{"version":3,"file":"primeng-fieldset.mjs","sources":["../../src/app/components/fieldset/fieldset.ts","../../src/app/components/fieldset/primeng-fieldset.ts"],"sourcesContent":["import { animate, state, style, transition, trigger } from '@angular/animations';\nimport { CommonModule } from '@angular/common';\nimport { AfterContentInit, AfterViewInit, ChangeDetectionStrategy, Component, ContentChildren, ElementRef, EventEmitter, Input, NgModule, Output, QueryList, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { BlockableUI, LicenseManager, PrimeTemplate, SharedModule } from 'primeng/api';\nimport { MinusIcon } from 'primeng/icons/minus';\nimport { PlusIcon } from 'primeng/icons/plus';\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 \n \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(\n 'hidden',\n style({\n height: '0'\n })\n ),\n state(\n 'visible',\n style({\n height: '*'\n })\n ),\n transition('visible <=> 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, AfterViewInit {\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 collapseIconTemplate: TemplateRef;\n\n expandIconTemplate: 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 'expandicon':\n this.expandIconTemplate = item.template;\n break;\n\n case 'collapseicon':\n this.collapseIconTemplate = item.template;\n break;\n\n case 'content':\n this.contentTemplate = item.template;\n break;\n }\n });\n }\n\n ngAfterViewInit() {\n LicenseManager.check();\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) this.expand(event);\n else 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() {\n this.animating = false;\n }\n}\n\n@NgModule({\n imports: [CommonModule, RippleModule, MinusIcon, PlusIcon],\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":";;;;;;;;;;;AAQA,IAAI,GAAG,GAAW,CAAC,CAAC;MAuEP,QAAQ,CAAA;AA+BjB,IAAA,WAAA,CAAoB,EAAc,EAAA;AAAd,QAAA,IAAE,CAAA,EAAA,GAAF,EAAE,CAAY;AA1BzB,QAAA,IAAS,CAAA,SAAA,GAAY,KAAK,CAAC;AAE1B,QAAA,IAAA,CAAA,eAAe,GAAsB,IAAI,YAAY,EAAE,CAAC;AAExD,QAAA,IAAA,CAAA,cAAc,GAAsB,IAAI,YAAY,EAAE,CAAC;AAEvD,QAAA,IAAA,CAAA,aAAa,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