@mantine/schedule 9.5.2 → 9.6.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 (208) hide show
  1. package/cjs/_virtual/_rolldown/runtime.cjs +1 -1
  2. package/cjs/components/AgendaView/AgendaView.cjs +7 -6
  3. package/cjs/components/AgendaView/AgendaView.cjs.map +1 -1
  4. package/cjs/components/AgendaView/get-agenda-view-events.cjs.map +1 -1
  5. package/cjs/components/CurrentTimeIndicator/CurrentTimeIndicator.cjs +3 -2
  6. package/cjs/components/CurrentTimeIndicator/CurrentTimeIndicator.cjs.map +1 -1
  7. package/cjs/components/DayView/DayView.cjs +144 -78
  8. package/cjs/components/DayView/DayView.cjs.map +1 -1
  9. package/cjs/components/DayView/DayView.module.cjs +2 -1
  10. package/cjs/components/DayView/DayView.module.cjs.map +1 -1
  11. package/cjs/components/DayView/get-day-view-events/get-day-view-events.cjs.map +1 -1
  12. package/cjs/components/DragContext/DragContext.cjs.map +1 -1
  13. package/cjs/components/MobileMonthView/MobileMonthView.cjs +7 -6
  14. package/cjs/components/MobileMonthView/MobileMonthView.cjs.map +1 -1
  15. package/cjs/components/MobileMonthView/get-mobile-month-view-events.cjs.map +1 -1
  16. package/cjs/components/MonthView/MonthView.cjs +24 -34
  17. package/cjs/components/MonthView/MonthView.cjs.map +1 -1
  18. package/cjs/components/MonthView/MonthView.module.cjs.map +1 -1
  19. package/cjs/components/MonthView/get-month-view-events/find-available-row.cjs.map +1 -1
  20. package/cjs/components/MonthView/get-month-view-events/get-month-positioned-events.cjs +4 -2
  21. package/cjs/components/MonthView/get-month-view-events/get-month-positioned-events.cjs.map +1 -1
  22. package/cjs/components/MonthView/get-month-view-events/get-month-view-events.cjs.map +1 -1
  23. package/cjs/components/MonthView/get-month-view-events/get-weeks-in-range.cjs +3 -2
  24. package/cjs/components/MonthView/get-month-view-events/get-weeks-in-range.cjs.map +1 -1
  25. package/cjs/components/MonthView/get-renderable-month-event-segments.cjs +1 -1
  26. package/cjs/components/MonthView/get-renderable-month-event-segments.cjs.map +1 -1
  27. package/cjs/components/MoreEvents/MoreEvents.cjs.map +1 -1
  28. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +136 -52
  29. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
  30. package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs +2 -1
  31. package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs.map +1 -1
  32. package/cjs/components/ResourcesDayView/ResourcesDayViewColumn.cjs.map +1 -1
  33. package/cjs/components/ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events.cjs.map +1 -1
  34. package/cjs/components/ResourcesMonthView/ResourcesMonthView.cjs.map +1 -1
  35. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs +3 -1
  36. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs.map +1 -1
  37. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +150 -59
  38. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
  39. package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs +2 -1
  40. package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs.map +1 -1
  41. package/cjs/components/ResourcesWeekView/ResourcesWeekViewRow.cjs.map +1 -1
  42. package/cjs/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.cjs +6 -3
  43. package/cjs/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.cjs.map +1 -1
  44. package/cjs/components/Schedule/Schedule.cjs +4 -1
  45. package/cjs/components/Schedule/Schedule.cjs.map +1 -1
  46. package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs +53 -0
  47. package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs.map +1 -0
  48. package/cjs/components/ScheduleEvent/ScheduleEvent.cjs.map +1 -1
  49. package/cjs/components/ScheduleHeader/HeaderControl/HeaderControl.cjs +15 -14
  50. package/cjs/components/ScheduleHeader/HeaderControl/HeaderControl.cjs.map +1 -1
  51. package/cjs/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.cjs.map +1 -1
  52. package/cjs/components/ScheduleHeader/ScheduleHeader.cjs.map +1 -1
  53. package/cjs/components/ScheduleHeader/ScheduleHeaderBase.cjs.map +1 -1
  54. package/cjs/components/ScheduleHeader/ScheduleHeaderContext.cjs.map +1 -1
  55. package/cjs/components/ScheduleHeader/ViewSelect/ViewSelect.cjs.map +1 -1
  56. package/cjs/components/WeekView/WeekView.cjs +159 -82
  57. package/cjs/components/WeekView/WeekView.cjs.map +1 -1
  58. package/cjs/components/WeekView/WeekView.module.cjs +2 -1
  59. package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
  60. package/cjs/components/WeekView/WeekViewDay.cjs.map +1 -1
  61. package/cjs/components/WeekView/get-week-label/get-week-label.cjs.map +1 -1
  62. package/cjs/components/WeekView/get-week-view-events/calculate-all-day-event-offset.cjs.map +1 -1
  63. package/cjs/components/WeekView/get-week-view-events/calculate-all-day-event-width.cjs.map +1 -1
  64. package/cjs/components/WeekView/get-week-view-events/calculate-event-days.cjs.map +1 -1
  65. package/cjs/components/WeekView/get-week-view-events/get-event-end-date.cjs.map +1 -1
  66. package/cjs/components/WeekView/get-week-view-events/get-hanging-status.cjs.map +1 -1
  67. package/cjs/components/WeekView/get-week-view-events/get-week-positioned-events.cjs.map +1 -1
  68. package/cjs/components/YearView/YearView.cjs +7 -6
  69. package/cjs/components/YearView/YearView.cjs.map +1 -1
  70. package/cjs/components/YearView/YearViewMonth.cjs.map +1 -1
  71. package/cjs/components/YearView/get-visible-week-days.cjs.map +1 -1
  72. package/cjs/components/YearView/get-year-view-events/get-year-view-events.cjs.map +1 -1
  73. package/cjs/hooks/use-auto-scroll-on-drag.cjs.map +1 -1
  74. package/cjs/hooks/use-day-grid-event-resize.cjs.map +1 -1
  75. package/cjs/hooks/use-drag-drop-handlers.cjs +13 -2
  76. package/cjs/hooks/use-drag-drop-handlers.cjs.map +1 -1
  77. package/cjs/hooks/use-drag-state.cjs.map +1 -1
  78. package/cjs/hooks/use-event-resize.cjs +30 -15
  79. package/cjs/hooks/use-event-resize.cjs.map +1 -1
  80. package/cjs/hooks/use-horizontal-event-resize.cjs +30 -15
  81. package/cjs/hooks/use-horizontal-event-resize.cjs.map +1 -1
  82. package/cjs/hooks/use-slot-drag-select.cjs.map +1 -1
  83. package/cjs/index.cjs +2 -0
  84. package/cjs/utils/calculate-drop-time/calculate-drop-time.cjs +25 -4
  85. package/cjs/utils/calculate-drop-time/calculate-drop-time.cjs.map +1 -1
  86. package/cjs/utils/calculate-month-drop-date/calculate-month-drop-date.cjs.map +1 -1
  87. package/cjs/utils/calculate-month-resize-dates/calculate-month-resize-dates.cjs.map +1 -1
  88. package/cjs/utils/expand-recurring-events/expand-recurring-events.cjs.map +1 -1
  89. package/cjs/utils/format-date/format-date.cjs.map +1 -1
  90. package/cjs/utils/get-current-time-position/get-current-time-position.cjs.map +1 -1
  91. package/cjs/utils/get-day-position/get-day-position.cjs.map +1 -1
  92. package/cjs/utils/get-end-of-week/get-end-of-week.cjs.map +1 -1
  93. package/cjs/utils/get-month-days/get-month-days.cjs +4 -2
  94. package/cjs/utils/get-month-days/get-month-days.cjs.map +1 -1
  95. package/cjs/utils/get-month-range/get-month-range.cjs.map +1 -1
  96. package/cjs/utils/get-months-by-quarter/get-months-by-quarter.cjs.map +1 -1
  97. package/cjs/utils/get-months-list/get-months-list.cjs.map +1 -1
  98. package/cjs/utils/get-start-of-week/get-start-of-week.cjs.map +1 -1
  99. package/cjs/utils/get-week-days/get-week-days.cjs.map +1 -1
  100. package/cjs/utils/get-week-number/get-week-number.cjs +4 -1
  101. package/cjs/utils/get-week-number/get-week-number.cjs.map +1 -1
  102. package/cjs/utils/get-weekdays-names/get-weekdays-names.cjs.map +1 -1
  103. package/cjs/utils/is-after-min-date/is-after-min-date.cjs.map +1 -1
  104. package/cjs/utils/is-all-day-event/is-all-day-event.cjs.map +1 -1
  105. package/cjs/utils/is-before-max-date/is-before-max-date.cjs.map +1 -1
  106. package/cjs/utils/is-event-in-time-range/is-event-in-time-range.cjs.map +1 -1
  107. package/cjs/utils/is-events-overlap/is-events-overlap.cjs.map +1 -1
  108. package/cjs/utils/is-in-time-range/is-in-time-range.cjs.map +1 -1
  109. package/cjs/utils/is-multiday-event/is-multiday-event.cjs.map +1 -1
  110. package/cjs/utils/is-same-month/is-same-month.cjs.map +1 -1
  111. package/cjs/utils/is-within-week/is-within-week.cjs.map +1 -1
  112. package/cjs/utils/next-week/next-week.cjs.map +1 -1
  113. package/cjs/utils/previous-week/previous-week.cjs.map +1 -1
  114. package/cjs/utils/sort-events/sort-events.cjs.map +1 -1
  115. package/cjs/utils/to-date-string/to-date-string.cjs.map +1 -1
  116. package/cjs/utils/validate-event/validate-event.cjs.map +1 -1
  117. package/esm/components/AgendaView/AgendaView.mjs +7 -6
  118. package/esm/components/AgendaView/AgendaView.mjs.map +1 -1
  119. package/esm/components/CurrentTimeIndicator/CurrentTimeIndicator.mjs +4 -3
  120. package/esm/components/CurrentTimeIndicator/CurrentTimeIndicator.mjs.map +1 -1
  121. package/esm/components/DayView/DayView.mjs +145 -79
  122. package/esm/components/DayView/DayView.mjs.map +1 -1
  123. package/esm/components/DayView/DayView.module.mjs +2 -1
  124. package/esm/components/DayView/DayView.module.mjs.map +1 -1
  125. package/esm/components/MobileMonthView/MobileMonthView.mjs +7 -6
  126. package/esm/components/MobileMonthView/MobileMonthView.mjs.map +1 -1
  127. package/esm/components/MonthView/MonthView.mjs +25 -35
  128. package/esm/components/MonthView/MonthView.mjs.map +1 -1
  129. package/esm/components/MonthView/MonthView.module.mjs.map +1 -1
  130. package/esm/components/MonthView/get-month-view-events/get-month-positioned-events.mjs +4 -2
  131. package/esm/components/MonthView/get-month-view-events/get-month-positioned-events.mjs.map +1 -1
  132. package/esm/components/MonthView/get-month-view-events/get-weeks-in-range.mjs +3 -2
  133. package/esm/components/MonthView/get-month-view-events/get-weeks-in-range.mjs.map +1 -1
  134. package/esm/components/MonthView/get-renderable-month-event-segments.mjs +1 -1
  135. package/esm/components/MonthView/get-renderable-month-event-segments.mjs.map +1 -1
  136. package/esm/components/MoreEvents/MoreEvents.mjs.map +1 -1
  137. package/esm/components/ResourcesDayView/ResourcesDayView.mjs +138 -54
  138. package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
  139. package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs +2 -1
  140. package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs.map +1 -1
  141. package/esm/components/ResourcesDayView/ResourcesDayViewColumn.mjs.map +1 -1
  142. package/esm/components/ResourcesMonthView/ResourcesMonthView.mjs.map +1 -1
  143. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs +3 -1
  144. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs.map +1 -1
  145. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +152 -61
  146. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
  147. package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs +2 -1
  148. package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs.map +1 -1
  149. package/esm/components/ResourcesWeekView/ResourcesWeekViewRow.mjs.map +1 -1
  150. package/esm/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.mjs +6 -3
  151. package/esm/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.mjs.map +1 -1
  152. package/esm/components/Schedule/Schedule.mjs +4 -1
  153. package/esm/components/Schedule/Schedule.mjs.map +1 -1
  154. package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs +53 -0
  155. package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs.map +1 -0
  156. package/esm/components/ScheduleEvent/ScheduleEvent.mjs.map +1 -1
  157. package/esm/components/ScheduleHeader/HeaderControl/HeaderControl.mjs +15 -14
  158. package/esm/components/ScheduleHeader/HeaderControl/HeaderControl.mjs.map +1 -1
  159. package/esm/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.mjs.map +1 -1
  160. package/esm/components/ScheduleHeader/ScheduleHeader.mjs.map +1 -1
  161. package/esm/components/ScheduleHeader/ScheduleHeaderBase.mjs.map +1 -1
  162. package/esm/components/ScheduleHeader/ViewSelect/ViewSelect.mjs.map +1 -1
  163. package/esm/components/WeekView/WeekView.mjs +160 -83
  164. package/esm/components/WeekView/WeekView.mjs.map +1 -1
  165. package/esm/components/WeekView/WeekView.module.mjs +2 -1
  166. package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
  167. package/esm/components/WeekView/WeekViewDay.mjs.map +1 -1
  168. package/esm/components/YearView/YearView.mjs +7 -6
  169. package/esm/components/YearView/YearView.mjs.map +1 -1
  170. package/esm/components/YearView/YearViewMonth.mjs.map +1 -1
  171. package/esm/hooks/use-drag-drop-handlers.mjs +13 -2
  172. package/esm/hooks/use-drag-drop-handlers.mjs.map +1 -1
  173. package/esm/hooks/use-event-resize.mjs +30 -15
  174. package/esm/hooks/use-event-resize.mjs.map +1 -1
  175. package/esm/hooks/use-horizontal-event-resize.mjs +30 -15
  176. package/esm/hooks/use-horizontal-event-resize.mjs.map +1 -1
  177. package/esm/index.mjs +2 -1
  178. package/esm/utils/calculate-drop-time/calculate-drop-time.mjs +25 -4
  179. package/esm/utils/calculate-drop-time/calculate-drop-time.mjs.map +1 -1
  180. package/esm/utils/get-month-days/get-month-days.mjs +4 -2
  181. package/esm/utils/get-month-days/get-month-days.mjs.map +1 -1
  182. package/esm/utils/get-week-number/get-week-number.mjs +4 -1
  183. package/esm/utils/get-week-number/get-week-number.mjs.map +1 -1
  184. package/lib/components/DayView/DayView.d.ts +7 -1
  185. package/lib/components/MonthView/MonthView.d.ts +2 -0
  186. package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +7 -1
  187. package/lib/components/ResourcesDayView/ResourcesDayViewColumn.d.ts +1 -1
  188. package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +3 -1
  189. package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +7 -1
  190. package/lib/components/ResourcesWeekView/ResourcesWeekViewRow.d.ts +1 -1
  191. package/lib/components/Schedule/Schedule.d.ts +3 -1
  192. package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.d.ts +19 -0
  193. package/lib/components/ScheduleBackgroundEvent/index.d.ts +2 -0
  194. package/lib/components/ScheduleHeader/HeaderControl/HeaderControl.d.ts +3 -3
  195. package/lib/components/ScheduleHeader/ScheduleHeaderBase.d.ts +1 -1
  196. package/lib/components/WeekView/WeekView.d.ts +7 -1
  197. package/lib/components/WeekView/WeekViewDay.d.ts +1 -1
  198. package/lib/components/YearView/YearViewMonth.d.ts +1 -1
  199. package/lib/hooks/use-drag-drop-handlers.d.ts +10 -1
  200. package/lib/hooks/use-event-resize.d.ts +2 -1
  201. package/lib/hooks/use-horizontal-event-resize.d.ts +2 -1
  202. package/lib/index.d.mts +1 -0
  203. package/lib/index.d.ts +1 -0
  204. package/lib/types.d.ts +1 -1
  205. package/lib/utils/calculate-drop-time/calculate-drop-time.d.ts +11 -1
  206. package/package.json +8 -5
  207. package/styles.css +160 -0
  208. package/styles.layer.css +160 -0
