File

src/ui/menu/smart-hamburger-menu/smart-hamburger-menu-item.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs
Outputs
Accessors

Constructor

constructor(elementRef: ElementRef, menuStructureService: SmartMenuStructureService, renderer: Renderer2)
Parameters :
Name Type Optional
elementRef ElementRef No
menuStructureService SmartMenuStructureService No
renderer Renderer2 No

Inputs

isChild
Type : boolean
model
Type : HamburgerMenuStructureItem

Outputs

onSelected
Type : EventEmitter<HamburgerMenuStructureItem>
openStateChanged
Type : EventEmitter<literal type>

Methods

isImage
isImage(itemImage: string)
Parameters :
Name Type Optional
itemImage string No
Returns : boolean
menuItemOpenStateChanged
menuItemOpenStateChanged(ev: any)
Parameters :
Name Type Optional
ev any No
Returns : void
onSelectedAction
onSelectedAction(itm: any)
Parameters :
Name Type Optional
itm any No
Returns : void
toggleMenu
toggleMenu(ev: Event, dropdownEl: HTMLElement)
Parameters :
Name Type Optional
ev Event No
dropdownEl HTMLElement No
Returns : void

Properties

childItems
Type : QueryList<SmartHamburgerMenuItemComponent>
Decorators :
@ViewChildren(SmartHamburgerMenuItemComponent)

Accessors

open
getopen()
Returns : boolean
setopen(value: boolean)
Parameters :
Name Type Optional
value boolean No
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;
    }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""