@mantine/schedule 9.5.0 → 9.5.1-alpha.0
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/ResourcesMonthView/ResourcesMonthView.cjs +105 -35
- package/cjs/components/ResourcesMonthView/ResourcesMonthView.cjs.map +1 -1
- package/cjs/components/ResourcesMonthView/ResourcesMonthView.module.cjs +3 -1
- package/cjs/components/ResourcesMonthView/ResourcesMonthView.module.cjs.map +1 -1
- package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs +3 -0
- package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs.map +1 -1
- package/cjs/components/YearView/YearView.cjs +23 -4
- package/cjs/components/YearView/YearView.cjs.map +1 -1
- package/cjs/components/YearView/YearView.module.cjs.map +1 -1
- package/cjs/components/YearView/YearViewMonth.cjs +18 -6
- package/cjs/components/YearView/YearViewMonth.cjs.map +1 -1
- package/cjs/components/YearView/get-visible-week-days.cjs +24 -0
- package/cjs/components/YearView/get-visible-week-days.cjs.map +1 -0
- package/cjs/hooks/use-day-grid-event-resize.cjs +119 -0
- package/cjs/hooks/use-day-grid-event-resize.cjs.map +1 -0
- package/cjs/utils/calculate-month-resize-dates/calculate-month-resize-dates.cjs +39 -0
- package/cjs/utils/calculate-month-resize-dates/calculate-month-resize-dates.cjs.map +1 -0
- package/esm/components/ResourcesMonthView/ResourcesMonthView.mjs +106 -36
- package/esm/components/ResourcesMonthView/ResourcesMonthView.mjs.map +1 -1
- package/esm/components/ResourcesMonthView/ResourcesMonthView.module.mjs +3 -1
- package/esm/components/ResourcesMonthView/ResourcesMonthView.module.mjs.map +1 -1
- package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs +3 -0
- package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs.map +1 -1
- package/esm/components/YearView/YearView.mjs +23 -4
- package/esm/components/YearView/YearView.mjs.map +1 -1
- package/esm/components/YearView/YearView.module.mjs.map +1 -1
- package/esm/components/YearView/YearViewMonth.mjs +18 -6
- package/esm/components/YearView/YearViewMonth.mjs.map +1 -1
- package/esm/components/YearView/get-visible-week-days.mjs +21 -0
- package/esm/components/YearView/get-visible-week-days.mjs.map +1 -0
- package/esm/hooks/use-day-grid-event-resize.mjs +117 -0
- package/esm/hooks/use-day-grid-event-resize.mjs.map +1 -0
- package/esm/utils/calculate-month-resize-dates/calculate-month-resize-dates.mjs +37 -0
- package/esm/utils/calculate-month-resize-dates/calculate-month-resize-dates.mjs.map +1 -0
- package/lib/components/ResourcesMonthView/ResourcesMonthView.d.ts +12 -1
- package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +1 -1
- package/lib/components/YearView/YearViewMonth.d.ts +3 -1
- package/lib/components/YearView/get-visible-week-days.d.ts +19 -0
- package/lib/hooks/use-day-grid-event-resize.d.ts +35 -0
- package/lib/utils/calculate-month-resize-dates/calculate-month-resize-dates.d.ts +17 -0
- package/package.json +4 -4
- package/styles.css +63 -2
- package/styles.layer.css +63 -2
|
@@ -13,9 +13,10 @@ import { DragContext } from "../DragContext/DragContext.mjs";
|
|
|
13
13
|
import { ScheduleEvent } from "../ScheduleEvent/ScheduleEvent.mjs";
|
|
14
14
|
import { MoreEvents } from "../MoreEvents/MoreEvents.mjs";
|
|
15
15
|
import { ScheduleHeaderBase } from "../ScheduleHeader/ScheduleHeaderBase.mjs";
|
|
16
|
+
import { useDayGridEventResize } from "../../hooks/use-day-grid-event-resize.mjs";
|
|
16
17
|
import ResourcesMonthView_module_default from "./ResourcesMonthView.module.mjs";
|
|
17
18
|
import dayjs from "dayjs";
|
|
18
|
-
import { Box, ScrollArea, UnstyledButton, createVarsResolver, factory, getRadius, rem, useProps, useResolvedStylesApi, useStyles } from "@mantine/core";
|
|
19
|
+
import { Box, ScrollArea, UnstyledButton, createVarsResolver, factory, getRadius, rem, useMantineTheme, useProps, useResolvedStylesApi, useStyles } from "@mantine/core";
|
|
19
20
|
import { useIsomorphicEffect, useMergedRef } from "@mantine/hooks";
|
|
20
21
|
import { createElement, useCallback, useMemo, useRef } from "react";
|
|
21
22
|
import { useDatesContext } from "@mantine/dates";
|
|
@@ -35,6 +36,7 @@ const defaultProps = {
|
|
|
35
36
|
withWeekendDays: true,
|
|
36
37
|
withEventsDragAndDrop: false,
|
|
37
38
|
withDragSlotSelect: false,
|
|
39
|
+
withEventResize: false,
|
|
38
40
|
mode: "default"
|
|
39
41
|
};
|
|
40
42
|
function compareCellEvents(a, b) {
|
|
@@ -54,7 +56,7 @@ function isMultiDayEvent(event) {
|
|
|
54
56
|
}
|
|
55
57
|
const ResourcesMonthView = factory((_props) => {
|
|
56
58
|
const props = useProps("ResourcesMonthView", defaultProps, _props);
|
|
57
|
-
const { classNames, className, style, styles, unstyled, attributes, vars, mod, date, onDateChange, resources, locale, weekdayFormat, weekendDays, withWeekendDays, startScrollDate, __staticSelector, onDayClick, highlightToday, radius, withHeader, monthYearSelectProps, onViewChange, todayControlProps, nextControlProps, previousControlProps, viewSelectProps, events, dayWidth, rowHeight, renderResourceLabel, groups, renderGroupLabel, groupLabelWidth, renderEventBody, renderEvent, withEventsDragAndDrop, onEventDrop, canDragEvent, onEventDragStart, onEventDragEnd, onEventClick, withDragSlotSelect, onSlotDragEnd, labels, mode, scrollAreaProps, onExternalEventDrop, maxEventsPerTimeSlot: _maxEventsPerTimeSlot, moreEventsProps, recurrenceExpansionLimit, ...others } = props;
|
|
59
|
+
const { classNames, className, style, styles, unstyled, attributes, vars, mod, date, onDateChange, resources, locale, weekdayFormat, weekendDays, withWeekendDays, startScrollDate, __staticSelector, onDayClick, highlightToday, radius, withHeader, monthYearSelectProps, onViewChange, todayControlProps, nextControlProps, previousControlProps, viewSelectProps, events, dayWidth, rowHeight, renderResourceLabel, groups, renderGroupLabel, groupLabelWidth, renderEventBody, renderEvent, withEventsDragAndDrop, onEventDrop, canDragEvent, onEventDragStart, onEventDragEnd, withEventResize, onEventResize, canResizeEvent, onEventClick, withDragSlotSelect, onSlotDragEnd, labels, mode, scrollAreaProps, onExternalEventDrop, maxEventsPerTimeSlot: _maxEventsPerTimeSlot, moreEventsProps, recurrenceExpansionLimit, ...others } = props;
|
|
58
60
|
const maxEventsPerTimeSlot = Math.min(10, Math.max(1, _maxEventsPerTimeSlot ?? 2));
|
|
59
61
|
const getStyles = useStyles({
|
|
60
62
|
name: __staticSelector,
|
|
@@ -82,6 +84,7 @@ const ResourcesMonthView = factory((_props) => {
|
|
|
82
84
|
__staticSelector,
|
|
83
85
|
radius
|
|
84
86
|
};
|
|
87
|
+
const theme = useMantineTheme();
|
|
85
88
|
const ctx = useDatesContext();
|
|
86
89
|
const resolvedWeekendDays = ctx.getWeekendDays(weekendDays);
|
|
87
90
|
const { orderedResources, groupRanges, resourceGroupMap } = useMemo(() => getOrderedResources(resources, groups), [resources, groups]);
|
|
@@ -134,13 +137,34 @@ const ResourcesMonthView = factory((_props) => {
|
|
|
134
137
|
date,
|
|
135
138
|
recurrenceExpansionLimit
|
|
136
139
|
]);
|
|
140
|
+
const monthDaySet = useMemo(() => new Set(monthDays), [monthDays]);
|
|
141
|
+
const eventResize = useDayGridEventResize({
|
|
142
|
+
enabled: withEventResize,
|
|
143
|
+
mode,
|
|
144
|
+
onEventResize,
|
|
145
|
+
canResizeEvent
|
|
146
|
+
});
|
|
147
|
+
const { resizingEventId, previewStart, previewEnd } = eventResize;
|
|
148
|
+
const layoutEvents = useMemo(() => {
|
|
149
|
+
if (resizingEventId === null || previewStart === null || previewEnd === null) return expandedEvents;
|
|
150
|
+
return expandedEvents.map((event) => event.id === resizingEventId ? {
|
|
151
|
+
...event,
|
|
152
|
+
start: previewStart,
|
|
153
|
+
end: previewEnd
|
|
154
|
+
} : event);
|
|
155
|
+
}, [
|
|
156
|
+
expandedEvents,
|
|
157
|
+
resizingEventId,
|
|
158
|
+
previewStart,
|
|
159
|
+
previewEnd
|
|
160
|
+
]);
|
|
137
161
|
const { eventsByResourceAndDay, eventLayoutByResource } = useMemo(() => {
|
|
138
162
|
const eventsByResourceAndDay = {};
|
|
139
163
|
for (const resource of resources) {
|
|
140
164
|
eventsByResourceAndDay[resource.id] = {};
|
|
141
165
|
for (const day of monthDays) eventsByResourceAndDay[resource.id][day] = [];
|
|
142
166
|
}
|
|
143
|
-
if (
|
|
167
|
+
if (layoutEvents) for (const event of layoutEvents) {
|
|
144
168
|
if (event.resourceId === void 0 || !(event.resourceId in eventsByResourceAndDay)) continue;
|
|
145
169
|
const eventStart = dayjs(event.start);
|
|
146
170
|
const eventEnd = dayjs(event.end);
|
|
@@ -255,7 +279,7 @@ const ResourcesMonthView = factory((_props) => {
|
|
|
255
279
|
}, [
|
|
256
280
|
resources,
|
|
257
281
|
monthDays,
|
|
258
|
-
|
|
282
|
+
layoutEvents,
|
|
259
283
|
maxEventsPerTimeSlot
|
|
260
284
|
]);
|
|
261
285
|
const handleExternalDrop = useCallback((e, target) => {
|
|
@@ -346,8 +370,69 @@ const ResourcesMonthView = factory((_props) => {
|
|
|
346
370
|
cellsRef.current[nextResourceIndex]?.[nextDayIndex]?.focus();
|
|
347
371
|
};
|
|
348
372
|
const rowHeightPercent = 100 / maxEventsPerTimeSlot;
|
|
373
|
+
const renderEventNode = ({ key, event, resourceIndex, style, hanging, eventMod, withStartHandle, withEndHandle }) => {
|
|
374
|
+
const isResizable = eventResize.isResizableEvent(event);
|
|
375
|
+
const isThisEventResizing = eventResize.resizingEventId === event.id;
|
|
376
|
+
const eventEnd = dayjs(event.end);
|
|
377
|
+
const lastDay = (eventEnd.hour() === 0 && eventEnd.minute() === 0 && eventEnd.second() === 0 ? eventEnd.subtract(1, "day") : eventEnd).format("YYYY-MM-DD");
|
|
378
|
+
const showStartHandle = withStartHandle && monthDaySet.has(dayjs(event.start).format("YYYY-MM-DD"));
|
|
379
|
+
const showEndHandle = withEndHandle && monthDaySet.has(lastDay);
|
|
380
|
+
const eventColors = isResizable ? theme.variantColorResolver({
|
|
381
|
+
color: event.color || theme.primaryColor,
|
|
382
|
+
theme,
|
|
383
|
+
variant: event.variant || "light",
|
|
384
|
+
autoContrast: true
|
|
385
|
+
}) : null;
|
|
386
|
+
const getHandleProps = (edge) => ({
|
|
387
|
+
...getStyles("resourcesMonthViewResizeHandle"),
|
|
388
|
+
"data-edge": edge,
|
|
389
|
+
"data-active": isThisEventResizing && eventResize.resizingEdge === edge || void 0,
|
|
390
|
+
onPointerDown: (e) => eventResize.handleResizeStart({
|
|
391
|
+
event,
|
|
392
|
+
edge,
|
|
393
|
+
cells: cellsRef.current[resourceIndex] ?? [],
|
|
394
|
+
days: monthDays,
|
|
395
|
+
pointerEvent: e
|
|
396
|
+
})
|
|
397
|
+
});
|
|
398
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
399
|
+
...getStyles("resourcesMonthViewEventWrapper", { style: {
|
|
400
|
+
position: "absolute",
|
|
401
|
+
zIndex: 3,
|
|
402
|
+
...style
|
|
403
|
+
} }),
|
|
404
|
+
__vars: eventColors ? { "--event-color": eventColors.color } : void 0,
|
|
405
|
+
"data-resizing": isThisEventResizing || void 0,
|
|
406
|
+
children: [
|
|
407
|
+
/* @__PURE__ */ jsx(ScheduleEvent, {
|
|
408
|
+
event,
|
|
409
|
+
nowrap: true,
|
|
410
|
+
autoSize: true,
|
|
411
|
+
size: "sm",
|
|
412
|
+
hanging,
|
|
413
|
+
mod: eventMod,
|
|
414
|
+
draggable: dragDrop.isDraggableEvent(event),
|
|
415
|
+
isResizing: isThisEventResizing,
|
|
416
|
+
renderEventBody,
|
|
417
|
+
renderEvent,
|
|
418
|
+
radius,
|
|
419
|
+
mode,
|
|
420
|
+
onClick: onEventClick ? (e) => {
|
|
421
|
+
if (!eventResize.wasResizing()) onEventClick(event, e);
|
|
422
|
+
} : void 0,
|
|
423
|
+
style: {
|
|
424
|
+
width: "100%",
|
|
425
|
+
height: "100%"
|
|
426
|
+
}
|
|
427
|
+
}),
|
|
428
|
+
isResizable && showStartHandle && /* @__PURE__ */ jsx("div", { ...getHandleProps("start") }),
|
|
429
|
+
isResizable && showEndHandle && /* @__PURE__ */ jsx("div", { ...getHandleProps("end") })
|
|
430
|
+
]
|
|
431
|
+
}, key);
|
|
432
|
+
};
|
|
349
433
|
const rows = orderedResources.map((resource, resourceIndex) => {
|
|
350
434
|
if (!cellsRef.current[resourceIndex]) cellsRef.current[resourceIndex] = [];
|
|
435
|
+
cellsRef.current[resourceIndex].length = monthDays.length;
|
|
351
436
|
const slotGroup = String(resource.id);
|
|
352
437
|
const dropTarget = dragDrop.dropTarget;
|
|
353
438
|
const totalDays = monthDays.length;
|
|
@@ -368,29 +453,21 @@ const ResourcesMonthView = factory((_props) => {
|
|
|
368
453
|
const hasHiddenEvents = hiddenEventsCount > 0 && mode !== "static";
|
|
369
454
|
visibleEvents.forEach(({ event, row }) => {
|
|
370
455
|
if (isMultiDayEvent(event)) return;
|
|
371
|
-
const isDraggable = dragDrop.isDraggableEvent(event);
|
|
372
456
|
const topValue = hasHiddenEvents ? `calc((100% - 18px) * ${row} / ${maxEventsPerTimeSlot} + 1px)` : `calc(${row * rowHeightPercent}% + 1px)`;
|
|
373
457
|
const heightValue = hasHiddenEvents ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)` : `calc(${rowHeightPercent}% - 2px)`;
|
|
374
|
-
eventNodes.push(
|
|
458
|
+
eventNodes.push(renderEventNode({
|
|
459
|
+
key: `${event.id}-${day}`,
|
|
375
460
|
event,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
draggable: isDraggable,
|
|
380
|
-
renderEventBody,
|
|
381
|
-
renderEvent,
|
|
382
|
-
radius,
|
|
383
|
-
mode,
|
|
384
|
-
onClick: onEventClick ? (e) => onEventClick(event, e) : void 0,
|
|
461
|
+
resourceIndex,
|
|
462
|
+
withStartHandle: true,
|
|
463
|
+
withEndHandle: true,
|
|
385
464
|
style: {
|
|
386
|
-
position: "absolute",
|
|
387
465
|
top: topValue,
|
|
388
466
|
left: `calc(${dayLeftPercent}% + 1px)`,
|
|
389
467
|
width: `calc(${dayWidthPercent}% - 2px)`,
|
|
390
|
-
height: heightValue
|
|
391
|
-
zIndex: 3
|
|
468
|
+
height: heightValue
|
|
392
469
|
}
|
|
393
|
-
}
|
|
470
|
+
}));
|
|
394
471
|
});
|
|
395
472
|
if (hiddenEventsCount > 0 && mode !== "static") moreNodes.push(/* @__PURE__ */ jsx(MoreEvents, {
|
|
396
473
|
events: dayEvents,
|
|
@@ -440,37 +517,29 @@ const ResourcesMonthView = factory((_props) => {
|
|
|
440
517
|
}, day);
|
|
441
518
|
});
|
|
442
519
|
(eventLayoutByResource[resource.id]?.segments ?? []).forEach((segment) => {
|
|
443
|
-
const isDraggable = dragDrop.isDraggableEvent(segment.event);
|
|
444
520
|
const segmentLeftPercent = segment.startDayIndex / totalDays * 100;
|
|
445
521
|
const segmentWidthPercent = (segment.endDayIndex - segment.startDayIndex + 1) / totalDays * 100;
|
|
446
522
|
const compressed = segment.hiddenInSpan && mode !== "static";
|
|
447
523
|
const topValue = compressed ? `calc((100% - 18px) * ${segment.row} / ${maxEventsPerTimeSlot} + 1px)` : `calc(${segment.row * rowHeightPercent}% + 1px)`;
|
|
448
524
|
const heightValue = compressed ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)` : `calc(${rowHeightPercent}% - 2px)`;
|
|
449
|
-
eventNodes.push(
|
|
525
|
+
eventNodes.push(renderEventNode({
|
|
526
|
+
key: `${segment.event.id}-segment-${segment.startDayIndex}`,
|
|
450
527
|
event: segment.event,
|
|
451
|
-
|
|
452
|
-
autoSize: true,
|
|
453
|
-
size: "sm",
|
|
528
|
+
resourceIndex,
|
|
454
529
|
hanging: segment.hanging,
|
|
455
|
-
|
|
456
|
-
renderEventBody,
|
|
457
|
-
renderEvent,
|
|
458
|
-
radius,
|
|
459
|
-
mode,
|
|
460
|
-
mod: {
|
|
530
|
+
eventMod: {
|
|
461
531
|
"clip-start": segment.clipStart,
|
|
462
532
|
"clip-end": segment.clipEnd
|
|
463
533
|
},
|
|
464
|
-
|
|
534
|
+
withStartHandle: !segment.clipStart && segment.hanging !== "start" && segment.hanging !== "both",
|
|
535
|
+
withEndHandle: !segment.clipEnd && segment.hanging !== "end" && segment.hanging !== "both",
|
|
465
536
|
style: {
|
|
466
|
-
position: "absolute",
|
|
467
537
|
top: topValue,
|
|
468
538
|
left: `calc(${segmentLeftPercent}% + 1px)`,
|
|
469
539
|
width: `calc(${segmentWidthPercent}% - 2px)`,
|
|
470
|
-
height: heightValue
|
|
471
|
-
zIndex: 3
|
|
540
|
+
height: heightValue
|
|
472
541
|
}
|
|
473
|
-
}
|
|
542
|
+
}));
|
|
474
543
|
});
|
|
475
544
|
const groupInfo = hasGroups ? resourceGroupMap[resourceIndex] : void 0;
|
|
476
545
|
const isGroupStart = groupInfo?.position === "first" || groupInfo?.position === "only";
|
|
@@ -517,7 +586,8 @@ const ResourcesMonthView = factory((_props) => {
|
|
|
517
586
|
mod: [{
|
|
518
587
|
static: mode === "static",
|
|
519
588
|
"slot-dragging": slotDragSelect.isDragging,
|
|
520
|
-
"event-interaction": dragDrop.dragContextValue.isDragging
|
|
589
|
+
"event-interaction": eventResize.isResizing || dragDrop.dragContextValue.isDragging,
|
|
590
|
+
resizing: eventResize.isResizing
|
|
521
591
|
}, mod],
|
|
522
592
|
...getStyles("resourcesMonthView"),
|
|
523
593
|
...others,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesMonthView.mjs","names":["classes"],"sources":["../../../src/components/ResourcesMonthView/ResourcesMonthView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useMemo, useRef } 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 ScrollAreaProps,\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 { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n formatDate,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n toDateString,\n} from '../../utils';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectProps } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport classes from './ResourcesMonthView.module.css';\n\nexport type ResourcesMonthViewStylesNames =\n | 'resourcesMonthView'\n | 'resourcesMonthViewRoot'\n | 'resourcesMonthViewScrollArea'\n | 'resourcesMonthViewDayLabelsRow'\n | 'resourcesMonthViewCorner'\n | 'resourcesMonthViewDayLabel'\n | 'resourcesMonthViewDayLabelWeekday'\n | 'resourcesMonthViewDayLabelNumber'\n | 'resourcesMonthViewRow'\n | 'resourcesMonthViewResourceLabel'\n | 'resourcesMonthViewRowSlots'\n | 'resourcesMonthViewCell'\n | 'resourcesMonthViewInner'\n | 'resourcesMonthViewGroupColumn'\n | 'resourcesMonthViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesMonthViewCssVariables = {\n resourcesMonthView:\n | '--resources-month-view-radius'\n | '--resources-month-view-day-width'\n | '--resources-month-view-row-height'\n | '--resources-month-view-group-label-width';\n};\n\nexport interface ResourcesMonthViewProps\n extends BoxProps, StylesApiProps<ResourcesMonthViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Date to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | string;\n\n /** Called with the new date value when a date is selected */\n onDateChange?: (value: DateStringValue) => void;\n\n /** List of resources to display as rows */\n resources: ScheduleResourceData[];\n\n /** Locale passed down to dayjs */\n locale?: string;\n\n /** `dayjs` format for weekdays in day column headers @default 'dd' */\n weekdayFormat?: DateLabelFormat;\n\n /** Indices of weekend days */\n weekendDays?: DayOfWeek[];\n\n /** If set to false, weekend days are hidden @default true */\n withWeekendDays?: boolean;\n\n /** Date to scroll to on initial render, in `YYYY-MM-DD` format */\n startScrollDate?: string;\n\n /** Called when a cell is clicked, includes resourceId */\n onDayClick?: (data: {\n date: DateStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** If set, highlights the current day @default true */\n highlightToday?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Props passed down to `MonthYearSelect` component */\n monthYearSelectProps?: Partial<MonthYearSelectProps>;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next 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 /** Events to display */\n events?: ScheduleEventData[];\n\n /** Width of each day column @default 40px */\n dayWidth?: React.CSSProperties['width'];\n\n /** Height of each resource row @default 48px */\n rowHeight?: React.CSSProperties['height'];\n\n /** Function to customize event body */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering */\n renderEvent?: RenderEvent;\n\n /** Function to customize resource label rendering */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** List of resource groups to display as a column to the left of resource labels */\n groups?: ScheduleResourceGroup[];\n\n /** Function to customize group label rendering */\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n\n /** Width of the group label column @default 80px */\n groupLabelWidth?: React.CSSProperties['width'];\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped, includes target resourceId */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\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 event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select day ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a day range is selected by dragging, includes resourceId */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Props passed down to `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n\n /** Called when an external item is dropped */\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Maximum number of events visible per cell before \"+more\" indicator @default 2 */\n maxEventsPerTimeSlot?: number;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Max number of generated recurring instances @default 2000 */\n recurrenceExpansionLimit?: number;\n}\n\nexport type ResourcesMonthViewFactory = Factory<{\n props: ResourcesMonthViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesMonthViewStylesNames;\n vars: ResourcesMonthViewCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<ResourcesMonthViewFactory>(\n (_theme, { radius, dayWidth, rowHeight, groupLabelWidth }) => ({\n resourcesMonthView: {\n '--resources-month-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-month-view-day-width': rem(dayWidth),\n '--resources-month-view-row-height': rem(rowHeight),\n '--resources-month-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nconst defaultProps = {\n __staticSelector: 'ResourcesMonthView',\n highlightToday: true,\n withHeader: true,\n weekdayFormat: 'ddd',\n withWeekendDays: true,\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n mode: 'default',\n} satisfies Partial<ResourcesMonthViewProps>;\n\nfunction compareCellEvents(a: ScheduleEventData, b: ScheduleEventData): number {\n const aStart = dayjs(a.start);\n const bStart = dayjs(b.start);\n const aSpan = dayjs(a.end).startOf('day').diff(aStart.startOf('day'), 'day');\n const bSpan = dayjs(b.end).startOf('day').diff(bStart.startOf('day'), 'day');\n\n if (aSpan !== bSpan) {\n return bSpan - aSpan;\n }\n\n return aStart.valueOf() - bStart.valueOf();\n}\n\nfunction getFirstAvailableRow(usedRows: Set<number>, maxRows: number): number | null {\n for (let row = 0; row < maxRows; row += 1) {\n if (!usedRows.has(row)) {\n return row;\n }\n }\n\n return null;\n}\n\ninterface ResourcesMonthViewCellLayout {\n visible: { event: ScheduleEventData; row: number }[];\n hiddenCount: number;\n}\n\ninterface ResourcesMonthViewSegment {\n event: ScheduleEventData;\n startDayIndex: number;\n endDayIndex: number;\n row: number;\n clipStart: boolean;\n clipEnd: boolean;\n hanging: 'start' | 'end' | 'both' | 'none';\n\n /** True when any day the segment covers shows a \"+N more\" indicator (those days compress rows) */\n hiddenInSpan: boolean;\n}\n\ninterface ResourcesMonthViewResourceLayout {\n byDay: Record<string, ResourcesMonthViewCellLayout>;\n segments: ResourcesMonthViewSegment[];\n}\n\nfunction isMultiDayEvent(event: ScheduleEventData): boolean {\n return dayjs(event.end).startOf('day').isAfter(dayjs(event.start).startOf('day'));\n}\n\nexport const ResourcesMonthView = factory<ResourcesMonthViewFactory>((_props) => {\n const props = useProps('ResourcesMonthView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n mod,\n date,\n onDateChange,\n resources,\n locale,\n weekdayFormat,\n weekendDays,\n withWeekendDays,\n startScrollDate,\n __staticSelector,\n onDayClick,\n highlightToday,\n radius,\n withHeader,\n monthYearSelectProps,\n onViewChange,\n todayControlProps,\n nextControlProps,\n previousControlProps,\n viewSelectProps,\n events,\n dayWidth,\n rowHeight,\n renderResourceLabel,\n groups,\n renderGroupLabel,\n groupLabelWidth,\n renderEventBody,\n renderEvent,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n labels,\n mode,\n scrollAreaProps,\n onExternalEventDrop,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n recurrenceExpansionLimit,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot = Math.min(10, Math.max(1, _maxEventsPerTimeSlot ?? 2));\n\n const getStyles = useStyles<ResourcesMonthViewFactory>({\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: 'resourcesMonthView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesMonthViewFactory>({\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 resolvedWeekendDays = ctx.getWeekendDays(weekendDays);\n const { orderedResources, groupRanges, resourceGroupMap } = useMemo(\n () => getOrderedResources(resources, groups),\n [resources, groups]\n );\n const hasGroups = groupRanges.length > 0;\n\n const monthDays = useMemo(() => {\n const start = dayjs(date).startOf('month');\n const daysCount = start.endOf('month').date();\n const weekendDayList = ctx.getWeekendDays(weekendDays);\n const days: string[] = [];\n for (let d = 1; d <= daysCount; d++) {\n const day = start.date(d);\n if (!withWeekendDays && weekendDayList.includes(day.day() as DayOfWeek)) {\n continue;\n }\n days.push(day.format('YYYY-MM-DD'));\n }\n return days;\n }, [date, withWeekendDays, weekendDays, ctx]);\n\n const viewportRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n const dayLabelRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n const resourceLabelRef = useRef<HTMLDivElement>(null);\n\n const scrollToDay = useCallback(\n (targetDate: string) => {\n if (!viewportRef.current) {\n return;\n }\n const targetIndex = monthDays.indexOf(targetDate);\n if (targetIndex < 0) {\n return;\n }\n const targetLabel = dayLabelRefs.current[targetIndex];\n if (!targetLabel) {\n return;\n }\n const labelRect = targetLabel.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const labelWidth = resourceLabelRef.current?.getBoundingClientRect().width ?? 0;\n viewportRef.current.scrollTo({\n left: labelRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n },\n [monthDays]\n );\n\n useIsomorphicEffect(() => {\n if (startScrollDate) {\n scrollToDay(startScrollDate);\n }\n }, []);\n\n const expandedEvents = useMemo(\n () =>\n expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('month').toDate(),\n rangeEnd: dayjs(date).endOf('month').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, date, recurrenceExpansionLimit]\n );\n\n const { eventsByResourceAndDay, eventLayoutByResource } = useMemo(() => {\n const eventsByResourceAndDay: Record<string | number, Record<string, ScheduleEventData[]>> = {};\n for (const resource of resources) {\n eventsByResourceAndDay[resource.id] = {};\n for (const day of monthDays) {\n eventsByResourceAndDay[resource.id][day] = [];\n }\n }\n\n if (expandedEvents) {\n for (const event of expandedEvents) {\n if (event.resourceId === undefined || !(event.resourceId in eventsByResourceAndDay)) {\n continue;\n }\n\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n\n for (const day of monthDays) {\n const dayStart = dayjs(day).startOf('day');\n const dayEnd = dayjs(day).endOf('day');\n\n if (eventStart.isBefore(dayEnd) && eventEnd.isAfter(dayStart)) {\n eventsByResourceAndDay[event.resourceId][day].push(event);\n }\n }\n }\n }\n\n const eventLayoutByResource: Record<string | number, ResourcesMonthViewResourceLayout> = {};\n const monthRangeStart = dayjs(monthDays[0]).startOf('day');\n const monthEndExclusive = dayjs(monthDays[monthDays.length - 1])\n .add(1, 'day')\n .startOf('day');\n\n for (const resource of resources) {\n const byDay: Record<string, ResourcesMonthViewCellLayout> = {};\n const lastRow = new Map<string | number, number>();\n const rowByEventDay = new Map<string | number, Map<number, number>>();\n const overlapByEvent = new Map<\n string | number,\n { event: ScheduleEventData; days: number[] }\n >();\n\n monthDays.forEach((day, dayIndex) => {\n const dayEvents = eventsByResourceAndDay[resource.id][day];\n dayEvents.sort(compareCellEvents);\n\n for (const event of dayEvents) {\n const overlap = overlapByEvent.get(event.id);\n if (overlap) {\n overlap.days.push(dayIndex);\n } else {\n overlapByEvent.set(event.id, { event, days: [dayIndex] });\n }\n }\n\n const usedRows = new Set<number>();\n const visible: ResourcesMonthViewCellLayout['visible'] = [];\n let hiddenCount = 0;\n\n for (const event of dayEvents) {\n let row: number | null | undefined = lastRow.get(event.id);\n\n if (row === undefined || row >= maxEventsPerTimeSlot || usedRows.has(row)) {\n row = getFirstAvailableRow(usedRows, maxEventsPerTimeSlot);\n }\n\n if (row === null) {\n hiddenCount += 1;\n continue;\n }\n\n usedRows.add(row);\n visible.push({ event, row });\n if (!rowByEventDay.has(event.id)) {\n rowByEventDay.set(event.id, new Map());\n }\n rowByEventDay.get(event.id)!.set(dayIndex, row);\n lastRow.set(event.id, row);\n }\n\n byDay[day] = { visible, hiddenCount };\n });\n\n const segments: ResourcesMonthViewSegment[] = [];\n\n for (const { event, days } of overlapByEvent.values()) {\n if (!isMultiDayEvent(event)) {\n continue;\n }\n\n const firstOverlap = days[0];\n const lastOverlap = days[days.length - 1];\n const rows = rowByEventDay.get(event.id);\n const extendsBefore = dayjs(event.start).isBefore(monthRangeStart);\n const extendsAfter = dayjs(event.end).isAfter(monthEndExclusive);\n let run: { startDayIndex: number; endDayIndex: number; row: number } | null = null;\n\n const flushRun = () => {\n if (!run) {\n return;\n }\n const clipStart = run.startDayIndex > firstOverlap;\n const clipEnd = run.endDayIndex < lastOverlap;\n const hangStart = !clipStart && extendsBefore;\n const hangEnd = !clipEnd && extendsAfter;\n let hiddenInSpan = false;\n for (let dayIndex = run.startDayIndex; dayIndex <= run.endDayIndex; dayIndex += 1) {\n if ((byDay[monthDays[dayIndex]]?.hiddenCount ?? 0) > 0) {\n hiddenInSpan = true;\n break;\n }\n }\n segments.push({\n event,\n startDayIndex: run.startDayIndex,\n endDayIndex: run.endDayIndex,\n row: run.row,\n clipStart,\n clipEnd,\n hanging: hangStart && hangEnd ? 'both' : hangStart ? 'start' : hangEnd ? 'end' : 'none',\n hiddenInSpan,\n });\n run = null;\n };\n\n for (let dayIndex = firstOverlap; dayIndex <= lastOverlap; dayIndex += 1) {\n const row = rows?.get(dayIndex);\n\n if (row === undefined) {\n flushRun();\n continue;\n }\n\n if (run && run.row === row && run.endDayIndex === dayIndex - 1) {\n run.endDayIndex = dayIndex;\n } else {\n flushRun();\n run = { startDayIndex: dayIndex, endDayIndex: dayIndex, row };\n }\n }\n\n flushRun();\n }\n\n eventLayoutByResource[resource.id] = { byDay, segments };\n }\n\n return { eventsByResourceAndDay, eventLayoutByResource };\n }, [resources, monthDays, expandedEvents, maxEventsPerTimeSlot]);\n\n type DropTargetCell = { day: string; resourceId: string | number };\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetCell) => {\n if (!onExternalEventDrop) {\n return;\n }\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime: `${dayjs(target.day).format('YYYY-MM-DD')} 00:00:00`,\n resourceId: target.resourceId,\n });\n },\n [onExternalEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetCell>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: (data) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetCell, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n return calculateMonthDropDate({ draggedEvent, targetDay: target.day });\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const groupToResourceId = useMemo(() => getGroupToResourceIdMap(resources), [resources]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex, group) => {\n if (!onSlotDragEnd) {\n return;\n }\n const startDay = monthDays[startIndex];\n const endDay = monthDays[endIndex];\n if (startDay && endDay) {\n onSlotDragEnd({\n rangeStart: dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n rangeEnd: dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n resourceId: groupToResourceId.get(group) ?? group,\n });\n }\n },\n });\n\n const dayLabels = monthDays.map((day, dayIndex) => {\n const d = dayjs(day);\n const weekend = resolvedWeekendDays.includes(d.day() as DayOfWeek);\n const today = d.isSame(dayjs(), 'day') && highlightToday;\n\n return (\n <Box\n {...getStyles('resourcesMonthViewDayLabel')}\n key={day}\n mod={{ weekend, today }}\n ref={(node) => {\n dayLabelRefs.current[dayIndex] = node;\n }}\n >\n <span {...getStyles('resourcesMonthViewDayLabelWeekday')}>\n {formatDate({ date: d, locale: ctx.getLocale(locale), format: weekdayFormat })}\n </span>\n <span {...getStyles('resourcesMonthViewDayLabelNumber')}>{d.date()}</span>\n </Box>\n );\n });\n\n const cellsRef = useRef<HTMLButtonElement[][]>([]);\n\n const getDayIndexFromDragPoint = useCallback((event: React.DragEvent, resourceIndex: number) => {\n return getIndexFromDragPoint(cellsRef.current[resourceIndex] ?? [], event.clientX);\n }, []);\n\n const handleCellKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n dayIndex: number\n ) => {\n const key = event.key;\n let nextResourceIndex = resourceIndex;\n let nextDayIndex = dayIndex;\n\n if (key === 'ArrowRight') {\n nextDayIndex = Math.min(dayIndex + 1, monthDays.length - 1);\n } else if (key === 'ArrowLeft') {\n nextDayIndex = Math.max(dayIndex - 1, 0);\n } else if (key === 'ArrowDown') {\n nextResourceIndex = Math.min(resourceIndex + 1, resources.length - 1);\n } else if (key === 'ArrowUp') {\n nextResourceIndex = Math.max(resourceIndex - 1, 0);\n } else {\n return;\n }\n\n event.preventDefault();\n cellsRef.current[nextResourceIndex]?.[nextDayIndex]?.focus();\n };\n\n const rowHeightPercent = 100 / maxEventsPerTimeSlot;\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n if (!cellsRef.current[resourceIndex]) {\n cellsRef.current[resourceIndex] = [];\n }\n\n const slotGroup = String(resource.id);\n const dropTarget = dragDrop.dropTarget;\n\n const totalDays = monthDays.length;\n const eventNodes: React.ReactNode[] = [];\n const moreNodes: React.ReactNode[] = [];\n\n const cells = monthDays.map((day, dayIndex) => {\n const d = dayjs(day);\n const weekend = ctx.getWeekendDays(weekendDays).includes(d.day() as DayOfWeek);\n const isDropTarget =\n dropTarget !== null &&\n typeof dropTarget === 'object' &&\n 'day' in dropTarget &&\n (dropTarget as DropTargetCell).day === day &&\n (dropTarget as DropTargetCell).resourceId === resource.id;\n const isDragSelected = slotDragSelect.isSlotSelected(dayIndex, slotGroup);\n const dayEvents = eventsByResourceAndDay[resource.id]?.[day] || [];\n const layout = eventLayoutByResource[resource.id]?.byDay[day];\n const visibleEvents = layout?.visible ?? [];\n const hiddenEventsCount = layout?.hiddenCount ?? 0;\n const isFirstCell = resourceIndex === 0 && dayIndex === 0;\n const dayLeftPercent = (dayIndex / totalDays) * 100;\n const dayWidthPercent = 100 / totalDays;\n\n const hasHiddenEvents = hiddenEventsCount > 0 && mode !== 'static';\n\n visibleEvents.forEach(({ event, row }) => {\n if (isMultiDayEvent(event)) {\n return;\n }\n\n const isDraggable = dragDrop.isDraggableEvent(event);\n const topValue = hasHiddenEvents\n ? `calc((100% - 18px) * ${row} / ${maxEventsPerTimeSlot} + 1px)`\n : `calc(${row * rowHeightPercent}% + 1px)`;\n const heightValue = hasHiddenEvents\n ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)`\n : `calc(${rowHeightPercent}% - 2px)`;\n\n eventNodes.push(\n <ScheduleEvent\n key={`${event.id}-${day}`}\n event={event}\n nowrap\n autoSize\n size=\"sm\"\n draggable={isDraggable}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(event, e) : undefined}\n style={{\n position: 'absolute',\n top: topValue,\n left: `calc(${dayLeftPercent}% + 1px)`,\n width: `calc(${dayWidthPercent}% - 2px)`,\n height: heightValue,\n zIndex: 3,\n }}\n />\n );\n });\n\n if (hiddenEventsCount > 0 && mode !== 'static') {\n moreNodes.push(\n <MoreEvents\n key={`more-${resource.id}-${day}`}\n events={dayEvents}\n moreEventsCount={hiddenEventsCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n bottom: 1,\n left: `calc(${dayLeftPercent}% + 1px)`,\n width: `calc(${dayWidthPercent}% - 2px)`,\n height: 18,\n zIndex: 4,\n }}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n );\n }\n\n return (\n <UnstyledButton\n key={day}\n ref={(node) => {\n if (node) {\n if (!cellsRef.current[resourceIndex]) {\n cellsRef.current[resourceIndex] = [];\n }\n cellsRef.current[resourceIndex][dayIndex] = node;\n }\n }}\n {...getStyles('resourcesMonthViewCell')}\n aria-label={`${resource.label} ${d.format('MMMM D, YYYY')}`}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? dayIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n mod={{\n weekend,\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n tabIndex={mode === 'static' ? -1 : isFirstCell ? 0 : -1}\n onClick={\n mode === 'static'\n ? undefined\n : (e) => onDayClick?.({ date: day, nativeEvent: e, resourceId: resource.id })\n }\n onKeyDown={\n mode === 'static' ? undefined : (e) => handleCellKeyDown(e, resourceIndex, dayIndex)\n }\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) =>\n slotDragSelect.handleSlotPointerDown(\n e as React.PointerEvent<HTMLButtonElement>,\n dayIndex,\n slotGroup\n )\n : undefined\n }\n onDragOver={withDragHandlers ? (e) => e.preventDefault() : undefined}\n />\n );\n });\n\n const resourceSegments = eventLayoutByResource[resource.id]?.segments ?? [];\n\n resourceSegments.forEach((segment) => {\n const isDraggable = dragDrop.isDraggableEvent(segment.event);\n const segmentLeftPercent = (segment.startDayIndex / totalDays) * 100;\n const segmentWidthPercent =\n ((segment.endDayIndex - segment.startDayIndex + 1) / totalDays) * 100;\n const compressed = segment.hiddenInSpan && mode !== 'static';\n const topValue = compressed\n ? `calc((100% - 18px) * ${segment.row} / ${maxEventsPerTimeSlot} + 1px)`\n : `calc(${segment.row * rowHeightPercent}% + 1px)`;\n const heightValue = compressed\n ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)`\n : `calc(${rowHeightPercent}% - 2px)`;\n\n eventNodes.push(\n <ScheduleEvent\n key={`${segment.event.id}-segment-${segment.startDayIndex}`}\n event={segment.event}\n nowrap\n autoSize\n size=\"sm\"\n hanging={segment.hanging}\n draggable={isDraggable}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n mod={{ 'clip-start': segment.clipStart, 'clip-end': segment.clipEnd }}\n onClick={onEventClick ? (e) => onEventClick(segment.event, e) : undefined}\n style={{\n position: 'absolute',\n top: topValue,\n left: `calc(${segmentLeftPercent}% + 1px)`,\n width: `calc(${segmentWidthPercent}% - 2px)`,\n height: heightValue,\n zIndex: 3,\n }}\n />\n );\n });\n\n const groupInfo = hasGroups ? resourceGroupMap[resourceIndex] : undefined;\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesMonthViewGroupColumn')}\n mod={{ 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-month-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box {...getStyles('resourcesMonthViewGroupColumnEmpty')} />\n )\n ) : null;\n\n return (\n <div {...getStyles('resourcesMonthViewRow')} key={resource.id}>\n {groupCell}\n <div\n {...getStyles('resourcesMonthViewResourceLabel')}\n data-has-groups={hasGroups || undefined}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </div>\n <div\n {...getStyles('resourcesMonthViewRowSlots')}\n onDragOver={\n withDragHandlers\n ? (e) => {\n const dayIndex = getDayIndexFromDragPoint(e, resourceIndex);\n if (dayIndex !== null && monthDays[dayIndex]) {\n dragDrop.handleDragOver(e, {\n day: monthDays[dayIndex],\n resourceId: resource.id,\n });\n }\n }\n : undefined\n }\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={\n withDragHandlers\n ? (e) => {\n const dayIndex = getDayIndexFromDragPoint(e, resourceIndex);\n if (dayIndex !== null && monthDays[dayIndex]) {\n dragDrop.handleDrop(e, {\n day: monthDays[dayIndex],\n resourceId: resource.id,\n });\n }\n }\n : undefined\n }\n >\n {eventNodes}\n {moreNodes}\n {cells}\n </div>\n </div>\n );\n });\n\n const content = (\n <Box\n mod={[\n {\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'event-interaction': dragDrop.dragContextValue.isDragging,\n },\n mod,\n ]}\n {...getStyles('resourcesMonthView')}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"month\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'month').startOf('month')),\n next: () => toDateString(dayjs(date).add(1, 'month').startOf('month')),\n today: () => {\n requestAnimationFrame(() => {\n scrollToDay(dayjs().format('YYYY-MM-DD'));\n });\n return toDateString(dayjs());\n },\n }}\n control={{\n monthYearSelect: {\n locale,\n yearValue: dayjs(date).get('year'),\n monthValue: dayjs(date).get('month'),\n onYearChange: (year) =>\n onDateChange?.(toDateString(dayjs(date).set('year', year).startOf('month'))),\n onMonthChange: (month) =>\n onDateChange?.(toDateString(dayjs(date).set('month', month).startOf('month'))),\n ...monthYearSelectProps,\n },\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={{ views: ['day', 'week', 'month'] as const, ...viewSelectProps }}\n stylesApiProps={stylesApiProps}\n />\n )}\n\n <Box {...getStyles('resourcesMonthViewRoot')}>\n <ScrollArea\n scrollbars=\"x\"\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesMonthViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n viewportRef={mergedViewportRef}\n >\n <div {...getStyles('resourcesMonthViewInner')}>\n <div {...getStyles('resourcesMonthViewDayLabelsRow')}>\n <div\n {...getStyles('resourcesMonthViewCorner')}\n key=\"corner\"\n ref={resourceLabelRef}\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n {dayLabels}\n </div>\n\n {rows}\n </div>\n </ScrollArea>\n </Box>\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nResourcesMonthView.displayName = '@mantine/schedule/ResourcesMonthView';\nResourcesMonthView.classes = classes;\nResourcesMonthView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8OA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,UAAU,WAAW,uBAAuB,EAC7D,oBAAoB;CAClB,iCAAiC,SAAS,UAAU,MAAM,IAAI,KAAA;CAC9D,oCAAoC,IAAI,QAAQ;CAChD,qCAAqC,IAAI,SAAS;CAClD,4CAA4C,IAAI,eAAe;AACjE,EACF,EACF;AAEA,MAAM,eAAe;CACnB,kBAAkB;CAClB,gBAAgB;CAChB,YAAY;CACZ,eAAe;CACf,iBAAiB;CACjB,uBAAuB;CACvB,oBAAoB;CACpB,MAAM;AACR;AAEA,SAAS,kBAAkB,GAAsB,GAA8B;CAC7E,MAAM,SAAS,MAAM,EAAE,KAAK;CAC5B,MAAM,SAAS,MAAM,EAAE,KAAK;CAC5B,MAAM,QAAQ,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,KAAK,OAAO,QAAQ,KAAK,GAAG,KAAK;CAC3E,MAAM,QAAQ,MAAM,EAA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,SACb,eAAe,aAAa,MAAM,IAAI,CAAC,CAAC,IAAI,QAAQ,IAAI,CAAC,CAAC,QAAQ,OAAO,CAAC,CAAC;IAC7E,gBAAgB,UACd,eAAe,aAAa,MAAM,IAAI,CAAC,CAAC,IAAI,SAAS,KAAK,CAAC,CAAC,QAAQ,OAAO,CAAC,CAAC;IAC/E,GAAG;GACL,EACF;GACQ;GACM;GACA;GACQ;GACJ;GACC;GACnB,iBAAiB;IAAE,OAAO;KAAC;KAAO;KAAQ;IAAO;IAAY,GAAG;GAAgB;GAChE;EACjB,CAAA,GAGH,oBAAC,KAAD;GAAK,GAAI,UAAU,wBAAwB;aACzC,oBAAC,YAAD;IACE,YAAW;IACX,eAAe;IACf,GAAI;IACJ,GAAI,UAAU,gCAAgC;KAC5C,WAAW,iBAAiB;KAC5B,OAAO,iBAAiB;IAC1B,CAAC;IACD,aAAa;cAEb,qBAAC,OAAD;KAAK,GAAI,UAAU,yBAAyB;eAA5C,CACE,qBAAC,OAAD;MAAK,GAAI,UAAU,gCAAgC;gBAAnD,CACE,8BAAC,OAAD;OACE,GAAI,UAAU,0BAA0B;OACxC,KAAI;OACJ,KAAK;OACL,OACE,YACI;QACE,WACE;QACF,UACE;OACJ,IACA,KAAA;MAIH,GADF,SAAS,aAAa,MAAM,CAC1B,GACJ,SACE;SAEJ,IACE;;GACK,CAAA;EACT,CAAA,CACF;;CAGP,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO,SAAS;YAAmB;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,mBAAmB,cAAc;AACjC,mBAAmB,UAAUA;AAC7B,mBAAmB,eAAe"}
|
|
1
|
+
{"version":3,"file":"ResourcesMonthView.mjs","names":["classes"],"sources":["../../../src/components/ResourcesMonthView/ResourcesMonthView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useMemo, useRef } 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 ScrollAreaProps,\n StylesApiProps,\n UnstyledButton,\n useMantineTheme,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport { useDayGridEventResize } from '../../hooks/use-day-grid-event-resize';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n formatDate,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n toDateString,\n} from '../../utils';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectProps } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport classes from './ResourcesMonthView.module.css';\n\nexport type ResourcesMonthViewStylesNames =\n | 'resourcesMonthView'\n | 'resourcesMonthViewRoot'\n | 'resourcesMonthViewScrollArea'\n | 'resourcesMonthViewDayLabelsRow'\n | 'resourcesMonthViewCorner'\n | 'resourcesMonthViewDayLabel'\n | 'resourcesMonthViewDayLabelWeekday'\n | 'resourcesMonthViewDayLabelNumber'\n | 'resourcesMonthViewRow'\n | 'resourcesMonthViewResourceLabel'\n | 'resourcesMonthViewRowSlots'\n | 'resourcesMonthViewCell'\n | 'resourcesMonthViewEventWrapper'\n | 'resourcesMonthViewResizeHandle'\n | 'resourcesMonthViewInner'\n | 'resourcesMonthViewGroupColumn'\n | 'resourcesMonthViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesMonthViewCssVariables = {\n resourcesMonthView:\n | '--resources-month-view-radius'\n | '--resources-month-view-day-width'\n | '--resources-month-view-row-height'\n | '--resources-month-view-group-label-width';\n};\n\nexport interface ResourcesMonthViewProps\n extends BoxProps, StylesApiProps<ResourcesMonthViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Date to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | string;\n\n /** Called with the new date value when a date is selected */\n onDateChange?: (value: DateStringValue) => void;\n\n /** List of resources to display as rows */\n resources: ScheduleResourceData[];\n\n /** Locale passed down to dayjs */\n locale?: string;\n\n /** `dayjs` format for weekdays in day column headers @default 'dd' */\n weekdayFormat?: DateLabelFormat;\n\n /** Indices of weekend days */\n weekendDays?: DayOfWeek[];\n\n /** If set to false, weekend days are hidden @default true */\n withWeekendDays?: boolean;\n\n /** Date to scroll to on initial render, in `YYYY-MM-DD` format */\n startScrollDate?: string;\n\n /** Called when a cell is clicked, includes resourceId */\n onDayClick?: (data: {\n date: DateStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** If set, highlights the current day @default true */\n highlightToday?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Props passed down to `MonthYearSelect` component */\n monthYearSelectProps?: Partial<MonthYearSelectProps>;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next 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 /** Events to display */\n events?: ScheduleEventData[];\n\n /** Width of each day column @default 40px */\n dayWidth?: React.CSSProperties['width'];\n\n /** Height of each resource row @default 48px */\n rowHeight?: React.CSSProperties['height'];\n\n /** Function to customize event body */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering */\n renderEvent?: RenderEvent;\n\n /** Function to customize resource label rendering */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** List of resource groups to display as a column to the left of resource labels */\n groups?: ScheduleResourceGroup[];\n\n /** Function to customize group label rendering */\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n\n /** Width of the group label column @default 80px */\n groupLabelWidth?: React.CSSProperties['width'];\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped, includes target resourceId */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\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 /** If true, events can be resized by dragging their start and end edges, resizing snaps to whole days @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 /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select day ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a day range is selected by dragging, includes resourceId */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Props passed down to `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n\n /** Called when an external item is dropped */\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Maximum number of events visible per cell before \"+more\" indicator @default 2 */\n maxEventsPerTimeSlot?: number;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Max number of generated recurring instances @default 2000 */\n recurrenceExpansionLimit?: number;\n}\n\nexport type ResourcesMonthViewFactory = Factory<{\n props: ResourcesMonthViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesMonthViewStylesNames;\n vars: ResourcesMonthViewCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<ResourcesMonthViewFactory>(\n (_theme, { radius, dayWidth, rowHeight, groupLabelWidth }) => ({\n resourcesMonthView: {\n '--resources-month-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-month-view-day-width': rem(dayWidth),\n '--resources-month-view-row-height': rem(rowHeight),\n '--resources-month-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nconst defaultProps = {\n __staticSelector: 'ResourcesMonthView',\n highlightToday: true,\n withHeader: true,\n weekdayFormat: 'ddd',\n withWeekendDays: true,\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n withEventResize: false,\n mode: 'default',\n} satisfies Partial<ResourcesMonthViewProps>;\n\nfunction compareCellEvents(a: ScheduleEventData, b: ScheduleEventData): number {\n const aStart = dayjs(a.start);\n const bStart = dayjs(b.start);\n const aSpan = dayjs(a.end).startOf('day').diff(aStart.startOf('day'), 'day');\n const bSpan = dayjs(b.end).startOf('day').diff(bStart.startOf('day'), 'day');\n\n if (aSpan !== bSpan) {\n return bSpan - aSpan;\n }\n\n return aStart.valueOf() - bStart.valueOf();\n}\n\nfunction getFirstAvailableRow(usedRows: Set<number>, maxRows: number): number | null {\n for (let row = 0; row < maxRows; row += 1) {\n if (!usedRows.has(row)) {\n return row;\n }\n }\n\n return null;\n}\n\ninterface ResourcesMonthViewCellLayout {\n visible: { event: ScheduleEventData; row: number }[];\n hiddenCount: number;\n}\n\ninterface ResourcesMonthViewSegment {\n event: ScheduleEventData;\n startDayIndex: number;\n endDayIndex: number;\n row: number;\n clipStart: boolean;\n clipEnd: boolean;\n hanging: 'start' | 'end' | 'both' | 'none';\n\n /** True when any day the segment covers shows a \"+N more\" indicator (those days compress rows) */\n hiddenInSpan: boolean;\n}\n\ninterface ResourcesMonthViewResourceLayout {\n byDay: Record<string, ResourcesMonthViewCellLayout>;\n segments: ResourcesMonthViewSegment[];\n}\n\nfunction isMultiDayEvent(event: ScheduleEventData): boolean {\n return dayjs(event.end).startOf('day').isAfter(dayjs(event.start).startOf('day'));\n}\n\nexport const ResourcesMonthView = factory<ResourcesMonthViewFactory>((_props) => {\n const props = useProps('ResourcesMonthView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n mod,\n date,\n onDateChange,\n resources,\n locale,\n weekdayFormat,\n weekendDays,\n withWeekendDays,\n startScrollDate,\n __staticSelector,\n onDayClick,\n highlightToday,\n radius,\n withHeader,\n monthYearSelectProps,\n onViewChange,\n todayControlProps,\n nextControlProps,\n previousControlProps,\n viewSelectProps,\n events,\n dayWidth,\n rowHeight,\n renderResourceLabel,\n groups,\n renderGroupLabel,\n groupLabelWidth,\n renderEventBody,\n renderEvent,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n withEventResize,\n onEventResize,\n canResizeEvent,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n labels,\n mode,\n scrollAreaProps,\n onExternalEventDrop,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n recurrenceExpansionLimit,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot = Math.min(10, Math.max(1, _maxEventsPerTimeSlot ?? 2));\n\n const getStyles = useStyles<ResourcesMonthViewFactory>({\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: 'resourcesMonthView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesMonthViewFactory>({\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 theme = useMantineTheme();\n const ctx = useDatesContext();\n const resolvedWeekendDays = ctx.getWeekendDays(weekendDays);\n const { orderedResources, groupRanges, resourceGroupMap } = useMemo(\n () => getOrderedResources(resources, groups),\n [resources, groups]\n );\n const hasGroups = groupRanges.length > 0;\n\n const monthDays = useMemo(() => {\n const start = dayjs(date).startOf('month');\n const daysCount = start.endOf('month').date();\n const weekendDayList = ctx.getWeekendDays(weekendDays);\n const days: string[] = [];\n for (let d = 1; d <= daysCount; d++) {\n const day = start.date(d);\n if (!withWeekendDays && weekendDayList.includes(day.day() as DayOfWeek)) {\n continue;\n }\n days.push(day.format('YYYY-MM-DD'));\n }\n return days;\n }, [date, withWeekendDays, weekendDays, ctx]);\n\n const viewportRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n const dayLabelRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n const resourceLabelRef = useRef<HTMLDivElement>(null);\n\n const scrollToDay = useCallback(\n (targetDate: string) => {\n if (!viewportRef.current) {\n return;\n }\n const targetIndex = monthDays.indexOf(targetDate);\n if (targetIndex < 0) {\n return;\n }\n const targetLabel = dayLabelRefs.current[targetIndex];\n if (!targetLabel) {\n return;\n }\n const labelRect = targetLabel.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const labelWidth = resourceLabelRef.current?.getBoundingClientRect().width ?? 0;\n viewportRef.current.scrollTo({\n left: labelRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n },\n [monthDays]\n );\n\n useIsomorphicEffect(() => {\n if (startScrollDate) {\n scrollToDay(startScrollDate);\n }\n }, []);\n\n const expandedEvents = useMemo(\n () =>\n expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('month').toDate(),\n rangeEnd: dayjs(date).endOf('month').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, date, recurrenceExpansionLimit]\n );\n\n const monthDaySet = useMemo(() => new Set(monthDays), [monthDays]);\n\n const eventResize = useDayGridEventResize({\n enabled: withEventResize,\n mode,\n onEventResize,\n canResizeEvent,\n });\n\n const { resizingEventId, previewStart, previewEnd } = eventResize;\n\n const layoutEvents = useMemo(() => {\n if (resizingEventId === null || previewStart === null || previewEnd === null) {\n return expandedEvents;\n }\n\n return expandedEvents.map((event) =>\n event.id === resizingEventId ? { ...event, start: previewStart, end: previewEnd } : event\n );\n }, [expandedEvents, resizingEventId, previewStart, previewEnd]);\n\n const { eventsByResourceAndDay, eventLayoutByResource } = useMemo(() => {\n const eventsByResourceAndDay: Record<string | number, Record<string, ScheduleEventData[]>> = {};\n for (const resource of resources) {\n eventsByResourceAndDay[resource.id] = {};\n for (const day of monthDays) {\n eventsByResourceAndDay[resource.id][day] = [];\n }\n }\n\n if (layoutEvents) {\n for (const event of layoutEvents) {\n if (event.resourceId === undefined || !(event.resourceId in eventsByResourceAndDay)) {\n continue;\n }\n\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n\n for (const day of monthDays) {\n const dayStart = dayjs(day).startOf('day');\n const dayEnd = dayjs(day).endOf('day');\n\n if (eventStart.isBefore(dayEnd) && eventEnd.isAfter(dayStart)) {\n eventsByResourceAndDay[event.resourceId][day].push(event);\n }\n }\n }\n }\n\n const eventLayoutByResource: Record<string | number, ResourcesMonthViewResourceLayout> = {};\n const monthRangeStart = dayjs(monthDays[0]).startOf('day');\n const monthEndExclusive = dayjs(monthDays[monthDays.length - 1])\n .add(1, 'day')\n .startOf('day');\n\n for (const resource of resources) {\n const byDay: Record<string, ResourcesMonthViewCellLayout> = {};\n const lastRow = new Map<string | number, number>();\n const rowByEventDay = new Map<string | number, Map<number, number>>();\n const overlapByEvent = new Map<\n string | number,\n { event: ScheduleEventData; days: number[] }\n >();\n\n monthDays.forEach((day, dayIndex) => {\n const dayEvents = eventsByResourceAndDay[resource.id][day];\n dayEvents.sort(compareCellEvents);\n\n for (const event of dayEvents) {\n const overlap = overlapByEvent.get(event.id);\n if (overlap) {\n overlap.days.push(dayIndex);\n } else {\n overlapByEvent.set(event.id, { event, days: [dayIndex] });\n }\n }\n\n const usedRows = new Set<number>();\n const visible: ResourcesMonthViewCellLayout['visible'] = [];\n let hiddenCount = 0;\n\n for (const event of dayEvents) {\n let row: number | null | undefined = lastRow.get(event.id);\n\n if (row === undefined || row >= maxEventsPerTimeSlot || usedRows.has(row)) {\n row = getFirstAvailableRow(usedRows, maxEventsPerTimeSlot);\n }\n\n if (row === null) {\n hiddenCount += 1;\n continue;\n }\n\n usedRows.add(row);\n visible.push({ event, row });\n if (!rowByEventDay.has(event.id)) {\n rowByEventDay.set(event.id, new Map());\n }\n rowByEventDay.get(event.id)!.set(dayIndex, row);\n lastRow.set(event.id, row);\n }\n\n byDay[day] = { visible, hiddenCount };\n });\n\n const segments: ResourcesMonthViewSegment[] = [];\n\n for (const { event, days } of overlapByEvent.values()) {\n if (!isMultiDayEvent(event)) {\n continue;\n }\n\n const firstOverlap = days[0];\n const lastOverlap = days[days.length - 1];\n const rows = rowByEventDay.get(event.id);\n const extendsBefore = dayjs(event.start).isBefore(monthRangeStart);\n const extendsAfter = dayjs(event.end).isAfter(monthEndExclusive);\n let run: { startDayIndex: number; endDayIndex: number; row: number } | null = null;\n\n const flushRun = () => {\n if (!run) {\n return;\n }\n const clipStart = run.startDayIndex > firstOverlap;\n const clipEnd = run.endDayIndex < lastOverlap;\n const hangStart = !clipStart && extendsBefore;\n const hangEnd = !clipEnd && extendsAfter;\n let hiddenInSpan = false;\n for (let dayIndex = run.startDayIndex; dayIndex <= run.endDayIndex; dayIndex += 1) {\n if ((byDay[monthDays[dayIndex]]?.hiddenCount ?? 0) > 0) {\n hiddenInSpan = true;\n break;\n }\n }\n segments.push({\n event,\n startDayIndex: run.startDayIndex,\n endDayIndex: run.endDayIndex,\n row: run.row,\n clipStart,\n clipEnd,\n hanging: hangStart && hangEnd ? 'both' : hangStart ? 'start' : hangEnd ? 'end' : 'none',\n hiddenInSpan,\n });\n run = null;\n };\n\n for (let dayIndex = firstOverlap; dayIndex <= lastOverlap; dayIndex += 1) {\n const row = rows?.get(dayIndex);\n\n if (row === undefined) {\n flushRun();\n continue;\n }\n\n if (run && run.row === row && run.endDayIndex === dayIndex - 1) {\n run.endDayIndex = dayIndex;\n } else {\n flushRun();\n run = { startDayIndex: dayIndex, endDayIndex: dayIndex, row };\n }\n }\n\n flushRun();\n }\n\n eventLayoutByResource[resource.id] = { byDay, segments };\n }\n\n return { eventsByResourceAndDay, eventLayoutByResource };\n }, [resources, monthDays, layoutEvents, maxEventsPerTimeSlot]);\n\n type DropTargetCell = { day: string; resourceId: string | number };\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetCell) => {\n if (!onExternalEventDrop) {\n return;\n }\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime: `${dayjs(target.day).format('YYYY-MM-DD')} 00:00:00`,\n resourceId: target.resourceId,\n });\n },\n [onExternalEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetCell>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: (data) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetCell, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n return calculateMonthDropDate({ draggedEvent, targetDay: target.day });\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const groupToResourceId = useMemo(() => getGroupToResourceIdMap(resources), [resources]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex, group) => {\n if (!onSlotDragEnd) {\n return;\n }\n const startDay = monthDays[startIndex];\n const endDay = monthDays[endIndex];\n if (startDay && endDay) {\n onSlotDragEnd({\n rangeStart: dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n rangeEnd: dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n resourceId: groupToResourceId.get(group) ?? group,\n });\n }\n },\n });\n\n const dayLabels = monthDays.map((day, dayIndex) => {\n const d = dayjs(day);\n const weekend = resolvedWeekendDays.includes(d.day() as DayOfWeek);\n const today = d.isSame(dayjs(), 'day') && highlightToday;\n\n return (\n <Box\n {...getStyles('resourcesMonthViewDayLabel')}\n key={day}\n mod={{ weekend, today }}\n ref={(node) => {\n dayLabelRefs.current[dayIndex] = node;\n }}\n >\n <span {...getStyles('resourcesMonthViewDayLabelWeekday')}>\n {formatDate({ date: d, locale: ctx.getLocale(locale), format: weekdayFormat })}\n </span>\n <span {...getStyles('resourcesMonthViewDayLabelNumber')}>{d.date()}</span>\n </Box>\n );\n });\n\n const cellsRef = useRef<HTMLButtonElement[][]>([]);\n\n const getDayIndexFromDragPoint = useCallback((event: React.DragEvent, resourceIndex: number) => {\n return getIndexFromDragPoint(cellsRef.current[resourceIndex] ?? [], event.clientX);\n }, []);\n\n const handleCellKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n dayIndex: number\n ) => {\n const key = event.key;\n let nextResourceIndex = resourceIndex;\n let nextDayIndex = dayIndex;\n\n if (key === 'ArrowRight') {\n nextDayIndex = Math.min(dayIndex + 1, monthDays.length - 1);\n } else if (key === 'ArrowLeft') {\n nextDayIndex = Math.max(dayIndex - 1, 0);\n } else if (key === 'ArrowDown') {\n nextResourceIndex = Math.min(resourceIndex + 1, resources.length - 1);\n } else if (key === 'ArrowUp') {\n nextResourceIndex = Math.max(resourceIndex - 1, 0);\n } else {\n return;\n }\n\n event.preventDefault();\n cellsRef.current[nextResourceIndex]?.[nextDayIndex]?.focus();\n };\n\n const rowHeightPercent = 100 / maxEventsPerTimeSlot;\n\n const renderEventNode = ({\n key,\n event,\n resourceIndex,\n style,\n hanging,\n eventMod,\n withStartHandle,\n withEndHandle,\n }: {\n key: string;\n event: ScheduleEventData;\n resourceIndex: number;\n style: React.CSSProperties;\n hanging?: ResourcesMonthViewSegment['hanging'];\n eventMod?: Record<string, any>;\n withStartHandle: boolean;\n withEndHandle: boolean;\n }) => {\n const isResizable = eventResize.isResizableEvent(event);\n const isThisEventResizing = eventResize.resizingEventId === event.id;\n\n const eventEnd = dayjs(event.end);\n const endsAtMidnight =\n eventEnd.hour() === 0 && eventEnd.minute() === 0 && eventEnd.second() === 0;\n const lastDay = (endsAtMidnight ? eventEnd.subtract(1, 'day') : eventEnd).format('YYYY-MM-DD');\n\n const showStartHandle =\n withStartHandle && monthDaySet.has(dayjs(event.start).format('YYYY-MM-DD'));\n const showEndHandle = withEndHandle && monthDaySet.has(lastDay);\n\n const eventColors = isResizable\n ? theme.variantColorResolver({\n color: event.color || theme.primaryColor,\n theme,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n : null;\n\n const getHandleProps = (edge: 'start' | 'end') => ({\n ...getStyles('resourcesMonthViewResizeHandle'),\n 'data-edge': edge,\n 'data-active': (isThisEventResizing && eventResize.resizingEdge === edge) || undefined,\n onPointerDown: (e: React.PointerEvent) =>\n eventResize.handleResizeStart({\n event,\n edge,\n cells: cellsRef.current[resourceIndex] ?? [],\n days: monthDays,\n pointerEvent: e,\n }),\n });\n\n return (\n <Box\n key={key}\n {...getStyles('resourcesMonthViewEventWrapper', {\n style: { position: 'absolute', zIndex: 3, ...style },\n })}\n __vars={eventColors ? { '--event-color': eventColors.color } : undefined}\n data-resizing={isThisEventResizing || undefined}\n >\n <ScheduleEvent\n event={event}\n nowrap\n autoSize\n size=\"sm\"\n hanging={hanging}\n mod={eventMod}\n draggable={dragDrop.isDraggableEvent(event)}\n isResizing={isThisEventResizing}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n style={{ width: '100%', height: '100%' }}\n />\n {isResizable && showStartHandle && <div {...getHandleProps('start')} />}\n {isResizable && showEndHandle && <div {...getHandleProps('end')} />}\n </Box>\n );\n };\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n if (!cellsRef.current[resourceIndex]) {\n cellsRef.current[resourceIndex] = [];\n }\n\n cellsRef.current[resourceIndex].length = monthDays.length;\n\n const slotGroup = String(resource.id);\n const dropTarget = dragDrop.dropTarget;\n\n const totalDays = monthDays.length;\n const eventNodes: React.ReactNode[] = [];\n const moreNodes: React.ReactNode[] = [];\n\n const cells = monthDays.map((day, dayIndex) => {\n const d = dayjs(day);\n const weekend = ctx.getWeekendDays(weekendDays).includes(d.day() as DayOfWeek);\n const isDropTarget =\n dropTarget !== null &&\n typeof dropTarget === 'object' &&\n 'day' in dropTarget &&\n (dropTarget as DropTargetCell).day === day &&\n (dropTarget as DropTargetCell).resourceId === resource.id;\n const isDragSelected = slotDragSelect.isSlotSelected(dayIndex, slotGroup);\n const dayEvents = eventsByResourceAndDay[resource.id]?.[day] || [];\n const layout = eventLayoutByResource[resource.id]?.byDay[day];\n const visibleEvents = layout?.visible ?? [];\n const hiddenEventsCount = layout?.hiddenCount ?? 0;\n const isFirstCell = resourceIndex === 0 && dayIndex === 0;\n const dayLeftPercent = (dayIndex / totalDays) * 100;\n const dayWidthPercent = 100 / totalDays;\n\n const hasHiddenEvents = hiddenEventsCount > 0 && mode !== 'static';\n\n visibleEvents.forEach(({ event, row }) => {\n if (isMultiDayEvent(event)) {\n return;\n }\n\n const topValue = hasHiddenEvents\n ? `calc((100% - 18px) * ${row} / ${maxEventsPerTimeSlot} + 1px)`\n : `calc(${row * rowHeightPercent}% + 1px)`;\n const heightValue = hasHiddenEvents\n ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)`\n : `calc(${rowHeightPercent}% - 2px)`;\n\n eventNodes.push(\n renderEventNode({\n key: `${event.id}-${day}`,\n event,\n resourceIndex,\n withStartHandle: true,\n withEndHandle: true,\n style: {\n top: topValue,\n left: `calc(${dayLeftPercent}% + 1px)`,\n width: `calc(${dayWidthPercent}% - 2px)`,\n height: heightValue,\n },\n })\n );\n });\n\n if (hiddenEventsCount > 0 && mode !== 'static') {\n moreNodes.push(\n <MoreEvents\n key={`more-${resource.id}-${day}`}\n events={dayEvents}\n moreEventsCount={hiddenEventsCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n bottom: 1,\n left: `calc(${dayLeftPercent}% + 1px)`,\n width: `calc(${dayWidthPercent}% - 2px)`,\n height: 18,\n zIndex: 4,\n }}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n );\n }\n\n return (\n <UnstyledButton\n key={day}\n ref={(node) => {\n if (node) {\n if (!cellsRef.current[resourceIndex]) {\n cellsRef.current[resourceIndex] = [];\n }\n cellsRef.current[resourceIndex][dayIndex] = node;\n }\n }}\n {...getStyles('resourcesMonthViewCell')}\n aria-label={`${resource.label} ${d.format('MMMM D, YYYY')}`}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? dayIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n mod={{\n weekend,\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n tabIndex={mode === 'static' ? -1 : isFirstCell ? 0 : -1}\n onClick={\n mode === 'static'\n ? undefined\n : (e) => onDayClick?.({ date: day, nativeEvent: e, resourceId: resource.id })\n }\n onKeyDown={\n mode === 'static' ? undefined : (e) => handleCellKeyDown(e, resourceIndex, dayIndex)\n }\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) =>\n slotDragSelect.handleSlotPointerDown(\n e as React.PointerEvent<HTMLButtonElement>,\n dayIndex,\n slotGroup\n )\n : undefined\n }\n onDragOver={withDragHandlers ? (e) => e.preventDefault() : undefined}\n />\n );\n });\n\n const resourceSegments = eventLayoutByResource[resource.id]?.segments ?? [];\n\n resourceSegments.forEach((segment) => {\n const segmentLeftPercent = (segment.startDayIndex / totalDays) * 100;\n const segmentWidthPercent =\n ((segment.endDayIndex - segment.startDayIndex + 1) / totalDays) * 100;\n const compressed = segment.hiddenInSpan && mode !== 'static';\n const topValue = compressed\n ? `calc((100% - 18px) * ${segment.row} / ${maxEventsPerTimeSlot} + 1px)`\n : `calc(${segment.row * rowHeightPercent}% + 1px)`;\n const heightValue = compressed\n ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)`\n : `calc(${rowHeightPercent}% - 2px)`;\n\n eventNodes.push(\n renderEventNode({\n key: `${segment.event.id}-segment-${segment.startDayIndex}`,\n event: segment.event,\n resourceIndex,\n hanging: segment.hanging,\n eventMod: { 'clip-start': segment.clipStart, 'clip-end': segment.clipEnd },\n withStartHandle:\n !segment.clipStart && segment.hanging !== 'start' && segment.hanging !== 'both',\n withEndHandle:\n !segment.clipEnd && segment.hanging !== 'end' && segment.hanging !== 'both',\n style: {\n top: topValue,\n left: `calc(${segmentLeftPercent}% + 1px)`,\n width: `calc(${segmentWidthPercent}% - 2px)`,\n height: heightValue,\n },\n })\n );\n });\n\n const groupInfo = hasGroups ? resourceGroupMap[resourceIndex] : undefined;\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesMonthViewGroupColumn')}\n mod={{ 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-month-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box {...getStyles('resourcesMonthViewGroupColumnEmpty')} />\n )\n ) : null;\n\n return (\n <div {...getStyles('resourcesMonthViewRow')} key={resource.id}>\n {groupCell}\n <div\n {...getStyles('resourcesMonthViewResourceLabel')}\n data-has-groups={hasGroups || undefined}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </div>\n <div\n {...getStyles('resourcesMonthViewRowSlots')}\n onDragOver={\n withDragHandlers\n ? (e) => {\n const dayIndex = getDayIndexFromDragPoint(e, resourceIndex);\n if (dayIndex !== null && monthDays[dayIndex]) {\n dragDrop.handleDragOver(e, {\n day: monthDays[dayIndex],\n resourceId: resource.id,\n });\n }\n }\n : undefined\n }\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={\n withDragHandlers\n ? (e) => {\n const dayIndex = getDayIndexFromDragPoint(e, resourceIndex);\n if (dayIndex !== null && monthDays[dayIndex]) {\n dragDrop.handleDrop(e, {\n day: monthDays[dayIndex],\n resourceId: resource.id,\n });\n }\n }\n : undefined\n }\n >\n {eventNodes}\n {moreNodes}\n {cells}\n </div>\n </div>\n );\n });\n\n const content = (\n <Box\n mod={[\n {\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'event-interaction': eventResize.isResizing || dragDrop.dragContextValue.isDragging,\n resizing: eventResize.isResizing,\n },\n mod,\n ]}\n {...getStyles('resourcesMonthView')}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"month\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'month').startOf('month')),\n next: () => toDateString(dayjs(date).add(1, 'month').startOf('month')),\n today: () => {\n requestAnimationFrame(() => {\n scrollToDay(dayjs().format('YYYY-MM-DD'));\n });\n return toDateString(dayjs());\n },\n }}\n control={{\n monthYearSelect: {\n locale,\n yearValue: dayjs(date).get('year'),\n monthValue: dayjs(date).get('month'),\n onYearChange: (year) =>\n onDateChange?.(toDateString(dayjs(date).set('year', year).startOf('month'))),\n onMonthChange: (month) =>\n onDateChange?.(toDateString(dayjs(date).set('month', month).startOf('month'))),\n ...monthYearSelectProps,\n },\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={{ views: ['day', 'week', 'month'] as const, ...viewSelectProps }}\n stylesApiProps={stylesApiProps}\n />\n )}\n\n <Box {...getStyles('resourcesMonthViewRoot')}>\n <ScrollArea\n scrollbars=\"x\"\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesMonthViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n viewportRef={mergedViewportRef}\n >\n <div {...getStyles('resourcesMonthViewInner')}>\n <div {...getStyles('resourcesMonthViewDayLabelsRow')}>\n <div\n {...getStyles('resourcesMonthViewCorner')}\n key=\"corner\"\n ref={resourceLabelRef}\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n {dayLabels}\n </div>\n\n {rows}\n </div>\n </ScrollArea>\n </Box>\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nResourcesMonthView.displayName = '@mantine/schedule/ResourcesMonthView';\nResourcesMonthView.classes = classes;\nResourcesMonthView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgQA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,UAAU,WAAW,uBAAuB,EAC7D,oBAAoB;CAClB,iCAAiC,SAAS,UAAU,MAAM,IAAI,KAAA;CAC9D,oCAAoC,IAAI,QAAQ;CAChD,qCAAqC,IAAI,SAAS;CAClD,4CAA4C,IAAI,eAAe;AACjE,EACF,EACF;AAEA,MAAM,eAAe;CACnB,kBAAkB;CAClB,gBAAgB;CAChB,YAAY;CACZ,eAAe;CACf,iBAAiB;CACjB,uBAAuB;CACvB,oBAAoB;CACpB,iBAAiB;CACjB,MAAM;AACR;AAEA,SAAS,kBAAkB,GAAsB,GAA8B;CAC7E,MAAM,SAAS,MAAM,EAAE,KAAK;CAC5B,MAAM,SAAS,MAAM,EAAE,KAAK;CAC5B,MAAM,QAAQ,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,KAAK,OAAO,QAAQ,KAAK,GAAG,KAAK;CAC3E,MAAM,QAAQ,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,KAAK,OAAO,QAAQ,KAAK,GAAG,KAAK;CAE3E,IAAI,UAAU,OACZ,OAAO,QAAQ;CAGjB,OAAO,OAAO,QAAQ,IAAI,OAAO,QAAQ;AAC3C;AAEA,SAAS,qBAAqB,UAAuB,SAAgC;CACnF,KAAK,IAAI,MAAM,GAAG,MAAM,SAAS,OAAO,GACtC,IAAI,CAAC,SAAS,IAAI,G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hG,OAAO;AACT,CAAC;AAED,mBAAmB,cAAc;AACjC,mBAAmB,UAAUA;AAC7B,mBAAmB,eAAe"}
|
|
@@ -15,7 +15,9 @@ var ResourcesMonthView_module_default = {
|
|
|
15
15
|
"resourcesMonthViewGroupColumn": "m_1fc335a8",
|
|
16
16
|
"resourcesMonthViewGroupColumnEmpty": "m_d5a3a885",
|
|
17
17
|
"resourcesMonthViewRowSlots": "m_4be74668",
|
|
18
|
-
"resourcesMonthViewCell": "m_146709cf"
|
|
18
|
+
"resourcesMonthViewCell": "m_146709cf",
|
|
19
|
+
"resourcesMonthViewEventWrapper": "m_4a182c06",
|
|
20
|
+
"resourcesMonthViewResizeHandle": "m_4dcd6369"
|
|
19
21
|
};
|
|
20
22
|
//#endregion
|
|
21
23
|
export { ResourcesMonthView_module_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesMonthView.module.mjs","names":[],"sources":["../../../src/components/ResourcesMonthView/ResourcesMonthView.module.css"],"sourcesContent":[".resourcesMonthView {\n --resources-month-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-month-view-resource-label-width: 120px;\n --resources-month-view-day-width: 80px;\n --resources-month-view-row-height: 64px;\n --resources-month-view-group-label-width: 80px;\n\n @mixin where-light {\n --resources-month-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --resources-month-view-border-color: var(--mantine-color-dark-4);\n }\n}\n\n.resourcesMonthViewRoot {\n border: 1px solid var(--resources-month-view-border-color);\n border-radius: var(--resources-month-view-radius);\n overflow: hidden;\n max-width: fit-content;\n}\n\n.resourcesMonthViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesMonthViewInner {\n display: inline-flex;\n flex-direction: column;\n}\n\n.resourcesMonthViewDayLabelsRow {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-month-view-border-color);\n margin-bottom: -1px;\n}\n\n.resourcesMonthViewCorner {\n flex: 0 0 var(--resources-month-view-resource-label-width);\n min-width: var(--resources-month-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\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 user-select: none;\n background-color: var(--mantine-color-body);\n}\n\n.resourcesMonthViewDayLabel {\n flex: 0 0 var(--resources-month-view-day-width);\n min-width: var(--resources-month-view-day-width);\n max-width: var(--resources-month-view-day-width);\n height: 42px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-today]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n }\n}\n\n.resourcesMonthViewDayLabelWeekday {\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n text-transform: capitalize;\n line-height: 1;\n margin-bottom: 3px;\n}\n\n.resourcesMonthViewDayLabelNumber {\n font-weight: var(--mantine-font-weight-medium);\n font-size: 12px;\n line-height: 1;\n}\n\n.resourcesMonthViewRow {\n display: flex;\n border-top: 1px solid var(--resources-month-view-border-color);\n}\n\n.resourcesMonthViewResourceLabel {\n flex: 0 0 var(--resources-month-view-resource-label-width);\n min-width: var(--resources-month-view-resource-label-width);\n display: flex;\n align-items: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n\n &:where([data-has-groups]) {\n left: var(--resources-month-view-group-label-width);\n }\n}\n\n.resourcesMonthViewGroupColumn {\n flex: 0 0 var(--resources-month-view-group-label-width);\n min-width: var(--resources-month-view-group-label-width);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 6;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-month-view-row-height) + 1px);\n }\n}\n\n.resourcesMonthViewGroupColumnEmpty {\n flex: 0 0 var(--resources-month-view-group-label-width);\n min-width: var(--resources-month-view-group-label-width);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n}\n\n.resourcesMonthViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-month-view-row-height);\n}\n\n.resourcesMonthViewCell {\n flex: 0 0 var(--resources-month-view-day-width);\n min-width: var(--resources-month-view-day-width);\n max-width: var(--resources-month-view-day-width);\n min-height: var(--resources-month-view-row-height);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n cursor: pointer;\n position: relative;\n overflow: hidden;\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n @mixin hover {\n &:where(:not([data-static])) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n\n &:where([data-weekend]) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-8);\n }\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.resourcesMonthView:where([data-event-interaction]) .resourcesMonthViewCell {\n pointer-events: none;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ResourcesMonthView.module.mjs","names":[],"sources":["../../../src/components/ResourcesMonthView/ResourcesMonthView.module.css"],"sourcesContent":[".resourcesMonthView {\n --resources-month-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-month-view-resource-label-width: 120px;\n --resources-month-view-day-width: 80px;\n --resources-month-view-row-height: 64px;\n --resources-month-view-group-label-width: 80px;\n\n @mixin where-light {\n --resources-month-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --resources-month-view-border-color: var(--mantine-color-dark-4);\n }\n}\n\n.resourcesMonthViewRoot {\n border: 1px solid var(--resources-month-view-border-color);\n border-radius: var(--resources-month-view-radius);\n overflow: hidden;\n max-width: fit-content;\n}\n\n.resourcesMonthViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesMonthViewInner {\n display: inline-flex;\n flex-direction: column;\n}\n\n.resourcesMonthViewDayLabelsRow {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-month-view-border-color);\n margin-bottom: -1px;\n}\n\n.resourcesMonthViewCorner {\n flex: 0 0 var(--resources-month-view-resource-label-width);\n min-width: var(--resources-month-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\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 user-select: none;\n background-color: var(--mantine-color-body);\n}\n\n.resourcesMonthViewDayLabel {\n flex: 0 0 var(--resources-month-view-day-width);\n min-width: var(--resources-month-view-day-width);\n max-width: var(--resources-month-view-day-width);\n height: 42px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-today]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n }\n}\n\n.resourcesMonthViewDayLabelWeekday {\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n text-transform: capitalize;\n line-height: 1;\n margin-bottom: 3px;\n}\n\n.resourcesMonthViewDayLabelNumber {\n font-weight: var(--mantine-font-weight-medium);\n font-size: 12px;\n line-height: 1;\n}\n\n.resourcesMonthViewRow {\n display: flex;\n border-top: 1px solid var(--resources-month-view-border-color);\n}\n\n.resourcesMonthViewResourceLabel {\n flex: 0 0 var(--resources-month-view-resource-label-width);\n min-width: var(--resources-month-view-resource-label-width);\n display: flex;\n align-items: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n\n &:where([data-has-groups]) {\n left: var(--resources-month-view-group-label-width);\n }\n}\n\n.resourcesMonthViewGroupColumn {\n flex: 0 0 var(--resources-month-view-group-label-width);\n min-width: var(--resources-month-view-group-label-width);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 6;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-month-view-row-height) + 1px);\n }\n}\n\n.resourcesMonthViewGroupColumnEmpty {\n flex: 0 0 var(--resources-month-view-group-label-width);\n min-width: var(--resources-month-view-group-label-width);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n}\n\n.resourcesMonthViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-month-view-row-height);\n}\n\n.resourcesMonthViewCell {\n flex: 0 0 var(--resources-month-view-day-width);\n min-width: var(--resources-month-view-day-width);\n max-width: var(--resources-month-view-day-width);\n min-height: var(--resources-month-view-row-height);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n cursor: pointer;\n position: relative;\n overflow: hidden;\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n @mixin hover {\n &:where(:not([data-static])) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n\n &:where([data-weekend]) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-8);\n }\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.resourcesMonthView:where([data-event-interaction]) .resourcesMonthViewCell {\n pointer-events: none;\n}\n\n.resourcesMonthViewEventWrapper {\n &:hover .resourcesMonthViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesMonthViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesMonthViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesMonthViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesMonthViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n touch-action: none;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='start']) {\n inset-inline-start: -2px;\n }\n\n &:where([data-edge='end']) {\n inset-inline-end: -2px;\n }\n}\n\n.resourcesMonthView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesMonthViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesMonthViewResizeHandle {\n opacity: 0;\n }\n }\n}\n"],"mappings":""}
|
|
@@ -85,6 +85,9 @@ const ResourcesSchedule = factory((_props) => {
|
|
|
85
85
|
case "month": return /* @__PURE__ */ jsx(ResourcesMonthView, {
|
|
86
86
|
...commonProps,
|
|
87
87
|
onDayClick,
|
|
88
|
+
withEventResize: mode === "static" ? false : withEventResize,
|
|
89
|
+
onEventResize,
|
|
90
|
+
canResizeEvent,
|
|
88
91
|
...monthViewProps
|
|
89
92
|
});
|
|
90
93
|
default: return null;
|