src/ui/menu/smart-hamburger-menu/smart-hamburger-menu-item.component.ts
| changeDetection | ChangeDetectionStrategy.Eager |
| selector | li[smart-hamburger-menu-item] |
| styleUrls | ./smart-hamburger-menu-item.component.css |
| templateUrl | ./smart-hamburger-menu-item.component.html |
Properties |
Methods |
Inputs |
Outputs |
Accessors |
constructor(elementRef: ElementRef, menuStructureService: SmartMenuStructureService, renderer: Renderer2)
|
||||||||||||
|
Parameters :
|
| isChild |
Type : boolean
|
| model |
Type : HamburgerMenuStructureItem
|
| onSelected |
Type : EventEmitter<HamburgerMenuStructureItem>
|
| openStateChanged |
Type : EventEmitter<literal type>
|
| isImage | ||||||
isImage(itemImage: string)
|
||||||
|
Parameters :
Returns :
boolean
|
| menuItemOpenStateChanged | ||||||
menuItemOpenStateChanged(ev: any)
|
||||||
|
Parameters :
Returns :
void
|
| onSelectedAction | ||||||
onSelectedAction(itm: any)
|
||||||
|
Parameters :
Returns :
void
|
| toggleMenu | |||||||||
toggleMenu(ev: Event, dropdownEl: HTMLElement)
|
|||||||||
|
Parameters :
Returns :
void
|
| childItems |
Type : QueryList<SmartHamburgerMenuItemComponent>
|
Decorators :
@ViewChildren(SmartHamburgerMenuItemComponent)
|
| open | ||||||
getopen()
|
||||||
|
Returns :
boolean
|
||||||
setopen(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
<!--
**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") - *
* www.consultingwerk.com and other contributors as listed *
* below. All Rights Reserved. *
* *
* Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY *
* KIND, either express or implied. *
* *
* Contributors: *
* *
**************************************************************************
--------------------------------------------------------------------------
File : smart-hamburger-menu-item.component.html
Purpose : Template for Smart Hamburger Menu Item.
Author(s) : Radu Nicoara
Created : Dec 07, 2017
--------------------------------------------------------------------------
-->
@if (model.HasChild) {
<a
kendoTooltip
role="button"
[ngClass]="{ 'nav-link': true, 'dropdown-toggle': true }"
[attr.id]="model.MenuGuid"
data-toggle="dropdown"
(click)="toggleMenu($event, dropdownEl)"
>
@if (!!model.MenuSmallImage) { @if (isImage(model.MenuSmallImage)) {
<img [src]="model.MenuSmallImage" />
} @if (!isImage(model.MenuSmallImage)) {
<i [ngClass]="model.MenuSmallImage"></i>
} }
<span [title]="model.MenuTooltip">{{ model.MenuName }}</span>
<b class="caret"></b>
</a>
<ul
class="dropdown-menu is-child-list"
[attr.aria-label]="model.MenuGuid"
#dropdownEl
>
<ng-container>
@for (child of model.Children; track child) {
<li
(onSelected)="onSelectedAction(child)"
(openStateChanged)="menuItemOpenStateChanged($event)"
[isChild]="true"
smart-hamburger-menu-item
[ngClass]="{
'nav-item': true,
dropdown: child.HasChild,
'is-child-item': true
}"
[model]="child"
></li>
}
</ng-container>
</ul>
} @if (!model.HasChild) {
<a
kendoTooltip
role="button"
class="nav-link is-child-item"
(click)="onSelectedAction(model)"
>
@if (!!model.MenuSmallImage) { @if (isImage(model.MenuSmallImage)) {
<img [src]="model.MenuSmallImage" />
} @if (!isImage(model.MenuSmallImage)) {
<i [ngClass]="model.MenuSmallImage"></i>
} }
<span [title]="model.MenuTooltip">{{ model.MenuName }}</span>
</a>
}
./smart-hamburger-menu-item.component.css
/**********************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") - *
* www.consultingwerk.com and other contributors as listed *
* below. All Rights Reserved. *
* *
* Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY *
* KIND, either express or implied. *
* *
* Contributors: *
* *
**********************************************************************/
/*------------------------------------------------------------------------
File : smart-hamburger-menu-item.component.css
Purpose : Styles for Smart Hamburger Menu Item.
Author(s) : Radu Nicoara
Created : Dec 07, 2017
----------------------------------------------------------------------*/
.is-child-list {
padding: 0px 15px 0px 25px;
}
.is-child-item:not(.dropdown) {
padding-top: 5px;
padding-bottom: 5px;
}
.nav-link img, .nav-link i {
padding-right: 7px;
}
.dropdown-menu {
background-color: transparent;
border: none;
}
@media screen and (min-width: 992px) {
::ng-deep .navbar-expand-lg .navbar-nav .dropdown-menu {
position: relative !important;
}
}