@mantine/schedule 9.6.1 → 9.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/cjs/components/DayView/DayView.cjs +37 -16
  2. package/cjs/components/DayView/DayView.cjs.map +1 -1
  3. package/cjs/components/DayView/DayView.module.cjs +1 -0
  4. package/cjs/components/DayView/DayView.module.cjs.map +1 -1
  5. package/cjs/components/MobileMonthView/MobileMonthView.cjs +1 -1
  6. package/cjs/components/MobileMonthView/MobileMonthView.cjs.map +1 -1
  7. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +39 -14
  8. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
  9. package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs.map +1 -1
  10. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs.map +1 -1
  11. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +45 -15
  12. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
  13. package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs.map +1 -1
  14. package/cjs/components/Schedule/Schedule.cjs.map +1 -1
  15. package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs +18 -3
  16. package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs.map +1 -1
  17. package/cjs/components/WeekView/WeekView.cjs +36 -13
  18. package/cjs/components/WeekView/WeekView.cjs.map +1 -1
  19. package/cjs/components/WeekView/WeekView.module.cjs +1 -0
  20. package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
  21. package/cjs/hooks/use-event-resize.cjs +7 -4
  22. package/cjs/hooks/use-event-resize.cjs.map +1 -1
  23. package/cjs/hooks/use-horizontal-event-resize.cjs +7 -4
  24. package/cjs/hooks/use-horizontal-event-resize.cjs.map +1 -1
  25. package/esm/components/DayView/DayView.mjs +37 -16
  26. package/esm/components/DayView/DayView.mjs.map +1 -1
  27. package/esm/components/DayView/DayView.module.mjs +1 -0
  28. package/esm/components/DayView/DayView.module.mjs.map +1 -1
  29. package/esm/components/MobileMonthView/MobileMonthView.mjs +1 -1
  30. package/esm/components/MobileMonthView/MobileMonthView.mjs.map +1 -1
  31. package/esm/components/ResourcesDayView/ResourcesDayView.mjs +39 -14
  32. package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
  33. package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs.map +1 -1
  34. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs.map +1 -1
  35. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +45 -15
  36. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
  37. package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs.map +1 -1
  38. package/esm/components/Schedule/Schedule.mjs.map +1 -1
  39. package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs +19 -4
  40. package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs.map +1 -1
  41. package/esm/components/WeekView/WeekView.mjs +36 -13
  42. package/esm/components/WeekView/WeekView.mjs.map +1 -1
  43. package/esm/components/WeekView/WeekView.module.mjs +1 -0
  44. package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
  45. package/esm/hooks/use-event-resize.mjs +7 -4
  46. package/esm/hooks/use-event-resize.mjs.map +1 -1
  47. package/esm/hooks/use-horizontal-event-resize.mjs +7 -4
  48. package/esm/hooks/use-horizontal-event-resize.mjs.map +1 -1
  49. package/lib/components/DayView/DayView.d.ts +2 -2
  50. package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +1 -1
  51. package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +1 -1
  52. package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +1 -1
  53. package/lib/components/Schedule/Schedule.d.ts +1 -1
  54. package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.d.ts +15 -2
  55. package/lib/components/WeekView/WeekView.d.ts +2 -2
  56. package/lib/hooks/use-event-resize.d.ts +3 -2
  57. package/lib/hooks/use-horizontal-event-resize.d.ts +3 -2
  58. package/package.json +4 -4
  59. package/styles.css +254 -6
  60. package/styles.layer.css +254 -6
@@ -263,7 +263,8 @@ const DayView = factory((_props) => {
263
263
  intervalMinutes,
264
264
  resizeIntervalMinutes: eventResizeInterval,
265
265
  onEventResize,
266
- canResizeEvent
266
+ canResizeEvent,
267
+ withBackgroundEvents: withInteractiveBackgroundEvents
267
268
  });
268
269
  const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== "static";
269
270
  const eventsNodes = eventsData.regularEvents.map((event) => {
@@ -410,21 +411,41 @@ const DayView = factory((_props) => {
410
411
  width: "100%"
411
412
  } })
412
413
  }, `bg-allday-${event.id}`));
