@mantine/schedule 9.7.2 → 9.7.3

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 (105) hide show
  1. package/cjs/components/DayView/DayView.cjs +45 -29
  2. package/cjs/components/DayView/DayView.cjs.map +1 -1
  3. package/cjs/components/DayView/DayView.module.cjs.map +1 -1
  4. package/cjs/components/MobileMonthView/MobileMonthView.cjs +54 -22
  5. package/cjs/components/MobileMonthView/MobileMonthView.cjs.map +1 -1
  6. package/cjs/components/MobileMonthView/MobileMonthView.module.cjs.map +1 -1
  7. package/cjs/components/MobileMonthView/get-mobile-month-view-weeks.cjs +32 -0
  8. package/cjs/components/MobileMonthView/get-mobile-month-view-weeks.cjs.map +1 -0
  9. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +15 -7
  10. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
  11. package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs.map +1 -1
  12. package/cjs/components/ResourcesDayView/ResourcesDayViewColumn.cjs +11 -6
  13. package/cjs/components/ResourcesDayView/ResourcesDayViewColumn.cjs.map +1 -1
  14. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +15 -7
  15. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
  16. package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs.map +1 -1
  17. package/cjs/components/ResourcesWeekView/ResourcesWeekViewRow.cjs +11 -6
  18. package/cjs/components/ResourcesWeekView/ResourcesWeekViewRow.cjs.map +1 -1
  19. package/cjs/components/Schedule/Schedule.cjs +2 -0
  20. package/cjs/components/Schedule/Schedule.cjs.map +1 -1
  21. package/cjs/components/WeekView/WeekView.cjs +29 -19
  22. package/cjs/components/WeekView/WeekView.cjs.map +1 -1
  23. package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
  24. package/cjs/components/WeekView/WeekViewDay.cjs +13 -7
  25. package/cjs/components/WeekView/WeekViewDay.cjs.map +1 -1
  26. package/cjs/components/YearView/YearView.cjs +1 -1
  27. package/cjs/components/YearView/YearView.cjs.map +1 -1
  28. package/cjs/components/YearView/YearViewMonth.cjs +1 -1
  29. package/cjs/components/YearView/YearViewMonth.cjs.map +1 -1
  30. package/cjs/index.cjs +10 -0
  31. package/cjs/utils/add-minutes-to-time/add-minutes-to-time.cjs +17 -0
  32. package/cjs/utils/add-minutes-to-time/add-minutes-to-time.cjs.map +1 -0
  33. package/cjs/utils/clamp-slot-label-interval/clamp-slot-label-interval.cjs +22 -0
  34. package/cjs/utils/clamp-slot-label-interval/clamp-slot-label-interval.cjs.map +1 -0
  35. package/cjs/utils/get-business-hours-mod/get-business-hours-mod.cjs +74 -17
  36. package/cjs/utils/get-business-hours-mod/get-business-hours-mod.cjs.map +1 -1
  37. package/cjs/utils/get-day-time-intervals/get-day-time-intervals.cjs +7 -2
  38. package/cjs/utils/get-day-time-intervals/get-day-time-intervals.cjs.map +1 -1
  39. package/cjs/utils/get-slot-label-groups/get-slot-label-groups.cjs +26 -0
  40. package/cjs/utils/get-slot-label-groups/get-slot-label-groups.cjs.map +1 -0
  41. package/cjs/{components/YearView → utils/get-visible-week-days}/get-visible-week-days.cjs +1 -1
  42. package/cjs/utils/get-visible-week-days/get-visible-week-days.cjs.map +1 -0
  43. package/esm/components/DayView/DayView.mjs +46 -30
  44. package/esm/components/DayView/DayView.mjs.map +1 -1
  45. package/esm/components/DayView/DayView.module.mjs.map +1 -1
  46. package/esm/components/MobileMonthView/MobileMonthView.mjs +54 -22
  47. package/esm/components/MobileMonthView/MobileMonthView.mjs.map +1 -1
  48. package/esm/components/MobileMonthView/MobileMonthView.module.mjs.map +1 -1
  49. package/esm/components/MobileMonthView/get-mobile-month-view-weeks.mjs +30 -0
  50. package/esm/components/MobileMonthView/get-mobile-month-view-weeks.mjs.map +1 -0
  51. package/esm/components/ResourcesDayView/ResourcesDayView.mjs +16 -8
  52. package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
  53. package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs.map +1 -1
  54. package/esm/components/ResourcesDayView/ResourcesDayViewColumn.mjs +12 -7
  55. package/esm/components/ResourcesDayView/ResourcesDayViewColumn.mjs.map +1 -1
  56. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +16 -8
  57. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
  58. package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs.map +1 -1
  59. package/esm/components/ResourcesWeekView/ResourcesWeekViewRow.mjs +12 -7
  60. package/esm/components/ResourcesWeekView/ResourcesWeekViewRow.mjs.map +1 -1
  61. package/esm/components/Schedule/Schedule.mjs +2 -0
  62. package/esm/components/Schedule/Schedule.mjs.map +1 -1
  63. package/esm/components/WeekView/WeekView.mjs +30 -20
  64. package/esm/components/WeekView/WeekView.mjs.map +1 -1
  65. package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
  66. package/esm/components/WeekView/WeekViewDay.mjs +14 -8
  67. package/esm/components/WeekView/WeekViewDay.mjs.map +1 -1
  68. package/esm/components/YearView/YearView.mjs +1 -1
  69. package/esm/components/YearView/YearView.mjs.map +1 -1
  70. package/esm/components/YearView/YearViewMonth.mjs +1 -1
  71. package/esm/components/YearView/YearViewMonth.mjs.map +1 -1
  72. package/esm/index.mjs +6 -2
  73. package/esm/utils/add-minutes-to-time/add-minutes-to-time.mjs +17 -0
  74. package/esm/utils/add-minutes-to-time/add-minutes-to-time.mjs.map +1 -0
  75. package/esm/utils/clamp-slot-label-interval/clamp-slot-label-interval.mjs +22 -0
  76. package/esm/utils/clamp-slot-label-interval/clamp-slot-label-interval.mjs.map +1 -0
  77. package/esm/utils/get-business-hours-mod/get-business-hours-mod.mjs +74 -18
  78. package/esm/utils/get-business-hours-mod/get-business-hours-mod.mjs.map +1 -1
  79. package/esm/utils/get-day-time-intervals/get-day-time-intervals.mjs +7 -2
  80. package/esm/utils/get-day-time-intervals/get-day-time-intervals.mjs.map +1 -1
  81. package/esm/utils/get-slot-label-groups/get-slot-label-groups.mjs +26 -0
  82. package/esm/utils/get-slot-label-groups/get-slot-label-groups.mjs.map +1 -0
  83. package/esm/{components/YearView → utils/get-visible-week-days}/get-visible-week-days.mjs +1 -1
  84. package/esm/utils/get-visible-week-days/get-visible-week-days.mjs.map +1 -0
  85. package/lib/components/DayView/DayView.d.ts +3 -1
  86. package/lib/components/MobileMonthView/MobileMonthView.d.ts +2 -0
  87. package/lib/components/MobileMonthView/get-mobile-month-view-weeks.d.ts +11 -0
  88. package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +1 -1
  89. package/lib/components/ResourcesDayView/ResourcesDayViewColumn.d.ts +2 -1
  90. package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +1 -1
  91. package/lib/components/ResourcesWeekView/ResourcesWeekViewRow.d.ts +2 -1
  92. package/lib/components/Schedule/Schedule.d.ts +1 -1
  93. package/lib/components/WeekView/WeekView.d.ts +3 -1
  94. package/lib/utils/add-minutes-to-time/add-minutes-to-time.d.ts +1 -0
  95. package/lib/utils/clamp-slot-label-interval/clamp-slot-label-interval.d.ts +9 -0
  96. package/lib/utils/get-business-hours-mod/get-business-hours-mod.d.ts +24 -5
  97. package/lib/utils/get-day-time-intervals/get-day-time-intervals.d.ts +5 -1
  98. package/lib/utils/get-slot-label-groups/get-slot-label-groups.d.ts +15 -0
  99. package/lib/utils/index.d.ts +7 -2
  100. package/package.json +4 -4
  101. package/styles.css +175 -6
  102. package/styles.layer.css +175 -6
  103. package/cjs/components/YearView/get-visible-week-days.cjs.map +0 -1
  104. package/esm/components/YearView/get-visible-week-days.mjs.map +0 -1
  105. /package/lib/{components/YearView → utils/get-visible-week-days}/get-visible-week-days.d.ts +0 -0
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { getLabel } from "../../labels.mjs";
3
3
  import { formatDate } from "../../utils/format-date/format-date.mjs";
