diff --git a/api-generator/components/fullcalendar.js b/api-generator/components/fullcalendar.js deleted file mode 100644 index 8801d40bff..0000000000 --- a/api-generator/components/fullcalendar.js +++ /dev/null @@ -1,35 +0,0 @@ -const FullCalendarProps = [ - { - name: 'id', - type: 'string', - default: 'Unique identifier of the element.', - description: 'events' - }, - { - name: 'array', - type: 'An array of events to display.', - default: 'style', - description: 'object' - }, - { - name: 'Inline style of the component.', - type: 'className', - default: 'string', - description: 'ClassName of the component.' - } -]; - -const FullCalendarEvents = []; - -const FullCalendarStyles = []; - -module.exports = { - fullcalendar: { - name: 'FullCalendar', - description: 'FullCalendar React library is fully compatible with PrimeReact themes.', - docUrl: 'https://primefaces.org/primereact/showcase/#/fullcalendar', - props: FullCalendarProps, - events: FullCalendarEvents, - styles: FullCalendarStyles - } -}; diff --git a/components/lib/fullcalendar/FullCalendar.js b/components/lib/fullcalendar/FullCalendar.js deleted file mode 100644 index dd7ee87bde..0000000000 --- a/components/lib/fullcalendar/FullCalendar.js +++ /dev/null @@ -1,89 +0,0 @@ -import * as React from 'react'; -import { useMountEffect, usePrevious, useUnmountEffect, useUpdateEffect } from '../hooks/Hooks'; -import { ObjectUtils } from '../utils/Utils'; - -export const FullCalendar = React.memo( - React.forwardRef((props, ref) => { - const elementRef = React.useRef(null); - const config = React.useRef({}); - const calendar = React.useRef(null); - const prevEvents = usePrevious(props.events); - const prevOptions = usePrevious(props.options); - - const initialize = () => { - import('@fullcalendar/core').then((module) => { - if (module && module.Calendar) { - calendar.current = new module.Calendar(elementRef.current, config.current); - calendar.current.render(); - - if (props.events) { - calendar.current.removeAllEventSources(); - calendar.current.addEventSource(props.events); - } - } - }); - }; - - React.useImperativeHandle(ref, () => ({ - props, - getElement: () => elementRef.current - })); - - useMountEffect(() => { - // eslint-disable-next-line no-console - console.warn("FullCalendar component is deprecated. Use FullCalendar component of '@fullcalendar/react' package."); - - config.current = { - theme: true - }; - - if (props.options) { - for (let prop in props.options) { - config.current[prop] = props.options[prop]; - } - } - - initialize(); - }); - - useUpdateEffect(() => { - if (!calendar.current) { - initialize(); - } else { - if (!ObjectUtils.equals(prevEvents, props.events)) { - calendar.current.removeAllEventSources(); - calendar.addEventSource(props.events); - } - - if (!ObjectUtils.equals(prevOptions, props.options)) { - for (let prop in props.options) { - let optionValue = props.options[prop]; - - config.current[prop] = optionValue; - calendar.current.setOption(prop, optionValue); - } - } - } - }); - - useUnmountEffect(() => { - if (calendar.current) { - calendar.current.destroy(); - } - }); - - const otherProps = ObjectUtils.findDiffKeys(props, FullCalendar.defaultProps); - - return
; - }) -); - -FullCalendar.displayName = 'FullCalendar'; -FullCalendar.defaultProps = { - __TYPE: 'FullCalendar', - id: null, - events: [], - style: null, - className: null, - options: null -}; diff --git a/components/lib/fullcalendar/fullcalendar.d.ts b/components/lib/fullcalendar/fullcalendar.d.ts deleted file mode 100644 index dd5892d2c8..0000000000 --- a/components/lib/fullcalendar/fullcalendar.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; - -export interface FullCalendarProps { - id?: string; - events?: any[]; - style?: object; - className?: string; - options?: object; - children?: React.ReactNode; -} - -export declare class FullCalendar extends React.Component