src/ui/menu/smart-accordion-menu/smart-menu.component.ts
A component used for displaying the navigation menu.
| changeDetection | ChangeDetectionStrategy.Eager |
| providers |
SmartMenuStructureService
|
| selector | smart-accordion-menu |
| styleUrls | ./smart-menu.component.css |
| templateUrl | ./smart-menu.component.html |
Properties |
Methods |
Inputs |
Outputs |
Accessors |
constructor(smartMenuStructureService: SmartMenuStructureService)
|
||||||
|
Parameters :
|
| expanded |
Type : boolean
|
|
If set to true, will expand the menu on initialization. |
| menu-structure-code |
Type : string
|
|
The structure code that the Smart Menu should use. |
| selected-item |
Type : any
|
|
The currently selected menu item. |
| smart-instance-name |
Type : string
|
|
The instance name of the component |
| smart-object-name |
Type : string
|
|
The object name of the component |
| selected-item-changed |
Type : EventEmitter<any>
|
|
Fires when the menu's selection changes. |
| onItemAction | ||||||
onItemAction(event: PanelBarStateChangeEvent)
|
||||||
|
Parameters :
Returns :
void
|
| panelBar |
Type : PanelBarItemComponent
|
Decorators :
@ViewChild(PanelBarItemComponent)
|
| menuItems | ||||||||
getmenuItems()
|
||||||||
|
Returns the loaded menu items.
Returns :
SmartMenuStructureItem[]
|
||||||||
setmenuItems(value: SmartMenuStructureItem[])
|
||||||||
|
Sets the menu items.
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-menu.component.html
Purpose : Template for Smart Menu.
Author(s) : Oana Sucigan
Created : Sep 08, 2021
--------------------------------------------------------------------------
-->
@if (_menuItemsSignal().length > 0) {
<kendo-panelbar
(stateChange)="onItemAction($event)"
>
@for (item of _menuItemsSignal(); track item.id) {
<kendo-panelbar-item kendoTooltip [filter]="'.menu-item-wrap'" [id]="item.id" [imageUrl]="item.imageUrl" [iconClass]="item.iconClass">
<ng-template kendoPanelBarItemTitle>
<div class="w-100 h-100 menu-item-wrap k-link" [attr.title]="item.tooltip">
<span class="k-link">{{item.title}}</span>
</div>
</ng-template>
@for (child of item.children; track child.id) {
<kendo-panelbar-item kendoTooltip [filter]="'.menu-item-wrap'" [id]="child.id" [imageUrl]="child.imageUrl" [iconClass]="child.iconClass">
<ng-template kendoPanelBarItemTitle>
<div class="w-100 h-100 menu-item-wrap" [attr.title]="child.tooltip">
<span class="k-link">{{child.title}}</span>
</div>
</ng-template>
@for (gChild of child.children; track gChild.id) {
<kendo-panelbar-item kendoTooltip [filter]="'.menu-item-wrap'" [id]="gChild.id" [imageUrl]="gChild.imageUrl" [iconClass]="gChild.iconClass">
<ng-template kendoPanelBarItemTitle>
<div class="w-100 h-100 menu-item-wrap" [attr.title]="gChild.tooltip">
<span class="k-link">{{gChild.title}}</span>
</div>
</ng-template>
@for (ggChild of gChild.children; track ggChild.id) {
<kendo-panelbar-item kendoTooltip [filter]="'.menu-item-wrap'" [id]="ggChild.id" [imageUrl]="ggChild.imageUrl" [iconClass]="ggChild.iconClass">
<ng-template kendoPanelBarItemTitle>
<div class="w-100 h-100 menu-item-wrap" [attr.title]="ggChild.tooltip">
<span class="k-link">{{ggChild.title}}</span>
</div>
</ng-template>
</kendo-panelbar-item>
}
</kendo-panelbar-item>
}
</kendo-panelbar-item>
}
</kendo-panelbar-item>
}
</kendo-panelbar>
}
./smart-menu.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-menu.component.css
Purpose : Styles for Smart Menu.
Author(s) : Radu Nicoara
Created : Dec 07, 2017
----------------------------------------------------------------------*/
::ng-deep .k-panelbar .k-group {
padding-left: 20px !important;
}
::ng-deep .k-panelbar .k-panelbar-collapse,
.k-panelbar .k-panelbar-expand {
padding-left: 15px !important;
right: 15px !important;
}