4
+ import { clampIntervalMinutes } from "../../utils/clamp-interval-minutes/clamp-interval-minutes.mjs";
4
5
  import { getDayTimeIntervals } from "../../utils/get-day-time-intervals/get-day-time-intervals.mjs";
5
6
  import { toDateString } from "../../utils/to-date-string/to-date-string.mjs";
6
7
  import { getWeekDays } from "../../utils/get-week-days/get-week-days.mjs";
@@ -12,9 +13,10 @@ import { isAllDayEvent } from "../../utils/is-all-day-event/is-all-day-event.mjs
12
13
  import { getDayPosition } from "../../utils/get-day-position/get-day-position.mjs";
13
14
  import { getTimeAxisEventStyle } from "../../utils/get-time-axis-event-style/get-time-axis-event-style.mjs";
14
15
  import { calculateDropTime } from "../../utils/calculate-drop-time/calculate-drop-time.mjs";
15
- import { getBusinessHoursMod } from "../../utils/get-business-hours-mod/get-business-hours-mod.mjs";
16
+ import { getBusinessHoursState } from "../../utils/get-business-hours-mod/get-business-hours-mod.mjs";
16
17
  import { expandRecurringEvents } from "../../utils/expand-recurring-events/expand-recurring-events.mjs";
17
18
  import { getOrderedResources } from "../../utils/get-ordered-resources/get-ordered-resources.mjs";
19
+ import { addMinutesToTime } from "../../utils/add-minutes-to-time/add-minutes-to-time.mjs";
18
20
  import { handleResourcesGridKeyDown } from "../../utils/handle-resources-grid-key-down/handle-resources-grid-key-down.mjs";
19
21
  import { getGroupToResourceIdMap } from "../../utils/get-group-to-resource-id-map/get-group-to-resource-id-map.mjs";
20
22
  import { getIndexFromDragPoint } from "../../utils/get-index-from-drag-point/get-index-from-drag-point.mjs";
@@ -64,7 +66,9 @@ const varsResolver = createVarsResolver((_theme, { radius, slotWidth, rowHeight,
64
66
  "--resources-week-view-radius": radius ? getRadius(radius) : void 0,
65
67
  "--resources-week-view-slot-width": rem(slotWidth),
66
68
  "--resources-week-view-row-height": rem(rowHeight),
67
- "--resources-week-view-group-label-width": rem(groupLabelWidth)
69
+ "--resources-week-view-group-label-width": rem(groupLabelWidth),
70
+ "--resources-week-view-business-hours-bg": void 0,
71
+ "--resources-week-view-non-business-hours-bg": void 0
68
72
  } }));
69
73
  const ResourcesWeekView = factory((_props) => {
70
74
  const props = useProps("ResourcesWeekView", defaultProps, _props);
@@ -348,17 +352,20 @@ const ResourcesWeekView = factory((_props) => {
348
352
  locale: ctx.getLocale(locale),
349
353
  format: slotLabelFormat
350
354
  });
355
+ const labelBusinessHours = getBusinessHoursState({
356
+ time: interval.startTime,
357
+ endTime: addMinutesToTime(interval.startTime, clampIntervalMinutes(intervalMinutes)),
358
+ businessHours,
359
+ highlightBusinessHours
360
+ });
351
361
  return /* @__PURE__ */ createElement(Box, {
352
362
  ...getStyles("resourcesWeekViewTimeLabel"),
353
363
  key: `${day}-${interval.startTime}`,
354
364
  mod: {
355
365
  "hour-start": interval.isHourStart,
356
- ...getBusinessHoursMod({
357
- time: interval.startTime,
358
- businessHours,
359
- highlightBusinessHours
360
- })
361
- }
366
+ ...labelBusinessHours.mod
367
+ },
368
+ __vars: labelBusinessHours.vars
362
369
  }, label);
363
370
  }));
364
371
  const slotsRef = useRef([]);
@@ -637,6 +644,7 @@ const ResourcesWeekView = factory((_props) => {
637
644
  });
