@eui/ecl 22.0.0-alpha.45 → 22.0.0-alpha.47
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/docs/changelog.html +60 -0
- package/docs/components/EclMenuItemComponent.html +203 -161
- package/docs/components/EclMenuMegaItemComponent.html +3 -3
- package/docs/interfaces/EclMenuItem.html +4 -4
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/documentation.json +152 -124
- package/docs/llms.txt +13 -7
- package/docs/properties.html +1 -1
- package/fesm2022/eui-ecl-components-ecl-accordion.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-add-to-calendar.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-animated-numbers.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-app.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-banner.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-blockquote.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-breadcrumb.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-button.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-card.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-carousel.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-category-filter.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-checkbox.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-content-block.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-content-item.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-date-block.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-date-picker.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-divider.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-expandable.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-fact-figures.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-featured.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-feedback-message.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-file-upload.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-file.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-form-group.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-form-label.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-gallery.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-help-block.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-highlight-box.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-highlighted-search.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-icon.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-inpage-navigation.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-label.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-layout-wrapper.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-link.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-list-illustration.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-list.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-loading-indicator.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-media-container.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-mega-menu.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-menu.mjs +67 -49
- package/fesm2022/eui-ecl-components-ecl-menu.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-modal.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-multiselect.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-navigation-list.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-news-ticker.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-notification.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-page-header.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-page-information.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-page-summary.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-pagination.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-popover.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-quiz.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-radio.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-range.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-rating-field.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-search-form.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-select.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-footer.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-header.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-slogan-ticker.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-social-media-follow.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-splash-page.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-spotlight.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-sticky-container.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-story-card.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-table.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-tabs.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-tag.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-text-area.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-text-input.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-text-media.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-timeline.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-tooltip.mjs.map +1 -1
- package/fesm2022/eui-ecl-core.mjs.map +1 -1
- package/fesm2022/eui-ecl-shared.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eui-ecl-components-ecl-accordion.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-add-to-calendar.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-animated-numbers.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-app.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-banner.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-blockquote.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-breadcrumb.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-button.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-card.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-carousel.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-category-filter.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-checkbox.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-content-block.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-content-item.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-date-block.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-date-picker.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-divider.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-expandable.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-fact-figures.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-featured.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-feedback-message.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-file-upload.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-file.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-form-group.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-form-label.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-gallery.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-help-block.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-highlight-box.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-highlighted-search.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-icon.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-inpage-navigation.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-label.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-layout-wrapper.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-link.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-list-illustration.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-list.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-loading-indicator.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-media-container.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-mega-menu.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-menu.d.ts +16 -11
- package/types/eui-ecl-components-ecl-menu.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-modal.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-multiselect.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-navigation-list.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-news-ticker.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-notification.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-page-header.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-page-information.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-page-summary.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-pagination.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-popover.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-quiz.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-radio.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-range.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-rating-field.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-search-form.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-select.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-site-footer.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-site-header.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-slogan-ticker.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-social-media-follow.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-splash-page.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-spotlight.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-sticky-container.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-story-card.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-table.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-tabs.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-tag.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-text-area.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-text-input.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-text-media.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-timeline.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-tooltip.d.ts.map +1 -1
- package/types/eui-ecl-core.d.ts.map +1 -1
- package/types/eui-ecl-shared.d.ts.map +1 -1
|
@@ -96,10 +96,12 @@ class EclMenuMegaItemComponent extends ECLBaseDirective {
|
|
|
96
96
|
...(ngDevMode ? [{ debugName: "linkExtraAttributes" }] : /* istanbul ignore next */ []));
|
|
97
97
|
this.menuItemSelect = output();
|
|
98
98
|
this.menuItemKeydown = output();
|
|
99
|
-
this.hasChildren = false
|
|
99
|
+
this.hasChildren = signal(false, /* @ts-ignore */
|
|
100
|
+
...(ngDevMode ? [{ debugName: "hasChildren" }] : /* istanbul ignore next */ []));
|
|
100
101
|
this.isExpanded = signal(true, /* @ts-ignore */
|
|
101
102
|
...(ngDevMode ? [{ debugName: "isExpanded" }] : /* istanbul ignore next */ []));
|
|
102
|
-
this.children = []
|
|
103
|
+
this.children = signal([], /* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [{ debugName: "children" }] : /* istanbul ignore next */ []));
|
|
103
105
|
/**
|
|
104
106
|
* The actual link of the menu item.
|
|
105
107
|
*/
|
|
@@ -411,7 +413,7 @@ class EclMenuItemComponent extends ECLBaseDirective {
|
|
|
411
413
|
/**
|
|
412
414
|
* Set to 'true', when item has more than 13 chidren and the overlay needs to use the full available space.
|
|
413
415
|
*/
|
|
414
|
-
this.isFull = computed(() => this.hasChildren && this.submenu().eclMenuMegaItems().length >= 13 /* ColTrigger.COL3_TRIGGER */, /* @ts-ignore */
|
|
416
|
+
this.isFull = computed(() => this.hasChildren() && this.submenu().eclMenuMegaItems().length >= 13 /* ColTrigger.COL3_TRIGGER */, /* @ts-ignore */
|
|
415
417
|
...(ngDevMode ? [{ debugName: "isFull" }] : /* istanbul ignore next */ []));
|
|
416
418
|
/**
|
|
417
419
|
* The default role of the item is 'listitem' and should not be changed.
|
|
@@ -440,38 +442,32 @@ class EclMenuItemComponent extends ECLBaseDirective {
|
|
|
440
442
|
this.destroy$ = new Subject();
|
|
441
443
|
this.renderer = inject(Renderer2);
|
|
442
444
|
this.appShell = inject(EuiAppShellService);
|
|
445
|
+
this.hasEclChildrenDataAttribute = computed(() => this.hasChildren() || undefined, /* @ts-ignore */
|
|
446
|
+
...(ngDevMode ? [{ debugName: "hasEclChildrenDataAttribute" }] : /* istanbul ignore next */ []));
|
|
447
|
+
this.isDataExpanded = computed(() => this.hasChildren() ? this.isHovered() : null, /* @ts-ignore */
|
|
448
|
+
...(ngDevMode ? [{ debugName: "isDataExpanded" }] : /* istanbul ignore next */ []));
|
|
449
|
+
/**
|
|
450
|
+
* 'aria-current' is set to 'page' only when this item itself is the current page, and not when it is
|
|
451
|
+
* marked current merely because one of its children is the active item (in that case the child link
|
|
452
|
+
* carries 'aria-current="page"'). Derived from live state so it stays correct whether 'isCurrent' is set
|
|
453
|
+
* at render time or updated on selection.
|
|
454
|
+
*/
|
|
455
|
+
this.ariaCurrent = computed(() => this.isCurrent() && !this.hasCurrentChild() ? 'page' : null, /* @ts-ignore */
|
|
456
|
+
...(ngDevMode ? [{ debugName: "ariaCurrent" }] : /* istanbul ignore next */ []));
|
|
457
|
+
/**
|
|
458
|
+
* Whether any child (sub-item) is the current item.
|
|
459
|
+
*/
|
|
460
|
+
this.hasCurrentChild = computed(() => this.children().some((child) => child.isCurrent()), /* @ts-ignore */
|
|
461
|
+
...(ngDevMode ? [{ debugName: "hasCurrentChild" }] : /* istanbul ignore next */ []));
|
|
462
|
+
this.hasChildren = computed(() => !!this.submenu(), /* @ts-ignore */
|
|
463
|
+
...(ngDevMode ? [{ debugName: "hasChildren" }] : /* istanbul ignore next */ []));
|
|
464
|
+
this.children = computed(() => this.hasChildren() ? this.submenu().eclMenuMegaItems() : [], /* @ts-ignore */
|
|
465
|
+
...(ngDevMode ? [{ debugName: "children" }] : /* istanbul ignore next */ []));
|
|
443
466
|
afterNextRender(() => {
|
|
444
467
|
this.observeBreakpointChanges();
|
|
445
468
|
this.setExtraAttributesForLink(this.menuLink()?.nativeElement, this.linkExtraAttributes());
|
|
446
469
|
});
|
|
447
470
|
}
|
|
448
|
-
get hasEclChildrenDataAttribute() {
|
|
449
|
-
return this.hasChildren || undefined;
|
|
450
|
-
}
|
|
451
|
-
get isDataExpanded() {
|
|
452
|
-
return this.hasChildren ? this.isHovered() : null;
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* 'aria-current' is set to 'page' only when this item itself is the current page, and not when it is
|
|
456
|
-
* marked current merely because one of its children is the active item (in that case the child link
|
|
457
|
-
* carries 'aria-current="page"'). Derived from live state so it stays correct whether 'isCurrent' is set
|
|
458
|
-
* at render time or updated on selection.
|
|
459
|
-
*/
|
|
460
|
-
get ariaCurrent() {
|
|
461
|
-
return this.isCurrent() && !this.hasCurrentChild ? 'page' : null;
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* Whether any child (sub-item) is the current item.
|
|
465
|
-
*/
|
|
466
|
-
get hasCurrentChild() {
|
|
467
|
-
return this.children.some((child) => child.isCurrent());
|
|
468
|
-
}
|
|
469
|
-
get hasChildren() {
|
|
470
|
-
return !!this.submenu();
|
|
471
|
-
}
|
|
472
|
-
get children() {
|
|
473
|
-
return this.hasChildren ? this.submenu().eclMenuMegaItems() : [];
|
|
474
|
-
}
|
|
475
471
|
ngAfterContentInit() {
|
|
476
472
|
// Subscibe to submenu component events.
|
|
477
473
|
const submenu = this.submenu();
|
|
@@ -518,10 +514,17 @@ class EclMenuItemComponent extends ECLBaseDirective {
|
|
|
518
514
|
}
|
|
519
515
|
}
|
|
520
516
|
/**
|
|
521
|
-
* When clicking the caret button, to expand item's children.
|
|
517
|
+
* When clicking the caret button, to expand/collapse item's children.
|
|
518
|
+
* Used on both desktop (click-to-open/close affordance) and mobile view.
|
|
519
|
+
*
|
|
520
|
+
* The caret is a toggle control, not a navigation control: prevent its default
|
|
521
|
+
* action and stop propagation so that, when the item also has an href/routerLink,
|
|
522
|
+
* clicking the caret toggles the submenu instead of navigating the link.
|
|
522
523
|
* @param evt
|
|
523
524
|
*/
|
|
524
525
|
onItemCaretClick(evt) {
|
|
526
|
+
evt.preventDefault();
|
|
527
|
+
evt.stopPropagation();
|
|
525
528
|
this.menuItemCaret.emit(new EclMenuItemCaretEvent(this, evt));
|
|
526
529
|
}
|
|
527
530
|
/**
|
|
@@ -586,7 +589,10 @@ class EclMenuItemComponent extends ECLBaseDirective {
|
|
|
586
589
|
this.menuItemKeydown.emit(new EclMenuItemKeydownEvent(this, evt));
|
|
587
590
|
break;
|
|
588
591
|
}
|
|
589
|
-
case KeyCode.ENTER:
|
|
592
|
+
case KeyCode.ENTER:
|
|
593
|
+
case KeyCode.SPACE: {
|
|
594
|
+
// Space must behave like Enter: activate the caret/submenu toggle.
|
|
595
|
+
// preventDefault stops the page from scrolling on Space.
|
|
590
596
|
evt.preventDefault();
|
|
591
597
|
this.menuItemKeydown.emit(new EclMenuItemKeydownEvent(this, evt));
|
|
592
598
|
break;
|
|
@@ -725,7 +731,7 @@ class EclMenuItemComponent extends ECLBaseDirective {
|
|
|
725
731
|
this.renderer.removeStyle(currentLink, 'white-space');
|
|
726
732
|
}
|
|
727
733
|
getClassDependingChildrenCnt() {
|
|
728
|
-
if (this.hasChildren) {
|
|
734
|
+
if (this.hasChildren()) {
|
|
729
735
|
if (this.submenu().eclMenuMegaItems().length < 5 /* ColTrigger.COL1_TRIGGER */) {
|
|
730
736
|
return 'ecl-menu__item--col1';
|
|
731
737
|
}
|
|
@@ -763,19 +769,19 @@ class EclMenuItemComponent extends ECLBaseDirective {
|
|
|
763
769
|
});
|
|
764
770
|
}
|
|
765
771
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EclMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
766
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: EclMenuItemComponent, isStandalone: true, selector: "ecl-menu-item", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, toggleAriaLabel: { classPropertyName: "toggleAriaLabel", publicName: "toggleAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, queryParamsHandling: { classPropertyName: "queryParamsHandling", publicName: "queryParamsHandling", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, isCurrentInput: { classPropertyName: "isCurrentInput", publicName: "isCurrent", isSignal: true, isRequired: false, transformFunction: null }, linkExtraAttributes: { classPropertyName: "linkExtraAttributes", publicName: "linkExtraAttributes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuItemSelect: "menuItemSelect", menuItemCaret: "menuItemCaret", menuItemHover: "menuItemHover", menuItemHoverOut: "menuItemHoverOut", menuMegaItemSelect: "menuMegaItemSelect", menuItemFocus: "menuItemFocus", menuItemKeydown: "menuItemKeydown", menuMegaLastItemTab: "menuMegaLastItemTab" }, host: { attributes: { "role": "listitem" }, listeners: { "mouseenter": "onItemMouseEnter($event)", "mouseleave": "onItemMouseLeave($event)" }, properties: { "class": "cssClasses()", "class.ecl-menu__item--has-children": "hasEclChildrenDataAttribute", "attr.aria-haspopup": "hasEclChildrenDataAttribute", "attr.data-expanded": "isDataExpanded" } }, queries: [{ propertyName: "submenu", first: true, predicate: i0.forwardRef(() => EclMenuMegaComponent), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "menuLink", first: true, predicate: ["menuLink"], descendants: true, isSignal: true }, { propertyName: "menuButton", first: true, predicate: EclButtonComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (href()) {\n <a eclLink\n #menuLink\n variant=\"standalone\"\n [href]=\"href()\"\n [target]=\"target()\"\n class=\"ecl-menu__link\"\n [class.ecl-menu__link--current]=\"isCurrent()\"\n [attr.aria-current]=\"ariaCurrent\"\n (focus)=\"onItemFocus($event)\"\n (click)=\"onItemClick($event)\"\n (keydown)=\"onLinkKeydown($event)\">\n {{ label() }}\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </a>\n} @else {\n <a eclLink\n #menuLink\n variant=\"standalone\"\n [attr.tabindex]=\"tabindex || 0\"\n [routerLink]=\"routerLink()\"\n [queryParams]=\"queryParams()\"\n [queryParamsHandling]=\"queryParamsHandling()\"\n class=\"ecl-menu__link\"\n [class.ecl-menu__link--current]=\"isCurrent()\"\n [attr.aria-current]=\"ariaCurrent\"\n (focus)=\"onItemFocus($event)\"\n (click)=\"onItemClick($event)\"\n (keydown)=\"onLinkKeydown($event)\">\n {{ label() }}\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </a>\n}\n\n@if (hasChildren) {\n @if (isMobileBreakpoint()) {\n <button\n eclButton\n variant=\"tertiary\"\n class=\"ecl-menu__button-caret ecl-button--neutral\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel() || 'Access item children'\"\n (click)=\"onItemCaretClick($event)\"\n (keydown)=\"onButtonKeydown($event)\">\n <ecl-icon icon=\"corner-arrow\" size=\"m\" transform=\"rotate-180\" class=\"ecl-button__icon\"></ecl-icon>\n </button>\n } @else {\n <button\n eclButton\n variant=\"tertiary\"\n class=\"ecl-menu__button-caret ecl-button--neutral\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel() || 'Access item children'\"\n [attr.
|
|
772
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: EclMenuItemComponent, isStandalone: true, selector: "ecl-menu-item", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, toggleAriaLabel: { classPropertyName: "toggleAriaLabel", publicName: "toggleAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, queryParamsHandling: { classPropertyName: "queryParamsHandling", publicName: "queryParamsHandling", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, isCurrentInput: { classPropertyName: "isCurrentInput", publicName: "isCurrent", isSignal: true, isRequired: false, transformFunction: null }, linkExtraAttributes: { classPropertyName: "linkExtraAttributes", publicName: "linkExtraAttributes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuItemSelect: "menuItemSelect", menuItemCaret: "menuItemCaret", menuItemHover: "menuItemHover", menuItemHoverOut: "menuItemHoverOut", menuMegaItemSelect: "menuMegaItemSelect", menuItemFocus: "menuItemFocus", menuItemKeydown: "menuItemKeydown", menuMegaLastItemTab: "menuMegaLastItemTab" }, host: { attributes: { "role": "listitem" }, listeners: { "mouseenter": "onItemMouseEnter($event)", "mouseleave": "onItemMouseLeave($event)" }, properties: { "class": "cssClasses()", "class.ecl-menu__item--has-children": "hasEclChildrenDataAttribute()", "attr.aria-haspopup": "hasEclChildrenDataAttribute()", "attr.data-expanded": "isDataExpanded()" } }, queries: [{ propertyName: "submenu", first: true, predicate: i0.forwardRef(() => EclMenuMegaComponent), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "menuLink", first: true, predicate: ["menuLink"], descendants: true, isSignal: true }, { propertyName: "menuButton", first: true, predicate: EclButtonComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (href()) {\n <a eclLink\n #menuLink\n variant=\"standalone\"\n [href]=\"href()\"\n [target]=\"target()\"\n class=\"ecl-menu__link\"\n [class.ecl-menu__link--current]=\"isCurrent()\"\n [attr.aria-current]=\"ariaCurrent()\"\n (focus)=\"onItemFocus($event)\"\n (click)=\"onItemClick($event)\"\n (keydown)=\"onLinkKeydown($event)\">\n {{ label() }}\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </a>\n} @else {\n <a eclLink\n #menuLink\n variant=\"standalone\"\n [attr.tabindex]=\"tabindex || 0\"\n [routerLink]=\"routerLink()\"\n [queryParams]=\"queryParams()\"\n [queryParamsHandling]=\"queryParamsHandling()\"\n class=\"ecl-menu__link\"\n [class.ecl-menu__link--current]=\"isCurrent()\"\n [attr.aria-current]=\"ariaCurrent()\"\n (focus)=\"onItemFocus($event)\"\n (click)=\"onItemClick($event)\"\n (keydown)=\"onLinkKeydown($event)\">\n {{ label() }}\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </a>\n}\n\n@if (hasChildren()) {\n @if (isMobileBreakpoint()) {\n <button\n eclButton\n variant=\"tertiary\"\n class=\"ecl-menu__button-caret ecl-button--neutral\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel() || 'Access item children'\"\n (click)=\"onItemCaretClick($event)\"\n (keydown)=\"onButtonKeydown($event)\">\n <ecl-icon icon=\"corner-arrow\" size=\"m\" transform=\"rotate-180\" class=\"ecl-button__icon\"></ecl-icon>\n </button>\n } @else {\n <button\n eclButton\n variant=\"tertiary\"\n class=\"ecl-menu__button-caret ecl-button--neutral\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel() || 'Access item children'\"\n [attr.aria-expanded]=\"isDataExpanded()\"\n (click)=\"onItemCaretClick($event)\"\n (keydown)=\"onButtonKeydown($event)\">\n <ecl-icon icon=\"corner-arrow\" size=\"m\" transform=\"rotate-180\" class=\"ecl-button__icon\"></ecl-icon>\n </button>\n }\n}\n\n<ng-content select=\"ecl-menu-mega\"></ng-content>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: i1.EclButtonComponent, selector: "button[eclButton], button[ecl-button], a[eclButton]", inputs: ["isIconOnly", "variant", "eclStyle", "size", "containerStyleClass"] }, { kind: "component", type: i2.EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }, { kind: "directive", type: i3.EclLinkDirective, selector: "[eclLink]", inputs: ["extraAttributes", "isInverted", "isIconOnly", "isHighlight", "isNoVisited", "isBranded", "variant"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
767
773
|
}
|
|
768
774
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EclMenuItemComponent, decorators: [{
|
|
769
775
|
type: Component,
|
|
770
776
|
args: [{ selector: 'ecl-menu-item', imports: [NgTemplateOutlet, RouterLink, RouterLinkWithHref, ...EUI_ECL_BUTTON, ...EUI_ECL_ICON, ...EUI_ECL_LINK], encapsulation: ViewEncapsulation.None, host: {
|
|
771
777
|
role: 'listitem',
|
|
772
778
|
'[class]': 'cssClasses()',
|
|
773
|
-
'[class.ecl-menu__item--has-children]': 'hasEclChildrenDataAttribute',
|
|
774
|
-
'[attr.aria-haspopup]': 'hasEclChildrenDataAttribute',
|
|
775
|
-
'[attr.data-expanded]': 'isDataExpanded',
|
|
779
|
+
'[class.ecl-menu__item--has-children]': 'hasEclChildrenDataAttribute()',
|
|
780
|
+
'[attr.aria-haspopup]': 'hasEclChildrenDataAttribute()',
|
|
781
|
+
'[attr.data-expanded]': 'isDataExpanded()',
|
|
776
782
|
'(mouseenter)': 'onItemMouseEnter($event)',
|
|
777
783
|
'(mouseleave)': 'onItemMouseLeave($event)',
|
|
778
|
-
}, template: "@if (href()) {\n <a eclLink\n #menuLink\n variant=\"standalone\"\n [href]=\"href()\"\n [target]=\"target()\"\n class=\"ecl-menu__link\"\n [class.ecl-menu__link--current]=\"isCurrent()\"\n [attr.aria-current]=\"ariaCurrent\"\n (focus)=\"onItemFocus($event)\"\n (click)=\"onItemClick($event)\"\n (keydown)=\"onLinkKeydown($event)\">\n {{ label() }}\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </a>\n} @else {\n <a eclLink\n #menuLink\n variant=\"standalone\"\n [attr.tabindex]=\"tabindex || 0\"\n [routerLink]=\"routerLink()\"\n [queryParams]=\"queryParams()\"\n [queryParamsHandling]=\"queryParamsHandling()\"\n class=\"ecl-menu__link\"\n [class.ecl-menu__link--current]=\"isCurrent()\"\n [attr.aria-current]=\"ariaCurrent\"\n (focus)=\"onItemFocus($event)\"\n (click)=\"onItemClick($event)\"\n (keydown)=\"onLinkKeydown($event)\">\n {{ label() }}\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </a>\n}\n\n@if (hasChildren) {\n @if (isMobileBreakpoint()) {\n <button\n eclButton\n variant=\"tertiary\"\n class=\"ecl-menu__button-caret ecl-button--neutral\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel() || 'Access item children'\"\n (click)=\"onItemCaretClick($event)\"\n (keydown)=\"onButtonKeydown($event)\">\n <ecl-icon icon=\"corner-arrow\" size=\"m\" transform=\"rotate-180\" class=\"ecl-button__icon\"></ecl-icon>\n </button>\n } @else {\n <button\n eclButton\n variant=\"tertiary\"\n class=\"ecl-menu__button-caret ecl-button--neutral\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel() || 'Access item children'\"\n [attr.
|
|
784
|
+
}, template: "@if (href()) {\n <a eclLink\n #menuLink\n variant=\"standalone\"\n [href]=\"href()\"\n [target]=\"target()\"\n class=\"ecl-menu__link\"\n [class.ecl-menu__link--current]=\"isCurrent()\"\n [attr.aria-current]=\"ariaCurrent()\"\n (focus)=\"onItemFocus($event)\"\n (click)=\"onItemClick($event)\"\n (keydown)=\"onLinkKeydown($event)\">\n {{ label() }}\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </a>\n} @else {\n <a eclLink\n #menuLink\n variant=\"standalone\"\n [attr.tabindex]=\"tabindex || 0\"\n [routerLink]=\"routerLink()\"\n [queryParams]=\"queryParams()\"\n [queryParamsHandling]=\"queryParamsHandling()\"\n class=\"ecl-menu__link\"\n [class.ecl-menu__link--current]=\"isCurrent()\"\n [attr.aria-current]=\"ariaCurrent()\"\n (focus)=\"onItemFocus($event)\"\n (click)=\"onItemClick($event)\"\n (keydown)=\"onLinkKeydown($event)\">\n {{ label() }}\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </a>\n}\n\n@if (hasChildren()) {\n @if (isMobileBreakpoint()) {\n <button\n eclButton\n variant=\"tertiary\"\n class=\"ecl-menu__button-caret ecl-button--neutral\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel() || 'Access item children'\"\n (click)=\"onItemCaretClick($event)\"\n (keydown)=\"onButtonKeydown($event)\">\n <ecl-icon icon=\"corner-arrow\" size=\"m\" transform=\"rotate-180\" class=\"ecl-button__icon\"></ecl-icon>\n </button>\n } @else {\n <button\n eclButton\n variant=\"tertiary\"\n class=\"ecl-menu__button-caret ecl-button--neutral\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel() || 'Access item children'\"\n [attr.aria-expanded]=\"isDataExpanded()\"\n (click)=\"onItemCaretClick($event)\"\n (keydown)=\"onButtonKeydown($event)\">\n <ecl-icon icon=\"corner-arrow\" size=\"m\" transform=\"rotate-180\" class=\"ecl-button__icon\"></ecl-icon>\n </button>\n }\n}\n\n<ng-content select=\"ecl-menu-mega\"></ng-content>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n" }]
|
|
779
785
|
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], toggleAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleAriaLabel", required: false }] }], routerLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "routerLink", required: false }] }], queryParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParams", required: false }] }], queryParamsHandling: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParamsHandling", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], isCurrentInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCurrent", required: false }] }], linkExtraAttributes: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkExtraAttributes", required: false }] }], menuItemSelect: [{ type: i0.Output, args: ["menuItemSelect"] }], menuItemCaret: [{ type: i0.Output, args: ["menuItemCaret"] }], menuItemHover: [{ type: i0.Output, args: ["menuItemHover"] }], menuItemHoverOut: [{ type: i0.Output, args: ["menuItemHoverOut"] }], menuMegaItemSelect: [{ type: i0.Output, args: ["menuMegaItemSelect"] }], menuItemFocus: [{ type: i0.Output, args: ["menuItemFocus"] }], menuItemKeydown: [{ type: i0.Output, args: ["menuItemKeydown"] }], menuMegaLastItemTab: [{ type: i0.Output, args: ["menuMegaLastItemTab"] }], submenu: [{ type: i0.ContentChild, args: [forwardRef(() => EclMenuMegaComponent), { isSignal: true }] }], menuLink: [{ type: i0.ViewChild, args: ['menuLink', { isSignal: true }] }], menuButton: [{ type: i0.ViewChild, args: [i0.forwardRef(() => EclButtonComponent), { isSignal: true }] }] } });
|
|
780
786
|
|
|
781
787
|
/**
|
|
@@ -1213,22 +1219,21 @@ class EclMenuComponent extends ECLBaseDirective {
|
|
|
1213
1219
|
}
|
|
1214
1220
|
onRootMenuItemKeydown(item, evt) {
|
|
1215
1221
|
switch (evt.domEvent.key) {
|
|
1222
|
+
// At the first-level row, arrows navigate through the items (ECL parity):
|
|
1223
|
+
// ArrowRight/ArrowDown move forward, ArrowLeft/ArrowUp move backward.
|
|
1224
|
+
// Opening a submenu via ArrowDown is handled on the caret button itself
|
|
1225
|
+
// (onButtonKeydown), not here.
|
|
1226
|
+
case KeyCode.ARROW_RIGHT:
|
|
1216
1227
|
case KeyCode.ARROW_DOWN: {
|
|
1217
|
-
this.onRootMenuItemEnter(item);
|
|
1218
|
-
break;
|
|
1219
|
-
}
|
|
1220
|
-
case KeyCode.ARROW_RIGHT: {
|
|
1221
1228
|
this.onNextMenuItemFocus(item);
|
|
1222
1229
|
break;
|
|
1223
1230
|
}
|
|
1224
|
-
case KeyCode.ARROW_UP:
|
|
1225
|
-
this.onPrevMenuItemFocus(item);
|
|
1226
|
-
break;
|
|
1227
|
-
}
|
|
1231
|
+
case KeyCode.ARROW_UP:
|
|
1228
1232
|
case KeyCode.ARROW_LEFT: {
|
|
1229
1233
|
this.onPrevMenuItemFocus(item);
|
|
1230
1234
|
break;
|
|
1231
1235
|
}
|
|
1236
|
+
case KeyCode.SPACE:
|
|
1232
1237
|
case KeyCode.ENTER: {
|
|
1233
1238
|
this.onRootMenuItemEnter(item);
|
|
1234
1239
|
break;
|
|
@@ -1287,7 +1292,7 @@ class EclMenuComponent extends ECLBaseDirective {
|
|
|
1287
1292
|
this.deselectAllSubmenusItems();
|
|
1288
1293
|
this.selectMenuItem(requestedRootMenuItem);
|
|
1289
1294
|
this.onCloseHamburgerMenu();
|
|
1290
|
-
if (this.hasOverflow) {
|
|
1295
|
+
if (this.hasOverflow()) {
|
|
1291
1296
|
this.managePrevNextButtonsClassOnItemSelected();
|
|
1292
1297
|
}
|
|
1293
1298
|
this.sendMenuItemSelectEvent(evt);
|
|
@@ -1367,7 +1372,20 @@ class EclMenuComponent extends ECLBaseDirective {
|
|
|
1367
1372
|
}
|
|
1368
1373
|
onRootMenuItemCaret(evt) {
|
|
1369
1374
|
const requestedRootMenuItem = evt.menuItem;
|
|
1370
|
-
//
|
|
1375
|
+
// Desktop: the caret click is a click-to-open/close affordance (ECL parity with
|
|
1376
|
+
// handleClickOnCaret). Toggle the submenu the same way Enter/Space does on desktop,
|
|
1377
|
+
// without touching the mobile accordion state or suppressing hover.
|
|
1378
|
+
if (!this.isMobileBreakpoint() && !this.isTablet()) {
|
|
1379
|
+
if (!requestedRootMenuItem.isHovered()) {
|
|
1380
|
+
this.openSubmenu(requestedRootMenuItem);
|
|
1381
|
+
}
|
|
1382
|
+
else {
|
|
1383
|
+
this.closeRootMenu();
|
|
1384
|
+
}
|
|
1385
|
+
return;
|
|
1386
|
+
}
|
|
1387
|
+
// Mobile/tablet: suppress hover events briefly after touch/caret interaction
|
|
1388
|
+
// (prevents double-trigger on hybrid devices), then toggle the accordion.
|
|
1371
1389
|
this.ignoreHover = true;
|
|
1372
1390
|
this.closeRootMenuButOneItem(requestedRootMenuItem);
|
|
1373
1391
|
this.toggleExpandedForMenuItem(requestedRootMenuItem);
|
|
@@ -1391,7 +1409,7 @@ class EclMenuComponent extends ECLBaseDirective {
|
|
|
1391
1409
|
}
|
|
1392
1410
|
deselectAllSubmenusItems() {
|
|
1393
1411
|
this.eclRootMenuItems().forEach((rootItem) => {
|
|
1394
|
-
this.deselectMenuItems(rootItem.children);
|
|
1412
|
+
this.deselectMenuItems(rootItem.children());
|
|
1395
1413
|
});
|
|
1396
1414
|
}
|
|
1397
1415
|
deselectMenuItems(items) {
|