{"version":3,"file":"primeng-panelmenu.js","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';\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})\nexport class PanelMenuSub extends BasePanelMenuItem {\n \n @Input() item: MenuItem;\n \n @Input() expanded: boolean;\n\n @Input() transitionOptions: string;\n\n @Input() root: boolean;\n\n constructor(ref: ChangeDetectorRef) {\n super(ref);\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})\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}\n\n@NgModule({\n imports: [CommonModule,RouterModule],\n exports: [PanelMenu,RouterModule],\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":";;;;;MAMa,iBAAiB;IAE1B,YAAoB,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;KAAI;IAE9C,WAAW,CAAC,KAAK,EAAE,IAAI;QACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,OAAO;SACV;QAED,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAEzB,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YACX,KAAK,CAAC,cAAc,EAAE,CAAC;SAC1B;QAED,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,OAAO,CAAC;gBACT,aAAa,EAAE,KAAK;gBACpB,IAAI,EAAE,IAAI;aACb,CAAC,CAAC;SACN;KACJ;CACJ;MA8CY,YAAa,SAAQ,iBAAiB;IAU/C,YAAY,GAAsB;QAC9B,KAAK,CAAC,GAAG,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