{"version":3,"sources":["../../src/app/components/card/card.ts"],"names":["Card","el","this","prototype","ngAfterContentInit","_this","templates","forEach","item","getType","headerTemplate","template","titleTemplate","subtitleTemplate","contentTemplate","footerTemplate","getBlockableElement","nativeElement","children","Component","args","selector","changeDetection","ChangeDetectionStrategy","OnPush","encapsulation","ViewEncapsulation","None","ElementRef","Input","ContentChild","Header","Footer","ContentChildren","PrimeTemplate","NgModule","imports","CommonModule","exports","SharedModule","declarations"],"mappings":"mdA+DI,SAAAA,EAAoBC,GAAAC,KAAAD,GAAAA,SAEpBD,EAAAG,UAAAC,mBAAA,WAAA,IAAAC,EAAAH,KACIA,KAAKI,UAAUC,SAAQ,SAACC,GACpB,OAAOA,EAAKC,WACR,IAAK,SACDJ,EAAKK,eAAiBF,EAAKG,SAC/B,MAEA,IAAK,QACDN,EAAKO,cAAgBJ,EAAKG,SAC9B,MAEA,IAAK,WACDN,EAAKQ,iBAAmBL,EAAKG,SACjC,MAEA,IAAK,UACDN,EAAKS,gBAAkBN,EAAKG,SAChC,MAEA,IAAK,SACDN,EAAKU,eAAiBP,EAAKG,SAC/B,MAEA,QACIN,EAAKS,gBAAkBN,EAAKG,cAM5CX,EAAAG,UAAAa,oBAAA,WACI,OAAOd,KAAKD,GAAGgB,cAAcC,SAAS,6BA3F7CC,EAAAA,UAASC,KAAA,CAAC,CACPC,SAAU,SACVV,SAAU,8yCA0BXW,gBAAiBC,EAAAA,wBAAwBC,OACxCC,cAAeC,EAAAA,kBAAkBC,4FAlCAC,EAAAA,8CAuChCC,EAAAA,yBAEAA,EAAAA,qBAEAA,EAAAA,0BAEAA,EAAAA,2BAEAC,EAAAA,aAAYV,KAAA,CAACW,EAAAA,6BAEbD,EAAAA,aAAYV,KAAA,CAACY,EAAAA,2BAEbC,EAAAA,gBAAeb,KAAA,CAACc,EAAAA,wBAuDrB,iCALCC,EAAAA,SAAQf,KAAA,CAAC,CACNgB,QAAS,CAACC,EAAAA,cACVC,QAAS,CAACtC,EAAMuC,EAAAA,cAChBC,aAAc,CAACxC","sourcesContent":["import { NgModule, Component, Input, ElementRef, ContentChild, ChangeDetectionStrategy, ViewEncapsulation, TemplateRef, AfterContentInit, ContentChildren, QueryList } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SharedModule, Header, Footer, PrimeTemplate } from 'primeng/api';\nimport { BlockableUI } from 'primeng/api';\n\n@Component({\n selector: 'p-card',\n template: `\n
\n
\n \n \n
\n
\n
\n {{header}}\n \n
\n
\n {{subheader}}\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./card.css']\n})\nexport class Card implements AfterContentInit,BlockableUI {\n\n @Input() header: string;\n\n @Input() subheader: string;\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @ContentChild(Header) headerFacet;\n\n @ContentChild(Footer) footerFacet;\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n headerTemplate: TemplateRef;\n \n titleTemplate: TemplateRef;\n \n subtitleTemplate: TemplateRef;\n \n contentTemplate: TemplateRef;\n \n footerTemplate: TemplateRef;\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 'title':\n this.titleTemplate = item.template;\n break;\n\n case 'subtitle':\n this.subtitleTemplate = 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 default:\n this.contentTemplate = item.template;\n break;\n }\n });\n }\n\n getBlockableElement(): HTMLElement  {\n return this.el.nativeElement.children[0];\n }\n\n}\n\n@NgModule({\n imports: [CommonModule],\n exports: [Card, SharedModule],\n declarations: [Card]\n})\nexport class CardModule { }\n"]}