@angular/aria 21.0.1 → 21.0.3
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 +17 -4
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +96 -120
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +225 -201
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox.mjs +173 -161
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +256 -238
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +9 -932
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +182 -168
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +15 -3
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +4 -2
- 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);
|
|
@@ -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() {
|
|
@@ -246,16 +213,16 @@ class Menu {
|
|
|
246
213
|
minVersion: "12.0.0",
|
|
247
214
|
version: "21.0.0",
|
|
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.
|
|
221
|
+
minVersion: "17.1.0",
|
|
255
222
|
version: "21.0.0",
|
|
256
|
-
type:
|
|
223
|
+
type: MenuItem,
|
|
257
224
|
isStandalone: true,
|
|
258
|
-
selector: "[
|
|
225
|
+
selector: "[ngMenuItem]",
|
|
259
226
|
inputs: {
|
|
260
227
|
id: {
|
|
261
228
|
classPropertyName: "id",
|
|
@@ -264,68 +231,55 @@ 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
|
}
|
|
@@ -333,42 +287,26 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
333
287
|
minVersion: "12.0.0",
|
|
334
288
|
version: "21.0.0",
|
|
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,44 +315,44 @@ 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
357
|
_allItems = contentChildren(MenuItem, ...(ngDevMode ? [{
|
|
420
358
|
debugName: "_allItems",
|
|
@@ -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,
|
|
@@ -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, ...(ngDevMode ? [{
|
|
600
|
+
debugName: "_allItems",
|
|
601
|
+
descendants: true
|
|
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
|
-
debugName: "
|
|
614
|
+
wrap = input(true, ...(ngDevMode ? [{
|
|
615
|
+
debugName: "wrap",
|
|
616
|
+
transform: booleanAttribute
|
|
617
|
+
}] : [{
|
|
618
|
+
transform: booleanAttribute
|
|
619
|
+
}]));
|
|
620
|
+
typeaheadDelay = input(500, ...(ngDevMode ? [{
|
|
621
|
+
debugName: "typeaheadDelay"
|
|
656
622
|
}] : []));
|
|
657
623
|
disabled = input(false, ...(ngDevMode ? [{
|
|
658
|
-
debugName: "disabled"
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
}]
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
});
|
|
666
|
-
_menuBar = inject(MenuBar, {
|
|
667
|
-
optional: true
|
|
668
|
-
});
|
|
669
|
-
parent = this._menu ?? this._menuBar;
|
|
670
|
-
submenu = input(undefined, ...(ngDevMode ? [{
|
|
671
|
-
debugName: "submenu"
|
|
624
|
+
debugName: "disabled",
|
|
625
|
+
transform: booleanAttribute
|
|
626
|
+
}] : [{
|
|
627
|
+
transform: booleanAttribute
|
|
628
|
+
}]));
|
|
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() {
|
|
@@ -703,16 +682,16 @@ class MenuItem {
|
|
|
703
682
|
minVersion: "12.0.0",
|
|
704
683
|
version: "21.0.0",
|
|
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.
|
|
690
|
+
minVersion: "17.2.0",
|
|
712
691
|
version: "21.0.0",
|
|
713
|
-
type:
|
|
692
|
+
type: Menu,
|
|
714
693
|
isStandalone: true,
|
|
715
|
-
selector: "[
|
|
694
|
+
selector: "[ngMenu]",
|
|
716
695
|
inputs: {
|
|
717
696
|
id: {
|
|
718
697
|
classPropertyName: "id",
|
|
@@ -721,55 +700,72 @@ 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
|
}
|
|
@@ -777,26 +773,46 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
777
773
|
minVersion: "12.0.0",
|
|
778
774
|
version: "21.0.0",
|
|
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,43 +821,45 @@ 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",
|