@@ -10,6 +10,7 @@ const require_previous_week = require("../../utils/previous-week/previous-week.c
10
10
  const require_get_current_time_position = require("../../utils/get-current-time-position/get-current-time-position.cjs");
11
11
  const require_is_in_time_range = require("../../utils/is-in-time-range/is-in-time-range.cjs");
12
12
  const require_is_all_day_event = require("../../utils/is-all-day-event/is-all-day-event.cjs");
13
+ const require_get_day_position = require("../../utils/get-day-position/get-day-position.cjs");
13
14
  const require_get_time_axis_event_style = require("../../utils/get-time-axis-event-style/get-time-axis-event-style.cjs");
14
15
  const require_calculate_drop_time = require("../../utils/calculate-drop-time/calculate-drop-time.cjs");
15
16
  const require_get_business_hours_mod = require("../../utils/get-business-hours-mod/get-business-hours-mod.cjs");
@@ -22,6 +23,7 @@ const require_use_slot_drag_select = require("../../hooks/use-slot-drag-select.c
22
23
  const require_DragContext = require("../DragContext/DragContext.cjs");
23
24
  const require_ScheduleEvent = require("../ScheduleEvent/ScheduleEvent.cjs");
24
25
  const require_MoreEvents = require("../MoreEvents/MoreEvents.cjs");
26
+ const require_ScheduleBackgroundEvent = require("../ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs");
25
27
  const require_ScheduleHeaderBase = require("../ScheduleHeader/ScheduleHeaderBase.cjs");
26
28
  const require_get_week_label = require("../WeekView/get-week-label/get-week-label.cjs");
27
29
  const require_use_horizontal_event_resize = require("../../hooks/use-horizontal-event-resize.cjs");
@@ -56,7 +58,8 @@ const defaultProps = {
56
58
  withCurrentTimeBubble: true,
57
59
  highlightToday: true,
58
60
  mode: "default",
59
- maxEventsPerTimeSlot: 2
61
+ maxEventsPerTimeSlot: 2,
62
+ withInteractiveBackgroundEvents: false
60
63
  };
61
64
  const varsResolver = (0, _mantine_core.createVarsResolver)((_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({ resourcesWeekView: {
62
65
  "--resources-week-view-radius": radius ? (0, _mantine_core.getRadius)(radius) : void 0,
@@ -66,7 +69,7 @@ const varsResolver = (0, _mantine_core.createVarsResolver)((_theme, { radius, sl
66
69
  } }));
67
70
  const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
68
71
  const props = (0, _mantine_core.useProps)("ResourcesWeekView", defaultProps, _props);
69
- const { classNames, className, style, styles, unstyled, attributes, vars, startTime, endTime, date, onDateChange, resources, intervalMinutes, minEventSize, slotLabelFormat, radius, startScrollDateTime, scrollAreaProps, locale, withCurrentTimeIndicator: _withCurrentTimeIndicator, withCurrentTimeBubble, getCurrentTime, __staticSelector, withHeader, onViewChange, previousControlProps, nextControlProps, todayControlProps, viewSelectProps, weekLabelFormat, renderWeekLabel, events, slotWidth, rowHeight, labels, highlightBusinessHours, businessHours, renderEventBody, renderEvent, renderResourceLabel, groups, renderGroupLabel, groupLabelWidth, withEventsDragAndDrop, onEventDrop, canDragEvent, onEventDragStart, onEventDragEnd, withEventResize, onEventResize, canResizeEvent, onTimeSlotClick, onEventClick, withDragSlotSelect, onSlotDragEnd, mode, onExternalEventDrop, recurrenceExpansionLimit, maxEventsPerTimeSlot: _maxEventsPerTimeSlot, moreEventsProps, firstDayOfWeek, weekendDays, withWeekendDays, weekdayFormat, highlightToday, ...others } = props;
72
+ const { classNames, className, style, styles, unstyled, attributes, vars, startTime, endTime, date, onDateChange, resources, intervalMinutes, minEventSize, slotLabelFormat, radius, startScrollDateTime, scrollAreaProps, locale, withCurrentTimeIndicator: _withCurrentTimeIndicator, withCurrentTimeBubble, getCurrentTime, __staticSelector, withHeader, onViewChange, previousControlProps, nextControlProps, todayControlProps, viewSelectProps, weekLabelFormat, renderWeekLabel, events, slotWidth, rowHeight, labels, highlightBusinessHours, businessHours, renderEventBody, renderEvent, renderResourceLabel, groups, renderGroupLabel, groupLabelWidth, withEventsDragAndDrop, onEventDrop, canDragEvent, eventDragInterval, onEventDragStart, onEventDragEnd, withEventResize, onEventResize, canResizeEvent, eventResizeInterval, onTimeSlotClick, onEventClick, withInteractiveBackgroundEvents, withDragSlotSelect, onSlotDragEnd, mode, onExternalEventDrop, recurrenceExpansionLimit, maxEventsPerTimeSlot: _maxEventsPerTimeSlot, moreEventsProps, firstDayOfWeek, weekendDays, withWeekendDays, weekdayFormat, highlightToday, ...others } = props;
70
73
  const maxEventsPerTimeSlot = _maxEventsPerTimeSlot !== void 0 ? Math.max(1, _maxEventsPerTimeSlot) : void 0;
71
74
  const getStyles = (0, _mantine_core.useStyles)({
72
75
  name: __staticSelector,
@@ -95,6 +98,7 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
95
98
  radius
96
99
  };
97
100
  const theme = (0, _mantine_core.useMantineTheme)();
101
+ const { dir } = (0, _mantine_core.useDirection)();
98
102
  const [scrolled, setScrolled] = (0, react.useState)(false);
99
103
  const [scrolledX, setScrolledX] = (0, react.useState)(false);
100
104
  const ctx = (0, _mantine_dates.useDatesContext)();
@@ -122,6 +126,7 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
122
126
  const now = resolveNow();
123
127
  const isToday = weekdays.some((day) => (0, dayjs.default)(day).isSame(now, "day"));
124
128
  const withCurrentTimeIndicator = _withCurrentTimeIndicator ?? isToday;
129
+ const mounted = (0, _mantine_hooks.useMounted)();
125
130
  const [, setTimeIndicatorTick] = (0, react.useState)(0);
126
131
  (0, _mantine_hooks.useInterval)(() => setTimeIndicatorTick((tick) => tick + 1), 6e4, { autoInvoke: true });
127
132
  const timeIndicatorOffset = require_get_current_time_position.getCurrentTimePosition({
@@ -131,7 +136,7 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
131
136
  now
132
137
  });
133
138
  const todayDayIndex = weekdays.findIndex((day) => (0, dayjs.default)(day).isSame(now, "day"));
134
- const showTimeIndicator = withCurrentTimeIndicator && todayDayIndex >= 0 && require_is_in_time_range.isInTimeRange({
139
+ const showTimeIndicator = mounted && withCurrentTimeIndicator && todayDayIndex >= 0 && require_is_in_time_range.isInTimeRange({
135
140
  date: now.toDate(),
136
141
  startTime,
137
142
  endTime
@@ -141,49 +146,101 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
141
146
  date: now,
142
147
  format: slotLabelFormat
143
148
  }) : "";
149
+ const dragOffsetRef = (0, react.useRef)({
150
+ offset: 0,
151
+ size: 0
152
+ });
144
153
  const handleExternalDrop = (0, react.useCallback)((e, target) => {
145
154
  if (!onExternalEventDrop) return;
146
155
  const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);
147
156
  const slotInDay = target.slotIndex % totalSlotsPerDay;
148
157
  const slotDay = weekdays[dayIndex];
149
- if (slotDay) onExternalEventDrop({
150
- dataTransfer: e.dataTransfer,
151
- dropDateTime: `${(0, dayjs.default)(slotDay).format("YYYY-MM-DD")} ${slots[slotInDay].startTime}`,
152
- resourceId: target.resourceId
153
- });
158
+ if (slotDay) {
159
+ const slotDate = (0, dayjs.default)(slotDay).format("YYYY-MM-DD");
160
+ const slotTime = slots[slotInDay].startTime;
161
+ let dropDateTime = `${slotDate} ${slotTime}`;
162
+ if (eventDragInterval != null) {
163
+ const { start } = require_calculate_drop_time.calculateDropTime({
164
+ draggedEvent: {
165
+ start: dropDateTime,
166
+ end: dropDateTime
167
+ },
168
+ targetDate: slotDate,
169
+ targetSlotTime: slotTime,
170
+ intervalMinutes,
171
+ dragIntervalMinutes: eventDragInterval,
172
+ slotOffset: dragOffsetRef.current.offset,
173
+ slotSize: dragOffsetRef.current.size,
174
+ startTime,
175
+ endTime
176
+ });
177
+ dropDateTime = (0, dayjs.default)(start).format("YYYY-MM-DD HH:mm:ss");
178
+ }
179
+ onExternalEventDrop({
180
+ dataTransfer: e.dataTransfer,
181
+ dropDateTime,
182
+ resourceId: target.resourceId
183
+ });
184
+ }
154
185
  }, [
155
186
  onExternalEventDrop,
156
187
  slots,
157
188
  weekdays,
158
- totalSlotsPerDay
189
+ totalSlotsPerDay,
190
+ eventDragInterval,
191
+ intervalMinutes,
192
+ startTime,
193
+ endTime
159
194
  ]);
160
195
  const lastDropResourceId = (0, react.useRef)(void 0);
196
+ const getDropTimeForSlot = (target, draggedEvent) => {
197
+ const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);
198
+ const slotInDay = target.slotIndex % totalSlotsPerDay;
199
+ const slotTime = slots[slotInDay].startTime;
200
+ const targetDay = weekdays[dayIndex] || weekdays[0];
201
+ return require_calculate_drop_time.calculateDropTime({
202
+ draggedEvent,
203
+ targetDate: targetDay,
204
+ targetSlotTime: slotTime,
205
+ intervalMinutes,
206
+ dragIntervalMinutes: eventDragInterval,
207
+ slotOffset: eventDragInterval == null ? void 0 : dragOffsetRef.current.offset,
208
+ slotSize: eventDragInterval == null ? void 0 : dragOffsetRef.current.size,
209
+ startTime,
210
+ endTime
211
+ });
212
+ };
213
+ const handleInternalEventDrop = (0, react.useCallback)((data) => {
214
+ onEventDrop?.({
215
+ ...data,
216
+ resourceId: lastDropResourceId.current
217
+ });
218
+ }, [onEventDrop]);
161
219
  const dragDrop = require_use_drag_drop_handlers.useDragDropHandlers({
162
220
  enabled: withEventsDragAndDrop,
163
221
  mode,
164
- onEventDrop: (0, react.useCallback)((data) => {
165
- onEventDrop?.({
166
- ...data,
167
- resourceId: lastDropResourceId.current
168
- });
169
- }, [onEventDrop]),
222
+ onEventDrop: handleInternalEventDrop,
170
223
  canDragEvent,
171
224
  onEventDragStart,
172
225
  onEventDragEnd,
173
226
  calculateDropTarget: (target, draggedEvent) => {
174
227
  lastDropResourceId.current = target.resourceId;
175
- const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);
176
- const slotInDay = target.slotIndex % totalSlotsPerDay;
177
- const slotTime = slots[slotInDay].startTime;
178
- return require_calculate_drop_time.calculateDropTime({
179
- draggedEvent,
180
- targetDate: weekdays[dayIndex] || weekdays[0],
181
- targetSlotTime: slotTime,
182
- intervalMinutes
183
- });
228
+ return getDropTimeForSlot(target, draggedEvent);
184
229
  },
185
230
  onExternalDrop: onExternalEventDrop ? handleExternalDrop : void 0
186
231
  });
232
+ const updateDragPreview = (target) => {
233
+ const draggedEvent = dragDrop.dragContextValue.draggedEvent;
234
+ if (eventDragInterval == null || !draggedEvent) return;
235
+ const { start, end } = getDropTimeForSlot(target, draggedEvent);
236
+ const newStart = (0, dayjs.default)(start).format("YYYY-MM-DD HH:mm:ss");
237
+ if (dragDrop.dragPreview?.start !== newStart || dragDrop.dragPreview?.target.resourceId !== target.resourceId) dragDrop.setDragPreview({
238
+ start: newStart,
239
+ end: (0, dayjs.default)(end).format("YYYY-MM-DD HH:mm:ss"),
240
+ target
241
+ });
242
+ };
243
+ const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;
187
244
  const groupToResourceId = (0, react.useMemo)(() => require_get_group_to_resource_id_map.getGroupToResourceIdMap(resources), [resources]);
188
245
  const slotDragSelect = require_use_slot_drag_select.useSlotDragSelect({
189
246
  enabled: withDragSlotSelect && mode !== "static",
@@ -208,6 +265,7 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
208
265
  startTime,
209
266
  endTime,
210
267
  intervalMinutes,
268
+ resizeIntervalMinutes: eventResizeInterval,
211
269
  onEventResize,
212
270
  canResizeEvent
213
271
  });
@@ -261,8 +319,10 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
261
319
  }));
262
320
  });
263
321
  const timeLabels = weekdays.flatMap((day) => slots.map((interval) => {
322
+ const dayStr = (0, dayjs.default)(day).format("YYYY-MM-DD");
323
+ const intervalTime = (0, dayjs.default)(`${dayStr} ${interval.startTime}`);
264
324
  const label = require_format_date.formatDate({
265
- date: (0, dayjs.default)(`${(0, dayjs.default)(day).format("YYYY-MM-DD")} ${interval.startTime}`),
325
+ date: intervalTime,
266
326
  locale: ctx.getLocale(locale),
267
327
  format: slotLabelFormat
268
328
  });
@@ -311,8 +371,20 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
311
371
  });
312
372
  }, []);