638
645
  return /* @__PURE__ */ jsxs(ResourcesWeekViewRow, {
639
646
  resource,
647
+ intervalMinutes,
640
648
  resourceIndex,
641
649
  weekdays,
642
650
  slots,
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesWeekView.mjs","names":["classes"],"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 DayPositionedEventData,\n PreventEventOverlap,\n ScheduleCanDropEventData,\n ScheduleCanDropExternalEventData,\n ScheduleCanResizeEventToData,\n ScheduleEventData,\n ScheduleEventPlacementRejectedData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n expandRecurringEvents,\n formatDate,\n getBusinessHoursMod,\n getDayPosition,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n getOverlapClusters,\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 { 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`. Combined with `withEventResize`, timed background events can also be resized by dragging their edges. @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 /** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */\n canDropEvent?: (data: ScheduleCanDropEventData) => boolean;\n\n /** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */\n canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;\n\n /** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */\n canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;\n\n /** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */\n preventEventOverlap?: PreventEventOverlap;\n\n /** Called when a drop or resize is rejected */\n onEventPlacementRejected?: (data: ScheduleEventPlacementRejectedData) => void;\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 canDropEvent,\n canDropExternalEvent,\n canResizeEventTo,\n preventEventOverlap,\n onEventPlacementRejected,\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 getExternalDropDateTime = useCallback(\n (target: DropTargetSlot) => {\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotDay = weekdays[dayIndex];\n\n if (!slotDay) {\n return null;\n }\n\n const slotDate = dayjs(slotDay).format('YYYY-MM-DD');\n const slotTime = slots[slotInDay].startTime;\n const dropDateTime = `${slotDate} ${slotTime}`;\n\n if (eventDragInterval == null) {\n return dropDateTime;\n }\n\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\n return dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n },\n [slots, weekdays, totalSlotsPerDay, eventDragInterval, intervalMinutes, startTime, endTime]\n );\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetSlot) => {\n if (!onExternalEventDrop) {\n return;\n }\n\n const dropDateTime = getExternalDropDateTime(target);\n\n if (dropDateTime === null) {\n return;\n }\n\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime,\n resourceId: target.resourceId,\n });\n },\n [onExternalEventDrop, getExternalDropDateTime]\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 expandedEvents = useMemo(\n () =>\n expandRecurringEvents({\n events,\n rangeStart: dayjs(weekdays[0]).startOf('day').toDate(),\n rangeEnd: dayjs(weekdays[weekdays.length - 1])\n .endOf('day')\n .toDate(),\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, weekdays, recurrenceExpansionLimit]\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 events: expandedEvents,\n preventEventOverlap,\n canDropEvent,\n canDropExternalEvent,\n onEventPlacementRejected,\n getExternalDropDateTime,\n getTargetResourceId: (target) => target.resourceId,\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 events: expandedEvents,\n preventEventOverlap,\n canResizeEventTo,\n onEventPlacementRejected,\n withBackgroundEvents: withInteractiveBackgroundEvents,\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 + viewportRef.current.scrollLeft - 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 pushBackgroundEvent = (event: DayPositionedEventData, allDay: boolean) => {\n const backgroundEventDate = dayjs(day).format('YYYY-MM-DD');\n const isResizable = !allDay && eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id, backgroundEventDate);\n const effectiveLeft = resizePosition ? resizePosition.left : event.position.top;\n const effectiveWidth = resizePosition ? resizePosition.width : event.position.height;\n\n eventNodes.push(\n <ScheduleBackgroundEvent<'start' | 'end'>\n key={`bg-${event.id}-${day}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={\n onEventClick\n ? (clickedEvent, e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(clickedEvent, e);\n }\n }\n : undefined\n }\n withResize={isResizable}\n isResizing={resizePosition !== null}\n activeResizeEdge={eventResize.resizingEdge}\n resizeAxis=\"horizontal\"\n resizeHandleProps={getStyles('resourcesWeekViewResizeHandle')}\n onResizeStart={\n isResizable\n ? (edge, e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: backgroundEventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n {...getStyles('resourcesWeekViewBackgroundEvent', {\n style: {\n left: `${dayOffsetPercent + (effectiveLeft / 100) * dayWidthPercent}%`,\n width: `${(effectiveWidth / 100) * dayWidthPercent}%`,\n top: 0,\n height: '100%',\n },\n })}\n />\n );\n };\n\n for (const event of dayEvents.backgroundTimedEvents[resource.id] || []) {\n pushBackgroundEvent(event, false);\n }\n\n for (const event of dayEvents.backgroundAllDayEvents[resource.id] || []) {\n pushBackgroundEvent(event, true);\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 mod={{ invalid: isThisEventResizing && !eventResize.resizeValid }}\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 mod={{ invalid: !dragDrop.dropValid }}\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqQA,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,eAAe,oBAClB,QAAQ,EAAE,QAAQ,WAAW,WAAW,uBAAuB,EAC9D,mBAAmB;CACjB,gCAAgC,SAAS,UAAU,MAAM,IAAI,KAAA;CAC7D,oCAAoC,IAAI,SAAS;CACjD,oCAAoC,IAAI,SAAS;CACjD,2CAA2C,IAAI,eAAe;AAChE,EACF,EACF;AAEA,MAAa,oBAAoB,SAAmC,WAAW;CAC7E,MAAM,QAAQ,SAAS,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,2BAC1B,uBACA,gBACA,kBACA,YACA,cACA,sBACA,kBACA,mBACA,iBACA,iBACA,iBACA,QACA,WACA,WACA,QACA,wBACA,eACA,iBACA,aACA,qBACA,QACA,kBACA,iBACA,uBACA,aACA,cACA,mBACA,kBACA,gBACA,iBACA,eACA,gBACA,cACA,sBACA,kBACA,qBACA,0BACA,qBACA,iBACA,cACA,iCACA,oBACA,eACA,MACA,qBACA,0BACA,sBAAsB,uBACtB,iBACA,gBACA,aACA,iBACA,eACA,gBACA,GAAG,WACD;CAEJ,MAAM,uBACJ,0BAA0B,KAAA,IAAY,KAAK,IAAI,GAAG,qBAAqB,IAAI,KAAA;CAE7E,MAAM,YAAY,UAAoC;EACpD,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;CAChB,CAAC;CAED,MAAM,EAAE,oBAAoB,mBAAmB,qBAA+C;EAC5F;EACA;EACA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,CAAA,CACF;OACF,CAAA,CAAA;;MAEJ;MAEA,qBACC,qBAAC,KAAD;OACE,GAAI,UAAU,uCAAuC;OACrD,QAAQ;QACN,2BAA2B,YACvB,mNAAmN,qBAAqB,WACxO,qHAAqH,qBAAqB;QAC9I,wBAAwB,sBACpB,SAAS,CAAC,CACX,YAAY,CAAC,CACb,SAAS,GAAG,IACX,SACA;OACN;OAZF,UAAA;QAcG,yBACC,oBAAC,OAAD;SAAK,GAAI,UAAU,iDAAiD;SACjE,UAAA;QACE,CAAA;QAEN,CAAC,yBACA,oBAAC,OAAD,EAAK,GAAI,UAAU,4CAA4C,EAAI,CAAA;QAErE,oBAAC,OAAD,EAAK,GAAI,UAAU,2CAA2C,EAAI,CAAA;OAC/D;;KAEJ;;GACK,CAAA;EACT,CAAA,CACF;;CAGP,MAAM,mBAAmB,cACjB,SAAS,kBACf,CAAC,SAAS,gBAAgB,CAC5B;CAEA,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO;EAAmB,UAAA;CAA8B,CAAA;CAGvF,OAAO;AACT,CAAC;AAED,kBAAkB,cAAc;AAChC,kBAAkB,UAAUA;AAC5B,kBAAkB,eAAe"}
1
+ {"version":3,"file":"ResourcesWeekView.mjs","names":["classes"],"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 DayPositionedEventData,\n PreventEventOverlap,\n ScheduleCanDropEventData,\n ScheduleCanDropExternalEventData,\n ScheduleCanResizeEventToData,\n ScheduleEventData,\n ScheduleEventPlacementRejectedData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n expandRecurringEvents,\n formatDate,\n addMinutesToTime,\n clampIntervalMinutes,\n getBusinessHoursState,\n getDayPosition,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n getOverlapClusters,\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 { 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 | '--resources-week-view-business-hours-bg'\n | '--resources-week-view-non-business-hours-bg';\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`. Combined with `withEventResize`, timed background events can also be resized by dragging their edges. @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 /** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */\n canDropEvent?: (data: ScheduleCanDropEventData) => boolean;\n\n /** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */\n canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;\n\n /** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */\n canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;\n\n /** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */\n preventEventOverlap?: PreventEventOverlap;\n\n /** Called when a drop or resize is rejected */\n onEventPlacementRejected?: (data: ScheduleEventPlacementRejectedData) => void;\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 '--resources-week-view-business-hours-bg': undefined,\n '--resources-week-view-non-business-hours-bg': undefined,\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 canDropEvent,\n canDropExternalEvent,\n canResizeEventTo,\n preventEventOverlap,\n onEventPlacementRejected,\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 getExternalDropDateTime = useCallback(\n (target: DropTargetSlot) => {\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotDay = weekdays[dayIndex];\n\n if (!slotDay) {\n return null;\n }\n\n const slotDate = dayjs(slotDay).format('YYYY-MM-DD');\n const slotTime = slots[slotInDay].startTime;\n const dropDateTime = `${slotDate} ${slotTime}`;\n\n if (eventDragInterval == null) {\n return dropDateTime;\n }\n\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\n return dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n },\n [slots, weekdays, totalSlotsPerDay, eventDragInterval, intervalMinutes, startTime, endTime]\n );\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetSlot) => {\n if (!onExternalEventDrop) {\n return;\n }\n\n const dropDateTime = getExternalDropDateTime(target);\n\n if (dropDateTime === null) {\n return;\n }\n\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime,\n resourceId: target.resourceId,\n });\n },\n [onExternalEventDrop, getExternalDropDateTime]\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 expandedEvents = useMemo(\n () =>\n expandRecurringEvents({\n events,\n rangeStart: dayjs(weekdays[0]).startOf('day').toDate(),\n rangeEnd: dayjs(weekdays[weekdays.length - 1])\n .endOf('day')\n .toDate(),\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, weekdays, recurrenceExpansionLimit]\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 events: expandedEvents,\n preventEventOverlap,\n canDropEvent,\n canDropExternalEvent,\n onEventPlacementRejected,\n getExternalDropDateTime,\n getTargetResourceId: (target) => target.resourceId,\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 events: expandedEvents,\n preventEventOverlap,\n canResizeEventTo,\n onEventPlacementRejected,\n withBackgroundEvents: withInteractiveBackgroundEvents,\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 const labelBusinessHours = getBusinessHoursState({\n time: interval.startTime,\n endTime: addMinutesToTime(interval.startTime, clampIntervalMinutes(intervalMinutes)),\n businessHours,\n highlightBusinessHours,\n });\n\n return (\n <Box\n {...getStyles('resourcesWeekViewTimeLabel')}\n key={`${day}-${interval.startTime}`}\n mod={{ 'hour-start': interval.isHourStart, ...labelBusinessHours.mod }}\n __vars={labelBusinessHours.vars}\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 + viewportRef.current.scrollLeft - 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 pushBackgroundEvent = (event: DayPositionedEventData, allDay: boolean) => {\n const backgroundEventDate = dayjs(day).format('YYYY-MM-DD');\n const isResizable = !allDay && eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id, backgroundEventDate);\n const effectiveLeft = resizePosition ? resizePosition.left : event.position.top;\n const effectiveWidth = resizePosition ? resizePosition.width : event.position.height;\n\n eventNodes.push(\n <ScheduleBackgroundEvent<'start' | 'end'>\n key={`bg-${event.id}-${day}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={\n onEventClick\n ? (clickedEvent, e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(clickedEvent, e);\n }\n }\n : undefined\n }\n withResize={isResizable}\n isResizing={resizePosition !== null}\n activeResizeEdge={eventResize.resizingEdge}\n resizeAxis=\"horizontal\"\n resizeHandleProps={getStyles('resourcesWeekViewResizeHandle')}\n onResizeStart={\n isResizable\n ? (edge, e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: backgroundEventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n {...getStyles('resourcesWeekViewBackgroundEvent', {\n style: {\n left: `${dayOffsetPercent + (effectiveLeft / 100) * dayWidthPercent}%`,\n width: `${(effectiveWidth / 100) * dayWidthPercent}%`,\n top: 0,\n height: '100%',\n },\n })}\n />\n );\n };\n\n for (const event of dayEvents.backgroundTimedEvents[resource.id] || []) {\n pushBackgroundEvent(event, false);\n }\n\n for (const event of dayEvents.backgroundAllDayEvents[resource.id] || []) {\n pushBackgroundEvent(event, true);\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 mod={{ invalid: isThisEventResizing && !eventResize.resizeValid }}\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 intervalMinutes={intervalMinutes}\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 mod={{ invalid: !dragDrop.dropValid }}\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyQA,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,eAAe,oBAClB,QAAQ,EAAE,QAAQ,WAAW,WAAW,uBAAuB,EAC9D,mBAAmB;CACjB,gCAAgC,SAAS,UAAU,MAAM,IAAI,KAAA;CAC7D,oCAAoC,IAAI,SAAS;CACjD,oCAAoC,IAAI,SAAS;CACjD,2CAA2C,IAAI,eAAe;CAC9D,2CAA2C,KAAA;CAC3C,+CAA+C,KAAA;AACjD,EACF,EACF;AAEA,MAAa,oBAAoB,SAAmC,WAAW;CAC7E,MAAM,QAAQ,SAAS,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,2BAC1B,uBACA,gBACA,kBACA,YACA,cACA,sBACA,kBACA,mBACA,iBACA,iBACA,iBACA,QACA,WACA,WACA,QACA,wBACA,eACA,iBACA,aACA,qBACA,QACA,kBACA,iBACA,uBACA,aACA,cACA,mBACA,kBACA,gBACA,iBACA,eACA,gBACA,cACA,sBACA,kBACA,qBACA,0BACA,qBACA,iBACA,cACA,iCACA,oBACA,eACA,MACA,qBACA,0BACA,sBAAsB,uBACtB,iBACA,gBACA,aACA,i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,GAAI,UAAU,6BAA6B;OAAhD,UAAA,CACE,8BAAC,OAAD;QACE,GAAI,UAAU,yBAAyB;QACvC,KAAI;QACJ,OACE,YACI;SACE,WACE;SACF,UACE;QACJ,IACA,KAAA;OAIH,GADF,SAAS,aAAa,MAAM,CAC1B,GACL,qBAAC,OAAD;QAAK,GAAI,UAAU,gCAAgC;QAAnD,UAAA,CACE,oBAAC,OAAD;SAAK,GAAI,UAAU,+BAA+B;SAAI,UAAA;QAAe,CAAA,GACrE,oBAAC,KAAD;SAAK,GAAI,UAAU,gCAAgC;SAAG,KAAK,EAAE,SAAS;SACnE,UAAA;QACE,CAAA,CACF;OACF,CAAA,CAAA;;MAEJ;MAEA,qBACC,qBAAC,KAAD;OACE,GAAI,UAAU,uCAAuC;OACrD,QAAQ;QACN,2BAA2B,YACvB,mNAAmN,qBAAqB,WACxO,qHAAqH,qBAAqB;QAC9I,wBAAwB,sBACpB,SAAS,CAAC,CACX,YAAY,CAAC,CACb,SAAS,GAAG,IACX,SACA;OACN;OAZF,UAAA;QAcG,yBACC,oBAAC,OAAD;SAAK,GAAI,UAAU,iDAAiD;SACjE,UAAA;QACE,CAAA;QAEN,CAAC,yBACA,oBAAC,OAAD,EAAK,GAAI,UAAU,4CAA4C,EAAI,CAAA;QAErE,oBAAC,OAAD,EAAK,GAAI,UAAU,2CAA2C,EAAI,CAAA;OAC/D;;KAEJ;;GACK,CAAA;EACT,CAAA,CACF;;CAGP,MAAM,mBAAmB,cACjB,SAAS,kBACf,CAAC,SAAS,gBAAgB,CAC5B;CAEA,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO;EAAmB,UAAA;CAA8B,CAAA;CAGvF,OAAO;AACT,CAAC;AAED,kBAAkB,cAAc;AAChC,kBAAkB,UAAUA;AAC5B,kBAAkB,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesWeekView.module.mjs","names":[],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.module.css"],"sourcesContent":[".resourcesWeekView {\n --resources-week-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-week-view-resource-label-width: 120px;\n --resources-week-view-slot-width: 60px;\n --resources-week-view-row-height: 64px;\n --resources-week-view-group-label-width: 80px;\n --resources-week-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-week-view-border-color: var(--mantine-color-gray-3);\n --resources-week-view-business-hours-bg: var(--mantine-color-white);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-week-view-border-color: var(--mantine-color-dark-4);\n --resources-week-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesWeekViewRoot {\n border: 1px solid var(--resources-week-view-border-color);\n border-radius: var(--resources-week-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesWeekViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesWeekViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesWeekViewHeaderRows {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 14;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-week-view-border-color);\n margin-bottom: -1px;\n}\n\n.resourcesWeekViewCorner {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n\n.resourcesWeekViewHeaderContent {\n display: flex;\n flex-direction: column;\n}\n\n.resourcesWeekViewDayLabelsRow {\n display: flex;\n border-bottom: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewDayLabel {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n cursor: default;\n height: 32px;\n text-transform: capitalize;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-today]) {\n color: var(--mantine-primary-color-contrast);\n background-color: var(--mantine-primary-color-filled);\n font-weight: var(--mantine-font-weight-bold);\n }\n}\n\n.resourcesWeekViewTimeLabelsRow {\n display: flex;\n}\n\n.resourcesWeekViewTimeLabel {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n}\n\n.resourcesWeekViewRow {\n display: flex;\n border-top: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewResourceLabel {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n\n &:where([data-has-groups]) {\n left: var(--resources-week-view-group-label-width);\n }\n}\n\n.resourcesWeekViewGroupColumn {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 13;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-week-view-row-height) + 1px);\n }\n}\n\n.resourcesWeekViewGroupColumnEmpty {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-week-view-row-height);\n}\n\n.resourcesWeekViewRowSlot {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n min-height: var(--resources-week-view-row-height);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n cursor: pointer;\n position: relative;\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-week-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n\n /* The resized edge repeatedly crosses the pointer, so hover feedback would flicker */\n &:where([data-resizing]) {\n @mixin hover {\n background-color: var(--bg-event-bg);\n }\n }\n}\n\n.resourcesWeekViewAllDayEvent {\n position: absolute;\n height: var(--resources-week-view-all-day-height);\n z-index: 2;\n}\n\n.resourcesWeekViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='start']) {\n left: -2px;\n }\n\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n\n.resourcesWeekViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-event-interaction]) .resourcesWeekViewRowSlot {\n pointer-events: none;\n}\n\n/* The resizing background event is the one that set `data-event-interaction`, so it must\n keep capturing pointer events. */\n.resourcesWeekView:where([data-event-interaction], [data-slot-dragging])\n .resourcesWeekViewBackgroundEvent:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n pointer-events: none;\n opacity: 0;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n & .resourcesWeekViewResizeHandle {\n background-color: var(--bg-event-color);\n\n &:where([data-edge='start']) {\n left: 0;\n }\n\n &:where([data-edge='end']) {\n right: 0;\n }\n }\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesWeekViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n opacity: 0;\n }\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-week-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n\n position: absolute;\n pointer-events: none;\n top: 62px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n background-color: var(--_indicator-color);\n opacity: 0.2;\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesWeekViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n width: var(--_thumb-size);\n height: var(--_thumb-size);\n border-radius: 50%;\n border: 1px solid var(--mantine-color-body);\n background-color: var(--_indicator-color);\n left: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n}\n\n.resourcesWeekViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n top: 0;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesWeekViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--resources-week-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n\n &:where([data-invalid]) {\n border-color: var(--mantine-color-error);\n background-color: transparent;\n opacity: 0.4;\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"ResourcesWeekView.module.mjs","names":[],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.module.css"],"sourcesContent":[".resourcesWeekView {\n --_business-hours-direction: to right;\n --resources-week-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-week-view-resource-label-width: 120px;\n --resources-week-view-slot-width: 60px;\n --resources-week-view-row-height: 64px;\n --resources-week-view-group-label-width: 80px;\n --resources-week-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-week-view-border-color: var(--mantine-color-gray-3);\n --resources-week-view-business-hours-bg: var(--mantine-color-white);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-week-view-border-color: var(--mantine-color-dark-4);\n --resources-week-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n\n @mixin rtl {\n --_business-hours-direction: to left;\n }\n}\n\n.resourcesWeekViewRoot {\n border: 1px solid var(--resources-week-view-border-color);\n border-radius: var(--resources-week-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesWeekViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesWeekViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesWeekViewHeaderRows {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 14;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-week-view-border-color);\n margin-bottom: -1px;\n}\n\n.resourcesWeekViewCorner {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n\n.resourcesWeekViewHeaderContent {\n display: flex;\n flex-direction: column;\n}\n\n.resourcesWeekViewDayLabelsRow {\n display: flex;\n border-bottom: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewDayLabel {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n cursor: default;\n height: 32px;\n text-transform: capitalize;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-today]) {\n color: var(--mantine-primary-color-contrast);\n background-color: var(--mantine-primary-color-filled);\n font-weight: var(--mantine-font-weight-bold);\n }\n}\n\n.resourcesWeekViewTimeLabelsRow {\n display: flex;\n}\n\n.resourcesWeekViewTimeLabel {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n\n &:where([data-partial-business-hours]) {\n background-image: linear-gradient(\n var(--_business-hours-direction),\n var(--resources-week-view-non-business-hours-bg) var(--business-hours-from),\n var(--resources-week-view-business-hours-bg) var(--business-hours-from),\n var(--resources-week-view-business-hours-bg) var(--business-hours-to),\n var(--resources-week-view-non-business-hours-bg) var(--business-hours-to)\n );\n }\n}\n\n.resourcesWeekViewRow {\n display: flex;\n border-top: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewResourceLabel {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n\n &:where([data-has-groups]) {\n left: var(--resources-week-view-group-label-width);\n }\n}\n\n.resourcesWeekViewGroupColumn {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 13;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-week-view-row-height) + 1px);\n }\n}\n\n.resourcesWeekViewGroupColumnEmpty {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-week-view-row-height);\n}\n\n.resourcesWeekViewRowSlot {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n min-height: var(--resources-week-view-row-height);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n cursor: pointer;\n position: relative;\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n @mixin hover {\n background-image: none;\n\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n\n &:where([data-partial-business-hours]) {\n background-image: linear-gradient(\n var(--_business-hours-direction),\n var(--resources-week-view-non-business-hours-bg) var(--business-hours-from),\n var(--resources-week-view-business-hours-bg) var(--business-hours-from),\n var(--resources-week-view-business-hours-bg) var(--business-hours-to),\n var(--resources-week-view-non-business-hours-bg) var(--business-hours-to)\n );\n }\n\n &:where([data-drop-target]) {\n background-image: none;\n\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-image: none;\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-week-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n\n /* The resized edge repeatedly crosses the pointer, so hover feedback would flicker */\n &:where([data-resizing]) {\n @mixin hover {\n background-color: var(--bg-event-bg);\n }\n }\n}\n\n.resourcesWeekViewAllDayEvent {\n position: absolute;\n height: var(--resources-week-view-all-day-height);\n z-index: 2;\n}\n\n.resourcesWeekViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='start']) {\n left: -2px;\n }\n\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n\n.resourcesWeekViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-event-interaction]) .resourcesWeekViewRowSlot {\n pointer-events: none;\n}\n\n/* The resizing background event is the one that set `data-event-interaction`, so it must\n keep capturing pointer events. */\n.resourcesWeekView:where([data-event-interaction], [data-slot-dragging])\n .resourcesWeekViewBackgroundEvent:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n pointer-events: none;\n opacity: 0;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n & .resourcesWeekViewResizeHandle {\n background-color: var(--bg-event-color);\n\n &:where([data-edge='start']) {\n left: 0;\n }\n\n &:where([data-edge='end']) {\n right: 0;\n }\n }\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesWeekViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n opacity: 0;\n }\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-week-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n\n position: absolute;\n pointer-events: none;\n top: 62px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n background-color: var(--_indicator-color);\n opacity: 0.2;\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesWeekViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n width: var(--_thumb-size);\n height: var(--_thumb-size);\n border-radius: 50%;\n border: 1px solid var(--mantine-color-body);\n background-color: var(--_indicator-color);\n left: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n}\n\n.resourcesWeekViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n top: 0;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesWeekViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--resources-week-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n\n &:where([data-invalid]) {\n border-color: var(--mantine-color-error);\n background-color: transparent;\n opacity: 0.4;\n }\n}\n"],"mappings":""}
@@ -1,16 +1,24 @@
1
1
  "use client";
