generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
31,648 additions
and
1,308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1 @@ | ||
@import '@fullcalendar/common/main.css'; | ||
@import '@fullcalendar/daygrid/main.css'; | ||
@import '@fullcalendar/timegrid/main.css'; | ||
@import '@fullcalendar/list/main.css'; | ||
@import '@fullcalendar/resource-timeline/main.css'; | ||
|
||
@tailwind utilities; | ||
|
||
html.dark { | ||
--fc-border-color: theme(colors.white / 5%); | ||
} | ||
|
||
.fc-toolbar-chunk { | ||
@apply space-y-1; | ||
} | ||
|
||
.fc-toolbar-title { | ||
@apply !text-lg leading-5 md:!text-3xl; | ||
} | ||
|
||
.filament-fullcalendar--calendar.fc .fc-button { | ||
@apply min-h-[2.25rem] rounded-lg px-[6px] py-1 text-sm font-medium text-white shadow outline-none transition-colors md:px-4; | ||
} | ||
|
||
.filament-fullcalendar--calendar.fc .fc-button-primary { | ||
@apply border-[color:rgba(var(--primary-600))] bg-[color:rgba(var(--primary-600))]; | ||
} | ||
|
||
.filament-fullcalendar--calendar.fc .fc-button-primary:hover { | ||
@apply border-[color:rgba(var(--primary-600))] bg-[color:rgba(var(--primary-500))]; | ||
} | ||
|
||
.filament-fullcalendar--calendar.fc .fc-button-primary:disabled { | ||
@apply border-[color:rgba(var(--primary-600))] bg-[color:rgba(var(--primary-600))] opacity-70; | ||
} | ||
|
||
.filament-fullcalendar--calendar.fc | ||
.fc-button-primary:not(:disabled).fc-button-active, | ||
.filament-fullcalendar--calendar.fc .fc-button-primary:not(:disabled):active { | ||
@apply border-[color:rgba(var(--primary-600))] bg-[color:rgba(var(--primary-500))] shadow-none; | ||
} | ||
|
||
.filament-fullcalendar--calendar.fc .fc-button-primary:focus, | ||
.filament-fullcalendar--calendar.fc .fc-button-primary:not(:disabled):focus, | ||
.filament-fullcalendar--calendar.fc | ||
.fc-button-primary:not(:disabled).fc-button-active:focus, | ||
.filament-fullcalendar--calendar.fc | ||
.fc-button-primary:not(:disabled):active:focus { | ||
@apply bg-[color:rgba(var(--primary-700))] shadow-none outline-none ring-2 ring-inset ring-white ring-offset-2 ring-offset-[color:rgba(var(--primary-700))]; | ||
} | ||
|
||
.filament-fullcalendar--calendar.fc .fc-daygrid-day.fc-day-today, | ||
.filament-fullcalendar--calendar.fc .fc-highlight { | ||
@apply bg-[color:rgba(var(--primary-500))]; | ||
} | ||
|
||
.dark .filament-fullcalendar--calendar.fc .fc-daygrid-day.fc-day-today { | ||
@apply bg-[color:rgba(var(--primary-900))]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,104 @@ | ||
import { Calendar } from '@fullcalendar/core' | ||
import rrulePlugin from '@fullcalendar/rrule' | ||
import interactionPlugin from '@fullcalendar/interaction' | ||
import dayGridPlugin from '@fullcalendar/daygrid' | ||
import timeGridPlugin from '@fullcalendar/timegrid' | ||
import listPlugin from '@fullcalendar/list' | ||
import multiMonthPlugin from '@fullcalendar/multimonth' | ||
import scrollGridPlugin from '@fullcalendar/scrollgrid' | ||
import timelinePlugin from '@fullcalendar/timeline' | ||
import adaptivePlugin from '@fullcalendar/adaptive' | ||
import resourcePlugin from '@fullcalendar/resource' | ||
import resourceDayGridPlugin from '@fullcalendar/resource-daygrid' | ||
import resourceTimelinePlugin from '@fullcalendar/resource-timeline' | ||
import interactionPlugin from '@fullcalendar/interaction' | ||
import rrulePlugin from '@fullcalendar/rrule' | ||
import momentPlugin from '@fullcalendar/moment' | ||
import momentTimezonePlugin from '@fullcalendar/moment-timezone' | ||
import locales from '@fullcalendar/core/locales-all' | ||
|
||
export default function fullcalendar({ | ||
key, | ||
config, | ||
locale, | ||
events, | ||
initialView, | ||
initialDate, | ||
shouldSaveState, | ||
handleEventClickUsing, | ||
handleEventDropUsing, | ||
handleEventResizeUsing, | ||
handleDateClickUsing, | ||
handleSelectUsing, | ||
fetchEventsUsing, | ||
plugins, | ||
schedulerLicenseKey, | ||
timeZone, | ||
config, | ||
editable, | ||
selectable, | ||
}) { | ||
return { | ||
calendar: null, | ||
|
||
cachedEvents: new Object(), | ||
|
||
init () { | ||
this.calendar = new Calendar(this.$refs.calendar, { | ||
init() { | ||
/** @type Calendar */ | ||
const calendar = new Calendar(this.$el, { | ||
headerToolbar: { | ||
'left': 'prev,next today', | ||
'center': 'title', | ||
'right': 'dayGridMonth,dayGridWeek,dayGridDay', | ||
}, | ||
plugins: plugins.map(plugin => availablePlugins[plugin]), | ||
locale, | ||
schedulerLicenseKey, | ||
timeZone, | ||
editable, | ||
selectable, | ||
...config, | ||
plugins: [ | ||
...(config.plugins.dayGrid ? [dayGridPlugin] : []), | ||
...(config.plugins.timeGrid ? [timeGridPlugin] : []), | ||
...(config.plugins.interaction ? [interactionPlugin] : []), | ||
...(config.plugins.list ? [listPlugin] : []), | ||
...(config.plugins.rrule ? [rrulePlugin] : []), | ||
...(config.plugins.resourceTimeline ? [resourceTimelinePlugin] : []), | ||
momentPlugin, | ||
momentTimezonePlugin, | ||
], | ||
locales, | ||
locale, | ||
eventClick: handleEventClickUsing, | ||
eventDrop: handleEventDropUsing, | ||
eventResize: handleEventResizeUsing, | ||
dateClick: handleDateClickUsing, | ||
select: handleSelectUsing, | ||
eventSources: [{ events }, fetchEventsUsing], | ||
...(shouldSaveState && { | ||
initialView: | ||
localStorage.getItem( | ||
'fullcalendar.view.' + key, | ||
) ?? | ||
initialView ?? | ||
undefined, | ||
initialDate: | ||
localStorage.getItem( | ||
'fullcalendar.date.' + key, | ||
) ?? | ||
initialDate ?? | ||
undefined, | ||
datesSet: function ({ start, view }) { | ||
localStorage.setItem( | ||
'fullcalendar.view.' + key, | ||
view.type, | ||
) | ||
localStorage.setItem( | ||
'fullcalendar.date.' + key, | ||
start.toISOString(), | ||
) | ||
}, | ||
}), | ||
events: (info, successCallback, failureCallback) => { | ||
this.$wire.fetchEvents({ start: info.startStr, end: info.endStr, timezone: info.timeZone }) | ||
.then(successCallback) | ||
.catch(failureCallback) | ||
}, | ||
eventClick: ({ event, jsEvent }) => { | ||
jsEvent.preventDefault() | ||
|
||
if (event.url) { | ||
return window.open(event.url, event.extendedProps.shouldOpenInNewTab ? '_blank' : '_self') | ||
} | ||
|
||
this.$wire.onEventClick(event) | ||
}, | ||
eventDrop: async ({ event, oldEvent, relatedEvents, delta, revert }) => { | ||
const shouldRevert = await this.$wire.onEventDrop(event, oldEvent, relatedEvents, delta) | ||
|
||
if (typeof shouldRevert === 'boolean' && shouldRevert) { | ||
revert() | ||
} | ||
}, | ||
eventResize: async ({ event, oldEvent, relatedEvents, startDelta, endDelta, revert }) => { | ||
const shouldRevert = await this.$wire.onEventResize(event, oldEvent, relatedEvents, startDelta, endDelta) | ||
|
||
if (typeof shouldRevert === 'boolean' && shouldRevert) { | ||
revert() | ||
} | ||
}, | ||
dateClick: ({ dateStr, allDay }) => { | ||
if (!selectable) return; | ||
this.$wire.onDateSelect(dateStr, null, allDay) | ||
}, | ||
select: ({ startStr, endStr, allDay }) => { | ||
if (!selectable) return; | ||
this.$wire.onDateSelect(startStr, endStr, allDay) | ||
}, | ||
}) | ||
|
||
this.calendar.render() | ||
calendar.render() | ||
|
||
window.addEventListener('filament-fullcalendar--refresh', () => calendar.refetchEvents()) | ||
}, | ||
} | ||
} | ||
|
||
const availablePlugins = { | ||
'interaction': interactionPlugin, | ||
'dayGrid': dayGridPlugin, | ||
'timeGrid': timeGridPlugin, | ||
'list': listPlugin, | ||
'multiMonth': multiMonthPlugin, | ||
'scrollGrid': scrollGridPlugin, | ||
'timeline': timelinePlugin, | ||
'adaptive': adaptivePlugin, | ||
'resource': resourcePlugin, | ||
'resourceDayGrid': resourceDayGridPlugin, | ||
'resourceTimeline': resourceTimelinePlugin, | ||
'rrule': rrulePlugin, | ||
'moment': momentPlugin, | ||
'momentTimezone': momentTimezonePlugin, | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.