{"version":3,"file":"primeng-panel.js","sources":["../../src/app/components/panel/panel.ts","../../src/app/components/panel/primeng-panel.ts"],"sourcesContent":["import {NgModule,Component,Input,Output,EventEmitter,ElementRef,ContentChild,ChangeDetectionStrategy, ViewEncapsulation, ContentChildren, QueryList, TemplateRef, AfterContentInit} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {SharedModule,Footer, PrimeTemplate} from 'primeng/api';\nimport {BlockableUI} from 'primeng/api';\nimport {RippleModule} from 'primeng/ripple';\nimport {trigger,state,style,transition,animate} from '@angular/animations';\n\nlet idx: number = 0;\n\n@Component({\n selector: 'p-panel',\n template: `\n
\n
\n {{header}}\n \n \n
\n \n \n
\n
\n
\n
\n \n \n
\n \n
\n \n \n
\n
\n
\n `,\n animations: [\n trigger('panelContent', [\n state('hidden', style({\n height: '0',\n overflow: 'hidden'\n })),\n state('void', style({\n height: '{{height}}'\n }), {params: {height: '0'}}),\n state('visible', style({\n height: '*'\n })),\n transition('visible <=> hidden', [style({ overflow: 'hidden'}), animate('{{transitionParams}}')]),\n transition('void => hidden', animate('{{transitionParams}}')),\n transition('void => visible', animate('{{transitionParams}}'))\n ])\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./panel.css']\n})\nexport class Panel implements AfterContentInit,BlockableUI {\n\n @Input() toggleable: boolean;\n\n @Input() header: string;\n\n @Input() collapsed: boolean = false;\n \n @Input() style: any;\n \n @Input() styleClass: string;\n \n @Input() expandIcon: string = 'pi pi-plus';\n \n @Input() collapseIcon: string = 'pi pi-minus';\n \n @Input() showHeader: boolean = true;\n\n @Input() toggler: string = \"icon\";\n \n @Output() collapsedChange: EventEmitter = new EventEmitter();\n\n @Output() onBeforeToggle: EventEmitter = new EventEmitter();\n\n @Output() onAfterToggle: EventEmitter = new EventEmitter();\n \n @Input() transitionOptions: string = '400ms cubic-bezier(0.86, 0, 0.07, 1)';\n\n @ContentChild(Footer) footerFacet;\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n public iconTemplate: TemplateRef;\n \n animating: boolean;\n\n headerTemplate: TemplateRef;\n\n contentTemplate: TemplateRef;\n\n footerTemplate: TemplateRef;\n \n id: string = `p-panel-${idx++}`;\n \n constructor(private el: ElementRef) { }\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch(item.getType()) {\n case 'header':\n this.headerTemplate = item.template;\n break;\n\n case 'content':\n this.contentTemplate = item.template;\n break;\n\n case 'footer':\n this.footerTemplate = item.template;\n break;\n\n case 'icons':\n this.iconTemplate = item.template;\n break;\n\n default:\n this.contentTemplate = item.template;\n break;\n }\n });\n }\n\n onHeaderClick(event: Event) {\n if (this.toggler === 'header') {\n this.toggle(event);\n }\n }\n\n onIconClick(event: Event) {\n if (this.toggler === 'icon') {\n this.toggle(event);\n }\n }\n \n toggle(event: Event) {\n if (this.animating) {\n return false;\n }\n \n this.animating = true;\n this.onBeforeToggle.emit({originalEvent: event, collapsed: this.collapsed});\n \n if (this.toggleable) {\n if (this.collapsed)\n this.expand(event);\n else\n this.collapse(event);\n }\n \n event.preventDefault();\n }\n \n expand(event) {\n this.collapsed = false;\n this.collapsedChange.emit(this.collapsed);\n }\n \n collapse(event) {\n this.collapsed = true;\n this.collapsedChange.emit(this.collapsed);\n }\n \n getBlockableElement(): HTMLElement {\n return this.el.nativeElement.children[0];\n }\n \n onToggleDone(event: Event) {\n this.animating = false;\n this.onAfterToggle.emit({originalEvent: event, collapsed: this.collapsed});\n }\n\n}\n\n@NgModule({\n imports: [CommonModule,SharedModule,RippleModule],\n exports: [Panel,SharedModule],\n declarations: [Panel]\n})\nexport class PanelModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAOA,IAAI,GAAG,GAAW,CAAC,CAAC;MAqDP,KAAK;IA4Cd,YAAoB,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;QAtCzB,cAAS,GAAY,KAAK,CAAC;QAM3B,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