@mantine/schedule 9.6.2 → 9.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/cjs/components/DayView/DayView.cjs +45 -30
  2. package/cjs/components/DayView/DayView.cjs.map +1 -1
  3. package/cjs/components/DayView/DayView.module.cjs.map +1 -1
  4. package/cjs/components/MobileMonthView/get-mobile-month-view-events.cjs +10 -2
  5. package/cjs/components/MobileMonthView/get-mobile-month-view-events.cjs.map +1 -1
  6. package/cjs/components/MonthView/MonthView.cjs +11 -4
  7. package/cjs/components/MonthView/MonthView.cjs.map +1 -1
  8. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +74 -59
  9. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
  10. package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs.map +1 -1
  11. package/cjs/components/ResourcesMonthView/ResourcesMonthView.cjs +18 -6
  12. package/cjs/components/ResourcesMonthView/ResourcesMonthView.cjs.map +1 -1
  13. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs +6 -1
  14. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs.map +1 -1
  15. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +84 -57
  16. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
  17. package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs.map +1 -1
  18. package/cjs/components/Schedule/Schedule.cjs +14 -1
  19. package/cjs/components/Schedule/Schedule.cjs.map +1 -1
  20. package/cjs/components/ScheduleEvent/ScheduleEvent.module.cjs.map +1 -1
  21. package/cjs/components/WeekView/WeekView.cjs +67 -45
  22. package/cjs/components/WeekView/WeekView.cjs.map +1 -1
  23. package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
  24. package/cjs/hooks/use-day-grid-event-resize.cjs +38 -8
  25. package/cjs/hooks/use-day-grid-event-resize.cjs.map +1 -1
  26. package/cjs/hooks/use-drag-drop-handlers.cjs +126 -10
  27. package/cjs/hooks/use-drag-drop-handlers.cjs.map +1 -1
  28. package/cjs/hooks/use-event-resize.cjs +36 -12
  29. package/cjs/hooks/use-event-resize.cjs.map +1 -1
  30. package/cjs/hooks/use-horizontal-event-resize.cjs +37 -12
  31. package/cjs/hooks/use-horizontal-event-resize.cjs.map +1 -1
  32. package/cjs/hooks/validate-event-resize.cjs +37 -0
  33. package/cjs/hooks/validate-event-resize.cjs.map +1 -0
  34. package/cjs/index.cjs +2 -0
  35. package/cjs/utils/is-event-placement-allowed/is-event-placement-allowed.cjs +52 -0
  36. package/cjs/utils/is-event-placement-allowed/is-event-placement-allowed.cjs.map +1 -0
  37. package/esm/components/DayView/DayView.mjs +45 -30
  38. package/esm/components/DayView/DayView.mjs.map +1 -1
  39. package/esm/components/DayView/DayView.module.mjs.map +1 -1
  40. package/esm/components/MobileMonthView/get-mobile-month-view-events.mjs +10 -2
  41. package/esm/components/MobileMonthView/get-mobile-month-view-events.mjs.map +1 -1
  42. package/esm/components/MonthView/MonthView.mjs +11 -4
  43. package/esm/components/MonthView/MonthView.mjs.map +1 -1
  44. package/esm/components/ResourcesDayView/ResourcesDayView.mjs +74 -59
  45. package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
  46. package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs.map +1 -1
  47. package/esm/components/ResourcesMonthView/ResourcesMonthView.mjs +18 -6
  48. package/esm/components/ResourcesMonthView/ResourcesMonthView.mjs.map +1 -1
  49. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs +6 -1
  50. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs.map +1 -1
  51. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +84 -57
  52. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
  53. package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs.map +1 -1
  54. package/esm/components/Schedule/Schedule.mjs +14 -1
  55. package/esm/components/Schedule/Schedule.mjs.map +1 -1
  56. package/esm/components/ScheduleEvent/ScheduleEvent.module.mjs.map +1 -1
  57. package/esm/components/WeekView/WeekView.mjs +67 -45
  58. package/esm/components/WeekView/WeekView.mjs.map +1 -1
  59. package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
  60. package/esm/hooks/use-day-grid-event-resize.mjs +38 -8
  61. package/esm/hooks/use-day-grid-event-resize.mjs.map +1 -1
  62. package/esm/hooks/use-drag-drop-handlers.mjs +126 -10
  63. package/esm/hooks/use-drag-drop-handlers.mjs.map +1 -1
  64. package/esm/hooks/use-event-resize.mjs +36 -12
  65. package/esm/hooks/use-event-resize.mjs.map +1 -1
  66. package/esm/hooks/use-horizontal-event-resize.mjs +37 -12
  67. package/esm/hooks/use-horizontal-event-resize.mjs.map +1 -1
  68. package/esm/hooks/validate-event-resize.mjs +37 -0
  69. package/esm/hooks/validate-event-resize.mjs.map +1 -0
  70. package/esm/index.mjs +2 -1
  71. package/esm/utils/is-event-placement-allowed/is-event-placement-allowed.mjs +50 -0
  72. package/esm/utils/is-event-placement-allowed/is-event-placement-allowed.mjs.map +1 -0
  73. package/lib/components/DayView/DayView.d.ts +11 -1
  74. package/lib/components/MonthView/MonthView.d.ts +9 -1
  75. package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +11 -1
  76. package/lib/components/ResourcesMonthView/ResourcesMonthView.d.ts +11 -1
  77. package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +12 -2
  78. package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +11 -1
  79. package/lib/components/Schedule/Schedule.d.ts +12 -2
  80. package/lib/components/WeekView/WeekView.d.ts +11 -1
  81. package/lib/hooks/use-day-grid-event-resize.d.ts +4 -2
  82. package/lib/hooks/use-drag-drop-handlers.d.ts +17 -1
  83. package/lib/hooks/use-event-resize.d.ts +4 -2
  84. package/lib/hooks/use-horizontal-event-resize.d.ts +4 -2
  85. package/lib/hooks/validate-event-resize.d.ts +33 -0
  86. package/lib/types.d.ts +65 -0
  87. package/lib/utils/index.d.ts +2 -0
  88. package/lib/utils/is-event-placement-allowed/is-event-placement-allowed.d.ts +22 -0
  89. package/package.json +6 -6
  90. package/styles.css +29 -0
  91. package/styles.layer.css +29 -0
