@mantine/schedule 9.6.1 → 9.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/DayView/DayView.cjs +37 -16
- package/cjs/components/DayView/DayView.cjs.map +1 -1
- package/cjs/components/DayView/DayView.module.cjs +1 -0
- package/cjs/components/DayView/DayView.module.cjs.map +1 -1
- package/cjs/components/MobileMonthView/MobileMonthView.cjs +1 -1
- package/cjs/components/MobileMonthView/MobileMonthView.cjs.map +1 -1
- package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +39 -14
- package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
- package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs.map +1 -1
- package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs.map +1 -1
- package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +45 -15
- package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
- package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs.map +1 -1
- package/cjs/components/Schedule/Schedule.cjs.map +1 -1
- package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs +18 -3
- package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs.map +1 -1
- package/cjs/components/WeekView/WeekView.cjs +36 -13
- package/cjs/components/WeekView/WeekView.cjs.map +1 -1
- package/cjs/components/WeekView/WeekView.module.cjs +1 -0
- package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
- package/cjs/hooks/use-event-resize.cjs +7 -4
- package/cjs/hooks/use-event-resize.cjs.map +1 -1
- package/cjs/hooks/use-horizontal-event-resize.cjs +7 -4
- package/cjs/hooks/use-horizontal-event-resize.cjs.map +1 -1
- package/esm/components/DayView/DayView.mjs +37 -16
- package/esm/components/DayView/DayView.mjs.map +1 -1
- package/esm/components/DayView/DayView.module.mjs +1 -0
- package/esm/components/DayView/DayView.module.mjs.map +1 -1
- package/esm/components/MobileMonthView/MobileMonthView.mjs +1 -1
- package/esm/components/MobileMonthView/MobileMonthView.mjs.map +1 -1
- package/esm/components/ResourcesDayView/ResourcesDayView.mjs +39 -14
- package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
- package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs.map +1 -1
- package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs.map +1 -1
- package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +45 -15
- package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
- package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs.map +1 -1
- package/esm/components/Schedule/Schedule.mjs.map +1 -1
- package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs +19 -4
- package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs.map +1 -1
- package/esm/components/WeekView/WeekView.mjs +36 -13
- package/esm/components/WeekView/WeekView.mjs.map +1 -1
- package/esm/components/WeekView/WeekView.module.mjs +1 -0
- package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
- package/esm/hooks/use-event-resize.mjs +7 -4
- package/esm/hooks/use-event-resize.mjs.map +1 -1
- package/esm/hooks/use-horizontal-event-resize.mjs +7 -4
- package/esm/hooks/use-horizontal-event-resize.mjs.map +1 -1
- package/lib/components/DayView/DayView.d.ts +2 -2
- package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +1 -1
- package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +1 -1
- package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +1 -1
- package/lib/components/Schedule/Schedule.d.ts +1 -1
- package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.d.ts +15 -2
- package/lib/components/WeekView/WeekView.d.ts +2 -2
- package/lib/hooks/use-event-resize.d.ts +3 -2
- package/lib/hooks/use-horizontal-event-resize.d.ts +3 -2
- package/package.json +4 -4
- package/styles.css +254 -6
- package/styles.layer.css +254 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesWeekView.mjs","names":["classes"],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n rem,\n ScrollArea,\n ScrollAreaProps,\n StylesApiProps,\n useDirection,\n useMantineTheme,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useInterval, useIsomorphicEffect, useMergedRef, useMounted } from '@mantine/hooks';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n AnyDateValue,\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n formatDate,\n getBusinessHoursMod,\n getDayPosition,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n getOverlapClusters,\n getTimeAxisEventStyle,\n getWeekDays,\n handleResourcesGridKeyDown,\n isAllDayEvent,\n isInTimeRange,\n nextWeek,\n previousWeek,\n ResourcesGridControlsRef,\n toDateString,\n} from '../../utils';\nimport { DragContext, DragContextValue } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getWeekLabel } from '../WeekView/get-week-label/get-week-label';\nimport { getResourcesWeekViewEvents } from './get-resources-week-view-events/get-resources-week-view-events';\nimport { ResourcesWeekViewRow } from './ResourcesWeekViewRow';\nimport classes from './ResourcesWeekView.module.css';\n\nexport type ResourcesWeekViewStylesNames =\n | 'resourcesWeekView'\n | 'resourcesWeekViewRoot'\n | 'resourcesWeekViewInner'\n | 'resourcesWeekViewHeaderRows'\n | 'resourcesWeekViewHeaderContent'\n | 'resourcesWeekViewDayLabelsRow'\n | 'resourcesWeekViewDayLabel'\n | 'resourcesWeekViewTimeLabelsRow'\n | 'resourcesWeekViewScrollArea'\n | 'resourcesWeekViewCorner'\n | 'resourcesWeekViewTimeLabel'\n | 'resourcesWeekViewResourceLabel'\n | 'resourcesWeekViewRow'\n | 'resourcesWeekViewRowSlot'\n | 'resourcesWeekViewRowSlots'\n | 'resourcesWeekViewBackgroundEvent'\n | 'resourcesWeekViewAllDayEvent'\n | 'resourcesWeekViewCurrentTimeIndicator'\n | 'resourcesWeekViewCurrentTimeIndicatorLine'\n | 'resourcesWeekViewCurrentTimeIndicatorThumb'\n | 'resourcesWeekViewCurrentTimeIndicatorTimeBubble'\n | 'resourcesWeekViewEventWrapper'\n | 'resourcesWeekViewDragPreview'\n | 'resourcesWeekViewResizeHandle'\n | 'resourcesWeekViewGroupColumn'\n | 'resourcesWeekViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesWeekViewCssVariables = {\n resourcesWeekView:\n | '--resources-week-view-radius'\n | '--resources-week-view-slot-width'\n | '--resources-week-view-row-height'\n | '--resources-week-view-group-label-width';\n};\n\nexport interface ResourcesWeekViewProps\n extends BoxProps, StylesApiProps<ResourcesWeekViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n date: Date | string;\n onDateChange?: (value: DateStringValue) => void;\n resources: ScheduleResourceData[];\n startTime?: string;\n endTime?: string;\n /** Number of minutes for each interval in the week view. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours (e.g. `120`, `240`) @default 60 */\n intervalMinutes?: number;\n /** Minimum on-screen size of an event along the time axis, in px. Prevents very short events from collapsing. Larger values make brief events easier to see but extend them past their real start time. @default 1 */\n minEventSize?: number;\n slotLabelFormat?: DateLabelFormat;\n radius?: MantineRadius;\n /** Date and time to scroll to on initial render, in `YYYY-MM-DD HH:mm:ss` format */\n startScrollDateTime?: string;\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n locale?: string;\n withCurrentTimeIndicator?: boolean;\n withCurrentTimeBubble?: boolean;\n\n /** A function to get the current time, called on every tick. Can be used to display the current time indicator in a different timezone. @default () => dayjs() */\n getCurrentTime?: () => AnyDateValue;\n\n withHeader?: boolean;\n onViewChange?: (view: ScheduleViewLevel) => void;\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n weekLabelFormat?: DateLabelFormat;\n renderWeekLabel?: (params: {\n weekStart: DateStringValue;\n weekEnd: DateStringValue;\n }) => React.ReactNode;\n events?: ScheduleEventData[];\n slotWidth?: React.CSSProperties['width'];\n rowHeight?: React.CSSProperties['height'];\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n renderEventBody?: RenderEventBody;\n renderEvent?: RenderEvent;\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** List of resource groups to display as a column to the left of resource labels */\n groups?: ScheduleResourceGroup[];\n\n /** Function to customize group label rendering */\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n\n /** Width of the group label column @default 80px */\n groupLabelWidth?: React.CSSProperties['width'];\n\n withEventsDragAndDrop?: boolean;\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n canDragEvent?: (event: ScheduleEventData) => boolean;\n /** Snap step for moving events by drag and drop, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventDragInterval?: number;\n onEventDragStart?: (event: ScheduleEventData) => void;\n onEventDragEnd?: () => void;\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick` @default false */\n withInteractiveBackgroundEvents?: boolean;\n withDragSlotSelect?: boolean;\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n mode?: ScheduleMode;\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** If true, events can be resized by dragging their left/right edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for resizing events, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventResizeInterval?: number;\n\n recurrenceExpansionLimit?: number;\n\n /** Maximum number of events visible per time slot before \"+more\" indicator shows, minimum value is 1 @default 2 */\n maxEventsPerTimeSlot?: number;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n firstDayOfWeek?: DayOfWeek;\n weekendDays?: DayOfWeek[];\n withWeekendDays?: boolean;\n weekdayFormat?: DateLabelFormat;\n highlightToday?: boolean;\n}\n\nexport type ResourcesWeekViewFactory = Factory<{\n props: ResourcesWeekViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesWeekViewStylesNames;\n vars: ResourcesWeekViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'ResourcesWeekView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n slotLabelFormat: 'HH:mm',\n intervalMinutes: 60,\n minEventSize: 1,\n withHeader: true,\n weekLabelFormat: 'MMM DD',\n weekdayFormat: 'ddd D',\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withEventResize: false,\n withDragSlotSelect: false,\n withWeekendDays: true,\n withCurrentTimeBubble: true,\n highlightToday: true,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n withInteractiveBackgroundEvents: false,\n} satisfies Partial<ResourcesWeekViewProps>;\n\nconst varsResolver = createVarsResolver<ResourcesWeekViewFactory>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesWeekView: {\n '--resources-week-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-week-view-slot-width': rem(slotWidth),\n '--resources-week-view-row-height': rem(rowHeight),\n '--resources-week-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nexport const ResourcesWeekView = factory<ResourcesWeekViewFactory>((_props) => {\n const props = useProps('ResourcesWeekView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n startTime,\n endTime,\n date,\n onDateChange,\n resources,\n intervalMinutes,\n minEventSize,\n slotLabelFormat,\n radius,\n startScrollDateTime,\n scrollAreaProps,\n locale,\n withCurrentTimeIndicator: _withCurrentTimeIndicator,\n withCurrentTimeBubble,\n getCurrentTime,\n __staticSelector,\n withHeader,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n weekLabelFormat,\n renderWeekLabel,\n events,\n slotWidth,\n rowHeight,\n labels,\n highlightBusinessHours,\n businessHours,\n renderEventBody,\n renderEvent,\n renderResourceLabel,\n groups,\n renderGroupLabel,\n groupLabelWidth,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n eventDragInterval,\n onEventDragStart,\n onEventDragEnd,\n withEventResize,\n onEventResize,\n canResizeEvent,\n eventResizeInterval,\n onTimeSlotClick,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n firstDayOfWeek,\n weekendDays,\n withWeekendDays,\n weekdayFormat,\n highlightToday,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot =\n _maxEventsPerTimeSlot !== undefined ? Math.max(1, _maxEventsPerTimeSlot) : undefined;\n\n const getStyles = useStyles<ResourcesWeekViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n attributes,\n rootSelector: 'resourcesWeekView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesWeekViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const theme = useMantineTheme();\n const { dir } = useDirection();\n const [scrolled, setScrolled] = useState(false);\n const [scrolledX, setScrolledX] = useState(false);\n const ctx = useDatesContext();\n const slots = getDayTimeIntervals({ startTime, endTime, intervalMinutes });\n const { orderedResources, groupRanges, resourceGroupMap } = useMemo(\n () => getOrderedResources(resources, groups),\n [resources, groups]\n );\n const hasGroups = groupRanges.length > 0;\n\n const weekdays = useMemo(\n () =>\n getWeekDays({\n week: date,\n withWeekendDays,\n weekendDays: ctx.getWeekendDays(weekendDays),\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n }),\n [date, withWeekendDays, weekendDays, firstDayOfWeek, ctx]\n );\n\n const totalSlotsPerDay = slots.length;\n\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const now = resolveNow();\n const isToday = weekdays.some((day) => dayjs(day).isSame(now, 'day'));\n const withCurrentTimeIndicator = _withCurrentTimeIndicator ?? isToday;\n\n const mounted = useMounted();\n const [, setTimeIndicatorTick] = useState(0);\n useInterval(() => setTimeIndicatorTick((tick) => tick + 1), 60000, { autoInvoke: true });\n const timeIndicatorOffset = getCurrentTimePosition({ startTime, endTime, intervalMinutes, now });\n\n const todayDayIndex = weekdays.findIndex((day) => dayjs(day).isSame(now, 'day'));\n const showTimeIndicator =\n mounted &&\n withCurrentTimeIndicator &&\n todayDayIndex >= 0 &&\n isInTimeRange({ date: now.toDate(), startTime, endTime });\n const formattedCurrentTime = withCurrentTimeBubble\n ? formatDate({ locale: ctx.getLocale(locale), date: now, format: slotLabelFormat })\n : '';\n\n type DropTargetSlot = { resourceId: string | number; slotIndex: number };\n\n const dragOffsetRef = useRef<{ offset: number; size: number }>({ offset: 0, size: 0 });\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetSlot) => {\n if (!onExternalEventDrop) {\n return;\n }\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotDay = weekdays[dayIndex];\n if (slotDay) {\n const slotDate = dayjs(slotDay).format('YYYY-MM-DD');\n const slotTime = slots[slotInDay].startTime;\n let dropDateTime: string = `${slotDate} ${slotTime}`;\n\n if (eventDragInterval != null) {\n const { start } = calculateDropTime({\n draggedEvent: { start: dropDateTime, end: dropDateTime } as ScheduleEventData,\n targetDate: slotDate,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: dragOffsetRef.current.offset,\n slotSize: dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n dropDateTime = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n }\n\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime,\n resourceId: target.resourceId,\n });\n }\n },\n [\n onExternalEventDrop,\n slots,\n weekdays,\n totalSlotsPerDay,\n eventDragInterval,\n intervalMinutes,\n startTime,\n endTime,\n ]\n );\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const getDropTimeForSlot = (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotTime = slots[slotInDay].startTime;\n const targetDay = weekdays[dayIndex] || weekdays[0];\n return calculateDropTime({\n draggedEvent,\n targetDate: targetDay,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: eventDragInterval == null ? undefined : dragOffsetRef.current.offset,\n slotSize: eventDragInterval == null ? undefined : dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n };\n\n const handleInternalEventDrop = useCallback(\n (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n [onEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetSlot>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: handleInternalEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n return getDropTimeForSlot(target, draggedEvent);\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const updateDragPreview = (target: DropTargetSlot) => {\n const draggedEvent = dragDrop.dragContextValue.draggedEvent;\n if (eventDragInterval == null || !draggedEvent) {\n return;\n }\n const { start, end } = getDropTimeForSlot(target, draggedEvent);\n const newStart = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n if (\n dragDrop.dragPreview?.start !== newStart ||\n dragDrop.dragPreview?.target.resourceId !== target.resourceId\n ) {\n dragDrop.setDragPreview({\n start: newStart,\n end: dayjs(end).format('YYYY-MM-DD HH:mm:ss'),\n target,\n });\n }\n };\n\n const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;\n\n const groupToResourceId = useMemo(() => getGroupToResourceIdMap(resources), [resources]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex, group) => {\n if (!onSlotDragEnd) {\n return;\n }\n const startDayIndex = Math.floor(startIndex / totalSlotsPerDay);\n const startSlotInDay = startIndex % totalSlotsPerDay;\n const endDayIndex = Math.floor(endIndex / totalSlotsPerDay);\n const endSlotInDay = endIndex % totalSlotsPerDay;\n const startDay = weekdays[startDayIndex];\n const endDay = weekdays[endDayIndex];\n if (startDay && endDay) {\n onSlotDragEnd({\n rangeStart: `${dayjs(startDay).format('YYYY-MM-DD')} ${slots[startSlotInDay].startTime}`,\n rangeEnd: `${dayjs(endDay).format('YYYY-MM-DD')} ${slots[endSlotInDay].endTime}`,\n resourceId: groupToResourceId.get(group) ?? group,\n });\n }\n },\n });\n\n const eventResize = useHorizontalEventResize({\n enabled: withEventResize,\n mode,\n startTime,\n endTime,\n intervalMinutes,\n resizeIntervalMinutes: eventResizeInterval,\n onEventResize,\n canResizeEvent,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const handleTimeSlotClick = (\n resourceId: string | number,\n day: string,\n slotTime: string,\n e: React.MouseEvent<HTMLButtonElement>\n ) => {\n if (!onTimeSlotClick) {\n return;\n }\n const slotIndex = slots.findIndex((s) => s.startTime === slotTime);\n if (slotIndex === -1) {\n return;\n }\n const slot = slots[slotIndex];\n const dayStr = dayjs(day).format('YYYY-MM-DD');\n onTimeSlotClick({\n slotStart: `${dayStr} ${slot.startTime}`,\n slotEnd: `${dayStr} ${slot.endTime}`,\n nativeEvent: e,\n resourceId,\n });\n };\n\n const weekViewEvents = useMemo(\n () =>\n getResourcesWeekViewEvents({\n events,\n resources,\n weekdays,\n startTime,\n endTime,\n intervalMinutes,\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, resources, weekdays, startTime, endTime, intervalMinutes, recurrenceExpansionLimit]\n );\n\n const dayLabels = weekdays.map((day) => {\n const d = dayjs(day);\n const today = d.isSame(now, 'day') && highlightToday;\n const weekend = ctx.getWeekendDays(weekendDays).includes(d.day() as DayOfWeek);\n\n return (\n <Box\n {...getStyles('resourcesWeekViewDayLabel')}\n key={day}\n mod={{ today, weekend }}\n style={{ width: `calc(var(--resources-week-view-slot-width) * ${totalSlotsPerDay})` }}\n >\n {formatDate({ date: d, locale: ctx.getLocale(locale), format: weekdayFormat })}\n </Box>\n );\n });\n\n const timeLabels = weekdays.flatMap((day) =>\n slots.map((interval) => {\n const dayStr = dayjs(day).format('YYYY-MM-DD');\n const intervalTime = dayjs(`${dayStr} ${interval.startTime}`);\n const label = formatDate({\n date: intervalTime,\n locale: ctx.getLocale(locale),\n format: slotLabelFormat,\n });\n\n return (\n <Box\n {...getStyles('resourcesWeekViewTimeLabel')}\n key={`${day}-${interval.startTime}`}\n mod={{\n 'hour-start': interval.isHourStart,\n ...getBusinessHoursMod({\n time: interval.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n }}\n >\n {label}\n </Box>\n );\n })\n );\n\n const slotsRef: ResourcesGridControlsRef = useRef<HTMLButtonElement[][]>([]);\n const rowSlotsContainersRef = useRef<(HTMLDivElement | null)[]>([]);\n const viewportRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n\n const firstSlotIndex = { resourceIndex: 0, slotIndex: 0 };\n\n useIsomorphicEffect(() => {\n if (!startScrollDateTime || !viewportRef.current) {\n return;\n }\n const parsed = dayjs(startScrollDateTime);\n const targetDayStr = parsed.format('YYYY-MM-DD 00:00:00');\n const targetTime = parsed.format('HH:mm:ss');\n const dayIndex = weekdays.indexOf(targetDayStr);\n if (dayIndex < 0) {\n return;\n }\n const slotInDay = slots.findIndex((s) => s.startTime >= targetTime);\n if (slotInDay < 0) {\n return;\n }\n const flatIndex = dayIndex * totalSlotsPerDay + slotInDay;\n const firstResourceSlots = slotsRef.current[0];\n if (!firstResourceSlots || firstResourceSlots.length === 0) {\n return;\n }\n const targetSlot = firstResourceSlots[flatIndex];\n if (!targetSlot) {\n return;\n }\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const cornerEl = viewportRef.current.querySelector(`.${classes.resourcesWeekViewCorner}`);\n const labelWidth = cornerEl ? cornerEl.getBoundingClientRect().width : 0;\n viewportRef.current.scrollTo({\n left: slotRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n }, []);\n\n const getSlotIndexFromDragPoint = useCallback(\n (event: React.DragEvent, resourceIndex: number) => {\n const daySlots = slotsRef.current[resourceIndex] ?? [];\n const index = getIndexFromDragPoint(daySlots, event.clientX);\n if (index !== null) {\n const rect = daySlots[index]?.getBoundingClientRect();\n if (rect) {\n const rawOffset = dir === 'rtl' ? rect.right - event.clientX : event.clientX - rect.left;\n dragOffsetRef.current = {\n offset: Math.max(0, Math.min(rect.width, rawOffset)),\n size: rect.width,\n };\n }\n }\n return index;\n },\n [dir]\n );\n\n const handleSlotKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => {\n handleResourcesGridKeyDown({\n controlsRef: slotsRef,\n resourceIndex,\n slotIndex,\n event,\n });\n };\n\n const dayWidthPercent = 100 / weekdays.length;\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n const eventNodes: React.ReactNode[] = [];\n const resourceAllDayBars = weekViewEvents.allDayBars[resource.id] ?? [];\n const maxAllDayCount = resourceAllDayBars.reduce((max, bar) => Math.max(max, bar.row + 1), 0);\n\n weekdays.forEach((day, dayIndex) => {\n const dayEvents = weekViewEvents.byDay[day];\n if (!dayEvents) {\n return;\n }\n\n const dayOffsetPercent = (dayIndex / weekdays.length) * 100;\n\n const bgEvents = [\n ...(dayEvents.backgroundTimedEvents[resource.id] || []),\n ...(dayEvents.backgroundAllDayEvents[resource.id] || []),\n ];\n for (const event of bgEvents) {\n eventNodes.push(\n <ScheduleBackgroundEvent\n key={`bg-${event.id}-${day}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={onEventClick}\n {...getStyles('resourcesWeekViewBackgroundEvent', {\n style: {\n left: `${dayOffsetPercent + (event.position.top / 100) * dayWidthPercent}%`,\n width: `${(event.position.height / 100) * dayWidthPercent}%`,\n top: 0,\n height: '100%',\n },\n })}\n />\n );\n }\n\n const allRegularEvents = (dayEvents.regularEvents[resource.id] || []).filter(\n (event) => !isAllDayEvent({ event, date: day })\n );\n\n const visibleEvents =\n maxEventsPerTimeSlot !== undefined\n ? allRegularEvents.filter((event) => event.position.column < maxEventsPerTimeSlot)\n : allRegularEvents;\n\n for (const event of visibleEvents) {\n const isDraggable = dragDrop.isDraggableEvent(event);\n const isResizable = eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const isThisEventResizing = resizePosition !== null;\n const activeEdge =\n isThisEventResizing && eventResize.resizingEdge ? eventResize.resizingEdge : null;\n\n const effectiveTop = resizePosition ? resizePosition.left : event.position.top;\n const effectiveHeight = resizePosition ? resizePosition.width : event.position.height;\n const eventLeft = dayOffsetPercent + (effectiveTop / 100) * dayWidthPercent;\n const eventWidth = (effectiveHeight / 100) * dayWidthPercent;\n\n const eventColors = isResizable\n ? theme.variantColorResolver({\n color: event.color || theme.primaryColor,\n theme,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n : null;\n\n const adjustPosition =\n maxEventsPerTimeSlot !== undefined && event.position.overlaps > maxEventsPerTimeSlot;\n\n const eventDate = dayjs(day).format('YYYY-MM-DD');\n\n eventNodes.push(\n <Box\n key={`${event.id}-${day}`}\n {...getStyles('resourcesWeekViewEventWrapper')}\n __vars={eventColors ? { '--event-color': eventColors.color } : undefined}\n data-resizing={isThisEventResizing || undefined}\n style={{\n ...getTimeAxisEventStyle({\n start: eventLeft,\n span: eventWidth,\n minSize: minEventSize,\n }),\n top: adjustPosition\n ? `calc((100% - 22px) * ${event.position.column} / ${maxEventsPerTimeSlot})`\n : `${event.position.offset}%`,\n height: adjustPosition\n ? `calc((100% - 22px) / ${maxEventsPerTimeSlot})`\n : `${event.position.width}%`,\n }}\n >\n <ScheduleEvent\n event={event}\n autoSize\n nowrap\n draggable={isDraggable}\n isResizing={isThisEventResizing}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n style={{ width: '100%', height: '100%', padding: 0 }}\n />\n {isResizable && mode !== 'static' && (\n <>\n <div\n {...getStyles('resourcesWeekViewResizeHandle')}\n data-edge=\"start\"\n data-active={activeEdge === 'start' || undefined}\n onPointerDown={(e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge: 'start',\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }}\n />\n <div\n {...getStyles('resourcesWeekViewResizeHandle')}\n data-edge=\"end\"\n data-active={activeEdge === 'end' || undefined}\n onPointerDown={(e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge: 'end',\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }}\n />\n </>\n )}\n </Box>\n );\n }\n\n if (maxEventsPerTimeSlot !== undefined) {\n const clusters = getOverlapClusters(allRegularEvents);\n for (const cluster of clusters) {\n const hiddenCount = cluster.filter(\n (e) => e.position.column >= maxEventsPerTimeSlot\n ).length;\n\n if (hiddenCount > 0 && mode !== 'static') {\n const leftPercent =\n dayOffsetPercent +\n (Math.min(...cluster.map((e) => e.position.top)) / 100) * dayWidthPercent;\n const rightPercent =\n dayOffsetPercent +\n (Math.max(...cluster.map((e) => e.position.top + e.position.height)) / 100) *\n dayWidthPercent;\n\n eventNodes.push(\n <MoreEvents\n key={`more-${resource.id}-${day}-${cluster[0].id}`}\n events={cluster}\n moreEventsCount={hiddenCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n left: `calc(${leftPercent}% + 1px)`,\n width: `calc(${rightPercent - leftPercent}% - 2px)`,\n bottom: 0,\n height: '22px',\n paddingInline: 4,\n zIndex: 4,\n }}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n );\n }\n }\n }\n });\n\n const stickyLabelOffset = hasGroups\n ? 'calc(var(--resources-week-view-group-label-width) + var(--resources-week-view-resource-label-width) + 5px)'\n : 'calc(var(--resources-week-view-resource-label-width) + 5px)';\n\n resourceAllDayBars.forEach((bar) => {\n const leftPercent = bar.startDayIndex * dayWidthPercent;\n const widthPercent = (bar.endDayIndex - bar.startDayIndex + 1) * dayWidthPercent;\n\n eventNodes.push(\n <div\n key={`all-day-${bar.event.id}-${bar.startDayIndex}`}\n {...getStyles('resourcesWeekViewAllDayEvent', {\n style: {\n left: `calc(${leftPercent}% + 1px)`,\n width: `calc(${widthPercent}% - 2px)`,\n top: `calc(${bar.row} * (var(--resources-week-view-all-day-height) + 2px) + 2px)`,\n },\n })}\n >\n <ScheduleEvent\n event={bar.event}\n autoSize\n nowrap\n renderEventBody={(barEvent) => (\n <span\n style={{\n position: 'sticky',\n insetInlineStart: stickyLabelOffset,\n display: 'inline-block',\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {renderEventBody ? renderEventBody(barEvent) : barEvent.title}\n </span>\n )}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(bar.event, e) : undefined}\n style={{ width: '100%', height: '100%', overflow: 'visible' }}\n styles={{\n eventInner: {\n display: 'block',\n overflow: 'visible',\n lineHeight: 'var(--resources-week-view-all-day-height)',\n },\n }}\n />\n </div>\n );\n });\n\n return (\n <ResourcesWeekViewRow\n key={resource.id}\n resource={resource}\n resourceIndex={resourceIndex}\n weekdays={weekdays}\n slots={slots}\n getStyles={getStyles}\n labels={labels}\n highlightBusinessHours={highlightBusinessHours}\n businessHours={businessHours}\n withEventsDragAndDrop={withDragHandlers}\n mode={mode}\n slotsRef={slotsRef}\n firstSlotIndex={firstSlotIndex}\n onSlotKeyDown={handleSlotKeyDown}\n onSlotClick={handleTimeSlotClick}\n onRowSlotsDragOver={(event, resourceId, resIdx) => {\n const slotIndex = getSlotIndexFromDragPoint(event, resIdx);\n if (slotIndex !== null) {\n dragDrop.handleDragOver(event, { resourceId, slotIndex });\n updateDragPreview({ resourceId, slotIndex });\n }\n }}\n onRowSlotsDragLeave={dragDrop.handleDragLeave}\n onRowSlotsDrop={(event, resourceId, resIdx) => {\n const slotIndex = getSlotIndexFromDragPoint(event, resIdx);\n if (slotIndex !== null) {\n dragDrop.handleDrop(event, { resourceId, slotIndex });\n }\n }}\n dropTargetSlotIndex={\n !suppressDropHighlight && dragDrop.dropTarget?.resourceId === resource.id\n ? dragDrop.dropTarget.slotIndex\n : undefined\n }\n withDragSlotSelect={withDragSlotSelect}\n onSlotPointerDown={slotDragSelect.handleSlotPointerDown}\n isSlotDragSelected={slotDragSelect.isSlotSelected}\n rowSlotsContainerRef={(node) => {\n rowSlotsContainersRef.current[resourceIndex] = node;\n }}\n renderResourceLabel={renderResourceLabel}\n renderGroupLabel={renderGroupLabel}\n scrolledX={scrolledX}\n groupInfo={hasGroups ? resourceGroupMap[resourceIndex] : undefined}\n allDayCount={maxAllDayCount}\n >\n {eventNodes}\n {dragDrop.dragPreview?.target.resourceId === resource.id &&\n dragDrop.dragContextValue.draggedEvent && (\n <Box\n {...getStyles('resourcesWeekViewDragPreview', {\n style: (() => {\n const previewDayIndex = Math.floor(\n dragDrop.dragPreview.target.slotIndex / totalSlotsPerDay\n );\n const { top, height } = getDayPosition({\n event: {\n ...dragDrop.dragContextValue.draggedEvent,\n start: dragDrop.dragPreview.start,\n end: dragDrop.dragPreview.end,\n },\n startTime,\n endTime,\n intervalMinutes,\n });\n const dayOffsetPercent = (previewDayIndex / weekdays.length) * 100;\n const eventLeft = dayOffsetPercent + (top / 100) * dayWidthPercent;\n const eventWidth = (height / 100) * dayWidthPercent;\n return {\n position: 'absolute',\n insetBlockStart: 0,\n insetBlockEnd: 0,\n ...getTimeAxisEventStyle({\n start: eventLeft,\n span: eventWidth,\n axis: 'horizontal',\n }),\n };\n })(),\n })}\n />\n )}\n </ResourcesWeekViewRow>\n );\n });\n\n const headerLabel = getWeekLabel({\n weekdays,\n locale: ctx.getLocale(locale),\n weekLabelFormat: weekLabelFormat!,\n renderWeekLabel,\n });\n\n const indicatorLeftPercent =\n todayDayIndex >= 0 ? ((todayDayIndex + timeIndicatorOffset / 100) / weekdays.length) * 100 : 0;\n\n const content = (\n <Box\n {...getStyles('resourcesWeekView')}\n mod={{\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n resizing: eventResize.isResizing,\n 'event-interaction': eventResize.isResizing || dragDrop.dragContextValue.isDragging,\n }}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"week\"\n navigationHandlers={{\n previous: () => previousWeek(date, ctx.getFirstDayOfWeek(firstDayOfWeek)),\n next: () => nextWeek(date, ctx.getFirstDayOfWeek(firstDayOfWeek)),\n today: () => toDateString(resolveNow()),\n }}\n control={{\n miw: 180,\n title: headerLabel,\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={{ views: ['day', 'week', 'month'] as const, ...viewSelectProps }}\n stylesApiProps={stylesApiProps}\n />\n )}\n\n <Box {...getStyles('resourcesWeekViewRoot')}>\n <ScrollArea\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesWeekViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n onScrollPositionChange={(position) => {\n scrollAreaProps?.onScrollPositionChange?.(position);\n setScrolled(position.y !== 0);\n setScrolledX(position.x !== 0);\n }}\n viewportRef={mergedViewportRef}\n >\n <div {...getStyles('resourcesWeekViewInner')}>\n <div {...getStyles('resourcesWeekViewHeaderRows')}>\n <div\n {...getStyles('resourcesWeekViewCorner')}\n key=\"corner\"\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n <div {...getStyles('resourcesWeekViewHeaderContent')}>\n <div {...getStyles('resourcesWeekViewDayLabelsRow')}>{dayLabels}</div>\n <Box {...getStyles('resourcesWeekViewTimeLabelsRow')} mod={{ scrolled }}>\n {timeLabels}\n </Box>\n </div>\n </div>\n\n {rows}\n\n {showTimeIndicator && (\n <Box\n {...getStyles('resourcesWeekViewCurrentTimeIndicator')}\n __vars={{\n '--indicator-left-offset': hasGroups\n ? `calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width) + (100% - var(--resources-week-view-resource-label-width) - var(--resources-week-view-group-label-width)) * ${indicatorLeftPercent} / 100)`\n : `calc(var(--resources-week-view-resource-label-width) + (100% - var(--resources-week-view-resource-label-width)) * ${indicatorLeftPercent} / 100)`,\n '--_time-bubble-width': formattedCurrentTime\n ?.toString()\n .toLowerCase()\n .includes('m')\n ? '64px'\n : '46px',\n }}\n >\n {withCurrentTimeBubble && (\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorTimeBubble')}>\n {formattedCurrentTime}\n </div>\n )}\n {!withCurrentTimeBubble && (\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorThumb')} />\n )}\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorLine')} />\n </Box>\n )}\n </div>\n </ScrollArea>\n </Box>\n </Box>\n );\n\n const dragContextValue = useMemo<DragContextValue>(\n () => dragDrop.dragContextValue,\n [dragDrop.dragContextValue]\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nResourcesWeekView.displayName = '@mantine/schedule/ResourcesWeekView';\nResourcesWeekView.classes = classes;\nResourcesWeekView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+OA,MAAM,eAAe;CACnB,kBAAkB;CAClB,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,iBAAiB;CACjB,cAAc;CACd,YAAY;CACZ,iBAAiB;CACjB,eAAe;CACf,wBAAwB;CACxB,eAAe,CAAC,YAAY,UAAU;CACtC,uBAAuB;CACvB,iBAAiB;CACjB,oBAAoB;CACpB,iBAAiB;CACjB,uBAAuB;CACvB,gBAAgB;CAChB,MAAM;CACN,sBAAsB;CACtB,iCAAiC;AACnC;AAEA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,WAAW,WAAW,uBAAuB,EAC9D,mBAAmB;CACjB,gCAAgC,SAAS,UAAU,MAAM,IAAI,KAAA;CAC7D,oCAAoC,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B,CAC5B;CAEA,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO;EAAmB,UAAA;CAA8B,CAAA;CAGvF,OAAO;AACT,CAAC;AAED,kBAAkB,cAAc;AAChC,kBAAkB,UAAUA;AAC5B,kBAAkB,eAAe"}
|
|
1
|
+
{"version":3,"file":"ResourcesWeekView.mjs","names":["classes"],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n rem,\n ScrollArea,\n ScrollAreaProps,\n StylesApiProps,\n useDirection,\n useMantineTheme,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useInterval, useIsomorphicEffect, useMergedRef, useMounted } from '@mantine/hooks';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n AnyDateValue,\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n DayPositionedEventData,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateDropTime,\n formatDate,\n getBusinessHoursMod,\n getDayPosition,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n getOverlapClusters,\n getTimeAxisEventStyle,\n getWeekDays,\n handleResourcesGridKeyDown,\n isAllDayEvent,\n isInTimeRange,\n nextWeek,\n previousWeek,\n ResourcesGridControlsRef,\n toDateString,\n} from '../../utils';\nimport { DragContext, DragContextValue } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport { getWeekLabel } from '../WeekView/get-week-label/get-week-label';\nimport { getResourcesWeekViewEvents } from './get-resources-week-view-events/get-resources-week-view-events';\nimport { ResourcesWeekViewRow } from './ResourcesWeekViewRow';\nimport classes from './ResourcesWeekView.module.css';\n\nexport type ResourcesWeekViewStylesNames =\n | 'resourcesWeekView'\n | 'resourcesWeekViewRoot'\n | 'resourcesWeekViewInner'\n | 'resourcesWeekViewHeaderRows'\n | 'resourcesWeekViewHeaderContent'\n | 'resourcesWeekViewDayLabelsRow'\n | 'resourcesWeekViewDayLabel'\n | 'resourcesWeekViewTimeLabelsRow'\n | 'resourcesWeekViewScrollArea'\n | 'resourcesWeekViewCorner'\n | 'resourcesWeekViewTimeLabel'\n | 'resourcesWeekViewResourceLabel'\n | 'resourcesWeekViewRow'\n | 'resourcesWeekViewRowSlot'\n | 'resourcesWeekViewRowSlots'\n | 'resourcesWeekViewBackgroundEvent'\n | 'resourcesWeekViewAllDayEvent'\n | 'resourcesWeekViewCurrentTimeIndicator'\n | 'resourcesWeekViewCurrentTimeIndicatorLine'\n | 'resourcesWeekViewCurrentTimeIndicatorThumb'\n | 'resourcesWeekViewCurrentTimeIndicatorTimeBubble'\n | 'resourcesWeekViewEventWrapper'\n | 'resourcesWeekViewDragPreview'\n | 'resourcesWeekViewResizeHandle'\n | 'resourcesWeekViewGroupColumn'\n | 'resourcesWeekViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesWeekViewCssVariables = {\n resourcesWeekView:\n | '--resources-week-view-radius'\n | '--resources-week-view-slot-width'\n | '--resources-week-view-row-height'\n | '--resources-week-view-group-label-width';\n};\n\nexport interface ResourcesWeekViewProps\n extends BoxProps, StylesApiProps<ResourcesWeekViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n date: Date | string;\n onDateChange?: (value: DateStringValue) => void;\n resources: ScheduleResourceData[];\n startTime?: string;\n endTime?: string;\n /** Number of minutes for each interval in the week view. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours (e.g. `120`, `240`) @default 60 */\n intervalMinutes?: number;\n /** Minimum on-screen size of an event along the time axis, in px. Prevents very short events from collapsing. Larger values make brief events easier to see but extend them past their real start time. @default 1 */\n minEventSize?: number;\n slotLabelFormat?: DateLabelFormat;\n radius?: MantineRadius;\n /** Date and time to scroll to on initial render, in `YYYY-MM-DD HH:mm:ss` format */\n startScrollDateTime?: string;\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n locale?: string;\n withCurrentTimeIndicator?: boolean;\n withCurrentTimeBubble?: boolean;\n\n /** A function to get the current time, called on every tick. Can be used to display the current time indicator in a different timezone. @default () => dayjs() */\n getCurrentTime?: () => AnyDateValue;\n\n withHeader?: boolean;\n onViewChange?: (view: ScheduleViewLevel) => void;\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n weekLabelFormat?: DateLabelFormat;\n renderWeekLabel?: (params: {\n weekStart: DateStringValue;\n weekEnd: DateStringValue;\n }) => React.ReactNode;\n events?: ScheduleEventData[];\n slotWidth?: React.CSSProperties['width'];\n rowHeight?: React.CSSProperties['height'];\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n renderEventBody?: RenderEventBody;\n renderEvent?: RenderEvent;\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** List of resource groups to display as a column to the left of resource labels */\n groups?: ScheduleResourceGroup[];\n\n /** Function to customize group label rendering */\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n\n /** Width of the group label column @default 80px */\n groupLabelWidth?: React.CSSProperties['width'];\n\n withEventsDragAndDrop?: boolean;\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n canDragEvent?: (event: ScheduleEventData) => boolean;\n /** Snap step for moving events by drag and drop, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventDragInterval?: number;\n onEventDragStart?: (event: ScheduleEventData) => void;\n onEventDragEnd?: () => void;\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick`. Combined with `withEventResize`, timed background events can also be resized by dragging their edges. @default false */\n withInteractiveBackgroundEvents?: boolean;\n withDragSlotSelect?: boolean;\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n mode?: ScheduleMode;\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** If true, events can be resized by dragging their left/right edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Snap step for resizing events, in minutes. Must divide evenly into an hour (e.g. `15`, `30`) or be a whole number of hours. When not set, `intervalMinutes` is used. @default intervalMinutes */\n eventResizeInterval?: number;\n\n recurrenceExpansionLimit?: number;\n\n /** Maximum number of events visible per time slot before \"+more\" indicator shows, minimum value is 1 @default 2 */\n maxEventsPerTimeSlot?: number;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n firstDayOfWeek?: DayOfWeek;\n weekendDays?: DayOfWeek[];\n withWeekendDays?: boolean;\n weekdayFormat?: DateLabelFormat;\n highlightToday?: boolean;\n}\n\nexport type ResourcesWeekViewFactory = Factory<{\n props: ResourcesWeekViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesWeekViewStylesNames;\n vars: ResourcesWeekViewCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'ResourcesWeekView',\n startTime: '00:00:00',\n endTime: '23:59:59',\n slotLabelFormat: 'HH:mm',\n intervalMinutes: 60,\n minEventSize: 1,\n withHeader: true,\n weekLabelFormat: 'MMM DD',\n weekdayFormat: 'ddd D',\n highlightBusinessHours: false,\n businessHours: ['09:00:00', '17:00:00'],\n withEventsDragAndDrop: false,\n withEventResize: false,\n withDragSlotSelect: false,\n withWeekendDays: true,\n withCurrentTimeBubble: true,\n highlightToday: true,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n withInteractiveBackgroundEvents: false,\n} satisfies Partial<ResourcesWeekViewProps>;\n\nconst varsResolver = createVarsResolver<ResourcesWeekViewFactory>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesWeekView: {\n '--resources-week-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-week-view-slot-width': rem(slotWidth),\n '--resources-week-view-row-height': rem(rowHeight),\n '--resources-week-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nexport const ResourcesWeekView = factory<ResourcesWeekViewFactory>((_props) => {\n const props = useProps('ResourcesWeekView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n startTime,\n endTime,\n date,\n onDateChange,\n resources,\n intervalMinutes,\n minEventSize,\n slotLabelFormat,\n radius,\n startScrollDateTime,\n scrollAreaProps,\n locale,\n withCurrentTimeIndicator: _withCurrentTimeIndicator,\n withCurrentTimeBubble,\n getCurrentTime,\n __staticSelector,\n withHeader,\n onViewChange,\n previousControlProps,\n nextControlProps,\n todayControlProps,\n viewSelectProps,\n weekLabelFormat,\n renderWeekLabel,\n events,\n slotWidth,\n rowHeight,\n labels,\n highlightBusinessHours,\n businessHours,\n renderEventBody,\n renderEvent,\n renderResourceLabel,\n groups,\n renderGroupLabel,\n groupLabelWidth,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n eventDragInterval,\n onEventDragStart,\n onEventDragEnd,\n withEventResize,\n onEventResize,\n canResizeEvent,\n eventResizeInterval,\n onTimeSlotClick,\n onEventClick,\n withInteractiveBackgroundEvents,\n withDragSlotSelect,\n onSlotDragEnd,\n mode,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n firstDayOfWeek,\n weekendDays,\n withWeekendDays,\n weekdayFormat,\n highlightToday,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot =\n _maxEventsPerTimeSlot !== undefined ? Math.max(1, _maxEventsPerTimeSlot) : undefined;\n\n const getStyles = useStyles<ResourcesWeekViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n attributes,\n rootSelector: 'resourcesWeekView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesWeekViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const theme = useMantineTheme();\n const { dir } = useDirection();\n const [scrolled, setScrolled] = useState(false);\n const [scrolledX, setScrolledX] = useState(false);\n const ctx = useDatesContext();\n const slots = getDayTimeIntervals({ startTime, endTime, intervalMinutes });\n const { orderedResources, groupRanges, resourceGroupMap } = useMemo(\n () => getOrderedResources(resources, groups),\n [resources, groups]\n );\n const hasGroups = groupRanges.length > 0;\n\n const weekdays = useMemo(\n () =>\n getWeekDays({\n week: date,\n withWeekendDays,\n weekendDays: ctx.getWeekendDays(weekendDays),\n firstDayOfWeek: ctx.getFirstDayOfWeek(firstDayOfWeek),\n }),\n [date, withWeekendDays, weekendDays, firstDayOfWeek, ctx]\n );\n\n const totalSlotsPerDay = slots.length;\n\n const resolveNow = () => (getCurrentTime ? dayjs(getCurrentTime()) : dayjs());\n const now = resolveNow();\n const isToday = weekdays.some((day) => dayjs(day).isSame(now, 'day'));\n const withCurrentTimeIndicator = _withCurrentTimeIndicator ?? isToday;\n\n const mounted = useMounted();\n const [, setTimeIndicatorTick] = useState(0);\n useInterval(() => setTimeIndicatorTick((tick) => tick + 1), 60000, { autoInvoke: true });\n const timeIndicatorOffset = getCurrentTimePosition({ startTime, endTime, intervalMinutes, now });\n\n const todayDayIndex = weekdays.findIndex((day) => dayjs(day).isSame(now, 'day'));\n const showTimeIndicator =\n mounted &&\n withCurrentTimeIndicator &&\n todayDayIndex >= 0 &&\n isInTimeRange({ date: now.toDate(), startTime, endTime });\n const formattedCurrentTime = withCurrentTimeBubble\n ? formatDate({ locale: ctx.getLocale(locale), date: now, format: slotLabelFormat })\n : '';\n\n type DropTargetSlot = { resourceId: string | number; slotIndex: number };\n\n const dragOffsetRef = useRef<{ offset: number; size: number }>({ offset: 0, size: 0 });\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetSlot) => {\n if (!onExternalEventDrop) {\n return;\n }\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotDay = weekdays[dayIndex];\n if (slotDay) {\n const slotDate = dayjs(slotDay).format('YYYY-MM-DD');\n const slotTime = slots[slotInDay].startTime;\n let dropDateTime: string = `${slotDate} ${slotTime}`;\n\n if (eventDragInterval != null) {\n const { start } = calculateDropTime({\n draggedEvent: { start: dropDateTime, end: dropDateTime } as ScheduleEventData,\n targetDate: slotDate,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: dragOffsetRef.current.offset,\n slotSize: dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n dropDateTime = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n }\n\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime,\n resourceId: target.resourceId,\n });\n }\n },\n [\n onExternalEventDrop,\n slots,\n weekdays,\n totalSlotsPerDay,\n eventDragInterval,\n intervalMinutes,\n startTime,\n endTime,\n ]\n );\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const getDropTimeForSlot = (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n const dayIndex = Math.floor(target.slotIndex / totalSlotsPerDay);\n const slotInDay = target.slotIndex % totalSlotsPerDay;\n const slotTime = slots[slotInDay].startTime;\n const targetDay = weekdays[dayIndex] || weekdays[0];\n return calculateDropTime({\n draggedEvent,\n targetDate: targetDay,\n targetSlotTime: slotTime,\n intervalMinutes,\n dragIntervalMinutes: eventDragInterval,\n slotOffset: eventDragInterval == null ? undefined : dragOffsetRef.current.offset,\n slotSize: eventDragInterval == null ? undefined : dragOffsetRef.current.size,\n startTime,\n endTime,\n });\n };\n\n const handleInternalEventDrop = useCallback(\n (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n [onEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetSlot>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: handleInternalEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetSlot, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n return getDropTimeForSlot(target, draggedEvent);\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const updateDragPreview = (target: DropTargetSlot) => {\n const draggedEvent = dragDrop.dragContextValue.draggedEvent;\n if (eventDragInterval == null || !draggedEvent) {\n return;\n }\n const { start, end } = getDropTimeForSlot(target, draggedEvent);\n const newStart = dayjs(start).format('YYYY-MM-DD HH:mm:ss');\n if (\n dragDrop.dragPreview?.start !== newStart ||\n dragDrop.dragPreview?.target.resourceId !== target.resourceId\n ) {\n dragDrop.setDragPreview({\n start: newStart,\n end: dayjs(end).format('YYYY-MM-DD HH:mm:ss'),\n target,\n });\n }\n };\n\n const suppressDropHighlight = eventDragInterval != null && dragDrop.dragContextValue.isDragging;\n\n const groupToResourceId = useMemo(() => getGroupToResourceIdMap(resources), [resources]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex, group) => {\n if (!onSlotDragEnd) {\n return;\n }\n const startDayIndex = Math.floor(startIndex / totalSlotsPerDay);\n const startSlotInDay = startIndex % totalSlotsPerDay;\n const endDayIndex = Math.floor(endIndex / totalSlotsPerDay);\n const endSlotInDay = endIndex % totalSlotsPerDay;\n const startDay = weekdays[startDayIndex];\n const endDay = weekdays[endDayIndex];\n if (startDay && endDay) {\n onSlotDragEnd({\n rangeStart: `${dayjs(startDay).format('YYYY-MM-DD')} ${slots[startSlotInDay].startTime}`,\n rangeEnd: `${dayjs(endDay).format('YYYY-MM-DD')} ${slots[endSlotInDay].endTime}`,\n resourceId: groupToResourceId.get(group) ?? group,\n });\n }\n },\n });\n\n const eventResize = useHorizontalEventResize({\n enabled: withEventResize,\n mode,\n startTime,\n endTime,\n intervalMinutes,\n resizeIntervalMinutes: eventResizeInterval,\n onEventResize,\n canResizeEvent,\n withBackgroundEvents: withInteractiveBackgroundEvents,\n });\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const handleTimeSlotClick = (\n resourceId: string | number,\n day: string,\n slotTime: string,\n e: React.MouseEvent<HTMLButtonElement>\n ) => {\n if (!onTimeSlotClick) {\n return;\n }\n const slotIndex = slots.findIndex((s) => s.startTime === slotTime);\n if (slotIndex === -1) {\n return;\n }\n const slot = slots[slotIndex];\n const dayStr = dayjs(day).format('YYYY-MM-DD');\n onTimeSlotClick({\n slotStart: `${dayStr} ${slot.startTime}`,\n slotEnd: `${dayStr} ${slot.endTime}`,\n nativeEvent: e,\n resourceId,\n });\n };\n\n const weekViewEvents = useMemo(\n () =>\n getResourcesWeekViewEvents({\n events,\n resources,\n weekdays,\n startTime,\n endTime,\n intervalMinutes,\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, resources, weekdays, startTime, endTime, intervalMinutes, recurrenceExpansionLimit]\n );\n\n const dayLabels = weekdays.map((day) => {\n const d = dayjs(day);\n const today = d.isSame(now, 'day') && highlightToday;\n const weekend = ctx.getWeekendDays(weekendDays).includes(d.day() as DayOfWeek);\n\n return (\n <Box\n {...getStyles('resourcesWeekViewDayLabel')}\n key={day}\n mod={{ today, weekend }}\n style={{ width: `calc(var(--resources-week-view-slot-width) * ${totalSlotsPerDay})` }}\n >\n {formatDate({ date: d, locale: ctx.getLocale(locale), format: weekdayFormat })}\n </Box>\n );\n });\n\n const timeLabels = weekdays.flatMap((day) =>\n slots.map((interval) => {\n const dayStr = dayjs(day).format('YYYY-MM-DD');\n const intervalTime = dayjs(`${dayStr} ${interval.startTime}`);\n const label = formatDate({\n date: intervalTime,\n locale: ctx.getLocale(locale),\n format: slotLabelFormat,\n });\n\n return (\n <Box\n {...getStyles('resourcesWeekViewTimeLabel')}\n key={`${day}-${interval.startTime}`}\n mod={{\n 'hour-start': interval.isHourStart,\n ...getBusinessHoursMod({\n time: interval.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n }}\n >\n {label}\n </Box>\n );\n })\n );\n\n const slotsRef: ResourcesGridControlsRef = useRef<HTMLButtonElement[][]>([]);\n const rowSlotsContainersRef = useRef<(HTMLDivElement | null)[]>([]);\n const viewportRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n\n const firstSlotIndex = { resourceIndex: 0, slotIndex: 0 };\n\n useIsomorphicEffect(() => {\n if (!startScrollDateTime || !viewportRef.current) {\n return;\n }\n const parsed = dayjs(startScrollDateTime);\n const targetDayStr = parsed.format('YYYY-MM-DD 00:00:00');\n const targetTime = parsed.format('HH:mm:ss');\n const dayIndex = weekdays.indexOf(targetDayStr);\n if (dayIndex < 0) {\n return;\n }\n const slotInDay = slots.findIndex((s) => s.startTime >= targetTime);\n if (slotInDay < 0) {\n return;\n }\n const flatIndex = dayIndex * totalSlotsPerDay + slotInDay;\n const firstResourceSlots = slotsRef.current[0];\n if (!firstResourceSlots || firstResourceSlots.length === 0) {\n return;\n }\n const targetSlot = firstResourceSlots[flatIndex];\n if (!targetSlot) {\n return;\n }\n const slotRect = targetSlot.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const cornerEl = viewportRef.current.querySelector(`.${classes.resourcesWeekViewCorner}`);\n const labelWidth = cornerEl ? cornerEl.getBoundingClientRect().width : 0;\n viewportRef.current.scrollTo({\n left: slotRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n }, []);\n\n const getSlotIndexFromDragPoint = useCallback(\n (event: React.DragEvent, resourceIndex: number) => {\n const daySlots = slotsRef.current[resourceIndex] ?? [];\n const index = getIndexFromDragPoint(daySlots, event.clientX);\n if (index !== null) {\n const rect = daySlots[index]?.getBoundingClientRect();\n if (rect) {\n const rawOffset = dir === 'rtl' ? rect.right - event.clientX : event.clientX - rect.left;\n dragOffsetRef.current = {\n offset: Math.max(0, Math.min(rect.width, rawOffset)),\n size: rect.width,\n };\n }\n }\n return index;\n },\n [dir]\n );\n\n const handleSlotKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => {\n handleResourcesGridKeyDown({\n controlsRef: slotsRef,\n resourceIndex,\n slotIndex,\n event,\n });\n };\n\n const dayWidthPercent = 100 / weekdays.length;\n\n const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== 'static';\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n const eventNodes: React.ReactNode[] = [];\n const resourceAllDayBars = weekViewEvents.allDayBars[resource.id] ?? [];\n const maxAllDayCount = resourceAllDayBars.reduce((max, bar) => Math.max(max, bar.row + 1), 0);\n\n weekdays.forEach((day, dayIndex) => {\n const dayEvents = weekViewEvents.byDay[day];\n if (!dayEvents) {\n return;\n }\n\n const dayOffsetPercent = (dayIndex / weekdays.length) * 100;\n\n const pushBackgroundEvent = (event: DayPositionedEventData, allDay: boolean) => {\n const backgroundEventDate = dayjs(day).format('YYYY-MM-DD');\n const isResizable = !allDay && eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id, backgroundEventDate);\n const effectiveLeft = resizePosition ? resizePosition.left : event.position.top;\n const effectiveWidth = resizePosition ? resizePosition.width : event.position.height;\n\n eventNodes.push(\n <ScheduleBackgroundEvent<'start' | 'end'>\n key={`bg-${event.id}-${day}`}\n event={event}\n renderEvent={renderEvent}\n renderEventBody={renderEventBody}\n interactive={interactiveBackgroundEvents}\n onEventClick={\n onEventClick\n ? (clickedEvent, e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(clickedEvent, e);\n }\n }\n : undefined\n }\n withResize={isResizable}\n isResizing={resizePosition !== null}\n activeResizeEdge={eventResize.resizingEdge}\n resizeAxis=\"horizontal\"\n resizeHandleProps={getStyles('resourcesWeekViewResizeHandle')}\n onResizeStart={\n isResizable\n ? (edge, e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: backgroundEventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }\n : undefined\n }\n {...getStyles('resourcesWeekViewBackgroundEvent', {\n style: {\n left: `${dayOffsetPercent + (effectiveLeft / 100) * dayWidthPercent}%`,\n width: `${(effectiveWidth / 100) * dayWidthPercent}%`,\n top: 0,\n height: '100%',\n },\n })}\n />\n );\n };\n\n for (const event of dayEvents.backgroundTimedEvents[resource.id] || []) {\n pushBackgroundEvent(event, false);\n }\n\n for (const event of dayEvents.backgroundAllDayEvents[resource.id] || []) {\n pushBackgroundEvent(event, true);\n }\n\n const allRegularEvents = (dayEvents.regularEvents[resource.id] || []).filter(\n (event) => !isAllDayEvent({ event, date: day })\n );\n\n const visibleEvents =\n maxEventsPerTimeSlot !== undefined\n ? allRegularEvents.filter((event) => event.position.column < maxEventsPerTimeSlot)\n : allRegularEvents;\n\n for (const event of visibleEvents) {\n const isDraggable = dragDrop.isDraggableEvent(event);\n const isResizable = eventResize.isResizableEvent(event);\n const resizePosition = eventResize.getResizePosition(event.id);\n const isThisEventResizing = resizePosition !== null;\n const activeEdge =\n isThisEventResizing && eventResize.resizingEdge ? eventResize.resizingEdge : null;\n\n const effectiveTop = resizePosition ? resizePosition.left : event.position.top;\n const effectiveHeight = resizePosition ? resizePosition.width : event.position.height;\n const eventLeft = dayOffsetPercent + (effectiveTop / 100) * dayWidthPercent;\n const eventWidth = (effectiveHeight / 100) * dayWidthPercent;\n\n const eventColors = isResizable\n ? theme.variantColorResolver({\n color: event.color || theme.primaryColor,\n theme,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n : null;\n\n const adjustPosition =\n maxEventsPerTimeSlot !== undefined && event.position.overlaps > maxEventsPerTimeSlot;\n\n const eventDate = dayjs(day).format('YYYY-MM-DD');\n\n eventNodes.push(\n <Box\n key={`${event.id}-${day}`}\n {...getStyles('resourcesWeekViewEventWrapper')}\n __vars={eventColors ? { '--event-color': eventColors.color } : undefined}\n data-resizing={isThisEventResizing || undefined}\n style={{\n ...getTimeAxisEventStyle({\n start: eventLeft,\n span: eventWidth,\n minSize: minEventSize,\n }),\n top: adjustPosition\n ? `calc((100% - 22px) * ${event.position.column} / ${maxEventsPerTimeSlot})`\n : `${event.position.offset}%`,\n height: adjustPosition\n ? `calc((100% - 22px) / ${maxEventsPerTimeSlot})`\n : `${event.position.width}%`,\n }}\n >\n <ScheduleEvent\n event={event}\n autoSize\n nowrap\n draggable={isDraggable}\n isResizing={isThisEventResizing}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n style={{ width: '100%', height: '100%', padding: 0 }}\n />\n {isResizable && mode !== 'static' && (\n <>\n <div\n {...getStyles('resourcesWeekViewResizeHandle')}\n data-edge=\"start\"\n data-active={activeEdge === 'start' || undefined}\n onPointerDown={(e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge: 'start',\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }}\n />\n <div\n {...getStyles('resourcesWeekViewResizeHandle')}\n data-edge=\"end\"\n data-active={activeEdge === 'end' || undefined}\n onPointerDown={(e) => {\n const container = rowSlotsContainersRef.current[resourceIndex];\n if (container) {\n eventResize.handleResizeStart({\n event,\n edge: 'end',\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate,\n dayIndex,\n dayCount: weekdays.length,\n pointerEvent: e,\n });\n }\n }}\n />\n </>\n )}\n </Box>\n );\n }\n\n if (maxEventsPerTimeSlot !== undefined) {\n const clusters = getOverlapClusters(allRegularEvents);\n for (const cluster of clusters) {\n const hiddenCount = cluster.filter(\n (e) => e.position.column >= maxEventsPerTimeSlot\n ).length;\n\n if (hiddenCount > 0 && mode !== 'static') {\n const leftPercent =\n dayOffsetPercent +\n (Math.min(...cluster.map((e) => e.position.top)) / 100) * dayWidthPercent;\n const rightPercent =\n dayOffsetPercent +\n (Math.max(...cluster.map((e) => e.position.top + e.position.height)) / 100) *\n dayWidthPercent;\n\n eventNodes.push(\n <MoreEvents\n key={`more-${resource.id}-${day}-${cluster[0].id}`}\n events={cluster}\n moreEventsCount={hiddenCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n left: `calc(${leftPercent}% + 1px)`,\n width: `calc(${rightPercent - leftPercent}% - 2px)`,\n bottom: 0,\n height: '22px',\n paddingInline: 4,\n zIndex: 4,\n }}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n );\n }\n }\n }\n });\n\n const stickyLabelOffset = hasGroups\n ? 'calc(var(--resources-week-view-group-label-width) + var(--resources-week-view-resource-label-width) + 5px)'\n : 'calc(var(--resources-week-view-resource-label-width) + 5px)';\n\n resourceAllDayBars.forEach((bar) => {\n const leftPercent = bar.startDayIndex * dayWidthPercent;\n const widthPercent = (bar.endDayIndex - bar.startDayIndex + 1) * dayWidthPercent;\n\n eventNodes.push(\n <div\n key={`all-day-${bar.event.id}-${bar.startDayIndex}`}\n {...getStyles('resourcesWeekViewAllDayEvent', {\n style: {\n left: `calc(${leftPercent}% + 1px)`,\n width: `calc(${widthPercent}% - 2px)`,\n top: `calc(${bar.row} * (var(--resources-week-view-all-day-height) + 2px) + 2px)`,\n },\n })}\n >\n <ScheduleEvent\n event={bar.event}\n autoSize\n nowrap\n renderEventBody={(barEvent) => (\n <span\n style={{\n position: 'sticky',\n insetInlineStart: stickyLabelOffset,\n display: 'inline-block',\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {renderEventBody ? renderEventBody(barEvent) : barEvent.title}\n </span>\n )}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={onEventClick ? (e) => onEventClick(bar.event, e) : undefined}\n style={{ width: '100%', height: '100%', overflow: 'visible' }}\n styles={{\n eventInner: {\n display: 'block',\n overflow: 'visible',\n lineHeight: 'var(--resources-week-view-all-day-height)',\n },\n }}\n />\n </div>\n );\n });\n\n return (\n <ResourcesWeekViewRow\n key={resource.id}\n resource={resource}\n resourceIndex={resourceIndex}\n weekdays={weekdays}\n slots={slots}\n getStyles={getStyles}\n labels={labels}\n highlightBusinessHours={highlightBusinessHours}\n businessHours={businessHours}\n withEventsDragAndDrop={withDragHandlers}\n mode={mode}\n slotsRef={slotsRef}\n firstSlotIndex={firstSlotIndex}\n onSlotKeyDown={handleSlotKeyDown}\n onSlotClick={handleTimeSlotClick}\n onRowSlotsDragOver={(event, resourceId, resIdx) => {\n const slotIndex = getSlotIndexFromDragPoint(event, resIdx);\n if (slotIndex !== null) {\n dragDrop.handleDragOver(event, { resourceId, slotIndex });\n updateDragPreview({ resourceId, slotIndex });\n }\n }}\n onRowSlotsDragLeave={dragDrop.handleDragLeave}\n onRowSlotsDrop={(event, resourceId, resIdx) => {\n const slotIndex = getSlotIndexFromDragPoint(event, resIdx);\n if (slotIndex !== null) {\n dragDrop.handleDrop(event, { resourceId, slotIndex });\n }\n }}\n dropTargetSlotIndex={\n !suppressDropHighlight && dragDrop.dropTarget?.resourceId === resource.id\n ? dragDrop.dropTarget.slotIndex\n : undefined\n }\n withDragSlotSelect={withDragSlotSelect}\n onSlotPointerDown={slotDragSelect.handleSlotPointerDown}\n isSlotDragSelected={slotDragSelect.isSlotSelected}\n rowSlotsContainerRef={(node) => {\n rowSlotsContainersRef.current[resourceIndex] = node;\n }}\n renderResourceLabel={renderResourceLabel}\n renderGroupLabel={renderGroupLabel}\n scrolledX={scrolledX}\n groupInfo={hasGroups ? resourceGroupMap[resourceIndex] : undefined}\n allDayCount={maxAllDayCount}\n >\n {eventNodes}\n {dragDrop.dragPreview?.target.resourceId === resource.id &&\n dragDrop.dragContextValue.draggedEvent && (\n <Box\n {...getStyles('resourcesWeekViewDragPreview', {\n style: (() => {\n const previewDayIndex = Math.floor(\n dragDrop.dragPreview.target.slotIndex / totalSlotsPerDay\n );\n const { top, height } = getDayPosition({\n event: {\n ...dragDrop.dragContextValue.draggedEvent,\n start: dragDrop.dragPreview.start,\n end: dragDrop.dragPreview.end,\n },\n startTime,\n endTime,\n intervalMinutes,\n });\n const dayOffsetPercent = (previewDayIndex / weekdays.length) * 100;\n const eventLeft = dayOffsetPercent + (top / 100) * dayWidthPercent;\n const eventWidth = (height / 100) * dayWidthPercent;\n return {\n position: 'absolute',\n insetBlockStart: 0,\n insetBlockEnd: 0,\n ...getTimeAxisEventStyle({\n start: eventLeft,\n span: eventWidth,\n axis: 'horizontal',\n }),\n };\n })(),\n })}\n />\n )}\n </ResourcesWeekViewRow>\n );\n });\n\n const headerLabel = getWeekLabel({\n weekdays,\n locale: ctx.getLocale(locale),\n weekLabelFormat: weekLabelFormat!,\n renderWeekLabel,\n });\n\n const indicatorLeftPercent =\n todayDayIndex >= 0 ? ((todayDayIndex + timeIndicatorOffset / 100) / weekdays.length) * 100 : 0;\n\n const content = (\n <Box\n {...getStyles('resourcesWeekView')}\n mod={{\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n resizing: eventResize.isResizing,\n 'event-interaction': eventResize.isResizing || dragDrop.dragContextValue.isDragging,\n }}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"week\"\n navigationHandlers={{\n previous: () => previousWeek(date, ctx.getFirstDayOfWeek(firstDayOfWeek)),\n next: () => nextWeek(date, ctx.getFirstDayOfWeek(firstDayOfWeek)),\n today: () => toDateString(resolveNow()),\n }}\n control={{\n miw: 180,\n title: headerLabel,\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={{ views: ['day', 'week', 'month'] as const, ...viewSelectProps }}\n stylesApiProps={stylesApiProps}\n />\n )}\n\n <Box {...getStyles('resourcesWeekViewRoot')}>\n <ScrollArea\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesWeekViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n onScrollPositionChange={(position) => {\n scrollAreaProps?.onScrollPositionChange?.(position);\n setScrolled(position.y !== 0);\n setScrolledX(position.x !== 0);\n }}\n viewportRef={mergedViewportRef}\n >\n <div {...getStyles('resourcesWeekViewInner')}>\n <div {...getStyles('resourcesWeekViewHeaderRows')}>\n <div\n {...getStyles('resourcesWeekViewCorner')}\n key=\"corner\"\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n <div {...getStyles('resourcesWeekViewHeaderContent')}>\n <div {...getStyles('resourcesWeekViewDayLabelsRow')}>{dayLabels}</div>\n <Box {...getStyles('resourcesWeekViewTimeLabelsRow')} mod={{ scrolled }}>\n {timeLabels}\n </Box>\n </div>\n </div>\n\n {rows}\n\n {showTimeIndicator && (\n <Box\n {...getStyles('resourcesWeekViewCurrentTimeIndicator')}\n __vars={{\n '--indicator-left-offset': hasGroups\n ? `calc(var(--resources-week-view-resource-label-width) + var(--resources-week-view-group-label-width) + (100% - var(--resources-week-view-resource-label-width) - var(--resources-week-view-group-label-width)) * ${indicatorLeftPercent} / 100)`\n : `calc(var(--resources-week-view-resource-label-width) + (100% - var(--resources-week-view-resource-label-width)) * ${indicatorLeftPercent} / 100)`,\n '--_time-bubble-width': formattedCurrentTime\n ?.toString()\n .toLowerCase()\n .includes('m')\n ? '64px'\n : '46px',\n }}\n >\n {withCurrentTimeBubble && (\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorTimeBubble')}>\n {formattedCurrentTime}\n </div>\n )}\n {!withCurrentTimeBubble && (\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorThumb')} />\n )}\n <div {...getStyles('resourcesWeekViewCurrentTimeIndicatorLine')} />\n </Box>\n )}\n </div>\n </ScrollArea>\n </Box>\n </Box>\n );\n\n const dragContextValue = useMemo<DragContextValue>(\n () => dragDrop.dragContextValue,\n [dragDrop.dragContextValue]\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nResourcesWeekView.displayName = '@mantine/schedule/ResourcesWeekView';\nResourcesWeekView.classes = classes;\nResourcesWeekView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgPA,MAAM,eAAe;CACnB,kBAAkB;CAClB,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,iBAAiB;CACjB,cAAc;CACd,YAAY;CACZ,iBAAiB;CACjB,eAAe;CACf,wBAAwB;CACxB,eAAe,CAAC,YAAY,UAAU;CACtC,uBAAuB;CACvB,iBAAiB;CACjB,oBAAoB;CACpB,iBAAiB;CACjB,uBAAuB;CACvB,gBAAgB;CAChB,MAAM;CACN,sBAAsB;CACtB,iCAAiC;AACnC;AAEA,MAAM,eAAe,oBAClB,QAAQ,EAAE,QAAQ,WAAW,WAAW,uBAAuB,EAC9D,mBAAmB;CACjB,gCAAgC,SAAS,UAAU,MAAM,IAAI,KAAA;CAC7D,oCAAoC,IAAI,SAAS;CACjD,oCAAoC,IAAI,SAAS;CACjD,2CAA2C,IAAI,eAAe;AAChE,EACF,EACF;AAEA,MAAa,oBAAoB,SAAmC,WAAW;CAC7E,MAAM,QAAQ,SAAS,qBAAqB,cAAc,MAAM;CAChE,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,YACA,MACA,WACA,SACA,MACA,cACA,WACA,iBACA,cACA,iBACA,QACA,qBACA,iBACA,QACA,0BAA0B,2BAC1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,uCAAuC;OACrD,QAAQ;QACN,2BAA2B,YACvB,mNAAmN,qBAAqB,WACxO,qHAAqH,qBAAqB;QAC9I,wBAAwB,sBACpB,SAAS,CAAC,CACX,YAAY,CAAC,CACb,SAAS,GAAG,IACX,SACA;OACN;OAZF,UAAA;QAcG,yBACC,oBAAC,OAAD;SAAK,GAAI,UAAU,iDAAiD;SACjE,UAAA;QACE,CAAA;QAEN,CAAC,yBACA,oBAAC,OAAD,EAAK,GAAI,UAAU,4CAA4C,EAAI,CAAA;QAErE,oBAAC,OAAD,EAAK,GAAI,UAAU,2CAA2C,EAAI,CAAA;OAC/D;;KAEJ;;GACK,CAAA;EACT,CAAA,CACF;;CAGP,MAAM,mBAAmB,cACjB,SAAS,kBACf,CAAC,SAAS,gBAAgB,CAC5B;CAEA,IAAI,uBACF,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO;EAAmB,UAAA;CAA8B,CAAA;CAGvF,OAAO;AACT,CAAC;AAED,kBAAkB,cAAc;AAChC,kBAAkB,UAAUA;AAC5B,kBAAkB,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesWeekView.module.mjs","names":[],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.module.css"],"sourcesContent":[".resourcesWeekView {\n --resources-week-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-week-view-resource-label-width: 120px;\n --resources-week-view-slot-width: 60px;\n --resources-week-view-row-height: 64px;\n --resources-week-view-group-label-width: 80px;\n --resources-week-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-week-view-border-color: var(--mantine-color-gray-3);\n --resources-week-view-business-hours-bg: var(--mantine-color-white);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-week-view-border-color: var(--mantine-color-dark-4);\n --resources-week-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesWeekViewRoot {\n border: 1px solid var(--resources-week-view-border-color);\n border-radius: var(--resources-week-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesWeekViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesWeekViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesWeekViewHeaderRows {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-week-view-border-color);\n margin-bottom: -1px;\n}\n\n.resourcesWeekViewCorner {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n\n.resourcesWeekViewHeaderContent {\n display: flex;\n flex-direction: column;\n}\n\n.resourcesWeekViewDayLabelsRow {\n display: flex;\n border-bottom: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewDayLabel {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n cursor: default;\n height: 32px;\n text-transform: capitalize;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-today]) {\n color: var(--mantine-primary-color-contrast);\n background-color: var(--mantine-primary-color-filled);\n font-weight: var(--mantine-font-weight-bold);\n }\n}\n\n.resourcesWeekViewTimeLabelsRow {\n display: flex;\n}\n\n.resourcesWeekViewTimeLabel {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n}\n\n.resourcesWeekViewRow {\n display: flex;\n border-top: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewResourceLabel {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n\n &:where([data-has-groups]) {\n left: var(--resources-week-view-group-label-width);\n }\n}\n\n.resourcesWeekViewGroupColumn {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 13;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-week-view-row-height) + 1px);\n }\n}\n\n.resourcesWeekViewGroupColumnEmpty {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-week-view-row-height);\n}\n\n.resourcesWeekViewRowSlot {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n min-height: var(--resources-week-view-row-height);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n cursor: pointer;\n position: relative;\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-week-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n}\n\n.resourcesWeekViewAllDayEvent {\n position: absolute;\n height: var(--resources-week-view-all-day-height);\n z-index: 2;\n}\n\n.resourcesWeekViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='start']) {\n left: -2px;\n }\n\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n\n.resourcesWeekViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-event-interaction]) .resourcesWeekViewRowSlot {\n pointer-events: none;\n}\n\n.resourcesWeekView:where([data-event-interaction], [data-slot-dragging])\n .resourcesWeekViewBackgroundEvent {\n pointer-events: none;\n}\n\n.resourcesWeekView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesWeekViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n opacity: 0;\n }\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-week-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n\n position: absolute;\n pointer-events: none;\n top: 62px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n background-color: var(--_indicator-color);\n opacity: 0.2;\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesWeekViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n width: var(--_thumb-size);\n height: var(--_thumb-size);\n border-radius: 50%;\n border: 1px solid var(--mantine-color-body);\n background-color: var(--_indicator-color);\n left: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n}\n\n.resourcesWeekViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n top: 0;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesWeekViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--resources-week-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ResourcesWeekView.module.mjs","names":[],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.module.css"],"sourcesContent":[".resourcesWeekView {\n --resources-week-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-week-view-resource-label-width: 120px;\n --resources-week-view-slot-width: 60px;\n --resources-week-view-row-height: 64px;\n --resources-week-view-group-label-width: 80px;\n --resources-week-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-week-view-border-color: var(--mantine-color-gray-3);\n --resources-week-view-business-hours-bg: var(--mantine-color-white);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-week-view-border-color: var(--mantine-color-dark-4);\n --resources-week-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesWeekViewRoot {\n border: 1px solid var(--resources-week-view-border-color);\n border-radius: var(--resources-week-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesWeekViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesWeekViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesWeekViewHeaderRows {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-week-view-border-color);\n margin-bottom: -1px;\n}\n\n.resourcesWeekViewCorner {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n\n.resourcesWeekViewHeaderContent {\n display: flex;\n flex-direction: column;\n}\n\n.resourcesWeekViewDayLabelsRow {\n display: flex;\n border-bottom: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewDayLabel {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n cursor: default;\n height: 32px;\n text-transform: capitalize;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-today]) {\n color: var(--mantine-primary-color-contrast);\n background-color: var(--mantine-primary-color-filled);\n font-weight: var(--mantine-font-weight-bold);\n }\n}\n\n.resourcesWeekViewTimeLabelsRow {\n display: flex;\n}\n\n.resourcesWeekViewTimeLabel {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n}\n\n.resourcesWeekViewRow {\n display: flex;\n border-top: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewResourceLabel {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n\n &:where([data-has-groups]) {\n left: var(--resources-week-view-group-label-width);\n }\n}\n\n.resourcesWeekViewGroupColumn {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 13;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-week-view-row-height) + 1px);\n }\n}\n\n.resourcesWeekViewGroupColumnEmpty {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-week-view-row-height);\n}\n\n.resourcesWeekViewRowSlot {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n min-height: var(--resources-week-view-row-height);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n cursor: pointer;\n position: relative;\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-week-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n\n /* The resized edge repeatedly crosses the pointer, so hover feedback would flicker */\n &:where([data-resizing]) {\n @mixin hover {\n background-color: var(--bg-event-bg);\n }\n }\n}\n\n.resourcesWeekViewAllDayEvent {\n position: absolute;\n height: var(--resources-week-view-all-day-height);\n z-index: 2;\n}\n\n.resourcesWeekViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='start']) {\n left: -2px;\n }\n\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n\n.resourcesWeekViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-event-interaction]) .resourcesWeekViewRowSlot {\n pointer-events: none;\n}\n\n/* The resizing background event is the one that set `data-event-interaction`, so it must\n keep capturing pointer events. */\n.resourcesWeekView:where([data-event-interaction], [data-slot-dragging])\n .resourcesWeekViewBackgroundEvent:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n pointer-events: none;\n opacity: 0;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n & .resourcesWeekViewResizeHandle {\n background-color: var(--bg-event-color);\n\n &:where([data-edge='start']) {\n left: 0;\n }\n\n &:where([data-edge='end']) {\n right: 0;\n }\n }\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesWeekViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n opacity: 0;\n }\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-week-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n\n position: absolute;\n pointer-events: none;\n top: 62px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n background-color: var(--_indicator-color);\n opacity: 0.2;\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesWeekViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n width: var(--_thumb-size);\n height: var(--_thumb-size);\n border-radius: 50%;\n border: 1px solid var(--mantine-color-body);\n background-color: var(--_indicator-color);\n left: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n}\n\n.resourcesWeekViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n top: 0;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesWeekViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--resources-week-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schedule.mjs","names":["classes"],"sources":["../../../src/components/Schedule/Schedule.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport { DayView, DayViewProps, DayViewStylesNames } from '../DayView/DayView';\nimport {\n MobileMonthView,\n MobileMonthViewProps,\n MobileMonthViewStylesNames,\n} from '../MobileMonthView/MobileMonthView';\nimport { MonthView, MonthViewProps, MonthViewStylesNames } from '../MonthView/MonthView';\nimport { RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\nimport { WeekView, WeekViewProps, WeekViewStylesNames } from '../WeekView/WeekView';\nimport { YearView, YearViewProps, YearViewStylesNames } from '../YearView/YearView';\nimport classes from './Schedule.module.css';\n\nexport type ScheduleStylesNames =\n | 'root'\n | 'desktopView'\n | 'mobileView'\n | DayViewStylesNames\n | WeekViewStylesNames\n | MonthViewStylesNames\n | YearViewStylesNames\n | MobileMonthViewStylesNames;\n\nexport type ScheduleLayout = 'default' | 'responsive';\n\ntype ScheduleCommonProps =\n | 'date'\n | 'onDateChange'\n | 'events'\n | 'locale'\n | 'radius'\n | 'labels'\n | 'renderEventBody'\n | 'withEventsDragAndDrop'\n | 'onEventDrop'\n | 'canDragEvent'\n | 'onEventDragStart'\n | 'onEventDragEnd'\n | 'onTimeSlotClick'\n | 'onAllDaySlotClick'\n | 'onEventClick'\n | 'onDayClick'\n | 'onMonthClick'\n | 'withDragSlotSelect'\n | 'onSlotDragEnd'\n | 'view'\n | 'onViewChange'\n | 'mode'\n | 'withAgenda'\n | 'onExternalEventDrop'\n | 'withEventResize'\n | 'onEventResize'\n | 'canResizeEvent'\n | 'recurrenceExpansionLimit'\n | 'withInteractiveBackgroundEvents';\n\ntype ScheduleViewProps<T> = Partial<Omit<T, ScheduleCommonProps>>;\n\nexport interface ScheduleProps\n extends BoxProps, StylesApiProps<ScheduleFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Current date to display (controlled) */\n date?: Date | DateStringValue;\n\n /** Default date (uncontrolled) */\n defaultDate?: Date | DateStringValue;\n\n /** Called when date changes via navigation */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Current view level (controlled) */\n view?: ScheduleViewLevel;\n\n /** Default view level (uncontrolled) */\n defaultView?: ScheduleViewLevel;\n\n /** Called when view level changes */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Events to display across all views */\n events?: ScheduleEventData[];\n\n /** Locale for date formatting (overrides `DatesProvider`) */\n locale?: string;\n\n /** Key of theme.radius or any valid CSS value to set border-radius */\n radius?: MantineRadius;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Custom event body renderer */\n renderEventBody?: RenderEventBody;\n\n /** Enable drag and drop for events @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked in DayView/WeekView */\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 in DayView/WeekView */\n onAllDaySlotClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Called when a day is clicked in MonthView and YearView */\n onDayClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a slot range is selected by dragging */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Called when event is clicked in any view */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Interaction mode:\n * - `'default'` allows all interactions\n * - `'static'` disables event interactions\n * @default 'default' */\n mode?: ScheduleMode;\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 /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick`. Applies to `day`, `week` and `month` views only – `YearView` and the `MobileMonthView` used by `layout=\"responsive\"` on small screens do not render background events at all. @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Layout mode:\n * - `'default'` uses same views on all screen sizes\n * - `'responsive'` switches to YearView/MobileMonthView on small screens\n * @default 'default' */\n layout?: ScheduleLayout;\n\n /** Props specific to DayView (includes `startTime`, `endTime`, `intervalMinutes`, etc.) */\n dayViewProps?: ScheduleViewProps<DayViewProps>;\n\n /** Props specific to WeekView (includes `startTime`, `endTime`, `intervalMinutes`, etc.) */\n weekViewProps?: ScheduleViewProps<WeekViewProps>;\n\n /** Props specific to MonthView (includes `firstDayOfWeek`, `weekendDays`, etc.) */\n monthViewProps?: ScheduleViewProps<MonthViewProps>;\n\n /** Props specific to YearView (includes `firstDayOfWeek`, `weekendDays`, etc.) */\n yearViewProps?: ScheduleViewProps<YearViewProps>;\n\n /** Props specific to MobileMonthView (used in responsive layout) */\n mobileMonthViewProps?: ScheduleViewProps<MobileMonthViewProps>;\n\n /** If set, displays an Agenda button in the header of DayView, WeekView and MonthView @default false */\n withAgenda?: boolean;\n}\n\nexport type ScheduleFactory = Factory<{\n props: ScheduleProps;\n ref: HTMLDivElement;\n stylesNames: ScheduleStylesNames;\n}>;\n\nconst defaultProps: Partial<ScheduleProps> = {\n defaultView: 'week',\n mode: 'default',\n layout: 'default',\n};\n\nexport const Schedule = factory<ScheduleFactory>((_props) => {\n const props = useProps('Schedule', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n date,\n defaultDate,\n onDateChange,\n view,\n defaultView,\n onViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n withInteractiveBackgroundEvents,\n recurrenceExpansionLimit,\n mode,\n layout,\n dayViewProps,\n weekViewProps,\n monthViewProps,\n yearViewProps,\n mobileMonthViewProps,\n withAgenda,\n __staticSelector,\n mod,\n ...others\n } = props;\n\n const getStyles = useStyles<ScheduleFactory>({\n name: __staticSelector || 'Schedule',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const [_view, _setView] = useUncontrolled<ScheduleViewLevel>({\n value: view,\n defaultValue: defaultView,\n onChange: onViewChange,\n });\n\n const [_date, _setDate] = useUncontrolled<Date | DateStringValue>({\n value: date,\n defaultValue: defaultDate ?? new Date(),\n });\n\n const handleDateChange = (newDate: DateStringValue) => {\n _setDate(newDate);\n onDateChange?.(newDate);\n };\n\n const handleViewChange = (newView: ScheduleViewLevel) => {\n _setView(newView);\n onViewChange?.(newView);\n };\n\n const handleMonthClick = (monthDate: DateStringValue) => {\n handleDateChange(monthDate);\n handleViewChange('month');\n };\n\n const commonProps = {\n date: _date,\n onDateChange: handleDateChange,\n view: _view,\n onViewChange: handleViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n withEventsDragAndDrop: mode === 'static' ? false : withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize: mode === 'static' ? false : withEventResize,\n onEventResize,\n canResizeEvent,\n recurrenceExpansionLimit,\n mode,\n withAgenda,\n };\n\n const desktopContent = (() => {\n switch (_view) {\n case 'day':\n return (\n <DayView\n {...commonProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...dayViewProps}\n />\n );\n case 'week':\n return (\n <WeekView\n {...commonProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...weekViewProps}\n />\n );\n case 'month':\n return (\n <MonthView\n {...commonProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...monthViewProps}\n />\n );\n case 'year':\n return <YearView {...commonProps} onMonthClick={handleMonthClick} {...yearViewProps} />;\n default:\n return null;\n }\n })();\n\n const mobileContent = (() => {\n switch (_view) {\n case 'day':\n case 'week':\n case 'month':\n return (\n <MobileMonthView\n date={_date}\n onDateChange={handleDateChange}\n events={events}\n locale={locale}\n radius={radius}\n labels={labels}\n mode={mode}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n onYearClick={() => handleViewChange('year')}\n onEventClick={onEventClick}\n {...mobileMonthViewProps}\n />\n );\n case 'year':\n return <YearView {...commonProps} onMonthClick={handleMonthClick} {...yearViewProps} />;\n default:\n return null;\n }\n })();\n\n if (layout === 'responsive') {\n return (\n <Box {...getStyles('root')} mod={[{ layout }, mod]} {...others}>\n <Box {...getStyles('desktopView')}>{desktopContent}</Box>\n <Box {...getStyles('mobileView')}>{mobileContent}</Box>\n </Box>\n );\n }\n\n return (\n <Box {...getStyles('root')} mod={mod} {...others}>\n {desktopContent}\n </Box>\n );\n});\n\nSchedule.displayName = '@mantine/schedule/Schedule';\nSchedule.classes = classes;\n\nexport namespace Schedule {\n export type Props = ScheduleProps;\n export type StylesNames = ScheduleStylesNames;\n export type Factory = ScheduleFactory;\n export type Layout = ScheduleLayout;\n}\n"],"mappings":";;;;;;;;;;;AAwNA,MAAM,eAAuC;CAC3C,aAAa;CACb,MAAM;CACN,QAAQ;AACV;AAEA,MAAa,WAAW,SAA0B,WAAW;CAC3D,MAAM,QAAQ,SAAS,YAAY,cAAc,MAAM;CACvD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,aACA,cACA,MACA,aACA,cACA,QACA,QACA,QACA,QACA,iBACA,uBACA,aACA,cACA,kBACA,gBACA,iBACA,mBACA,YACA,cACA,oBACA,eACA,qBACA,iBACA,eACA,gBACA,iCACA,0BACA,MACA,QACA,cACA,eACA,gBACA,eACA,sBACA,YACA,kBACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA2B;EAC3C,MAAM,oBAAoB;EAC1B,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,CAAC,OAAO,YAAY,gBAAmC;EAC3D,OAAO;EACP,cAAc;EACd,UAAU;CACZ,CAAC;CAED,MAAM,CAAC,OAAO,YAAY,gBAAwC;EAChE,OAAO;EACP,cAAc,+BAAe,IAAI,KAAK;CACxC,CAAC;CAED,MAAM,oBAAoB,YAA6B;EACrD,SAAS,OAAO;EAChB,eAAe,OAAO;CACxB;CAEA,MAAM,oBAAoB,YAA+B;EACvD,SAAS,OAAO;EAChB,eAAe,OAAO;CACxB;CAEA,MAAM,oBAAoB,cAA+B;EACvD,iBAAiB,SAAS;EAC1B,iBAAiB,OAAO;C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AAoB,CAAA,GACxD,oBAAC,KAAD;GAAK,GAAI,UAAU,YAAY;GAAI,UAAA;EAAmB,CAAA,CACnD;;CAIT,OACE,oBAAC,KAAD;EAAK,GAAI,UAAU,MAAM;EAAQ;EAAK,GAAI;EACvC,UAAA;CACE,CAAA;AAET,CAAC;AAED,SAAS,cAAc;AACvB,SAAS,UAAUA"}
|
|
1
|
+
{"version":3,"file":"Schedule.mjs","names":["classes"],"sources":["../../../src/components/Schedule/Schedule.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport { DayView, DayViewProps, DayViewStylesNames } from '../DayView/DayView';\nimport {\n MobileMonthView,\n MobileMonthViewProps,\n MobileMonthViewStylesNames,\n} from '../MobileMonthView/MobileMonthView';\nimport { MonthView, MonthViewProps, MonthViewStylesNames } from '../MonthView/MonthView';\nimport { RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\nimport { WeekView, WeekViewProps, WeekViewStylesNames } from '../WeekView/WeekView';\nimport { YearView, YearViewProps, YearViewStylesNames } from '../YearView/YearView';\nimport classes from './Schedule.module.css';\n\nexport type ScheduleStylesNames =\n | 'root'\n | 'desktopView'\n | 'mobileView'\n | DayViewStylesNames\n | WeekViewStylesNames\n | MonthViewStylesNames\n | YearViewStylesNames\n | MobileMonthViewStylesNames;\n\nexport type ScheduleLayout = 'default' | 'responsive';\n\ntype ScheduleCommonProps =\n | 'date'\n | 'onDateChange'\n | 'events'\n | 'locale'\n | 'radius'\n | 'labels'\n | 'renderEventBody'\n | 'withEventsDragAndDrop'\n | 'onEventDrop'\n | 'canDragEvent'\n | 'onEventDragStart'\n | 'onEventDragEnd'\n | 'onTimeSlotClick'\n | 'onAllDaySlotClick'\n | 'onEventClick'\n | 'onDayClick'\n | 'onMonthClick'\n | 'withDragSlotSelect'\n | 'onSlotDragEnd'\n | 'view'\n | 'onViewChange'\n | 'mode'\n | 'withAgenda'\n | 'onExternalEventDrop'\n | 'withEventResize'\n | 'onEventResize'\n | 'canResizeEvent'\n | 'recurrenceExpansionLimit'\n | 'withInteractiveBackgroundEvents';\n\ntype ScheduleViewProps<T> = Partial<Omit<T, ScheduleCommonProps>>;\n\nexport interface ScheduleProps\n extends BoxProps, StylesApiProps<ScheduleFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Current date to display (controlled) */\n date?: Date | DateStringValue;\n\n /** Default date (uncontrolled) */\n defaultDate?: Date | DateStringValue;\n\n /** Called when date changes via navigation */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Current view level (controlled) */\n view?: ScheduleViewLevel;\n\n /** Default view level (uncontrolled) */\n defaultView?: ScheduleViewLevel;\n\n /** Called when view level changes */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Events to display across all views */\n events?: ScheduleEventData[];\n\n /** Locale for date formatting (overrides `DatesProvider`) */\n locale?: string;\n\n /** Key of theme.radius or any valid CSS value to set border-radius */\n radius?: MantineRadius;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Custom event body renderer */\n renderEventBody?: RenderEventBody;\n\n /** Enable drag and drop for events @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked in DayView/WeekView */\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 in DayView/WeekView */\n onAllDaySlotClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Called when a day is clicked in MonthView and YearView */\n onDayClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a slot range is selected by dragging */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Called when event is clicked in any view */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Interaction mode:\n * - `'default'` allows all interactions\n * - `'static'` disables event interactions\n * @default 'default' */\n mode?: ScheduleMode;\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 /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick`. Applies to `day`, `week` and `month` views only – `YearView` and the `MobileMonthView` used by `layout=\"responsive\"` on small screens do not render background events at all. Combined with `withEventResize`, timed background events in `day` and `week` views can also be resized by dragging their edges. @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Layout mode:\n * - `'default'` uses same views on all screen sizes\n * - `'responsive'` switches to YearView/MobileMonthView on small screens\n * @default 'default' */\n layout?: ScheduleLayout;\n\n /** Props specific to DayView (includes `startTime`, `endTime`, `intervalMinutes`, etc.) */\n dayViewProps?: ScheduleViewProps<DayViewProps>;\n\n /** Props specific to WeekView (includes `startTime`, `endTime`, `intervalMinutes`, etc.) */\n weekViewProps?: ScheduleViewProps<WeekViewProps>;\n\n /** Props specific to MonthView (includes `firstDayOfWeek`, `weekendDays`, etc.) */\n monthViewProps?: ScheduleViewProps<MonthViewProps>;\n\n /** Props specific to YearView (includes `firstDayOfWeek`, `weekendDays`, etc.) */\n yearViewProps?: ScheduleViewProps<YearViewProps>;\n\n /** Props specific to MobileMonthView (used in responsive layout) */\n mobileMonthViewProps?: ScheduleViewProps<MobileMonthViewProps>;\n\n /** If set, displays an Agenda button in the header of DayView, WeekView and MonthView @default false */\n withAgenda?: boolean;\n}\n\nexport type ScheduleFactory = Factory<{\n props: ScheduleProps;\n ref: HTMLDivElement;\n stylesNames: ScheduleStylesNames;\n}>;\n\nconst defaultProps: Partial<ScheduleProps> = {\n defaultView: 'week',\n mode: 'default',\n layout: 'default',\n};\n\nexport const Schedule = factory<ScheduleFactory>((_props) => {\n const props = useProps('Schedule', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n date,\n defaultDate,\n onDateChange,\n view,\n defaultView,\n onViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n withInteractiveBackgroundEvents,\n recurrenceExpansionLimit,\n mode,\n layout,\n dayViewProps,\n weekViewProps,\n monthViewProps,\n yearViewProps,\n mobileMonthViewProps,\n withAgenda,\n __staticSelector,\n mod,\n ...others\n } = props;\n\n const getStyles = useStyles<ScheduleFactory>({\n name: __staticSelector || 'Schedule',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const [_view, _setView] = useUncontrolled<ScheduleViewLevel>({\n value: view,\n defaultValue: defaultView,\n onChange: onViewChange,\n });\n\n const [_date, _setDate] = useUncontrolled<Date | DateStringValue>({\n value: date,\n defaultValue: defaultDate ?? new Date(),\n });\n\n const handleDateChange = (newDate: DateStringValue) => {\n _setDate(newDate);\n onDateChange?.(newDate);\n };\n\n const handleViewChange = (newView: ScheduleViewLevel) => {\n _setView(newView);\n onViewChange?.(newView);\n };\n\n const handleMonthClick = (monthDate: DateStringValue) => {\n handleDateChange(monthDate);\n handleViewChange('month');\n };\n\n const commonProps = {\n date: _date,\n onDateChange: handleDateChange,\n view: _view,\n onViewChange: handleViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n withEventsDragAndDrop: mode === 'static' ? false : withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize: mode === 'static' ? false : withEventResize,\n onEventResize,\n canResizeEvent,\n recurrenceExpansionLimit,\n mode,\n withAgenda,\n };\n\n const desktopContent = (() => {\n switch (_view) {\n case 'day':\n return (\n <DayView\n {...commonProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...dayViewProps}\n />\n );\n case 'week':\n return (\n <WeekView\n {...commonProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...weekViewProps}\n />\n );\n case 'month':\n return (\n <MonthView\n {...commonProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...monthViewProps}\n />\n );\n case 'year':\n return <YearView {...commonProps} onMonthClick={handleMonthClick} {...yearViewProps} />;\n default:\n return null;\n }\n })();\n\n const mobileContent = (() => {\n switch (_view) {\n case 'day':\n case 'week':\n case 'month':\n return (\n <MobileMonthView\n date={_date}\n onDateChange={handleDateChange}\n events={events}\n locale={locale}\n radius={radius}\n labels={labels}\n mode={mode}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n onYearClick={() => handleViewChange('year')}\n onEventClick={onEventClick}\n {...mobileMonthViewProps}\n />\n );\n case 'year':\n return <YearView {...commonProps} onMonthClick={handleMonthClick} {...yearViewProps} />;\n default:\n return null;\n }\n })();\n\n if (layout === 'responsive') {\n return (\n <Box {...getStyles('root')} mod={[{ layout }, mod]} {...others}>\n <Box {...getStyles('desktopView')}>{desktopContent}</Box>\n <Box {...getStyles('mobileView')}>{mobileContent}</Box>\n </Box>\n );\n }\n\n return (\n <Box {...getStyles('root')} mod={mod} {...others}>\n {desktopContent}\n </Box>\n );\n});\n\nSchedule.displayName = '@mantine/schedule/Schedule';\nSchedule.classes = classes;\n\nexport namespace Schedule {\n export type Props = ScheduleProps;\n export type StylesNames = ScheduleStylesNames;\n export type Factory = ScheduleFactory;\n export type Layout = ScheduleLayout;\n}\n"],"mappings":";;;;;;;;;;;AAwNA,MAAM,eAAuC;CAC3C,aAAa;CACb,MAAM;CACN,QAAQ;AACV;AAEA,MAAa,WAAW,SAA0B,WAAW;CAC3D,MAAM,QAAQ,SAAS,YAAY,cAAc,MAAM;CACvD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,aACA,cACA,MACA,aACA,cACA,QACA,QACA,QACA,QACA,iBACA,uBACA,aACA,cACA,kBACA,gBACA,iBACA,mBACA,YACA,cACA,oBACA,eACA,qBACA,iBACA,eACA,gBACA,iCACA,0BACA,MACA,QACA,cACA,eACA,gBACA,eACA,sBACA,YACA,kBACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA2B;EAC3C,MAAM,oBAAoB;EAC1B,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,CAAC,OAAO,YAAY,gBAAmC;EAC3D,OAAO;EACP,cAAc;EACd,UAA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A;GAEL,KAAK,QACH,OAAO,oBAAC,UAAD;IAAU,GAAI;IAAa,cAAc;IAAkB,GAAI;GAAgB,CAAA;GACxF,SACE,OAAO;EACX;CACF,EAAA,CAAG;CAEH,IAAI,WAAW,cACb,OACE,qBAAC,KAAD;EAAK,GAAI,UAAU,MAAM;EAAG,KAAK,CAAC,EAAE,OAAO,GAAG,GAAG;EAAG,GAAI;EAAxD,UAAA,CACE,oBAAC,KAAD;GAAK,GAAI,UAAU,aAAa;GAAI,UAAA;EAAoB,CAAA,GACxD,oBAAC,KAAD;GAAK,GAAI,UAAU,YAAY;GAAI,UAAA;EAAmB,CAAA,CACnD;;CAIT,OACE,oBAAC,KAAD;EAAK,GAAI,UAAU,MAAM;EAAQ;EAAK,GAAI;EACvC,UAAA;CACE,CAAA;AAET,CAAC;AAED,SAAS,cAAc;AACvB,SAAS,UAAUA"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Box, UnstyledButton, useMantineTheme, useProps } from "@mantine/core";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region packages/@mantine/schedule/src/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.tsx
|
|
6
|
+
const RESIZE_EDGES = {
|
|
7
|
+
vertical: ["top", "bottom"],
|
|
8
|
+
horizontal: ["start", "end"]
|
|
9
|
+
};
|
|
6
10
|
function ScheduleBackgroundEvent(props) {
|
|
7
|
-
const { event, interactive, onEventClick, renderEvent, renderEventBody, mod, ...others } = useProps("ScheduleBackgroundEvent", null, props);
|
|
11
|
+
const { event, interactive, onEventClick, renderEvent, renderEventBody, mod, withResize, resizeAxis = "vertical", resizeHandleProps, onResizeStart, isResizing, activeResizeEdge, ...others } = useProps("ScheduleBackgroundEvent", null, props);
|
|
8
12
|
const theme = useMantineTheme();
|
|
9
13
|
const [dragPassthrough, setDragPassthrough] = useState(false);
|
|
10
14
|
useEffect(() => {
|
|
@@ -25,6 +29,13 @@ function ScheduleBackgroundEvent(props) {
|
|
|
25
29
|
variant: "light",
|
|
26
30
|
autoContrast: true
|
|
27
31
|
});
|
|
32
|
+
const body = typeof renderEventBody === "function" ? renderEventBody(event) : event.title;
|
|
33
|
+
const children = withResize ? /* @__PURE__ */ jsxs(Fragment, { children: [RESIZE_EDGES[resizeAxis].map((edge) => /* @__PURE__ */ jsx(Box, {
|
|
34
|
+
...resizeHandleProps,
|
|
35
|
+
mod: { edge },
|
|
36
|
+
"data-active": isResizing && activeResizeEdge === edge || void 0,
|
|
37
|
+
onPointerDown: (e) => onResizeStart?.(edge, e)
|
|
38
|
+
}, edge)), body] }) : body;
|
|
28
39
|
const rootProps = {
|
|
29
40
|
...others,
|
|
30
41
|
__vars: {
|
|
@@ -32,8 +43,12 @@ function ScheduleBackgroundEvent(props) {
|
|
|
32
43
|
"--bg-event-color": colors.color,
|
|
33
44
|
"--bg-event-hover": colors.hover
|
|
34
45
|
},
|
|
35
|
-
children
|
|
36
|
-
mod:
|
|
46
|
+
children,
|
|
47
|
+
mod: [mod, {
|
|
48
|
+
interactive,
|
|
49
|
+
resizable: withResize,
|
|
50
|
+
resizing: isResizing
|
|
51
|
+
}],
|
|
37
52
|
...interactive ? {
|
|
38
53
|
"data-event-id": event.id,
|
|
39
54
|
title: event.title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleBackgroundEvent.mjs","names":[],"sources":["../../../src/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport {\n Box,\n BoxProps,\n ElementProps,\n UnstyledButton,\n useMantineTheme,\n useProps,\n} from '@mantine/core';\nimport { ScheduleEventData } from '../../types';\nimport { RenderEvent, RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\n\nexport interface ScheduleBackgroundEventProps extends BoxProps, ElementProps<'div', 'onClick'> {\n /** Background event to display */\n event: ScheduleEventData;\n\n /** If set, the root element is a `button` instead of a `div` and the event can be clicked @default false */\n interactive?: boolean;\n\n /** Called when the event is clicked, only when `interactive` is set */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Function to fully customize event rendering */\n renderEvent?: RenderEvent;\n\n /** Function to customize event body */\n renderEventBody?: RenderEventBody;\n}\n\nexport function ScheduleBackgroundEvent(props: ScheduleBackgroundEventProps) {\n const {
|
|
1
|
+
{"version":3,"file":"ScheduleBackgroundEvent.mjs","names":[],"sources":["../../../src/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport {\n Box,\n BoxProps,\n ElementProps,\n UnstyledButton,\n useMantineTheme,\n useProps,\n} from '@mantine/core';\nimport { ScheduleEventData } from '../../types';\nimport { RenderEvent, RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\n\nexport type ScheduleBackgroundEventResizeEdge = 'top' | 'bottom' | 'start' | 'end';\n\nconst RESIZE_EDGES = {\n vertical: ['top', 'bottom'],\n horizontal: ['start', 'end'],\n} satisfies Record<string, ScheduleBackgroundEventResizeEdge[]>;\n\nexport interface ScheduleBackgroundEventProps<\n Edge extends ScheduleBackgroundEventResizeEdge = ScheduleBackgroundEventResizeEdge,\n>\n extends BoxProps, ElementProps<'div', 'onClick'> {\n /** Background event to display */\n event: ScheduleEventData;\n\n /** If set, the root element is a `button` instead of a `div` and the event can be clicked @default false */\n interactive?: boolean;\n\n /** Called when the event is clicked, only when `interactive` is set */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Function to fully customize event rendering */\n renderEvent?: RenderEvent;\n\n /** Function to customize event body */\n renderEventBody?: RenderEventBody;\n\n /** If set, the event renders resize handles on both of its edges @default false */\n withResize?: boolean;\n\n /** Axis along which the event is resized, defines which edges render handles @default 'vertical' */\n resizeAxis?: 'vertical' | 'horizontal';\n\n /** Props passed down to both resize handles, usually a styles api props object */\n resizeHandleProps?: Record<string, any>;\n\n /** Called when resize starts on an edge */\n onResizeStart?: (edge: Edge, e: React.PointerEvent) => void;\n\n /** If set, the event is currently being resized @default false */\n isResizing?: boolean;\n\n /** Edge that is currently being dragged, only relevant when `isResizing` is set */\n activeResizeEdge?: Edge | null;\n}\n\nexport function ScheduleBackgroundEvent<\n Edge extends ScheduleBackgroundEventResizeEdge = ScheduleBackgroundEventResizeEdge,\n>(props: ScheduleBackgroundEventProps<Edge>) {\n const {\n event,\n interactive,\n onEventClick,\n renderEvent,\n renderEventBody,\n mod,\n withResize,\n resizeAxis = 'vertical',\n resizeHandleProps,\n onResizeStart,\n isResizing,\n activeResizeEdge,\n ...others\n } = useProps('ScheduleBackgroundEvent', null, props);\n\n const theme = useMantineTheme();\n\n // An interactive background event captures pointer events so it can be clicked, which\n // also makes it the target of drag events – the drop targets underneath (day cells and\n // slots) would then never receive `dragover` and could not accept a drop. Stepping out\n // of the way for the duration of the drag keeps both behaviours working, including for\n // drags started outside the schedule.\n const [dragPassthrough, setDragPassthrough] = useState(false);\n\n useEffect(() => {\n if (!dragPassthrough) {\n return undefined;\n }\n\n const reset = () => setDragPassthrough(false);\n\n document.addEventListener('dragend', reset);\n document.addEventListener('drop', reset);\n // A drag can end without either of those firing – dropped on another window, or with\n // propagation stopped. Pointer events are suppressed for the duration of a drag, so\n // seeing one means the drag is over and the element can capture input again.\n document.addEventListener('pointermove', reset);\n\n return () => {\n document.removeEventListener('dragend', reset);\n document.removeEventListener('drop', reset);\n document.removeEventListener('pointermove', reset);\n };\n }, [dragPassthrough]);\n\n const colors = theme.variantColorResolver({\n color: event.color || theme.primaryColor,\n theme,\n variant: 'light',\n autoContrast: true,\n });\n\n // Handles are part of the children rather than a wrapper so that `renderEvent` consumers\n // keep them – the same contract `ScheduleEvent` uses for its own resize handles.\n const body = typeof renderEventBody === 'function' ? renderEventBody(event) : event.title;\n const children = withResize ? (\n <>\n {(RESIZE_EDGES[resizeAxis] as Edge[]).map((edge) => (\n <Box\n key={edge}\n {...resizeHandleProps}\n mod={{ edge }}\n data-active={(isResizing && activeResizeEdge === edge) || undefined}\n onPointerDown={(e: React.PointerEvent) => onResizeStart?.(edge, e)}\n />\n ))}\n {body}\n </>\n ) : (\n body\n );\n\n const eventProps = {\n ...others,\n __vars: {\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n '--bg-event-hover': colors.hover,\n },\n children,\n // Composed rather than replaced – `mod` is a public prop, and overwriting it would\n // silently drop the caller's data modifiers whenever `interactive` is set.\n mod: [mod, { interactive, resizable: withResize, resizing: isResizing }],\n ...(interactive\n ? {\n 'data-event-id': event.id,\n title: event.title,\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => onEventClick?.(event, e),\n onDragEnter: () => setDragPassthrough(true),\n onDragOver: () => setDragPassthrough(true),\n }\n : null),\n // Appended rather than replaced – the views position background events with `style`,\n // and the array form preserves the function and array style values Box supports.\n ...(interactive && dragPassthrough\n ? { style: [others.style, { pointerEvents: 'none' as const }] }\n : null),\n };\n\n // The root element switches between a div and a button depending on `interactive`, so\n // the shared prop bag cannot satisfy both element types at once.\n const rootProps = eventProps as Parameters<RenderEvent>[1];\n\n if (typeof renderEvent === 'function') {\n return renderEvent(event, rootProps);\n }\n\n return interactive ? (\n <UnstyledButton {...rootProps} />\n ) : (\n <Box {...(rootProps as React.ComponentPropsWithoutRef<'div'>)} />\n );\n}\n\nScheduleBackgroundEvent.displayName = '@mantine/schedule/ScheduleBackgroundEvent';\n"],"mappings":";;;;;AAcA,MAAM,eAAe;CACnB,UAAU,CAAC,OAAO,QAAQ;CAC1B,YAAY,CAAC,SAAS,KAAK;AAC7B;AAwCA,SAAgB,wBAEd,OAA2C;CAC3C,MAAM,EACJ,OACA,aACA,cACA,aACA,iBACA,KACA,YACA,aAAa,YACb,mBACA,eACA,YACA,kBACA,GAAG,WACD,SAAS,2BAA2B,MAAM,KAAK;CAEnD,MAAM,QAA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gB,CAAC,EAAE,IAC5D;CAKqB;CAE3B,IAAI,OAAO,gBAAgB,YACzB,OAAO,YAAY,OAAO,SAAS;CAGrC,OAAO,cACL,oBAAC,gBAAD,EAAgB,GAAI,UAAY,CAAA,IAEhC,oBAAC,KAAD,EAAK,GAAK,UAAsD,CAAA;AAEpE;AAEA,wBAAwB,cAAc"}
|
|
@@ -216,7 +216,8 @@ const WeekView = factory((_props) => {
|
|
|
216
216
|
intervalMinutes,
|
|
217
217
|
resizeIntervalMinutes: eventResizeInterval,
|
|
218
218
|
onEventResize,
|
|
219
|
-
canResizeEvent
|
|
219
|
+
canResizeEvent,
|
|
220
|
+
withBackgroundEvents: withInteractiveBackgroundEvents
|
|
220
221
|
});
|
|
221
222
|
const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== "static";
|
|
222
223
|
const handleTimeSlotClick = (day, slotTime, e) => {
|
|
@@ -401,18 +402,40 @@ const WeekView = factory((_props) => {
|
|
|
401
402
|
}, dayjs(day).date())));
|
|
402
403
|
const interactiveBackgroundEvents = withInteractiveBackgroundEvents && mode !== "static";
|
|
403
404
|
const days = weekdays.map((day, dayIndex) => {
|
|
404
|
-
const backgroundEventNodes = (weekEvents.backgroundEvents[day] || []).filter((event) => !event.position.allDay).map((event) =>
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
405
|
+
const backgroundEventNodes = (weekEvents.backgroundEvents[day] || []).filter((event) => !event.position.allDay).map((event) => {
|
|
406
|
+
const eventDate = dayjs(day).format("YYYY-MM-DD");
|
|
407
|
+
const isResizable = eventResize.isResizableEvent(event);
|
|
408
|
+
const resizePosition = eventResize.getResizePosition(event.id, eventDate);
|
|
409
|
+
return /* @__PURE__ */ jsx(ScheduleBackgroundEvent, {
|
|
410
|
+
event,
|
|
411
|
+
renderEvent,
|
|
412
|
+
renderEventBody,
|
|
413
|
+
interactive: interactiveBackgroundEvents,
|
|
414
|
+
onEventClick: onEventClick ? (clickedEvent, e) => {
|
|
415
|
+
if (!eventResize.wasResizing()) onEventClick(clickedEvent, e);
|
|
416
|
+
} : void 0,
|
|
417
|
+
withResize: isResizable,
|
|
418
|
+
isResizing: resizePosition !== null,
|
|
419
|
+
resizeHandleProps: getStyles("weekViewBackgroundEventResizeHandle"),
|
|
420
|
+
onResizeStart: isResizable ? (edge, e) => {
|
|
421
|
+
const container = daySlotsContainersRef.current[dayIndex];
|
|
422
|
+
if (container) eventResize.handleResizeStart({
|
|
423
|
+
event,
|
|
424
|
+
edge,
|
|
425
|
+
container,
|
|
426
|
+
originalTop: event.position.top,
|
|
427
|
+
originalHeight: event.position.height,
|
|
428
|
+
eventDate,
|
|
429
|
+
pointerEvent: e
|
|
430
|
+
});
|
|
431
|
+
} : void 0,
|
|
432
|
+
...getStyles("weekViewBackgroundEvent", { style: {
|
|
433
|
+
top: `${resizePosition ? resizePosition.top : event.position.top}%`,
|
|
434
|
+
height: `${resizePosition ? resizePosition.height : event.position.height}%`,
|
|
435
|
+
width: "100%"
|
|
436
|
+
} })
|
|
437
|
+
}, `bg-${event.id}`);
|
|
438
|
+
});
|
|
416
439
|
const dayEvents = (weekEvents.regularEvents[day] || []).map((event) => {
|
|
417
440
|
const eventIsAllDay = isAllDayEvent({
|
|
418
441
|
event,
|