{"version":3,"file":"primeng-fieldset.mjs","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 host: {\n 'class': 'p-element'\n }\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAOA,IAAI,GAAG,GAAW,CAAC,CAAC;MAiDP,QAAQ;IA4BjB,YAAoB,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;QAtBzB,cAAS,GAAY,KAAK,CAAC;QAE1B,oBAAe,GAAsB,IAAI,YAAY,EAAE,CAAC;QAExD,mBAAc,GAAsB,IAAI,YAAY,EAAE,CAAC;QAEvD,kBAAa,GAAsB,IAAI,YAAY,EAAE,CAAC;QAMvD,sBAAiB,GAAW,sCAAsC,CAAC;QAY5E,OAAE,GAAW,cAAc,GAAG,EAAE,EAAE,CAAC;KAFG;IAItC,kBAAkB;QACd,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI;YACxB,QAAO,IAAI,CAAC,OAAO,EAAE;gBACjB,KAAK,QAAQ;oBACT,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC;oBACxC,MAAM;gBAEN,KAAK,SAAS;oBACV,IAAI,CAAC,eAAe,GAAG,IA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