import {NgModule,Component,ElementRef,OnDestroy,Input} from '@angular/core'; import {trigger,state,style,transition,animate} from '@angular/animations'; import {CommonModule} from '@angular/common'; import {MenuItem} from '../common/menuitem'; import {RouterModule} from '@angular/router'; export class BasePanelMenuItem { handleClick(event, item) { if(item.disabled) { event.preventDefault(); return; } item.expanded = !item.expanded; if(!item.url) { event.preventDefault(); } if(item.command) { item.command({ originalEvent: event, item: item }); } } } @Component({ selector: 'p-panelMenuSub', template: `
`, animations: [ trigger('submenu', [ state('hidden', style({ height: '0px' })), state('visible', style({ height: '*' })), transition('visible => hidden', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)')), transition('hidden => visible', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)')) ]) ] }) export class PanelMenuSub extends BasePanelMenuItem { @Input() item: MenuItem; @Input() expanded: boolean; } @Component({ selector: 'p-panelMenu', template: `