{"version":3,"file":"primeng-inplace.umd.js","sources":["../../src/app/components/inplace/inplace.ts","../../src/app/components/inplace/primeng-inplace.ts"],"sourcesContent":["import {NgModule,Component,Input,Output,EventEmitter,ChangeDetectionStrategy, ViewEncapsulation, ChangeDetectorRef, AfterContentInit, TemplateRef, QueryList, ContentChildren} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ButtonModule} from 'primeng/button';\nimport {PrimeTemplate} from 'primeng/api';\n\n@Component({\n selector: 'p-inplaceDisplay',\n template: ''\n})\nexport class InplaceDisplay {}\n\n@Component({\n selector: 'p-inplaceContent',\n template: ''\n})\nexport class InplaceContent {}\n\n@Component({\n selector: 'p-inplace',\n template: `\n
\n
\n \n \n
\n
\n \n \n \n
\n
\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./inplace.css']\n})\nexport class Inplace implements AfterContentInit {\n\n @Input() active: boolean;\n\n @Input() closable: boolean;\n\n @Input() disabled: boolean;\n\n @Input() preventClick: boolean;\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @Input() closeIcon: string = 'pi pi-times';\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n @Output() onActivate: EventEmitter = new EventEmitter();\n\n @Output() onDeactivate: EventEmitter = new EventEmitter();\n\n hover: boolean;\n\n displayTemplate: TemplateRef;\n\n contentTemplate: TemplateRef;\n\n constructor(public cd: ChangeDetectorRef) {}\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch(item.getType()) {\n case 'display':\n this.displayTemplate = item.template;\n break;\n\n case 'content':\n this.contentTemplate = item.template;\n break;\n }\n });\n }\n\n onActivateClick(event) {\n if (!this.preventClick)\n this.activate(event);\n }\n\n onDeactivateClick(event) {\n if (!this.preventClick)\n this.deactivate(event);\n }\n\n activate(event?: Event) {\n if (!this.disabled) {\n this.active = true;\n this.onActivate.emit(event);\n this.cd.markForCheck();\n }\n }\n\n deactivate(event?: Event) {\n if (!this.disabled) {\n this.active = false;\n this.hover = false;\n this.onDeactivate.emit(event);\n this.cd.markForCheck();\n }\n }\n\n onKeydown(event: KeyboardEvent) {\n if (event.which === 13) {\n this.activate(event);\n event.preventDefault();\n }\n }\n}\n\n@NgModule({\n imports: [CommonModule,ButtonModule],\n exports: [Inplace,InplaceDisplay,InplaceContent,ButtonModule],\n declarations: [Inplace,InplaceDisplay,InplaceContent]\n})\nexport class InplaceModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["Component","EventEmitter","ChangeDetectionStrategy","ViewEncapsulation","ChangeDetectorRef","Input","ContentChildren","PrimeTemplate","Output","NgModule","CommonModule","ButtonModule"],"mappings":";;;;;;;QASA;;;;;gBAJCA,cAAS,SAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,QAAQ,EAAE,2BAA2B;iBACxC;;;QAOD;;;;;gBAJCA,cAAS,SAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,QAAQ,EAAE,2BAA2B;iBACxC;;;QAmDG,iBAAmB,EAAqB;YAArB,OAAE,GAAF,EAAE,CAAmB;YAd/B,cAAS,GAAW,aAAa,CAAC;YAIjC,eAAU,GAAsB,IAAIC,iBAAY,EAAE,CAAC;YAEnD,iBAAY,GAAsB,IAAIA,iBAAY,EAAE,CAAC;SAQnB;QAE5C,oCAAkB,GAAlB;YAAA,iBAYC;YAXG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAC,IAAI;gBACxB,QAAO,IAAI,CAAC,OAAO,EAAE;oBACjB,KAAK,SAAS;wBACV,KAAI,CAAC,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC;wBACzC,MAAM;oBAEN,KAAK,SAAS;wBACV,KAAI,CAAC,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC;wBACzC,MAAM;iBACT;aACJ,CAAC,CAAC;SACN;QAED,iCAAe,GAAf,UAAgB,KAAK;YACjB,IAAI,CAAC,IAAI,CAAC,YAAY;gBAClB,I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