413
- const backgroundTimedEventNodes = eventsData.backgroundTimedEvents.map((event) => /* @__PURE__ */ jsx(ScheduleBackgroundEvent, {
414
- event,
415
- renderEvent,
416
- renderEventBody,
417
- interactive: interactiveBackgroundEvents,
418
- onEventClick,
419
- ...getStyles("dayViewBackgroundEvent", { style: {
420
- ...getTimeAxisEventStyle({
421
- start: event.position.top,
422
- span: event.position.height,
423
- axis: "vertical"
424
- }),
425
- width: "100%"
426
- } })
427
- }, event.id));
414
+ const backgroundTimedEventNodes = eventsData.backgroundTimedEvents.map((event) => {
415
+ const isResizable = eventResize.isResizableEvent(event);
416
+ const resizePosition = eventResize.getResizePosition(event.id);
417
+ return /* @__PURE__ */ jsx(ScheduleBackgroundEvent, {
418
+ event,
419
+ renderEvent,
420
+ renderEventBody,
421
+ interactive: interactiveBackgroundEvents,
422
+ onEventClick: onEventClick ? (clickedEvent, e) => {
423
+ if (!eventResize.wasResizing()) onEventClick(clickedEvent, e);
424
+ } : void 0,
425
+ withResize: isResizable,
426
+ isResizing: resizePosition !== null,
427
+ resizeHandleProps: getStyles("dayViewBackgroundEventResizeHandle"),
428
+ onResizeStart: isResizable ? (edge, e) => {
429
+ if (timeSlotsContainerRef.current) eventResize.handleResizeStart({
430
+ event,
431
+ edge,
432
+ container: timeSlotsContainerRef.current,
433
+ originalTop: event.position.top,
434
+ originalHeight: event.position.height,
435
+ eventDate: dayjs(date).format("YYYY-MM-DD"),
436
+ pointerEvent: e
437
+ });
438
+ } : void 0,
439
+ ...getStyles("dayViewBackgroundEvent", { style: {
440
+ ...getTimeAxisEventStyle({
441
+ start: resizePosition ? resizePosition.top : event.position.top,
442
+ span: resizePosition ? resizePosition.height : event.position.height,
443
+ axis: "vertical"
444
+ }),
445
+ width: "100%"
446
+ } })
447
+ }, event.id);
448
+ });
428
449
  const content = /* @__PURE__ */ jsxs(Box, {
429
450
  ...getStyles("dayView"),
430
451
  __vars: { "--event-raise-delay": `${eventOverlapRaiseDelay}ms` },
@@ -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 | '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` @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 });\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 <ScheduleBackgroundEvent\n key={event.id}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('dayViewBackgroundEvent', {\n style: {\n ...getTimeAxisEventStyle({\n start: event.position.top,\n span: event.position.height,\n axis: 'vertical',\n }),\n width: '100%',\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8RA,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,wBAAwB;AAC1B;AAEA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,YAAY,wBAAwB,EACrD,SAAS;CACP,qBAAqB,WAAW,KAAA,IAAY,UAAU,MAAM,IAAI,KAAA;CAChE,0B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,oBAAC,KAAD,EACE,GAAI,UAAU,sBAAsB,EAClC,cAAc;SACZ,MAAM,EAAE,KAAK,WAAW,eAAe;UACrC,OAAO;WACL,GAAG,SAAS,iBAAiB;WAC7B,OAAO,SAAS,YAAY;WAC5B,KAAK,SAAS,YAAY;UAC5B;UACA;UACA;UACA;SACF,CAAC;SACD,OAAO;UACL,UAAU;UACV,kBAAkB;UAClB,gBAAgB;UAChB,KAAK,GAAG,IAAI;UACZ,QAAQ,GAAG,OAAO;SACpB;QACF,EAAA,CAAG,EACL,CAAC,EACF,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
+ {"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;CACtC,uBAAuB;CACvB,oBAAoB;CACpB,iBAAiB;CACjB,MAAM;CACN,iCAAiC;CACjC,kBAAkB;CAClB,wBAAwB;AAC1B;AAEA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,YAAY,wBAAwB,EACrD,SAAS;CACP,qBAAqB,WAAW,KAAA,IAAY,UAAU,MAAM,IAAI,KAAA;CAChE,0BAA0B,IAAI,UAAU;CACxC,kCAAkC,IAAI,gBAAgB;AACxD,EACF,EACF;AAEA,MAAa,UAAU,SAAyB,WAAW;CACzD,MAAM,QAAQ,SAAS,WAAW,cAAc,MAAM;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,YACA,MACA,kBACA,WACA,SACA,iBACA,sBACA,kBACA,wBACA,gBACA,MACA,QACA,iBACA,cACA,gBACA,0BACA,uBACA,YACA,QACA,cACA,cACA,sBACA,kBACA,mBACA,iBACA,YACA,kBACA,iBACA,QACA,iBACA,iBACA,aACA,QACA,wBACA,eACA,uBACA,aACA,cACA,mBACA,kBACA,gBACA,iBACA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AAM,YAAY,0BAA0B,KAAK;QACjD,IAAI,cAAc,MAChB,SAAS,WAAW,OAAO,SAAS;OAExC,IACA,KAAA;OAvBR,UAAA;QA0BG;QAEA;QAEA,SAAS,eAAe,SAAS,iBAAiB,gBACjD,oBAAC,KAAD,EACE,GAAI,UAAU,sBAAsB,EAClC,cAAc;SACZ,MAAM,EAAE,KAAK,WAAW,eAAe;UACrC,OAAO;WACL,GAAG,SAAS,iBAAiB;WAC7B,OAAO,SAAS,YAAY;WAC5B,KAAK,SAAS,YAAY;UAC5B;UACA;UACA;UACA;SACF,CAAC;SACD,OAAO;UACL,UAAU;UACV,kBAAkB;UAClB,gBAAgB;UAChB,KAAK,GAAG,IAAI;UACZ,QAAQ,GAAG,OAAO;SACpB;QACF,EAAA,CAAG,EACL,CAAC,EACF,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"}
@@ -12,6 +12,7 @@ var DayView_module_default = {
12
12
  "dayViewSlotLabel": "m_2f950041",
13
13
  "dayViewSlots": "m_d5dc3060",
14
14
  "dayViewBackgroundEvent": "m_c5cd9a77",
15
+ "dayViewBackgroundEventResizeHandle": "m_cddb9413",
15
16
  "dayViewAllDay": "m_c6f08d70",
16
17
  "dayViewAllDayEvents": "m_42b986a9"
17
18
  };
@@ -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\n.dayView:where([data-event-interaction], [data-slot-dragging]) .dayViewBackgroundEvent {\n pointer-events: none;\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"],"mappings":""}
@@ -172,7 +172,7 @@ const MobileMonthView = factory((_props) => {
172
172
  children: event.title
173
173
  }), /* @__PURE__ */ jsx(Text, {
174
174
  ...getStyles("mobileMonthViewEventTime"),
175
- children: isAllDay ? "All day" : `${startTime} – ${endTime}`
175
+ children: isAllDay ? getLabel("allDay", labels) : `${startTime} – ${endTime}`
176
176
  })] })]
177
177
  });
