{"version":3,"file":"primeng-fieldset.umd.js","sources":["../../src/app/components/fieldset/fieldset.ts","../../src/app/components/fieldset/primeng-fieldset.ts"],"sourcesContent":["import {NgModule,Component,Input,Output,EventEmitter,ElementRef,ChangeDetectionStrategy, ViewEncapsulation, AfterContentInit, QueryList, ContentChildren, TemplateRef} from '@angular/core';\nimport {trigger,state,style,transition,animate} from '@angular/animations';\nimport {CommonModule} from '@angular/common';\nimport {SharedModule, PrimeTemplate} from 'primeng/api';\nimport {BlockableUI} from 'primeng/api';\nimport {RippleModule} from 'primeng/ripple'; \n\nlet idx: number = 0;\n\n@Component({\n selector: 'p-fieldset',\n template: `\n
\n \n \n \n \n \n \n \n \n {{legend}}\n \n \n \n \n
\n
\n \n \n
\n
\n
\n `,\n animations: [\n trigger('fieldsetContent', [\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: ['./fieldset.css']\n})\nexport class Fieldset implements AfterContentInit,BlockableUI {\n\n @Input() legend: string;\n\n @Input() toggleable: boolean;\n\n @Input() collapsed: boolean = false;\n\n @Output() collapsedChange: EventEmitter = new EventEmitter();\n \n @Output() onBeforeToggle: EventEmitter = new EventEmitter();\n\n @Output() onAfterToggle: EventEmitter = new EventEmitter();\n \n @Input() style: any;\n \n @Input() styleClass: string;\n\n @Input() transitionOptions: string = '400ms cubic-bezier(0.86, 0, 0.07, 1)';\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n \n public animating: boolean;\n\n headerTemplate: TemplateRef;\n\n contentTemplate: TemplateRef;\n \n constructor(private el: ElementRef) {}\n \n id: string = `p-fieldset-${idx++}`;\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 });\n }\n \n toggle(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.collapsed)\n this.expand(event);\n else\n this.collapse(event);\n \n this.onAfterToggle.emit({originalEvent: event, collapsed: this.collapsed}); \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 }\n\n}\n\n@NgModule({\n imports: [CommonModule,RippleModule],\n exports: [Fieldset,SharedModule],\n declarations: [Fieldset]\n})\nexport class FieldsetModule { }","/**\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","ContentChildren","PrimeTemplate","NgModule","CommonModule","RippleModule","SharedModule"],"mappings":";;;;;;IAOA,IAAI,GAAG,GAAW,CAAC,CAAC;;QA0EhB,kBAAoB,EAAc;YAAd,OAAE,GAAF,EAAE,CAAY;YAtBzB,cAAS,GAAY,KAAK,CAAC;YAE1B,oBAAe,GAAsB,IAAIA,iBAAY,EAAE,CAAC;YAExD,mBAAc,GAAsB,IAAIA,iBAAY,EAAE,CAAC;YAEvD,kBAAa,GAAsB,IAAIA,iBAAY,EAAE,CAAC;YAMvD,sBAAiB,GAAW,sCAAsC,CAAC;YAY5E,OAAE,GAAW,gBAAc,GAAG,EAAI,CAAC;SAFG;QAItC,qCAAkB,GAAlB;YAAA,iBAYC;YAXG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAC,IAAI;gBACxB,QAAO,IAAI,CAAC,OAAO,EAAE;oBACjB,KAAK,QAAQ;wBACT,KAAI,CAAC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