{"version":3,"file":"primeng-inplace.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":[],"mappings":";;;;;MASa,cAAc;;;YAJ1B,SAAS,SAAC;gBACP,QAAQ,EAAE,kBAAkB;gBAC5B,QAAQ,EAAE,2BAA2B;aACxC;;MAOY,cAAc;;;YAJ1B,SAAS,SAAC;gBACP,QAAQ,EAAE,kBAAkB;gBAC5B,QAAQ,EAAE,2BAA2B;aACxC;;MAuBY,OAAO;IA4BhB,YAAmB,EAAqB;QAArB,OAAE,GAAF,EAAE,CAAmB;QAd/B,cAAS,GAAW,aAAa,CAAC;QAIjC,eAAU,GAAsB,IAAI,YAAY,EAAE,CAAC;QAEnD,iBAAY,GAAsB,IAAI,YAAY,EAAE,CAAC;KAQnB;IAE5C,kBAAkB;QACd,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI;YACxB,QAAO,IAAI,CAAC,OAAO,EAAE;gBACjB,KAAK,SAAS;oBACV,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC;oBACzC,MAAM;gBAEN,KAAK,SAAS;oBACV,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC;oBACzC,MAAM;aACT;SACJ,CAAC,CAAC;KACN;IAED,eAAe,CAAC,KAAK;QACjB,IAAI,CAAC,IAAI,CAAC,YAAY;YAClB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;KAC5B;IAED,iBAAiB,CAAC,KAAK;QACnB,IAAI,CAAC,IAAI,CAAC,YAAY;YAClB,IAAI,CAAC,U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