@mantine/schedule 9.4.3-alpha.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.
Files changed (61) hide show
  1. package/cjs/components/ResourcesMonthView/ResourcesMonthView.cjs +105 -35
  2. package/cjs/components/ResourcesMonthView/ResourcesMonthView.cjs.map +1 -1
  3. package/cjs/components/ResourcesMonthView/ResourcesMonthView.module.cjs +3 -1
  4. package/cjs/components/ResourcesMonthView/ResourcesMonthView.module.cjs.map +1 -1
  5. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs +3 -0
  6. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs.map +1 -1
  7. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +2 -1
  8. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
  9. package/cjs/components/ScheduleHeader/HeaderControl/HeaderControl.cjs +4 -2
  10. package/cjs/components/ScheduleHeader/HeaderControl/HeaderControl.cjs.map +1 -1
  11. package/cjs/components/YearView/YearView.cjs +23 -4
  12. package/cjs/components/YearView/YearView.cjs.map +1 -1
  13. package/cjs/components/YearView/YearView.module.cjs.map +1 -1
  14. package/cjs/components/YearView/YearViewMonth.cjs +18 -6
  15. package/cjs/components/YearView/YearViewMonth.cjs.map +1 -1
  16. package/cjs/components/YearView/get-visible-week-days.cjs +24 -0
  17. package/cjs/components/YearView/get-visible-week-days.cjs.map +1 -0
  18. package/cjs/hooks/use-day-grid-event-resize.cjs +119 -0
  19. package/cjs/hooks/use-day-grid-event-resize.cjs.map +1 -0
  20. package/cjs/hooks/use-event-resize.cjs +7 -3
  21. package/cjs/hooks/use-event-resize.cjs.map +1 -1
  22. package/cjs/hooks/use-horizontal-event-resize.cjs +8 -4
  23. package/cjs/hooks/use-horizontal-event-resize.cjs.map +1 -1
  24. package/cjs/utils/calculate-month-resize-dates/calculate-month-resize-dates.cjs +39 -0
  25. package/cjs/utils/calculate-month-resize-dates/calculate-month-resize-dates.cjs.map +1 -0
  26. package/cjs/utils/expand-recurring-events/expand-recurring-events.cjs +1 -0
  27. package/esm/components/ResourcesMonthView/ResourcesMonthView.mjs +106 -36
  28. package/esm/components/ResourcesMonthView/ResourcesMonthView.mjs.map +1 -1
  29. package/esm/components/ResourcesMonthView/ResourcesMonthView.module.mjs +3 -1
  30. package/esm/components/ResourcesMonthView/ResourcesMonthView.module.mjs.map +1 -1
  31. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs +3 -0
  32. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs.map +1 -1
  33. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +2 -1
  34. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
  35. package/esm/components/ScheduleHeader/HeaderControl/HeaderControl.mjs +4 -2
  36. package/esm/components/ScheduleHeader/HeaderControl/HeaderControl.mjs.map +1 -1
  37. package/esm/components/YearView/YearView.mjs +23 -4
  38. package/esm/components/YearView/YearView.mjs.map +1 -1
  39. package/esm/components/YearView/YearView.module.mjs.map +1 -1
  40. package/esm/components/YearView/YearViewMonth.mjs +18 -6
  41. package/esm/components/YearView/YearViewMonth.mjs.map +1 -1
  42. package/esm/components/YearView/get-visible-week-days.mjs +21 -0
  43. package/esm/components/YearView/get-visible-week-days.mjs.map +1 -0
  44. package/esm/hooks/use-day-grid-event-resize.mjs +117 -0
  45. package/esm/hooks/use-day-grid-event-resize.mjs.map +1 -0
  46. package/esm/hooks/use-event-resize.mjs +7 -3
  47. package/esm/hooks/use-event-resize.mjs.map +1 -1
  48. package/esm/hooks/use-horizontal-event-resize.mjs +8 -4
  49. package/esm/hooks/use-horizontal-event-resize.mjs.map +1 -1
  50. package/esm/utils/calculate-month-resize-dates/calculate-month-resize-dates.mjs +37 -0
  51. package/esm/utils/calculate-month-resize-dates/calculate-month-resize-dates.mjs.map +1 -0
  52. package/esm/utils/expand-recurring-events/expand-recurring-events.mjs +1 -1
  53. package/lib/components/ResourcesMonthView/ResourcesMonthView.d.ts +12 -1
  54. package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +1 -1
  55. package/lib/components/YearView/YearViewMonth.d.ts +3 -1
  56. package/lib/components/YearView/get-visible-week-days.d.ts +19 -0
  57. package/lib/hooks/use-day-grid-event-resize.d.ts +35 -0
  58. package/lib/utils/calculate-month-resize-dates/calculate-month-resize-dates.d.ts +17 -0
  59. package/package.json +4 -4
  60. package/styles.css +63 -2
  61. package/styles.layer.css +63 -2
