[59329aa] | 1 | import { NgModule, Component, Input, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
---|
| 2 | import { CommonModule } from '@angular/common';
|
---|
| 3 | import { Calendar } from '@fullcalendar/core';
|
---|
| 4 | import * as i0 from "@angular/core";
|
---|
| 5 | import * as i1 from "@angular/common";
|
---|
| 6 | export class FullCalendar {
|
---|
| 7 | constructor(el) {
|
---|
| 8 | this.el = el;
|
---|
| 9 | }
|
---|
| 10 | ngOnInit() {
|
---|
| 11 | this.config = {
|
---|
| 12 | theme: true
|
---|
| 13 | };
|
---|
| 14 | if (this.options) {
|
---|
| 15 | for (let prop in this.options) {
|
---|
| 16 | this.config[prop] = this.options[prop];
|
---|
| 17 | }
|
---|
| 18 | }
|
---|
| 19 | }
|
---|
| 20 | ngAfterViewChecked() {
|
---|
| 21 | if (!this.initialized && this.el.nativeElement.offsetParent) {
|
---|
| 22 | this.initialize();
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 | get events() {
|
---|
| 26 | return this._events;
|
---|
| 27 | }
|
---|
| 28 | set events(value) {
|
---|
| 29 | this._events = value;
|
---|
| 30 | if (this._events && this.calendar) {
|
---|
| 31 | this.calendar.removeAllEventSources();
|
---|
| 32 | this.calendar.addEventSource(this._events);
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
| 35 | get options() {
|
---|
| 36 | return this._options;
|
---|
| 37 | }
|
---|
| 38 | set options(value) {
|
---|
| 39 | this._options = value;
|
---|
| 40 | if (this._options && this.calendar) {
|
---|
| 41 | for (let prop in this._options) {
|
---|
| 42 | let optionValue = this._options[prop];
|
---|
| 43 | this.config[prop] = optionValue;
|
---|
| 44 | this.calendar.setOption(prop, optionValue);
|
---|
| 45 | }
|
---|
| 46 | }
|
---|
| 47 | }
|
---|
| 48 | initialize() {
|
---|
| 49 | this.calendar = new Calendar(this.el.nativeElement.children[0], this.config);
|
---|
| 50 | this.calendar.render();
|
---|
| 51 | this.initialized = true;
|
---|
| 52 | if (this.events) {
|
---|
| 53 | this.calendar.removeAllEventSources();
|
---|
| 54 | this.calendar.addEventSource(this.events);
|
---|
| 55 | }
|
---|
| 56 | }
|
---|
| 57 | getCalendar() {
|
---|
| 58 | return this.calendar;
|
---|
| 59 | }
|
---|
| 60 | ngOnDestroy() {
|
---|
| 61 | if (this.calendar) {
|
---|
| 62 | this.calendar.destroy();
|
---|
| 63 | this.initialized = false;
|
---|
| 64 | this.calendar = null;
|
---|
| 65 | }
|
---|
| 66 | }
|
---|
| 67 | }
|
---|
| 68 | FullCalendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FullCalendar, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
---|
| 69 | FullCalendar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: FullCalendar, selector: "p-fullCalendar", inputs: { style: "style", styleClass: "styleClass", events: "events", options: "options" }, host: { classAttribute: "p-element" }, ngImport: i0, template: '<div [ngStyle]="style" [class]="styleClass"></div>', isInline: true, directives: [{ type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
---|
| 70 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FullCalendar, decorators: [{
|
---|
| 71 | type: Component,
|
---|
| 72 | args: [{
|
---|
| 73 | selector: 'p-fullCalendar',
|
---|
| 74 | template: '<div [ngStyle]="style" [class]="styleClass"></div>',
|
---|
| 75 | changeDetection: ChangeDetectionStrategy.OnPush,
|
---|
| 76 | encapsulation: ViewEncapsulation.None,
|
---|
| 77 | host: {
|
---|
| 78 | 'class': 'p-element'
|
---|
| 79 | }
|
---|
| 80 | }]
|
---|
| 81 | }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { style: [{
|
---|
| 82 | type: Input
|
---|
| 83 | }], styleClass: [{
|
---|
| 84 | type: Input
|
---|
| 85 | }], events: [{
|
---|
| 86 | type: Input
|
---|
| 87 | }], options: [{
|
---|
| 88 | type: Input
|
---|
| 89 | }] } });
|
---|
| 90 | export class FullCalendarModule {
|
---|
| 91 | }
|
---|
| 92 | FullCalendarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FullCalendarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
---|
| 93 | FullCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FullCalendarModule, declarations: [FullCalendar], imports: [CommonModule], exports: [FullCalendar] });
|
---|
| 94 | FullCalendarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FullCalendarModule, imports: [[CommonModule]] });
|
---|
| 95 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FullCalendarModule, decorators: [{
|
---|
| 96 | type: NgModule,
|
---|
| 97 | args: [{
|
---|
| 98 | imports: [CommonModule],
|
---|
| 99 | exports: [FullCalendar],
|
---|
| 100 | declarations: [FullCalendar]
|
---|
| 101 | }]
|
---|
| 102 | }] });
|
---|
| 103 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnVsbGNhbGVuZGFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2FwcC9jb21wb25lbnRzL2Z1bGxjYWxlbmRhci9mdWxsY2FsZW5kYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFFBQVEsRUFBQyxTQUFTLEVBQXNCLEtBQUssRUFBeUIsdUJBQXVCLEVBQUUsaUJBQWlCLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDL0ksT0FBTyxFQUFDLFlBQV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