313
373
  const getSlotIndexFromDragPoint = (0, react.useCallback)((event, resourceIndex) => {
314
- return require_get_index_from_drag_point.getIndexFromDragPoint(slotsRef.current[resourceIndex] ?? [], event.clientX);
315
- }, []);
374
+ const daySlots = slotsRef.current[resourceIndex] ?? [];
375
+ const index = require_get_index_from_drag_point.getIndexFromDragPoint(daySlots, event.clientX);
376
+ if (index !== null) {
377
+ const rect = daySlots[index]?.getBoundingClientRect();
378
+ if (rect) {
379
+ const rawOffset = dir === "rtl" ? rect.right - event.clientX : event.clientX - rect.left;
380
+ dragOffsetRef.current = {
381
+ offset: Math.max(0, Math.min(rect.width, rawOffset)),
382
+ size: rect.width
383
+ };
384
+ }
385
+ }
386
+ return index;
387
+ }, [dir]);
316
388
  const handleSlotKeyDown = (event, resourceIndex, slotIndex) => {
317
389
  require_handle_resources_grid_key_down.handleResourcesGridKeyDown({
318
390
  controlsRef: slotsRef,
@@ -322,6 +394,7 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
322
394
  });
323
395
  };
324
396
  const dayWidthPercent = 100 / weekdays.length;
397
+ const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== "static";
325
398
  const rows = orderedResources.map((resource, resourceIndex) => {
326
399
  const eventNodes = [];
327
400
  const resourceAllDayBars = weekViewEvents.allDayBars[resource.id] ?? [];
@@ -331,31 +404,19 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
331
404
  if (!dayEvents) return;
332
405
  const dayOffsetPercent = dayIndex / weekdays.length * 100;
333
406
  const bgEvents = [...dayEvents.backgroundTimedEvents[resource.id] || [], ...dayEvents.backgroundAllDayEvents[resource.id] || []];
334
- for (const event of bgEvents) {
335
- const colors = theme.variantColorResolver({
336
- color: event.color || theme.primaryColor,
337
- theme,
338
- variant: "light",
339
- autoContrast: true
340
- });
341
- const bgEventBody = typeof renderEventBody === "function" ? renderEventBody(event) : event.title;
342
- const bgEventProps = {
343
- key: `bg-${event.id}-${day}`,
344
- ...getStyles("resourcesWeekViewBackgroundEvent", { style: {
345
- left: `${dayOffsetPercent + event.position.top / 100 * dayWidthPercent}%`,
346
- width: `${event.position.height / 100 * dayWidthPercent}%`,
347
- top: 0,
348
- height: "100%"
349
- } }),
350
- __vars: {
351
- "--bg-event-bg": colors.background,
352
- "--bg-event-color": colors.color
353
- },
354
- children: bgEventBody
355
- };
356
- if (typeof renderEvent === "function") eventNodes.push(renderEvent(event, bgEventProps));
357
- else eventNodes.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, { ...bgEventProps }));
358
- }
407
+ for (const event of bgEvents) eventNodes.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScheduleBackgroundEvent.ScheduleBackgroundEvent, {
408
+ event,
409
+ renderEvent,
410
+ renderEventBody,
411
+ interactive: interactiveBackgroundEvents,
412
+ onEventClick,
413
+ ...getStyles("resourcesWeekViewBackgroundEvent", { style: {
414
+ left: `${dayOffsetPercent + event.position.top / 100 * dayWidthPercent}%`,
415
+ width: `${event.position.height / 100 * dayWidthPercent}%`,
416
+ top: 0,
417
+ height: "100%"
418
+ } })
419
+ }, `bg-${event.id}-${day}`));
359
420
  const allRegularEvents = (dayEvents.regularEvents[resource.id] || []).filter((event) => !require_is_all_day_event.isAllDayEvent({
360
421
  event,
361
422
  date: day
@@ -522,7 +583,7 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
522
583
  })
523
584
  }, `all-day-${bar.event.id}-${bar.startDayIndex}`));
524
585
  });
525
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ResourcesWeekViewRow.ResourcesWeekViewRow, {
586
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ResourcesWeekViewRow.ResourcesWeekViewRow, {
526
587
  resource,
527
588
  resourceIndex,
528
589
  weekdays,
@@ -539,10 +600,16 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
539
600
  onSlotClick: handleTimeSlotClick,
540
601
  onRowSlotsDragOver: (event, resourceId, resIdx) => {
541
602
  const slotIndex = getSlotIndexFromDragPoint(event, resIdx);
542
- if (slotIndex !== null) dragDrop.handleDragOver(event, {
543
- resourceId,
544
- slotIndex
545
- });
603
+ if (slotIndex !== null) {
604
+ dragDrop.handleDragOver(event, {
605
+ resourceId,
606
+ slotIndex
607
+ });
608
+ updateDragPreview({
609
+ resourceId,
610
+ slotIndex
611
+ });
612
+ }
546
613
  },
547
614
  onRowSlotsDragLeave: dragDrop.handleDragLeave,
548
615
  onRowSlotsDrop: (event, resourceId, resIdx) => {
@@ -552,7 +619,7 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
552
619
  slotIndex
553
620
  });
554
621
  },
555
- dropTargetSlotIndex: dragDrop.dropTarget?.resourceId === resource.id ? dragDrop.dropTarget.slotIndex : void 0,
622
+ dropTargetSlotIndex: !suppressDropHighlight && dragDrop.dropTarget?.resourceId === resource.id ? dragDrop.dropTarget.slotIndex : void 0,
556
623
  withDragSlotSelect,
557
624
  onSlotPointerDown: slotDragSelect.handleSlotPointerDown,
558
625
  isSlotDragSelected: slotDragSelect.isSlotSelected,
@@ -564,7 +631,31 @@ const ResourcesWeekView = (0, _mantine_core.factory)((_props) => {
564
631
  scrolledX,
565
632
  groupInfo: hasGroups ? resourceGroupMap[resourceIndex] : void 0,
566
633
  allDayCount: maxAllDayCount,
567
- children: eventNodes
634
+ children: [eventNodes, dragDrop.dragPreview?.target.resourceId === resource.id && dragDrop.dragContextValue.draggedEvent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, { ...getStyles("resourcesWeekViewDragPreview", { style: (() => {
635
+ const previewDayIndex = Math.floor(dragDrop.dragPreview.target.slotIndex / totalSlotsPerDay);
636
+ const { top, height } = require_get_day_position.getDayPosition({
637
+ event: {
638
+ ...dragDrop.dragContextValue.draggedEvent,
639
+ start: dragDrop.dragPreview.start,
640
+ end: dragDrop.dragPreview.end
641
+ },
642
+ startTime,
643
+ endTime,
644
+ intervalMinutes
645
+ });
646
+ const eventLeft = previewDayIndex / weekdays.length * 100 + top / 100 * dayWidthPercent;
647
+ const eventWidth = height / 100 * dayWidthPercent;
648
+ return {
649
+ position: "absolute",
650
+ insetBlockStart: 0,
651
+ insetBlockEnd: 0,
652
+ ...require_get_time_axis_event_style.getTimeAxisEventStyle({
653
+ start: eventLeft,
654
+ span: eventWidth,
655
+ axis: "horizontal"
656
+ })
657
+ };
658
+ })() }) })]
568
659
  }, resource.id);