@@ -14,6 +14,7 @@ const require_DragContext = require("../DragContext/DragContext.cjs");
14
14
  const require_ScheduleEvent = require("../ScheduleEvent/ScheduleEvent.cjs");
15
15
  const require_MoreEvents = require("../MoreEvents/MoreEvents.cjs");
16
16
  const require_ScheduleHeaderBase = require("../ScheduleHeader/ScheduleHeaderBase.cjs");
17
+ const require_use_day_grid_event_resize = require("../../hooks/use-day-grid-event-resize.cjs");
17
18
  const require_ResourcesMonthView_module = require("./ResourcesMonthView.module.cjs");
18
19
  let dayjs = require("dayjs");
19
20
  dayjs = require_runtime.__toESM(dayjs);
@@ -37,6 +38,7 @@ const defaultProps = {
37
38
  withWeekendDays: true,
38
39
  withEventsDragAndDrop: false,
39
40
  withDragSlotSelect: false,
41
+ withEventResize: false,
40
42
  mode: "default"
41
43
  };
42
44
  function compareCellEvents(a, b) {
@@ -56,7 +58,7 @@ function isMultiDayEvent(event) {
56
58
  }
57
59
  const ResourcesMonthView = (0, _mantine_core.factory)((_props) => {
58
60
  const props = (0, _mantine_core.useProps)("ResourcesMonthView", defaultProps, _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, onEventClick, withDragSlotSelect, onSlotDragEnd, labels, mode, scrollAreaProps, onExternalEventDrop, maxEventsPerTimeSlot: _maxEventsPerTimeSlot, moreEventsProps, recurrenceExpansionLimit, ...others } = props;
61
+ 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;
60
62
  const maxEventsPerTimeSlot = Math.min(10, Math.max(1, _maxEventsPerTimeSlot ?? 2));
61
63
  const getStyles = (0, _mantine_core.useStyles)({
62
64
  name: __staticSelector,
@@ -84,6 +86,7 @@ const ResourcesMonthView = (0, _mantine_core.factory)((_props) => {
84
86
  __staticSelector,
85
87
  radius
86
88
  };
89
+ const theme = (0, _mantine_core.useMantineTheme)();
87
90
  const ctx = (0, _mantine_dates.useDatesContext)();
88
91
  const resolvedWeekendDays = ctx.getWeekendDays(weekendDays);
89
92
  const { orderedResources, groupRanges, resourceGroupMap } = (0, react.useMemo)(() => require_get_ordered_resources.getOrderedResources(resources, groups), [resources, groups]);
@@ -136,13 +139,34 @@ const ResourcesMonthView = (0, _mantine_core.factory)((_props) => {
136
139
  date,
137
140
  recurrenceExpansionLimit
138
141
  ]);
142
+ const monthDaySet = (0, react.useMemo)(() => new Set(monthDays), [monthDays]);
143
+ const eventResize = require_use_day_grid_event_resize.useDayGridEventResize({
144
+ enabled: withEventResize,
145
+ mode,
146
+ onEventResize,
147
+ canResizeEvent
148
+ });
149
+ const { resizingEventId, previewStart, previewEnd } = eventResize;
150
+ const layoutEvents = (0, react.useMemo)(() => {
151
+ if (resizingEventId === null || previewStart === null || previewEnd === null) return expandedEvents;
152
+ return expandedEvents.map((event) => event.id === resizingEventId ? {
153
+ ...event,
154
+ start: previewStart,
155
+ end: previewEnd
156
+ } : event);
157
+ }, [
158
+ expandedEvents,
159
+ resizingEventId,
160
+ previewStart,
161
+ previewEnd
162
+ ]);
139
163
  const { eventsByResourceAndDay, eventLayoutByResource } = (0, react.useMemo)(() => {
140
164
  const eventsByResourceAndDay = {};
141
165
  for (const resource of resources) {
142
166
  eventsByResourceAndDay[resource.id] = {};
143
167
  for (const day of monthDays) eventsByResourceAndDay[resource.id][day] = [];
144
168
  }
145
- if (expandedEvents) for (const event of expandedEvents) {
169
+ if (layoutEvents) for (const event of layoutEvents) {
146
170
  if (event.resourceId === void 0 || !(event.resourceId in eventsByResourceAndDay)) continue;
147
171
  const eventStart = (0, dayjs.default)(event.start);
148
172
  const eventEnd = (0, dayjs.default)(event.end);
@@ -257,7 +281,7 @@ const ResourcesMonthView = (0, _mantine_core.factory)((_props) => {
257
281
  }, [
258
282
  resources,
259
283
  monthDays,
260
- expandedEvents,
284
+ layoutEvents,
261
285
  maxEventsPerTimeSlot
262
286
  ]);
263
287
  const handleExternalDrop = (0, react.useCallback)((e, target) => {
@@ -348,8 +372,69 @@ const ResourcesMonthView = (0, _mantine_core.factory)((_props) => {
348
372
  cellsRef.current[nextResourceIndex]?.[nextDayIndex]?.focus();
349
373
  };
350
374
  const rowHeightPercent = 100 / maxEventsPerTimeSlot;
375
+ const renderEventNode = ({ key, event, resourceIndex, style, hanging, eventMod, withStartHandle, withEndHandle }) => {
376
+ const isResizable = eventResize.isResizableEvent(event);
377
+ const isThisEventResizing = eventResize.resizingEventId === event.id;
378
+ const eventEnd = (0, dayjs.default)(event.end);
379
+ const lastDay = (eventEnd.hour() === 0 && eventEnd.minute() === 0 && eventEnd.second() === 0 ? eventEnd.subtract(1, "day") : eventEnd).format("YYYY-MM-DD");
380
+ const showStartHandle = withStartHandle && monthDaySet.has((0, dayjs.default)(event.start).format("YYYY-MM-DD"));
381
+ const showEndHandle = withEndHandle && monthDaySet.has(lastDay);
382
+ const eventColors = isResizable ? theme.variantColorResolver({
383
+ color: event.color || theme.primaryColor,
384
+ theme,
385
+ variant: event.variant || "light",
386
+ autoContrast: true
387
+ }) : null;
388
+ const getHandleProps = (edge) => ({
389
+ ...getStyles("resourcesMonthViewResizeHandle"),
390
+ "data-edge": edge,
391
+ "data-active": isThisEventResizing && eventResize.resizingEdge === edge || void 0,
392
+ onPointerDown: (e) => eventResize.handleResizeStart({
393
+ event,
394
+ edge,
395
+ cells: cellsRef.current[resourceIndex] ?? [],
396
+ days: monthDays,
397
+ pointerEvent: e
398
+ })
399
+ });
400
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, {
401
+ ...getStyles("resourcesMonthViewEventWrapper", { style: {
402
+ position: "absolute",
403
+ zIndex: 3,
404
+ ...style
405
+ } }),
406
+ __vars: eventColors ? { "--event-color": eventColors.color } : void 0,
407
+ "data-resizing": isThisEventResizing || void 0,
408
+ children: [
409
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScheduleEvent.ScheduleEvent, {
410
+ event,
411
+ nowrap: true,
412
+ autoSize: true,
413
+ size: "sm",
414
+ hanging,
415
+ mod: eventMod,
416
+ draggable: dragDrop.isDraggableEvent(event),
417
+ isResizing: isThisEventResizing,
418
+ renderEventBody,
419
+ renderEvent,
420
+ radius,
421
+ mode,
422
+ onClick: onEventClick ? (e) => {
423
+ if (!eventResize.wasResizing()) onEventClick(event, e);
424
+ } : void 0,
425
+ style: {
426
+ width: "100%",
427
+ height: "100%"
428
+ }
429
+ }),
430
+ isResizable && showStartHandle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ...getHandleProps("start") }),
431
+ isResizable && showEndHandle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ...getHandleProps("end") })
432
+ ]
433
+ }, key);
434
+ };
351
435
  const rows = orderedResources.map((resource, resourceIndex) => {
352
436
  if (!cellsRef.current[resourceIndex]) cellsRef.current[resourceIndex] = [];
437
+ cellsRef.current[resourceIndex].length = monthDays.length;
353
438
  const slotGroup = String(resource.id);
354
439
  const dropTarget = dragDrop.dropTarget;
355
440
  const totalDays = monthDays.length;
@@ -370,29 +455,21 @@ const ResourcesMonthView = (0, _mantine_core.factory)((_props) => {
370
455
  const hasHiddenEvents = hiddenEventsCount > 0 && mode !== "static";
371
456
  visibleEvents.forEach(({ event, row }) => {
372
457
  if (isMultiDayEvent(event)) return;
373
- const isDraggable = dragDrop.isDraggableEvent(event);
374
458
  const topValue = hasHiddenEvents ? `calc((100% - 18px) * ${row} / ${maxEventsPerTimeSlot} + 1px)` : `calc(${row * rowHeightPercent}% + 1px)`;
375
459
  const heightValue = hasHiddenEvents ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)` : `calc(${rowHeightPercent}% - 2px)`;
376
- eventNodes.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScheduleEvent.ScheduleEvent, {
460
+ eventNodes.push(renderEventNode({
461
+ key: `${event.id}-${day}`,
377
462
  event,
378
- nowrap: true,
379
- autoSize: true,
380
- size: "sm",
381
- draggable: isDraggable,
382
- renderEventBody,
383
- renderEvent,
384
- radius,
385
- mode,
386
- onClick: onEventClick ? (e) => onEventClick(event, e) : void 0,
463
+ resourceIndex,
464
+ withStartHandle: true,
465
+ withEndHandle: true,
387
466
  style: {
388
- position: "absolute",
389
467
  top: topValue,
390
468
  left: `calc(${dayLeftPercent}% + 1px)`,
391
469
  width: `calc(${dayWidthPercent}% - 2px)`,
392
- height: heightValue,
393
- zIndex: 3
470
+ height: heightValue
394
471
  }
395
- }, `${event.id}-${day}`));
472
+ }));
396
473
  });
397
474
  if (hiddenEventsCount > 0 && mode !== "static") moreNodes.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MoreEvents.MoreEvents, {
398
475
  events: dayEvents,
@@ -442,37 +519,29 @@ const ResourcesMonthView = (0, _mantine_core.factory)((_props) => {
442
519
  }, day);
443
520
  });
444
521
  (eventLayoutByResource[resource.id]?.segments ?? []).forEach((segment) => {
445
- const isDraggable = dragDrop.isDraggableEvent(segment.event);
446
522
  const segmentLeftPercent = segment.startDayIndex / totalDays * 100;
447
523
  const segmentWidthPercent = (segment.endDayIndex - segment.startDayIndex + 1) / totalDays * 100;
448
524
  const compressed = segment.hiddenInSpan && mode !== "static";
449
525
  const topValue = compressed ? `calc((100% - 18px) * ${segment.row} / ${maxEventsPerTimeSlot} + 1px)` : `calc(${segment.row * rowHeightPercent}% + 1px)`;
450
526
  const heightValue = compressed ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)` : `calc(${rowHeightPercent}% - 2px)`;
451
- eventNodes.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScheduleEvent.ScheduleEvent, {
527
+ eventNodes.push(renderEventNode({
528
+ key: `${segment.event.id}-segment-${segment.startDayIndex}`,
452
529
  event: segment.event,
453
- nowrap: true,
454
- autoSize: true,
455
- size: "sm",
530
+ resourceIndex,
456
531
  hanging: segment.hanging,
457
- draggable: isDraggable,
458
- renderEventBody,
459
- renderEvent,
460
- radius,
461
- mode,
462
- mod: {
532
+ eventMod: {
463
533
  "clip-start": segment.clipStart,
464
534
  "clip-end": segment.clipEnd
465
535
  },
466
- onClick: onEventClick ? (e) => onEventClick(segment.event, e) : void 0,
536
+ withStartHandle: !segment.clipStart && segment.hanging !== "start" && segment.hanging !== "both",
537
+ withEndHandle: !segment.clipEnd && segment.hanging !== "end" && segment.hanging !== "both",
467
538
  style: {
468
- position: "absolute",
469
539
  top: topValue,
470
540
  left: `calc(${segmentLeftPercent}% + 1px)`,
471
541
  width: `calc(${segmentWidthPercent}% - 2px)`,
472
- height: heightValue,
473
- zIndex: 3
542
+ height: heightValue
474
543
  }
475
- }, `${segment.event.id}-segment-${segment.startDayIndex}`));
544
+ }));
476
545
  });
477
546
  const groupInfo = hasGroups ? resourceGroupMap[resourceIndex] : void 0;
478
547
  const isGroupStart = groupInfo?.position === "first" || groupInfo?.position === "only";
@@ -519,7 +588,8 @@ const ResourcesMonthView = (0, _mantine_core.factory)((_props) => {
519
588
  mod: [{
520
589
  static: mode === "static",
521
590
  "slot-dragging": slotDragSelect.isDragging,
522
- "event-interaction": dragDrop.dragContextValue.isDragging
591
+ "event-interaction": eventResize.isResizing || dragDrop.dragContextValue.isDragging,
592
+ resizing: eventResize.isResizing
523
593
  }, mod],
524
594
  ...getStyles("resourcesMonthView"),
525
595
  ...others,
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesMonthView.cjs","names":["getOrderedResources","expandRecurringEvents","useDragDropHandlers","calculateMonthDropDate","getGroupToResourceIdMap","useSlotDragSelect","Box","formatDate","getIndexFromDragPoint","ScheduleEvent","MoreEvents","UnstyledButton","ScheduleHeaderBase","toDateString","ScrollArea","getLabel","DragContext","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,gBAAA,GAAA,cAAA,mBAAA,EACH,QAAQ,EAAE,QAAQ,UAAU,WAAW,uBAAuB,EAC7D,oBAAoB;CAClB,iCAAiC,UAAA,GAAA,cAAA,UAAA,CAAmB,MAAM,IAAI,KAAA;CAC9D,qCAAA,GAAA,cAAA,IAAA,CAAwC,QAAQ;CAChD,sCAAA,GAAA,cAAA,IAAA,CAAyC,SAAS;CAClD,6CAAA,GAAA,cAAA,IAAA,CAAgD,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,UAAA,GAAA,MAAA,QAAA,CAAe,EAAE,KAAK;CAC5B,MAAM,UAAA,GAAA,MAAA,QAAA,CAAe,EAAE,KAAK;CAC5B,MAAM,SAAA,GAAA,MAAA,QAAA,CAAc,EAAE,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,KAAK,OAAO,QAAQ,KAAK,GAAG,KAAK;CAC3E,MAAM,SAAA,GAAA,MAAA,QAAA,CAAc,EAAE,GAAG,CAAC,CAAC,QAAQ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F,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,YAAY,UAAb;EAAsB,OAAO,SAAS;YAAmB;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,mBAAmB,cAAc;AACjC,mBAAmB,UAAUC,kCAAAA;AAC7B,mBAAmB,eAAe"}
1
+ {"version":3,"file":"ResourcesMonthView.cjs","names":["getOrderedResources","expandRecurringEvents","useDayGridEventResize","useDragDropHandlers","calculateMonthDropDate","getGroupToResourceIdMap","useSlotDragSelect","Box","formatDate","getIndexFromDragPoint","ScheduleEvent","MoreEvents","UnstyledButton","ScheduleHeaderBase","toDateString","ScrollArea","getLabel","DragContext","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,gBAAA,GAAA,cAAA,mBAAA,EACH,QAAQ,EAAE,QAAQ,UAAU,WAAW,uBAAuB,EAC7D,oBAAoB;CAClB,iCAAiC,UAAA,GAAA,cAAA,UAAA,CAAmB,MAAM,IAAI,KAAA;CAC9D,qCAAA,GAAA,cAAA,IAAA,CAAwC,QAAQ;CAChD,sCAAA,GAAA,cAAA,IAAA,CAAyC,SAAS;CAClD,6CAAA,GAAA,cAAA,IAAA,CAAgD,eAAe;AACjE,EACF,EACF;AAEA,MAAM,eAAe;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IAAA,CAACC,oBAAAA,YAAY,UAAb;EAAsB,OAAO,SAAS;YAAmB;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,mBAAmB,cAAc;AACjC,mBAAmB,UAAUC,kCAAAA;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
  exports.default = ResourcesMonthView_module_default;
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesMonthView.module.cjs","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.cjs","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 = (0, _mantine_core.factory)((_props) => {
85
85
  case "month": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ResourcesMonthView.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;