Fixed #3827 - FullCalendar: Deprecated component

pull/3841/head
Tuğçe Küçükoğlu 2023-03-31 17:24:17 +03:00
parent ac87f9a5d5
commit 977a6b560f
8 changed files with 789 additions and 1157 deletions

View File

@ -1,22 +0,0 @@
const FullCalendarProps = [
{
name: 'events',
type: 'array',
default: 'null',
description: 'An array of events to display.'
},
{
name: 'options',
type: 'object',
default: 'null',
description: 'A configuration object to define properties of FullCalendar.'
}
];
module.exports = {
fullcalendar: {
name: 'FullCalendar',
description: 'An event calendar based on the FullCalendar library.',
props: FullCalendarProps
}
};

View File

@ -1,34 +0,0 @@
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export interface FullCalendarProps {
events?: any[];
options?: object;
}
export interface FullCalendarSlots {}
export declare type FullCalendarEmits = {};
declare class FullCalendar extends ClassComponent<FullCalendarProps, FullCalendarSlots, FullCalendarEmits> {}
declare module '@vue/runtime-core' {
interface GlobalComponents {
FullCalendar: GlobalComponentConstructor<FullCalendar>;
}
}
/**
*
* PrimeVue provides theming for the FullCalendar Vue component.
*
* Helper API:
*
* - [FullCalendar](https://fullcalendar.io/docs/vue)
*
* Demos:
*
* - [FullCalendar](https://primevue.org/fullcalendar)
*
* @deprecated
*/
export default FullCalendar;

View File

@ -1,64 +0,0 @@
<template>
<div></div>
</template>
<script>
import '@fullcalendar/core/vdom'; // vite support
import { Calendar } from '@fullcalendar/core';
export default {
name: 'FullCalendar',
props: {
events: Array,
options: null
},
calendar: null,
watch: {
events(value) {
if (value && this.calendar) {
this.calendar.removeAllEventSources();
this.calendar.addEventSource(value);
}
},
options(value) {
if (value && this.calendar) {
for (let prop in value) {
this.calendar.setOption(prop, value[prop]);
}
}
}
},
mounted() {
if (this.$el.offsetParent) {
this.initialize();
}
},
updated() {
if (!this.calendar && this.$el.offsetParent) {
this.initialize();
}
},
beforeUnmount() {
if (this.calendar) {
this.calendar.destroy();
this.calendar = null;
}
},
methods: {
initialize() {
let defaultConfig = { themeSystem: 'standard' };
let config = this.options ? { ...this.options, ...defaultConfig } : defaultConfig;
this.calendar = new Calendar(this.$el, config);
this.calendar.render();
if (this.events) {
this.calendar.removeAllEventSources();
this.calendar.addEventSource(this.events);
}
}
}
};
</script>
<style></style>

View File

@ -1,9 +0,0 @@
{
"main": "./fullcalendar.cjs.js",
"module": "./fullcalendar.esm.js",
"unpkg": "./fullcalendar.min.js",
"types": "./FullCalendar.d.ts",
"browser": {
"./sfc": "./FullCalendar.vue"
}
}

1793
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -41,11 +41,6 @@
], ],
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.18.9", "@babel/eslint-parser": "^7.18.9",
"@fullcalendar/core": "^5.11.0",
"@fullcalendar/daygrid": "^5.11.0",
"@fullcalendar/interaction": "^5.11.0",
"@fullcalendar/timegrid": "^5.11.0",
"@fullcalendar/vue3": "^5.11.0",
"@stackblitz/sdk": "^1.8.2", "@stackblitz/sdk": "^1.8.2",
"@vitest/coverage-istanbul": "^0.26.2", "@vitest/coverage-istanbul": "^0.26.2",
"@vue/test-utils": "^2.0.0", "@vue/test-utils": "^2.0.0",

View File

@ -1,18 +0,0 @@
import '@fullcalendar/core/vdom'; // solve problem with Vite
import dayGridPlugin from '@fullcalendar/daygrid';
import interactionPlugin from '@fullcalendar/interaction';
import timeGridPlugin from '@fullcalendar/timegrid';
import FullCalendar from '@fullcalendar/vue3';
FullCalendar.options = {
plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin]
};
const $fullCalendar = {
install: (Vue, options) => {
Vue.config.globalProperties.$fullCalendar = FullCalendar;
}
};
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use($fullCalendar);
});

View File

@ -43,7 +43,6 @@ let coreDependencies = {
let globalDependencies = { let globalDependencies = {
vue: 'Vue', vue: 'Vue',
'@fullcalendar/core': 'FullCalendar',
...coreDependencies ...coreDependencies
}; };