@@ -1 +1 @@
1
- {"version":3,"file":"DayView.mjs","names":["classes"],"sources":["../../../src/components/DayView/DayView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, 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 ScrollAreaAutosizeProps,\n StylesApiProps,\n UnstyledButton,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport { useAutoScrollOnDrag } from '../../hooks/use-auto-scroll-on-drag';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useEventResize } from '../../hooks/use-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 ScheduleEventOverlapMode,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n clampIntervalMinutes,\n expandRecurringEvents,\n formatDate,\n getBusinessHoursMod,\n getDayPosition,\n getDayTimeIntervals,\n getTimeAxisEventStyle,\n getVisibleEvents,\n isAllDayEvent,\n toDateString,\n} from '../../utils';\nimport { AgendaView, AgendaViewStylesNames } from '../AgendaView/AgendaView';\nimport {\n CurrentTimeIndicator,\n CurrentTimeIndicatorStylesNames,\n} from '../CurrentTimeIndicator/CurrentTimeIndicator';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent';\nimport {\n RenderEvent,\n RenderEventBody,\n ScheduleEvent,\n ScheduleEventStylesNames,\n} from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectStylesNames } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getDayViewEvents } from './get-day-view-events/get-day-view-events';\nimport classes from './DayView.module.css';\n\nexport type DayViewStylesNames =\n | 'dayView'\n | 'dayViewInner'\n | 'dayViewScrollArea'\n | 'dayViewAllDay'\n | 'dayViewAllDayEvents'\n | 'dayViewSlot'\n | 'dayViewSlots'\n | 'dayViewTimeSlots'\n | 'dayViewSlotLabel'\n | 'dayViewSlotLabels'\n | 'dayViewBackgroundEvent'\n | 'dayViewBackgroundEventResizeHandle'\n | 'dayViewDragPreview'\n | MoreEventsStylesNames\n | ScheduleEventStylesNames\n | Exclude<CombinedScheduleHeaderStylesNames, MonthYearSelectStylesNames>\n | CurrentTimeIndicatorStylesNames\n | AgendaViewStylesNames;\n\nexport type DayViewCssVariables = {\n dayView: '--day-view-radius' | '--day-view-slot-height' | '--day-view-all-day-slot-height';\n};\n\nexport interface DayViewProps\n extends BoxProps, StylesApiProps<DayViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Day to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | DateStringValue;\n\n /** Called when date is changed */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Events to display, must be a stable reference */\n events?: ScheduleEventData[];\n\n /** Time slots start time, in `HH:mm:ss` format @default 00:00:00 */\n startTime?: string;\n\n /** Time slots end time in `HH:mm:ss` format @default 23:59:59 */\n endTime?: string;\n\n /** Number of minutes for each time slot. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours (e.g. `120`, `240`) @default 15 */\n intervalMinutes?: number;\n\n /** If set, grid lines are displayed for intervals smaller than one hour, for example 15 and 30 minutes intervals @default true */\n withSubHourGridLines?: boolean;\n\n /** Determines how events that overlap in time are laid out: `columns` splits the available width between them, `cascade` indents each event and stacks it over the previous one @default 'columns' */\n eventOverlapMode?: ScheduleEventOverlapMode;\n\n /** Time in ms the pointer must rest on an event before it is raised above the events covering it, only used with `eventOverlapMode=\"cascade\"` @default 600 */\n eventOverlapRaiseDelay?: number;\n\n /** If set, the all-day slot is displayed below the header @default true */\n withAllDaySlot?: boolean;\n\n /** Locale passed down to dayjs, overrides value defined on `DatesProvider` */\n locale?: string;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Dayjs format for slot labels or a callback function that returns formatted value @default HH:mm */\n slotLabelFormat?: DateLabelFormat;\n\n /** Date format in the header @default MMMM D, YYYY */\n headerFormat?: DateLabelFormat;\n\n /** If set, displays a 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 month control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next month 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 /** Height of 1hr slot @default 64px */\n slotHeight?: React.CSSProperties['height'];\n\n /** Height of all-day slot @default 44px */\n allDaySlotHeight?: React.CSSProperties['height'];\n\n /** Props passed down to the `ScrollArea.Autosize` component */\n scrollAreaProps?: ScrollAreaAutosizeProps & DataAttributes;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Function to customize event body, `event` object is passed as first argument */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering, receives all props that would be passed to the root element including children */\n renderEvent?: RenderEvent;\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 /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped at new time */\n onEventDrop?: (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 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 */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n }) => void;\n\n /** Called when all-day slot is clicked */\n onAllDaySlotClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => 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 */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Interaction mode: 'default' allows all interactions, 'static' disables event interactions @default default */\n mode?: ScheduleMode;\n\n /** Time to scroll to on initial render, in `HH:mm:ss` format */\n startScrollTime?: string;\n\n /** Called when an external item is dropped onto the schedule. Receives the `DataTransfer` object and the drop target datetime. */\n onExternalEventDrop?: (dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue) => void;\n\n /** If true, events can be resized by dragging their 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 /** Function to get additional props for each time slot. Receives slot start and end datetime strings. Returned props are spread onto the slot element. Event handlers returned by this function are composed with internal handlers (e.g. onClick) rather than overriding them. */\n getTimeSlotProps?: (data: {\n start: DateTimeStringValue;\n end: DateTimeStringValue;\n }) => Record<string, any> | undefined;\n\n /** If set, displays an Agenda button in the header that opens an agenda list view @default false */\n withAgenda?: boolean;\n}\n\nexport type DayViewFactory = Factory<{\n props: DayViewProps;\n ref: HTMLDivElement;\n stylesNames: DayViewStylesNames;\n vars: DayViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'DayView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 15,\n withSubHourGridLines: true,\n withAllDaySlot: true,\n slotLabelFormat: 'HH:mm',\n headerFormat: 'MMMM D, YYYY',\n withCurrentTimeBubble: true,\n withHeader: true,\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n withEventResize: false,\n mode: 'default',\n withInteractiveBackgroundEvents: false,\n eventOverlapMode: 'columns',\n eventOverlapRaiseDelay: 600,\n} satisfies Partial<DayViewProps>;\n\nconst varsResolver = createVarsResolver<DayViewFactory>(\n (_theme, { radius, slotHeight, allDaySlotHeight }) => ({\n dayView: {\n '--day-view-radius': radius !== undefined ? getRadius(radius) : undefined,\n '--day-view-slot-height': rem(slotHeight),\n '--day-view-all-day-slot-height': rem(allDaySlotHeight),\n },\n })\n);\n\nexport const DayView = factory<DayViewFactory>((_props) => {\n const props = useProps('DayView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n __staticSelector,\n startTime,\n endTime,\n intervalMinutes,\n withSubHourGridLines,\n eventOverlapMode,\n eventOverlapRaiseDelay,\n withAllDaySlot,\n date,\n locale,\n slotLabelFormat,\n headerFormat,\n getCurrentTime,\n withCurrentTimeIndicator,\n withCurrentTimeBubble,\n withHeader,\n radius,\n onDateChange,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n slotHeight,\n allDaySlotHeight,\n scrollAreaProps,\n events,\n moreEventsProps,\n renderEventBody,\n renderEvent,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n eventDragInterval,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n startScrollTime,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n eventResizeInterval,\n recurrenceExpansionLimit,\n getTimeSlotProps,\n withAgenda,\n ...others\n } = props;\n\n const [agendaOpen, setAgendaOpen] = useState(false);\n\n const getStyles = useStyles<DayViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n rootSelector: 'dayView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<DayViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const ctx = useDatesContext();\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const showCurrentTimeIndicator =\n withCurrentTimeIndicator ?? dayjs(date).isSame(resolveNow(), 'day');\n const slots = getDayTimeIntervals({ startTime, endTime, intervalMinutes });\n const slotsRef = useRef<HTMLButtonElement[]>([]);\n const viewportRef = useRef<HTMLDivElement>(null);\n const timeSlotsContainerRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n\n useAutoScrollOnDrag({\n viewportRef,\n enabled: (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static',\n });\n\n useIsomorphicEffect(() => {\n if (!startScrollTime || !viewportRef.current || slotsRef.current.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 = slotsRef.current[targetIndex];\n if (!targetSlot) {\n return;\n }\n\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n viewportRef.current.scrollTo({ left: 0, top: slotRect.top - viewportRect.top });\n }, []);\n\n const dragOffsetRef = useRef<{ offset: number; size: number }>({ offset: 0, size: 0 });\n\n const getSlotIndexFromDragPoint = useCallback((event: React.DragEvent) => {\n const slotIndex = slotsRef.current.findIndex((slotNode) => {\n if (!slotNode) {\n return false;\n }\n\n const rect = slotNode.getBoundingClientRect();\n return event.clientY >= rect.top && event.clientY <= rect.bottom;\n });\n\n if (slotIndex >= 0) {\n const rect = slotsRef.current[slotIndex]!.getBoundingClientRect();\n dragOffsetRef.current = { offset: event.clientY - rect.top, size: rect.height };\n return slotIndex;\n }\n\n const firstSlot = slotsRef.current[0];\n const lastSlot = slotsRef.current[slotsRef.current.length - 1];\n\n if (!firstSlot || !lastSlot) {\n return null;\n }\n\n const firstRect = firstSlot.getBoundingClientRect();\n const lastRect = lastSlot.getBoundingClientRect();\n\n if (event.clientY < firstRect.top) {\n dragOffsetRef.current = { offset: 0, size: firstRect.height };\n return 0;\n }\n\n if (event.clientY > lastRect.bottom) {\n dragOffsetRef.current = { offset: lastRect.height, size: lastRect.height };\n return slotsRef.current.length - 1;\n }\n\n return null;\n }, []);\n\n const handleSlotKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>, slotIndex: number) => {\n const direction = event.key;\n if (direction === 'ArrowDown' && slotIndex < slots.length - 1) {\n event.preventDefault();\n slotsRef.current[slotIndex + 1]?.focus();\n } else if (direction === 'ArrowUp' && slotIndex > 0) {\n event.preventDefault();\n slotsRef.current[slotIndex - 1]?.focus();\n }\n };\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex) => {\n if (!onSlotDragEnd) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n onSlotDragEnd(\n `${slotDate} ${slots[startIndex].startTime}`,\n `${slotDate} ${slots[endIndex].endTime}`\n );\n },\n });\n\n const expandedEvents = expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('day').toDate(),\n rangeEnd: dayjs(date).endOf('day').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n });\n\n const eventsData = getDayViewEvents({\n events: expandedEvents,\n date,\n startTime,\n endTime,\n intervalMinutes,\n eventOverlapMode,\n });\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, slotIndex: number) => {\n if (!onExternalEventDrop) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n const slotTime = slots[slotIndex].startTime;\n\n if (eventDragInterval == null) {\n onExternalEventDrop(e.dataTransfer, `${slotDate} ${slotTime}`);\n return;\n }\n\n const slotStart = `${slotDate} ${slotTime}`;\n const { start } = calculateDropTime({\n draggedEvent: { start: slotStart, end: slotStart } as ScheduleEventData,\n targetDate: date,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: dragOffsetRef.current.offset,\n slotSize: dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n onExternalEventDrop(e.dataTransfer, dayjs(start).format('YYYY-MM-DD HH:mm:ss'));\n },\n [onExternalEventDrop, date, slots, eventDragInterval, intervalMinutes, startTime, endTime]\n );\n\n const getDropTimeForSlot = (slotIndex: number, draggedEvent: ScheduleEventData) => {\n const slotTime = slots[slotIndex].startTime;\n return calculateDropTime({\n draggedEvent,\n targetDate: date,\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 dragDrop = useDragDropHandlers({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: getDropTimeForSlot,\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const updateDragPreview = (slotIndex: number) => {\n const draggedEvent = dragDrop.dragContextValue.draggedEvent;\n if (eventDragInterval == null || !draggedEvent) {\n return;\n }\n const { start, end } = getDropTimeForSlot(slotIndex, draggedEvent);\n const newStart = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n if (dragDrop.dragPreview?.start !== newStart) {\n dragDrop.setDragPreview({\n start: newStart,\n end: dayjs(end).format('YYYY-MM-DD HH:mm:ss'),\n target: slotIndex,\n });\n }\n };\n\n const eventResize = useEventResize({\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 eventsNodes = eventsData.regularEvents.map((event) => {\n const eventIsAllDay = isAllDayEvent({ event, date });\n const isDraggable = !eventIsAllDay && dragDrop.isDraggableEvent(event);\n const isResizable = !eventIsAllDay && eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const eventTop = resizePosition ? resizePosition.top : event.position.top;\n const eventHeight = resizePosition ? resizePosition.height : event.position.height;\n\n return (\n <ScheduleEvent\n event={event}\n key={event.id}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n autoSize\n draggable={isDraggable}\n withResize={isResizable}\n isResizing={resizePosition !== null}\n onResizeStart={\n isResizable\n ? (edge, e) => {\n if (timeSlotsContainerRef.current) {\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainerRef.current,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n {...stylesApiProps}\n mod={{ cascade: eventOverlapMode === 'cascade' }}\n style={{\n ...stylesApiProps.styles?.event,\n top: `${eventTop}%`,\n height: `${eventHeight}%`,\n insetInlineStart: `${event.position.offset}%`,\n width: `${event.position.width}%`,\n position: 'absolute',\n '--event-z-index': event.position.column + 3,\n '--event-z-index-raised': event.position.overlaps + 3,\n }}\n />\n );\n });\n\n const allDayEventsCount = getVisibleEvents({\n maxEvents: 2,\n totalEvents: eventsData.allDayEvents.length,\n });\n\n const allDayEventsNodes = eventsData.allDayEvents\n .slice(0, allDayEventsCount.visibleEventsCount)\n .map((event) => (\n <ScheduleEvent\n key={event.id}\n event={event}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n style={{ maxHeight: '50%' }}\n nowrap\n autoSize\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(event, e) : undefined}\n {...stylesApiProps}\n />\n ));\n\n const dayGroup = dayjs(date).format('YYYY-MM-DD');\n\n const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;\n\n const items = slots.map((slot, index) => {\n const isDropTarget = !suppressDropHighlight && dragDrop.isDropTarget(index);\n const isDragSelected = slotDragSelect.isSlotSelected(index, dayGroup);\n const slotStart = `${dayGroup} ${slot.startTime}` as DateTimeStringValue;\n const slotEnd = `${dayGroup} ${slot.endTime}` as DateTimeStringValue;\n const { onClick: externalOnClick, ...externalSlotProps } =\n getTimeSlotProps?.({ start: slotStart, end: slotEnd }) || {};\n\n const handleClick =\n mode === 'static'\n ? undefined\n : (event: React.MouseEvent<HTMLButtonElement>) => {\n onTimeSlotClick?.({\n slotStart,\n slotEnd,\n nativeEvent: event,\n });\n externalOnClick?.(event);\n };\n\n return (\n <UnstyledButton\n {...getStyles('dayViewSlot')}\n key={slot.startTime}\n ref={(node) => {\n slotsRef.current[index] = node!;\n }}\n mod={{\n first: index === 0,\n 'hour-start': slot.isHourStart,\n ...getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n __vars={{ '--slot-size': `${clampIntervalMinutes(intervalMinutes) / 60}` }}\n aria-label={`${getLabel('timeSlot', labels)} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : index === 0 ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? index : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? dayGroup : undefined}\n onKeyDown={mode === 'static' ? undefined : (e) => handleSlotKeyDown(e, index)}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => slotDragSelect.handleSlotPointerDown(e, index, dayGroup)\n : undefined\n }\n onClick={handleClick}\n onDragOver={withDragHandlers ? (event) => event.preventDefault() : undefined}\n {...externalSlotProps}\n />\n );\n });\n\n const slotsLabels = slots.reduce<React.ReactNode[]>((acc, slot) => {\n if (slot.isHourStart) {\n const slotTime = dayjs(`${dayjs(date).format('YYYY-MM-DD')} ${slot.startTime}`);\n const label = formatDate({\n locale: ctx.getLocale(locale),\n date: slotTime,\n format: slotLabelFormat,\n });\n\n acc.push(\n <Box\n {...getStyles('dayViewSlotLabel')}\n key={slot.startTime}\n mod={getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n })}\n >\n {label}\n </Box>\n );\n }\n return acc;\n }, []);\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const backgroundAllDayEventNodes = eventsData.backgroundAllDayEvents.map((event) => (\n <ScheduleBackgroundEvent\n key={`bg-allday-${event.id}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('dayViewBackgroundEvent', {\n style: { top: 0, height: '100%', width: '100%' },\n })}\n />\n ));\n\n const backgroundTimedEventNodes = eventsData.backgroundTimedEvents.map((event) => {\n const isResizable = eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n\n return (\n <ScheduleBackgroundEvent<'top' | 'bottom'>\n key={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 resizeHandleProps={getStyles('dayViewBackgroundEventResizeHandle')}\n onResizeStart={\n isResizable\n ? (edge, e) => {\n if (timeSlotsContainerRef.current) {\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainerRef.current,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n {...getStyles('dayViewBackgroundEvent', {\n style: {\n ...getTimeAxisEventStyle({\n start: resizePosition ? resizePosition.top : event.position.top,\n span: resizePosition ? resizePosition.height : event.position.height,\n axis: 'vertical',\n }),\n width: '100%',\n },\n })}\n />\n );\n });\n\n const content = (\n <Box\n {...getStyles('dayView')}\n __vars={{ '--event-raise-delay': `${eventOverlapRaiseDelay}ms` }}\n mod={{\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'hide-sub-hour-grid-lines': !withSubHourGridLines,\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 title: formatDate({ locale: ctx.getLocale(locale), date, format: headerFormat }),\n miw: 140,\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={viewSelectProps}\n stylesApiProps={stylesApiProps}\n onAgendaClick={withAgenda ? () => setAgendaOpen((v) => !v) : undefined}\n agendaActive={agendaOpen}\n />\n )}\n\n {agendaOpen && (\n <AgendaView\n rangeStart={dayjs(date).startOf('day').format('YYYY-MM-DD')}\n rangeEnd={dayjs(date).endOf('day').format('YYYY-MM-DD')}\n events={events}\n locale={locale}\n labels={labels}\n mode={mode}\n onEventClick={onEventClick}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n {...stylesApiProps}\n />\n )}\n\n {!agendaOpen && (\n <ScrollArea.Autosize\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('dayViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n viewportRef={mergedViewportRef}\n >\n <Box {...getStyles('dayViewInner')}>\n <div {...getStyles('dayViewSlotLabels')}>\n {withAllDaySlot && (\n <Box {...getStyles('dayViewSlotLabel')} mod={{ 'all-day': true }}>\n {getLabel('allDay', labels)}\n </Box>\n )}\n {slotsLabels}\n </div>\n\n <div {...getStyles('dayViewSlots')}>\n {withAllDaySlot && (\n <div {...getStyles('dayViewAllDay')}>\n {backgroundAllDayEventNodes}\n <div {...getStyles('dayViewAllDayEvents')}>\n {allDayEventsNodes}\n {allDayEventsCount.hiddenEventsCount > 0 && (\n <MoreEvents\n events={eventsData.allDayEvents}\n moreEventsCount={allDayEventsCount.hiddenEventsCount}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n mode={mode}\n labels={labels}\n onEventClick={onEventClick}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n )}\n </div>\n <UnstyledButton\n {...getStyles('dayViewSlot')}\n mod={{ 'all-day': true, static: mode === 'static' }}\n aria-label={`${getLabel('timeSlot', labels)} ${getLabel('allDay', labels)}`}\n onClick={\n mode === 'static' || !onAllDaySlotClick\n ? undefined\n : (e) => {\n onAllDaySlotClick(dayjs(date).format('YYYY-MM-DD'), e);\n }\n }\n />\n </div>\n )}\n\n <div\n ref={timeSlotsContainerRef}\n {...getStyles('dayViewTimeSlots')}\n onDragOver={\n withDragHandlers\n ? (event) => {\n const slotIndex = getSlotIndexFromDragPoint(event);\n if (slotIndex !== null) {\n dragDrop.handleDragOver(event, slotIndex);\n updateDragPreview(slotIndex);\n }\n }\n : undefined\n }\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={\n withDragHandlers\n ? (event) => {\n const slotIndex = getSlotIndexFromDragPoint(event);\n if (slotIndex !== null) {\n dragDrop.handleDrop(event, slotIndex);\n }\n }\n : undefined\n }\n >\n {backgroundTimedEventNodes}\n\n {eventsNodes}\n\n {dragDrop.dragPreview && dragDrop.dragContextValue.draggedEvent && (\n <Box\n {...getStyles('dayViewDragPreview', {\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 insetInlineStart: 0,\n insetInlineEnd: 0,\n top: `${top}%`,\n height: `${height}%`,\n };\n })(),\n })}\n />\n )}\n\n {showCurrentTimeIndicator && (\n <CurrentTimeIndicator\n startOffset=\"calc(var(--day-view-slot-labels-width) * -1)\"\n endOffset=\"0rem\"\n topOffset=\"0rem\"\n timeBubbleStartOffset=\"calc(var(--day-view-slot-labels-width) * -1 + 30px)\"\n currentTimeFormat={slotLabelFormat}\n withTimeBubble={withCurrentTimeBubble}\n withThumb={!withCurrentTimeBubble}\n locale={locale}\n startTime={startTime}\n endTime={endTime}\n intervalMinutes={intervalMinutes}\n getCurrentTime={getCurrentTime}\n {...stylesApiProps}\n />\n )}\n {items}\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n )}\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nDayView.displayName = '@mantine/schedule/DayView';\nDayView.classes = classes;\nDayView.varsResolver = varsResolver;\n\nexport namespace DayView {\n export type Props = DayViewProps;\n export type Factory = DayViewFactory;\n export type StylesNames = DayViewStylesNames;\n export type CssVariables = DayViewCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+RA,MAAM,eAAe;CACnB,kBAAkB;CAClB,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,sBAAsB;CACtB,gBAAgB;CAChB,iBAAiB;CACjB,cAAc;CACd,uBAAuB;CACvB,YAAY;CACZ,wBAAwB;CACxB,eAAe,CAAC,YAAY,UAAU;CACt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mBAAmB;SACnB,gBAAgB;SAChB,WAAW,CAAC;SACJ;SACG;SACF;SACQ;SACD;SAChB,GAAI;QACL,CAAA;QAEF;OACE;MACF,CAAA,CAAA;KACF,CAAA,CAAA;;GACc,CAAA;EAEpB;;CAGP,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO,SAAS;EAAmB,UAAA;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,QAAQ,cAAc;AACtB,QAAQ,UAAUA;AAClB,QAAQ,eAAe"}
1
+ {"version":3,"file":"DayView.mjs","names":["classes"],"sources":["../../../src/components/DayView/DayView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, 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 ScrollAreaAutosizeProps,\n StylesApiProps,\n UnstyledButton,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport { useAutoScrollOnDrag } from '../../hooks/use-auto-scroll-on-drag';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useEventResize } from '../../hooks/use-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 PreventEventOverlap,\n ScheduleCanDropEventData,\n ScheduleCanDropExternalEventData,\n ScheduleCanResizeEventToData,\n ScheduleEventData,\n ScheduleEventOverlapMode,\n ScheduleEventPlacementRejectedData,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n clampIntervalMinutes,\n expandRecurringEvents,\n formatDate,\n getBusinessHoursMod,\n getDayPosition,\n getDayTimeIntervals,\n getTimeAxisEventStyle,\n getVisibleEvents,\n isAllDayEvent,\n toDateString,\n} from '../../utils';\nimport { AgendaView, AgendaViewStylesNames } from '../AgendaView/AgendaView';\nimport {\n CurrentTimeIndicator,\n CurrentTimeIndicatorStylesNames,\n} from '../CurrentTimeIndicator/CurrentTimeIndicator';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent';\nimport {\n RenderEvent,\n RenderEventBody,\n ScheduleEvent,\n ScheduleEventStylesNames,\n} from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectStylesNames } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getDayViewEvents } from './get-day-view-events/get-day-view-events';\nimport classes from './DayView.module.css';\n\nexport type DayViewStylesNames =\n | 'dayView'\n | 'dayViewInner'\n | 'dayViewScrollArea'\n | 'dayViewAllDay'\n | 'dayViewAllDayEvents'\n | 'dayViewSlot'\n | 'dayViewSlots'\n | 'dayViewTimeSlots'\n | 'dayViewSlotLabel'\n | 'dayViewSlotLabels'\n | 'dayViewBackgroundEvent'\n | 'dayViewBackgroundEventResizeHandle'\n | 'dayViewDragPreview'\n | MoreEventsStylesNames\n | ScheduleEventStylesNames\n | Exclude<CombinedScheduleHeaderStylesNames, MonthYearSelectStylesNames>\n | CurrentTimeIndicatorStylesNames\n | AgendaViewStylesNames;\n\nexport type DayViewCssVariables = {\n dayView: '--day-view-radius' | '--day-view-slot-height' | '--day-view-all-day-slot-height';\n};\n\nexport interface DayViewProps\n extends BoxProps, StylesApiProps<DayViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Day to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | DateStringValue;\n\n /** Called when date is changed */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Events to display, must be a stable reference */\n events?: ScheduleEventData[];\n\n /** Time slots start time, in `HH:mm:ss` format @default 00:00:00 */\n startTime?: string;\n\n /** Time slots end time in `HH:mm:ss` format @default 23:59:59 */\n endTime?: string;\n\n /** Number of minutes for each time slot. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours (e.g. `120`, `240`) @default 15 */\n intervalMinutes?: number;\n\n /** If set, grid lines are displayed for intervals smaller than one hour, for example 15 and 30 minutes intervals @default true */\n withSubHourGridLines?: boolean;\n\n /** Determines how events that overlap in time are laid out: `columns` splits the available width between them, `cascade` indents each event and stacks it over the previous one @default 'columns' */\n eventOverlapMode?: ScheduleEventOverlapMode;\n\n /** Time in ms the pointer must rest on an event before it is raised above the events covering it, only used with `eventOverlapMode=\"cascade\"` @default 600 */\n eventOverlapRaiseDelay?: number;\n\n /** If set, the all-day slot is displayed below the header @default true */\n withAllDaySlot?: boolean;\n\n /** Locale passed down to dayjs, overrides value defined on `DatesProvider` */\n locale?: string;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Dayjs format for slot labels or a callback function that returns formatted value @default HH:mm */\n slotLabelFormat?: DateLabelFormat;\n\n /** Date format in the header @default MMMM D, YYYY */\n headerFormat?: DateLabelFormat;\n\n /** If set, displays a 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 month control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next month 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 /** Height of 1hr slot @default 64px */\n slotHeight?: React.CSSProperties['height'];\n\n /** Height of all-day slot @default 44px */\n allDaySlotHeight?: React.CSSProperties['height'];\n\n /** Props passed down to the `ScrollArea.Autosize` component */\n scrollAreaProps?: ScrollAreaAutosizeProps & DataAttributes;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Function to customize event body, `event` object is passed as first argument */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering, receives all props that would be passed to the root element including children */\n renderEvent?: RenderEvent;\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 /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped at new time */\n onEventDrop?: (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 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 */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n }) => void;\n\n /** Called when all-day slot is clicked */\n onAllDaySlotClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => 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 */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Interaction mode: 'default' allows all interactions, 'static' disables event interactions @default default */\n mode?: ScheduleMode;\n\n /** Time to scroll to on initial render, in `HH:mm:ss` format */\n startScrollTime?: string;\n\n /** Called when an external item is dropped onto the schedule. Receives the `DataTransfer` object and the drop target datetime. */\n onExternalEventDrop?: (dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue) => void;\n\n /** If true, events can be resized by dragging their edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */\n canDropEvent?: (data: ScheduleCanDropEventData) => boolean;\n\n /** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */\n canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;\n\n /** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */\n canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;\n\n /** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */\n preventEventOverlap?: PreventEventOverlap;\n\n /** Called when a drop or resize is rejected */\n onEventPlacementRejected?: (data: ScheduleEventPlacementRejectedData) => void;\n\n /** Snap step for resizing events, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventResizeInterval?: number;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Function to get additional props for each time slot. Receives slot start and end datetime strings. Returned props are spread onto the slot element. Event handlers returned by this function are composed with internal handlers (e.g. onClick) rather than overriding them. */\n getTimeSlotProps?: (data: {\n start: DateTimeStringValue;\n end: DateTimeStringValue;\n }) => Record<string, any> | undefined;\n\n /** If set, displays an Agenda button in the header that opens an agenda list view @default false */\n withAgenda?: boolean;\n}\n\nexport type DayViewFactory = Factory<{\n props: DayViewProps;\n ref: HTMLDivElement;\n stylesNames: DayViewStylesNames;\n vars: DayViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'DayView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 15,\n withSubHourGridLines: true,\n withAllDaySlot: true,\n slotLabelFormat: 'HH:mm',\n headerFormat: 'MMMM D, YYYY',\n withCurrentTimeBubble: true,\n withHeader: true,\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n withEventResize: false,\n mode: 'default',\n withInteractiveBackgroundEvents: false,\n eventOverlapMode: 'columns',\n eventOverlapRaiseDelay: 600,\n} satisfies Partial<DayViewProps>;\n\nconst varsResolver = createVarsResolver<DayViewFactory>(\n (_theme, { radius, slotHeight, allDaySlotHeight }) => ({\n dayView: {\n '--day-view-radius': radius !== undefined ? getRadius(radius) : undefined,\n '--day-view-slot-height': rem(slotHeight),\n '--day-view-all-day-slot-height': rem(allDaySlotHeight),\n },\n })\n);\n\nexport const DayView = factory<DayViewFactory>((_props) => {\n const props = useProps('DayView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n __staticSelector,\n startTime,\n endTime,\n intervalMinutes,\n withSubHourGridLines,\n eventOverlapMode,\n eventOverlapRaiseDelay,\n withAllDaySlot,\n date,\n locale,\n slotLabelFormat,\n headerFormat,\n getCurrentTime,\n withCurrentTimeIndicator,\n withCurrentTimeBubble,\n withHeader,\n radius,\n onDateChange,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n slotHeight,\n allDaySlotHeight,\n scrollAreaProps,\n events,\n moreEventsProps,\n renderEventBody,\n renderEvent,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n eventDragInterval,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n startScrollTime,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n canDropEvent,\n canDropExternalEvent,\n canResizeEventTo,\n preventEventOverlap,\n onEventPlacementRejected,\n eventResizeInterval,\n recurrenceExpansionLimit,\n getTimeSlotProps,\n withAgenda,\n ...others\n } = props;\n\n const [agendaOpen, setAgendaOpen] = useState(false);\n\n const getStyles = useStyles<DayViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n rootSelector: 'dayView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<DayViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const ctx = useDatesContext();\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const showCurrentTimeIndicator =\n withCurrentTimeIndicator ?? dayjs(date).isSame(resolveNow(), 'day');\n const slots = getDayTimeIntervals({ startTime, endTime, intervalMinutes });\n const slotsRef = useRef<HTMLButtonElement[]>([]);\n const viewportRef = useRef<HTMLDivElement>(null);\n const timeSlotsContainerRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n\n useAutoScrollOnDrag({\n viewportRef,\n enabled: (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static',\n });\n\n useIsomorphicEffect(() => {\n if (!startScrollTime || !viewportRef.current || slotsRef.current.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 = slotsRef.current[targetIndex];\n if (!targetSlot) {\n return;\n }\n\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n viewportRef.current.scrollTo({ left: 0, top: slotRect.top - viewportRect.top });\n }, []);\n\n const dragOffsetRef = useRef<{ offset: number; size: number }>({ offset: 0, size: 0 });\n\n const getSlotIndexFromDragPoint = useCallback((event: React.DragEvent) => {\n const slotIndex = slotsRef.current.findIndex((slotNode) => {\n if (!slotNode) {\n return false;\n }\n\n const rect = slotNode.getBoundingClientRect();\n return event.clientY >= rect.top && event.clientY <= rect.bottom;\n });\n\n if (slotIndex >= 0) {\n const rect = slotsRef.current[slotIndex]!.getBoundingClientRect();\n dragOffsetRef.current = { offset: event.clientY - rect.top, size: rect.height };\n return slotIndex;\n }\n\n const firstSlot = slotsRef.current[0];\n const lastSlot = slotsRef.current[slotsRef.current.length - 1];\n\n if (!firstSlot || !lastSlot) {\n return null;\n }\n\n const firstRect = firstSlot.getBoundingClientRect();\n const lastRect = lastSlot.getBoundingClientRect();\n\n if (event.clientY < firstRect.top) {\n dragOffsetRef.current = { offset: 0, size: firstRect.height };\n return 0;\n }\n\n if (event.clientY > lastRect.bottom) {\n dragOffsetRef.current = { offset: lastRect.height, size: lastRect.height };\n return slotsRef.current.length - 1;\n }\n\n return null;\n }, []);\n\n const handleSlotKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>, slotIndex: number) => {\n const direction = event.key;\n if (direction === 'ArrowDown' && slotIndex < slots.length - 1) {\n event.preventDefault();\n slotsRef.current[slotIndex + 1]?.focus();\n } else if (direction === 'ArrowUp' && slotIndex > 0) {\n event.preventDefault();\n slotsRef.current[slotIndex - 1]?.focus();\n }\n };\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex) => {\n if (!onSlotDragEnd) {\n return;\n }\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n onSlotDragEnd(\n `${slotDate} ${slots[startIndex].startTime}`,\n `${slotDate} ${slots[endIndex].endTime}`\n );\n },\n });\n\n const expandedEvents = expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('day').toDate(),\n rangeEnd: dayjs(date).endOf('day').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n });\n\n const eventsData = getDayViewEvents({\n events: expandedEvents,\n date,\n startTime,\n endTime,\n intervalMinutes,\n eventOverlapMode,\n });\n\n const getExternalDropDateTime = useCallback(\n (slotIndex: number) => {\n const slotDate = dayjs(date).format('YYYY-MM-DD');\n const slotTime = slots[slotIndex].startTime;\n const slotStart = `${slotDate} ${slotTime}`;\n\n if (eventDragInterval == null) {\n return slotStart;\n }\n\n const { start } = calculateDropTime({\n draggedEvent: { start: slotStart, end: slotStart } as ScheduleEventData,\n targetDate: date,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: dragOffsetRef.current.offset,\n slotSize: dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n\n return dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n },\n [date, slots, eventDragInterval, intervalMinutes, startTime, endTime]\n );\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, slotIndex: number) => {\n if (!onExternalEventDrop) {\n return;\n }\n onExternalEventDrop(e.dataTransfer, getExternalDropDateTime(slotIndex));\n },\n [onExternalEventDrop, getExternalDropDateTime]\n );\n\n const getDropTimeForSlot = (slotIndex: number, draggedEvent: ScheduleEventData) => {\n const slotTime = slots[slotIndex].startTime;\n return calculateDropTime({\n draggedEvent,\n targetDate: date,\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 dragDrop = useDragDropHandlers({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: getDropTimeForSlot,\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n events: expandedEvents,\n preventEventOverlap,\n canDropEvent,\n canDropExternalEvent,\n onEventPlacementRejected,\n getExternalDropDateTime,\n });\n\n const updateDragPreview = (slotIndex: number) => {\n const draggedEvent = dragDrop.dragContextValue.draggedEvent;\n if (eventDragInterval == null || !draggedEvent) {\n return;\n }\n const { start, end } = getDropTimeForSlot(slotIndex, draggedEvent);\n const newStart = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n if (dragDrop.dragPreview?.start !== newStart) {\n dragDrop.setDragPreview({\n start: newStart,\n end: dayjs(end).format('YYYY-MM-DD HH:mm:ss'),\n target: slotIndex,\n });\n }\n };\n\n const eventResize = useEventResize({\n enabled: withEventResize,\n mode,\n startTime,\n endTime,\n intervalMinutes,\n resizeIntervalMinutes: eventResizeInterval,\n onEventResize,\n canResizeEvent,\n events: expandedEvents,\n preventEventOverlap,\n canResizeEventTo,\n onEventPlacementRejected,\n withBackgroundEvents: withInteractiveBackgroundEvents,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const eventsNodes = eventsData.regularEvents.map((event) => {\n const eventIsAllDay = isAllDayEvent({ event, date });\n const isDraggable = !eventIsAllDay && dragDrop.isDraggableEvent(event);\n const isResizable = !eventIsAllDay && eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const eventTop = resizePosition ? resizePosition.top : event.position.top;\n const eventHeight = resizePosition ? resizePosition.height : event.position.height;\n\n return (\n <ScheduleEvent\n event={event}\n key={event.id}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n autoSize\n draggable={isDraggable}\n withResize={isResizable}\n isResizing={resizePosition !== null}\n onResizeStart={\n isResizable\n ? (edge, e) => {\n if (timeSlotsContainerRef.current) {\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainerRef.current,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n {...stylesApiProps}\n mod={{\n cascade: eventOverlapMode === 'cascade',\n invalid: resizePosition !== null && !eventResize.resizeValid,\n }}\n style={{\n ...stylesApiProps.styles?.event,\n top: `${eventTop}%`,\n height: `${eventHeight}%`,\n insetInlineStart: `${event.position.offset}%`,\n width: `${event.position.width}%`,\n position: 'absolute',\n '--event-z-index': event.position.column + 3,\n '--event-z-index-raised': event.position.overlaps + 3,\n }}\n />\n );\n });\n\n const allDayEventsCount = getVisibleEvents({\n maxEvents: 2,\n totalEvents: eventsData.allDayEvents.length,\n });\n\n const allDayEventsNodes = eventsData.allDayEvents\n .slice(0, allDayEventsCount.visibleEventsCount)\n .map((event) => (\n <ScheduleEvent\n key={event.id}\n event={event}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n style={{ maxHeight: '50%' }}\n nowrap\n autoSize\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(event, e) : undefined}\n {...stylesApiProps}\n />\n ));\n\n const dayGroup = dayjs(date).format('YYYY-MM-DD');\n\n const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;\n\n const items = slots.map((slot, index) => {\n const isDropTarget = !suppressDropHighlight && dragDrop.isDropTarget(index);\n const isDragSelected = slotDragSelect.isSlotSelected(index, dayGroup);\n const slotStart = `${dayGroup} ${slot.startTime}` as DateTimeStringValue;\n const slotEnd = `${dayGroup} ${slot.endTime}` as DateTimeStringValue;\n const { onClick: externalOnClick, ...externalSlotProps } =\n getTimeSlotProps?.({ start: slotStart, end: slotEnd }) || {};\n\n const handleClick =\n mode === 'static'\n ? undefined\n : (event: React.MouseEvent<HTMLButtonElement>) => {\n onTimeSlotClick?.({\n slotStart,\n slotEnd,\n nativeEvent: event,\n });\n externalOnClick?.(event);\n };\n\n return (\n <UnstyledButton\n {...getStyles('dayViewSlot')}\n key={slot.startTime}\n ref={(node) => {\n slotsRef.current[index] = node!;\n }}\n mod={{\n first: index === 0,\n 'hour-start': slot.isHourStart,\n ...getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n __vars={{ '--slot-size': `${clampIntervalMinutes(intervalMinutes) / 60}` }}\n aria-label={`${getLabel('timeSlot', labels)} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : index === 0 ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? index : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? dayGroup : undefined}\n onKeyDown={mode === 'static' ? undefined : (e) => handleSlotKeyDown(e, index)}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => slotDragSelect.handleSlotPointerDown(e, index, dayGroup)\n : undefined\n }\n onClick={handleClick}\n onDragOver={withDragHandlers ? (event) => event.preventDefault() : undefined}\n {...externalSlotProps}\n />\n );\n });\n\n const slotsLabels = slots.reduce<React.ReactNode[]>((acc, slot) => {\n if (slot.isHourStart) {\n const slotTime = dayjs(`${dayjs(date).format('YYYY-MM-DD')} ${slot.startTime}`);\n const label = formatDate({\n locale: ctx.getLocale(locale),\n date: slotTime,\n format: slotLabelFormat,\n });\n\n acc.push(\n <Box\n {...getStyles('dayViewSlotLabel')}\n key={slot.startTime}\n mod={getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n })}\n >\n {label}\n </Box>\n );\n }\n return acc;\n }, []);\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const backgroundAllDayEventNodes = eventsData.backgroundAllDayEvents.map((event) => (\n <ScheduleBackgroundEvent\n key={`bg-allday-${event.id}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('dayViewBackgroundEvent', {\n style: { top: 0, height: '100%', width: '100%' },\n })}\n />\n ));\n\n const backgroundTimedEventNodes = eventsData.backgroundTimedEvents.map((event) => {\n const isResizable = eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n\n return (\n <ScheduleBackgroundEvent<'top' | 'bottom'>\n key={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 resizeHandleProps={getStyles('dayViewBackgroundEventResizeHandle')}\n onResizeStart={\n isResizable\n ? (edge, e) => {\n if (timeSlotsContainerRef.current) {\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainerRef.current,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n {...getStyles('dayViewBackgroundEvent', {\n style: {\n ...getTimeAxisEventStyle({\n start: resizePosition ? resizePosition.top : event.position.top,\n span: resizePosition ? resizePosition.height : event.position.height,\n axis: 'vertical',\n }),\n width: '100%',\n },\n })}\n />\n );\n });\n\n const content = (\n <Box\n {...getStyles('dayView')}\n __vars={{ '--event-raise-delay': `${eventOverlapRaiseDelay}ms` }}\n mod={{\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'hide-sub-hour-grid-lines': !withSubHourGridLines,\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 title: formatDate({ locale: ctx.getLocale(locale), date, format: headerFormat }),\n miw: 140,\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={viewSelectProps}\n stylesApiProps={stylesApiProps}\n onAgendaClick={withAgenda ? () => setAgendaOpen((v) => !v) : undefined}\n agendaActive={agendaOpen}\n />\n )}\n\n {agendaOpen && (\n <AgendaView\n rangeStart={dayjs(date).startOf('day').format('YYYY-MM-DD')}\n rangeEnd={dayjs(date).endOf('day').format('YYYY-MM-DD')}\n events={events}\n locale={locale}\n labels={labels}\n mode={mode}\n onEventClick={onEventClick}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n {...stylesApiProps}\n />\n )}\n\n {!agendaOpen && (\n <ScrollArea.Autosize\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('dayViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n viewportRef={mergedViewportRef}\n >\n <Box {...getStyles('dayViewInner')}>\n <div {...getStyles('dayViewSlotLabels')}>\n {withAllDaySlot && (\n <Box {...getStyles('dayViewSlotLabel')} mod={{ 'all-day': true }}>\n {getLabel('allDay', labels)}\n </Box>\n )}\n {slotsLabels}\n </div>\n\n <div {...getStyles('dayViewSlots')}>\n {withAllDaySlot && (\n <div {...getStyles('dayViewAllDay')}>\n {backgroundAllDayEventNodes}\n <div {...getStyles('dayViewAllDayEvents')}>\n {allDayEventsNodes}\n {allDayEventsCount.hiddenEventsCount > 0 && (\n <MoreEvents\n events={eventsData.allDayEvents}\n moreEventsCount={allDayEventsCount.hiddenEventsCount}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n mode={mode}\n labels={labels}\n onEventClick={onEventClick}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n )}\n </div>\n <UnstyledButton\n {...getStyles('dayViewSlot')}\n mod={{ 'all-day': true, static: mode === 'static' }}\n aria-label={`${getLabel('timeSlot', labels)} ${getLabel('allDay', labels)}`}\n onClick={\n mode === 'static' || !onAllDaySlotClick\n ? undefined\n : (e) => {\n onAllDaySlotClick(dayjs(date).format('YYYY-MM-DD'), e);\n }\n }\n />\n </div>\n )}\n\n <div\n ref={timeSlotsContainerRef}\n {...getStyles('dayViewTimeSlots')}\n onDragOver={\n withDragHandlers\n ? (event) => {\n const slotIndex = getSlotIndexFromDragPoint(event);\n if (slotIndex !== null) {\n dragDrop.handleDragOver(event, slotIndex);\n updateDragPreview(slotIndex);\n }\n }\n : undefined\n }\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={\n withDragHandlers\n ? (event) => {\n const slotIndex = getSlotIndexFromDragPoint(event);\n if (slotIndex !== null) {\n dragDrop.handleDrop(event, slotIndex);\n }\n }\n : undefined\n }\n >\n {backgroundTimedEventNodes}\n\n {eventsNodes}\n\n {dragDrop.dragPreview && dragDrop.dragContextValue.draggedEvent && (\n <Box\n mod={{ invalid: !dragDrop.dropValid }}\n {...getStyles('dayViewDragPreview', {\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 insetInlineStart: 0,\n insetInlineEnd: 0,\n top: `${top}%`,\n height: `${height}%`,\n };\n })(),\n })}\n />\n )}\n\n {showCurrentTimeIndicator && (\n <CurrentTimeIndicator\n startOffset=\"calc(var(--day-view-slot-labels-width) * -1)\"\n endOffset=\"0rem\"\n topOffset=\"0rem\"\n timeBubbleStartOffset=\"calc(var(--day-view-slot-labels-width) * -1 + 30px)\"\n currentTimeFormat={slotLabelFormat}\n withTimeBubble={withCurrentTimeBubble}\n withThumb={!withCurrentTimeBubble}\n locale={locale}\n startTime={startTime}\n endTime={endTime}\n intervalMinutes={intervalMinutes}\n getCurrentTime={getCurrentTime}\n {...stylesApiProps}\n />\n )}\n {items}\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n )}\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nDayView.displayName = '@mantine/schedule/DayView';\nDayView.classes = classes;\nDayView.varsResolver = varsResolver;\n\nexport namespace DayView {\n export type Props = DayViewProps;\n export type Factory = DayViewFactory;\n export type StylesNames = DayViewStylesNames;\n export type CssVariables = DayViewCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmTA,MAAM,eAAe;CACnB,kBAAkB;CAClB,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,sBAAsB;CACtB,gBAAgB;CAChB,iBAAiB;CACjB,cAAc;CACd,uBAAuB;CACvB,YAAY;CACZ,wBAAwB;CACxB,eAAe,CAAC,YAAY,UAAU;CACtC,uBAAuB;CACvB,oBAAoB;CACpB,iBAAiB;CACjB,MAAM;CACN,iCAAiC;CACjC,kBAAkB;CAClB,wBAAw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ACF,EAAA,CAAG,EACL,CAAC;QACF,CAAA;QAGF,4BACC,oBAAC,sBAAD;SACE,aAAY;SACZ,WAAU;SACV,WAAU;SACV,uBAAsB;SACtB,mBAAmB;SACnB,gBAAgB;SAChB,WAAW,CAAC;SACJ;SACG;SACF;SACQ;SACD;SAChB,GAAI;QACL,CAAA;QAEF;OACE;MACF,CAAA,CAAA;KACF,CAAA,CAAA;;GACc,CAAA;EAEpB;;CAGP,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO,SAAS;EAAmB,UAAA;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,QAAQ,cAAc;AACtB,QAAQ,UAAUA;AAClB,QAAQ,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"DayView.module.mjs","names":[],"sources":["../../../src/components/DayView/DayView.module.css"],"sourcesContent":[".dayView {\n --slot-height: var(--day-view-slot-height, 64px); /* total height of 1 hour slot */\n --all-day-slot-height: var(--day-view-all-day-slot-height, 44px); /* height of all day slot */\n --day-view-slot-labels-width: 80px;\n --day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n @mixin where-light {\n --day-view-border-color: var(--mantine-color-gray-3);\n --day-view-business-hours-bg: var(--mantine-color-white);\n --day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --day-view-border-color: var(--mantine-color-dark-4);\n --day-view-business-hours-bg: var(--mantine-color-dark-7);\n --day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.dayViewHeader {\n text-transform: capitalize;\n height: 40px;\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}\n\n.dayViewScrollArea {\n border: 1px solid var(--day-view-border-color);\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n :where(:global(.mantine-ScrollArea-scrollbar)) {\n z-index: 4;\n }\n}\n\n.dayViewInner {\n display: flex;\n}\n\n.dayViewTimeSlots {\n position: relative;\n\n /* Cascade events stack with an unbounded z-index, keep them out of the sticky header's layer */\n &:where(:has([data-cascade])) {\n isolation: isolate;\n\n /* Drag and resize feedback must stay above every cascade column */\n --event-cascade-interaction-z-index: 999;\n\n .dayViewDragPreview {\n z-index: var(--event-cascade-interaction-z-index);\n }\n }\n\n &:where(:first-of-type) .dayViewSlot:where([data-first]) {\n border-top-color: transparent;\n }\n}\n\n.dayViewSlotLabels {\n width: var(--day-view-slot-labels-width);\n}\n\n.dayViewSlotLabel {\n height: var(--slot-height);\n border-top: 1px solid var(--day-view-border-color);\n font-size: var(--mantine-font-size-sm);\n text-align: right;\n padding: 4px 8px;\n font-variant-numeric: tabular-nums;\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where(:first-of-type) {\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n}\n\n.dayViewSlots {\n flex: 1;\n}\n\n.dayViewSlot {\n display: block;\n width: 100%;\n border-top: 1px dotted var(--day-view-border-color);\n height: calc(var(--slot-height) * var(--slot-size));\n position: relative;\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-hour-start]) {\n border-top: 1px solid var(--day-view-border-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--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.dayView:where([data-hide-sub-hour-grid-lines]) .dayViewSlot:not([data-hour-start]) {\n border-top-color: transparent;\n}\n\n.dayView:where([data-event-interaction]) .dayViewSlot:not([data-all-day]) {\n pointer-events: none;\n}\n\n.dayViewBackgroundEvent {\n position: absolute;\n border-radius: 0;\n pointer-events: none;\n z-index: 2;\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.dayViewBackgroundEventResizeHandle {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n width: 40%;\n max-width: 40px;\n height: 4px;\n border-radius: 2px;\n cursor: ns-resize;\n pointer-events: all;\n z-index: 4;\n touch-action: none;\n background-color: var(--bg-event-color);\n opacity: 0;\n transition: opacity 100ms ease;\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='top']) {\n top: 0;\n }\n\n &:where([data-edge='bottom']) {\n bottom: 0;\n }\n\n .dayViewBackgroundEvent:where(:hover, [data-resizing]) & {\n opacity: 0.5;\n }\n\n @mixin hover {\n opacity: 0.8;\n }\n}\n\n/* The resizing background event is the one that set `data-event-interaction`, so it must\n keep capturing pointer events. */\n.dayView:where([data-event-interaction], [data-slot-dragging])\n .dayViewBackgroundEvent:not([data-resizing]) {\n pointer-events: none;\n\n & .dayViewBackgroundEventResizeHandle {\n pointer-events: none;\n opacity: 0;\n }\n}\n\n.dayViewAllDay {\n position: relative;\n height: var(--all-day-slot-height);\n}\n\n.dayViewAllDayEvents {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n pointer-events: none;\n z-index: 3;\n}\n\n.dayViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--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":"DayView.module.mjs","names":[],"sources":["../../../src/components/DayView/DayView.module.css"],"sourcesContent":[".dayView {\n --slot-height: var(--day-view-slot-height, 64px); /* total height of 1 hour slot */\n --all-day-slot-height: var(--day-view-all-day-slot-height, 44px); /* height of all day slot */\n --day-view-slot-labels-width: 80px;\n --day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n @mixin where-light {\n --day-view-border-color: var(--mantine-color-gray-3);\n --day-view-business-hours-bg: var(--mantine-color-white);\n --day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --day-view-border-color: var(--mantine-color-dark-4);\n --day-view-business-hours-bg: var(--mantine-color-dark-7);\n --day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.dayViewHeader {\n text-transform: capitalize;\n height: 40px;\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}\n\n.dayViewScrollArea {\n border: 1px solid var(--day-view-border-color);\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n :where(:global(.mantine-ScrollArea-scrollbar)) {\n z-index: 4;\n }\n}\n\n.dayViewInner {\n display: flex;\n}\n\n.dayViewTimeSlots {\n position: relative;\n\n /* Cascade events stack with an unbounded z-index, keep them out of the sticky header's layer */\n &:where(:has([data-cascade])) {\n isolation: isolate;\n\n /* Drag and resize feedback must stay above every cascade column */\n --event-cascade-interaction-z-index: 999;\n\n .dayViewDragPreview {\n z-index: var(--event-cascade-interaction-z-index);\n }\n }\n\n &:where(:first-of-type) .dayViewSlot:where([data-first]) {\n border-top-color: transparent;\n }\n}\n\n.dayViewSlotLabels {\n width: var(--day-view-slot-labels-width);\n}\n\n.dayViewSlotLabel {\n height: var(--slot-height);\n border-top: 1px solid var(--day-view-border-color);\n font-size: var(--mantine-font-size-sm);\n text-align: right;\n padding: 4px 8px;\n font-variant-numeric: tabular-nums;\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where(:first-of-type) {\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n}\n\n.dayViewSlots {\n flex: 1;\n}\n\n.dayViewSlot {\n display: block;\n width: 100%;\n border-top: 1px dotted var(--day-view-border-color);\n height: calc(var(--slot-height) * var(--slot-size));\n position: relative;\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-hour-start]) {\n border-top: 1px solid var(--day-view-border-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--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.dayView:where([data-hide-sub-hour-grid-lines]) .dayViewSlot:not([data-hour-start]) {\n border-top-color: transparent;\n}\n\n.dayView:where([data-event-interaction]) .dayViewSlot:not([data-all-day]) {\n pointer-events: none;\n}\n\n.dayViewBackgroundEvent {\n position: absolute;\n border-radius: 0;\n pointer-events: none;\n z-index: 2;\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.dayViewBackgroundEventResizeHandle {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n width: 40%;\n max-width: 40px;\n height: 4px;\n border-radius: 2px;\n cursor: ns-resize;\n pointer-events: all;\n z-index: 4;\n touch-action: none;\n background-color: var(--bg-event-color);\n opacity: 0;\n transition: opacity 100ms ease;\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='top']) {\n top: 0;\n }\n\n &:where([data-edge='bottom']) {\n bottom: 0;\n }\n\n .dayViewBackgroundEvent:where(:hover, [data-resizing]) & {\n opacity: 0.5;\n }\n\n @mixin hover {\n opacity: 0.8;\n }\n}\n\n/* The resizing background event is the one that set `data-event-interaction`, so it must\n keep capturing pointer events. */\n.dayView:where([data-event-interaction], [data-slot-dragging])\n .dayViewBackgroundEvent:not([data-resizing]) {\n pointer-events: none;\n\n & .dayViewBackgroundEventResizeHandle {\n pointer-events: none;\n opacity: 0;\n }\n}\n\n.dayViewAllDay {\n position: relative;\n height: var(--all-day-slot-height);\n}\n\n.dayViewAllDayEvents {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n pointer-events: none;\n z-index: 3;\n}\n\n.dayViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--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 &:where([data-invalid]) {\n border-color: var(--mantine-color-error);\n background-color: transparent;\n opacity: 0.4;\n }\n}\n"],"mappings":""}
@@ -3,10 +3,16 @@ import { validateEvent } from "../../utils/validate-event/validate-event.mjs";
3
3
  import { isMultidayEvent } from "../../utils/is-multiday-event/is-multiday-event.mjs";
4
4
  import dayjs from "dayjs";
5
5
  //#region packages/@mantine/schedule/src/components/MobileMonthView/get-mobile-month-view-events.ts
6
+ function getEventEndDay(event) {
7
+ const startDay = dayjs(event.start).startOf("day");
8
+ const end = dayjs(event.end);
9
+ const endDay = end.hour() === 0 && end.minute() === 0 && end.second() === 0 ? end.startOf("day").subtract(1, "day") : end.startOf("day");
10
+ return endDay.isBefore(startDay) ? startDay : endDay;
11
+ }
6
12
  function groupEventByDate(event, groupedEvents) {
7
13
  if (isMultidayEvent(event)) {
8
14
  const startDate = dayjs(event.start).startOf("day");
9
- const endDate = dayjs(event.end).startOf("day");
15
+ const endDate = getEventEndDay(event);
10
16
  for (let date = startDate; date.isBefore(endDate) || date.isSame(endDate); date = date.add(1, "day")) {
11
17
  const dateKey = date.format("YYYY-MM-DD");
12
18
  if (!groupedEvents[dateKey]) groupedEvents[dateKey] = [];
@@ -21,10 +27,12 @@ function groupEventByDate(event, groupedEvents) {
21
27
  function getMobileMonthViewEvents({ date, events }) {
22
28
  const groupedEvents = {};
23
29
  if (events === void 0) return groupedEvents;
30
+ const monthStart = dayjs(date).startOf("month");
31
+ const monthEnd = dayjs(date).endOf("month");
24
32
  const ids = /* @__PURE__ */ new Set();
25
33
  for (const event of events) {
26
34
  if (event.display === "background") continue;
27
- if (dayjs(event.start).isSame(dayjs(date), "month")) {
35
+ if (!getEventEndDay(event).isBefore(monthStart, "day") && !dayjs(event.start).isAfter(monthEnd, "day")) {
28
36
  groupEventByDate(validateEvent(event), groupedEvents);
29
37
  if (!ids.has(event.id)) ids.add(event.id);
30
38
  else throw new Error(`[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}`);
@@ -1 +1 @@
1
- {"version":3,"file":"get-mobile-month-view-events.mjs","names":[],"sources":["../../../src/components/MobileMonthView/get-mobile-month-view-events.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { AnyDateValue, DateStringValue, ScheduleEventData } from '../../types';\nimport { isMultidayEvent, validateEvent } from '../../utils';\n\nexport type GroupedEvents = Record<DateStringValue, ScheduleEventData[]>;\n\nfunction groupEventByDate(event: ScheduleEventData, groupedEvents: GroupedEvents) {\n if (isMultidayEvent(event)) {\n const startDate = dayjs(event.start).startOf('day');\n const endDate = dayjs(event.end).startOf('day');\n\n for (\n let date = startDate;\n date.isBefore(endDate) || date.isSame(endDate);\n date = date.add(1, 'day')\n ) {\n const dateKey = date.format('YYYY-MM-DD');\n if (!groupedEvents[dateKey]) {\n groupedEvents[dateKey] = [];\n }\n groupedEvents[dateKey].push(event);\n }\n\n return;\n }\n\n const eventDate = dayjs(event.start).format('YYYY-MM-DD');\n if (!groupedEvents[eventDate]) {\n groupedEvents[eventDate] = [];\n }\n groupedEvents[eventDate].push(event);\n}\n\ninterface GetMobileMonthViewEventsInput {\n date: AnyDateValue;\n events: ScheduleEventData[] | undefined;\n}\n\nexport function getMobileMonthViewEvents({ date, events }: GetMobileMonthViewEventsInput) {\n const groupedEvents: GroupedEvents = {};\n\n if (events === undefined) {\n return groupedEvents;\n }\n\n const ids = new Set<string | number>();\n\n for (const event of events) {\n if (event.display === 'background') {\n continue;\n }\n\n if (dayjs(event.start).isSame(dayjs(date), 'month')) {\n groupEventByDate(validateEvent(event), groupedEvents);\n\n if (!ids.has(event.id)) {\n ids.add(event.id);\n } else {\n throw new Error(\n `[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}`\n );\n }\n }\n }\n\n return groupedEvents;\n}\n"],"mappings":";;;;;AAMA,SAAS,iBAAiB,OAA0B,eAA8B;CAChF,IAAI,gBAAgB,KAAK,GAAG;EAC1B,MAAM,YAAY,MAAM,MAAM,KAAK,CAAC,CAAC,QAAQ,KAAK;EAClD,MAAM,UAAU,MAAM,MAAM,GAAG,CAAC,CAAC,QAAQ,KAAK;EAE9C,KACE,IAAI,OAAO,WACX,KAAK,SAAS,OAAO,KAAK,KAAK,OAAO,OAAO,GAC7C,OAAO,KAAK,IAAI,GAAG,KAAK,GACxB;GACA,MAAM,UAAU,KAAK,OAAO,YAAY;GACxC,IAAI,CAAC,cAAc,UACjB,cAAc,WAAW,CAAC;GAE5B,cAAc,QAAQ,CAAC,KAAK,KAAK;EACnC;EAEA;CACF;CAEA,MAAM,YAAY,MAAM,MAAM,KAAK,CAAC,CAAC,OAAO,YAAY;CACxD,IAAI,CAAC,cAAc,YACjB,cAAc,aAAa,CAAC;CAE9B,cAAc,UAAU,CAAC,KAAK,KAAK;AACrC;AAOA,SAAgB,yBAAyB,EAAE,MAAM,UAAyC;CACxF,MAAM,gBAA+B,CAAC;CAEtC,IAAI,WAAW,KAAA,GACb,OAAO;CAGT,MAAM,sBAAM,IAAI,IAAqB;CAErC,KAAK,MAAM,SAAS,QAAQ;EAC1B,IAAI,MAAM,YAAY,cACpB;EAGF,IAAI,MAAM,MAAM,KAAK,CAAC,CAAC,OAAO,MAAM,IAAI,GAAG,OAAO,GAAG;GACnD,iBAAiB,cAAc,KAAK,GAAG,aAAa;GAEpD,IAAI,CAAC,IAAI,IAAI,MAAM,EAAE,GACnB,IAAI,IAAI,MAAM,EAAE;QAEhB,MAAM,IAAI,MACR,oEAAoE,MAAM,IAC5E;EAEJ;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"get-mobile-month-view-events.mjs","names":[],"sources":["../../../src/components/MobileMonthView/get-mobile-month-view-events.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { AnyDateValue, DateStringValue, ScheduleEventData } from '../../types';\nimport { isMultidayEvent, validateEvent } from '../../utils';\n\nexport type GroupedEvents = Record<DateStringValue, ScheduleEventData[]>;\n\nfunction getEventEndDay(event: ScheduleEventData) {\n const startDay = dayjs(event.start).startOf('day');\n const end = dayjs(event.end);\n const endAtMidnight = end.hour() === 0 && end.minute() === 0 && end.second() === 0;\n const endDay = endAtMidnight ? end.startOf('day').subtract(1, 'day') : end.startOf('day');\n return endDay.isBefore(startDay) ? startDay : endDay;\n}\n\nfunction groupEventByDate(event: ScheduleEventData, groupedEvents: GroupedEvents) {\n if (isMultidayEvent(event)) {\n const startDate = dayjs(event.start).startOf('day');\n const endDate = getEventEndDay(event);\n\n for (\n let date = startDate;\n date.isBefore(endDate) || date.isSame(endDate);\n date = date.add(1, 'day')\n ) {\n const dateKey = date.format('YYYY-MM-DD');\n if (!groupedEvents[dateKey]) {\n groupedEvents[dateKey] = [];\n }\n groupedEvents[dateKey].push(event);\n }\n\n return;\n }\n\n const eventDate = dayjs(event.start).format('YYYY-MM-DD');\n if (!groupedEvents[eventDate]) {\n groupedEvents[eventDate] = [];\n }\n groupedEvents[eventDate].push(event);\n}\n\ninterface GetMobileMonthViewEventsInput {\n date: AnyDateValue;\n events: ScheduleEventData[] | undefined;\n}\n\nexport function getMobileMonthViewEvents({ date, events }: GetMobileMonthViewEventsInput) {\n const groupedEvents: GroupedEvents = {};\n\n if (events === undefined) {\n return groupedEvents;\n }\n\n const monthStart = dayjs(date).startOf('month');\n const monthEnd = dayjs(date).endOf('month');\n\n const ids = new Set<string | number>();\n\n for (const event of events) {\n if (event.display === 'background') {\n continue;\n }\n\n const overlapsMonth =\n !getEventEndDay(event).isBefore(monthStart, 'day') &&\n !dayjs(event.start).isAfter(monthEnd, 'day');\n\n if (overlapsMonth) {\n groupEventByDate(validateEvent(event), groupedEvents);\n\n if (!ids.has(event.id)) {\n ids.add(event.id);\n } else {\n throw new Error(\n `[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}`\n );\n }\n }\n }\n\n return groupedEvents;\n}\n"],"mappings":";;;;;AAMA,SAAS,eAAe,OAA0B;CAChD,MAAM,WAAW,MAAM,MAAM,KAAK,CAAC,CAAC,QAAQ,KAAK;CACjD,MAAM,MAAM,MAAM,MAAM,GAAG;CAE3B,MAAM,SADgB,IAAI,KAAK,MAAM,KAAK,IAAI,OAAO,MAAM,KAAK,IAAI,OAAO,MAAM,IAClD,IAAI,QAAQ,KAAK,CAAC,CAAC,SAAS,GAAG,KAAK,IAAI,IAAI,QAAQ,KAAK;CACxF,OAAO,OAAO,SAAS,QAAQ,IAAI,WAAW;AAChD;AAEA,SAAS,iBAAiB,OAA0B,eAA8B;CAChF,IAAI,gBAAgB,KAAK,GAAG;EAC1B,MAAM,YAAY,MAAM,MAAM,KAAK,CAAC,CAAC,QAAQ,KAAK;EAClD,MAAM,UAAU,eAAe,KAAK;EAEpC,KACE,IAAI,OAAO,WACX,KAAK,SAAS,OAAO,KAAK,KAAK,OAAO,OAAO,GAC7C,OAAO,KAAK,IAAI,GAAG,KAAK,GACxB;GACA,MAAM,UAAU,KAAK,OAAO,YAAY;GACxC,IAAI,CAAC,cAAc,UACjB,cAAc,WAAW,CAAC;GAE5B,cAAc,QAAQ,CAAC,KAAK,KAAK;EACnC;EAEA;CACF;CAEA,MAAM,YAAY,MAAM,MAAM,KAAK,CAAC,CAAC,OAAO,YAAY;CACxD,IAAI,CAAC,cAAc,YACjB,cAAc,aAAa,CAAC;CAE9B,cAAc,UAAU,CAAC,KAAK,KAAK;AACrC;AAOA,SAAgB,yBAAyB,EAAE,MAAM,UAAyC;CACxF,MAAM,gBAA+B,CAAC;CAEtC,IAAI,WAAW,KAAA,GACb,OAAO;CAGT,MAAM,aAAa,MAAM,IAAI,CAAC,CAAC,QAAQ,OAAO;CAC9C,MAAM,WAAW,MAAM,IAAI,CAAC,CAAC,MAAM,OAAO;CAE1C,MAAM,sBAAM,IAAI,IAAqB;CAErC,KAAK,MAAM,SAAS,QAAQ;EAC1B,IAAI,MAAM,YAAY,cACpB;EAOF,IAHE,CAAC,eAAe,KAAK,CAAC,CAAC,SAAS,YAAY,KAAK,KACjD,CAAC,MAAM,MAAM,KAAK,CAAC,CAAC,QAAQ,UAAU,KAAK,GAE1B;GACjB,iBAAiB,cAAc,KAAK,GAAG,aAAa;GAEpD,IAAI,CAAC,IAAI,IAAI,MAAM,EAAE,GACnB,IAAI,IAAI,MAAM,EAAE;QAEhB,MAAM,IAAI,MACR,oEAAoE,MAAM,IAC5E;EAEJ;CACF;CAEA,OAAO;AACT"}
@@ -46,7 +46,7 @@ const defaultProps = {
46
46
  };
47
47
  const MonthView = factory((_props) => {
48
48
  const props = useProps("MonthView", defaultProps, _props);
49
- const { classNames, className, style, styles, unstyled, attributes, vars, mod, date, onDateChange, withWeekNumbers, withWeekDays, withWeekendDays, locale, weekdayFormat, firstDayOfWeek, weekendDays, __staticSelector, getDayProps, getWeekNumberProps, onDayClick, onWeekNumberClick, consistentWeeks, highlightToday, radius, withOutsideDays, withHeader, monthYearSelectProps, onViewChange, todayControlProps, nextControlProps, previousControlProps, viewSelectProps, events, moreEventsProps, renderEventBody, renderEvent, withEventsDragAndDrop, onEventDrop, canDragEvent, onEventDragStart, onEventDragEnd, onEventClick, withInteractiveBackgroundEvents, withDragSlotSelect, onSlotDragEnd, labels, mode, scrollAreaProps, onExternalEventDrop, recurrenceExpansionLimit, maxEventsPerDay: _maxEventsPerDay, withAgenda, ...others } = props;
49
+ const { classNames, className, style, styles, unstyled, attributes, vars, mod, date, onDateChange, withWeekNumbers, withWeekDays, withWeekendDays, locale, weekdayFormat, firstDayOfWeek, weekendDays, __staticSelector, getDayProps, getWeekNumberProps, onDayClick, onWeekNumberClick, consistentWeeks, highlightToday, radius, withOutsideDays, withHeader, monthYearSelectProps, onViewChange, todayControlProps, nextControlProps, previousControlProps, viewSelectProps, events, moreEventsProps, renderEventBody, renderEvent, withEventsDragAndDrop, onEventDrop, canDragEvent, canDropEvent, canDropExternalEvent, preventEventOverlap, onEventPlacementRejected, onEventDragStart, onEventDragEnd, onEventClick, withInteractiveBackgroundEvents, withDragSlotSelect, onSlotDragEnd, labels, mode, scrollAreaProps, onExternalEventDrop, recurrenceExpansionLimit, maxEventsPerDay: _maxEventsPerDay, withAgenda, ...others } = props;
50
50
  const [agendaOpen, setAgendaOpen] = useState(false);
51
51
  const maxEventsPerDay = Math.min(10, Math.max(1, _maxEventsPerDay ?? 2));
52
52
  const getStyles = useStyles({
@@ -101,10 +101,11 @@ const MonthView = factory((_props) => {
101
101
  withOutsideDays,
102
102
  consistentWeeks
103
103
  });
104
+ const getExternalDropDateTime = useCallback((day) => `${dayjs(day).format("YYYY-MM-DD")} 00:00:00`, []);
104
105
  const handleExternalDrop = useCallback((e, day) => {
105
106
  if (!onExternalEventDrop) return;
106
- onExternalEventDrop(e.dataTransfer, `${dayjs(day).format("YYYY-MM-DD")} 00:00:00`);
107
- }, [onExternalEventDrop]);
107
+ onExternalEventDrop(e.dataTransfer, getExternalDropDateTime(day));
108
+ }, [onExternalEventDrop, getExternalDropDateTime]);
108
109
  const dragDrop = useDragDropHandlers({
109
110
  enabled: withEventsDragAndDrop,
110
111
  mode,
@@ -118,7 +119,13 @@ const MonthView = factory((_props) => {
118
119
  targetDay
119
120
  });
120
121
  },
121
- onExternalDrop: onExternalEventDrop ? handleExternalDrop : void 0
122
+ onExternalDrop: onExternalEventDrop ? handleExternalDrop : void 0,
123
+ events: expandedEvents,
124
+ preventEventOverlap,
125
+ canDropEvent,
126
+ canDropExternalEvent,
127
+ onEventPlacementRejected,
128
+ getExternalDropDateTime
122
129
  });
123
130
  const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== "static";
124
131
  const flatDaysRef = useRef([]);
@@ -1 +1 @@
1
- {"version":3,"file":"MonthView.mjs","names":["classes"],"sources":["../../../src/components/MonthView/MonthView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useRef, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n ScrollArea,\n ScrollAreaProps,\n StylesApiProps,\n UnstyledButton,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n getMonthDays,\n getMonthRange,\n getWeekdaysNames,\n getWeekNumber,\n isSameMonth,\n toDateString,\n} from '../../utils';\nimport { AgendaView, AgendaViewStylesNames } from '../AgendaView/AgendaView';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps } from '../MoreEvents/MoreEvents';\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectProps } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getMonthViewEvents } from './get-month-view-events/get-month-view-events';\nimport { getRenderableMonthEventSegments } from './get-renderable-month-event-segments';\nimport { clipSpanToVisibleColumns, getVisibleColumnMap } from './get-visible-columns';\nimport { handleMonthViewKeyDown, MonthViewControlsRef } from './handle-month-view-key-down';\nimport classes from './MonthView.module.css';\n\nexport type MonthViewStylesNames =\n | 'monthView'\n | 'monthViewScrollArea'\n | 'monthViewInner'\n | 'monthViewWeek'\n | 'monthViewDay'\n | 'monthViewDayLabel'\n | 'monthViewWeekNumber'\n | 'monthViewWeekday'\n | 'monthViewWeekdays'\n | 'monthViewWeekdaysCorner'\n | 'monthViewEvents'\n | 'monthViewBackgroundEvent'\n | CombinedScheduleHeaderStylesNames\n | AgendaViewStylesNames;\n\nexport type MonthViewCssVariables = {\n monthView: '--month-view-radius' | '--month-view-max-events';\n};\n\nexport interface MonthViewProps\n extends BoxProps, StylesApiProps<MonthViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Date to display, Date object or date string in `YYYY-MM-DD 00:00:00` 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 /** If set, week numbers are displayed in the first column @default false */\n withWeekNumbers?: boolean;\n\n /** If set, weekdays names are displayed in the first row @default true */\n withWeekDays?: boolean;\n\n /** If set, weekend days are displayed. When `false`, days defined by `weekendDays` are hidden and the grid shrinks to the remaining columns @default true */\n withWeekendDays?: boolean;\n\n /** Locale passed down to dayjs, overrides value defined on `DatesProvider` */\n locale?: string;\n\n /** Number 0-6, where 0 – Sunday and 6 – Saturday. @default 1 – Monday */\n firstDayOfWeek?: DayOfWeek;\n\n /** `dayjs` format for weekdays names. By default, the first letter of the weekday. */\n weekdayFormat?: DateLabelFormat;\n\n /** Indices of weekend days, 0-6, where 0 is Sunday and 6 is Saturday. The default value is defined by `DatesProvider`. */\n weekendDays?: DayOfWeek[];\n\n /** Props passed down to the week number button */\n getWeekNumberProps?: (weekStartDate: DateStringValue) => Record<string, any>;\n\n /** Props passed down to the day button */\n getDayProps?: (date: DateStringValue) => Record<string, any>;\n\n /** Called when day is clicked */\n onDayClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Called with first day of the week when week number is clicked */\n onWeekNumberClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, always renders 6 weeks in the month view @default true */\n consistentWeeks?: boolean;\n\n /** If set, highlights the current day @default true */\n highlightToday?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set, days from the previous and next months are displayed to fill the weeks @default true */\n withOutsideDays?: boolean;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Props passed down to `MonthYearSelect` component in the header */\n monthYearSelectProps?: Partial<MonthYearSelectProps>;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous month control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next month control */\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to today control */\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to view level select */\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n\n /** Events to display */\n events?: ScheduleEventData[];\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Function to customize event body, `event` object is passed as first argument */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering, receives all props that would be passed to the root element including children */\n renderEvent?: RenderEvent;\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped on new date */\n onEventDrop?: (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 dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick` @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** If set, enables drag-to-select day ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a day range is selected by dragging */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Interaction mode: 'default' allows all interactions, 'static' disables event interactions @default default */\n mode?: ScheduleMode;\n\n /** Props passed down to `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n\n /** Called when an external item is dropped onto the schedule. Receives the `DataTransfer` object and the drop target datetime. */\n onExternalEventDrop?: (dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue) => void;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Maximum number of events visible per day before \"+more\" indicator shows, value is clamped between 1 and 10 @default 2 */\n maxEventsPerDay?: number;\n\n /** If set, displays an Agenda button in the header that opens an agenda list view @default false */\n withAgenda?: boolean;\n}\n\nexport type MonthViewFactory = Factory<{\n props: MonthViewProps;\n ref: HTMLDivElement;\n stylesNames: MonthViewStylesNames;\n vars: MonthViewCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<MonthViewFactory>(\n (_theme, { radius, maxEventsPerDay }) => ({\n monthView: {\n '--month-view-radius': radius !== undefined ? getRadius(radius) : undefined,\n '--month-view-max-events':\n maxEventsPerDay !== undefined ? `${Math.min(10, Math.max(1, maxEventsPerDay))}` : undefined,\n },\n })\n);\n\nconst defaultProps = {\n __staticSelector: 'MonthView',\n withWeekDays: true,\n withWeekendDays: true,\n consistentWeeks: true,\n highlightToday: true,\n withOutsideDays: true,\n withHeader: true,\n weekdayFormat: 'ddd',\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n mode: 'default',\n withInteractiveBackgroundEvents: false,\n} satisfies Partial<MonthViewProps>;\n\nexport const MonthView = factory<MonthViewFactory>((_props) => {\n const props = useProps('MonthView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n mod,\n date,\n onDateChange,\n withWeekNumbers,\n withWeekDays,\n withWeekendDays,\n locale,\n weekdayFormat,\n firstDayOfWeek,\n weekendDays,\n __staticSelector,\n getDayProps,\n getWeekNumberProps,\n onDayClick,\n onWeekNumberClick,\n consistentWeeks,\n highlightToday,\n radius,\n withOutsideDays,\n withHeader,\n monthYearSelectProps,\n onViewChange,\n todayControlProps,\n nextControlProps,\n previousControlProps,\n viewSelectProps,\n events,\n moreEventsProps,\n renderEventBody,\n renderEvent,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n labels,\n mode,\n scrollAreaProps,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n maxEventsPerDay: _maxEventsPerDay,\n withAgenda,\n ...others\n } = props;\n\n const [agendaOpen, setAgendaOpen] = useState(false);\n const maxEventsPerDay = Math.min(10, Math.max(1, _maxEventsPerDay ?? 2));\n\n const getStyles = useStyles<MonthViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n rootSelector: 'monthView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<MonthViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const ctx = useDatesContext();\n\n const resolvedFirstDayOfWeek = ctx.getFirstDayOfWeek(firstDayOfWeek);\n const resolvedWeekendDays = ctx.getWeekendDays(weekendDays);\n const hiddenColumns = withWeekendDays\n ? []\n : Array.from({ length: 7 }, (_, index) => index).filter((index) =>\n resolvedWeekendDays.includes(((resolvedFirstDayOfWeek + index) % 7) as DayOfWeek)\n );\n const hiddenColumnSet = new Set(hiddenColumns);\n const columnsCount = 7 - hiddenColumns.length;\n const visibleColumnMap = getVisibleColumnMap(hiddenColumns);\n\n const range = getMonthRange({\n month: date,\n withOutsideDays,\n consistentWeeks,\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n });\n\n const expandedEvents = expandRecurringEvents({\n events,\n rangeStart: dayjs(range.start).startOf('day').toDate(),\n rangeEnd: dayjs(range.end).endOf('day').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n });\n\n const monthEvents = getMonthViewEvents({\n date,\n events: expandedEvents,\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n withOutsideDays,\n consistentWeeks,\n });\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, day: string) => {\n if (!onExternalEventDrop) {\n return;\n }\n onExternalEventDrop(e.dataTransfer, `${dayjs(day).format('YYYY-MM-DD')} 00:00:00`);\n },\n [onExternalEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<string>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (targetDay: string, draggedEvent: ScheduleEventData) => {\n return calculateMonthDropDate({\n draggedEvent,\n targetDay,\n });\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const flatDaysRef = useRef<string[]>([]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex) => {\n if (!onSlotDragEnd) {\n return;\n }\n const startDay = flatDaysRef.current[startIndex];\n const endDay = flatDaysRef.current[endIndex];\n if (startDay && endDay) {\n onSlotDragEnd(\n dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss')\n );\n }\n },\n });\n\n const daysRef: MonthViewControlsRef = useRef<HTMLButtonElement[][]>([]);\n\n const monthDays = getMonthDays({\n month: dayjs(date).format('YYYY-MM-DD 00:00:00'),\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n consistentWeeks: consistentWeeks && withOutsideDays,\n });\n\n const firstDayIndex = (() => {\n for (let weekIndex = 0; weekIndex < monthDays.length; weekIndex++) {\n const week = monthDays[weekIndex];\n let visibleDayIndex = -1;\n for (let dayIndex = 0; dayIndex < week.length; dayIndex++) {\n if (hiddenColumnSet.has(dayIndex)) {\n continue;\n }\n visibleDayIndex += 1;\n const day = week[dayIndex];\n const outside = !isSameMonth(date, day);\n if (!outside || withOutsideDays) {\n return { weekIndex, dayIndex: visibleDayIndex };\n }\n }\n }\n return { weekIndex: 0, dayIndex: 0 };\n })();\n\n const weekdays = withWeekDays\n ? getWeekdaysNames({\n locale: ctx.getLocale(locale),\n format: weekdayFormat,\n firstDayOfWeek: resolvedFirstDayOfWeek,\n })\n .map((day, index) => ({ day, index }))\n .filter(({ index }) => !hiddenColumnSet.has(index))\n .map(({ day, index }) => (\n <div {...getStyles('monthViewWeekday')} key={index}>\n {day}\n </div>\n ))\n : null;\n\n const monthGroup = 'month';\n flatDaysRef.current = monthDays\n .map((week) => week.filter((_, index) => !hiddenColumnSet.has(index)))\n .flat();\n\n const weeks = monthDays.map((week, weekIndex) => {\n daysRef.current[weekIndex] = [];\n\n const days = week\n .map((day, columnIndex) => ({ day, columnIndex }))\n .filter(({ columnIndex }) => !hiddenColumnSet.has(columnIndex))\n .map(({ day }, dayIndex) => {\n const outside = !isSameMonth(date, day);\n const weekend = resolvedWeekendDays.includes(dayjs(day).day());\n const ariaLabel = dayjs(day)\n .locale(locale || ctx.locale)\n .format('MMMM D, YYYY');\n\n const dayProps = getDayProps?.(dayjs(day).format('YYYY-MM-DD')) || {};\n const today = dayjs(day).isSame(dayjs(), 'day') && highlightToday;\n\n if (outside && !withOutsideDays) {\n return (\n <div key={day} data-static {...getStyles('monthViewDay', { style: dayProps.style })} />\n );\n }\n\n const isFirstDay =\n weekIndex === firstDayIndex.weekIndex && dayIndex === firstDayIndex.dayIndex;\n\n const isDropTarget = dragDrop.isDropTarget(day);\n const flatIndex = weekIndex * columnsCount + dayIndex;\n const isDragSelected = slotDragSelect.isSlotSelected(flatIndex, monthGroup);\n\n return (\n <UnstyledButton\n aria-label={ariaLabel}\n {...dayProps}\n {...getStyles('monthViewDay', { className: dayProps.className, style: dayProps.style })}\n key={day}\n ref={(node) => {\n if (node) {\n if (!daysRef.current[weekIndex]) {\n daysRef.current[weekIndex] = [];\n }\n daysRef.current[weekIndex][dayIndex] = node;\n }\n }}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? flatIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? monthGroup : undefined}\n onClick={\n mode === 'static'\n ? undefined\n : (event) => {\n onDayClick?.(dayjs(day).format('YYYY-MM-DD'), event);\n dayProps.onClick?.(event);\n }\n }\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) =>\n slotDragSelect.handleSlotPointerDown(\n e as React.PointerEvent<HTMLButtonElement>,\n flatIndex,\n monthGroup\n )\n : undefined\n }\n onKeyDown={(event) => {\n handleMonthViewKeyDown({\n controlsRef: daysRef,\n weekIndex,\n dayIndex,\n event,\n });\n dayProps.onKeyDown?.(event);\n }}\n mod={[\n {\n outside,\n weekend,\n today,\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n },\n dayProps.mod,\n ]}\n data-outside={outside || undefined}\n tabIndex={mode === 'static' ? -1 : isFirstDay ? 0 : -1}\n onDragOver={withDragHandlers ? (e) => dragDrop.handleDragOver(e, day) : undefined}\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={withDragHandlers ? (e) => dragDrop.handleDrop(e, day) : undefined}\n >\n <span data-today={today || undefined} {...getStyles('monthViewDayLabel')}>\n {dayjs(day).format('D')}\n </span>\n </UnstyledButton>\n );\n });\n\n const weekNumberProps = getWeekNumberProps?.(dayjs(week[0]).format('YYYY-MM-DD')) || {};\n const weekNumber = getWeekNumber(week);\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const backgroundEventNodes = (monthEvents.backgroundByWeek[weekIndex] || []).flatMap(\n (event) => {\n const startColumn = Math.round(event.position.startOffset / (100 / 7));\n const span = Math.max(1, Math.round(event.position.width / (100 / 7)));\n const spans =\n hiddenColumns.length === 0\n ? [{ startOffset: event.position.startOffset, width: event.position.width }]\n : clipSpanToVisibleColumns(\n startColumn,\n startColumn + span - 1,\n visibleColumnMap,\n columnsCount\n );\n\n return spans.map((spanPosition, spanIndex) => (\n <ScheduleBackgroundEvent\n key={`bg-${event.id}-${weekIndex}-${spanIndex}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('monthViewBackgroundEvent', {\n style: {\n left: `calc(${spanPosition.startOffset}% + 2px)`,\n width: `calc(${spanPosition.width}% - 3px)`,\n },\n })}\n />\n ));\n }\n );\n\n const rowHeightPercent = 100 / maxEventsPerDay;\n\n const eventSegments = getRenderableMonthEventSegments({\n events: monthEvents.groupedByWeek[weekIndex] || [],\n groupedByDay: monthEvents.groupedByDay,\n maxEventsPerDay,\n week,\n hiddenColumns,\n columnsCount,\n });\n\n const events = eventSegments.map((segment) => {\n const isDraggable = dragDrop.isDraggableEvent(segment.event);\n\n return (\n <ScheduleEvent\n key={segment.key}\n event={segment.event}\n nowrap\n autoSize\n hanging={segment.position.hanging}\n draggable={isDraggable}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n mod={{ 'clip-start': segment.clipStart, 'clip-end': segment.clipEnd }}\n onClick={onEventClick ? (e) => onEventClick(segment.event, e) : undefined}\n style={{\n position: 'absolute',\n top: `calc(${segment.position.row * rowHeightPercent}% + 1px)`,\n left: `calc(${segment.position.startOffset}% + 1px)`,\n width: `calc(${segment.position.width}% - 2px)`,\n height: `calc(${rowHeightPercent}% - 2px)`,\n }}\n />\n );\n });\n\n const moreEventsNodes = week.map((day, dayIndex) => {\n if (hiddenColumnSet.has(dayIndex)) {\n return null;\n }\n\n const dayEvents = monthEvents.groupedByDay[day] || [];\n const hiddenEventsCount = Math.max(0, dayEvents.length - maxEventsPerDay);\n\n if (hiddenEventsCount <= 0) {\n return null;\n }\n\n const dayStartOffset = (visibleColumnMap[dayIndex] / columnsCount) * 100;\n const dayWidth = (1 / columnsCount) * 100;\n\n return (\n <MoreEvents\n key={`more-${day}`}\n events={dayEvents}\n moreEventsCount={hiddenEventsCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n top: `calc(100% - 2px)`,\n left: `calc(${dayStartOffset}% + 1px)`,\n width: `calc(${dayWidth}% - 1px)`,\n height: '22px',\n paddingInline: 4,\n }}\n {...moreEventsProps}\n />\n );\n });\n\n return (\n <div {...getStyles('monthViewWeek')} key={weekIndex}>\n {withWeekNumbers && (\n <UnstyledButton\n key={weekNumber}\n aria-label={`Week ${weekNumber}`}\n {...weekNumberProps}\n onClick={\n mode === 'static'\n ? undefined\n : (event) => {\n onViewChange?.('week');\n onDateChange?.(toDateString(week[0]));\n onWeekNumberClick?.(dayjs(week[0]).format('YYYY-MM-DD'), event);\n weekNumberProps.onClick?.(event);\n }\n }\n mod={{ static: mode === 'static' }}\n tabIndex={mode === 'static' ? -1 : 0}\n {...getStyles('monthViewWeekNumber', {\n className: weekNumberProps.className,\n style: weekNumberProps.style,\n })}\n >\n {weekNumber}\n </UnstyledButton>\n )}\n\n <div {...getStyles('monthViewEvents')} key=\"week-events\">\n {backgroundEventNodes}\n {events}\n {moreEventsNodes}\n </div>\n\n {days}\n </div>\n );\n });\n\n const content = (\n <Box\n mod={[\n {\n 'with-week-numbers': withWeekNumbers,\n 'with-weekdays': withWeekDays,\n 'without-weekend-days': hiddenColumns.length > 0,\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'event-interaction': dragDrop.dragContextValue.isDragging,\n },\n mod,\n ]}\n __vars={hiddenColumns.length > 0 ? { '--month-view-columns': `${columnsCount}` } : undefined}\n {...getStyles('monthView')}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"month\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'month').startOf('month')),\n next: () => toDateString(dayjs(date).add(1, 'month').startOf('month')),\n today: () => toDateString(dayjs()),\n }}\n control={{\n monthYearSelect: {\n locale,\n yearValue: dayjs(date).get('year'),\n monthValue: dayjs(date).get('month'),\n onYearChange: (year) =>\n onDateChange?.(toDateString(dayjs(date).set('year', year).startOf('month'))),\n onMonthChange: (month) =>\n onDateChange?.(toDateString(dayjs(date).set('month', month).startOf('month'))),\n ...monthYearSelectProps,\n },\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={viewSelectProps}\n stylesApiProps={stylesApiProps}\n onAgendaClick={withAgenda ? () => setAgendaOpen((v) => !v) : undefined}\n agendaActive={agendaOpen}\n />\n )}\n\n {agendaOpen && (\n <AgendaView\n rangeStart={dayjs(date).startOf('month').format('YYYY-MM-DD')}\n rangeEnd={dayjs(date).endOf('month').format('YYYY-MM-DD')}\n events={events}\n locale={locale}\n labels={labels}\n mode={mode}\n onEventClick={onEventClick}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n {...stylesApiProps}\n />\n )}\n\n {!agendaOpen && (\n <ScrollArea\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('monthViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n >\n <div {...getStyles('monthViewInner')}>\n {weekdays && (\n <div {...getStyles('monthViewWeekdays')}>\n {withWeekNumbers && <div {...getStyles('monthViewWeekdaysCorner')} />}\n {weekdays}\n </div>\n )}\n\n {weeks}\n </div>\n </ScrollArea>\n )}\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nMonthView.displayName = '@mantine/schedule/MonthView';\nMonthView.classes = classes;\nMonthView.varsResolver = varsResolver;\n\nexport namespace MonthView {\n export type Props = MonthViewProps;\n export type Factory = MonthViewFactory;\n export type StylesNames = MonthViewStylesNames;\n export type CssVariables = MonthViewCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmOA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,uBAAuB,EACxC,WAAW;CACT,uBAAuB,WAAW,KAAA,IAAY,UAAU,MAAM,IAAI,KAAA;CAClE,2BACE,oBAAoB,KAAA,IAAY,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,GAAG,eAAe,CAAC,MAAM,KAAA;AACtF,EACF,EACF;AAEA,MAAM,eAAe;CACnB,kBAAkB;CAClB,cAAc;CACd,iBAAiB;CACjB,i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;;GACK,CAAA;EAEX;;CAGP,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO,SAAS;EAAmB,UAAA;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,UAAU,cAAc;AACxB,UAAU,UAAUA;AACpB,UAAU,eAAe"}
1
+ {"version":3,"file":"MonthView.mjs","names":["classes"],"sources":["../../../src/components/MonthView/MonthView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useRef, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n ScrollArea,\n ScrollAreaProps,\n StylesApiProps,\n UnstyledButton,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n PreventEventOverlap,\n ScheduleCanDropEventData,\n ScheduleCanDropExternalEventData,\n ScheduleEventData,\n ScheduleEventPlacementRejectedData,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n getMonthDays,\n getMonthRange,\n getWeekdaysNames,\n getWeekNumber,\n isSameMonth,\n toDateString,\n} from '../../utils';\nimport { AgendaView, AgendaViewStylesNames } from '../AgendaView/AgendaView';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps } from '../MoreEvents/MoreEvents';\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectProps } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getMonthViewEvents } from './get-month-view-events/get-month-view-events';\nimport { getRenderableMonthEventSegments } from './get-renderable-month-event-segments';\nimport { clipSpanToVisibleColumns, getVisibleColumnMap } from './get-visible-columns';\nimport { handleMonthViewKeyDown, MonthViewControlsRef } from './handle-month-view-key-down';\nimport classes from './MonthView.module.css';\n\nexport type MonthViewStylesNames =\n | 'monthView'\n | 'monthViewScrollArea'\n | 'monthViewInner'\n | 'monthViewWeek'\n | 'monthViewDay'\n | 'monthViewDayLabel'\n | 'monthViewWeekNumber'\n | 'monthViewWeekday'\n | 'monthViewWeekdays'\n | 'monthViewWeekdaysCorner'\n | 'monthViewEvents'\n | 'monthViewBackgroundEvent'\n | CombinedScheduleHeaderStylesNames\n | AgendaViewStylesNames;\n\nexport type MonthViewCssVariables = {\n monthView: '--month-view-radius' | '--month-view-max-events';\n};\n\nexport interface MonthViewProps\n extends BoxProps, StylesApiProps<MonthViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Date to display, Date object or date string in `YYYY-MM-DD 00:00:00` 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 /** If set, week numbers are displayed in the first column @default false */\n withWeekNumbers?: boolean;\n\n /** If set, weekdays names are displayed in the first row @default true */\n withWeekDays?: boolean;\n\n /** If set, weekend days are displayed. When `false`, days defined by `weekendDays` are hidden and the grid shrinks to the remaining columns @default true */\n withWeekendDays?: boolean;\n\n /** Locale passed down to dayjs, overrides value defined on `DatesProvider` */\n locale?: string;\n\n /** Number 0-6, where 0 – Sunday and 6 – Saturday. @default 1 – Monday */\n firstDayOfWeek?: DayOfWeek;\n\n /** `dayjs` format for weekdays names. By default, the first letter of the weekday. */\n weekdayFormat?: DateLabelFormat;\n\n /** Indices of weekend days, 0-6, where 0 is Sunday and 6 is Saturday. The default value is defined by `DatesProvider`. */\n weekendDays?: DayOfWeek[];\n\n /** Props passed down to the week number button */\n getWeekNumberProps?: (weekStartDate: DateStringValue) => Record<string, any>;\n\n /** Props passed down to the day button */\n getDayProps?: (date: DateStringValue) => Record<string, any>;\n\n /** Called when day is clicked */\n onDayClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Called with first day of the week when week number is clicked */\n onWeekNumberClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, always renders 6 weeks in the month view @default true */\n consistentWeeks?: boolean;\n\n /** If set, highlights the current day @default true */\n highlightToday?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set, days from the previous and next months are displayed to fill the weeks @default true */\n withOutsideDays?: boolean;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Props passed down to `MonthYearSelect` component in the header */\n monthYearSelectProps?: Partial<MonthYearSelectProps>;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous month control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next month control */\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to today control */\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to view level select */\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n\n /** Events to display */\n events?: ScheduleEventData[];\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Function to customize event body, `event` object is passed as first argument */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering, receives all props that would be passed to the root element including children */\n renderEvent?: RenderEvent;\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped on new date */\n onEventDrop?: (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 dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */\n canDropEvent?: (data: ScheduleCanDropEventData) => boolean;\n\n /** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */\n canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;\n\n /** If set, drops that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging to compute live feedback, it must be pure and cheap. @default false */\n preventEventOverlap?: PreventEventOverlap;\n\n /** Called when a drop is rejected */\n onEventPlacementRejected?: (data: ScheduleEventPlacementRejectedData) => void;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick` @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** If set, enables drag-to-select day ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a day range is selected by dragging */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Interaction mode: 'default' allows all interactions, 'static' disables event interactions @default default */\n mode?: ScheduleMode;\n\n /** Props passed down to `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n\n /** Called when an external item is dropped onto the schedule. Receives the `DataTransfer` object and the drop target datetime. */\n onExternalEventDrop?: (dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue) => void;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Maximum number of events visible per day before \"+more\" indicator shows, value is clamped between 1 and 10 @default 2 */\n maxEventsPerDay?: number;\n\n /** If set, displays an Agenda button in the header that opens an agenda list view @default false */\n withAgenda?: boolean;\n}\n\nexport type MonthViewFactory = Factory<{\n props: MonthViewProps;\n ref: HTMLDivElement;\n stylesNames: MonthViewStylesNames;\n vars: MonthViewCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<MonthViewFactory>(\n (_theme, { radius, maxEventsPerDay }) => ({\n monthView: {\n '--month-view-radius': radius !== undefined ? getRadius(radius) : undefined,\n '--month-view-max-events':\n maxEventsPerDay !== undefined ? `${Math.min(10, Math.max(1, maxEventsPerDay))}` : undefined,\n },\n })\n);\n\nconst defaultProps = {\n __staticSelector: 'MonthView',\n withWeekDays: true,\n withWeekendDays: true,\n consistentWeeks: true,\n highlightToday: true,\n withOutsideDays: true,\n withHeader: true,\n weekdayFormat: 'ddd',\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n mode: 'default',\n withInteractiveBackgroundEvents: false,\n} satisfies Partial<MonthViewProps>;\n\nexport const MonthView = factory<MonthViewFactory>((_props) => {\n const props = useProps('MonthView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n mod,\n date,\n onDateChange,\n withWeekNumbers,\n withWeekDays,\n withWeekendDays,\n locale,\n weekdayFormat,\n firstDayOfWeek,\n weekendDays,\n __staticSelector,\n getDayProps,\n getWeekNumberProps,\n onDayClick,\n onWeekNumberClick,\n consistentWeeks,\n highlightToday,\n radius,\n withOutsideDays,\n withHeader,\n monthYearSelectProps,\n onViewChange,\n todayControlProps,\n nextControlProps,\n previousControlProps,\n viewSelectProps,\n events,\n moreEventsProps,\n renderEventBody,\n renderEvent,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n canDropEvent,\n canDropExternalEvent,\n preventEventOverlap,\n onEventPlacementRejected,\n onEventDragStart,\n onEventDragEnd,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n labels,\n mode,\n scrollAreaProps,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n maxEventsPerDay: _maxEventsPerDay,\n withAgenda,\n ...others\n } = props;\n\n const [agendaOpen, setAgendaOpen] = useState(false);\n const maxEventsPerDay = Math.min(10, Math.max(1, _maxEventsPerDay ?? 2));\n\n const getStyles = useStyles<MonthViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n rootSelector: 'monthView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<MonthViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const ctx = useDatesContext();\n\n const resolvedFirstDayOfWeek = ctx.getFirstDayOfWeek(firstDayOfWeek);\n const resolvedWeekendDays = ctx.getWeekendDays(weekendDays);\n const hiddenColumns = withWeekendDays\n ? []\n : Array.from({ length: 7 }, (_, index) => index).filter((index) =>\n resolvedWeekendDays.includes(((resolvedFirstDayOfWeek + index) % 7) as DayOfWeek)\n );\n const hiddenColumnSet = new Set(hiddenColumns);\n const columnsCount = 7 - hiddenColumns.length;\n const visibleColumnMap = getVisibleColumnMap(hiddenColumns);\n\n const range = getMonthRange({\n month: date,\n withOutsideDays,\n consistentWeeks,\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n });\n\n const expandedEvents = expandRecurringEvents({\n events,\n rangeStart: dayjs(range.start).startOf('day').toDate(),\n rangeEnd: dayjs(range.end).endOf('day').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n });\n\n const monthEvents = getMonthViewEvents({\n date,\n events: expandedEvents,\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n withOutsideDays,\n consistentWeeks,\n });\n\n const getExternalDropDateTime = useCallback(\n (day: string) => `${dayjs(day).format('YYYY-MM-DD')} 00:00:00`,\n []\n );\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, day: string) => {\n if (!onExternalEventDrop) {\n return;\n }\n onExternalEventDrop(e.dataTransfer, getExternalDropDateTime(day));\n },\n [onExternalEventDrop, getExternalDropDateTime]\n );\n\n const dragDrop = useDragDropHandlers<string>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (targetDay: string, draggedEvent: ScheduleEventData) => {\n return calculateMonthDropDate({\n draggedEvent,\n targetDay,\n });\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n events: expandedEvents,\n preventEventOverlap,\n canDropEvent,\n canDropExternalEvent,\n onEventPlacementRejected,\n getExternalDropDateTime,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const flatDaysRef = useRef<string[]>([]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex) => {\n if (!onSlotDragEnd) {\n return;\n }\n const startDay = flatDaysRef.current[startIndex];\n const endDay = flatDaysRef.current[endIndex];\n if (startDay && endDay) {\n onSlotDragEnd(\n dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss')\n );\n }\n },\n });\n\n const daysRef: MonthViewControlsRef = useRef<HTMLButtonElement[][]>([]);\n\n const monthDays = getMonthDays({\n month: dayjs(date).format('YYYY-MM-DD 00:00:00'),\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n consistentWeeks: consistentWeeks && withOutsideDays,\n });\n\n const firstDayIndex = (() => {\n for (let weekIndex = 0; weekIndex < monthDays.length; weekIndex++) {\n const week = monthDays[weekIndex];\n let visibleDayIndex = -1;\n for (let dayIndex = 0; dayIndex < week.length; dayIndex++) {\n if (hiddenColumnSet.has(dayIndex)) {\n continue;\n }\n visibleDayIndex += 1;\n const day = week[dayIndex];\n const outside = !isSameMonth(date, day);\n if (!outside || withOutsideDays) {\n return { weekIndex, dayIndex: visibleDayIndex };\n }\n }\n }\n return { weekIndex: 0, dayIndex: 0 };\n })();\n\n const weekdays = withWeekDays\n ? getWeekdaysNames({\n locale: ctx.getLocale(locale),\n format: weekdayFormat,\n firstDayOfWeek: resolvedFirstDayOfWeek,\n })\n .map((day, index) => ({ day, index }))\n .filter(({ index }) => !hiddenColumnSet.has(index))\n .map(({ day, index }) => (\n <div {...getStyles('monthViewWeekday')} key={index}>\n {day}\n </div>\n ))\n : null;\n\n const monthGroup = 'month';\n flatDaysRef.current = monthDays\n .map((week) => week.filter((_, index) => !hiddenColumnSet.has(index)))\n .flat();\n\n const weeks = monthDays.map((week, weekIndex) => {\n daysRef.current[weekIndex] = [];\n\n const days = week\n .map((day, columnIndex) => ({ day, columnIndex }))\n .filter(({ columnIndex }) => !hiddenColumnSet.has(columnIndex))\n .map(({ day }, dayIndex) => {\n const outside = !isSameMonth(date, day);\n const weekend = resolvedWeekendDays.includes(dayjs(day).day());\n const ariaLabel = dayjs(day)\n .locale(locale || ctx.locale)\n .format('MMMM D, YYYY');\n\n const dayProps = getDayProps?.(dayjs(day).format('YYYY-MM-DD')) || {};\n const today = dayjs(day).isSame(dayjs(), 'day') && highlightToday;\n\n if (outside && !withOutsideDays) {\n return (\n <div key={day} data-static {...getStyles('monthViewDay', { style: dayProps.style })} />\n );\n }\n\n const isFirstDay =\n weekIndex === firstDayIndex.weekIndex && dayIndex === firstDayIndex.dayIndex;\n\n const isDropTarget = dragDrop.isDropTarget(day);\n const flatIndex = weekIndex * columnsCount + dayIndex;\n const isDragSelected = slotDragSelect.isSlotSelected(flatIndex, monthGroup);\n\n return (\n <UnstyledButton\n aria-label={ariaLabel}\n {...dayProps}\n {...getStyles('monthViewDay', { className: dayProps.className, style: dayProps.style })}\n key={day}\n ref={(node) => {\n if (node) {\n if (!daysRef.current[weekIndex]) {\n daysRef.current[weekIndex] = [];\n }\n daysRef.current[weekIndex][dayIndex] = node;\n }\n }}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? flatIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? monthGroup : undefined}\n onClick={\n mode === 'static'\n ? undefined\n : (event) => {\n onDayClick?.(dayjs(day).format('YYYY-MM-DD'), event);\n dayProps.onClick?.(event);\n }\n }\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) =>\n slotDragSelect.handleSlotPointerDown(\n e as React.PointerEvent<HTMLButtonElement>,\n flatIndex,\n monthGroup\n )\n : undefined\n }\n onKeyDown={(event) => {\n handleMonthViewKeyDown({\n controlsRef: daysRef,\n weekIndex,\n dayIndex,\n event,\n });\n dayProps.onKeyDown?.(event);\n }}\n mod={[\n {\n outside,\n weekend,\n today,\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n },\n dayProps.mod,\n ]}\n data-outside={outside || undefined}\n tabIndex={mode === 'static' ? -1 : isFirstDay ? 0 : -1}\n onDragOver={withDragHandlers ? (e) => dragDrop.handleDragOver(e, day) : undefined}\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={withDragHandlers ? (e) => dragDrop.handleDrop(e, day) : undefined}\n >\n <span data-today={today || undefined} {...getStyles('monthViewDayLabel')}>\n {dayjs(day).format('D')}\n </span>\n </UnstyledButton>\n );\n });\n\n const weekNumberProps = getWeekNumberProps?.(dayjs(week[0]).format('YYYY-MM-DD')) || {};\n const weekNumber = getWeekNumber(week);\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const backgroundEventNodes = (monthEvents.backgroundByWeek[weekIndex] || []).flatMap(\n (event) => {\n const startColumn = Math.round(event.position.startOffset / (100 / 7));\n const span = Math.max(1, Math.round(event.position.width / (100 / 7)));\n const spans =\n hiddenColumns.length === 0\n ? [{ startOffset: event.position.startOffset, width: event.position.width }]\n : clipSpanToVisibleColumns(\n startColumn,\n startColumn + span - 1,\n visibleColumnMap,\n columnsCount\n );\n\n return spans.map((spanPosition, spanIndex) => (\n <ScheduleBackgroundEvent\n key={`bg-${event.id}-${weekIndex}-${spanIndex}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('monthViewBackgroundEvent', {\n style: {\n left: `calc(${spanPosition.startOffset}% + 2px)`,\n width: `calc(${spanPosition.width}% - 3px)`,\n },\n })}\n />\n ));\n }\n );\n\n const rowHeightPercent = 100 / maxEventsPerDay;\n\n const eventSegments = getRenderableMonthEventSegments({\n events: monthEvents.groupedByWeek[weekIndex] || [],\n groupedByDay: monthEvents.groupedByDay,\n maxEventsPerDay,\n week,\n hiddenColumns,\n columnsCount,\n });\n\n const events = eventSegments.map((segment) => {\n const isDraggable = dragDrop.isDraggableEvent(segment.event);\n\n return (\n <ScheduleEvent\n key={segment.key}\n event={segment.event}\n nowrap\n autoSize\n hanging={segment.position.hanging}\n draggable={isDraggable}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n mod={{ 'clip-start': segment.clipStart, 'clip-end': segment.clipEnd }}\n onClick={onEventClick ? (e) => onEventClick(segment.event, e) : undefined}\n style={{\n position: 'absolute',\n top: `calc(${segment.position.row * rowHeightPercent}% + 1px)`,\n left: `calc(${segment.position.startOffset}% + 1px)`,\n width: `calc(${segment.position.width}% - 2px)`,\n height: `calc(${rowHeightPercent}% - 2px)`,\n }}\n />\n );\n });\n\n const moreEventsNodes = week.map((day, dayIndex) => {\n if (hiddenColumnSet.has(dayIndex)) {\n return null;\n }\n\n const dayEvents = monthEvents.groupedByDay[day] || [];\n const hiddenEventsCount = Math.max(0, dayEvents.length - maxEventsPerDay);\n\n if (hiddenEventsCount <= 0) {\n return null;\n }\n\n const dayStartOffset = (visibleColumnMap[dayIndex] / columnsCount) * 100;\n const dayWidth = (1 / columnsCount) * 100;\n\n return (\n <MoreEvents\n key={`more-${day}`}\n events={dayEvents}\n moreEventsCount={hiddenEventsCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n top: `calc(100% - 2px)`,\n left: `calc(${dayStartOffset}% + 1px)`,\n width: `calc(${dayWidth}% - 1px)`,\n height: '22px',\n paddingInline: 4,\n }}\n {...moreEventsProps}\n />\n );\n });\n\n return (\n <div {...getStyles('monthViewWeek')} key={weekIndex}>\n {withWeekNumbers && (\n <UnstyledButton\n key={weekNumber}\n aria-label={`Week ${weekNumber}`}\n {...weekNumberProps}\n onClick={\n mode === 'static'\n ? undefined\n : (event) => {\n onViewChange?.('week');\n onDateChange?.(toDateString(week[0]));\n onWeekNumberClick?.(dayjs(week[0]).format('YYYY-MM-DD'), event);\n weekNumberProps.onClick?.(event);\n }\n }\n mod={{ static: mode === 'static' }}\n tabIndex={mode === 'static' ? -1 : 0}\n {...getStyles('monthViewWeekNumber', {\n className: weekNumberProps.className,\n style: weekNumberProps.style,\n })}\n >\n {weekNumber}\n </UnstyledButton>\n )}\n\n <div {...getStyles('monthViewEvents')} key=\"week-events\">\n {backgroundEventNodes}\n {events}\n {moreEventsNodes}\n </div>\n\n {days}\n </div>\n );\n });\n\n const content = (\n <Box\n mod={[\n {\n 'with-week-numbers': withWeekNumbers,\n 'with-weekdays': withWeekDays,\n 'without-weekend-days': hiddenColumns.length > 0,\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'event-interaction': dragDrop.dragContextValue.isDragging,\n },\n mod,\n ]}\n __vars={hiddenColumns.length > 0 ? { '--month-view-columns': `${columnsCount}` } : undefined}\n {...getStyles('monthView')}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"month\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'month').startOf('month')),\n next: () => toDateString(dayjs(date).add(1, 'month').startOf('month')),\n today: () => toDateString(dayjs()),\n }}\n control={{\n monthYearSelect: {\n locale,\n yearValue: dayjs(date).get('year'),\n monthValue: dayjs(date).get('month'),\n onYearChange: (year) =>\n onDateChange?.(toDateString(dayjs(date).set('year', year).startOf('month'))),\n onMonthChange: (month) =>\n onDateChange?.(toDateString(dayjs(date).set('month', month).startOf('month'))),\n ...monthYearSelectProps,\n },\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={viewSelectProps}\n stylesApiProps={stylesApiProps}\n onAgendaClick={withAgenda ? () => setAgendaOpen((v) => !v) : undefined}\n agendaActive={agendaOpen}\n />\n )}\n\n {agendaOpen && (\n <AgendaView\n rangeStart={dayjs(date).startOf('month').format('YYYY-MM-DD')}\n rangeEnd={dayjs(date).endOf('month').format('YYYY-MM-DD')}\n events={events}\n locale={locale}\n labels={labels}\n mode={mode}\n onEventClick={onEventClick}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n {...stylesApiProps}\n />\n )}\n\n {!agendaOpen && (\n <ScrollArea\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('monthViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n >\n <div {...getStyles('monthViewInner')}>\n {weekdays && (\n <div {...getStyles('monthViewWeekdays')}>\n {withWeekNumbers && <div {...getStyles('monthViewWeekdaysCorner')} />}\n {weekdays}\n </div>\n )}\n\n {weeks}\n </div>\n </ScrollArea>\n )}\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nMonthView.displayName = '@mantine/schedule/MonthView';\nMonthView.classes = classes;\nMonthView.varsResolver = varsResolver;\n\nexport namespace MonthView {\n export type Props = MonthViewProps;\n export type Factory = MonthViewFactory;\n export type StylesNames = MonthViewStylesNames;\n export type CssVariables = MonthViewCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmPA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,uBAAuB,EACxC,WAAW;CACT,uBAAuB,WAAW,KAAA,IAAY,UAAU,MAAM,IAAI,KAAA;CAClE,2BACE,oBAAoB,KAAA,IAAY,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,GAAG,eAAe,CAAC,MAAM,KAAA;AACtF,EACF,EACF;AAEA,MAAM,eAAe;CACnB,kBAAkB;CAClB,cAAc;CACd,iBAAiB;CACjB,iBAAiB;CACjB,gBAAgB;CAChB,iBAAiB;CACjB,YAAY;CACZ,eAAe;CACf,uBAAuB;CACvB,oBAAoB;CACpB,MAAM;CACN,iCAAiC;AACnC;AAEA,MAAa,YAAY,SAA2B,WAAW;CAC7D,MAAM,QAAQ,SAAS,aAAa,cAAc,MAAM;CACxD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,YACA,MACA,KACA,MACA,cACA,iBACA,cACA,iBACA,QACA,eACA,gBACA,aACA,kBACA,aACA,oBACA,YACA,mBACA,iBACA,gBACA,QACA,iBACA,YACA,sBACA,cACA,mBACA,kBACA,sBACA,iBACA,QACA,iBACA,iBACA,aACA,uBACA,aACA,cACA,cACA,sBACA,qBACA,0BACA,kBACA,gBACA,cACA,iCACA,oBACA,eACA,QACA,MACA,iBACA,qBACA,0BACA,iBAAiB,kBACjB,YACA,GAAG,WACD;CAEJ,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;CAClD,MAAM,kBAAkB,KAAK,IAAI,IAAI,KAAK,IAAI,GAAG,oBAAoB,CAAC,CAAC;CAEvE,MAAM,YAAY,UAA4B;EAC5C,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;CAChB,CAAC;CAED,MAAM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