@mantine/schedule 9.6.0 → 9.6.1
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/cjs/components/DayView/DayView.cjs +11 -4
- package/cjs/components/DayView/DayView.cjs.map +1 -1
- package/cjs/components/DayView/DayView.module.cjs +2 -2
- package/cjs/components/DayView/DayView.module.cjs.map +1 -1
- package/cjs/components/DayView/get-day-view-events/get-day-positioned-events.cjs +12 -7
- package/cjs/components/DayView/get-day-view-events/get-day-positioned-events.cjs.map +1 -1
- package/cjs/components/DayView/get-day-view-events/get-day-view-events.cjs +3 -2
- package/cjs/components/DayView/get-day-view-events/get-day-view-events.cjs.map +1 -1
- package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +1 -1
- package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
- package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +1 -1
- package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
- package/cjs/components/ScheduleEvent/ScheduleEvent.module.cjs.map +1 -1
- package/cjs/components/WeekView/WeekView.cjs +11 -4
- package/cjs/components/WeekView/WeekView.cjs.map +1 -1
- package/cjs/components/WeekView/WeekView.module.cjs +2 -2
- package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
- package/cjs/components/WeekView/get-week-view-events/get-week-positioned-events.cjs +4 -2
- package/cjs/components/WeekView/get-week-view-events/get-week-positioned-events.cjs.map +1 -1
- package/cjs/index.cjs +4 -0
- package/cjs/utils/apply-cascade-layout/apply-cascade-layout.cjs +21 -0
- package/cjs/utils/apply-cascade-layout/apply-cascade-layout.cjs.map +1 -0
- package/cjs/{components/ResourcesDayView → utils}/get-overlap-clusters/get-overlap-clusters.cjs +2 -2
- package/cjs/utils/get-overlap-clusters/get-overlap-clusters.cjs.map +1 -0
- package/cjs/utils/is-event-in-time-range/is-event-in-time-range.cjs +2 -1
- package/cjs/utils/is-event-in-time-range/is-event-in-time-range.cjs.map +1 -1
- package/esm/components/DayView/DayView.mjs +11 -4
- package/esm/components/DayView/DayView.mjs.map +1 -1
- package/esm/components/DayView/DayView.module.mjs +2 -2
- package/esm/components/DayView/DayView.module.mjs.map +1 -1
- package/esm/components/DayView/get-day-view-events/get-day-positioned-events.mjs +12 -7
- package/esm/components/DayView/get-day-view-events/get-day-positioned-events.mjs.map +1 -1
- package/esm/components/DayView/get-day-view-events/get-day-view-events.mjs +3 -2
- package/esm/components/DayView/get-day-view-events/get-day-view-events.mjs.map +1 -1
- package/esm/components/ResourcesDayView/ResourcesDayView.mjs +1 -1
- package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
- package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +1 -1
- package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
- package/esm/components/ScheduleEvent/ScheduleEvent.module.mjs.map +1 -1
- package/esm/components/WeekView/WeekView.mjs +11 -4
- package/esm/components/WeekView/WeekView.mjs.map +1 -1
- package/esm/components/WeekView/WeekView.module.mjs +2 -2
- package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
- package/esm/components/WeekView/get-week-view-events/get-week-positioned-events.mjs +4 -2
- package/esm/components/WeekView/get-week-view-events/get-week-positioned-events.mjs.map +1 -1
- package/esm/index.mjs +3 -1
- package/esm/utils/apply-cascade-layout/apply-cascade-layout.mjs +21 -0
- package/esm/utils/apply-cascade-layout/apply-cascade-layout.mjs.map +1 -0
- package/esm/{components/ResourcesDayView → utils}/get-overlap-clusters/get-overlap-clusters.mjs +2 -2
- package/esm/utils/get-overlap-clusters/get-overlap-clusters.mjs.map +1 -0
- package/esm/utils/is-event-in-time-range/is-event-in-time-range.mjs +2 -1
- package/esm/utils/is-event-in-time-range/is-event-in-time-range.mjs.map +1 -1
- package/lib/components/DayView/DayView.d.ts +5 -1
- package/lib/components/DayView/get-day-view-events/get-day-positioned-events.d.ts +4 -2
- package/lib/components/DayView/get-day-view-events/get-day-view-events.d.ts +3 -2
- package/lib/components/WeekView/WeekView.d.ts +5 -1
- package/lib/components/WeekView/get-week-view-events/get-week-positioned-events.d.ts +4 -2
- package/lib/types.d.ts +2 -0
- package/lib/utils/apply-cascade-layout/apply-cascade-layout.d.ts +6 -0
- package/lib/utils/get-overlap-clusters/get-overlap-clusters.d.ts +2 -0
- package/lib/utils/index.d.ts +3 -0
- package/package.json +4 -4
- package/styles.css +61 -0
- package/styles.layer.css +61 -0
- package/cjs/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.cjs.map +0 -1
- package/esm/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.mjs.map +0 -1
- package/lib/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.d.ts +0 -2
package/cjs/{components/ResourcesDayView → utils}/get-overlap-clusters/get-overlap-clusters.cjs
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const require_is_events_overlap = require("
|
|
3
|
-
//#region packages/@mantine/schedule/src/
|
|
2
|
+
const require_is_events_overlap = require("../is-events-overlap/is-events-overlap.cjs");
|
|
3
|
+
//#region packages/@mantine/schedule/src/utils/get-overlap-clusters/get-overlap-clusters.ts
|
|
4
4
|
function getOverlapClusters(events) {
|
|
5
5
|
const clusters = [];
|
|
6
6
|
const assigned = /* @__PURE__ */ new Set();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-overlap-clusters.cjs","names":["isEventsOverlap"],"sources":["../../../src/utils/get-overlap-clusters/get-overlap-clusters.ts"],"sourcesContent":["import { ScheduleEventData } from '../../types';\nimport { isEventsOverlap } from '../is-events-overlap/is-events-overlap';\n\nexport function getOverlapClusters<T extends ScheduleEventData>(events: T[]): T[][] {\n const clusters: T[][] = [];\n const assigned = new Set<number>();\n\n for (let i = 0; i < events.length; i++) {\n if (assigned.has(i)) {\n continue;\n }\n\n const cluster: T[] = [events[i]];\n assigned.add(i);\n\n let j = 0;\n while (j < cluster.length) {\n for (let k = 0; k < events.length; k++) {\n if (!assigned.has(k) && isEventsOverlap(cluster[j], events[k])) {\n cluster.push(events[k]);\n assigned.add(k);\n }\n }\n j++;\n }\n\n clusters.push(cluster);\n }\n\n return clusters;\n}\n"],"mappings":";;;AAGA,SAAgB,mBAAgD,QAAoB;CAClF,MAAM,WAAkB,CAAC;CACzB,MAAM,2BAAW,IAAI,IAAY;CAEjC,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;EACtC,IAAI,SAAS,IAAI,CAAC,GAChB;EAGF,MAAM,UAAe,CAAC,OAAO,EAAE;EAC/B,SAAS,IAAI,CAAC;EAEd,IAAI,IAAI;EACR,OAAO,IAAI,QAAQ,QAAQ;GACzB,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KACjC,IAAI,CAAC,SAAS,IAAI,CAAC,KAAKA,0BAAAA,gBAAgB,QAAQ,IAAI,OAAO,EAAE,GAAG;IAC9D,QAAQ,KAAK,OAAO,EAAE;IACtB,SAAS,IAAI,CAAC;GAChB;GAEF;EACF;EAEA,SAAS,KAAK,OAAO;CACvB;CAEA,OAAO;AACT"}
|
|
@@ -20,8 +20,9 @@ function isEventInTimeRange({ event, startTime, endTime }) {
|
|
|
20
20
|
const timeWindowEndMinutes = endHour * 60 + endMinute;
|
|
21
21
|
const eventStart = (0, dayjs.default)(event.start);
|
|
22
22
|
const eventEnd = (0, dayjs.default)(event.end);
|
|
23
|
+
const endsAtNextDayStart = eventEnd.isSame(eventStart.startOf("day").add(1, "day"), "second");
|
|
23
24
|
const eventStartMinutes = eventStart.hour() * 60 + eventStart.minute();
|
|
24
|
-
return !(eventEnd.hour() * 60 + eventEnd.minute() <= timeWindowStartMinutes || eventStartMinutes >= timeWindowEndMinutes);
|
|
25
|
+
return !((endsAtNextDayStart ? 1440 : eventEnd.hour() * 60 + eventEnd.minute()) <= timeWindowStartMinutes || eventStartMinutes >= timeWindowEndMinutes);
|
|
25
26
|
}
|
|
26
27
|
//#endregion
|
|
27
28
|
exports.isEventInTimeRange = isEventInTimeRange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-event-in-time-range.cjs","names":["isMultidayEvent"],"sources":["../../../src/utils/is-event-in-time-range/is-event-in-time-range.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { ScheduleEventData } from '../../types';\nimport { isMultidayEvent } from '../is-multiday-event/is-multiday-event';\n\ninterface IsEventInTimeRangeInput {\n event: ScheduleEventData;\n startTime?: string;\n endTime?: string;\n}\n\nfunction spansFullDay(event: ScheduleEventData) {\n const start = dayjs(event.start);\n const end = dayjs(event.end);\n if (!start.isSame(start.startOf('day'))) {\n return false;\n }\n const nextDayStart = start.startOf('day').add(1, 'day');\n return end.isSame(nextDayStart) || end.isSame(nextDayStart.subtract(1, 'second'));\n}\n\nexport function isEventInTimeRange({ event, startTime, endTime }: IsEventInTimeRangeInput) {\n if (isMultidayEvent(event) || spansFullDay(event)) {\n return true;\n }\n\n if (!startTime || !endTime) {\n return true;\n }\n\n const [startHour, startMinute] = startTime.split(':').map(Number);\n const [endHour, endMinute] = endTime.split(':').map(Number);\n const timeWindowStartMinutes = startHour * 60 + startMinute;\n const timeWindowEndMinutes = endHour * 60 + endMinute;\n\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const eventStartMinutes = eventStart.hour() * 60 + eventStart.minute();\n const eventEndMinutes = eventEnd.hour() * 60 + eventEnd.minute();\n\n return !(eventEndMinutes <= timeWindowStartMinutes || eventStartMinutes >= timeWindowEndMinutes);\n}\n"],"mappings":";;;;;;AAUA,SAAS,aAAa,OAA0B;CAC9C,MAAM,SAAA,GAAQ,MAAA,QAAA,CAAM,MAAM,KAAK;CAC/B,MAAM,OAAA,GAAM,MAAA,QAAA,CAAM,MAAM,GAAG;CAC3B,IAAI,CAAC,MAAM,OAAO,MAAM,QAAQ,KAAK,CAAC,GACpC,OAAO;CAET,MAAM,eAAe,MAAM,QAAQ,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK;CACtD,OAAO,IAAI,OAAO,YAAY,KAAK,IAAI,OAAO,aAAa,SAAS,GAAG,QAAQ,CAAC;AAClF;AAEA,SAAgB,mBAAmB,EAAE,OAAO,WAAW,WAAoC;CACzF,IAAIA,0BAAAA,gBAAgB,KAAK,KAAK,aAAa,KAAK,GAC9C,OAAO;CAGT,IAAI,CAAC,aAAa,CAAC,SACjB,OAAO;CAGT,MAAM,CAAC,WAAW,eAAe,UAAU,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;CAChE,MAAM,CAAC,SAAS,aAAa,QAAQ,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;CAC1D,MAAM,yBAAyB,YAAY,KAAK;CAChD,MAAM,uBAAuB,UAAU,KAAK;CAE5C,MAAM,cAAA,GAAa,MAAA,QAAA,CAAM,MAAM,KAAK;CACpC,MAAM,YAAA,GAAW,MAAA,QAAA,CAAM,MAAM,GAAG;CAChC,MAAM,oBAAoB,WAAW,KAAK,IAAI,KAAK,WAAW,OAAO;CAGrE,OAAO,
|
|
1
|
+
{"version":3,"file":"is-event-in-time-range.cjs","names":["isMultidayEvent"],"sources":["../../../src/utils/is-event-in-time-range/is-event-in-time-range.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { ScheduleEventData } from '../../types';\nimport { isMultidayEvent } from '../is-multiday-event/is-multiday-event';\n\ninterface IsEventInTimeRangeInput {\n event: ScheduleEventData;\n startTime?: string;\n endTime?: string;\n}\n\nfunction spansFullDay(event: ScheduleEventData) {\n const start = dayjs(event.start);\n const end = dayjs(event.end);\n if (!start.isSame(start.startOf('day'))) {\n return false;\n }\n const nextDayStart = start.startOf('day').add(1, 'day');\n return end.isSame(nextDayStart) || end.isSame(nextDayStart.subtract(1, 'second'));\n}\n\nexport function isEventInTimeRange({ event, startTime, endTime }: IsEventInTimeRangeInput) {\n if (isMultidayEvent(event) || spansFullDay(event)) {\n return true;\n }\n\n if (!startTime || !endTime) {\n return true;\n }\n\n const [startHour, startMinute] = startTime.split(':').map(Number);\n const [endHour, endMinute] = endTime.split(':').map(Number);\n const timeWindowStartMinutes = startHour * 60 + startMinute;\n const timeWindowEndMinutes = endHour * 60 + endMinute;\n\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const endsAtNextDayStart = eventEnd.isSame(eventStart.startOf('day').add(1, 'day'), 'second');\n const eventStartMinutes = eventStart.hour() * 60 + eventStart.minute();\n const eventEndMinutes = endsAtNextDayStart ? 24 * 60 : eventEnd.hour() * 60 + eventEnd.minute();\n\n return !(eventEndMinutes <= timeWindowStartMinutes || eventStartMinutes >= timeWindowEndMinutes);\n}\n"],"mappings":";;;;;;AAUA,SAAS,aAAa,OAA0B;CAC9C,MAAM,SAAA,GAAQ,MAAA,QAAA,CAAM,MAAM,KAAK;CAC/B,MAAM,OAAA,GAAM,MAAA,QAAA,CAAM,MAAM,GAAG;CAC3B,IAAI,CAAC,MAAM,OAAO,MAAM,QAAQ,KAAK,CAAC,GACpC,OAAO;CAET,MAAM,eAAe,MAAM,QAAQ,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK;CACtD,OAAO,IAAI,OAAO,YAAY,KAAK,IAAI,OAAO,aAAa,SAAS,GAAG,QAAQ,CAAC;AAClF;AAEA,SAAgB,mBAAmB,EAAE,OAAO,WAAW,WAAoC;CACzF,IAAIA,0BAAAA,gBAAgB,KAAK,KAAK,aAAa,KAAK,GAC9C,OAAO;CAGT,IAAI,CAAC,aAAa,CAAC,SACjB,OAAO;CAGT,MAAM,CAAC,WAAW,eAAe,UAAU,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;CAChE,MAAM,CAAC,SAAS,aAAa,QAAQ,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;CAC1D,MAAM,yBAAyB,YAAY,KAAK;CAChD,MAAM,uBAAuB,UAAU,KAAK;CAE5C,MAAM,cAAA,GAAa,MAAA,QAAA,CAAM,MAAM,KAAK;CACpC,MAAM,YAAA,GAAW,MAAA,QAAA,CAAM,MAAM,GAAG;CAChC,MAAM,qBAAqB,SAAS,OAAO,WAAW,QAAQ,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,GAAG,QAAQ;CAC5F,MAAM,oBAAoB,WAAW,KAAK,IAAI,KAAK,WAAW,OAAO;CAGrE,OAAO,GAFiB,qBAAqB,OAAU,SAAS,KAAK,IAAI,KAAK,SAAS,OAAO,MAElE,0BAA0B,qBAAqB;AAC7E"}
|
|
@@ -48,7 +48,9 @@ const defaultProps = {
|
|
|
48
48
|
withDragSlotSelect: false,
|
|
49
49
|
withEventResize: false,
|
|
50
50
|
mode: "default",
|
|
51
|
-
withInteractiveBackgroundEvents: false
|
|
51
|
+
withInteractiveBackgroundEvents: false,
|
|
52
|
+
eventOverlapMode: "columns",
|
|
53
|
+
eventOverlapRaiseDelay: 600
|
|
52
54
|
};
|
|
53
55
|
const varsResolver = createVarsResolver((_theme, { radius, slotHeight, allDaySlotHeight }) => ({ dayView: {
|
|
54
56
|
"--day-view-radius": radius !== void 0 ? getRadius(radius) : void 0,
|
|
@@ -57,7 +59,7 @@ const varsResolver = createVarsResolver((_theme, { radius, slotHeight, allDaySlo
|
|
|
57
59
|
} }));
|
|
58
60
|
const DayView = factory((_props) => {
|
|
59
61
|
const props = useProps("DayView", defaultProps, _props);
|
|
60
|
-
const { classNames, className, style, styles, unstyled, attributes, vars, __staticSelector, startTime, endTime, intervalMinutes, withSubHourGridLines, withAllDaySlot, date, locale, slotLabelFormat, headerFormat, getCurrentTime, withCurrentTimeIndicator, withCurrentTimeBubble, withHeader, radius, onDateChange, onViewChange, previousControlProps, nextControlProps, todayControlProps, viewSelectProps, slotHeight, allDaySlotHeight, scrollAreaProps, events, moreEventsProps, renderEventBody, renderEvent, labels, highlightBusinessHours, businessHours, withEventsDragAndDrop, onEventDrop, canDragEvent, eventDragInterval, onEventDragStart, onEventDragEnd, onTimeSlotClick, onAllDaySlotClick, onEventClick, withInteractiveBackgroundEvents, withDragSlotSelect, onSlotDragEnd, mode, startScrollTime, onExternalEventDrop, withEventResize, onEventResize, canResizeEvent, eventResizeInterval, recurrenceExpansionLimit, getTimeSlotProps, withAgenda, ...others } = props;
|
|
62
|
+
const { classNames, className, style, styles, unstyled, attributes, vars, __staticSelector, startTime, endTime, intervalMinutes, withSubHourGridLines, eventOverlapMode, eventOverlapRaiseDelay, withAllDaySlot, date, locale, slotLabelFormat, headerFormat, getCurrentTime, withCurrentTimeIndicator, withCurrentTimeBubble, withHeader, radius, onDateChange, onViewChange, previousControlProps, nextControlProps, todayControlProps, viewSelectProps, slotHeight, allDaySlotHeight, scrollAreaProps, events, moreEventsProps, renderEventBody, renderEvent, labels, highlightBusinessHours, businessHours, withEventsDragAndDrop, onEventDrop, canDragEvent, eventDragInterval, onEventDragStart, onEventDragEnd, onTimeSlotClick, onAllDaySlotClick, onEventClick, withInteractiveBackgroundEvents, withDragSlotSelect, onSlotDragEnd, mode, startScrollTime, onExternalEventDrop, withEventResize, onEventResize, canResizeEvent, eventResizeInterval, recurrenceExpansionLimit, getTimeSlotProps, withAgenda, ...others } = props;
|
|
61
63
|
const [agendaOpen, setAgendaOpen] = useState(false);
|
|
62
64
|
const getStyles = useStyles({
|
|
63
65
|
name: __staticSelector,
|
|
@@ -182,7 +184,8 @@ const DayView = factory((_props) => {
|
|
|
182
184
|
date,
|
|
183
185
|
startTime,
|
|
184
186
|
endTime,
|
|
185
|
-
intervalMinutes
|
|
187
|
+
intervalMinutes,
|
|
188
|
+
eventOverlapMode
|
|
186
189
|
});
|
|
187
190
|
const handleExternalDrop = useCallback((e, slotIndex) => {
|
|
188
191
|
if (!onExternalEventDrop) return;
|
|
@@ -297,13 +300,16 @@ const DayView = factory((_props) => {
|
|
|
297
300
|
if (!eventResize.wasResizing()) onEventClick(event, e);
|
|
298
301
|
} : void 0,
|
|
299
302
|
...stylesApiProps,
|
|
303
|
+
mod: { cascade: eventOverlapMode === "cascade" },
|
|
300
304
|
style: {
|
|
301
305
|
...stylesApiProps.styles?.event,
|
|
302
306
|
top: `${eventTop}%`,
|
|
303
307
|
height: `${eventHeight}%`,
|
|
304
308
|
insetInlineStart: `${event.position.offset}%`,
|
|
305
309
|
width: `${event.position.width}%`,
|
|
306
|
-
position: "absolute"
|
|
310
|
+
position: "absolute",
|
|
311
|
+
"--event-z-index": event.position.column + 3,
|
|
312
|
+
"--event-z-index-raised": event.position.overlaps + 3
|
|
307
313
|
}
|
|
308
314
|
}, event.id);
|
|
309
315
|
});
|
|
@@ -421,6 +427,7 @@ const DayView = factory((_props) => {
|
|
|
421
427
|
}, event.id));
|
|
422
428
|
const content = /* @__PURE__ */ jsxs(Box, {
|
|
423
429
|
...getStyles("dayView"),
|
|
430
|
+
__vars: { "--event-raise-delay": `${eventOverlapRaiseDelay}ms` },
|
|
424
431
|
mod: {
|
|
425
432
|
static: mode === "static",
|
|
426
433
|
"slot-dragging": slotDragSelect.isDragging,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DayView.mjs","names":["classes"],"sources":["../../../src/components/DayView/DayView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useRef, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n rem,\n ScrollArea,\n ScrollAreaAutosizeProps,\n StylesApiProps,\n UnstyledButton,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport { useAutoScrollOnDrag } from '../../hooks/use-auto-scroll-on-drag';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useEventResize } from '../../hooks/use-event-resize';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n AnyDateValue,\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n clampIntervalMinutes,\n expandRecurringEvents,\n formatDate,\n getBusinessHoursMod,\n getDayPosition,\n getDayTimeIntervals,\n getTimeAxisEventStyle,\n getVisibleEvents,\n isAllDayEvent,\n toDateString,\n} from '../../utils';\nimport { AgendaView, AgendaViewStylesNames } from '../AgendaView/AgendaView';\nimport {\n CurrentTimeIndicator,\n CurrentTimeIndicatorStylesNames,\n} from '../CurrentTimeIndicator/CurrentTimeIndicator';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent';\nimport {\n RenderEvent,\n RenderEventBody,\n ScheduleEvent,\n ScheduleEventStylesNames,\n} from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectStylesNames } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getDayViewEvents } from './get-day-view-events/get-day-view-events';\nimport classes from './DayView.module.css';\n\nexport type DayViewStylesNames =\n | 'dayView'\n | 'dayViewInner'\n | 'dayViewScrollArea'\n | 'dayViewAllDay'\n | 'dayViewAllDayEvents'\n | 'dayViewSlot'\n | 'dayViewSlots'\n | 'dayViewTimeSlots'\n | 'dayViewSlotLabel'\n | 'dayViewSlotLabels'\n | 'dayViewBackgroundEvent'\n | 'dayViewDragPreview'\n | MoreEventsStylesNames\n | ScheduleEventStylesNames\n | Exclude<CombinedScheduleHeaderStylesNames, MonthYearSelectStylesNames>\n | CurrentTimeIndicatorStylesNames\n | AgendaViewStylesNames;\n\nexport type DayViewCssVariables = {\n dayView: '--day-view-radius' | '--day-view-slot-height' | '--day-view-all-day-slot-height';\n};\n\nexport interface DayViewProps\n extends BoxProps, StylesApiProps<DayViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Day to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | DateStringValue;\n\n /** Called when date is changed */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Events to display, must be a stable reference */\n events?: ScheduleEventData[];\n\n /** Time slots start time, in `HH:mm:ss` format @default 00:00:00 */\n startTime?: string;\n\n /** Time slots end time in `HH:mm:ss` format @default 23:59:59 */\n endTime?: string;\n\n /** Number of minutes for each time slot. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours (e.g. `120`, `240`) @default 15 */\n intervalMinutes?: number;\n\n /** If set, grid lines are displayed for intervals smaller than one hour, for example 15 and 30 minutes intervals @default true */\n withSubHourGridLines?: boolean;\n\n /** If set, the all-day slot is displayed below the header @default true */\n withAllDaySlot?: boolean;\n\n /** Locale passed down to dayjs, overrides value defined on `DatesProvider` */\n locale?: string;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Dayjs format for slot labels or a callback function that returns formatted value @default HH:mm */\n slotLabelFormat?: DateLabelFormat;\n\n /** Date format in the header @default MMMM D, YYYY */\n headerFormat?: DateLabelFormat;\n\n /** If set, displays a line indicating the current time. By default, displayed only for the current day. */\n withCurrentTimeIndicator?: boolean;\n\n /** If set, the time indicator displays the current time in the bubble @default true */\n withCurrentTimeBubble?: boolean;\n\n /** A function to get the current time, called on every tick. Can be used to display the current time indicator in a different timezone. @default () => dayjs() */\n getCurrentTime?: () => AnyDateValue;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous month control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next month control */\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to today control */\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to view level select */\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n\n /** Height of 1hr slot @default 64px */\n slotHeight?: React.CSSProperties['height'];\n\n /** Height of all-day slot @default 44px */\n allDaySlotHeight?: React.CSSProperties['height'];\n\n /** Props passed down to the `ScrollArea.Autosize` component */\n scrollAreaProps?: ScrollAreaAutosizeProps & DataAttributes;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Function to customize event body, `event` object is passed as first argument */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering, receives all props that would be passed to the root element including children */\n renderEvent?: RenderEvent;\n\n /** Labels override */\n labels?: ScheduleLabelsOverride;\n\n /** If set to true, highlights business hours with white background @default false */\n highlightBusinessHours?: boolean;\n\n /** Business hours range in `HH:mm:ss` format @default ['09:00:00', '17:00:00'] */\n businessHours?: [string, string];\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped at new time */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for moving events by drag and drop, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventDragInterval?: number;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n }) => void;\n\n /** Called when all-day slot is clicked */\n onAllDaySlotClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick` @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** If set, enables drag-to-select time slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a time slot range is selected by dragging */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Interaction mode: 'default' allows all interactions, 'static' disables event interactions @default default */\n mode?: ScheduleMode;\n\n /** Time to scroll to on initial render, in `HH:mm:ss` format */\n startScrollTime?: string;\n\n /** Called when an external item is dropped onto the schedule. Receives the `DataTransfer` object and the drop target datetime. */\n onExternalEventDrop?: (dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue) => void;\n\n /** If true, events can be resized by dragging their edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for resizing events, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventResizeInterval?: number;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Function to get additional props for each time slot. Receives slot start and end datetime strings. Returned props are spread onto the slot element. Event handlers returned by this function are composed with internal handlers (e.g. onClick) rather than overriding them. */\n getTimeSlotProps?: (data: {\n start: DateTimeStringValue;\n end: DateTimeStringValue;\n }) => Record<string, any> | undefined;\n\n /** If set, displays an Agenda button in the header that opens an agenda list view @default false */\n withAgenda?: boolean;\n}\n\nexport type DayViewFactory = Factory<{\n props: DayViewProps;\n ref: HTMLDivElement;\n stylesNames: DayViewStylesNames;\n vars: DayViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'DayView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 15,\n withSubHourGridLines: true,\n withAllDaySlot: true,\n slotLabelFormat: 'HH:mm',\n headerFormat: 'MMMM D, YYYY',\n withCurrentTimeBubble: true,\n withHeader: true,\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n withEventResize: false,\n mode: 'default',\n withInteractiveBackgroundEvents: false,\n} satisfies Partial<DayViewProps>;\n\nconst varsResolver = createVarsResolver<DayViewFactory>(\n (_theme, { radius, slotHeight, allDaySlotHeight }) => ({\n dayView: {\n '--day-view-radius': radius !== undefined ? getRadius(radius) : undefined,\n '--day-view-slot-height': rem(slotHeight),\n '--day-view-all-day-slot-height': rem(allDaySlotHeight),\n },\n })\n);\n\nexport const DayView = factory<DayViewFactory>((_props) => {\n const props = useProps('DayView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n __staticSelector,\n startTime,\n endTime,\n intervalMinutes,\n withSubHourGridLines,\n withAllDaySlot,\n date,\n locale,\n slotLabelFormat,\n headerFormat,\n getCurrentTime,\n withCurrentTimeIndicator,\n withCurrentTimeBubble,\n withHeader,\n radius,\n onDateChange,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n slotHeight,\n allDaySlotHeight,\n scrollAreaProps,\n events,\n moreEventsProps,\n renderEventBody,\n renderEvent,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n eventDragInterval,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n startScrollTime,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n eventResizeInterval,\n recurrenceExpansionLimit,\n getTimeSlotProps,\n withAgenda,\n ...others\n } = props;\n\n const [agendaOpen, setAgendaOpen] = useState(false);\n\n const getStyles = useStyles<DayViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n rootSelector: 'dayView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<DayViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const ctx = useDatesContext();\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const showCurrentTimeIndicator =\n withCurrentTimeIndicator ?? dayjs(date).isSame(resolveNow(), 'day');\n const slots = getDayTimeIntervals({ startTime, endTime, intervalMinutes });\n const slotsRef = useRef<HTMLButtonElement[]>([]);\n const viewportRef = useRef<HTMLDivElement>(null);\n const timeSlotsContainerRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n\n useAutoScrollOnDrag({\n viewportRef,\n enabled: (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static',\n });\n\n useIsomorphicEffect(() => {\n if (!startScrollTime || !viewportRef.current || slotsRef.current.length === 0) {\n return;\n }\n\n const targetIndex = slots.findIndex((s) => s.startTime >= startScrollTime);\n if (targetIndex < 0) {\n return;\n }\n\n const targetSlot = slotsRef.current[targetIndex];\n if (!targetSlot) {\n return;\n }\n\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n viewportRef.current.scrollTo({ left: 0, top: slotRect.top - viewportRect.top });\n }, []);\n\n const dragOffsetRef = useRef<{ offset: number; size: number }>({ offset: 0, size: 0 });\n\n const getSlotIndexFromDragPoint = useCallback((event: React.DragEvent) => {\n const slotIndex = slotsRef.current.findIndex((slotNode) => {\n if (!slotNode) {\n return false;\n }\n\n const rect = slotNode.getBoundingClientRect();\n return event.clientY >= rect.top && event.clientY <= rect.bottom;\n });\n\n if (slotIndex >= 0) {\n const rect = slotsRef.current[slotIndex]!.getBoundingClientRect();\n dragOffsetRef.current = { offset: event.clientY - rect.top, size: rect.height };\n return slotIndex;\n }\n\n const firstSlot = slotsRef.current[0];\n const lastSlot = slotsRef.current[slotsRef.current.length - 1];\n\n if (!firstSlot || !lastSlot) {\n return null;\n }\n\n const firstRect = firstSlot.getBoundingClientRect();\n const lastRect = lastSlot.getBoundingClientRect();\n\n if (event.clientY < firstRect.top) {\n dragOffsetRef.current = { offset: 0, size: firstRect.height };\n return 0;\n }\n\n if (event.clientY > lastRect.bottom) {\n dragOffsetRef.current = { offset: lastRect.height, size: lastRect.height };\n return slotsRef.current.length - 1;\n }\n\n return null;\n }, []);\n\n const handleSlotKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>, slotIndex: number) => {\n const direction = event.key;\n if (direction === 'ArrowDown' && slotIndex < slots.length - 1) {\n event.preventDefault();\n slotsRef.current[slotIndex + 1]?.focus();\n } else if (direction === 'ArrowUp' && slotIndex > 0) {\n event.preventDefault();\n slotsRef.current[slotIndex - 1]?.focus();\n }\n };\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex) => {\n if (!onSlotDragEnd) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n onSlotDragEnd(\n `${slotDate} ${slots[startIndex].startTime}`,\n `${slotDate} ${slots[endIndex].endTime}`\n );\n },\n });\n\n const expandedEvents = expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('day').toDate(),\n rangeEnd: dayjs(date).endOf('day').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n });\n\n const eventsData = getDayViewEvents({\n events: expandedEvents,\n date,\n startTime,\n endTime,\n intervalMinutes,\n });\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, slotIndex: number) => {\n if (!onExternalEventDrop) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n const slotTime = slots[slotIndex].startTime;\n\n if (eventDragInterval == null) {\n onExternalEventDrop(e.dataTransfer, `${slotDate} ${slotTime}`);\n return;\n }\n\n const slotStart = `${slotDate} ${slotTime}`;\n const { start } = calculateDropTime({\n draggedEvent: { start: slotStart, end: slotStart } as ScheduleEventData,\n targetDate: date,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: dragOffsetRef.current.offset,\n slotSize: dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n onExternalEventDrop(e.dataTransfer, dayjs(start).format('YYYY-MM-DD HH:mm:ss'));\n },\n [onExternalEventDrop, date, slots, eventDragInterval, intervalMinutes, startTime, endTime]\n );\n\n const getDropTimeForSlot = (slotIndex: number, draggedEvent: ScheduleEventData) => {\n const slotTime = slots[slotIndex].startTime;\n return calculateDropTime({\n draggedEvent,\n targetDate: date,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: eventDragInterval == null ? undefined : dragOffsetRef.current.offset,\n slotSize: eventDragInterval == null ? undefined : dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n };\n\n const dragDrop = useDragDropHandlers({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: getDropTimeForSlot,\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const updateDragPreview = (slotIndex: number) => {\n const draggedEvent = dragDrop.dragContextValue.draggedEvent;\n if (eventDragInterval == null || !draggedEvent) {\n return;\n }\n const { start, end } = getDropTimeForSlot(slotIndex, draggedEvent);\n const newStart = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n if (dragDrop.dragPreview?.start !== newStart) {\n dragDrop.setDragPreview({\n start: newStart,\n end: dayjs(end).format('YYYY-MM-DD HH:mm:ss'),\n target: slotIndex,\n });\n }\n };\n\n const eventResize = useEventResize({\n enabled: withEventResize,\n mode,\n startTime,\n endTime,\n intervalMinutes,\n resizeIntervalMinutes: eventResizeInterval,\n onEventResize,\n canResizeEvent,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const eventsNodes = eventsData.regularEvents.map((event) => {\n const eventIsAllDay = isAllDayEvent({ event, date });\n const isDraggable = !eventIsAllDay && dragDrop.isDraggableEvent(event);\n const isResizable = !eventIsAllDay && eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const eventTop = resizePosition ? resizePosition.top : event.position.top;\n const eventHeight = resizePosition ? resizePosition.height : event.position.height;\n\n return (\n <ScheduleEvent\n event={event}\n key={event.id}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n autoSize\n draggable={isDraggable}\n withResize={isResizable}\n isResizing={resizePosition !== null}\n onResizeStart={\n isResizable\n ? (edge, e) => {\n if (timeSlotsContainerRef.current) {\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainerRef.current,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n {...stylesApiProps}\n style={{\n ...stylesApiProps.styles?.event,\n top: `${eventTop}%`,\n height: `${eventHeight}%`,\n insetInlineStart: `${event.position.offset}%`,\n width: `${event.position.width}%`,\n position: 'absolute',\n }}\n />\n );\n });\n\n const allDayEventsCount = getVisibleEvents({\n maxEvents: 2,\n totalEvents: eventsData.allDayEvents.length,\n });\n\n const allDayEventsNodes = eventsData.allDayEvents\n .slice(0, allDayEventsCount.visibleEventsCount)\n .map((event) => (\n <ScheduleEvent\n key={event.id}\n event={event}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n style={{ maxHeight: '50%' }}\n nowrap\n autoSize\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(event, e) : undefined}\n {...stylesApiProps}\n />\n ));\n\n const dayGroup = dayjs(date).format('YYYY-MM-DD');\n\n const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;\n\n const items = slots.map((slot, index) => {\n const isDropTarget = !suppressDropHighlight && dragDrop.isDropTarget(index);\n const isDragSelected = slotDragSelect.isSlotSelected(index, dayGroup);\n const slotStart = `${dayGroup} ${slot.startTime}` as DateTimeStringValue;\n const slotEnd = `${dayGroup} ${slot.endTime}` as DateTimeStringValue;\n const { onClick: externalOnClick, ...externalSlotProps } =\n getTimeSlotProps?.({ start: slotStart, end: slotEnd }) || {};\n\n const handleClick =\n mode === 'static'\n ? undefined\n : (event: React.MouseEvent<HTMLButtonElement>) => {\n onTimeSlotClick?.({\n slotStart,\n slotEnd,\n nativeEvent: event,\n });\n externalOnClick?.(event);\n };\n\n return (\n <UnstyledButton\n {...getStyles('dayViewSlot')}\n key={slot.startTime}\n ref={(node) => {\n slotsRef.current[index] = node!;\n }}\n mod={{\n first: index === 0,\n 'hour-start': slot.isHourStart,\n ...getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n __vars={{ '--slot-size': `${clampIntervalMinutes(intervalMinutes) / 60}` }}\n aria-label={`${getLabel('timeSlot', labels)} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : index === 0 ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? index : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? dayGroup : undefined}\n onKeyDown={mode === 'static' ? undefined : (e) => handleSlotKeyDown(e, index)}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => slotDragSelect.handleSlotPointerDown(e, index, dayGroup)\n : undefined\n }\n onClick={handleClick}\n onDragOver={withDragHandlers ? (event) => event.preventDefault() : undefined}\n {...externalSlotProps}\n />\n );\n });\n\n const slotsLabels = slots.reduce<React.ReactNode[]>((acc, slot) => {\n if (slot.isHourStart) {\n const slotTime = dayjs(`${dayjs(date).format('YYYY-MM-DD')} ${slot.startTime}`);\n const label = formatDate({\n locale: ctx.getLocale(locale),\n date: slotTime,\n format: slotLabelFormat,\n });\n\n acc.push(\n <Box\n {...getStyles('dayViewSlotLabel')}\n key={slot.startTime}\n mod={getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n })}\n >\n {label}\n </Box>\n );\n }\n return acc;\n }, []);\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const backgroundAllDayEventNodes = eventsData.backgroundAllDayEvents.map((event) => (\n <ScheduleBackgroundEvent\n key={`bg-allday-${event.id}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('dayViewBackgroundEvent', {\n style: { top: 0, height: '100%', width: '100%' },\n })}\n />\n ));\n\n const backgroundTimedEventNodes = eventsData.backgroundTimedEvents.map((event) => (\n <ScheduleBackgroundEvent\n key={event.id}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('dayViewBackgroundEvent', {\n style: {\n ...getTimeAxisEventStyle({\n start: event.position.top,\n span: event.position.height,\n axis: 'vertical',\n }),\n width: '100%',\n },\n })}\n />\n ));\n\n const content = (\n <Box\n {...getStyles('dayView')}\n mod={{\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'hide-sub-hour-grid-lines': !withSubHourGridLines,\n 'event-interaction': eventResize.isResizing || dragDrop.dragContextValue.isDragging,\n }}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"day\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'day')),\n next: () => toDateString(dayjs(date).add(1, 'day')),\n today: () => toDateString(resolveNow()),\n }}\n control={{\n title: formatDate({ locale: ctx.getLocale(locale), date, format: headerFormat }),\n miw: 140,\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={viewSelectProps}\n stylesApiProps={stylesApiProps}\n onAgendaClick={withAgenda ? () => setAgendaOpen((v) => !v) : undefined}\n agendaActive={agendaOpen}\n />\n )}\n\n {agendaOpen && (\n <AgendaView\n rangeStart={dayjs(date).startOf('day').format('YYYY-MM-DD')}\n rangeEnd={dayjs(date).endOf('day').format('YYYY-MM-DD')}\n events={events}\n locale={locale}\n labels={labels}\n mode={mode}\n onEventClick={onEventClick}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n {...stylesApiProps}\n />\n )}\n\n {!agendaOpen && (\n <ScrollArea.Autosize\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('dayViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n viewportRef={mergedViewportRef}\n >\n <Box {...getStyles('dayViewInner')}>\n <div {...getStyles('dayViewSlotLabels')}>\n {withAllDaySlot && (\n <Box {...getStyles('dayViewSlotLabel')} mod={{ 'all-day': true }}>\n {getLabel('allDay', labels)}\n </Box>\n )}\n {slotsLabels}\n </div>\n\n <div {...getStyles('dayViewSlots')}>\n {withAllDaySlot && (\n <div {...getStyles('dayViewAllDay')}>\n {backgroundAllDayEventNodes}\n <div {...getStyles('dayViewAllDayEvents')}>\n {allDayEventsNodes}\n {allDayEventsCount.hiddenEventsCount > 0 && (\n <MoreEvents\n events={eventsData.allDayEvents}\n moreEventsCount={allDayEventsCount.hiddenEventsCount}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n mode={mode}\n labels={labels}\n onEventClick={onEventClick}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n )}\n </div>\n <UnstyledButton\n {...getStyles('dayViewSlot')}\n mod={{ 'all-day': true, static: mode === 'static' }}\n aria-label={`${getLabel('timeSlot', labels)} ${getLabel('allDay', labels)}`}\n onClick={\n mode === 'static' || !onAllDaySlotClick\n ? undefined\n : (e) => {\n onAllDaySlotClick(dayjs(date).format('YYYY-MM-DD'), e);\n }\n }\n />\n </div>\n )}\n\n <div\n ref={timeSlotsContainerRef}\n {...getStyles('dayViewTimeSlots')}\n onDragOver={\n withDragHandlers\n ? (event) => {\n const slotIndex = getSlotIndexFromDragPoint(event);\n if (slotIndex !== null) {\n dragDrop.handleDragOver(event, slotIndex);\n updateDragPreview(slotIndex);\n }\n }\n : undefined\n }\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={\n withDragHandlers\n ? (event) => {\n const slotIndex = getSlotIndexFromDragPoint(event);\n if (slotIndex !== null) {\n dragDrop.handleDrop(event, slotIndex);\n }\n }\n : undefined\n }\n >\n {backgroundTimedEventNodes}\n\n {eventsNodes}\n\n {dragDrop.dragPreview && dragDrop.dragContextValue.draggedEvent && (\n <Box\n {...getStyles('dayViewDragPreview', {\n style: (() => {\n const { top, height } = getDayPosition({\n event: {\n ...dragDrop.dragContextValue.draggedEvent,\n start: dragDrop.dragPreview.start,\n end: dragDrop.dragPreview.end,\n },\n startTime,\n endTime,\n intervalMinutes,\n });\n return {\n position: 'absolute',\n insetInlineStart: 0,\n insetInlineEnd: 0,\n top: `${top}%`,\n height: `${height}%`,\n };\n })(),\n })}\n />\n )}\n\n {showCurrentTimeIndicator && (\n <CurrentTimeIndicator\n startOffset=\"calc(var(--day-view-slot-labels-width) * -1)\"\n endOffset=\"0rem\"\n topOffset=\"0rem\"\n timeBubbleStartOffset=\"calc(var(--day-view-slot-labels-width) * -1 + 30px)\"\n currentTimeFormat={slotLabelFormat}\n withTimeBubble={withCurrentTimeBubble}\n withThumb={!withCurrentTimeBubble}\n locale={locale}\n startTime={startTime}\n endTime={endTime}\n intervalMinutes={intervalMinutes}\n getCurrentTime={getCurrentTime}\n {...stylesApiProps}\n />\n )}\n {items}\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n )}\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nDayView.displayName = '@mantine/schedule/DayView';\nDayView.classes = classes;\nDayView.varsResolver = varsResolver;\n\nexport namespace DayView {\n export type Props = DayViewProps;\n export type Factory = DayViewFactory;\n export type StylesNames = DayViewStylesNames;\n export type CssVariables = DayViewCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuRA,MAAM,eAAe;CACnB,kBAAkB;CAClB,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,sBAAsB;CACtB,gBAAgB;CAChB,iBAAiB;CACjB,cAAc;CACd,uBAAuB;CACvB,YAAY;CACZ,wBAAwB;CACxB,eAAe,CAAC,YAAY,UAAU;CACtC,uBAAuB;CACvB,oBAAoB;CACpB,iBAAiB;CACjB,MAAM;CACN,iCAAiC;AACnC;AAEA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,YAAY,wBAAwB,EACrD,SAAS;CACP,qBAAqB,WAAW,KAAA,IAAY,UAAU,MAAM,IAAI,KAAA;CAChE,0BAA0B,IAAI,UAAU;CACxC,kCAAkC,IAAI,gBAAgB;AACxD,EACF,EACF;AAEA,MAAa,UAAU,SAAyB,WAAW;CACzD,MAAM,QAAQ,SAAS,WAAW,cAAc,MAAM;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,YACA,MACA,kBACA,WACA,SACA,iBACA,sBACA,gBACA,MACA,QACA,iBACA,cACA,gBACA,0BACA,uBACA,YACA,QACA,cACA,cACA,sBACA,kBACA,mBACA,iBACA,YACA,kBACA,iBACA,QACA,iBACA,iBACA,aACA,QACA,wBACA,eACA,uBACA,aACA,cACA,mBACA,kBACA,gBACA,iBACA,mBACA,cACA,iCACA,oBAC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P,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO,SAAS;EAAmB,UAAA;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,QAAQ,cAAc;AACtB,QAAQ,UAAUA;AAClB,QAAQ,eAAe"}
|
|
1
|
+
{"version":3,"file":"DayView.mjs","names":["classes"],"sources":["../../../src/components/DayView/DayView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useRef, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n rem,\n ScrollArea,\n ScrollAreaAutosizeProps,\n StylesApiProps,\n UnstyledButton,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport { useAutoScrollOnDrag } from '../../hooks/use-auto-scroll-on-drag';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useEventResize } from '../../hooks/use-event-resize';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n AnyDateValue,\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n ScheduleEventOverlapMode,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n clampIntervalMinutes,\n expandRecurringEvents,\n formatDate,\n getBusinessHoursMod,\n getDayPosition,\n getDayTimeIntervals,\n getTimeAxisEventStyle,\n getVisibleEvents,\n isAllDayEvent,\n toDateString,\n} from '../../utils';\nimport { AgendaView, AgendaViewStylesNames } from '../AgendaView/AgendaView';\nimport {\n CurrentTimeIndicator,\n CurrentTimeIndicatorStylesNames,\n} from '../CurrentTimeIndicator/CurrentTimeIndicator';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent';\nimport {\n RenderEvent,\n RenderEventBody,\n ScheduleEvent,\n ScheduleEventStylesNames,\n} from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectStylesNames } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getDayViewEvents } from './get-day-view-events/get-day-view-events';\nimport classes from './DayView.module.css';\n\nexport type DayViewStylesNames =\n | 'dayView'\n | 'dayViewInner'\n | 'dayViewScrollArea'\n | 'dayViewAllDay'\n | 'dayViewAllDayEvents'\n | 'dayViewSlot'\n | 'dayViewSlots'\n | 'dayViewTimeSlots'\n | 'dayViewSlotLabel'\n | 'dayViewSlotLabels'\n | 'dayViewBackgroundEvent'\n | 'dayViewDragPreview'\n | MoreEventsStylesNames\n | ScheduleEventStylesNames\n | Exclude<CombinedScheduleHeaderStylesNames, MonthYearSelectStylesNames>\n | CurrentTimeIndicatorStylesNames\n | AgendaViewStylesNames;\n\nexport type DayViewCssVariables = {\n dayView: '--day-view-radius' | '--day-view-slot-height' | '--day-view-all-day-slot-height';\n};\n\nexport interface DayViewProps\n extends BoxProps, StylesApiProps<DayViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Day to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | DateStringValue;\n\n /** Called when date is changed */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Events to display, must be a stable reference */\n events?: ScheduleEventData[];\n\n /** Time slots start time, in `HH:mm:ss` format @default 00:00:00 */\n startTime?: string;\n\n /** Time slots end time in `HH:mm:ss` format @default 23:59:59 */\n endTime?: string;\n\n /** Number of minutes for each time slot. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours (e.g. `120`, `240`) @default 15 */\n intervalMinutes?: number;\n\n /** If set, grid lines are displayed for intervals smaller than one hour, for example 15 and 30 minutes intervals @default true */\n withSubHourGridLines?: boolean;\n\n /** Determines how events that overlap in time are laid out: `columns` splits the available width between them, `cascade` indents each event and stacks it over the previous one @default 'columns' */\n eventOverlapMode?: ScheduleEventOverlapMode;\n\n /** Time in ms the pointer must rest on an event before it is raised above the events covering it, only used with `eventOverlapMode=\"cascade\"` @default 600 */\n eventOverlapRaiseDelay?: number;\n\n /** If set, the all-day slot is displayed below the header @default true */\n withAllDaySlot?: boolean;\n\n /** Locale passed down to dayjs, overrides value defined on `DatesProvider` */\n locale?: string;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Dayjs format for slot labels or a callback function that returns formatted value @default HH:mm */\n slotLabelFormat?: DateLabelFormat;\n\n /** Date format in the header @default MMMM D, YYYY */\n headerFormat?: DateLabelFormat;\n\n /** If set, displays a line indicating the current time. By default, displayed only for the current day. */\n withCurrentTimeIndicator?: boolean;\n\n /** If set, the time indicator displays the current time in the bubble @default true */\n withCurrentTimeBubble?: boolean;\n\n /** A function to get the current time, called on every tick. Can be used to display the current time indicator in a different timezone. @default () => dayjs() */\n getCurrentTime?: () => AnyDateValue;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous month control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next month control */\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to today control */\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to view level select */\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n\n /** Height of 1hr slot @default 64px */\n slotHeight?: React.CSSProperties['height'];\n\n /** Height of all-day slot @default 44px */\n allDaySlotHeight?: React.CSSProperties['height'];\n\n /** Props passed down to the `ScrollArea.Autosize` component */\n scrollAreaProps?: ScrollAreaAutosizeProps & DataAttributes;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Function to customize event body, `event` object is passed as first argument */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering, receives all props that would be passed to the root element including children */\n renderEvent?: RenderEvent;\n\n /** Labels override */\n labels?: ScheduleLabelsOverride;\n\n /** If set to true, highlights business hours with white background @default false */\n highlightBusinessHours?: boolean;\n\n /** Business hours range in `HH:mm:ss` format @default ['09:00:00', '17:00:00'] */\n businessHours?: [string, string];\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped at new time */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for moving events by drag and drop, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventDragInterval?: number;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n }) => void;\n\n /** Called when all-day slot is clicked */\n onAllDaySlotClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick` @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** If set, enables drag-to-select time slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a time slot range is selected by dragging */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Interaction mode: 'default' allows all interactions, 'static' disables event interactions @default default */\n mode?: ScheduleMode;\n\n /** Time to scroll to on initial render, in `HH:mm:ss` format */\n startScrollTime?: string;\n\n /** Called when an external item is dropped onto the schedule. Receives the `DataTransfer` object and the drop target datetime. */\n onExternalEventDrop?: (dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue) => void;\n\n /** If true, events can be resized by dragging their edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for resizing events, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventResizeInterval?: number;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Function to get additional props for each time slot. Receives slot start and end datetime strings. Returned props are spread onto the slot element. Event handlers returned by this function are composed with internal handlers (e.g. onClick) rather than overriding them. */\n getTimeSlotProps?: (data: {\n start: DateTimeStringValue;\n end: DateTimeStringValue;\n }) => Record<string, any> | undefined;\n\n /** If set, displays an Agenda button in the header that opens an agenda list view @default false */\n withAgenda?: boolean;\n}\n\nexport type DayViewFactory = Factory<{\n props: DayViewProps;\n ref: HTMLDivElement;\n stylesNames: DayViewStylesNames;\n vars: DayViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'DayView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 15,\n withSubHourGridLines: true,\n withAllDaySlot: true,\n slotLabelFormat: 'HH:mm',\n headerFormat: 'MMMM D, YYYY',\n withCurrentTimeBubble: true,\n withHeader: true,\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n withEventResize: false,\n mode: 'default',\n withInteractiveBackgroundEvents: false,\n eventOverlapMode: 'columns',\n eventOverlapRaiseDelay: 600,\n} satisfies Partial<DayViewProps>;\n\nconst varsResolver = createVarsResolver<DayViewFactory>(\n (_theme, { radius, slotHeight, allDaySlotHeight }) => ({\n dayView: {\n '--day-view-radius': radius !== undefined ? getRadius(radius) : undefined,\n '--day-view-slot-height': rem(slotHeight),\n '--day-view-all-day-slot-height': rem(allDaySlotHeight),\n },\n })\n);\n\nexport const DayView = factory<DayViewFactory>((_props) => {\n const props = useProps('DayView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n __staticSelector,\n startTime,\n endTime,\n intervalMinutes,\n withSubHourGridLines,\n eventOverlapMode,\n eventOverlapRaiseDelay,\n withAllDaySlot,\n date,\n locale,\n slotLabelFormat,\n headerFormat,\n getCurrentTime,\n withCurrentTimeIndicator,\n withCurrentTimeBubble,\n withHeader,\n radius,\n onDateChange,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n slotHeight,\n allDaySlotHeight,\n scrollAreaProps,\n events,\n moreEventsProps,\n renderEventBody,\n renderEvent,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n eventDragInterval,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n startScrollTime,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n eventResizeInterval,\n recurrenceExpansionLimit,\n getTimeSlotProps,\n withAgenda,\n ...others\n } = props;\n\n const [agendaOpen, setAgendaOpen] = useState(false);\n\n const getStyles = useStyles<DayViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n rootSelector: 'dayView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<DayViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const ctx = useDatesContext();\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const showCurrentTimeIndicator =\n withCurrentTimeIndicator ?? dayjs(date).isSame(resolveNow(), 'day');\n const slots = getDayTimeIntervals({ startTime, endTime, intervalMinutes });\n const slotsRef = useRef<HTMLButtonElement[]>([]);\n const viewportRef = useRef<HTMLDivElement>(null);\n const timeSlotsContainerRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n\n useAutoScrollOnDrag({\n viewportRef,\n enabled: (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static',\n });\n\n useIsomorphicEffect(() => {\n if (!startScrollTime || !viewportRef.current || slotsRef.current.length === 0) {\n return;\n }\n\n const targetIndex = slots.findIndex((s) => s.startTime >= startScrollTime);\n if (targetIndex < 0) {\n return;\n }\n\n const targetSlot = slotsRef.current[targetIndex];\n if (!targetSlot) {\n return;\n }\n\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n viewportRef.current.scrollTo({ left: 0, top: slotRect.top - viewportRect.top });\n }, []);\n\n const dragOffsetRef = useRef<{ offset: number; size: number }>({ offset: 0, size: 0 });\n\n const getSlotIndexFromDragPoint = useCallback((event: React.DragEvent) => {\n const slotIndex = slotsRef.current.findIndex((slotNode) => {\n if (!slotNode) {\n return false;\n }\n\n const rect = slotNode.getBoundingClientRect();\n return event.clientY >= rect.top && event.clientY <= rect.bottom;\n });\n\n if (slotIndex >= 0) {\n const rect = slotsRef.current[slotIndex]!.getBoundingClientRect();\n dragOffsetRef.current = { offset: event.clientY - rect.top, size: rect.height };\n return slotIndex;\n }\n\n const firstSlot = slotsRef.current[0];\n const lastSlot = slotsRef.current[slotsRef.current.length - 1];\n\n if (!firstSlot || !lastSlot) {\n return null;\n }\n\n const firstRect = firstSlot.getBoundingClientRect();\n const lastRect = lastSlot.getBoundingClientRect();\n\n if (event.clientY < firstRect.top) {\n dragOffsetRef.current = { offset: 0, size: firstRect.height };\n return 0;\n }\n\n if (event.clientY > lastRect.bottom) {\n dragOffsetRef.current = { offset: lastRect.height, size: lastRect.height };\n return slotsRef.current.length - 1;\n }\n\n return null;\n }, []);\n\n const handleSlotKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>, slotIndex: number) => {\n const direction = event.key;\n if (direction === 'ArrowDown' && slotIndex < slots.length - 1) {\n event.preventDefault();\n slotsRef.current[slotIndex + 1]?.focus();\n } else if (direction === 'ArrowUp' && slotIndex > 0) {\n event.preventDefault();\n slotsRef.current[slotIndex - 1]?.focus();\n }\n };\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex) => {\n if (!onSlotDragEnd) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n onSlotDragEnd(\n `${slotDate} ${slots[startIndex].startTime}`,\n `${slotDate} ${slots[endIndex].endTime}`\n );\n },\n });\n\n const expandedEvents = expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('day').toDate(),\n rangeEnd: dayjs(date).endOf('day').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n });\n\n const eventsData = getDayViewEvents({\n events: expandedEvents,\n date,\n startTime,\n endTime,\n intervalMinutes,\n eventOverlapMode,\n });\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, slotIndex: number) => {\n if (!onExternalEventDrop) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n const slotTime = slots[slotIndex].startTime;\n\n if (eventDragInterval == null) {\n onExternalEventDrop(e.dataTransfer, `${slotDate} ${slotTime}`);\n return;\n }\n\n const slotStart = `${slotDate} ${slotTime}`;\n const { start } = calculateDropTime({\n draggedEvent: { start: slotStart, end: slotStart } as ScheduleEventData,\n targetDate: date,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: dragOffsetRef.current.offset,\n slotSize: dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n onExternalEventDrop(e.dataTransfer, dayjs(start).format('YYYY-MM-DD HH:mm:ss'));\n },\n [onExternalEventDrop, date, slots, eventDragInterval, intervalMinutes, startTime, endTime]\n );\n\n const getDropTimeForSlot = (slotIndex: number, draggedEvent: ScheduleEventData) => {\n const slotTime = slots[slotIndex].startTime;\n return calculateDropTime({\n draggedEvent,\n targetDate: date,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: eventDragInterval == null ? undefined : dragOffsetRef.current.offset,\n slotSize: eventDragInterval == null ? undefined : dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n };\n\n const dragDrop = useDragDropHandlers({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: getDropTimeForSlot,\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const updateDragPreview = (slotIndex: number) => {\n const draggedEvent = dragDrop.dragContextValue.draggedEvent;\n if (eventDragInterval == null || !draggedEvent) {\n return;\n }\n const { start, end } = getDropTimeForSlot(slotIndex, draggedEvent);\n const newStart = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n if (dragDrop.dragPreview?.start !== newStart) {\n dragDrop.setDragPreview({\n start: newStart,\n end: dayjs(end).format('YYYY-MM-DD HH:mm:ss'),\n target: slotIndex,\n });\n }\n };\n\n const eventResize = useEventResize({\n enabled: withEventResize,\n mode,\n startTime,\n endTime,\n intervalMinutes,\n resizeIntervalMinutes: eventResizeInterval,\n onEventResize,\n canResizeEvent,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const eventsNodes = eventsData.regularEvents.map((event) => {\n const eventIsAllDay = isAllDayEvent({ event, date });\n const isDraggable = !eventIsAllDay && dragDrop.isDraggableEvent(event);\n const isResizable = !eventIsAllDay && eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const eventTop = resizePosition ? resizePosition.top : event.position.top;\n const eventHeight = resizePosition ? resizePosition.height : event.position.height;\n\n return (\n <ScheduleEvent\n event={event}\n key={event.id}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n autoSize\n draggable={isDraggable}\n withResize={isResizable}\n isResizing={resizePosition !== null}\n onResizeStart={\n isResizable\n ? (edge, e) => {\n if (timeSlotsContainerRef.current) {\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainerRef.current,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n {...stylesApiProps}\n mod={{ cascade: eventOverlapMode === 'cascade' }}\n style={{\n ...stylesApiProps.styles?.event,\n top: `${eventTop}%`,\n height: `${eventHeight}%`,\n insetInlineStart: `${event.position.offset}%`,\n width: `${event.position.width}%`,\n position: 'absolute',\n '--event-z-index': event.position.column + 3,\n '--event-z-index-raised': event.position.overlaps + 3,\n }}\n />\n );\n });\n\n const allDayEventsCount = getVisibleEvents({\n maxEvents: 2,\n totalEvents: eventsData.allDayEvents.length,\n });\n\n const allDayEventsNodes = eventsData.allDayEvents\n .slice(0, allDayEventsCount.visibleEventsCount)\n .map((event) => (\n <ScheduleEvent\n key={event.id}\n event={event}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n style={{ maxHeight: '50%' }}\n nowrap\n autoSize\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(event, e) : undefined}\n {...stylesApiProps}\n />\n ));\n\n const dayGroup = dayjs(date).format('YYYY-MM-DD');\n\n const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;\n\n const items = slots.map((slot, index) => {\n const isDropTarget = !suppressDropHighlight && dragDrop.isDropTarget(index);\n const isDragSelected = slotDragSelect.isSlotSelected(index, dayGroup);\n const slotStart = `${dayGroup} ${slot.startTime}` as DateTimeStringValue;\n const slotEnd = `${dayGroup} ${slot.endTime}` as DateTimeStringValue;\n const { onClick: externalOnClick, ...externalSlotProps } =\n getTimeSlotProps?.({ start: slotStart, end: slotEnd }) || {};\n\n const handleClick =\n mode === 'static'\n ? undefined\n : (event: React.MouseEvent<HTMLButtonElement>) => {\n onTimeSlotClick?.({\n slotStart,\n slotEnd,\n nativeEvent: event,\n });\n externalOnClick?.(event);\n };\n\n return (\n <UnstyledButton\n {...getStyles('dayViewSlot')}\n key={slot.startTime}\n ref={(node) => {\n slotsRef.current[index] = node!;\n }}\n mod={{\n first: index === 0,\n 'hour-start': slot.isHourStart,\n ...getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n __vars={{ '--slot-size': `${clampIntervalMinutes(intervalMinutes) / 60}` }}\n aria-label={`${getLabel('timeSlot', labels)} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : index === 0 ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? index : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? dayGroup : undefined}\n onKeyDown={mode === 'static' ? undefined : (e) => handleSlotKeyDown(e, index)}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => slotDragSelect.handleSlotPointerDown(e, index, dayGroup)\n : undefined\n }\n onClick={handleClick}\n onDragOver={withDragHandlers ? (event) => event.preventDefault() : undefined}\n {...externalSlotProps}\n />\n );\n });\n\n const slotsLabels = slots.reduce<React.ReactNode[]>((acc, slot) => {\n if (slot.isHourStart) {\n const slotTime = dayjs(`${dayjs(date).format('YYYY-MM-DD')} ${slot.startTime}`);\n const label = formatDate({\n locale: ctx.getLocale(locale),\n date: slotTime,\n format: slotLabelFormat,\n });\n\n acc.push(\n <Box\n {...getStyles('dayViewSlotLabel')}\n key={slot.startTime}\n mod={getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n })}\n >\n {label}\n </Box>\n );\n }\n return acc;\n }, []);\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const backgroundAllDayEventNodes = eventsData.backgroundAllDayEvents.map((event) => (\n <ScheduleBackgroundEvent\n key={`bg-allday-${event.id}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('dayViewBackgroundEvent', {\n style: { top: 0, height: '100%', width: '100%' },\n })}\n />\n ));\n\n const backgroundTimedEventNodes = eventsData.backgroundTimedEvents.map((event) => (\n <ScheduleBackgroundEvent\n key={event.id}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('dayViewBackgroundEvent', {\n style: {\n ...getTimeAxisEventStyle({\n start: event.position.top,\n span: event.position.height,\n axis: 'vertical',\n }),\n width: '100%',\n },\n })}\n />\n ));\n\n const content = (\n <Box\n {...getStyles('dayView')}\n __vars={{ '--event-raise-delay': `${eventOverlapRaiseDelay}ms` }}\n mod={{\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'hide-sub-hour-grid-lines': !withSubHourGridLines,\n 'event-interaction': eventResize.isResizing || dragDrop.dragContextValue.isDragging,\n }}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"day\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'day')),\n next: () => toDateString(dayjs(date).add(1, 'day')),\n today: () => toDateString(resolveNow()),\n }}\n control={{\n title: formatDate({ locale: ctx.getLocale(locale), date, format: headerFormat }),\n miw: 140,\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={viewSelectProps}\n stylesApiProps={stylesApiProps}\n onAgendaClick={withAgenda ? () => setAgendaOpen((v) => !v) : undefined}\n agendaActive={agendaOpen}\n />\n )}\n\n {agendaOpen && (\n <AgendaView\n rangeStart={dayjs(date).startOf('day').format('YYYY-MM-DD')}\n rangeEnd={dayjs(date).endOf('day').format('YYYY-MM-DD')}\n events={events}\n locale={locale}\n labels={labels}\n mode={mode}\n onEventClick={onEventClick}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n {...stylesApiProps}\n />\n )}\n\n {!agendaOpen && (\n <ScrollArea.Autosize\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('dayViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n viewportRef={mergedViewportRef}\n >\n <Box {...getStyles('dayViewInner')}>\n <div {...getStyles('dayViewSlotLabels')}>\n {withAllDaySlot && (\n <Box {...getStyles('dayViewSlotLabel')} mod={{ 'all-day': true }}>\n {getLabel('allDay', labels)}\n </Box>\n )}\n {slotsLabels}\n </div>\n\n <div {...getStyles('dayViewSlots')}>\n {withAllDaySlot && (\n <div {...getStyles('dayViewAllDay')}>\n {backgroundAllDayEventNodes}\n <div {...getStyles('dayViewAllDayEvents')}>\n {allDayEventsNodes}\n {allDayEventsCount.hiddenEventsCount > 0 && (\n <MoreEvents\n events={eventsData.allDayEvents}\n moreEventsCount={allDayEventsCount.hiddenEventsCount}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n mode={mode}\n labels={labels}\n onEventClick={onEventClick}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n )}\n </div>\n <UnstyledButton\n {...getStyles('dayViewSlot')}\n mod={{ 'all-day': true, static: mode === 'static' }}\n aria-label={`${getLabel('timeSlot', labels)} ${getLabel('allDay', labels)}`}\n onClick={\n mode === 'static' || !onAllDaySlotClick\n ? undefined\n : (e) => {\n onAllDaySlotClick(dayjs(date).format('YYYY-MM-DD'), e);\n }\n }\n />\n </div>\n )}\n\n <div\n ref={timeSlotsContainerRef}\n {...getStyles('dayViewTimeSlots')}\n onDragOver={\n withDragHandlers\n ? (event) => {\n const slotIndex = getSlotIndexFromDragPoint(event);\n if (slotIndex !== null) {\n dragDrop.handleDragOver(event, slotIndex);\n updateDragPreview(slotIndex);\n }\n }\n : undefined\n }\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={\n withDragHandlers\n ? (event) => {\n const slotIndex = getSlotIndexFromDragPoint(event);\n if (slotIndex !== null) {\n dragDrop.handleDrop(event, slotIndex);\n }\n }\n : undefined\n }\n >\n {backgroundTimedEventNodes}\n\n {eventsNodes}\n\n {dragDrop.dragPreview && dragDrop.dragContextValue.draggedEvent && (\n <Box\n {...getStyles('dayViewDragPreview', {\n style: (() => {\n const { top, height } = getDayPosition({\n event: {\n ...dragDrop.dragContextValue.draggedEvent,\n start: dragDrop.dragPreview.start,\n end: dragDrop.dragPreview.end,\n },\n startTime,\n endTime,\n intervalMinutes,\n });\n return {\n position: 'absolute',\n insetInlineStart: 0,\n insetInlineEnd: 0,\n top: `${top}%`,\n height: `${height}%`,\n };\n })(),\n })}\n />\n )}\n\n {showCurrentTimeIndicator && (\n <CurrentTimeIndicator\n startOffset=\"calc(var(--day-view-slot-labels-width) * -1)\"\n endOffset=\"0rem\"\n topOffset=\"0rem\"\n timeBubbleStartOffset=\"calc(var(--day-view-slot-labels-width) * -1 + 30px)\"\n currentTimeFormat={slotLabelFormat}\n withTimeBubble={withCurrentTimeBubble}\n withThumb={!withCurrentTimeBubble}\n locale={locale}\n startTime={startTime}\n endTime={endTime}\n intervalMinutes={intervalMinutes}\n getCurrentTime={getCurrentTime}\n {...stylesApiProps}\n />\n )}\n {items}\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n )}\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nDayView.displayName = '@mantine/schedule/DayView';\nDayView.classes = classes;\nDayView.varsResolver = varsResolver;\n\nexport namespace DayView {\n export type Props = DayViewProps;\n export type Factory = DayViewFactory;\n export type StylesNames = DayViewStylesNames;\n export type CssVariables = DayViewCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8RA,MAAM,eAAe;CACnB,kBAAkB;CAClB,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,sBAAsB;CACtB,gBAAgB;CAChB,iBAAiB;CACjB,cAAc;CACd,uBAAuB;CACvB,YAAY;CACZ,wBAAwB;CACxB,eAAe,CAAC,YAAY,UAAU;CACtC,uBAAuB;CACvB,oBAAoB;CACpB,iBAAiB;CACjB,MAAM;CACN,iCAAiC;CACjC,kBAAkB;CAClB,wBAAwB;AAC1B;AAEA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,YAAY,wBAAwB,EACrD,SAAS;CACP,qBAAqB,WAAW,KAAA,IAAY,UAAU,MAAM,IAAI,KAAA;CAChE,0BAA0B,IAAI,UAAU;CACxC,kCAAkC,IAAI,gBAAgB;AACxD,EACF,EACF;AAEA,MAAa,UAAU,SAAyB,WAAW;CACzD,MAAM,QAAQ,SAAS,WAAW,cAAc,MAAM;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,YACA,MACA,kBACA,WACA,SACA,iBACA,sBACA,kBACA,wBACA,gBACA,MACA,QACA,iBACA,cACA,gBACA,0BACA,uBACA,YACA,QACA,cACA,cACA,sBACA,kBACA,mBACA,iBACA,YACA,kBACA,iBACA,QAC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AAC,EACF,CAAA;QAGF,4BACC,oBAAC,sBAAD;SACE,aAAY;SACZ,WAAU;SACV,WAAU;SACV,uBAAsB;SACtB,mBAAmB;SACnB,gBAAgB;SAChB,WAAW,CAAC;SACJ;SACG;SACF;SACQ;SACD;SAChB,GAAI;QACL,CAAA;QAEF;OACE;MACF,CAAA,CAAA;KACF,CAAA,CAAA;;GACc,CAAA;EAEpB;;CAGP,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO,SAAS;EAAmB,UAAA;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,QAAQ,cAAc;AACtB,QAAQ,UAAUA;AAClB,QAAQ,eAAe"}
|
|
@@ -6,14 +6,14 @@ var DayView_module_default = {
|
|
|
6
6
|
"dayViewScrollArea": "m_f2eec5af",
|
|
7
7
|
"dayViewInner": "m_d5502881",
|
|
8
8
|
"dayViewTimeSlots": "m_9389813",
|
|
9
|
+
"dayViewDragPreview": "m_2d4819df",
|
|
9
10
|
"dayViewSlot": "m_cd179e73",
|
|
10
11
|
"dayViewSlotLabels": "m_c30b0852",
|
|
11
12
|
"dayViewSlotLabel": "m_2f950041",
|
|
12
13
|
"dayViewSlots": "m_d5dc3060",
|
|
13
14
|
"dayViewBackgroundEvent": "m_c5cd9a77",
|
|
14
15
|
"dayViewAllDay": "m_c6f08d70",
|
|
15
|
-
"dayViewAllDayEvents": "m_42b986a9"
|
|
16
|
-
"dayViewDragPreview": "m_2d4819df"
|
|
16
|
+
"dayViewAllDayEvents": "m_42b986a9"
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
19
19
|
export { DayView_module_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DayView.module.mjs","names":[],"sources":["../../../src/components/DayView/DayView.module.css"],"sourcesContent":[".dayView {\n --slot-height: var(--day-view-slot-height, 64px); /* total height of 1 hour slot */\n --all-day-slot-height: var(--day-view-all-day-slot-height, 44px); /* height of all day slot */\n --day-view-slot-labels-width: 80px;\n --day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n @mixin where-light {\n --day-view-border-color: var(--mantine-color-gray-3);\n --day-view-business-hours-bg: var(--mantine-color-white);\n --day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --day-view-border-color: var(--mantine-color-dark-4);\n --day-view-business-hours-bg: var(--mantine-color-dark-7);\n --day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.dayViewHeader {\n text-transform: capitalize;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n}\n\n.dayViewScrollArea {\n border: 1px solid var(--day-view-border-color);\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n :where(:global(.mantine-ScrollArea-scrollbar)) {\n z-index: 4;\n }\n}\n\n.dayViewInner {\n display: flex;\n}\n\n.dayViewTimeSlots {\n position: relative;\n\n &:where(:first-of-type) .dayViewSlot:where([data-first]) {\n border-top-color: transparent;\n }\n}\n\n.dayViewSlotLabels {\n width: var(--day-view-slot-labels-width);\n}\n\n.dayViewSlotLabel {\n height: var(--slot-height);\n border-top: 1px solid var(--day-view-border-color);\n font-size: var(--mantine-font-size-sm);\n text-align: right;\n padding: 4px 8px;\n font-variant-numeric: tabular-nums;\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where(:first-of-type) {\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n}\n\n.dayViewSlots {\n flex: 1;\n}\n\n.dayViewSlot {\n display: block;\n width: 100%;\n border-top: 1px dotted var(--day-view-border-color);\n height: calc(var(--slot-height) * var(--slot-size));\n position: relative;\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-hour-start]) {\n border-top: 1px solid var(--day-view-border-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.dayView:where([data-hide-sub-hour-grid-lines]) .dayViewSlot:not([data-hour-start]) {\n border-top-color: transparent;\n}\n\n.dayView:where([data-event-interaction]) .dayViewSlot:not([data-all-day]) {\n pointer-events: none;\n}\n\n.dayViewBackgroundEvent {\n position: absolute;\n border-radius: 0;\n pointer-events: none;\n z-index: 2;\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n}\n\n.dayView:where([data-event-interaction], [data-slot-dragging]) .dayViewBackgroundEvent {\n pointer-events: none;\n}\n\n.dayViewAllDay {\n position: relative;\n height: var(--all-day-slot-height);\n}\n\n.dayViewAllDayEvents {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n pointer-events: none;\n z-index: 3;\n}\n\n.dayViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--day-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"DayView.module.mjs","names":[],"sources":["../../../src/components/DayView/DayView.module.css"],"sourcesContent":[".dayView {\n --slot-height: var(--day-view-slot-height, 64px); /* total height of 1 hour slot */\n --all-day-slot-height: var(--day-view-all-day-slot-height, 44px); /* height of all day slot */\n --day-view-slot-labels-width: 80px;\n --day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n @mixin where-light {\n --day-view-border-color: var(--mantine-color-gray-3);\n --day-view-business-hours-bg: var(--mantine-color-white);\n --day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --day-view-border-color: var(--mantine-color-dark-4);\n --day-view-business-hours-bg: var(--mantine-color-dark-7);\n --day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.dayViewHeader {\n text-transform: capitalize;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n}\n\n.dayViewScrollArea {\n border: 1px solid var(--day-view-border-color);\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n :where(:global(.mantine-ScrollArea-scrollbar)) {\n z-index: 4;\n }\n}\n\n.dayViewInner {\n display: flex;\n}\n\n.dayViewTimeSlots {\n position: relative;\n\n /* Cascade events stack with an unbounded z-index, keep them out of the sticky header's layer */\n &:where(:has([data-cascade])) {\n isolation: isolate;\n\n /* Drag and resize feedback must stay above every cascade column */\n --event-cascade-interaction-z-index: 999;\n\n .dayViewDragPreview {\n z-index: var(--event-cascade-interaction-z-index);\n }\n }\n\n &:where(:first-of-type) .dayViewSlot:where([data-first]) {\n border-top-color: transparent;\n }\n}\n\n.dayViewSlotLabels {\n width: var(--day-view-slot-labels-width);\n}\n\n.dayViewSlotLabel {\n height: var(--slot-height);\n border-top: 1px solid var(--day-view-border-color);\n font-size: var(--mantine-font-size-sm);\n text-align: right;\n padding: 4px 8px;\n font-variant-numeric: tabular-nums;\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where(:first-of-type) {\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n}\n\n.dayViewSlots {\n flex: 1;\n}\n\n.dayViewSlot {\n display: block;\n width: 100%;\n border-top: 1px dotted var(--day-view-border-color);\n height: calc(var(--slot-height) * var(--slot-size));\n position: relative;\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-hour-start]) {\n border-top: 1px solid var(--day-view-border-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.dayView:where([data-hide-sub-hour-grid-lines]) .dayViewSlot:not([data-hour-start]) {\n border-top-color: transparent;\n}\n\n.dayView:where([data-event-interaction]) .dayViewSlot:not([data-all-day]) {\n pointer-events: none;\n}\n\n.dayViewBackgroundEvent {\n position: absolute;\n border-radius: 0;\n pointer-events: none;\n z-index: 2;\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n}\n\n.dayView:where([data-event-interaction], [data-slot-dragging]) .dayViewBackgroundEvent {\n pointer-events: none;\n}\n\n.dayViewAllDay {\n position: relative;\n height: var(--all-day-slot-height);\n}\n\n.dayViewAllDayEvents {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n pointer-events: none;\n z-index: 3;\n}\n\n.dayViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--day-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n}\n"],"mappings":""}
|
|
@@ -3,6 +3,7 @@ import { isAllDayEvent } from "../../../utils/is-all-day-event/is-all-day-event.
|
|
|
3
3
|
import { sortEvents } from "../../../utils/sort-events/sort-events.mjs";
|
|
4
4
|
import { isEventsOverlap } from "../../../utils/is-events-overlap/is-events-overlap.mjs";
|
|
5
5
|
import { getDayPosition } from "../../../utils/get-day-position/get-day-position.mjs";
|
|
6
|
+
import { applyCascadeLayout } from "../../../utils/apply-cascade-layout/apply-cascade-layout.mjs";
|
|
6
7
|
//#region packages/@mantine/schedule/src/components/DayView/get-day-view-events/get-day-positioned-events.ts
|
|
7
8
|
function columnHasConflict({ columns, columnIndex, event, allDay, date }) {
|
|
8
9
|
if (!columns[columnIndex]) return false;
|
|
@@ -16,7 +17,7 @@ function columnHasConflict({ columns, columnIndex, event, allDay, date }) {
|
|
|
16
17
|
return hasTimeConflict;
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, date }) {
|
|
20
|
+
function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, date, eventOverlapMode = "columns" }) {
|
|
20
21
|
const columns = [];
|
|
21
22
|
const positioned = [];
|
|
22
23
|
const sorted = sortEvents(events);
|
|
@@ -56,14 +57,18 @@ function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, d
|
|
|
56
57
|
}
|
|
57
58
|
});
|
|
58
59
|
}
|
|
60
|
+
for (const positionedEvent of positioned) if (positionedEvent.position.allDay) {
|
|
61
|
+
positionedEvent.position.overlaps = 1;
|
|
62
|
+
positionedEvent.position.width = 100;
|
|
63
|
+
positionedEvent.position.offset = 0;
|
|
64
|
+
}
|
|
65
|
+
if (eventOverlapMode === "cascade") {
|
|
66
|
+
applyCascadeLayout(positioned);
|
|
67
|
+
return positioned;
|
|
68
|
+
}
|
|
59
69
|
for (const positionedEvent of positioned) {
|
|
60
70
|
const { allDay, column } = positionedEvent.position;
|
|
61
|
-
if (allDay)
|
|
62
|
-
positionedEvent.position.overlaps = 1;
|
|
63
|
-
positionedEvent.position.width = 100;
|
|
64
|
-
positionedEvent.position.offset = 0;
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
71
|
+
if (allDay) continue;
|
|
67
72
|
const directlyOverlapping = [];
|
|
68
73
|
for (const otherEvent of positioned) {
|
|
69
74
|
if (otherEvent === positionedEvent || otherEvent.position.allDay) continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-day-positioned-events.mjs","names":[],"sources":["../../../../src/components/DayView/get-day-view-events/get-day-positioned-events.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"get-day-positioned-events.mjs","names":[],"sources":["../../../../src/components/DayView/get-day-view-events/get-day-positioned-events.ts"],"sourcesContent":["import {\n AnyDateValue,\n DayPositionedEventData,\n ScheduleEventData,\n ScheduleEventOverlapMode,\n} from '../../../types';\nimport {\n applyCascadeLayout,\n getDayPosition,\n isAllDayEvent,\n isEventsOverlap,\n sortEvents,\n} from '../../../utils';\n\ninterface ColumnHasConflictOptions {\n columns: ScheduleEventData[][];\n columnIndex: number;\n event: ScheduleEventData;\n allDay: boolean;\n date: AnyDateValue;\n}\n\nfunction columnHasConflict({\n columns,\n columnIndex,\n event,\n allDay,\n date,\n}: ColumnHasConflictOptions): boolean {\n if (!columns[columnIndex]) {\n return false;\n }\n\n return columns[columnIndex].some((e) => {\n const eAllDay = isAllDayEvent({ event: e, date });\n const hasTimeConflict = isEventsOverlap(e, event);\n\n // Don't count all-day events as overlaps\n if (allDay || eAllDay) {\n return false;\n }\n\n return hasTimeConflict;\n });\n}\n\ninterface GetDayPositionedEventsInput {\n /** Date at which events are positioned, used to check if events are all-day */\n date: AnyDateValue;\n\n /** List of all events that belong to the given date, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[];\n\n /** Start time of the day view, used to calculate event positions */\n startTime?: string;\n\n /** End time of the day view, used to calculate event positions */\n endTime?: string;\n\n /** Number of minutes per time slot, used to align the canvas to whole slots */\n intervalMinutes?: number;\n\n /** Determines how events that overlap in time are laid out @default 'columns' */\n eventOverlapMode?: ScheduleEventOverlapMode;\n}\n\nexport function getDayPositionedEvents({\n events,\n startTime,\n endTime,\n intervalMinutes,\n date,\n eventOverlapMode = 'columns',\n}: GetDayPositionedEventsInput) {\n const columns: ScheduleEventData[][] = [];\n const positioned: DayPositionedEventData[] = [];\n\n const sorted = sortEvents(events);\n\n for (const event of sorted) {\n const allDay = isAllDayEvent({ event, date });\n\n let column = 0;\n\n while (columnHasConflict({ columns, columnIndex: column, event, allDay, date })) {\n column++;\n }\n\n if (!columns[column]) {\n columns[column] = [];\n }\n\n columns[column].push(event);\n\n const verticalPosition = allDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event, startTime, endTime, intervalMinutes });\n\n positioned.push({\n ...event,\n position: {\n ...verticalPosition,\n allDay,\n column,\n\n // set later\n width: 0,\n offset: 0,\n overlaps: 0,\n },\n });\n }\n for (const positionedEvent of positioned) {\n if (positionedEvent.position.allDay) {\n positionedEvent.position.overlaps = 1;\n positionedEvent.position.width = 100;\n positionedEvent.position.offset = 0;\n }\n }\n\n if (eventOverlapMode === 'cascade') {\n applyCascadeLayout(positioned);\n return positioned;\n }\n\n for (const positionedEvent of positioned) {\n const { allDay, column } = positionedEvent.position;\n\n if (allDay) {\n continue;\n }\n\n // Find events that directly overlap with this event\n const directlyOverlapping: DayPositionedEventData[] = [];\n\n for (const otherEvent of positioned) {\n if (otherEvent === positionedEvent || otherEvent.position.allDay) {\n continue;\n }\n\n if (isEventsOverlap(otherEvent, positionedEvent)) {\n directlyOverlapping.push(otherEvent);\n }\n }\n\n // Find the max column by also checking overlaps of overlapping events\n // This ensures we account for the full column group\n let maxColumn = column;\n\n for (const overlappingEvent of directlyOverlapping) {\n maxColumn = Math.max(maxColumn, overlappingEvent.position.column);\n\n // Check what overlaps with each overlapping event\n for (const otherEvent of positioned) {\n if (otherEvent === overlappingEvent || otherEvent.position.allDay) {\n continue;\n }\n\n if (isEventsOverlap(otherEvent, overlappingEvent)) {\n maxColumn = Math.max(maxColumn, otherEvent.position.column);\n }\n }\n }\n\n const totalColumns = maxColumn + 1;\n\n // Find the first occupied column to the right of this event\n // Events expand to fill empty columns but stop at the next occupied column\n let nextOccupiedColumn = totalColumns;\n\n for (const other of directlyOverlapping) {\n if (other.position.column > column && other.position.column < nextOccupiedColumn) {\n nextOccupiedColumn = other.position.column;\n }\n }\n\n const columnsSpanned = nextOccupiedColumn - column;\n\n positionedEvent.position.overlaps = totalColumns;\n positionedEvent.position.width = (columnsSpanned / totalColumns) * 100;\n positionedEvent.position.offset = (column * 100) / totalColumns;\n }\n\n return positioned;\n}\n"],"mappings":";;;;;;;AAsBA,SAAS,kBAAkB,EACzB,SACA,aACA,OACA,QACA,QACoC;CACpC,IAAI,CAAC,QAAQ,cACX,OAAO;CAGT,OAAO,QAAQ,YAAY,CAAC,MAAM,MAAM;EACtC,MAAM,UAAU,cAAc;GAAE,OAAO;GAAG;EAAK,CAAC;EAChD,MAAM,kBAAkB,gBAAgB,GAAG,KAAK;EAGhD,IAAI,UAAU,SACZ,OAAO;EAGT,OAAO;CACT,CAAC;AACH;AAsBA,SAAgB,uBAAuB,EACrC,QACA,WACA,SACA,iBACA,MACA,mBAAmB,aACW;CAC9B,MAAM,UAAiC,CAAC;CACxC,MAAM,aAAuC,CAAC;CAE9C,MAAM,SAAS,WAAW,MAAM;CAEhC,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,SAAS,cAAc;GAAE;GAAO;EAAK,CAAC;EAE5C,IAAI,SAAS;EAEb,OAAO,kBAAkB;GAAE;GAAS,aAAa;GAAQ;GAAO;GAAQ;EAAK,CAAC,GAC5E;EAGF,IAAI,CAAC,QAAQ,SACX,QAAQ,UAAU,CAAC;EAGrB,QAAQ,OAAO,CAAC,KAAK,KAAK;EAE1B,MAAM,mBAAmB,SACrB;GAAE,KAAK;GAAG,QAAQ;EAAI,IACtB,eAAe;GAAE;GAAO;GAAW;GAAS;EAAgB,CAAC;EAEjE,WAAW,KAAK;GACd,GAAG;GACH,UAAU;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} from "./get-day-positioned-events.mjs";
|
|
7
7
|
import dayjs from "dayjs";
|
|
8
8
|
//#region packages/@mantine/schedule/src/components/DayView/get-day-view-events/get-day-view-events.ts
|
|
9
|
-
function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes }) {
|
|
9
|
+
function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes, eventOverlapMode }) {
|
|
10
10
|
if (events === void 0) return {
|
|
11
11
|
allDayEvents: [],
|
|
12
12
|
regularEvents: [],
|
|
@@ -41,7 +41,8 @@ function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes })
|
|
|
41
41
|
startTime,
|
|
42
42
|
endTime,
|
|
43
43
|
intervalMinutes,
|
|
44
|
-
date
|
|
44
|
+
date,
|
|
45
|
+
eventOverlapMode
|
|
45
46
|
});
|
|
46
47
|
const allDayEvents = [];
|
|
47
48
|
const regularEvents = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-day-view-events.mjs","names":[],"sources":["../../../../src/components/DayView/get-day-view-events/get-day-view-events.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport {
|
|
1
|
+
{"version":3,"file":"get-day-view-events.mjs","names":[],"sources":["../../../../src/components/DayView/get-day-view-events/get-day-view-events.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport {\n AnyDateValue,\n DayPositionedEventData,\n ScheduleEventData,\n ScheduleEventOverlapMode,\n} from '../../../types';\nimport { getDayPosition, isAllDayEvent, isEventInTimeRange, validateEvent } from '../../../utils';\nimport { getDayPositionedEvents } from './get-day-positioned-events';\n\ninterface GetDayViewEventsInput {\n events: ScheduleEventData[] | undefined;\n date: AnyDateValue;\n startTime?: string;\n endTime?: string;\n intervalMinutes?: number;\n eventOverlapMode?: ScheduleEventOverlapMode;\n}\n\nexport function getDayViewEvents({\n events,\n date,\n startTime,\n endTime,\n intervalMinutes,\n eventOverlapMode,\n}: GetDayViewEventsInput) {\n if (events === undefined) {\n return {\n allDayEvents: [],\n regularEvents: [],\n backgroundTimedEvents: [],\n backgroundAllDayEvents: [],\n };\n }\n\n const ids = new Set<string | number>();\n const filteredEvents: ScheduleEventData[] = [];\n const backgroundFiltered: ScheduleEventData[] = [];\n const dayStart = dayjs(date).startOf('day');\n const dayEnd = dayjs(date).endOf('day');\n\n for (const event of events) {\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const isOnDay = eventStart.isSame(dayStart, 'day');\n const spansIntoDay =\n !isOnDay &&\n event.display === 'background' &&\n eventStart.isBefore(dayEnd) &&\n eventEnd.isAfter(dayStart);\n\n if (isOnDay || spansIntoDay) {\n if (isOnDay && !isEventInTimeRange({ event, startTime, endTime })) {\n continue;\n }\n\n const validated = validateEvent(event);\n\n if (!ids.has(event.id)) {\n ids.add(event.id);\n } else {\n throw new Error(`[@mantine/schedule] DayView: Duplicated event ids found: ${event.id}`);\n }\n\n if (event.display === 'background') {\n backgroundFiltered.push(validated);\n } else {\n filteredEvents.push(validated);\n }\n }\n }\n\n const positionedEvents = getDayPositionedEvents({\n events: filteredEvents,\n startTime,\n endTime,\n intervalMinutes,\n date,\n eventOverlapMode,\n });\n\n const allDayEvents: DayPositionedEventData[] = [];\n const regularEvents: DayPositionedEventData[] = [];\n\n for (const event of positionedEvents) {\n if (event.position.allDay) {\n allDayEvents.push(event);\n } else {\n regularEvents.push(event);\n }\n }\n\n const backgroundTimedEvents: DayPositionedEventData[] = [];\n const backgroundAllDayEvents: DayPositionedEventData[] = [];\n for (const event of backgroundFiltered) {\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart;\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd;\n\n const clippedEvent = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n };\n\n const allDay = isAllDayEvent({ event: clippedEvent, date });\n\n if (allDay) {\n backgroundAllDayEvents.push({\n ...event,\n position: {\n top: 0,\n height: 100,\n allDay: true,\n width: 100,\n offset: 0,\n column: 0,\n overlaps: 1,\n },\n });\n } else {\n const { top, height } = getDayPosition({\n event: clippedEvent,\n startTime,\n endTime,\n intervalMinutes,\n });\n if (height <= 0) {\n continue;\n }\n backgroundTimedEvents.push({\n ...event,\n position: { top, height, allDay: false, width: 100, offset: 0, column: 0, overlaps: 1 },\n });\n }\n }\n\n return { allDayEvents, regularEvents, backgroundTimedEvents, backgroundAllDayEvents };\n}\n"],"mappings":";;;;;;;;AAmBA,SAAgB,iBAAiB,EAC/B,QACA,MACA,WACA,SACA,iBACA,oBACwB;CACxB,IAAI,WAAW,KAAA,GACb,OAAO;EACL,cAAc,CAAC;EACf,eAAe,CAAC;EAChB,uBAAuB,CAAC;EACxB,wBAAwB,CAAC;CAC3B;CAGF,MAAM,sBAAM,IAAI,IAAqB;CACrC,MAAM,iBAAsC,CAAC;CAC7C,MAAM,qBAA0C,CAAC;CACjD,MAAM,WAAW,MAAM,IAAI,CAAC,CAAC,QAAQ,KAAK;CAC1C,MAAM,SAAS,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK;CAEtC,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,aAAa,MAAM,MAAM,KAAK;EACpC,MAAM,WAAW,MAAM,MAAM,GAAG;EAChC,MAAM,UAAU,WAAW,OAAO,UAAU,KAAK;EACjD,MAAM,eACJ,CAAC,WACD,MAAM,YAAY,gBAClB,WAAW,SAAS,MAAM,KAC1B,SAAS,QAAQ,QAAQ;EAE3B,IAAI,WAAW,cAAc;GAC3B,IAAI,WAAW,CAAC,mBAAmB;IAAE;IAAO;IAAW;GAAQ,CAAC,GAC9D;GAGF,MAAM,YAAY,cAAc,KAAK;GAErC,IAAI,CAAC,IAAI,IAAI,MAAM,EAAE,GACnB,IAAI,IAAI,MAAM,EAAE;QAEhB,MAAM,IAAI,MAAM,4DAA4D,MAAM,IAAI;GAGxF,IAAI,MAAM,YAAY,cACpB,mBAAmB,KAAK,SAAS;QAEjC,eAAe,KAAK,SAAS;EAEjC;CACF;CAEA,MAAM,mBAAmB,uBAAuB;EAC9C,QAAQ;EACR;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,eAAyC,CAAC;CAChD,MAAM,gBAA0C,CAAC;CAEjD,KAAK,MAAM,SAAS,kBAClB,IAAI,MAAM,SAAS,QACjB,aAAa,KAAK,KAAK;MAEvB,cAAc,KAAK,KAAK;CAI5B,MAAM,wBAAkD,CAAC;CACzD,MAAM,yBAAmD,CAAC;CAC1D,KAAK,MAAM,SAAS,oBAAoB;EACtC,MAAM,aAAa,MAAM,MAAM,KAAK;EACpC,MAAM,WAAW,MAAM,MAAM,GAAG;EAChC,MAAM,eAAe,WAAW,SAAS,QAAQ,IAAI,WAAW;EAChE,MAAM,aAAa,SAAS,QAAQ,MAAM,IAAI,SAAS;EAEvD,MAAM,eAAe;GACnB,GAAG;GACH,OAAO,aAAa,OAAO,qBAAqB;GAChD,KAAK,WAAW,OAAO,qBAAqB;EAC9C;EAIA,IAFe,cAAc;GAAE,OAAO;GAAc;EAAK,CAEhD,GACP,uBAAuB,KAAK;GAC1B,GAAG;GACH,UAAU;IACR,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,UAAU;GACZ;EACF,CAAC;OACI;GACL,MAAM,EAAE,KAAK,WAAW,eAAe;IACrC,OAAO;IACP;IACA;IACA;GACF,CAAC;GACD,IAAI,UAAU,GACZ;GAEF,sBAAsB,KAAK;IACzB,GAAG;IACH,UAAU;KAAE;KAAK;KAAQ,QAAQ;KAAO,OAAO;KAAK,QAAQ;KAAG,QAAQ;KAAG,UAAU;IAAE;GACxF,CAAC;EACH;CACF;CAEA,OAAO;EAAE;EAAc;EAAe;EAAuB;CAAuB;AACtF"}
|
|
@@ -15,6 +15,7 @@ import { getOrderedResources } from "../../utils/get-ordered-resources/get-order
|
|
|
15
15
|
import { handleResourcesGridKeyDown } from "../../utils/handle-resources-grid-key-down/handle-resources-grid-key-down.mjs";
|
|
16
16
|
import { getGroupToResourceIdMap } from "../../utils/get-group-to-resource-id-map/get-group-to-resource-id-map.mjs";
|
|
17
17
|
import { getIndexFromDragPoint } from "../../utils/get-index-from-drag-point/get-index-from-drag-point.mjs";
|
|
18
|
+
import { getOverlapClusters } from "../../utils/get-overlap-clusters/get-overlap-clusters.mjs";
|
|
18
19
|
import { useDragDropHandlers } from "../../hooks/use-drag-drop-handlers.mjs";
|
|
19
20
|
import { useSlotDragSelect } from "../../hooks/use-slot-drag-select.mjs";
|
|
20
21
|
import { DragContext } from "../DragContext/DragContext.mjs";
|
|
@@ -23,7 +24,6 @@ import { MoreEvents } from "../MoreEvents/MoreEvents.mjs";
|
|
|
23
24
|
import { ScheduleBackgroundEvent } from "../ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs";
|
|
24
25
|
import { ScheduleHeaderBase } from "../ScheduleHeader/ScheduleHeaderBase.mjs";
|
|
25
26
|
import { useHorizontalEventResize } from "../../hooks/use-horizontal-event-resize.mjs";
|
|
26
|
-
import { getOverlapClusters } from "./get-overlap-clusters/get-overlap-clusters.mjs";
|
|
27
27
|
import { getResourcesDayViewEvents } from "./get-resources-day-view-events/get-resources-day-view-events.mjs";
|
|
28
28
|
import { ResourcesDayViewRow } from "./ResourcesDayViewColumn.mjs";
|
|
29
29
|
import ResourcesDayView_module_default from "./ResourcesDayView.module.mjs";
|