@mantine/schedule 9.6.1 → 9.6.2

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 (60) hide show
  1. package/cjs/components/DayView/DayView.cjs +37 -16
  2. package/cjs/components/DayView/DayView.cjs.map +1 -1
  3. package/cjs/components/DayView/DayView.module.cjs +1 -0
  4. package/cjs/components/DayView/DayView.module.cjs.map +1 -1
  5. package/cjs/components/MobileMonthView/MobileMonthView.cjs +1 -1
  6. package/cjs/components/MobileMonthView/MobileMonthView.cjs.map +1 -1
  7. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +39 -14
  8. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
  9. package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs.map +1 -1
  10. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs.map +1 -1
  11. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +45 -15
  12. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
  13. package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs.map +1 -1
  14. package/cjs/components/Schedule/Schedule.cjs.map +1 -1
  15. package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs +18 -3
  16. package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs.map +1 -1
  17. package/cjs/components/WeekView/WeekView.cjs +36 -13
  18. package/cjs/components/WeekView/WeekView.cjs.map +1 -1
  19. package/cjs/components/WeekView/WeekView.module.cjs +1 -0
  20. package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
  21. package/cjs/hooks/use-event-resize.cjs +7 -4
  22. package/cjs/hooks/use-event-resize.cjs.map +1 -1
  23. package/cjs/hooks/use-horizontal-event-resize.cjs +7 -4
  24. package/cjs/hooks/use-horizontal-event-resize.cjs.map +1 -1
  25. package/esm/components/DayView/DayView.mjs +37 -16
  26. package/esm/components/DayView/DayView.mjs.map +1 -1
  27. package/esm/components/DayView/DayView.module.mjs +1 -0
  28. package/esm/components/DayView/DayView.module.mjs.map +1 -1
  29. package/esm/components/MobileMonthView/MobileMonthView.mjs +1 -1
  30. package/esm/components/MobileMonthView/MobileMonthView.mjs.map +1 -1
  31. package/esm/components/ResourcesDayView/ResourcesDayView.mjs +39 -14
  32. package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
  33. package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs.map +1 -1
  34. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs.map +1 -1
  35. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +45 -15
  36. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
  37. package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs.map +1 -1
  38. package/esm/components/Schedule/Schedule.mjs.map +1 -1
  39. package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs +19 -4
  40. package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs.map +1 -1
  41. package/esm/components/WeekView/WeekView.mjs +36 -13
  42. package/esm/components/WeekView/WeekView.mjs.map +1 -1
  43. package/esm/components/WeekView/WeekView.module.mjs +1 -0
  44. package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
  45. package/esm/hooks/use-event-resize.mjs +7 -4
  46. package/esm/hooks/use-event-resize.mjs.map +1 -1
  47. package/esm/hooks/use-horizontal-event-resize.mjs +7 -4
  48. package/esm/hooks/use-horizontal-event-resize.mjs.map +1 -1
  49. package/lib/components/DayView/DayView.d.ts +2 -2
  50. package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +1 -1
  51. package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +1 -1
  52. package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +1 -1
  53. package/lib/components/Schedule/Schedule.d.ts +1 -1
  54. package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.d.ts +15 -2
  55. package/lib/components/WeekView/WeekView.d.ts +2 -2
  56. package/lib/hooks/use-event-resize.d.ts +3 -2
  57. package/lib/hooks/use-horizontal-event-resize.d.ts +3 -2
  58. package/package.json +4 -4
  59. package/styles.css +254 -6
  60. package/styles.layer.css +254 -6
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesDayView.mjs","names":["classes"],"sources":["../../../src/components/ResourcesDayView/ResourcesDayView.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 ScheduleEventData,\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 handleResourcesGridKeyDown,\n isAllDayEvent,\n isInTimeRange,\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 { getResourcesDayViewEvents } from './get-resources-day-view-events/get-resources-day-view-events';\nimport { ResourcesDayViewRow } from './ResourcesDayViewColumn';\nimport classes from './ResourcesDayView.module.css';\n\nexport type ResourcesDayViewStylesNames =\n | 'resourcesDayView'\n | 'resourcesDayViewRoot'\n | 'resourcesDayViewInner'\n | 'resourcesDayViewTimeLabelsRow'\n | 'resourcesDayViewScrollArea'\n | 'resourcesDayViewCorner'\n | 'resourcesDayViewTimeLabel'\n | 'resourcesDayViewResourceLabel'\n | 'resourcesDayViewRow'\n | 'resourcesDayViewRowSlot'\n | 'resourcesDayViewRowSlots'\n | 'resourcesDayViewBackgroundEvent'\n | 'resourcesDayViewAllDayEvent'\n | 'resourcesDayViewCurrentTimeIndicator'\n | 'resourcesDayViewCurrentTimeIndicatorLine'\n | 'resourcesDayViewCurrentTimeIndicatorThumb'\n | 'resourcesDayViewCurrentTimeIndicatorTimeBubble'\n | 'resourcesDayViewEventWrapper'\n | 'resourcesDayViewDragPreview'\n | 'resourcesDayViewResizeHandle'\n | 'resourcesDayViewGroupColumn'\n | 'resourcesDayViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesDayViewCssVariables = {\n resourcesDayView:\n | '--resources-day-view-radius'\n | '--resources-day-view-slot-width'\n | '--resources-day-view-row-height'\n | '--resources-day-view-group-label-width';\n};\n\nexport interface ResourcesDayViewProps\n extends BoxProps, StylesApiProps<ResourcesDayViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Day to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | string;\n\n /** Called with the new date value when a date is selected */\n onDateChange?: (value: DateStringValue) => void;\n\n /** List of resources to display as rows */\n resources: ScheduleResourceData[];\n\n /** Start time for the day view, in `HH:mm:ss` format @default 00:00:00 */\n startTime?: string;\n\n /** End time for the day view, in `HH:mm:ss` format @default 23:59:59 */\n endTime?: string;\n\n /** Number of minutes for each interval in the day 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\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\n /** Dayjs format for slot labels or a callback function that returns formatted value @default HH:mm */\n slotLabelFormat?: DateLabelFormat;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Time to scroll to on initial render, in `HH:mm:ss` format */\n startScrollTime?: string;\n\n /** Props passed down to the `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n\n /** Locale passed down to dayjs, overrides value defined on `DatesProvider` */\n locale?: string;\n\n /** If set, displays a vertical line indicating the current time. By default, displayed only for the current day. */\n withCurrentTimeIndicator?: boolean;\n\n /** If set, the time indicator displays the current time in the bubble @default true */\n withCurrentTimeBubble?: boolean;\n\n /** A function to get the current time, called on every tick. Can be used to display the current time indicator in a different timezone. @default () => dayjs() */\n getCurrentTime?: () => AnyDateValue;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next control */\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to today control */\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to view level select */\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n\n /** Dayjs format for header label @default 'MMMM D, YYYY' */\n headerFormat?: DateLabelFormat;\n\n /** List of events to display */\n events?: ScheduleEventData[];\n\n /** Width of each time slot column @default 80px */\n slotWidth?: React.CSSProperties['width'];\n\n /** Height of each resource row @default 64px */\n rowHeight?: React.CSSProperties['height'];\n\n /** Labels override */\n labels?: ScheduleLabelsOverride;\n\n /** If set to true, highlights business hours with white background @default false */\n highlightBusinessHours?: boolean;\n\n /** Business hours range in `HH:mm:ss` format @default ['09:00:00', '17:00:00'] */\n businessHours?: [string, string];\n\n /** Function to customize event body */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering */\n renderEvent?: RenderEvent;\n\n /** Function to customize resource label rendering */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** List of resource groups to display as a column to the left of resource labels */\n groups?: ScheduleResourceGroup[];\n\n /** Function to customize group label rendering */\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n\n /** Width of the group label column @default 80px */\n groupLabelWidth?: React.CSSProperties['width'];\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped at new time, includes target resourceId */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for moving events by drag and drop, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventDragInterval?: number;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked, includes resourceId */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick` @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** If set, enables drag-to-select time slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a time slot range is selected by dragging, includes resourceId */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Called when an external item is dropped onto the schedule */\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** If true, events can be resized by dragging their left/right edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for resizing events, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventResizeInterval?: number;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\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\nexport type ResourcesDayViewFactory = Factory<{\n props: ResourcesDayViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesDayViewStylesNames;\n vars: ResourcesDayViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'ResourcesDayView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n slotLabelFormat: 'HH:mm',\n intervalMinutes: 60,\n minEventSize: 1,\n withHeader: true,\n headerFormat: 'MMMM D, YYYY',\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n withEventResize: false,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n withInteractiveBackgroundEvents: false,\n} satisfies Partial<ResourcesDayViewProps>;\n\nconst varsResolver = createVarsResolver<ResourcesDayViewFactory>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesDayView: {\n '--resources-day-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-day-view-slot-width': rem(slotWidth),\n '--resources-day-view-row-height': rem(rowHeight),\n '--resources-day-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nexport const ResourcesDayView = factory<ResourcesDayViewFactory>((_props) => {\n const props = useProps('ResourcesDayView', 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 startScrollTime,\n scrollAreaProps,\n locale,\n withCurrentTimeIndicator: _withCurrentTimeIndicator,\n withCurrentTimeBubble = true,\n getCurrentTime,\n __staticSelector,\n withHeader,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n headerFormat,\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 onTimeSlotClick,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n eventResizeInterval,\n recurrenceExpansionLimit,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot =\n _maxEventsPerTimeSlot !== undefined ? Math.max(1, _maxEventsPerTimeSlot) : undefined;\n\n const getStyles = useStyles<ResourcesDayViewFactory>({\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: 'resourcesDayView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesDayViewFactory>({\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 type DropTargetSlot = { resourceId: string | number; slotIndex: number };\n\n const dragOffsetRef = useRef<{ offset: number; size: number }>({ offset: 0, size: 0 });\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetSlot) => {\n if (!onExternalEventDrop) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n const slotTime = slots[target.slotIndex].startTime;\n let dropDateTime: string = `${slotDate} ${slotTime}`;\n\n if (eventDragInterval != null) {\n const { start } = calculateDropTime({\n draggedEvent: { start: dropDateTime, end: dropDateTime } as ScheduleEventData,\n targetDate: slotDate,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: dragOffsetRef.current.offset,\n slotSize: dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n dropDateTime = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n }\n\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime,\n resourceId: target.resourceId,\n });\n },\n [onExternalEventDrop, slots, date, eventDragInterval, intervalMinutes, startTime, endTime]\n );\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const getDropTimeForSlot = (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n const slotTime = slots[target.slotIndex].startTime;\n return calculateDropTime({\n draggedEvent,\n targetDate: dayjs(date).format('YYYY-MM-DD'),\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: eventDragInterval == null ? undefined : dragOffsetRef.current.offset,\n slotSize: eventDragInterval == null ? undefined : dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n };\n\n const handleInternalEventDrop = useCallback(\n (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n [onEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetSlot>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: handleInternalEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n return getDropTimeForSlot(target, draggedEvent);\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const updateDragPreview = (target: DropTargetSlot) => {\n const draggedEvent = dragDrop.dragContextValue.draggedEvent;\n if (eventDragInterval == null || !draggedEvent) {\n return;\n }\n const { start, end } = getDropTimeForSlot(target, draggedEvent);\n const newStart = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n if (\n dragDrop.dragPreview?.start !== newStart ||\n dragDrop.dragPreview?.target.resourceId !== target.resourceId\n ) {\n dragDrop.setDragPreview({\n start: newStart,\n end: dayjs(end).format('YYYY-MM-DD HH:mm:ss'),\n target,\n });\n }\n };\n\n const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;\n\n const groupToResourceId = useMemo(() => getGroupToResourceIdMap(resources), [resources]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex, group) => {\n if (!onSlotDragEnd) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n onSlotDragEnd({\n rangeStart: `${slotDate} ${slots[startIndex].startTime}`,\n rangeEnd: `${slotDate} ${slots[endIndex].endTime}`,\n resourceId: groupToResourceId.get(group) ?? group,\n });\n },\n });\n\n const eventResize = useHorizontalEventResize({\n enabled: withEventResize,\n mode,\n startTime,\n endTime,\n intervalMinutes,\n resizeIntervalMinutes: eventResizeInterval,\n onEventResize,\n canResizeEvent,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const handleTimeSlotClick = (\n resourceId: string | number,\n slotTime: string,\n e: React.MouseEvent<HTMLButtonElement>\n ) => {\n if (!onTimeSlotClick) {\n return;\n }\n\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n const slotIndex = slots.findIndex((s) => s.startTime === slotTime);\n if (slotIndex === -1) {\n return;\n }\n\n const slot = slots[slotIndex];\n onTimeSlotClick({\n slotStart: `${slotDate} ${slot.startTime}`,\n slotEnd: `${slotDate} ${slot.endTime}`,\n nativeEvent: e,\n resourceId,\n });\n };\n\n const dateStr = dayjs(date).format('YYYY-MM-DD');\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const now = resolveNow();\n const isToday = dayjs(date).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 const showTimeIndicator =\n mounted &&\n withCurrentTimeIndicator &&\n isInTimeRange({ date: now.toDate(), startTime, endTime });\n const formattedCurrentTime = withCurrentTimeBubble\n ? formatDate({ locale: ctx.getLocale(locale), date: now, format: slotLabelFormat })\n : '';\n\n const expandedEvents = useMemo(\n () =>\n expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('day').toDate(),\n rangeEnd: dayjs(date).endOf('day').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, date, recurrenceExpansionLimit]\n );\n\n const resourceEvents = useMemo(\n () =>\n getResourcesDayViewEvents({\n date,\n events: expandedEvents,\n resources,\n startTime,\n endTime,\n intervalMinutes,\n }),\n [date, expandedEvents, resources, startTime, endTime, intervalMinutes]\n );\n\n const timeLabels = slots.map((interval) => {\n const intervalTime = dayjs(`${dateStr} ${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('resourcesDayViewTimeLabel')}\n key={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 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 (!startScrollTime || !viewportRef.current) {\n return;\n }\n\n const firstResourceSlots = slotsRef.current[0];\n if (!firstResourceSlots || firstResourceSlots.length === 0) {\n return;\n }\n\n const targetIndex = slots.findIndex((s) => s.startTime >= startScrollTime);\n if (targetIndex < 0) {\n return;\n }\n\n const targetSlot = firstResourceSlots[targetIndex];\n if (!targetSlot) {\n return;\n }\n\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const cornerEl = viewportRef.current.querySelector(`.${classes.resourcesDayViewCorner}`);\n const labelWidth = cornerEl ? cornerEl.getBoundingClientRect().width : 0;\n viewportRef.current.scrollTo({\n left: slotRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n }, []);\n\n const getSlotIndexFromDragPoint = useCallback(\n (event: React.DragEvent, resourceIndex: number) => {\n const daySlots = slotsRef.current[resourceIndex] ?? [];\n const index = getIndexFromDragPoint(daySlots, event.clientX);\n if (index !== null) {\n const rect = daySlots[index]?.getBoundingClientRect();\n if (rect) {\n const rawOffset = dir === 'rtl' ? rect.right - event.clientX : event.clientX - rect.left;\n dragOffsetRef.current = {\n offset: Math.max(0, Math.min(rect.width, rawOffset)),\n size: rect.width,\n };\n }\n }\n return index;\n },\n [dir]\n );\n\n const handleSlotKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => {\n handleResourcesGridKeyDown({\n controlsRef: slotsRef,\n resourceIndex,\n slotIndex,\n event,\n });\n };\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n const allBgEvents = [\n ...(resourceEvents.backgroundTimedEvents[resource.id] || []),\n ...(resourceEvents.backgroundAllDayEvents[resource.id] || []),\n ];\n\n const backgroundEventNodes = allBgEvents.map((event) => (\n <ScheduleBackgroundEvent\n key={`bg-${event.id}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('resourcesDayViewBackgroundEvent', {\n style: {\n left: `${event.position.top}%`,\n width: `${event.position.height}%`,\n top: 0,\n height: '100%',\n },\n })}\n />\n ));\n\n const allRegularEvents = (resourceEvents.regularEvents[resource.id] || []).filter(\n (event) => !isAllDayEvent({ event, date })\n );\n\n const visibleRegularEvents =\n maxEventsPerTimeSlot !== undefined\n ? allRegularEvents.filter((event) => event.position.column < maxEventsPerTimeSlot)\n : allRegularEvents;\n\n const regularEvents = visibleRegularEvents.map((event) => {\n const isDraggable = dragDrop.isDraggableEvent(event);\n const isResizable = eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const eventLeft = resizePosition ? resizePosition.left : event.position.top;\n const eventWidth = resizePosition ? resizePosition.width : event.position.height;\n\n const adjustPosition =\n maxEventsPerTimeSlot !== undefined && event.position.overlaps > maxEventsPerTimeSlot;\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 isThisEventResizing = resizePosition !== null;\n const activeEdge =\n isThisEventResizing && eventResize.resizingEdge ? eventResize.resizingEdge : null;\n\n return (\n <Box\n key={event.id}\n {...getStyles('resourcesDayViewEventWrapper')}\n __vars={eventColors ? { '--event-color': eventColors.color } : undefined}\n data-resizing={isThisEventResizing || undefined}\n style={{\n ...getTimeAxisEventStyle({\n start: eventLeft,\n span: eventWidth,\n minSize: minEventSize,\n }),\n top: adjustPosition\n ? `calc((100% - 22px) * ${event.position.column} / ${maxEventsPerTimeSlot})`\n : `${event.position.offset}%`,\n height: adjustPosition\n ? `calc((100% - 22px) / ${maxEventsPerTimeSlot})`\n : `${event.position.width}%`,\n }}\n >\n <ScheduleEvent\n event={event}\n autoSize\n nowrap\n draggable={isDraggable}\n isResizing={isThisEventResizing}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n style={{ width: '100%', height: '100%', padding: 0 }}\n />\n {isResizable && mode !== 'static' && (\n <>\n <div\n {...getStyles('resourcesDayViewResizeHandle')}\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: dateStr,\n pointerEvent: e,\n });\n }\n }}\n />\n <div\n {...getStyles('resourcesDayViewResizeHandle')}\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: dateStr,\n pointerEvent: e,\n });\n }\n }}\n />\n </>\n )}\n </Box>\n );\n });\n\n const allDayEvents = resourceEvents.allDayEvents[resource.id] || [];\n\n const allDayEventNodes = allDayEvents.map((event, index) => (\n <Box\n key={`all-day-${event.id}`}\n {...getStyles('resourcesDayViewAllDayEvent', {\n style: {\n top: `calc(${index} * (var(--resources-day-view-all-day-height) + 2px) + 2px)`,\n },\n })}\n >\n <ScheduleEvent\n event={event}\n autoSize\n nowrap\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(event, e) : undefined}\n style={{ width: '100%', height: '100%' }}\n />\n </Box>\n ));\n\n const moreEventsForResource =\n maxEventsPerTimeSlot !== undefined\n ? getOverlapClusters(allRegularEvents)\n .filter((cluster) => cluster.some((e) => e.position.column >= maxEventsPerTimeSlot))\n .map((cluster) => {\n const hiddenCount = cluster.filter(\n (e) => e.position.column >= maxEventsPerTimeSlot\n ).length;\n const leftPercent = Math.min(...cluster.map((e) => e.position.top));\n const rightPercent = Math.max(\n ...cluster.map((e) => e.position.top + e.position.height)\n );\n\n return (\n <MoreEvents\n key={`more-${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 return (\n <ResourcesDayViewRow\n key={resource.id}\n resource={resource}\n resourceIndex={resourceIndex}\n date={dateStr}\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={allDayEvents.length}\n >\n {backgroundEventNodes}\n {allDayEventNodes}\n {regularEvents}\n {moreEventsForResource}\n {dragDrop.dragPreview?.target.resourceId === resource.id &&\n dragDrop.dragContextValue.draggedEvent && (\n <Box\n {...getStyles('resourcesDayViewDragPreview', {\n style: (() => {\n const { top, height } = getDayPosition({\n event: {\n ...dragDrop.dragContextValue.draggedEvent,\n start: dragDrop.dragPreview.start,\n end: dragDrop.dragPreview.end,\n },\n startTime,\n endTime,\n intervalMinutes,\n });\n return {\n position: 'absolute',\n insetBlockStart: 0,\n insetBlockEnd: 0,\n ...getTimeAxisEventStyle({ start: top, span: height, axis: 'horizontal' }),\n };\n })(),\n })}\n />\n )}\n </ResourcesDayViewRow>\n );\n });\n\n const headerLabel = formatDate({\n date: dayjs(date),\n locale: ctx.getLocale(locale),\n format: headerFormat,\n });\n\n const content = (\n <Box\n {...getStyles('resourcesDayView')}\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=\"day\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'day')),\n next: () => toDateString(dayjs(date).add(1, 'day')),\n today: () => toDateString(resolveNow()),\n }}\n control={{\n miw: 140,\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('resourcesDayViewRoot')}>\n <ScrollArea\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesDayViewScrollArea', {\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('resourcesDayViewInner')}>\n <Box {...getStyles('resourcesDayViewTimeLabelsRow')} mod={{ scrolled }}>\n <div\n {...getStyles('resourcesDayViewCorner')}\n key=\"corner\"\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n {timeLabels}\n </Box>\n\n {rows}\n\n {showTimeIndicator && (\n <Box\n {...getStyles('resourcesDayViewCurrentTimeIndicator')}\n __vars={{\n '--indicator-left-offset': hasGroups\n ? `calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width) + (100% - var(--resources-day-view-resource-label-width) - var(--resources-day-view-group-label-width)) * ${timeIndicatorOffset} / 100)`\n : `calc(var(--resources-day-view-resource-label-width) + (100% - var(--resources-day-view-resource-label-width)) * ${timeIndicatorOffset} / 100)`,\n '--_time-bubble-width': formattedCurrentTime\n ?.toString()\n .toLowerCase()\n .includes('m')\n ? '64px'\n : '46px',\n }}\n >\n {withCurrentTimeBubble && (\n <div {...getStyles('resourcesDayViewCurrentTimeIndicatorTimeBubble')}>\n {formattedCurrentTime}\n </div>\n )}\n {!withCurrentTimeBubble && (\n <div {...getStyles('resourcesDayViewCurrentTimeIndicatorThumb')} />\n )}\n <div {...getStyles('resourcesDayViewCurrentTimeIndicatorLine')} />\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\nResourcesDayView.displayName = '@mantine/schedule/ResourcesDayView';\nResourcesDayView.classes = classes;\nResourcesDayView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,yBACA,oBAAC,OAAD,EAAK,GAAI,UAAU,2CAA2C,EAAI,CAAA;QAEpE,oBAAC,OAAD,EAAK,GAAI,UAAU,0CAA0C,EAAI,CAAA;OAC9D;;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,iBAAiB,cAAc;AAC/B,iBAAiB,UAAUA;AAC3B,iBAAiB,eAAe"}
1
+ {"version":3,"file":"ResourcesDayView.mjs","names":["classes"],"sources":["../../../src/components/ResourcesDayView/ResourcesDayView.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 DayPositionedEventData,\n ScheduleEventData,\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 handleResourcesGridKeyDown,\n isAllDayEvent,\n isInTimeRange,\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 { getResourcesDayViewEvents } from './get-resources-day-view-events/get-resources-day-view-events';\nimport { ResourcesDayViewRow } from './ResourcesDayViewColumn';\nimport classes from './ResourcesDayView.module.css';\n\nexport type ResourcesDayViewStylesNames =\n | 'resourcesDayView'\n | 'resourcesDayViewRoot'\n | 'resourcesDayViewInner'\n | 'resourcesDayViewTimeLabelsRow'\n | 'resourcesDayViewScrollArea'\n | 'resourcesDayViewCorner'\n | 'resourcesDayViewTimeLabel'\n | 'resourcesDayViewResourceLabel'\n | 'resourcesDayViewRow'\n | 'resourcesDayViewRowSlot'\n | 'resourcesDayViewRowSlots'\n | 'resourcesDayViewBackgroundEvent'\n | 'resourcesDayViewAllDayEvent'\n | 'resourcesDayViewCurrentTimeIndicator'\n | 'resourcesDayViewCurrentTimeIndicatorLine'\n | 'resourcesDayViewCurrentTimeIndicatorThumb'\n | 'resourcesDayViewCurrentTimeIndicatorTimeBubble'\n | 'resourcesDayViewEventWrapper'\n | 'resourcesDayViewDragPreview'\n | 'resourcesDayViewResizeHandle'\n | 'resourcesDayViewGroupColumn'\n | 'resourcesDayViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesDayViewCssVariables = {\n resourcesDayView:\n | '--resources-day-view-radius'\n | '--resources-day-view-slot-width'\n | '--resources-day-view-row-height'\n | '--resources-day-view-group-label-width';\n};\n\nexport interface ResourcesDayViewProps\n extends BoxProps, StylesApiProps<ResourcesDayViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Day to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | string;\n\n /** Called with the new date value when a date is selected */\n onDateChange?: (value: DateStringValue) => void;\n\n /** List of resources to display as rows */\n resources: ScheduleResourceData[];\n\n /** Start time for the day view, in `HH:mm:ss` format @default 00:00:00 */\n startTime?: string;\n\n /** End time for the day view, in `HH:mm:ss` format @default 23:59:59 */\n endTime?: string;\n\n /** Number of minutes for each interval in the day 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\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\n /** Dayjs format for slot labels or a callback function that returns formatted value @default HH:mm */\n slotLabelFormat?: DateLabelFormat;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Time to scroll to on initial render, in `HH:mm:ss` format */\n startScrollTime?: string;\n\n /** Props passed down to the `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n\n /** Locale passed down to dayjs, overrides value defined on `DatesProvider` */\n locale?: string;\n\n /** If set, displays a vertical line indicating the current time. By default, displayed only for the current day. */\n withCurrentTimeIndicator?: boolean;\n\n /** If set, the time indicator displays the current time in the bubble @default true */\n withCurrentTimeBubble?: boolean;\n\n /** A function to get the current time, called on every tick. Can be used to display the current time indicator in a different timezone. @default () => dayjs() */\n getCurrentTime?: () => AnyDateValue;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next control */\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to today control */\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to view level select */\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n\n /** Dayjs format for header label @default 'MMMM D, YYYY' */\n headerFormat?: DateLabelFormat;\n\n /** List of events to display */\n events?: ScheduleEventData[];\n\n /** Width of each time slot column @default 80px */\n slotWidth?: React.CSSProperties['width'];\n\n /** Height of each resource row @default 64px */\n rowHeight?: React.CSSProperties['height'];\n\n /** Labels override */\n labels?: ScheduleLabelsOverride;\n\n /** If set to true, highlights business hours with white background @default false */\n highlightBusinessHours?: boolean;\n\n /** Business hours range in `HH:mm:ss` format @default ['09:00:00', '17:00:00'] */\n businessHours?: [string, string];\n\n /** Function to customize event body */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering */\n renderEvent?: RenderEvent;\n\n /** Function to customize resource label rendering */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** List of resource groups to display as a column to the left of resource labels */\n groups?: ScheduleResourceGroup[];\n\n /** Function to customize group label rendering */\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n\n /** Width of the group label column @default 80px */\n groupLabelWidth?: React.CSSProperties['width'];\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped at new time, includes target resourceId */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for moving events by drag and drop, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventDragInterval?: number;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked, includes resourceId */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick`. Combined with `withEventResize`, timed background events can also be resized by dragging their edges. @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** If set, enables drag-to-select time slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a time slot range is selected by dragging, includes resourceId */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Called when an external item is dropped onto the schedule */\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** If true, events can be resized by dragging their left/right edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for resizing events, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventResizeInterval?: number;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\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\nexport type ResourcesDayViewFactory = Factory<{\n props: ResourcesDayViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesDayViewStylesNames;\n vars: ResourcesDayViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'ResourcesDayView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n slotLabelFormat: 'HH:mm',\n intervalMinutes: 60,\n minEventSize: 1,\n withHeader: true,\n headerFormat: 'MMMM D, YYYY',\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n withEventResize: false,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n withInteractiveBackgroundEvents: false,\n} satisfies Partial<ResourcesDayViewProps>;\n\nconst varsResolver = createVarsResolver<ResourcesDayViewFactory>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesDayView: {\n '--resources-day-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-day-view-slot-width': rem(slotWidth),\n '--resources-day-view-row-height': rem(rowHeight),\n '--resources-day-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nexport const ResourcesDayView = factory<ResourcesDayViewFactory>((_props) => {\n const props = useProps('ResourcesDayView', 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 startScrollTime,\n scrollAreaProps,\n locale,\n withCurrentTimeIndicator: _withCurrentTimeIndicator,\n withCurrentTimeBubble = true,\n getCurrentTime,\n __staticSelector,\n withHeader,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n headerFormat,\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 onTimeSlotClick,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n eventResizeInterval,\n recurrenceExpansionLimit,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot =\n _maxEventsPerTimeSlot !== undefined ? Math.max(1, _maxEventsPerTimeSlot) : undefined;\n\n const getStyles = useStyles<ResourcesDayViewFactory>({\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: 'resourcesDayView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesDayViewFactory>({\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 type DropTargetSlot = { resourceId: string | number; slotIndex: number };\n\n const dragOffsetRef = useRef<{ offset: number; size: number }>({ offset: 0, size: 0 });\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetSlot) => {\n if (!onExternalEventDrop) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n const slotTime = slots[target.slotIndex].startTime;\n let dropDateTime: string = `${slotDate} ${slotTime}`;\n\n if (eventDragInterval != null) {\n const { start } = calculateDropTime({\n draggedEvent: { start: dropDateTime, end: dropDateTime } as ScheduleEventData,\n targetDate: slotDate,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: dragOffsetRef.current.offset,\n slotSize: dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n dropDateTime = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n }\n\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime,\n resourceId: target.resourceId,\n });\n },\n [onExternalEventDrop, slots, date, eventDragInterval, intervalMinutes, startTime, endTime]\n );\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const getDropTimeForSlot = (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n const slotTime = slots[target.slotIndex].startTime;\n return calculateDropTime({\n draggedEvent,\n targetDate: dayjs(date).format('YYYY-MM-DD'),\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: eventDragInterval == null ? undefined : dragOffsetRef.current.offset,\n slotSize: eventDragInterval == null ? undefined : dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n };\n\n const handleInternalEventDrop = useCallback(\n (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n [onEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetSlot>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: handleInternalEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n return getDropTimeForSlot(target, draggedEvent);\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const updateDragPreview = (target: DropTargetSlot) => {\n const draggedEvent = dragDrop.dragContextValue.draggedEvent;\n if (eventDragInterval == null || !draggedEvent) {\n return;\n }\n const { start, end } = getDropTimeForSlot(target, draggedEvent);\n const newStart = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n if (\n dragDrop.dragPreview?.start !== newStart ||\n dragDrop.dragPreview?.target.resourceId !== target.resourceId\n ) {\n dragDrop.setDragPreview({\n start: newStart,\n end: dayjs(end).format('YYYY-MM-DD HH:mm:ss'),\n target,\n });\n }\n };\n\n const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;\n\n const groupToResourceId = useMemo(() => getGroupToResourceIdMap(resources), [resources]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex, group) => {\n if (!onSlotDragEnd) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n onSlotDragEnd({\n rangeStart: `${slotDate} ${slots[startIndex].startTime}`,\n rangeEnd: `${slotDate} ${slots[endIndex].endTime}`,\n resourceId: groupToResourceId.get(group) ?? group,\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 withBackgroundEvents: withInteractiveBackgroundEvents,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const handleTimeSlotClick = (\n resourceId: string | number,\n slotTime: string,\n e: React.MouseEvent<HTMLButtonElement>\n ) => {\n if (!onTimeSlotClick) {\n return;\n }\n\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n const slotIndex = slots.findIndex((s) => s.startTime === slotTime);\n if (slotIndex === -1) {\n return;\n }\n\n const slot = slots[slotIndex];\n onTimeSlotClick({\n slotStart: `${slotDate} ${slot.startTime}`,\n slotEnd: `${slotDate} ${slot.endTime}`,\n nativeEvent: e,\n resourceId,\n });\n };\n\n const dateStr = dayjs(date).format('YYYY-MM-DD');\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const now = resolveNow();\n const isToday = dayjs(date).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 const showTimeIndicator =\n mounted &&\n withCurrentTimeIndicator &&\n isInTimeRange({ date: now.toDate(), startTime, endTime });\n const formattedCurrentTime = withCurrentTimeBubble\n ? formatDate({ locale: ctx.getLocale(locale), date: now, format: slotLabelFormat })\n : '';\n\n const expandedEvents = useMemo(\n () =>\n expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('day').toDate(),\n rangeEnd: dayjs(date).endOf('day').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, date, recurrenceExpansionLimit]\n );\n\n const resourceEvents = useMemo(\n () =>\n getResourcesDayViewEvents({\n date,\n events: expandedEvents,\n resources,\n startTime,\n endTime,\n intervalMinutes,\n }),\n [date, expandedEvents, resources, startTime, endTime, intervalMinutes]\n );\n\n const timeLabels = slots.map((interval) => {\n const intervalTime = dayjs(`${dateStr} ${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('resourcesDayViewTimeLabel')}\n key={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 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 (!startScrollTime || !viewportRef.current) {\n return;\n }\n\n const firstResourceSlots = slotsRef.current[0];\n if (!firstResourceSlots || firstResourceSlots.length === 0) {\n return;\n }\n\n const targetIndex = slots.findIndex((s) => s.startTime >= startScrollTime);\n if (targetIndex < 0) {\n return;\n }\n\n const targetSlot = firstResourceSlots[targetIndex];\n if (!targetSlot) {\n return;\n }\n\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const cornerEl = viewportRef.current.querySelector(`.${classes.resourcesDayViewCorner}`);\n const labelWidth = cornerEl ? cornerEl.getBoundingClientRect().width : 0;\n viewportRef.current.scrollTo({\n left: slotRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n }, []);\n\n const getSlotIndexFromDragPoint = useCallback(\n (event: React.DragEvent, resourceIndex: number) => {\n const daySlots = slotsRef.current[resourceIndex] ?? [];\n const index = getIndexFromDragPoint(daySlots, event.clientX);\n if (index !== null) {\n const rect = daySlots[index]?.getBoundingClientRect();\n if (rect) {\n const rawOffset = dir === 'rtl' ? rect.right - event.clientX : event.clientX - rect.left;\n dragOffsetRef.current = {\n offset: Math.max(0, Math.min(rect.width, rawOffset)),\n size: rect.width,\n };\n }\n }\n return index;\n },\n [dir]\n );\n\n const handleSlotKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => {\n handleResourcesGridKeyDown({\n controlsRef: slotsRef,\n resourceIndex,\n slotIndex,\n event,\n });\n };\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n const renderBackgroundEvent = (event: DayPositionedEventData, allDay: boolean) => {\n const isResizable = !allDay && eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n\n return (\n <ScheduleBackgroundEvent<'start' | 'end'>\n key={`bg-${event.id}`}\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('resourcesDayViewResizeHandle')}\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: dateStr,\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n {...getStyles('resourcesDayViewBackgroundEvent', {\n style: {\n left: `${resizePosition ? resizePosition.left : event.position.top}%`,\n width: `${resizePosition ? resizePosition.width : event.position.height}%`,\n top: 0,\n height: '100%',\n },\n })}\n />\n );\n };\n\n const backgroundEventNodes = [\n ...(resourceEvents.backgroundTimedEvents[resource.id] || []).map((event) =>\n renderBackgroundEvent(event, false)\n ),\n ...(resourceEvents.backgroundAllDayEvents[resource.id] || []).map((event) =>\n renderBackgroundEvent(event, true)\n ),\n ];\n\n const allRegularEvents = (resourceEvents.regularEvents[resource.id] || []).filter(\n (event) => !isAllDayEvent({ event, date })\n );\n\n const visibleRegularEvents =\n maxEventsPerTimeSlot !== undefined\n ? allRegularEvents.filter((event) => event.position.column < maxEventsPerTimeSlot)\n : allRegularEvents;\n\n const regularEvents = visibleRegularEvents.map((event) => {\n const isDraggable = dragDrop.isDraggableEvent(event);\n const isResizable = eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const eventLeft = resizePosition ? resizePosition.left : event.position.top;\n const eventWidth = resizePosition ? resizePosition.width : event.position.height;\n\n const adjustPosition =\n maxEventsPerTimeSlot !== undefined && event.position.overlaps > maxEventsPerTimeSlot;\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 isThisEventResizing = resizePosition !== null;\n const activeEdge =\n isThisEventResizing && eventResize.resizingEdge ? eventResize.resizingEdge : null;\n\n return (\n <Box\n key={event.id}\n {...getStyles('resourcesDayViewEventWrapper')}\n __vars={eventColors ? { '--event-color': eventColors.color } : undefined}\n data-resizing={isThisEventResizing || undefined}\n style={{\n ...getTimeAxisEventStyle({\n start: eventLeft,\n span: eventWidth,\n minSize: minEventSize,\n }),\n top: adjustPosition\n ? `calc((100% - 22px) * ${event.position.column} / ${maxEventsPerTimeSlot})`\n : `${event.position.offset}%`,\n height: adjustPosition\n ? `calc((100% - 22px) / ${maxEventsPerTimeSlot})`\n : `${event.position.width}%`,\n }}\n >\n <ScheduleEvent\n event={event}\n autoSize\n nowrap\n draggable={isDraggable}\n isResizing={isThisEventResizing}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n style={{ width: '100%', height: '100%', padding: 0 }}\n />\n {isResizable && mode !== 'static' && (\n <>\n <div\n {...getStyles('resourcesDayViewResizeHandle')}\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: dateStr,\n pointerEvent: e,\n });\n }\n }}\n />\n <div\n {...getStyles('resourcesDayViewResizeHandle')}\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: dateStr,\n pointerEvent: e,\n });\n }\n }}\n />\n </>\n )}\n </Box>\n );\n });\n\n const allDayEvents = resourceEvents.allDayEvents[resource.id] || [];\n\n const allDayEventNodes = allDayEvents.map((event, index) => (\n <Box\n key={`all-day-${event.id}`}\n {...getStyles('resourcesDayViewAllDayEvent', {\n style: {\n top: `calc(${index} * (var(--resources-day-view-all-day-height) + 2px) + 2px)`,\n },\n })}\n >\n <ScheduleEvent\n event={event}\n autoSize\n nowrap\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(event, e) : undefined}\n style={{ width: '100%', height: '100%' }}\n />\n </Box>\n ));\n\n const moreEventsForResource =\n maxEventsPerTimeSlot !== undefined\n ? getOverlapClusters(allRegularEvents)\n .filter((cluster) => cluster.some((e) => e.position.column >= maxEventsPerTimeSlot))\n .map((cluster) => {\n const hiddenCount = cluster.filter(\n (e) => e.position.column >= maxEventsPerTimeSlot\n ).length;\n const leftPercent = Math.min(...cluster.map((e) => e.position.top));\n const rightPercent = Math.max(\n ...cluster.map((e) => e.position.top + e.position.height)\n );\n\n return (\n <MoreEvents\n key={`more-${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 return (\n <ResourcesDayViewRow\n key={resource.id}\n resource={resource}\n resourceIndex={resourceIndex}\n date={dateStr}\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={allDayEvents.length}\n >\n {backgroundEventNodes}\n {allDayEventNodes}\n {regularEvents}\n {moreEventsForResource}\n {dragDrop.dragPreview?.target.resourceId === resource.id &&\n dragDrop.dragContextValue.draggedEvent && (\n <Box\n {...getStyles('resourcesDayViewDragPreview', {\n style: (() => {\n const { top, height } = getDayPosition({\n event: {\n ...dragDrop.dragContextValue.draggedEvent,\n start: dragDrop.dragPreview.start,\n end: dragDrop.dragPreview.end,\n },\n startTime,\n endTime,\n intervalMinutes,\n });\n return {\n position: 'absolute',\n insetBlockStart: 0,\n insetBlockEnd: 0,\n ...getTimeAxisEventStyle({ start: top, span: height, axis: 'horizontal' }),\n };\n })(),\n })}\n />\n )}\n </ResourcesDayViewRow>\n );\n });\n\n const headerLabel = formatDate({\n date: dayjs(date),\n locale: ctx.getLocale(locale),\n format: headerFormat,\n });\n\n const content = (\n <Box\n {...getStyles('resourcesDayView')}\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=\"day\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'day')),\n next: () => toDateString(dayjs(date).add(1, 'day')),\n today: () => toDateString(resolveNow()),\n }}\n control={{\n miw: 140,\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('resourcesDayViewRoot')}>\n <ScrollArea\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesDayViewScrollArea', {\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('resourcesDayViewInner')}>\n <Box {...getStyles('resourcesDayViewTimeLabelsRow')} mod={{ scrolled }}>\n <div\n {...getStyles('resourcesDayViewCorner')}\n key=\"corner\"\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n {timeLabels}\n </Box>\n\n {rows}\n\n {showTimeIndicator && (\n <Box\n {...getStyles('resourcesDayViewCurrentTimeIndicator')}\n __vars={{\n '--indicator-left-offset': hasGroups\n ? `calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width) + (100% - var(--resources-day-view-resource-label-width) - var(--resources-day-view-group-label-width)) * ${timeIndicatorOffset} / 100)`\n : `calc(var(--resources-day-view-resource-label-width) + (100% - var(--resources-day-view-resource-label-width)) * ${timeIndicatorOffset} / 100)`,\n '--_time-bubble-width': formattedCurrentTime\n ?.toString()\n .toLowerCase()\n .includes('m')\n ? '64px'\n : '46px',\n }}\n >\n {withCurrentTimeBubble && (\n <div {...getStyles('resourcesDayViewCurrentTimeIndicatorTimeBubble')}>\n {formattedCurrentTime}\n </div>\n )}\n {!withCurrentTimeBubble && (\n <div {...getStyles('resourcesDayViewCurrentTimeIndicatorThumb')} />\n )}\n <div {...getStyles('resourcesDayViewCurrentTimeIndicatorLine')} />\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\nResourcesDayView.displayName = '@mantine/schedule/ResourcesDayView';\nResourcesDayView.classes = classes;\nResourcesDayView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8SA,MAAM,eAAe;CACnB,kBAAkB;CAClB,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,iBAAiB;CACjB,cAAc;CACd,YAAY;CACZ,cAAc;CACd,wBAAwB;CACxB,eAAe,CAAC,YAAY,UAAU;CACtC,uBAAuB;CACvB,oBAAoB;CACpB,iBAAiB;CACjB,MAAM;CACN,sBAAsB;CACtB,iCAAiC;AACnC;AAEA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,WAAW,WAAW,u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;OAIH,GADF,SAAS,aAAa,MAAM,CAC1B,GACJ,UACE;;MAEJ;MAEA,qBACC,qBAAC,KAAD;OACE,GAAI,UAAU,sCAAsC;OACpD,QAAQ;QACN,2BAA2B,YACvB,+MAA+M,oBAAoB,WACnO,mHAAmH,oBAAoB;QAC3I,wBAAwB,sBACpB,SAAS,CAAC,CACX,YAAY,CAAC,CACb,SAAS,GAAG,IACX,SACA;OACN;OAZF,UAAA;QAcG,yBACC,oBAAC,OAAD;SAAK,GAAI,UAAU,gDAAgD;SAChE,UAAA;QACE,CAAA;QAEN,CAAC,yBACA,oBAAC,OAAD,EAAK,GAAI,UAAU,2CAA2C,EAAI,CAAA;QAEpE,oBAAC,OAAD,EAAK,GAAI,UAAU,0CAA0C,EAAI,CAAA;OAC9D;;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,iBAAiB,cAAc;AAC/B,iBAAiB,UAAUA;AAC3B,iBAAiB,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesDayView.module.mjs","names":[],"sources":["../../../src/components/ResourcesDayView/ResourcesDayView.module.css"],"sourcesContent":[".resourcesDayView {\n --resources-day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-day-view-resource-label-width: 120px;\n --resources-day-view-slot-width: 80px;\n --resources-day-view-row-height: 64px;\n --resources-day-view-group-label-width: 80px;\n --resources-day-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-day-view-border-color: var(--mantine-color-gray-3);\n --resources-day-view-business-hours-bg: var(--mantine-color-white);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-day-view-border-color: var(--mantine-color-dark-4);\n --resources-day-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesDayViewRoot {\n border: 1px solid var(--resources-day-view-border-color);\n border-radius: var(--resources-day-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesDayViewScrollArea {\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.resourcesDayViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesDayViewTimeLabelsRow {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-day-view-border-color);\n margin-bottom: -1px;\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n}\n\n.resourcesDayViewCorner {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n position: sticky;\n left: 0;\n z-index: 11;\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.resourcesDayViewTimeLabel {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\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-day-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-day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n}\n\n.resourcesDayViewRow {\n display: flex;\n border-top: 1px solid var(--resources-day-view-border-color);\n}\n\n.resourcesDayViewResourceLabel {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-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-day-view-border-color);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 11;\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-day-view-group-label-width);\n }\n}\n\n.resourcesDayViewGroupColumn {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-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-day-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-day-view-row-height) + 1px);\n }\n}\n\n.resourcesDayViewGroupColumnEmpty {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-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-day-view-border-color);\n}\n\n.resourcesDayViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-day-view-row-height);\n}\n\n.resourcesDayViewRowSlot {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n min-height: var(--resources-day-view-row-height);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n cursor: pointer;\n position: relative;\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(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesDayViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-day-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: 37px;\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.resourcesDayViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesDayViewCurrentTimeIndicatorThumb {\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.resourcesDayViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\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 top: 0;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesDayViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-day-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\n.resourcesDayViewAllDayEvent {\n position: absolute;\n inset-inline: 1px;\n height: var(--resources-day-view-all-day-height);\n z-index: 3;\n}\n\n.resourcesDayViewResizeHandle {\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.resourcesDayViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesDayViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesDayViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesDayView:where([data-event-interaction]) .resourcesDayViewRowSlot {\n pointer-events: none;\n}\n\n.resourcesDayView:where([data-event-interaction], [data-slot-dragging])\n .resourcesDayViewBackgroundEvent {\n pointer-events: none;\n}\n\n.resourcesDayView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesDayViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesDayViewResizeHandle {\n opacity: 0;\n }\n }\n}\n\n.resourcesDayViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--resources-day-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"ResourcesDayView.module.mjs","names":[],"sources":["../../../src/components/ResourcesDayView/ResourcesDayView.module.css"],"sourcesContent":[".resourcesDayView {\n --resources-day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-day-view-resource-label-width: 120px;\n --resources-day-view-slot-width: 80px;\n --resources-day-view-row-height: 64px;\n --resources-day-view-group-label-width: 80px;\n --resources-day-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-day-view-border-color: var(--mantine-color-gray-3);\n --resources-day-view-business-hours-bg: var(--mantine-color-white);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-day-view-border-color: var(--mantine-color-dark-4);\n --resources-day-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesDayViewRoot {\n border: 1px solid var(--resources-day-view-border-color);\n border-radius: var(--resources-day-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesDayViewScrollArea {\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.resourcesDayViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesDayViewTimeLabelsRow {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-day-view-border-color);\n margin-bottom: -1px;\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n}\n\n.resourcesDayViewCorner {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n position: sticky;\n left: 0;\n z-index: 11;\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.resourcesDayViewTimeLabel {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\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-day-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-day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n}\n\n.resourcesDayViewRow {\n display: flex;\n border-top: 1px solid var(--resources-day-view-border-color);\n}\n\n.resourcesDayViewResourceLabel {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-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-day-view-border-color);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 11;\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-day-view-group-label-width);\n }\n}\n\n.resourcesDayViewGroupColumn {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-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-day-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-day-view-row-height) + 1px);\n }\n}\n\n.resourcesDayViewGroupColumnEmpty {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-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-day-view-border-color);\n}\n\n.resourcesDayViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-day-view-row-height);\n}\n\n.resourcesDayViewRowSlot {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n min-height: var(--resources-day-view-row-height);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n cursor: pointer;\n position: relative;\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(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesDayViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-day-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: 37px;\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.resourcesDayViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesDayViewCurrentTimeIndicatorThumb {\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.resourcesDayViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\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 top: 0;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesDayViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-day-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.resourcesDayViewAllDayEvent {\n position: absolute;\n inset-inline: 1px;\n height: var(--resources-day-view-all-day-height);\n z-index: 3;\n}\n\n.resourcesDayViewResizeHandle {\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.resourcesDayViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesDayViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesDayViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesDayView:where([data-event-interaction]) .resourcesDayViewRowSlot {\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.resourcesDayView:where([data-event-interaction], [data-slot-dragging])\n .resourcesDayViewBackgroundEvent:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesDayViewResizeHandle {\n pointer-events: none;\n opacity: 0;\n }\n}\n\n.resourcesDayViewBackgroundEvent {\n & .resourcesDayViewResizeHandle {\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 .resourcesDayViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesDayViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesDayView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesDayViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesDayViewResizeHandle {\n opacity: 0;\n }\n }\n}\n\n.resourcesDayViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--resources-day-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesSchedule.mjs","names":["classes"],"sources":["../../../src/components/ResourcesSchedule/ResourcesSchedule.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n ResourcesDayView,\n ResourcesDayViewProps,\n ResourcesDayViewStylesNames,\n} from '../ResourcesDayView/ResourcesDayView';\nimport {\n ResourcesMonthView,\n ResourcesMonthViewProps,\n ResourcesMonthViewStylesNames,\n} from '../ResourcesMonthView/ResourcesMonthView';\nimport {\n ResourcesWeekView,\n ResourcesWeekViewProps,\n ResourcesWeekViewStylesNames,\n} from '../ResourcesWeekView/ResourcesWeekView';\nimport { RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\nimport classes from './ResourcesSchedule.module.css';\n\nexport type ResourcesScheduleStylesNames =\n | 'root'\n | ResourcesDayViewStylesNames\n | ResourcesWeekViewStylesNames\n | ResourcesMonthViewStylesNames;\n\nexport type ResourcesScheduleViewLevel = 'day' | 'week' | 'month';\n\ntype ResourcesScheduleCommonProps =\n | 'date'\n | 'onDateChange'\n | 'resources'\n | 'events'\n | 'locale'\n | 'radius'\n | 'labels'\n | 'renderEventBody'\n | 'renderResourceLabel'\n | 'withEventsDragAndDrop'\n | 'onEventDrop'\n | 'canDragEvent'\n | 'onEventDragStart'\n | 'onEventDragEnd'\n | 'onTimeSlotClick'\n | 'onEventClick'\n | 'onDayClick'\n | 'withDragSlotSelect'\n | 'onSlotDragEnd'\n | 'view'\n | 'onViewChange'\n | 'mode'\n | 'onExternalEventDrop'\n | 'withEventResize'\n | 'onEventResize'\n | 'canResizeEvent'\n | 'recurrenceExpansionLimit'\n | 'withInteractiveBackgroundEvents';\n\ntype ResourcesScheduleViewProps<T> = Partial<Omit<T, ResourcesScheduleCommonProps>>;\n\nexport interface ResourcesScheduleProps\n extends BoxProps, StylesApiProps<ResourcesScheduleFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** List of resources to display */\n resources: ScheduleResourceData[];\n\n /** Current date to display (controlled) */\n date?: Date | DateStringValue;\n\n /** Default date (uncontrolled) */\n defaultDate?: Date | DateStringValue;\n\n /** Called when date changes via navigation */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Current view level (controlled) */\n view?: ResourcesScheduleViewLevel;\n\n /** Default view level (uncontrolled) @default 'day' */\n defaultView?: ResourcesScheduleViewLevel;\n\n /** Called when view level changes */\n onViewChange?: (view: ResourcesScheduleViewLevel) => void;\n\n /** Events to display across all views */\n events?: ScheduleEventData[];\n\n /** Locale for date formatting */\n locale?: string;\n\n /** Key of theme.radius or any valid CSS value to set border-radius */\n radius?: MantineRadius;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Custom event body renderer */\n renderEventBody?: RenderEventBody;\n\n /** Custom resource label renderer */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** Enable drag and drop for events @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when day is clicked in month view */\n onDayClick?: (data: {\n date: DateStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a slot range is selected by dragging */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Called when an external item is dropped onto the schedule */\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 edges, resizing snaps to whole days in month view @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 /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick`. Applies to `day` and `week` views only – `ResourcesMonthView` does not render background events separately. @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** Max number of generated recurring instances @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Props specific to ResourcesDayView */\n dayViewProps?: ResourcesScheduleViewProps<ResourcesDayViewProps>;\n\n /** Props specific to ResourcesWeekView */\n weekViewProps?: ResourcesScheduleViewProps<ResourcesWeekViewProps>;\n\n /** Props specific to ResourcesMonthView */\n monthViewProps?: ResourcesScheduleViewProps<ResourcesMonthViewProps>;\n}\n\nexport type ResourcesScheduleFactory = Factory<{\n props: ResourcesScheduleProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesScheduleStylesNames;\n}>;\n\nconst defaultProps: Partial<ResourcesScheduleProps> = {\n defaultView: 'day',\n mode: 'default',\n};\n\nexport const ResourcesSchedule = factory<ResourcesScheduleFactory>((_props) => {\n const props = useProps('ResourcesSchedule', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n resources,\n date,\n defaultDate,\n onDateChange,\n view,\n defaultView,\n onViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n renderResourceLabel,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n withInteractiveBackgroundEvents,\n recurrenceExpansionLimit,\n mode,\n dayViewProps,\n weekViewProps,\n monthViewProps,\n __staticSelector,\n mod,\n ...others\n } = props;\n\n const getStyles = useStyles<ResourcesScheduleFactory>({\n name: __staticSelector || 'ResourcesSchedule',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const [_view, _setView] = useUncontrolled<ResourcesScheduleViewLevel>({\n value: view,\n defaultValue: defaultView,\n onChange: onViewChange,\n });\n\n const [_date, _setDate] = useUncontrolled<Date | DateStringValue>({\n value: date,\n defaultValue: defaultDate ?? new Date(),\n });\n\n const handleDateChange = (newDate: DateStringValue) => {\n _setDate(newDate);\n onDateChange?.(newDate);\n };\n\n const handleViewChange = (newView: ScheduleViewLevel) => {\n if (newView === 'day' || newView === 'week' || newView === 'month') {\n _setView(newView);\n }\n };\n\n const commonProps = {\n resources,\n date: _date,\n onDateChange: handleDateChange,\n onViewChange: handleViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n renderResourceLabel,\n withEventsDragAndDrop: mode === 'static' ? false : withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n mode,\n };\n\n const content = (() => {\n switch (_view) {\n case 'day':\n return (\n <ResourcesDayView\n {...commonProps}\n onTimeSlotClick={onTimeSlotClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...dayViewProps}\n />\n );\n case 'week':\n return (\n <ResourcesWeekView\n {...commonProps}\n onTimeSlotClick={onTimeSlotClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...weekViewProps}\n />\n );\n case 'month':\n return (\n <ResourcesMonthView\n {...commonProps}\n onDayClick={onDayClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n {...monthViewProps}\n />\n );\n default:\n return null;\n }\n })();\n\n return (\n <Box {...getStyles('root')} mod={mod} {...others}>\n {content}\n </Box>\n );\n});\n\nResourcesSchedule.displayName = '@mantine/schedule/ResourcesSchedule';\nResourcesSchedule.classes = classes;\n\nexport namespace ResourcesSchedule {\n export type Props = ResourcesScheduleProps;\n export type StylesNames = ResourcesScheduleStylesNames;\n export type Factory = ResourcesScheduleFactory;\n export type ViewLevel = ResourcesScheduleViewLevel;\n}\n"],"mappings":";;;;;;;;;AAyNA,MAAM,eAAgD;CACpD,aAAa;CACb,MAAM;AACR;AAEA,MAAa,o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WAAW,QAAQ;IAE9B,GAAI;GACL,CAAA;GAEL,KAAK,SACH,OACE,oBAAC,oBAAD;IACE,GAAI;IACQ;IACZ,iBAAiB,SAAS,WAAW,QAAQ;IAC9B;IACC;IAChB,GAAI;GACL,CAAA;GAEL,SACE,OAAO;EACX;CACF,EAAA,CAAG;CAEH,OACE,oBAAC,KAAD;EAAK,GAAI,UAAU,MAAM;EAAQ;EAAK,GAAI;EACvC,UAAA;CACE,CAAA;AAET,CAAC;AAED,kBAAkB,cAAc;AAChC,kBAAkB,UAAUA"}
1
+ {"version":3,"file":"ResourcesSchedule.mjs","names":["classes"],"sources":["../../../src/components/ResourcesSchedule/ResourcesSchedule.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n ResourcesDayView,\n ResourcesDayViewProps,\n ResourcesDayViewStylesNames,\n} from '../ResourcesDayView/ResourcesDayView';\nimport {\n ResourcesMonthView,\n ResourcesMonthViewProps,\n ResourcesMonthViewStylesNames,\n} from '../ResourcesMonthView/ResourcesMonthView';\nimport {\n ResourcesWeekView,\n ResourcesWeekViewProps,\n ResourcesWeekViewStylesNames,\n} from '../ResourcesWeekView/ResourcesWeekView';\nimport { RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\nimport classes from './ResourcesSchedule.module.css';\n\nexport type ResourcesScheduleStylesNames =\n | 'root'\n | ResourcesDayViewStylesNames\n | ResourcesWeekViewStylesNames\n | ResourcesMonthViewStylesNames;\n\nexport type ResourcesScheduleViewLevel = 'day' | 'week' | 'month';\n\ntype ResourcesScheduleCommonProps =\n | 'date'\n | 'onDateChange'\n | 'resources'\n | 'events'\n | 'locale'\n | 'radius'\n | 'labels'\n | 'renderEventBody'\n | 'renderResourceLabel'\n | 'withEventsDragAndDrop'\n | 'onEventDrop'\n | 'canDragEvent'\n | 'onEventDragStart'\n | 'onEventDragEnd'\n | 'onTimeSlotClick'\n | 'onEventClick'\n | 'onDayClick'\n | 'withDragSlotSelect'\n | 'onSlotDragEnd'\n | 'view'\n | 'onViewChange'\n | 'mode'\n | 'onExternalEventDrop'\n | 'withEventResize'\n | 'onEventResize'\n | 'canResizeEvent'\n | 'recurrenceExpansionLimit'\n | 'withInteractiveBackgroundEvents';\n\ntype ResourcesScheduleViewProps<T> = Partial<Omit<T, ResourcesScheduleCommonProps>>;\n\nexport interface ResourcesScheduleProps\n extends BoxProps, StylesApiProps<ResourcesScheduleFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** List of resources to display */\n resources: ScheduleResourceData[];\n\n /** Current date to display (controlled) */\n date?: Date | DateStringValue;\n\n /** Default date (uncontrolled) */\n defaultDate?: Date | DateStringValue;\n\n /** Called when date changes via navigation */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Current view level (controlled) */\n view?: ResourcesScheduleViewLevel;\n\n /** Default view level (uncontrolled) @default 'day' */\n defaultView?: ResourcesScheduleViewLevel;\n\n /** Called when view level changes */\n onViewChange?: (view: ResourcesScheduleViewLevel) => void;\n\n /** Events to display across all views */\n events?: ScheduleEventData[];\n\n /** Locale for date formatting */\n locale?: string;\n\n /** Key of theme.radius or any valid CSS value to set border-radius */\n radius?: MantineRadius;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Custom event body renderer */\n renderEventBody?: RenderEventBody;\n\n /** Custom resource label renderer */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** Enable drag and drop for events @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when day is clicked in month view */\n onDayClick?: (data: {\n date: DateStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a slot range is selected by dragging */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Called when an external item is dropped onto the schedule */\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 edges, resizing snaps to whole days in month view @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 /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick`. Applies to `day` and `week` views only – `ResourcesMonthView` does not render background events separately. Combined with `withEventResize`, timed background events can also be resized by dragging their edges. @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** Max number of generated recurring instances @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Props specific to ResourcesDayView */\n dayViewProps?: ResourcesScheduleViewProps<ResourcesDayViewProps>;\n\n /** Props specific to ResourcesWeekView */\n weekViewProps?: ResourcesScheduleViewProps<ResourcesWeekViewProps>;\n\n /** Props specific to ResourcesMonthView */\n monthViewProps?: ResourcesScheduleViewProps<ResourcesMonthViewProps>;\n}\n\nexport type ResourcesScheduleFactory = Factory<{\n props: ResourcesScheduleProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesScheduleStylesNames;\n}>;\n\nconst defaultProps: Partial<ResourcesScheduleProps> = {\n defaultView: 'day',\n mode: 'default',\n};\n\nexport const ResourcesSchedule = factory<ResourcesScheduleFactory>((_props) => {\n const props = useProps('ResourcesSchedule', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n resources,\n date,\n defaultDate,\n onDateChange,\n view,\n defaultView,\n onViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n renderResourceLabel,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n withInteractiveBackgroundEvents,\n recurrenceExpansionLimit,\n mode,\n dayViewProps,\n weekViewProps,\n monthViewProps,\n __staticSelector,\n mod,\n ...others\n } = props;\n\n const getStyles = useStyles<ResourcesScheduleFactory>({\n name: __staticSelector || 'ResourcesSchedule',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const [_view, _setView] = useUncontrolled<ResourcesScheduleViewLevel>({\n value: view,\n defaultValue: defaultView,\n onChange: onViewChange,\n });\n\n const [_date, _setDate] = useUncontrolled<Date | DateStringValue>({\n value: date,\n defaultValue: defaultDate ?? new Date(),\n });\n\n const handleDateChange = (newDate: DateStringValue) => {\n _setDate(newDate);\n onDateChange?.(newDate);\n };\n\n const handleViewChange = (newView: ScheduleViewLevel) => {\n if (newView === 'day' || newView === 'week' || newView === 'month') {\n _setView(newView);\n }\n };\n\n const commonProps = {\n resources,\n date: _date,\n onDateChange: handleDateChange,\n onViewChange: handleViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n renderResourceLabel,\n withEventsDragAndDrop: mode === 'static' ? false : withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n mode,\n };\n\n const content = (() => {\n switch (_view) {\n case 'day':\n return (\n <ResourcesDayView\n {...commonProps}\n onTimeSlotClick={onTimeSlotClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...dayViewProps}\n />\n );\n case 'week':\n return (\n <ResourcesWeekView\n {...commonProps}\n onTimeSlotClick={onTimeSlotClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...weekViewProps}\n />\n );\n case 'month':\n return (\n <ResourcesMonthView\n {...commonProps}\n onDayClick={onDayClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n {...monthViewProps}\n />\n );\n default:\n return null;\n }\n })();\n\n return (\n <Box {...getStyles('root')} mod={mod} {...others}>\n {content}\n </Box>\n );\n});\n\nResourcesSchedule.displayName = '@mantine/schedule/ResourcesSchedule';\nResourcesSchedule.classes = classes;\n\nexport namespace ResourcesSchedule {\n export type Props = ResourcesScheduleProps;\n export type StylesNames = ResourcesScheduleStylesNames;\n export type Factory = ResourcesScheduleFactory;\n export type ViewLevel = ResourcesScheduleViewLevel;\n}\n"],"mappings":";;;;;;;;;AAyNA,MAAM,eAAgD;CACpD,aAAa;CACb,MAAM;AACR;AAEA,MAAa,oBAAoB,SAAmC,WAAW;CAC7E,MAAM,QAAQ,SAAS,qBAAqB,cAAc,MAAM;CAChE,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,WACA,MACA,aACA,cACA,MACA,aACA,cACA,QACA,QACA,QACA,QACA,iBACA,qBACA,uBACA,aACA,cACA,kBACA,gBACA,iBACA,YACA,cACA,oBACA,eACA,qBACA,iBACA,eACA,gBACA,iCACA,0BACA,MACA,cACA,eACA,gBACA,kBACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAAoC;EACpD,MAAM,oBAAoB;EAC1B,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,CAAC,OAAO,YAAY,gBAA4C;EACpE,OAAO;EACP,cAAc;EACd,UAAU;CACZ,CAAC;CAED,MAAM,CAAC,OAAO,YAAY,gBAAwC;EAChE,OAAO;EACP,cAAc,+BAAe,IAAI,KAAK;CACxC,CAAC;CAED,MAAM,oBAAoB,YAA6B;EACrD,SAAS,OAAO;EAChB,eAAe,OAAO;CACxB;CAEA,MAAM,oBAAoB,YAA+B;EACvD,IAAI,YAAY,SAAS,YAAY,UAAU,YAAY,SACzD,SAAS,OAAO;CAEpB;CAEA,MAAM,cAAc;EAClB;EACA,MAAM;EACN,cAAc;EACd,cAAc;EACd;EACA;EACA;EACA;EACA;EACA;EACA,uBAAuB,SAAS,WAAW,QAAQ;EACnD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAEA,MAAM,iBAAiB;EACrB,QAAQ,OAAR;GACE,KAAK,OACH,OACE,oBAAC,kBAAD;IACE,GAAI;IACa;IACjB,iBAAiB,SAAS,WAAW,QAAQ;IAC9B;IACC;IAChB,iCACE,SAAS,WAAW,QAAQ;IAE9B,GAAI;GACL,CAAA;GAEL,KAAK,QACH,OACE,oBAAC,mBAAD;IACE,GAAI;IACa;IACjB,iBAAiB,SAAS,WAAW,QAAQ;IAC9B;IACC;IAChB,iCACE,SAAS,WAAW,QAAQ;IAE9B,GAAI;GACL,CAAA;GAEL,KAAK,SACH,OACE,oBAAC,oBAAD;IACE,GAAI;IACQ;IACZ,iBAAiB,SAAS,WAAW,QAAQ;IAC9B;IACC;IAChB,GAAI;GACL,CAAA;GAEL,SACE,OAAO;EACX;CACF,EAAA,CAAG;CAEH,OACE,oBAAC,KAAD;EAAK,GAAI,UAAU,MAAM;EAAQ;EAAK,GAAI;EACvC,UAAA;CACE,CAAA;AAET,CAAC;AAED,kBAAkB,cAAc;AAChC,kBAAkB,UAAUA"}
@@ -265,7 +265,8 @@ const ResourcesWeekView = factory((_props) => {
265
265
  intervalMinutes,
266
266
  resizeIntervalMinutes: eventResizeInterval,
267
267
  onEventResize,
268
- canResizeEvent
268
+ canResizeEvent,
269
+ withBackgroundEvents: withInteractiveBackgroundEvents
269
270
  });
270
271
  const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== "static";
271
272
  const handleTimeSlotClick = (resourceId, day, slotTime, e) => {
@@ -401,20 +402,49 @@ const ResourcesWeekView = factory((_props) => {
401
402
  const dayEvents = weekViewEvents.byDay[day];
402
403
  if (!dayEvents) return;
403
404
  const dayOffsetPercent = dayIndex / weekdays.length * 100;
404
- const bgEvents = [...dayEvents.backgroundTimedEvents[resource.id] || [], ...dayEvents.backgroundAllDayEvents[resource.id] || []];
405
- for (const event of bgEvents) eventNodes.push(/* @__PURE__ */ jsx(ScheduleBackgroundEvent, {
406
- event,
407
- renderEvent,
408
- renderEventBody,
409
- interactive: interactiveBackgroundEvents,
410
- onEventClick,
411
- ...getStyles("resourcesWeekViewBackgroundEvent", { style: {
412
- left: `${dayOffsetPercent + event.position.top / 100 * dayWidthPercent}%`,
413
- width: `${event.position.height / 100 * dayWidthPercent}%`,
414
- top: 0,
415
- height: "100%"
416
- } })
417
- }, `bg-${event.id}-${day}`));
405
+ const pushBackgroundEvent = (event, allDay) => {
406
+ const backgroundEventDate = dayjs(day).format("YYYY-MM-DD");
407
+ const isResizable = !allDay && eventResize.isResizableEvent(event);
408
+ const resizePosition = eventResize.getResizePosition(event.id, backgroundEventDate);
409
+ const effectiveLeft = resizePosition ? resizePosition.left : event.position.top;
410
+ const effectiveWidth = resizePosition ? resizePosition.width : event.position.height;
411
+ eventNodes.push(/* @__PURE__ */ jsx(ScheduleBackgroundEvent, {
412
+ event,
413
+ renderEvent,
414
+ renderEventBody,
415
+ interactive: interactiveBackgroundEvents,
416
+ onEventClick: onEventClick ? (clickedEvent, e) => {
417
+ if (!eventResize.wasResizing()) onEventClick(clickedEvent, e);
418
+ } : void 0,
419
+ withResize: isResizable,
420
+ isResizing: resizePosition !== null,
421
+ activeResizeEdge: eventResize.resizingEdge,
422
+ resizeAxis: "horizontal",
423
+ resizeHandleProps: getStyles("resourcesWeekViewResizeHandle"),
424
+ onResizeStart: isResizable ? (edge, e) => {
425
+ const container = rowSlotsContainersRef.current[resourceIndex];
426
+ if (container) eventResize.handleResizeStart({
427
+ event,
428
+ edge,
429
+ container,
430
+ originalLeft: event.position.top,
431
+ originalWidth: event.position.height,
432
+ eventDate: backgroundEventDate,
433
+ dayIndex,
434
+ dayCount: weekdays.length,
435
+ pointerEvent: e
436
+ });
437
+ } : void 0,
438
+ ...getStyles("resourcesWeekViewBackgroundEvent", { style: {
439
+ left: `${dayOffsetPercent + effectiveLeft / 100 * dayWidthPercent}%`,
440
+ width: `${effectiveWidth / 100 * dayWidthPercent}%`,
441
+ top: 0,
442
+ height: "100%"
443
+ } })
444
+ }, `bg-${event.id}-${day}`));
445
+ };
446
+ for (const event of dayEvents.backgroundTimedEvents[resource.id] || []) pushBackgroundEvent(event, false);
447
+ for (const event of dayEvents.backgroundAllDayEvents[resource.id] || []) pushBackgroundEvent(event, true);
418
448
  const allRegularEvents = (dayEvents.regularEvents[resource.id] || []).filter((event) => !isAllDayEvent({
419
449
  event,
420
450
  date: day