{"version":3,"file":"primeng-inplace.mjs","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 host: {\n 'class': 'p-element'\n }\n})\nexport class InplaceDisplay {}\n\n@Component({\n selector: 'p-inplaceContent',\n template: '',\n host: {\n 'class': 'p-element'\n }\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 host: {\n 'class': 'p-element'\n }\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":";;;;;;;;MAYa,cAAc;;2GAAd,cAAc;+FAAd,cAAc,+FALb,2BAA2B;2FAK5B,cAAc;kBAP1B,SAAS;mBAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,QAAQ,EAAE,2BAA2B;oBACrC,IAAI,EAAE;wBACF,OAAO,EAAE,WAAW;qBACvB;iBACJ;;MAUY,cAAc;;2GAAd,cAAc;+FAAd,cAAc,+FALb,2BAA2B;2FAK5B,cAAc;kBAP1B,SAAS;mBAAC;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,QAAQ,EAAE,2BAA2B;oBACrC,IAAI,EAAE;wBACF,OAAO,EAAE,WAAW;qBACvB;iBACJ;;MA0BY,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,SAA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