chore: copia de libs/shared con prefijo Pi y APIs de terceros actualizadas
This commit is contained in:
54
libs/ui/src/lib/util/menu/base.menu.component.ts
Normal file
54
libs/ui/src/lib/util/menu/base.menu.component.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
// Angular
|
||||
import { ContentChild, Directive, HostBinding, Input, TemplateRef } from '@angular/core';
|
||||
|
||||
// Style definitions
|
||||
import { MenuEntry, MenuItemText } from './entities/menu-entry.model';
|
||||
|
||||
@Directive()
|
||||
export abstract class PiBaseMenuComponent {
|
||||
@HostBinding('class') baseClassName = 'pi-menu pi-menu__parent';
|
||||
|
||||
isMouseOver = false;
|
||||
|
||||
@Input()
|
||||
label: string;
|
||||
|
||||
_menuItems: Array<MenuEntry> = [];
|
||||
|
||||
@Input()
|
||||
set menuItems(menuItems: MenuEntry[]) {
|
||||
this._menuItems = menuItems;
|
||||
}
|
||||
|
||||
get menuItems(): MenuEntry[] {
|
||||
return this._menuItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parent Menu
|
||||
*/
|
||||
@ContentChild('parentMenuTemplate', { static: false })
|
||||
parentMenuTemplateRef: TemplateRef<unknown> | undefined;
|
||||
|
||||
/**
|
||||
* Children Menu (Level 1)
|
||||
*/
|
||||
@ContentChild('childMenuTemplate', { static: false })
|
||||
childMenuTemplateRef: TemplateRef<unknown> | undefined;
|
||||
|
||||
/**
|
||||
* Additional Children Menu (Level 1)
|
||||
*/
|
||||
@ContentChild('childAsideMenuTemplate', { static: false })
|
||||
childAsideMenuTemplateRef: TemplateRef<unknown> | undefined;
|
||||
|
||||
/**
|
||||
* Additional Children Menu (Level 1)
|
||||
*/
|
||||
@ContentChild('asideMenuTemplate', { static: false })
|
||||
asideMenuTemplateRef: TemplateRef<unknown> | undefined;
|
||||
|
||||
trackByFn(index: number, item: MenuEntry): MenuItemText | string | undefined {
|
||||
return item.label;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user