{"version":3,"file":"primeng-blockui.umd.js","sources":["../../src/app/components/blockui/blockui.ts","../../src/app/components/blockui/primeng-blockui.ts"],"sourcesContent":["import {NgModule,Component,Input,AfterViewInit,OnDestroy,ElementRef,ViewChild,ChangeDetectionStrategy, ViewEncapsulation, ChangeDetectorRef, ContentChildren, QueryList, TemplateRef} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {DomHandler} from 'primeng/dom';\nimport {PrimeTemplate} from 'primeng/api';\n\n@Component({\n selector: 'p-blockUI',\n template: `\n
\n \n \n
\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./blockui.css']\n})\nexport class BlockUI implements AfterViewInit,OnDestroy {\n\n @Input() target: any;\n \n @Input() autoZIndex: boolean = true;\n \n @Input() baseZIndex: number = 0;\n \n @Input() styleClass: string;\n \n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n @ViewChild('mask') mask: ElementRef;\n \n _blocked: boolean;\n\n contentTemplate: TemplateRef;\n \n constructor(public el: ElementRef, public cd: ChangeDetectorRef) {}\n \n @Input() get blocked(): boolean {\n return this._blocked;\n }\n \n set blocked(val: boolean) {\n this._blocked = val;\n \n if (this.mask && this.mask.nativeElement) {\n if (this._blocked)\n this.block();\n else\n this.unblock();\n }\n }\n \n ngAfterViewInit() {\n if (this.target && !this.target.getBlockableElement) {\n throw 'Target of BlockUI must implement BlockableUI interface';\n }\n }\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch(item.getType()) {\n case 'content':\n this.contentTemplate = item.template;\n break;\n \n default:\n this.contentTemplate = item.template;\n break;\n }\n });\n }\n \n block() {\n if (this.target) {\n this.target.getBlockableElement().appendChild(this.mask.nativeElement);\n this.target.getBlockableElement().style.position = 'relative';\n }\n else {\n document.body.appendChild(this.mask.nativeElement);\n }\n \n if (this.autoZIndex) {\n this.mask.nativeElement.style.zIndex = String(this.baseZIndex + (++DomHandler.zindex));\n }\n }\n \n unblock() {\n this.el.nativeElement.appendChild(this.mask.nativeElement);\n }\n \n ngOnDestroy() {\n this.unblock();\n }\n}\n\n@NgModule({\n imports: [CommonModule],\n exports: [BlockUI],\n declarations: [BlockUI]\n})\nexport class BlockUIModule { }","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["DomHandler","Component","ChangeDetectionStrategy","ViewEncapsulation","ElementRef","ChangeDetectorRef","Input","ContentChildren","PrimeTemplate","ViewChild","NgModule","CommonModule"],"mappings":";;;;;;;QAmCI,iBAAmB,EAAc,EAAS,EAAqB;YAA5C,OAAE,GAAF,EAAE,CAAY;YAAS,OAAE,GAAF,EAAE,CAAmB;YAdtD,eAAU,GAAY,IAAI,CAAC;YAE3B,eAAU,GAAW,CAAC,CAAC;SAYmC;QAEnE,sBAAa,4BAAO;iBAApB;gBACI,OAAO,IAAI,CAAC,QAAQ,CAAC;aACxB;iBAED,UAAY,GAAY;gBACpB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;gBAEpB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;oBACtC,IAAI,IAAI,CAAC,QAAQ;wBACb,IAAI,CAAC,KAAK,EAAE,CAAC;;wBAEb,IAAI,CAAC,OAAO,EAAE,CAAC;iBACtB;aACJ;;;WAXA;QAaD,iCAAe,GAAf;YACI,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE;gBACjD,MAAM,wDAAwD,CAAC;aAClE;SACJ;QAED,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;wBACI,KAAI,CAAC,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC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