569
660
  });
570
661
  const headerLabel = require_get_week_label.getWeekLabel({
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesWeekView.cjs","names":["getDayTimeIntervals","getOrderedResources","getWeekDays","getCurrentTimePosition","isInTimeRange","formatDate","useDragDropHandlers","calculateDropTime","getGroupToResourceIdMap","useSlotDragSelect","useHorizontalEventResize","getResourcesWeekViewEvents","Box","getBusinessHoursMod","classes","getIndexFromDragPoint","isAllDayEvent","getTimeAxisEventStyle","ScheduleEvent","getOverlapClusters","MoreEvents","ResourcesWeekViewRow","getWeekLabel","ScheduleHeaderBase","previousWeek","nextWeek","toDateString","ScrollArea","getLabel","DragContext"],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n rem,\n ScrollArea,\n ScrollAreaProps,\n StylesApiProps,\n useMantineTheme,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useInterval, useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n AnyDateValue,\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n formatDate,\n getBusinessHoursMod,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n getTimeAxisEventStyle,\n getWeekDays,\n handleResourcesGridKeyDown,\n isAllDayEvent,\n isInTimeRange,\n nextWeek,\n previousWeek,\n ResourcesGridControlsRef,\n toDateString,\n} from '../../utils';\nimport { DragContext, DragContextValue } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { getOverlapClusters } from '../ResourcesDayView/get-overlap-clusters/get-overlap-clusters';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getWeekLabel } from '../WeekView/get-week-label/get-week-label';\nimport { getResourcesWeekViewEvents } from './get-resources-week-view-events/get-resources-week-view-events';\nimport { ResourcesWeekViewRow } from './ResourcesWeekViewRow';\nimport classes from './ResourcesWeekView.module.css';\n\nexport type ResourcesWeekViewStylesNames =\n | 'resourcesWeekView'\n | 'resourcesWeekViewRoot'\n | 'resourcesWeekViewInner'\n | 'resourcesWeekViewHeaderRows'\n | 'resourcesWeekViewHeaderContent'\n | 'resourcesWeekViewDayLabelsRow'\n | 'resourcesWeekViewDayLabel'\n | 'resourcesWeekViewTimeLabelsRow'\n | 'resourcesWeekViewScrollArea'\n | 'resourcesWeekViewCorner'\n | 'resourcesWeekViewTimeLabel'\n | 'resourcesWeekViewResourceLabel'\n | 'resourcesWeekViewRow'\n | 'resourcesWeekViewRowSlot'\n | 'resourcesWeekViewRowSlots'\n | 'resourcesWeekViewBackgroundEvent'\n | 'resourcesWeekViewAllDayEvent'\n | 'resourcesWeekViewCurrentTimeIndicator'\n | 'resourcesWeekViewCurrentTimeIndicatorLine'\n | 'resourcesWeekViewCurrentTimeIndicatorThumb'\n | 'resourcesWeekViewCurrentTimeIndicatorTimeBubble'\n | 'resourcesWeekViewEventWrapper'\n | 'resourcesWeekViewResizeHandle'\n | 'resourcesWeekViewGroupColumn'\n | 'resourcesWeekViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesWeekViewCssVariables = {\n resourcesWeekView:\n | '--resources-week-view-radius'\n | '--resources-week-view-slot-width'\n | '--resources-week-view-row-height'\n | '--resources-week-view-group-label-width';\n};\n\nexport interface ResourcesWeekViewProps\n extends BoxProps, StylesApiProps<ResourcesWeekViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n date: Date | string;\n onDateChange?: (value: DateStringValue) => void;\n resources: ScheduleResourceData[];\n startTime?: string;\n endTime?: string;\n /** Number of minutes for each interval in the week view. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours (e.g. `120`, `240`) @default 60 */\n intervalMinutes?: number;\n /** Minimum on-screen size of an event along the time axis, in px. Prevents very short events from collapsing. Larger values make brief events easier to see but extend them past their real start time. @default 1 */\n minEventSize?: number;\n slotLabelFormat?: DateLabelFormat;\n radius?: MantineRadius;\n /** Date and time to scroll to on initial render, in `YYYY-MM-DD HH:mm:ss` format */\n startScrollDateTime?: string;\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n locale?: string;\n withCurrentTimeIndicator?: boolean;\n withCurrentTimeBubble?: boolean;\n\n /** A function to get the current time, called on every tick. Can be used to display the current time indicator in a different timezone. @default () => dayjs() */\n getCurrentTime?: () => AnyDateValue;\n\n withHeader?: boolean;\n onViewChange?: (view: ScheduleViewLevel) => void;\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n weekLabelFormat?: DateLabelFormat;\n renderWeekLabel?: (params: {\n weekStart: DateStringValue;\n weekEnd: DateStringValue;\n }) => React.ReactNode;\n events?: ScheduleEventData[];\n slotWidth?: React.CSSProperties['width'];\n rowHeight?: React.CSSProperties['height'];\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n renderEventBody?: RenderEventBody;\n renderEvent?: RenderEvent;\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 withEventsDragAndDrop?: boolean;\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n canDragEvent?: (event: ScheduleEventData) => boolean;\n onEventDragStart?: (event: ScheduleEventData) => void;\n onEventDragEnd?: () => void;\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n withDragSlotSelect?: boolean;\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n mode?: ScheduleMode;\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** If true, events can be resized by dragging their left/right edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n recurrenceExpansionLimit?: number;\n\n /** Maximum number of events visible per time slot before \"+more\" indicator shows, minimum value is 1 @default 2 */\n maxEventsPerTimeSlot?: number;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n firstDayOfWeek?: DayOfWeek;\n weekendDays?: DayOfWeek[];\n withWeekendDays?: boolean;\n weekdayFormat?: DateLabelFormat;\n highlightToday?: boolean;\n}\n\nexport type ResourcesWeekViewFactory = Factory<{\n props: ResourcesWeekViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesWeekViewStylesNames;\n vars: ResourcesWeekViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'ResourcesWeekView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n slotLabelFormat: 'HH:mm',\n intervalMinutes: 60,\n minEventSize: 1,\n withHeader: true,\n weekLabelFormat: 'MMM DD',\n weekdayFormat: 'ddd D',\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withEventResize: false,\n withDragSlotSelect: false,\n withWeekendDays: true,\n withCurrentTimeBubble: true,\n highlightToday: true,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n} satisfies Partial<ResourcesWeekViewProps>;\n\nconst varsResolver = createVarsResolver<ResourcesWeekViewFactory>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesWeekView: {\n '--resources-week-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-week-view-slot-width': rem(slotWidth),\n '--resources-week-view-row-height': rem(rowHeight),\n '--resources-week-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nexport const ResourcesWeekView = factory<ResourcesWeekViewFactory>((_props) => {\n const props = useProps('ResourcesWeekView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n startTime,\n endTime,\n date,\n onDateChange,\n resources,\n intervalMinutes,\n minEventSize,\n slotLabelFormat,\n radius,\n startScrollDateTime,\n scrollAreaProps,\n locale,\n withCurrentTimeIndicator: _withCurrentTimeIndicator,\n withCurrentTimeBubble,\n getCurrentTime,\n __staticSelector,\n withHeader,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n weekLabelFormat,\n renderWeekLabel,\n events,\n slotWidth,\n rowHeight,\n labels,\n highlightBusinessHours,\n businessHours,\n renderEventBody,\n renderEvent,\n renderResourceLabel,\n groups,\n renderGroupLabel,\n groupLabelWidth,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n withEventResize,\n onEventResize,\n canResizeEvent,\n onTimeSlotClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n firstDayOfWeek,\n weekendDays,\n withWeekendDays,\n weekdayFormat,\n highlightToday,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot =\n _maxEventsPerTimeSlot !== undefined ? Math.max(1, _maxEventsPerTimeSlot) : undefined;\n\n const getStyles = useStyles<ResourcesWeekViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n attributes,\n rootSelector: 'resourcesWeekView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesWeekViewFactory>({\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 [scrolled, setScrolled] = useState(false);\n const [scrolledX, setScrolledX] = useState(false);\n const ctx = useDatesContext();\n const slots = getDayTimeIntervals({ startTime, endTime, intervalMinutes });\n const { orderedResources, groupRanges, resourceGroupMap } = useMemo(\n () => getOrderedResources(resources, groups),\n [resources, groups]\n );\n const hasGroups = groupRanges.length > 0;\n\n const weekdays = useMemo(\n () =>\n getWeekDays({\n week: date,\n withWeekendDays,\n weekendDays: ctx.getWeekendDays(weekendDays),\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n }),\n [date, withWeekendDays, weekendDays, firstDayOfWeek, ctx]\n );\n\n const totalSlotsPerDay = slots.length;\n\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const now = resolveNow();\n const isToday = weekdays.some((day) => dayjs(day).isSame(now, 'day'));\n const withCurrentTimeIndicator = _withCurrentTimeIndicator ?? isToday;\n\n const [, setTimeIndicatorTick] = useState(0);\n useInterval(() => setTimeIndicatorTick((tick) => tick + 1), 60000, { autoInvoke: true });\n const timeIndicatorOffset = getCurrentTimePosition({ startTime, endTime, intervalMinutes, now });\n\n const todayDayIndex = weekdays.findIndex((day) => dayjs(day).isSame(now, 'day'));\n const showTimeIndicator =\n withCurrentTimeIndicator &&\n todayDayIndex >= 0 &&\n isInTimeRange({ date: now.toDate(), startTime, endTime });\n const formattedCurrentTime = withCurrentTimeBubble\n ? formatDate({ locale: ctx.getLocale(locale), date: now, format: slotLabelFormat })\n : '';\n\n type DropTargetSlot = { resourceId: string | number; slotIndex: number };\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetSlot) => {\n if (!onExternalEventDrop) {\n return;\n }\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotDay = weekdays[dayIndex];\n if (slotDay) {\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime: `${dayjs(slotDay).format('YYYY-MM-DD')} ${slots[slotInDay].startTime}`,\n resourceId: target.resourceId,\n });\n }\n },\n [onExternalEventDrop, slots, weekdays, totalSlotsPerDay]\n );\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const handleInternalEventDrop = useCallback(\n (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n [onEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetSlot>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: handleInternalEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotTime = slots[slotInDay].startTime;\n const targetDay = weekdays[dayIndex] || weekdays[0];\n return calculateDropTime({\n draggedEvent,\n targetDate: targetDay,\n targetSlotTime: slotTime,\n intervalMinutes,\n });\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\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 startDayIndex = Math.floor(startIndex / totalSlotsPerDay);\n const startSlotInDay = startIndex % totalSlotsPerDay;\n const endDayIndex = Math.floor(endIndex / totalSlotsPerDay);\n const endSlotInDay = endIndex % totalSlotsPerDay;\n const startDay = weekdays[startDayIndex];\n const endDay = weekdays[endDayIndex];\n if (startDay && endDay) {\n onSlotDragEnd({\n rangeStart: `${dayjs(startDay).format('YYYY-MM-DD')} ${slots[startSlotInDay].startTime}`,\n rangeEnd: `${dayjs(endDay).format('YYYY-MM-DD')} ${slots[endSlotInDay].endTime}`,\n resourceId: groupToResourceId.get(group) ?? group,\n });\n }\n },\n });\n\n const eventResize = useHorizontalEventResize({\n enabled: withEventResize,\n mode,\n startTime,\n endTime,\n intervalMinutes,\n onEventResize,\n canResizeEvent,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const handleTimeSlotClick = (\n resourceId: string | number,\n day: string,\n slotTime: string,\n e: React.MouseEvent<HTMLButtonElement>\n ) => {\n if (!onTimeSlotClick) {\n return;\n }\n const slotIndex = slots.findIndex((s) => s.startTime === slotTime);\n if (slotIndex === -1) {\n return;\n }\n const slot = slots[slotIndex];\n const dayStr = dayjs(day).format('YYYY-MM-DD');\n onTimeSlotClick({\n slotStart: `${dayStr} ${slot.startTime}`,\n slotEnd: `${dayStr} ${slot.endTime}`,\n nativeEvent: e,\n resourceId,\n });\n };\n\n const weekViewEvents = useMemo(\n () =>\n getResourcesWeekViewEvents({\n events,\n resources,\n weekdays,\n startTime,\n endTime,\n intervalMinutes,\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, resources, weekdays, startTime, endTime, intervalMinutes, recurrenceExpansionLimit]\n );\n\n const dayLabels = weekdays.map((day) => {\n const d = dayjs(day);\n const today = d.isSame(now, 'day') && highlightToday;\n const weekend = ctx.getWeekendDays(weekendDays).includes(d.day() as DayOfWeek);\n\n return (\n <Box\n {...getStyles('resourcesWeekViewDayLabel')}\n key={day}\n mod={{ today, weekend }}\n style={{ width: `calc(var(--resources-week-view-slot-width) * ${totalSlotsPerDay})` }}\n >\n {formatDate({ date: d, locale: ctx.getLocale(locale), format: weekdayFormat })}\n </Box>\n );\n });\n\n const timeLabels = weekdays.flatMap((day) =>\n slots.map((interval) => {\n const dayStr = dayjs(day).format('YYYY-MM-DD');\n const intervalTime = dayjs(`${dayStr} ${interval.startTime}`);\n const label = formatDate({\n date: intervalTime,\n locale: ctx.getLocale(locale),\n format: slotLabelFormat,\n });\n\n return (\n <Box\n {...getStyles('resourcesWeekViewTimeLabel')}\n key={`${day}-${interval.startTime}`}\n mod={{\n 'hour-start': interval.isHourStart,\n ...getBusinessHoursMod({\n time: interval.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n }}\n >\n {label}\n </Box>\n );\n })\n );\n\n const slotsRef: ResourcesGridControlsRef = useRef<HTMLButtonElement[][]>([]);\n const rowSlotsContainersRef = useRef<(HTMLDivElement | null)[]>([]);\n const viewportRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n\n const firstSlotIndex = { resourceIndex: 0, slotIndex: 0 };\n\n useIsomorphicEffect(() => {\n if (!startScrollDateTime || !viewportRef.current) {\n return;\n }\n const parsed = dayjs(startScrollDateTime);\n const targetDayStr = parsed.format('YYYY-MM-DD 00:00:00');\n const targetTime = parsed.format('HH:mm:ss');\n const dayIndex = weekdays.indexOf(targetDayStr);\n if (dayIndex < 0) {\n return;\n }\n const slotInDay = slots.findIndex((s) => s.startTime >= targetTime);\n if (slotInDay < 0) {\n return;\n }\n const flatIndex = dayIndex * totalSlotsPerDay + slotInDay;\n const firstResourceSlots = slotsRef.current[0];\n if (!firstResourceSlots || firstResourceSlots.length === 0) {\n return;\n }\n const targetSlot = firstResourceSlots[flatIndex];\n if (!targetSlot) {\n return;\n }\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const cornerEl = viewportRef.current.querySelector(`.${classes.resourcesWeekViewCorner}`);\n const labelWidth = cornerEl ? cornerEl.getBoundingClientRect().width : 0;\n viewportRef.current.scrollTo({\n left: slotRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n }, []);\n\n const getSlotIndexFromDragPoint = useCallback((event: React.DragEvent, resourceIndex: number) => {\n return getIndexFromDragPoint(slotsRef.current[resourceIndex] ?? [], event.clientX);\n }, []);\n\n const handleSlotKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => {\n handleResourcesGridKeyDown({\n controlsRef: slotsRef,\n resourceIndex,\n slotIndex,\n event,\n });\n };\n\n const dayWidthPercent = 100 / weekdays.length;\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n const eventNodes: React.ReactNode[] = [];\n const resourceAllDayBars = weekViewEvents.allDayBars[resource.id] ?? [];\n const maxAllDayCount = resourceAllDayBars.reduce((max, bar) => Math.max(max, bar.row + 1), 0);\n\n weekdays.forEach((day, dayIndex) => {\n const dayEvents = weekViewEvents.byDay[day];\n if (!dayEvents) {\n return;\n }\n\n const dayOffsetPercent = (dayIndex / weekdays.length) * 100;\n\n const bgEvents = [\n ...(dayEvents.backgroundTimedEvents[resource.id] || []),\n ...(dayEvents.backgroundAllDayEvents[resource.id] || []),\n ];\n for (const event of bgEvents) {\n const colors = theme.variantColorResolver({\n color: event.color || theme.primaryColor,\n theme,\n variant: 'light',\n autoContrast: true,\n });\n\n const bgEventBody =\n typeof renderEventBody === 'function' ? renderEventBody(event) : event.title;\n\n const bgEventProps = {\n key: `bg-${event.id}-${day}`,\n ...getStyles('resourcesWeekViewBackgroundEvent', {\n style: {\n left: `${dayOffsetPercent + (event.position.top / 100) * dayWidthPercent}%`,\n width: `${(event.position.height / 100) * dayWidthPercent}%`,\n top: 0,\n height: '100%',\n },\n }),\n __vars: {\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n },\n children: bgEventBody,\n };\n\n if (typeof renderEvent === 'function') {\n eventNodes.push(renderEvent(event, bgEventProps as any));\n } else {\n eventNodes.push(<Box {...bgEventProps} />);\n }\n }\n\n const allRegularEvents = (dayEvents.regularEvents[resource.id] || []).filter(\n (event) => !isAllDayEvent({ event, date: day })\n );\n\n const visibleEvents =\n maxEventsPerTimeSlot !== undefined\n ? allRegularEvents.filter((event) => event.position.column < maxEventsPerTimeSlot)\n : allRegularEvents;\n\n for (const event of visibleEvents) {\n const isDraggable = dragDrop.isDraggableEvent(event);\n const isResizable = eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const isThisEventResizing = resizePosition !== null;\n const activeEdge =\n isThisEventResizing && eventResize.resizingEdge ? eventResize.resizingEdge : null;\n\n const effectiveTop = resizePosition ? resizePosition.left : event.position.top;\n const effectiveHeight = resizePosition ? resizePosition.width : event.position.height;\n const eventLeft = dayOffsetPercent + (effectiveTop / 100) * dayWidthPercent;\n const eventWidth = (effectiveHeight / 100) * dayWidthPercent;\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 adjustPosition =\n maxEventsPerTimeSlot !== undefined && event.position.overlaps > maxEventsPerTimeSlot;\n\n const eventDate = dayjs(day).format('YYYY-MM-DD');\n\n eventNodes.push(\n <Box\n key={`${event.id}-${day}`}\n {...getStyles('resourcesWeekViewEventWrapper')}\n __vars={eventColors ? { '--event-color': eventColors.color } : undefined}\n data-resizing={isThisEventResizing || undefined}\n style={{\n ...getTimeAxisEventStyle({\n start: eventLeft,\n span: eventWidth,\n minSize: minEventSize,\n }),\n top: adjustPosition\n ? `calc((100% - 22px) * ${event.position.column} / ${maxEventsPerTimeSlot})`\n : `${event.position.offset}%`,\n height: adjustPosition\n ? `calc((100% - 22px) / ${maxEventsPerTimeSlot})`\n : `${event.position.width}%`,\n }}\n >\n <ScheduleEvent\n event={event}\n autoSize\n nowrap\n draggable={isDraggable}\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%', padding: 0 }}\n />\n {isResizable && mode !== 'static' && (\n <>\n <div\n {...getStyles('resourcesWeekViewResizeHandle')}\n data-edge=\"start\"\n data-active={activeEdge === 'start' || undefined}\n onPointerDown={(e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge: 'start',\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }}\n />\n <div\n {...getStyles('resourcesWeekViewResizeHandle')}\n data-edge=\"end\"\n data-active={activeEdge === 'end' || undefined}\n onPointerDown={(e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge: 'end',\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }}\n />\n </>\n )}\n </Box>\n );\n }\n\n if (maxEventsPerTimeSlot !== undefined) {\n const clusters = getOverlapClusters(allRegularEvents);\n for (const cluster of clusters) {\n const hiddenCount = cluster.filter(\n (e) => e.position.column >= maxEventsPerTimeSlot\n ).length;\n\n if (hiddenCount > 0 && mode !== 'static') {\n const leftPercent =\n dayOffsetPercent +\n (Math.min(...cluster.map((e) => e.position.top)) / 100) * dayWidthPercent;\n const rightPercent =\n dayOffsetPercent +\n (Math.max(...cluster.map((e) => e.position.top + e.position.height)) / 100) *\n dayWidthPercent;\n\n eventNodes.push(\n <MoreEvents\n key={`more-${resource.id}-${day}-${cluster[0].id}`}\n events={cluster}\n moreEventsCount={hiddenCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n left: `calc(${leftPercent}% + 1px)`,\n width: `calc(${rightPercent - leftPercent}% - 2px)`,\n bottom: 0,\n height: '22px',\n paddingInline: 4,\n zIndex: 4,\n }}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n );\n }\n }\n }\n });\n\n const stickyLabelOffset = hasGroups\n ? 'calc(var(--resources-week-view-group-label-width) + var(--resources-week-view-resource-label-width) + 5px)'\n : 'calc(var(--resources-week-view-resource-label-width) + 5px)';\n\n resourceAllDayBars.forEach((bar) => {\n const leftPercent = bar.startDayIndex * dayWidthPercent;\n const widthPercent = (bar.endDayIndex - bar.startDayIndex + 1) * dayWidthPercent;\n\n eventNodes.push(\n <div\n key={`all-day-${bar.event.id}-${bar.startDayIndex}`}\n {...getStyles('resourcesWeekViewAllDayEvent', {\n style: {\n left: `calc(${leftPercent}% + 1px)`,\n width: `calc(${widthPercent}% - 2px)`,\n top: `calc(${bar.row} * (var(--resources-week-view-all-day-height) + 2px) + 2px)`,\n },\n })}\n >\n <ScheduleEvent\n event={bar.event}\n autoSize\n nowrap\n renderEventBody={(barEvent) => (\n <span\n style={{\n position: 'sticky',\n insetInlineStart: stickyLabelOffset,\n display: 'inline-block',\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {renderEventBody ? renderEventBody(barEvent) : barEvent.title}\n </span>\n )}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(bar.event, e) : undefined}\n style={{ width: '100%', height: '100%', overflow: 'visible' }}\n styles={{\n eventInner: {\n display: 'block',\n overflow: 'visible',\n lineHeight: 'var(--resources-week-view-all-day-height)',\n },\n }}\n />\n </div>\n );\n });\n\n return (\n <ResourcesWeekViewRow\n key={resource.id}\n resource={resource}\n resourceIndex={resourceIndex}\n weekdays={weekdays}\n slots={slots}\n getStyles={getStyles}\n labels={labels}\n highlightBusinessHours={highlightBusinessHours}\n businessHours={businessHours}\n withEventsDragAndDrop={withDragHandlers}\n mode={mode}\n slotsRef={slotsRef}\n firstSlotIndex={firstSlotIndex}\n onSlotKeyDown={handleSlotKeyDown}\n onSlotClick={handleTimeSlotClick}\n onRowSlotsDragOver={(event, resourceId, resIdx) => {\n const slotIndex = getSlotIndexFromDragPoint(event, resIdx);\n if (slotIndex !== null) {\n dragDrop.handleDragOver(event, { resourceId, slotIndex });\n }\n }}\n onRowSlotsDragLeave={dragDrop.handleDragLeave}\n onRowSlotsDrop={(event, resourceId, resIdx) => {\n const slotIndex = getSlotIndexFromDragPoint(event, resIdx);\n if (slotIndex !== null) {\n dragDrop.handleDrop(event, { resourceId, slotIndex });\n }\n }}\n dropTargetSlotIndex={\n dragDrop.dropTarget?.resourceId === resource.id\n ? dragDrop.dropTarget.slotIndex\n : undefined\n }\n withDragSlotSelect={withDragSlotSelect}\n onSlotPointerDown={slotDragSelect.handleSlotPointerDown}\n isSlotDragSelected={slotDragSelect.isSlotSelected}\n rowSlotsContainerRef={(node) => {\n rowSlotsContainersRef.current[resourceIndex] = node;\n }}\n renderResourceLabel={renderResourceLabel}\n renderGroupLabel={renderGroupLabel}\n scrolledX={scrolledX}\n groupInfo={hasGroups ? resourceGroupMap[resourceIndex] : undefined}\n allDayCount={maxAllDayCount}\n >\n {eventNodes}\n </ResourcesWeekViewRow>\n );\n });\n\n const headerLabel = getWeekLabel({\n weekdays,\n locale: ctx.getLocale(locale),\n weekLabelFormat: weekLabelFormat!,\n renderWeekLabel,\n });\n\n const indicatorLeftPercent =\n todayDayIndex >= 0 ? ((todayDayIndex + timeIndicatorOffset / 100) / weekdays.length) * 100 : 0;\n\n const content = (\n <Box\n {...getStyles('resourcesWeekView')}\n mod={{\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n resizing: eventResize.isResizing,\n 'event-interaction': eventResize.isResizing || dragDrop.dragContextValue.isDragging,\n }}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"week\"\n navigationHandlers={{\n previous: () => previousWeek(date, ctx.getFirstDayOfWeek(firstDayOfWeek)),\n next: () => nextWeek(date, ctx.getFirstDayOfWeek(firstDayOfWeek)),\n today: () => toDateString(resolveNow()),\n }}\n control={{\n miw: 180,\n title: headerLabel,\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('resourcesWeekViewRoot')}>\n <ScrollArea\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesWeekViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n onScrollPositionChange={(position) => {\n scrollAreaProps?.onScrollPositionChange?.(position);\n setScrolled(position.y !== 0);\n setScrolledX(position.x !== 0);\n }}\n viewportRef={mergedViewportRef}\n >\n <div {...getStyles('resourcesWeekViewInner')}>\n <div {...getStyles('resourcesWeekViewHeaderRows')}>\n <div\n {...getStyles('resourcesWeekViewCorner')}\n key=\"corner\"\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n <div {...getStyles('resourcesWeekViewHeaderContent')}>\n <div {...getStyles('resourcesWeekViewDayLabelsRow')}>{dayLabels}</div>\n <Box {...getStyles('resourcesWeekViewTimeLabelsRow')} mod={{ scrolled }}>\n {timeLabels}\n </Box>\n </div>\n </div>\n\n {rows}\n\n {showTimeIndicator && (\n <Box\n {...getStyles('resourcesWeekViewCurrentTimeIndicator')}\n __vars={{\n '--indicator-left-offset': hasGroups\n ? `calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width) + (100% - var(--resources-week-view-resource-label-width) - var(--resources-week-view-group-label-width)) * ${indicatorLeftPercent} / 100)`\n : `calc(var(--resources-week-view-resource-label-width) + (100% - var(--resources-week-view-resource-label-width)) * ${indicatorLeftPercent} / 100)`,\n '--_time-bubble-width': formattedCurrentTime\n ?.toString()\n .toLowerCase()\n .includes('m')\n ? '64px'\n : '46px',\n }}\n >\n {withCurrentTimeBubble && (\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorTimeBubble')}>\n {formattedCurrentTime}\n </div>\n )}\n {!withCurrentTimeBubble && (\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorThumb')} />\n )}\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorLine')} />\n </Box>\n )}\n </div>\n </ScrollArea>\n </Box>\n </Box>\n );\n\n const dragContextValue = useMemo<DragContextValue>(\n () => dragDrop.dragContextValue,\n [dragDrop.dragContextValue]\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nResourcesWeekView.displayName = '@mantine/schedule/ResourcesWeekView';\nResourcesWeekView.classes = classes;\nResourcesWeekView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoOA,MAAM,eAAe;CACnB,kBAAkB;CAClB,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,iBAAiB;CACjB,cAAc;CACd,YAAY;CACZ,iBAAiB;CACjB,eAAe;CACf,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CAAA;OAC/D;;KAEJ;;GACK,CAAA;EACT,CAAA,CACF;;CAGP,MAAM,oBAAA,GAAA,MAAA,QAAA,OACE,SAAS,kBACf,CAAC,SAAS,gBAAgB,CAC5B;CAEA,IAAI,uBACF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACiB,oBAAAA,YAAY,UAAb;EAAsB,OAAO;YAAmB;CAA8B,CAAA;CAGvF,OAAO;AACT,CAAC;AAED,kBAAkB,cAAc;AAChC,kBAAkB,UAAUf,iCAAAA;AAC5B,kBAAkB,eAAe"}
1
+ {"version":3,"file":"ResourcesWeekView.cjs","names":["createVarsResolver","getRadius","rem","factory","useProps","useStyles","useResolvedStylesApi","useMantineTheme","useDirection","useState","useDatesContext","getDayTimeIntervals","useMemo","getOrderedResources","getWeekDays","useMounted","getCurrentTimePosition","isInTimeRange","formatDate","useRef","useCallback","calculateDropTime","useDragDropHandlers","getGroupToResourceIdMap","useSlotDragSelect","useHorizontalEventResize","getResourcesWeekViewEvents","Box","getBusinessHoursMod","useMergedRef","classes","getIndexFromDragPoint","ScheduleBackgroundEvent","isAllDayEvent","getTimeAxisEventStyle","ScheduleEvent","getOverlapClusters","MoreEvents","ResourcesWeekViewRow","getDayPosition","getWeekLabel","ScheduleHeaderBase","previousWeek","nextWeek","toDateString","ScrollArea","getLabel","DragContext"],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n rem,\n ScrollArea,\n ScrollAreaProps,\n StylesApiProps,\n useDirection,\n useMantineTheme,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useInterval, useIsomorphicEffect, useMergedRef, useMounted } from '@mantine/hooks';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n AnyDateValue,\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n formatDate,\n getBusinessHoursMod,\n getDayPosition,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n getTimeAxisEventStyle,\n getWeekDays,\n handleResourcesGridKeyDown,\n isAllDayEvent,\n isInTimeRange,\n nextWeek,\n previousWeek,\n ResourcesGridControlsRef,\n toDateString,\n} from '../../utils';\nimport { DragContext, DragContextValue } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { getOverlapClusters } from '../ResourcesDayView/get-overlap-clusters/get-overlap-clusters';\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getWeekLabel } from '../WeekView/get-week-label/get-week-label';\nimport { getResourcesWeekViewEvents } from './get-resources-week-view-events/get-resources-week-view-events';\nimport { ResourcesWeekViewRow } from './ResourcesWeekViewRow';\nimport classes from './ResourcesWeekView.module.css';\n\nexport type ResourcesWeekViewStylesNames =\n | 'resourcesWeekView'\n | 'resourcesWeekViewRoot'\n | 'resourcesWeekViewInner'\n | 'resourcesWeekViewHeaderRows'\n | 'resourcesWeekViewHeaderContent'\n | 'resourcesWeekViewDayLabelsRow'\n | 'resourcesWeekViewDayLabel'\n | 'resourcesWeekViewTimeLabelsRow'\n | 'resourcesWeekViewScrollArea'\n | 'resourcesWeekViewCorner'\n | 'resourcesWeekViewTimeLabel'\n | 'resourcesWeekViewResourceLabel'\n | 'resourcesWeekViewRow'\n | 'resourcesWeekViewRowSlot'\n | 'resourcesWeekViewRowSlots'\n | 'resourcesWeekViewBackgroundEvent'\n | 'resourcesWeekViewAllDayEvent'\n | 'resourcesWeekViewCurrentTimeIndicator'\n | 'resourcesWeekViewCurrentTimeIndicatorLine'\n | 'resourcesWeekViewCurrentTimeIndicatorThumb'\n | 'resourcesWeekViewCurrentTimeIndicatorTimeBubble'\n | 'resourcesWeekViewEventWrapper'\n | 'resourcesWeekViewDragPreview'\n | 'resourcesWeekViewResizeHandle'\n | 'resourcesWeekViewGroupColumn'\n | 'resourcesWeekViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesWeekViewCssVariables = {\n resourcesWeekView:\n | '--resources-week-view-radius'\n | '--resources-week-view-slot-width'\n | '--resources-week-view-row-height'\n | '--resources-week-view-group-label-width';\n};\n\nexport interface ResourcesWeekViewProps\n extends BoxProps, StylesApiProps<ResourcesWeekViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n date: Date | string;\n onDateChange?: (value: DateStringValue) => void;\n resources: ScheduleResourceData[];\n startTime?: string;\n endTime?: string;\n /** Number of minutes for each interval in the week view. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours (e.g. `120`, `240`) @default 60 */\n intervalMinutes?: number;\n /** Minimum on-screen size of an event along the time axis, in px. Prevents very short events from collapsing. Larger values make brief events easier to see but extend them past their real start time. @default 1 */\n minEventSize?: number;\n slotLabelFormat?: DateLabelFormat;\n radius?: MantineRadius;\n /** Date and time to scroll to on initial render, in `YYYY-MM-DD HH:mm:ss` format */\n startScrollDateTime?: string;\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n locale?: string;\n withCurrentTimeIndicator?: boolean;\n withCurrentTimeBubble?: boolean;\n\n /** A function to get the current time, called on every tick. Can be used to display the current time indicator in a different timezone. @default () => dayjs() */\n getCurrentTime?: () => AnyDateValue;\n\n withHeader?: boolean;\n onViewChange?: (view: ScheduleViewLevel) => void;\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n weekLabelFormat?: DateLabelFormat;\n renderWeekLabel?: (params: {\n weekStart: DateStringValue;\n weekEnd: DateStringValue;\n }) => React.ReactNode;\n events?: ScheduleEventData[];\n slotWidth?: React.CSSProperties['width'];\n rowHeight?: React.CSSProperties['height'];\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n renderEventBody?: RenderEventBody;\n renderEvent?: RenderEvent;\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 withEventsDragAndDrop?: boolean;\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n canDragEvent?: (event: ScheduleEventData) => boolean;\n /** Snap step for moving events by drag and drop, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventDragInterval?: number;\n onEventDragStart?: (event: ScheduleEventData) => void;\n onEventDragEnd?: () => void;\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick` @default false */\n withInteractiveBackgroundEvents?: boolean;\n withDragSlotSelect?: boolean;\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n mode?: ScheduleMode;\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** If true, events can be resized by dragging their left/right edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for resizing events, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventResizeInterval?: number;\n\n recurrenceExpansionLimit?: number;\n\n /** Maximum number of events visible per time slot before \"+more\" indicator shows, minimum value is 1 @default 2 */\n maxEventsPerTimeSlot?: number;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n firstDayOfWeek?: DayOfWeek;\n weekendDays?: DayOfWeek[];\n withWeekendDays?: boolean;\n weekdayFormat?: DateLabelFormat;\n highlightToday?: boolean;\n}\n\nexport type ResourcesWeekViewFactory = Factory<{\n props: ResourcesWeekViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesWeekViewStylesNames;\n vars: ResourcesWeekViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'ResourcesWeekView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n slotLabelFormat: 'HH:mm',\n intervalMinutes: 60,\n minEventSize: 1,\n withHeader: true,\n weekLabelFormat: 'MMM DD',\n weekdayFormat: 'ddd D',\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withEventResize: false,\n withDragSlotSelect: false,\n withWeekendDays: true,\n withCurrentTimeBubble: true,\n highlightToday: true,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n withInteractiveBackgroundEvents: false,\n} satisfies Partial<ResourcesWeekViewProps>;\n\nconst varsResolver = createVarsResolver<ResourcesWeekViewFactory>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesWeekView: {\n '--resources-week-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-week-view-slot-width': rem(slotWidth),\n '--resources-week-view-row-height': rem(rowHeight),\n '--resources-week-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nexport const ResourcesWeekView = factory<ResourcesWeekViewFactory>((_props) => {\n const props = useProps('ResourcesWeekView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n startTime,\n endTime,\n date,\n onDateChange,\n resources,\n intervalMinutes,\n minEventSize,\n slotLabelFormat,\n radius,\n startScrollDateTime,\n scrollAreaProps,\n locale,\n withCurrentTimeIndicator: _withCurrentTimeIndicator,\n withCurrentTimeBubble,\n getCurrentTime,\n __staticSelector,\n withHeader,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n weekLabelFormat,\n renderWeekLabel,\n events,\n slotWidth,\n rowHeight,\n labels,\n highlightBusinessHours,\n businessHours,\n renderEventBody,\n renderEvent,\n renderResourceLabel,\n groups,\n renderGroupLabel,\n groupLabelWidth,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n eventDragInterval,\n onEventDragStart,\n onEventDragEnd,\n withEventResize,\n onEventResize,\n canResizeEvent,\n eventResizeInterval,\n onTimeSlotClick,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n firstDayOfWeek,\n weekendDays,\n withWeekendDays,\n weekdayFormat,\n highlightToday,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot =\n _maxEventsPerTimeSlot !== undefined ? Math.max(1, _maxEventsPerTimeSlot) : undefined;\n\n const getStyles = useStyles<ResourcesWeekViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n attributes,\n rootSelector: 'resourcesWeekView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesWeekViewFactory>({\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 { dir } = useDirection();\n const [scrolled, setScrolled] = useState(false);\n const [scrolledX, setScrolledX] = useState(false);\n const ctx = useDatesContext();\n const slots = getDayTimeIntervals({ startTime, endTime, intervalMinutes });\n const { orderedResources, groupRanges, resourceGroupMap } = useMemo(\n () => getOrderedResources(resources, groups),\n [resources, groups]\n );\n const hasGroups = groupRanges.length > 0;\n\n const weekdays = useMemo(\n () =>\n getWeekDays({\n week: date,\n withWeekendDays,\n weekendDays: ctx.getWeekendDays(weekendDays),\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n }),\n [date, withWeekendDays, weekendDays, firstDayOfWeek, ctx]\n );\n\n const totalSlotsPerDay = slots.length;\n\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const now = resolveNow();\n const isToday = weekdays.some((day) => dayjs(day).isSame(now, 'day'));\n const withCurrentTimeIndicator = _withCurrentTimeIndicator ?? isToday;\n\n const mounted = useMounted();\n const [, setTimeIndicatorTick] = useState(0);\n useInterval(() => setTimeIndicatorTick((tick) => tick + 1), 60000, { autoInvoke: true });\n const timeIndicatorOffset = getCurrentTimePosition({ startTime, endTime, intervalMinutes, now });\n\n const todayDayIndex = weekdays.findIndex((day) => dayjs(day).isSame(now, 'day'));\n const showTimeIndicator =\n mounted &&\n withCurrentTimeIndicator &&\n todayDayIndex >= 0 &&\n isInTimeRange({ date: now.toDate(), startTime, endTime });\n const formattedCurrentTime = withCurrentTimeBubble\n ? formatDate({ locale: ctx.getLocale(locale), date: now, format: slotLabelFormat })\n : '';\n\n type DropTargetSlot = { resourceId: string | number; slotIndex: number };\n\n const dragOffsetRef = useRef<{ offset: number; size: number }>({ offset: 0, size: 0 });\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetSlot) => {\n if (!onExternalEventDrop) {\n return;\n }\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotDay = weekdays[dayIndex];\n if (slotDay) {\n const slotDate = dayjs(slotDay).format('YYYY-MM-DD');\n const slotTime = slots[slotInDay].startTime;\n let dropDateTime: string = `${slotDate} ${slotTime}`;\n\n if (eventDragInterval != null) {\n const { start } = calculateDropTime({\n draggedEvent: { start: dropDateTime, end: dropDateTime } as ScheduleEventData,\n targetDate: slotDate,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: dragOffsetRef.current.offset,\n slotSize: dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n dropDateTime = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n }\n\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime,\n resourceId: target.resourceId,\n });\n }\n },\n [\n onExternalEventDrop,\n slots,\n weekdays,\n totalSlotsPerDay,\n eventDragInterval,\n intervalMinutes,\n startTime,\n endTime,\n ]\n );\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const getDropTimeForSlot = (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotTime = slots[slotInDay].startTime;\n const targetDay = weekdays[dayIndex] || weekdays[0];\n return calculateDropTime({\n draggedEvent,\n targetDate: targetDay,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: eventDragInterval == null ? undefined : dragOffsetRef.current.offset,\n slotSize: eventDragInterval == null ? undefined : dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n };\n\n const handleInternalEventDrop = useCallback(\n (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n [onEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetSlot>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: handleInternalEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n return getDropTimeForSlot(target, draggedEvent);\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const updateDragPreview = (target: DropTargetSlot) => {\n const draggedEvent = dragDrop.dragContextValue.draggedEvent;\n if (eventDragInterval == null || !draggedEvent) {\n return;\n }\n const { start, end } = getDropTimeForSlot(target, draggedEvent);\n const newStart = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n if (\n dragDrop.dragPreview?.start !== newStart ||\n dragDrop.dragPreview?.target.resourceId !== target.resourceId\n ) {\n dragDrop.setDragPreview({\n start: newStart,\n end: dayjs(end).format('YYYY-MM-DD HH:mm:ss'),\n target,\n });\n }\n };\n\n const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;\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 startDayIndex = Math.floor(startIndex / totalSlotsPerDay);\n const startSlotInDay = startIndex % totalSlotsPerDay;\n const endDayIndex = Math.floor(endIndex / totalSlotsPerDay);\n const endSlotInDay = endIndex % totalSlotsPerDay;\n const startDay = weekdays[startDayIndex];\n const endDay = weekdays[endDayIndex];\n if (startDay && endDay) {\n onSlotDragEnd({\n rangeStart: `${dayjs(startDay).format('YYYY-MM-DD')} ${slots[startSlotInDay].startTime}`,\n rangeEnd: `${dayjs(endDay).format('YYYY-MM-DD')} ${slots[endSlotInDay].endTime}`,\n resourceId: groupToResourceId.get(group) ?? group,\n });\n }\n },\n });\n\n const eventResize = useHorizontalEventResize({\n enabled: withEventResize,\n mode,\n startTime,\n endTime,\n intervalMinutes,\n resizeIntervalMinutes: eventResizeInterval,\n onEventResize,\n canResizeEvent,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const handleTimeSlotClick = (\n resourceId: string | number,\n day: string,\n slotTime: string,\n e: React.MouseEvent<HTMLButtonElement>\n ) => {\n if (!onTimeSlotClick) {\n return;\n }\n const slotIndex = slots.findIndex((s) => s.startTime === slotTime);\n if (slotIndex === -1) {\n return;\n }\n const slot = slots[slotIndex];\n const dayStr = dayjs(day).format('YYYY-MM-DD');\n onTimeSlotClick({\n slotStart: `${dayStr} ${slot.startTime}`,\n slotEnd: `${dayStr} ${slot.endTime}`,\n nativeEvent: e,\n resourceId,\n });\n };\n\n const weekViewEvents = useMemo(\n () =>\n getResourcesWeekViewEvents({\n events,\n resources,\n weekdays,\n startTime,\n endTime,\n intervalMinutes,\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, resources, weekdays, startTime, endTime, intervalMinutes, recurrenceExpansionLimit]\n );\n\n const dayLabels = weekdays.map((day) => {\n const d = dayjs(day);\n const today = d.isSame(now, 'day') && highlightToday;\n const weekend = ctx.getWeekendDays(weekendDays).includes(d.day() as DayOfWeek);\n\n return (\n <Box\n {...getStyles('resourcesWeekViewDayLabel')}\n key={day}\n mod={{ today, weekend }}\n style={{ width: `calc(var(--resources-week-view-slot-width) * ${totalSlotsPerDay})` }}\n >\n {formatDate({ date: d, locale: ctx.getLocale(locale), format: weekdayFormat })}\n </Box>\n );\n });\n\n const timeLabels = weekdays.flatMap((day) =>\n slots.map((interval) => {\n const dayStr = dayjs(day).format('YYYY-MM-DD');\n const intervalTime = dayjs(`${dayStr} ${interval.startTime}`);\n const label = formatDate({\n date: intervalTime,\n locale: ctx.getLocale(locale),\n format: slotLabelFormat,\n });\n\n return (\n <Box\n {...getStyles('resourcesWeekViewTimeLabel')}\n key={`${day}-${interval.startTime}`}\n mod={{\n 'hour-start': interval.isHourStart,\n ...getBusinessHoursMod({\n time: interval.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n }}\n >\n {label}\n </Box>\n );\n })\n );\n\n const slotsRef: ResourcesGridControlsRef = useRef<HTMLButtonElement[][]>([]);\n const rowSlotsContainersRef = useRef<(HTMLDivElement | null)[]>([]);\n const viewportRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n\n const firstSlotIndex = { resourceIndex: 0, slotIndex: 0 };\n\n useIsomorphicEffect(() => {\n if (!startScrollDateTime || !viewportRef.current) {\n return;\n }\n const parsed = dayjs(startScrollDateTime);\n const targetDayStr = parsed.format('YYYY-MM-DD 00:00:00');\n const targetTime = parsed.format('HH:mm:ss');\n const dayIndex = weekdays.indexOf(targetDayStr);\n if (dayIndex < 0) {\n return;\n }\n const slotInDay = slots.findIndex((s) => s.startTime >= targetTime);\n if (slotInDay < 0) {\n return;\n }\n const flatIndex = dayIndex * totalSlotsPerDay + slotInDay;\n const firstResourceSlots = slotsRef.current[0];\n if (!firstResourceSlots || firstResourceSlots.length === 0) {\n return;\n }\n const targetSlot = firstResourceSlots[flatIndex];\n if (!targetSlot) {\n return;\n }\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const cornerEl = viewportRef.current.querySelector(`.${classes.resourcesWeekViewCorner}`);\n const labelWidth = cornerEl ? cornerEl.getBoundingClientRect().width : 0;\n viewportRef.current.scrollTo({\n left: slotRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n }, []);\n\n const getSlotIndexFromDragPoint = useCallback(\n (event: React.DragEvent, resourceIndex: number) => {\n const daySlots = slotsRef.current[resourceIndex] ?? [];\n const index = getIndexFromDragPoint(daySlots, event.clientX);\n if (index !== null) {\n const rect = daySlots[index]?.getBoundingClientRect();\n if (rect) {\n const rawOffset = dir === 'rtl' ? rect.right - event.clientX : event.clientX - rect.left;\n dragOffsetRef.current = {\n offset: Math.max(0, Math.min(rect.width, rawOffset)),\n size: rect.width,\n };\n }\n }\n return index;\n },\n [dir]\n );\n\n const handleSlotKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => {\n handleResourcesGridKeyDown({\n controlsRef: slotsRef,\n resourceIndex,\n slotIndex,\n event,\n });\n };\n\n const dayWidthPercent = 100 / weekdays.length;\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n const eventNodes: React.ReactNode[] = [];\n const resourceAllDayBars = weekViewEvents.allDayBars[resource.id] ?? [];\n const maxAllDayCount = resourceAllDayBars.reduce((max, bar) => Math.max(max, bar.row + 1), 0);\n\n weekdays.forEach((day, dayIndex) => {\n const dayEvents = weekViewEvents.byDay[day];\n if (!dayEvents) {\n return;\n }\n\n const dayOffsetPercent = (dayIndex / weekdays.length) * 100;\n\n const bgEvents = [\n ...(dayEvents.backgroundTimedEvents[resource.id] || []),\n ...(dayEvents.backgroundAllDayEvents[resource.id] || []),\n ];\n for (const event of bgEvents) {\n eventNodes.push(\n <ScheduleBackgroundEvent\n key={`bg-${event.id}-${day}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('resourcesWeekViewBackgroundEvent', {\n style: {\n left: `${dayOffsetPercent + (event.position.top / 100) * dayWidthPercent}%`,\n width: `${(event.position.height / 100) * dayWidthPercent}%`,\n top: 0,\n height: '100%',\n },\n })}\n />\n );\n }\n\n const allRegularEvents = (dayEvents.regularEvents[resource.id] || []).filter(\n (event) => !isAllDayEvent({ event, date: day })\n );\n\n const visibleEvents =\n maxEventsPerTimeSlot !== undefined\n ? allRegularEvents.filter((event) => event.position.column < maxEventsPerTimeSlot)\n : allRegularEvents;\n\n for (const event of visibleEvents) {\n const isDraggable = dragDrop.isDraggableEvent(event);\n const isResizable = eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const isThisEventResizing = resizePosition !== null;\n const activeEdge =\n isThisEventResizing && eventResize.resizingEdge ? eventResize.resizingEdge : null;\n\n const effectiveTop = resizePosition ? resizePosition.left : event.position.top;\n const effectiveHeight = resizePosition ? resizePosition.width : event.position.height;\n const eventLeft = dayOffsetPercent + (effectiveTop / 100) * dayWidthPercent;\n const eventWidth = (effectiveHeight / 100) * dayWidthPercent;\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 adjustPosition =\n maxEventsPerTimeSlot !== undefined && event.position.overlaps > maxEventsPerTimeSlot;\n\n const eventDate = dayjs(day).format('YYYY-MM-DD');\n\n eventNodes.push(\n <Box\n key={`${event.id}-${day}`}\n {...getStyles('resourcesWeekViewEventWrapper')}\n __vars={eventColors ? { '--event-color': eventColors.color } : undefined}\n data-resizing={isThisEventResizing || undefined}\n style={{\n ...getTimeAxisEventStyle({\n start: eventLeft,\n span: eventWidth,\n minSize: minEventSize,\n }),\n top: adjustPosition\n ? `calc((100% - 22px) * ${event.position.column} / ${maxEventsPerTimeSlot})`\n : `${event.position.offset}%`,\n height: adjustPosition\n ? `calc((100% - 22px) / ${maxEventsPerTimeSlot})`\n : `${event.position.width}%`,\n }}\n >\n <ScheduleEvent\n event={event}\n autoSize\n nowrap\n draggable={isDraggable}\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%', padding: 0 }}\n />\n {isResizable && mode !== 'static' && (\n <>\n <div\n {...getStyles('resourcesWeekViewResizeHandle')}\n data-edge=\"start\"\n data-active={activeEdge === 'start' || undefined}\n onPointerDown={(e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge: 'start',\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }}\n />\n <div\n {...getStyles('resourcesWeekViewResizeHandle')}\n data-edge=\"end\"\n data-active={activeEdge === 'end' || undefined}\n onPointerDown={(e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge: 'end',\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }}\n />\n </>\n )}\n </Box>\n );\n }\n\n if (maxEventsPerTimeSlot !== undefined) {\n const clusters = getOverlapClusters(allRegularEvents);\n for (const cluster of clusters) {\n const hiddenCount = cluster.filter(\n (e) => e.position.column >= maxEventsPerTimeSlot\n ).length;\n\n if (hiddenCount > 0 && mode !== 'static') {\n const leftPercent =\n dayOffsetPercent +\n (Math.min(...cluster.map((e) => e.position.top)) / 100) * dayWidthPercent;\n const rightPercent =\n dayOffsetPercent +\n (Math.max(...cluster.map((e) => e.position.top + e.position.height)) / 100) *\n dayWidthPercent;\n\n eventNodes.push(\n <MoreEvents\n key={`more-${resource.id}-${day}-${cluster[0].id}`}\n events={cluster}\n moreEventsCount={hiddenCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n left: `calc(${leftPercent}% + 1px)`,\n width: `calc(${rightPercent - leftPercent}% - 2px)`,\n bottom: 0,\n height: '22px',\n paddingInline: 4,\n zIndex: 4,\n }}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n );\n }\n }\n }\n });\n\n const stickyLabelOffset = hasGroups\n ? 'calc(var(--resources-week-view-group-label-width) + var(--resources-week-view-resource-label-width) + 5px)'\n : 'calc(var(--resources-week-view-resource-label-width) + 5px)';\n\n resourceAllDayBars.forEach((bar) => {\n const leftPercent = bar.startDayIndex * dayWidthPercent;\n const widthPercent = (bar.endDayIndex - bar.startDayIndex + 1) * dayWidthPercent;\n\n eventNodes.push(\n <div\n key={`all-day-${bar.event.id}-${bar.startDayIndex}`}\n {...getStyles('resourcesWeekViewAllDayEvent', {\n style: {\n left: `calc(${leftPercent}% + 1px)`,\n width: `calc(${widthPercent}% - 2px)`,\n top: `calc(${bar.row} * (var(--resources-week-view-all-day-height) + 2px) + 2px)`,\n },\n })}\n >\n <ScheduleEvent\n event={bar.event}\n autoSize\n nowrap\n renderEventBody={(barEvent) => (\n <span\n style={{\n position: 'sticky',\n insetInlineStart: stickyLabelOffset,\n display: 'inline-block',\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {renderEventBody ? renderEventBody(barEvent) : barEvent.title}\n </span>\n )}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(bar.event, e) : undefined}\n style={{ width: '100%', height: '100%', overflow: 'visible' }}\n styles={{\n eventInner: {\n display: 'block',\n overflow: 'visible',\n lineHeight: 'var(--resources-week-view-all-day-height)',\n },\n }}\n />\n </div>\n );\n });\n\n return (\n <ResourcesWeekViewRow\n key={resource.id}\n resource={resource}\n resourceIndex={resourceIndex}\n weekdays={weekdays}\n slots={slots}\n getStyles={getStyles}\n labels={labels}\n highlightBusinessHours={highlightBusinessHours}\n businessHours={businessHours}\n withEventsDragAndDrop={withDragHandlers}\n mode={mode}\n slotsRef={slotsRef}\n firstSlotIndex={firstSlotIndex}\n onSlotKeyDown={handleSlotKeyDown}\n onSlotClick={handleTimeSlotClick}\n onRowSlotsDragOver={(event, resourceId, resIdx) => {\n const slotIndex = getSlotIndexFromDragPoint(event, resIdx);\n if (slotIndex !== null) {\n dragDrop.handleDragOver(event, { resourceId, slotIndex });\n updateDragPreview({ resourceId, slotIndex });\n }\n }}\n onRowSlotsDragLeave={dragDrop.handleDragLeave}\n onRowSlotsDrop={(event, resourceId, resIdx) => {\n const slotIndex = getSlotIndexFromDragPoint(event, resIdx);\n if (slotIndex !== null) {\n dragDrop.handleDrop(event, { resourceId, slotIndex });\n }\n }}\n dropTargetSlotIndex={\n !suppressDropHighlight && dragDrop.dropTarget?.resourceId === resource.id\n ? dragDrop.dropTarget.slotIndex\n : undefined\n }\n withDragSlotSelect={withDragSlotSelect}\n onSlotPointerDown={slotDragSelect.handleSlotPointerDown}\n isSlotDragSelected={slotDragSelect.isSlotSelected}\n rowSlotsContainerRef={(node) => {\n rowSlotsContainersRef.current[resourceIndex] = node;\n }}\n renderResourceLabel={renderResourceLabel}\n renderGroupLabel={renderGroupLabel}\n scrolledX={scrolledX}\n groupInfo={hasGroups ? resourceGroupMap[resourceIndex] : undefined}\n allDayCount={maxAllDayCount}\n >\n {eventNodes}\n {dragDrop.dragPreview?.target.resourceId === resource.id &&\n dragDrop.dragContextValue.draggedEvent && (\n <Box\n {...getStyles('resourcesWeekViewDragPreview', {\n style: (() => {\n const previewDayIndex = Math.floor(\n dragDrop.dragPreview.target.slotIndex / totalSlotsPerDay\n );\n const { top, height } = getDayPosition({\n event: {\n ...dragDrop.dragContextValue.draggedEvent,\n start: dragDrop.dragPreview.start,\n end: dragDrop.dragPreview.end,\n },\n startTime,\n endTime,\n intervalMinutes,\n });\n const dayOffsetPercent = (previewDayIndex / weekdays.length) * 100;\n const eventLeft = dayOffsetPercent + (top / 100) * dayWidthPercent;\n const eventWidth = (height / 100) * dayWidthPercent;\n return {\n position: 'absolute',\n insetBlockStart: 0,\n insetBlockEnd: 0,\n ...getTimeAxisEventStyle({\n start: eventLeft,\n span: eventWidth,\n axis: 'horizontal',\n }),\n };\n })(),\n })}\n />\n )}\n </ResourcesWeekViewRow>\n );\n });\n\n const headerLabel = getWeekLabel({\n weekdays,\n locale: ctx.getLocale(locale),\n weekLabelFormat: weekLabelFormat!,\n renderWeekLabel,\n });\n\n const indicatorLeftPercent =\n todayDayIndex >= 0 ? ((todayDayIndex + timeIndicatorOffset / 100) / weekdays.length) * 100 : 0;\n\n const content = (\n <Box\n {...getStyles('resourcesWeekView')}\n mod={{\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n resizing: eventResize.isResizing,\n 'event-interaction': eventResize.isResizing || dragDrop.dragContextValue.isDragging,\n }}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"week\"\n navigationHandlers={{\n previous: () => previousWeek(date, ctx.getFirstDayOfWeek(firstDayOfWeek)),\n next: () => nextWeek(date, ctx.getFirstDayOfWeek(firstDayOfWeek)),\n today: () => toDateString(resolveNow()),\n }}\n control={{\n miw: 180,\n title: headerLabel,\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('resourcesWeekViewRoot')}>\n <ScrollArea\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesWeekViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n onScrollPositionChange={(position) => {\n scrollAreaProps?.onScrollPositionChange?.(position);\n setScrolled(position.y !== 0);\n setScrolledX(position.x !== 0);\n }}\n viewportRef={mergedViewportRef}\n >\n <div {...getStyles('resourcesWeekViewInner')}>\n <div {...getStyles('resourcesWeekViewHeaderRows')}>\n <div\n {...getStyles('resourcesWeekViewCorner')}\n key=\"corner\"\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n <div {...getStyles('resourcesWeekViewHeaderContent')}>\n <div {...getStyles('resourcesWeekViewDayLabelsRow')}>{dayLabels}</div>\n <Box {...getStyles('resourcesWeekViewTimeLabelsRow')} mod={{ scrolled }}>\n {timeLabels}\n </Box>\n </div>\n </div>\n\n {rows}\n\n {showTimeIndicator && (\n <Box\n {...getStyles('resourcesWeekViewCurrentTimeIndicator')}\n __vars={{\n '--indicator-left-offset': hasGroups\n ? `calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width) + (100% - var(--resources-week-view-resource-label-width) - var(--resources-week-view-group-label-width)) * ${indicatorLeftPercent} / 100)`\n : `calc(var(--resources-week-view-resource-label-width) + (100% - var(--resources-week-view-resource-label-width)) * ${indicatorLeftPercent} / 100)`,\n '--_time-bubble-width': formattedCurrentTime\n ?.toString()\n .toLowerCase()\n .includes('m')\n ? '64px'\n : '46px',\n }}\n >\n {withCurrentTimeBubble && (\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorTimeBubble')}>\n {formattedCurrentTime}\n </div>\n )}\n {!withCurrentTimeBubble && (\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorThumb')} />\n )}\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorLine')} />\n </Box>\n )}\n </div>\n </ScrollArea>\n </Box>\n </Box>\n );\n\n const dragContextValue = useMemo<DragContextValue>(\n () => dragDrop.dragContextValue,\n [dragDrop.dragContextValue]\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nResourcesWeekView.displayName = '@mantine/schedule/ResourcesWeekView';\nResourcesWeekView.classes = classes;\nResourcesWeekView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+OA,MAAM,eAAe;CACnB,kBAAkB;CAClB,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,iBAAiB;CACjB,cAAc;CACd,YAAY;CACZ,iBAAiB;CACjB,eAAe;CACf,wBAAwB;CACxB,eAAe,CAAC,YAAY,UAAU;CACtC,uBAAuB;CACvB,iBAAiB;CACjB,oBAAoB;CACpB,iBAAiB;CACjB,uBAAuB;CACvB,gBAAgB;CAChB,MAAM;CACN,sBAAsB;CACtB,iCAAiC;AACnC;AAEA,MAAM,gBAAA,GAAeA,cAAAA,mBAAAA,EAClB,QAAQ,EAAE,QAAQ,WAAW,WAAW,uBAAuB,EAC9D,mBAAmB;CACjB,gCAAgC,UAAA,GAASC,cAAAA,UAAAA,CAAU,MAAM,IAAI,KAAA;CAC7D,qCAAA,GAAoCC,cAAAA,IAAAA,CAAI,SAAS;CACjD,qCAAA,GAAoCA,cAAAA,IAAAA,CAAI,SAAS;CACjD,4CAAA,GAA2CA,cAAAA,IAAAA,CAAI,eAAe;AAChE,EACF,EACF;AAEA,MAAa,qBAAA,GAAoBC,cAAAA,QAAAA,EAAmC,WAAW;CAC7E,MAAM,SAAA,GAAQC,cAAAA,SAAAA,CAAS,qBAAqB,cAAc,MAAM;CAChE,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,YACA,MACA,WACA,SACA,MACA,cACA,WACA,iBACA,cACA,iBACA,QACA,qBACA,iBACA,QACA,0BAA0B,2BA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