@fullcalendar/mui 7.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +22 -0
- package/README.md +79 -0
- package/breezy/theme.css +987 -0
- package/cjs/breezy/EventCalendar.cjs +62 -0
- package/cjs/breezy/EventCalendarContainer.cjs +35 -0
- package/cjs/breezy/EventCalendarToolbar.cjs +65 -0
- package/cjs/breezy/EventCalendarViews.cjs +283 -0
- package/cjs/breezy/ResourceTimeGrid.cjs +57 -0
- package/cjs/breezy/ResourceTimeline.cjs +54 -0
- package/cjs/breezy/SchedulerViews.cjs +70 -0
- package/cjs/breezy/icons.cjs +37 -0
- package/cjs/classic/EventCalendar.cjs +62 -0
- package/cjs/classic/EventCalendarContainer.cjs +22 -0
- package/cjs/classic/EventCalendarToolbar.cjs +62 -0
- package/cjs/classic/EventCalendarViews.cjs +230 -0
- package/cjs/classic/ResourceTimeGrid.cjs +57 -0
- package/cjs/classic/ResourceTimeline.cjs +54 -0
- package/cjs/classic/SchedulerViews.cjs +74 -0
- package/cjs/classic/icons.cjs +37 -0
- package/cjs/forma/EventCalendar.cjs +62 -0
- package/cjs/forma/EventCalendarContainer.cjs +35 -0
- package/cjs/forma/EventCalendarToolbar.cjs +64 -0
- package/cjs/forma/EventCalendarViews.cjs +251 -0
- package/cjs/forma/ResourceTimeGrid.cjs +57 -0
- package/cjs/forma/ResourceTimeline.cjs +54 -0
- package/cjs/forma/SchedulerViews.cjs +62 -0
- package/cjs/forma/icons.cjs +37 -0
- package/cjs/monarch/EventCalendar.cjs +62 -0
- package/cjs/monarch/EventCalendarContainer.cjs +35 -0
- package/cjs/monarch/EventCalendarToolbar.cjs +62 -0
- package/cjs/monarch/EventCalendarViews.cjs +252 -0
- package/cjs/monarch/ResourceTimeGrid.cjs +57 -0
- package/cjs/monarch/ResourceTimeline.cjs +54 -0
- package/cjs/monarch/SchedulerViews.cjs +83 -0
- package/cjs/monarch/icons.cjs +37 -0
- package/cjs/pulse/EventCalendar.cjs +62 -0
- package/cjs/pulse/EventCalendarContainer.cjs +22 -0
- package/cjs/pulse/EventCalendarToolbar.cjs +62 -0
- package/cjs/pulse/EventCalendarViews.cjs +268 -0
- package/cjs/pulse/ResourceTimeGrid.cjs +57 -0
- package/cjs/pulse/ResourceTimeline.cjs +54 -0
- package/cjs/pulse/SchedulerViews.cjs +58 -0
- package/cjs/pulse/icons.cjs +37 -0
- package/classic/theme.css +811 -0
- package/esm/breezy/EventCalendar.d.ts +15 -0
- package/esm/breezy/EventCalendar.js +49 -0
- package/esm/breezy/EventCalendarContainer.d.ts +15 -0
- package/esm/breezy/EventCalendarContainer.js +26 -0
- package/esm/breezy/EventCalendarToolbar.d.ts +16 -0
- package/esm/breezy/EventCalendarToolbar.js +51 -0
- package/esm/breezy/EventCalendarViews.d.ts +33 -0
- package/esm/breezy/EventCalendarViews.js +250 -0
- package/esm/breezy/ResourceTimeGrid.d.ts +15 -0
- package/esm/breezy/ResourceTimeGrid.js +45 -0
- package/esm/breezy/ResourceTimeline.d.ts +15 -0
- package/esm/breezy/ResourceTimeline.js +43 -0
- package/esm/breezy/SchedulerViews.d.ts +8 -0
- package/esm/breezy/SchedulerViews.js +62 -0
- package/esm/breezy/icons.d.ts +11 -0
- package/esm/breezy/icons.js +22 -0
- package/esm/classic/EventCalendar.d.ts +15 -0
- package/esm/classic/EventCalendar.js +49 -0
- package/esm/classic/EventCalendarContainer.d.ts +11 -0
- package/esm/classic/EventCalendarContainer.js +13 -0
- package/esm/classic/EventCalendarToolbar.d.ts +17 -0
- package/esm/classic/EventCalendarToolbar.js +48 -0
- package/esm/classic/EventCalendarViews.d.ts +31 -0
- package/esm/classic/EventCalendarViews.js +205 -0
- package/esm/classic/ResourceTimeGrid.d.ts +15 -0
- package/esm/classic/ResourceTimeGrid.js +45 -0
- package/esm/classic/ResourceTimeline.d.ts +15 -0
- package/esm/classic/ResourceTimeline.js +43 -0
- package/esm/classic/SchedulerViews.d.ts +8 -0
- package/esm/classic/SchedulerViews.js +66 -0
- package/esm/classic/icons.d.ts +11 -0
- package/esm/classic/icons.js +22 -0
- package/esm/forma/EventCalendar.d.ts +15 -0
- package/esm/forma/EventCalendar.js +49 -0
- package/esm/forma/EventCalendarContainer.d.ts +15 -0
- package/esm/forma/EventCalendarContainer.js +26 -0
- package/esm/forma/EventCalendarToolbar.d.ts +16 -0
- package/esm/forma/EventCalendarToolbar.js +50 -0
- package/esm/forma/EventCalendarViews.d.ts +30 -0
- package/esm/forma/EventCalendarViews.js +221 -0
- package/esm/forma/ResourceTimeGrid.d.ts +15 -0
- package/esm/forma/ResourceTimeGrid.js +45 -0
- package/esm/forma/ResourceTimeline.d.ts +15 -0
- package/esm/forma/ResourceTimeline.js +43 -0
- package/esm/forma/SchedulerViews.d.ts +8 -0
- package/esm/forma/SchedulerViews.js +54 -0
- package/esm/forma/icons.d.ts +11 -0
- package/esm/forma/icons.js +22 -0
- package/esm/monarch/EventCalendar.d.ts +15 -0
- package/esm/monarch/EventCalendar.js +49 -0
- package/esm/monarch/EventCalendarContainer.d.ts +15 -0
- package/esm/monarch/EventCalendarContainer.js +26 -0
- package/esm/monarch/EventCalendarToolbar.d.ts +16 -0
- package/esm/monarch/EventCalendarToolbar.js +48 -0
- package/esm/monarch/EventCalendarViews.d.ts +27 -0
- package/esm/monarch/EventCalendarViews.js +225 -0
- package/esm/monarch/ResourceTimeGrid.d.ts +15 -0
- package/esm/monarch/ResourceTimeGrid.js +45 -0
- package/esm/monarch/ResourceTimeline.d.ts +15 -0
- package/esm/monarch/ResourceTimeline.js +43 -0
- package/esm/monarch/SchedulerViews.d.ts +8 -0
- package/esm/monarch/SchedulerViews.js +75 -0
- package/esm/monarch/icons.d.ts +11 -0
- package/esm/monarch/icons.js +22 -0
- package/esm/pulse/EventCalendar.d.ts +15 -0
- package/esm/pulse/EventCalendar.js +49 -0
- package/esm/pulse/EventCalendarContainer.d.ts +11 -0
- package/esm/pulse/EventCalendarContainer.js +13 -0
- package/esm/pulse/EventCalendarToolbar.d.ts +17 -0
- package/esm/pulse/EventCalendarToolbar.js +48 -0
- package/esm/pulse/EventCalendarViews.d.ts +29 -0
- package/esm/pulse/EventCalendarViews.js +239 -0
- package/esm/pulse/ResourceTimeGrid.d.ts +15 -0
- package/esm/pulse/ResourceTimeGrid.js +45 -0
- package/esm/pulse/ResourceTimeline.d.ts +15 -0
- package/esm/pulse/ResourceTimeline.js +43 -0
- package/esm/pulse/SchedulerViews.d.ts +8 -0
- package/esm/pulse/SchedulerViews.js +50 -0
- package/esm/pulse/icons.d.ts +11 -0
- package/esm/pulse/icons.js +22 -0
- package/forma/theme.css +936 -0
- package/monarch/theme.css +1014 -0
- package/package.json +371 -0
- package/pulse/theme.css +913 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { joinClassNames } from '@fullcalendar/core';
|
|
3
|
+
import EventCalendarViews, { mutedBgClass, mutedHoverPressableClass, outlineWidthFocusClass, primaryOutlineColorClass, strongSolidPressableClass } from './EventCalendarViews.js';
|
|
4
|
+
import { EventCalendarExpanderIcon } from './icons.js';
|
|
5
|
+
import '@fullcalendar/react';
|
|
6
|
+
import '@mui/material';
|
|
7
|
+
import '@mui/icons-material/ChevronLeft';
|
|
8
|
+
import '@mui/icons-material/ChevronRight';
|
|
9
|
+
import '@mui/icons-material/Close';
|
|
10
|
+
import '@mui/icons-material/ExpandMore';
|
|
11
|
+
|
|
12
|
+
function SchedulerViews({ views: userViews, ...restOptions }) {
|
|
13
|
+
return (React.createElement(EventCalendarViews
|
|
14
|
+
/* Resource Day Header
|
|
15
|
+
------------------------------------------------------------------------------------------- */
|
|
16
|
+
, {
|
|
17
|
+
/* Resource Day Header
|
|
18
|
+
------------------------------------------------------------------------------------------- */
|
|
19
|
+
resourceDayHeaderAlign: "center", resourceDayHeaderClass: "fc-breezy-UZp", resourceDayHeaderInnerClass: (data) => joinClassNames(`fc-breezy-aS8 fc-breezy-HBk fc-breezy-RKK`, data.isNarrow ? "fc-breezy-17F" : "fc-breezy-gEy"),
|
|
20
|
+
/* Resource Data Grid
|
|
21
|
+
------------------------------------------------------------------------------------------- */
|
|
22
|
+
resourceColumnHeaderClass: "fc-breezy-UZp fc-breezy-G56 fc-breezy-a65", resourceColumnHeaderInnerClass: "fc-breezy-aS8 fc-breezy-HBk fc-breezy-gEy", resourceColumnResizerClass: "fc-breezy-YA2 fc-breezy-8ZZ fc-breezy-Ahl fc-breezy-W3O", resourceGroupHeaderClass: `fc-breezy-UZp fc-breezy-G56 ${mutedBgClass}`, resourceGroupHeaderInnerClass: "fc-breezy-aS8 fc-breezy-HBk fc-breezy-gEy", resourceCellClass: "fc-breezy-UZp fc-breezy-G56", resourceCellInnerClass: "fc-breezy-aS8 fc-breezy-HBk fc-breezy-gEy", resourceIndentClass: "fc-breezy-fpO fc-breezy-aCj fc-breezy-a65", resourceExpanderClass: `fc-breezy-ytQ fc-breezy-KbZ fc-breezy-IdG ${mutedHoverPressableClass} ${outlineWidthFocusClass} ${primaryOutlineColorClass}`, resourceExpanderContent: (data) => (React.createElement(EventCalendarExpanderIcon, { isExpanded: data.isExpanded })), resourceHeaderRowClass: "fc-breezy-UZp fc-breezy-G56", resourceRowClass: "fc-breezy-UZp fc-breezy-G56", resourceColumnDividerClass: "fc-breezy-EWl fc-breezy-I55",
|
|
23
|
+
/* Timeline Lane
|
|
24
|
+
------------------------------------------------------------------------------------------- */
|
|
25
|
+
resourceGroupLaneClass: `fc-breezy-UZp fc-breezy-G56 ${mutedBgClass}`, resourceLaneClass: "fc-breezy-UZp fc-breezy-G56", resourceLaneBottomClass: (data) => joinClassNames(data.options.eventOverlap && "fc-breezy-433"), timelineBottomClass: "fc-breezy-433",
|
|
26
|
+
/* View-Specific Options
|
|
27
|
+
------------------------------------------------------------------------------------------- */
|
|
28
|
+
views: {
|
|
29
|
+
...userViews,
|
|
30
|
+
resourceDayGrid: {
|
|
31
|
+
resourceDayHeaderClass: (data) => (data.isMajor
|
|
32
|
+
? "fc-breezy-I55"
|
|
33
|
+
: "fc-breezy-G56"),
|
|
34
|
+
...userViews?.resourceDayGrid,
|
|
35
|
+
},
|
|
36
|
+
resourceTimeGrid: {
|
|
37
|
+
resourceDayHeaderClass: (data) => (data.isMajor
|
|
38
|
+
? "fc-breezy-I55"
|
|
39
|
+
: "fc-breezy-G56"),
|
|
40
|
+
...userViews?.resourceTimeGrid,
|
|
41
|
+
},
|
|
42
|
+
timeline: {
|
|
43
|
+
/* Timeline > Row Event
|
|
44
|
+
--------------------------------------------------------------------------------------- */
|
|
45
|
+
rowEventClass: (data) => joinClassNames(data.isEnd && "fc-breezy-bpq"),
|
|
46
|
+
rowEventInnerClass: (data) => data.options.eventOverlap ? "fc-breezy-ztx" : "fc-breezy-KyB",
|
|
47
|
+
/* Timeline > More-Link
|
|
48
|
+
--------------------------------------------------------------------------------------- */
|
|
49
|
+
rowMoreLinkClass: `fc-breezy-bpq fc-breezy-mwm fc-breezy-UZp fc-breezy-lqW fc-breezy-ePV fc-breezy-UPi ${strongSolidPressableClass} fc-breezy-82y`,
|
|
50
|
+
rowMoreLinkInnerClass: `fc-breezy-xbC fc-breezy-HBk fc-breezy-17F`,
|
|
51
|
+
/* Timeline > Slot Header
|
|
52
|
+
--------------------------------------------------------------------------------------- */
|
|
53
|
+
slotHeaderAlign: (data) => data.isTime ? "start" : "center",
|
|
54
|
+
slotHeaderClass: (data) => joinClassNames(data.level > 0 && `fc-breezy-UZp fc-breezy-G56`, "fc-breezy-RhI"),
|
|
55
|
+
slotHeaderInnerClass: (data) => joinClassNames("fc-breezy-U10 fc-breezy-KyB fc-breezy-17F", data.isTime && joinClassNames("fc-breezy-vPs fc-breezy-prr", data.isFirst && "fc-breezy-C9h"), data.hasNavLink && "fc-breezy-jaW"),
|
|
56
|
+
slotHeaderDividerClass: `fc-breezy-QTT fc-breezy-I55 fc-breezy-5jb`,
|
|
57
|
+
...userViews?.timeline,
|
|
58
|
+
},
|
|
59
|
+
}, ...restOptions }));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { SchedulerViews as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
declare function EventCalendarPrevIcon(): React.JSX.Element;
|
|
4
|
+
declare function EventCalendarNextIcon(): React.JSX.Element;
|
|
5
|
+
declare function EventCalendarCloseIcon(): React.JSX.Element;
|
|
6
|
+
interface EventCalendarExpanderIconProps {
|
|
7
|
+
isExpanded: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function EventCalendarExpanderIcon({ isExpanded }: EventCalendarExpanderIconProps): React.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { EventCalendarCloseIcon, EventCalendarExpanderIcon, EventCalendarExpanderIconProps, EventCalendarNextIcon, EventCalendarPrevIcon };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { joinClassNames } from '@fullcalendar/core';
|
|
3
|
+
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
|
|
4
|
+
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
5
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
6
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
7
|
+
|
|
8
|
+
const pressableIconClass = "fc-breezy-5Kh fc-breezy-HHp fc-breezy-La2";
|
|
9
|
+
function EventCalendarPrevIcon() {
|
|
10
|
+
return React.createElement(ChevronLeftIcon, { className: "fc-breezy-AAt" });
|
|
11
|
+
}
|
|
12
|
+
function EventCalendarNextIcon() {
|
|
13
|
+
return React.createElement(ChevronRightIcon, { className: "fc-breezy-AAt" });
|
|
14
|
+
}
|
|
15
|
+
function EventCalendarCloseIcon() {
|
|
16
|
+
return (React.createElement(CloseIcon, { sx: { fontSize: 18, margin: "1px" }, className: pressableIconClass }));
|
|
17
|
+
}
|
|
18
|
+
function EventCalendarExpanderIcon({ isExpanded }) {
|
|
19
|
+
return (React.createElement(ExpandMoreIcon, { sx: { fontSize: 18, margin: "1px" }, className: joinClassNames(pressableIconClass, !isExpanded && "fc-breezy-doO fc-breezy-Bzb") }));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { EventCalendarCloseIcon, EventCalendarExpanderIcon, EventCalendarNextIcon, EventCalendarPrevIcon };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarOptions } from '@fullcalendar/core';
|
|
3
|
+
|
|
4
|
+
interface EventCalendarProps extends Omit<CalendarOptions, 'class'> {
|
|
5
|
+
availableViews?: string[];
|
|
6
|
+
addButton?: {
|
|
7
|
+
isPrimary?: boolean;
|
|
8
|
+
text?: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
click?: (ev: MouseEvent) => void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare function EventCalendar({ availableViews, addButton, className, height, contentHeight, direction, plugins: userPlugins, ...restOptions }: EventCalendarProps): React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { EventCalendarProps, EventCalendar as default };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useCalendarController } from '@fullcalendar/react';
|
|
3
|
+
import dayGridPlugin from '@fullcalendar/daygrid';
|
|
4
|
+
import timeGridPlugin from '@fullcalendar/timegrid';
|
|
5
|
+
import listPlugin from '@fullcalendar/list';
|
|
6
|
+
import interactionPlugin from '@fullcalendar/interaction';
|
|
7
|
+
import multiMonthPlugin from '@fullcalendar/multimonth';
|
|
8
|
+
import EventCalendarToolbar from './EventCalendarToolbar.js';
|
|
9
|
+
import EventCalendarViews from './EventCalendarViews.js';
|
|
10
|
+
import EventCalendarContainer from './EventCalendarContainer.js';
|
|
11
|
+
import '@mui/material/Box';
|
|
12
|
+
import '@mui/material/Button';
|
|
13
|
+
import '@mui/material/IconButton';
|
|
14
|
+
import '@mui/material/Typography';
|
|
15
|
+
import '@mui/material/ToggleButtonGroup';
|
|
16
|
+
import '@mui/material/ToggleButton';
|
|
17
|
+
import './icons.js';
|
|
18
|
+
import '@fullcalendar/core';
|
|
19
|
+
import '@mui/icons-material/ChevronLeft';
|
|
20
|
+
import '@mui/icons-material/ChevronRight';
|
|
21
|
+
import '@mui/icons-material/Close';
|
|
22
|
+
import '@mui/icons-material/ExpandMore';
|
|
23
|
+
import '@mui/material';
|
|
24
|
+
|
|
25
|
+
const plugins = [
|
|
26
|
+
dayGridPlugin,
|
|
27
|
+
timeGridPlugin,
|
|
28
|
+
listPlugin,
|
|
29
|
+
interactionPlugin,
|
|
30
|
+
multiMonthPlugin,
|
|
31
|
+
];
|
|
32
|
+
const defaultAvailableViews = [
|
|
33
|
+
'dayGridMonth',
|
|
34
|
+
'timeGridWeek',
|
|
35
|
+
'timeGridDay',
|
|
36
|
+
'listWeek',
|
|
37
|
+
'multiMonthYear',
|
|
38
|
+
];
|
|
39
|
+
const navLinkDayClick = 'timeGridDay';
|
|
40
|
+
const navLinkWeekClick = 'timeGridWeek';
|
|
41
|
+
function EventCalendar({ availableViews = defaultAvailableViews, addButton, className, height, contentHeight, direction, plugins: userPlugins = [], ...restOptions }) {
|
|
42
|
+
const controller = useCalendarController();
|
|
43
|
+
const autoHeight = height === 'auto' || contentHeight === 'auto';
|
|
44
|
+
return (React.createElement(EventCalendarContainer, { direction: direction, className: className, height: height },
|
|
45
|
+
React.createElement(EventCalendarToolbar, { controller: controller, availableViews: availableViews, addButton: addButton, borderlessX: restOptions.borderlessX ?? restOptions.borderless }),
|
|
46
|
+
React.createElement(EventCalendarViews, { liquidHeight: !autoHeight && height !== undefined, height: autoHeight ? 'auto' : contentHeight, initialView: availableViews[0], navLinkDayClick: navLinkDayClick, navLinkWeekClick: navLinkWeekClick, controller: controller, plugins: [...plugins, ...userPlugins], ...restOptions })));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { EventCalendar as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface EventCalendarContainerProps {
|
|
4
|
+
direction: 'ltr' | 'rtl' | undefined;
|
|
5
|
+
className: string | undefined;
|
|
6
|
+
height: string | number | undefined;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function EventCalendarContainer(props: EventCalendarContainerProps): React.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { EventCalendarContainerProps, EventCalendarContainer as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
|
|
4
|
+
function EventCalendarContainer(props) {
|
|
5
|
+
return (React.createElement(Box, { dir: props.direction === 'rtl' ? 'rtl' : undefined, className: props.className, sx: {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'column',
|
|
8
|
+
gap: 2.5,
|
|
9
|
+
height: props.height,
|
|
10
|
+
} }, props.children));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { EventCalendarContainer as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarController } from '@fullcalendar/core';
|
|
3
|
+
|
|
4
|
+
interface EventCalendarToolbarProps {
|
|
5
|
+
controller: CalendarController;
|
|
6
|
+
availableViews: string[];
|
|
7
|
+
addButton?: {
|
|
8
|
+
isPrimary?: boolean;
|
|
9
|
+
text?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
click?: (ev: MouseEvent) => void;
|
|
12
|
+
};
|
|
13
|
+
borderlessX?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function EventCalendarToolbar({ controller, availableViews, addButton, borderlessX, }: EventCalendarToolbarProps): React.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { EventCalendarToolbarProps, EventCalendarToolbar as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
|
+
import IconButton from '@mui/material/IconButton';
|
|
5
|
+
import Typography from '@mui/material/Typography';
|
|
6
|
+
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|
7
|
+
import ToggleButton from '@mui/material/ToggleButton';
|
|
8
|
+
import { EventCalendarPrevIcon, EventCalendarNextIcon } from './icons.js';
|
|
9
|
+
import '@fullcalendar/core';
|
|
10
|
+
import '@mui/icons-material/ChevronLeft';
|
|
11
|
+
import '@mui/icons-material/ChevronRight';
|
|
12
|
+
import '@mui/icons-material/Close';
|
|
13
|
+
import '@mui/icons-material/ExpandMore';
|
|
14
|
+
|
|
15
|
+
function EventCalendarToolbar({ controller, availableViews, addButton, borderlessX, }) {
|
|
16
|
+
const buttons = controller.getButtonState();
|
|
17
|
+
return (React.createElement(Box, { sx: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexWrap: 'wrap',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'space-between',
|
|
22
|
+
gap: 1,
|
|
23
|
+
px: borderlessX ? 1.5 : undefined,
|
|
24
|
+
} },
|
|
25
|
+
React.createElement(Box, { sx: {
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexShrink: 0,
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
gap: 1,
|
|
30
|
+
} },
|
|
31
|
+
addButton && (React.createElement(Button, { onClick: addButton.click, "aria-label": addButton.hint, variant: addButton.isPrimary === false ? 'outlined' : 'contained' }, addButton.text)),
|
|
32
|
+
React.createElement(Button, { onClick: () => controller.today(), "aria-label": buttons.today.hint, variant: "outlined" }, buttons.today.text),
|
|
33
|
+
React.createElement(Box, { sx: {
|
|
34
|
+
display: 'flex',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
} },
|
|
37
|
+
React.createElement(IconButton, { onClick: () => controller.prev(), disabled: buttons.prev.isDisabled, "aria-label": buttons.prev.hint },
|
|
38
|
+
React.createElement(EventCalendarPrevIcon, null)),
|
|
39
|
+
React.createElement(IconButton, { onClick: () => controller.next(), disabled: buttons.next.isDisabled, "aria-label": buttons.next.hint },
|
|
40
|
+
React.createElement(EventCalendarNextIcon, null))),
|
|
41
|
+
React.createElement(Typography, { variant: "h5" }, controller.view?.title)),
|
|
42
|
+
React.createElement(ToggleButtonGroup, { size: "small", exclusive: true, value: controller.view?.type, onChange: (_ev, val) => {
|
|
43
|
+
controller.changeView(val);
|
|
44
|
+
} }, availableViews.map((availableView) => (React.createElement(ToggleButton, { key: availableView, value: availableView, "aria-label": buttons[availableView]?.hint, color: "primary" },
|
|
45
|
+
React.createElement(Box, { sx: { px: 1 } }, buttons[availableView]?.text)))))));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { EventCalendarToolbar as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarOptions } from '@fullcalendar/core';
|
|
3
|
+
|
|
4
|
+
declare const outlineWidthClass = "outline-3";
|
|
5
|
+
declare const outlineWidthFocusClass = "focus-visible:outline-3";
|
|
6
|
+
declare const outlineOffsetClass = "outline-offset-1";
|
|
7
|
+
declare const outlineInsetClass = "-outline-offset-3";
|
|
8
|
+
declare const primaryOutlineColorClass = "outline-[rgba(var(--mui-palette-primary-mainChannel)_/_0.5)]";
|
|
9
|
+
declare const strongSolidPressableClass: string;
|
|
10
|
+
declare const mutedBgClass = "bg-[rgba(var(--mui-palette-text-primaryChannel)_/_0.08)]";
|
|
11
|
+
declare const mutedSolidBgClass = "[background:linear-gradient(rgba(var(--mui-palette-text-primaryChannel)_/_0.08),rgba(var(--mui-palette-text-primaryChannel)_/_0.08))_var(--mui-palette-background-paper)]";
|
|
12
|
+
declare const mutedHoverPressableClass: string;
|
|
13
|
+
declare const faintBgClass = "bg-[rgba(var(--mui-palette-text-primaryChannel)_/_0.04)]";
|
|
14
|
+
declare const faintHoverPressableClass: string;
|
|
15
|
+
declare const rowPointerResizerClass: string;
|
|
16
|
+
declare const rowTouchResizerClass: string;
|
|
17
|
+
declare const getDayClass: (data: {
|
|
18
|
+
isMajor: boolean;
|
|
19
|
+
isToday: boolean;
|
|
20
|
+
isDisabled: boolean;
|
|
21
|
+
}) => string;
|
|
22
|
+
declare const getSlotClass: (data: {
|
|
23
|
+
isMinor: boolean;
|
|
24
|
+
}) => string;
|
|
25
|
+
declare const dayRowCommonClasses: CalendarOptions;
|
|
26
|
+
interface EventCalendarViewsProps extends CalendarOptions {
|
|
27
|
+
liquidHeight?: boolean;
|
|
28
|
+
}
|
|
29
|
+
declare function EventCalendarViews({ className, liquidHeight, height, views: userViews, ...restOptions }: EventCalendarViewsProps): React.JSX.Element;
|
|
30
|
+
|
|
31
|
+
export { EventCalendarViewsProps, dayRowCommonClasses, EventCalendarViews as default, faintBgClass, faintHoverPressableClass, getDayClass, getSlotClass, mutedBgClass, mutedHoverPressableClass, mutedSolidBgClass, outlineInsetClass, outlineOffsetClass, outlineWidthClass, outlineWidthFocusClass, primaryOutlineColorClass, rowPointerResizerClass, rowTouchResizerClass, strongSolidPressableClass };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FullCalendar from '@fullcalendar/react';
|
|
3
|
+
import { joinClassNames } from '@fullcalendar/core';
|
|
4
|
+
import { Box } from '@mui/material';
|
|
5
|
+
import { EventCalendarCloseIcon } from './icons.js';
|
|
6
|
+
import '@mui/icons-material/ChevronLeft';
|
|
7
|
+
import '@mui/icons-material/ChevronRight';
|
|
8
|
+
import '@mui/icons-material/Close';
|
|
9
|
+
import '@mui/icons-material/ExpandMore';
|
|
10
|
+
|
|
11
|
+
// outline
|
|
12
|
+
const outlineWidthClass = "fc-classic-bAU";
|
|
13
|
+
const outlineWidthFocusClass = "fc-classic-Tid";
|
|
14
|
+
const outlineOffsetClass = "fc-classic-fKI";
|
|
15
|
+
const outlineInsetClass = "fc-classic-bzG";
|
|
16
|
+
const primaryOutlineColorClass = "fc-classic-lul";
|
|
17
|
+
// stronger (20%)
|
|
18
|
+
const strongerSolidBgHoverClass = "fc-classic-fEn";
|
|
19
|
+
// strongest (25%)
|
|
20
|
+
const strongestSolidBgActiveClass = "fc-classic-lS3";
|
|
21
|
+
// strong (16%)
|
|
22
|
+
const strongSolidBgClass = "fc-classic-5V9";
|
|
23
|
+
const strongSolidPressableClass = `${strongSolidBgClass} ${strongerSolidBgHoverClass} ${strongestSolidBgActiveClass}`;
|
|
24
|
+
// muted (8%)
|
|
25
|
+
const mutedBgClass = "fc-classic-VxY";
|
|
26
|
+
const mutedSolidBgClass = "fc-classic-yKv";
|
|
27
|
+
const mutedBgHoverClass = "fc-classic-znR";
|
|
28
|
+
const mutedBgActiveClass = "fc-classic-cmB";
|
|
29
|
+
const mutedHoverPressableClass = `${mutedBgHoverClass} fc-classic-G0J ${mutedBgActiveClass}`;
|
|
30
|
+
// faint (4%)
|
|
31
|
+
const faintBgClass = "fc-classic-IKt";
|
|
32
|
+
const faintBgHoverClass = "fc-classic-iAr";
|
|
33
|
+
const faintBgFocusClass = "fc-classic-r6h";
|
|
34
|
+
const faintHoverPressableClass = `${faintBgHoverClass} ${faintBgFocusClass} ${mutedBgActiveClass}`;
|
|
35
|
+
// usually 11px font / 12px line-height
|
|
36
|
+
const xxsTextClass = "fc-classic-HRt";
|
|
37
|
+
// transparent resizer for mouse
|
|
38
|
+
const blockPointerResizerClass = "fc-classic-YA2 fc-classic-C9h fc-classic-ZkV";
|
|
39
|
+
const rowPointerResizerClass = `${blockPointerResizerClass} fc-classic-8ZZ fc-classic-1lj`;
|
|
40
|
+
const columnPointerResizerClass = `${blockPointerResizerClass} fc-classic-xX5 fc-classic-433`;
|
|
41
|
+
// circle resizer for touch
|
|
42
|
+
const blockTouchResizerClass = `fc-classic-YA2 fc-classic-tEU fc-classic-UZp fc-classic-qvz fc-classic-Y27 fc-classic-IdG`;
|
|
43
|
+
const rowTouchResizerClass = `${blockTouchResizerClass} fc-classic-if4 fc-classic-NN9`;
|
|
44
|
+
const columnTouchResizerClass = `${blockTouchResizerClass} fc-classic-Z2g fc-classic-RWU`;
|
|
45
|
+
const getDayClass = (data) => joinClassNames("fc-classic-UZp", data.isMajor ? "fc-classic-I55" : "fc-classic-G56", data.isDisabled ? faintBgClass :
|
|
46
|
+
data.isToday && "fc-classic-VZw");
|
|
47
|
+
const getSlotClass = (data) => joinClassNames(`fc-classic-UZp fc-classic-G56`, data.isMinor && "fc-classic-M5N");
|
|
48
|
+
const dayRowCommonClasses = {
|
|
49
|
+
/* Day Row > List-Item Event
|
|
50
|
+
----------------------------------------------------------------------------------------------- */
|
|
51
|
+
listItemEventClass: (data) => joinClassNames(`fc-classic-mwm fc-classic-df6 fc-classic-dpa`, data.isNarrow ? "fc-classic-6gf" : "fc-classic-qK4", data.isSelected
|
|
52
|
+
? joinClassNames(mutedBgClass, data.isDragging && "fc-classic-5jb")
|
|
53
|
+
: (data.isInteractive ? mutedHoverPressableClass : mutedBgHoverClass)),
|
|
54
|
+
listItemEventBeforeClass: (data) => joinClassNames("fc-classic-PrA", data.isNarrow ? "fc-classic-6gf" : "fc-classic-MOr"),
|
|
55
|
+
listItemEventInnerClass: (data) => joinClassNames("fc-classic-Hhr fc-classic-uEy fc-classic-gfU fc-classic-h2r fc-classic-fji", data.isNarrow ? xxsTextClass : "fc-classic-17F"),
|
|
56
|
+
listItemEventTimeClass: "fc-classic-OKV fc-classic-JTJ fc-classic-O5O fc-classic-qbn",
|
|
57
|
+
listItemEventTitleClass: "fc-classic-OKV fc-classic-Kw3 fc-classic-JTJ fc-classic-O5O fc-classic-nGI",
|
|
58
|
+
/* Day Row > Row Event
|
|
59
|
+
----------------------------------------------------------------------------------------------- */
|
|
60
|
+
rowEventClass: (data) => joinClassNames(data.isStart && joinClassNames("fc-classic-fdR", data.isNarrow ? "fc-classic-9ZR" : "fc-classic-GSF"), data.isEnd && joinClassNames("fc-classic-Ea4", data.isNarrow ? "fc-classic-bpq" : "fc-classic-Jha")),
|
|
61
|
+
rowEventInnerClass: "fc-classic-h2r fc-classic-fji",
|
|
62
|
+
rowEventTimeClass: "fc-classic-OKV",
|
|
63
|
+
rowEventTitleClass: "fc-classic-OKV",
|
|
64
|
+
/* Day Row > More-Link
|
|
65
|
+
----------------------------------------------------------------------------------------------- */
|
|
66
|
+
rowMoreLinkClass: (data) => joinClassNames("fc-classic-mwm fc-classic-UZp fc-classic-dpa", data.isNarrow
|
|
67
|
+
? `fc-classic-6gf fc-classic-R95`
|
|
68
|
+
: "fc-classic-rK9 fc-classic-qK4 fc-classic-lqW", mutedHoverPressableClass),
|
|
69
|
+
rowMoreLinkInnerClass: (data) => joinClassNames("fc-classic-df6", data.isNarrow ? xxsTextClass : "fc-classic-17F"),
|
|
70
|
+
};
|
|
71
|
+
function EventCalendarViews({ className, liquidHeight, height, views: userViews, ...restOptions }) {
|
|
72
|
+
const borderlessX = restOptions.borderlessX ?? restOptions.borderless;
|
|
73
|
+
const borderlessBottom = restOptions.borderlessBottom ?? restOptions.borderless;
|
|
74
|
+
return (React.createElement(Box, { className: className, sx: {
|
|
75
|
+
bgcolor: "background.paper",
|
|
76
|
+
borderStyle: "solid",
|
|
77
|
+
borderColor: "divider",
|
|
78
|
+
borderLeftWidth: borderlessX ? 0 : 1,
|
|
79
|
+
borderRightWidth: borderlessX ? 0 : 1,
|
|
80
|
+
borderTopWidth: 1,
|
|
81
|
+
borderBottomWidth: borderlessBottom ? 0 : 1,
|
|
82
|
+
...((borderlessX || borderlessBottom) ? {} : {
|
|
83
|
+
borderRadius: 1,
|
|
84
|
+
overflow: "fc-classic-C9h",
|
|
85
|
+
}),
|
|
86
|
+
...(liquidHeight ? { flexGrow: 1, minHeight: 0 } : {}),
|
|
87
|
+
} },
|
|
88
|
+
React.createElement(FullCalendar, { className: "fc-classic-ND7", height: liquidHeight ? "100%" : height,
|
|
89
|
+
/* Abstract Event
|
|
90
|
+
----------------------------------------------------------------------------------------- */
|
|
91
|
+
eventColor: "var(--mui-palette-primary-main)", eventContrastColor: "var(--mui-palette-primary-contrastText)", eventClass: (data) => joinClassNames(data.isSelected
|
|
92
|
+
? joinClassNames(outlineWidthClass, data.isDragging ? "fc-classic-ACR" : "fc-classic-iqH")
|
|
93
|
+
: outlineWidthFocusClass, primaryOutlineColorClass),
|
|
94
|
+
/* Background Event
|
|
95
|
+
----------------------------------------------------------------------------------------- */
|
|
96
|
+
backgroundEventColor: "var(--mui-palette-secondary-main)", backgroundEventClass: "fc-classic-Z7B", backgroundEventTitleClass: (data) => joinClassNames("fc-classic-F6C fc-classic-dra", data.isNarrow
|
|
97
|
+
? `fc-classic-KbZ ${xxsTextClass}`
|
|
98
|
+
: "fc-classic-xGk fc-classic-17F"),
|
|
99
|
+
/* List-Item Event
|
|
100
|
+
----------------------------------------------------------------------------------------- */
|
|
101
|
+
listItemEventClass: "fc-classic-gfU", listItemEventBeforeClass: "fc-classic-qvz fc-classic-IdG",
|
|
102
|
+
/* Block Event
|
|
103
|
+
----------------------------------------------------------------------------------------- */
|
|
104
|
+
blockEventClass: (data) => joinClassNames(`fc-classic-ytQ fc-classic-vPs fc-classic-lqW fc-classic-iVS fc-classic-n4P fc-classic-82y ${outlineOffsetClass}`, (data.isDragging && !data.isSelected) && "fc-classic-0HG"), blockEventInnerClass: "fc-classic-P9J fc-classic-Nt8", blockEventTimeClass: "fc-classic-JTJ fc-classic-O5O fc-classic-qbn", blockEventTitleClass: "fc-classic-JTJ fc-classic-O5O fc-classic-nGI",
|
|
105
|
+
/* Row Event
|
|
106
|
+
----------------------------------------------------------------------------------------- */
|
|
107
|
+
rowEventClass: (data) => joinClassNames("fc-classic-mwm fc-classic-3WQ", data.isStart && "fc-classic-riW", data.isEnd && "fc-classic-EWl"), rowEventBeforeClass: (data) => joinClassNames(data.isStartResizable && joinClassNames(data.isSelected ? rowTouchResizerClass : rowPointerResizerClass, "fc-classic-BD7")), rowEventAfterClass: (data) => joinClassNames(data.isEndResizable && joinClassNames(data.isSelected ? rowTouchResizerClass : rowPointerResizerClass, "fc-classic-8rg")), rowEventInnerClass: (data) => joinClassNames("fc-classic-Hhr fc-classic-uEy fc-classic-gfU", data.isNarrow ? xxsTextClass : "fc-classic-17F"), rowEventTimeClass: "fc-classic-Kw3",
|
|
108
|
+
/* Column Event
|
|
109
|
+
----------------------------------------------------------------------------------------- */
|
|
110
|
+
columnEventClass: (data) => joinClassNames("fc-classic-zDQ fc-classic-z3l fc-classic-bLM", data.isStart && "fc-classic-srs fc-classic-ugX", data.isEnd && "fc-classic-mwm fc-classic-QTT fc-classic-7zG"), columnEventBeforeClass: (data) => joinClassNames(data.isStartResizable && joinClassNames(data.isSelected ? columnTouchResizerClass : columnPointerResizerClass, "fc-classic-f4s")), columnEventAfterClass: (data) => joinClassNames(data.isEndResizable && joinClassNames(data.isSelected ? columnTouchResizerClass : columnPointerResizerClass, "fc-classic-I8n")), columnEventInnerClass: (data) => joinClassNames("fc-classic-Hhr", data.isShort
|
|
111
|
+
? "fc-classic-KbZ fc-classic-uEy fc-classic-gfU fc-classic-RVT"
|
|
112
|
+
: "fc-classic-55Y fc-classic-bXY"), columnEventTimeClass: (data) => joinClassNames(!data.isShort && "fc-classic-zvv", xxsTextClass), columnEventTitleClass: (data) => joinClassNames(!data.isShort && "fc-classic-vvo", (data.isShort || data.isNarrow) ? xxsTextClass : "fc-classic-17F"),
|
|
113
|
+
/* More-Link
|
|
114
|
+
----------------------------------------------------------------------------------------- */
|
|
115
|
+
moreLinkClass: `${outlineWidthFocusClass} ${primaryOutlineColorClass}`, moreLinkInnerClass: "fc-classic-JTJ fc-classic-O5O", columnMoreLinkClass: `fc-classic-mwm fc-classic-dpa fc-classic-UZp fc-classic-lqW fc-classic-ePV ${strongSolidPressableClass} fc-classic-82y fc-classic-z3l fc-classic-bLM ${outlineOffsetClass}`, columnMoreLinkInnerClass: (data) => joinClassNames("fc-classic-KbZ", data.isNarrow ? xxsTextClass : "fc-classic-17F"),
|
|
116
|
+
/* Day Header
|
|
117
|
+
----------------------------------------------------------------------------------------- */
|
|
118
|
+
dayHeaderAlign: (data) => data.inPopover ? "start" : "center", dayHeaderClass: (data) => joinClassNames("fc-classic-a65", data.isDisabled && faintBgClass, data.inPopover
|
|
119
|
+
? "fc-classic-QTT fc-classic-G56"
|
|
120
|
+
: joinClassNames("fc-classic-UZp", data.isMajor
|
|
121
|
+
? "fc-classic-I55"
|
|
122
|
+
: "fc-classic-G56")), dayHeaderInnerClass: (data) => joinClassNames("fc-classic-qB7 fc-classic-vvo fc-classic-Hhr fc-classic-bXY", data.isNarrow ? xxsTextClass : "fc-classic-gEy"), dayHeaderDividerClass: "fc-classic-QTT fc-classic-G56",
|
|
123
|
+
/* Day Cell
|
|
124
|
+
----------------------------------------------------------------------------------------- */
|
|
125
|
+
dayCellClass: getDayClass, dayCellTopClass: (data) => joinClassNames(data.isNarrow ? "fc-classic-WoG" : "fc-classic-s9U", "fc-classic-Hhr fc-classic-uEy fc-classic-RhI"), dayCellTopInnerClass: (data) => joinClassNames("fc-classic-qB7 fc-classic-JTJ", data.isNarrow
|
|
126
|
+
? `fc-classic-vvo ${xxsTextClass}`
|
|
127
|
+
: "fc-classic-ztx fc-classic-gEy", data.isOther && "fc-classic-lVd", data.monthText && "fc-classic-Kw3"), dayCellInnerClass: (data) => joinClassNames(data.inPopover && "fc-classic-aS8"),
|
|
128
|
+
/* Popover
|
|
129
|
+
----------------------------------------------------------------------------------------- */
|
|
130
|
+
popoverClass: "fc-classic-HBk fc-classic-Y27 fc-classic-DC1 fc-classic-8Kl fc-classic-O5O fc-classic-uPX fc-classic-c0k fc-classic-nhl fc-classic-ND7", popoverCloseClass: `fc-classic-ytQ fc-classic-YA2 fc-classic-RWe fc-classic-Eoc ${outlineWidthFocusClass} ${primaryOutlineColorClass} fc-classic-om0`, popoverCloseContent: () => React.createElement(EventCalendarCloseIcon, null),
|
|
131
|
+
/* Lane
|
|
132
|
+
----------------------------------------------------------------------------------------- */
|
|
133
|
+
dayLaneClass: getDayClass, dayLaneInnerClass: (data) => joinClassNames(data.isStack
|
|
134
|
+
? "fc-classic-JQD"
|
|
135
|
+
: data.isNarrow ? "fc-classic-6gf" : "fc-classic-GSF fc-classic-Dk5"), slotLaneClass: getSlotClass,
|
|
136
|
+
/* List Day
|
|
137
|
+
----------------------------------------------------------------------------------------- */
|
|
138
|
+
listDayHeaderClass: `fc-classic-QTT fc-classic-G56 ${mutedSolidBgClass} fc-classic-Hhr fc-classic-uEy fc-classic-gfU fc-classic-Klj`, listDayHeaderInnerClass: "fc-classic-U10 fc-classic-KyB fc-classic-gEy fc-classic-Kw3",
|
|
139
|
+
/* Single Month (in Multi-Month)
|
|
140
|
+
----------------------------------------------------------------------------------------- */
|
|
141
|
+
singleMonthClass: "fc-classic-tZ3", singleMonthHeaderClass: (data) => joinClassNames(data.isSticky && `fc-classic-QTT fc-classic-G56 fc-classic-Y27`, data.colCount > 1 ? "fc-classic-LbL" : "fc-classic-KyB", "fc-classic-gfU"), singleMonthHeaderInnerClass: "fc-classic-PuF fc-classic-Kw3",
|
|
142
|
+
/* Misc Table
|
|
143
|
+
----------------------------------------------------------------------------------------- */
|
|
144
|
+
tableHeaderClass: (data) => joinClassNames(data.isSticky && "fc-classic-Y27"), fillerClass: "fc-classic-UZp fc-classic-G56 fc-classic-F6C", dayHeaderRowClass: "fc-classic-UZp fc-classic-G56", dayRowClass: "fc-classic-UZp fc-classic-G56", slotHeaderRowClass: "fc-classic-UZp fc-classic-G56", slotHeaderClass: getSlotClass,
|
|
145
|
+
/* Misc Content
|
|
146
|
+
----------------------------------------------------------------------------------------- */
|
|
147
|
+
navLinkClass: `fc-classic-jaW ${outlineWidthFocusClass} ${outlineInsetClass} ${primaryOutlineColorClass}`, inlineWeekNumberClass: (data) => joinClassNames(`fc-classic-YA2 fc-classic-pPI fc-classic-9o9 fc-classic-0W5 fc-classic-KbZ fc-classic-fi1 fc-classic-Znt ${mutedBgClass}`, data.isNarrow ? xxsTextClass : "fc-classic-gEy"), nonBusinessClass: faintBgClass, highlightClass: "fc-classic-gKu",
|
|
148
|
+
/* View-Specific Options
|
|
149
|
+
----------------------------------------------------------------------------------------- */
|
|
150
|
+
views: {
|
|
151
|
+
...userViews,
|
|
152
|
+
dayGrid: {
|
|
153
|
+
...dayRowCommonClasses,
|
|
154
|
+
dayCellBottomClass: "fc-classic-WoG",
|
|
155
|
+
...userViews?.dayGrid,
|
|
156
|
+
},
|
|
157
|
+
multiMonth: {
|
|
158
|
+
...dayRowCommonClasses,
|
|
159
|
+
dayCellBottomClass: "fc-classic-WoG",
|
|
160
|
+
tableClass: `fc-classic-UZp fc-classic-G56`,
|
|
161
|
+
...userViews?.multiMonth,
|
|
162
|
+
},
|
|
163
|
+
timeGrid: {
|
|
164
|
+
...dayRowCommonClasses,
|
|
165
|
+
dayCellBottomClass: "fc-classic-iJ1",
|
|
166
|
+
/* TimeGrid > Week Number Header
|
|
167
|
+
------------------------------------------------------------------------------------- */
|
|
168
|
+
weekNumberHeaderClass: "fc-classic-gfU fc-classic-RhI",
|
|
169
|
+
weekNumberHeaderInnerClass: (data) => joinClassNames("fc-classic-qB7 fc-classic-vvo", data.isNarrow ? xxsTextClass : "fc-classic-gEy"),
|
|
170
|
+
/* TimeGrid > All-Day Header
|
|
171
|
+
------------------------------------------------------------------------------------- */
|
|
172
|
+
allDayHeaderClass: "fc-classic-gfU fc-classic-RhI",
|
|
173
|
+
allDayHeaderInnerClass: (data) => joinClassNames("fc-classic-qB7 fc-classic-KyB fc-classic-csg fc-classic-XMF", data.isNarrow ? xxsTextClass : "fc-classic-gEy"),
|
|
174
|
+
allDayDividerClass: `fc-classic-3WQ fc-classic-G56 fc-classic-yJv ${mutedBgClass}`,
|
|
175
|
+
/* TimeGrid > Slot Header
|
|
176
|
+
------------------------------------------------------------------------------------- */
|
|
177
|
+
slotHeaderClass: "fc-classic-RhI",
|
|
178
|
+
slotHeaderInnerClass: (data) => joinClassNames("fc-classic-qB7 fc-classic-vvo", data.isNarrow ? xxsTextClass : "fc-classic-gEy"),
|
|
179
|
+
slotHeaderDividerClass: `fc-classic-EWl fc-classic-G56`,
|
|
180
|
+
/* TimeGrid > Now-Indicator
|
|
181
|
+
------------------------------------------------------------------------------------- */
|
|
182
|
+
nowIndicatorHeaderClass: "fc-classic-9o9 fc-classic-Bjh fc-classic-ARL fc-classic-DGs fc-classic-cwE fc-classic-7Ra",
|
|
183
|
+
nowIndicatorLineClass: `fc-classic-srs fc-classic-R3n`,
|
|
184
|
+
...userViews?.timeGrid,
|
|
185
|
+
},
|
|
186
|
+
list: {
|
|
187
|
+
/* List-View > List-Item Event
|
|
188
|
+
------------------------------------------------------------------------------------- */
|
|
189
|
+
listItemEventClass: (data) => joinClassNames(`fc-classic-ytQ fc-classic-QTT fc-classic-G56 fc-classic-U10 fc-classic-KyB fc-classic-9Vv`, data.isInteractive
|
|
190
|
+
? joinClassNames(faintHoverPressableClass, outlineInsetClass)
|
|
191
|
+
: "fc-classic-iAr"),
|
|
192
|
+
listItemEventBeforeClass: "fc-classic-1uc",
|
|
193
|
+
listItemEventInnerClass: "fc-classic-QDv",
|
|
194
|
+
listItemEventTimeClass: "fc-classic-f5K fc-classic-yvz fc-classic-8Ko fc-classic-mTj fc-classic-JTJ fc-classic-O5O fc-classic-yGY fc-classic-gEy",
|
|
195
|
+
listItemEventTitleClass: (data) => joinClassNames("fc-classic-oee fc-classic-qbd fc-classic-JTJ fc-classic-O5O fc-classic-gEy", data.event.url && "fc-classic-YdZ"),
|
|
196
|
+
/* No-Events Screen
|
|
197
|
+
------------------------------------------------------------------------------------- */
|
|
198
|
+
noEventsClass: `${mutedBgClass} fc-classic-Hhr fc-classic-bXY fc-classic-gfU fc-classic-a65`,
|
|
199
|
+
noEventsInnerClass: "sticky fc-classic-wVG fc-classic-UyD",
|
|
200
|
+
...userViews?.list,
|
|
201
|
+
},
|
|
202
|
+
}, ...restOptions })));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export { dayRowCommonClasses, EventCalendarViews as default, faintBgClass, faintHoverPressableClass, getDayClass, getSlotClass, mutedBgClass, mutedHoverPressableClass, mutedSolidBgClass, outlineInsetClass, outlineOffsetClass, outlineWidthClass, outlineWidthFocusClass, primaryOutlineColorClass, rowPointerResizerClass, rowTouchResizerClass, strongSolidPressableClass };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarOptions } from '@fullcalendar/core';
|
|
3
|
+
|
|
4
|
+
interface ResourceTimeGridProps extends Omit<CalendarOptions, 'class'> {
|
|
5
|
+
availableViews?: string[];
|
|
6
|
+
addButton?: {
|
|
7
|
+
isPrimary?: boolean;
|
|
8
|
+
text?: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
click?: (ev: MouseEvent) => void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare function ResourceTimeGrid({ availableViews, addButton, className, height, contentHeight, direction, plugins: userPlugins, ...restOptions }: ResourceTimeGridProps): React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { ResourceTimeGridProps, ResourceTimeGrid as default };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useCalendarController } from '@fullcalendar/react';
|
|
3
|
+
import adaptivePlugin from '@fullcalendar/adaptive';
|
|
4
|
+
import interactionPlugin from '@fullcalendar/interaction';
|
|
5
|
+
import scrollGridPlugin from '@fullcalendar/scrollgrid';
|
|
6
|
+
import resourceTimeGridPlugin from '@fullcalendar/resource-timegrid';
|
|
7
|
+
import EventCalendarToolbar from './EventCalendarToolbar.js';
|
|
8
|
+
import SchedulerViews from './SchedulerViews.js';
|
|
9
|
+
import EventCalendarContainer from './EventCalendarContainer.js';
|
|
10
|
+
import '@mui/material/Box';
|
|
11
|
+
import '@mui/material/Button';
|
|
12
|
+
import '@mui/material/IconButton';
|
|
13
|
+
import '@mui/material/Typography';
|
|
14
|
+
import '@mui/material/ToggleButtonGroup';
|
|
15
|
+
import '@mui/material/ToggleButton';
|
|
16
|
+
import './icons.js';
|
|
17
|
+
import '@fullcalendar/core';
|
|
18
|
+
import '@mui/icons-material/ChevronLeft';
|
|
19
|
+
import '@mui/icons-material/ChevronRight';
|
|
20
|
+
import '@mui/icons-material/Close';
|
|
21
|
+
import '@mui/icons-material/ExpandMore';
|
|
22
|
+
import './EventCalendarViews.js';
|
|
23
|
+
import '@mui/material';
|
|
24
|
+
|
|
25
|
+
const plugins = [
|
|
26
|
+
adaptivePlugin,
|
|
27
|
+
interactionPlugin,
|
|
28
|
+
scrollGridPlugin,
|
|
29
|
+
resourceTimeGridPlugin,
|
|
30
|
+
];
|
|
31
|
+
const defaultAvailableViews = [
|
|
32
|
+
'resourceTimeGridDay',
|
|
33
|
+
'resourceTimeGridWeek',
|
|
34
|
+
];
|
|
35
|
+
const navLinkDayClick = 'resourceTimeGridDay';
|
|
36
|
+
const navLinkWeekClick = 'resourceTimeGridWeek';
|
|
37
|
+
function ResourceTimeGrid({ availableViews = defaultAvailableViews, addButton, className, height, contentHeight, direction, plugins: userPlugins = [], ...restOptions }) {
|
|
38
|
+
const controller = useCalendarController();
|
|
39
|
+
const autoHeight = height === 'auto' || contentHeight === 'auto';
|
|
40
|
+
return (React.createElement(EventCalendarContainer, { direction: direction, className: className, height: height },
|
|
41
|
+
React.createElement(EventCalendarToolbar, { controller: controller, availableViews: availableViews, addButton: addButton, borderlessX: restOptions.borderlessX ?? restOptions.borderless }),
|
|
42
|
+
React.createElement(SchedulerViews, { liquidHeight: !autoHeight && height !== undefined, height: autoHeight ? 'auto' : contentHeight, initialView: availableViews[0], navLinkDayClick: navLinkDayClick, navLinkWeekClick: navLinkWeekClick, controller: controller, plugins: [...plugins, ...userPlugins], ...restOptions })));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { ResourceTimeGrid as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarOptions } from '@fullcalendar/core';
|
|
3
|
+
|
|
4
|
+
interface ResourceTimelineProps extends Omit<CalendarOptions, 'class'> {
|
|
5
|
+
availableViews?: string[];
|
|
6
|
+
addButton?: {
|
|
7
|
+
isPrimary?: boolean;
|
|
8
|
+
text?: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
click?: (ev: MouseEvent) => void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare function ResourceTimeline({ availableViews, addButton, className, height, contentHeight, direction, plugins: userPlugins, ...restOptions }: ResourceTimelineProps): React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { ResourceTimelineProps, ResourceTimeline as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useCalendarController } from '@fullcalendar/react';
|
|
3
|
+
import adaptivePlugin from '@fullcalendar/adaptive';
|
|
4
|
+
import resourceTimelinePlugin from '@fullcalendar/resource-timeline';
|
|
5
|
+
import interactionPlugin from '@fullcalendar/interaction';
|
|
6
|
+
import EventCalendarToolbar from './EventCalendarToolbar.js';
|
|
7
|
+
import SchedulerViews from './SchedulerViews.js';
|
|
8
|
+
import EventCalendarContainer from './EventCalendarContainer.js';
|
|
9
|
+
import '@mui/material/Box';
|
|
10
|
+
import '@mui/material/Button';
|
|
11
|
+
import '@mui/material/IconButton';
|
|
12
|
+
import '@mui/material/Typography';
|
|
13
|
+
import '@mui/material/ToggleButtonGroup';
|
|
14
|
+
import '@mui/material/ToggleButton';
|
|
15
|
+
import './icons.js';
|
|
16
|
+
import '@fullcalendar/core';
|
|
17
|
+
import '@mui/icons-material/ChevronLeft';
|
|
18
|
+
import '@mui/icons-material/ChevronRight';
|
|
19
|
+
import '@mui/icons-material/Close';
|
|
20
|
+
import '@mui/icons-material/ExpandMore';
|
|
21
|
+
import './EventCalendarViews.js';
|
|
22
|
+
import '@mui/material';
|
|
23
|
+
|
|
24
|
+
const plugins = [
|
|
25
|
+
adaptivePlugin,
|
|
26
|
+
interactionPlugin,
|
|
27
|
+
resourceTimelinePlugin,
|
|
28
|
+
];
|
|
29
|
+
const defaultAvailableViews = [
|
|
30
|
+
'resourceTimelineDay',
|
|
31
|
+
'resourceTimelineWeek',
|
|
32
|
+
];
|
|
33
|
+
const navLinkDayClick = 'resourceTimelineDay';
|
|
34
|
+
const navLinkWeekClick = 'resourceTimelineWeek';
|
|
35
|
+
function ResourceTimeline({ availableViews = defaultAvailableViews, addButton, className, height, contentHeight, direction, plugins: userPlugins = [], ...restOptions }) {
|
|
36
|
+
const controller = useCalendarController();
|
|
37
|
+
const autoHeight = height === 'auto' || contentHeight === 'auto';
|
|
38
|
+
return (React.createElement(EventCalendarContainer, { direction: direction, className: className, height: height },
|
|
39
|
+
React.createElement(EventCalendarToolbar, { controller: controller, availableViews: availableViews, addButton: addButton, borderlessX: restOptions.borderlessX ?? restOptions.borderless }),
|
|
40
|
+
React.createElement(SchedulerViews, { liquidHeight: !autoHeight && height !== undefined, height: autoHeight ? 'auto' : contentHeight, initialView: availableViews[0], navLinkDayClick: navLinkDayClick, navLinkWeekClick: navLinkWeekClick, controller: controller, plugins: [...plugins, ...userPlugins], ...restOptions })));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { ResourceTimeline as default };
|