{"version":3,"file":"primeng-panelmenu.mjs","sources":["../../src/app/components/panelmenu/panelmenu.ts","../../src/app/components/panelmenu/primeng-panelmenu.ts"],"sourcesContent":["import {NgModule,Component,Input,ChangeDetectorRef,ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';\nimport {trigger,state,style,transition,animate} from '@angular/animations';\nimport {CommonModule} from '@angular/common';\nimport {MenuItem} from 'primeng/api';\nimport {RouterModule} from '@angular/router';\nimport {TooltipModule} from 'primeng/tooltip';\nimport {DomHandler} from 'primeng/dom';\n\nexport class BasePanelMenuItem {\n\n constructor(private ref: ChangeDetectorRef) {}\n\n handleClick(event, item) {\n if (item.disabled) {\n event.preventDefault();\n return;\n }\n\n item.expanded = !item.expanded;\n this.ref.detectChanges();\n\n if (!item.url) {\n event.preventDefault();\n }\n\n if (item.command) {\n item.command({\n originalEvent: event,\n item: item\n });\n }\n }\n}\n\n@Component({\n selector: 'p-panelMenuSub',\n template: `\n \n `,\n animations: [\n trigger('submenu', [\n state('hidden', style({\n height: '0',\n overflow: 'hidden'\n })),\n state('visible', style({\n height: '*'\n })),\n transition('visible <=> hidden', [style({overflow: 'hidden'}), animate('{{transitionParams}}')]),\n transition('void => *', animate(0))\n ])\n ],\n encapsulation: ViewEncapsulation.None,\n host: {\n 'class': 'p-element'\n }\n})\nexport class PanelMenuSub extends BasePanelMenuItem {\n\n @Input() item: MenuItem;\n\n @Input() expanded: boolean;\n\n @Input() parentExpanded: boolean;\n\n @Input() transitionOptions: string;\n\n @Input() root: boolean;\n\n constructor(ref: ChangeDetectorRef) {\n super(ref);\n }\n\n\n\n onItemKeyDown(event) {\n let listItem = event.currentTarget;\n\n switch (event.code) {\n case 'Space':\n case 'Enter':\n if (listItem && !DomHandler.hasClass(listItem, 'p-disabled')) {\n listItem.click();\n }\n\n event.preventDefault();\n break;\n\n default:\n break;\n }\n }\n}\n\n@Component({\n selector: 'p-panelMenu',\n template: `\n
\n \n \n \n
\n `,\n animations: [\n trigger('rootItem', [\n state('hidden', style({\n height: '0',\n overflow: 'hidden'\n })),\n state('visible', style({\n height: '*'\n })),\n transition('visible <=> hidden', [style({overflow: 'hidden'}), animate('{{transitionParams}}')]),\n transition('void => *', animate(0))\n ])\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./panelmenu.css'],\n host: {\n 'class': 'p-element'\n }\n})\nexport class PanelMenu extends BasePanelMenuItem {\n\n @Input() model: MenuItem[];\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @Input() multiple: boolean = true;\n\n @Input() transitionOptions: string = '400ms cubic-bezier(0.86, 0, 0.07, 1)';\n\n public animating: boolean;\n\n constructor(ref: ChangeDetectorRef) {\n super(ref);\n }\n\n collapseAll() {\n \tfor(let item of this.model) {\n \t\tif (item.expanded) {\n \t\t\titem.expanded = false;\n \t\t}\n \t}\n }\n\n handleClick(event, item) {\n \tif (!this.multiple) {\n for(let modelItem of this.model) {\n \t\tif (item !== modelItem && modelItem.expanded) {\n \t\t\tmodelItem.expanded = false;\n \t\t}\n \t}\n \t}\n\n this.animating = true;\n super.handleClick(event, item);\n }\n\n onToggleDone() {\n this.animating = false;\n }\n\n onItemKeyDown(event) {\n let listItem = event.currentTarget;\n\n switch (event.code) {\n case 'Space':\n case 'Enter':\n if (listItem && !DomHandler.hasClass(listItem, 'p-disabled')) {\n listItem.click();\n }\n\n event.preventDefault();\n break;\n\n default:\n break;\n }\n }\n\n}\n\n@NgModule({\n imports: [CommonModule,RouterModule,TooltipModule],\n exports: [PanelMenu,RouterModule,TooltipModule],\n declarations: [PanelMenu,PanelMenuSub]\n})\nexport class PanelMenuModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;MAQa,iBAAiB;IAE1B,YAAoB,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;KAAI;IAE9C,WAAW,CAAC,KAAK,EAAE,IAAI;QACnB,IAAI,IAAI,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