178
178
  const rootProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"MobileMonthView.mjs","names":["classes"],"sources":["../../../src/components/MobileMonthView/MobileMonthView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport React, { useRef } from 'react';\nimport {\n AccordionChevron,\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getRadius,\n getThemeColor,\n MantineRadius,\n StylesApiProps,\n Text,\n UnstyledButton,\n useDirection,\n useMantineTheme,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n DateLabelFormat,\n DateStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n} from '../../types';\nimport {\n expandRecurringEvents,\n formatDate,\n getMonthDays,\n getWeekdaysNames,\n getWeekNumber,\n isSameMonth,\n sortEvents,\n toDateString,\n} from '../../utils';\nimport {\n handleMonthViewKeyDown,\n MonthViewControlsRef,\n} from '../MonthView/handle-month-view-key-down';\nimport { RenderEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { getMobileMonthViewEvents } from './get-mobile-month-view-events';\nimport classes from './MobileMonthView.module.css';\n\nexport type MobileMonthViewStylesNames =\n | 'mobileMonthView'\n | 'mobileMonthViewHeader'\n | 'mobileMonthViewHeaderBackButton'\n | 'mobileMonthViewHeaderLabel'\n | 'mobileMonthViewCalendar'\n | 'mobileMonthViewWeekdays'\n | 'mobileMonthViewWeekday'\n | 'mobileMonthViewWeekdaysCorner'\n | 'mobileMonthViewWeek'\n | 'mobileMonthViewWeekNumber'\n | 'mobileMonthViewDay'\n | 'mobileMonthViewDayIndicators'\n | 'mobileMonthViewDayIndicator'\n | 'mobileMonthViewEventsList'\n | 'mobileMonthViewEventsHeader'\n | 'mobileMonthViewEvent'\n | 'mobileMonthViewEventColor'\n | 'mobileMonthViewEventBody'\n | 'mobileMonthViewEventTitle'\n | 'mobileMonthViewEventTime'\n | 'mobileMonthViewNoEvents';\n\nexport type MobileMonthViewCssVariables = {\n mobileMonthView: '--mobile-month-view-radius';\n};\n\nexport interface MobileMonthViewRenderHeaderInput {\n /** Current interaction mode */\n mode: ScheduleMode;\n /** Current date displayed in the view */\n date: Date | string;\n /** Default header element */\n defaultHeader: React.ReactNode;\n}\n\nexport interface MobileMonthViewProps\n extends BoxProps, StylesApiProps<MobileMonthViewFactory>, 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 /** Currently selected date (controlled) */\n selectedDate?: Date | string | null;\n\n /** Default selected date (uncontrolled) */\n defaultSelectedDate?: Date | string | null;\n\n /** Called when selected date changes */\n onSelectedDateChange?: (value: DateStringValue | null) => 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 /** 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 false */\n withOutsideDays?: boolean;\n\n /** Events to display */\n events?: ScheduleEventData[];\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 /** Function to fully customize event rendering, receives all props that would be passed to the root element including children */\n renderEvent?: RenderEvent;\n\n /** Format for the events list header date @default 'dddd, MMMM D' */\n eventsHeaderFormat?: DateLabelFormat;\n\n /** Called when the year back button in the header is clicked */\n onYearClick?: () => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Custom header renderer, receives object with mode, date, and default header element */\n renderHeader?: (input: MobileMonthViewRenderHeaderInput) => React.ReactNode;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n}\n\nexport type MobileMonthViewFactory = Factory<{\n props: MobileMonthViewProps;\n ref: HTMLDivElement;\n stylesNames: MobileMonthViewStylesNames;\n vars: MobileMonthViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'MobileMonthView',\n withWeekDays: true,\n consistentWeeks: true,\n highlightToday: true,\n mode: 'default',\n eventsHeaderFormat: 'dddd, MMMM D',\n} satisfies Partial<MobileMonthViewProps>;\n\nconst varsResolver = createVarsResolver<MobileMonthViewFactory>((_theme, { radius }) => ({\n mobileMonthView: {\n '--mobile-month-view-radius': getRadius(radius),\n },\n}));\n\nexport const MobileMonthView = factory<MobileMonthViewFactory>((_props) => {\n const props = useProps('MobileMonthView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n attributes,\n __staticSelector,\n date,\n onDateChange,\n selectedDate,\n defaultSelectedDate,\n onSelectedDateChange,\n withWeekNumbers,\n withWeekDays,\n locale,\n firstDayOfWeek,\n weekdayFormat,\n weekendDays,\n getWeekNumberProps,\n getDayProps,\n onDayClick,\n onWeekNumberClick,\n consistentWeeks,\n highlightToday,\n radius,\n withOutsideDays,\n events,\n labels,\n mode,\n renderEvent,\n eventsHeaderFormat,\n onYearClick,\n onEventClick,\n renderHeader,\n recurrenceExpansionLimit,\n ...others\n } = props;\n\n const ctx = useDatesContext();\n const theme = useMantineTheme();\n const today = dayjs();\n\n const [_selectedDate, _setSelectedDate] = useUncontrolled<Date | string | null>({\n value: selectedDate,\n defaultValue: defaultSelectedDate ?? toDateString(today),\n onChange: (value) => onSelectedDateChange?.(value ? toDateString(dayjs(value)) : null),\n });\n\n const getStyles = useStyles<MobileMonthViewFactory>({\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: 'mobileMonthView',\n });\n\n const daysRef: MonthViewControlsRef = useRef<HTMLButtonElement[][]>([]);\n const firstDayPosition = useRef<{ weekIndex: number; dayIndex: number } | null>(null);\n\n const expandedEvents = expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('month').toDate(),\n rangeEnd: dayjs(date).endOf('month').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n });\n\n const groupedEvents = getMobileMonthViewEvents({ date, events: expandedEvents });\n\n const weekdays = withWeekDays\n ? getWeekdaysNames({\n locale: ctx.getLocale(locale),\n format: weekdayFormat,\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n }).map((day, index) => (\n <div {...getStyles('mobileMonthViewWeekday')} key={index}>\n {day}\n </div>\n ))\n : null;\n\n const weeks = getMonthDays({\n month: dayjs(date).format('YYYY-MM-DD'),\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n consistentWeeks,\n }).map((week, weekIndex) => {\n const days = week.map((dayDate, dayIndex) => {\n const outside = !isSameMonth(dayDate, date);\n const weekend = ctx.getWeekendDays(weekendDays).includes(dayjs(dayDate).day());\n const ariaLabel = dayjs(dayDate)\n .locale(locale || ctx.locale)\n .format('MMMM D, YYYY');\n\n const dayProps = getDayProps?.(dayjs(dayDate).format('YYYY-MM-DD')) || {};\n const isToday = dayjs(dayDate).isSame(today, 'day') && highlightToday;\n const isSelected = _selectedDate && dayjs(dayDate).isSame(dayjs(_selectedDate), 'day');\n const dayEvents = groupedEvents[dayjs(dayDate).format('YYYY-MM-DD')] || [];\n\n const shouldRender = withOutsideDays || !outside;\n\n if (shouldRender && firstDayPosition.current === null) {\n firstDayPosition.current = { weekIndex, dayIndex };\n }\n\n const isFirstDay =\n firstDayPosition.current?.weekIndex === weekIndex &&\n firstDayPosition.current?.dayIndex === dayIndex;\n\n const indicators = dayEvents.slice(0, 3).map((event) => (\n <div\n {...getStyles('mobileMonthViewDayIndicator', {\n style: { backgroundColor: getThemeColor(event.color, theme) },\n })}\n key={event.id}\n />\n ));\n\n const handleDayClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n const dateStr = dayjs(dayDate).format('YYYY-MM-DD');\n _setSelectedDate(dateStr);\n onDayClick?.(dateStr, event);\n dayProps.onClick?.(event);\n };\n\n const handleDayKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n handleMonthViewKeyDown({\n controlsRef: daysRef,\n weekIndex,\n dayIndex,\n event,\n });\n };\n\n return (\n <UnstyledButton\n aria-label={ariaLabel}\n aria-selected={isSelected || undefined}\n {...dayProps}\n {...getStyles('mobileMonthViewDay', {\n className: dayProps.className,\n style: dayProps.style,\n })}\n key={dayDate}\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 mod={[\n {\n outside,\n weekend,\n today: isToday,\n selected: isSelected,\n static: mode === 'static',\n hidden: !shouldRender,\n },\n dayProps.mod,\n ]}\n tabIndex={mode === 'static' || !shouldRender ? -1 : isFirstDay ? 0 : -1}\n onClick={mode === 'static' || !shouldRender ? undefined : handleDayClick}\n onKeyDown={mode === 'static' || !shouldRender ? undefined : handleDayKeyDown}\n >\n {shouldRender ? dayjs(dayDate).format('D') : null}\n {shouldRender && <div {...getStyles('mobileMonthViewDayIndicators')}>{indicators}</div>}\n </UnstyledButton>\n );\n });\n\n const weekNumberProps = getWeekNumberProps?.(dayjs(week[0]).format('YYYY-MM-DD')) || {};\n const weekNumber = getWeekNumber(week);\n\n return (\n <div {...getStyles('mobileMonthViewWeek')} 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 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('mobileMonthViewWeekNumber', {\n className: weekNumberProps.className,\n style: weekNumberProps.style,\n })}\n >\n {weekNumber}\n </UnstyledButton>\n )}\n {days}\n </div>\n );\n });\n\n const selectedDateEvents = _selectedDate\n ? sortEvents(groupedEvents[dayjs(_selectedDate).format('YYYY-MM-DD')] || [])\n : [];\n\n const eventsList = selectedDateEvents.map((event) => {\n const startTime = dayjs(event.start).format('HH:mm');\n const endTime = dayjs(event.end).format('HH:mm');\n const isAllDay = startTime === '00:00' && endTime === '00:00';\n\n const eventChildren = (\n <Box {...getStyles('mobileMonthViewEventBody')}>\n <div\n {...getStyles('mobileMonthViewEventColor', {\n style: { backgroundColor: getThemeColor(event.color, theme) },\n })}\n />\n <div>\n <Text {...getStyles('mobileMonthViewEventTitle')}>{event.title}</Text>\n <Text {...getStyles('mobileMonthViewEventTime')}>\n {isAllDay ? 'All day' : `${startTime} – ${endTime}`}\n </Text>\n </div>\n </Box>\n );\n\n const rootProps: React.ComponentPropsWithoutRef<'button'> & { children: React.ReactNode } = {\n ...getStyles('mobileMonthViewEvent'),\n onClick:\n mode === 'static'\n ? undefined\n : (e: React.MouseEvent<HTMLButtonElement>) => {\n onEventClick?.(event, e);\n },\n tabIndex: mode === 'static' ? -1 : 0,\n children: eventChildren,\n };\n\n if (typeof renderEvent === 'function') {\n return <React.Fragment key={event.id}>{renderEvent(event, rootProps)}</React.Fragment>;\n }\n\n return <UnstyledButton {...rootProps} key={event.id} />;\n });\n\n const eventsHeader = _selectedDate\n ? formatDate({\n locale: ctx.getLocale(locale),\n date: _selectedDate,\n format: eventsHeaderFormat,\n })\n : '';\n\n const { dir } = useDirection();\n\n const headerLabel = formatDate({ locale: ctx.getLocale(locale), date, format: 'MMMM YYYY' });\n\n const defaultHeader = (\n <>\n <UnstyledButton\n {...getStyles('mobileMonthViewHeaderBackButton')}\n onClick={onYearClick}\n mod={{ static: mode === 'static' }}\n tabIndex={mode === 'static' ? -1 : 0}\n >\n <AccordionChevron\n style={{ transform: `rotate(${dir === 'rtl' ? -90 : 90}deg)` }}\n size={20}\n />\n {dayjs(date).format('YYYY')}\n </UnstyledButton>\n <Text {...getStyles('mobileMonthViewHeaderLabel')}>{headerLabel}</Text>\n </>\n );\n\n return (\n <Box\n {...getStyles('mobileMonthView')}\n mod={{ 'with-week-numbers': withWeekNumbers }}\n {...others}\n >\n <div {...getStyles('mobileMonthViewHeader')}>\n {typeof renderHeader === 'function'\n ? renderHeader({ mode: mode!, date, defaultHeader })\n : defaultHeader}\n </div>\n\n <Box {...getStyles('mobileMonthViewCalendar')} mod={{ 'with-weekdays': withWeekDays }}>\n {weekdays && (\n <div {...getStyles('mobileMonthViewWeekdays')}>\n {withWeekNumbers && <div {...getStyles('mobileMonthViewWeekdaysCorner')} />}\n {weekdays}\n </div>\n )}\n {weeks}\n </Box>\n\n <Box {...getStyles('mobileMonthViewEventsList')}>\n <Text {...getStyles('mobileMonthViewEventsHeader')}>{eventsHeader}</Text>\n\n {eventsList.length > 0 ? (\n eventsList\n ) : (\n <Text {...getStyles('mobileMonthViewNoEvents')}>{getLabel('noEvents', labels)}</Text>\n )}\n </Box>\n </Box>\n );\n});\n\nMobileMonthView.displayName = '@mantine/schedule/MobileMonthView';\nMobileMonthView.classes = classes;\nMobileMonthView.varsResolver = varsResolver;\n\nexport namespace MobileMonthView {\n export type Props = MobileMonthViewProps;\n export type Factory = MobileMonthViewFactory;\n export type StylesNames = MobileMonthViewStylesNames;\n export type CssVariables = MobileMonthViewCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqLA,MAAM,eAAe;CACnB,kBAAkB;CAClB,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,MAAM;CACN,oBAAoB;AACtB;AAEA,MAAM,eAAe,oBAA4C,QAAQ,EAAE,cAAc,EACvF,iBAAiB,EACf,8BAA8B,UAAU,MAAM,EAChD,EACF,EAAE;AAEF,MAAa,kBAAkB,SAAiC,WAAW;CACzE,MAAM,QAAQ,SAAS,mBAAmB,cAAc,MAAM;CAC9D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,YACA,kBACA,MACA,cACA,cACA,qBACA,sBACA,iBACA,cACA,QACA,gBACA,eACA,aACA,oBACA,aACA,YACA,mBACA,iBACA,gBACA,QACA,iBACA,QACA,QACA,MACA,aACA,oBACA,aACA,cACA,cACA,0BACA,GAAG,WACD;CAEJ,MAAM,MAAM,gBAAgB;CAC5B,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,QAAQ,MAAM;CAEpB,MAAM,CAAC,eAAe,oBAAoB,gBAAsC;EAC9E,OAAO;EACP,cAAc,uBAAuB,aAAa,KAAK;EACvD,WAAW,UAAU,uBAAuB,QAAQ,aAAa,MAAM,KAAK,CAAC,IAAI,IAAI;CACvF,CAAC;CAED,MAAM,YAAY,UAAkC;EAClD,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;CAChB,CAAC;CAED,MAAM,UAAgC,OAA8B,CAAC,CAAC;CACtE,MAAM,mBAAmB,OAAuD,IAAI;CAEpF,MAAM,iBAAiB,sBAAsB;EAC3C;EACA,YAAY,MAAM,IAAI,CAAC,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N,UAAA;GAKE,oBAAC,OAAD;IAAK,GAAI,UAAU,uBAAuB;IACvC,UAAA,OAAO,iBAAiB,aACrB,aAAa;KAAQ;KAAO;KAAM;IAAc,CAAC,IACjD;GACD,CAAA;GAEL,qBAAC,KAAD;IAAK,GAAI,UAAU,yBAAyB;IAAG,KAAK,EAAE,iBAAiB,aAAa;IAApF,UAAA,CACG,YACC,qBAAC,OAAD;KAAK,GAAI,UAAU,yBAAyB;KAA5C,UAAA,CACG,mBAAmB,oBAAC,OAAD,EAAK,GAAI,UAAU,+BAA+B,EAAI,CAAA,GACzE,QACE;IAEN,CAAA,GAAA,KACE;;GAEL,qBAAC,KAAD;IAAK,GAAI,UAAU,2BAA2B;IAA9C,UAAA,CACE,oBAAC,MAAD;KAAM,GAAI,UAAU,6BAA6B;KAAI,UAAA;IAAmB,CAAA,GAEvE,WAAW,SAAS,IACnB,aAEA,oBAAC,MAAD;KAAM,GAAI,UAAU,yBAAyB;KAAI,UAAA,SAAS,YAAY,MAAM;IAAQ,CAAA,CAEnF;;EACF;;AAET,CAAC;AAED,gBAAgB,cAAc;AAC9B,gBAAgB,UAAUA;AAC1B,gBAAgB,eAAe"}
