@mantine/schedule 9.6.0 → 9.6.1

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 (67) hide show
  1. package/cjs/components/DayView/DayView.cjs +11 -4
  2. package/cjs/components/DayView/DayView.cjs.map +1 -1
  3. package/cjs/components/DayView/DayView.module.cjs +2 -2
  4. package/cjs/components/DayView/DayView.module.cjs.map +1 -1
  5. package/cjs/components/DayView/get-day-view-events/get-day-positioned-events.cjs +12 -7
  6. package/cjs/components/DayView/get-day-view-events/get-day-positioned-events.cjs.map +1 -1
  7. package/cjs/components/DayView/get-day-view-events/get-day-view-events.cjs +3 -2
  8. package/cjs/components/DayView/get-day-view-events/get-day-view-events.cjs.map +1 -1
  9. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +1 -1
  10. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
  11. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +1 -1
  12. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
  13. package/cjs/components/ScheduleEvent/ScheduleEvent.module.cjs.map +1 -1
  14. package/cjs/components/WeekView/WeekView.cjs +11 -4
  15. package/cjs/components/WeekView/WeekView.cjs.map +1 -1
  16. package/cjs/components/WeekView/WeekView.module.cjs +2 -2
  17. package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
  18. package/cjs/components/WeekView/get-week-view-events/get-week-positioned-events.cjs +4 -2
  19. package/cjs/components/WeekView/get-week-view-events/get-week-positioned-events.cjs.map +1 -1
  20. package/cjs/index.cjs +4 -0
  21. package/cjs/utils/apply-cascade-layout/apply-cascade-layout.cjs +21 -0
  22. package/cjs/utils/apply-cascade-layout/apply-cascade-layout.cjs.map +1 -0
  23. package/cjs/{components/ResourcesDayView → utils}/get-overlap-clusters/get-overlap-clusters.cjs +2 -2
  24. package/cjs/utils/get-overlap-clusters/get-overlap-clusters.cjs.map +1 -0
  25. package/cjs/utils/is-event-in-time-range/is-event-in-time-range.cjs +2 -1
  26. package/cjs/utils/is-event-in-time-range/is-event-in-time-range.cjs.map +1 -1
  27. package/esm/components/DayView/DayView.mjs +11 -4
  28. package/esm/components/DayView/DayView.mjs.map +1 -1
  29. package/esm/components/DayView/DayView.module.mjs +2 -2
  30. package/esm/components/DayView/DayView.module.mjs.map +1 -1
  31. package/esm/components/DayView/get-day-view-events/get-day-positioned-events.mjs +12 -7
  32. package/esm/components/DayView/get-day-view-events/get-day-positioned-events.mjs.map +1 -1
  33. package/esm/components/DayView/get-day-view-events/get-day-view-events.mjs +3 -2
  34. package/esm/components/DayView/get-day-view-events/get-day-view-events.mjs.map +1 -1
  35. package/esm/components/ResourcesDayView/ResourcesDayView.mjs +1 -1
  36. package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
  37. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +1 -1
  38. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
  39. package/esm/components/ScheduleEvent/ScheduleEvent.module.mjs.map +1 -1
  40. package/esm/components/WeekView/WeekView.mjs +11 -4
  41. package/esm/components/WeekView/WeekView.mjs.map +1 -1
  42. package/esm/components/WeekView/WeekView.module.mjs +2 -2
  43. package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
  44. package/esm/components/WeekView/get-week-view-events/get-week-positioned-events.mjs +4 -2
  45. package/esm/components/WeekView/get-week-view-events/get-week-positioned-events.mjs.map +1 -1
  46. package/esm/index.mjs +3 -1
  47. package/esm/utils/apply-cascade-layout/apply-cascade-layout.mjs +21 -0
  48. package/esm/utils/apply-cascade-layout/apply-cascade-layout.mjs.map +1 -0
  49. package/esm/{components/ResourcesDayView → utils}/get-overlap-clusters/get-overlap-clusters.mjs +2 -2
  50. package/esm/utils/get-overlap-clusters/get-overlap-clusters.mjs.map +1 -0
  51. package/esm/utils/is-event-in-time-range/is-event-in-time-range.mjs +2 -1
  52. package/esm/utils/is-event-in-time-range/is-event-in-time-range.mjs.map +1 -1
  53. package/lib/components/DayView/DayView.d.ts +5 -1
  54. package/lib/components/DayView/get-day-view-events/get-day-positioned-events.d.ts +4 -2
  55. package/lib/components/DayView/get-day-view-events/get-day-view-events.d.ts +3 -2
  56. package/lib/components/WeekView/WeekView.d.ts +5 -1
  57. package/lib/components/WeekView/get-week-view-events/get-week-positioned-events.d.ts +4 -2
  58. package/lib/types.d.ts +2 -0
  59. package/lib/utils/apply-cascade-layout/apply-cascade-layout.d.ts +6 -0
  60. package/lib/utils/get-overlap-clusters/get-overlap-clusters.d.ts +2 -0
  61. package/lib/utils/index.d.ts +3 -0
  62. package/package.json +4 -4
  63. package/styles.css +61 -0
  64. package/styles.layer.css +61 -0
  65. package/cjs/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.cjs.map +0 -1
  66. package/esm/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.mjs.map +0 -1
  67. package/lib/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.d.ts +0 -2
@@ -50,7 +50,9 @@ const defaultProps = {
50
50
  withDragSlotSelect: false,
51
51
  withEventResize: false,
52
52
  mode: "default",
53
- withInteractiveBackgroundEvents: false
53
+ withInteractiveBackgroundEvents: false,
54
+ eventOverlapMode: "columns",
55
+ eventOverlapRaiseDelay: 600
54
56
  };
