@angular/aria 21.0.3 → 21.1.0-next.1
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 +743 -0
- package/_adev_assets/aria-combobox.json +603 -0
- package/_adev_assets/aria-grid.json +893 -0
- package/_adev_assets/aria-listbox.json +540 -0
- package/_adev_assets/aria-menu.json +1049 -0
- package/_adev_assets/aria-tabs.json +880 -0
- package/_adev_assets/aria-toolbar.json +545 -0
- package/_adev_assets/aria-tree.json +853 -0
- package/fesm2022/_widget-chunk.mjs +246 -4
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +4 -17
- 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 -96
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +201 -225
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox.mjs +161 -173
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +238 -256
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +932 -7
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +168 -182
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +3 -15
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +2 -4
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +3 -3
- package/types/_grid-chunk.d.ts +210 -3
- package/types/accordion.d.ts +49 -52
- package/types/combobox.d.ts +111 -25
- package/types/grid.d.ts +32 -37
- package/types/listbox.d.ts +5 -8
- package/types/menu.d.ts +113 -113
- package/types/private.d.ts +498 -10
- package/types/tabs.d.ts +84 -89
- package/types/toolbar.d.ts +66 -69
- package/types/tree.d.ts +103 -106
- package/fesm2022/_combobox-chunk.mjs +0 -425
- package/fesm2022/_combobox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-listbox-chunk.mjs +0 -522
- package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-popup-chunk.mjs +0 -46
- package/fesm2022/_combobox-popup-chunk.mjs.map +0 -1
- package/fesm2022/_list-navigation-chunk.mjs +0 -116
- package/fesm2022/_list-navigation-chunk.mjs.map +0 -1
- package/fesm2022/_pointer-event-manager-chunk.mjs +0 -134
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
- package/types/_combobox-chunk.d.ts +0 -98
- package/types/_combobox-chunk.d2.ts +0 -193
- package/types/_list-chunk.d.ts +0 -212
- package/types/_list-navigation-chunk.d.ts +0 -212
- package/types/_listbox-chunk.d.ts +0 -106
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,
|
|
2
|
+
import { inject, ElementRef, input, computed, booleanAttribute, effect, Directive, contentChildren, signal, output, afterRenderEffect, untracked, model } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/aria/private';
|
|
4
|
-
import { MenuTriggerPattern,
|
|
5
|
-
import { Directionality } from '@angular/cdk/bidi';
|
|
4
|
+
import { MenuTriggerPattern, DeferredContentAware, MenuPattern, MenuBarPattern, MenuItemPattern, DeferredContent } from '@angular/aria/private';
|
|
6
5
|
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
6
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
7
7
|
|
|
8
8
|
class MenuTrigger {
|
|
9
9
|
_elementRef = inject(ElementRef);
|
|
@@ -156,54 +156,87 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
156
156
|
}]
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
class Menu {
|
|
160
|
+
_deferredContentAware = inject(DeferredContentAware, {
|
|
161
|
+
optional: true
|
|
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
|
+
}] : []));
|
|
163
172
|
_elementRef = inject(ElementRef);
|
|
164
173
|
element = this._elementRef.nativeElement;
|
|
165
|
-
|
|
174
|
+
textDirection = inject(Directionality).valueSignal;
|
|
175
|
+
id = input(inject(_IdGenerator).getId('ng-menu-', true), ...(ngDevMode ? [{
|
|
166
176
|
debugName: "id"
|
|
167
177
|
}] : []));
|
|
168
|
-
|
|
169
|
-
debugName: "
|
|
178
|
+
wrap = input(true, ...(ngDevMode ? [{
|
|
179
|
+
debugName: "wrap",
|
|
180
|
+
transform: booleanAttribute
|
|
181
|
+
}] : [{
|
|
182
|
+
transform: booleanAttribute
|
|
183
|
+
}]));
|
|
184
|
+
typeaheadDelay = input(500, ...(ngDevMode ? [{
|
|
185
|
+
debugName: "typeaheadDelay"
|
|
170
186
|
}] : []));
|
|
171
187
|
disabled = input(false, ...(ngDevMode ? [{
|
|
172
|
-
debugName: "disabled"
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}]
|
|
177
|
-
parent =
|
|
178
|
-
|
|
179
|
-
});
|
|
180
|
-
submenu = input(undefined, ...(ngDevMode ? [{
|
|
181
|
-
debugName: "submenu"
|
|
188
|
+
debugName: "disabled",
|
|
189
|
+
transform: booleanAttribute
|
|
190
|
+
}] : [{
|
|
191
|
+
transform: booleanAttribute
|
|
192
|
+
}]));
|
|
193
|
+
parent = signal(undefined, ...(ngDevMode ? [{
|
|
194
|
+
debugName: "parent"
|
|
182
195
|
}] : []));
|
|
183
|
-
|
|
184
|
-
|
|
196
|
+
_pattern;
|
|
197
|
+
_itemPatterns = () => this._items().map(i => i._pattern);
|
|
198
|
+
visible = computed(() => this._pattern.visible(), ...(ngDevMode ? [{
|
|
199
|
+
debugName: "visible"
|
|
185
200
|
}] : []));
|
|
186
|
-
|
|
187
|
-
debugName: "
|
|
201
|
+
tabIndex = computed(() => this._pattern.tabIndex(), ...(ngDevMode ? [{
|
|
202
|
+
debugName: "tabIndex"
|
|
188
203
|
}] : []));
|
|
189
|
-
|
|
190
|
-
|
|
204
|
+
onSelect = output();
|
|
205
|
+
expansionDelay = input(100, ...(ngDevMode ? [{
|
|
206
|
+
debugName: "expansionDelay"
|
|
191
207
|
}] : []));
|
|
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
|
-
});
|
|
201
208
|
constructor() {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
209
|
+
this._pattern = new MenuPattern({
|
|
210
|
+
...this,
|
|
211
|
+
parent: computed(() => this.parent()?._pattern),
|
|
212
|
+
items: this._itemPatterns,
|
|
213
|
+
multi: () => false,
|
|
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._pattern.hasBeenHovered() && this._items().length) {
|
|
238
|
+
untracked(() => this._pattern.setDefaultState());
|
|
239
|
+
}
|
|
207
240
|
});
|
|
208
241
|
}
|
|
209
242
|
close() {
|
|
@@ -213,16 +246,16 @@ class MenuItem {
|
|
|
213
246
|
minVersion: "12.0.0",
|
|
214
247
|
version: "21.0.0",
|
|
215
248
|
ngImport: i0,
|
|
216
|
-
type:
|
|
249
|
+
type: Menu,
|
|
217
250
|
deps: [],
|
|
218
251
|
target: i0.ɵɵFactoryTarget.Directive
|
|
219
252
|
});
|
|
220
253
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
221
|
-
minVersion: "17.
|
|
254
|
+
minVersion: "17.2.0",
|
|
222
255
|
version: "21.0.0",
|
|
223
|
-
type:
|
|
256
|
+
type: Menu,
|
|
224
257
|
isStandalone: true,
|
|
225
|
-
selector: "[
|
|
258
|
+
selector: "[ngMenu]",
|
|
226
259
|
inputs: {
|
|
227
260
|
id: {
|
|
228
261
|
classPropertyName: "id",
|
|
@@ -231,55 +264,68 @@ class MenuItem {
|
|
|
231
264
|
isRequired: false,
|
|
232
265
|
transformFunction: null
|
|
233
266
|
},
|
|
234
|
-
|
|
235
|
-
classPropertyName: "
|
|
236
|
-
publicName: "
|
|
267
|
+
wrap: {
|
|
268
|
+
classPropertyName: "wrap",
|
|
269
|
+
publicName: "wrap",
|
|
237
270
|
isSignal: true,
|
|
238
|
-
isRequired:
|
|
271
|
+
isRequired: false,
|
|
239
272
|
transformFunction: null
|
|
240
273
|
},
|
|
241
|
-
|
|
242
|
-
classPropertyName: "
|
|
243
|
-
publicName: "
|
|
274
|
+
typeaheadDelay: {
|
|
275
|
+
classPropertyName: "typeaheadDelay",
|
|
276
|
+
publicName: "typeaheadDelay",
|
|
244
277
|
isSignal: true,
|
|
245
278
|
isRequired: false,
|
|
246
279
|
transformFunction: null
|
|
247
280
|
},
|
|
248
|
-
|
|
249
|
-
classPropertyName: "
|
|
250
|
-
publicName: "
|
|
281
|
+
disabled: {
|
|
282
|
+
classPropertyName: "disabled",
|
|
283
|
+
publicName: "disabled",
|
|
251
284
|
isSignal: true,
|
|
252
285
|
isRequired: false,
|
|
253
286
|
transformFunction: null
|
|
254
287
|
},
|
|
255
|
-
|
|
256
|
-
classPropertyName: "
|
|
257
|
-
publicName: "
|
|
288
|
+
expansionDelay: {
|
|
289
|
+
classPropertyName: "expansionDelay",
|
|
290
|
+
publicName: "expansionDelay",
|
|
258
291
|
isSignal: true,
|
|
259
292
|
isRequired: false,
|
|
260
293
|
transformFunction: null
|
|
261
294
|
}
|
|
262
295
|
},
|
|
263
296
|
outputs: {
|
|
264
|
-
|
|
297
|
+
onSelect: "onSelect"
|
|
265
298
|
},
|
|
266
299
|
host: {
|
|
267
300
|
attributes: {
|
|
268
|
-
"role": "
|
|
301
|
+
"role": "menu"
|
|
269
302
|
},
|
|
270
303
|
listeners: {
|
|
271
|
-
"
|
|
304
|
+
"keydown": "_pattern.onKeydown($event)",
|
|
305
|
+
"mouseover": "_pattern.onMouseOver($event)",
|
|
306
|
+
"mouseout": "_pattern.onMouseOut($event)",
|
|
307
|
+
"focusout": "_pattern.onFocusOut($event)",
|
|
308
|
+
"focusin": "_pattern.onFocusIn()",
|
|
309
|
+
"click": "_pattern.onClick($event)"
|
|
272
310
|
},
|
|
273
311
|
properties: {
|
|
274
|
-
"attr.
|
|
275
|
-
"attr.data-active": "active()",
|
|
276
|
-
"attr.aria-haspopup": "hasPopup()",
|
|
277
|
-
"attr.aria-expanded": "expanded()",
|
|
312
|
+
"attr.id": "_pattern.id()",
|
|
278
313
|
"attr.aria-disabled": "_pattern.disabled()",
|
|
279
|
-
"attr.
|
|
314
|
+
"attr.tabindex": "tabIndex()",
|
|
315
|
+
"attr.data-visible": "visible()"
|
|
280
316
|
}
|
|
281
317
|
},
|
|
282
|
-
|
|
318
|
+
queries: [{
|
|
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
|
+
}],
|
|
283
329
|
ngImport: i0
|
|
284
330
|
});
|
|
285
331
|
}
|
|
@@ -287,26 +333,42 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
287
333
|
minVersion: "12.0.0",
|
|
288
334
|
version: "21.0.0",
|
|
289
335
|
ngImport: i0,
|
|
290
|
-
type:
|
|
336
|
+
type: Menu,
|
|
291
337
|
decorators: [{
|
|
292
338
|
type: Directive,
|
|
293
339
|
args: [{
|
|
294
|
-
selector: '[
|
|
295
|
-
exportAs: '
|
|
340
|
+
selector: '[ngMenu]',
|
|
341
|
+
exportAs: 'ngMenu',
|
|
296
342
|
host: {
|
|
297
|
-
'role': '
|
|
298
|
-
'
|
|
299
|
-
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
300
|
-
'[attr.data-active]': 'active()',
|
|
301
|
-
'[attr.aria-haspopup]': 'hasPopup()',
|
|
302
|
-
'[attr.aria-expanded]': 'expanded()',
|
|
343
|
+
'role': 'menu',
|
|
344
|
+
'[attr.id]': '_pattern.id()',
|
|
303
345
|
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
304
|
-
'[attr.
|
|
305
|
-
|
|
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)',
|
|
352
|
+
'(focusin)': '_pattern.onFocusIn()',
|
|
353
|
+
'(click)': '_pattern.onClick($event)'
|
|
354
|
+
},
|
|
355
|
+
hostDirectives: [{
|
|
356
|
+
directive: DeferredContentAware,
|
|
357
|
+
inputs: ['preserveContent']
|
|
358
|
+
}]
|
|
306
359
|
}]
|
|
307
360
|
}],
|
|
308
361
|
ctorParameters: () => [],
|
|
309
362
|
propDecorators: {
|
|
363
|
+
_allItems: [{
|
|
364
|
+
type: i0.ContentChildren,
|
|
365
|
+
args: [i0.forwardRef(() => MenuItem), {
|
|
366
|
+
...{
|
|
367
|
+
descendants: true
|
|
368
|
+
},
|
|
369
|
+
isSignal: true
|
|
370
|
+
}]
|
|
371
|
+
}],
|
|
310
372
|
id: [{
|
|
311
373
|
type: i0.Input,
|
|
312
374
|
args: [{
|
|
@@ -315,44 +377,44 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
315
377
|
required: false
|
|
316
378
|
}]
|
|
317
379
|
}],
|
|
318
|
-
|
|
380
|
+
wrap: [{
|
|
319
381
|
type: i0.Input,
|
|
320
382
|
args: [{
|
|
321
383
|
isSignal: true,
|
|
322
|
-
alias: "
|
|
323
|
-
required:
|
|
384
|
+
alias: "wrap",
|
|
385
|
+
required: false
|
|
324
386
|
}]
|
|
325
387
|
}],
|
|
326
|
-
|
|
388
|
+
typeaheadDelay: [{
|
|
327
389
|
type: i0.Input,
|
|
328
390
|
args: [{
|
|
329
391
|
isSignal: true,
|
|
330
|
-
alias: "
|
|
392
|
+
alias: "typeaheadDelay",
|
|
331
393
|
required: false
|
|
332
394
|
}]
|
|
333
395
|
}],
|
|
334
|
-
|
|
396
|
+
disabled: [{
|
|
335
397
|
type: i0.Input,
|
|
336
398
|
args: [{
|
|
337
399
|
isSignal: true,
|
|
338
|
-
alias: "
|
|
400
|
+
alias: "disabled",
|
|
339
401
|
required: false
|
|
340
402
|
}]
|
|
341
|
-
},
|
|
403
|
+
}],
|
|
404
|
+
onSelect: [{
|
|
342
405
|
type: i0.Output,
|
|
343
|
-
args: ["
|
|
406
|
+
args: ["onSelect"]
|
|
344
407
|
}],
|
|
345
|
-
|
|
408
|
+
expansionDelay: [{
|
|
346
409
|
type: i0.Input,
|
|
347
410
|
args: [{
|
|
348
411
|
isSignal: true,
|
|
349
|
-
alias: "
|
|
412
|
+
alias: "expansionDelay",
|
|
350
413
|
required: false
|
|
351
414
|
}]
|
|
352
415
|
}]
|
|
353
416
|
}
|
|
354
417
|
});
|
|
355
|
-
|
|
356
418
|
class MenuBar {
|
|
357
419
|
_allItems = contentChildren(MenuItem, ...(ngDevMode ? [{
|
|
358
420
|
debugName: "_allItems",
|
|
@@ -490,10 +552,6 @@ class MenuBar {
|
|
|
490
552
|
"attr.tabindex": "_pattern.tabIndex()"
|
|
491
553
|
}
|
|
492
554
|
},
|
|
493
|
-
providers: [{
|
|
494
|
-
provide: MENU_COMPONENT,
|
|
495
|
-
useExisting: MenuBar
|
|
496
|
-
}],
|
|
497
555
|
queries: [{
|
|
498
556
|
propertyName: "_allItems",
|
|
499
557
|
predicate: MenuItem,
|
|
@@ -524,11 +582,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
524
582
|
'(click)': '_pattern.onClick($event)',
|
|
525
583
|
'(focusin)': '_pattern.onFocusIn()',
|
|
526
584
|
'(focusout)': '_pattern.onFocusOut($event)'
|
|
527
|
-
}
|
|
528
|
-
providers: [{
|
|
529
|
-
provide: MENU_COMPONENT,
|
|
530
|
-
useExisting: MenuBar
|
|
531
|
-
}]
|
|
585
|
+
}
|
|
532
586
|
}]
|
|
533
587
|
}],
|
|
534
588
|
ctorParameters: () => [],
|
|
@@ -591,88 +645,55 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
591
645
|
}]
|
|
592
646
|
}
|
|
593
647
|
});
|
|
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
|
-
}] : []));
|
|
648
|
+
class MenuItem {
|
|
608
649
|
_elementRef = inject(ElementRef);
|
|
609
650
|
element = this._elementRef.nativeElement;
|
|
610
|
-
|
|
611
|
-
id = input(inject(_IdGenerator).getId('ng-menu-', true), ...(ngDevMode ? [{
|
|
651
|
+
id = input(inject(_IdGenerator).getId('ng-menu-item-', true), ...(ngDevMode ? [{
|
|
612
652
|
debugName: "id"
|
|
613
653
|
}] : []));
|
|
614
|
-
|
|
615
|
-
debugName: "
|
|
616
|
-
transform: booleanAttribute
|
|
617
|
-
}] : [{
|
|
618
|
-
transform: booleanAttribute
|
|
619
|
-
}]));
|
|
620
|
-
typeaheadDelay = input(500, ...(ngDevMode ? [{
|
|
621
|
-
debugName: "typeaheadDelay"
|
|
654
|
+
value = input.required(...(ngDevMode ? [{
|
|
655
|
+
debugName: "value"
|
|
622
656
|
}] : []));
|
|
623
657
|
disabled = input(false, ...(ngDevMode ? [{
|
|
624
|
-
debugName: "disabled"
|
|
625
|
-
transform: booleanAttribute
|
|
626
|
-
}] : [{
|
|
627
|
-
transform: booleanAttribute
|
|
628
|
-
}]));
|
|
629
|
-
parent = signal(undefined, ...(ngDevMode ? [{
|
|
630
|
-
debugName: "parent"
|
|
658
|
+
debugName: "disabled"
|
|
631
659
|
}] : []));
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
visible = computed(() => this._pattern.visible(), ...(ngDevMode ? [{
|
|
635
|
-
debugName: "visible"
|
|
660
|
+
searchTerm = model('', ...(ngDevMode ? [{
|
|
661
|
+
debugName: "searchTerm"
|
|
636
662
|
}] : []));
|
|
637
|
-
|
|
638
|
-
|
|
663
|
+
_menu = inject(Menu, {
|
|
664
|
+
optional: true
|
|
665
|
+
});
|
|
666
|
+
_menuBar = inject(MenuBar, {
|
|
667
|
+
optional: true
|
|
668
|
+
});
|
|
669
|
+
parent = this._menu ?? this._menuBar;
|
|
670
|
+
submenu = input(undefined, ...(ngDevMode ? [{
|
|
671
|
+
debugName: "submenu"
|
|
639
672
|
}] : []));
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
673
|
+
active = computed(() => this._pattern.active(), ...(ngDevMode ? [{
|
|
674
|
+
debugName: "active"
|
|
675
|
+
}] : []));
|
|
676
|
+
expanded = computed(() => this._pattern.expanded(), ...(ngDevMode ? [{
|
|
677
|
+
debugName: "expanded"
|
|
678
|
+
}] : []));
|
|
679
|
+
hasPopup = computed(() => this._pattern.hasPopup(), ...(ngDevMode ? [{
|
|
680
|
+
debugName: "hasPopup"
|
|
643
681
|
}] : []));
|
|
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
|
+
});
|
|
644
691
|
constructor() {
|
|
645
|
-
this.
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
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
|
-
}
|
|
692
|
+
effect(() => this.submenu()?.parent.set(this));
|
|
693
|
+
}
|
|
694
|
+
open() {
|
|
695
|
+
this._pattern.open({
|
|
696
|
+
first: true
|
|
676
697
|
});
|
|
677
698
|
}
|
|
678
699
|
close() {
|
|
@@ -682,16 +703,16 @@ class Menu {
|
|
|
682
703
|
minVersion: "12.0.0",
|
|
683
704
|
version: "21.0.0",
|
|
684
705
|
ngImport: i0,
|
|
685
|
-
type:
|
|
706
|
+
type: MenuItem,
|
|
686
707
|
deps: [],
|
|
687
708
|
target: i0.ɵɵFactoryTarget.Directive
|
|
688
709
|
});
|
|
689
710
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
690
|
-
minVersion: "17.
|
|
711
|
+
minVersion: "17.1.0",
|
|
691
712
|
version: "21.0.0",
|
|
692
|
-
type:
|
|
713
|
+
type: MenuItem,
|
|
693
714
|
isStandalone: true,
|
|
694
|
-
selector: "[
|
|
715
|
+
selector: "[ngMenuItem]",
|
|
695
716
|
inputs: {
|
|
696
717
|
id: {
|
|
697
718
|
classPropertyName: "id",
|
|
@@ -700,72 +721,55 @@ class Menu {
|
|
|
700
721
|
isRequired: false,
|
|
701
722
|
transformFunction: null
|
|
702
723
|
},
|
|
703
|
-
|
|
704
|
-
classPropertyName: "
|
|
705
|
-
publicName: "
|
|
724
|
+
value: {
|
|
725
|
+
classPropertyName: "value",
|
|
726
|
+
publicName: "value",
|
|
706
727
|
isSignal: true,
|
|
707
|
-
isRequired:
|
|
728
|
+
isRequired: true,
|
|
708
729
|
transformFunction: null
|
|
709
730
|
},
|
|
710
|
-
|
|
711
|
-
classPropertyName: "
|
|
712
|
-
publicName: "
|
|
731
|
+
disabled: {
|
|
732
|
+
classPropertyName: "disabled",
|
|
733
|
+
publicName: "disabled",
|
|
713
734
|
isSignal: true,
|
|
714
735
|
isRequired: false,
|
|
715
736
|
transformFunction: null
|
|
716
737
|
},
|
|
717
|
-
|
|
718
|
-
classPropertyName: "
|
|
719
|
-
publicName: "
|
|
738
|
+
searchTerm: {
|
|
739
|
+
classPropertyName: "searchTerm",
|
|
740
|
+
publicName: "searchTerm",
|
|
720
741
|
isSignal: true,
|
|
721
742
|
isRequired: false,
|
|
722
743
|
transformFunction: null
|
|
723
744
|
},
|
|
724
|
-
|
|
725
|
-
classPropertyName: "
|
|
726
|
-
publicName: "
|
|
745
|
+
submenu: {
|
|
746
|
+
classPropertyName: "submenu",
|
|
747
|
+
publicName: "submenu",
|
|
727
748
|
isSignal: true,
|
|
728
749
|
isRequired: false,
|
|
729
750
|
transformFunction: null
|
|
730
751
|
}
|
|
731
752
|
},
|
|
732
753
|
outputs: {
|
|
733
|
-
|
|
754
|
+
searchTerm: "searchTermChange"
|
|
734
755
|
},
|
|
735
756
|
host: {
|
|
736
757
|
attributes: {
|
|
737
|
-
"role": "
|
|
758
|
+
"role": "menuitem"
|
|
738
759
|
},
|
|
739
760
|
listeners: {
|
|
740
|
-
"
|
|
741
|
-
"mouseover": "_pattern.onMouseOver($event)",
|
|
742
|
-
"mouseout": "_pattern.onMouseOut($event)",
|
|
743
|
-
"focusout": "_pattern.onFocusOut($event)",
|
|
744
|
-
"focusin": "_pattern.onFocusIn()",
|
|
745
|
-
"click": "_pattern.onClick($event)"
|
|
761
|
+
"focusin": "_pattern.onFocusIn()"
|
|
746
762
|
},
|
|
747
763
|
properties: {
|
|
748
|
-
"attr.
|
|
764
|
+
"attr.tabindex": "_pattern.tabIndex()",
|
|
765
|
+
"attr.data-active": "active()",
|
|
766
|
+
"attr.aria-haspopup": "hasPopup()",
|
|
767
|
+
"attr.aria-expanded": "expanded()",
|
|
749
768
|
"attr.aria-disabled": "_pattern.disabled()",
|
|
750
|
-
"attr.
|
|
751
|
-
"attr.data-visible": "visible()"
|
|
769
|
+
"attr.aria-controls": "_pattern.submenu()?.id()"
|
|
752
770
|
}
|
|
753
771
|
},
|
|
754
|
-
|
|
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
|
-
}],
|
|
772
|
+
exportAs: ["ngMenuItem"],
|
|
769
773
|
ngImport: i0
|
|
770
774
|
});
|
|
771
775
|
}
|
|
@@ -773,46 +777,26 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
773
777
|
minVersion: "12.0.0",
|
|
774
778
|
version: "21.0.0",
|
|
775
779
|
ngImport: i0,
|
|
776
|
-
type:
|
|
780
|
+
type: MenuItem,
|
|
777
781
|
decorators: [{
|
|
778
782
|
type: Directive,
|
|
779
783
|
args: [{
|
|
780
|
-
selector: '[
|
|
781
|
-
exportAs: '
|
|
784
|
+
selector: '[ngMenuItem]',
|
|
785
|
+
exportAs: 'ngMenuItem',
|
|
782
786
|
host: {
|
|
783
|
-
'role': '
|
|
784
|
-
'[attr.id]': '_pattern.id()',
|
|
785
|
-
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
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)',
|
|
787
|
+
'role': 'menuitem',
|
|
792
788
|
'(focusin)': '_pattern.onFocusIn()',
|
|
793
|
-
'
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
provide: MENU_COMPONENT,
|
|
801
|
-
useExisting: Menu
|
|
802
|
-
}]
|
|
789
|
+
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
790
|
+
'[attr.data-active]': 'active()',
|
|
791
|
+
'[attr.aria-haspopup]': 'hasPopup()',
|
|
792
|
+
'[attr.aria-expanded]': 'expanded()',
|
|
793
|
+
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
794
|
+
'[attr.aria-controls]': '_pattern.submenu()?.id()'
|
|
795
|
+
}
|
|
803
796
|
}]
|
|
804
797
|
}],
|
|
805
798
|
ctorParameters: () => [],
|
|
806
799
|
propDecorators: {
|
|
807
|
-
_allItems: [{
|
|
808
|
-
type: i0.ContentChildren,
|
|
809
|
-
args: [i0.forwardRef(() => MenuItem), {
|
|
810
|
-
...{
|
|
811
|
-
descendants: true
|
|
812
|
-
},
|
|
813
|
-
isSignal: true
|
|
814
|
-
}]
|
|
815
|
-
}],
|
|
816
800
|
id: [{
|
|
817
801
|
type: i0.Input,
|
|
818
802
|
args: [{
|
|
@@ -821,45 +805,43 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
821
805
|
required: false
|
|
822
806
|
}]
|
|
823
807
|
}],
|
|
824
|
-
|
|
808
|
+
value: [{
|
|
825
809
|
type: i0.Input,
|
|
826
810
|
args: [{
|
|
827
811
|
isSignal: true,
|
|
828
|
-
alias: "
|
|
829
|
-
required:
|
|
812
|
+
alias: "value",
|
|
813
|
+
required: true
|
|
830
814
|
}]
|
|
831
815
|
}],
|
|
832
|
-
|
|
816
|
+
disabled: [{
|
|
833
817
|
type: i0.Input,
|
|
834
818
|
args: [{
|
|
835
819
|
isSignal: true,
|
|
836
|
-
alias: "
|
|
820
|
+
alias: "disabled",
|
|
837
821
|
required: false
|
|
838
822
|
}]
|
|
839
823
|
}],
|
|
840
|
-
|
|
824
|
+
searchTerm: [{
|
|
841
825
|
type: i0.Input,
|
|
842
826
|
args: [{
|
|
843
827
|
isSignal: true,
|
|
844
|
-
alias: "
|
|
828
|
+
alias: "searchTerm",
|
|
845
829
|
required: false
|
|
846
830
|
}]
|
|
847
|
-
}
|
|
848
|
-
onSelect: [{
|
|
831
|
+
}, {
|
|
849
832
|
type: i0.Output,
|
|
850
|
-
args: ["
|
|
833
|
+
args: ["searchTermChange"]
|
|
851
834
|
}],
|
|
852
|
-
|
|
835
|
+
submenu: [{
|
|
853
836
|
type: i0.Input,
|
|
854
837
|
args: [{
|
|
855
838
|
isSignal: true,
|
|
856
|
-
alias: "
|
|
839
|
+
alias: "submenu",
|
|
857
840
|
required: false
|
|
858
841
|
}]
|
|
859
842
|
}]
|
|
860
843
|
}
|
|
861
844
|
});
|
|
862
|
-
|
|
863
845
|
class MenuContent {
|
|
864
846
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
865
847
|
minVersion: "12.0.0",
|