1
+ {"version":3,"file":"MobileMonthView.mjs","names":["classes"],"sources":["../../../src/components/MobileMonthView/MobileMonthView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport React, { useRef } from 'react';\nimport {\n AccordionChevron,\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getRadius,\n getThemeColor,\n MantineRadius,\n StylesApiProps,\n Text,\n UnstyledButton,\n useDirection,\n useMantineTheme,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n DateLabelFormat,\n DateStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n} from '../../types';\nimport {\n expandRecurringEvents,\n formatDate,\n getMonthDays,\n getWeekdaysNames,\n getWeekNumber,\n isSameMonth,\n sortEvents,\n toDateString,\n} from '../../utils';\nimport {\n handleMonthViewKeyDown,\n MonthViewControlsRef,\n} from '../MonthView/handle-month-view-key-down';\nimport { RenderEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { getMobileMonthViewEvents } from './get-mobile-month-view-events';\nimport classes from './MobileMonthView.module.css';\n\nexport type MobileMonthViewStylesNames =\n | 'mobileMonthView'\n | 'mobileMonthViewHeader'\n | 'mobileMonthViewHeaderBackButton'\n | 'mobileMonthViewHeaderLabel'\n | 'mobileMonthViewCalendar'\n | 'mobileMonthViewWeekdays'\n | 'mobileMonthViewWeekday'\n | 'mobileMonthViewWeekdaysCorner'\n | 'mobileMonthViewWeek'\n | 'mobileMonthViewWeekNumber'\n | 'mobileMonthViewDay'\n | 'mobileMonthViewDayIndicators'\n | 'mobileMonthViewDayIndicator'\n | 'mobileMonthViewEventsList'\n | 'mobileMonthViewEventsHeader'\n | 'mobileMonthViewEvent'\n | 'mobileMonthViewEventColor'\n | 'mobileMonthViewEventBody'\n | 'mobileMonthViewEventTitle'\n | 'mobileMonthViewEventTime'\n | 'mobileMonthViewNoEvents';\n\nexport type MobileMonthViewCssVariables = {\n mobileMonthView: '--mobile-month-view-radius';\n};\n\nexport interface MobileMonthViewRenderHeaderInput {\n /** Current interaction mode */\n mode: ScheduleMode;\n /** Current date displayed in the view */\n date: Date | string;\n /** Default header element */\n defaultHeader: React.ReactNode;\n}\n\nexport interface MobileMonthViewProps\n extends BoxProps, StylesApiProps<MobileMonthViewFactory>, 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 /** Currently selected date (controlled) */\n selectedDate?: Date | string | null;\n\n /** Default selected date (uncontrolled) */\n defaultSelectedDate?: Date | string | null;\n\n /** Called when selected date changes */\n onSelectedDateChange?: (value: DateStringValue | null) => 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 /** 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 false */\n withOutsideDays?: boolean;\n\n /** Events to display */\n events?: ScheduleEventData[];\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 /** Function to fully customize event rendering, receives all props that would be passed to the root element including children */\n renderEvent?: RenderEvent;\n\n /** Format for the events list header date @default 'dddd, MMMM D' */\n eventsHeaderFormat?: DateLabelFormat;\n\n /** Called when the year back button in the header is clicked */\n onYearClick?: () => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Custom header renderer, receives object with mode, date, and default header element */\n renderHeader?: (input: MobileMonthViewRenderHeaderInput) => React.ReactNode;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n}\n\nexport type MobileMonthViewFactory = Factory<{\n props: MobileMonthViewProps;\n ref: HTMLDivElement;\n stylesNames: MobileMonthViewStylesNames;\n vars: MobileMonthViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'MobileMonthView',\n withWeekDays: true,\n consistentWeeks: true,\n highlightToday: true,\n mode: 'default',\n eventsHeaderFormat: 'dddd, MMMM D',\n} satisfies Partial<MobileMonthViewProps>;\n\nconst varsResolver = createVarsResolver<MobileMonthViewFactory>((_theme, { radius }) => ({\n mobileMonthView: {\n '--mobile-month-view-radius': getRadius(radius),\n },\n}));\n\nexport const MobileMonthView = factory<MobileMonthViewFactory>((_props) => {\n const props = useProps('MobileMonthView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n attributes,\n __staticSelector,\n date,\n onDateChange,\n selectedDate,\n defaultSelectedDate,\n onSelectedDateChange,\n withWeekNumbers,\n withWeekDays,\n locale,\n firstDayOfWeek,\n weekdayFormat,\n weekendDays,\n getWeekNumberProps,\n getDayProps,\n onDayClick,\n onWeekNumberClick,\n consistentWeeks,\n highlightToday,\n radius,\n withOutsideDays,\n events,\n labels,\n mode,\n renderEvent,\n eventsHeaderFormat,\n onYearClick,\n onEventClick,\n renderHeader,\n recurrenceExpansionLimit,\n ...others\n } = props;\n\n const ctx = useDatesContext();\n const theme = useMantineTheme();\n const today = dayjs();\n\n const [_selectedDate, _setSelectedDate] = useUncontrolled<Date | string | null>({\n value: selectedDate,\n defaultValue: defaultSelectedDate ?? toDateString(today),\n onChange: (value) => onSelectedDateChange?.(value ? toDateString(dayjs(value)) : null),\n });\n\n const getStyles = useStyles<MobileMonthViewFactory>({\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: 'mobileMonthView',\n });\n\n const daysRef: MonthViewControlsRef = useRef<HTMLButtonElement[][]>([]);\n const firstDayPosition = useRef<{ weekIndex: number; dayIndex: number } | null>(null);\n\n const expandedEvents = expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('month').toDate(),\n rangeEnd: dayjs(date).endOf('month').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n });\n\n const groupedEvents = getMobileMonthViewEvents({ date, events: expandedEvents });\n\n const weekdays = withWeekDays\n ? getWeekdaysNames({\n locale: ctx.getLocale(locale),\n format: weekdayFormat,\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n }).map((day, index) => (\n <div {...getStyles('mobileMonthViewWeekday')} key={index}>\n {day}\n </div>\n ))\n : null;\n\n const weeks = getMonthDays({\n month: dayjs(date).format('YYYY-MM-DD'),\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n consistentWeeks,\n }).map((week, weekIndex) => {\n const days = week.map((dayDate, dayIndex) => {\n const outside = !isSameMonth(dayDate, date);\n const weekend = ctx.getWeekendDays(weekendDays).includes(dayjs(dayDate).day());\n const ariaLabel = dayjs(dayDate)\n .locale(locale || ctx.locale)\n .format('MMMM D, YYYY');\n\n const dayProps = getDayProps?.(dayjs(dayDate).format('YYYY-MM-DD')) || {};\n const isToday = dayjs(dayDate).isSame(today, 'day') && highlightToday;\n const isSelected = _selectedDate && dayjs(dayDate).isSame(dayjs(_selectedDate), 'day');\n const dayEvents = groupedEvents[dayjs(dayDate).format('YYYY-MM-DD')] || [];\n\n const shouldRender = withOutsideDays || !outside;\n\n if (shouldRender && firstDayPosition.current === null) {\n firstDayPosition.current = { weekIndex, dayIndex };\n }\n\n const isFirstDay =\n firstDayPosition.current?.weekIndex === weekIndex &&\n firstDayPosition.current?.dayIndex === dayIndex;\n\n const indicators = dayEvents.slice(0, 3).map((event) => (\n <div\n {...getStyles('mobileMonthViewDayIndicator', {\n style: { backgroundColor: getThemeColor(event.color, theme) },\n })}\n key={event.id}\n />\n ));\n\n const handleDayClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n const dateStr = dayjs(dayDate).format('YYYY-MM-DD');\n _setSelectedDate(dateStr);\n onDayClick?.(dateStr, event);\n dayProps.onClick?.(event);\n };\n\n const handleDayKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n handleMonthViewKeyDown({\n controlsRef: daysRef,\n weekIndex,\n dayIndex,\n event,\n });\n };\n\n return (\n <UnstyledButton\n aria-label={ariaLabel}\n aria-selected={isSelected || undefined}\n {...dayProps}\n {...getStyles('mobileMonthViewDay', {\n className: dayProps.className,\n style: dayProps.style,\n })}\n key={dayDate}\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 mod={[\n {\n outside,\n weekend,\n today: isToday,\n selected: isSelected,\n static: mode === 'static',\n hidden: !shouldRender,\n },\n dayProps.mod,\n ]}\n tabIndex={mode === 'static' || !shouldRender ? -1 : isFirstDay ? 0 : -1}\n onClick={mode === 'static' || !shouldRender ? undefined : handleDayClick}\n onKeyDown={mode === 'static' || !shouldRender ? undefined : handleDayKeyDown}\n >\n {shouldRender ? dayjs(dayDate).format('D') : null}\n {shouldRender && <div {...getStyles('mobileMonthViewDayIndicators')}>{indicators}</div>}\n </UnstyledButton>\n );\n });\n\n const weekNumberProps = getWeekNumberProps?.(dayjs(week[0]).format('YYYY-MM-DD')) || {};\n const weekNumber = getWeekNumber(week);\n\n return (\n <div {...getStyles('mobileMonthViewWeek')} 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 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('mobileMonthViewWeekNumber', {\n className: weekNumberProps.className,\n style: weekNumberProps.style,\n })}\n >\n {weekNumber}\n </UnstyledButton>\n )}\n {days}\n </div>\n );\n });\n\n const selectedDateEvents = _selectedDate\n ? sortEvents(groupedEvents[dayjs(_selectedDate).format('YYYY-MM-DD')] || [])\n : [];\n\n const eventsList = selectedDateEvents.map((event) => {\n const startTime = dayjs(event.start).format('HH:mm');\n const endTime = dayjs(event.end).format('HH:mm');\n const isAllDay = startTime === '00:00' && endTime === '00:00';\n\n const eventChildren = (\n <Box {...getStyles('mobileMonthViewEventBody')}>\n <div\n {...getStyles('mobileMonthViewEventColor', {\n style: { backgroundColor: getThemeColor(event.color, theme) },\n })}\n />\n <div>\n <Text {...getStyles('mobileMonthViewEventTitle')}>{event.title}</Text>\n <Text {...getStyles('mobileMonthViewEventTime')}>\n {isAllDay ? getLabel('allDay', labels) : `${startTime} – ${endTime}`}\n </Text>\n </div>\n </Box>\n );\n\n const rootProps: React.ComponentPropsWithoutRef<'button'> & { children: React.ReactNode } = {\n ...getStyles('mobileMonthViewEvent'),\n onClick:\n mode === 'static'\n ? undefined\n : (e: React.MouseEvent<HTMLButtonElement>) => {\n onEventClick?.(event, e);\n },\n tabIndex: mode === 'static' ? -1 : 0,\n children: eventChildren,\n };\n\n if (typeof renderEvent === 'function') {\n return <React.Fragment key={event.id}>{renderEvent(event, rootProps)}</React.Fragment>;\n }\n\n return <UnstyledButton {...rootProps} key={event.id} />;\n });\n\n const eventsHeader = _selectedDate\n ? formatDate({\n locale: ctx.getLocale(locale),\n date: _selectedDate,\n format: eventsHeaderFormat,\n })\n : '';\n\n const { dir } = useDirection();\n\n const headerLabel = formatDate({ locale: ctx.getLocale(locale), date, format: 'MMMM YYYY' });\n\n const defaultHeader = (\n <>\n <UnstyledButton\n {...getStyles('mobileMonthViewHeaderBackButton')}\n onClick={onYearClick}\n mod={{ static: mode === 'static' }}\n tabIndex={mode === 'static' ? -1 : 0}\n >\n <AccordionChevron\n style={{ transform: `rotate(${dir === 'rtl' ? -90 : 90}deg)` }}\n size={20}\n />\n {dayjs(date).format('YYYY')}\n </UnstyledButton>\n <Text {...getStyles('mobileMonthViewHeaderLabel')}>{headerLabel}</Text>\n </>\n );\n\n return (\n <Box\n {...getStyles('mobileMonthView')}\n mod={{ 'with-week-numbers': withWeekNumbers }}\n {...others}\n >\n <div {...getStyles('mobileMonthViewHeader')}>\n {typeof renderHeader === 'function'\n ? renderHeader({ mode: mode!, date, defaultHeader })\n : defaultHeader}\n </div>\n\n <Box {...getStyles('mobileMonthViewCalendar')} mod={{ 'with-weekdays': withWeekDays }}>\n {weekdays && (\n <div {...getStyles('mobileMonthViewWeekdays')}>\n {withWeekNumbers && <div {...getStyles('mobileMonthViewWeekdaysCorner')} />}\n {weekdays}\n </div>\n )}\n {weeks}\n </Box>\n\n <Box {...getStyles('mobileMonthViewEventsList')}>\n <Text {...getStyles('mobileMonthViewEventsHeader')}>{eventsHeader}</Text>\n\n {eventsList.length > 0 ? (\n eventsList\n ) : (\n <Text {...getStyles('mobileMonthViewNoEvents')}>{getLabel('noEvents', labels)}</Text>\n )}\n </Box>\n </Box>\n );\n});\n\nMobileMonthView.displayName = '@mantine/schedule/MobileMonthView';\nMobileMonthView.classes = classes;\nMobileMonthView.varsResolver = varsResolver;\n\nexport namespace MobileMonthView {\n export type Props = MobileMonthViewProps;\n export type Factory = MobileMonthViewFactory;\n export type StylesNames = MobileMonthViewStylesNames;\n export type CssVariables = MobileMonthViewCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqLA,MAAM,eAAe;CACnB,kBAAkB;CAClB,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,MAAM;CACN,oBAAoB;AACtB;AAEA,MAAM,eAAe,oBAA4C,QAAQ,EAAE,cAAc,EACvF,iBAAiB,EACf,8BAA8B,UA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ACE;;GAEL,qBAAC,KAAD;IAAK,GAAI,UAAU,2BAA2B;IAA9C,UAAA,CACE,oBAAC,MAAD;KAAM,GAAI,UAAU,6BAA6B;KAAI,UAAA;IAAmB,CAAA,GAEvE,WAAW,SAAS,IACnB,aAEA,oBAAC,MAAD;KAAM,GAAI,UAAU,yBAAyB;KAAI,UAAA,SAAS,YAAY,MAAM;IAAQ,CAAA,CAEnF;;EACF;;AAET,CAAC;AAED,gBAAgB,cAAc;AAC9B,gBAAgB,UAAUA;AAC1B,gBAAgB,eAAe"}
@@ -207,7 +207,8 @@ const ResourcesDayView = factory((_props) => {
207
207
  intervalMinutes,
208
208
  resizeIntervalMinutes: eventResizeInterval,
209
209
  onEventResize,
210
- canResizeEvent
210
+ canResizeEvent,
211
+ withBackgroundEvents: withInteractiveBackgroundEvents
211
212
  });
212
213
  const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== "static";
213
214
  const handleTimeSlotClick = (resourceId, slotTime, e) => {
@@ -342,19 +343,43 @@ const ResourcesDayView = factory((_props) => {
342
343
  };
343
344
  const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== "static";
344
345
  const rows = orderedResources.map((resource, resourceIndex) => {
345
- const backgroundEventNodes = [...resourceEvents.backgroundTimedEvents[resource.id] || [], ...resourceEvents.backgroundAllDayEvents[resource.id] || []].map((event) => /* @__PURE__ */ jsx(ScheduleBackgroundEvent, {
346
- event,
347
- renderEvent,
348
- renderEventBody,
349
- interactive: interactiveBackgroundEvents,
350
- onEventClick,
351
- ...getStyles("resourcesDayViewBackgroundEvent", { style: {
352
- left: `${event.position.top}%`,
353
- width: `${event.position.height}%`,
354
- top: 0,
355
- height: "100%"
356
- } })
357
- }, `bg-${event.id}`));
346
+ const renderBackgroundEvent = (event, allDay) => {
347
+ const isResizable = !allDay && eventResize.isResizableEvent(event);
348
+ const resizePosition = eventResize.getResizePosition(event.id);
349
+ return /* @__PURE__ */ jsx(ScheduleBackgroundEvent, {
350
+ event,
351
+ renderEvent,
352
+ renderEventBody,
353
+ interactive: interactiveBackgroundEvents,
354
+ onEventClick: onEventClick ? (clickedEvent, e) => {
355
+ if (!eventResize.wasResizing()) onEventClick(clickedEvent, e);
356
+ } : void 0,
357
+ withResize: isResizable,
358
+ isResizing: resizePosition !== null,
359
+ activeResizeEdge: eventResize.resizingEdge,
360
+ resizeAxis: "horizontal",
361
+ resizeHandleProps: getStyles("resourcesDayViewResizeHandle"),
362
+ onResizeStart: isResizable ? (edge, e) => {
363
+ const container = rowSlotsContainersRef.current[resourceIndex];
364
+ if (container) eventResize.handleResizeStart({
365
+ event,
366
+ edge,
367
+ container,
368
+ originalLeft: event.position.top,
369
+ originalWidth: event.position.height,
370
+ eventDate: dateStr,
371
+ pointerEvent: e
372
+ });
373
+ } : void 0,
374
+ ...getStyles("resourcesDayViewBackgroundEvent", { style: {
375
+ left: `${resizePosition ? resizePosition.left : event.position.top}%`,
376
+ width: `${resizePosition ? resizePosition.width : event.position.height}%`,
377
+ top: 0,
378
+ height: "100%"
379
+ } })
380
+ }, `bg-${event.id}`);
381
+ };
382
+ const backgroundEventNodes = [...(resourceEvents.backgroundTimedEvents[resource.id] || []).map((event) => renderBackgroundEvent(event, false)), ...(resourceEvents.backgroundAllDayEvents[resource.id] || []).map((event) => renderBackgroundEvent(event, true))];
358
383
  const allRegularEvents = (resourceEvents.regularEvents[resource.id] || []).filter((event) => !isAllDayEvent({
359
384
  event,
360
385
  date