55
57
  const varsResolver = (0, _mantine_core.createVarsResolver)((_theme, { radius, slotHeight, allDaySlotHeight }) => ({ dayView: {
56
58
  "--day-view-radius": radius !== void 0 ? (0, _mantine_core.getRadius)(radius) : void 0,
@@ -59,7 +61,7 @@ const varsResolver = (0, _mantine_core.createVarsResolver)((_theme, { radius, sl
59
61
  } }));
60
62
  const DayView = (0, _mantine_core.factory)((_props) => {
61
63
  const props = (0, _mantine_core.useProps)("DayView", defaultProps, _props);
62
- const { classNames, className, style, styles, unstyled, attributes, vars, __staticSelector, startTime, endTime, intervalMinutes, withSubHourGridLines, withAllDaySlot, date, locale, slotLabelFormat, headerFormat, getCurrentTime, withCurrentTimeIndicator, withCurrentTimeBubble, withHeader, radius, onDateChange, onViewChange, previousControlProps, nextControlProps, todayControlProps, viewSelectProps, slotHeight, allDaySlotHeight, scrollAreaProps, events, moreEventsProps, renderEventBody, renderEvent, labels, highlightBusinessHours, businessHours, withEventsDragAndDrop, onEventDrop, canDragEvent, eventDragInterval, onEventDragStart, onEventDragEnd, onTimeSlotClick, onAllDaySlotClick, onEventClick, withInteractiveBackgroundEvents, withDragSlotSelect, onSlotDragEnd, mode, startScrollTime, onExternalEventDrop, withEventResize, onEventResize, canResizeEvent, eventResizeInterval, recurrenceExpansionLimit, getTimeSlotProps, withAgenda, ...others } = props;
64
+ const { classNames, className, style, styles, unstyled, attributes, vars, __staticSelector, startTime, endTime, intervalMinutes, withSubHourGridLines, eventOverlapMode, eventOverlapRaiseDelay, withAllDaySlot, date, locale, slotLabelFormat, headerFormat, getCurrentTime, withCurrentTimeIndicator, withCurrentTimeBubble, withHeader, radius, onDateChange, onViewChange, previousControlProps, nextControlProps, todayControlProps, viewSelectProps, slotHeight, allDaySlotHeight, scrollAreaProps, events, moreEventsProps, renderEventBody, renderEvent, labels, highlightBusinessHours, businessHours, withEventsDragAndDrop, onEventDrop, canDragEvent, eventDragInterval, onEventDragStart, onEventDragEnd, onTimeSlotClick, onAllDaySlotClick, onEventClick, withInteractiveBackgroundEvents, withDragSlotSelect, onSlotDragEnd, mode, startScrollTime, onExternalEventDrop, withEventResize, onEventResize, canResizeEvent, eventResizeInterval, recurrenceExpansionLimit, getTimeSlotProps, withAgenda, ...others } = props;
63
65
  const [agendaOpen, setAgendaOpen] = (0, react.useState)(false);
64
66
  const getStyles = (0, _mantine_core.useStyles)({
65
67
  name: __staticSelector,
@@ -184,7 +186,8 @@ const DayView = (0, _mantine_core.factory)((_props) => {
184
186
  date,
185
187
  startTime,
186
188
  endTime,
187
- intervalMinutes
189
+ intervalMinutes,
190
+ eventOverlapMode
188
191
  });
189
192
  const handleExternalDrop = (0, react.useCallback)((e, slotIndex) => {
190
193
  if (!onExternalEventDrop) return;
@@ -299,13 +302,16 @@ const DayView = (0, _mantine_core.factory)((_props) => {
299
302
  if (!eventResize.wasResizing()) onEventClick(event, e);
300
303
  } : void 0,
301
304
  ...stylesApiProps,
305
+ mod: { cascade: eventOverlapMode === "cascade" },
302
306
  style: {
303
307
  ...stylesApiProps.styles?.event,
304
308
  top: `${eventTop}%`,
305
309
  height: `${eventHeight}%`,
306
310
  insetInlineStart: `${event.position.offset}%`,
307
311
  width: `${event.position.width}%`,
308
- position: "absolute"
312
+ position: "absolute",
313
+ "--event-z-index": event.position.column + 3,
314
+ "--event-z-index-raised": event.position.overlaps + 3
309
315
  }
310
316
  }, event.id);
311
317
  });
@@ -423,6 +429,7 @@ const DayView = (0, _mantine_core.factory)((_props) => {
423
429
  }, event.id));
424
430
  const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, {
425
431
  ...getStyles("dayView"),
432
+ __vars: { "--event-raise-delay": `${eventOverlapRaiseDelay}ms` },
426
433
  mod: {
427
434
  static: mode === "static",
428
435
  "slot-dragging": slotDragSelect.isDragging,
@@ -1 +1 @@
1
- {"version":3,"file":"DayView.cjs","names":["createVarsResolver","getRadius","rem","factory","useProps","useState","useStyles","useResolvedStylesApi","useDatesContext","getDayTimeIntervals","useRef","useMergedRef","useCallback","useSlotDragSelect","expandRecurringEvents","getDayViewEvents","calculateDropTime","useDragDropHandlers","useEventResize","isAllDayEvent","ScheduleEvent","getVisibleEvents","UnstyledButton","getBusinessHoursMod","clampIntervalMinutes","getLabel","formatDate","Box","ScheduleBackgroundEvent","getTimeAxisEventStyle","ScheduleHeaderBase","toDateString","AgendaView","ScrollArea","MoreEvents","getDayPosition","CurrentTimeIndicator","DragContext","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 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 /** 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} 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 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 });\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 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 }}\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 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuRA,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;AACnC;AAEA,MAAM,gBAAA,GAAeA,cAAAA,mBAAAA,EAClB,QAAQ,EAAE,QAAQ,YAAY,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,mBAAmB,SAAS,kBAAkB,KAAA;OAC3D,QACE,oBACK,UAAU;QACT,MAAM,YAAY,0BAA0B,KAAK;QACjD,IAAI,cAAc,MAChB,SAAS,WAAW,OAAO,SAAS;OAExC,IACA,KAAA;OAvBR,UAAA;QA0BG;QAEA;QAEA,SAAS,eAAe,SAAS,iBAAiB,gBACjD,iBAAA,GAAA,kBAAA,IAAA,CAACE,cAAAA,KAAD,EACE,GAAI,UAAU,sBAAsB,EAClC,cAAc;SACZ,MAAM,EAAE,KAAK,WAAWQ,yBAAAA,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,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,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,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,YAAY,UAAb;EAAsB,OAAO,SAAS;EAAmB,UAAA;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,QAAQ,cAAc;AACtB,QAAQ,UAAUC,uBAAAA;AAClB,QAAQ,eAAe"}
1
+ {"version":3,"file":"DayView.cjs","names":["createVarsResolver","getRadius","rem","factory","useProps","useState","useStyles","useResolvedStylesApi","useDatesContext","getDayTimeIntervals","useRef","useMergedRef","useCallback","useSlotDragSelect","expandRecurringEvents","getDayViewEvents","calculateDropTime","useDragDropHandlers","useEventResize","isAllDayEvent","ScheduleEvent","getVisibleEvents","UnstyledButton","getBusinessHoursMod","clampIntervalMinutes","getLabel","formatDate","Box","ScheduleBackgroundEvent","getTimeAxisEventStyle","ScheduleHeaderBase","toDateString","AgendaView","ScrollArea","MoreEvents","getDayPosition","CurrentTimeIndicator","DragContext","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,gBAAA,GAAeA,cAAAA,mBAAAA,EAClB,QAAQ,EAAE,QAAQ,YAAY,wBAAwB,EACrD,SAAS;CACP,qBAAqB,WAAW,KAAA,KAAA,GAAYC,cAAAA,UAAAA,CAAU,MAAM,IAAI,KAAA;CAChE,2BAAA,GAA0BC,cAAAA,IAAAA,CAAI,UAAU;CACxC,mCAAA,GAAkCA,cAAAA,IAAAA,CAAI,gBAAgB;AACxD,EACF,EACF;AAEA,MAAa,WAAA,GAAUC,cAAAA,QAAAA,EAAyB,WAAW;CACzD,MAAM,SAAA,GAAQC,cAAAA,SAAAA,CAAS,WAAW,cAAc,MAAM;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA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,SAAS,iBAAiB,gBACjD,iBAAA,GAAA,kBAAA,IAAA,CAACE,cAAAA,KAAD,EACE,GAAI,UAAU,sBAAsB,EAClC,cAAc;SACZ,MAAM,EAAE,KAAK,WAAWQ,yBAAAA,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,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,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,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,YAAY,UAAb;EAAsB,OAAO,SAAS;EAAmB,UAAA;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,QAAQ,cAAc;AACtB,QAAQ,UAAUC,uBAAAA;AAClB,QAAQ,eAAe"}
@@ -6,14 +6,14 @@ var DayView_module_default = {
6
6
  "dayViewScrollArea": "m_f2eec5af",
7
7
  "dayViewInner": "m_d5502881",
8
8
  "dayViewTimeSlots": "m_9389813",
9
+ "dayViewDragPreview": "m_2d4819df",
9
10
  "dayViewSlot": "m_cd179e73",
10
11
  "dayViewSlotLabels": "m_c30b0852",
11
12
  "dayViewSlotLabel": "m_2f950041",
12
13
  "dayViewSlots": "m_d5dc3060",
13
14
  "dayViewBackgroundEvent": "m_c5cd9a77",
14
15
  "dayViewAllDay": "m_c6f08d70",
15
- "dayViewAllDayEvents": "m_42b986a9",
16
- "dayViewDragPreview": "m_2d4819df"
16
+ "dayViewAllDayEvents": "m_42b986a9"
17
17
  };
18
18
  //#endregion
19
19
  exports.default = DayView_module_default;
@@ -1 +1 @@
1
- {"version":3,"file":"DayView.module.cjs","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 &: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.cjs","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":""}
@@ -3,6 +3,7 @@ const require_is_all_day_event = require("../../../utils/is-all-day-event/is-all
3
3
  const require_sort_events = require("../../../utils/sort-events/sort-events.cjs");
4
4
  const require_is_events_overlap = require("../../../utils/is-events-overlap/is-events-overlap.cjs");
5
5
  const require_get_day_position = require("../../../utils/get-day-position/get-day-position.cjs");
6
+ const require_apply_cascade_layout = require("../../../utils/apply-cascade-layout/apply-cascade-layout.cjs");
6
7
  //#region packages/@mantine/schedule/src/components/DayView/get-day-view-events/get-day-positioned-events.ts
7
8
  function columnHasConflict({ columns, columnIndex, event, allDay, date }) {
8
9
  if (!columns[columnIndex]) return false;
@@ -16,7 +17,7 @@ function columnHasConflict({ columns, columnIndex, event, allDay, date }) {
16
17
  return hasTimeConflict;
17
18
  });
18
19
  }
19
- function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, date }) {
20
+ function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, date, eventOverlapMode = "columns" }) {
20
21
  const columns = [];
21
22
  const positioned = [];
22
23
  const sorted = require_sort_events.sortEvents(events);
@@ -56,14 +57,18 @@ function getDayPositionedEvents({ events, startTime, endTime, intervalMinutes, d
56
57
  }
57
58
  });
58
59
  }
60
+ for (const positionedEvent of positioned) if (positionedEvent.position.allDay) {
61
+ positionedEvent.position.overlaps = 1;
62
+ positionedEvent.position.width = 100;
63
+ positionedEvent.position.offset = 0;
64
+ }
65
+ if (eventOverlapMode === "cascade") {
66
+ require_apply_cascade_layout.applyCascadeLayout(positioned);
67
+ return positioned;
68
+ }
59
69
  for (const positionedEvent of positioned) {
60
70
  const { allDay, column } = positionedEvent.position;
61
- if (allDay) {
62
- positionedEvent.position.overlaps = 1;
63
- positionedEvent.position.width = 100;
64
- positionedEvent.position.offset = 0;
65
- continue;
66
- }
71
+ if (allDay) continue;
67
72
  const directlyOverlapping = [];
68
73
  for (const otherEvent of positioned) {
69
74
  if (otherEvent === positionedEvent || otherEvent.position.allDay) continue;
@@ -1 +1 @@
1
- {"version":3,"file":"get-day-positioned-events.cjs","names":["isAllDayEvent","isEventsOverlap","sortEvents","getDayPosition"],"sources":["../../../../src/components/DayView/get-day-view-events/get-day-positioned-events.ts"],"sourcesContent":["import { AnyDateValue, DayPositionedEventData, ScheduleEventData } from '../../../types';\nimport { getDayPosition, isAllDayEvent, isEventsOverlap, sortEvents } from '../../../utils';\n\ninterface ColumnHasConflictOptions {\n columns: ScheduleEventData[][];\n columnIndex: number;\n event: ScheduleEventData;\n allDay: boolean;\n date: AnyDateValue;\n}\n\nfunction columnHasConflict({\n columns,\n columnIndex,\n event,\n allDay,\n date,\n}: ColumnHasConflictOptions): boolean {\n if (!columns[columnIndex]) {\n return false;\n }\n\n return columns[columnIndex].some((e) => {\n const eAllDay = isAllDayEvent({ event: e, date });\n const hasTimeConflict = isEventsOverlap(e, event);\n\n // Don't count all-day events as overlaps\n if (allDay || eAllDay) {\n return false;\n }\n\n return hasTimeConflict;\n });\n}\n\ninterface GetDayPositionedEventsInput {\n /** Date at which events are positioned, used to check if events are all-day */\n date: AnyDateValue;\n\n /** List of all events that belong to the given date, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[];\n\n /** Start time of the day view, used to calculate event positions */\n startTime?: string;\n\n /** End time of the day view, used to calculate event positions */\n endTime?: string;\n\n /** Number of minutes per time slot, used to align the canvas to whole slots */\n intervalMinutes?: number;\n}\n\nexport function getDayPositionedEvents({\n events,\n startTime,\n endTime,\n intervalMinutes,\n date,\n}: GetDayPositionedEventsInput) {\n const columns: ScheduleEventData[][] = [];\n const positioned: DayPositionedEventData[] = [];\n\n const sorted = sortEvents(events);\n\n for (const event of sorted) {\n const allDay = isAllDayEvent({ event, date });\n\n let column = 0;\n\n while (columnHasConflict({ columns, columnIndex: column, event, allDay, date })) {\n column++;\n }\n\n if (!columns[column]) {\n columns[column] = [];\n }\n\n columns[column].push(event);\n\n const verticalPosition = allDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event, startTime, endTime, intervalMinutes });\n\n positioned.push({\n ...event,\n position: {\n ...verticalPosition,\n allDay,\n column,\n\n // set later\n width: 0,\n offset: 0,\n overlaps: 0,\n },\n });\n }\n for (const positionedEvent of positioned) {\n const { allDay, column } = positionedEvent.position;\n\n if (allDay) {\n positionedEvent.position.overlaps = 1;\n positionedEvent.position.width = 100;\n positionedEvent.position.offset = 0;\n continue;\n }\n\n // Find events that directly overlap with this event\n const directlyOverlapping: DayPositionedEventData[] = [];\n\n for (const otherEvent of positioned) {\n if (otherEvent === positionedEvent || otherEvent.position.allDay) {\n continue;\n }\n\n if (isEventsOverlap(otherEvent, positionedEvent)) {\n directlyOverlapping.push(otherEvent);\n }\n }\n\n // Find the max column by also checking overlaps of overlapping events\n // This ensures we account for the full column group\n let maxColumn = column;\n\n for (const overlappingEvent of directlyOverlapping) {\n maxColumn = Math.max(maxColumn, overlappingEvent.position.column);\n\n // Check what overlaps with each overlapping event\n for (const otherEvent of positioned) {\n if (otherEvent === overlappingEvent || otherEvent.position.allDay) {\n continue;\n }\n\n if (isEventsOverlap(otherEvent, overlappingEvent)) {\n maxColumn = Math.max(maxColumn, otherEvent.position.column);\n }\n }\n }\n\n const totalColumns = maxColumn + 1;\n\n // Find the first occupied column to the right of this event\n // Events expand to fill empty columns but stop at the next occupied column\n let nextOccupiedColumn = totalColumns;\n\n for (const other of directlyOverlapping) {\n if (other.position.column > column && other.position.column < nextOccupiedColumn) {\n nextOccupiedColumn = other.position.column;\n }\n }\n\n const columnsSpanned = nextOccupiedColumn - column;\n\n positionedEvent.position.overlaps = totalColumns;\n positionedEvent.position.width = (columnsSpanned / totalColumns) * 100;\n positionedEvent.position.offset = (column * 100) / totalColumns;\n }\n\n return positioned;\n}\n"],"mappings":";;;;;;AAWA,SAAS,kBAAkB,EACzB,SACA,aACA,OACA,QACA,QACoC;CACpC,IAAI,CAAC,QAAQ,cACX,OAAO;CAGT,OAAO,QAAQ,YAAY,CAAC,MAAM,MAAM;EACtC,MAAM,UAAUA,yBAAAA,cAAc;GAAE,OAAO;GAAG;EAAK,CAAC;EAChD,MAAM,kBAAkBC,0BAAAA,gBAAgB,GAAG,KAAK;EAGhD,IAAI,UAAU,SACZ,OAAO;EAGT,OAAO;CACT,CAAC;AACH;AAmBA,SAAgB,uBAAuB,EACrC,QACA,WACA,SACA,iBACA,QAC8B;CAC9B,MAAM,UAAiC,CAAC;CACxC,MAAM,aAAuC,CAAC;CAE9C,MAAM,SAASC,oBAAAA,WAAW,MAAM;CAEhC,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,SAASF,yBAAAA,cAAc;GAAE;GAAO;EAAK,CAAC;EAE5C,IAAI,SAAS;EAEb,OAAO,kBAAkB;GAAE;GAAS,aAAa;GAAQ;GAAO;GAAQ;EAAK,CAAC,GAC5E;EAGF,IAAI,CAAC,QAAQ,SACX,QAAQ,UAAU,CAAC;EAGrB,QAAQ,OAAO,CAAC,KAAK,KAAK;EAE1B,MAAM,mBAAmB,SACrB;GAAE,KAAK;GAAG,QAAQ;EAAI,IACtBG,yBAAAA,eAAe;GAAE;GAAO;GAAW;GAAS;EAAgB,CAAC;EAEjE,WAAW,KAAK;GACd,GAAG;GACH,UAAU;IACR,GAAG;IACH;IACA;IAGA,OAAO;IACP,QAAQ;IACR,UAAU;GACZ;EACF,CAAC;CACH;CACA,KAAK,MAAM,mBAAmB,YAAY;EACxC,MAAM,EAAE,QAAQ,WAAW,gBAAgB;EAE3C,IAAI,QAAQ;GACV,gBAAgB,SAAS,WAAW;GACpC,gBAAgB,SAAS,QAAQ;GACjC,gBAAgB,SAAS,SAAS;GAClC;EACF;EAGA,MAAM,sBAAgD,CAAC;EAEvD,KAAK,MAAM,cAAc,YAAY;GACnC,IAAI,eAAe,mBAAmB,WAAW,SAAS,QACxD;GAGF,IAAIF,0BAAAA,gBAAgB,YAAY,eAAe,GAC7C,oBAAoB,KAAK,UAAU;EAEvC;EAIA,IAAI,YAAY;EAEhB,KAAK,MAAM,oBAAoB,qBAAqB;GAClD,YAAY,KAAK,IAAI,WAAW,iBAAiB,SAAS,MAAM;GAGhE,KAAK,MAAM,cAAc,YAAY;IACnC,IAAI,eAAe,oBAAoB,WAAW,SAAS,QACzD;IAGF,IAAIA,0BAAAA,gBAAgB,YAAY,gBAAgB,GAC9C,YAAY,KAAK,IAAI,WAAW,WAAW,SAAS,MAAM;GAE9D;EACF;EAEA,MAAM,eAAe,YAAY;EAIjC,IAAI,qBAAqB;EAEzB,KAAK,MAAM,SAAS,qBAClB,IAAI,MAAM,SAAS,SAAS,UAAU,MAAM,SAAS,SAAS,oBAC5D,qBAAqB,MAAM,SAAS;EAIxC,MAAM,iBAAiB,qBAAqB;EAE5C,gBAAgB,SAAS,WAAW;EACpC,gBAAgB,SAAS,QAAS,iBAAiB,eAAgB;EACnE,gBAAgB,SAAS,SAAU,SAAS,MAAO;CACrD;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"get-day-positioned-events.cjs","names":["isAllDayEvent","isEventsOverlap","sortEvents","getDayPosition"],"sources":["../../../../src/components/DayView/get-day-view-events/get-day-positioned-events.ts"],"sourcesContent":["import {\n AnyDateValue,\n DayPositionedEventData,\n ScheduleEventData,\n ScheduleEventOverlapMode,\n} from '../../../types';\nimport {\n applyCascadeLayout,\n getDayPosition,\n isAllDayEvent,\n isEventsOverlap,\n sortEvents,\n} from '../../../utils';\n\ninterface ColumnHasConflictOptions {\n columns: ScheduleEventData[][];\n columnIndex: number;\n event: ScheduleEventData;\n allDay: boolean;\n date: AnyDateValue;\n}\n\nfunction columnHasConflict({\n columns,\n columnIndex,\n event,\n allDay,\n date,\n}: ColumnHasConflictOptions): boolean {\n if (!columns[columnIndex]) {\n return false;\n }\n\n return columns[columnIndex].some((e) => {\n const eAllDay = isAllDayEvent({ event: e, date });\n const hasTimeConflict = isEventsOverlap(e, event);\n\n // Don't count all-day events as overlaps\n if (allDay || eAllDay) {\n return false;\n }\n\n return hasTimeConflict;\n });\n}\n\ninterface GetDayPositionedEventsInput {\n /** Date at which events are positioned, used to check if events are all-day */\n date: AnyDateValue;\n\n /** List of all events that belong to the given date, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[];\n\n /** Start time of the day view, used to calculate event positions */\n startTime?: string;\n\n /** End time of the day view, used to calculate event positions */\n endTime?: string;\n\n /** Number of minutes per time slot, used to align the canvas to whole slots */\n intervalMinutes?: number;\n\n /** Determines how events that overlap in time are laid out @default 'columns' */\n eventOverlapMode?: ScheduleEventOverlapMode;\n}\n\nexport function getDayPositionedEvents({\n events,\n startTime,\n endTime,\n intervalMinutes,\n date,\n eventOverlapMode = 'columns',\n}: GetDayPositionedEventsInput) {\n const columns: ScheduleEventData[][] = [];\n const positioned: DayPositionedEventData[] = [];\n\n const sorted = sortEvents(events);\n\n for (const event of sorted) {\n const allDay = isAllDayEvent({ event, date });\n\n let column = 0;\n\n while (columnHasConflict({ columns, columnIndex: column, event, allDay, date })) {\n column++;\n }\n\n if (!columns[column]) {\n columns[column] = [];\n }\n\n columns[column].push(event);\n\n const verticalPosition = allDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event, startTime, endTime, intervalMinutes });\n\n positioned.push({\n ...event,\n position: {\n ...verticalPosition,\n allDay,\n column,\n\n // set later\n width: 0,\n offset: 0,\n overlaps: 0,\n },\n });\n }\n for (const positionedEvent of positioned) {\n if (positionedEvent.position.allDay) {\n positionedEvent.position.overlaps = 1;\n positionedEvent.position.width = 100;\n positionedEvent.position.offset = 0;\n }\n }\n\n if (eventOverlapMode === 'cascade') {\n applyCascadeLayout(positioned);\n return positioned;\n }\n\n for (const positionedEvent of positioned) {\n const { allDay, column } = positionedEvent.position;\n\n if (allDay) {\n continue;\n }\n\n // Find events that directly overlap with this event\n const directlyOverlapping: DayPositionedEventData[] = [];\n\n for (const otherEvent of positioned) {\n if (otherEvent === positionedEvent || otherEvent.position.allDay) {\n continue;\n }\n\n if (isEventsOverlap(otherEvent, positionedEvent)) {\n directlyOverlapping.push(otherEvent);\n }\n }\n\n // Find the max column by also checking overlaps of overlapping events\n // This ensures we account for the full column group\n let maxColumn = column;\n\n for (const overlappingEvent of directlyOverlapping) {\n maxColumn = Math.max(maxColumn, overlappingEvent.position.column);\n\n // Check what overlaps with each overlapping event\n for (const otherEvent of positioned) {\n if (otherEvent === overlappingEvent || otherEvent.position.allDay) {\n continue;\n }\n\n if (isEventsOverlap(otherEvent, overlappingEvent)) {\n maxColumn = Math.max(maxColumn, otherEvent.position.column);\n }\n }\n }\n\n const totalColumns = maxColumn + 1;\n\n // Find the first occupied column to the right of this event\n // Events expand to fill empty columns but stop at the next occupied column\n let nextOccupiedColumn = totalColumns;\n\n for (const other of directlyOverlapping) {\n if (other.position.column > column && other.position.column < nextOccupiedColumn) {\n nextOccupiedColumn = other.position.column;\n }\n }\n\n const columnsSpanned = nextOccupiedColumn - column;\n\n positionedEvent.position.overlaps = totalColumns;\n positionedEvent.position.width = (columnsSpanned / totalColumns) * 100;\n positionedEvent.position.offset = (column * 100) / totalColumns;\n }\n\n return positioned;\n}\n"],"mappings":";;;;;;;AAsBA,SAAS,kBAAkB,EACzB,SACA,aACA,OACA,QACA,QACoC;CACpC,IAAI,CAAC,QAAQ,cACX,OAAO;CAGT,OAAO,QAAQ,YAAY,CAAC,MAAM,MAAM;EACtC,MAAM,UAAUA,yBAAAA,cAAc;GAAE,OAAO;GAAG;EAAK,CAAC;EAChD,MAAM,kBAAkBC,0BAAAA,gBAAgB,GAAG,KAAK;EAGhD,IAAI,UAAU,SACZ,OAAO;EAGT,OAAO;CACT,CAAC;AACH;AAsBA,SAAgB,uBAAuB,EAC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MAAM;GAGhE,KAAK,MAAM,cAAc,YAAY;IACnC,IAAI,eAAe,oBAAoB,WAAW,SAAS,QACzD;IAGF,IAAIA,0BAAAA,gBAAgB,YAAY,gBAAgB,GAC9C,YAAY,KAAK,IAAI,WAAW,WAAW,SAAS,MAAM;GAE9D;EACF;EAEA,MAAM,eAAe,YAAY;EAIjC,IAAI,qBAAqB;EAEzB,KAAK,MAAM,SAAS,qBAClB,IAAI,MAAM,SAAS,SAAS,UAAU,MAAM,SAAS,SAAS,oBAC5D,qBAAqB,MAAM,SAAS;EAIxC,MAAM,iBAAiB,qBAAqB;EAE5C,gBAAgB,SAAS,WAAW;EACpC,gBAAgB,SAAS,QAAS,iBAAiB,eAAgB;EACnE,gBAAgB,SAAS,SAAU,SAAS,MAAO;CACrD;CAEA,OAAO;AACT"}
@@ -8,7 +8,7 @@ const require_get_day_positioned_events = require("./get-day-positioned-events.c
8
8
  let dayjs = require("dayjs");
9
9
  dayjs = require_runtime.__toESM(dayjs);
10
10
  //#region packages/@mantine/schedule/src/components/DayView/get-day-view-events/get-day-view-events.ts
11
- function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes }) {
11
+ function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes, eventOverlapMode }) {
12
12
  if (events === void 0) return {
13
13
  allDayEvents: [],
14
14
  regularEvents: [],
@@ -43,7 +43,8 @@ function getDayViewEvents({ events, date, startTime, endTime, intervalMinutes })
43
43
  startTime,
44
44
  endTime,
45
45
  intervalMinutes,
46
- date
46
+ date,
47
+ eventOverlapMode
47
48
  });
48
49
  const allDayEvents = [];
49
50
  const regularEvents = [];
@@ -1 +1 @@
1
- {"version":3,"file":"get-day-view-events.cjs","names":["isEventInTimeRange","validateEvent","getDayPositionedEvents","isAllDayEvent","getDayPosition"],"sources":["../../../../src/components/DayView/get-day-view-events/get-day-view-events.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { AnyDateValue, DayPositionedEventData, ScheduleEventData } from '../../../types';\nimport { getDayPosition, isAllDayEvent, isEventInTimeRange, validateEvent } from '../../../utils';\nimport { getDayPositionedEvents } from './get-day-positioned-events';\n\ninterface GetDayViewEventsInput {\n events: ScheduleEventData[] | undefined;\n date: AnyDateValue;\n startTime?: string;\n endTime?: string;\n intervalMinutes?: number;\n}\n\nexport function getDayViewEvents({\n events,\n date,\n startTime,\n endTime,\n intervalMinutes,\n}: GetDayViewEventsInput) {\n if (events === undefined) {\n return {\n allDayEvents: [],\n regularEvents: [],\n backgroundTimedEvents: [],\n backgroundAllDayEvents: [],\n };\n }\n\n const ids = new Set<string | number>();\n const filteredEvents: ScheduleEventData[] = [];\n const backgroundFiltered: ScheduleEventData[] = [];\n const dayStart = dayjs(date).startOf('day');\n const dayEnd = dayjs(date).endOf('day');\n\n for (const event of events) {\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const isOnDay = eventStart.isSame(dayStart, 'day');\n const spansIntoDay =\n !isOnDay &&\n event.display === 'background' &&\n eventStart.isBefore(dayEnd) &&\n eventEnd.isAfter(dayStart);\n\n if (isOnDay || spansIntoDay) {\n if (isOnDay && !isEventInTimeRange({ event, startTime, endTime })) {\n continue;\n }\n\n const validated = validateEvent(event);\n\n if (!ids.has(event.id)) {\n ids.add(event.id);\n } else {\n throw new Error(`[@mantine/schedule] DayView: Duplicated event ids found: ${event.id}`);\n }\n\n if (event.display === 'background') {\n backgroundFiltered.push(validated);\n } else {\n filteredEvents.push(validated);\n }\n }\n }\n\n const positionedEvents = getDayPositionedEvents({\n events: filteredEvents,\n startTime,\n endTime,\n intervalMinutes,\n date,\n });\n\n const allDayEvents: DayPositionedEventData[] = [];\n const regularEvents: DayPositionedEventData[] = [];\n\n for (const event of positionedEvents) {\n if (event.position.allDay) {\n allDayEvents.push(event);\n } else {\n regularEvents.push(event);\n }\n }\n\n const backgroundTimedEvents: DayPositionedEventData[] = [];\n const backgroundAllDayEvents: DayPositionedEventData[] = [];\n for (const event of backgroundFiltered) {\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart;\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd;\n\n const clippedEvent = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n };\n\n const allDay = isAllDayEvent({ event: clippedEvent, date });\n\n if (allDay) {\n backgroundAllDayEvents.push({\n ...event,\n position: {\n top: 0,\n height: 100,\n allDay: true,\n width: 100,\n offset: 0,\n column: 0,\n overlaps: 1,\n },\n });\n } else {\n const { top, height } = getDayPosition({\n event: clippedEvent,\n startTime,\n endTime,\n intervalMinutes,\n });\n if (height <= 0) {\n continue;\n }\n backgroundTimedEvents.push({\n ...event,\n position: { top, height, allDay: false, width: 100, offset: 0, column: 0, overlaps: 1 },\n });\n }\n }\n\n return { allDayEvents, regularEvents, backgroundTimedEvents, backgroundAllDayEvents };\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,iBAAiB,EAC/B,QACA,MACA,WACA,SACA,mBACwB;CACxB,IAAI,WAAW,KAAA,GACb,OAAO;EACL,cAAc,CAAC;EACf,eAAe,CAAC;EAChB,uBAAuB,CAAC;EACxB,wBAAwB,CAAC;CAC3B;CAGF,MAAM,sBAAM,IAAI,IAAqB;CACrC,MAAM,iBAAsC,CAAC;CAC7C,MAAM,qBAA0C,CAAC;CACjD,MAAM,YAAA,GAAW,MAAA,QAAA,CAAM,IAAI,CAAC,CAAC,QAAQ,KAAK;CAC1C,MAAM,UAAA,GAAS,MAAA,QAAA,CAAM,IAAI,CAAC,CAAC,MAAM,KAAK;CAEtC,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,cAAA,GAAa,MAAA,QAAA,CAAM,MAAM,KAAK;EACpC,MAAM,YAAA,GAAW,MAAA,QAAA,CAAM,MAAM,GAAG;EAChC,MAAM,UAAU,WAAW,OAAO,UAAU,KAAK;EACjD,MAAM,eACJ,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ACR,UAAU;GACZ;EACF,CAAC;OACI;GACL,MAAM,EAAE,KAAK,WAAWC,yBAAAA,eAAe;IACrC,OAAO;IACP;IACA;IACA;GACF,CAAC;GACD,IAAI,UAAU,GACZ;GAEF,sBAAsB,KAAK;IACzB,GAAG;IACH,UAAU;KAAE;KAAK;KAAQ,QAAQ;KAAO,OAAO;KAAK,QAAQ;KAAG,QAAQ;KAAG,UAAU;IAAE;GACxF,CAAC;EACH;CACF;CAEA,OAAO;EAAE;EAAc;EAAe;EAAuB;CAAuB;AACtF"}
1
+ {"version":3,"file":"get-day-view-events.cjs","names":["isEventInTimeRange","validateEvent","getDayPositionedEvents","isAllDayEvent","getDayPosition"],"sources":["../../../../src/components/DayView/get-day-view-events/get-day-view-events.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport {\n AnyDateValue,\n DayPositionedEventData,\n ScheduleEventData,\n ScheduleEventOverlapMode,\n} from '../../../types';\nimport { getDayPosition, isAllDayEvent, isEventInTimeRange, validateEvent } from '../../../utils';\nimport { getDayPositionedEvents } from './get-day-positioned-events';\n\ninterface GetDayViewEventsInput {\n events: ScheduleEventData[] | undefined;\n date: AnyDateValue;\n startTime?: string;\n endTime?: string;\n intervalMinutes?: number;\n eventOverlapMode?: ScheduleEventOverlapMode;\n}\n\nexport function getDayViewEvents({\n events,\n date,\n startTime,\n endTime,\n intervalMinutes,\n eventOverlapMode,\n}: GetDayViewEventsInput) {\n if (events === undefined) {\n return {\n allDayEvents: [],\n regularEvents: [],\n backgroundTimedEvents: [],\n backgroundAllDayEvents: [],\n };\n }\n\n const ids = new Set<string | number>();\n const filteredEvents: ScheduleEventData[] = [];\n const backgroundFiltered: ScheduleEventData[] = [];\n const dayStart = dayjs(date).startOf('day');\n const dayEnd = dayjs(date).endOf('day');\n\n for (const event of events) {\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const isOnDay = eventStart.isSame(dayStart, 'day');\n const spansIntoDay =\n !isOnDay &&\n event.display === 'background' &&\n eventStart.isBefore(dayEnd) &&\n eventEnd.isAfter(dayStart);\n\n if (isOnDay || spansIntoDay) {\n if (isOnDay && !isEventInTimeRange({ event, startTime, endTime })) {\n continue;\n }\n\n const validated = validateEvent(event);\n\n if (!ids.has(event.id)) {\n ids.add(event.id);\n } else {\n throw new Error(`[@mantine/schedule] DayView: Duplicated event ids found: ${event.id}`);\n }\n\n if (event.display === 'background') {\n backgroundFiltered.push(validated);\n } else {\n filteredEvents.push(validated);\n }\n }\n }\n\n const positionedEvents = getDayPositionedEvents({\n events: filteredEvents,\n startTime,\n endTime,\n intervalMinutes,\n date,\n eventOverlapMode,\n });\n\n const allDayEvents: DayPositionedEventData[] = [];\n const regularEvents: DayPositionedEventData[] = [];\n\n for (const event of positionedEvents) {\n if (event.position.allDay) {\n allDayEvents.push(event);\n } else {\n regularEvents.push(event);\n }\n }\n\n const backgroundTimedEvents: DayPositionedEventData[] = [];\n const backgroundAllDayEvents: DayPositionedEventData[] = [];\n for (const event of backgroundFiltered) {\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart;\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd;\n\n const clippedEvent = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n };\n\n const allDay = isAllDayEvent({ event: clippedEvent, date });\n\n if (allDay) {\n backgroundAllDayEvents.push({\n ...event,\n position: {\n top: 0,\n height: 100,\n allDay: true,\n width: 100,\n offset: 0,\n column: 0,\n overlaps: 1,\n },\n });\n } else {\n const { top, height } = getDayPosition({\n event: clippedEvent,\n startTime,\n endTime,\n intervalMinutes,\n });\n if (height <= 0) {\n continue;\n }\n backgroundTimedEvents.push({\n ...event,\n position: { top, height, allDay: false, width: 100, offset: 0, column: 0, overlaps: 1 },\n });\n }\n }\n\n return { allDayEvents, regularEvents, backgroundTimedEvents, backgroundA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AM,SAAS,kBAClB,IAAI,MAAM,SAAS,QACjB,aAAa,KAAK,KAAK;MAEvB,cAAc,KAAK,KAAK;CAI5B,MAAM,wBAAkD,CAAC;CACzD,MAAM,yBAAmD,CAAC;CAC1D,KAAK,MAAM,SAAS,oBAAoB;EACtC,MAAM,cAAA,GAAa,MAAA,QAAA,CAAM,MAAM,KAAK;EACpC,MAAM,YAAA,GAAW,MAAA,QAAA,CAAM,MAAM,GAAG;EAChC,MAAM,eAAe,WAAW,SAAS,QAAQ,IAAI,WAAW;EAChE,MAAM,aAAa,SAAS,QAAQ,MAAM,IAAI,SAAS;EAEvD,MAAM,eAAe;GACnB,GAAG;GACH,OAAO,aAAa,OAAO,qBAAqB;GAChD,KAAK,WAAW,OAAO,qBAAqB;EAC9C;EAIA,IAFeC,yBAAAA,cAAc;GAAE,OAAO;GAAc;EAAK,CAEhD,GACP,uBAAuB,KAAK;GAC1B,GAAG;GACH,UAAU;IACR,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,UAAU;GACZ;EACF,CAAC;OACI;GACL,MAAM,EAAE,KAAK,WAAWC,yBAAAA,eAAe;IACrC,OAAO;IACP;IACA;IACA;GACF,CAAC;GACD,IAAI,UAAU,GACZ;GAEF,sBAAsB,KAAK;IACzB,GAAG;IACH,UAAU;KAAE;KAAK;KAAQ,QAAQ;KAAO,OAAO;KAAK,QAAQ;KAAG,QAAQ;KAAG,UAAU;IAAE;GACxF,CAAC;EACH;CACF;CAEA,OAAO;EAAE;EAAc;EAAe;EAAuB;CAAuB;AACtF"}
@@ -16,6 +16,7 @@ const require_get_ordered_resources = require("../../utils/get-ordered-resources
16
16
  const require_handle_resources_grid_key_down = require("../../utils/handle-resources-grid-key-down/handle-resources-grid-key-down.cjs");
17
17
  const require_get_group_to_resource_id_map = require("../../utils/get-group-to-resource-id-map/get-group-to-resource-id-map.cjs");
18
18
  const require_get_index_from_drag_point = require("../../utils/get-index-from-drag-point/get-index-from-drag-point.cjs");
19
+ const require_get_overlap_clusters = require("../../utils/get-overlap-clusters/get-overlap-clusters.cjs");
19
20
  const require_use_drag_drop_handlers = require("../../hooks/use-drag-drop-handlers.cjs");
20
21
  const require_use_slot_drag_select = require("../../hooks/use-slot-drag-select.cjs");
21
22
  const require_DragContext = require("../DragContext/DragContext.cjs");
@@ -24,7 +25,6 @@ const require_MoreEvents = require("../MoreEvents/MoreEvents.cjs");
24
25
  const require_ScheduleBackgroundEvent = require("../ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs");
25
26
  const require_ScheduleHeaderBase = require("../ScheduleHeader/ScheduleHeaderBase.cjs");
26
27
  const require_use_horizontal_event_resize = require("../../hooks/use-horizontal-event-resize.cjs");
27
- const require_get_overlap_clusters = require("./get-overlap-clusters/get-overlap-clusters.cjs");
28
28
  const require_get_resources_day_view_events = require("./get-resources-day-view-events/get-resources-day-view-events.cjs");
29
29
  const require_ResourcesDayViewColumn = require("./ResourcesDayViewColumn.cjs");
30
30
  const require_ResourcesDayView_module = require("./ResourcesDayView.module.cjs");