{"version":3,"sources":["../../src/app/components/fullcalendar/fullcalendar.ts"],"names":["FullCalendar","el","this","prototype","ngOnInit","config","theme","options","prop","ngAfterViewChecked","initialized","nativeElement","offsetParent","initialize","Object","defineProperty","_events","value","calendar","removeAllEventSources","addEventSource","_options","optionValue","setOption","Calendar","children","render","events","getCalendar","ngOnDestroy","destroy","Component","args","selector","template","changeDetection","ChangeDetectionStrategy","OnPush","encapsulation","ViewEncapsulation","None","ElementRef","Input","NgModule","imports","CommonModule","exports","declarations"],"mappings":"0eA0BI,SAAAA,EAAmBC,GAAAC,KAAAD,GAAAA,SAEnBD,EAAAG,UAAAC,SAAA,WAKI,GAJAF,KAAKG,OAAS,CACVC,OAAO,GAGPJ,KAAKK,QACL,IAAK,IAAIC,KAAQN,KAAKK,QAClBL,KAAKG,OAAOG,GAAQN,KAAKK,QAAQC,IAK7CR,EAAAG,UAAAM,mBAAA,YACSP,KAAKQ,aAAeR,KAAKD,GAAGU,cAAcC,cAC3CV,KAAKW,cAIbC,OAAAC,eAAaf,EAAAG,UAAA,SAAM,KAAnB,WACI,OAAOD,KAAKc,aAGhB,SAAWC,GACPf,KAAKc,QAAUC,EAEXf,KAAKc,SAAWd,KAAKgB,WACrBhB,KAAKgB,SAASC,wBACdjB,KAAKgB,SAASE,eAAelB,KAAKc,2CAI1CF,OAAAC,eAAaf,EAAAG,UAAA,UAAO,KAApB,WACI,OAAOD,KAAKmB,cAGhB,SAAYJ,GAGR,GAFAf,KAAKmB,SAAWJ,EAEZf,KAAKmB,UAAYnB,KAAKgB,SACtB,IAAK,IAAIV,KAAQN,KAAKmB,SAAU,CAC5B,IAAIC,EAAcpB,KAAKmB,SAASb,GAChCN,KAAKG,OAAOG,GAAQc,EACpBpB,KAAKgB,SAASK,UAAUf,EAAMc,qCAK1CtB,EAAAG,UAAAU,WAAA,WACIX,KAAKgB,SAAW,IAAIM,EAAAA,SAAStB,KAAKD,GAAGU,cAAcc,SAAS,GAAIvB,KAAKG,QACrEH,KAAKgB,SAASQ,SACdxB,KAAKQ,aAAc,EAEfR,KAAKyB,SACLzB,KAAKgB,SAASC,wBACdjB,KAAKgB,SAASE,eAAelB,KAAKyB,UAI1C3B,EAAAG,UAAAyB,YAAA,WACI,OAAO1B,KAAKgB,UAGhBlB,EAAAG,UAAA0B,YAAA,WACQ3B,KAAKgB,WACLhB,KAAKgB,SAASY,UACd5B,KAAKQ,aAAc,EACnBR,KAAKgB,SAAW,gCA1F3Ba,EAAAA,UAASC,KAAA,CAAC,CACPC,SAAU,iBACVC,SAAU,qDACVC,gBAAiBC,EAAAA,wBAAwBC,OACzCC,cAAeC,EAAAA,kBAAkBC,kDARVC,EAAAA,6CAYtBC,EAAAA,0BAEAA,EAAAA,sBAgCAA,EAAAA,uBAaAA,EAAAA,eA6CL,iCALCC,EAAAA,SAAQX,KAAA,CAAC,CACNY,QAAS,CAACC,EAAAA,cACVC,QAAS,CAAC9C,GACV+C,aAAc,CAAC/C","sourcesContent":["import {NgModule,Component,ElementRef,OnDestroy,Input,OnInit,AfterViewChecked,ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {Calendar} from '@fullcalendar/core';\n\n@Component({\n selector: 'p-fullCalendar',\n template: '
',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class FullCalendar implements OnDestroy,OnInit,AfterViewChecked {\n \n @Input() style: any;\n\n @Input() styleClass: string;\n \n initialized: boolean;\n \n calendar: any;\n \n config: any;\n\n _options: any;\n\n _events: any[];\n\n constructor(public el: ElementRef) {}\n \n ngOnInit() {\n this.config = {\n theme: true\n };\n\n if (this.options) {\n for (let prop in this.options) {\n this.config[prop] = this.options[prop];\n }\n }\n }\n \n ngAfterViewChecked() {\n if (!this.initialized && this.el.nativeElement.offsetParent) {\n this.initialize();\n }\n }\n \n @Input() get events(): any {\n return this._events;\n }\n\n set events(value: any) {\n this._events = value;\n\n if (this._events && this.calendar) {\n this.calendar.removeAllEventSources();\n this.calendar.addEventSource(this._events);\n }\n }\n\n @Input() get options(): any {\n return this._options;\n }\n\n set options(value: any) {\n this._options = value;\n\n if (this._options && this.calendar) {\n for (let prop in this._options) {\n let optionValue = this._options[prop];\n this.config[prop] = optionValue;\n this.calendar.setOption(prop, optionValue);\n }\n }\n }\n\n initialize() {\n this.calendar = new Calendar(this.el.nativeElement.children[0], this.config);\n this.calendar.render();\n this.initialized = true;\n \n if (this.events) {\n this.calendar.removeAllEventSources();\n this.calendar.addEventSource(this.events);\n }\n }\n\n getCalendar() {\n return this.calendar;\n }\n \n ngOnDestroy() {\n if (this.calendar) {\n this.calendar.destroy();\n this.initialized = false;\n this.calendar = null;\n } \n }\n}\n\n@NgModule({\n imports: [CommonModule],\n exports: [FullCalendar],\n declarations: [FullCalendar]\n})\nexport class FullCalendarModule { }\n"]}