packages/components/layout/eui-toolbar/toolbar-mega-menu/toolbar-mega-menu-container.component.ts
Container component for rendering the mega menu dropdown content with multi-column layout. Displays grouped menu items organized by parent, column index, and column label in a structured grid. Handles menu item clicks and executes associated command functions. Used internally by EuiToolbarMegaMenuComponent to render the dropdown panel content. Supports router links, badges, and icons on menu items.
Example :<!-- Used internally by eui-toolbar-mega-menu -->
<eui-toolbar-mega-menu-container
[megaMenuItemsGrouped]="groupedItems"
[activeMenu]="0">
</eui-toolbar-mega-menu-container>// Grouped structure created by parent component
megaMenuItemsGrouped = {
0: {
'0': { 'Category A': [{ label: 'Item 1', url: '/item1' }] },
'1': { 'Category B': [{ label: 'Item 2', url: '/item2' }] }
}
};| selector | eui-toolbar-mega-menu-container |
| imports |
EUI_ICON
EUI_BADGE
TranslateModule
KeyValuePipe
NgTemplateOutlet
RouterLink
RouterLinkActive
|
| templateUrl | ./toolbar-mega-menu-container.component.html |
| styleUrl | ./toolbar-mega-menu-container.component.scss |
Properties |
Methods |
Inputs |
Outputs |
HostBindings |
| activeMenu |
Type : number
|
Default value : null
|
|
Index of the currently active menu item whose dropdown is displayed. Used to determine which parent menu's children to render in the dropdown. When null, no dropdown is displayed. |
| ariaLabel |
Type : string
|
Default value : 'eUI sub menu'
|
|
Provides accessibility labeling for the dropdown menu. |
| itemClick |
Type : EventEmitter
|
|
Emits an output event when item is clicked |
| class |
Type : string
|
Default value : 'eui-toolbar-mega-menu-container'
|
| focusFirstItem |
focusFirstItem()
|
|
Focuses the first item in the submenu.
Returns :
void
|
| onItemClick | ||||||
onItemClick(item: EuiMenuItem)
|
||||||
|
Handles click events on menu items within the dropdown. Executes the item's command function if defined. Called internally when user clicks a menu item in the dropdown panel.
Parameters :
Returns :
void
|
| string |
Type : string
|
Default value : 'eui-toolbar-mega-menu-container'
|
Decorators :
@HostBinding('class')
|
| submenuItemLinks |
Type : QueryList<ElementRef<HTMLElement>>
|
Decorators :
@ViewChildren('submenuItemLink', {read: ElementRef})
|