{"version":3,"file":"primeng-panel.umd.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":["EventEmitter","Component","trigger","state","style","transition","animate","ChangeDetectionStrategy","ViewEncapsulation","ElementRef","Input","Output","ContentChild","Footer","ContentChildren","PrimeTemplate","NgModule","CommonModule","SharedModule","RippleModule"],"mappings":";;;;;;IAOA,I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