2
2
  import { getLabel } from "../../labels.mjs";
3
- import { getBusinessHoursMod } from "../../utils/get-business-hours-mod/get-business-hours-mod.mjs";
3
+ import { clampIntervalMinutes } from "../../utils/clamp-interval-minutes/clamp-interval-minutes.mjs";
4
+ import { getBusinessHoursState } from "../../utils/get-business-hours-mod/get-business-hours-mod.mjs";
5
+ import { addMinutesToTime } from "../../utils/add-minutes-to-time/add-minutes-to-time.mjs";
4
6
  import { Box, UnstyledButton } from "@mantine/core";
5
7
  import { jsx, jsxs } from "react/jsx-runtime";
6
8
  //#region packages/@mantine/schedule/src/components/ResourcesWeekView/ResourcesWeekViewRow.tsx
7
- function ResourcesWeekViewRow({ resource, resourceIndex, weekdays, slots, getStyles, children, labels, highlightBusinessHours, businessHours, withEventsDragAndDrop, onRowSlotsDragOver, onRowSlotsDragLeave, onRowSlotsDrop, onSlotClick, dropTargetSlotIndex, mode, slotsRef, firstSlotIndex, onSlotKeyDown, withDragSlotSelect, onSlotPointerDown, isSlotDragSelected, rowSlotsContainerRef, renderResourceLabel, renderGroupLabel, scrolledX, groupInfo, allDayCount }) {
9
+ function ResourcesWeekViewRow({ resource, resourceIndex, weekdays, slots, intervalMinutes, getStyles, children, labels, highlightBusinessHours, businessHours, withEventsDragAndDrop, onRowSlotsDragOver, onRowSlotsDragLeave, onRowSlotsDrop, onSlotClick, dropTargetSlotIndex, mode, slotsRef, firstSlotIndex, onSlotKeyDown, withDragSlotSelect, onSlotPointerDown, isSlotDragSelected, rowSlotsContainerRef, renderResourceLabel, renderGroupLabel, scrolledX, groupInfo, allDayCount }) {
8
10
  const slotGroup = String(resource.id);
9
11
  const items = weekdays.flatMap((day, dayIndex) => slots.map((slot, slotIndex) => {
10
12
  const flatIndex = dayIndex * slots.length + slotIndex;
11
13
  const isDropTarget = dropTargetSlotIndex === flatIndex;
12
14
  const isFirstSlot = firstSlotIndex?.resourceIndex === resourceIndex && firstSlotIndex?.slotIndex === flatIndex;
13
15
  const isDragSelected = isSlotDragSelected?.(flatIndex, slotGroup) || false;
16
+ const businessHoursState = getBusinessHoursState({
17
+ time: slot.startTime,
18
+ endTime: addMinutesToTime(slot.startTime, clampIntervalMinutes(intervalMinutes)),
19
+ businessHours,
20
+ highlightBusinessHours
21
+ });
14
22
  return /* @__PURE__ */ jsx(UnstyledButton, {
15
23
  ref: (node) => {
16
24
  if (!slotsRef?.current) return;
@@ -25,15 +33,12 @@ function ResourcesWeekViewRow({ resource, resourceIndex, weekdays, slots, getSty
25
33
  ...getStyles("resourcesWeekViewRowSlot"),
26
34
  mod: {
27
35
  "hour-start": slot.isHourStart,
28
- ...getBusinessHoursMod({
29
- time: slot.startTime,
30
- businessHours,
31
- highlightBusinessHours
32
- }),
36
+ ...businessHoursState.mod,
33
37
  "drop-target": isDropTarget,
34
38
  "drag-selected": isDragSelected,
35
39
  static: mode === "static"
36
40
  },
41
+ __vars: businessHoursState.vars,
37
42
  "aria-label": `${getLabel("resourceSlot", labels)} ${resource.label} ${day} ${slot.startTime} - ${slot.endTime}`,
38
43
  tabIndex: mode === "static" ? -1 : isFirstSlot ? 0 : -1,
39
44
  "data-drag-slot-index": withDragSlotSelect && mode !== "static" ? flatIndex : void 0,
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesWeekViewRow.mjs","names":[],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekViewRow.tsx"],"sourcesContent":["import { Box, GetStylesApi, UnstyledButton } from '@mantine/core';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport { ScheduleMode, ScheduleResourceData, ScheduleResourceGroup } from '../../types';\nimport {\n DayTimeInterval,\n getBusinessHoursMod,\n ResourceGroupInfo,\n ResourcesGridControlsRef,\n} from '../../utils';\nimport type { ResourcesWeekViewFactory } from './ResourcesWeekView';\n\nexport interface ResourcesWeekViewRowProps {\n resource: ScheduleResourceData;\n resourceIndex: number;\n weekdays: string[];\n slots: DayTimeInterval[];\n getStyles: GetStylesApi<ResourcesWeekViewFactory>;\n children?: React.ReactNode;\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n withEventsDragAndDrop?: boolean;\n onRowSlotsDragOver?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onRowSlotsDragLeave?: () => void;\n onRowSlotsDrop?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onSlotClick?: (\n resourceId: string | number,\n day: string,\n slotTime: string,\n event: React.MouseEvent<HTMLButtonElement>\n ) => void;\n dropTargetSlotIndex?: number;\n mode?: ScheduleMode;\n slotsRef?: ResourcesGridControlsRef;\n firstSlotIndex?: { resourceIndex: number; slotIndex: number };\n onSlotKeyDown?: (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => void;\n withDragSlotSelect?: boolean;\n onSlotPointerDown?: (\n event: React.PointerEvent<HTMLButtonElement>,\n index: number,\n group: string\n ) => void;\n isSlotDragSelected?: (index: number, group: string) => boolean;\n rowSlotsContainerRef?: (node: HTMLDivElement | null) => void;\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n scrolledX?: boolean;\n groupInfo?: ResourceGroupInfo | null;\n allDayCount?: number;\n}\n\nexport function ResourcesWeekViewRow({\n resource,\n resourceIndex,\n weekdays,\n slots,\n getStyles,\n children,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onRowSlotsDragOver,\n onRowSlotsDragLeave,\n onRowSlotsDrop,\n onSlotClick,\n dropTargetSlotIndex,\n mode,\n slotsRef,\n firstSlotIndex,\n onSlotKeyDown,\n withDragSlotSelect,\n onSlotPointerDown,\n isSlotDragSelected,\n rowSlotsContainerRef,\n renderResourceLabel,\n renderGroupLabel,\n scrolledX,\n groupInfo,\n allDayCount,\n}: ResourcesWeekViewRowProps) {\n const slotGroup = String(resource.id);\n\n const items = weekdays.flatMap((day, dayIndex) =>\n slots.map((slot, slotIndex) => {\n const flatIndex = dayIndex * slots.length + slotIndex;\n const isDropTarget = dropTargetSlotIndex === flatIndex;\n const isFirstSlot =\n firstSlotIndex?.resourceIndex === resourceIndex && firstSlotIndex?.slotIndex === flatIndex;\n const isDragSelected = isSlotDragSelected?.(flatIndex, slotGroup) || false;\n\n return (\n <UnstyledButton\n key={`${day}-${slot.startTime}`}\n ref={(node) => {\n if (!slotsRef?.current) {\n return;\n }\n if (!slotsRef.current[resourceIndex]) {\n slotsRef.current[resourceIndex] = [];\n }\n const row = slotsRef.current[resourceIndex];\n if (node) {\n row[flatIndex] = node;\n } else {\n delete row[flatIndex];\n while (row.length > 0 && row[row.length - 1] == null) {\n row.length -= 1;\n }\n }\n }}\n {...getStyles('resourcesWeekViewRowSlot')}\n mod={{\n 'hour-start': slot.isHourStart,\n ...getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n aria-label={`${getLabel('resourceSlot', labels)} ${resource.label} ${day} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : isFirstSlot ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? flatIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n onKeyDown={(e) => {\n if (onSlotKeyDown) {\n onSlotKeyDown(e, resourceIndex, flatIndex);\n }\n }}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => onSlotPointerDown?.(e, flatIndex, slotGroup)\n : undefined\n }\n onClick={\n mode === 'static' || !onSlotClick\n ? undefined\n : (e) => onSlotClick(resource.id, day, slot.startTime, e)\n }\n onDragOver={\n withEventsDragAndDrop && mode !== 'static' ? (e) => e.preventDefault() : undefined\n }\n />\n );\n })\n );\n\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesWeekViewGroupColumn')}\n mod={{ 'scrolled-x': scrolledX, 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-week-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box\n {...getStyles('resourcesWeekViewGroupColumnEmpty')}\n mod={{ 'scrolled-x': scrolledX }}\n />\n )\n ) : null;\n\n return (\n <Box {...getStyles('resourcesWeekViewRow')}>\n {groupCell}\n <Box\n {...getStyles('resourcesWeekViewResourceLabel')}\n mod={{ 'scrolled-x': scrolledX, 'has-groups': groupInfo !== undefined }}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </Box>\n <Box\n ref={rowSlotsContainerRef}\n {...getStyles('resourcesWeekViewRowSlots', {\n style: allDayCount\n ? {\n minHeight: `max(var(--resources-week-view-row-height), calc(${allDayCount} * (var(--resources-week-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined,\n })}\n onDragOver={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDragOver?.(e, resource.id, resourceIndex)\n : undefined\n }\n onDragLeave={withEventsDragAndDrop && mode !== 'static' ? onRowSlotsDragLeave : undefined}\n onDrop={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDrop?.(e, resource.id, resourceIndex)\n : undefined\n }\n >\n {children}\n {items}\n </Box>\n </Box>\n );\n}\n"],"mappings":";;;;;;AA+DA,SAAgB,qBAAqB,EACnC,UACA,eACA,UACA,OACA,WACA,UACA,QACA,wBACA,eACA,uBACA,oBACA,qBACA,gBACA,aACA,qBACA,MACA,UACA,gBACA,eACA,oBACA,mBACA,oBACA,sBACA,qBACA,kBACA,WACA,WACA,eAC4B;CAC5B,MAAM,YAAY,OAAO,SAAS,EAAE;CAEpC,MAAM,QAAQ,SAAS,SAAS,KAAK,aACnC,MAAM,KAAK,MAAM,cAAc;EAC7B,MAAM,YAAY,WAAW,MAAM,SAAS;EAC5C,MAAM,eAAe,wBAAwB;EAC7C,MAAM,cACJ,gBAAgB,kBAAkB,iBAAiB,gBAAgB,cAAc;EACnF,MAAM,iBAAiB,qBAAqB,WAAW,SAAS,KAAK;EAErE,OACE,oBAAC,gBAAD;GAEE,MAAM,SAAS;IACb,IAAI,CAAC,UAAU,SACb;IAEF,IAAI,CAAC,SAAS,QAAQ,gBACpB,SAAS,QAAQ,iBAAiB,CAAC;IAErC,MAAM,MAAM,SAAS,QAAQ;IAC7B,IAAI,MACF,IAAI,aAAa;SACZ;KACL,OAAO,IAAI;KACX,OAAO,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,MAAM,MAC9C,IAAI,UAAU;IAElB;GACF;GACA,GAAI,UAAU,0BAA0B;GACxC,KAAK;IACH,cAAc,KAAK;IACnB,GAAG,oBAAoB;KACrB,MAAM,KAAK;KACX;KACA;IACF,CAAC;IACD,eAAe;IACf,iBAAiB;IACjB,QAAQ,SAAS;GACnB;GACA,cAAY,GAAG,SAAS,gBAAgB,MAAM,EAAE,GAAG,SAAS,MAAM,GAAG,IAA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CAAA;GACL,qBAAC,KAAD;IACE,KAAK;IACL,GAAI,UAAU,6BAA6B,EACzC,OAAO,cACH,EACE,WAAW,mDAAmD,YAAY,8DAC5E,IACA,KAAA,EACN,CAAC;IACD,YACE,yBAAyB,SAAS,YAC7B,MAAM,qBAAqB,GAAG,SAAS,IAAI,aAAa,IACzD,KAAA;IAEN,aAAa,yBAAyB,SAAS,WAAW,sBAAsB,KAAA;IAChF,QACE,yBAAyB,SAAS,YAC7B,MAAM,iBAAiB,GAAG,SAAS,IAAI,aAAa,IACrD,KAAA;IAlBR,UAAA,CAqBG,UACA,KACE;;EACF;;AAET"}
1
+ {"version":3,"file":"ResourcesWeekViewRow.mjs","names":[],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekViewRow.tsx"],"sourcesContent":["import { Box, GetStylesApi, UnstyledButton } from '@mantine/core';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport { ScheduleMode, ScheduleResourceData, ScheduleResourceGroup } from '../../types';\nimport {\n DayTimeInterval,\n addMinutesToTime,\n clampIntervalMinutes,\n getBusinessHoursState,\n ResourceGroupInfo,\n ResourcesGridControlsRef,\n} from '../../utils';\nimport type { ResourcesWeekViewFactory } from './ResourcesWeekView';\n\nexport interface ResourcesWeekViewRowProps {\n resource: ScheduleResourceData;\n resourceIndex: number;\n weekdays: string[];\n slots: DayTimeInterval[];\n intervalMinutes: number;\n getStyles: GetStylesApi<ResourcesWeekViewFactory>;\n children?: React.ReactNode;\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n withEventsDragAndDrop?: boolean;\n onRowSlotsDragOver?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onRowSlotsDragLeave?: () => void;\n onRowSlotsDrop?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onSlotClick?: (\n resourceId: string | number,\n day: string,\n slotTime: string,\n event: React.MouseEvent<HTMLButtonElement>\n ) => void;\n dropTargetSlotIndex?: number;\n mode?: ScheduleMode;\n slotsRef?: ResourcesGridControlsRef;\n firstSlotIndex?: { resourceIndex: number; slotIndex: number };\n onSlotKeyDown?: (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => void;\n withDragSlotSelect?: boolean;\n onSlotPointerDown?: (\n event: React.PointerEvent<HTMLButtonElement>,\n index: number,\n group: string\n ) => void;\n isSlotDragSelected?: (index: number, group: string) => boolean;\n rowSlotsContainerRef?: (node: HTMLDivElement | null) => void;\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n scrolledX?: boolean;\n groupInfo?: ResourceGroupInfo | null;\n allDayCount?: number;\n}\n\nexport function ResourcesWeekViewRow({\n resource,\n resourceIndex,\n weekdays,\n slots,\n intervalMinutes,\n getStyles,\n children,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onRowSlotsDragOver,\n onRowSlotsDragLeave,\n onRowSlotsDrop,\n onSlotClick,\n dropTargetSlotIndex,\n mode,\n slotsRef,\n firstSlotIndex,\n onSlotKeyDown,\n withDragSlotSelect,\n onSlotPointerDown,\n isSlotDragSelected,\n rowSlotsContainerRef,\n renderResourceLabel,\n renderGroupLabel,\n scrolledX,\n groupInfo,\n allDayCount,\n}: ResourcesWeekViewRowProps) {\n const slotGroup = String(resource.id);\n\n const items = weekdays.flatMap((day, dayIndex) =>\n slots.map((slot, slotIndex) => {\n const flatIndex = dayIndex * slots.length + slotIndex;\n const isDropTarget = dropTargetSlotIndex === flatIndex;\n const isFirstSlot =\n firstSlotIndex?.resourceIndex === resourceIndex && firstSlotIndex?.slotIndex === flatIndex;\n const isDragSelected = isSlotDragSelected?.(flatIndex, slotGroup) || false;\n\n const businessHoursState = getBusinessHoursState({\n time: slot.startTime,\n endTime: addMinutesToTime(slot.startTime, clampIntervalMinutes(intervalMinutes)),\n businessHours,\n highlightBusinessHours,\n });\n\n return (\n <UnstyledButton\n key={`${day}-${slot.startTime}`}\n ref={(node) => {\n if (!slotsRef?.current) {\n return;\n }\n if (!slotsRef.current[resourceIndex]) {\n slotsRef.current[resourceIndex] = [];\n }\n const row = slotsRef.current[resourceIndex];\n if (node) {\n row[flatIndex] = node;\n } else {\n delete row[flatIndex];\n while (row.length > 0 && row[row.length - 1] == null) {\n row.length -= 1;\n }\n }\n }}\n {...getStyles('resourcesWeekViewRowSlot')}\n mod={{\n 'hour-start': slot.isHourStart,\n ...businessHoursState.mod,\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n __vars={businessHoursState.vars}\n aria-label={`${getLabel('resourceSlot', labels)} ${resource.label} ${day} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : isFirstSlot ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? flatIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n onKeyDown={(e) => {\n if (onSlotKeyDown) {\n onSlotKeyDown(e, resourceIndex, flatIndex);\n }\n }}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => onSlotPointerDown?.(e, flatIndex, slotGroup)\n : undefined\n }\n onClick={\n mode === 'static' || !onSlotClick\n ? undefined\n : (e) => onSlotClick(resource.id, day, slot.startTime, e)\n }\n onDragOver={\n withEventsDragAndDrop && mode !== 'static' ? (e) => e.preventDefault() : undefined\n }\n />\n );\n })\n );\n\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesWeekViewGroupColumn')}\n mod={{ 'scrolled-x': scrolledX, 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-week-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box\n {...getStyles('resourcesWeekViewGroupColumnEmpty')}\n mod={{ 'scrolled-x': scrolledX }}\n />\n )\n ) : null;\n\n return (\n <Box {...getStyles('resourcesWeekViewRow')}>\n {groupCell}\n <Box\n {...getStyles('resourcesWeekViewResourceLabel')}\n mod={{ 'scrolled-x': scrolledX, 'has-groups': groupInfo !== undefined }}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </Box>\n <Box\n ref={rowSlotsContainerRef}\n {...getStyles('resourcesWeekViewRowSlots', {\n style: allDayCount\n ? {\n minHeight: `max(var(--resources-week-view-row-height), calc(${allDayCount} * (var(--resources-week-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined,\n })}\n onDragOver={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDragOver?.(e, resource.id, resourceIndex)\n : undefined\n }\n onDragLeave={withEventsDragAndDrop && mode !== 'static' ? onRowSlotsDragLeave : undefined}\n onDrop={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDrop?.(e, resource.id, resourceIndex)\n : undefined\n }\n >\n {children}\n {items}\n </Box>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;AAkEA,SAAgB,qBAAqB,EACnC,UACA,eACA,UACA,OACA,iBACA,WACA,UACA,QACA,wBACA,eACA,uBACA,oBACA,qBACA,gBACA,aACA,qBACA,MACA,UACA,gBACA,eACA,oBACA,mBACA,oBACA,sBACA,qBACA,kBACA,WACA,WACA,eAC4B;CAC5B,MAAM,YAAY,OAAO,SAAS,EAAE;CAEpC,MAAM,QAAQ,SAAS,SAAS,KAAK,aACnC,MAAM,KAAK,MAAM,cAAc;EAC7B,MAAM,YAAY,WAAW,MAAM,SAAS;EAC5C,MAAM,eAAe,wBAAwB;EAC7C,MAAM,cACJ,gBAAgB,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AiDrB;CAEL,CAAC,CACH;CAEA,MAAM,eAAe,WAAW,aAAa,WAAW,WAAW,aAAa;CAChF,MAAM,YACJ,cAAc,KAAA,IACZ,cAAc,OACZ,oBAAC,KAAD;EACE,GAAI,UAAU,8BAA8B;EAC5C,KAAK;GAAE,cAAc;GAAW,kBAAkB,UAAU;EAAS;EAEpE,UAAA,gBACC,oBAAC,QAAD;GACE,OACE,UAAU,QAAQ,IACd,EACE,WAAW,oBAAoB,UAAU,QAAQ,EAAE,yDACrD,IACA,KAAA;GAGL,UAAA,mBAAmB,iBAAiB,UAAU,KAAK,IAAI,UAAU,MAAM;EACpE,CAAA;CAEL,CAAA,IAEL,oBAAC,KAAD;EACE,GAAI,UAAU,mCAAmC;EACjD,KAAK,EAAE,cAAc,UAAU;CAChC,CAAA,IAED;CAEN,OACE,qBAAC,KAAD;EAAK,GAAI,UAAU,sBAAsB;EAAzC,UAAA;GACG;GACD,oBAAC,KAAD;IACE,GAAI,UAAU,gCAAgC;IAC9C,KAAK;KAAE,cAAc;KAAW,cAAc,cAAc,KAAA;IAAU;IAErE,UAAA,sBAAsB,oBAAoB,QAAQ,IAAI,SAAS;GAC7D,CAAA;GACL,qBAAC,KAAD;IACE,KAAK;IACL,GAAI,UAAU,6BAA6B,EACzC,OAAO,cACH,EACE,WAAW,mDAAmD,YAAY,8DAC5E,IACA,KAAA,EACN,CAAC;IACD,YACE,yBAAyB,SAAS,YAC7B,MAAM,qBAAqB,GAAG,SAAS,IAAI,aAAa,IACzD,KAAA;IAEN,aAAa,yBAAyB,SAAS,WAAW,sBAAsB,KAAA;IAChF,QACE,yBAAyB,SAAS,YAC7B,MAAM,iBAAiB,GAAG,SAAS,IAAI,aAAa,IACrD,KAAA;IAlBR,UAAA,CAqBG,UACA,KACE;;EACF;;AAET"}
@@ -131,6 +131,8 @@ const Schedule = factory((_props) => {
131
131
  recurrenceExpansionLimit,
132
132
  onYearClick: () => handleViewChange("year"),
133
133
  onEventClick,
134
+ weekendDays: monthViewProps?.weekendDays,
135
+ withWeekendDays: monthViewProps?.withWeekendDays,
134
136
  ...mobileMonthViewProps
135
137
  });
136
138
  case "year": return /* @__PURE__ */ jsx(YearView, {