@mantine-vue/schedule 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/cjs/index.cjs +755 -236
  2. package/cjs/index.cjs.map +1 -1
  3. package/esm/index.mjs +756 -238
  4. package/esm/index.mjs.map +1 -1
  5. package/lib/component-props.d.ts +15 -0
  6. package/lib/components/ResourcesDayView/ResourcesDayView.types.d.ts +6 -0
  7. package/lib/components/ResourcesMonthView/ResourcesMonthView.types.d.ts +8 -2
  8. package/lib/components/ResourcesMonthView/ResourcesMonthView.vue.d.ts +3 -0
  9. package/lib/components/ResourcesSchedule/ResourcesSchedule.types.d.ts +3 -1
  10. package/lib/components/ResourcesWeekView/ResourcesWeekView.types.d.ts +6 -0
  11. package/lib/components/Schedule/Schedule.types.d.ts +2 -0
  12. package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.d.ts +3 -0
  13. package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.types.d.ts +24 -0
  14. package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.vue.d.ts +15 -0
  15. package/lib/components/ScheduleBackgroundEvent/index.d.ts +1 -0
  16. package/lib/components/WeekView/get-week-view-events/find-available-column.d.ts +6 -3
  17. package/lib/components/YearView/YearView.d.ts +1 -0
  18. package/lib/components/YearView/YearView.types.d.ts +14 -1
  19. package/lib/components/YearView/YearView.vue.d.ts +9 -2
  20. package/lib/components/use-slot-drop-target.d.ts +4 -0
  21. package/lib/hooks/use-event-resize.d.ts +1 -0
  22. package/lib/hooks/use-horizontal-event-resize.d.ts +1 -0
  23. package/lib/index.d.mts +1 -0
  24. package/lib/index.d.ts +1 -0
  25. package/lib/types.d.ts +1 -1
  26. package/lib/utils/calculate-drop-time/calculate-drop-time.d.ts +11 -1
  27. package/package.json +4 -4
  28. package/styles.css +523 -370
  29. package/styles.layer.css +523 -370
package/esm/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/labels.ts","../src/utils/format-date/format-date.ts","../src/utils/get-weekdays-names/get-weekdays-names.ts","../src/utils/get-start-of-week/get-start-of-week.ts","../src/utils/get-end-of-week/get-end-of-week.ts","../src/utils/get-week-number/get-week-number.ts","../src/utils/get-month-days/get-month-days.ts","../src/utils/is-after-min-date/is-after-min-date.ts","../src/utils/is-before-max-date/is-before-max-date.ts","../src/utils/is-same-month/is-same-month.ts","../src/utils/get-months-by-quarter/get-months-by-quarter.ts","../src/utils/clamp-interval-minutes/clamp-interval-minutes.ts","../src/utils/parse-time-string/parse-time-string.ts","../src/utils/to-time-string/to-time-string.ts","../src/utils/get-day-time-intervals/get-day-time-intervals.ts","../src/utils/to-date-string/to-date-string.ts","../src/utils/get-week-days/get-week-days.ts","../src/utils/get-months-list/get-months-list.ts","../src/utils/get-years-list/get-years-list.ts","../src/utils/next-week/next-week.ts","../src/utils/previous-week/previous-week.ts","../src/utils/get-current-time-position/get-current-time-position.ts","../src/utils/is-in-time-range/is-in-time-range.ts","../src/utils/is-all-day-event/is-all-day-event.ts","../src/utils/validate-event/validate-event.ts","../src/utils/sort-events/sort-events.ts","../src/utils/is-events-overlap/is-events-overlap.ts","../src/utils/get-visible-events/get-visible-events.ts","../src/utils/is-multiday-event/is-multiday-event.ts","../src/utils/is-event-in-time-range/is-event-in-time-range.ts","../src/utils/is-within-week/is-within-week.ts","../src/utils/get-month-range/get-month-range.ts","../src/utils/get-day-position/get-day-position.ts","../src/utils/calculate-drop-time/calculate-drop-time.ts","../src/utils/calculate-month-drop-date/calculate-month-drop-date.ts","../src/utils/get-business-hours-mod/get-business-hours-mod.ts","../src/utils/expand-recurring-events/expand-recurring-events.ts","../src/utils/get-ordered-resources/get-ordered-resources.ts","../src/utils/get-group-to-resource-id-map/get-group-to-resource-id-map.ts","../src/utils/handle-resources-grid-key-down/handle-resources-grid-key-down.ts","../src/components/shared.ts","../src/hooks/use-event-resize.ts","../src/components/CurrentTimeIndicator/CurrentTimeIndicator.module.css","../src/components/CurrentTimeIndicator/CurrentTimeIndicator.vue","../src/components/CurrentTimeIndicator/CurrentTimeIndicator.vue","../src/components/CurrentTimeIndicator/CurrentTimeIndicator.ts","../src/components/DragContext/DragContext.ts","../src/components/ScheduleEvent/ScheduleEvent.module.css","../src/components/ScheduleEvent/ScheduleEvent.vue","../src/components/ScheduleEvent/ScheduleEvent.vue","../src/components/ScheduleEvent/ScheduleEvent.ts","../src/components/MoreEvents/MoreEvents.module.css","../src/components/MoreEvents/MoreEvents.vue","../src/components/MoreEvents/MoreEvents.vue","../src/components/MoreEvents/MoreEvents.ts","../src/components/ScheduleHeader/ScheduleHeader.context.ts","../src/components/ScheduleHeader/ScheduleHeader.module.css","../src/components/ScheduleHeader/ScheduleHeader.vue","../src/components/ScheduleHeader/ScheduleHeader.vue","../src/components/ScheduleHeader/HeaderControl/HeaderControl.module.css","../src/components/ScheduleHeader/HeaderControl/HeaderControl.vue","../src/components/ScheduleHeader/HeaderControl/HeaderControl.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderNext.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderNext.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderPrevious.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderPrevious.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderToday.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderToday.vue","../src/components/ScheduleHeader/HeaderControl/HeaderControl.ts","../src/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.module.css","../src/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.vue","../src/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.vue","../src/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.ts","../src/components/ScheduleHeader/ViewSelect/ViewSelect.module.css","../src/components/ScheduleHeader/ViewSelect/ViewSelect.vue","../src/components/ScheduleHeader/ViewSelect/ViewSelect.vue","../src/components/ScheduleHeader/ViewSelect/ViewSelect.ts","../src/components/ScheduleHeader/ScheduleHeader.ts","../src/components/ScheduleHeader/ScheduleHeaderBase.vue","../src/components/ScheduleHeader/ScheduleHeaderBase.vue","../src/components/ScheduleHeader/ScheduleHeaderBase.ts","../src/components/use-slot-drag-select.ts","../src/components/use-slot-drop-target.ts","../src/components/DayView/get-day-view-events/get-day-positioned-events.ts","../src/components/DayView/get-day-view-events/get-day-view-events.ts","../src/components/DayView/DayView.module.css","../src/components/DayView/DayView.vue","../src/components/DayView/DayView.vue","../src/components/DayView/DayView.ts","../src/components/MobileMonthView/get-mobile-month-view-events.ts","../src/components/MobileMonthView/MobileMonthView.module.css","../src/components/MobileMonthView/MobileMonthView.vue","../src/components/MobileMonthView/MobileMonthView.vue","../src/components/MobileMonthView/MobileMonthView.ts","../src/components/keyboard-navigation.ts","../src/components/MonthView/get-month-view-events/add-event-to-day-groups.ts","../src/components/MonthView/get-month-view-events/calculate-event-position-in-week.ts","../src/components/MonthView/get-month-view-events/find-available-row.ts","../src/components/MonthView/get-month-view-events/get-weeks-in-range.ts","../src/components/MonthView/get-month-view-events/get-month-positioned-events.ts","../src/components/MonthView/get-month-view-events/get-month-view-events.ts","../src/components/MonthView/get-renderable-month-event-segments.ts","../src/components/MonthView/MonthView.module.css","../src/components/MonthView/MonthView.vue","../src/components/MonthView/MonthView.vue","../src/components/MonthView/MonthView.ts","../src/components/WeekView/get-week-label/get-week-label.ts","../src/components/WeekView/get-week-view-events/filter-week-view-events.ts","../src/components/WeekView/get-week-view-events/assign-event-rows.ts","../src/components/WeekView/get-week-view-events/calculate-all-day-event-offset.ts","../src/components/WeekView/get-week-view-events/calculate-all-day-event-width.ts","../src/components/WeekView/get-week-view-events/calculate-event-days.ts","../src/components/WeekView/get-week-view-events/calculate-regular-event-overlaps.ts","../src/components/WeekView/get-week-view-events/find-available-column.ts","../src/components/WeekView/get-week-view-events/get-event-end-date.ts","../src/components/WeekView/get-week-view-events/get-hanging-status.ts","../src/components/WeekView/get-week-view-events/get-week-positioned-events.ts","../src/components/WeekView/get-week-view-events/get-week-view-events.ts","../src/components/WeekView/WeekView.module.css","../src/components/WeekView/WeekView.vue","../src/components/WeekView/WeekView.vue","../src/components/WeekView/WeekView.ts","../src/components/YearView/get-year-view-events/get-year-view-events.ts","../src/components/YearView/YearView.module.css","../src/components/YearView/YearView.vue","../src/components/YearView/YearView.vue","../src/components/YearView/YearView.ts","../src/components/Schedule/Schedule.module.css","../src/components/Schedule/Schedule.vue","../src/components/Schedule/Schedule.vue","../src/components/Schedule/Schedule.ts","../src/hooks/use-horizontal-event-resize.ts","../src/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.ts","../src/components/ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events.ts","../src/components/ResourcesDayView/ResourcesDayView.module.css","../src/components/ResourcesDayView/ResourcesDayView.vue","../src/components/ResourcesDayView/ResourcesDayView.vue","../src/components/ResourcesDayView/ResourcesDayView.ts","../src/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.ts","../src/components/ResourcesWeekView/ResourcesWeekView.module.css","../src/components/ResourcesWeekView/ResourcesWeekView.vue","../src/components/ResourcesWeekView/ResourcesWeekView.vue","../src/components/ResourcesWeekView/ResourcesWeekView.ts","../src/components/ResourcesMonthView/get-resources-month-view-layout/get-resources-month-view-layout.ts","../src/components/ResourcesMonthView/ResourcesMonthView.module.css","../src/components/ResourcesMonthView/ResourcesMonthView.vue","../src/components/ResourcesMonthView/ResourcesMonthView.vue","../src/components/ResourcesMonthView/ResourcesMonthView.ts","../src/components/ResourcesSchedule/ResourcesSchedule.module.css","../src/components/ResourcesSchedule/ResourcesSchedule.vue","../src/components/ResourcesSchedule/ResourcesSchedule.vue","../src/components/ResourcesSchedule/ResourcesSchedule.ts"],"sourcesContent":["export interface ScheduleLabels {\n day: string\n week: string\n month: string\n year: string\n allDay: string\n weekday: string\n timeSlot: string\n today: string\n next: string\n previous: string\n more: string\n selectMonth: string\n selectYear: string\n switchToDayView: string\n switchToWeekView: string\n switchToMonthView: string\n switchToYearView: string\n viewSelectLabel: string\n noEvents: string\n moreLabel: (hiddenEventsCount: number) => string\n resource?: string\n resources?: string\n resourceSlot?: string\n}\n\nexport const DEFAULT_SCHEDULE_LABELS: ScheduleLabels = {\n today: 'Today',\n next: 'Next',\n previous: 'Previous',\n more: 'More',\n day: 'Day',\n week: 'Week',\n month: 'Month',\n year: 'Year',\n allDay: 'All day',\n weekday: 'Weekday',\n timeSlot: 'Time slot',\n selectMonth: 'Select month',\n selectYear: 'Select year',\n switchToDayView: 'Switch to day view',\n switchToWeekView: 'Switch to week view',\n switchToMonthView: 'Switch to month view',\n switchToYearView: 'Switch to year view',\n viewSelectLabel: 'Calendar view',\n noEvents: 'No events',\n moreLabel: (hiddenEventsCount: number) => `+${hiddenEventsCount} more`,\n resource: 'Resource',\n resources: 'Resources',\n resourceSlot: 'Resource time slot',\n}\n\nexport type ScheduleLabelsOverride = Partial<ScheduleLabels>\n\nexport function getLabel<K extends keyof ScheduleLabels>(\n key: K,\n override?: ScheduleLabelsOverride,\n): ScheduleLabels[K] {\n if (override) {\n return { ...DEFAULT_SCHEDULE_LABELS, ...override }[key]\n }\n\n return DEFAULT_SCHEDULE_LABELS[key]\n}\n","import dayjs from 'dayjs'\nimport { DateLabelFormat } from '../../types'\n\nexport interface FormatDateInput {\n locale: string\n date: string | Date | dayjs.Dayjs\n format: DateLabelFormat\n}\n\nexport function formatDate({ locale, date, format }: FormatDateInput) {\n if (typeof format === 'function') {\n return format(dayjs(date).format('YYYY-MM-DD HH:mm:ss'))\n }\n\n return dayjs(date).locale(locale).format(format)\n}\n","import dayjs from 'dayjs'\nimport type { VNodeChild } from 'vue'\nimport type { DateLabelFormat, DayOfWeek } from '../../types'\nimport { formatDate } from '../format-date/format-date'\n\ninterface GetWeekdaysNamesInput {\n locale: string\n format?: DateLabelFormat\n firstDayOfWeek?: DayOfWeek\n}\n\nexport function getWeekdaysNames({\n locale,\n format = 'dd',\n firstDayOfWeek = 1,\n}: GetWeekdaysNamesInput) {\n const baseDate = dayjs().day(firstDayOfWeek)\n const labels: VNodeChild[] = []\n\n for (let i = 0; i < 7; i += 1) {\n labels.push(formatDate({ locale, date: baseDate.add(i, 'days'), format }))\n }\n\n return labels\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek } from '../../types'\n\ninterface GetStartOfWeekInput {\n date: AnyDateValue\n firstDayOfWeek?: DayOfWeek\n}\n\nexport function getStartOfWeek({ date, firstDayOfWeek = 1 }: GetStartOfWeekInput) {\n let value = dayjs(date)\n\n while (value.day() !== firstDayOfWeek) {\n value = value.subtract(1, 'day')\n }\n\n return value.format('YYYY-MM-DD')\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek } from '../../types'\n\nexport function getEndOfWeek(date: AnyDateValue, firstDayOfWeek: DayOfWeek = 1) {\n let value = dayjs(date)\n\n if (!value.isValid()) {\n return value\n }\n\n const lastDayOfWeek = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1\n while (value.day() !== lastDayOfWeek) {\n value = value.add(1, 'day')\n }\n\n return value.format('YYYY-MM-DD')\n}\n","import dayjs from 'dayjs'\nimport isoWeek from 'dayjs/plugin/isoWeek.js'\nimport { AnyDateValue } from '../../types'\n\ndayjs.extend(isoWeek)\n\nexport function getWeekNumber(week: AnyDateValue | AnyDateValue[]): number {\n if (Array.isArray(week)) {\n const monday = week.find((date) => dayjs(date).day() === 1)\n return dayjs(monday).isoWeek()\n }\n\n return dayjs(week).isoWeek()\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, DayOfWeek } from '../../types'\nimport { getEndOfWeek } from '../get-end-of-week/get-end-of-week'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\n\ninterface GetMonthDaysInput {\n month: AnyDateValue\n firstDayOfWeek: DayOfWeek | undefined\n consistentWeeks: boolean | undefined\n}\n\nexport function getMonthDays({\n month,\n firstDayOfWeek = 1,\n consistentWeeks,\n}: GetMonthDaysInput): DateStringValue[][] {\n const day = dayjs(month).subtract(dayjs(month).date() - 1, 'day')\n const start = dayjs(day.format('YYYY-MM-DD'))\n const startOfMonth = start.format('YYYY-MM-DD')\n const endOfMonth = start.add(+start.daysInMonth() - 1, 'day').format('YYYY-MM-DD')\n const endDate = getEndOfWeek(endOfMonth, firstDayOfWeek)\n const weeks: DateStringValue[][] = []\n\n let date = dayjs(getStartOfWeek({ date: startOfMonth, firstDayOfWeek }))\n\n while (dayjs(date).isBefore(endDate, 'day')) {\n const days: DateStringValue[] = []\n\n for (let i = 0; i < 7; i += 1) {\n days.push(date.format('YYYY-MM-DD 00:00:00'))\n date = date.add(1, 'day')\n }\n\n weeks.push(days)\n }\n\n if (consistentWeeks && weeks.length < 6) {\n const lastWeek = weeks[weeks.length - 1]\n const lastDay = lastWeek[lastWeek.length - 1]\n let nextDay = dayjs(lastDay).add(1, 'day')\n\n while (weeks.length < 6) {\n const days: DateStringValue[] = []\n\n for (let i = 0; i < 7; i += 1) {\n days.push(nextDay.format('YYYY-MM-DD 00:00:00'))\n nextDay = nextDay.add(1, 'day')\n }\n\n weeks.push(days)\n }\n }\n\n return weeks\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\n\nexport function isAfterMinDate(date: AnyDateValue, minDate: AnyDateValue | undefined) {\n return minDate ? dayjs(date).isAfter(dayjs(minDate).subtract(1, 'day'), 'day') : true\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\n\nexport function isBeforeMaxDate(date: AnyDateValue, maxDate: AnyDateValue | undefined) {\n return maxDate ? dayjs(date).isBefore(dayjs(maxDate).add(1, 'day'), 'day') : true\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\n\nexport function isSameMonth(date: AnyDateValue, comparison: AnyDateValue) {\n return dayjs(date).format('YYYY-MM') === dayjs(comparison).format('YYYY-MM')\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue } from '../../types'\n\nexport function getMonthsByQuarter(year: AnyDateValue) {\n const startOfYear = dayjs(year).startOf('year').toDate()\n\n const results: DateStringValue[][] = [[], [], [], []]\n let currentMonthIndex = 0\n\n for (let i = 0; i < 4; i += 1) {\n for (let j = 0; j < 3; j += 1) {\n results[i].push(dayjs(startOfYear).add(currentMonthIndex, 'months').format('YYYY-MM-DD'))\n currentMonthIndex += 1\n }\n }\n\n return results\n}\n","/**\n * Clamps interval minutes to a value that keeps the time grid consistent:\n *\n * - Values of 60 or less must divide evenly into an hour.\n * - Values above an hour must be a whole number of hours.\n *\n * Invalid values fall back to 60 and the result is capped to one day.\n */\nexport function clampIntervalMinutes(intervalMinutes: number): number {\n const rounded = Math.round(Math.max(1, Math.min(1440, intervalMinutes)))\n\n if (rounded <= 60) {\n return 60 % rounded === 0 ? rounded : 60\n }\n\n return rounded % 60 === 0 ? rounded : 60\n}\n","export interface ParsedTime {\n hours: number\n minutes: number\n seconds: number\n}\n\nexport function parseTimeString(time: string): ParsedTime {\n const [hours, minutes, seconds] = time.split(':').map(Number)\n return { hours, minutes, seconds: seconds || 0 }\n}\n","import { ParsedTime } from '../parse-time-string/parse-time-string'\n\nexport function toTimeString({ hours, minutes, seconds }: ParsedTime) {\n return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`\n}\n","import { clampIntervalMinutes } from '../clamp-interval-minutes/clamp-interval-minutes'\nimport { parseTimeString } from '../parse-time-string/parse-time-string'\nimport { toTimeString } from '../to-time-string/to-time-string'\n\nexport interface DayTimeInterval {\n /** Start time of the interval in HH:mm:ss format */\n startTime: string\n\n /** End time of the interval in HH:mm:ss format */\n endTime: string\n\n /** Duration of the interval in seconds */\n duration: number\n\n /** Indicates if the interval starts at the beginning of an hour */\n isHourStart: boolean\n}\n\nexport interface GetDayTimeIntervalsInput {\n /** Start time in HH:mm:ss format */\n startTime: string\n\n /** End time in HH:mm:ss format, end of the day by default */\n endTime?: string\n\n /** Interval in minutes, 60 by default */\n intervalMinutes?: number\n}\n\nexport function getDayTimeIntervals({\n startTime,\n endTime,\n intervalMinutes: _intervalMinutes = 60,\n}: GetDayTimeIntervalsInput): DayTimeInterval[] {\n const intervalMinutes = clampIntervalMinutes(_intervalMinutes)\n\n const start = parseTimeString(startTime)\n const end = endTime ? parseTimeString(endTime) : { hours: 23, minutes: 59, seconds: 59 }\n\n const startSeconds = start.hours * 3600 + start.minutes * 60 + start.seconds\n const endSeconds = end.hours * 3600 + end.minutes * 60 + end.seconds\n const intervalSeconds = intervalMinutes * 60\n\n const intervals: DayTimeInterval[] = []\n let currentSeconds = startSeconds\n\n while (currentSeconds < endSeconds) {\n const intervalStartSeconds = currentSeconds\n let intervalEndSeconds = currentSeconds + intervalSeconds\n\n if (intervalEndSeconds > endSeconds) {\n intervalEndSeconds = endSeconds\n }\n\n const startHours = Math.floor(intervalStartSeconds / 3600)\n const startMinutes = Math.floor((intervalStartSeconds % 3600) / 60)\n const startSecs = intervalStartSeconds % 60\n\n const endHours = Math.floor(intervalEndSeconds / 3600)\n const endMinutes = Math.floor((intervalEndSeconds % 3600) / 60)\n const endSecs = intervalEndSeconds % 60\n\n const durationSeconds = intervalEndSeconds - intervalStartSeconds\n const isHourStart = startMinutes === 0 && startSecs === 0\n\n intervals.push({\n startTime: toTimeString({ hours: startHours, minutes: startMinutes, seconds: startSecs }),\n endTime: toTimeString({ hours: endHours, minutes: endMinutes, seconds: endSecs }),\n duration: durationSeconds,\n isHourStart,\n })\n\n currentSeconds = intervalEndSeconds\n }\n\n return intervals\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue } from '../../types'\n\nexport function toDateString(date: AnyDateValue): DateStringValue {\n return dayjs(date).format('YYYY-MM-DD 00:00:00')\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, DayOfWeek } from '../../types'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\nimport { toDateString } from '../to-date-string/to-date-string'\n\nexport interface GetWeekDaysInput {\n /** Week to generate days for */\n week: AnyDateValue\n\n /** Indices of weekend days, 0-6, where 0 is Sunday and 6 is Saturday. The default value is defined by `DatesProvider`. */\n weekendDays?: DayOfWeek[]\n\n /** If set to false, weekend days are hidden @default true */\n withWeekendDays?: boolean\n\n /** Number 0-6, where 0 – Sunday and 6 – Saturday @default 1 */\n firstDayOfWeek?: DayOfWeek\n}\n\n/** Returns a list of days in a given week */\nexport function getWeekDays({\n week,\n weekendDays,\n withWeekendDays = true,\n firstDayOfWeek = 1,\n}: GetWeekDaysInput): DateStringValue[] {\n const days: DateStringValue[] = []\n\n let current = dayjs(getStartOfWeek({ date: week, firstDayOfWeek }))\n\n for (let i = 0; i < 7; i += 1) {\n const dayOfWeek = current.day()\n const isWeekend = weekendDays && weekendDays.includes(dayOfWeek as DayOfWeek)\n\n if (!isWeekend || withWeekendDays) {\n days.push(toDateString(current))\n }\n\n current = current.add(1, 'day')\n }\n\n return days\n}\n","import dayjs from 'dayjs'\nimport { DateLabelFormat } from '../../types'\nimport { formatDate } from '../format-date/format-date'\n\ninterface GetMonthsListInput {\n locale: string\n format: DateLabelFormat\n}\n\ninterface MonthData {\n month: number\n name: string\n}\n\nexport function getMonthsList({ locale, format }: GetMonthsListInput) {\n const months: MonthData[] = []\n const date = dayjs().locale(locale).startOf('year')\n\n for (let i = 0; i < 12; i++) {\n months.push({ month: i, name: formatDate({ date: date.add(i, 'month'), format, locale }) })\n }\n\n return months\n}\n","interface GetYearsListInput {\n startYear: number\n endYear: number\n}\n\nexport function getYearsList({ startYear, endYear }: GetYearsListInput) {\n const years: number[] = []\n\n for (let year = startYear; year <= endYear; year++) {\n years.push(year)\n }\n\n return years\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, DayOfWeek } from '../../types'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\nimport { toDateString } from '../to-date-string/to-date-string'\n\nexport function nextWeek(date: AnyDateValue, firstDayOfWeek: DayOfWeek): DateStringValue {\n const start = getStartOfWeek({ date, firstDayOfWeek })\n return toDateString(dayjs(start).set('date', dayjs(start).date() + 7))\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, DayOfWeek } from '../../types'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\nimport { toDateString } from '../to-date-string/to-date-string'\n\nexport function previousWeek(date: AnyDateValue, firstDayOfWeek: DayOfWeek): DateStringValue {\n const start = getStartOfWeek({ date, firstDayOfWeek })\n return toDateString(dayjs(start).set('date', dayjs(start).date() - 7))\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\nimport { clampIntervalMinutes } from '../clamp-interval-minutes/clamp-interval-minutes'\n\ninterface GetCurrentTimePositionInput {\n startTime?: string\n endTime?: string\n now?: AnyDateValue\n\n /** Number of minutes per time slot. Used to align the indicator to whole slots when `endTime` does not divide evenly. */\n intervalMinutes?: number\n}\n\nexport function getCurrentTimePosition(input?: GetCurrentTimePositionInput) {\n const now = dayjs(input?.now)\n\n if (!input?.startTime || !input?.endTime) {\n const startOf = now.startOf('date')\n const diffInMinutes = now.diff(startOf, 'minute')\n return (diffInMinutes / 1440) * 100\n }\n\n const [startHour, startMinute, startSecond = 0] = input.startTime.split(':').map(Number)\n const [endHour, endMinute, endSecond = 0] = input.endTime.split(':').map(Number)\n\n const startOfDay = now.startOf('date')\n const startDateTime = startOfDay.hour(startHour).minute(startMinute).second(startSecond)\n const endDateTime = startOfDay.hour(endHour).minute(endMinute).second(endSecond)\n\n const literalSeconds = endDateTime.diff(startDateTime, 'second')\n const intervalSeconds =\n input.intervalMinutes !== undefined\n ? clampIntervalMinutes(input.intervalMinutes) * 60\n : undefined\n const totalSeconds = intervalSeconds\n ? Math.ceil(literalSeconds / intervalSeconds) * intervalSeconds\n : literalSeconds\n const currentSeconds = now.diff(startDateTime, 'second')\n\n return (currentSeconds / totalSeconds) * 100\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\nimport { parseTimeString } from '../parse-time-string/parse-time-string'\n\ninterface IsInTimeRangeInput {\n date: AnyDateValue\n startTime?: string\n endTime?: string\n}\n\n/** Returns true if the given date's time is within the specified time range */\nexport function isInTimeRange({\n date,\n startTime = '00:00:00',\n endTime = '23:59:59',\n}: IsInTimeRangeInput) {\n const targetDate = dayjs(date)\n const parsedStartTime = parseTimeString(startTime)\n const parsedEndTime = parseTimeString(endTime)\n\n const startDateTime = targetDate\n .hour(parsedStartTime.hours)\n .minute(parsedStartTime.minutes)\n .second(parsedStartTime.seconds)\n\n const endDateTime = targetDate\n .hour(parsedEndTime.hours)\n .minute(parsedEndTime.minutes)\n .second(parsedEndTime.seconds)\n\n return targetDate.isAfter(startDateTime) && targetDate.isBefore(endDateTime)\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, ScheduleEventData } from '../../types'\n\ninterface IsAllDayEventInput {\n event: ScheduleEventData\n date: AnyDateValue\n}\n\nexport function isAllDayEvent({ event, date }: IsAllDayEventInput) {\n const dayStart = dayjs(date).startOf('day')\n const nextDayStart = dayStart.add(1, 'day')\n const sameDayEnd = nextDayStart.subtract(1, 'second')\n const startTime = dayjs(event.start)\n const endTime = dayjs(event.end)\n\n return startTime.isSame(dayStart) && (endTime.isSame(nextDayStart) || endTime.isSame(sameDayEnd))\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\n\nexport function validateEvent(eventData: ScheduleEventData) {\n if (!dayjs(eventData.start).isValid()) {\n throw new Error(`[@mantine/schedule] Invalid start date for event id: ${eventData.id}`)\n }\n\n if (!dayjs(eventData.end).isValid()) {\n throw new Error(`[@mantine/schedule] Invalid end date for event id: ${eventData.id}`)\n }\n\n if (dayjs(eventData.end).isBefore(dayjs(eventData.start))) {\n throw new Error(\n `[@mantine/schedule] Event end date is before start date for event id: ${eventData.id}`,\n )\n }\n\n return eventData\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\n\n/** Sorts events by start time, then by duration (longer first) */\nexport function sortEvents<T extends ScheduleEventData>(events: T[]): T[] {\n return [...events].sort((a: T, b: T) => {\n const startDiff = dayjs(a.start).diff(dayjs(b.start))\n\n if (startDiff !== 0) {\n return startDiff\n }\n\n return dayjs(b.end).diff(dayjs(b.start)) - dayjs(a.end).diff(dayjs(a.start))\n })\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\n\n/** Returns true if two events overlap in time */\nexport function isEventsOverlap(event1: ScheduleEventData, event2: ScheduleEventData) {\n const start1 = dayjs(event1.start).valueOf()\n const end1 = dayjs(event1.end).valueOf()\n const start2 = dayjs(event2.start).valueOf()\n const end2 = dayjs(event2.end).valueOf()\n return start1 < end2 && start2 < end1\n}\n","interface GetVisibleEventsInput {\n maxEvents: number\n totalEvents: number\n}\n\nexport function getVisibleEvents({ maxEvents, totalEvents }: GetVisibleEventsInput) {\n if (totalEvents <= maxEvents) {\n return {\n visibleEventsCount: totalEvents,\n hiddenEventsCount: 0,\n }\n }\n\n return {\n visibleEventsCount: maxEvents - 1,\n hiddenEventsCount: totalEvents - (maxEvents - 1),\n }\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\n\nexport function isMultidayEvent(event: ScheduleEventData) {\n const startDate = dayjs(event.start).startOf('day')\n const rawEnd = dayjs(event.end)\n const endAtMidnight = rawEnd.hour() === 0 && rawEnd.minute() === 0 && rawEnd.second() === 0\n const endDate = endAtMidnight ? rawEnd.startOf('day').subtract(1, 'day') : rawEnd.startOf('day')\n return endDate.isAfter(startDate)\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\nimport { isMultidayEvent } from '../is-multiday-event/is-multiday-event'\n\ninterface IsEventInTimeRangeInput {\n event: ScheduleEventData\n startTime?: string\n endTime?: string\n}\n\nfunction spansFullDay(event: ScheduleEventData) {\n const start = dayjs(event.start)\n const end = dayjs(event.end)\n if (!start.isSame(start.startOf('day'))) {\n return false\n }\n const nextDayStart = start.startOf('day').add(1, 'day')\n return end.isSame(nextDayStart) || end.isSame(nextDayStart.subtract(1, 'second'))\n}\n\nexport function isEventInTimeRange({ event, startTime, endTime }: IsEventInTimeRangeInput) {\n if (isMultidayEvent(event) || spansFullDay(event)) {\n return true\n }\n\n if (!startTime || !endTime) {\n return true\n }\n\n const [startHour, startMinute] = startTime.split(':').map(Number)\n const [endHour, endMinute] = endTime.split(':').map(Number)\n const timeWindowStartMinutes = startHour * 60 + startMinute\n const timeWindowEndMinutes = endHour * 60 + endMinute\n\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n const eventStartMinutes = eventStart.hour() * 60 + eventStart.minute()\n const eventEndMinutes = eventEnd.hour() * 60 + eventEnd.minute()\n\n return !(eventEndMinutes <= timeWindowStartMinutes || eventStartMinutes >= timeWindowEndMinutes)\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\n\ninterface IsWithinWeekInput {\n event: ScheduleEventData\n targetWeek: AnyDateValue\n firstDayOfWeek: DayOfWeek\n}\n\nexport function isWithinWeek({ event, targetWeek, firstDayOfWeek }: IsWithinWeekInput) {\n const startOfWeek = dayjs(getStartOfWeek({ date: targetWeek, firstDayOfWeek }))\n const endOfWeek = startOfWeek.add(7, 'day')\n return dayjs(event.start).isBefore(endOfWeek) && dayjs(event.end).isAfter(startOfWeek)\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek } from '../../types'\nimport { getMonthDays } from '../get-month-days/get-month-days'\nimport { toDateString } from '../to-date-string/to-date-string'\n\ninterface GetMonthRangeInput {\n month: AnyDateValue\n withOutsideDays: boolean | undefined\n consistentWeeks: boolean | undefined\n firstDayOfWeek: DayOfWeek\n}\n\n/** Returns start and end dates as displayed in MonthView */\nexport function getMonthRange({\n month,\n withOutsideDays,\n consistentWeeks,\n firstDayOfWeek,\n}: GetMonthRangeInput) {\n if (!withOutsideDays) {\n return {\n start: toDateString(dayjs(month).startOf('month')),\n end: toDateString(dayjs(month).endOf('month')),\n }\n }\n\n const days = getMonthDays({ month, firstDayOfWeek, consistentWeeks })\n\n return {\n start: days[0][0],\n end: days[days.length - 1][6],\n }\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\nimport { clampIntervalMinutes } from '../clamp-interval-minutes/clamp-interval-minutes'\nimport { parseTimeString } from '../parse-time-string/parse-time-string'\n\ninterface GetDayPositionInput {\n /** Event data to calculate position for */\n event: ScheduleEventData\n\n /** Start time boundary for the day in HH:mm:ss format, `00:00:00` by default */\n startTime?: string\n\n /** End time boundary for the day in HH:mm:ss format, `23:59:59` by default */\n endTime?: string\n\n /** Number of minutes per time slot, `60` by default. Used to align the canvas to whole slots when `endTime` does not divide evenly. */\n intervalMinutes?: number\n}\n\n/** Calculates day position within given start and end time boundaries. Returns top and height in percentages. */\nexport function getDayPosition({\n event,\n startTime = '00:00:00',\n endTime = '23:59:59',\n intervalMinutes = 60,\n}: GetDayPositionInput) {\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n\n const parsedStartTime = parseTimeString(startTime)\n const parsedEndTime = parseTimeString(endTime)\n\n const startOfDay = eventStart.startOf('date')\n const boundaryStart = startOfDay\n .hour(parsedStartTime.hours)\n .minute(parsedStartTime.minutes)\n .second(parsedStartTime.seconds)\n const literalEnd = startOfDay\n .hour(parsedEndTime.hours)\n .minute(parsedEndTime.minutes)\n .second(parsedEndTime.seconds)\n\n const intervalSeconds = clampIntervalMinutes(intervalMinutes) * 60\n const literalRangeSeconds = literalEnd.diff(boundaryStart, 'second')\n const totalSeconds = Math.ceil(literalRangeSeconds / intervalSeconds) * intervalSeconds\n\n const clippedEventStart = eventStart.isBefore(boundaryStart) ? boundaryStart : eventStart\n const eventStartSeconds = clippedEventStart.diff(boundaryStart, 'second')\n\n const clippedEventEnd = eventEnd.isAfter(literalEnd) ? literalEnd : eventEnd\n const eventEndSeconds = clippedEventEnd.diff(boundaryStart, 'second')\n\n const startPercent = (eventStartSeconds / totalSeconds) * 100\n const endPercent = (eventEndSeconds / totalSeconds) * 100\n\n return {\n top: startPercent,\n height: endPercent - startPercent,\n }\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, ScheduleEventData } from '../../types'\nimport { parseTimeString } from '../parse-time-string/parse-time-string'\n\nexport interface CalculateDropTimeInput {\n /** The event being dragged */\n draggedEvent: ScheduleEventData\n\n /** Target date where event will be dropped */\n targetDate: AnyDateValue\n\n /** Target time slot start time in HH:mm:ss format */\n targetSlotTime: string\n\n /** Mouse Y position relative to the slot */\n mouseYOffset?: number\n\n /** Height of one slot in pixels */\n slotHeight?: number\n\n /** Minutes per slot */\n intervalMinutes?: number\n}\n\nexport interface CalculateDropTimeResult {\n /** New start date/time for the event */\n start: Date\n\n /** New end date/time for the event */\n end: Date\n}\n\nexport function calculateDropTime({\n draggedEvent,\n targetDate,\n targetSlotTime,\n mouseYOffset = 0,\n slotHeight = 64,\n intervalMinutes = 15,\n}: CalculateDropTimeInput): CalculateDropTimeResult {\n const eventDuration = dayjs(draggedEvent.end).diff(dayjs(draggedEvent.start), 'millisecond')\n\n const parsedTime = parseTimeString(targetSlotTime)\n const targetDay = dayjs(targetDate).startOf('day')\n\n const baseTargetTime = targetDay.hour(parsedTime.hours).minute(parsedTime.minutes).second(0)\n\n let finalTargetTime = baseTargetTime\n\n if (mouseYOffset > 0 && slotHeight > 0) {\n const offsetRatio = mouseYOffset / slotHeight\n const offsetMinutes = Math.round(offsetRatio * intervalMinutes)\n finalTargetTime = baseTargetTime.add(offsetMinutes, 'minute')\n }\n\n const newStart = finalTargetTime.toDate()\n const newEnd = finalTargetTime.add(eventDuration, 'millisecond').toDate()\n\n return {\n start: newStart,\n end: newEnd,\n }\n}\n","import dayjs from 'dayjs'\nimport { DateStringValue, ScheduleEventData } from '../../types'\n\nexport interface CalculateMonthDropDateInput {\n /** The event being dragged */\n draggedEvent: ScheduleEventData\n\n /** The target day where the event is being dropped */\n targetDay: DateStringValue\n}\n\nexport interface CalculateMonthDropDateResult {\n /** New start date for the event */\n start: Date\n\n /** New end date for the event */\n end: Date\n}\n\nexport function calculateMonthDropDate({\n draggedEvent,\n targetDay,\n}: CalculateMonthDropDateInput): CalculateMonthDropDateResult {\n const eventDuration = dayjs(draggedEvent.end).diff(dayjs(draggedEvent.start), 'millisecond')\n\n const originalStartTime = dayjs(draggedEvent.start)\n const targetDayStart = dayjs(targetDay).startOf('day')\n\n const newStart = targetDayStart\n .hour(originalStartTime.hour())\n .minute(originalStartTime.minute())\n .second(originalStartTime.second())\n .millisecond(originalStartTime.millisecond())\n\n const newEnd = newStart.add(eventDuration, 'millisecond')\n\n return {\n start: newStart.toDate(),\n end: newEnd.toDate(),\n }\n}\n","import { DayOfWeek } from '../../types'\n\n/** Business hours range in `HH:mm:ss` format */\nexport type BusinessHoursRange = [string, string]\n\n/** Per-day business hours map keyed by day of the week (0 – Sunday, 6 – Saturday). `null` marks a day as fully outside business hours. */\nexport type BusinessHoursPerDay = Partial<Record<DayOfWeek, BusinessHoursRange | null>>\n\n/** Business hours value – tuple applies to every day, record configures business hours per day */\nexport type BusinessHoursValue = BusinessHoursRange | BusinessHoursPerDay\n\nexport interface GetBusinessHoursModInput {\n time: string\n businessHours?: BusinessHoursValue\n highlightBusinessHours?: boolean\n dayOfWeek?: DayOfWeek\n}\n\nexport interface BusinessHoursMod {\n 'business-hours': boolean\n 'non-business-hours': boolean\n}\n\nfunction isBusinessHoursRange(value: BusinessHoursValue): value is BusinessHoursRange {\n return (\n Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'string' &&\n typeof value[1] === 'string'\n )\n}\n\n/**\n * Determines if a given time is within business hours and returns modifier object\n * @param time - Time string in HH:mm:ss format\n * @param businessHours - Tuple of [start, end] times in HH:mm:ss format, or per-day record keyed by day of the week\n * @param highlightBusinessHours - Whether to highlight business hours\n * @param dayOfWeek - Day of the week (0 – Sunday, 6 – Saturday), used to resolve per-day business hours\n * @returns Modifier object for styling business/non-business hours\n */\nexport function getBusinessHoursMod({\n time,\n businessHours,\n highlightBusinessHours,\n dayOfWeek,\n}: GetBusinessHoursModInput): BusinessHoursMod {\n if (!highlightBusinessHours || !businessHours) {\n return {\n 'business-hours': false,\n 'non-business-hours': false,\n }\n }\n\n let range: [string, string] | null\n if (isBusinessHoursRange(businessHours)) {\n range = businessHours\n } else {\n if (dayOfWeek === undefined) {\n return {\n 'business-hours': false,\n 'non-business-hours': false,\n }\n }\n range = businessHours[dayOfWeek] ?? null\n }\n\n if (!range) {\n return {\n 'business-hours': false,\n 'non-business-hours': true,\n }\n }\n\n const [start, end] = range\n const isInBusinessHours = time >= start && time < end\n\n return {\n 'business-hours': isInBusinessHours,\n 'non-business-hours': !isInBusinessHours,\n }\n}\n","import dayjs from 'dayjs'\nimport * as rruleAll from 'rrule'\n\nfunction resolveRRule(ns: Record<string, unknown>): typeof rruleAll.RRule {\n const interop = (ns.default ?? ns) as typeof rruleAll\n return interop.RRule\n}\nconst RRule = resolveRRule(rruleAll as unknown as Record<string, unknown>)\nimport { DateTimeStringValue, ScheduleEventData, ScheduleRecurrenceData } from '../../types'\nimport { validateEvent } from '../validate-event/validate-event'\n\ninterface ExpandRecurringEventsInput {\n events: ScheduleEventData[] | undefined\n rangeStart: Date | string\n rangeEnd: Date | string\n expansionLimit?: number\n}\n\nfunction getRecurrenceKey(recurringEventId: string | number, recurrenceId: DateTimeStringValue) {\n return `${recurringEventId}::${recurrenceId}`\n}\n\nfunction overlapsRange(\n eventStart: dayjs.Dayjs,\n eventEnd: dayjs.Dayjs,\n rangeStart: dayjs.Dayjs,\n rangeEnd: dayjs.Dayjs,\n) {\n return (\n (eventEnd.isAfter(rangeStart) || eventEnd.isSame(rangeStart)) &&\n (eventStart.isBefore(rangeEnd) || eventStart.isSame(rangeEnd))\n )\n}\n\nfunction getExdateSet(recurrence: ScheduleRecurrenceData | undefined) {\n if (!recurrence?.exdate) {\n return new Set<string>()\n }\n\n const values = recurrence.exdate\n .map((value) => dayjs(value))\n .filter((value) => value.isValid())\n .map((value) => value.format('YYYY-MM-DD HH:mm:ss'))\n\n return new Set(values)\n}\n\nfunction getRRuleString(rule: string) {\n const normalized = rule.trim()\n if (!normalized.includes('\\n')) {\n return normalized.startsWith('RRULE:') ? normalized.replace(/^RRULE:/, '') : normalized\n }\n\n const rruleLine = normalized\n .split('\\n')\n .map((line) => line.trim())\n .find((line) => line.startsWith('RRULE:'))\n\n return rruleLine ? rruleLine.replace(/^RRULE:/, '') : normalized\n}\n\nfunction getOccurrenceStartsInRange(\n event: ScheduleEventData,\n rangeStart: dayjs.Dayjs,\n rangeEnd: dayjs.Dayjs,\n expansionLimit: number,\n durationMs: number,\n) {\n const dtstart = dayjs(event.recurrence?.dtstart || event.start)\n if (!dtstart.isValid() || !event.recurrence) {\n return []\n }\n\n try {\n const options = RRule.parseString(getRRuleString(event.recurrence.rrule))\n options.dtstart = dtstart.toDate()\n const rule = new RRule(options)\n\n const searchStart = rangeStart.subtract(Math.max(0, durationMs), 'millisecond').toDate()\n const results = rule.between(searchStart, rangeEnd.toDate(), true)\n return results.slice(0, expansionLimit).map((value) => dayjs(value))\n } catch {\n return []\n }\n}\n\nfunction isEventInRange(event: ScheduleEventData, rangeStart: dayjs.Dayjs, rangeEnd: dayjs.Dayjs) {\n const start = dayjs(event.start)\n const end = dayjs(event.end)\n\n if (!start.isValid() || !end.isValid()) {\n return false\n }\n\n return overlapsRange(start, end, rangeStart, rangeEnd)\n}\n\nfunction createGeneratedInstance(\n event: ScheduleEventData,\n occurrenceStart: dayjs.Dayjs,\n durationMs: number,\n): ScheduleEventData {\n const occurrenceEnd = occurrenceStart.add(durationMs, 'millisecond')\n const recurrenceId = occurrenceStart.format('YYYY-MM-DD HH:mm:ss')\n const { recurrence: _recurrence, ...eventWithoutRecurrence } = event\n\n return {\n ...eventWithoutRecurrence,\n id: `${event.id}::${recurrenceId}`,\n start: occurrenceStart.format('YYYY-MM-DD HH:mm:ss'),\n end: occurrenceEnd.format('YYYY-MM-DD HH:mm:ss'),\n recurringEventId: event.id,\n recurrenceId,\n recurringInstance: {\n isRecurringInstance: true,\n recurringEventId: event.id,\n recurrenceId,\n originalStart: occurrenceStart.format('YYYY-MM-DD HH:mm:ss'),\n originalEnd: occurrenceEnd.format('YYYY-MM-DD HH:mm:ss'),\n },\n }\n}\n\nconst DEFAULT_EXPANSION_LIMIT = 2000\n\nexport function expandRecurringEvents({\n events,\n rangeStart,\n rangeEnd,\n expansionLimit = DEFAULT_EXPANSION_LIMIT,\n}: ExpandRecurringEventsInput): ScheduleEventData[] {\n if (!events || events.length === 0) {\n return []\n }\n\n const start = dayjs(rangeStart)\n const end = dayjs(rangeEnd)\n\n if (!start.isValid() || !end.isValid()) {\n return []\n }\n\n const regularEvents: ScheduleEventData[] = []\n const recurringEvents: ScheduleEventData[] = []\n const overrides = new Map<string, ScheduleEventData>()\n\n for (const event of events) {\n if (event.recurringEventId && event.recurrenceId) {\n overrides.set(getRecurrenceKey(event.recurringEventId, event.recurrenceId), event)\n continue\n }\n\n if (event.recurrence?.rrule) {\n recurringEvents.push(event)\n continue\n }\n\n regularEvents.push(event)\n }\n\n const output: ScheduleEventData[] = []\n const consumedOverrideIds = new Set<string | number>()\n\n for (const event of regularEvents) {\n if (isEventInRange(event, start, end)) {\n output.push(validateEvent(event))\n }\n }\n\n for (const event of recurringEvents) {\n const eventStart = dayjs(event.recurrence?.dtstart || event.start)\n const eventEnd = dayjs(event.end)\n\n if (!eventStart.isValid() || !eventEnd.isValid()) {\n continue\n }\n\n const durationMs = eventEnd.diff(dayjs(event.start), 'millisecond')\n if (durationMs < 0) {\n continue\n }\n\n const exdate = getExdateSet(event.recurrence)\n const starts = getOccurrenceStartsInRange(event, start, end, expansionLimit, durationMs)\n\n for (const occurrenceStart of starts) {\n const recurrenceId = occurrenceStart.format('YYYY-MM-DD HH:mm:ss')\n if (exdate.has(recurrenceId)) {\n continue\n }\n\n const overrideKey = getRecurrenceKey(event.id, recurrenceId)\n const override = overrides.get(overrideKey)\n if (override) {\n if (isEventInRange(override, start, end)) {\n output.push(validateEvent(override))\n consumedOverrideIds.add(override.id)\n }\n continue\n }\n\n const generated = createGeneratedInstance(event, occurrenceStart, durationMs)\n if (overlapsRange(dayjs(generated.start), dayjs(generated.end), start, end)) {\n output.push(validateEvent(generated))\n }\n }\n }\n\n for (const override of overrides.values()) {\n if (consumedOverrideIds.has(override.id)) {\n continue\n }\n if (isEventInRange(override, start, end)) {\n output.push(validateEvent(override))\n }\n }\n\n return output\n}\n\nexport { DEFAULT_EXPANSION_LIMIT }\n","import type { ScheduleResourceData, ScheduleResourceGroup } from '../../types'\n\nexport interface GroupRange {\n group: ScheduleResourceGroup\n startIndex: number\n count: number\n}\n\nexport interface ResourceGroupInfo {\n group: ScheduleResourceGroup\n position: 'first' | 'middle' | 'last' | 'only'\n count: number\n}\n\nexport interface OrderedResourcesResult {\n orderedResources: ScheduleResourceData[]\n groupRanges: GroupRange[]\n resourceGroupMap: Array<ResourceGroupInfo | null>\n}\n\nexport function getOrderedResources(\n resources: ScheduleResourceData[],\n groups: ScheduleResourceGroup[] | undefined,\n): OrderedResourcesResult {\n if (!groups?.length) {\n return { orderedResources: resources, groupRanges: [], resourceGroupMap: [] }\n }\n\n const resourceMap = new Map(resources.map((resource) => [resource.id, resource]))\n const usedIds = new Set<string | number>()\n const orderedResources: ScheduleResourceData[] = []\n const groupRanges: GroupRange[] = []\n\n groups.forEach((group) => {\n const startIndex = orderedResources.length\n group.resourceIds.forEach((id) => {\n const resource = resourceMap.get(id)\n if (resource && !usedIds.has(id)) {\n orderedResources.push(resource)\n usedIds.add(id)\n }\n })\n const count = orderedResources.length - startIndex\n if (count) groupRanges.push({ group, startIndex, count })\n })\n\n resources.forEach((resource) => {\n if (!usedIds.has(resource.id)) orderedResources.push(resource)\n })\n\n const resourceGroupMap: Array<ResourceGroupInfo | null> = Array(orderedResources.length).fill(\n null,\n )\n groupRanges.forEach(({ group, startIndex, count }) => {\n for (let index = 0; index < count; index += 1) {\n const position: ResourceGroupInfo['position'] =\n count === 1 ? 'only' : index === 0 ? 'first' : index === count - 1 ? 'last' : 'middle'\n resourceGroupMap[startIndex + index] = { group, position, count }\n }\n })\n\n return { orderedResources, groupRanges, resourceGroupMap }\n}\n","import type { ScheduleResourceData } from '../../types'\n\nexport function getGroupToResourceIdMap(\n resources: ScheduleResourceData[],\n): Map<string, string | number> {\n return new Map(resources.map((resource) => [String(resource.id), resource.id]))\n}\n","export type ResourcesGridControls = Array<Array<HTMLButtonElement | undefined>>\n\nexport interface HandleResourcesGridKeyDownInput {\n controls: ResourcesGridControls\n resourceIndex: number\n slotIndex: number\n event: KeyboardEvent\n}\n\nexport function handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex,\n event,\n}: HandleResourcesGridKeyDownInput): void {\n const deltas: Record<string, [number, number]> = {\n ArrowLeft: [0, -1],\n ArrowRight: [0, 1],\n ArrowUp: [-1, 0],\n ArrowDown: [1, 0],\n }\n const delta = deltas[event.key]\n if (!delta) return\n event.preventDefault()\n\n let row = resourceIndex + delta[0]\n let column = slotIndex + delta[1]\n while (row >= 0 && row < controls.length) {\n const rowControls = controls[row] || []\n if (delta[0] !== 0) column = Math.min(column, rowControls.length - 1)\n if (column < 0 || column >= rowControls.length) return\n const control = rowControls[column]\n if (control && !control.disabled && !control.hasAttribute('data-hidden')) {\n control.focus()\n return\n }\n row += delta[0]\n column += delta[1]\n }\n}\n","import dayjs from 'dayjs'\nimport { computed, onScopeDispose, type ComputedRef } from 'vue'\nimport type { EventSlots, RenderEvent, RenderEventBody } from '../component-props'\nimport type {\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n} from '../types'\nimport { expandRecurringEvents, formatDate, toDateString } from '../utils'\n\n/**\n * Resolves a schedule `radius` prop to a CSS value.\n *\n * Deliberately not `getRadius` from the core package: this accepts any CSS length\n * (`12px`, `1em`, `clamp(...)`) alongside the `theme.radius` keys, and treats a plain\n * number as pixels rather than rem.\n */\nexport function resolveScheduleRadius(radius: string | number | undefined): string | undefined {\n if (radius === undefined) {\n return undefined\n }\n\n if (typeof radius === 'number') {\n return `${radius}px`\n }\n\n return ['xs', 'sm', 'md', 'lg', 'xl'].includes(radius)\n ? `var(--mantine-radius-${radius})`\n : radius\n}\n\n/** A callback coalesced to one animation frame, with the pending frame cancellable. */\nexport interface RafThrottled<Args extends unknown[]> {\n (...args: Args): void\n\n /** Drops the pending frame. Call this the moment the gesture ends. */\n cancel: () => void\n}\n\n/**\n * Runs `callback` at most once per animation frame with the most recent arguments.\n *\n * Pointer and drag events fire far faster than the browser paints. Handling every one of them\n * means the schedule reads layout and re-renders several times per frame, which makes the drag\n * fall behind the pointer and keep catching up after it has stopped. Coalescing to one frame\n * keeps the work bounded, and `cancel` guarantees nothing lands after the drop.\n */\nexport function rafThrottle<Args extends unknown[]>(\n callback: (...args: Args) => void,\n): RafThrottled<Args> {\n let frame = 0\n let pending: Args | null = null\n\n const run = () => {\n frame = 0\n const args = pending\n pending = null\n\n if (args) {\n callback(...args)\n }\n }\n\n const throttled = ((...args: Args) => {\n pending = args\n\n if (frame === 0) {\n frame = requestAnimationFrame(run)\n }\n }) as RafThrottled<Args>\n\n throttled.cancel = () => {\n if (frame !== 0) {\n cancelAnimationFrame(frame)\n }\n\n frame = 0\n pending = null\n }\n\n onScopeDispose(throttled.cancel, true)\n\n return throttled\n}\n\n/**\n * Styles produced by `getStyles` for one selector. `any` matches the core signature: the value\n * is spread onto an element, where `class` and `style` accept every shape Vue supports.\n */\nexport type SelectorStyles = { class: any; style: any }\n\n/**\n * Memoizes `getStyles(selector)` for selectors that take no per-element options.\n *\n * A view renders the same selector for hundreds of slots, and every `getStyles` call rebuilds\n * the class list and merges the resolved styles and CSS variables. Wrapping each selector in a\n * `computed` turns that into one evaluation per selector per change of the theme or the props,\n * instead of one per element per render — which is what a drag re-render is made of.\n */\nexport function useStaticStyles<Selector extends string>(\n getStyles: (selector: Selector) => SelectorStyles,\n) {\n const cache = new Map<Selector, ComputedRef<SelectorStyles>>()\n\n return (selector: Selector): SelectorStyles => {\n let entry = cache.get(selector)\n\n if (!entry) {\n entry = computed(() => getStyles(selector))\n cache.set(selector, entry)\n }\n\n return entry.value\n }\n}\n\n/** Converts a `slotHeight` / `rowHeight` style prop to a CSS length. */\nexport function cssSize(value: string | number | undefined): string | undefined {\n return typeof value === 'number' ? `${value}px` : value\n}\n\nexport function getExpandedEvents(\n events: ScheduleEventData[] | undefined,\n rangeStart: Date | string,\n rangeEnd: Date | string,\n expansionLimit: number,\n) {\n return expandRecurringEvents({ events, rangeStart, rangeEnd, expansionLimit })\n}\n\nexport function formatLabel(\n date: Date | string,\n locale: string | undefined,\n format: DateLabelFormat,\n) {\n return formatDate({ date, locale: locale || 'en', format })\n}\n\n/** The `renderEvent` / `renderEventBody` pair a view hands down to `ScheduleEvent`. */\nexport interface EventRenderers {\n renderEvent?: RenderEvent\n renderEventBody?: RenderEventBody\n}\n\n/**\n * Folds the `event` / `eventBody` scoped slots into the equivalent render props, so a view\n * forwards a single object down to every `ScheduleEvent` it renders instead of re-declaring\n * the slots at each call site. Slots win over props, matching the rest of the library.\n */\nexport function resolveEventRenderers(props: EventRenderers, slots: EventSlots): EventRenderers {\n return {\n renderEvent: slots.event\n ? (event, renderProps) => slots.event!({ ...renderProps, event })\n : props.renderEvent,\n renderEventBody: slots.eventBody\n ? (event) => slots.eventBody!({ event })\n : props.renderEventBody,\n }\n}\n\n/** Reads the event referenced by a native drag payload, if the drag started inside a schedule. */\nexport function getDropEvent(\n events: ScheduleEventData[] | undefined,\n transfer: DataTransfer | null,\n) {\n const raw = transfer?.getData('application/json')\n\n if (!raw) {\n return undefined\n }\n\n try {\n const data: unknown = JSON.parse(raw)\n\n if (typeof data !== 'object' || data === null || !('eventId' in data)) {\n return undefined\n }\n\n const eventId = (data as { eventId: unknown }).eventId\n\n if (typeof eventId !== 'string' && typeof eventId !== 'number') {\n return undefined\n }\n\n return events?.find((event) => String(event.id) === String(eventId))\n } catch {\n return undefined\n }\n}\n\n/**\n * Attribute the views put on their `ScrollArea` viewport so they can find it again without\n * depending on Mantine static classes, which a consumer can turn off.\n */\nexport const SCROLL_VIEWPORT_ATTRIBUTE = 'data-schedule-viewport'\n\n/** Props spread onto the viewport of a view's `ScrollArea`. */\nexport const scheduleViewportProps = { [SCROLL_VIEWPORT_ATTRIBUTE]: '' }\n\n/** Finds the `ScrollArea` viewport that contains `node`. */\nexport function getScrollAreaViewport(node: HTMLElement | null | undefined) {\n return node?.closest<HTMLElement>(`[${SCROLL_VIEWPORT_ATTRIBUTE}]`) ?? null\n}\n\n/**\n * Scrolls the viewport around `target` so that `target` sits at its start.\n *\n * The second pass runs a frame later because a `ScrollArea` viewport is still being laid out\n * on the tick it mounts, so the first offsets it reports are not final.\n */\nexport function scrollSlotIntoView(target: HTMLElement | null | undefined, axis: 'x' | 'y' = 'y') {\n const viewport = getScrollAreaViewport(target)\n\n if (!viewport || !target) {\n return\n }\n\n const scroll = () => {\n if (axis === 'x') {\n viewport.scrollLeft = target.offsetLeft\n } else {\n viewport.scrollTop = target.offsetTop\n }\n }\n\n scroll()\n requestAnimationFrame(scroll)\n}\n\nexport function moveEventTo(event: ScheduleEventData, newStart: dayjs.ConfigType) {\n const start = dayjs(event.start)\n const duration = dayjs(event.end).diff(start, 'second')\n const nextStart = dayjs(newStart)\n\n return {\n eventId: event.id,\n newStart: nextStart.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n newEnd: nextStart.add(duration, 'second').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n event,\n }\n}\n\nexport function moveEventToAllDay(event: ScheduleEventData, date: dayjs.ConfigType) {\n const dayStart = dayjs(date).startOf('day')\n const spanDays = Math.max(\n 1,\n dayjs(event.end).startOf('day').diff(dayjs(event.start).startOf('day'), 'day'),\n )\n\n return {\n eventId: event.id,\n newStart: dayStart.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n newEnd: dayStart.add(spanDays, 'day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n event,\n }\n}\n\nexport function todayString(): DateStringValue {\n return toDateString(dayjs())\n}\n","import dayjs from 'dayjs'\nimport { onBeforeUnmount, shallowRef } from 'vue'\nimport { rafThrottle } from '../components/shared'\nimport type { EventDropData } from '../component-props'\nimport type { DateTimeStringValue, ScheduleEventData, ScheduleMode } from '../types'\nimport { clampIntervalMinutes, parseTimeString } from '../utils'\n\ntype ResizeEdge = 'top' | 'bottom'\n\ninterface ResizeState {\n eventId: string | number\n event: ScheduleEventData\n edge: ResizeEdge\n container: HTMLElement\n originalTop: number\n originalHeight: number\n currentTop: number\n currentHeight: number\n eventDate: string\n originalStart: DateTimeStringValue\n originalEnd: DateTimeStringValue\n startMinutes: number\n literalRange: number\n totalMinutes: number\n intervalMinutes: number\n minHeightPercent: number\n}\n\ninterface HandleResizeStartInput {\n event: ScheduleEventData\n edge: ResizeEdge\n container: HTMLElement\n originalTop: number\n originalHeight: number\n eventDate: string\n pointerEvent: PointerEvent\n}\n\nexport interface UseEventResizeInput {\n enabled: () => boolean\n mode: () => ScheduleMode\n startTime: () => string\n endTime: () => string\n intervalMinutes: () => number\n onEventResize: (data: EventDropData) => void\n canResizeEvent: () => ((event: ScheduleEventData) => boolean) | undefined\n}\n\nexport function useEventResize(input: UseEventResizeInput) {\n const resizeState = shallowRef<ResizeState | null>(null)\n let justResized = false\n let savedUserSelect: string | null = null\n\n const clampAndSnap = (minutes: number, state: ResizeState): number => {\n const snapped = Math.round(minutes / state.intervalMinutes) * state.intervalMinutes\n return Math.max(0, Math.min(state.literalRange, snapped))\n }\n\n const snapPercent = (percent: number, state: ResizeState): number => {\n const minutes = (percent / 100) * state.totalMinutes\n return (clampAndSnap(minutes, state) / state.totalMinutes) * 100\n }\n\n const percentToDateTime = (\n percent: number,\n eventDate: string,\n state: ResizeState,\n ): DateTimeStringValue => {\n const minutes = (percent / 100) * state.totalMinutes\n const totalMinutes = state.startMinutes + clampAndSnap(minutes, state)\n const hours = Math.floor(totalMinutes / 60)\n const mins = totalMinutes % 60\n return `${eventDate} ${String(hours).padStart(2, '0')}:${String(mins).padStart(2, '0')}:00`\n }\n\n /**\n * Coalesced to one animation frame: `pointermove` outruns paint, and each step reads layout\n * and re-renders the grid. Without this the preview trails the pointer and keeps moving after\n * it stops.\n */\n const handlePointerMove = rafThrottle((clientY: number) => {\n const state = resizeState.value\n if (!state) return\n\n const containerRect = state.container.getBoundingClientRect()\n if (containerRect.height === 0) return\n\n const relativeY = clientY - containerRect.top\n const rawPercent = Math.max(0, Math.min(100, (relativeY / containerRect.height) * 100))\n const snappedPercent = snapPercent(rawPercent, state)\n let currentTop = state.originalTop\n let currentHeight = state.originalHeight\n\n if (state.edge === 'bottom') {\n currentHeight = Math.max(state.minHeightPercent, snappedPercent - state.originalTop)\n } else {\n const originalBottom = state.originalTop + state.originalHeight\n currentTop = Math.min(snappedPercent, originalBottom - state.minHeightPercent)\n currentHeight = originalBottom - currentTop\n }\n\n resizeState.value = { ...state, currentTop, currentHeight }\n })\n\n const trackPointer = (event: PointerEvent) => handlePointerMove(event.clientY)\n\n const removeDocumentListeners = () => {\n handlePointerMove.cancel()\n document.removeEventListener('pointermove', trackPointer)\n document.removeEventListener('pointerup', handlePointerUp)\n if (savedUserSelect !== null) {\n document.body.style.userSelect = savedUserSelect\n savedUserSelect = null\n }\n }\n\n const handlePointerUp = () => {\n // Drop the pending frame first, so a stale step cannot land after the gesture ended.\n handlePointerMove.cancel()\n const state = resizeState.value\n if (\n state &&\n (state.currentTop !== state.originalTop || state.currentHeight !== state.originalHeight)\n ) {\n const newStart =\n state.edge === 'top'\n ? percentToDateTime(state.currentTop, state.eventDate, state)\n : state.originalStart\n const newEnd =\n state.edge === 'bottom'\n ? percentToDateTime(state.currentTop + state.currentHeight, state.eventDate, state)\n : state.originalEnd\n\n input.onEventResize({ eventId: state.eventId, newStart, newEnd, event: state.event })\n }\n\n resizeState.value = null\n removeDocumentListeners()\n justResized = true\n requestAnimationFrame(() => {\n justResized = false\n })\n }\n\n const handleResizeStart = ({\n event,\n edge,\n container,\n originalTop,\n originalHeight,\n eventDate,\n pointerEvent,\n }: HandleResizeStartInput) => {\n if (!input.enabled() || input.mode() === 'static') return\n\n pointerEvent.preventDefault()\n pointerEvent.stopPropagation()\n\n const parsedStartTime = parseTimeString(input.startTime())\n const parsedEndTime = parseTimeString(input.endTime())\n const startMinutes = parsedStartTime.hours * 60 + parsedStartTime.minutes\n const endMinutes = parsedEndTime.hours * 60 + parsedEndTime.minutes\n const intervalMinutes = clampIntervalMinutes(input.intervalMinutes())\n const literalRange = endMinutes - startMinutes\n const totalMinutes = Math.ceil(literalRange / intervalMinutes) * intervalMinutes\n\n resizeState.value = {\n eventId: event.id,\n event,\n edge,\n container,\n originalTop,\n originalHeight,\n currentTop: originalTop,\n currentHeight: originalHeight,\n eventDate,\n originalStart: dayjs(event.start).format('YYYY-MM-DD HH:mm:ss'),\n originalEnd: dayjs(event.end).format('YYYY-MM-DD HH:mm:ss'),\n startMinutes,\n literalRange,\n totalMinutes,\n intervalMinutes,\n minHeightPercent: (intervalMinutes / totalMinutes) * 100,\n }\n\n savedUserSelect = document.body.style.userSelect\n document.body.style.userSelect = 'none'\n document.addEventListener('pointermove', trackPointer)\n document.addEventListener('pointerup', handlePointerUp)\n }\n\n const getResizePosition = (eventId: string | number) => {\n const state = resizeState.value\n return state?.eventId === eventId\n ? { top: state.currentTop, height: state.currentHeight }\n : null\n }\n\n const isResizableEvent = (event: ScheduleEventData): boolean =>\n input.enabled() &&\n input.mode() !== 'static' &&\n event.display !== 'background' &&\n (input.canResizeEvent()?.(event) ?? true)\n\n onBeforeUnmount(removeDocumentListeners)\n\n return {\n handleResizeStart,\n getResizePosition,\n isResizableEvent,\n wasResizing: () => justResized,\n }\n}\n",".currentTimeIndicator {\n --time-bubble-height: 18px;\n --thumb-size: 12px;\n --_indicator-color: var(--indicator-color, var(--mantine-color-red-7));\n\n position: absolute;\n pointer-events: none;\n left: 0;\n right: 0;\n top: var(--top-offset);\n height: 2px;\n z-index: 2;\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.currentTimeIndicatorLine {\n height: 100%;\n position: absolute;\n top: 0;\n background-color: var(--_indicator-color);\n inset-inline-start: var(--start-offset);\n inset-inline-end: var(--end-offset);\n}\n\n.currentTimeIndicatorThumb {\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 inset-inline-start: calc(var(--start-offset) - (var(--thumb-size) / 2 - 1px));\n}\n\n.currentTimeIndicatorTimeBubble {\n position: absolute;\n height: var(--time-bubble-height);\n width: var(--time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n inset-inline-start: var(--time-bubble-start-offset);\n top: calc(-1 * (var(--time-bubble-height) / 2 - 1px));\n z-index: 2;\n text-transform: uppercase;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver, getThemeColor } from '@mantine-vue/core'\n\nconst defaultProps = {\n color: 'red',\n startOffset: '0px',\n endOffset: '0px',\n topOffset: '0px',\n timeBubbleStartOffset: '0px',\n withTimeBubble: true,\n withThumb: true,\n currentTimeFormat: 'HH:mm',\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n} as const\n\n// Time-dependent values reach the module-scoped resolver through the styles context.\nconst varsResolver = createVarsResolver<any>(\n (theme, { color, startOffset, endOffset, topOffset, timeBubbleStartOffset }, ctx) => ({\n currentTimeIndicator: {\n '--indicator-color': getThemeColor(color, theme),\n '--start-offset': startOffset,\n '--end-offset': endOffset,\n '--top-offset': `calc(${ctx.offsetPercent}% + ${topOffset})`,\n '--time-bubble-start-offset': timeBubbleStartOffset,\n // A format with AM/PM needs a wider bubble than a 24h one.\n '--time-bubble-width': ctx.hasMeridiem ? '64px' : '46px',\n },\n }),\n)\n\nconst TICK_INTERVAL = 30_000\n\nexport { defaultProps, varsResolver, TICK_INTERVAL }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, onBeforeUnmount, onMounted, ref, useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { formatDate, getCurrentTimePosition, isInTimeRange } from '../../utils'\nimport type { CurrentTimeIndicatorOwnProps } from './CurrentTimeIndicator.types'\nimport classes from './CurrentTimeIndicator.module.css'\n\ndefineOptions({\n name: 'CurrentTimeIndicator',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<CurrentTimeIndicatorOwnProps>(), {\n color: undefined,\n startOffset: undefined,\n endOffset: undefined,\n topOffset: undefined,\n timeBubbleStartOffset: undefined,\n withTimeBubble: undefined,\n withThumb: undefined,\n currentTimeFormat: undefined,\n locale: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n getCurrentTime: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst attrs = useAttrs()\n\nconst props = useProps('CurrentTimeIndicator', defaultProps, rawProps)\n\n/** Bumped on every tick so the computed values below re-evaluate. */\nconst tick = ref(0)\nlet timer: ReturnType<typeof setInterval> | undefined\n\nonMounted(() => {\n timer = setInterval(() => {\n tick.value += 1\n }, TICK_INTERVAL)\n})\n\nonBeforeUnmount(() => clearInterval(timer))\n\nconst now = computed(() => {\n void tick.value\n return props.getCurrentTime ? dayjs(props.getCurrentTime()) : dayjs()\n})\n\nconst visible = computed(() =>\n isInTimeRange({ date: now.value, startTime: props.startTime, endTime: props.endTime }),\n)\n\nconst offsetPercent = computed(() =>\n getCurrentTimePosition({\n now: now.value,\n startTime: props.startTime,\n endTime: props.endTime,\n intervalMinutes: props.intervalMinutes,\n }),\n)\n\nconst formattedTime = computed(() =>\n props.withTimeBubble\n ? formatDate({\n date: now.value,\n locale: props.locale || 'en',\n format: props.currentTimeFormat!,\n })\n : '',\n)\n\nconst getStyles = useStyles({\n name: 'CurrentTimeIndicator',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'currentTimeIndicator',\n // Getters keep the context live without re-creating the styles resolver on every tick.\n stylesCtx: {\n get offsetPercent() {\n return offsetPercent.value\n },\n get hasMeridiem() {\n return String(formattedTime.value).toLowerCase().includes('m')\n },\n },\n})\n</script>\n\n<template>\n <Box v-if=\"visible\" v-bind=\"{ ...attrs, ...getStyles('currentTimeIndicator') }\">\n <div v-if=\"props.withTimeBubble\" v-bind=\"getStyles('currentTimeIndicatorTimeBubble')\">\n {{ formattedTime }}\n </div>\n <div v-if=\"props.withThumb\" v-bind=\"getStyles('currentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('currentTimeIndicatorLine')\" />\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver, getThemeColor } from '@mantine-vue/core'\n\nconst defaultProps = {\n color: 'red',\n startOffset: '0px',\n endOffset: '0px',\n topOffset: '0px',\n timeBubbleStartOffset: '0px',\n withTimeBubble: true,\n withThumb: true,\n currentTimeFormat: 'HH:mm',\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n} as const\n\n// Time-dependent values reach the module-scoped resolver through the styles context.\nconst varsResolver = createVarsResolver<any>(\n (theme, { color, startOffset, endOffset, topOffset, timeBubbleStartOffset }, ctx) => ({\n currentTimeIndicator: {\n '--indicator-color': getThemeColor(color, theme),\n '--start-offset': startOffset,\n '--end-offset': endOffset,\n '--top-offset': `calc(${ctx.offsetPercent}% + ${topOffset})`,\n '--time-bubble-start-offset': timeBubbleStartOffset,\n // A format with AM/PM needs a wider bubble than a 24h one.\n '--time-bubble-width': ctx.hasMeridiem ? '64px' : '46px',\n },\n }),\n)\n\nconst TICK_INTERVAL = 30_000\n\nexport { defaultProps, varsResolver, TICK_INTERVAL }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, onBeforeUnmount, onMounted, ref, useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { formatDate, getCurrentTimePosition, isInTimeRange } from '../../utils'\nimport type { CurrentTimeIndicatorOwnProps } from './CurrentTimeIndicator.types'\nimport classes from './CurrentTimeIndicator.module.css'\n\ndefineOptions({\n name: 'CurrentTimeIndicator',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<CurrentTimeIndicatorOwnProps>(), {\n color: undefined,\n startOffset: undefined,\n endOffset: undefined,\n topOffset: undefined,\n timeBubbleStartOffset: undefined,\n withTimeBubble: undefined,\n withThumb: undefined,\n currentTimeFormat: undefined,\n locale: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n getCurrentTime: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst attrs = useAttrs()\n\nconst props = useProps('CurrentTimeIndicator', defaultProps, rawProps)\n\n/** Bumped on every tick so the computed values below re-evaluate. */\nconst tick = ref(0)\nlet timer: ReturnType<typeof setInterval> | undefined\n\nonMounted(() => {\n timer = setInterval(() => {\n tick.value += 1\n }, TICK_INTERVAL)\n})\n\nonBeforeUnmount(() => clearInterval(timer))\n\nconst now = computed(() => {\n void tick.value\n return props.getCurrentTime ? dayjs(props.getCurrentTime()) : dayjs()\n})\n\nconst visible = computed(() =>\n isInTimeRange({ date: now.value, startTime: props.startTime, endTime: props.endTime }),\n)\n\nconst offsetPercent = computed(() =>\n getCurrentTimePosition({\n now: now.value,\n startTime: props.startTime,\n endTime: props.endTime,\n intervalMinutes: props.intervalMinutes,\n }),\n)\n\nconst formattedTime = computed(() =>\n props.withTimeBubble\n ? formatDate({\n date: now.value,\n locale: props.locale || 'en',\n format: props.currentTimeFormat!,\n })\n : '',\n)\n\nconst getStyles = useStyles({\n name: 'CurrentTimeIndicator',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'currentTimeIndicator',\n // Getters keep the context live without re-creating the styles resolver on every tick.\n stylesCtx: {\n get offsetPercent() {\n return offsetPercent.value\n },\n get hasMeridiem() {\n return String(formattedTime.value).toLowerCase().includes('m')\n },\n },\n})\n</script>\n\n<template>\n <Box v-if=\"visible\" v-bind=\"{ ...attrs, ...getStyles('currentTimeIndicator') }\">\n <div v-if=\"props.withTimeBubble\" v-bind=\"getStyles('currentTimeIndicatorTimeBubble')\">\n {{ formattedTime }}\n </div>\n <div v-if=\"props.withThumb\" v-bind=\"getStyles('currentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('currentTimeIndicatorLine')\" />\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport CurrentTimeIndicatorComponent, { varsResolver } from './CurrentTimeIndicator.vue'\nimport type { CurrentTimeIndicatorFactory } from './CurrentTimeIndicator.types'\nimport classes from './CurrentTimeIndicator.module.css'\n\nexport const CurrentTimeIndicator = factory<CurrentTimeIndicatorFactory>(\n CurrentTimeIndicatorComponent,\n { classes, varsResolver },\n)\n\nexport type {\n CurrentTimeIndicatorCssVariables,\n CurrentTimeIndicatorFactory,\n CurrentTimeIndicatorOwnProps,\n CurrentTimeIndicatorProps,\n CurrentTimeIndicatorStylesNames,\n} from './CurrentTimeIndicator.types'\n","import {\n inject,\n onScopeDispose,\n provide,\n shallowRef,\n type InjectionKey,\n type ShallowRef,\n} from 'vue'\nimport type { DropTarget, ScheduleEventData } from '../../types'\n\nexport interface DragContextValue {\n readonly draggedEvent: ScheduleEventData | null\n\n readonly dragOverTarget: DropTarget | null\n\n readonly isDragging: boolean\n\n readonly isSlotDragging: boolean\n}\n\nconst IDLE: DragContextValue = {\n draggedEvent: null,\n dragOverTarget: null,\n isDragging: false,\n isSlotDragging: false,\n}\n\nexport const DragContext: InjectionKey<DragContextValue> = Symbol('mantine-schedule-drag-context')\n\nexport function provideDragContext(value: DragContextValue) {\n provide(DragContext, value)\n}\n\n/**\n * Reads the drag state of the surrounding view. Components rendered outside a schedule get an\n * idle state rather than `undefined`, so they never have to null-check it.\n */\nexport function useDragContext(): DragContextValue {\n return inject(DragContext, IDLE)\n}\n\nexport interface ScheduleDragState {\n draggedEvent: ShallowRef<ScheduleEventData | null>\n\n startEventDrag: (event: ScheduleEventData) => void\n\n /**\n * Ends the drag. Safe to call more than once: only the first call after a `startEventDrag`\n * takes effect, so the component's own `dragend` and the document safety net cannot both\n * report the same drag.\n */\n endEventDrag: () => void\n}\n\nexport interface ProvideScheduleDragStateInput {\n /** Slot the pointer is currently over, owned by the view because it also drives the highlight. */\n dragOverTarget?: () => DropTarget | null\n\n isSlotDragging?: () => boolean\n\n /**\n * Called exactly once per drag, however it ended: dropped, cancelled, or ended after the\n * dragged element was already replaced. Use it to clear view-local drag state.\n */\n onDragEnd?: () => void\n}\n\n/**\n * Publishes the view's drag state to the events it renders, so an event can tell that *some*\n * other event is being dragged and dim itself.\n *\n * The context is a getter-backed object rather than a snapshot: it is provided once during\n * `setup`, and every read stays reactive as the drag progresses.\n *\n * The end of a drag is detected on `document` rather than only through the dragged event's own\n * `dragend`. A successful drop usually makes the consumer move the event, which re-renders it\n * under a different key: the original element is gone by the time the browser would fire\n * `dragend` on it, so that event never arrives. Relying on it alone would leave the schedule\n * stuck in the dragging state, with every event non-interactive.\n */\nexport function provideScheduleDragState(\n input: ProvideScheduleDragStateInput = {},\n): ScheduleDragState {\n const draggedEvent = shallowRef<ScheduleEventData | null>(null)\n\n provideDragContext({\n get draggedEvent() {\n return draggedEvent.value\n },\n get dragOverTarget() {\n return input.dragOverTarget?.() ?? null\n },\n get isDragging() {\n return draggedEvent.value !== null\n },\n get isSlotDragging() {\n return input.isSlotDragging?.() ?? false\n },\n })\n\n const endEventDrag = () => {\n if (draggedEvent.value === null) {\n return\n }\n\n draggedEvent.value = null\n stopWatchingDocument()\n input.onDragEnd?.()\n }\n\n // Capture phase, so the drag cannot be left open by a handler that stops propagation.\n const watchOptions = { capture: true } as const\n\n function startWatchingDocument() {\n document.addEventListener('drop', endEventDrag, watchOptions)\n document.addEventListener('dragend', endEventDrag, watchOptions)\n }\n\n function stopWatchingDocument() {\n document.removeEventListener('drop', endEventDrag, watchOptions)\n document.removeEventListener('dragend', endEventDrag, watchOptions)\n }\n\n onScopeDispose(stopWatchingDocument, true)\n\n return {\n draggedEvent,\n startEventDrag: (event) => {\n if (draggedEvent.value === null) {\n startWatchingDocument()\n }\n\n draggedEvent.value = event\n },\n endEventDrag,\n }\n}\n",".event {\n padding: 1px;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n flex: 1 0 auto;\n position: relative;\n z-index: 3;\n\n &:where([data-auto-size]) {\n container-type: size;\n }\n\n &:where([data-draggable]) .eventInner {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n }\n\n &:where([data-dragging]) {\n opacity: 0.2;\n\n .eventInner {\n cursor: grabbing;\n }\n }\n\n &:where([data-any-dragging]:not([data-dragging])) {\n pointer-events: none;\n\n .eventInner {\n pointer-events: none;\n }\n }\n\n &:where([data-static]) {\n pointer-events: none;\n cursor: default;\n }\n\n &:where([data-resizing]) {\n z-index: 10;\n\n .eventInner {\n @mixin hover {\n background-color: var(--event-bg);\n }\n }\n }\n\n &:where([data-hanging='start'], [data-hanging='both']) {\n &::before {\n content: '';\n position: absolute;\n inset-block: 2px;\n inset-inline-start: 2px;\n width: 2px;\n background-color: var(--event-color);\n border-radius: 10px;\n opacity: 0.3;\n }\n\n .eventInner {\n padding-inline-start: 6px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n }\n\n &:where([data-hanging='end'], [data-hanging='both']) {\n &::after {\n content: '';\n position: absolute;\n inset-block: 2px;\n inset-inline-end: 2px;\n width: 2px;\n background-color: var(--event-color);\n border-radius: 10px;\n opacity: 0.3;\n }\n\n .eventInner {\n padding-inline-end: 6px;\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n }\n\n &:where([data-clip-start]) {\n .eventInner {\n padding-inline-start: 12px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);\n }\n }\n\n &:where([data-clip-end]) {\n .eventInner {\n padding-inline-end: 12px;\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);\n }\n }\n\n &:where([data-clip-start][data-clip-end]) {\n .eventInner {\n clip-path: polygon(\n 10px 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 10px 100%,\n 0 50%\n );\n }\n }\n}\n\n.eventInner {\n background-color: var(--event-bg);\n color: var(--event-color);\n pointer-events: all;\n border-radius: min(var(--event-radius), 50%);\n font-weight: var(--mantine-font-weight-medium);\n font-size: 12px;\n line-height: 1;\n padding: 3px 4px;\n width: 100%;\n height: 100%;\n cursor: pointer;\n user-select: none;\n overflow: hidden;\n\n &:where([data-nowrap]) {\n white-space: nowrap;\n text-overflow: ellipsis;\n line-height: 1.25;\n }\n\n &:where([data-size='md']) {\n font-size: 14px;\n padding: 4px 6px;\n }\n\n @mixin hover {\n background-color: var(--event-hover);\n }\n\n &:where([data-auto-size]) {\n @container (max-width: 12px) {\n padding-inline: 0;\n }\n\n @container (min-width: 16px) {\n width: calc(100% - 2px);\n margin-inline: auto;\n }\n\n @container (max-height: 18px) {\n font-size: 9px;\n padding-block: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n }\n\n .event[data-static] & {\n cursor: default;\n pointer-events: none;\n\n @mixin hover {\n background-color: var(--event-bg);\n }\n }\n\n :where([data-slot-dragging]) & {\n pointer-events: none;\n }\n}\n\n.eventResizeHandle {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n width: 40%;\n max-width: 40px;\n height: 4px;\n border-radius: 2px;\n cursor: ns-resize;\n pointer-events: all;\n z-index: 4;\n touch-action: none;\n background-color: var(--event-color);\n opacity: 0;\n transition: opacity 100ms ease;\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='top']) {\n top: -2px;\n }\n\n &:where([data-edge='bottom']) {\n bottom: -2px;\n }\n\n .event:where(:hover, [data-resizing]) & {\n opacity: 0.5;\n }\n\n @mixin hover {\n opacity: 0.8;\n }\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\n\nconst defaultProps = {\n radius: 'sm',\n size: 'sm',\n mode: 'default',\n} as const\n\n// Colors come from each event's data rather than a component-level color prop.\nconst varsResolver = createVarsResolver<any>((theme, { event, radius }) => {\n const colors = theme.variantColorResolver({\n color: event?.color || theme.primaryColor,\n theme,\n variant: event?.variant || 'light',\n autoContrast: true,\n })\n\n return {\n event: {\n '--event-color': colors.color,\n '--event-bg': colors.background,\n '--event-hover': colors.hover,\n '--event-radius': resolveScheduleRadius(radius),\n },\n }\n})\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, h, onBeforeUnmount, ref, useAttrs, useSlots, type VNodeChild } from 'vue'\nimport { Box, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useDragContext } from '../DragContext'\nimport type {\n ScheduleEventEmits,\n ScheduleEventOwnProps,\n ScheduleEventResizeEdge,\n ScheduleEventSlots,\n} from './ScheduleEvent.types'\nimport classes from './ScheduleEvent.module.css'\n\ndefineOptions({\n name: 'ScheduleEvent',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleEventOwnProps>(), {\n radius: undefined,\n size: undefined,\n mode: undefined,\n hanging: undefined,\n renderEvent: undefined,\n renderEventBody: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleEventSlots>()\n\nconst emit = defineEmits<ScheduleEventEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst dragContext = useDragContext()\n\nconst props = useProps('ScheduleEvent', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ScheduleEvent',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'event',\n})\n\nconst isNativeDragging = ref(false)\n\n/**\n * Ends the native drag, however it ended. Idempotent, because it is reached from both the\n * element's own `dragend` and a `document` listener.\n *\n * The element handler alone is not enough: `dragend` fires on the element the drag started\n * from, which a schedule usually re-renders under a different key the moment the drop is\n * handled — so this element can be gone before the browser gets there and the event never\n * arrives. `document` catches both the drop and the cancel: exactly one of them always fires,\n * and both bubble.\n */\nconst stopNativeDrag = () => {\n if (!isNativeDragging.value) {\n return\n }\n\n isNativeDragging.value = false\n document.removeEventListener('drop', stopNativeDrag, true)\n document.removeEventListener('dragend', stopNativeDrag, true)\n emit('eventDragEnd')\n}\n\nonBeforeUnmount(() => {\n document.removeEventListener('drop', stopNativeDrag, true)\n document.removeEventListener('dragend', stopNativeDrag, true)\n})\n\nconst isStatic = computed(() => props.mode === 'static')\nconst isDraggable = computed(() => props.draggable && !isStatic.value)\nconst withResizeHandles = computed(() => Boolean(props.withResize) && !isStatic.value)\n\nconst body = computed<VNodeChild>(\n () =>\n slots.eventBody?.({ event: props.event }) ??\n props.renderEventBody?.(props.event) ??\n slots.default?.() ??\n props.event.title,\n)\n\nconst handleDragStart = (nativeEvent: DragEvent) => {\n if (!isDraggable.value) {\n nativeEvent.preventDefault()\n return\n }\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.effectAllowed = 'move'\n nativeEvent.dataTransfer.setData(\n 'application/json',\n JSON.stringify({ eventId: props.event.id }),\n )\n }\n\n isNativeDragging.value = true\n document.addEventListener('drop', stopNativeDrag, true)\n document.addEventListener('dragend', stopNativeDrag, true)\n emit('eventDragStart', props.event)\n}\n\nconst handleResizeStart = (edge: ScheduleEventResizeEdge, nativeEvent: PointerEvent) => {\n emit('resizeStart', edge, nativeEvent)\n}\n\nconst isBeingDragged = computed(() => props.isDragging || isNativeDragging.value)\n\nconst rootMod = computed(() => [\n {\n autoSize: props.autoSize,\n hanging: props.hanging,\n draggable: isDraggable.value,\n dragging: isBeingDragged.value,\n // Set on every event while a drag is in progress, so the ones that are not being dragged\n // can step back visually.\n anyDragging: dragContext.isDragging,\n static: isStatic.value,\n resizing: props.isResizing,\n resizable: withResizeHandles.value,\n },\n (attrs as any).mod,\n])\n\n/**\n * Everything spread onto the root element. `renderEvent` receives the same object, so a\n * custom root behaves like the built-in one.\n */\nconst rootProps = computed(() => ({\n ...attrs,\n ...getStyles('event'),\n 'data-event-id': props.event.id,\n title: props.event.title,\n mod: rootMod.value,\n draggable: isDraggable.value,\n tabindex: isStatic.value ? -1 : 0,\n onDragstart: handleDragStart,\n // The element's own `dragend` is the fast path; `stopNativeDrag` also listens on `document`\n // for the case where this element is replaced before the browser gets to fire it.\n onDragend: isStatic.value ? undefined : stopNativeDrag,\n onClick: isStatic.value\n ? undefined\n : (attrs.onClick as ((event: MouseEvent) => void) | undefined),\n}))\n\n/**\n * Default children as a functional component, so the template and the `renderEvent`\n * payload share one definition instead of building the tree twice.\n */\nconst EventChildren = () => [\n withResizeHandles.value\n ? h(Box, {\n ...getStyles('eventResizeHandle'),\n mod: { edge: 'top' },\n onPointerdown: (nativeEvent: PointerEvent) => handleResizeStart('top', nativeEvent),\n })\n : null,\n h(\n Box,\n {\n ...getStyles('eventInner'),\n mod: {\n nowrap: props.nowrap,\n size: props.size,\n autoSize: props.autoSize,\n hanging: props.hanging,\n },\n },\n () => body.value,\n ),\n withResizeHandles.value\n ? h(Box, {\n ...getStyles('eventResizeHandle'),\n mod: { edge: 'bottom' },\n onPointerdown: (nativeEvent: PointerEvent) => handleResizeStart('bottom', nativeEvent),\n })\n : null,\n]\n\nconst customEvent = computed<VNodeChild>(() => {\n if (!slots.event && !props.renderEvent) {\n return null\n }\n\n const payload = { ...rootProps.value, children: h(EventChildren) }\n return (\n slots.event?.({ ...payload, event: props.event }) ??\n props.renderEvent?.(props.event, payload) ??\n null\n )\n})\n\nconst renderCustomEvent = () => customEvent.value\n</script>\n\n<template>\n <component :is=\"renderCustomEvent\" v-if=\"customEvent\" />\n <UnstyledButton v-else v-bind=\"rootProps\">\n <EventChildren />\n </UnstyledButton>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\n\nconst defaultProps = {\n radius: 'sm',\n size: 'sm',\n mode: 'default',\n} as const\n\n// Colors come from each event's data rather than a component-level color prop.\nconst varsResolver = createVarsResolver<any>((theme, { event, radius }) => {\n const colors = theme.variantColorResolver({\n color: event?.color || theme.primaryColor,\n theme,\n variant: event?.variant || 'light',\n autoContrast: true,\n })\n\n return {\n event: {\n '--event-color': colors.color,\n '--event-bg': colors.background,\n '--event-hover': colors.hover,\n '--event-radius': resolveScheduleRadius(radius),\n },\n }\n})\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, h, onBeforeUnmount, ref, useAttrs, useSlots, type VNodeChild } from 'vue'\nimport { Box, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useDragContext } from '../DragContext'\nimport type {\n ScheduleEventEmits,\n ScheduleEventOwnProps,\n ScheduleEventResizeEdge,\n ScheduleEventSlots,\n} from './ScheduleEvent.types'\nimport classes from './ScheduleEvent.module.css'\n\ndefineOptions({\n name: 'ScheduleEvent',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleEventOwnProps>(), {\n radius: undefined,\n size: undefined,\n mode: undefined,\n hanging: undefined,\n renderEvent: undefined,\n renderEventBody: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleEventSlots>()\n\nconst emit = defineEmits<ScheduleEventEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst dragContext = useDragContext()\n\nconst props = useProps('ScheduleEvent', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ScheduleEvent',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'event',\n})\n\nconst isNativeDragging = ref(false)\n\n/**\n * Ends the native drag, however it ended. Idempotent, because it is reached from both the\n * element's own `dragend` and a `document` listener.\n *\n * The element handler alone is not enough: `dragend` fires on the element the drag started\n * from, which a schedule usually re-renders under a different key the moment the drop is\n * handled — so this element can be gone before the browser gets there and the event never\n * arrives. `document` catches both the drop and the cancel: exactly one of them always fires,\n * and both bubble.\n */\nconst stopNativeDrag = () => {\n if (!isNativeDragging.value) {\n return\n }\n\n isNativeDragging.value = false\n document.removeEventListener('drop', stopNativeDrag, true)\n document.removeEventListener('dragend', stopNativeDrag, true)\n emit('eventDragEnd')\n}\n\nonBeforeUnmount(() => {\n document.removeEventListener('drop', stopNativeDrag, true)\n document.removeEventListener('dragend', stopNativeDrag, true)\n})\n\nconst isStatic = computed(() => props.mode === 'static')\nconst isDraggable = computed(() => props.draggable && !isStatic.value)\nconst withResizeHandles = computed(() => Boolean(props.withResize) && !isStatic.value)\n\nconst body = computed<VNodeChild>(\n () =>\n slots.eventBody?.({ event: props.event }) ??\n props.renderEventBody?.(props.event) ??\n slots.default?.() ??\n props.event.title,\n)\n\nconst handleDragStart = (nativeEvent: DragEvent) => {\n if (!isDraggable.value) {\n nativeEvent.preventDefault()\n return\n }\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.effectAllowed = 'move'\n nativeEvent.dataTransfer.setData(\n 'application/json',\n JSON.stringify({ eventId: props.event.id }),\n )\n }\n\n isNativeDragging.value = true\n document.addEventListener('drop', stopNativeDrag, true)\n document.addEventListener('dragend', stopNativeDrag, true)\n emit('eventDragStart', props.event)\n}\n\nconst handleResizeStart = (edge: ScheduleEventResizeEdge, nativeEvent: PointerEvent) => {\n emit('resizeStart', edge, nativeEvent)\n}\n\nconst isBeingDragged = computed(() => props.isDragging || isNativeDragging.value)\n\nconst rootMod = computed(() => [\n {\n autoSize: props.autoSize,\n hanging: props.hanging,\n draggable: isDraggable.value,\n dragging: isBeingDragged.value,\n // Set on every event while a drag is in progress, so the ones that are not being dragged\n // can step back visually.\n anyDragging: dragContext.isDragging,\n static: isStatic.value,\n resizing: props.isResizing,\n resizable: withResizeHandles.value,\n },\n (attrs as any).mod,\n])\n\n/**\n * Everything spread onto the root element. `renderEvent` receives the same object, so a\n * custom root behaves like the built-in one.\n */\nconst rootProps = computed(() => ({\n ...attrs,\n ...getStyles('event'),\n 'data-event-id': props.event.id,\n title: props.event.title,\n mod: rootMod.value,\n draggable: isDraggable.value,\n tabindex: isStatic.value ? -1 : 0,\n onDragstart: handleDragStart,\n // The element's own `dragend` is the fast path; `stopNativeDrag` also listens on `document`\n // for the case where this element is replaced before the browser gets to fire it.\n onDragend: isStatic.value ? undefined : stopNativeDrag,\n onClick: isStatic.value\n ? undefined\n : (attrs.onClick as ((event: MouseEvent) => void) | undefined),\n}))\n\n/**\n * Default children as a functional component, so the template and the `renderEvent`\n * payload share one definition instead of building the tree twice.\n */\nconst EventChildren = () => [\n withResizeHandles.value\n ? h(Box, {\n ...getStyles('eventResizeHandle'),\n mod: { edge: 'top' },\n onPointerdown: (nativeEvent: PointerEvent) => handleResizeStart('top', nativeEvent),\n })\n : null,\n h(\n Box,\n {\n ...getStyles('eventInner'),\n mod: {\n nowrap: props.nowrap,\n size: props.size,\n autoSize: props.autoSize,\n hanging: props.hanging,\n },\n },\n () => body.value,\n ),\n withResizeHandles.value\n ? h(Box, {\n ...getStyles('eventResizeHandle'),\n mod: { edge: 'bottom' },\n onPointerdown: (nativeEvent: PointerEvent) => handleResizeStart('bottom', nativeEvent),\n })\n : null,\n]\n\nconst customEvent = computed<VNodeChild>(() => {\n if (!slots.event && !props.renderEvent) {\n return null\n }\n\n const payload = { ...rootProps.value, children: h(EventChildren) }\n return (\n slots.event?.({ ...payload, event: props.event }) ??\n props.renderEvent?.(props.event, payload) ??\n null\n )\n})\n\nconst renderCustomEvent = () => customEvent.value\n</script>\n\n<template>\n <component :is=\"renderCustomEvent\" v-if=\"customEvent\" />\n <UnstyledButton v-else v-bind=\"rootProps\">\n <EventChildren />\n </UnstyledButton>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ScheduleEventComponent, { varsResolver } from './ScheduleEvent.vue'\nimport type { ScheduleEventFactory } from './ScheduleEvent.types'\nimport classes from './ScheduleEvent.module.css'\n\nexport const ScheduleEvent = factory<ScheduleEventFactory>(ScheduleEventComponent, {\n classes,\n varsResolver,\n})\n\nexport type { RenderEvent, RenderEventBody, ScheduleEventRenderProps } from '../../component-props'\n\nexport type {\n ScheduleEventCssVariables,\n ScheduleEventEmits,\n ScheduleEventFactory,\n ScheduleEventHanging,\n ScheduleEventOwnProps,\n ScheduleEventProps,\n ScheduleEventResizeEdge,\n ScheduleEventSlots,\n ScheduleEventStylesNames,\n} from './ScheduleEvent.types'\n",".moreEventsButton {\n color: var(--mantine-color-dimmed);\n font-size: 13px;\n pointer-events: all;\n flex: 1;\n\n @mixin hover {\n color: var(--mantine-color-bright);\n text-decoration: underline;\n }\n\n &:where([data-static]) {\n cursor: default;\n\n @mixin hover {\n color: var(--mantine-color-dimmed);\n text-decoration: none;\n }\n }\n}\n\n.moreEventsDropdown {\n padding: 4px;\n}\n\n.moreEventsList {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n","<script lang=\"ts\">\nconst defaultProps = {\n dropdownType: 'popover',\n mode: 'default',\n} as const\n\n/** Pulls the popover back over the control it replaces, so the list covers the day cell. */\nconst POPOVER_OFFSET = -46\n\nexport { defaultProps, POPOVER_OFFSET }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { Box, Modal, Popover, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport type { ScheduleEventData } from '../../types'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { resolveEventRenderers } from '../shared'\nimport type { MoreEventsEmits, MoreEventsOwnProps, MoreEventsSlots } from './MoreEvents.types'\nimport classes from './MoreEvents.module.css'\n\ndefineOptions({\n name: 'MoreEvents',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MoreEventsOwnProps>(), {\n radius: undefined,\n modalTitle: undefined,\n dropdownType: undefined,\n popoverProps: undefined,\n modalProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n labels: undefined,\n mode: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MoreEventsSlots>()\n\nconst emit = defineEmits<MoreEventsEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('MoreEvents', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MoreEvents',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'moreEventsButton',\n})\n\nconst opened = ref(false)\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst close = () => {\n opened.value = false\n emit('dropdownClose')\n}\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n emit('eventClick', event, nativeEvent)\n}\n\nconst handlePopoverChange = (value: boolean) => {\n if (!value) {\n close()\n }\n}\n</script>\n\n<template>\n <!--\n The modal and the popover both wrap the same list. Rendering the modal alongside a\n disabled popover keeps a single target control for either dropdown type.\n -->\n <Modal\n v-if=\"props.dropdownType === 'modal'\"\n v-bind=\"props.modalProps\"\n :opened=\"opened\"\n :radius=\"props.radius\"\n :title=\"props.modalTitle\"\n @close=\"close\"\n >\n <Box v-bind=\"getStyles('moreEventsList')\">\n <ScheduleEvent\n v-for=\"event in props.events\"\n :key=\"event.id\"\n :event=\"event\"\n :radius=\"props.radius ?? 'sm'\"\n size=\"md\"\n :mode=\"props.mode\"\n v-bind=\"eventRenderers\"\n @click=\"clickEvent(event, $event)\"\n />\n </Box>\n </Modal>\n\n <Popover\n position=\"bottom-start\"\n :width=\"260\"\n :opened=\"opened\"\n trap-focus\n :return-focus=\"false\"\n :disabled=\"props.dropdownType === 'modal'\"\n :radius=\"props.radius\"\n :transition-props=\"{ transition: 'pop', duration: 120 }\"\n :offset=\"POPOVER_OFFSET\"\n v-bind=\"props.popoverProps\"\n @change=\"handlePopoverChange\"\n >\n <Popover.Target>\n <UnstyledButton\n v-bind=\"{ ...attrs, ...getStyles('moreEventsButton') }\"\n :mod=\"{ static: props.mode === 'static' }\"\n :aria-expanded=\"opened\"\n @click=\"opened = !opened\"\n >\n {{ getLabel('moreLabel', props.labels)(props.moreEventsCount) }}\n </UnstyledButton>\n </Popover.Target>\n\n <Popover.Dropdown v-bind=\"getStyles('moreEventsDropdown')\">\n <Box v-bind=\"getStyles('moreEventsList')\">\n <ScheduleEvent\n v-for=\"event in props.events\"\n :key=\"event.id\"\n :event=\"event\"\n :radius=\"props.radius ?? 'sm'\"\n size=\"md\"\n :mode=\"props.mode\"\n v-bind=\"eventRenderers\"\n @click=\"clickEvent(event, $event)\"\n />\n </Box>\n </Popover.Dropdown>\n </Popover>\n</template>\n","<script lang=\"ts\">\nconst defaultProps = {\n dropdownType: 'popover',\n mode: 'default',\n} as const\n\n/** Pulls the popover back over the control it replaces, so the list covers the day cell. */\nconst POPOVER_OFFSET = -46\n\nexport { defaultProps, POPOVER_OFFSET }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { Box, Modal, Popover, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport type { ScheduleEventData } from '../../types'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { resolveEventRenderers } from '../shared'\nimport type { MoreEventsEmits, MoreEventsOwnProps, MoreEventsSlots } from './MoreEvents.types'\nimport classes from './MoreEvents.module.css'\n\ndefineOptions({\n name: 'MoreEvents',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MoreEventsOwnProps>(), {\n radius: undefined,\n modalTitle: undefined,\n dropdownType: undefined,\n popoverProps: undefined,\n modalProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n labels: undefined,\n mode: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MoreEventsSlots>()\n\nconst emit = defineEmits<MoreEventsEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('MoreEvents', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MoreEvents',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'moreEventsButton',\n})\n\nconst opened = ref(false)\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst close = () => {\n opened.value = false\n emit('dropdownClose')\n}\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n emit('eventClick', event, nativeEvent)\n}\n\nconst handlePopoverChange = (value: boolean) => {\n if (!value) {\n close()\n }\n}\n</script>\n\n<template>\n <!--\n The modal and the popover both wrap the same list. Rendering the modal alongside a\n disabled popover keeps a single target control for either dropdown type.\n -->\n <Modal\n v-if=\"props.dropdownType === 'modal'\"\n v-bind=\"props.modalProps\"\n :opened=\"opened\"\n :radius=\"props.radius\"\n :title=\"props.modalTitle\"\n @close=\"close\"\n >\n <Box v-bind=\"getStyles('moreEventsList')\">\n <ScheduleEvent\n v-for=\"event in props.events\"\n :key=\"event.id\"\n :event=\"event\"\n :radius=\"props.radius ?? 'sm'\"\n size=\"md\"\n :mode=\"props.mode\"\n v-bind=\"eventRenderers\"\n @click=\"clickEvent(event, $event)\"\n />\n </Box>\n </Modal>\n\n <Popover\n position=\"bottom-start\"\n :width=\"260\"\n :opened=\"opened\"\n trap-focus\n :return-focus=\"false\"\n :disabled=\"props.dropdownType === 'modal'\"\n :radius=\"props.radius\"\n :transition-props=\"{ transition: 'pop', duration: 120 }\"\n :offset=\"POPOVER_OFFSET\"\n v-bind=\"props.popoverProps\"\n @change=\"handlePopoverChange\"\n >\n <Popover.Target>\n <UnstyledButton\n v-bind=\"{ ...attrs, ...getStyles('moreEventsButton') }\"\n :mod=\"{ static: props.mode === 'static' }\"\n :aria-expanded=\"opened\"\n @click=\"opened = !opened\"\n >\n {{ getLabel('moreLabel', props.labels)(props.moreEventsCount) }}\n </UnstyledButton>\n </Popover.Target>\n\n <Popover.Dropdown v-bind=\"getStyles('moreEventsDropdown')\">\n <Box v-bind=\"getStyles('moreEventsList')\">\n <ScheduleEvent\n v-for=\"event in props.events\"\n :key=\"event.id\"\n :event=\"event\"\n :radius=\"props.radius ?? 'sm'\"\n size=\"md\"\n :mode=\"props.mode\"\n v-bind=\"eventRenderers\"\n @click=\"clickEvent(event, $event)\"\n />\n </Box>\n </Popover.Dropdown>\n </Popover>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport MoreEventsComponent from './MoreEvents.vue'\nimport type { MoreEventsFactory } from './MoreEvents.types'\nimport classes from './MoreEvents.module.css'\n\nexport const MoreEvents = factory<MoreEventsFactory>(MoreEventsComponent, { classes })\n\nexport type {\n MoreEventsDropdownType,\n MoreEventsEmits,\n MoreEventsFactory,\n MoreEventsOwnProps,\n MoreEventsProps,\n MoreEventsSlots,\n MoreEventsStylesNames,\n} from './MoreEvents.types'\n","import { computed, inject, provide, type ComputedRef, type InjectionKey } from 'vue'\nimport type { ScheduleLabelsOverride } from '../../labels'\n\nconst ScheduleHeaderLabelsKey: InjectionKey<() => ScheduleLabelsOverride | undefined> = Symbol(\n 'mantine-schedule-header-labels',\n)\n\n/**\n * Shares the header's `labels` with the compound components rendered inside it.\n * A getter is provided rather than the value so the labels stay reactive.\n */\nexport function provideScheduleHeaderLabels(labels: () => ScheduleLabelsOverride | undefined) {\n provide(ScheduleHeaderLabelsKey, labels)\n}\n\n/**\n * Merges a control's own `labels` over the ones provided by the surrounding `ScheduleHeader`,\n * so overriding a single key does not drop the rest. Must be called during `setup`.\n */\nexport function useScheduleHeaderLabels(\n override: () => ScheduleLabelsOverride | undefined,\n): ComputedRef<ScheduleLabelsOverride | undefined> {\n const contextLabels = inject(ScheduleHeaderLabelsKey, undefined)\n\n return computed(() => {\n const inherited = contextLabels?.()\n const own = override()\n\n if (!own) {\n return inherited\n }\n\n if (!inherited) {\n return own\n }\n\n return { ...inherited, ...own }\n })\n}\n",".header {\n --schedule-header-gap: 8px;\n\n display: flex;\n flex-wrap: wrap;\n gap: var(--schedule-header-gap);\n margin-bottom: var(--schedule-header-gap);\n container-type: inline-size;\n}\n\n.navigationGroup {\n display: flex;\n gap: var(--schedule-header-gap);\n align-items: center;\n\n @container (width <= 600px) {\n flex: 1;\n\n & > :not([data-square]) {\n flex: 1;\n }\n }\n}\n\n.todayControl {\n @container (width <= 600px) {\n display: none;\n }\n}\n\n.viewSelect {\n @container (width <= 600px) {\n display: none;\n }\n}\n\n.compactViewSelect {\n display: none;\n font-weight: var(--mantine-font-weight-medium);\n\n @container (width <= 600px) {\n display: block;\n flex: 1 1 100%;\n }\n}\n","<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { provideScheduleHeaderLabels } from './ScheduleHeader.context'\nimport type { ScheduleHeaderOwnProps, ScheduleHeaderSlots } from './ScheduleHeader.types'\nimport classes from './ScheduleHeader.module.css'\n\ndefineOptions({\n name: 'ScheduleHeader',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleHeaderOwnProps>(), {\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleHeaderSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ScheduleHeader', null, rawProps)\n\nconst getStyles = useStyles({\n name: 'ScheduleHeader',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'header',\n})\n\nprovideScheduleHeaderLabels(() => props.labels)\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('header') }\">\n <slot />\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { provideScheduleHeaderLabels } from './ScheduleHeader.context'\nimport type { ScheduleHeaderOwnProps, ScheduleHeaderSlots } from './ScheduleHeader.types'\nimport classes from './ScheduleHeader.module.css'\n\ndefineOptions({\n name: 'ScheduleHeader',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleHeaderOwnProps>(), {\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleHeaderSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ScheduleHeader', null, rawProps)\n\nconst getStyles = useStyles({\n name: 'ScheduleHeader',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'header',\n})\n\nprovideScheduleHeaderLabels(() => props.labels)\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('header') }\">\n <slot />\n </Box>\n</template>\n",".headerControl {\n --control-size: 32px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n user-select: none;\n min-width: var(--control-size);\n height: var(--control-size);\n border-radius: var(--schedule-radius, var(--control-radius, var(--mantine-radius-default)));\n border: 1px solid var(--mantine-color-default-border);\n color: var(--mantine-color-default-color);\n background: var(--mantine-color-default);\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-transform: capitalize;\n\n &:where([data-interactive]) {\n cursor: pointer;\n\n @mixin hover {\n background-color: var(--mantine-color-default-hover);\n }\n }\n\n &:where(:not([data-square])) {\n padding-inline: 12px;\n }\n\n &:where([data-active]) {\n background-color: var(--mantine-primary-color-filled);\n border-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n\n @mixin hover {\n background-color: var(--mantine-primary-color-filled-hover);\n border-color: var(--mantine-primary-color-filled-hover);\n }\n }\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../../shared'\n\nconst defaultProps = {\n interactive: true,\n} as const\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n headerControl: {\n '--control-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\nimport classes from './HeaderControl.module.css'\n\ndefineOptions({\n name: 'HeaderControl',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('HeaderControl', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'HeaderControl',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'headerControl',\n})\n\nconst rootStyles = computed(() => getStyles('headerControl', { active: props.interactive }))\n\nconst rootMod = computed(() => [\n { active: props.active, square: props.square, interactive: props.interactive },\n (attrs as any).mod,\n])\n\n/** A non-interactive control stays in the DOM as a button but out of the tab order. */\nconst tabindex = computed(() =>\n props.interactive ? (attrs as { tabindex?: number | string }).tabindex : -1,\n)\n</script>\n\n<template>\n <UnstyledButton v-bind=\"{ ...attrs, ...rootStyles }\" :mod=\"rootMod\" :tabindex=\"tabindex\">\n <slot />\n </UnstyledButton>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../../shared'\n\nconst defaultProps = {\n interactive: true,\n} as const\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n headerControl: {\n '--control-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\nimport classes from './HeaderControl.module.css'\n\ndefineOptions({\n name: 'HeaderControl',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('HeaderControl', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'HeaderControl',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'headerControl',\n})\n\nconst rootStyles = computed(() => getStyles('headerControl', { active: props.interactive }))\n\nconst rootMod = computed(() => [\n { active: props.active, square: props.square, interactive: props.interactive },\n (attrs as any).mod,\n])\n\n/** A non-interactive control stays in the DOM as a button but out of the tab order. */\nconst tabindex = computed(() =>\n props.interactive ? (attrs as { tabindex?: number | string }).tabindex : -1,\n)\n</script>\n\n<template>\n <UnstyledButton v-bind=\"{ ...attrs, ...rootStyles }\" :mod=\"rootMod\" :tabindex=\"tabindex\">\n <slot />\n </UnstyledButton>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { AccordionChevron, useDirection } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderNext',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\n/** The chevron points down by default, so it is rotated onto the reading direction. */\nconst chevronStyle = computed(() => ({\n transform: `rotate(${dir.value === 'rtl' ? 90 : -90}deg)`,\n}))\n</script>\n\n<template>\n <HeaderControl\n data-type=\"next\"\n :aria-label=\"getLabel('next', labels)\"\n square\n :active=\"props.active\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>\n <AccordionChevron :style=\"chevronStyle\" />\n </slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { AccordionChevron, useDirection } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderNext',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\n/** The chevron points down by default, so it is rotated onto the reading direction. */\nconst chevronStyle = computed(() => ({\n transform: `rotate(${dir.value === 'rtl' ? 90 : -90}deg)`,\n}))\n</script>\n\n<template>\n <HeaderControl\n data-type=\"next\"\n :aria-label=\"getLabel('next', labels)\"\n square\n :active=\"props.active\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>\n <AccordionChevron :style=\"chevronStyle\" />\n </slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { AccordionChevron, useDirection } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderPrevious',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\n/** The chevron points down by default, so it is rotated onto the reading direction. */\nconst chevronStyle = computed(() => ({\n transform: `rotate(${dir.value === 'rtl' ? -90 : 90}deg)`,\n}))\n</script>\n\n<template>\n <HeaderControl\n data-type=\"previous\"\n :aria-label=\"getLabel('previous', labels)\"\n square\n :active=\"props.active\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>\n <AccordionChevron :style=\"chevronStyle\" />\n </slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { AccordionChevron, useDirection } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderPrevious',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\n/** The chevron points down by default, so it is rotated onto the reading direction. */\nconst chevronStyle = computed(() => ({\n transform: `rotate(${dir.value === 'rtl' ? -90 : 90}deg)`,\n}))\n</script>\n\n<template>\n <HeaderControl\n data-type=\"previous\"\n :aria-label=\"getLabel('previous', labels)\"\n square\n :active=\"props.active\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>\n <AccordionChevron :style=\"chevronStyle\" />\n </slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderToday',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n</script>\n\n<template>\n <HeaderControl\n data-type=\"today\"\n :aria-label=\"getLabel('today', labels)\"\n :active=\"props.active\"\n :square=\"props.square\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>{{ getLabel('today', labels) }}</slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderToday',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n</script>\n\n<template>\n <HeaderControl\n data-type=\"today\"\n :aria-label=\"getLabel('today', labels)\"\n :active=\"props.active\"\n :square=\"props.square\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>{{ getLabel('today', labels) }}</slot>\n </HeaderControl>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport HeaderControlComponent, { varsResolver } from './HeaderControl.vue'\nimport ScheduleHeaderNextComponent from './ScheduleHeaderNext.vue'\nimport ScheduleHeaderPreviousComponent from './ScheduleHeaderPrevious.vue'\nimport ScheduleHeaderTodayComponent from './ScheduleHeaderToday.vue'\nimport type { HeaderControlFactory } from './HeaderControl.types'\nimport classes from './HeaderControl.module.css'\n\nexport const HeaderControl = factory<HeaderControlFactory>(HeaderControlComponent, {\n classes,\n varsResolver,\n})\n\n/** `HeaderControl` preset that navigates to the next period. */\nexport const ScheduleHeaderNext = factory<HeaderControlFactory>(ScheduleHeaderNextComponent, {\n classes,\n varsResolver,\n})\n\n/** `HeaderControl` preset that navigates to the previous period. */\nexport const ScheduleHeaderPrevious = factory<HeaderControlFactory>(\n ScheduleHeaderPreviousComponent,\n { classes, varsResolver },\n)\n\n/** `HeaderControl` preset that navigates to today. */\nexport const ScheduleHeaderToday = factory<HeaderControlFactory>(ScheduleHeaderTodayComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n HeaderControlCssVariables,\n HeaderControlFactory,\n HeaderControlOwnProps,\n HeaderControlProps,\n HeaderControlSlots,\n HeaderControlStylesNames,\n} from './HeaderControl.types'\n",".monthYearSelectTarget {\n text-transform: capitalize;\n min-width: 80px;\n\n &:where([data-with-months]) {\n min-width: 140px;\n }\n}\n\n.monthYearSelectList {\n flex: 1;\n}\n\n.monthYearSelectDropdown {\n display: flex;\n gap: var(--mantine-spacing-sm);\n padding: 8px 4px;\n\n &:where([data-with-months]) {\n padding: var(--mantine-spacing-sm);\n }\n}\n\n.monthYearSelectLabel {\n font-weight: var(--mantine-font-weight-medium);\n font-size: var(--mantine-font-size-sm);\n padding-inline: 8px;\n margin-bottom: 6px;\n}\n\n.monthYearSelectControl {\n display: block;\n width: 100%;\n padding: 6px 8px;\n font-size: var(--mantine-font-size-sm);\n line-height: 1;\n border-radius: var(--schedule-radius, var(--control-radius, var(--mantine-radius-default)));\n font-variant-numeric: tabular-nums;\n text-transform: capitalize;\n\n &:where([data-type='year']) {\n text-align: center;\n }\n\n @mixin hover {\n background-color: var(--mantine-color-default-hover);\n }\n\n &:where([data-active]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n\n @mixin hover {\n background-color: var(--mantine-primary-color-filled-hover);\n }\n }\n}\n","<script lang=\"ts\">\nconst defaultProps = {\n monthsListFormat: 'MMMM',\n withMonths: true,\n} as const\n\n/** Fallback radius of the dropdown, so it follows the schedule radius when one is set. */\nconst DEFAULT_DROPDOWN_RADIUS = 'var(--schedule-radius, var(--mantine-radius-default))'\n\nexport { defaultProps, DEFAULT_DROPDOWN_RADIUS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport {\n Box,\n createScopedKeydownHandler,\n Popover,\n UnstyledButton,\n useProps,\n useStyles,\n} from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { formatDate, getMonthsList, getYearsList } from '../../../utils'\nimport { HeaderControl } from '../HeaderControl'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport type { MonthYearSelectEmits, MonthYearSelectOwnProps } from './MonthYearSelect.types'\nimport classes from './MonthYearSelect.module.css'\n\ndefineOptions({\n name: 'MonthYearSelect',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MonthYearSelectOwnProps>(), {\n locale: undefined,\n startYear: undefined,\n endYear: undefined,\n yearValue: undefined,\n monthValue: undefined,\n monthsListFormat: undefined,\n labelFormat: undefined,\n radius: undefined,\n getYearControlProps: undefined,\n getMonthControlProps: undefined,\n withMonths: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<MonthYearSelectEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('MonthYearSelect', defaultProps, rawProps)\n\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\nconst getStyles = useStyles({\n name: 'MonthYearSelect',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'monthYearSelectTarget',\n})\n\nconst opened = ref(false)\n\n/** Captured once so the default year range does not shift while the dropdown is open. */\nconst today = new Date()\n\nconst startYear = computed(() => props.startYear ?? today.getFullYear() - 5)\nconst endYear = computed(() => props.endYear ?? today.getFullYear() + 5)\n\nconst selectedDate = computed(\n () => new Date(props.yearValue ?? today.getFullYear(), props.monthValue ?? today.getMonth(), 1),\n)\n\n/**\n * When the selected year falls outside the offered range no control can be focused by the\n * roving tabindex, so the first one takes the tab stop instead.\n */\nconst hasActiveYear = computed(\n () =>\n props.yearValue !== undefined &&\n props.yearValue >= startYear.value &&\n props.yearValue <= endYear.value,\n)\n\nconst months = computed(() =>\n props.withMonths\n ? getMonthsList({ locale: props.locale || 'en', format: props.monthsListFormat! })\n : [],\n)\n\nconst years = computed(() => getYearsList({ startYear: startYear.value, endYear: endYear.value }))\n\nconst targetLabel = computed(() =>\n formatDate({\n date: selectedDate.value,\n locale: props.locale || 'en',\n format: props.labelFormat || (props.withMonths ? 'MMMM YYYY' : 'YYYY'),\n }),\n)\n\nconst selectMonth = (month: number) => {\n emit('update:monthValue', month)\n emit('monthChange', month)\n}\n\nconst selectYear = (year: number) => {\n emit('update:yearValue', year)\n emit('yearChange', year)\n\n // Without a month list there is nothing left to pick, so the dropdown closes itself.\n if (!props.withMonths) {\n opened.value = false\n }\n}\n\n/**\n * Roving focus inside one dropdown list. A handler returned by `getMonthControlProps` or\n * `getYearControlProps` is not composed in here: Vue already merges the two `keydown`\n * listeners and would otherwise call the consumer's twice.\n */\nconst monthKeydownHandler = createScopedKeydownHandler({\n siblingSelector: '[data-type=\"month\"]:not(:disabled)',\n parentSelector: '[data-list]',\n activateOnFocus: false,\n loop: true,\n orientation: 'vertical',\n})\n\nconst yearKeydownHandler = createScopedKeydownHandler({\n siblingSelector: '[data-type=\"year\"]:not(:disabled)',\n parentSelector: '[data-list]',\n activateOnFocus: false,\n loop: true,\n orientation: 'vertical',\n})\n\nconst monthControlProps = (month: number) => props.getMonthControlProps?.(month) ?? {}\nconst yearControlProps = (year: number) => props.getYearControlProps?.(year) ?? {}\n</script>\n\n<template>\n <Popover\n position=\"bottom-start\"\n trap-focus\n :transition-props=\"{ transition: 'pop', duration: 120 }\"\n :radius=\"props.radius || DEFAULT_DROPDOWN_RADIUS\"\n shadow=\"md\"\n :offset=\"3\"\n :width=\"props.withMonths ? undefined : 'target'\"\n :opened=\"opened\"\n @change=\"opened = $event\"\n >\n <Popover.Target>\n <HeaderControl\n v-bind=\"{ ...attrs, ...getStyles('monthYearSelectTarget') }\"\n :radius=\"props.radius\"\n :data-with-months=\"props.withMonths || undefined\"\n @click=\"opened = !opened\"\n >\n {{ targetLabel }}\n </HeaderControl>\n </Popover.Target>\n\n <Popover.Dropdown\n v-bind=\"getStyles('monthYearSelectDropdown')\"\n :data-with-months=\"props.withMonths || undefined\"\n >\n <Box v-if=\"props.withMonths\" v-bind=\"getStyles('monthYearSelectList')\" data-list>\n <Box v-bind=\"getStyles('monthYearSelectLabel')\">{{ getLabel('month', labels) }}</Box>\n <UnstyledButton\n v-for=\"month in months\"\n :key=\"month.month\"\n v-bind=\"{\n ...monthControlProps(month.month),\n ...getStyles('monthYearSelectControl', {\n className: monthControlProps(month.month).class,\n }),\n }\"\n :mod=\"{ type: 'month', active: month.month === props.monthValue }\"\n :tabindex=\"month.month === props.monthValue ? 0 : -1\"\n :aria-label=\"`${getLabel('selectMonth', labels)} ${month.name}`\"\n @keydown=\"monthKeydownHandler\"\n @click=\"selectMonth(month.month)\"\n >\n {{ month.name }}\n </UnstyledButton>\n </Box>\n\n <Box v-bind=\"getStyles('monthYearSelectList')\" data-list>\n <Box v-if=\"props.withMonths\" v-bind=\"getStyles('monthYearSelectLabel')\">\n {{ getLabel('year', labels) }}\n </Box>\n <UnstyledButton\n v-for=\"(year, index) in years\"\n :key=\"year\"\n v-bind=\"{\n ...yearControlProps(year),\n ...getStyles('monthYearSelectControl', { className: yearControlProps(year).class }),\n }\"\n :mod=\"{ type: 'year', active: year === props.yearValue }\"\n :tabindex=\"hasActiveYear ? (year === props.yearValue ? 0 : -1) : index === 0 ? 0 : -1\"\n :aria-label=\"`${getLabel('selectYear', labels)} ${year}`\"\n @keydown=\"yearKeydownHandler\"\n @click=\"selectYear(year)\"\n >\n {{ year }}\n </UnstyledButton>\n </Box>\n </Popover.Dropdown>\n </Popover>\n</template>\n","<script lang=\"ts\">\nconst defaultProps = {\n monthsListFormat: 'MMMM',\n withMonths: true,\n} as const\n\n/** Fallback radius of the dropdown, so it follows the schedule radius when one is set. */\nconst DEFAULT_DROPDOWN_RADIUS = 'var(--schedule-radius, var(--mantine-radius-default))'\n\nexport { defaultProps, DEFAULT_DROPDOWN_RADIUS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport {\n Box,\n createScopedKeydownHandler,\n Popover,\n UnstyledButton,\n useProps,\n useStyles,\n} from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { formatDate, getMonthsList, getYearsList } from '../../../utils'\nimport { HeaderControl } from '../HeaderControl'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport type { MonthYearSelectEmits, MonthYearSelectOwnProps } from './MonthYearSelect.types'\nimport classes from './MonthYearSelect.module.css'\n\ndefineOptions({\n name: 'MonthYearSelect',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MonthYearSelectOwnProps>(), {\n locale: undefined,\n startYear: undefined,\n endYear: undefined,\n yearValue: undefined,\n monthValue: undefined,\n monthsListFormat: undefined,\n labelFormat: undefined,\n radius: undefined,\n getYearControlProps: undefined,\n getMonthControlProps: undefined,\n withMonths: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<MonthYearSelectEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('MonthYearSelect', defaultProps, rawProps)\n\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\nconst getStyles = useStyles({\n name: 'MonthYearSelect',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'monthYearSelectTarget',\n})\n\nconst opened = ref(false)\n\n/** Captured once so the default year range does not shift while the dropdown is open. */\nconst today = new Date()\n\nconst startYear = computed(() => props.startYear ?? today.getFullYear() - 5)\nconst endYear = computed(() => props.endYear ?? today.getFullYear() + 5)\n\nconst selectedDate = computed(\n () => new Date(props.yearValue ?? today.getFullYear(), props.monthValue ?? today.getMonth(), 1),\n)\n\n/**\n * When the selected year falls outside the offered range no control can be focused by the\n * roving tabindex, so the first one takes the tab stop instead.\n */\nconst hasActiveYear = computed(\n () =>\n props.yearValue !== undefined &&\n props.yearValue >= startYear.value &&\n props.yearValue <= endYear.value,\n)\n\nconst months = computed(() =>\n props.withMonths\n ? getMonthsList({ locale: props.locale || 'en', format: props.monthsListFormat! })\n : [],\n)\n\nconst years = computed(() => getYearsList({ startYear: startYear.value, endYear: endYear.value }))\n\nconst targetLabel = computed(() =>\n formatDate({\n date: selectedDate.value,\n locale: props.locale || 'en',\n format: props.labelFormat || (props.withMonths ? 'MMMM YYYY' : 'YYYY'),\n }),\n)\n\nconst selectMonth = (month: number) => {\n emit('update:monthValue', month)\n emit('monthChange', month)\n}\n\nconst selectYear = (year: number) => {\n emit('update:yearValue', year)\n emit('yearChange', year)\n\n // Without a month list there is nothing left to pick, so the dropdown closes itself.\n if (!props.withMonths) {\n opened.value = false\n }\n}\n\n/**\n * Roving focus inside one dropdown list. A handler returned by `getMonthControlProps` or\n * `getYearControlProps` is not composed in here: Vue already merges the two `keydown`\n * listeners and would otherwise call the consumer's twice.\n */\nconst monthKeydownHandler = createScopedKeydownHandler({\n siblingSelector: '[data-type=\"month\"]:not(:disabled)',\n parentSelector: '[data-list]',\n activateOnFocus: false,\n loop: true,\n orientation: 'vertical',\n})\n\nconst yearKeydownHandler = createScopedKeydownHandler({\n siblingSelector: '[data-type=\"year\"]:not(:disabled)',\n parentSelector: '[data-list]',\n activateOnFocus: false,\n loop: true,\n orientation: 'vertical',\n})\n\nconst monthControlProps = (month: number) => props.getMonthControlProps?.(month) ?? {}\nconst yearControlProps = (year: number) => props.getYearControlProps?.(year) ?? {}\n</script>\n\n<template>\n <Popover\n position=\"bottom-start\"\n trap-focus\n :transition-props=\"{ transition: 'pop', duration: 120 }\"\n :radius=\"props.radius || DEFAULT_DROPDOWN_RADIUS\"\n shadow=\"md\"\n :offset=\"3\"\n :width=\"props.withMonths ? undefined : 'target'\"\n :opened=\"opened\"\n @change=\"opened = $event\"\n >\n <Popover.Target>\n <HeaderControl\n v-bind=\"{ ...attrs, ...getStyles('monthYearSelectTarget') }\"\n :radius=\"props.radius\"\n :data-with-months=\"props.withMonths || undefined\"\n @click=\"opened = !opened\"\n >\n {{ targetLabel }}\n </HeaderControl>\n </Popover.Target>\n\n <Popover.Dropdown\n v-bind=\"getStyles('monthYearSelectDropdown')\"\n :data-with-months=\"props.withMonths || undefined\"\n >\n <Box v-if=\"props.withMonths\" v-bind=\"getStyles('monthYearSelectList')\" data-list>\n <Box v-bind=\"getStyles('monthYearSelectLabel')\">{{ getLabel('month', labels) }}</Box>\n <UnstyledButton\n v-for=\"month in months\"\n :key=\"month.month\"\n v-bind=\"{\n ...monthControlProps(month.month),\n ...getStyles('monthYearSelectControl', {\n className: monthControlProps(month.month).class,\n }),\n }\"\n :mod=\"{ type: 'month', active: month.month === props.monthValue }\"\n :tabindex=\"month.month === props.monthValue ? 0 : -1\"\n :aria-label=\"`${getLabel('selectMonth', labels)} ${month.name}`\"\n @keydown=\"monthKeydownHandler\"\n @click=\"selectMonth(month.month)\"\n >\n {{ month.name }}\n </UnstyledButton>\n </Box>\n\n <Box v-bind=\"getStyles('monthYearSelectList')\" data-list>\n <Box v-if=\"props.withMonths\" v-bind=\"getStyles('monthYearSelectLabel')\">\n {{ getLabel('year', labels) }}\n </Box>\n <UnstyledButton\n v-for=\"(year, index) in years\"\n :key=\"year\"\n v-bind=\"{\n ...yearControlProps(year),\n ...getStyles('monthYearSelectControl', { className: yearControlProps(year).class }),\n }\"\n :mod=\"{ type: 'year', active: year === props.yearValue }\"\n :tabindex=\"hasActiveYear ? (year === props.yearValue ? 0 : -1) : index === 0 ? 0 : -1\"\n :aria-label=\"`${getLabel('selectYear', labels)} ${year}`\"\n @keydown=\"yearKeydownHandler\"\n @click=\"selectYear(year)\"\n >\n {{ year }}\n </UnstyledButton>\n </Box>\n </Popover.Dropdown>\n </Popover>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport MonthYearSelectComponent from './MonthYearSelect.vue'\nimport type { MonthYearSelectFactory } from './MonthYearSelect.types'\nimport classes from './MonthYearSelect.module.css'\n\nexport const MonthYearSelect = factory<MonthYearSelectFactory>(MonthYearSelectComponent, {\n classes,\n})\n\nexport type {\n MonthYearSelectEmits,\n MonthYearSelectFactory,\n MonthYearSelectOwnProps,\n MonthYearSelectProps,\n MonthYearSelectStylesNames,\n} from './MonthYearSelect.types'\n",".viewSelect {\n display: flex;\n gap: 4px;\n}\n","<script lang=\"ts\">\nimport type { ScheduleViewLevel } from '../../../types'\n\nconst defaultProps = {\n views: ['day', 'week', 'month', 'year'],\n} as const\n\nconst SWITCH_LABELS: Record<\n ScheduleViewLevel,\n 'switchToDayView' | 'switchToWeekView' | 'switchToMonthView' | 'switchToYearView'\n> = {\n day: 'switchToDayView',\n week: 'switchToWeekView',\n month: 'switchToMonthView',\n year: 'switchToYearView',\n}\n\nexport { defaultProps, SWITCH_LABELS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { HeaderControl } from '../HeaderControl'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport type { ViewSelectEmits, ViewSelectOwnProps } from './ViewSelect.types'\nimport classes from './ViewSelect.module.css'\n\ndefineOptions({\n name: 'ViewSelect',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ViewSelectOwnProps>(), {\n views: undefined,\n modelValue: undefined,\n value: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<ViewSelectEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ViewSelect', defaultProps, rawProps)\n\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\nconst getStyles = useStyles({\n name: 'ViewSelect',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'viewSelect',\n})\n\nconst selected = computed(() => props.modelValue ?? props.value)\n\nconst select = (view: ScheduleViewLevel) => {\n emit('update:modelValue', view)\n emit('change', view)\n}\n\n/** Roving tabindex across the tablist, matching the WAI-ARIA tabs pattern. */\nconst handleKeydown = (nativeEvent: KeyboardEvent, index: number) => {\n const controls = (\n nativeEvent.currentTarget as HTMLElement\n ).parentElement?.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]')\n\n if (!controls?.length) {\n return\n }\n\n let next = index\n\n if (nativeEvent.key === 'ArrowRight') {\n next = (index + 1) % controls.length\n } else if (nativeEvent.key === 'ArrowLeft') {\n next = (index - 1 + controls.length) % controls.length\n } else if (nativeEvent.key === 'Home') {\n next = 0\n } else if (nativeEvent.key === 'End') {\n next = controls.length - 1\n } else {\n return\n }\n\n nativeEvent.preventDefault()\n controls[next]?.focus()\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('viewSelect') }\"\n role=\"tablist\"\n :aria-label=\"getLabel('viewSelectLabel', labels)\"\n >\n <HeaderControl\n v-for=\"(view, index) in props.views\"\n :key=\"view\"\n :active=\"view === selected\"\n :radius=\"props.radius\"\n role=\"tab\"\n :data-type=\"view\"\n :aria-selected=\"view === selected\"\n :aria-label=\"getLabel(SWITCH_LABELS[view], labels)\"\n :tabindex=\"view === selected ? 0 : -1\"\n @click=\"select(view)\"\n @keydown=\"handleKeydown($event, index)\"\n >\n {{ getLabel(view, labels) }}\n </HeaderControl>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport type { ScheduleViewLevel } from '../../../types'\n\nconst defaultProps = {\n views: ['day', 'week', 'month', 'year'],\n} as const\n\nconst SWITCH_LABELS: Record<\n ScheduleViewLevel,\n 'switchToDayView' | 'switchToWeekView' | 'switchToMonthView' | 'switchToYearView'\n> = {\n day: 'switchToDayView',\n week: 'switchToWeekView',\n month: 'switchToMonthView',\n year: 'switchToYearView',\n}\n\nexport { defaultProps, SWITCH_LABELS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { HeaderControl } from '../HeaderControl'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport type { ViewSelectEmits, ViewSelectOwnProps } from './ViewSelect.types'\nimport classes from './ViewSelect.module.css'\n\ndefineOptions({\n name: 'ViewSelect',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ViewSelectOwnProps>(), {\n views: undefined,\n modelValue: undefined,\n value: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<ViewSelectEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ViewSelect', defaultProps, rawProps)\n\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\nconst getStyles = useStyles({\n name: 'ViewSelect',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'viewSelect',\n})\n\nconst selected = computed(() => props.modelValue ?? props.value)\n\nconst select = (view: ScheduleViewLevel) => {\n emit('update:modelValue', view)\n emit('change', view)\n}\n\n/** Roving tabindex across the tablist, matching the WAI-ARIA tabs pattern. */\nconst handleKeydown = (nativeEvent: KeyboardEvent, index: number) => {\n const controls = (\n nativeEvent.currentTarget as HTMLElement\n ).parentElement?.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]')\n\n if (!controls?.length) {\n return\n }\n\n let next = index\n\n if (nativeEvent.key === 'ArrowRight') {\n next = (index + 1) % controls.length\n } else if (nativeEvent.key === 'ArrowLeft') {\n next = (index - 1 + controls.length) % controls.length\n } else if (nativeEvent.key === 'Home') {\n next = 0\n } else if (nativeEvent.key === 'End') {\n next = controls.length - 1\n } else {\n return\n }\n\n nativeEvent.preventDefault()\n controls[next]?.focus()\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('viewSelect') }\"\n role=\"tablist\"\n :aria-label=\"getLabel('viewSelectLabel', labels)\"\n >\n <HeaderControl\n v-for=\"(view, index) in props.views\"\n :key=\"view\"\n :active=\"view === selected\"\n :radius=\"props.radius\"\n role=\"tab\"\n :data-type=\"view\"\n :aria-selected=\"view === selected\"\n :aria-label=\"getLabel(SWITCH_LABELS[view], labels)\"\n :tabindex=\"view === selected ? 0 : -1\"\n @click=\"select(view)\"\n @keydown=\"handleKeydown($event, index)\"\n >\n {{ getLabel(view, labels) }}\n </HeaderControl>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ViewSelectComponent from './ViewSelect.vue'\nimport type { ViewSelectFactory } from './ViewSelect.types'\nimport classes from './ViewSelect.module.css'\n\nexport const ViewSelect = factory<ViewSelectFactory>(ViewSelectComponent, { classes })\n\nexport type {\n ViewSelectEmits,\n ViewSelectFactory,\n ViewSelectOwnProps,\n ViewSelectProps,\n ViewSelectStylesNames,\n} from './ViewSelect.types'\n","import { factory } from '@mantine-vue/core'\nimport ScheduleHeaderComponent from './ScheduleHeader.vue'\nimport {\n HeaderControl,\n ScheduleHeaderNext,\n ScheduleHeaderPrevious,\n ScheduleHeaderToday,\n} from './HeaderControl'\nimport { MonthYearSelect } from './MonthYearSelect'\nimport { ViewSelect } from './ViewSelect'\nimport type { ScheduleHeaderFactory } from './ScheduleHeader.types'\nimport classes from './ScheduleHeader.module.css'\n\nexport const ScheduleHeader = factory<\n ScheduleHeaderFactory & {\n staticComponents: {\n Control: typeof HeaderControl\n Previous: typeof ScheduleHeaderPrevious\n Next: typeof ScheduleHeaderNext\n Today: typeof ScheduleHeaderToday\n ViewSelect: typeof ViewSelect\n MonthYearSelect: typeof MonthYearSelect\n }\n }\n>(ScheduleHeaderComponent, {\n classes,\n Control: HeaderControl,\n Previous: ScheduleHeaderPrevious,\n Next: ScheduleHeaderNext,\n Today: ScheduleHeaderToday,\n ViewSelect,\n MonthYearSelect,\n})\n\nexport type {\n CombinedScheduleHeaderStylesNames,\n ScheduleHeaderFactory,\n ScheduleHeaderOwnProps,\n ScheduleHeaderProps,\n ScheduleHeaderSlots,\n ScheduleHeaderStylesNames,\n} from './ScheduleHeader.types'\n","<script lang=\"ts\">\nimport dayjs from 'dayjs'\nimport type { ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport type { ScheduleHeaderNavigationHandlers } from './ScheduleHeaderBase.types'\n\nconst DEFAULT_VIEWS: ScheduleViewLevel[] = ['day', 'week', 'month', 'year']\n\n/** Builds the previous/next/today handlers for a view that steps by a single `unit`. */\nexport function createHeaderNavigation(\n date: Date | string,\n unit: 'day' | 'week' | 'month' | 'year',\n): ScheduleHeaderNavigationHandlers {\n return {\n previous: () => toDateString(dayjs(date).subtract(1, unit)),\n next: () => toDateString(dayjs(date).add(1, unit)),\n today: () => toDateString(dayjs()),\n }\n}\n\nexport { DEFAULT_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { Box, NativeSelect, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport { ScheduleHeader } from './ScheduleHeader'\nimport type {\n ScheduleHeaderBaseEmits,\n ScheduleHeaderBaseProps,\n ScheduleHeaderBaseSlots,\n} from './ScheduleHeaderBase.types'\nimport classes from './ScheduleHeader.module.css'\n\ndefineOptions({\n name: 'ScheduleHeaderBase',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleHeaderBaseProps>(), {\n labels: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleHeaderBaseSlots>()\n\nconst emit = defineEmits<ScheduleHeaderBaseEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ScheduleHeader', null, rawProps)\n\n/**\n * The layout selectors live in the `ScheduleHeader` Styles API, so a view that forwards its\n * `classNames` reaches them through the same names it documents.\n */\nconst getStyles = useStyles({\n name: 'ScheduleHeader',\n props,\n classes,\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'header',\n})\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst views = computed(() => props.viewSelectProps?.views ?? DEFAULT_VIEWS)\n\nconst compactData = computed(() =>\n views.value.map((view) => ({ value: view, label: getLabel(view, props.labels) })),\n)\n\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n\nconst renderTitle = () => props.control.title\n</script>\n\n<template>\n <ScheduleHeader v-bind=\"{ ...attrs, ...stylesApi }\" :labels=\"props.labels\">\n <Box v-bind=\"getStyles('navigationGroup')\">\n <ScheduleHeader.Previous\n v-bind=\"{ ...stylesApi, ...props.previousControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.previous())\"\n />\n\n <ScheduleHeader.MonthYearSelect\n v-if=\"props.control.monthYearSelect\"\n v-bind=\"{ ...stylesApi, ...props.control.monthYearSelect }\"\n :labels=\"props.labels\"\n />\n <ScheduleHeader.Control\n v-else\n v-bind=\"stylesApi\"\n :interactive=\"false\"\n :style=\"props.control.miw === undefined ? undefined : { minWidth: props.control.miw }\"\n >\n <component :is=\"renderTitle\" v-if=\"props.control.title !== undefined\" />\n <slot v-else name=\"title\" />\n </ScheduleHeader.Control>\n\n <ScheduleHeader.Next\n v-bind=\"{ ...stylesApi, ...props.nextControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.next())\"\n />\n </Box>\n\n <Box v-bind=\"getStyles('todayControl')\">\n <ScheduleHeader.Today\n v-bind=\"{ ...stylesApi, ...props.todayControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.today())\"\n />\n </Box>\n\n <NativeSelect\n :class=\"getStyles('compactViewSelect').class\"\n :model-value=\"props.view\"\n size=\"sm\"\n :data=\"compactData\"\n :aria-label=\"getLabel('viewSelectLabel', props.labels)\"\n @change=\"changeView($event as ScheduleViewLevel)\"\n />\n\n <Box v-bind=\"getStyles('viewSelect', { style: { marginInlineStart: 'auto' } })\">\n <ScheduleHeader.ViewSelect\n v-bind=\"{ ...stylesApi, ...props.viewSelectProps }\"\n :model-value=\"props.view\"\n :labels=\"props.labels\"\n @change=\"changeView\"\n />\n </Box>\n </ScheduleHeader>\n</template>\n","<script lang=\"ts\">\nimport dayjs from 'dayjs'\nimport type { ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport type { ScheduleHeaderNavigationHandlers } from './ScheduleHeaderBase.types'\n\nconst DEFAULT_VIEWS: ScheduleViewLevel[] = ['day', 'week', 'month', 'year']\n\n/** Builds the previous/next/today handlers for a view that steps by a single `unit`. */\nexport function createHeaderNavigation(\n date: Date | string,\n unit: 'day' | 'week' | 'month' | 'year',\n): ScheduleHeaderNavigationHandlers {\n return {\n previous: () => toDateString(dayjs(date).subtract(1, unit)),\n next: () => toDateString(dayjs(date).add(1, unit)),\n today: () => toDateString(dayjs()),\n }\n}\n\nexport { DEFAULT_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { Box, NativeSelect, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport { ScheduleHeader } from './ScheduleHeader'\nimport type {\n ScheduleHeaderBaseEmits,\n ScheduleHeaderBaseProps,\n ScheduleHeaderBaseSlots,\n} from './ScheduleHeaderBase.types'\nimport classes from './ScheduleHeader.module.css'\n\ndefineOptions({\n name: 'ScheduleHeaderBase',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleHeaderBaseProps>(), {\n labels: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleHeaderBaseSlots>()\n\nconst emit = defineEmits<ScheduleHeaderBaseEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ScheduleHeader', null, rawProps)\n\n/**\n * The layout selectors live in the `ScheduleHeader` Styles API, so a view that forwards its\n * `classNames` reaches them through the same names it documents.\n */\nconst getStyles = useStyles({\n name: 'ScheduleHeader',\n props,\n classes,\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'header',\n})\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst views = computed(() => props.viewSelectProps?.views ?? DEFAULT_VIEWS)\n\nconst compactData = computed(() =>\n views.value.map((view) => ({ value: view, label: getLabel(view, props.labels) })),\n)\n\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n\nconst renderTitle = () => props.control.title\n</script>\n\n<template>\n <ScheduleHeader v-bind=\"{ ...attrs, ...stylesApi }\" :labels=\"props.labels\">\n <Box v-bind=\"getStyles('navigationGroup')\">\n <ScheduleHeader.Previous\n v-bind=\"{ ...stylesApi, ...props.previousControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.previous())\"\n />\n\n <ScheduleHeader.MonthYearSelect\n v-if=\"props.control.monthYearSelect\"\n v-bind=\"{ ...stylesApi, ...props.control.monthYearSelect }\"\n :labels=\"props.labels\"\n />\n <ScheduleHeader.Control\n v-else\n v-bind=\"stylesApi\"\n :interactive=\"false\"\n :style=\"props.control.miw === undefined ? undefined : { minWidth: props.control.miw }\"\n >\n <component :is=\"renderTitle\" v-if=\"props.control.title !== undefined\" />\n <slot v-else name=\"title\" />\n </ScheduleHeader.Control>\n\n <ScheduleHeader.Next\n v-bind=\"{ ...stylesApi, ...props.nextControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.next())\"\n />\n </Box>\n\n <Box v-bind=\"getStyles('todayControl')\">\n <ScheduleHeader.Today\n v-bind=\"{ ...stylesApi, ...props.todayControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.today())\"\n />\n </Box>\n\n <NativeSelect\n :class=\"getStyles('compactViewSelect').class\"\n :model-value=\"props.view\"\n size=\"sm\"\n :data=\"compactData\"\n :aria-label=\"getLabel('viewSelectLabel', props.labels)\"\n @change=\"changeView($event as ScheduleViewLevel)\"\n />\n\n <Box v-bind=\"getStyles('viewSelect', { style: { marginInlineStart: 'auto' } })\">\n <ScheduleHeader.ViewSelect\n v-bind=\"{ ...stylesApi, ...props.viewSelectProps }\"\n :model-value=\"props.view\"\n :labels=\"props.labels\"\n @change=\"changeView\"\n />\n </Box>\n </ScheduleHeader>\n</template>\n","import ScheduleHeaderBaseComponent, { createHeaderNavigation } from './ScheduleHeaderBase.vue'\n\n/**\n * Header shared by every view. Internal building block: views expose the parts of it they\n * support through their own props rather than rendering it directly.\n */\nexport const ScheduleHeaderBase = ScheduleHeaderBaseComponent\n\nexport { createHeaderNavigation }\n\nexport type {\n ScheduleHeaderBaseEmits,\n ScheduleHeaderBaseProps,\n ScheduleHeaderBaseSlots,\n ScheduleHeaderControl,\n ScheduleHeaderNavigationHandlers,\n} from './ScheduleHeaderBase.types'\n","import { onBeforeUnmount, shallowRef, watch, type Ref } from 'vue'\nimport { rafThrottle } from './shared'\n\ninterface SelectedRange {\n group: string\n start: number\n end: number\n}\n\ninterface DragState {\n group: string\n startIndex: number\n currentIndex: number\n}\n\nexport interface UseSlotDragSelectInput {\n enabled: () => boolean\n\n onDragEnd?: (startIndex: number, endIndex: number, group: string) => void\n}\n\nexport interface SlotDragSelect {\n handleSlotPointerDown: (event: PointerEvent, index: number, group: string) => void\n\n isSlotSelected: (index: number, group: string) => boolean\n\n isDragging: () => boolean\n}\n\n/**\n * Slot drag-selection shared by the day, week and month views. It tracks a selected range as the\n * pointer moves across elements carrying `data-drag-slot-index` / `data-drag-slot-group`.\n *\n * Hit testing goes through `elementsFromPoint`, which reads layout, so it is coalesced to one\n * animation frame: a fast pointer would otherwise queue up more hit tests and re-renders than the\n * browser can paint, and the selection would keep growing after the pointer stopped.\n */\nexport function useSlotDragSelect(input: UseSlotDragSelectInput): SlotDragSelect {\n const selectedRange = shallowRef<SelectedRange | null>(null)\n let drag: DragState | null = null\n let savedUserSelect = ''\n\n const resolveIndexAt = rafThrottle((clientX: number, clientY: number) => {\n if (!drag) {\n return\n }\n\n for (const element of document.elementsFromPoint(clientX, clientY)) {\n const indexAttr = element.getAttribute?.('data-drag-slot-index')\n const groupAttr = element.getAttribute?.('data-drag-slot-group')\n\n if (indexAttr == null || groupAttr == null) {\n continue\n }\n\n if (groupAttr === drag.group) {\n const nextIndex = Number(indexAttr)\n\n if (!Number.isNaN(nextIndex) && nextIndex !== drag.currentIndex) {\n drag.currentIndex = nextIndex\n selectedRange.value = {\n group: groupAttr,\n start: Math.min(drag.startIndex, nextIndex),\n end: Math.max(drag.startIndex, nextIndex),\n }\n }\n }\n\n // The topmost slot under the pointer decides; anything below it is covered.\n break\n }\n })\n\n const handlePointerMove = (event: PointerEvent) => {\n if (drag) {\n resolveIndexAt(event.clientX, event.clientY)\n }\n }\n\n const handlePointerUp = () => {\n // Drop the pending hit test first: the gesture is over, so its result is stale by definition.\n resolveIndexAt.cancel()\n\n if (drag) {\n const { startIndex, currentIndex, group } = drag\n\n if (startIndex !== currentIndex) {\n input.onDragEnd?.(\n Math.min(startIndex, currentIndex),\n Math.max(startIndex, currentIndex),\n group,\n )\n }\n }\n\n drag = null\n selectedRange.value = null\n }\n\n const removeListeners = () => {\n resolveIndexAt.cancel()\n document.body.style.userSelect = savedUserSelect\n document.removeEventListener('pointermove', handlePointerMove)\n document.removeEventListener('pointerup', handlePointerUp)\n }\n\n watch(\n () => selectedRange.value !== null,\n (isDragging) => {\n if (isDragging) {\n savedUserSelect = document.body.style.userSelect\n document.body.style.userSelect = 'none'\n document.addEventListener('pointermove', handlePointerMove)\n document.addEventListener('pointerup', handlePointerUp)\n } else {\n removeListeners()\n }\n },\n )\n\n onBeforeUnmount(() => {\n if (selectedRange.value !== null) {\n removeListeners()\n }\n })\n\n const handleSlotPointerDown = (_event: PointerEvent, index: number, group: string) => {\n if (!input.enabled()) {\n return\n }\n\n drag = { group, startIndex: index, currentIndex: index }\n selectedRange.value = { group, start: index, end: index }\n }\n\n const isSlotSelected = (index: number, group: string) => {\n const range = selectedRange.value\n\n if (!range || range.group !== group) {\n return false\n }\n\n return index >= range.start && index <= range.end\n }\n\n const isDragging = () => selectedRange.value !== null\n\n return { handleSlotPointerDown, isSlotSelected, isDragging }\n}\n\nexport type SelectedRangeRef = Ref<SelectedRange | null>\n","import { shallowRef } from 'vue'\nimport type { DateStringValue, DateTimeStringValue } from '../types'\nimport { rafThrottle } from './shared'\n\nexport interface SlotDropTarget {\n date: DateStringValue\n\n slotIndex: number\n}\n\nexport interface SlotDropInterval {\n startTime: string\n}\n\nexport interface ResolveSlotInput {\n container: HTMLElement | null | undefined\n\n date: DateStringValue\n\n intervals: SlotDropInterval[]\n}\n\nexport interface ResolvedSlotDrop {\n slotIndex: number\n target: DateTimeStringValue\n}\n\nfunction resolveSlotIndex(\n { container, intervals }: ResolveSlotInput,\n clientY: number,\n eventTarget: Element | null,\n) {\n if (!container || intervals.length === 0) {\n return -1\n }\n\n // Fast path: the pointer is over a slot, so the index is already on the element.\n const slot = eventTarget?.closest<HTMLElement>('[data-time-slot-index]')\n\n if (slot && container.contains(slot)) {\n const index = Number(slot.dataset.timeSlotIndex)\n\n if (Number.isInteger(index)) {\n return index\n }\n }\n\n // Slow path: the pointer is over an event or a gap, so the slots have to be measured. This\n // reads layout, which is why the caller only ever reaches it once per animation frame.\n const slots = container.querySelectorAll<HTMLElement>('[data-time-slot-index]')\n\n return Array.from(slots).findIndex((element) => {\n const rect = element.getBoundingClientRect()\n return clientY >= rect.top && clientY <= rect.bottom\n })\n}\n\n/**\n * Tracks the time slot a drag is hovering over.\n *\n * `dragover` fires many times per frame and the fallback that measures slots reads layout, so\n * resolving the target on every event makes the highlight lag behind the pointer and keep\n * catching up after it stops. The resolution is therefore coalesced to one animation frame, the\n * state is only written when the slot actually changes, and any pending frame is dropped as soon\n * as the drag leaves or the drop happens — so nothing lands after the fact.\n */\nexport function useSlotDropTarget() {\n const dropTarget = shallowRef<SlotDropTarget | null>(null)\n\n const setTarget = (next: SlotDropTarget | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (current && next && current.date === next.date && current.slotIndex === next.slotIndex) {\n return\n }\n\n dropTarget.value = next\n }\n\n const resolveLater = rafThrottle(\n (input: ResolveSlotInput, clientY: number, eventTarget: Element | null) => {\n const slotIndex = resolveSlotIndex(input, clientY, eventTarget)\n setTarget(slotIndex < 0 ? null : { date: input.date, slotIndex })\n },\n )\n\n const reset = () => {\n resolveLater.cancel()\n setTarget(null)\n }\n\n return {\n dropTarget,\n\n isTarget: (date: DateStringValue, slotIndex: number) =>\n dropTarget.value?.date === date && dropTarget.value.slotIndex === slotIndex,\n\n /**\n * Accepts the drag and schedules the target update. `preventDefault` and `dropEffect` run\n * synchronously because the browser reads them as the handler returns.\n */\n dragOver: (nativeEvent: DragEvent, input: ResolveSlotInput) => {\n nativeEvent.preventDefault()\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.dropEffect = nativeEvent.dataTransfer.types.includes(\n 'application/json',\n )\n ? 'move'\n : 'copy'\n }\n\n resolveLater(\n input,\n nativeEvent.clientY,\n nativeEvent.target instanceof Element ? nativeEvent.target : null,\n )\n },\n\n dragLeave: (nativeEvent: DragEvent, container: HTMLElement | null | undefined) => {\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !container?.contains(nativeEvent.relatedTarget)\n ) {\n reset()\n }\n },\n\n drop: (nativeEvent: DragEvent, input: ResolveSlotInput): ResolvedSlotDrop | undefined => {\n const slotIndex = resolveSlotIndex(\n input,\n nativeEvent.clientY,\n nativeEvent.target instanceof Element ? nativeEvent.target : null,\n )\n\n reset()\n\n const interval = input.intervals[slotIndex]\n\n return interval\n ? { slotIndex, target: `${input.date} ${interval.startTime}` as DateTimeStringValue }\n : undefined\n },\n\n reset,\n }\n}\n","import { AnyDateValue, DayPositionedEventData, ScheduleEventData } from '../../../types'\nimport { getDayPosition, isAllDayEvent, isEventsOverlap, sortEvents } from '../../../utils'\n\ninterface ColumnHasConflictOptions {\n columns: ScheduleEventData[][]\n columnIndex: number\n event: ScheduleEventData\n allDay: boolean\n date: AnyDateValue\n}\n\nfunction columnHasConflict({\n columns,\n columnIndex,\n event,\n allDay,\n date,\n}: ColumnHasConflictOptions): boolean {\n if (!columns[columnIndex]) {\n return false\n }\n\n return columns[columnIndex].some((e) => {\n const eAllDay = isAllDayEvent({ event: e, date })\n const hasTimeConflict = isEventsOverlap(e, event)\n\n // Don't count all-day events as overlaps\n if (allDay || eAllDay) {\n return false\n }\n\n return hasTimeConflict\n })\n}\n\ninterface GetDayPositionedEventsInput {\n /** Date at which events are positioned, used to check if events are all-day */\n date: AnyDateValue\n\n /** List of all events that belong to the given date, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[]\n\n /** Start time of the day view, used to calculate event positions */\n startTime?: string\n\n /** End time of the day view, used to calculate event positions */\n endTime?: string\n\n /** Number of minutes per time slot, used to align the canvas to whole slots */\n intervalMinutes?: number\n}\n\nexport function getDayPositionedEvents({\n events,\n startTime,\n endTime,\n intervalMinutes,\n date,\n}: GetDayPositionedEventsInput) {\n const columns: ScheduleEventData[][] = []\n const positioned: DayPositionedEventData[] = []\n\n const sorted = sortEvents(events)\n\n for (const event of sorted) {\n const allDay = isAllDayEvent({ event, date })\n\n let column = 0\n\n while (columnHasConflict({ columns, columnIndex: column, event, allDay, date })) {\n column++\n }\n\n if (!columns[column]) {\n columns[column] = []\n }\n\n columns[column].push(event)\n\n const verticalPosition = allDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event, startTime, endTime, intervalMinutes })\n\n positioned.push({\n ...event,\n position: {\n ...verticalPosition,\n allDay,\n column,\n\n // set later\n width: 0,\n offset: 0,\n overlaps: 0,\n },\n })\n }\n for (const positionedEvent of positioned) {\n const { allDay, column } = positionedEvent.position\n\n if (allDay) {\n positionedEvent.position.overlaps = 1\n positionedEvent.position.width = 100\n positionedEvent.position.offset = 0\n continue\n }\n\n // Find events that directly overlap with this event\n const directlyOverlapping: DayPositionedEventData[] = []\n\n for (const otherEvent of positioned) {\n if (otherEvent === positionedEvent || otherEvent.position.allDay) {\n continue\n }\n\n if (isEventsOverlap(otherEvent, positionedEvent)) {\n directlyOverlapping.push(otherEvent)\n }\n }\n\n // Find the max column by also checking overlaps of overlapping events\n // This ensures we account for the full column group\n let maxColumn = column\n\n for (const overlappingEvent of directlyOverlapping) {\n maxColumn = Math.max(maxColumn, overlappingEvent.position.column)\n\n // Check what overlaps with each overlapping event\n for (const otherEvent of positioned) {\n if (otherEvent === overlappingEvent || otherEvent.position.allDay) {\n continue\n }\n\n if (isEventsOverlap(otherEvent, overlappingEvent)) {\n maxColumn = Math.max(maxColumn, otherEvent.position.column)\n }\n }\n }\n\n const totalColumns = maxColumn + 1\n\n // Find the first occupied column to the right of this event\n // Events expand to fill empty columns but stop at the next occupied column\n let nextOccupiedColumn = totalColumns\n\n for (const other of directlyOverlapping) {\n if (other.position.column > column && other.position.column < nextOccupiedColumn) {\n nextOccupiedColumn = other.position.column\n }\n }\n\n const columnsSpanned = nextOccupiedColumn - column\n\n positionedEvent.position.overlaps = totalColumns\n positionedEvent.position.width = (columnsSpanned / totalColumns) * 100\n positionedEvent.position.offset = (column * 100) / totalColumns\n }\n\n return positioned\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayPositionedEventData, ScheduleEventData } from '../../../types'\nimport { getDayPosition, isAllDayEvent, isEventInTimeRange, validateEvent } from '../../../utils'\nimport { getDayPositionedEvents } from './get-day-positioned-events'\n\ninterface GetDayViewEventsInput {\n events: ScheduleEventData[] | undefined\n date: AnyDateValue\n startTime?: string\n endTime?: string\n intervalMinutes?: number\n}\n\nexport function getDayViewEvents({\n events,\n date,\n startTime,\n endTime,\n intervalMinutes,\n}: GetDayViewEventsInput) {\n if (events === undefined) {\n return {\n allDayEvents: [],\n regularEvents: [],\n backgroundTimedEvents: [],\n backgroundAllDayEvents: [],\n }\n }\n\n const ids = new Set<string | number>()\n const filteredEvents: ScheduleEventData[] = []\n const backgroundFiltered: ScheduleEventData[] = []\n const dayStart = dayjs(date).startOf('day')\n const dayEnd = dayjs(date).endOf('day')\n\n for (const event of events) {\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n const isOnDay = eventStart.isSame(dayStart, 'day')\n const spansIntoDay =\n !isOnDay &&\n event.display === 'background' &&\n eventStart.isBefore(dayEnd) &&\n eventEnd.isAfter(dayStart)\n\n if (isOnDay || spansIntoDay) {\n if (isOnDay && !isEventInTimeRange({ event, startTime, endTime })) {\n continue\n }\n\n const validated = validateEvent(event)\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(`[@mantine/schedule] DayView: Duplicated event ids found: ${event.id}`)\n }\n\n if (event.display === 'background') {\n backgroundFiltered.push(validated)\n } else {\n filteredEvents.push(validated)\n }\n }\n }\n\n const positionedEvents = getDayPositionedEvents({\n events: filteredEvents,\n startTime,\n endTime,\n intervalMinutes,\n date,\n })\n\n const allDayEvents: DayPositionedEventData[] = []\n const regularEvents: DayPositionedEventData[] = []\n\n for (const event of positionedEvents) {\n if (event.position.allDay) {\n allDayEvents.push(event)\n } else {\n regularEvents.push(event)\n }\n }\n\n const backgroundTimedEvents: DayPositionedEventData[] = []\n const backgroundAllDayEvents: DayPositionedEventData[] = []\n for (const event of backgroundFiltered) {\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd\n\n const clippedEvent = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n }\n\n const allDay = isAllDayEvent({ event: clippedEvent, date })\n\n if (allDay) {\n backgroundAllDayEvents.push({\n ...event,\n position: {\n top: 0,\n height: 100,\n allDay: true,\n width: 100,\n offset: 0,\n column: 0,\n overlaps: 1,\n },\n })\n } else {\n const { top, height } = getDayPosition({\n event: clippedEvent,\n startTime,\n endTime,\n intervalMinutes,\n })\n if (height <= 0) {\n continue\n }\n backgroundTimedEvents.push({\n ...event,\n position: { top, height, allDay: false, width: 100, offset: 0, column: 0, overlaps: 1 },\n })\n }\n }\n\n return { allDayEvents, regularEvents, backgroundTimedEvents, backgroundAllDayEvents }\n}\n",".dayView {\n --slot-height: var(--day-view-slot-height, 64px); /* total height of 1 hour slot */\n --all-day-slot-height: var(--day-view-all-day-slot-height, 44px); /* height of all day slot */\n --day-view-slot-labels-width: 80px;\n --day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n @mixin where-light {\n --day-view-border-color: var(--mantine-color-gray-3);\n --day-view-business-hours-bg: var(--mantine-color-white);\n --day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --day-view-border-color: var(--mantine-color-dark-4);\n --day-view-business-hours-bg: var(--mantine-color-dark-7);\n --day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.dayViewScrollArea {\n border: 1px solid var(--day-view-border-color);\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n :where(:global(.mantine-ScrollArea-scrollbar)) {\n z-index: 4;\n }\n}\n\n.dayViewInner {\n display: flex;\n}\n\n.dayViewTimeSlots {\n position: relative;\n\n &:where(:first-of-type) .dayViewSlot:where([data-first]) {\n border-top-color: transparent;\n }\n}\n\n.dayViewSlotLabels {\n width: var(--day-view-slot-labels-width);\n}\n\n.dayViewSlotLabel {\n height: var(--slot-height);\n border-top: 1px solid var(--day-view-border-color);\n font-size: var(--mantine-font-size-sm);\n text-align: right;\n padding: 4px 8px;\n font-variant-numeric: tabular-nums;\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where(:first-of-type) {\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n}\n\n.dayViewSlots {\n flex: 1;\n}\n\n.dayViewSlot {\n display: block;\n width: 100%;\n border-top: 1px dotted var(--day-view-border-color);\n height: calc(var(--slot-height) * var(--slot-size));\n position: relative;\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-hour-start]) {\n border-top: 1px solid var(--day-view-border-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.dayViewBackgroundEvent {\n position: absolute;\n border-radius: 0;\n pointer-events: none;\n z-index: 2;\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n}\n\n.dayViewAllDay {\n position: relative;\n height: var(--all-day-slot-height);\n}\n\n.dayViewAllDayEvents {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n pointer-events: none;\n z-index: 3;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 15,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n slotHeight: 64,\n headerFormat: 'MMMM D, YYYY',\n withAllDaySlot: true,\n allDaySlotHeight: 44,\n maxAllDayEvents: 3,\n} as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotHeight, allDaySlotHeight }) => ({\n dayView: {\n '--day-view-radius': resolveScheduleRadius(radius),\n '--day-view-slot-height': cssSize(slotHeight),\n '--day-view-all-day-slot-height': cssSize(allDaySlotHeight),\n },\n }),\n)\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useEventResize } from '../../hooks/use-event-resize'\nimport { getLabel } from '../../labels'\nimport type { DateTimeStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getDayTimeIntervals,\n getVisibleEvents,\n toDateString,\n} from '../../utils'\nimport { CurrentTimeIndicator } from '../CurrentTimeIndicator'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n moveEventToAllDay,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { useSlotDropTarget } from '../use-slot-drop-target'\nimport { getDayViewEvents } from './get-day-view-events/get-day-view-events'\nimport type { DayViewEmits, DayViewOwnProps, DayViewSlots } from './DayView.types'\nimport classes from './DayView.module.css'\n\ndefineOptions({\n name: 'DayView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<DayViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n slotLabelFormat: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n slotHeight: undefined,\n businessHours: undefined,\n canDragEvent: undefined,\n startScrollTime: undefined,\n canResizeEvent: undefined,\n headerFormat: undefined,\n withAllDaySlot: undefined,\n allDaySlotHeight: undefined,\n maxAllDayEvents: undefined,\n moreEventsProps: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<DayViewSlots>()\n\nconst emit = defineEmits<DayViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('DayView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'DayView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'dayView',\n})\n\n/**\n * Cached per selector: the slot list re-renders on every step of a drag, and rebuilding the\n * same class list once per slot is what makes that re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst timeSlotsContainer = ref<HTMLElement | null>(null)\n\nconst slotDropTarget = useSlotDropTarget()\n\nconst date = computed(() => toDateString(props.date))\nconst datePart = computed(() => dayjs(date.value).format('YYYY-MM-DD'))\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? dayjs()))\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst showCurrentTimeIndicator = computed(\n () => props.withCurrentTimeIndicator ?? dayjs(date.value).isSame(now.value, 'day'),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n dayjs(date.value).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(date.value).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst dayEvents = computed(() =>\n getDayViewEvents({\n events: expandedEvents.value,\n date: date.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst hourStartIntervals = computed(() => intervals.value.filter((slot) => slot.isHourStart))\n\nconst allDayCounts = computed(() =>\n getVisibleEvents({\n maxEvents: props.maxAllDayEvents!,\n totalEvents: dayEvents.value.allDayEvents.length,\n }),\n)\n\nconst visibleAllDayEvents = computed(() =>\n dayEvents.value.allDayEvents.slice(0, allDayCounts.value.visibleEventsCount),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst eventResize = useEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex) => {\n const startSlot = intervals.value[startIndex]\n const endSlot = intervals.value[endIndex]\n\n if (startSlot && endSlot) {\n emit(\n 'slotDragEnd',\n `${datePart.value} ${startSlot.startTime}` as DateTimeStringValue,\n `${datePart.value} ${endSlot.endTime}` as DateTimeStringValue,\n )\n }\n },\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = slotDropTarget.dropTarget.value\n return target\n ? {\n date: target.date,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n slotDropTarget.reset()\n emit('eventDragEnd')\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n const target = timeSlotsContainer.value?.querySelector<HTMLElement>(\n `[data-time-slot-index=\"${targetIndex}\"]`,\n )\n\n scrollSlotIntoView(target)\n})\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst emitDrop = (nativeEvent: DragEvent, target: DateTimeStringValue) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventTo(event, target))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, target)\n }\n}\n\nconst emitAllDayDrop = (nativeEvent: DragEvent) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventToAllDay(event, datePart.value))\n } else if (nativeEvent.dataTransfer) {\n emit(\n 'externalEventDrop',\n nativeEvent.dataTransfer,\n `${datePart.value} 00:00:00` as DateTimeStringValue,\n )\n }\n}\n\nconst clickAllDaySlot = (nativeEvent: MouseEvent) =>\n emit('allDaySlotClick', date.value, nativeEvent)\n\nconst clickTimeSlot = (slotIndex: number, nativeEvent: MouseEvent) => {\n const slot = intervals.value[slotIndex]\n const start = dayjs(`${datePart.value} ${slot.startTime}`)\n emit('timeSlotClick', {\n slotStart: start.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n slotEnd: start\n .add(props.intervalMinutes!, 'minute')\n .format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n nativeEvent,\n })\n}\n\nconst dropInput = () => ({\n container: timeSlotsContainer.value,\n date: datePart.value,\n intervals: intervals.value,\n})\n\nconst handleGridDragOver = (nativeEvent: DragEvent) =>\n slotDropTarget.dragOver(nativeEvent, dropInput())\n\nconst handleGridDragLeave = (nativeEvent: DragEvent) =>\n slotDropTarget.dragLeave(nativeEvent, timeSlotsContainer.value)\n\nconst handleGridDrop = (nativeEvent: DragEvent) => {\n const target = slotDropTarget.drop(nativeEvent, dropInput())\n\n if (target) {\n emitDrop(nativeEvent, target.target)\n }\n}\n\nconst handleSlotKeydown = (nativeEvent: KeyboardEvent, index: number) => {\n const nextIndex =\n nativeEvent.key === 'ArrowDown' ? index + 1 : nativeEvent.key === 'ArrowUp' ? index - 1 : -1\n\n if (nextIndex < 0 || nextIndex >= intervals.value.length) {\n return\n }\n\n nativeEvent.preventDefault()\n timeSlotsContainer.value\n ?.querySelector<HTMLButtonElement>(`[data-time-slot-index=\"${nextIndex}\"]`)\n ?.focus()\n}\n\nconst businessHoursMods = computed(() =>\n intervals.value.map((slot) =>\n props.highlightBusinessHours\n ? getBusinessHoursMod({\n time: slot.startTime,\n businessHours: props.businessHours || ['09:00:00', '17:00:00'],\n highlightBusinessHours: true,\n dayOfWeek: dayjs(`${datePart.value} ${slot.startTime}`).day() as DayOfWeek,\n })\n : { 'business-hours': false, 'non-business-hours': false },\n ),\n)\n\nconst backgroundEventStyle = (position: { top: number; height: number }) => ({\n top: `${position.top}%`,\n bottom: `${100 - position.top - position.height}%`,\n minHeight: '1px',\n})\n\nconst regularEventStyle = (event: ScheduleEventData & { position: any }) => {\n const resizePosition = eventResize.getResizePosition(event.id)\n const top = resizePosition?.top ?? event.position.top\n const height = resizePosition?.height ?? event.position.height\n\n return {\n position: 'absolute' as const,\n top: `${top}%`,\n bottom: `${100 - top - height}%`,\n minHeight: '1px',\n width: `${event.position.width}%`,\n insetInlineStart: `${event.position.offset}%`,\n }\n}\n\nconst startEventResize = (\n event: ScheduleEventData & { position: any },\n edge: 'top' | 'bottom',\n pointerEvent: PointerEvent,\n) => {\n if (!timeSlotsContainer.value) {\n return\n }\n\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainer.value,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: datePart.value,\n pointerEvent,\n })\n}\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickResizableEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!eventResize.wasResizing()) {\n clickEvent(event, nativeEvent)\n }\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('dayView') }\"\n :mod=\"[{ static: isStatic, 'slot-dragging': slotDragSelect.isDragging() }, (attrs as any).mod]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"day\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(date, 'day')\"\n :control=\"{\n title: formatDate({ date, locale: props.locale || 'en', format: props.headerFormat! }),\n }\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"emit('dateChange', $event)\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <ScrollArea.Autosize\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('dayViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <Box v-bind=\"getStyles('dayViewInner')\">\n <div v-bind=\"getStyles('dayViewSlotLabels')\">\n <Box\n v-if=\"props.withAllDaySlot\"\n v-bind=\"getStyles('dayViewSlotLabel')\"\n :mod=\"{ 'all-day': true }\"\n >\n {{ getLabel('allDay', props.labels) }}\n </Box>\n <Box\n v-for=\"slot in hourStartIntervals\"\n :key=\"slot.startTime\"\n v-bind=\"staticStyles('dayViewSlotLabel')\"\n >\n {{\n formatDate({\n date: `${datePart} ${slot.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </Box>\n </div>\n\n <div v-bind=\"getStyles('dayViewSlots')\">\n <div v-if=\"props.withAllDaySlot\" v-bind=\"getStyles('dayViewAllDay')\">\n <div\n v-for=\"event in dayEvents.backgroundAllDayEvents\"\n :key=\"event.id\"\n v-bind=\"staticStyles('dayViewBackgroundEvent')\"\n />\n\n <div v-bind=\"getStyles('dayViewAllDayEvents')\">\n <ScheduleEvent\n v-for=\"event in visibleAllDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n nowrap\n :mode=\"props.mode\"\n :draggable=\"\n !isStatic &&\n props.withEventsDragAndDrop === true &&\n (props.canDragEvent?.(event) ?? true)\n \"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(event, $event)\"\n />\n\n <MoreEvents\n v-if=\"allDayCounts.hiddenEventsCount > 0\"\n :events=\"dayEvents.allDayEvents\"\n :more-events-count=\"allDayCounts.hiddenEventsCount\"\n :labels=\"props.labels\"\n :mode=\"props.mode\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"clickEvent\"\n />\n </div>\n\n <UnstyledButton\n v-bind=\"getStyles('dayViewSlot')\"\n :mod=\"{ 'all-day': true, static: isStatic }\"\n :tabindex=\"isStatic ? -1 : 0\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${getLabel('allDay', props.labels)}`\"\n @click=\"isStatic ? undefined : clickAllDaySlot($event)\"\n @dragover.prevent\n @drop=\"emitAllDayDrop\"\n />\n </div>\n\n <div\n ref=\"timeSlotsContainer\"\n v-bind=\"getStyles('dayViewTimeSlots')\"\n @dragover=\"withDragHandlers ? handleGridDragOver($event) : undefined\"\n @dragleave=\"withDragHandlers ? handleGridDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleGridDrop($event) : undefined\"\n >\n <div\n v-for=\"event in dayEvents.backgroundTimedEvents\"\n :key=\"event.id\"\n v-bind=\"staticStyles('dayViewBackgroundEvent')\"\n :style=\"backgroundEventStyle(event.position)\"\n />\n\n <ScheduleEvent\n v-for=\"event in dayEvents.regularEvents\"\n :key=\"event.id\"\n :event=\"event\"\n auto-size\n :mode=\"props.mode\"\n :style=\"regularEventStyle(event)\"\n :draggable=\"\n !isStatic &&\n props.withEventsDragAndDrop === true &&\n (props.canDragEvent?.(event) ?? true)\n \"\n :with-resize=\"eventResize.isResizableEvent(event)\"\n :is-resizing=\"eventResize.getResizePosition(event.id) !== null\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickResizableEvent(event, $event)\"\n @resize-start=\"(edge, pointerEvent) => startEventResize(event, edge, pointerEvent)\"\n />\n\n <CurrentTimeIndicator\n v-if=\"showCurrentTimeIndicator\"\n start-offset=\"calc(var(--day-view-slot-labels-width) * -1)\"\n end-offset=\"0rem\"\n top-offset=\"0rem\"\n time-bubble-start-offset=\"calc(var(--day-view-slot-labels-width) * -1 + 30px)\"\n :current-time-format=\"props.slotLabelFormat\"\n :start-time=\"props.startTime\"\n :end-time=\"props.endTime\"\n :interval-minutes=\"props.intervalMinutes\"\n :with-time-bubble=\"props.withCurrentTimeBubble\"\n :with-thumb=\"!props.withCurrentTimeBubble\"\n :get-current-time=\"props.getCurrentTime\"\n :locale=\"props.locale\"\n v-bind=\"stylesApi\"\n />\n\n <UnstyledButton\n v-for=\"(slot, index) in intervals\"\n :key=\"slot.startTime\"\n v-bind=\"staticStyles('dayViewSlot')\"\n :data-time-slot-index=\"index\"\n :data-drag-slot-index=\"withSlotSelect ? index : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? datePart : undefined\"\n :style=\"{ '--slot-size': String(props.intervalMinutes! / 60) }\"\n :mod=\"{\n first: index === 0,\n 'hour-start': slot.isHourStart,\n static: isStatic,\n 'drop-target': slotDropTarget.isTarget(datePart, index),\n 'drag-selected': slotDragSelect.isSlotSelected(index, datePart),\n 'business-hours': businessHoursMods[index]['business-hours'],\n 'non-business-hours': businessHoursMods[index]['non-business-hours'],\n }\"\n :tabindex=\"isStatic ? -1 : index === 0 ? 0 : -1\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${slot.startTime} - ${slot.endTime}`\"\n @keydown=\"isStatic ? undefined : handleSlotKeydown($event, index)\"\n @click=\"clickTimeSlot(index, $event)\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown($event, index, datePart)\n : undefined\n \"\n @dragover.prevent\n />\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 15,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n slotHeight: 64,\n headerFormat: 'MMMM D, YYYY',\n withAllDaySlot: true,\n allDaySlotHeight: 44,\n maxAllDayEvents: 3,\n} as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotHeight, allDaySlotHeight }) => ({\n dayView: {\n '--day-view-radius': resolveScheduleRadius(radius),\n '--day-view-slot-height': cssSize(slotHeight),\n '--day-view-all-day-slot-height': cssSize(allDaySlotHeight),\n },\n }),\n)\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useEventResize } from '../../hooks/use-event-resize'\nimport { getLabel } from '../../labels'\nimport type { DateTimeStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getDayTimeIntervals,\n getVisibleEvents,\n toDateString,\n} from '../../utils'\nimport { CurrentTimeIndicator } from '../CurrentTimeIndicator'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n moveEventToAllDay,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { useSlotDropTarget } from '../use-slot-drop-target'\nimport { getDayViewEvents } from './get-day-view-events/get-day-view-events'\nimport type { DayViewEmits, DayViewOwnProps, DayViewSlots } from './DayView.types'\nimport classes from './DayView.module.css'\n\ndefineOptions({\n name: 'DayView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<DayViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n slotLabelFormat: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n slotHeight: undefined,\n businessHours: undefined,\n canDragEvent: undefined,\n startScrollTime: undefined,\n canResizeEvent: undefined,\n headerFormat: undefined,\n withAllDaySlot: undefined,\n allDaySlotHeight: undefined,\n maxAllDayEvents: undefined,\n moreEventsProps: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<DayViewSlots>()\n\nconst emit = defineEmits<DayViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('DayView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'DayView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'dayView',\n})\n\n/**\n * Cached per selector: the slot list re-renders on every step of a drag, and rebuilding the\n * same class list once per slot is what makes that re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst timeSlotsContainer = ref<HTMLElement | null>(null)\n\nconst slotDropTarget = useSlotDropTarget()\n\nconst date = computed(() => toDateString(props.date))\nconst datePart = computed(() => dayjs(date.value).format('YYYY-MM-DD'))\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? dayjs()))\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst showCurrentTimeIndicator = computed(\n () => props.withCurrentTimeIndicator ?? dayjs(date.value).isSame(now.value, 'day'),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n dayjs(date.value).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(date.value).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst dayEvents = computed(() =>\n getDayViewEvents({\n events: expandedEvents.value,\n date: date.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst hourStartIntervals = computed(() => intervals.value.filter((slot) => slot.isHourStart))\n\nconst allDayCounts = computed(() =>\n getVisibleEvents({\n maxEvents: props.maxAllDayEvents!,\n totalEvents: dayEvents.value.allDayEvents.length,\n }),\n)\n\nconst visibleAllDayEvents = computed(() =>\n dayEvents.value.allDayEvents.slice(0, allDayCounts.value.visibleEventsCount),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst eventResize = useEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex) => {\n const startSlot = intervals.value[startIndex]\n const endSlot = intervals.value[endIndex]\n\n if (startSlot && endSlot) {\n emit(\n 'slotDragEnd',\n `${datePart.value} ${startSlot.startTime}` as DateTimeStringValue,\n `${datePart.value} ${endSlot.endTime}` as DateTimeStringValue,\n )\n }\n },\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = slotDropTarget.dropTarget.value\n return target\n ? {\n date: target.date,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n slotDropTarget.reset()\n emit('eventDragEnd')\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n const target = timeSlotsContainer.value?.querySelector<HTMLElement>(\n `[data-time-slot-index=\"${targetIndex}\"]`,\n )\n\n scrollSlotIntoView(target)\n})\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst emitDrop = (nativeEvent: DragEvent, target: DateTimeStringValue) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventTo(event, target))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, target)\n }\n}\n\nconst emitAllDayDrop = (nativeEvent: DragEvent) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventToAllDay(event, datePart.value))\n } else if (nativeEvent.dataTransfer) {\n emit(\n 'externalEventDrop',\n nativeEvent.dataTransfer,\n `${datePart.value} 00:00:00` as DateTimeStringValue,\n )\n }\n}\n\nconst clickAllDaySlot = (nativeEvent: MouseEvent) =>\n emit('allDaySlotClick', date.value, nativeEvent)\n\nconst clickTimeSlot = (slotIndex: number, nativeEvent: MouseEvent) => {\n const slot = intervals.value[slotIndex]\n const start = dayjs(`${datePart.value} ${slot.startTime}`)\n emit('timeSlotClick', {\n slotStart: start.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n slotEnd: start\n .add(props.intervalMinutes!, 'minute')\n .format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n nativeEvent,\n })\n}\n\nconst dropInput = () => ({\n container: timeSlotsContainer.value,\n date: datePart.value,\n intervals: intervals.value,\n})\n\nconst handleGridDragOver = (nativeEvent: DragEvent) =>\n slotDropTarget.dragOver(nativeEvent, dropInput())\n\nconst handleGridDragLeave = (nativeEvent: DragEvent) =>\n slotDropTarget.dragLeave(nativeEvent, timeSlotsContainer.value)\n\nconst handleGridDrop = (nativeEvent: DragEvent) => {\n const target = slotDropTarget.drop(nativeEvent, dropInput())\n\n if (target) {\n emitDrop(nativeEvent, target.target)\n }\n}\n\nconst handleSlotKeydown = (nativeEvent: KeyboardEvent, index: number) => {\n const nextIndex =\n nativeEvent.key === 'ArrowDown' ? index + 1 : nativeEvent.key === 'ArrowUp' ? index - 1 : -1\n\n if (nextIndex < 0 || nextIndex >= intervals.value.length) {\n return\n }\n\n nativeEvent.preventDefault()\n timeSlotsContainer.value\n ?.querySelector<HTMLButtonElement>(`[data-time-slot-index=\"${nextIndex}\"]`)\n ?.focus()\n}\n\nconst businessHoursMods = computed(() =>\n intervals.value.map((slot) =>\n props.highlightBusinessHours\n ? getBusinessHoursMod({\n time: slot.startTime,\n businessHours: props.businessHours || ['09:00:00', '17:00:00'],\n highlightBusinessHours: true,\n dayOfWeek: dayjs(`${datePart.value} ${slot.startTime}`).day() as DayOfWeek,\n })\n : { 'business-hours': false, 'non-business-hours': false },\n ),\n)\n\nconst backgroundEventStyle = (position: { top: number; height: number }) => ({\n top: `${position.top}%`,\n bottom: `${100 - position.top - position.height}%`,\n minHeight: '1px',\n})\n\nconst regularEventStyle = (event: ScheduleEventData & { position: any }) => {\n const resizePosition = eventResize.getResizePosition(event.id)\n const top = resizePosition?.top ?? event.position.top\n const height = resizePosition?.height ?? event.position.height\n\n return {\n position: 'absolute' as const,\n top: `${top}%`,\n bottom: `${100 - top - height}%`,\n minHeight: '1px',\n width: `${event.position.width}%`,\n insetInlineStart: `${event.position.offset}%`,\n }\n}\n\nconst startEventResize = (\n event: ScheduleEventData & { position: any },\n edge: 'top' | 'bottom',\n pointerEvent: PointerEvent,\n) => {\n if (!timeSlotsContainer.value) {\n return\n }\n\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainer.value,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: datePart.value,\n pointerEvent,\n })\n}\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickResizableEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!eventResize.wasResizing()) {\n clickEvent(event, nativeEvent)\n }\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('dayView') }\"\n :mod=\"[{ static: isStatic, 'slot-dragging': slotDragSelect.isDragging() }, (attrs as any).mod]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"day\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(date, 'day')\"\n :control=\"{\n title: formatDate({ date, locale: props.locale || 'en', format: props.headerFormat! }),\n }\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"emit('dateChange', $event)\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <ScrollArea.Autosize\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('dayViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <Box v-bind=\"getStyles('dayViewInner')\">\n <div v-bind=\"getStyles('dayViewSlotLabels')\">\n <Box\n v-if=\"props.withAllDaySlot\"\n v-bind=\"getStyles('dayViewSlotLabel')\"\n :mod=\"{ 'all-day': true }\"\n >\n {{ getLabel('allDay', props.labels) }}\n </Box>\n <Box\n v-for=\"slot in hourStartIntervals\"\n :key=\"slot.startTime\"\n v-bind=\"staticStyles('dayViewSlotLabel')\"\n >\n {{\n formatDate({\n date: `${datePart} ${slot.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </Box>\n </div>\n\n <div v-bind=\"getStyles('dayViewSlots')\">\n <div v-if=\"props.withAllDaySlot\" v-bind=\"getStyles('dayViewAllDay')\">\n <div\n v-for=\"event in dayEvents.backgroundAllDayEvents\"\n :key=\"event.id\"\n v-bind=\"staticStyles('dayViewBackgroundEvent')\"\n />\n\n <div v-bind=\"getStyles('dayViewAllDayEvents')\">\n <ScheduleEvent\n v-for=\"event in visibleAllDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n nowrap\n :mode=\"props.mode\"\n :draggable=\"\n !isStatic &&\n props.withEventsDragAndDrop === true &&\n (props.canDragEvent?.(event) ?? true)\n \"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(event, $event)\"\n />\n\n <MoreEvents\n v-if=\"allDayCounts.hiddenEventsCount > 0\"\n :events=\"dayEvents.allDayEvents\"\n :more-events-count=\"allDayCounts.hiddenEventsCount\"\n :labels=\"props.labels\"\n :mode=\"props.mode\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"clickEvent\"\n />\n </div>\n\n <UnstyledButton\n v-bind=\"getStyles('dayViewSlot')\"\n :mod=\"{ 'all-day': true, static: isStatic }\"\n :tabindex=\"isStatic ? -1 : 0\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${getLabel('allDay', props.labels)}`\"\n @click=\"isStatic ? undefined : clickAllDaySlot($event)\"\n @dragover.prevent\n @drop=\"emitAllDayDrop\"\n />\n </div>\n\n <div\n ref=\"timeSlotsContainer\"\n v-bind=\"getStyles('dayViewTimeSlots')\"\n @dragover=\"withDragHandlers ? handleGridDragOver($event) : undefined\"\n @dragleave=\"withDragHandlers ? handleGridDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleGridDrop($event) : undefined\"\n >\n <div\n v-for=\"event in dayEvents.backgroundTimedEvents\"\n :key=\"event.id\"\n v-bind=\"staticStyles('dayViewBackgroundEvent')\"\n :style=\"backgroundEventStyle(event.position)\"\n />\n\n <ScheduleEvent\n v-for=\"event in dayEvents.regularEvents\"\n :key=\"event.id\"\n :event=\"event\"\n auto-size\n :mode=\"props.mode\"\n :style=\"regularEventStyle(event)\"\n :draggable=\"\n !isStatic &&\n props.withEventsDragAndDrop === true &&\n (props.canDragEvent?.(event) ?? true)\n \"\n :with-resize=\"eventResize.isResizableEvent(event)\"\n :is-resizing=\"eventResize.getResizePosition(event.id) !== null\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickResizableEvent(event, $event)\"\n @resize-start=\"(edge, pointerEvent) => startEventResize(event, edge, pointerEvent)\"\n />\n\n <CurrentTimeIndicator\n v-if=\"showCurrentTimeIndicator\"\n start-offset=\"calc(var(--day-view-slot-labels-width) * -1)\"\n end-offset=\"0rem\"\n top-offset=\"0rem\"\n time-bubble-start-offset=\"calc(var(--day-view-slot-labels-width) * -1 + 30px)\"\n :current-time-format=\"props.slotLabelFormat\"\n :start-time=\"props.startTime\"\n :end-time=\"props.endTime\"\n :interval-minutes=\"props.intervalMinutes\"\n :with-time-bubble=\"props.withCurrentTimeBubble\"\n :with-thumb=\"!props.withCurrentTimeBubble\"\n :get-current-time=\"props.getCurrentTime\"\n :locale=\"props.locale\"\n v-bind=\"stylesApi\"\n />\n\n <UnstyledButton\n v-for=\"(slot, index) in intervals\"\n :key=\"slot.startTime\"\n v-bind=\"staticStyles('dayViewSlot')\"\n :data-time-slot-index=\"index\"\n :data-drag-slot-index=\"withSlotSelect ? index : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? datePart : undefined\"\n :style=\"{ '--slot-size': String(props.intervalMinutes! / 60) }\"\n :mod=\"{\n first: index === 0,\n 'hour-start': slot.isHourStart,\n static: isStatic,\n 'drop-target': slotDropTarget.isTarget(datePart, index),\n 'drag-selected': slotDragSelect.isSlotSelected(index, datePart),\n 'business-hours': businessHoursMods[index]['business-hours'],\n 'non-business-hours': businessHoursMods[index]['non-business-hours'],\n }\"\n :tabindex=\"isStatic ? -1 : index === 0 ? 0 : -1\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${slot.startTime} - ${slot.endTime}`\"\n @keydown=\"isStatic ? undefined : handleSlotKeydown($event, index)\"\n @click=\"clickTimeSlot(index, $event)\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown($event, index, datePart)\n : undefined\n \"\n @dragover.prevent\n />\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport DayViewComponent, { varsResolver } from './DayView.vue'\nimport type { DayViewFactory } from './DayView.types'\nimport classes from './DayView.module.css'\n\nexport const DayView = factory<DayViewFactory>(DayViewComponent, { classes, varsResolver })\n\nexport type {\n DayViewCssVariables,\n DayViewEmits,\n DayViewFactory,\n DayViewOwnProps,\n DayViewOwnStylesNames,\n DayViewProps,\n DayViewSlots,\n DayViewStylesNames,\n} from './DayView.types'\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, ScheduleEventData } from '../../types'\nimport { isMultidayEvent, validateEvent } from '../../utils'\n\nexport type GroupedEvents = Record<DateStringValue, ScheduleEventData[]>\n\nfunction groupEventByDate(event: ScheduleEventData, groupedEvents: GroupedEvents) {\n if (isMultidayEvent(event)) {\n const startDate = dayjs(event.start).startOf('day')\n const endDate = dayjs(event.end).startOf('day')\n\n for (\n let date = startDate;\n date.isBefore(endDate) || date.isSame(endDate);\n date = date.add(1, 'day')\n ) {\n const dateKey = date.format('YYYY-MM-DD')\n if (!groupedEvents[dateKey]) {\n groupedEvents[dateKey] = []\n }\n groupedEvents[dateKey].push(event)\n }\n\n return\n }\n\n const eventDate = dayjs(event.start).format('YYYY-MM-DD')\n if (!groupedEvents[eventDate]) {\n groupedEvents[eventDate] = []\n }\n groupedEvents[eventDate].push(event)\n}\n\ninterface GetMobileMonthViewEventsInput {\n date: AnyDateValue\n events: ScheduleEventData[] | undefined\n}\n\nexport function getMobileMonthViewEvents({ date, events }: GetMobileMonthViewEventsInput) {\n const groupedEvents: GroupedEvents = {}\n\n if (events === undefined) {\n return groupedEvents\n }\n\n const ids = new Set<string | number>()\n\n for (const event of events) {\n if (event.display === 'background') {\n continue\n }\n\n if (dayjs(event.start).isSame(dayjs(date), 'month')) {\n groupEventByDate(validateEvent(event), groupedEvents)\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(\n `[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}`,\n )\n }\n }\n }\n\n return groupedEvents\n}\n",".mobileMonthView {\n --mobile-month-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --week-numbers-offset: 0rem;\n --day-base-color: var(--mantine-color-text);\n --day-dimmed-color: alpha(var(--day-base-color), 0.5);\n\n display: flex;\n flex-direction: column;\n height: 100%;\n\n @mixin where-light {\n --mobile-month-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --mobile-month-view-border-color: var(--mantine-color-dark-4);\n }\n\n &:where([data-with-week-numbers]) {\n --week-numbers-offset: 32px;\n }\n}\n\n.mobileMonthViewHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--mantine-spacing-sm);\n border-bottom: 1px solid var(--mobile-month-view-border-color);\n}\n\n.mobileMonthViewHeaderBackButton {\n display: flex;\n align-items: center;\n gap: 4px;\n font-weight: var(--mantine-font-weight-medium);\n cursor: pointer;\n user-select: none;\n font-size: var(--mobile-month-view-font-size);\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.mobileMonthViewHeaderLabel {\n user-select: none;\n font-weight: var(--mantine-font-weight-semibold);\n text-transform: capitalize;\n}\n\n.mobileMonthViewCalendar {\n --mobile-month-view-font-size: clamp(6px, 3.5cqw, 22px);\n\n container-type: inline-size;\n padding: var(--mantine-spacing-sm);\n border-bottom: 1px solid var(--mobile-month-view-border-color);\n}\n\n.mobileMonthViewWeekdays {\n display: flex;\n margin-bottom: var(--mantine-spacing-xs);\n}\n\n.mobileMonthViewWeekdaysCorner {\n flex: 0 0 var(--week-numbers-offset);\n}\n\n.mobileMonthViewWeekday {\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n font-size: var(--mobile-month-view-font-size);\n font-weight: var(--mantine-font-weight-medium);\n text-align: center;\n text-transform: capitalize;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n user-select: none;\n color: var(--day-dimmed-color);\n padding-block: 4px;\n}\n\n.mobileMonthViewWeek {\n display: flex;\n}\n\n.mobileMonthViewWeekNumber {\n flex: 0 0 calc(var(--week-numbers-offset) - rem(4px));\n margin-inline-end: rem(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n border-radius: var(--mobile-month-view-radius);\n padding: 4px;\n font-weight: var(--mantine-font-weight-medium);\n cursor: pointer;\n user-select: none;\n color: var(--day-dimmed-color);\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.mobileMonthViewDay {\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n height: 48px;\n padding: 4px;\n font-weight: var(--mantine-font-weight-medium);\n font-size: var(--mobile-month-view-font-size);\n color: var(--day-base-color);\n cursor: pointer;\n user-select: none;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n z-index: 0;\n\n &::before {\n width: 32px;\n height: 32px;\n border-radius: 100%;\n content: '';\n position: absolute;\n top: 7px;\n left: calc(50% - 16px);\n z-index: -1;\n pointer-events: none;\n }\n\n &:focus {\n z-index: 1;\n }\n\n &:where([data-hidden]) {\n visibility: hidden;\n pointer-events: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-outside]) {\n color: var(--day-dimmed-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-today]:not([data-selected])) {\n @mixin where-light {\n &::before {\n background-color: var(--mantine-color-gray-2);\n }\n }\n\n @mixin where-dark {\n &::before {\n background-color: var(--mantine-color-dark-5);\n }\n }\n }\n\n &:where([data-selected]) {\n color: var(--mantine-primary-color-contrast);\n\n &::before {\n background-color: var(--mantine-primary-color-filled);\n }\n\n @mixin hover {\n &::before {\n background-color: var(--mantine-primary-color-filled-hover);\n }\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.mobileMonthViewDayIndicators {\n position: absolute;\n bottom: 2px;\n inset-inline: 0;\n display: flex;\n justify-content: center;\n padding-inline-start: 2px;\n}\n\n.mobileMonthViewDayIndicator {\n width: 5px;\n height: 5px;\n border-radius: 100%;\n margin-inline-start: -1px;\n}\n\n.mobileMonthViewEventsList {\n flex: 1;\n display: flex;\n flex-direction: column;\n min-height: 0;\n padding: var(--mantine-spacing-sm);\n}\n\n.mobileMonthViewEventsHeader {\n margin-bottom: var(--mantine-spacing-sm);\n font-weight: var(--mantine-font-weight-semibold);\n text-transform: capitalize;\n}\n\n.mobileMonthViewEvent {\n display: block;\n width: 100%;\n text-align: start;\n cursor: pointer;\n\n &:where(:not(:last-child)) {\n border-bottom: 1px solid var(--mobile-month-view-border-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n}\n\n.mobileMonthViewEventBody {\n display: flex;\n gap: var(--mantine-spacing-sm);\n padding: var(--mantine-spacing-xs) 0;\n}\n\n.mobileMonthViewEventColor {\n width: 4px;\n border-radius: 2px;\n flex-shrink: 0;\n}\n\n.mobileMonthViewEventTime {\n margin-top: 2px;\n font-size: var(--mantine-font-size-xs);\n color: var(--mantine-color-dimmed);\n}\n\n.mobileMonthViewNoEvents {\n color: var(--mantine-color-dimmed);\n text-align: center;\n padding-block: var(--mantine-spacing-xl);\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { MobileMonthViewOwnProps } from './MobileMonthView.types'\n\nconst defaultProps = {\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n withHeader: true,\n withWeekDays: true,\n firstDayOfWeek: 1,\n weekdayFormat: 'dd',\n weekendDays: [0, 6],\n consistentWeeks: true,\n highlightToday: true,\n eventsHeaderFormat: 'dddd, MMMM D',\n} satisfies Partial<MobileMonthViewOwnProps>\n\nconst MAX_DAY_INDICATORS = 3\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n mobileMonthView: {\n '--mobile-month-view-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver, MAX_DAY_INDICATORS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, h, useAttrs, useSlots, type VNodeChild } from 'vue'\nimport {\n AccordionChevron,\n Box,\n getThemeColor,\n Text,\n UnstyledButton,\n useDirection,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport { getLabel } from '../../labels'\nimport type { DateStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport { formatDate, getMonthDays, getWeekNumber, getWeekdaysNames } from '../../utils'\nimport { getExpandedEvents } from '../shared'\nimport { getMobileMonthViewEvents } from './get-mobile-month-view-events'\nimport type { MobileMonthViewEmits, MobileMonthViewSlots } from './MobileMonthView.types'\nimport classes from './MobileMonthView.module.css'\n\ndefineOptions({\n name: 'MobileMonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MobileMonthViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n selectedDate: undefined,\n defaultSelectedDate: undefined,\n withWeekDays: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n getWeekNumberProps: undefined,\n getDayProps: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n eventsHeaderFormat: undefined,\n renderHeader: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MobileMonthViewSlots>()\n\nconst emit = defineEmits<MobileMonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('MobileMonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MobileMonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'mobileMonthView',\n})\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst toDayKey = (value: Date | DateStringValue | null | undefined) =>\n value ? (dayjs(value).format('YYYY-MM-DD') as DateStringValue) : null\n\nconst [selected, setSelected] = useUncontrolled<DateStringValue | null>({\n // `null` is a meaningful selection (nothing selected), so only `undefined` means uncontrolled.\n value: () => (props.selectedDate === undefined ? undefined : toDayKey(props.selectedDate)),\n defaultValue: dayjs(props.defaultSelectedDate ?? undefined).format(\n 'YYYY-MM-DD',\n ) as DateStringValue,\n finalValue: null,\n onChange: (value) => {\n emit('update:selectedDate', value)\n emit('selectedDateChange', value)\n },\n})\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\n\nconst weeks = computed(() =>\n getMonthDays({\n month: month.value,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n weeks.value[0][0],\n dayjs(weeks.value.at(-1)!.at(-1)!).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst eventsByDay = computed(() =>\n getMobileMonthViewEvents({ date: month.value, events: expandedEvents.value }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\nconst selectedEvents = computed(() =>\n selected.value ? eventsByDay.value[selected.value] || [] : [],\n)\n\nconst dayProps = (date: string | Date) => props.getDayProps?.(toDayKey(date)!) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDayKey(weekStart)!) ?? {}\n\nconst isOutside = (date: string | Date) => !dayjs(date).isSame(month.value, 'month')\n\n/** Outside days keep their cell so the grid stays aligned, but render nothing. */\nconst isRendered = (date: string | Date) => !isOutside(date) || Boolean(props.withOutsideDays)\n\nconst dayIndicators = (date: string | Date) =>\n (eventsByDay.value[toDayKey(date)!] || []).slice(0, MAX_DAY_INDICATORS)\n\nconst indicatorStyle = (event: ScheduleEventData) => ({\n background: `var(--mantine-color-${event.color}-6, ${event.color})`,\n})\n\nconst selectDay = (date: string | Date, nativeEvent: MouseEvent) => {\n const value = toDayKey(date)!\n setSelected(value)\n emit('dayClick', value, nativeEvent)\n}\n\nconst isAllDayEvent = (event: ScheduleEventData) =>\n dayjs(event.start).format('HH:mm') === '00:00' && dayjs(event.end).format('HH:mm') === '00:00'\n\nconst eventTimeLabel = (event: ScheduleEventData) =>\n isAllDayEvent(event)\n ? getLabel('allDay', props.labels)\n : `${dayjs(event.start).format('HH:mm')} – ${dayjs(event.end).format('HH:mm')}`\n\n/**\n * Default header as a functional component, so the template and the `renderHeader` payload\n * share one definition instead of building the tree twice.\n */\nconst DefaultHeader = () => [\n h(\n UnstyledButton,\n {\n ...getStyles('mobileMonthViewHeaderBackButton'),\n mod: { static: isStatic.value },\n tabindex: isStatic.value ? -1 : 0,\n onClick: isStatic.value ? undefined : () => emit('yearClick'),\n },\n () => [\n h(AccordionChevron, {\n size: 20,\n style: { transform: `rotate(${dir.value === 'rtl' ? -90 : 90}deg)` },\n }),\n month.value.format('YYYY'),\n ],\n ),\n h(Text, getStyles('mobileMonthViewHeaderLabel'), () =>\n formatDate({ date: month.value, locale: props.locale || 'en', format: 'MMMM YYYY' }),\n ),\n]\n\nconst headerPayload = computed(() => ({\n mode: props.mode!,\n date: props.date,\n defaultHeader: h(DefaultHeader) as VNodeChild,\n}))\n\nconst customHeader = computed<VNodeChild>(() => {\n if (!slots.header && !props.renderHeader) {\n return null\n }\n\n return slots.header?.(headerPayload.value) ?? props.renderHeader?.(headerPayload.value) ?? null\n})\n\nconst renderHeaderContent = () => customHeader.value ?? h(DefaultHeader)\n\nconst listEventProps = (event: ScheduleEventData) => ({\n type: 'button' as const,\n ...getStyles('mobileMonthViewEvent'),\n tabindex: isStatic.value ? -1 : 0,\n onClick: isStatic.value\n ? undefined\n : (nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n})\n\nconst EventBody = (event: ScheduleEventData) => () =>\n h(Box, getStyles('mobileMonthViewEventBody'), () => [\n h(\n 'div',\n getStyles('mobileMonthViewEventColor', {\n style: { backgroundColor: getThemeColor(event.color, theme.value) },\n }),\n ),\n h('div', [\n h(Text, getStyles('mobileMonthViewEventTitle'), () => event.title),\n h(Text, getStyles('mobileMonthViewEventTime'), () => eventTimeLabel(event)),\n ]),\n ])\n\nconst renderListEvent = (event: ScheduleEventData) => () => {\n const children = h(EventBody(event))\n const rootProps = listEventProps(event)\n const payload = { ...rootProps, children }\n\n return (\n slots.event?.({ ...payload, event }) ??\n props.renderEvent?.(event, payload) ??\n h(UnstyledButton, rootProps, () => children)\n )\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('mobileMonthView') }\"\n :mod=\"[{ 'with-week-numbers': props.withWeekNumbers }, (attrs as any).mod]\"\n >\n <div v-if=\"props.withHeader\" v-bind=\"getStyles('mobileMonthViewHeader')\">\n <component :is=\"renderHeaderContent\" />\n </div>\n\n <Box\n v-bind=\"getStyles('mobileMonthViewCalendar')\"\n :mod=\"{ 'with-weekdays': props.withWeekDays }\"\n >\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('mobileMonthViewWeekdays')\">\n <span v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('mobileMonthViewWeekdaysCorner')\" />\n <span\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"getStyles('mobileMonthViewWeekday')\"\n >\n {{ weekday }}\n </span>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"getStyles('mobileMonthViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('mobileMonthViewWeekNumber', {\n className: weekNumberProps(week[0]).class,\n }),\n }\"\n :mod=\"{ static: isStatic }\"\n :tabindex=\"isStatic ? -1 : 0\"\n @click=\"emit('weekNumberClick', toDayKey(week[0])!, $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <UnstyledButton\n v-for=\"date in week\"\n :key=\"toDayKey(date)!\"\n v-bind=\"{\n ...dayProps(date),\n ...getStyles('mobileMonthViewDay', { className: dayProps(date).class }),\n }\"\n :mod=\"{\n outside: isOutside(date),\n weekend: props.weekendDays!.includes(dayjs(date).day() as DayOfWeek),\n today: props.highlightToday && dayjs(date).isSame(dayjs(), 'day'),\n selected: selected === toDayKey(date),\n static: isStatic,\n hidden: !isRendered(date),\n }\"\n :tabindex=\"isStatic || !isRendered(date) ? -1 : 0\"\n :aria-label=\"formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\"\n :aria-selected=\"selected === toDayKey(date) || undefined\"\n @click=\"isStatic || !isRendered(date) ? undefined : selectDay(date, $event)\"\n >\n <template v-if=\"isRendered(date)\">\n {{ dayjs(date).date() }}\n <span\n v-if=\"dayIndicators(date).length\"\n v-bind=\"getStyles('mobileMonthViewDayIndicators')\"\n >\n <span\n v-for=\"event in dayIndicators(date)\"\n :key=\"event.id\"\n v-bind=\"getStyles('mobileMonthViewDayIndicator')\"\n :style=\"indicatorStyle(event)\"\n />\n </span>\n </template>\n </UnstyledButton>\n </div>\n </Box>\n\n <Box v-bind=\"getStyles('mobileMonthViewEventsList')\">\n <Text v-bind=\"getStyles('mobileMonthViewEventsHeader')\">\n {{\n selected\n ? formatDate({\n date: selected,\n locale: props.locale || 'en',\n format: props.eventsHeaderFormat!,\n })\n : ''\n }}\n </Text>\n\n <template v-if=\"selectedEvents.length\">\n <component :is=\"renderListEvent(event)\" v-for=\"event in selectedEvents\" :key=\"event.id\" />\n </template>\n <Text v-else v-bind=\"getStyles('mobileMonthViewNoEvents')\">\n {{ getLabel('noEvents', props.labels) }}\n </Text>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { MobileMonthViewOwnProps } from './MobileMonthView.types'\n\nconst defaultProps = {\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n withHeader: true,\n withWeekDays: true,\n firstDayOfWeek: 1,\n weekdayFormat: 'dd',\n weekendDays: [0, 6],\n consistentWeeks: true,\n highlightToday: true,\n eventsHeaderFormat: 'dddd, MMMM D',\n} satisfies Partial<MobileMonthViewOwnProps>\n\nconst MAX_DAY_INDICATORS = 3\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n mobileMonthView: {\n '--mobile-month-view-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver, MAX_DAY_INDICATORS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, h, useAttrs, useSlots, type VNodeChild } from 'vue'\nimport {\n AccordionChevron,\n Box,\n getThemeColor,\n Text,\n UnstyledButton,\n useDirection,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport { getLabel } from '../../labels'\nimport type { DateStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport { formatDate, getMonthDays, getWeekNumber, getWeekdaysNames } from '../../utils'\nimport { getExpandedEvents } from '../shared'\nimport { getMobileMonthViewEvents } from './get-mobile-month-view-events'\nimport type { MobileMonthViewEmits, MobileMonthViewSlots } from './MobileMonthView.types'\nimport classes from './MobileMonthView.module.css'\n\ndefineOptions({\n name: 'MobileMonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MobileMonthViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n selectedDate: undefined,\n defaultSelectedDate: undefined,\n withWeekDays: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n getWeekNumberProps: undefined,\n getDayProps: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n eventsHeaderFormat: undefined,\n renderHeader: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MobileMonthViewSlots>()\n\nconst emit = defineEmits<MobileMonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('MobileMonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MobileMonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'mobileMonthView',\n})\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst toDayKey = (value: Date | DateStringValue | null | undefined) =>\n value ? (dayjs(value).format('YYYY-MM-DD') as DateStringValue) : null\n\nconst [selected, setSelected] = useUncontrolled<DateStringValue | null>({\n // `null` is a meaningful selection (nothing selected), so only `undefined` means uncontrolled.\n value: () => (props.selectedDate === undefined ? undefined : toDayKey(props.selectedDate)),\n defaultValue: dayjs(props.defaultSelectedDate ?? undefined).format(\n 'YYYY-MM-DD',\n ) as DateStringValue,\n finalValue: null,\n onChange: (value) => {\n emit('update:selectedDate', value)\n emit('selectedDateChange', value)\n },\n})\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\n\nconst weeks = computed(() =>\n getMonthDays({\n month: month.value,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n weeks.value[0][0],\n dayjs(weeks.value.at(-1)!.at(-1)!).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst eventsByDay = computed(() =>\n getMobileMonthViewEvents({ date: month.value, events: expandedEvents.value }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\nconst selectedEvents = computed(() =>\n selected.value ? eventsByDay.value[selected.value] || [] : [],\n)\n\nconst dayProps = (date: string | Date) => props.getDayProps?.(toDayKey(date)!) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDayKey(weekStart)!) ?? {}\n\nconst isOutside = (date: string | Date) => !dayjs(date).isSame(month.value, 'month')\n\n/** Outside days keep their cell so the grid stays aligned, but render nothing. */\nconst isRendered = (date: string | Date) => !isOutside(date) || Boolean(props.withOutsideDays)\n\nconst dayIndicators = (date: string | Date) =>\n (eventsByDay.value[toDayKey(date)!] || []).slice(0, MAX_DAY_INDICATORS)\n\nconst indicatorStyle = (event: ScheduleEventData) => ({\n background: `var(--mantine-color-${event.color}-6, ${event.color})`,\n})\n\nconst selectDay = (date: string | Date, nativeEvent: MouseEvent) => {\n const value = toDayKey(date)!\n setSelected(value)\n emit('dayClick', value, nativeEvent)\n}\n\nconst isAllDayEvent = (event: ScheduleEventData) =>\n dayjs(event.start).format('HH:mm') === '00:00' && dayjs(event.end).format('HH:mm') === '00:00'\n\nconst eventTimeLabel = (event: ScheduleEventData) =>\n isAllDayEvent(event)\n ? getLabel('allDay', props.labels)\n : `${dayjs(event.start).format('HH:mm')} – ${dayjs(event.end).format('HH:mm')}`\n\n/**\n * Default header as a functional component, so the template and the `renderHeader` payload\n * share one definition instead of building the tree twice.\n */\nconst DefaultHeader = () => [\n h(\n UnstyledButton,\n {\n ...getStyles('mobileMonthViewHeaderBackButton'),\n mod: { static: isStatic.value },\n tabindex: isStatic.value ? -1 : 0,\n onClick: isStatic.value ? undefined : () => emit('yearClick'),\n },\n () => [\n h(AccordionChevron, {\n size: 20,\n style: { transform: `rotate(${dir.value === 'rtl' ? -90 : 90}deg)` },\n }),\n month.value.format('YYYY'),\n ],\n ),\n h(Text, getStyles('mobileMonthViewHeaderLabel'), () =>\n formatDate({ date: month.value, locale: props.locale || 'en', format: 'MMMM YYYY' }),\n ),\n]\n\nconst headerPayload = computed(() => ({\n mode: props.mode!,\n date: props.date,\n defaultHeader: h(DefaultHeader) as VNodeChild,\n}))\n\nconst customHeader = computed<VNodeChild>(() => {\n if (!slots.header && !props.renderHeader) {\n return null\n }\n\n return slots.header?.(headerPayload.value) ?? props.renderHeader?.(headerPayload.value) ?? null\n})\n\nconst renderHeaderContent = () => customHeader.value ?? h(DefaultHeader)\n\nconst listEventProps = (event: ScheduleEventData) => ({\n type: 'button' as const,\n ...getStyles('mobileMonthViewEvent'),\n tabindex: isStatic.value ? -1 : 0,\n onClick: isStatic.value\n ? undefined\n : (nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n})\n\nconst EventBody = (event: ScheduleEventData) => () =>\n h(Box, getStyles('mobileMonthViewEventBody'), () => [\n h(\n 'div',\n getStyles('mobileMonthViewEventColor', {\n style: { backgroundColor: getThemeColor(event.color, theme.value) },\n }),\n ),\n h('div', [\n h(Text, getStyles('mobileMonthViewEventTitle'), () => event.title),\n h(Text, getStyles('mobileMonthViewEventTime'), () => eventTimeLabel(event)),\n ]),\n ])\n\nconst renderListEvent = (event: ScheduleEventData) => () => {\n const children = h(EventBody(event))\n const rootProps = listEventProps(event)\n const payload = { ...rootProps, children }\n\n return (\n slots.event?.({ ...payload, event }) ??\n props.renderEvent?.(event, payload) ??\n h(UnstyledButton, rootProps, () => children)\n )\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('mobileMonthView') }\"\n :mod=\"[{ 'with-week-numbers': props.withWeekNumbers }, (attrs as any).mod]\"\n >\n <div v-if=\"props.withHeader\" v-bind=\"getStyles('mobileMonthViewHeader')\">\n <component :is=\"renderHeaderContent\" />\n </div>\n\n <Box\n v-bind=\"getStyles('mobileMonthViewCalendar')\"\n :mod=\"{ 'with-weekdays': props.withWeekDays }\"\n >\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('mobileMonthViewWeekdays')\">\n <span v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('mobileMonthViewWeekdaysCorner')\" />\n <span\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"getStyles('mobileMonthViewWeekday')\"\n >\n {{ weekday }}\n </span>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"getStyles('mobileMonthViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('mobileMonthViewWeekNumber', {\n className: weekNumberProps(week[0]).class,\n }),\n }\"\n :mod=\"{ static: isStatic }\"\n :tabindex=\"isStatic ? -1 : 0\"\n @click=\"emit('weekNumberClick', toDayKey(week[0])!, $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <UnstyledButton\n v-for=\"date in week\"\n :key=\"toDayKey(date)!\"\n v-bind=\"{\n ...dayProps(date),\n ...getStyles('mobileMonthViewDay', { className: dayProps(date).class }),\n }\"\n :mod=\"{\n outside: isOutside(date),\n weekend: props.weekendDays!.includes(dayjs(date).day() as DayOfWeek),\n today: props.highlightToday && dayjs(date).isSame(dayjs(), 'day'),\n selected: selected === toDayKey(date),\n static: isStatic,\n hidden: !isRendered(date),\n }\"\n :tabindex=\"isStatic || !isRendered(date) ? -1 : 0\"\n :aria-label=\"formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\"\n :aria-selected=\"selected === toDayKey(date) || undefined\"\n @click=\"isStatic || !isRendered(date) ? undefined : selectDay(date, $event)\"\n >\n <template v-if=\"isRendered(date)\">\n {{ dayjs(date).date() }}\n <span\n v-if=\"dayIndicators(date).length\"\n v-bind=\"getStyles('mobileMonthViewDayIndicators')\"\n >\n <span\n v-for=\"event in dayIndicators(date)\"\n :key=\"event.id\"\n v-bind=\"getStyles('mobileMonthViewDayIndicator')\"\n :style=\"indicatorStyle(event)\"\n />\n </span>\n </template>\n </UnstyledButton>\n </div>\n </Box>\n\n <Box v-bind=\"getStyles('mobileMonthViewEventsList')\">\n <Text v-bind=\"getStyles('mobileMonthViewEventsHeader')\">\n {{\n selected\n ? formatDate({\n date: selected,\n locale: props.locale || 'en',\n format: props.eventsHeaderFormat!,\n })\n : ''\n }}\n </Text>\n\n <template v-if=\"selectedEvents.length\">\n <component :is=\"renderListEvent(event)\" v-for=\"event in selectedEvents\" :key=\"event.id\" />\n </template>\n <Text v-else v-bind=\"getStyles('mobileMonthViewNoEvents')\">\n {{ getLabel('noEvents', props.labels) }}\n </Text>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport MobileMonthViewComponent, { varsResolver } from './MobileMonthView.vue'\nimport type { MobileMonthViewFactory } from './MobileMonthView.types'\nimport classes from './MobileMonthView.module.css'\n\nexport const MobileMonthView = factory<MobileMonthViewFactory>(MobileMonthViewComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n MobileMonthViewCssVariables,\n MobileMonthViewEmits,\n MobileMonthViewFactory,\n MobileMonthViewHeaderPayload,\n MobileMonthViewOwnProps,\n MobileMonthViewProps,\n MobileMonthViewSlots,\n MobileMonthViewStylesNames,\n} from './MobileMonthView.types'\n","export function handleGridKeydown({\n event,\n index,\n columns,\n total,\n getControl,\n}: {\n event: KeyboardEvent\n index: number\n columns: number\n total: number\n getControl: (index: number) => HTMLButtonElement | null\n}): void {\n const step =\n event.key === 'ArrowRight'\n ? 1\n : event.key === 'ArrowLeft'\n ? -1\n : event.key === 'ArrowDown'\n ? columns\n : event.key === 'ArrowUp'\n ? -columns\n : 0\n\n if (step === 0) return\n event.preventDefault()\n\n for (let next = index + step; next >= 0 && next < total; next += step) {\n const control = getControl(next)\n if (control && !control.disabled && !control.hasAttribute('data-hidden')) {\n control.focus()\n return\n }\n }\n}\n","import dayjs from 'dayjs'\nimport { MonthPositionedEventData } from '../../../types'\n\ninterface AddEventToDayGroupsInput {\n positionedEvent: MonthPositionedEventData\n eventStart: dayjs.Dayjs\n eventEnd: dayjs.Dayjs\n groupedByDay: { [date: string]: MonthPositionedEventData[] }\n eventsAddedToDay: Set<string>\n weekIdx: number\n}\n\nexport function addEventToDayGroups({\n positionedEvent,\n eventStart,\n eventEnd,\n groupedByDay,\n eventsAddedToDay,\n weekIdx,\n}: AddEventToDayGroupsInput): void {\n if (weekIdx === 0 || !eventsAddedToDay.has(positionedEvent.id.toString())) {\n let dayDate = eventStart\n while (dayDate.isBefore(eventEnd) || dayDate.isSame(eventEnd, 'day')) {\n const dayDateStr = dayDate.format('YYYY-MM-DD 00:00:00')\n if (groupedByDay[dayDateStr]) {\n groupedByDay[dayDateStr].push(positionedEvent)\n }\n dayDate = dayDate.add(1, 'day')\n }\n eventsAddedToDay.add(positionedEvent.id.toString())\n }\n}\n","import dayjs from 'dayjs'\n\nexport type HangingStatus = 'none' | 'start' | 'end' | 'both'\n\ninterface CalculateEventPositionInput {\n eventStart: dayjs.Dayjs\n eventEnd: dayjs.Dayjs\n weekStart: dayjs.Dayjs\n weekEnd: dayjs.Dayjs\n isMultiday: boolean\n}\n\ninterface EventPositionInWeek {\n startDayIndex: number\n daysSpanned: number\n startOffset: number\n width: number\n hanging: HangingStatus\n}\n\nexport function calculateEventPositionInWeek({\n eventStart,\n eventEnd,\n weekStart,\n weekEnd,\n isMultiday,\n}: CalculateEventPositionInput): EventPositionInWeek {\n let displayStart = eventStart\n let displayEnd = eventEnd\n\n const hangingStart = eventStart.isBefore(weekStart)\n const hangingEnd = eventEnd.isAfter(weekEnd)\n const hanging: HangingStatus =\n hangingStart && hangingEnd ? 'both' : hangingStart ? 'start' : hangingEnd ? 'end' : 'none'\n\n if (displayStart.isBefore(weekStart)) {\n displayStart = weekStart\n }\n if (displayEnd.isAfter(weekEnd)) {\n displayEnd = weekEnd\n }\n\n const startDayIndex = displayStart.diff(weekStart, 'day')\n const endDayIndex = displayEnd.diff(weekStart, 'day')\n const daysSpanned = Math.max(1, endDayIndex - startDayIndex + (isMultiday ? 1 : 0))\n\n const startOffset = (startDayIndex / 7) * 100\n const width = (daysSpanned / 7) * 100\n\n return {\n startDayIndex,\n daysSpanned,\n startOffset,\n width,\n hanging,\n }\n}\n","import dayjs from 'dayjs'\nimport { MonthPositionedEventData } from '../../../types'\n\ninterface FindAvailableRowInput {\n existingEvents: MonthPositionedEventData[]\n startDayIndex: number\n daysSpanned: number\n weekStart: dayjs.Dayjs\n}\n\nexport function findAvailableRow({\n existingEvents,\n startDayIndex,\n daysSpanned,\n weekStart,\n}: FindAvailableRowInput): number {\n let row = 0\n\n for (const existing of existingEvents) {\n const existingStart = dayjs(existing.start).startOf('day')\n const existingDisplayStart =\n existingStart.isBefore(weekStart) || existingStart.isSame(weekStart, 'day')\n ? weekStart\n : existingStart\n const existingDayIndex = existingDisplayStart.diff(weekStart, 'day')\n const existingWidth = existing.position?.width || 0\n const existingDaysSpanned = (existingWidth / 100) * 7\n\n if (\n existingDayIndex + existingDaysSpanned > startDayIndex &&\n existingDayIndex < startDayIndex + daysSpanned\n ) {\n row = Math.max(row, (existing.position?.row || 0) + 1)\n }\n }\n\n return row\n}\n","import dayjs from 'dayjs'\nimport { DateStringValue, DayOfWeek, MonthPositionedEventData } from '../../../types'\nimport { getStartOfWeek } from '../../../utils'\n\ninterface GetWeeksInRangeInput {\n rangeStart: dayjs.Dayjs\n rangeEnd: dayjs.Dayjs\n firstDayOfWeek: DayOfWeek\n}\n\ninterface GetWeeksInRangeOutput {\n weeks: DateStringValue[][]\n groupedByDay: Record<string, MonthPositionedEventData[]>\n}\n\nexport function getWeeksInRange({\n rangeStart,\n rangeEnd,\n firstDayOfWeek,\n}: GetWeeksInRangeInput): GetWeeksInRangeOutput {\n const weeks: DateStringValue[][] = []\n const groupedByDay: Record<string, MonthPositionedEventData[]> = {}\n\n const startOfFirstWeekStr = getStartOfWeek({\n date: rangeStart.format('YYYY-MM-DD'),\n firstDayOfWeek,\n })\n\n let currentDate = dayjs(startOfFirstWeekStr)\n\n while (currentDate.isBefore(rangeEnd) || currentDate.isSame(rangeEnd, 'day')) {\n const week: DateStringValue[] = []\n for (let i = 0; i < 7; i++) {\n const dateStr = currentDate.format('YYYY-MM-DD 00:00:00')\n week.push(dateStr)\n if (!groupedByDay[dateStr]) {\n groupedByDay[dateStr] = []\n }\n currentDate = currentDate.add(1, 'day')\n }\n weeks.push(week)\n }\n\n return { weeks, groupedByDay }\n}\n","import dayjs from 'dayjs'\nimport {\n AnyDateValue,\n DateStringValue,\n DayOfWeek,\n MonthPositionedEventData,\n ScheduleEventData,\n} from '../../../types'\nimport { addEventToDayGroups } from './add-event-to-day-groups'\nimport { calculateEventPositionInWeek } from './calculate-event-position-in-week'\nimport { findAvailableRow } from './find-available-row'\nimport { getWeeksInRange } from './get-weeks-in-range'\n\ninterface GetMonthPositionedEventsInput {\n /** Date (month start) at which events are positioned */\n date: AnyDateValue\n\n /** List of all events that belong to the given month, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[]\n\n /** First day of the week, 0 - Sunday, 1 - Monday, etc., used to calculate events positions */\n firstDayOfWeek?: DayOfWeek\n\n /** Range of dates for which events should be displayed (includes outside days if withOutsideDays is true) */\n range?: {\n start: DateStringValue\n end: DateStringValue\n }\n}\n\n/** Events grouped by week index and by day */\nexport interface GroupedMonthEvents {\n /** Events grouped by week index (index within month) */\n groupedByWeek: {\n [weekIndex: string]: MonthPositionedEventData[]\n }\n\n /** Events grouped by day (YYYY-MM-DD format) */\n groupedByDay: {\n [date: string]: MonthPositionedEventData[]\n }\n\n /** Background events grouped by week index */\n backgroundByWeek: {\n [weekIndex: string]: MonthPositionedEventData[]\n }\n}\n\nexport function getMonthPositionedEvents({\n date,\n events,\n firstDayOfWeek = 1,\n range,\n}: GetMonthPositionedEventsInput): GroupedMonthEvents {\n const groupedByWeek: GroupedMonthEvents['groupedByWeek'] = {}\n const backgroundByWeek: GroupedMonthEvents['backgroundByWeek'] = {}\n const eventsAddedToDay = new Set<string>()\n\n const rangeStart = range ? dayjs(range.start) : dayjs(date).startOf('month')\n const rangeEnd = range ? dayjs(range.end) : dayjs(date).startOf('month').endOf('month')\n\n const { weeks, groupedByDay } = getWeeksInRange({\n rangeStart,\n rangeEnd,\n firstDayOfWeek,\n })\n\n for (let i = 0; i < weeks.length; i++) {\n groupedByWeek[i.toString()] = []\n backgroundByWeek[i.toString()] = []\n }\n\n for (const event of events) {\n const eventStart = dayjs(event.start).startOf('day')\n const rawEnd = dayjs(event.end)\n const endAtMidnight = rawEnd.hour() === 0 && rawEnd.minute() === 0 && rawEnd.second() === 0\n const eventEnd = endAtMidnight\n ? rawEnd.startOf('day').subtract(1, 'day')\n : rawEnd.startOf('day')\n const isMultiday = eventEnd.isAfter(eventStart)\n\n for (let weekIdx = 0; weekIdx < weeks.length; weekIdx++) {\n const week = weeks[weekIdx]\n const weekStart = dayjs(week[0]).startOf('day')\n const weekEnd = dayjs(week[6]).endOf('day')\n\n if (\n (eventStart.isBefore(weekEnd) || eventStart.isSame(weekEnd, 'day')) &&\n (eventEnd.isAfter(weekStart) || eventEnd.isSame(weekStart, 'day'))\n ) {\n const { startDayIndex, daysSpanned, startOffset, width, hanging } =\n calculateEventPositionInWeek({\n eventStart,\n eventEnd,\n weekStart,\n weekEnd,\n isMultiday,\n })\n\n if (event.display === 'background') {\n backgroundByWeek[weekIdx.toString()].push({\n ...event,\n position: {\n startOffset,\n width,\n weekIndex: weekIdx,\n row: 0,\n hanging,\n },\n })\n continue\n }\n\n const row = findAvailableRow({\n existingEvents: groupedByWeek[weekIdx.toString()],\n startDayIndex,\n daysSpanned,\n weekStart,\n })\n\n const positionedEvent: MonthPositionedEventData = {\n ...event,\n position: {\n startOffset,\n width,\n weekIndex: weekIdx,\n row,\n hanging,\n },\n }\n\n groupedByWeek[weekIdx.toString()].push(positionedEvent)\n\n addEventToDayGroups({\n positionedEvent,\n eventStart,\n eventEnd,\n groupedByDay,\n eventsAddedToDay,\n weekIdx,\n })\n }\n }\n }\n\n return {\n groupedByWeek,\n groupedByDay,\n backgroundByWeek,\n }\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek, ScheduleEventData } from '../../../types'\nimport { getMonthRange, validateEvent } from '../../../utils'\nimport { getMonthPositionedEvents, GroupedMonthEvents } from './get-month-positioned-events'\n\ninterface UseMonthViewEventsInput {\n /** Date (month start) at which events are positioned */\n date: AnyDateValue\n\n /** List of all events that belong to the given month, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[] | undefined\n\n /** First day of the week, 0 - Sunday, 1 - Monday, etc., used to calculate events positions */\n firstDayOfWeek?: DayOfWeek\n\n /** If true, events for outside days are included */\n withOutsideDays?: boolean\n\n /** If true, month will show events for consistent number of weeks (6) */\n consistentWeeks?: boolean\n}\n\nexport function getMonthViewEvents({\n date,\n events,\n firstDayOfWeek = 1,\n withOutsideDays,\n consistentWeeks,\n}: UseMonthViewEventsInput): GroupedMonthEvents {\n if (events === undefined) {\n return { groupedByDay: {}, groupedByWeek: {}, backgroundByWeek: {} }\n }\n\n const ids = new Set<string | number>()\n const filteredEvents: ScheduleEventData[] = []\n\n const range = getMonthRange({ month: date, withOutsideDays, consistentWeeks, firstDayOfWeek })\n\n for (const event of events) {\n if (\n dayjs(event.end).isAfter(range.start, 'day') ||\n dayjs(event.start).isBefore(range.end, 'day')\n ) {\n filteredEvents.push(validateEvent(event))\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(`[@mantine/schedule] MonthView: Duplicated event ids found: ${event.id}`)\n }\n }\n }\n\n return getMonthPositionedEvents({\n date,\n events: filteredEvents,\n firstDayOfWeek,\n range,\n })\n}\n","import { DateStringValue, MonthEventPositionData, MonthPositionedEventData } from '../../types'\n\nconst DAYS_IN_WEEK = 7\nconst DAY_WIDTH = 100 / DAYS_IN_WEEK\n\ninterface GetRenderableMonthEventSegmentsInput {\n events: MonthPositionedEventData[]\n groupedByDay: Record<string, MonthPositionedEventData[]>\n maxEventsPerDay: number\n week: DateStringValue[]\n}\n\ninterface EventDayRange {\n startDayIndex: number\n endDayIndex: number\n}\n\ninterface SegmentRange extends EventDayRange {\n row: number\n}\n\nexport interface RenderableMonthEventSegment {\n event: MonthPositionedEventData\n position: MonthEventPositionData\n clipStart: boolean\n clipEnd: boolean\n key: string\n}\n\nfunction getEventDayRange(event: MonthPositionedEventData): EventDayRange {\n const startDayIndex = Math.max(0, Math.round(event.position.startOffset / DAY_WIDTH))\n const daysSpanned = Math.max(1, Math.round(event.position.width / DAY_WIDTH))\n\n return {\n startDayIndex,\n endDayIndex: Math.min(DAYS_IN_WEEK - 1, startDayIndex + daysSpanned - 1),\n }\n}\n\nfunction getFirstAvailableRow(usedRows: Set<number>, maxEventsPerDay: number): number | null {\n for (let row = 0; row < maxEventsPerDay; row += 1) {\n if (!usedRows.has(row)) {\n return row\n }\n }\n\n return null\n}\n\nfunction getSegmentHanging(\n originalHanging: MonthEventPositionData['hanging'],\n touchesStart: boolean,\n touchesEnd: boolean,\n): MonthEventPositionData['hanging'] {\n const hangsFromStart = touchesStart && (originalHanging === 'start' || originalHanging === 'both')\n const hangsFromEnd = touchesEnd && (originalHanging === 'end' || originalHanging === 'both')\n\n if (hangsFromStart && hangsFromEnd) {\n return 'both'\n }\n\n if (hangsFromStart) {\n return 'start'\n }\n\n if (hangsFromEnd) {\n return 'end'\n }\n\n return 'none'\n}\n\nfunction getSegmentPosition(\n event: MonthPositionedEventData,\n segment: SegmentRange,\n eventRange: EventDayRange,\n): MonthEventPositionData {\n const touchesStart = segment.startDayIndex === eventRange.startDayIndex\n const touchesEnd = segment.endDayIndex === eventRange.endDayIndex\n\n return {\n ...event.position,\n startOffset: (segment.startDayIndex / DAYS_IN_WEEK) * 100,\n width: ((segment.endDayIndex - segment.startDayIndex + 1) / DAYS_IN_WEEK) * 100,\n row: segment.row,\n hanging: getSegmentHanging(event.position.hanging, touchesStart, touchesEnd),\n }\n}\n\nfunction getEventKey(event: MonthPositionedEventData): string | number {\n return event.id\n}\n\nexport function getRenderableMonthEventSegments({\n events,\n groupedByDay,\n maxEventsPerDay,\n week,\n}: GetRenderableMonthEventSegmentsInput): RenderableMonthEventSegment[] {\n const eventIndexes = new Map<MonthPositionedEventData, number>()\n const eventRanges = new Map<MonthPositionedEventData, EventDayRange>()\n const renderRows = new Map<MonthPositionedEventData, Map<number, number>>()\n\n events.forEach((event, index) => {\n eventIndexes.set(event, index)\n eventRanges.set(event, getEventDayRange(event))\n })\n\n const setRenderRow = (event: MonthPositionedEventData, dayIndex: number, row: number) => {\n if (!renderRows.has(event)) {\n renderRows.set(event, new Map())\n }\n\n renderRows.get(event)!.set(dayIndex, row)\n }\n\n for (let dayIndex = 0; dayIndex < week.length; dayIndex += 1) {\n const dayEvents = groupedByDay[week[dayIndex]] || []\n const dayEventIds = new Set(dayEvents.map((event) => getEventKey(event)))\n const dayWeekEvents = events.filter((event) => {\n const range = eventRanges.get(event)!\n return (\n dayEventIds.has(getEventKey(event)) &&\n dayIndex >= range.startDayIndex &&\n dayIndex <= range.endDayIndex\n )\n })\n\n if (dayEvents.length > maxEventsPerDay) {\n dayWeekEvents.forEach((event) => {\n if (event.position.row < maxEventsPerDay) {\n setRenderRow(event, dayIndex, event.position.row)\n }\n })\n\n continue\n }\n\n const usedRows = new Set<number>()\n const sortedDayEvents = [...dayWeekEvents].sort((a, b) => {\n const rowDiff = a.position.row - b.position.row\n\n if (rowDiff !== 0) {\n return rowDiff\n }\n\n return eventIndexes.get(a)! - eventIndexes.get(b)!\n })\n\n sortedDayEvents.forEach((event) => {\n let row = event.position.row\n\n if (row >= maxEventsPerDay || usedRows.has(row)) {\n const availableRow = getFirstAvailableRow(usedRows, maxEventsPerDay)\n\n if (availableRow === null) {\n return\n }\n\n row = availableRow\n }\n\n usedRows.add(row)\n setRenderRow(event, dayIndex, row)\n })\n }\n\n return events.flatMap((event) => {\n const eventRange = eventRanges.get(event)!\n const eventRenderRows = renderRows.get(event)\n const segments: RenderableMonthEventSegment[] = []\n let currentSegment: SegmentRange | null = null\n\n const addSegment = (segment: SegmentRange) => {\n const position = getSegmentPosition(event, segment, eventRange)\n\n segments.push({\n event,\n position,\n clipStart: segment.startDayIndex > eventRange.startDayIndex,\n clipEnd: segment.endDayIndex < eventRange.endDayIndex,\n key: `${event.id}-${event.position.weekIndex}-${segment.startDayIndex}-${segment.endDayIndex}-${segment.row}`,\n })\n }\n\n for (\n let dayIndex = eventRange.startDayIndex;\n dayIndex <= eventRange.endDayIndex;\n dayIndex += 1\n ) {\n const row = eventRenderRows?.get(dayIndex)\n\n if (row === undefined) {\n if (currentSegment) {\n addSegment(currentSegment)\n currentSegment = null\n }\n\n continue\n }\n\n if (currentSegment && currentSegment.row === row) {\n currentSegment.endDayIndex = dayIndex\n } else {\n if (currentSegment) {\n addSegment(currentSegment)\n }\n\n currentSegment = {\n startDayIndex: dayIndex,\n endDayIndex: dayIndex,\n row,\n }\n }\n }\n\n if (currentSegment) {\n addSegment(currentSegment)\n }\n\n return segments\n })\n}\n",".monthView {\n --week-numbers-offset: 0rem;\n --month-view-border: 1px solid var(--month-view-border-color);\n --month-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --day-base-color: var(--mantine-color-text);\n --min-day-width: 84px;\n\n &:where([data-with-week-numbers]) {\n --week-numbers-offset: 42px;\n }\n\n @mixin where-light {\n --month-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --month-view-border-color: var(--mantine-color-dark-4);\n }\n}\n\n.monthViewWeekdays {\n display: flex;\n}\n\n.monthViewWeek {\n display: flex;\n position: relative;\n min-width: calc(var(--min-day-width) * 7 + var(--week-numbers-offset));\n}\n\n.monthViewWeekNumber {\n flex: 0 0 var(--week-numbers-offset);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n padding: 4px;\n border-block-start: var(--month-view-border);\n border-block-end: none;\n border-inline-start: var(--month-view-border);\n border-inline-end: none;\n font-weight: var(--mantine-font-weight-medium);\n cursor: pointer;\n user-select: none;\n\n :where(.monthViewWeek:first-child) & {\n border-start-start-radius: var(--month-view-radius);\n\n :where([data-with-weekdays] .monthView) & {\n border-start-start-radius: 0;\n }\n }\n\n :where(.monthViewWeek:last-child) & {\n border-block-end: var(--month-view-border);\n border-end-start-radius: var(--month-view-radius);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.monthViewWeekday {\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n min-width: var(--min-day-width);\n height: 36px;\n font-size: var(--mantine-font-size-sm);\n border-block-start: var(--month-view-border);\n border-block-end: none;\n border-inline-start: var(--month-view-border);\n border-inline-end: none;\n font-weight: var(--mantine-font-weight-medium);\n text-align: center;\n text-transform: capitalize;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n user-select: none;\n\n &:where(:first-child) {\n border-start-start-radius: var(--month-view-radius);\n\n :where([data-with-week-numbers] .monthView) & {\n border-start-start-radius: 0;\n }\n }\n\n &:where(:last-child) {\n border-inline-end: var(--month-view-border);\n border-start-end-radius: var(--month-view-radius);\n }\n}\n\n.monthViewWeekdaysCorner {\n flex: 0 0 var(--week-numbers-offset);\n border-block-start: var(--month-view-border);\n border-inline-start: var(--month-view-border);\n border-start-start-radius: var(--month-view-radius);\n}\n\n.monthViewDay {\n min-width: var(--min-day-width);\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n height: calc(52px + var(--month-view-max-events, 2) * 24px);\n padding: 4px;\n font-weight: var(--mantine-font-weight-medium);\n border-block-start: var(--month-view-border);\n border-block-end: none;\n border-inline-start: var(--month-view-border);\n border-inline-end: none;\n color: var(--day-base-color);\n cursor: pointer;\n display: flex;\n align-items: flex-start;\n position: relative;\n\n &:where(:last-child) {\n border-inline-end: var(--month-view-border);\n\n :where(.monthViewWeek:last-child) & {\n border-block-end: var(--month-view-border);\n border-end-end-radius: var(--month-view-radius);\n }\n\n :where(.monthViewWeek:first-child) & {\n border-start-end-radius: var(--month-view-radius);\n\n :where(:not([data-with-weekdays])) .monthView & {\n border-start-end-radius: var(--month-view-radius);\n }\n }\n }\n\n &:where(:first-of-type) {\n :where(.monthViewWeek:first-child) & {\n border-start-start-radius: var(--month-view-radius);\n\n :where([data-with-week-numbers]) .monthView & {\n border-start-start-radius: 0;\n }\n\n :where([data-with-weekdays]) .monthView & {\n border-start-start-radius: 0;\n }\n }\n\n :where(.monthViewWeek:last-child) & {\n border-end-start-radius: var(--month-view-radius);\n }\n\n :where([data-with-week-numbers]) .monthViewWeek:last-child & {\n border-end-start-radius: 0;\n }\n }\n\n :where(.monthViewWeek:last-child) & {\n border-block-end: var(--month-view-border);\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-outside]) {\n color: alpha(var(--day-base-color), 0.4);\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n\n @mixin hover {\n &:where(:not([data-static])) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\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: 0px;\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\n.monthViewDayLabel {\n width: 26px;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 100%;\n font-size: var(--mantine-font-size-sm);\n user-select: none;\n\n &:where([data-today]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n }\n}\n\n.monthViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--month-view-radius);\n background-color: var(--bg-event-bg);\n top: 0;\n bottom: -21px;\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\n.monthViewEvents {\n position: absolute;\n inset-inline: 0;\n inset-inline-start: var(--week-numbers-offset);\n top: 30px;\n bottom: 22px;\n pointer-events: none;\n z-index: 3;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { MonthViewOwnProps } from './MonthView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n firstDayOfWeek: 1,\n weekdayFormat: 'ddd',\n weekendDays: [0, 6],\n withWeekDays: true,\n consistentWeeks: true,\n highlightToday: true,\n withOutsideDays: true,\n maxEventsPerDay: 2,\n} satisfies Partial<MonthViewOwnProps>\n\n/** Vertical offset of the first event row, past the day label, in px. */\nconst EVENTS_TOP_OFFSET = 28\n\n/** Vertical step between stacked event rows, in px. */\nconst EVENT_ROW_HEIGHT = 22\n\n/** Group name of the month grid for slot drag selection – a month has a single grid. */\nconst MONTH_SLOT_GROUP = 'month'\n\nconst COLUMNS = 7\n\n/** `maxEventsPerDay` is clamped so the CSS grid keeps a workable row height. */\nfunction clampMaxEvents(value: number) {\n return Math.min(10, Math.max(1, value))\n}\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius, maxEventsPerDay }) => ({\n monthView: {\n '--month-view-radius': resolveScheduleRadius(radius),\n '--month-view-max-events': String(\n clampMaxEvents(maxEventsPerDay ?? defaultProps.maxEventsPerDay),\n ),\n },\n}))\n\nexport {\n defaultProps,\n varsResolver,\n clampMaxEvents,\n EVENTS_TOP_OFFSET,\n EVENT_ROW_HEIGHT,\n MONTH_SLOT_GROUP,\n COLUMNS,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n} from '../../types'\nimport {\n calculateMonthDropDate,\n formatDate,\n getMonthDays,\n getWeekNumber,\n getWeekdaysNames,\n toDateString,\n} from '../../utils'\nimport { handleGridKeydown } from '../keyboard-navigation'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getMonthViewEvents } from './get-month-view-events/get-month-view-events'\nimport { getRenderableMonthEventSegments } from './get-renderable-month-event-segments'\nimport type { MonthViewEmits, MonthViewSlots } from './MonthView.types'\nimport classes from './MonthView.module.css'\n\ndefineOptions({\n name: 'MonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MonthViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekDays: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n withOutsideDays: undefined,\n maxEventsPerDay: undefined,\n getDayProps: undefined,\n getWeekNumberProps: undefined,\n canDragEvent: undefined,\n monthYearSelectProps: undefined,\n moreEventsProps: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MonthViewSlots>()\n\nconst emit = defineEmits<MonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('MonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'monthView',\n})\n\n/**\n * Cached per selector: the grid renders one cell per day of the month, and rebuilding the same\n * class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst monthGrid = ref<HTMLElement | null>(null)\n\nconst dropTarget = shallowRef<DateStringValue | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\n\nconst maxEventsPerDay = computed(() => clampMaxEvents(props.maxEventsPerDay!))\n\nconst weeks = computed(() =>\n getMonthDays({\n month: month.value,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst flatDays = computed(() => weeks.value.flat().map((date) => toDateString(date)))\n\nconst firstFocusableDayIndex = computed(() =>\n weeks.value\n .flat()\n .findIndex((date) => props.withOutsideDays || dayjs(date).isSame(month.value, 'month')),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n weeks.value[0][0],\n dayjs(weeks.value.at(-1)!.at(-1)!).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst grouped = computed(() =>\n getMonthViewEvents({\n date: month.value,\n events: expandedEvents.value,\n firstDayOfWeek: props.firstDayOfWeek,\n withOutsideDays: props.withOutsideDays,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst weekSegments = computed(() =>\n weeks.value.map((week, weekIndex) =>\n getRenderableMonthEventSegments({\n events: grouped.value.groupedByWeek[String(weekIndex)] || [],\n groupedByDay: grouped.value.groupedByDay,\n maxEventsPerDay: maxEventsPerDay.value,\n week,\n }),\n ),\n)\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex) => {\n const startDay = flatDays.value[startIndex]\n const endDay = flatDays.value[endIndex]\n\n if (startDay && endDay) {\n emit(\n 'slotDragEnd',\n dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n )\n }\n },\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => (dropTarget.value ? { date: dropTarget.value } : null),\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n highlightDay.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n monthValue: month.value.month(),\n yearValue: month.value.year(),\n onMonthChange: (value: number) => changeDate(toDateString(month.value.month(value))),\n onYearChange: (value: number) => changeDate(toDateString(month.value.year(value))),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst dayProps = (date: string) => props.getDayProps?.(toDateString(date)) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDateString(weekStart)) ?? {}\n\nconst isOutside = (date: string | Date) => !dayjs(date).isSame(month.value, 'month')\n\n/** Outside days are rendered as empty placeholders when `withOutsideDays` is off. */\nconst isHiddenDay = (date: string | Date) => isOutside(date) && !props.withOutsideDays\n\nconst dayEvents = (date: string | Date) =>\n grouped.value.groupedByDay[dayjs(date).format('YYYY-MM-DD 00:00:00')] || []\n\nconst hiddenEventsCount = (date: string | Date) =>\n Math.max(0, dayEvents(date).length - maxEventsPerDay.value)\n\nconst handleDayKeydown = (nativeEvent: KeyboardEvent, gridIndex: number) => {\n handleGridKeydown({\n event: nativeEvent,\n index: gridIndex,\n columns: COLUMNS,\n total: weeks.value.length * COLUMNS,\n getControl: (index) =>\n monthGrid.value?.querySelector<HTMLButtonElement>(\n `[data-grid-index=\"${index}\"]:not([data-hidden])`,\n ) ?? null,\n })\n}\n\nconst setDropTarget = (next: DateStringValue | null) => {\n if (dropTarget.value !== next) {\n dropTarget.value = next\n }\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and every change\n * of the highlight re-renders the whole month grid.\n */\nconst highlightDay = rafThrottle((date: DateStringValue) => setDropTarget(date))\n\nconst handleDragOver = (nativeEvent: DragEvent, date: string | Date) => {\n // `preventDefault` and `dropEffect` stay synchronous: the browser reads them as the handler\n // returns, so they cannot be deferred to the next frame.\n nativeEvent.preventDefault()\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.dropEffect = nativeEvent.dataTransfer.types.includes(\n 'application/json',\n )\n ? 'move'\n : 'copy'\n }\n\n highlightDay(toDateString(date))\n}\n\nconst handleDragLeave = (nativeEvent: DragEvent) => {\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !monthGrid.value?.contains(nativeEvent.relatedTarget)\n ) {\n highlightDay.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleDrop = (nativeEvent: DragEvent, date: string | Date) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n highlightDay.cancel()\n setDropTarget(null)\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n const { start } = calculateMonthDropDate({\n draggedEvent: event,\n targetDay: toDateString(date),\n })\n emit('eventDrop', moveEventTo(event, start))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, toDateString(date))\n }\n}\n\nconst segmentStyle = (position: { startOffset: number; width: number; row: number }) => ({\n position: 'absolute' as const,\n insetInlineStart: `${position.startOffset}%`,\n width: `${position.width}%`,\n top: `${EVENTS_TOP_OFFSET + position.row * EVENT_ROW_HEIGHT}px`,\n})\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('monthView') }\"\n :mod=\"[\n {\n 'with-week-numbers': props.withWeekNumbers,\n 'with-weekdays': props.withWeekDays,\n static: isStatic,\n 'slot-dragging': slotDragSelect.isDragging(),\n },\n (attrs as any).mod,\n ]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"month\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'month')\"\n :control=\"headerControl\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('monthViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div ref=\"monthGrid\" v-bind=\"getStyles('monthViewInner')\">\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('monthViewWeekdays')\">\n <div v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('monthViewWeekdaysCorner')\" />\n <div\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"staticStyles('monthViewWeekday')\"\n >\n {{ weekday }}\n </div>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"staticStyles('monthViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n type=\"button\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('monthViewWeekNumber', { className: weekNumberProps(week[0]).class }),\n }\"\n @click=\"emit('weekNumberClick', toDateString(week[0]), $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <div\n v-for=\"(date, dayIndex) in week\"\n :key=\"toDateString(date)\"\n v-bind=\"staticStyles('monthViewDay')\"\n :data-outside=\"isOutside(date) || undefined\"\n :data-weekend=\"props.weekendDays!.includes(dayjs(date).day() as DayOfWeek) || undefined\"\n :data-static=\"isStatic || undefined\"\n :data-drop-target=\"dropTarget === toDateString(date) || undefined\"\n :data-drag-selected=\"\n slotDragSelect.isSlotSelected(weekIndex * COLUMNS + dayIndex, MONTH_SLOT_GROUP) ||\n undefined\n \"\n :data-drag-slot-index=\"withSlotSelect ? weekIndex * COLUMNS + dayIndex : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? MONTH_SLOT_GROUP : undefined\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown(\n $event,\n weekIndex * COLUMNS + dayIndex,\n MONTH_SLOT_GROUP,\n )\n : undefined\n \"\n @dragover=\"withDragHandlers ? handleDragOver($event, date) : $event.preventDefault()\"\n @dragleave=\"withDragHandlers ? handleDragLeave($event) : undefined\"\n @drop=\"handleDrop($event, date)\"\n >\n <UnstyledButton\n type=\"button\"\n v-bind=\"{\n ...dayProps(date as string),\n ...getStyles('monthViewDayLabel', { className: dayProps(date as string).class }),\n }\"\n :disabled=\"isStatic\"\n :data-grid-index=\"weekIndex * COLUMNS + dayIndex\"\n :data-outside=\"isOutside(date) || undefined\"\n :data-hidden=\"isHiddenDay(date) || undefined\"\n :aria-label=\"\n formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\n \"\n :data-today=\"\n (props.highlightToday && dayjs(date).isSame(dayjs(), 'day')) || undefined\n \"\n :tabindex=\"\n isStatic ? -1 : weekIndex * COLUMNS + dayIndex === firstFocusableDayIndex ? 0 : -1\n \"\n @click=\"emit('dayClick', toDateString(date), $event)\"\n @keydown=\"\n isStatic ? undefined : handleDayKeydown($event, weekIndex * COLUMNS + dayIndex)\n \"\n >\n {{ isHiddenDay(date) ? '' : dayjs(date).date() }}\n </UnstyledButton>\n\n <MoreEvents\n v-if=\"hiddenEventsCount(date) > 0\"\n :events=\"dayEvents(date)\"\n :more-events-count=\"hiddenEventsCount(date)\"\n :labels=\"props.labels\"\n :mode=\"props.mode\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"clickEvent\"\n />\n </div>\n\n <div v-bind=\"getStyles('monthViewEvents')\">\n <ScheduleEvent\n v-for=\"segment in weekSegments[weekIndex]\"\n :key=\"segment.key\"\n :event=\"segment.event\"\n nowrap\n :hanging=\"segment.position.hanging\"\n :mode=\"props.mode\"\n :data-clip-start=\"segment.clipStart || undefined\"\n :data-clip-end=\"segment.clipEnd || undefined\"\n :style=\"segmentStyle(segment.position)\"\n :draggable=\"isDraggableEvent(segment.event)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(segment.event, $event)\"\n />\n </div>\n </div>\n </div>\n </ScrollArea>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { MonthViewOwnProps } from './MonthView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n firstDayOfWeek: 1,\n weekdayFormat: 'ddd',\n weekendDays: [0, 6],\n withWeekDays: true,\n consistentWeeks: true,\n highlightToday: true,\n withOutsideDays: true,\n maxEventsPerDay: 2,\n} satisfies Partial<MonthViewOwnProps>\n\n/** Vertical offset of the first event row, past the day label, in px. */\nconst EVENTS_TOP_OFFSET = 28\n\n/** Vertical step between stacked event rows, in px. */\nconst EVENT_ROW_HEIGHT = 22\n\n/** Group name of the month grid for slot drag selection – a month has a single grid. */\nconst MONTH_SLOT_GROUP = 'month'\n\nconst COLUMNS = 7\n\n/** `maxEventsPerDay` is clamped so the CSS grid keeps a workable row height. */\nfunction clampMaxEvents(value: number) {\n return Math.min(10, Math.max(1, value))\n}\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius, maxEventsPerDay }) => ({\n monthView: {\n '--month-view-radius': resolveScheduleRadius(radius),\n '--month-view-max-events': String(\n clampMaxEvents(maxEventsPerDay ?? defaultProps.maxEventsPerDay),\n ),\n },\n}))\n\nexport {\n defaultProps,\n varsResolver,\n clampMaxEvents,\n EVENTS_TOP_OFFSET,\n EVENT_ROW_HEIGHT,\n MONTH_SLOT_GROUP,\n COLUMNS,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n} from '../../types'\nimport {\n calculateMonthDropDate,\n formatDate,\n getMonthDays,\n getWeekNumber,\n getWeekdaysNames,\n toDateString,\n} from '../../utils'\nimport { handleGridKeydown } from '../keyboard-navigation'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getMonthViewEvents } from './get-month-view-events/get-month-view-events'\nimport { getRenderableMonthEventSegments } from './get-renderable-month-event-segments'\nimport type { MonthViewEmits, MonthViewSlots } from './MonthView.types'\nimport classes from './MonthView.module.css'\n\ndefineOptions({\n name: 'MonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MonthViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekDays: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n withOutsideDays: undefined,\n maxEventsPerDay: undefined,\n getDayProps: undefined,\n getWeekNumberProps: undefined,\n canDragEvent: undefined,\n monthYearSelectProps: undefined,\n moreEventsProps: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MonthViewSlots>()\n\nconst emit = defineEmits<MonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('MonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'monthView',\n})\n\n/**\n * Cached per selector: the grid renders one cell per day of the month, and rebuilding the same\n * class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst monthGrid = ref<HTMLElement | null>(null)\n\nconst dropTarget = shallowRef<DateStringValue | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\n\nconst maxEventsPerDay = computed(() => clampMaxEvents(props.maxEventsPerDay!))\n\nconst weeks = computed(() =>\n getMonthDays({\n month: month.value,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst flatDays = computed(() => weeks.value.flat().map((date) => toDateString(date)))\n\nconst firstFocusableDayIndex = computed(() =>\n weeks.value\n .flat()\n .findIndex((date) => props.withOutsideDays || dayjs(date).isSame(month.value, 'month')),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n weeks.value[0][0],\n dayjs(weeks.value.at(-1)!.at(-1)!).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst grouped = computed(() =>\n getMonthViewEvents({\n date: month.value,\n events: expandedEvents.value,\n firstDayOfWeek: props.firstDayOfWeek,\n withOutsideDays: props.withOutsideDays,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst weekSegments = computed(() =>\n weeks.value.map((week, weekIndex) =>\n getRenderableMonthEventSegments({\n events: grouped.value.groupedByWeek[String(weekIndex)] || [],\n groupedByDay: grouped.value.groupedByDay,\n maxEventsPerDay: maxEventsPerDay.value,\n week,\n }),\n ),\n)\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex) => {\n const startDay = flatDays.value[startIndex]\n const endDay = flatDays.value[endIndex]\n\n if (startDay && endDay) {\n emit(\n 'slotDragEnd',\n dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n )\n }\n },\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => (dropTarget.value ? { date: dropTarget.value } : null),\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n highlightDay.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n monthValue: month.value.month(),\n yearValue: month.value.year(),\n onMonthChange: (value: number) => changeDate(toDateString(month.value.month(value))),\n onYearChange: (value: number) => changeDate(toDateString(month.value.year(value))),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst dayProps = (date: string) => props.getDayProps?.(toDateString(date)) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDateString(weekStart)) ?? {}\n\nconst isOutside = (date: string | Date) => !dayjs(date).isSame(month.value, 'month')\n\n/** Outside days are rendered as empty placeholders when `withOutsideDays` is off. */\nconst isHiddenDay = (date: string | Date) => isOutside(date) && !props.withOutsideDays\n\nconst dayEvents = (date: string | Date) =>\n grouped.value.groupedByDay[dayjs(date).format('YYYY-MM-DD 00:00:00')] || []\n\nconst hiddenEventsCount = (date: string | Date) =>\n Math.max(0, dayEvents(date).length - maxEventsPerDay.value)\n\nconst handleDayKeydown = (nativeEvent: KeyboardEvent, gridIndex: number) => {\n handleGridKeydown({\n event: nativeEvent,\n index: gridIndex,\n columns: COLUMNS,\n total: weeks.value.length * COLUMNS,\n getControl: (index) =>\n monthGrid.value?.querySelector<HTMLButtonElement>(\n `[data-grid-index=\"${index}\"]:not([data-hidden])`,\n ) ?? null,\n })\n}\n\nconst setDropTarget = (next: DateStringValue | null) => {\n if (dropTarget.value !== next) {\n dropTarget.value = next\n }\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and every change\n * of the highlight re-renders the whole month grid.\n */\nconst highlightDay = rafThrottle((date: DateStringValue) => setDropTarget(date))\n\nconst handleDragOver = (nativeEvent: DragEvent, date: string | Date) => {\n // `preventDefault` and `dropEffect` stay synchronous: the browser reads them as the handler\n // returns, so they cannot be deferred to the next frame.\n nativeEvent.preventDefault()\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.dropEffect = nativeEvent.dataTransfer.types.includes(\n 'application/json',\n )\n ? 'move'\n : 'copy'\n }\n\n highlightDay(toDateString(date))\n}\n\nconst handleDragLeave = (nativeEvent: DragEvent) => {\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !monthGrid.value?.contains(nativeEvent.relatedTarget)\n ) {\n highlightDay.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleDrop = (nativeEvent: DragEvent, date: string | Date) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n highlightDay.cancel()\n setDropTarget(null)\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n const { start } = calculateMonthDropDate({\n draggedEvent: event,\n targetDay: toDateString(date),\n })\n emit('eventDrop', moveEventTo(event, start))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, toDateString(date))\n }\n}\n\nconst segmentStyle = (position: { startOffset: number; width: number; row: number }) => ({\n position: 'absolute' as const,\n insetInlineStart: `${position.startOffset}%`,\n width: `${position.width}%`,\n top: `${EVENTS_TOP_OFFSET + position.row * EVENT_ROW_HEIGHT}px`,\n})\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('monthView') }\"\n :mod=\"[\n {\n 'with-week-numbers': props.withWeekNumbers,\n 'with-weekdays': props.withWeekDays,\n static: isStatic,\n 'slot-dragging': slotDragSelect.isDragging(),\n },\n (attrs as any).mod,\n ]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"month\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'month')\"\n :control=\"headerControl\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('monthViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div ref=\"monthGrid\" v-bind=\"getStyles('monthViewInner')\">\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('monthViewWeekdays')\">\n <div v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('monthViewWeekdaysCorner')\" />\n <div\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"staticStyles('monthViewWeekday')\"\n >\n {{ weekday }}\n </div>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"staticStyles('monthViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n type=\"button\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('monthViewWeekNumber', { className: weekNumberProps(week[0]).class }),\n }\"\n @click=\"emit('weekNumberClick', toDateString(week[0]), $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <div\n v-for=\"(date, dayIndex) in week\"\n :key=\"toDateString(date)\"\n v-bind=\"staticStyles('monthViewDay')\"\n :data-outside=\"isOutside(date) || undefined\"\n :data-weekend=\"props.weekendDays!.includes(dayjs(date).day() as DayOfWeek) || undefined\"\n :data-static=\"isStatic || undefined\"\n :data-drop-target=\"dropTarget === toDateString(date) || undefined\"\n :data-drag-selected=\"\n slotDragSelect.isSlotSelected(weekIndex * COLUMNS + dayIndex, MONTH_SLOT_GROUP) ||\n undefined\n \"\n :data-drag-slot-index=\"withSlotSelect ? weekIndex * COLUMNS + dayIndex : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? MONTH_SLOT_GROUP : undefined\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown(\n $event,\n weekIndex * COLUMNS + dayIndex,\n MONTH_SLOT_GROUP,\n )\n : undefined\n \"\n @dragover=\"withDragHandlers ? handleDragOver($event, date) : $event.preventDefault()\"\n @dragleave=\"withDragHandlers ? handleDragLeave($event) : undefined\"\n @drop=\"handleDrop($event, date)\"\n >\n <UnstyledButton\n type=\"button\"\n v-bind=\"{\n ...dayProps(date as string),\n ...getStyles('monthViewDayLabel', { className: dayProps(date as string).class }),\n }\"\n :disabled=\"isStatic\"\n :data-grid-index=\"weekIndex * COLUMNS + dayIndex\"\n :data-outside=\"isOutside(date) || undefined\"\n :data-hidden=\"isHiddenDay(date) || undefined\"\n :aria-label=\"\n formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\n \"\n :data-today=\"\n (props.highlightToday && dayjs(date).isSame(dayjs(), 'day')) || undefined\n \"\n :tabindex=\"\n isStatic ? -1 : weekIndex * COLUMNS + dayIndex === firstFocusableDayIndex ? 0 : -1\n \"\n @click=\"emit('dayClick', toDateString(date), $event)\"\n @keydown=\"\n isStatic ? undefined : handleDayKeydown($event, weekIndex * COLUMNS + dayIndex)\n \"\n >\n {{ isHiddenDay(date) ? '' : dayjs(date).date() }}\n </UnstyledButton>\n\n <MoreEvents\n v-if=\"hiddenEventsCount(date) > 0\"\n :events=\"dayEvents(date)\"\n :more-events-count=\"hiddenEventsCount(date)\"\n :labels=\"props.labels\"\n :mode=\"props.mode\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"clickEvent\"\n />\n </div>\n\n <div v-bind=\"getStyles('monthViewEvents')\">\n <ScheduleEvent\n v-for=\"segment in weekSegments[weekIndex]\"\n :key=\"segment.key\"\n :event=\"segment.event\"\n nowrap\n :hanging=\"segment.position.hanging\"\n :mode=\"props.mode\"\n :data-clip-start=\"segment.clipStart || undefined\"\n :data-clip-end=\"segment.clipEnd || undefined\"\n :style=\"segmentStyle(segment.position)\"\n :draggable=\"isDraggableEvent(segment.event)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(segment.event, $event)\"\n />\n </div>\n </div>\n </div>\n </ScrollArea>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport MonthViewComponent, { varsResolver } from './MonthView.vue'\nimport type { MonthViewFactory } from './MonthView.types'\nimport classes from './MonthView.module.css'\n\nexport const MonthView = factory<MonthViewFactory>(MonthViewComponent, { classes, varsResolver })\n\nexport type {\n MonthViewCssVariables,\n MonthViewEmits,\n MonthViewFactory,\n MonthViewOwnProps,\n MonthViewOwnStylesNames,\n MonthViewProps,\n MonthViewSlots,\n MonthViewStylesNames,\n} from './MonthView.types'\n","import dayjs from 'dayjs'\nimport type { VNodeChild } from 'vue'\nimport { DateLabelFormat, DateStringValue } from '../../../types'\nimport { formatDate } from '../../../utils'\n\ninterface GetWeekLabelInput {\n weekdays: Date[] | string[]\n locale: string\n weekLabelFormat: DateLabelFormat\n renderWeekLabel?: (params: { weekStart: DateStringValue; weekEnd: DateStringValue }) => VNodeChild\n}\n\nexport function getWeekLabel({\n weekdays,\n locale,\n weekLabelFormat,\n renderWeekLabel,\n}: GetWeekLabelInput) {\n if (renderWeekLabel) {\n return renderWeekLabel({\n weekStart: dayjs(weekdays[0]).format('YYYY-MM-DD'),\n weekEnd: dayjs(weekdays[weekdays.length - 1]).format('YYYY-MM-DD'),\n })\n }\n\n return `${formatDate({\n locale,\n date: weekdays[0],\n format: weekLabelFormat,\n })} – ${formatDate({\n locale,\n date: weekdays[weekdays.length - 1],\n format: weekLabelFormat,\n })}, ${formatDate({ locale, date: weekdays[0], format: 'YYYY' })}`\n}\n","import { AnyDateValue, DayOfWeek, ScheduleEventData } from '../../../types'\nimport { isEventInTimeRange, isWithinWeek, validateEvent } from '../../../utils'\n\nexport interface FilterWeekViewEventsInput {\n /** Date (week start) at which events are positioned, used to check if events are all-day */\n date: AnyDateValue\n\n /** List of all events that belong to the given week, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[] | undefined\n\n /** Start time of the week view, used to calculate event positions */\n startTime?: string\n\n /** End time of the week view, used to calculate event positions */\n endTime?: string\n\n /** First day of the week, 0 - Sunday, 1 - Monday, etc., used to calculate events positions */\n firstDayOfWeek?: DayOfWeek\n}\n\nexport function filterWeekViewEvents({\n date,\n events,\n startTime,\n endTime,\n firstDayOfWeek = 1,\n}: FilterWeekViewEventsInput): ScheduleEventData[] {\n if (events === undefined) {\n return []\n }\n\n const ids = new Set<string | number>()\n const filteredEvents: ScheduleEventData[] = []\n\n for (const event of events) {\n if (\n isWithinWeek({ event, targetWeek: date, firstDayOfWeek }) &&\n isEventInTimeRange({ event, startTime, endTime })\n ) {\n filteredEvents.push(validateEvent(event))\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(`[@mantine/schedule] WeekView: Duplicated event ids found: ${event.id}`)\n }\n }\n }\n\n return filteredEvents\n}\n","import { ScheduleEventData, WeekPositionedEventData } from '../../../types'\nimport { isEventsOverlap } from '../../../utils'\n\nexport function assignEventRows(events: WeekPositionedEventData[]): Map<ScheduleEventData, number> {\n const eventRows = new Map<ScheduleEventData, number>()\n\n for (const event of events) {\n let row = 0\n\n while (true) {\n let hasConflict = false\n\n for (const [otherEvent, otherRow] of eventRows.entries()) {\n if (otherRow === row && isEventsOverlap(event, otherEvent)) {\n hasConflict = true\n break\n }\n }\n\n if (!hasConflict) {\n break\n }\n\n row++\n }\n\n eventRows.set(event, row)\n }\n\n return eventRows\n}\n","import dayjs, { Dayjs } from 'dayjs'\nimport { DateStringValue } from '../../../types'\n\ninterface CalculateAllDayEventOffsetInput {\n eventStartDate: Dayjs\n weekStartDate: Dayjs\n weekDays: DateStringValue[]\n visibleDaysCount: number\n hangingStart: boolean\n}\n\nexport function calculateAllDayEventOffset({\n eventStartDate,\n weekStartDate,\n weekDays,\n visibleDaysCount,\n hangingStart,\n}: CalculateAllDayEventOffsetInput): number {\n let displayStartDate = eventStartDate\n\n if (hangingStart) {\n displayStartDate = weekStartDate\n }\n\n if (!weekDays.some((day) => dayjs(day).isSame(displayStartDate, 'day'))) {\n displayStartDate = dayjs(weekDays[0])\n }\n\n const visibleDaysBeforeEvent =\n weekDays.filter(\n (day) => dayjs(day).isBefore(displayStartDate) || dayjs(day).isSame(displayStartDate, 'day'),\n ).length - 1\n\n return (visibleDaysBeforeEvent / visibleDaysCount) * 100\n}\n","import dayjs, { Dayjs } from 'dayjs'\nimport { DateStringValue } from '../../../types'\n\ninterface CalculateAllDayEventWidthInput {\n eventStartDate: Dayjs\n actualEndDate: Dayjs\n weekStartDate: Dayjs\n weekEndDate: Dayjs\n weekDays: DateStringValue[]\n visibleDaysCount: number\n}\n\nexport function calculateAllDayEventWidth({\n eventStartDate,\n actualEndDate,\n weekStartDate,\n weekEndDate,\n weekDays,\n visibleDaysCount,\n}: CalculateAllDayEventWidthInput): number {\n let displayStartDate = eventStartDate\n if (eventStartDate.isBefore(weekStartDate)) {\n displayStartDate = weekStartDate\n }\n\n let displayEndDate = actualEndDate\n if (actualEndDate.isAfter(weekEndDate)) {\n displayEndDate = weekEndDate\n }\n\n const visibleDaysSpanned = weekDays.filter(\n (day) =>\n (dayjs(day).isAfter(displayStartDate) || dayjs(day).isSame(displayStartDate, 'day')) &&\n (dayjs(day).isBefore(displayEndDate) || dayjs(day).isSame(displayEndDate, 'day')),\n ).length\n\n return (visibleDaysSpanned / visibleDaysCount) * 100\n}\n","import dayjs, { Dayjs } from 'dayjs'\nimport { DateStringValue, ScheduleEventData } from '../../../types'\n\ninterface CalculateEventDaysInput {\n event: ScheduleEventData\n weekDays: DateStringValue[]\n actualEndDate: Dayjs\n}\n\nexport function calculateEventDays({ event, weekDays, actualEndDate }: CalculateEventDaysInput) {\n const eventStartDate = dayjs(event.start).startOf('day')\n\n return weekDays.filter((day) => {\n const dayDate = dayjs(day).startOf('day')\n return (\n (dayDate.isAfter(eventStartDate) || dayDate.isSame(eventStartDate)) &&\n (dayDate.isBefore(actualEndDate) || dayDate.isSame(actualEndDate))\n )\n })\n}\n","import { WeekPositionedEventData } from '../../../types'\nimport { isEventsOverlap } from '../../../utils'\n\nexport function calculateRegularEventOverlaps(events: WeekPositionedEventData[]): void {\n for (const event of events) {\n let maxOverlappingColumn = event.position.column\n\n for (const otherEvent of events) {\n if (isEventsOverlap(event, otherEvent)) {\n maxOverlappingColumn = Math.max(maxOverlappingColumn, otherEvent.position.column)\n }\n }\n\n const overlaps = maxOverlappingColumn + 1\n event.position.overlaps = overlaps\n event.position.width = 100 / overlaps\n event.position.offset = (event.position.column * 100) / overlaps\n }\n}\n","import { DateStringValue, ScheduleEventData } from '../../../types'\nimport { isAllDayEvent, isEventsOverlap } from '../../../utils'\n\ninterface FindAvailableColumnInput {\n columns: Map<string, ScheduleEventData[]>\n event: ScheduleEventData\n allDay: boolean\n allWeekDays: DateStringValue[]\n}\n\nfunction columnHasConflict({\n columns,\n columnIndex,\n event,\n allDay,\n allWeekDays,\n}: FindAvailableColumnInput & { columnIndex: number }): boolean {\n const columnKey = `col-${columnIndex}`\n if (!columns.has(columnKey)) {\n return false\n }\n\n const columnEvents = columns.get(columnKey)!\n\n return columnEvents.some((e) => {\n const eAllDay = allWeekDays.some((day) => isAllDayEvent({ event: e, date: day }))\n const hasTimeConflict = isEventsOverlap(e, event)\n\n if (allDay && eAllDay) {\n return hasTimeConflict\n }\n\n if (allDay || eAllDay) {\n return false\n }\n\n return hasTimeConflict\n })\n}\n\nexport function findAvailableColumn(input: FindAvailableColumnInput): number {\n let column = 0\n\n while (columnHasConflict({ ...input, columnIndex: column })) {\n column++\n }\n\n return column\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../../types'\n\nexport function getEventEndDate(event: ScheduleEventData) {\n const eventEndDate = dayjs(event.end).startOf('day')\n\n if (dayjs(event.end).hour() === 0 && dayjs(event.end).minute() === 0) {\n return eventEndDate.subtract(1, 'day')\n }\n\n return eventEndDate\n}\n","import dayjs, { Dayjs } from 'dayjs'\nimport { DateStringValue } from '../../../types'\n\ninterface GetHangingStatusInput {\n eventStartDate: Dayjs\n actualEndDate: Dayjs\n weekDays: DateStringValue[]\n}\n\nexport function getHangingStatus({\n eventStartDate,\n actualEndDate,\n weekDays,\n}: GetHangingStatusInput): 'start' | 'end' | 'both' | 'none' {\n const weekStartDate = dayjs(weekDays[0])\n const weekEndDate = dayjs(weekDays[weekDays.length - 1])\n\n const hangingStart = eventStartDate.isBefore(weekStartDate)\n const hangingEnd = actualEndDate.isAfter(weekEndDate)\n\n if (hangingStart && hangingEnd) {\n return 'both'\n }\n\n if (hangingStart) {\n return 'start'\n }\n\n if (hangingEnd) {\n return 'end'\n }\n\n return 'none'\n}\n","import dayjs from 'dayjs'\nimport {\n AnyDateValue,\n DateStringValue,\n DayOfWeek,\n ScheduleEventData,\n WeekPositionedEventData,\n} from '../../../types'\nimport { getDayPosition, getWeekDays, isAllDayEvent, sortEvents } from '../../../utils'\nimport { assignEventRows } from './assign-event-rows'\nimport { calculateAllDayEventOffset } from './calculate-all-day-event-offset'\nimport { calculateAllDayEventWidth } from './calculate-all-day-event-width'\nimport { calculateEventDays } from './calculate-event-days'\nimport { calculateRegularEventOverlaps } from './calculate-regular-event-overlaps'\nimport { findAvailableColumn } from './find-available-column'\nimport { getEventEndDate } from './get-event-end-date'\nimport { getHangingStatus } from './get-hanging-status'\n\nexport interface GetWeekPositionedEventsInput {\n /** Date (week start) at which events are positioned, used to check if events are all-day */\n date: AnyDateValue\n\n /** List of all events that belong to the given week, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[]\n\n /** Start time of the week view, used to calculate event positions */\n startTime?: string\n\n /** End time of the week view, used to calculate event positions */\n endTime?: string\n\n /** Number of minutes per time slot, used to align the canvas to whole slots */\n intervalMinutes?: number\n\n /** First day of the week, 0 - Sunday, 1 - Monday, etc., used to calculate events positions */\n firstDayOfWeek?: DayOfWeek\n\n /** Indices of weekend days, 0-6, where 0 is Sunday and 6 is Saturday */\n weekendDays?: DayOfWeek[]\n\n /** If set to false, weekend days are hidden @default true */\n withWeekendDays?: boolean\n}\n\n/** Events grouped by week day date (YYYY-MM-DD 00:00:00) and by columns */\nexport interface GroupedWeekEvents {\n allDayEvents: WeekPositionedEventData[]\n regularEvents: Record<DateStringValue, WeekPositionedEventData[]>\n backgroundEvents: Record<DateStringValue, WeekPositionedEventData[]>\n}\n\nexport function getWeekPositionedEvents({\n date,\n events,\n startTime,\n endTime,\n intervalMinutes,\n firstDayOfWeek = 1,\n weekendDays = [0, 6],\n withWeekendDays = true,\n}: GetWeekPositionedEventsInput): GroupedWeekEvents {\n const weekDays = getWeekDays({ week: date, firstDayOfWeek, withWeekendDays, weekendDays })\n const visibleDaysCount = weekDays.length\n const weekStartDate = dayjs(weekDays[0])\n const weekEndDate = dayjs(weekDays[weekDays.length - 1])\n\n const grouped: GroupedWeekEvents = {\n allDayEvents: [],\n regularEvents: Object.fromEntries(weekDays.map((day) => [day, []])),\n backgroundEvents: Object.fromEntries(weekDays.map((day) => [day, []])),\n }\n\n const columns = new Map<string, ScheduleEventData[]>()\n const allDayColumns = new Map<string, ScheduleEventData[]>()\n const sorted = sortEvents(events)\n\n for (const event of sorted) {\n if (event.display === 'background') {\n const eventStartDate = dayjs(event.start).startOf('day')\n const actualEndDate = getEventEndDate(event)\n const eventWeekDays = calculateEventDays({ event, weekDays, actualEndDate })\n const hanging = getHangingStatus({ eventStartDate, actualEndDate, weekDays })\n\n for (const day of eventWeekDays) {\n const visibleDayIndex = weekDays.indexOf(day)\n if (visibleDayIndex === -1) {\n continue\n }\n\n const dayStart = dayjs(day)\n const dayEnd = dayStart.endOf('day')\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd\n\n const clippedEvent = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n }\n\n const isAllDay = isAllDayEvent({ event: clippedEvent, date: day })\n const verticalPosition = isAllDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event: clippedEvent, startTime, endTime, intervalMinutes })\n\n if (!isAllDay && verticalPosition.height <= 0) {\n continue\n }\n\n const dayWeekOffset = (visibleDayIndex / visibleDaysCount) * 100\n\n grouped.backgroundEvents[day].push({\n ...event,\n position: {\n ...verticalPosition,\n allDay: isAllDay,\n column: 0,\n width: 100,\n offset: 0,\n overlaps: 1,\n weekOffset: dayWeekOffset,\n row: 0,\n hanging,\n },\n })\n }\n\n continue\n }\n const eventStartDate = dayjs(event.start).startOf('day')\n const actualEndDate = getEventEndDate(event)\n const eventWeekDays = calculateEventDays({ event, weekDays, actualEndDate })\n\n if (eventWeekDays.length === 0) {\n continue\n }\n\n const isMultiday = actualEndDate.isAfter(eventStartDate)\n const hanging = getHangingStatus({ eventStartDate, actualEndDate, weekDays })\n const isActuallyAllDay = eventWeekDays.some((day) => isAllDayEvent({ event, date: day }))\n const allDay = isMultiday || isActuallyAllDay\n\n const columnMap = allDay ? allDayColumns : columns\n const column = findAvailableColumn({\n columns: columnMap,\n event,\n allDay,\n allWeekDays: weekDays,\n })\n\n const columnKey = `col-${column}`\n if (!columnMap.has(columnKey)) {\n columnMap.set(columnKey, [])\n }\n columnMap.get(columnKey)!.push(event)\n\n const verticalPosition = allDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event, startTime, endTime, intervalMinutes })\n\n if (allDay) {\n const offset = calculateAllDayEventOffset({\n eventStartDate,\n weekStartDate,\n weekDays,\n visibleDaysCount,\n hangingStart: hanging === 'start' || hanging === 'both',\n })\n\n grouped.allDayEvents.push({\n ...event,\n position: {\n ...verticalPosition,\n allDay,\n column,\n width: 0,\n offset,\n overlaps: 0,\n row: 0,\n hanging,\n },\n })\n } else {\n for (const day of eventWeekDays) {\n const visibleDayIndex = weekDays.indexOf(day)\n\n if (visibleDayIndex === -1) {\n continue\n }\n\n const dayWeekOffset = (visibleDayIndex / visibleDaysCount) * 100\n\n grouped.regularEvents[day].push({\n ...event,\n position: {\n ...verticalPosition,\n allDay,\n column,\n width: 0,\n offset: 0,\n overlaps: 0,\n weekOffset: dayWeekOffset,\n row: 0,\n hanging,\n },\n })\n }\n }\n }\n\n for (const day of weekDays) {\n calculateRegularEventOverlaps(grouped.regularEvents[day])\n }\n\n if (grouped.allDayEvents.length > 0) {\n const eventRows = assignEventRows(grouped.allDayEvents)\n const assignedRows = new Set<number>()\n\n for (const event of grouped.allDayEvents) {\n const row = eventRows.get(event)!\n event.position.row = row\n assignedRows.add(row)\n }\n\n const rowCount = Math.max(...assignedRows) + 1\n\n for (const event of grouped.allDayEvents) {\n const eventStartDate = dayjs(event.start).startOf('day')\n const actualEndDate = getEventEndDate(event)\n\n event.position.width = calculateAllDayEventWidth({\n eventStartDate,\n actualEndDate,\n weekStartDate,\n weekEndDate,\n weekDays,\n visibleDaysCount,\n })\n\n event.position.overlaps = rowCount\n }\n }\n\n return grouped\n}\n","import { ScheduleEventData } from '../../../types'\nimport { filterWeekViewEvents } from './filter-week-view-events'\nimport {\n getWeekPositionedEvents,\n GetWeekPositionedEventsInput,\n GroupedWeekEvents,\n} from './get-week-positioned-events'\n\ninterface GetWeekViewEventsInput extends Omit<GetWeekPositionedEventsInput, 'events'> {\n events: ScheduleEventData[] | undefined\n}\n\nexport function getWeekViewEvents(input: GetWeekViewEventsInput): GroupedWeekEvents {\n return getWeekPositionedEvents({ ...input, events: filterWeekViewEvents(input) })\n}\n",".weekView {\n --week-view-week-day-height: 58px;\n --week-view-all-day-slots-height: 48px;\n --week-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --week-view-slots-label-width: 80px;\n --week-view-min-slot-width: 80px;\n --week-view-slot-height: 64px;\n\n @mixin where-light {\n --week-view-border-color: var(--mantine-color-gray-3);\n --week-view-business-hours-bg: var(--mantine-color-white);\n --week-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --week-view-border-color: var(--mantine-color-dark-4);\n --week-view-business-hours-bg: var(--mantine-color-dark-7);\n --week-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.weekViewRoot {\n --indicator-labels-offset: calc(var(--week-view-slots-label-width) / var(--number-of-days));\n\n border: 1px solid var(--week-view-border-color);\n border-radius: var(--week-view-radius);\n overflow: hidden;\n}\n\n.weekViewInner {\n display: flex;\n position: relative;\n overflow: hidden;\n}\n\n.weekViewScrollArea {\n :where(:global(.mantine-ScrollArea-scrollbar)) {\n z-index: 4;\n }\n}\n\n.weekViewHeader {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--week-view-border-color);\n margin-bottom: -1px;\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n}\n\n.weekViewCorner {\n height: var(--week-view-week-day-height);\n flex: 0 0 var(--week-view-slots-label-width);\n min-width: var(--week-view-slots-label-width);\n line-height: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.weekViewSlotLabels {\n flex: 0 0 var(--week-view-slots-label-width);\n min-width: var(--week-view-slots-label-width);\n background-color: var(--mantine-color-body);\n}\n\n.weekViewSlotLabel {\n border-top: 1px solid var(--week-view-border-color);\n text-align: right;\n height: var(--week-view-slot-height);\n padding: 4px;\n padding-inline-end: 8px;\n font-size: var(--mantine-font-size-sm);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n\n &:where([data-business-hours]) {\n background-color: var(--week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--week-view-non-business-hours-bg);\n }\n}\n\n.weekViewDay {\n flex: 1;\n border-inline-start: 1px solid var(--week-view-border-color);\n}\n\n.weekViewDayLabel {\n height: var(--week-view-week-day-height);\n min-width: var(--week-view-min-slot-width);\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n cursor: pointer;\n flex: 1;\n border-inline-start: 1px solid var(--week-view-border-color);\n padding-inline-start: 5px;\n\n &:where([data-weekend]) {\n color: var(--mantine-color-error);\n }\n\n &:where([data-today]) {\n gap: 6px;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.weekViewDayNumber {\n text-align: center;\n width: 26px;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 100%;\n font-size: var(--mantine-font-size-sm);\n\n :where(.weekViewDayLabel[data-today]) & {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n }\n}\n\n.weekViewDayWeekday {\n text-align: center;\n font-size: var(--mantine-font-size-sm);\n text-transform: capitalize;\n}\n\n.weekViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--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\n.weekViewDaySlots {\n position: relative;\n}\n\n.weekViewDaySlot {\n display: block;\n width: 100%;\n border-top: 1px solid var(--week-view-border-color);\n height: var(--week-view-slot-height);\n min-width: var(--week-view-min-slot-width);\n padding: 4px;\n cursor: pointer;\n position: relative;\n\n &:where(:focus) {\n z-index: 1;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where([data-business-hours]) {\n background-color: var(--week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--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.weekViewWeekLabel {\n text-align: center;\n margin-bottom: 4px;\n font-size: var(--mantine-font-size-sm);\n}\n\n.weekViewWeekNumber {\n font-weight: var(--mantine-font-weight-medium);\n text-align: center;\n font-size: var(--mantine-font-size-lg);\n}\n\n.weekViewAllDaySlots {\n display: flex;\n height: var(--week-view-all-day-slots-height);\n}\n\n.weekViewAllDaySlotsLabel {\n flex: 0 0 var(--week-view-slots-label-width);\n text-align: right;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n}\n\n.weekViewAllDaySlotsEvents {\n position: absolute;\n inset: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n.weekViewAllDaySlotsList {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n\n & > .weekViewDaySlot {\n flex: 1;\n border-inline-start: 1px solid var(--week-view-border-color);\n height: 100%;\n }\n\n &:hover,\n &:focus-within {\n .weekViewAllDaySlotsEvents {\n overflow: visible;\n\n &::before {\n content: '';\n position: absolute;\n top: 100%;\n height: calc(var(--week-view-all-day-slots-height) / 2 * var(--extra-rows));\n inset-inline: 0;\n z-index: 1;\n pointer-events: all;\n }\n }\n }\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { WeekViewOwnProps } from './WeekView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeIndicator: true,\n withCurrentTimeBubble: true,\n slotHeight: 64,\n firstDayOfWeek: 1,\n weekdayFormat: 'ddd',\n dayFormat: 'D',\n withWeekNumber: true,\n withAllDaySlots: true,\n allDaySlotHeight: 44,\n weekendDays: [0, 6],\n withWeekendDays: true,\n weekLabelFormat: 'MMM D',\n} satisfies Partial<WeekViewOwnProps>\n\n/** Vertical step between stacked all-day event rows, in px. */\nconst ALL_DAY_ROW_HEIGHT = 22\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotHeight, allDaySlotHeight, allDaySlotsHeight }) => ({\n weekView: {\n '--week-view-radius': resolveScheduleRadius(radius),\n '--week-view-slot-height': cssSize(slotHeight),\n '--week-view-all-day-slots-height': cssSize(allDaySlotsHeight ?? allDaySlotHeight),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, ALL_DAY_ROW_HEIGHT }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useEventResize } from '../../hooks/use-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n} from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getDayTimeIntervals,\n getWeekDays,\n getWeekNumber,\n} from '../../utils'\nimport { CurrentTimeIndicator } from '../CurrentTimeIndicator'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n moveEventToAllDay,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { useSlotDropTarget } from '../use-slot-drop-target'\nimport { getWeekLabel } from './get-week-label/get-week-label'\nimport { getWeekViewEvents } from './get-week-view-events/get-week-view-events'\nimport type { WeekViewEmits, WeekViewSlots } from './WeekView.types'\nimport classes from './WeekView.module.css'\n\ndefineOptions({\n name: 'WeekView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<WeekViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n slotLabelFormat: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n slotHeight: undefined,\n businessHours: undefined,\n canDragEvent: undefined,\n startScrollTime: undefined,\n canResizeEvent: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n dayFormat: undefined,\n withWeekNumber: undefined,\n withWeekNumbers: undefined,\n withAllDaySlots: undefined,\n withAllDaySlot: undefined,\n allDaySlotHeight: undefined,\n allDaySlotsHeight: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n weekLabelFormat: undefined,\n renderWeekLabel: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<WeekViewSlots>()\n\nconst emit = defineEmits<WeekViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('WeekView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'WeekView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'weekView',\n})\n\n/**\n * Cached per selector: a week renders one slot per day and interval, and rebuilding the same\n * class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst weekRoot = ref<HTMLElement | null>(null)\nconst setWeekRoot = (node: Element | null) => {\n weekRoot.value = node instanceof HTMLElement ? node : null\n}\n\nconst daySlotsContainers = new Map<string, HTMLElement>()\n\nconst slotDropTarget = useSlotDropTarget()\n\nconst isStatic = computed(() => props.mode === 'static')\n\n/** The plural names are the deprecated aliases; the canonical prop wins when both are set. */\nconst withWeekNumber = computed(() => props.withWeekNumbers ?? props.withWeekNumber)\nconst withAllDaySlots = computed(() => props.withAllDaySlot ?? props.withAllDaySlots)\n\nconst days = computed(() =>\n getWeekDays({\n week: props.date,\n firstDayOfWeek: props.firstDayOfWeek,\n withWeekendDays: props.withWeekendDays,\n weekendDays: props.weekendDays,\n }),\n)\n\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? dayjs()))\n\nconst currentWeekdayIndex = computed(() => {\n if (!props.withCurrentTimeIndicator) {\n return -1\n }\n\n return props.forceCurrentTimeIndicator\n ? days.value.findIndex((date) => dayjs(date).day() === now.value.day())\n : days.value.findIndex((date) => dayjs(date).isSame(now.value, 'day'))\n})\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n dayjs(days.value[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(days.value.at(-1)).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst grouped = computed(() =>\n getWeekViewEvents({\n date: props.date,\n events: expandedEvents.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n firstDayOfWeek: props.firstDayOfWeek,\n weekendDays: props.weekendDays,\n withWeekendDays: props.withWeekendDays,\n }),\n)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst weekLabel = computed(() =>\n getWeekLabel({\n weekdays: days.value,\n locale: props.locale || 'en',\n weekLabelFormat: props.weekLabelFormat!,\n renderWeekLabel: slots.weekLabel\n ? (payload) => slots.weekLabel!(payload)\n : props.renderWeekLabel,\n }),\n)\n\nconst rootVars = computed(() => ({\n '--number-of-days': String(days.value.length),\n '--indicator-offset-index':\n currentWeekdayIndex.value === -1 ? undefined : String(currentWeekdayIndex.value + 1),\n}))\n\n/**\n * Everything the template needs per day column.\n *\n * `days` holds `YYYY-MM-DD 00:00:00` strings, so the grid used to re-derive the day key, the\n * weekend flag and both labels for each of the hundreds of slots it renders. Doing it once per\n * day instead is what keeps a drag re-render cheap.\n */\nconst dayColumns = computed(() =>\n days.value.map((date) => {\n const day = dayjs(date)\n\n return {\n date,\n key: day.format('YYYY-MM-DD') as DateStringValue,\n isWeekend: props.weekendDays!.includes(day.day() as DayOfWeek),\n isToday: day.isSame(now.value, 'day'),\n weekdayLabel: formatDate({\n date,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n }),\n dayLabel: formatDate({ date, locale: props.locale || 'en', format: props.dayFormat! }),\n }\n }),\n)\n\nconst slotLabels = computed(() =>\n intervals.value.map((slot) =>\n formatDate({\n date: `${dayColumns.value[0]?.key} ${slot.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n }),\n ),\n)\n\nconst businessHoursMods = computed(() =>\n days.value.map((date) =>\n intervals.value.map((slot) =>\n getBusinessHoursMod({\n time: slot.startTime,\n businessHours: props.businessHours || ['09:00:00', '17:00:00'],\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayjs(date).day() as DayOfWeek,\n }),\n ),\n ),\n)\n\nconst eventResize = useEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex, group) => {\n const slotDate = dayjs(group).format('YYYY-MM-DD')\n const startSlot = intervals.value[startIndex]\n const endSlot = intervals.value[endIndex]\n\n if (startSlot && endSlot) {\n emit(\n 'slotDragEnd',\n `${slotDate} ${startSlot.startTime}` as DateTimeStringValue,\n `${slotDate} ${endSlot.endTime}` as DateTimeStringValue,\n )\n }\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n const target = weekRoot.value?.querySelector<HTMLElement>(\n `[data-week-day-index=\"0\"][data-time-slot-index=\"${targetIndex}\"]`,\n )\n\n scrollSlotIntoView(target)\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = slotDropTarget.dropTarget.value\n return target\n ? {\n date: target.date,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n slotDropTarget.reset()\n emit('eventDragEnd')\n },\n})\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst setDaySlotsContainer = (date: string) => (element: unknown) => {\n if (element instanceof HTMLElement) {\n daySlotsContainers.set(date, element)\n } else {\n daySlotsContainers.delete(date)\n }\n}\n\nconst focusWeekControl = (nativeEvent: KeyboardEvent, selector: string) => {\n const control = weekRoot.value?.querySelector<HTMLButtonElement>(selector)\n\n if (!control || control.disabled) {\n return\n }\n\n nativeEvent.preventDefault()\n control.focus()\n}\n\nconst handleDayLabelKeydown = (nativeEvent: KeyboardEvent, dayIndex: number) => {\n const next =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : -1\n\n if (next >= 0 && next < days.value.length) {\n focusWeekControl(nativeEvent, `[data-weekday-index=\"${next}\"]`)\n }\n}\n\nconst handleAllDaySlotKeydown = (nativeEvent: KeyboardEvent, dayIndex: number) => {\n if (nativeEvent.key === 'ArrowDown') {\n focusWeekControl(nativeEvent, `[data-week-day-index=\"${dayIndex}\"][data-time-slot-index=\"0\"]`)\n return\n }\n\n const next =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : -1\n\n if (next >= 0 && next < days.value.length) {\n focusWeekControl(nativeEvent, `[data-all-day-index=\"${next}\"]`)\n }\n}\n\nconst handleTimeSlotKeydown = (nativeEvent: KeyboardEvent, dayIndex: number, slotIndex: number) => {\n if (nativeEvent.key === 'ArrowUp' && slotIndex === 0 && withAllDaySlots.value) {\n focusWeekControl(nativeEvent, `[data-all-day-index=\"${dayIndex}\"]`)\n return\n }\n\n const nextDay =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : dayIndex\n const nextSlot =\n nativeEvent.key === 'ArrowDown'\n ? slotIndex + 1\n : nativeEvent.key === 'ArrowUp'\n ? slotIndex - 1\n : slotIndex\n\n if (\n nextDay >= 0 &&\n nextDay < days.value.length &&\n nextSlot >= 0 &&\n nextSlot < intervals.value.length &&\n (nextDay !== dayIndex || nextSlot !== slotIndex)\n ) {\n focusWeekControl(\n nativeEvent,\n `[data-week-day-index=\"${nextDay}\"][data-time-slot-index=\"${nextSlot}\"]`,\n )\n }\n}\n\nconst clickDayLabel = (date: string) => {\n emit('viewChange', 'day')\n emit('dateChange', date as DateStringValue)\n}\n\nconst clickTimeSlot = (date: string, slotIndex: number, nativeEvent: MouseEvent) => {\n const datePart = dayjs(date).format('YYYY-MM-DD')\n const slot = intervals.value[slotIndex]\n\n emit('timeSlotClick', {\n slotStart: `${datePart} ${slot.startTime}` as DateTimeStringValue,\n slotEnd: `${datePart} ${slot.endTime}` as DateTimeStringValue,\n nativeEvent,\n })\n}\n\nconst emitDrop = (nativeEvent: DragEvent, target: DateTimeStringValue) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventTo(event, target))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, target)\n }\n}\n\nconst emitAllDayDrop = (nativeEvent: DragEvent, date: string) => {\n nativeEvent.preventDefault()\n const dayKey = dayjs(date).format('YYYY-MM-DD')\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventToAllDay(event, dayKey))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, `${dayKey} 00:00:00` as DateTimeStringValue)\n }\n}\n\nconst dropInput = (date: string) => ({\n container: daySlotsContainers.get(date),\n date: dayjs(date).format('YYYY-MM-DD') as DateStringValue,\n intervals: intervals.value,\n})\n\nconst handleDayDragOver = (nativeEvent: DragEvent, date: string) =>\n slotDropTarget.dragOver(nativeEvent, dropInput(date))\n\nconst handleDayDragLeave = (nativeEvent: DragEvent, date: string) =>\n slotDropTarget.dragLeave(nativeEvent, daySlotsContainers.get(date))\n\nconst handleDayDrop = (nativeEvent: DragEvent, date: string) => {\n const target = slotDropTarget.drop(nativeEvent, dropInput(date))\n\n if (target) {\n emitDrop(nativeEvent, target.target)\n }\n}\n\nconst allDayEventStyle = (position: { offset: number; width: number; row: number }) => ({\n position: 'absolute' as const,\n insetInlineStart: `${position.offset}%`,\n width: `${position.width}%`,\n top: `${position.row * ALL_DAY_ROW_HEIGHT}px`,\n})\n\nconst backgroundEventStyle = (position: { top: number; height: number }) => ({\n top: `${position.top}%`,\n bottom: `${100 - position.top - position.height}%`,\n minHeight: '1px',\n width: '100%',\n})\n\nconst regularEventStyle = (event: ScheduleEventData & { position: any }) => {\n const resizePosition = eventResize.getResizePosition(event.id)\n const top = resizePosition?.top ?? event.position.top\n const height = resizePosition?.height ?? event.position.height\n\n return {\n position: 'absolute' as const,\n top: `${top}%`,\n bottom: `${100 - top - height}%`,\n minHeight: '1px',\n width: `${event.position.width}%`,\n insetInlineStart: `${event.position.offset}%`,\n }\n}\n\nconst startEventResize = (\n event: ScheduleEventData & { position: any },\n date: string,\n edge: 'top' | 'bottom',\n pointerEvent: PointerEvent,\n) => {\n const container = daySlotsContainers.get(date)\n\n if (!container) {\n return\n }\n\n eventResize.handleResizeStart({\n event,\n edge,\n container,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent,\n })\n}\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickResizableEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!eventResize.wasResizing()) {\n clickEvent(event, nativeEvent)\n }\n}\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('weekView') }\"\n :mod=\"[{ static: isStatic, 'slot-dragging': slotDragSelect.isDragging() }, (attrs as any).mod]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"week\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'week')\"\n :control=\"{ title: weekLabel }\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"emit('dateChange', $event)\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <Box\n :root-ref=\"setWeekRoot\"\n v-bind=\"getStyles('weekViewRoot', { style: rootVars })\"\n :mod=\"{ 'with-weekends': props.withWeekendDays }\"\n >\n <ScrollArea.Autosize\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('weekViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div v-bind=\"getStyles('weekViewHeader')\">\n <div v-bind=\"getStyles('weekViewCorner')\">\n <template v-if=\"withWeekNumber\">\n <div v-bind=\"getStyles('weekViewWeekLabel')\">\n {{ getLabel('week', props.labels) }}\n </div>\n <div v-bind=\"getStyles('weekViewWeekNumber')\">{{ getWeekNumber(days) }}</div>\n </template>\n </div>\n\n <UnstyledButton\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDayLabel')\"\n :data-weekday-index=\"dayIndex\"\n :data-weekend=\"column.isWeekend || undefined\"\n :aria-label=\"`${getLabel('weekday', props.labels)} ${column.key}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleDayLabelKeydown($event, dayIndex)\"\n @click=\"isStatic ? undefined : clickDayLabel(column.date)\"\n >\n <span v-bind=\"staticStyles('weekViewDayWeekday')\">{{ column.weekdayLabel }}</span>\n <span\n v-bind=\"staticStyles('weekViewDayNumber')\"\n :data-today=\"column.isToday || undefined\"\n >\n {{ column.dayLabel }}\n </span>\n </UnstyledButton>\n </div>\n\n <div v-if=\"withAllDaySlots\" v-bind=\"getStyles('weekViewAllDaySlots')\">\n <div v-bind=\"getStyles('weekViewAllDaySlotsLabel')\">\n {{ getLabel('allDay', props.labels) }}\n </div>\n\n <div v-bind=\"getStyles('weekViewAllDaySlotsList')\">\n <div v-bind=\"getStyles('weekViewAllDaySlotsEvents')\">\n <ScheduleEvent\n v-for=\"event in grouped.allDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n nowrap\n :hanging=\"event.position.hanging\"\n :mode=\"props.mode\"\n :style=\"allDayEventStyle(event.position)\"\n :draggable=\"isDraggableEvent(event)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(event, $event)\"\n />\n </div>\n\n <UnstyledButton\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDaySlot')\"\n :disabled=\"isStatic\"\n :data-all-day-index=\"dayIndex\"\n :aria-label=\"`${getLabel('allDay', props.labels)} ${column.key}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleAllDaySlotKeydown($event, dayIndex)\"\n @click=\"emit('allDaySlotClick', column.date, $event)\"\n @dragover.prevent\n @drop=\"emitAllDayDrop($event, column.date)\"\n />\n </div>\n </div>\n\n <Box v-bind=\"getStyles('weekViewInner')\">\n <div v-bind=\"getStyles('weekViewSlotLabels')\">\n <div\n v-for=\"(label, slotIndex) in slotLabels\"\n :key=\"slotIndex\"\n v-bind=\"staticStyles('weekViewSlotLabel')\"\n >\n {{ label }}\n </div>\n </div>\n\n <CurrentTimeIndicator\n v-if=\"props.withCurrentTimeIndicator && currentWeekdayIndex !== -1\"\n start-offset=\"calc(100% - (100% / var(--number-of-days)) * (var(--number-of-days) - var(--indicator-offset-index) + 1) + ((var(--number-of-days) - var(--indicator-offset-index) + 1) * var(--indicator-labels-offset)))\"\n end-offset=\"calc((100% / var(--number-of-days)) * (var(--number-of-days) - var(--indicator-offset-index)) - (var(--number-of-days) - var(--indicator-offset-index)) * var(--indicator-labels-offset))\"\n time-bubble-start-offset=\"calc(var(--week-view-slots-label-width) - var(--time-bubble-width))\"\n :current-time-format=\"props.slotLabelFormat\"\n :with-time-bubble=\"props.withCurrentTimeBubble\"\n :with-thumb=\"props.withCurrentTimeBubble ? currentWeekdayIndex !== 0 : true\"\n :locale=\"props.locale\"\n :start-time=\"props.startTime\"\n :end-time=\"props.endTime\"\n :interval-minutes=\"props.intervalMinutes\"\n :get-current-time=\"props.getCurrentTime\"\n v-bind=\"stylesApi\"\n />\n\n <div\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n v-bind=\"staticStyles('weekViewDay')\"\n >\n <div\n :ref=\"setDaySlotsContainer(column.date)\"\n v-bind=\"staticStyles('weekViewDaySlots')\"\n @dragover=\"withDragHandlers ? handleDayDragOver($event, column.date) : undefined\"\n @dragleave=\"withDragHandlers ? handleDayDragLeave($event, column.date) : undefined\"\n @drop=\"withDragHandlers ? handleDayDrop($event, column.date) : undefined\"\n >\n <UnstyledButton\n v-for=\"(slot, slotIndex) in intervals\"\n :key=\"slot.startTime\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDaySlot')\"\n :data-week-day-index=\"dayIndex\"\n :data-time-slot-index=\"slotIndex\"\n :data-drag-slot-index=\"withSlotSelect ? slotIndex : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? column.key : undefined\"\n :data-drop-target=\"slotDropTarget.isTarget(column.key, slotIndex) || undefined\"\n :data-drag-selected=\"\n slotDragSelect.isSlotSelected(slotIndex, column.key) || undefined\n \"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n :disabled=\"isStatic\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${column.key} ${slot.startTime} - ${slot.endTime}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 && slotIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleTimeSlotKeydown($event, dayIndex, slotIndex)\"\n @click=\"clickTimeSlot(column.date, slotIndex, $event)\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown($event, slotIndex, column.key)\n : undefined\n \"\n @dragover.prevent\n />\n\n <div\n v-for=\"event in grouped.backgroundEvents[column.date] || []\"\n :key=\"`background-${event.id}`\"\n v-bind=\"staticStyles('weekViewBackgroundEvent')\"\n :style=\"backgroundEventStyle(event.position)\"\n />\n\n <ScheduleEvent\n v-for=\"event in grouped.regularEvents[column.date] || []\"\n :key=\"`${event.id}-${column.date}`\"\n :event=\"event\"\n auto-size\n :mode=\"props.mode\"\n :style=\"regularEventStyle(event)\"\n :draggable=\"isDraggableEvent(event)\"\n :with-resize=\"eventResize.isResizableEvent(event)\"\n :is-resizing=\"eventResize.getResizePosition(event.id) !== null\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickResizableEvent(event, $event)\"\n @resize-start=\"\n (edge, pointerEvent) => startEventResize(event, column.date, edge, pointerEvent)\n \"\n />\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { WeekViewOwnProps } from './WeekView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeIndicator: true,\n withCurrentTimeBubble: true,\n slotHeight: 64,\n firstDayOfWeek: 1,\n weekdayFormat: 'ddd',\n dayFormat: 'D',\n withWeekNumber: true,\n withAllDaySlots: true,\n allDaySlotHeight: 44,\n weekendDays: [0, 6],\n withWeekendDays: true,\n weekLabelFormat: 'MMM D',\n} satisfies Partial<WeekViewOwnProps>\n\n/** Vertical step between stacked all-day event rows, in px. */\nconst ALL_DAY_ROW_HEIGHT = 22\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotHeight, allDaySlotHeight, allDaySlotsHeight }) => ({\n weekView: {\n '--week-view-radius': resolveScheduleRadius(radius),\n '--week-view-slot-height': cssSize(slotHeight),\n '--week-view-all-day-slots-height': cssSize(allDaySlotsHeight ?? allDaySlotHeight),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, ALL_DAY_ROW_HEIGHT }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useEventResize } from '../../hooks/use-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n} from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getDayTimeIntervals,\n getWeekDays,\n getWeekNumber,\n} from '../../utils'\nimport { CurrentTimeIndicator } from '../CurrentTimeIndicator'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n moveEventToAllDay,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { useSlotDropTarget } from '../use-slot-drop-target'\nimport { getWeekLabel } from './get-week-label/get-week-label'\nimport { getWeekViewEvents } from './get-week-view-events/get-week-view-events'\nimport type { WeekViewEmits, WeekViewSlots } from './WeekView.types'\nimport classes from './WeekView.module.css'\n\ndefineOptions({\n name: 'WeekView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<WeekViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n slotLabelFormat: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n slotHeight: undefined,\n businessHours: undefined,\n canDragEvent: undefined,\n startScrollTime: undefined,\n canResizeEvent: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n dayFormat: undefined,\n withWeekNumber: undefined,\n withWeekNumbers: undefined,\n withAllDaySlots: undefined,\n withAllDaySlot: undefined,\n allDaySlotHeight: undefined,\n allDaySlotsHeight: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n weekLabelFormat: undefined,\n renderWeekLabel: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<WeekViewSlots>()\n\nconst emit = defineEmits<WeekViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('WeekView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'WeekView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'weekView',\n})\n\n/**\n * Cached per selector: a week renders one slot per day and interval, and rebuilding the same\n * class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst weekRoot = ref<HTMLElement | null>(null)\nconst setWeekRoot = (node: Element | null) => {\n weekRoot.value = node instanceof HTMLElement ? node : null\n}\n\nconst daySlotsContainers = new Map<string, HTMLElement>()\n\nconst slotDropTarget = useSlotDropTarget()\n\nconst isStatic = computed(() => props.mode === 'static')\n\n/** The plural names are the deprecated aliases; the canonical prop wins when both are set. */\nconst withWeekNumber = computed(() => props.withWeekNumbers ?? props.withWeekNumber)\nconst withAllDaySlots = computed(() => props.withAllDaySlot ?? props.withAllDaySlots)\n\nconst days = computed(() =>\n getWeekDays({\n week: props.date,\n firstDayOfWeek: props.firstDayOfWeek,\n withWeekendDays: props.withWeekendDays,\n weekendDays: props.weekendDays,\n }),\n)\n\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? dayjs()))\n\nconst currentWeekdayIndex = computed(() => {\n if (!props.withCurrentTimeIndicator) {\n return -1\n }\n\n return props.forceCurrentTimeIndicator\n ? days.value.findIndex((date) => dayjs(date).day() === now.value.day())\n : days.value.findIndex((date) => dayjs(date).isSame(now.value, 'day'))\n})\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n dayjs(days.value[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(days.value.at(-1)).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst grouped = computed(() =>\n getWeekViewEvents({\n date: props.date,\n events: expandedEvents.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n firstDayOfWeek: props.firstDayOfWeek,\n weekendDays: props.weekendDays,\n withWeekendDays: props.withWeekendDays,\n }),\n)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst weekLabel = computed(() =>\n getWeekLabel({\n weekdays: days.value,\n locale: props.locale || 'en',\n weekLabelFormat: props.weekLabelFormat!,\n renderWeekLabel: slots.weekLabel\n ? (payload) => slots.weekLabel!(payload)\n : props.renderWeekLabel,\n }),\n)\n\nconst rootVars = computed(() => ({\n '--number-of-days': String(days.value.length),\n '--indicator-offset-index':\n currentWeekdayIndex.value === -1 ? undefined : String(currentWeekdayIndex.value + 1),\n}))\n\n/**\n * Everything the template needs per day column.\n *\n * `days` holds `YYYY-MM-DD 00:00:00` strings, so the grid used to re-derive the day key, the\n * weekend flag and both labels for each of the hundreds of slots it renders. Doing it once per\n * day instead is what keeps a drag re-render cheap.\n */\nconst dayColumns = computed(() =>\n days.value.map((date) => {\n const day = dayjs(date)\n\n return {\n date,\n key: day.format('YYYY-MM-DD') as DateStringValue,\n isWeekend: props.weekendDays!.includes(day.day() as DayOfWeek),\n isToday: day.isSame(now.value, 'day'),\n weekdayLabel: formatDate({\n date,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n }),\n dayLabel: formatDate({ date, locale: props.locale || 'en', format: props.dayFormat! }),\n }\n }),\n)\n\nconst slotLabels = computed(() =>\n intervals.value.map((slot) =>\n formatDate({\n date: `${dayColumns.value[0]?.key} ${slot.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n }),\n ),\n)\n\nconst businessHoursMods = computed(() =>\n days.value.map((date) =>\n intervals.value.map((slot) =>\n getBusinessHoursMod({\n time: slot.startTime,\n businessHours: props.businessHours || ['09:00:00', '17:00:00'],\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayjs(date).day() as DayOfWeek,\n }),\n ),\n ),\n)\n\nconst eventResize = useEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex, group) => {\n const slotDate = dayjs(group).format('YYYY-MM-DD')\n const startSlot = intervals.value[startIndex]\n const endSlot = intervals.value[endIndex]\n\n if (startSlot && endSlot) {\n emit(\n 'slotDragEnd',\n `${slotDate} ${startSlot.startTime}` as DateTimeStringValue,\n `${slotDate} ${endSlot.endTime}` as DateTimeStringValue,\n )\n }\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n const target = weekRoot.value?.querySelector<HTMLElement>(\n `[data-week-day-index=\"0\"][data-time-slot-index=\"${targetIndex}\"]`,\n )\n\n scrollSlotIntoView(target)\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = slotDropTarget.dropTarget.value\n return target\n ? {\n date: target.date,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n slotDropTarget.reset()\n emit('eventDragEnd')\n },\n})\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst setDaySlotsContainer = (date: string) => (element: unknown) => {\n if (element instanceof HTMLElement) {\n daySlotsContainers.set(date, element)\n } else {\n daySlotsContainers.delete(date)\n }\n}\n\nconst focusWeekControl = (nativeEvent: KeyboardEvent, selector: string) => {\n const control = weekRoot.value?.querySelector<HTMLButtonElement>(selector)\n\n if (!control || control.disabled) {\n return\n }\n\n nativeEvent.preventDefault()\n control.focus()\n}\n\nconst handleDayLabelKeydown = (nativeEvent: KeyboardEvent, dayIndex: number) => {\n const next =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : -1\n\n if (next >= 0 && next < days.value.length) {\n focusWeekControl(nativeEvent, `[data-weekday-index=\"${next}\"]`)\n }\n}\n\nconst handleAllDaySlotKeydown = (nativeEvent: KeyboardEvent, dayIndex: number) => {\n if (nativeEvent.key === 'ArrowDown') {\n focusWeekControl(nativeEvent, `[data-week-day-index=\"${dayIndex}\"][data-time-slot-index=\"0\"]`)\n return\n }\n\n const next =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : -1\n\n if (next >= 0 && next < days.value.length) {\n focusWeekControl(nativeEvent, `[data-all-day-index=\"${next}\"]`)\n }\n}\n\nconst handleTimeSlotKeydown = (nativeEvent: KeyboardEvent, dayIndex: number, slotIndex: number) => {\n if (nativeEvent.key === 'ArrowUp' && slotIndex === 0 && withAllDaySlots.value) {\n focusWeekControl(nativeEvent, `[data-all-day-index=\"${dayIndex}\"]`)\n return\n }\n\n const nextDay =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : dayIndex\n const nextSlot =\n nativeEvent.key === 'ArrowDown'\n ? slotIndex + 1\n : nativeEvent.key === 'ArrowUp'\n ? slotIndex - 1\n : slotIndex\n\n if (\n nextDay >= 0 &&\n nextDay < days.value.length &&\n nextSlot >= 0 &&\n nextSlot < intervals.value.length &&\n (nextDay !== dayIndex || nextSlot !== slotIndex)\n ) {\n focusWeekControl(\n nativeEvent,\n `[data-week-day-index=\"${nextDay}\"][data-time-slot-index=\"${nextSlot}\"]`,\n )\n }\n}\n\nconst clickDayLabel = (date: string) => {\n emit('viewChange', 'day')\n emit('dateChange', date as DateStringValue)\n}\n\nconst clickTimeSlot = (date: string, slotIndex: number, nativeEvent: MouseEvent) => {\n const datePart = dayjs(date).format('YYYY-MM-DD')\n const slot = intervals.value[slotIndex]\n\n emit('timeSlotClick', {\n slotStart: `${datePart} ${slot.startTime}` as DateTimeStringValue,\n slotEnd: `${datePart} ${slot.endTime}` as DateTimeStringValue,\n nativeEvent,\n })\n}\n\nconst emitDrop = (nativeEvent: DragEvent, target: DateTimeStringValue) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventTo(event, target))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, target)\n }\n}\n\nconst emitAllDayDrop = (nativeEvent: DragEvent, date: string) => {\n nativeEvent.preventDefault()\n const dayKey = dayjs(date).format('YYYY-MM-DD')\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventToAllDay(event, dayKey))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, `${dayKey} 00:00:00` as DateTimeStringValue)\n }\n}\n\nconst dropInput = (date: string) => ({\n container: daySlotsContainers.get(date),\n date: dayjs(date).format('YYYY-MM-DD') as DateStringValue,\n intervals: intervals.value,\n})\n\nconst handleDayDragOver = (nativeEvent: DragEvent, date: string) =>\n slotDropTarget.dragOver(nativeEvent, dropInput(date))\n\nconst handleDayDragLeave = (nativeEvent: DragEvent, date: string) =>\n slotDropTarget.dragLeave(nativeEvent, daySlotsContainers.get(date))\n\nconst handleDayDrop = (nativeEvent: DragEvent, date: string) => {\n const target = slotDropTarget.drop(nativeEvent, dropInput(date))\n\n if (target) {\n emitDrop(nativeEvent, target.target)\n }\n}\n\nconst allDayEventStyle = (position: { offset: number; width: number; row: number }) => ({\n position: 'absolute' as const,\n insetInlineStart: `${position.offset}%`,\n width: `${position.width}%`,\n top: `${position.row * ALL_DAY_ROW_HEIGHT}px`,\n})\n\nconst backgroundEventStyle = (position: { top: number; height: number }) => ({\n top: `${position.top}%`,\n bottom: `${100 - position.top - position.height}%`,\n minHeight: '1px',\n width: '100%',\n})\n\nconst regularEventStyle = (event: ScheduleEventData & { position: any }) => {\n const resizePosition = eventResize.getResizePosition(event.id)\n const top = resizePosition?.top ?? event.position.top\n const height = resizePosition?.height ?? event.position.height\n\n return {\n position: 'absolute' as const,\n top: `${top}%`,\n bottom: `${100 - top - height}%`,\n minHeight: '1px',\n width: `${event.position.width}%`,\n insetInlineStart: `${event.position.offset}%`,\n }\n}\n\nconst startEventResize = (\n event: ScheduleEventData & { position: any },\n date: string,\n edge: 'top' | 'bottom',\n pointerEvent: PointerEvent,\n) => {\n const container = daySlotsContainers.get(date)\n\n if (!container) {\n return\n }\n\n eventResize.handleResizeStart({\n event,\n edge,\n container,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent,\n })\n}\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickResizableEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!eventResize.wasResizing()) {\n clickEvent(event, nativeEvent)\n }\n}\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('weekView') }\"\n :mod=\"[{ static: isStatic, 'slot-dragging': slotDragSelect.isDragging() }, (attrs as any).mod]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"week\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'week')\"\n :control=\"{ title: weekLabel }\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"emit('dateChange', $event)\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <Box\n :root-ref=\"setWeekRoot\"\n v-bind=\"getStyles('weekViewRoot', { style: rootVars })\"\n :mod=\"{ 'with-weekends': props.withWeekendDays }\"\n >\n <ScrollArea.Autosize\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('weekViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div v-bind=\"getStyles('weekViewHeader')\">\n <div v-bind=\"getStyles('weekViewCorner')\">\n <template v-if=\"withWeekNumber\">\n <div v-bind=\"getStyles('weekViewWeekLabel')\">\n {{ getLabel('week', props.labels) }}\n </div>\n <div v-bind=\"getStyles('weekViewWeekNumber')\">{{ getWeekNumber(days) }}</div>\n </template>\n </div>\n\n <UnstyledButton\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDayLabel')\"\n :data-weekday-index=\"dayIndex\"\n :data-weekend=\"column.isWeekend || undefined\"\n :aria-label=\"`${getLabel('weekday', props.labels)} ${column.key}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleDayLabelKeydown($event, dayIndex)\"\n @click=\"isStatic ? undefined : clickDayLabel(column.date)\"\n >\n <span v-bind=\"staticStyles('weekViewDayWeekday')\">{{ column.weekdayLabel }}</span>\n <span\n v-bind=\"staticStyles('weekViewDayNumber')\"\n :data-today=\"column.isToday || undefined\"\n >\n {{ column.dayLabel }}\n </span>\n </UnstyledButton>\n </div>\n\n <div v-if=\"withAllDaySlots\" v-bind=\"getStyles('weekViewAllDaySlots')\">\n <div v-bind=\"getStyles('weekViewAllDaySlotsLabel')\">\n {{ getLabel('allDay', props.labels) }}\n </div>\n\n <div v-bind=\"getStyles('weekViewAllDaySlotsList')\">\n <div v-bind=\"getStyles('weekViewAllDaySlotsEvents')\">\n <ScheduleEvent\n v-for=\"event in grouped.allDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n nowrap\n :hanging=\"event.position.hanging\"\n :mode=\"props.mode\"\n :style=\"allDayEventStyle(event.position)\"\n :draggable=\"isDraggableEvent(event)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(event, $event)\"\n />\n </div>\n\n <UnstyledButton\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDaySlot')\"\n :disabled=\"isStatic\"\n :data-all-day-index=\"dayIndex\"\n :aria-label=\"`${getLabel('allDay', props.labels)} ${column.key}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleAllDaySlotKeydown($event, dayIndex)\"\n @click=\"emit('allDaySlotClick', column.date, $event)\"\n @dragover.prevent\n @drop=\"emitAllDayDrop($event, column.date)\"\n />\n </div>\n </div>\n\n <Box v-bind=\"getStyles('weekViewInner')\">\n <div v-bind=\"getStyles('weekViewSlotLabels')\">\n <div\n v-for=\"(label, slotIndex) in slotLabels\"\n :key=\"slotIndex\"\n v-bind=\"staticStyles('weekViewSlotLabel')\"\n >\n {{ label }}\n </div>\n </div>\n\n <CurrentTimeIndicator\n v-if=\"props.withCurrentTimeIndicator && currentWeekdayIndex !== -1\"\n start-offset=\"calc(100% - (100% / var(--number-of-days)) * (var(--number-of-days) - var(--indicator-offset-index) + 1) + ((var(--number-of-days) - var(--indicator-offset-index) + 1) * var(--indicator-labels-offset)))\"\n end-offset=\"calc((100% / var(--number-of-days)) * (var(--number-of-days) - var(--indicator-offset-index)) - (var(--number-of-days) - var(--indicator-offset-index)) * var(--indicator-labels-offset))\"\n time-bubble-start-offset=\"calc(var(--week-view-slots-label-width) - var(--time-bubble-width))\"\n :current-time-format=\"props.slotLabelFormat\"\n :with-time-bubble=\"props.withCurrentTimeBubble\"\n :with-thumb=\"props.withCurrentTimeBubble ? currentWeekdayIndex !== 0 : true\"\n :locale=\"props.locale\"\n :start-time=\"props.startTime\"\n :end-time=\"props.endTime\"\n :interval-minutes=\"props.intervalMinutes\"\n :get-current-time=\"props.getCurrentTime\"\n v-bind=\"stylesApi\"\n />\n\n <div\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n v-bind=\"staticStyles('weekViewDay')\"\n >\n <div\n :ref=\"setDaySlotsContainer(column.date)\"\n v-bind=\"staticStyles('weekViewDaySlots')\"\n @dragover=\"withDragHandlers ? handleDayDragOver($event, column.date) : undefined\"\n @dragleave=\"withDragHandlers ? handleDayDragLeave($event, column.date) : undefined\"\n @drop=\"withDragHandlers ? handleDayDrop($event, column.date) : undefined\"\n >\n <UnstyledButton\n v-for=\"(slot, slotIndex) in intervals\"\n :key=\"slot.startTime\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDaySlot')\"\n :data-week-day-index=\"dayIndex\"\n :data-time-slot-index=\"slotIndex\"\n :data-drag-slot-index=\"withSlotSelect ? slotIndex : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? column.key : undefined\"\n :data-drop-target=\"slotDropTarget.isTarget(column.key, slotIndex) || undefined\"\n :data-drag-selected=\"\n slotDragSelect.isSlotSelected(slotIndex, column.key) || undefined\n \"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n :disabled=\"isStatic\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${column.key} ${slot.startTime} - ${slot.endTime}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 && slotIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleTimeSlotKeydown($event, dayIndex, slotIndex)\"\n @click=\"clickTimeSlot(column.date, slotIndex, $event)\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown($event, slotIndex, column.key)\n : undefined\n \"\n @dragover.prevent\n />\n\n <div\n v-for=\"event in grouped.backgroundEvents[column.date] || []\"\n :key=\"`background-${event.id}`\"\n v-bind=\"staticStyles('weekViewBackgroundEvent')\"\n :style=\"backgroundEventStyle(event.position)\"\n />\n\n <ScheduleEvent\n v-for=\"event in grouped.regularEvents[column.date] || []\"\n :key=\"`${event.id}-${column.date}`\"\n :event=\"event\"\n auto-size\n :mode=\"props.mode\"\n :style=\"regularEventStyle(event)\"\n :draggable=\"isDraggableEvent(event)\"\n :with-resize=\"eventResize.isResizableEvent(event)\"\n :is-resizing=\"eventResize.getResizePosition(event.id) !== null\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickResizableEvent(event, $event)\"\n @resize-start=\"\n (edge, pointerEvent) => startEventResize(event, column.date, edge, pointerEvent)\n \"\n />\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport WeekViewComponent, { varsResolver } from './WeekView.vue'\nimport type { WeekViewFactory } from './WeekView.types'\nimport classes from './WeekView.module.css'\n\nexport const WeekView = factory<WeekViewFactory>(WeekViewComponent, { classes, varsResolver })\n\nexport type {\n WeekLabelPayload,\n WeekViewCssVariables,\n WeekViewEmits,\n WeekViewFactory,\n WeekViewOwnProps,\n WeekViewOwnStylesNames,\n WeekViewProps,\n WeekViewSlots,\n WeekViewStylesNames,\n} from './WeekView.types'\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, ScheduleEventData } from '../../../types'\nimport { isMultidayEvent, validateEvent } from '../../../utils'\n\nexport type GroupedEvents = Record<DateStringValue, ScheduleEventData[]>\n\nfunction groupEventByDate(event: ScheduleEventData, groupedEvents: GroupedEvents) {\n if (isMultidayEvent(event)) {\n const startDate = dayjs(event.start).startOf('day')\n const endDate = dayjs(event.end).startOf('day')\n\n for (\n let date = startDate;\n date.isBefore(endDate) || date.isSame(endDate);\n date = date.add(1, 'day')\n ) {\n const dateKey = date.format('YYYY-MM-DD')\n if (!groupedEvents[dateKey]) {\n groupedEvents[dateKey] = []\n }\n groupedEvents[dateKey].push(event)\n }\n\n return\n }\n\n const eventDate = dayjs(event.start).format('YYYY-MM-DD')\n if (!groupedEvents[eventDate]) {\n groupedEvents[eventDate] = []\n }\n groupedEvents[eventDate].push(event)\n}\n\ninterface GetYearViewEventsInput {\n date: AnyDateValue\n events: ScheduleEventData[] | undefined\n}\n\nexport function getYearViewEvents({ date, events }: GetYearViewEventsInput) {\n const groupedEvents: GroupedEvents = {}\n\n if (events === undefined) {\n return groupedEvents\n }\n\n const ids = new Set<string | number>()\n\n for (const event of events) {\n if (dayjs(event.start).isSame(dayjs(date), 'year')) {\n groupEventByDate(validateEvent(event), groupedEvents)\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(`[@mantine/schedule] YearView: Duplicated event ids found: ${event.id}`)\n }\n }\n }\n\n return groupedEvents\n}\n",".yearView {\n --year-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --year-view-font-size: var(--mantine-font-size-sm);\n container-type: inline-size;\n\n @mixin where-light {\n --year-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --year-view-border-color: var(--mantine-color-dark-4);\n }\n}\n\n.yearViewMonths {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n\n @container (width <= 850px) {\n --year-view-font-size: calc(var(--mantine-font-size-sm) - 2px);\n }\n\n @container (width <= 750px) {\n grid-template-columns: repeat(2, 1fr);\n --year-view-font-size: var(--mantine-font-size-xs);\n }\n\n @container (width <= 520px) {\n --year-view-font-size: calc(var(--mantine-font-size-xs) - 2px);\n }\n\n @container (width <= 420px) {\n grid-template-columns: 1fr;\n --year-view-font-size: var(--mantine-font-size-xs);\n }\n}\n\n.yearViewMonth {\n --week-numbers-offset: 0rem;\n --day-base-color: var(--mantine-color-text);\n --day-dimmed-color: alpha(var(--day-base-color), 0.35);\n\n &:where([data-with-week-numbers]) {\n --week-numbers-offset: 28px;\n }\n\n min-width: 0;\n border: 1px solid var(--year-view-border-color);\n padding: var(--mantine-spacing-md);\n margin-top: -1px;\n margin-inline-start: -1px;\n\n &:where(:nth-child(3n + 1)) {\n margin-inline-start: 0;\n }\n\n &:where(:nth-child(-n + 3)) {\n margin-top: 0;\n }\n\n &:where(:nth-child(1)) {\n border-start-start-radius: var(--year-view-radius);\n }\n\n &:where(:nth-child(3)) {\n border-start-end-radius: var(--year-view-radius);\n }\n\n &:where(:nth-last-child(3)) {\n border-end-start-radius: var(--year-view-radius);\n }\n\n &:where(:nth-last-child(1)) {\n border-end-end-radius: var(--year-view-radius);\n }\n\n @container (width <= 750px) {\n border: 0;\n padding: 8px;\n margin: 0;\n\n &:where([data-with-week-numbers]) {\n --week-numbers-offset: 14px;\n }\n }\n\n @container (width <= 420px) {\n padding: 6px;\n }\n}\n\n.yearViewWeekdays {\n display: flex;\n}\n\n.yearViewWeek {\n display: flex;\n}\n\n.yearViewWeekNumber {\n flex: 0 0 calc(var(--week-numbers-offset) - rem(4px));\n margin-inline-end: rem(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--year-view-font-size);\n border-radius: var(--year-view-radius);\n padding: 4px;\n font-weight: var(--mantine-font-weight-medium);\n cursor: pointer;\n user-select: none;\n color: var(--day-dimmed-color);\n\n @container (width <= 750px) {\n padding: 0;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.yearViewWeekday {\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n height: 36px;\n font-size: var(--year-view-font-size);\n font-weight: var(--mantine-font-weight-medium);\n text-align: center;\n text-transform: capitalize;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n user-select: none;\n color: var(--day-dimmed-color);\n\n @container (width <= 750px) {\n height: auto;\n padding-block: 2px;\n }\n}\n\n.yearViewWeekdaysCorner {\n flex: 0 0 var(--week-numbers-offset);\n}\n\n.yearViewDay {\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n padding: 4px;\n font-size: var(--year-view-font-size);\n color: var(--day-base-color);\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 100%;\n aspect-ratio: 1;\n position: relative;\n\n @container (width <= 750px) {\n padding: 0;\n }\n\n &:where([data-day-placeholder]) {\n background-color: transparent;\n cursor: default;\n pointer-events: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-outside]) {\n color: var(--day-dimmed-color);\n }\n\n @mixin hover {\n &:where(:not([data-today], [data-day-placeholder])) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n\n &:where([data-today]:not([data-outside])) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n\n @mixin hover {\n background-color: var(--mantine-primary-color-filled-hover);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.yearViewMonthCaption {\n padding-inline: var(--mantine-spacing-sm);\n width: 100%;\n padding-block: 4px;\n margin-bottom: 4px;\n font-size: var(--year-view-font-size);\n font-weight: var(--mantine-font-weight-medium);\n text-transform: capitalize;\n border-radius: var(--year-view-radius);\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.yearViewDayIndicators {\n position: absolute;\n bottom: 0;\n inset-inline: 0;\n display: flex;\n justify-content: center;\n padding-inline-start: 2px;\n}\n\n.yearViewDayIndicator {\n width: 8px;\n height: 8px;\n border-radius: 100%;\n margin-inline-start: -2px;\n border: 1px solid var(--mantine-color-body);\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { YearViewOwnProps } from './YearView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n firstDayOfWeek: 1,\n weekdayFormat: 'dd',\n weekendDays: [0, 6],\n withWeekDays: true,\n highlightToday: true,\n withOutsideDays: true,\n monthsListFormat: 'MMMM',\n} satisfies Partial<YearViewOwnProps>\n\nconst COLUMNS = 7\n\nconst MAX_DAY_INDICATORS = 3\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n yearView: {\n '--year-view-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver, COLUMNS, MAX_DAY_INDICATORS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, ref, useAttrs } from 'vue'\nimport { Box, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type { DateStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport {\n formatDate,\n getMonthDays,\n getWeekNumber,\n getWeekdaysNames,\n toDateString,\n} from '../../utils'\nimport { handleGridKeydown } from '../keyboard-navigation'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { getExpandedEvents, useStaticStyles } from '../shared'\nimport { getYearViewEvents } from './get-year-view-events/get-year-view-events'\nimport type { YearViewEmits } from './YearView.types'\nimport classes from './YearView.module.css'\n\ndefineOptions({\n name: 'YearView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<YearViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekDays: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n withOutsideDays: undefined,\n monthsListFormat: undefined,\n getDayProps: undefined,\n getWeekNumberProps: undefined,\n monthYearSelectProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<YearViewEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('YearView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'YearView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'yearView',\n})\n\n/**\n * Cached per selector: a year renders twelve month grids, so the same class list would\n * otherwise be rebuilt for several hundred day cells on every render.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst yearGrid = ref<HTMLElement | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst year = computed(() => dayjs(props.date).startOf('year'))\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n year.value.startOf('year').format('YYYY-MM-DD HH:mm:ss'),\n year.value.endOf('year').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst eventsByDay = computed(() =>\n getYearViewEvents({ date: year.value, events: expandedEvents.value }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\n/**\n * Every month with the grid offset its cells start at, so a single roving tabindex can walk\n * the whole year rather than restarting in each month.\n */\nconst months = computed(() => {\n let offset = 0\n\n return Array.from({ length: 12 }, (_, monthIndex) => {\n const month = year.value.month(monthIndex)\n const weeks = getMonthDays({\n month,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n })\n const entry = { month, monthIndex, weeks, offset }\n offset += weeks.length * COLUMNS\n return entry\n })\n})\n\nconst totalYearGridCells = computed(() =>\n months.value.reduce((total, { weeks }) => total + weeks.length * COLUMNS, 0),\n)\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n yearValue: year.value.year(),\n withMonths: false,\n labelFormat: 'YYYY',\n onYearChange: (value: number) => emit('dateChange', toDateString(year.value.year(value))),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\n\nconst dayProps = (date: string | Date) => props.getDayProps?.(toDateString(date)) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDateString(weekStart)) ?? {}\n\nconst isOutside = (date: string | Date, month: dayjs.Dayjs) => !dayjs(date).isSame(month, 'month')\n\nconst dayEvents = (date: string | Date) =>\n (eventsByDay.value[dayjs(date).format('YYYY-MM-DD')] || []).slice(0, MAX_DAY_INDICATORS)\n\nconst indicatorStyle = (event: ScheduleEventData) => ({\n background: `var(--mantine-color-${event.color}-6, ${event.color})`,\n})\n\nconst handleDayKeydown = (nativeEvent: KeyboardEvent, gridIndex: number) => {\n handleGridKeydown({\n event: nativeEvent,\n index: gridIndex,\n columns: COLUMNS,\n total: totalYearGridCells.value,\n getControl: (index) => {\n const control =\n yearGrid.value?.querySelector<HTMLButtonElement>(`[data-year-grid-index=\"${index}\"]`) ??\n null\n // Days of the neighbouring months are visible but never focusable.\n return control?.hasAttribute('data-outside') ? null : control\n },\n })\n}\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('yearView') }\">\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"year\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'year')\"\n :control=\"headerControl\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <div ref=\"yearGrid\" v-bind=\"getStyles('yearViewMonths')\">\n <section\n v-for=\"{ month, weeks, offset } in months\"\n :key=\"month.month()\"\n v-bind=\"getStyles('yearViewMonth')\"\n :data-with-week-numbers=\"props.withWeekNumbers || undefined\"\n >\n <UnstyledButton\n type=\"button\"\n v-bind=\"getStyles('yearViewMonthCaption')\"\n @click=\"emit('monthClick', toDateString(month))\"\n >\n {{\n formatDate({\n date: month,\n locale: props.locale || 'en',\n format: props.monthsListFormat!,\n })\n }}\n </UnstyledButton>\n\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('yearViewWeekdays')\">\n <span v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('yearViewWeekdaysCorner')\" />\n <span\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"staticStyles('yearViewWeekday')\"\n >\n {{ weekday }}\n </span>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"staticStyles('yearViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n type=\"button\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('yearViewWeekNumber', { className: weekNumberProps(week[0]).class }),\n }\"\n @click=\"emit('weekNumberClick', toDateString(week[0]), $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <template v-for=\"(date, dayIndex) in week\" :key=\"toDateString(date)\">\n <div\n v-if=\"isOutside(date, month) && !props.withOutsideDays\"\n v-bind=\"staticStyles('yearViewDay')\"\n data-day-placeholder\n />\n <UnstyledButton\n v-else\n type=\"button\"\n v-bind=\"{\n ...dayProps(date),\n ...getStyles('yearViewDay', { className: dayProps(date).class }),\n }\"\n :disabled=\"isStatic\"\n :data-year-grid-index=\"offset + weekIndex * COLUMNS + dayIndex\"\n :data-outside=\"isOutside(date, month) || undefined\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(date).day() as DayOfWeek) || undefined\n \"\n :data-today=\"\n (props.highlightToday && dayjs(date).isSame(dayjs(), 'day')) || undefined\n \"\n :aria-label=\"\n formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\n \"\n :tabindex=\"\n isStatic || isOutside(date, month) ? -1 : dayjs(date).date() === 1 ? 0 : -1\n \"\n @keydown=\"\n isStatic\n ? undefined\n : handleDayKeydown($event, offset + weekIndex * COLUMNS + dayIndex)\n \"\n @click=\"emit('dayClick', toDateString(date), $event)\"\n >\n {{ dayjs(date).date() }}\n <span v-if=\"dayEvents(date).length\" v-bind=\"getStyles('yearViewDayIndicators')\">\n <span\n v-for=\"event in dayEvents(date)\"\n :key=\"event.id\"\n v-bind=\"getStyles('yearViewDayIndicator')\"\n :style=\"indicatorStyle(event)\"\n />\n </span>\n </UnstyledButton>\n </template>\n </div>\n </section>\n </div>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { YearViewOwnProps } from './YearView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n firstDayOfWeek: 1,\n weekdayFormat: 'dd',\n weekendDays: [0, 6],\n withWeekDays: true,\n highlightToday: true,\n withOutsideDays: true,\n monthsListFormat: 'MMMM',\n} satisfies Partial<YearViewOwnProps>\n\nconst COLUMNS = 7\n\nconst MAX_DAY_INDICATORS = 3\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n yearView: {\n '--year-view-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver, COLUMNS, MAX_DAY_INDICATORS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, ref, useAttrs } from 'vue'\nimport { Box, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type { DateStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport {\n formatDate,\n getMonthDays,\n getWeekNumber,\n getWeekdaysNames,\n toDateString,\n} from '../../utils'\nimport { handleGridKeydown } from '../keyboard-navigation'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { getExpandedEvents, useStaticStyles } from '../shared'\nimport { getYearViewEvents } from './get-year-view-events/get-year-view-events'\nimport type { YearViewEmits } from './YearView.types'\nimport classes from './YearView.module.css'\n\ndefineOptions({\n name: 'YearView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<YearViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekDays: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n withOutsideDays: undefined,\n monthsListFormat: undefined,\n getDayProps: undefined,\n getWeekNumberProps: undefined,\n monthYearSelectProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<YearViewEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('YearView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'YearView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'yearView',\n})\n\n/**\n * Cached per selector: a year renders twelve month grids, so the same class list would\n * otherwise be rebuilt for several hundred day cells on every render.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst yearGrid = ref<HTMLElement | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst year = computed(() => dayjs(props.date).startOf('year'))\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n year.value.startOf('year').format('YYYY-MM-DD HH:mm:ss'),\n year.value.endOf('year').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst eventsByDay = computed(() =>\n getYearViewEvents({ date: year.value, events: expandedEvents.value }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\n/**\n * Every month with the grid offset its cells start at, so a single roving tabindex can walk\n * the whole year rather than restarting in each month.\n */\nconst months = computed(() => {\n let offset = 0\n\n return Array.from({ length: 12 }, (_, monthIndex) => {\n const month = year.value.month(monthIndex)\n const weeks = getMonthDays({\n month,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n })\n const entry = { month, monthIndex, weeks, offset }\n offset += weeks.length * COLUMNS\n return entry\n })\n})\n\nconst totalYearGridCells = computed(() =>\n months.value.reduce((total, { weeks }) => total + weeks.length * COLUMNS, 0),\n)\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n yearValue: year.value.year(),\n withMonths: false,\n labelFormat: 'YYYY',\n onYearChange: (value: number) => emit('dateChange', toDateString(year.value.year(value))),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\n\nconst dayProps = (date: string | Date) => props.getDayProps?.(toDateString(date)) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDateString(weekStart)) ?? {}\n\nconst isOutside = (date: string | Date, month: dayjs.Dayjs) => !dayjs(date).isSame(month, 'month')\n\nconst dayEvents = (date: string | Date) =>\n (eventsByDay.value[dayjs(date).format('YYYY-MM-DD')] || []).slice(0, MAX_DAY_INDICATORS)\n\nconst indicatorStyle = (event: ScheduleEventData) => ({\n background: `var(--mantine-color-${event.color}-6, ${event.color})`,\n})\n\nconst handleDayKeydown = (nativeEvent: KeyboardEvent, gridIndex: number) => {\n handleGridKeydown({\n event: nativeEvent,\n index: gridIndex,\n columns: COLUMNS,\n total: totalYearGridCells.value,\n getControl: (index) => {\n const control =\n yearGrid.value?.querySelector<HTMLButtonElement>(`[data-year-grid-index=\"${index}\"]`) ??\n null\n // Days of the neighbouring months are visible but never focusable.\n return control?.hasAttribute('data-outside') ? null : control\n },\n })\n}\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('yearView') }\">\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"year\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'year')\"\n :control=\"headerControl\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <div ref=\"yearGrid\" v-bind=\"getStyles('yearViewMonths')\">\n <section\n v-for=\"{ month, weeks, offset } in months\"\n :key=\"month.month()\"\n v-bind=\"getStyles('yearViewMonth')\"\n :data-with-week-numbers=\"props.withWeekNumbers || undefined\"\n >\n <UnstyledButton\n type=\"button\"\n v-bind=\"getStyles('yearViewMonthCaption')\"\n @click=\"emit('monthClick', toDateString(month))\"\n >\n {{\n formatDate({\n date: month,\n locale: props.locale || 'en',\n format: props.monthsListFormat!,\n })\n }}\n </UnstyledButton>\n\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('yearViewWeekdays')\">\n <span v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('yearViewWeekdaysCorner')\" />\n <span\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"staticStyles('yearViewWeekday')\"\n >\n {{ weekday }}\n </span>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"staticStyles('yearViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n type=\"button\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('yearViewWeekNumber', { className: weekNumberProps(week[0]).class }),\n }\"\n @click=\"emit('weekNumberClick', toDateString(week[0]), $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <template v-for=\"(date, dayIndex) in week\" :key=\"toDateString(date)\">\n <div\n v-if=\"isOutside(date, month) && !props.withOutsideDays\"\n v-bind=\"staticStyles('yearViewDay')\"\n data-day-placeholder\n />\n <UnstyledButton\n v-else\n type=\"button\"\n v-bind=\"{\n ...dayProps(date),\n ...getStyles('yearViewDay', { className: dayProps(date).class }),\n }\"\n :disabled=\"isStatic\"\n :data-year-grid-index=\"offset + weekIndex * COLUMNS + dayIndex\"\n :data-outside=\"isOutside(date, month) || undefined\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(date).day() as DayOfWeek) || undefined\n \"\n :data-today=\"\n (props.highlightToday && dayjs(date).isSame(dayjs(), 'day')) || undefined\n \"\n :aria-label=\"\n formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\n \"\n :tabindex=\"\n isStatic || isOutside(date, month) ? -1 : dayjs(date).date() === 1 ? 0 : -1\n \"\n @keydown=\"\n isStatic\n ? undefined\n : handleDayKeydown($event, offset + weekIndex * COLUMNS + dayIndex)\n \"\n @click=\"emit('dayClick', toDateString(date), $event)\"\n >\n {{ dayjs(date).date() }}\n <span v-if=\"dayEvents(date).length\" v-bind=\"getStyles('yearViewDayIndicators')\">\n <span\n v-for=\"event in dayEvents(date)\"\n :key=\"event.id\"\n v-bind=\"getStyles('yearViewDayIndicator')\"\n :style=\"indicatorStyle(event)\"\n />\n </span>\n </UnstyledButton>\n </template>\n </div>\n </section>\n </div>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport YearViewComponent, { varsResolver } from './YearView.vue'\nimport type { YearViewFactory } from './YearView.types'\nimport classes from './YearView.module.css'\n\nexport const YearView = factory<YearViewFactory>(YearViewComponent, { classes, varsResolver })\n\nexport type {\n YearViewCssVariables,\n YearViewEmits,\n YearViewFactory,\n YearViewOwnProps,\n YearViewOwnStylesNames,\n YearViewProps,\n YearViewStylesNames,\n} from './YearView.types'\n",".root {\n &:where([data-layout='responsive']) {\n container-type: inline-size;\n }\n}\n\n.desktopView {\n display: block;\n height: 100%;\n\n @container (width <= 600px) {\n display: none;\n }\n}\n\n.mobileView {\n display: none;\n height: 100%;\n\n @container (width <= 600px) {\n display: block;\n }\n}\n","<script lang=\"ts\">\nimport type { ScheduleOwnProps } from './Schedule.types'\n\nconst defaultProps = {\n defaultView: 'week',\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n layout: 'default',\n} satisfies Partial<ScheduleOwnProps>\n\nexport { defaultProps }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, useAttrs, useSlots } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport type { DateStringValue, ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport { DayView } from '../DayView'\nimport { MobileMonthView } from '../MobileMonthView'\nimport { MonthView } from '../MonthView'\nimport { resolveEventRenderers } from '../shared'\nimport { WeekView } from '../WeekView'\nimport { YearView } from '../YearView'\nimport type { ScheduleEmits, ScheduleSlots } from './Schedule.types'\nimport classes from './Schedule.module.css'\n\ndefineOptions({\n name: 'Schedule',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleOwnProps>(), {\n date: undefined,\n defaultDate: undefined,\n view: undefined,\n defaultView: undefined,\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n renderEventBody: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n layout: undefined,\n dayViewProps: undefined,\n weekViewProps: undefined,\n monthViewProps: undefined,\n yearViewProps: undefined,\n mobileMonthViewProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleSlots>()\n\nconst emit = defineEmits<ScheduleEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('Schedule', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'Schedule',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n})\n\nconst [currentDate, setCurrentDate] = useUncontrolled<DateStringValue>({\n value: () => (props.date === undefined ? undefined : toDateString(props.date)),\n defaultValue: toDateString(props.defaultDate ?? dayjs()),\n onChange: (value) => {\n emit('update:date', value)\n emit('dateChange', value)\n },\n})\n\nconst [currentView, setCurrentView] = useUncontrolled<ScheduleViewLevel>({\n value: () => props.view,\n defaultValue: props.defaultView,\n finalValue: 'week',\n onChange: (value) => {\n emit('update:view', value)\n emit('viewChange', value)\n },\n})\n\nconst eventRenderers = computed(() =>\n resolveEventRenderers({ renderEventBody: props.renderEventBody }, slots),\n)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst sharedProps = computed(() => ({\n date: currentDate.value,\n events: props.events,\n locale: props.locale,\n radius: props.radius,\n labels: props.labels,\n mode: props.mode,\n withEventsDragAndDrop: props.withEventsDragAndDrop,\n canDragEvent: props.canDragEvent,\n withDragSlotSelect: props.withDragSlotSelect,\n withExternalEventDrop: props.withExternalEventDrop,\n withEventResize: props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n recurrenceExpansionLimit: props.recurrenceExpansionLimit,\n ...eventRenderers.value,\n ...stylesApi.value,\n}))\n\n/**\n * Listeners re-emitted from the active view. They are `on*` keys rather than template `@`\n * bindings because a single object has to be spread onto whichever view is rendered — which is\n * exactly what the compiler produces for a template listener anyway.\n */\nconst sharedListeners = {\n onDateChange: (date: DateStringValue) => setCurrentDate(date),\n onViewChange: (view: ScheduleViewLevel) => setCurrentView(view),\n onEventDrop: (data: any) => emit('eventDrop', data),\n onEventDragStart: (event: any) => emit('eventDragStart', event),\n onEventDragEnd: () => emit('eventDragEnd'),\n onTimeSlotClick: (data: any) => emit('timeSlotClick', data),\n onAllDaySlotClick: (date: any, nativeEvent: MouseEvent) =>\n emit('allDaySlotClick', date, nativeEvent),\n onEventClick: (event: any, nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n onDayClick: (date: any, nativeEvent: MouseEvent) => emit('dayClick', date, nativeEvent),\n onMonthClick: (month: any) => emit('monthClick', month),\n onSlotDragEnd: (rangeStart: any, rangeEnd: any) => emit('slotDragEnd', rangeStart, rangeEnd),\n onExternalEventDrop: (dataTransfer: DataTransfer, dateTime: any) =>\n emit('externalEventDrop', dataTransfer, dateTime),\n onEventResize: (data: any) => emit('eventResize', data),\n}\n\nconst views = {\n day: DayView,\n week: WeekView,\n month: MonthView,\n year: YearView,\n} as const\n\nconst activeView = computed(() => views[currentView.value])\n\nconst activeViewProps = computed(() => {\n const perView = {\n day: props.dayViewProps,\n week: {\n ...(slots.weekLabel ? { renderWeekLabel: (payload: any) => slots.weekLabel!(payload) } : {}),\n ...props.weekViewProps,\n },\n month: props.monthViewProps,\n year: props.yearViewProps,\n }\n\n return { ...sharedProps.value, ...sharedListeners, ...perView[currentView.value] }\n})\n\n/**\n * The responsive layout shows the year view unchanged on narrow screens, because\n * `MobileMonthView` has no year equivalent.\n */\nconst mobileView = computed(() => (currentView.value === 'year' ? YearView : MobileMonthView))\n\nconst mobileViewProps = computed(() => {\n if (currentView.value === 'year') {\n return { ...sharedProps.value, ...sharedListeners, ...props.yearViewProps }\n }\n\n const viewProps = props.mobileMonthViewProps\n\n return {\n ...sharedProps.value,\n ...sharedListeners,\n ...(slots.header ? { renderHeader: (payload: any) => slots.header!(payload) } : {}),\n ...viewProps,\n onYearClick: () => setCurrentView('year'),\n // Both the schedule-level and the view-level listener run, matching the desktop view.\n onDayClick: (date: DateStringValue, nativeEvent: MouseEvent) => {\n emit('dayClick', date, nativeEvent)\n viewProps?.onDayClick?.(date, nativeEvent)\n },\n }\n})\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('root') }\"\n :mod=\"[{ layout: props.layout }, (attrs as any).mod]\"\n >\n <template v-if=\"props.layout !== 'responsive'\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\" />\n </template>\n\n <template v-else>\n <Box v-bind=\"getStyles('desktopView')\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\" />\n </Box>\n <Box v-bind=\"getStyles('mobileView')\">\n <component :is=\"mobileView\" v-bind=\"mobileViewProps\" />\n </Box>\n </template>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport type { ScheduleOwnProps } from './Schedule.types'\n\nconst defaultProps = {\n defaultView: 'week',\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n layout: 'default',\n} satisfies Partial<ScheduleOwnProps>\n\nexport { defaultProps }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, useAttrs, useSlots } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport type { DateStringValue, ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport { DayView } from '../DayView'\nimport { MobileMonthView } from '../MobileMonthView'\nimport { MonthView } from '../MonthView'\nimport { resolveEventRenderers } from '../shared'\nimport { WeekView } from '../WeekView'\nimport { YearView } from '../YearView'\nimport type { ScheduleEmits, ScheduleSlots } from './Schedule.types'\nimport classes from './Schedule.module.css'\n\ndefineOptions({\n name: 'Schedule',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleOwnProps>(), {\n date: undefined,\n defaultDate: undefined,\n view: undefined,\n defaultView: undefined,\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n renderEventBody: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n layout: undefined,\n dayViewProps: undefined,\n weekViewProps: undefined,\n monthViewProps: undefined,\n yearViewProps: undefined,\n mobileMonthViewProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleSlots>()\n\nconst emit = defineEmits<ScheduleEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('Schedule', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'Schedule',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n})\n\nconst [currentDate, setCurrentDate] = useUncontrolled<DateStringValue>({\n value: () => (props.date === undefined ? undefined : toDateString(props.date)),\n defaultValue: toDateString(props.defaultDate ?? dayjs()),\n onChange: (value) => {\n emit('update:date', value)\n emit('dateChange', value)\n },\n})\n\nconst [currentView, setCurrentView] = useUncontrolled<ScheduleViewLevel>({\n value: () => props.view,\n defaultValue: props.defaultView,\n finalValue: 'week',\n onChange: (value) => {\n emit('update:view', value)\n emit('viewChange', value)\n },\n})\n\nconst eventRenderers = computed(() =>\n resolveEventRenderers({ renderEventBody: props.renderEventBody }, slots),\n)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst sharedProps = computed(() => ({\n date: currentDate.value,\n events: props.events,\n locale: props.locale,\n radius: props.radius,\n labels: props.labels,\n mode: props.mode,\n withEventsDragAndDrop: props.withEventsDragAndDrop,\n canDragEvent: props.canDragEvent,\n withDragSlotSelect: props.withDragSlotSelect,\n withExternalEventDrop: props.withExternalEventDrop,\n withEventResize: props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n recurrenceExpansionLimit: props.recurrenceExpansionLimit,\n ...eventRenderers.value,\n ...stylesApi.value,\n}))\n\n/**\n * Listeners re-emitted from the active view. They are `on*` keys rather than template `@`\n * bindings because a single object has to be spread onto whichever view is rendered — which is\n * exactly what the compiler produces for a template listener anyway.\n */\nconst sharedListeners = {\n onDateChange: (date: DateStringValue) => setCurrentDate(date),\n onViewChange: (view: ScheduleViewLevel) => setCurrentView(view),\n onEventDrop: (data: any) => emit('eventDrop', data),\n onEventDragStart: (event: any) => emit('eventDragStart', event),\n onEventDragEnd: () => emit('eventDragEnd'),\n onTimeSlotClick: (data: any) => emit('timeSlotClick', data),\n onAllDaySlotClick: (date: any, nativeEvent: MouseEvent) =>\n emit('allDaySlotClick', date, nativeEvent),\n onEventClick: (event: any, nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n onDayClick: (date: any, nativeEvent: MouseEvent) => emit('dayClick', date, nativeEvent),\n onMonthClick: (month: any) => emit('monthClick', month),\n onSlotDragEnd: (rangeStart: any, rangeEnd: any) => emit('slotDragEnd', rangeStart, rangeEnd),\n onExternalEventDrop: (dataTransfer: DataTransfer, dateTime: any) =>\n emit('externalEventDrop', dataTransfer, dateTime),\n onEventResize: (data: any) => emit('eventResize', data),\n}\n\nconst views = {\n day: DayView,\n week: WeekView,\n month: MonthView,\n year: YearView,\n} as const\n\nconst activeView = computed(() => views[currentView.value])\n\nconst activeViewProps = computed(() => {\n const perView = {\n day: props.dayViewProps,\n week: {\n ...(slots.weekLabel ? { renderWeekLabel: (payload: any) => slots.weekLabel!(payload) } : {}),\n ...props.weekViewProps,\n },\n month: props.monthViewProps,\n year: props.yearViewProps,\n }\n\n return { ...sharedProps.value, ...sharedListeners, ...perView[currentView.value] }\n})\n\n/**\n * The responsive layout shows the year view unchanged on narrow screens, because\n * `MobileMonthView` has no year equivalent.\n */\nconst mobileView = computed(() => (currentView.value === 'year' ? YearView : MobileMonthView))\n\nconst mobileViewProps = computed(() => {\n if (currentView.value === 'year') {\n return { ...sharedProps.value, ...sharedListeners, ...props.yearViewProps }\n }\n\n const viewProps = props.mobileMonthViewProps\n\n return {\n ...sharedProps.value,\n ...sharedListeners,\n ...(slots.header ? { renderHeader: (payload: any) => slots.header!(payload) } : {}),\n ...viewProps,\n onYearClick: () => setCurrentView('year'),\n // Both the schedule-level and the view-level listener run, matching the desktop view.\n onDayClick: (date: DateStringValue, nativeEvent: MouseEvent) => {\n emit('dayClick', date, nativeEvent)\n viewProps?.onDayClick?.(date, nativeEvent)\n },\n }\n})\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('root') }\"\n :mod=\"[{ layout: props.layout }, (attrs as any).mod]\"\n >\n <template v-if=\"props.layout !== 'responsive'\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\" />\n </template>\n\n <template v-else>\n <Box v-bind=\"getStyles('desktopView')\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\" />\n </Box>\n <Box v-bind=\"getStyles('mobileView')\">\n <component :is=\"mobileView\" v-bind=\"mobileViewProps\" />\n </Box>\n </template>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ScheduleComponent from './Schedule.vue'\nimport type { ScheduleFactory } from './Schedule.types'\nimport classes from './Schedule.module.css'\n\nexport const Schedule = factory<ScheduleFactory>(ScheduleComponent, { classes })\n\nexport type {\n ScheduleEmits,\n ScheduleFactory,\n ScheduleLayout,\n ScheduleOwnProps,\n ScheduleOwnStylesNames,\n ScheduleProps,\n ScheduleSlots,\n ScheduleStylesNames,\n} from './Schedule.types'\n","import dayjs from 'dayjs'\nimport { onBeforeUnmount, shallowRef } from 'vue'\nimport { rafThrottle } from '../components/shared'\nimport type { EventDropData } from '../component-props'\nimport type { DateTimeStringValue, ScheduleEventData, ScheduleMode } from '../types'\nimport { clampIntervalMinutes, parseTimeString } from '../utils'\n\ntype ResizeEdge = 'start' | 'end'\n\ninterface ResizeState {\n event: ScheduleEventData\n edge: ResizeEdge\n container: HTMLElement\n originalLeft: number\n originalWidth: number\n currentLeft: number\n currentWidth: number\n eventDate: string\n originalStart: DateTimeStringValue\n originalEnd: DateTimeStringValue\n dayIndex: number\n dayCount: number\n}\n\nexport function useHorizontalEventResize(input: {\n enabled: () => boolean\n mode: () => ScheduleMode\n startTime: () => string\n endTime: () => string\n intervalMinutes: () => number\n onEventResize: (data: EventDropData) => void\n canResizeEvent: () => ((event: ScheduleEventData) => boolean) | undefined\n}) {\n const state = shallowRef<ResizeState | null>(null)\n let justResized = false\n let savedUserSelect = ''\n\n const metrics = () => {\n const start = parseTimeString(input.startTime())\n const end = parseTimeString(input.endTime())\n const startMinutes = start.hours * 60 + start.minutes\n const literalRange = end.hours * 60 + end.minutes - startMinutes\n const interval = clampIntervalMinutes(input.intervalMinutes())\n const total = Math.ceil(literalRange / interval) * interval\n return { startMinutes, literalRange, interval, total, minWidth: (interval / total) * 100 }\n }\n const snap = (percent: number) => {\n const { literalRange, interval, total } = metrics()\n const minutes = Math.max(\n 0,\n Math.min(literalRange, Math.round(((percent / 100) * total) / interval) * interval),\n )\n return (minutes / total) * 100\n }\n const toDateTime = (percent: number, date: string): DateTimeStringValue => {\n const { startMinutes, total } = metrics()\n const minutes = startMinutes + Math.round((snap(percent) / 100) * total)\n return `${date} ${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}:00`\n }\n /**\n * Coalesced to one animation frame: `pointermove` outruns paint, and each step reads layout\n * and re-renders the grid.\n */\n const move = rafThrottle((clientX: number) => {\n if (!state.value) return\n const rect = state.value.container.getBoundingClientRect()\n const dayWidth = rect.width / state.value.dayCount\n const raw = ((clientX - rect.left - state.value.dayIndex * dayWidth) / dayWidth) * 100\n const point = snap(raw)\n const { minWidth } = metrics()\n const current = state.value\n if (current.edge === 'end') {\n current.currentWidth = Math.max(minWidth, point - current.originalLeft)\n } else {\n const right = current.originalLeft + current.originalWidth\n current.currentLeft = Math.min(point, right - minWidth)\n current.currentWidth = right - current.currentLeft\n }\n state.value = { ...current }\n })\n const trackPointer = (event: PointerEvent) => move(event.clientX)\n const cleanup = () => {\n move.cancel()\n document.removeEventListener('pointermove', trackPointer)\n document.removeEventListener('pointerup', finish)\n document.body.style.userSelect = savedUserSelect\n }\n const finish = () => {\n // Drop the pending frame first, so a stale step cannot land after the gesture ended.\n move.cancel()\n const current = state.value\n if (\n current &&\n (current.currentLeft !== current.originalLeft ||\n current.currentWidth !== current.originalWidth)\n ) {\n input.onEventResize({\n eventId: current.event.id,\n newStart:\n current.edge === 'start'\n ? toDateTime(current.currentLeft, current.eventDate)\n : current.originalStart,\n newEnd:\n current.edge === 'end'\n ? toDateTime(current.currentLeft + current.currentWidth, current.eventDate)\n : current.originalEnd,\n event: current.event,\n })\n }\n state.value = null\n cleanup()\n justResized = true\n requestAnimationFrame(() => (justResized = false))\n }\n const handleResizeStart = (params: {\n event: ScheduleEventData\n edge: ResizeEdge\n container: HTMLElement\n originalLeft: number\n originalWidth: number\n eventDate: string\n pointerEvent: PointerEvent\n dayIndex?: number\n dayCount?: number\n }) => {\n if (!input.enabled() || input.mode() === 'static') return\n params.pointerEvent.preventDefault()\n params.pointerEvent.stopPropagation()\n state.value = {\n ...params,\n currentLeft: params.originalLeft,\n currentWidth: params.originalWidth,\n originalStart: dayjs(params.event.start).format('YYYY-MM-DD HH:mm:ss'),\n originalEnd: dayjs(params.event.end).format('YYYY-MM-DD HH:mm:ss'),\n dayIndex: params.dayIndex ?? 0,\n dayCount: params.dayCount ?? 1,\n }\n savedUserSelect = document.body.style.userSelect\n document.body.style.userSelect = 'none'\n document.addEventListener('pointermove', trackPointer)\n document.addEventListener('pointerup', finish)\n }\n onBeforeUnmount(cleanup)\n return {\n state,\n handleResizeStart,\n getResizePosition: (id: string | number) =>\n state.value?.event.id === id\n ? { left: state.value.currentLeft, width: state.value.currentWidth }\n : null,\n isResizableEvent: (event: ScheduleEventData) =>\n input.enabled() &&\n input.mode() !== 'static' &&\n event.display !== 'background' &&\n (input.canResizeEvent()?.(event) ?? true),\n wasResizing: () => justResized,\n }\n}\n","import type { DayPositionedEventData } from '../../../types'\n\nexport function getOverlapClusters(events: DayPositionedEventData[]): DayPositionedEventData[][] {\n const sorted = [...events].sort((a, b) => a.position.top - b.position.top)\n const clusters: DayPositionedEventData[][] = []\n let current: DayPositionedEventData[] = []\n let end = -1\n sorted.forEach((event) => {\n if (current.length && event.position.top >= end) {\n clusters.push(current)\n current = []\n end = -1\n }\n current.push(event)\n end = Math.max(end, event.position.top + event.position.height)\n })\n if (current.length) clusters.push(current)\n return clusters\n}\n","import dayjs from 'dayjs'\nimport type {\n AnyDateValue,\n DayPositionedEventData,\n ScheduleEventData,\n ScheduleResourceData,\n} from '../../../types'\nimport { getDayPosition, isAllDayEvent, isEventInTimeRange, validateEvent } from '../../../utils'\nimport { getDayPositionedEvents } from '../../DayView/get-day-view-events/get-day-positioned-events'\n\nexport interface ResourcesDayViewEventsResult {\n regularEvents: Record<string | number, DayPositionedEventData[]>\n allDayEvents: Record<string | number, DayPositionedEventData[]>\n backgroundTimedEvents: Record<string | number, DayPositionedEventData[]>\n backgroundAllDayEvents: Record<string | number, DayPositionedEventData[]>\n}\n\nexport function getResourcesDayViewEvents({\n events,\n resources,\n date,\n startTime,\n endTime,\n intervalMinutes,\n}: {\n events: ScheduleEventData[] | undefined\n resources: ScheduleResourceData[]\n date: AnyDateValue\n startTime?: string\n endTime?: string\n intervalMinutes?: number\n}): ResourcesDayViewEventsResult {\n const result: ResourcesDayViewEventsResult = {\n regularEvents: {},\n allDayEvents: {},\n backgroundTimedEvents: {},\n backgroundAllDayEvents: {},\n }\n resources.forEach((resource) => {\n result.regularEvents[resource.id] = []\n result.allDayEvents[resource.id] = []\n result.backgroundTimedEvents[resource.id] = []\n result.backgroundAllDayEvents[resource.id] = []\n })\n if (!events) return result\n\n const dayStart = dayjs(date).startOf('day')\n const dayEnd = dayjs(date).endOf('day')\n const regular = new Map<string | number, ScheduleEventData[]>(\n resources.map((resource) => [resource.id, []]),\n )\n const background = new Map<string | number, ScheduleEventData[]>(\n resources.map((resource) => [resource.id, []]),\n )\n const seen = new Set<string | number>()\n\n events.forEach((event) => {\n if (event.resourceId === undefined || !regular.has(event.resourceId)) return\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n const startsOnDay = eventStart.isSame(dayStart, 'day')\n if (!startsOnDay && !(eventStart.isBefore(dayEnd) && eventEnd.isAfter(dayStart))) return\n if (startsOnDay && !isEventInTimeRange({ event, startTime, endTime })) return\n if (seen.has(event.id)) {\n throw new Error(\n `[@mantine/schedule] ResourcesDayView: Duplicated event ids found: ${event.id}`,\n )\n }\n seen.add(event.id)\n const validated = validateEvent(event)\n if (event.display === 'background') {\n background.get(event.resourceId)!.push(validated)\n return\n }\n const clipped = startsOnDay\n ? validated\n : {\n ...validated,\n start: (eventStart.isBefore(dayStart) ? dayStart : eventStart).format(\n 'YYYY-MM-DD HH:mm:ss',\n ),\n end: (eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd).format('YYYY-MM-DD HH:mm:ss'),\n }\n if (isEventInTimeRange({ event: clipped, startTime, endTime })) {\n regular.get(event.resourceId)!.push(clipped)\n }\n })\n\n resources.forEach((resource) => {\n getDayPositionedEvents({\n events: regular.get(resource.id)!,\n startTime,\n endTime,\n date,\n intervalMinutes,\n }).forEach((event) => {\n const target = event.position.allDay ? result.allDayEvents : result.regularEvents\n target[resource.id].push(event)\n })\n\n background.get(resource.id)!.forEach((event) => {\n const clippedStart = dayjs(event.start).isBefore(dayStart) ? dayStart : dayjs(event.start)\n const clippedEnd = dayjs(event.end).isAfter(dayEnd) ? dayEnd : dayjs(event.end)\n const clipped = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n }\n const allDay = isAllDayEvent({ event: clipped, date })\n const position = allDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event: clipped, startTime, endTime, intervalMinutes })\n if (!allDay && position.height <= 0) return\n const target = allDay ? result.backgroundAllDayEvents : result.backgroundTimedEvents\n target[resource.id].push({\n ...event,\n position: {\n ...position,\n allDay,\n width: 100,\n offset: 0,\n column: 0,\n overlaps: 1,\n },\n })\n })\n })\n return result\n}\n",".resourcesDayView {\n --resources-day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-day-view-resource-label-width: 120px;\n --resources-day-view-slot-width: 80px;\n --resources-day-view-row-height: 64px;\n --resources-day-view-group-label-width: 80px;\n --resources-day-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-day-view-border-color: var(--mantine-color-gray-3);\n --resources-day-view-business-hours-bg: var(--mantine-color-white);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-day-view-border-color: var(--mantine-color-dark-4);\n --resources-day-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesDayViewRoot {\n border: 1px solid var(--resources-day-view-border-color);\n border-radius: var(--resources-day-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesDayViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesDayViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n.resourcesDayViewTimeLabelsRow {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-day-view-border-color);\n margin-bottom: -1px;\n transition: box-shadow 100ms ease;\n &:where([data-scrolled]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n}\n.resourcesDayViewCorner {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n position: sticky;\n left: 0;\n z-index: 11;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n.resourcesDayViewTimeLabel {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n}\n.resourcesDayViewRow {\n display: flex;\n border-top: 1px solid var(--resources-day-view-border-color);\n}\n.resourcesDayViewResourceLabel {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 11;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n &:where([data-has-groups]) {\n left: var(--resources-day-view-group-label-width);\n }\n}\n.resourcesDayViewGroupColumn,\n.resourcesDayViewGroupColumnEmpty {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n}\n.resourcesDayViewGroupColumn {\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 overflow: visible;\n &:where([data-group-position='first'], [data-group-position='only']) {\n z-index: 13;\n }\n &:where([data-group-position='middle'], [data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-day-view-row-height) + 1px);\n }\n}\n.resourcesDayViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-day-view-row-height);\n}\n.resourcesDayViewRowSlot {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n min-height: var(--resources-day-view-row-height);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n cursor: pointer;\n position: relative;\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where(:focus) {\n z-index: 1;\n }\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\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 @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-primary-color-2);\n }\n }\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n.resourcesDayViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-day-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n position: absolute;\n pointer-events: none;\n top: 37px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n}\n.resourcesDayViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n inset-block: 0;\n background-color: var(--_indicator-color);\n}\n.resourcesDayViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: -5px;\n left: -5px;\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}\n.resourcesDayViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n text-transform: uppercase;\n top: 0;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n.resourcesDayViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-day-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n}\n.resourcesDayViewAllDayEvent {\n position: absolute;\n inset-inline: 1px;\n height: var(--resources-day-view-all-day-height);\n z-index: 3;\n}\n.resourcesDayViewEventWrapper {\n position: absolute;\n z-index: 3;\n}\n.resourcesDayViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n &:where([data-edge='start']) {\n left: -2px;\n }\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n.resourcesDayViewEventWrapper:hover .resourcesDayViewResizeHandle {\n opacity: 0.5;\n}\n.resourcesDayViewEventWrapper .resourcesDayViewResizeHandle:hover,\n.resourcesDayViewEventWrapper[data-resizing] .resourcesDayViewResizeHandle[data-active] {\n opacity: 0.8;\n}\n.resourcesDayViewEventWrapper[data-resizing] .resourcesDayViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n}\n.resourcesDayView:where([data-event-interaction]) .resourcesDayViewRowSlot {\n pointer-events: none;\n}\n.resourcesDayView:where([data-resizing]) * {\n cursor: ew-resize !important;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesDayViewOwnProps } from './ResourcesDayView.types'\n\nconst defaultProps = {\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n withHeader: true,\n headerFormat: 'MMMM D, YYYY',\n slotWidth: 80,\n rowHeight: 64,\n groupLabelWidth: 80,\n businessHours: ['09:00:00', '17:00:00'],\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n maxEventsPerTimeSlot: 2,\n} satisfies Partial<ResourcesDayViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesDayView: {\n '--resources-day-view-radius': resolveScheduleRadius(radius),\n '--resources-day-view-slot-width': cssSize(slotWidth),\n '--resources-day-view-row-height': cssSize(rowHeight),\n '--resources-day-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, RESOURCE_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n expandRecurringEvents,\n formatDate,\n getBusinessHoursMod,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getOrderedResources,\n handleResourcesGridKeyDown,\n isInTimeRange,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getOverlapClusters } from './get-overlap-clusters/get-overlap-clusters'\nimport { getResourcesDayViewEvents } from './get-resources-day-view-events/get-resources-day-view-events'\nimport type { ResourcesDayViewEmits, ResourcesDayViewSlots } from './ResourcesDayView.types'\nimport classes from './ResourcesDayView.module.css'\n\ndefineOptions({\n name: 'ResourcesDayView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesDayViewOwnProps>(), {\n groups: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n slotLabelFormat: undefined,\n radius: undefined,\n startScrollTime: undefined,\n scrollAreaProps: undefined,\n locale: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n headerFormat: undefined,\n events: undefined,\n slotWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n labels: undefined,\n businessHours: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesDayViewSlots>()\n\nconst emit = defineEmits<ResourcesDayViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('ResourcesDayView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesDayView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesDayView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; slotIndex: number } | null>(null)\nconst scrolled = ref(false)\nconst scrolledX = ref(false)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst date = computed(() => dayjs(props.date).format('YYYY-MM-DD') as DateStringValue)\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? new Date()))\nconst dayOfWeek = computed(() => dayjs(props.date).day() as DayOfWeek)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst resourceIdMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst expandedEvents = computed(() =>\n expandRecurringEvents({\n events: props.events,\n rangeStart: dayjs(props.date).startOf('day').toDate(),\n rangeEnd: dayjs(props.date).endOf('day').toDate(),\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst positioned = computed(() =>\n getResourcesDayViewEvents({\n date: props.date,\n events: expandedEvents.value,\n resources: props.resources,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst businessHoursMods = computed(() =>\n intervals.value.map((interval) =>\n getBusinessHoursMod({\n time: interval.startTime,\n businessHours: props.businessHours,\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayOfWeek.value,\n }),\n ),\n)\n\nconst showIndicator = computed(\n () =>\n (props.withCurrentTimeIndicator ?? dayjs(props.date).isSame(now.value, 'day')) &&\n isInTimeRange({\n date: now.value.toDate(),\n startTime: props.startTime!,\n endTime: props.endTime!,\n }),\n)\n\nconst indicatorOffset = computed(() =>\n getCurrentTimePosition({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n now: now.value,\n }),\n)\n\nconst currentTime = computed(() =>\n formatDate({ date: now.value, locale: props.locale || 'en', format: props.slotLabelFormat! }),\n)\n\nconst headerLabel = computed(() =>\n formatDate({ date: props.date, locale: props.locale || 'en', format: props.headerFormat! }),\n)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const first = intervals.value[start]\n const last = intervals.value[end]\n\n if (first && last) {\n emit('slotDragEnd', {\n rangeStart: `${date.value} ${first.startTime}` as DateTimeStringValue,\n rangeEnd: `${date.value} ${last.endTime}` as DateTimeStringValue,\n resourceId: resourceIdMap.value.get(group),\n })\n }\n },\n})\n\nconst resize = useHorizontalEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n scrollSlotIntoView(controls[0]?.[targetIndex], 'x')\n})\n\nconst setControl = (resourceIndex: number, slotIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][slotIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n const node = (element as { $el?: HTMLElement } | null)?.$el ?? element\n\n if (node instanceof HTMLElement) {\n rowContainers.set(resourceIndex, node)\n }\n}\n\nconst withDragHandlers = computed(\n () => Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop),\n)\n\nconst getSlotIndexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container || intervals.value.length === 0) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(\n intervals.value.length - 1,\n Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * intervals.value.length),\n ),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, slotIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const interval = intervals.value[slotIndex]\n\n if (!interval) {\n return\n }\n\n const target = `${date.value} ${interval.startTime}` as DateTimeStringValue\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', { ...moveEventTo(event, target), resourceId })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: target,\n resourceId,\n })\n }\n}\n\nconst setDropTarget = (next: { resourceId: string | number; slotIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.slotIndex === next.slotIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const slotIndex = getSlotIndexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(slotIndex < 0 ? null : { resourceId, slotIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n if (isStatic.value) {\n return\n }\n\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const related = nativeEvent.relatedTarget\n const current = nativeEvent.currentTarget\n\n if (\n !(related instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(related)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const slotIndex = getSlotIndexAtPoint(nativeEvent, resourceIndex)\n\n if (slotIndex >= 0) {\n emitDrop(nativeEvent, resource.id, slotIndex)\n }\n}\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-day-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst backgroundEvents = (resourceId: string | number) => [\n ...(positioned.value.backgroundTimedEvents[resourceId] || []),\n ...(positioned.value.backgroundAllDayEvents[resourceId] || []),\n]\n\nconst backgroundEventStyle = (event: ScheduleEventData & { position: any }) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n\n return {\n left: `${event.position.top}%`,\n right: `${100 - event.position.top - event.position.height}%`,\n minWidth: '1px',\n top: 0,\n height: '100%',\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n }\n}\n\nconst allDayEvents = (resourceId: string | number) =>\n positioned.value.allDayEvents[resourceId] || []\n\nconst allDayEventStyle = (index: number) => ({\n top: `calc(${index} * (var(--resources-day-view-all-day-height) + 2px) + 2px)`,\n})\n\nconst allRegularEvents = (resourceId: string | number) =>\n positioned.value.regularEvents[resourceId] || []\n\nconst visibleRegularEvents = (resourceId: string | number) =>\n allRegularEvents(resourceId).filter(\n (event) => event.position.column < Math.max(1, props.maxEventsPerTimeSlot!),\n )\n\nconst eventWrapperStyle = (event: ScheduleEventData & { position: any }) => {\n const position = resize.getResizePosition(event.id)\n const left = position?.left ?? event.position.top\n const width = position?.width ?? event.position.height\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n\n return {\n left: `calc(${left}% + 1px)`,\n width: `calc(${width}% - 2px)`,\n top: `${event.position.offset}%`,\n height: `${event.position.width}%`,\n '--event-color': colors.color,\n }\n}\n\nconst moreClusters = (resourceId: string | number) =>\n getOverlapClusters(allRegularEvents(resourceId))\n .filter((cluster) =>\n cluster.some((event) => event.position.column >= props.maxEventsPerTimeSlot!),\n )\n .map((cluster) => {\n const left = Math.min(...cluster.map((event) => event.position.top))\n const right = Math.max(...cluster.map((event) => event.position.top + event.position.height))\n\n return {\n cluster,\n hiddenCount: cluster.filter((event) => event.position.column >= props.maxEventsPerTimeSlot!)\n .length,\n style: {\n position: 'absolute' as const,\n left: `calc(${left}% + 1px)`,\n width: `calc(${right - left}% - 2px)`,\n bottom: 0,\n height: '22px',\n zIndex: 4,\n },\n }\n })\n\nconst cornerStyle = computed(() =>\n hasGroups.value\n ? {\n flexBasis:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n }\n : undefined,\n)\n\nconst indicatorStyle = computed(() => ({\n '--indicator-left-offset': hasGroups.value\n ? `calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width) + (100% - var(--resources-day-view-resource-label-width) - var(--resources-day-view-group-label-width)) * ${indicatorOffset.value} / 100)`\n : `calc(var(--resources-day-view-resource-label-width) + (100% - var(--resources-day-view-resource-label-width)) * ${indicatorOffset.value} / 100)`,\n '--_time-bubble-width': String(currentTime.value).toLowerCase().includes('m') ? '64px' : '46px',\n}))\n\nconst rowMinHeight = (resourceId: string | number) => {\n const count = allDayEvents(resourceId).length\n\n return count\n ? {\n minHeight: `max(var(--resources-day-view-row-height), calc(${count} * (var(--resources-day-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined\n}\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!resize.wasResizing()) {\n emit('eventClick', event, nativeEvent)\n }\n}\n\nconst startResize = (\n event: ScheduleEventData & { position: any },\n resourceIndex: number,\n edge: 'start' | 'end',\n pointerEvent: PointerEvent,\n) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container) {\n return\n }\n\n resize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: date.value,\n pointerEvent,\n })\n}\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n return target\n ? {\n date: date.value,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesDayView') }\"\n :root-ref=\"setRootElement\"\n :data-resizing=\"resize.state.value ? true : undefined\"\n :data-event-interaction=\"resize.state.value ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :date=\"date\" :label=\"headerLabel\">\n <ScheduleHeaderBase\n view=\"day\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'day')\"\n :control=\"{ title: headerLabel }\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesDayViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesDayViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n @scroll-position-change=\"\n (position) => {\n scrolled = position.y !== 0\n scrolledX = position.x !== 0\n }\n \"\n >\n <div v-bind=\"getStyles('resourcesDayViewInner')\">\n <Box\n v-bind=\"getStyles('resourcesDayViewTimeLabelsRow')\"\n :data-scrolled=\"scrolled || undefined\"\n >\n <div v-bind=\"getStyles('resourcesDayViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <Box\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"interval.startTime\"\n v-bind=\"staticStyles('resourcesDayViewTimeLabel')\"\n :data-business-hours=\"businessHoursMods[slotIndex]['business-hours'] || undefined\"\n :data-non-business-hours=\"\n businessHoursMods[slotIndex]['non-business-hours'] || undefined\n \"\n >\n <slot\n name=\"timeLabel\"\n :label=\"\n formatDate({\n date: `${date} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n \"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n >\n {{\n formatDate({\n date: `${date} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </slot>\n </Box>\n </Box>\n\n <Box\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesDayViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesDayViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesDayViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <Box\n v-bind=\"staticStyles('resourcesDayViewResourceLabel')\"\n :data-scrolled-x=\"scrolledX || undefined\"\n :data-has-groups=\"groupInfo(resourceIndex) !== undefined || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </Box>\n\n <Box\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"getStyles('resourcesDayViewRowSlots', { style: rowMinHeight(resource.id) })\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"withDragHandlers ? handleRowDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <template v-for=\"event in backgroundEvents(resource.id)\" :key=\"`bg-${event.id}`\">\n <slot name=\"backgroundEvent\" :event=\"event\">\n <Box\n v-bind=\"\n getStyles('resourcesDayViewBackgroundEvent', {\n style: backgroundEventStyle(event),\n })\n \"\n >\n <component\n :is=\"() => eventRenderers.renderEventBody!(event)\"\n v-if=\"eventRenderers.renderEventBody\"\n />\n <template v-else>{{ event.title }}</template>\n </Box>\n </slot>\n </template>\n\n <template\n v-for=\"(event, index) in allDayEvents(resource.id)\"\n :key=\"`all-${event.id}`\"\n >\n <Box\n v-bind=\"\n getStyles('resourcesDayViewAllDayEvent', { style: allDayEventStyle(index) })\n \"\n >\n <slot name=\"allDayEvent\" :event=\"event\">\n <ScheduleEvent\n :event=\"event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @click=\"\n isStatic ? undefined : emit('eventClick', event, $event as MouseEvent)\n \"\n />\n </slot>\n </Box>\n </template>\n\n <Box\n v-for=\"event in visibleRegularEvents(resource.id)\"\n :key=\"event.id\"\n v-bind=\"\n getStyles('resourcesDayViewEventWrapper', { style: eventWrapperStyle(event) })\n \"\n :data-resizing=\"resize.getResizePosition(event.id) !== null || undefined\"\n >\n <ScheduleEvent\n :event=\"event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(event)\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"isStatic ? undefined : clickEvent(event, $event as MouseEvent)\"\n />\n\n <template v-if=\"resize.isResizableEvent(event)\">\n <div\n v-for=\"edge in ['start', 'end'] as const\"\n :key=\"edge\"\n v-bind=\"staticStyles('resourcesDayViewResizeHandle')\"\n :data-edge=\"edge\"\n :data-active=\"resize.state.value?.edge === edge || undefined\"\n :aria-label=\"`${\n edge === 'start' ? 'Resize event start' : 'Resize event end'\n } ${event.title}`\"\n @dragstart.prevent\n @pointerdown=\"startResize(event, resourceIndex, edge, $event)\"\n />\n </template>\n </Box>\n\n <template\n v-for=\"entry in moreClusters(resource.id)\"\n :key=\"`more-${entry.cluster[0].id}`\"\n >\n <slot name=\"moreEvents\" :events=\"entry.cluster\" :hidden-count=\"entry.hiddenCount\">\n <MoreEvents\n :events=\"entry.cluster\"\n :more-events-count=\"entry.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"entry.style\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <UnstyledButton\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"interval.startTime\"\n :ref=\"setControl(resourceIndex, slotIndex)\"\n v-bind=\"staticStyles('resourcesDayViewRowSlot')\"\n :data-business-hours=\"businessHoursMods[slotIndex]['business-hours'] || undefined\"\n :data-non-business-hours=\"\n businessHoursMods[slotIndex]['non-business-hours'] || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id && dropTarget.slotIndex === slotIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(slotIndex, String(resource.id)) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"props.withDragSlotSelect ? slotIndex : undefined\"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :aria-label=\"`${getLabel('resourceSlot', props.labels)} ${String(resource.label)} ${date} ${interval.startTime} - ${interval.endTime}`\"\n :tabindex=\"isStatic ? -1 : resourceIndex === 0 && slotIndex === 0 ? 0 : -1\"\n @keydown=\"\n handleResourcesGridKeyDown({ controls, resourceIndex, slotIndex, event: $event })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown($event, slotIndex, String(resource.id))\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('timeSlotClick', {\n slotStart: `${date} ${interval.startTime}` as DateTimeStringValue,\n slotEnd: `${date} ${interval.endTime}` as DateTimeStringValue,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot\n name=\"timeSlot\"\n :resource=\"resource\"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n />\n </UnstyledButton>\n </Box>\n </Box>\n\n <template v-if=\"showIndicator\">\n <slot name=\"currentTimeIndicator\" :time=\"currentTime\" :offset=\"indicatorOffset\">\n <Box\n v-bind=\"\n getStyles('resourcesDayViewCurrentTimeIndicator', { style: indicatorStyle })\n \"\n >\n <div\n v-if=\"props.withCurrentTimeBubble\"\n v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorTimeBubble')\"\n >\n {{ currentTime }}\n </div>\n <div v-else v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorLine')\" />\n </Box>\n </slot>\n </template>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesDayViewOwnProps } from './ResourcesDayView.types'\n\nconst defaultProps = {\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n withHeader: true,\n headerFormat: 'MMMM D, YYYY',\n slotWidth: 80,\n rowHeight: 64,\n groupLabelWidth: 80,\n businessHours: ['09:00:00', '17:00:00'],\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n maxEventsPerTimeSlot: 2,\n} satisfies Partial<ResourcesDayViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesDayView: {\n '--resources-day-view-radius': resolveScheduleRadius(radius),\n '--resources-day-view-slot-width': cssSize(slotWidth),\n '--resources-day-view-row-height': cssSize(rowHeight),\n '--resources-day-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, RESOURCE_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n expandRecurringEvents,\n formatDate,\n getBusinessHoursMod,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getOrderedResources,\n handleResourcesGridKeyDown,\n isInTimeRange,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getOverlapClusters } from './get-overlap-clusters/get-overlap-clusters'\nimport { getResourcesDayViewEvents } from './get-resources-day-view-events/get-resources-day-view-events'\nimport type { ResourcesDayViewEmits, ResourcesDayViewSlots } from './ResourcesDayView.types'\nimport classes from './ResourcesDayView.module.css'\n\ndefineOptions({\n name: 'ResourcesDayView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesDayViewOwnProps>(), {\n groups: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n slotLabelFormat: undefined,\n radius: undefined,\n startScrollTime: undefined,\n scrollAreaProps: undefined,\n locale: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n headerFormat: undefined,\n events: undefined,\n slotWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n labels: undefined,\n businessHours: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesDayViewSlots>()\n\nconst emit = defineEmits<ResourcesDayViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('ResourcesDayView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesDayView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesDayView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; slotIndex: number } | null>(null)\nconst scrolled = ref(false)\nconst scrolledX = ref(false)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst date = computed(() => dayjs(props.date).format('YYYY-MM-DD') as DateStringValue)\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? new Date()))\nconst dayOfWeek = computed(() => dayjs(props.date).day() as DayOfWeek)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst resourceIdMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst expandedEvents = computed(() =>\n expandRecurringEvents({\n events: props.events,\n rangeStart: dayjs(props.date).startOf('day').toDate(),\n rangeEnd: dayjs(props.date).endOf('day').toDate(),\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst positioned = computed(() =>\n getResourcesDayViewEvents({\n date: props.date,\n events: expandedEvents.value,\n resources: props.resources,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst businessHoursMods = computed(() =>\n intervals.value.map((interval) =>\n getBusinessHoursMod({\n time: interval.startTime,\n businessHours: props.businessHours,\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayOfWeek.value,\n }),\n ),\n)\n\nconst showIndicator = computed(\n () =>\n (props.withCurrentTimeIndicator ?? dayjs(props.date).isSame(now.value, 'day')) &&\n isInTimeRange({\n date: now.value.toDate(),\n startTime: props.startTime!,\n endTime: props.endTime!,\n }),\n)\n\nconst indicatorOffset = computed(() =>\n getCurrentTimePosition({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n now: now.value,\n }),\n)\n\nconst currentTime = computed(() =>\n formatDate({ date: now.value, locale: props.locale || 'en', format: props.slotLabelFormat! }),\n)\n\nconst headerLabel = computed(() =>\n formatDate({ date: props.date, locale: props.locale || 'en', format: props.headerFormat! }),\n)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const first = intervals.value[start]\n const last = intervals.value[end]\n\n if (first && last) {\n emit('slotDragEnd', {\n rangeStart: `${date.value} ${first.startTime}` as DateTimeStringValue,\n rangeEnd: `${date.value} ${last.endTime}` as DateTimeStringValue,\n resourceId: resourceIdMap.value.get(group),\n })\n }\n },\n})\n\nconst resize = useHorizontalEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n scrollSlotIntoView(controls[0]?.[targetIndex], 'x')\n})\n\nconst setControl = (resourceIndex: number, slotIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][slotIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n const node = (element as { $el?: HTMLElement } | null)?.$el ?? element\n\n if (node instanceof HTMLElement) {\n rowContainers.set(resourceIndex, node)\n }\n}\n\nconst withDragHandlers = computed(\n () => Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop),\n)\n\nconst getSlotIndexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container || intervals.value.length === 0) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(\n intervals.value.length - 1,\n Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * intervals.value.length),\n ),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, slotIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const interval = intervals.value[slotIndex]\n\n if (!interval) {\n return\n }\n\n const target = `${date.value} ${interval.startTime}` as DateTimeStringValue\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', { ...moveEventTo(event, target), resourceId })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: target,\n resourceId,\n })\n }\n}\n\nconst setDropTarget = (next: { resourceId: string | number; slotIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.slotIndex === next.slotIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const slotIndex = getSlotIndexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(slotIndex < 0 ? null : { resourceId, slotIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n if (isStatic.value) {\n return\n }\n\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const related = nativeEvent.relatedTarget\n const current = nativeEvent.currentTarget\n\n if (\n !(related instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(related)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const slotIndex = getSlotIndexAtPoint(nativeEvent, resourceIndex)\n\n if (slotIndex >= 0) {\n emitDrop(nativeEvent, resource.id, slotIndex)\n }\n}\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-day-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst backgroundEvents = (resourceId: string | number) => [\n ...(positioned.value.backgroundTimedEvents[resourceId] || []),\n ...(positioned.value.backgroundAllDayEvents[resourceId] || []),\n]\n\nconst backgroundEventStyle = (event: ScheduleEventData & { position: any }) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n\n return {\n left: `${event.position.top}%`,\n right: `${100 - event.position.top - event.position.height}%`,\n minWidth: '1px',\n top: 0,\n height: '100%',\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n }\n}\n\nconst allDayEvents = (resourceId: string | number) =>\n positioned.value.allDayEvents[resourceId] || []\n\nconst allDayEventStyle = (index: number) => ({\n top: `calc(${index} * (var(--resources-day-view-all-day-height) + 2px) + 2px)`,\n})\n\nconst allRegularEvents = (resourceId: string | number) =>\n positioned.value.regularEvents[resourceId] || []\n\nconst visibleRegularEvents = (resourceId: string | number) =>\n allRegularEvents(resourceId).filter(\n (event) => event.position.column < Math.max(1, props.maxEventsPerTimeSlot!),\n )\n\nconst eventWrapperStyle = (event: ScheduleEventData & { position: any }) => {\n const position = resize.getResizePosition(event.id)\n const left = position?.left ?? event.position.top\n const width = position?.width ?? event.position.height\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n\n return {\n left: `calc(${left}% + 1px)`,\n width: `calc(${width}% - 2px)`,\n top: `${event.position.offset}%`,\n height: `${event.position.width}%`,\n '--event-color': colors.color,\n }\n}\n\nconst moreClusters = (resourceId: string | number) =>\n getOverlapClusters(allRegularEvents(resourceId))\n .filter((cluster) =>\n cluster.some((event) => event.position.column >= props.maxEventsPerTimeSlot!),\n )\n .map((cluster) => {\n const left = Math.min(...cluster.map((event) => event.position.top))\n const right = Math.max(...cluster.map((event) => event.position.top + event.position.height))\n\n return {\n cluster,\n hiddenCount: cluster.filter((event) => event.position.column >= props.maxEventsPerTimeSlot!)\n .length,\n style: {\n position: 'absolute' as const,\n left: `calc(${left}% + 1px)`,\n width: `calc(${right - left}% - 2px)`,\n bottom: 0,\n height: '22px',\n zIndex: 4,\n },\n }\n })\n\nconst cornerStyle = computed(() =>\n hasGroups.value\n ? {\n flexBasis:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n }\n : undefined,\n)\n\nconst indicatorStyle = computed(() => ({\n '--indicator-left-offset': hasGroups.value\n ? `calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width) + (100% - var(--resources-day-view-resource-label-width) - var(--resources-day-view-group-label-width)) * ${indicatorOffset.value} / 100)`\n : `calc(var(--resources-day-view-resource-label-width) + (100% - var(--resources-day-view-resource-label-width)) * ${indicatorOffset.value} / 100)`,\n '--_time-bubble-width': String(currentTime.value).toLowerCase().includes('m') ? '64px' : '46px',\n}))\n\nconst rowMinHeight = (resourceId: string | number) => {\n const count = allDayEvents(resourceId).length\n\n return count\n ? {\n minHeight: `max(var(--resources-day-view-row-height), calc(${count} * (var(--resources-day-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined\n}\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!resize.wasResizing()) {\n emit('eventClick', event, nativeEvent)\n }\n}\n\nconst startResize = (\n event: ScheduleEventData & { position: any },\n resourceIndex: number,\n edge: 'start' | 'end',\n pointerEvent: PointerEvent,\n) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container) {\n return\n }\n\n resize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: date.value,\n pointerEvent,\n })\n}\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n return target\n ? {\n date: date.value,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesDayView') }\"\n :root-ref=\"setRootElement\"\n :data-resizing=\"resize.state.value ? true : undefined\"\n :data-event-interaction=\"resize.state.value ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :date=\"date\" :label=\"headerLabel\">\n <ScheduleHeaderBase\n view=\"day\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'day')\"\n :control=\"{ title: headerLabel }\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesDayViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesDayViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n @scroll-position-change=\"\n (position) => {\n scrolled = position.y !== 0\n scrolledX = position.x !== 0\n }\n \"\n >\n <div v-bind=\"getStyles('resourcesDayViewInner')\">\n <Box\n v-bind=\"getStyles('resourcesDayViewTimeLabelsRow')\"\n :data-scrolled=\"scrolled || undefined\"\n >\n <div v-bind=\"getStyles('resourcesDayViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <Box\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"interval.startTime\"\n v-bind=\"staticStyles('resourcesDayViewTimeLabel')\"\n :data-business-hours=\"businessHoursMods[slotIndex]['business-hours'] || undefined\"\n :data-non-business-hours=\"\n businessHoursMods[slotIndex]['non-business-hours'] || undefined\n \"\n >\n <slot\n name=\"timeLabel\"\n :label=\"\n formatDate({\n date: `${date} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n \"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n >\n {{\n formatDate({\n date: `${date} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </slot>\n </Box>\n </Box>\n\n <Box\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesDayViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesDayViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesDayViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <Box\n v-bind=\"staticStyles('resourcesDayViewResourceLabel')\"\n :data-scrolled-x=\"scrolledX || undefined\"\n :data-has-groups=\"groupInfo(resourceIndex) !== undefined || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </Box>\n\n <Box\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"getStyles('resourcesDayViewRowSlots', { style: rowMinHeight(resource.id) })\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"withDragHandlers ? handleRowDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <template v-for=\"event in backgroundEvents(resource.id)\" :key=\"`bg-${event.id}`\">\n <slot name=\"backgroundEvent\" :event=\"event\">\n <Box\n v-bind=\"\n getStyles('resourcesDayViewBackgroundEvent', {\n style: backgroundEventStyle(event),\n })\n \"\n >\n <component\n :is=\"() => eventRenderers.renderEventBody!(event)\"\n v-if=\"eventRenderers.renderEventBody\"\n />\n <template v-else>{{ event.title }}</template>\n </Box>\n </slot>\n </template>\n\n <template\n v-for=\"(event, index) in allDayEvents(resource.id)\"\n :key=\"`all-${event.id}`\"\n >\n <Box\n v-bind=\"\n getStyles('resourcesDayViewAllDayEvent', { style: allDayEventStyle(index) })\n \"\n >\n <slot name=\"allDayEvent\" :event=\"event\">\n <ScheduleEvent\n :event=\"event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @click=\"\n isStatic ? undefined : emit('eventClick', event, $event as MouseEvent)\n \"\n />\n </slot>\n </Box>\n </template>\n\n <Box\n v-for=\"event in visibleRegularEvents(resource.id)\"\n :key=\"event.id\"\n v-bind=\"\n getStyles('resourcesDayViewEventWrapper', { style: eventWrapperStyle(event) })\n \"\n :data-resizing=\"resize.getResizePosition(event.id) !== null || undefined\"\n >\n <ScheduleEvent\n :event=\"event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(event)\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"isStatic ? undefined : clickEvent(event, $event as MouseEvent)\"\n />\n\n <template v-if=\"resize.isResizableEvent(event)\">\n <div\n v-for=\"edge in ['start', 'end'] as const\"\n :key=\"edge\"\n v-bind=\"staticStyles('resourcesDayViewResizeHandle')\"\n :data-edge=\"edge\"\n :data-active=\"resize.state.value?.edge === edge || undefined\"\n :aria-label=\"`${\n edge === 'start' ? 'Resize event start' : 'Resize event end'\n } ${event.title}`\"\n @dragstart.prevent\n @pointerdown=\"startResize(event, resourceIndex, edge, $event)\"\n />\n </template>\n </Box>\n\n <template\n v-for=\"entry in moreClusters(resource.id)\"\n :key=\"`more-${entry.cluster[0].id}`\"\n >\n <slot name=\"moreEvents\" :events=\"entry.cluster\" :hidden-count=\"entry.hiddenCount\">\n <MoreEvents\n :events=\"entry.cluster\"\n :more-events-count=\"entry.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"entry.style\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <UnstyledButton\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"interval.startTime\"\n :ref=\"setControl(resourceIndex, slotIndex)\"\n v-bind=\"staticStyles('resourcesDayViewRowSlot')\"\n :data-business-hours=\"businessHoursMods[slotIndex]['business-hours'] || undefined\"\n :data-non-business-hours=\"\n businessHoursMods[slotIndex]['non-business-hours'] || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id && dropTarget.slotIndex === slotIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(slotIndex, String(resource.id)) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"props.withDragSlotSelect ? slotIndex : undefined\"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :aria-label=\"`${getLabel('resourceSlot', props.labels)} ${String(resource.label)} ${date} ${interval.startTime} - ${interval.endTime}`\"\n :tabindex=\"isStatic ? -1 : resourceIndex === 0 && slotIndex === 0 ? 0 : -1\"\n @keydown=\"\n handleResourcesGridKeyDown({ controls, resourceIndex, slotIndex, event: $event })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown($event, slotIndex, String(resource.id))\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('timeSlotClick', {\n slotStart: `${date} ${interval.startTime}` as DateTimeStringValue,\n slotEnd: `${date} ${interval.endTime}` as DateTimeStringValue,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot\n name=\"timeSlot\"\n :resource=\"resource\"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n />\n </UnstyledButton>\n </Box>\n </Box>\n\n <template v-if=\"showIndicator\">\n <slot name=\"currentTimeIndicator\" :time=\"currentTime\" :offset=\"indicatorOffset\">\n <Box\n v-bind=\"\n getStyles('resourcesDayViewCurrentTimeIndicator', { style: indicatorStyle })\n \"\n >\n <div\n v-if=\"props.withCurrentTimeBubble\"\n v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorTimeBubble')\"\n >\n {{ currentTime }}\n </div>\n <div v-else v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorLine')\" />\n </Box>\n </slot>\n </template>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ResourcesDayViewComponent, { varsResolver } from './ResourcesDayView.vue'\nimport type { ResourcesDayViewFactory } from './ResourcesDayView.types'\nimport classes from './ResourcesDayView.module.css'\n\nexport const ResourcesDayView = factory<ResourcesDayViewFactory>(ResourcesDayViewComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n ResourceExternalDropData,\n ResourceSlotDragEndData,\n ResourceTimeSlotClickData,\n ResourceViewDropData,\n ResourcesDayViewCssVariables,\n ResourcesDayViewEmits,\n ResourcesDayViewFactory,\n ResourcesDayViewOwnProps,\n ResourcesDayViewOwnStylesNames,\n ResourcesDayViewProps,\n ResourcesDayViewSlots,\n ResourcesDayViewStylesNames,\n} from './ResourcesDayView.types'\n","import dayjs from 'dayjs'\nimport type { ScheduleEventData, ScheduleResourceData } from '../../../types'\nimport { expandRecurringEvents, isMultidayEvent } from '../../../utils'\nimport {\n getResourcesDayViewEvents,\n type ResourcesDayViewEventsResult,\n} from '../../ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events'\nimport { calculateEventDays } from '../../WeekView/get-week-view-events/calculate-event-days'\nimport { getEventEndDate } from '../../WeekView/get-week-view-events/get-event-end-date'\n\nexport interface ResourcesWeekViewAllDayBar {\n event: ScheduleEventData\n startDayIndex: number\n endDayIndex: number\n row: number\n}\n\nexport interface ResourcesWeekViewEventsResult {\n byDay: Record<string, ResourcesDayViewEventsResult>\n allDayBars: Record<string | number, ResourcesWeekViewAllDayBar[]>\n}\n\nfunction assignAllDayRows(bars: ResourcesWeekViewAllDayBar[]): void {\n const rowEnds: number[] = []\n ;[...bars]\n .sort((a, b) => a.startDayIndex - b.startDayIndex || a.endDayIndex - b.endDayIndex)\n .forEach((bar) => {\n let row = 0\n while (row < rowEnds.length && rowEnds[row] >= bar.startDayIndex) row += 1\n rowEnds[row] = bar.endDayIndex\n bar.row = row\n })\n}\n\nexport function getResourcesWeekViewEvents({\n events,\n resources,\n weekdays,\n startTime,\n endTime,\n intervalMinutes,\n expansionLimit,\n}: {\n events: ScheduleEventData[] | undefined\n resources: ScheduleResourceData[]\n weekdays: string[]\n startTime?: string\n endTime?: string\n intervalMinutes?: number\n expansionLimit?: number\n}): ResourcesWeekViewEventsResult {\n const expanded = expandRecurringEvents({\n events,\n rangeStart: dayjs(weekdays[0]).startOf('day').toDate(),\n rangeEnd: dayjs(weekdays.at(-1)).endOf('day').toDate(),\n expansionLimit,\n })\n const seen = new Set<string | number>()\n expanded?.forEach((event) => {\n if (seen.has(event.id)) {\n throw new Error(\n `[@mantine/schedule] ResourcesWeekView: Duplicated event ids found: ${event.id}`,\n )\n }\n seen.add(event.id)\n })\n\n const byDay: Record<string, ResourcesDayViewEventsResult> = {}\n const assigned = new Set<string | number>()\n const spanning = (event: ScheduleEventData) =>\n event.display !== 'background' && isMultidayEvent(event)\n weekdays.forEach((day) => {\n const dayEvents = expanded?.filter((event) => {\n if (assigned.has(event.id) || spanning(event)) return false\n const start = dayjs(event.start)\n const dayStart = dayjs(day).startOf('day')\n if (start.isSame(dayStart, 'day')) {\n assigned.add(event.id)\n return true\n }\n return (\n event.display === 'background' &&\n start.isBefore(dayjs(day).endOf('day')) &&\n dayjs(event.end).isAfter(dayStart)\n )\n })\n byDay[day] = getResourcesDayViewEvents({\n events: dayEvents,\n resources,\n date: day,\n startTime,\n endTime,\n intervalMinutes,\n })\n })\n\n const allDayBars: Record<string | number, ResourcesWeekViewAllDayBar[]> = {}\n resources.forEach((resource) => (allDayBars[resource.id] = []))\n weekdays.forEach((day, dayIndex) => {\n resources.forEach((resource) => {\n byDay[day].allDayEvents[resource.id]?.forEach((event) =>\n allDayBars[resource.id].push({\n event,\n startDayIndex: dayIndex,\n endDayIndex: dayIndex,\n row: 0,\n }),\n )\n })\n })\n expanded?.forEach((event) => {\n if (!spanning(event) || event.resourceId === undefined || !(event.resourceId in allDayBars))\n return\n const days = calculateEventDays({\n event,\n weekDays: weekdays,\n actualEndDate: getEventEndDate(event),\n })\n if (!days.length) return\n allDayBars[event.resourceId].push({\n event,\n startDayIndex: weekdays.indexOf(days[0]),\n endDayIndex: weekdays.indexOf(days.at(-1)!),\n row: 0,\n })\n })\n resources.forEach((resource) => assignAllDayRows(allDayBars[resource.id]))\n return { byDay, allDayBars }\n}\n",".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 @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 @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.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.resourcesWeekViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n.resourcesWeekViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\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.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.resourcesWeekViewHeaderContent {\n display: flex;\n flex-direction: column;\n}\n.resourcesWeekViewDayLabelsRow {\n display: flex;\n border-bottom: 1px solid var(--resources-week-view-border-color);\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 &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\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.resourcesWeekViewTimeLabelsRow {\n display: flex;\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 &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n}\n.resourcesWeekViewRow {\n display: flex;\n border-top: 1px solid var(--resources-week-view-border-color);\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 &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n &:where([data-has-groups]) {\n left: var(--resources-week-view-group-label-width);\n }\n}\n.resourcesWeekViewGroupColumn,\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.resourcesWeekViewGroupColumn {\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 overflow: visible;\n &:where([data-group-position='first'], [data-group-position='only']) {\n z-index: 13;\n }\n &:where([data-group-position='middle'], [data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-week-view-row-height) + 1px);\n }\n}\n.resourcesWeekViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-week-view-row-height);\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 &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where(:focus) {\n z-index: 1;\n }\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-color-blue-4);\n border-radius: 2px;\n }\n }\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-primary-color-2);\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.resourcesWeekViewAllDayEvent {\n position: absolute;\n height: var(--resources-week-view-all-day-height);\n z-index: 2;\n}\n.resourcesWeekViewEventWrapper {\n position: absolute;\n z-index: 3;\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 &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n &:where([data-edge='start']) {\n left: -2px;\n }\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n.resourcesWeekViewEventWrapper:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n}\n.resourcesWeekViewEventWrapper .resourcesWeekViewResizeHandle:hover,\n.resourcesWeekViewEventWrapper[data-resizing] .resourcesWeekViewResizeHandle[data-active] {\n opacity: 0.8;\n}\n.resourcesWeekViewEventWrapper[data-resizing] .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n}\n.resourcesWeekView:where([data-event-interaction]) .resourcesWeekViewRowSlot {\n pointer-events: none;\n}\n.resourcesWeekView:where([data-resizing]) * {\n cursor: ew-resize !important;\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 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.resourcesWeekViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n inset-block: 0;\n background-color: var(--_indicator-color);\n}\n.resourcesWeekViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: -5px;\n left: -5px;\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}\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 text-transform: uppercase;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesWeekViewOwnProps } from './ResourcesWeekView.types'\n\nconst defaultProps = {\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n withHeader: true,\n weekLabelFormat: 'MMM DD',\n slotWidth: 60,\n rowHeight: 64,\n groupLabelWidth: 80,\n businessHours: ['09:00:00', '17:00:00'],\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n maxEventsPerTimeSlot: 2,\n firstDayOfWeek: 1,\n weekendDays: [0, 6],\n withWeekendDays: true,\n weekdayFormat: 'ddd D',\n highlightToday: true,\n} satisfies Partial<ResourcesWeekViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesWeekView: {\n '--resources-week-view-radius': resolveScheduleRadius(radius),\n '--resources-week-view-slot-width': cssSize(slotWidth),\n '--resources-week-view-row-height': cssSize(rowHeight),\n '--resources-week-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, RESOURCE_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getOrderedResources,\n getWeekDays,\n handleResourcesGridKeyDown,\n isInTimeRange,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { getOverlapClusters } from '../ResourcesDayView/get-overlap-clusters/get-overlap-clusters'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getWeekLabel } from '../WeekView/get-week-label/get-week-label'\nimport { getResourcesWeekViewEvents } from './get-resources-week-view-events/get-resources-week-view-events'\nimport type { ResourcesWeekViewEmits, ResourcesWeekViewSlots } from './ResourcesWeekView.types'\nimport classes from './ResourcesWeekView.module.css'\n\ndefineOptions({\n name: 'ResourcesWeekView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesWeekViewOwnProps>(), {\n groups: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n slotLabelFormat: undefined,\n radius: undefined,\n startScrollDateTime: undefined,\n scrollAreaProps: undefined,\n locale: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n weekLabelFormat: undefined,\n renderWeekLabel: undefined,\n events: undefined,\n slotWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n labels: undefined,\n businessHours: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n firstDayOfWeek: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n weekdayFormat: undefined,\n highlightToday: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesWeekViewSlots>()\n\nconst emit = defineEmits<ResourcesWeekViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('ResourcesWeekView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesWeekView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesWeekView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; flatIndex: number } | null>(null)\nconst scrolledX = ref(false)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst weekdays = computed(() =>\n getWeekDays({\n week: props.date,\n firstDayOfWeek: props.firstDayOfWeek,\n weekendDays: props.weekendDays,\n withWeekendDays: props.withWeekendDays,\n }).map((day) => dayjs(day).format('YYYY-MM-DD') as DateStringValue),\n)\n\nconst slotsPerDay = computed(() => intervals.value.length)\nconst dayCount = computed(() => weekdays.value.length)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst resourceIdMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst weekEvents = computed(() =>\n getResourcesWeekViewEvents({\n events: props.events,\n resources: props.resources,\n weekdays: weekdays.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? new Date()))\n\nconst todayIndex = computed(() =>\n weekdays.value.findIndex((day) => dayjs(day).isSame(now.value, 'day')),\n)\n\nconst showIndicator = computed(\n () =>\n (props.withCurrentTimeIndicator ?? todayIndex.value !== -1) &&\n todayIndex.value !== -1 &&\n isInTimeRange({\n date: now.value.toDate(),\n startTime: props.startTime!,\n endTime: props.endTime!,\n }),\n)\n\nconst indicatorOffset = computed(() => {\n const timeOffset = getCurrentTimePosition({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n now: now.value,\n })\n\n return ((todayIndex.value + timeOffset / 100) / dayCount.value) * 100\n})\n\nconst currentTime = computed(() =>\n formatDate({ date: now.value, locale: props.locale || 'en', format: props.slotLabelFormat! }),\n)\n\nconst weekStart = computed(() => weekdays.value[0])\nconst weekEnd = computed(() => weekdays.value.at(-1)!)\n\nconst headerLabel = computed(\n () =>\n props.renderWeekLabel?.({ weekStart: weekStart.value, weekEnd: weekEnd.value }) ??\n getWeekLabel({\n weekdays: weekdays.value,\n locale: props.locale || 'en',\n weekLabelFormat: props.weekLabelFormat!,\n }),\n)\n\nconst businessHoursMods = computed(() =>\n weekdays.value.map((day) =>\n intervals.value.map((interval) =>\n getBusinessHoursMod({\n time: interval.startTime,\n businessHours: props.businessHours,\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayjs(day).day() as DayOfWeek,\n }),\n ),\n ),\n)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const count = slotsPerDay.value\n const startDay = weekdays.value[Math.floor(start / count)]\n const endDay = weekdays.value[Math.floor(end / count)]\n const first = intervals.value[start % count]\n const last = intervals.value[end % count]\n\n if (first && last && startDay && endDay) {\n emit('slotDragEnd', {\n rangeStart: `${startDay} ${first.startTime}` as DateTimeStringValue,\n rangeEnd: `${endDay} ${last.endTime}` as DateTimeStringValue,\n resourceId: resourceIdMap.value.get(group),\n })\n }\n },\n})\n\nconst resize = useHorizontalEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nonMounted(async () => {\n if (!props.startScrollDateTime) {\n return\n }\n\n await nextTick()\n\n const target = dayjs(props.startScrollDateTime)\n const dayIndex = weekdays.value.findIndex((day) => dayjs(day).isSame(target, 'day'))\n\n if (dayIndex < 0) {\n return\n }\n\n const targetTime = target.format('HH:mm:ss')\n const intervalIndex = intervals.value.findIndex((interval) => interval.startTime >= targetTime)\n\n if (intervalIndex < 0) {\n return\n }\n\n const flatIndex = dayIndex * slotsPerDay.value + intervalIndex\n\n scrollSlotIntoView(controls[0]?.[flatIndex], 'x')\n})\n\nconst setControl = (resourceIndex: number, flatIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][flatIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n const node = (element as { $el?: HTMLElement } | null)?.$el ?? element\n\n if (node instanceof HTMLElement) {\n rowContainers.set(resourceIndex, node)\n }\n}\n\nconst withDragHandlers = computed(\n () => Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop),\n)\n\nconst getFlatIndexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n const count = slotsPerDay.value * dayCount.value\n\n if (!container || count === 0) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(count - 1, Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * count)),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, flatIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const count = slotsPerDay.value\n const day = weekdays.value[Math.floor(flatIndex / count)]\n const interval = intervals.value[flatIndex % count]\n\n if (!day || !interval) {\n return\n }\n\n const target = `${day} ${interval.startTime}` as DateTimeStringValue\n const event = getDropEvent(props.events, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', { ...moveEventTo(event, target), resourceId })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: target,\n resourceId,\n })\n }\n}\n\nconst setDropTarget = (next: { resourceId: string | number; flatIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.flatIndex === next.flatIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const flatIndex = getFlatIndexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(flatIndex < 0 ? null : { resourceId, flatIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n if (isStatic.value) {\n return\n }\n\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const related = nativeEvent.relatedTarget\n const current = nativeEvent.currentTarget\n\n if (\n !(related instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(related)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const flatIndex = getFlatIndexAtPoint(nativeEvent, resourceIndex)\n\n if (flatIndex >= 0) {\n emitDrop(nativeEvent, resource.id, flatIndex)\n }\n}\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-week-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst dayOffset = (dayIndex: number) => (dayIndex / dayCount.value) * 100\nconst dayWidth = computed(() => 100 / dayCount.value)\n\nconst backgroundEvents = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) => {\n const data = weekEvents.value.byDay[day]\n\n return [\n ...(data.backgroundTimedEvents[resourceId] || []),\n ...(data.backgroundAllDayEvents[resourceId] || []),\n ].map((event) => ({ event, day, dayIndex }))\n })\n\nconst backgroundEventStyle = (event: ScheduleEventData & { position: any }, dayIndex: number) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n\n return {\n left: `${dayOffset(dayIndex) + (event.position.top / 100) * dayWidth.value}%`,\n right: `${\n 100 -\n dayOffset(dayIndex) -\n ((event.position.top + event.position.height) / 100) * dayWidth.value\n }%`,\n minWidth: '1px',\n top: 0,\n height: '100%',\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n }\n}\n\nconst regularEvents = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) =>\n (weekEvents.value.byDay[day].regularEvents[resourceId] || [])\n .filter((event) => event.position.column < Math.max(1, props.maxEventsPerTimeSlot!))\n .map((event) => ({ event, day, dayIndex })),\n )\n\nconst eventWrapperStyle = (event: ScheduleEventData & { position: any }, dayIndex: number) => {\n const position = resize.getResizePosition(event.id)\n const relativeLeft = position?.left ?? event.position.top\n const relativeWidth = position?.width ?? event.position.height\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n\n return {\n '--event-color': colors.color,\n left: `calc(${dayOffset(dayIndex) + (relativeLeft / 100) * dayWidth.value}% + 1px)`,\n width: `calc(${(relativeWidth / 100) * dayWidth.value}% - 2px)`,\n top: `${event.position.offset}%`,\n height: `${event.position.width}%`,\n }\n}\n\nconst moreClusters = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) =>\n getOverlapClusters(weekEvents.value.byDay[day].regularEvents[resourceId] || [])\n .filter((cluster) =>\n cluster.some((event) => event.position.column >= props.maxEventsPerTimeSlot!),\n )\n .map((cluster) => {\n const left = Math.min(...cluster.map((event) => event.position.top))\n const right = Math.max(\n ...cluster.map((event) => event.position.top + event.position.height),\n )\n\n return {\n cluster,\n day,\n hiddenCount: cluster.filter(\n (event) => event.position.column >= props.maxEventsPerTimeSlot!,\n ).length,\n style: {\n position: 'absolute' as const,\n left: `calc(${dayOffset(dayIndex) + (left / 100) * dayWidth.value}% + 1px)`,\n width: `calc(${((right - left) / 100) * dayWidth.value}% - 2px)`,\n bottom: 0,\n height: '22px',\n zIndex: 4,\n },\n }\n }),\n )\n\nconst allDayBars = (resourceId: string | number) => weekEvents.value.allDayBars[resourceId] || []\n\nconst allDayBarStyle = (bar: { startDayIndex: number; endDayIndex: number; row: number }) => ({\n left: `calc(${(bar.startDayIndex / dayCount.value) * 100}% + 1px)`,\n width: `calc(${((bar.endDayIndex - bar.startDayIndex + 1) / dayCount.value) * 100}% - 2px)`,\n top: `calc(${bar.row} * (var(--resources-week-view-all-day-height) + 2px) + 2px)`,\n})\n\nconst rowMinHeight = (resourceId: string | number) => {\n const bars = allDayBars(resourceId)\n const rows = bars.length ? Math.max(...bars.map((bar) => bar.row)) + 1 : 0\n\n return rows\n ? {\n minHeight: `max(var(--resources-week-view-row-height), calc(${rows} * (var(--resources-week-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined\n}\n\nconst cornerStyle = computed(() =>\n hasGroups.value\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\nconst dayLabelStyle = computed(() => ({\n flex: `0 0 calc(var(--resources-week-view-slot-width) * ${slotsPerDay.value})`,\n}))\n\nconst indicatorStyle = computed(() => ({\n '--indicator-left-offset': hasGroups.value\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)) * ${indicatorOffset.value} / 100)`\n : `calc(var(--resources-week-view-resource-label-width) + (100% - var(--resources-week-view-resource-label-width)) * ${indicatorOffset.value} / 100)`,\n '--_time-bubble-width': String(currentTime.value).toLowerCase().includes('m') ? '64px' : '46px',\n}))\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!resize.wasResizing()) {\n emit('eventClick', event, nativeEvent)\n }\n}\n\nconst startResize = (\n event: ScheduleEventData & { position: any },\n day: DateStringValue,\n dayIndex: number,\n resourceIndex: number,\n edge: 'start' | 'end',\n pointerEvent: PointerEvent,\n) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container) {\n return\n }\n\n resize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: day,\n dayIndex,\n dayCount: dayCount.value,\n pointerEvent,\n })\n}\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n\n if (!target) {\n return null\n }\n\n const count = slotsPerDay.value\n const day = weekdays.value[Math.floor(target.flatIndex / count)]\n\n return day\n ? {\n date: day,\n slotIndex: target.flatIndex % count,\n time: intervals.value[target.flatIndex % count]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesWeekView') }\"\n :root-ref=\"setRootElement\"\n :data-resizing=\"resize.state.value ? true : undefined\"\n :data-event-interaction=\"resize.state.value ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :week-start=\"weekStart\" :week-end=\"weekEnd\" :label=\"headerLabel\">\n <ScheduleHeaderBase\n view=\"week\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'week')\"\n :control=\"{ title: headerLabel }\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesWeekViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesWeekViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n @scroll-position-change=\"(position) => (scrolledX = position.x !== 0)\"\n >\n <div v-bind=\"getStyles('resourcesWeekViewInner')\">\n <Box v-bind=\"getStyles('resourcesWeekViewHeaderRows')\">\n <div v-bind=\"getStyles('resourcesWeekViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <div v-bind=\"getStyles('resourcesWeekViewHeaderContent')\">\n <div v-bind=\"getStyles('resourcesWeekViewDayLabelsRow')\">\n <Box\n v-for=\"day in weekdays\"\n :key=\"day\"\n v-bind=\"getStyles('resourcesWeekViewDayLabel', { style: dayLabelStyle })\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-today=\"(props.highlightToday && dayjs(day).isSame(now, 'day')) || undefined\"\n >\n <slot\n name=\"dayLabel\"\n :date=\"day\"\n :label=\"\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n \"\n >\n {{\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n }}\n </slot>\n </Box>\n </div>\n\n <div v-bind=\"getStyles('resourcesWeekViewTimeLabelsRow')\">\n <template v-for=\"(day, dayIndex) in weekdays\" :key=\"day\">\n <Box\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"`${day}-${interval.startTime}`\"\n v-bind=\"staticStyles('resourcesWeekViewTimeLabel')\"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n >\n <slot\n name=\"timeLabel\"\n :date=\"day\"\n :label=\"\n formatDate({\n date: `${day} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n \"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n >\n {{\n formatDate({\n date: `${day} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </slot>\n </Box>\n </template>\n </div>\n </div>\n </Box>\n\n <Box\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesWeekViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesWeekViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesWeekViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <Box\n v-bind=\"staticStyles('resourcesWeekViewResourceLabel')\"\n :data-scrolled-x=\"scrolledX || undefined\"\n :data-has-groups=\"groupInfo(resourceIndex) !== undefined || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </Box>\n\n <Box\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"getStyles('resourcesWeekViewRowSlots', { style: rowMinHeight(resource.id) })\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"withDragHandlers ? handleRowDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <template\n v-for=\"entry in backgroundEvents(resource.id)\"\n :key=\"`bg-${entry.day}-${entry.event.id}`\"\n >\n <slot name=\"backgroundEvent\" :event=\"entry.event\" :date=\"entry.day\">\n <Box\n v-bind=\"\n getStyles('resourcesWeekViewBackgroundEvent', {\n style: backgroundEventStyle(entry.event, entry.dayIndex),\n })\n \"\n >\n <component\n :is=\"() => eventRenderers.renderEventBody!(entry.event)\"\n v-if=\"eventRenderers.renderEventBody\"\n />\n <template v-else>{{ entry.event.title }}</template>\n </Box>\n </slot>\n </template>\n\n <template v-for=\"bar in allDayBars(resource.id)\" :key=\"`all-${bar.event.id}`\">\n <Box\n v-bind=\"getStyles('resourcesWeekViewAllDayEvent', { style: allDayBarStyle(bar) })\"\n >\n <slot\n name=\"allDayEvent\"\n :event=\"bar.event\"\n :start-day-index=\"bar.startDayIndex\"\n :end-day-index=\"bar.endDayIndex\"\n >\n <ScheduleEvent\n :event=\"bar.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @click=\"\n isStatic ? undefined : emit('eventClick', bar.event, $event as MouseEvent)\n \"\n />\n </slot>\n </Box>\n </template>\n\n <Box\n v-for=\"entry in regularEvents(resource.id)\"\n :key=\"`${entry.day}-${entry.event.id}`\"\n v-bind=\"\n getStyles('resourcesWeekViewEventWrapper', {\n style: eventWrapperStyle(entry.event, entry.dayIndex),\n })\n \"\n :data-resizing=\"resize.getResizePosition(entry.event.id) !== null || undefined\"\n >\n <ScheduleEvent\n :event=\"entry.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(entry.event)\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"isStatic ? undefined : clickEvent(entry.event, $event as MouseEvent)\"\n />\n\n <template v-if=\"resize.isResizableEvent(entry.event)\">\n <div\n v-for=\"edge in ['start', 'end'] as const\"\n :key=\"edge\"\n v-bind=\"staticStyles('resourcesWeekViewResizeHandle')\"\n :data-edge=\"edge\"\n :data-active=\"resize.state.value?.edge === edge || undefined\"\n :aria-label=\"`${\n edge === 'start' ? 'Resize event start' : 'Resize event end'\n } ${entry.event.title}`\"\n @dragstart.prevent\n @pointerdown=\"\n startResize(\n entry.event,\n entry.day,\n entry.dayIndex,\n resourceIndex,\n edge,\n $event,\n )\n \"\n />\n </template>\n </Box>\n\n <template\n v-for=\"entry in moreClusters(resource.id)\"\n :key=\"`more-${entry.day}-${entry.cluster[0].id}`\"\n >\n <slot\n name=\"moreEvents\"\n :events=\"entry.cluster\"\n :hidden-count=\"entry.hiddenCount\"\n :date=\"entry.day\"\n >\n <MoreEvents\n :events=\"entry.cluster\"\n :more-events-count=\"entry.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"entry.style\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <template v-for=\"(day, dayIndex) in weekdays\" :key=\"`slots-${day}`\">\n <UnstyledButton\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"`${day}-${interval.startTime}`\"\n :ref=\"setControl(resourceIndex, dayIndex * slotsPerDay + slotIndex)\"\n v-bind=\"staticStyles('resourcesWeekViewRowSlot')\"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id &&\n dropTarget.flatIndex === dayIndex * slotsPerDay + slotIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(\n dayIndex * slotsPerDay + slotIndex,\n String(resource.id),\n ) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"\n props.withDragSlotSelect ? dayIndex * slotsPerDay + slotIndex : undefined\n \"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :aria-label=\"`${getLabel('resourceSlot', props.labels)} ${String(resource.label)} ${day} ${interval.startTime} - ${interval.endTime}`\"\n :tabindex=\"\n isStatic\n ? -1\n : resourceIndex === 0 && dayIndex === 0 && slotIndex === 0\n ? 0\n : -1\n \"\n @keydown=\"\n handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex: dayIndex * slotsPerDay + slotIndex,\n event: $event,\n })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown(\n $event,\n dayIndex * slotsPerDay + slotIndex,\n String(resource.id),\n )\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('timeSlotClick', {\n slotStart: `${day} ${interval.startTime}` as DateTimeStringValue,\n slotEnd: `${day} ${interval.endTime}` as DateTimeStringValue,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot\n name=\"timeSlot\"\n :resource=\"resource\"\n :date=\"day\"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n />\n </UnstyledButton>\n </template>\n </Box>\n </Box>\n\n <template v-if=\"showIndicator\">\n <slot\n name=\"currentTimeIndicator\"\n :time=\"currentTime\"\n :offset=\"indicatorOffset\"\n :date=\"weekdays[todayIndex]\"\n >\n <Box\n v-bind=\"\n getStyles('resourcesWeekViewCurrentTimeIndicator', { style: indicatorStyle })\n \"\n >\n <div\n v-if=\"props.withCurrentTimeBubble\"\n v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorTimeBubble')\"\n >\n {{ currentTime }}\n </div>\n <div v-else v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorLine')\" />\n </Box>\n </slot>\n </template>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesWeekViewOwnProps } from './ResourcesWeekView.types'\n\nconst defaultProps = {\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n withHeader: true,\n weekLabelFormat: 'MMM DD',\n slotWidth: 60,\n rowHeight: 64,\n groupLabelWidth: 80,\n businessHours: ['09:00:00', '17:00:00'],\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n maxEventsPerTimeSlot: 2,\n firstDayOfWeek: 1,\n weekendDays: [0, 6],\n withWeekendDays: true,\n weekdayFormat: 'ddd D',\n highlightToday: true,\n} satisfies Partial<ResourcesWeekViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesWeekView: {\n '--resources-week-view-radius': resolveScheduleRadius(radius),\n '--resources-week-view-slot-width': cssSize(slotWidth),\n '--resources-week-view-row-height': cssSize(rowHeight),\n '--resources-week-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, RESOURCE_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getOrderedResources,\n getWeekDays,\n handleResourcesGridKeyDown,\n isInTimeRange,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { getOverlapClusters } from '../ResourcesDayView/get-overlap-clusters/get-overlap-clusters'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getWeekLabel } from '../WeekView/get-week-label/get-week-label'\nimport { getResourcesWeekViewEvents } from './get-resources-week-view-events/get-resources-week-view-events'\nimport type { ResourcesWeekViewEmits, ResourcesWeekViewSlots } from './ResourcesWeekView.types'\nimport classes from './ResourcesWeekView.module.css'\n\ndefineOptions({\n name: 'ResourcesWeekView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesWeekViewOwnProps>(), {\n groups: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n slotLabelFormat: undefined,\n radius: undefined,\n startScrollDateTime: undefined,\n scrollAreaProps: undefined,\n locale: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n weekLabelFormat: undefined,\n renderWeekLabel: undefined,\n events: undefined,\n slotWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n labels: undefined,\n businessHours: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n firstDayOfWeek: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n weekdayFormat: undefined,\n highlightToday: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesWeekViewSlots>()\n\nconst emit = defineEmits<ResourcesWeekViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('ResourcesWeekView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesWeekView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesWeekView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; flatIndex: number } | null>(null)\nconst scrolledX = ref(false)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst weekdays = computed(() =>\n getWeekDays({\n week: props.date,\n firstDayOfWeek: props.firstDayOfWeek,\n weekendDays: props.weekendDays,\n withWeekendDays: props.withWeekendDays,\n }).map((day) => dayjs(day).format('YYYY-MM-DD') as DateStringValue),\n)\n\nconst slotsPerDay = computed(() => intervals.value.length)\nconst dayCount = computed(() => weekdays.value.length)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst resourceIdMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst weekEvents = computed(() =>\n getResourcesWeekViewEvents({\n events: props.events,\n resources: props.resources,\n weekdays: weekdays.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? new Date()))\n\nconst todayIndex = computed(() =>\n weekdays.value.findIndex((day) => dayjs(day).isSame(now.value, 'day')),\n)\n\nconst showIndicator = computed(\n () =>\n (props.withCurrentTimeIndicator ?? todayIndex.value !== -1) &&\n todayIndex.value !== -1 &&\n isInTimeRange({\n date: now.value.toDate(),\n startTime: props.startTime!,\n endTime: props.endTime!,\n }),\n)\n\nconst indicatorOffset = computed(() => {\n const timeOffset = getCurrentTimePosition({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n now: now.value,\n })\n\n return ((todayIndex.value + timeOffset / 100) / dayCount.value) * 100\n})\n\nconst currentTime = computed(() =>\n formatDate({ date: now.value, locale: props.locale || 'en', format: props.slotLabelFormat! }),\n)\n\nconst weekStart = computed(() => weekdays.value[0])\nconst weekEnd = computed(() => weekdays.value.at(-1)!)\n\nconst headerLabel = computed(\n () =>\n props.renderWeekLabel?.({ weekStart: weekStart.value, weekEnd: weekEnd.value }) ??\n getWeekLabel({\n weekdays: weekdays.value,\n locale: props.locale || 'en',\n weekLabelFormat: props.weekLabelFormat!,\n }),\n)\n\nconst businessHoursMods = computed(() =>\n weekdays.value.map((day) =>\n intervals.value.map((interval) =>\n getBusinessHoursMod({\n time: interval.startTime,\n businessHours: props.businessHours,\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayjs(day).day() as DayOfWeek,\n }),\n ),\n ),\n)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const count = slotsPerDay.value\n const startDay = weekdays.value[Math.floor(start / count)]\n const endDay = weekdays.value[Math.floor(end / count)]\n const first = intervals.value[start % count]\n const last = intervals.value[end % count]\n\n if (first && last && startDay && endDay) {\n emit('slotDragEnd', {\n rangeStart: `${startDay} ${first.startTime}` as DateTimeStringValue,\n rangeEnd: `${endDay} ${last.endTime}` as DateTimeStringValue,\n resourceId: resourceIdMap.value.get(group),\n })\n }\n },\n})\n\nconst resize = useHorizontalEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nonMounted(async () => {\n if (!props.startScrollDateTime) {\n return\n }\n\n await nextTick()\n\n const target = dayjs(props.startScrollDateTime)\n const dayIndex = weekdays.value.findIndex((day) => dayjs(day).isSame(target, 'day'))\n\n if (dayIndex < 0) {\n return\n }\n\n const targetTime = target.format('HH:mm:ss')\n const intervalIndex = intervals.value.findIndex((interval) => interval.startTime >= targetTime)\n\n if (intervalIndex < 0) {\n return\n }\n\n const flatIndex = dayIndex * slotsPerDay.value + intervalIndex\n\n scrollSlotIntoView(controls[0]?.[flatIndex], 'x')\n})\n\nconst setControl = (resourceIndex: number, flatIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][flatIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n const node = (element as { $el?: HTMLElement } | null)?.$el ?? element\n\n if (node instanceof HTMLElement) {\n rowContainers.set(resourceIndex, node)\n }\n}\n\nconst withDragHandlers = computed(\n () => Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop),\n)\n\nconst getFlatIndexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n const count = slotsPerDay.value * dayCount.value\n\n if (!container || count === 0) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(count - 1, Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * count)),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, flatIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const count = slotsPerDay.value\n const day = weekdays.value[Math.floor(flatIndex / count)]\n const interval = intervals.value[flatIndex % count]\n\n if (!day || !interval) {\n return\n }\n\n const target = `${day} ${interval.startTime}` as DateTimeStringValue\n const event = getDropEvent(props.events, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', { ...moveEventTo(event, target), resourceId })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: target,\n resourceId,\n })\n }\n}\n\nconst setDropTarget = (next: { resourceId: string | number; flatIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.flatIndex === next.flatIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const flatIndex = getFlatIndexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(flatIndex < 0 ? null : { resourceId, flatIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n if (isStatic.value) {\n return\n }\n\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const related = nativeEvent.relatedTarget\n const current = nativeEvent.currentTarget\n\n if (\n !(related instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(related)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const flatIndex = getFlatIndexAtPoint(nativeEvent, resourceIndex)\n\n if (flatIndex >= 0) {\n emitDrop(nativeEvent, resource.id, flatIndex)\n }\n}\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-week-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst dayOffset = (dayIndex: number) => (dayIndex / dayCount.value) * 100\nconst dayWidth = computed(() => 100 / dayCount.value)\n\nconst backgroundEvents = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) => {\n const data = weekEvents.value.byDay[day]\n\n return [\n ...(data.backgroundTimedEvents[resourceId] || []),\n ...(data.backgroundAllDayEvents[resourceId] || []),\n ].map((event) => ({ event, day, dayIndex }))\n })\n\nconst backgroundEventStyle = (event: ScheduleEventData & { position: any }, dayIndex: number) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n\n return {\n left: `${dayOffset(dayIndex) + (event.position.top / 100) * dayWidth.value}%`,\n right: `${\n 100 -\n dayOffset(dayIndex) -\n ((event.position.top + event.position.height) / 100) * dayWidth.value\n }%`,\n minWidth: '1px',\n top: 0,\n height: '100%',\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n }\n}\n\nconst regularEvents = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) =>\n (weekEvents.value.byDay[day].regularEvents[resourceId] || [])\n .filter((event) => event.position.column < Math.max(1, props.maxEventsPerTimeSlot!))\n .map((event) => ({ event, day, dayIndex })),\n )\n\nconst eventWrapperStyle = (event: ScheduleEventData & { position: any }, dayIndex: number) => {\n const position = resize.getResizePosition(event.id)\n const relativeLeft = position?.left ?? event.position.top\n const relativeWidth = position?.width ?? event.position.height\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n\n return {\n '--event-color': colors.color,\n left: `calc(${dayOffset(dayIndex) + (relativeLeft / 100) * dayWidth.value}% + 1px)`,\n width: `calc(${(relativeWidth / 100) * dayWidth.value}% - 2px)`,\n top: `${event.position.offset}%`,\n height: `${event.position.width}%`,\n }\n}\n\nconst moreClusters = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) =>\n getOverlapClusters(weekEvents.value.byDay[day].regularEvents[resourceId] || [])\n .filter((cluster) =>\n cluster.some((event) => event.position.column >= props.maxEventsPerTimeSlot!),\n )\n .map((cluster) => {\n const left = Math.min(...cluster.map((event) => event.position.top))\n const right = Math.max(\n ...cluster.map((event) => event.position.top + event.position.height),\n )\n\n return {\n cluster,\n day,\n hiddenCount: cluster.filter(\n (event) => event.position.column >= props.maxEventsPerTimeSlot!,\n ).length,\n style: {\n position: 'absolute' as const,\n left: `calc(${dayOffset(dayIndex) + (left / 100) * dayWidth.value}% + 1px)`,\n width: `calc(${((right - left) / 100) * dayWidth.value}% - 2px)`,\n bottom: 0,\n height: '22px',\n zIndex: 4,\n },\n }\n }),\n )\n\nconst allDayBars = (resourceId: string | number) => weekEvents.value.allDayBars[resourceId] || []\n\nconst allDayBarStyle = (bar: { startDayIndex: number; endDayIndex: number; row: number }) => ({\n left: `calc(${(bar.startDayIndex / dayCount.value) * 100}% + 1px)`,\n width: `calc(${((bar.endDayIndex - bar.startDayIndex + 1) / dayCount.value) * 100}% - 2px)`,\n top: `calc(${bar.row} * (var(--resources-week-view-all-day-height) + 2px) + 2px)`,\n})\n\nconst rowMinHeight = (resourceId: string | number) => {\n const bars = allDayBars(resourceId)\n const rows = bars.length ? Math.max(...bars.map((bar) => bar.row)) + 1 : 0\n\n return rows\n ? {\n minHeight: `max(var(--resources-week-view-row-height), calc(${rows} * (var(--resources-week-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined\n}\n\nconst cornerStyle = computed(() =>\n hasGroups.value\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\nconst dayLabelStyle = computed(() => ({\n flex: `0 0 calc(var(--resources-week-view-slot-width) * ${slotsPerDay.value})`,\n}))\n\nconst indicatorStyle = computed(() => ({\n '--indicator-left-offset': hasGroups.value\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)) * ${indicatorOffset.value} / 100)`\n : `calc(var(--resources-week-view-resource-label-width) + (100% - var(--resources-week-view-resource-label-width)) * ${indicatorOffset.value} / 100)`,\n '--_time-bubble-width': String(currentTime.value).toLowerCase().includes('m') ? '64px' : '46px',\n}))\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!resize.wasResizing()) {\n emit('eventClick', event, nativeEvent)\n }\n}\n\nconst startResize = (\n event: ScheduleEventData & { position: any },\n day: DateStringValue,\n dayIndex: number,\n resourceIndex: number,\n edge: 'start' | 'end',\n pointerEvent: PointerEvent,\n) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container) {\n return\n }\n\n resize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: day,\n dayIndex,\n dayCount: dayCount.value,\n pointerEvent,\n })\n}\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n\n if (!target) {\n return null\n }\n\n const count = slotsPerDay.value\n const day = weekdays.value[Math.floor(target.flatIndex / count)]\n\n return day\n ? {\n date: day,\n slotIndex: target.flatIndex % count,\n time: intervals.value[target.flatIndex % count]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesWeekView') }\"\n :root-ref=\"setRootElement\"\n :data-resizing=\"resize.state.value ? true : undefined\"\n :data-event-interaction=\"resize.state.value ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :week-start=\"weekStart\" :week-end=\"weekEnd\" :label=\"headerLabel\">\n <ScheduleHeaderBase\n view=\"week\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'week')\"\n :control=\"{ title: headerLabel }\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesWeekViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesWeekViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n @scroll-position-change=\"(position) => (scrolledX = position.x !== 0)\"\n >\n <div v-bind=\"getStyles('resourcesWeekViewInner')\">\n <Box v-bind=\"getStyles('resourcesWeekViewHeaderRows')\">\n <div v-bind=\"getStyles('resourcesWeekViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <div v-bind=\"getStyles('resourcesWeekViewHeaderContent')\">\n <div v-bind=\"getStyles('resourcesWeekViewDayLabelsRow')\">\n <Box\n v-for=\"day in weekdays\"\n :key=\"day\"\n v-bind=\"getStyles('resourcesWeekViewDayLabel', { style: dayLabelStyle })\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-today=\"(props.highlightToday && dayjs(day).isSame(now, 'day')) || undefined\"\n >\n <slot\n name=\"dayLabel\"\n :date=\"day\"\n :label=\"\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n \"\n >\n {{\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n }}\n </slot>\n </Box>\n </div>\n\n <div v-bind=\"getStyles('resourcesWeekViewTimeLabelsRow')\">\n <template v-for=\"(day, dayIndex) in weekdays\" :key=\"day\">\n <Box\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"`${day}-${interval.startTime}`\"\n v-bind=\"staticStyles('resourcesWeekViewTimeLabel')\"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n >\n <slot\n name=\"timeLabel\"\n :date=\"day\"\n :label=\"\n formatDate({\n date: `${day} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n \"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n >\n {{\n formatDate({\n date: `${day} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </slot>\n </Box>\n </template>\n </div>\n </div>\n </Box>\n\n <Box\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesWeekViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesWeekViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesWeekViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <Box\n v-bind=\"staticStyles('resourcesWeekViewResourceLabel')\"\n :data-scrolled-x=\"scrolledX || undefined\"\n :data-has-groups=\"groupInfo(resourceIndex) !== undefined || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </Box>\n\n <Box\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"getStyles('resourcesWeekViewRowSlots', { style: rowMinHeight(resource.id) })\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"withDragHandlers ? handleRowDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <template\n v-for=\"entry in backgroundEvents(resource.id)\"\n :key=\"`bg-${entry.day}-${entry.event.id}`\"\n >\n <slot name=\"backgroundEvent\" :event=\"entry.event\" :date=\"entry.day\">\n <Box\n v-bind=\"\n getStyles('resourcesWeekViewBackgroundEvent', {\n style: backgroundEventStyle(entry.event, entry.dayIndex),\n })\n \"\n >\n <component\n :is=\"() => eventRenderers.renderEventBody!(entry.event)\"\n v-if=\"eventRenderers.renderEventBody\"\n />\n <template v-else>{{ entry.event.title }}</template>\n </Box>\n </slot>\n </template>\n\n <template v-for=\"bar in allDayBars(resource.id)\" :key=\"`all-${bar.event.id}`\">\n <Box\n v-bind=\"getStyles('resourcesWeekViewAllDayEvent', { style: allDayBarStyle(bar) })\"\n >\n <slot\n name=\"allDayEvent\"\n :event=\"bar.event\"\n :start-day-index=\"bar.startDayIndex\"\n :end-day-index=\"bar.endDayIndex\"\n >\n <ScheduleEvent\n :event=\"bar.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @click=\"\n isStatic ? undefined : emit('eventClick', bar.event, $event as MouseEvent)\n \"\n />\n </slot>\n </Box>\n </template>\n\n <Box\n v-for=\"entry in regularEvents(resource.id)\"\n :key=\"`${entry.day}-${entry.event.id}`\"\n v-bind=\"\n getStyles('resourcesWeekViewEventWrapper', {\n style: eventWrapperStyle(entry.event, entry.dayIndex),\n })\n \"\n :data-resizing=\"resize.getResizePosition(entry.event.id) !== null || undefined\"\n >\n <ScheduleEvent\n :event=\"entry.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(entry.event)\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"isStatic ? undefined : clickEvent(entry.event, $event as MouseEvent)\"\n />\n\n <template v-if=\"resize.isResizableEvent(entry.event)\">\n <div\n v-for=\"edge in ['start', 'end'] as const\"\n :key=\"edge\"\n v-bind=\"staticStyles('resourcesWeekViewResizeHandle')\"\n :data-edge=\"edge\"\n :data-active=\"resize.state.value?.edge === edge || undefined\"\n :aria-label=\"`${\n edge === 'start' ? 'Resize event start' : 'Resize event end'\n } ${entry.event.title}`\"\n @dragstart.prevent\n @pointerdown=\"\n startResize(\n entry.event,\n entry.day,\n entry.dayIndex,\n resourceIndex,\n edge,\n $event,\n )\n \"\n />\n </template>\n </Box>\n\n <template\n v-for=\"entry in moreClusters(resource.id)\"\n :key=\"`more-${entry.day}-${entry.cluster[0].id}`\"\n >\n <slot\n name=\"moreEvents\"\n :events=\"entry.cluster\"\n :hidden-count=\"entry.hiddenCount\"\n :date=\"entry.day\"\n >\n <MoreEvents\n :events=\"entry.cluster\"\n :more-events-count=\"entry.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"entry.style\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <template v-for=\"(day, dayIndex) in weekdays\" :key=\"`slots-${day}`\">\n <UnstyledButton\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"`${day}-${interval.startTime}`\"\n :ref=\"setControl(resourceIndex, dayIndex * slotsPerDay + slotIndex)\"\n v-bind=\"staticStyles('resourcesWeekViewRowSlot')\"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id &&\n dropTarget.flatIndex === dayIndex * slotsPerDay + slotIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(\n dayIndex * slotsPerDay + slotIndex,\n String(resource.id),\n ) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"\n props.withDragSlotSelect ? dayIndex * slotsPerDay + slotIndex : undefined\n \"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :aria-label=\"`${getLabel('resourceSlot', props.labels)} ${String(resource.label)} ${day} ${interval.startTime} - ${interval.endTime}`\"\n :tabindex=\"\n isStatic\n ? -1\n : resourceIndex === 0 && dayIndex === 0 && slotIndex === 0\n ? 0\n : -1\n \"\n @keydown=\"\n handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex: dayIndex * slotsPerDay + slotIndex,\n event: $event,\n })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown(\n $event,\n dayIndex * slotsPerDay + slotIndex,\n String(resource.id),\n )\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('timeSlotClick', {\n slotStart: `${day} ${interval.startTime}` as DateTimeStringValue,\n slotEnd: `${day} ${interval.endTime}` as DateTimeStringValue,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot\n name=\"timeSlot\"\n :resource=\"resource\"\n :date=\"day\"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n />\n </UnstyledButton>\n </template>\n </Box>\n </Box>\n\n <template v-if=\"showIndicator\">\n <slot\n name=\"currentTimeIndicator\"\n :time=\"currentTime\"\n :offset=\"indicatorOffset\"\n :date=\"weekdays[todayIndex]\"\n >\n <Box\n v-bind=\"\n getStyles('resourcesWeekViewCurrentTimeIndicator', { style: indicatorStyle })\n \"\n >\n <div\n v-if=\"props.withCurrentTimeBubble\"\n v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorTimeBubble')\"\n >\n {{ currentTime }}\n </div>\n <div v-else v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorLine')\" />\n </Box>\n </slot>\n </template>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ResourcesWeekViewComponent, { varsResolver } from './ResourcesWeekView.vue'\nimport type { ResourcesWeekViewFactory } from './ResourcesWeekView.types'\nimport classes from './ResourcesWeekView.module.css'\n\nexport const ResourcesWeekView = factory<ResourcesWeekViewFactory>(ResourcesWeekViewComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n ResourcesWeekViewCssVariables,\n ResourcesWeekViewEmits,\n ResourcesWeekViewFactory,\n ResourcesWeekViewOwnProps,\n ResourcesWeekViewOwnStylesNames,\n ResourcesWeekViewProps,\n ResourcesWeekViewSlots,\n ResourcesWeekViewStylesNames,\n} from './ResourcesWeekView.types'\n","import dayjs from 'dayjs'\nimport type { DateStringValue, ScheduleEventData } from '../../../types'\n\n/** One day cell of a resource row: the events that fit, and how many did not. */\nexport interface ResourcesMonthViewCellLayout {\n /** Events that fit into the cell, with the row they occupy. */\n visible: Array<{ event: ScheduleEventData; row: number }>\n\n /** Number of events that did not fit. */\n hiddenCount: number\n}\n\n/** A multi-day event bar spanning a run of consecutive day columns on one row. */\nexport interface ResourcesMonthViewSegment {\n event: ScheduleEventData\n\n /** Index of the first day column the bar covers. */\n start: number\n\n /** Index of the last day column the bar covers. */\n end: number\n\n /** Row the bar occupies inside the cells it covers. */\n row: number\n\n /** Which ends of the bar continue outside the displayed month. */\n hanging: 'start' | 'end' | 'both' | 'none'\n\n /** Whether any covered cell also hides events, which shortens the bar. */\n hidden: boolean\n}\n\nexport interface ResourcesMonthViewRowLayout {\n /** Events of the resource per day column, sorted the way they are laid out. */\n eventsByDay: ScheduleEventData[][]\n\n /** Layout of every day cell of the row. */\n layouts: ResourcesMonthViewCellLayout[]\n\n /** Multi-day bars of the row. */\n segments: ResourcesMonthViewSegment[]\n}\n\nexport interface GetResourcesMonthViewLayoutInput {\n /** Day columns of the month, `YYYY-MM-DD`. */\n days: DateStringValue[]\n\n /** Events already expanded for the displayed month. */\n events: ScheduleEventData[] | undefined\n\n /** Resource the row belongs to. */\n resourceId: string | number\n\n /** Number of event rows a cell can show before the rest collapse into a \"more\" control. */\n maxRows: number\n}\n\n/** An event is multi-day when it ends on a later calendar day than it starts. */\nexport function isMultiDayEvent(event: ScheduleEventData) {\n return dayjs(event.end).startOf('day').isAfter(dayjs(event.start).startOf('day'))\n}\n\n/** Longer events come first, then earlier ones, so bars stack predictably. */\nexport function compareMonthEvents(a: ScheduleEventData, b: ScheduleEventData) {\n const aSpan = dayjs(a.end).startOf('day').diff(dayjs(a.start).startOf('day'), 'day')\n const bSpan = dayjs(b.end).startOf('day').diff(dayjs(b.start).startOf('day'), 'day')\n return aSpan === bSpan ? dayjs(a.start).valueOf() - dayjs(b.start).valueOf() : bSpan - aSpan\n}\n\n/**\n * Lays out one resource row of the month grid.\n *\n * Each event keeps the row it was given on the previous day whenever that row is still free,\n * so a multi-day event forms an unbroken bar instead of stepping between rows.\n */\nexport function getResourcesMonthViewLayout({\n days,\n events,\n resourceId,\n maxRows,\n}: GetResourcesMonthViewLayoutInput): ResourcesMonthViewRowLayout {\n const monthStart = dayjs(days[0]).startOf('day')\n const monthEnd = dayjs(days.at(-1)).add(1, 'day').startOf('day')\n\n const eventsByDay = days.map((day) =>\n (events || [])\n .filter(\n (event) =>\n event.resourceId === resourceId &&\n dayjs(event.start).isBefore(dayjs(day).endOf('day')) &&\n dayjs(event.end).isAfter(dayjs(day).startOf('day')),\n )\n .sort(compareMonthEvents),\n )\n\n const layouts: ResourcesMonthViewCellLayout[] = []\n const lastRow = new Map<string | number, number>()\n const rowByEvent = new Map<string | number, Map<number, number>>()\n\n eventsByDay.forEach((eventList, dayIndex) => {\n const used = new Set<number>()\n const visible: ResourcesMonthViewCellLayout['visible'] = []\n let hiddenCount = 0\n\n eventList.forEach((event) => {\n let row = lastRow.get(event.id)\n\n if (row === undefined || row >= maxRows || used.has(row)) {\n row = Array.from({ length: maxRows }, (_, index) => index).find((index) => !used.has(index))\n }\n\n if (row === undefined) {\n hiddenCount += 1\n return\n }\n\n used.add(row)\n visible.push({ event, row })\n lastRow.set(event.id, row)\n\n if (!rowByEvent.has(event.id)) {\n rowByEvent.set(event.id, new Map())\n }\n\n rowByEvent.get(event.id)!.set(dayIndex, row)\n })\n\n layouts.push({ visible, hiddenCount })\n })\n\n const segments: ResourcesMonthViewSegment[] = []\n const multiDayEvents = [\n ...new Map(\n eventsByDay\n .flat()\n .filter(isMultiDayEvent)\n .map((event) => [event.id, event]),\n ).values(),\n ]\n\n multiDayEvents.forEach((event) => {\n const rowsForEvent = rowByEvent.get(event.id)\n let run: { start: number; end: number; row: number } | null = null\n\n const flush = () => {\n if (!run) {\n return\n }\n\n const before = dayjs(event.start).isBefore(monthStart)\n const after = dayjs(event.end).isAfter(monthEnd)\n\n segments.push({\n event,\n ...run,\n hanging: before && after ? 'both' : before ? 'start' : after ? 'end' : 'none',\n hidden: Array.from(\n { length: run.end - run.start + 1 },\n (_, index) => layouts[run!.start + index].hiddenCount > 0,\n ).some(Boolean),\n })\n\n run = null\n }\n\n days.forEach((_day, index) => {\n const row = rowsForEvent?.get(index)\n\n if (row === undefined) {\n flush()\n } else if (run && run.row === row && run.end === index - 1) {\n run.end = index\n } else {\n flush()\n run = { start: index, end: index, row }\n }\n })\n\n flush()\n })\n\n return { eventsByDay, layouts, segments }\n}\n",".resourcesMonthView {\n --resources-month-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-month-view-resource-label-width: 120px;\n --resources-month-view-day-width: 80px;\n --resources-month-view-row-height: 64px;\n --resources-month-view-group-label-width: 80px;\n\n @mixin where-light {\n --resources-month-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --resources-month-view-border-color: var(--mantine-color-dark-4);\n }\n}\n\n.resourcesMonthViewRoot {\n border: 1px solid var(--resources-month-view-border-color);\n border-radius: var(--resources-month-view-radius);\n overflow: hidden;\n max-width: fit-content;\n}\n\n.resourcesMonthViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesMonthViewInner {\n display: inline-flex;\n flex-direction: column;\n}\n.resourcesMonthViewDayLabelsRow {\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-month-view-border-color);\n margin-bottom: -1px;\n}\n.resourcesMonthViewCorner {\n flex: 0 0 var(--resources-month-view-resource-label-width);\n min-width: var(--resources-month-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\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 background-color: var(--mantine-color-body);\n}\n.resourcesMonthViewDayLabel {\n flex: 0 0 var(--resources-month-view-day-width);\n min-width: var(--resources-month-view-day-width);\n max-width: var(--resources-month-view-day-width);\n height: 42px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n &:where([data-today]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n }\n}\n.resourcesMonthViewDayLabelWeekday {\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n text-transform: capitalize;\n line-height: 1;\n margin-bottom: 3px;\n}\n.resourcesMonthViewDayLabelNumber {\n font-weight: var(--mantine-font-weight-medium);\n font-size: 12px;\n line-height: 1;\n}\n.resourcesMonthViewRow {\n display: flex;\n border-top: 1px solid var(--resources-month-view-border-color);\n}\n.resourcesMonthViewResourceLabel {\n flex: 0 0 var(--resources-month-view-resource-label-width);\n min-width: var(--resources-month-view-resource-label-width);\n display: flex;\n align-items: 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-month-view-border-color);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n &:where([data-has-groups]) {\n left: var(--resources-month-view-group-label-width);\n }\n}\n.resourcesMonthViewGroupColumn,\n.resourcesMonthViewGroupColumnEmpty {\n flex: 0 0 var(--resources-month-view-group-label-width);\n min-width: var(--resources-month-view-group-label-width);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n}\n.resourcesMonthViewGroupColumn {\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 overflow: visible;\n &:where([data-group-position='first'], [data-group-position='only']) {\n z-index: 6;\n }\n &:where([data-group-position='middle'], [data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-month-view-row-height) + 1px);\n }\n}\n.resourcesMonthViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-month-view-row-height);\n}\n.resourcesMonthViewCell {\n flex: 0 0 var(--resources-month-view-day-width);\n min-width: var(--resources-month-view-day-width);\n max-width: var(--resources-month-view-day-width);\n min-height: var(--resources-month-view-row-height);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n cursor: pointer;\n position: relative;\n overflow: hidden;\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where(:focus) {\n z-index: 1;\n }\n @mixin hover {\n &:where(:not([data-static])) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n &:where([data-weekend]) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-8);\n }\n }\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-color-blue-4);\n border-radius: 2px;\n }\n }\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-primary-color-2);\n }\n }\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n.resourcesMonthView:where([data-event-interaction]) .resourcesMonthViewCell {\n pointer-events: none;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesMonthViewOwnProps } from './ResourcesMonthView.types'\n\nconst defaultProps = {\n weekdayFormat: 'ddd',\n weekendDays: [0, 6],\n withWeekendDays: true,\n highlightToday: true,\n withHeader: true,\n dayWidth: 80,\n rowHeight: 64,\n groupLabelWidth: 80,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n recurrenceExpansionLimit: 2000,\n} satisfies Partial<ResourcesMonthViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\n/** Height reserved for the \"more events\" control at the bottom of a cell, in px. */\nconst MORE_EVENTS_HEIGHT = 18\n\n/** `maxEventsPerTimeSlot` is clamped so the cells keep a workable row height. */\nfunction clampMaxRows(value: number) {\n return Math.min(10, Math.max(1, value))\n}\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, dayWidth, rowHeight, groupLabelWidth }) => ({\n resourcesMonthView: {\n '--resources-month-view-radius': resolveScheduleRadius(radius),\n '--resources-month-view-day-width': cssSize(dayWidth),\n '--resources-month-view-row-height': cssSize(rowHeight),\n '--resources-month-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, clampMaxRows, RESOURCE_VIEWS, MORE_EVENTS_HEIGHT }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n formatDate,\n getGroupToResourceIdMap,\n getOrderedResources,\n handleResourcesGridKeyDown,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport {\n getResourcesMonthViewLayout,\n isMultiDayEvent,\n type ResourcesMonthViewSegment,\n} from './get-resources-month-view-layout/get-resources-month-view-layout'\nimport type { ResourcesMonthViewEmits, ResourcesMonthViewSlots } from './ResourcesMonthView.types'\nimport classes from './ResourcesMonthView.module.css'\n\ndefineOptions({\n name: 'ResourcesMonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesMonthViewOwnProps>(), {\n groups: undefined,\n locale: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n startScrollDate: undefined,\n highlightToday: undefined,\n radius: undefined,\n withHeader: undefined,\n monthYearSelectProps: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n events: undefined,\n dayWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n labels: undefined,\n mode: undefined,\n scrollAreaProps: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n recurrenceExpansionLimit: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesMonthViewSlots>()\n\nconst emit = defineEmits<ResourcesMonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('ResourcesMonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesMonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesMonthView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; dayIndex: number } | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\nconst monthString = computed(() => month.value.format('YYYY-MM-DD') as DateStringValue)\n\nconst maxRows = computed(() => clampMaxRows(props.maxEventsPerTimeSlot!))\n\nconst days = computed(() =>\n Array.from({ length: month.value.daysInMonth() }, (_, index) => month.value.date(index + 1))\n .filter((day) => props.withWeekendDays || !props.weekendDays!.includes(day.day() as DayOfWeek))\n .map((day) => day.format('YYYY-MM-DD') as DateStringValue),\n)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst idMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst expandedEvents = computed(() =>\n expandRecurringEvents({\n events: props.events,\n rangeStart: month.value.toDate(),\n rangeEnd: month.value.endOf('month').toDate(),\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst rowLayouts = computed(() =>\n ordered.value.orderedResources.map((resource) =>\n getResourcesMonthViewLayout({\n days: days.value,\n events: expandedEvents.value,\n resourceId: resource.id,\n maxRows: maxRows.value,\n }),\n ),\n)\n\nconst singleDayEvents = (rowIndex: number) =>\n rowLayouts.value[rowIndex].layouts.flatMap((layout, dayIndex) =>\n layout.visible\n .filter(({ event }) => !isMultiDayEvent(event))\n .map(({ event, row }) => ({\n event,\n row,\n dayIndex,\n compressed: layout.hiddenCount > 0 && !isStatic.value,\n })),\n )\n\nconst cellsWithHiddenEvents = (rowIndex: number) =>\n rowLayouts.value[rowIndex].layouts\n .map((layout, dayIndex) => ({ layout, dayIndex }))\n .filter(({ layout }) => layout.hiddenCount > 0 && !isStatic.value)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const first = days.value[start]\n const last = days.value[end]\n\n if (first && last) {\n emit('slotDragEnd', {\n rangeStart: `${first} 00:00:00` as DateTimeStringValue,\n rangeEnd: dayjs(last).endOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n resourceId: idMap.value.get(group) ?? group,\n })\n }\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollDate) {\n return\n }\n\n await nextTick()\n\n const index = days.value.indexOf(\n dayjs(props.startScrollDate).format('YYYY-MM-DD') as DateStringValue,\n )\n\n if (index < 0) {\n return\n }\n\n scrollSlotIntoView(controls[0]?.[index], 'x')\n})\n\nconst setControl = (resourceIndex: number, dayIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][dayIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n if (element instanceof HTMLElement) {\n rowContainers.set(resourceIndex, element)\n }\n}\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst indexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container || !days.value.length) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(\n days.value.length - 1,\n Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * days.value.length),\n ),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, dayIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const day = days.value[dayIndex]\n\n if (!day) {\n return\n }\n\n const dragged = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (dragged) {\n const next = calculateMonthDropDate({ draggedEvent: dragged, targetDay: day })\n\n emit('eventDrop', {\n eventId: dragged.id,\n newStart: dayjs(next.start).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n newEnd: dayjs(next.end).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n event: dragged,\n resourceId,\n })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: `${day} 00:00:00` as DateTimeStringValue,\n resourceId,\n })\n }\n}\n\nconst setDropTarget = (next: { resourceId: string | number; dayIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.dayIndex === next.dayIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const dayIndex = indexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(dayIndex < 0 ? null : { resourceId, dayIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const current = nativeEvent.currentTarget\n\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(nativeEvent.relatedTarget)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const dayIndex = indexAtPoint(nativeEvent, resourceIndex)\n\n if (dayIndex >= 0) {\n emitDrop(nativeEvent, resource.id, dayIndex)\n }\n}\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-month-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst rowGeometry = (row: number, compressed: boolean) =>\n compressed\n ? {\n top: `calc((100% - ${MORE_EVENTS_HEIGHT}px) * ${row} / ${maxRows.value} + 1px)`,\n height: `calc((100% - ${MORE_EVENTS_HEIGHT}px) / ${maxRows.value} - 2px)`,\n }\n : {\n top: `calc(${(row / maxRows.value) * 100}% + 1px)`,\n height: `calc(${100 / maxRows.value}% - 2px)`,\n }\n\nconst singleEventStyle = (entry: { row: number; dayIndex: number; compressed: boolean }) => ({\n position: 'absolute' as const,\n left: `calc(${(entry.dayIndex / days.value.length) * 100}% + 1px)`,\n width: `calc(${100 / days.value.length}% - 2px)`,\n ...rowGeometry(entry.row, entry.compressed),\n zIndex: 3,\n})\n\nconst segmentStyle = (segment: ResourcesMonthViewSegment) => ({\n position: 'absolute' as const,\n left: `calc(${(segment.start / days.value.length) * 100}% + 1px)`,\n width: `calc(${((segment.end - segment.start + 1) / days.value.length) * 100}% - 2px)`,\n ...rowGeometry(segment.row, segment.hidden),\n zIndex: 3,\n})\n\nconst moreEventsStyle = (dayIndex: number) => ({\n position: 'absolute' as const,\n bottom: '1px',\n left: `calc(${(dayIndex / days.value.length) * 100}% + 1px)`,\n width: `calc(${100 / days.value.length}% - 2px)`,\n height: `${MORE_EVENTS_HEIGHT}px`,\n zIndex: 4,\n})\n\nconst cornerStyle = computed(() =>\n hasGroups.value\n ? {\n flexBasis:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n }\n : undefined,\n)\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n monthValue: month.value.month(),\n yearValue: month.value.year(),\n onMonthChange: (value: number) =>\n emit('dateChange', month.value.month(value).format('YYYY-MM-DD') as DateStringValue),\n onYearChange: (value: number) =>\n emit('dateChange', month.value.year(value).format('YYYY-MM-DD') as DateStringValue),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n const day = target ? days.value[target.dayIndex] : undefined\n return day ? { date: day } : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesMonthView') }\"\n :root-ref=\"setRootElement\"\n :data-event-interaction=\"dropTarget ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :month=\"monthString\">\n <ScheduleHeaderBase\n view=\"month\"\n :navigation-handlers=\"{\n previous: () => month.subtract(1, 'month').format('YYYY-MM-DD'),\n next: () => month.add(1, 'month').format('YYYY-MM-DD'),\n today: () => dayjs().format('YYYY-MM-DD'),\n }\"\n :control=\"headerControl\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesMonthViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n scrollbars=\"x\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesMonthViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div v-bind=\"getStyles('resourcesMonthViewInner')\">\n <div v-bind=\"getStyles('resourcesMonthViewDayLabelsRow')\">\n <div v-bind=\"getStyles('resourcesMonthViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <template v-for=\"day in days\" :key=\"day\">\n <slot\n name=\"dayLabel\"\n :date=\"day\"\n :weekday=\"\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n \"\n :day=\"dayjs(day).date()\"\n >\n <div\n v-bind=\"staticStyles('resourcesMonthViewDayLabel')\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-today=\"\n (props.highlightToday && dayjs(day).isSame(dayjs(), 'day')) || undefined\n \"\n >\n <span v-bind=\"staticStyles('resourcesMonthViewDayLabelWeekday')\">\n {{\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n }}\n </span>\n <span v-bind=\"staticStyles('resourcesMonthViewDayLabelNumber')\">\n {{ dayjs(day).date() }}\n </span>\n </div>\n </slot>\n </template>\n </div>\n\n <div\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesMonthViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesMonthViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesMonthViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <div\n v-bind=\"staticStyles('resourcesMonthViewResourceLabel')\"\n :data-has-groups=\"hasGroups || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </div>\n\n <div\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"staticStyles('resourcesMonthViewRowSlots')\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"handleRowDragLeave($event)\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <ScheduleEvent\n v-for=\"entry in singleDayEvents(resourceIndex)\"\n :key=\"`${entry.event.id}-${entry.dayIndex}`\"\n :event=\"entry.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(entry.event)\"\n :style=\"singleEventStyle(entry)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"\n isStatic ? undefined : emit('eventClick', entry.event, $event as MouseEvent)\n \"\n />\n\n <ScheduleEvent\n v-for=\"segment in rowLayouts[resourceIndex].segments\"\n :key=\"`${segment.event.id}-${segment.start}`\"\n :event=\"segment.event\"\n :hanging=\"segment.hanging\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(segment.event)\"\n :style=\"segmentStyle(segment)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"\n isStatic ? undefined : emit('eventClick', segment.event, $event as MouseEvent)\n \"\n />\n\n <template\n v-for=\"entry in cellsWithHiddenEvents(resourceIndex)\"\n :key=\"`more-${entry.dayIndex}`\"\n >\n <slot\n name=\"moreEvents\"\n :events=\"rowLayouts[resourceIndex].eventsByDay[entry.dayIndex]\"\n :hidden-count=\"entry.layout.hiddenCount\"\n :resource=\"resource\"\n :date=\"days[entry.dayIndex]\"\n >\n <MoreEvents\n :events=\"rowLayouts[resourceIndex].eventsByDay[entry.dayIndex]\"\n :more-events-count=\"entry.layout.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"moreEventsStyle(entry.dayIndex)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <UnstyledButton\n v-for=\"(day, dayIndex) in days\"\n :key=\"day\"\n :ref=\"setControl(resourceIndex, dayIndex)\"\n v-bind=\"staticStyles('resourcesMonthViewCell')\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id && dropTarget.dayIndex === dayIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(dayIndex, String(resource.id)) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"props.withDragSlotSelect ? dayIndex : undefined\"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :tabindex=\"isStatic ? -1 : resourceIndex === 0 && dayIndex === 0 ? 0 : -1\"\n :aria-label=\"`${String(resource.label)} ${dayjs(day).format('MMMM D, YYYY')}`\"\n @keydown=\"\n handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex: dayIndex,\n event: $event,\n })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown($event, dayIndex, String(resource.id))\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('dayClick', {\n date: day,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot name=\"dayCell\" :resource=\"resource\" :date=\"day\" />\n </UnstyledButton>\n </div>\n </div>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesMonthViewOwnProps } from './ResourcesMonthView.types'\n\nconst defaultProps = {\n weekdayFormat: 'ddd',\n weekendDays: [0, 6],\n withWeekendDays: true,\n highlightToday: true,\n withHeader: true,\n dayWidth: 80,\n rowHeight: 64,\n groupLabelWidth: 80,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n recurrenceExpansionLimit: 2000,\n} satisfies Partial<ResourcesMonthViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\n/** Height reserved for the \"more events\" control at the bottom of a cell, in px. */\nconst MORE_EVENTS_HEIGHT = 18\n\n/** `maxEventsPerTimeSlot` is clamped so the cells keep a workable row height. */\nfunction clampMaxRows(value: number) {\n return Math.min(10, Math.max(1, value))\n}\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, dayWidth, rowHeight, groupLabelWidth }) => ({\n resourcesMonthView: {\n '--resources-month-view-radius': resolveScheduleRadius(radius),\n '--resources-month-view-day-width': cssSize(dayWidth),\n '--resources-month-view-row-height': cssSize(rowHeight),\n '--resources-month-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, clampMaxRows, RESOURCE_VIEWS, MORE_EVENTS_HEIGHT }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n formatDate,\n getGroupToResourceIdMap,\n getOrderedResources,\n handleResourcesGridKeyDown,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport {\n getResourcesMonthViewLayout,\n isMultiDayEvent,\n type ResourcesMonthViewSegment,\n} from './get-resources-month-view-layout/get-resources-month-view-layout'\nimport type { ResourcesMonthViewEmits, ResourcesMonthViewSlots } from './ResourcesMonthView.types'\nimport classes from './ResourcesMonthView.module.css'\n\ndefineOptions({\n name: 'ResourcesMonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesMonthViewOwnProps>(), {\n groups: undefined,\n locale: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n startScrollDate: undefined,\n highlightToday: undefined,\n radius: undefined,\n withHeader: undefined,\n monthYearSelectProps: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n events: undefined,\n dayWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n labels: undefined,\n mode: undefined,\n scrollAreaProps: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n recurrenceExpansionLimit: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesMonthViewSlots>()\n\nconst emit = defineEmits<ResourcesMonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('ResourcesMonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesMonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesMonthView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; dayIndex: number } | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\nconst monthString = computed(() => month.value.format('YYYY-MM-DD') as DateStringValue)\n\nconst maxRows = computed(() => clampMaxRows(props.maxEventsPerTimeSlot!))\n\nconst days = computed(() =>\n Array.from({ length: month.value.daysInMonth() }, (_, index) => month.value.date(index + 1))\n .filter((day) => props.withWeekendDays || !props.weekendDays!.includes(day.day() as DayOfWeek))\n .map((day) => day.format('YYYY-MM-DD') as DateStringValue),\n)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst idMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst expandedEvents = computed(() =>\n expandRecurringEvents({\n events: props.events,\n rangeStart: month.value.toDate(),\n rangeEnd: month.value.endOf('month').toDate(),\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst rowLayouts = computed(() =>\n ordered.value.orderedResources.map((resource) =>\n getResourcesMonthViewLayout({\n days: days.value,\n events: expandedEvents.value,\n resourceId: resource.id,\n maxRows: maxRows.value,\n }),\n ),\n)\n\nconst singleDayEvents = (rowIndex: number) =>\n rowLayouts.value[rowIndex].layouts.flatMap((layout, dayIndex) =>\n layout.visible\n .filter(({ event }) => !isMultiDayEvent(event))\n .map(({ event, row }) => ({\n event,\n row,\n dayIndex,\n compressed: layout.hiddenCount > 0 && !isStatic.value,\n })),\n )\n\nconst cellsWithHiddenEvents = (rowIndex: number) =>\n rowLayouts.value[rowIndex].layouts\n .map((layout, dayIndex) => ({ layout, dayIndex }))\n .filter(({ layout }) => layout.hiddenCount > 0 && !isStatic.value)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const first = days.value[start]\n const last = days.value[end]\n\n if (first && last) {\n emit('slotDragEnd', {\n rangeStart: `${first} 00:00:00` as DateTimeStringValue,\n rangeEnd: dayjs(last).endOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n resourceId: idMap.value.get(group) ?? group,\n })\n }\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollDate) {\n return\n }\n\n await nextTick()\n\n const index = days.value.indexOf(\n dayjs(props.startScrollDate).format('YYYY-MM-DD') as DateStringValue,\n )\n\n if (index < 0) {\n return\n }\n\n scrollSlotIntoView(controls[0]?.[index], 'x')\n})\n\nconst setControl = (resourceIndex: number, dayIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][dayIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n if (element instanceof HTMLElement) {\n rowContainers.set(resourceIndex, element)\n }\n}\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst indexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container || !days.value.length) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(\n days.value.length - 1,\n Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * days.value.length),\n ),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, dayIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const day = days.value[dayIndex]\n\n if (!day) {\n return\n }\n\n const dragged = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (dragged) {\n const next = calculateMonthDropDate({ draggedEvent: dragged, targetDay: day })\n\n emit('eventDrop', {\n eventId: dragged.id,\n newStart: dayjs(next.start).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n newEnd: dayjs(next.end).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n event: dragged,\n resourceId,\n })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: `${day} 00:00:00` as DateTimeStringValue,\n resourceId,\n })\n }\n}\n\nconst setDropTarget = (next: { resourceId: string | number; dayIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.dayIndex === next.dayIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const dayIndex = indexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(dayIndex < 0 ? null : { resourceId, dayIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const current = nativeEvent.currentTarget\n\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(nativeEvent.relatedTarget)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const dayIndex = indexAtPoint(nativeEvent, resourceIndex)\n\n if (dayIndex >= 0) {\n emitDrop(nativeEvent, resource.id, dayIndex)\n }\n}\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-month-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst rowGeometry = (row: number, compressed: boolean) =>\n compressed\n ? {\n top: `calc((100% - ${MORE_EVENTS_HEIGHT}px) * ${row} / ${maxRows.value} + 1px)`,\n height: `calc((100% - ${MORE_EVENTS_HEIGHT}px) / ${maxRows.value} - 2px)`,\n }\n : {\n top: `calc(${(row / maxRows.value) * 100}% + 1px)`,\n height: `calc(${100 / maxRows.value}% - 2px)`,\n }\n\nconst singleEventStyle = (entry: { row: number; dayIndex: number; compressed: boolean }) => ({\n position: 'absolute' as const,\n left: `calc(${(entry.dayIndex / days.value.length) * 100}% + 1px)`,\n width: `calc(${100 / days.value.length}% - 2px)`,\n ...rowGeometry(entry.row, entry.compressed),\n zIndex: 3,\n})\n\nconst segmentStyle = (segment: ResourcesMonthViewSegment) => ({\n position: 'absolute' as const,\n left: `calc(${(segment.start / days.value.length) * 100}% + 1px)`,\n width: `calc(${((segment.end - segment.start + 1) / days.value.length) * 100}% - 2px)`,\n ...rowGeometry(segment.row, segment.hidden),\n zIndex: 3,\n})\n\nconst moreEventsStyle = (dayIndex: number) => ({\n position: 'absolute' as const,\n bottom: '1px',\n left: `calc(${(dayIndex / days.value.length) * 100}% + 1px)`,\n width: `calc(${100 / days.value.length}% - 2px)`,\n height: `${MORE_EVENTS_HEIGHT}px`,\n zIndex: 4,\n})\n\nconst cornerStyle = computed(() =>\n hasGroups.value\n ? {\n flexBasis:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n }\n : undefined,\n)\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n monthValue: month.value.month(),\n yearValue: month.value.year(),\n onMonthChange: (value: number) =>\n emit('dateChange', month.value.month(value).format('YYYY-MM-DD') as DateStringValue),\n onYearChange: (value: number) =>\n emit('dateChange', month.value.year(value).format('YYYY-MM-DD') as DateStringValue),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n const day = target ? days.value[target.dayIndex] : undefined\n return day ? { date: day } : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesMonthView') }\"\n :root-ref=\"setRootElement\"\n :data-event-interaction=\"dropTarget ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :month=\"monthString\">\n <ScheduleHeaderBase\n view=\"month\"\n :navigation-handlers=\"{\n previous: () => month.subtract(1, 'month').format('YYYY-MM-DD'),\n next: () => month.add(1, 'month').format('YYYY-MM-DD'),\n today: () => dayjs().format('YYYY-MM-DD'),\n }\"\n :control=\"headerControl\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesMonthViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n scrollbars=\"x\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesMonthViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div v-bind=\"getStyles('resourcesMonthViewInner')\">\n <div v-bind=\"getStyles('resourcesMonthViewDayLabelsRow')\">\n <div v-bind=\"getStyles('resourcesMonthViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <template v-for=\"day in days\" :key=\"day\">\n <slot\n name=\"dayLabel\"\n :date=\"day\"\n :weekday=\"\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n \"\n :day=\"dayjs(day).date()\"\n >\n <div\n v-bind=\"staticStyles('resourcesMonthViewDayLabel')\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-today=\"\n (props.highlightToday && dayjs(day).isSame(dayjs(), 'day')) || undefined\n \"\n >\n <span v-bind=\"staticStyles('resourcesMonthViewDayLabelWeekday')\">\n {{\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n }}\n </span>\n <span v-bind=\"staticStyles('resourcesMonthViewDayLabelNumber')\">\n {{ dayjs(day).date() }}\n </span>\n </div>\n </slot>\n </template>\n </div>\n\n <div\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesMonthViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesMonthViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesMonthViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <div\n v-bind=\"staticStyles('resourcesMonthViewResourceLabel')\"\n :data-has-groups=\"hasGroups || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </div>\n\n <div\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"staticStyles('resourcesMonthViewRowSlots')\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"handleRowDragLeave($event)\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <ScheduleEvent\n v-for=\"entry in singleDayEvents(resourceIndex)\"\n :key=\"`${entry.event.id}-${entry.dayIndex}`\"\n :event=\"entry.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(entry.event)\"\n :style=\"singleEventStyle(entry)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"\n isStatic ? undefined : emit('eventClick', entry.event, $event as MouseEvent)\n \"\n />\n\n <ScheduleEvent\n v-for=\"segment in rowLayouts[resourceIndex].segments\"\n :key=\"`${segment.event.id}-${segment.start}`\"\n :event=\"segment.event\"\n :hanging=\"segment.hanging\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(segment.event)\"\n :style=\"segmentStyle(segment)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"\n isStatic ? undefined : emit('eventClick', segment.event, $event as MouseEvent)\n \"\n />\n\n <template\n v-for=\"entry in cellsWithHiddenEvents(resourceIndex)\"\n :key=\"`more-${entry.dayIndex}`\"\n >\n <slot\n name=\"moreEvents\"\n :events=\"rowLayouts[resourceIndex].eventsByDay[entry.dayIndex]\"\n :hidden-count=\"entry.layout.hiddenCount\"\n :resource=\"resource\"\n :date=\"days[entry.dayIndex]\"\n >\n <MoreEvents\n :events=\"rowLayouts[resourceIndex].eventsByDay[entry.dayIndex]\"\n :more-events-count=\"entry.layout.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"moreEventsStyle(entry.dayIndex)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <UnstyledButton\n v-for=\"(day, dayIndex) in days\"\n :key=\"day\"\n :ref=\"setControl(resourceIndex, dayIndex)\"\n v-bind=\"staticStyles('resourcesMonthViewCell')\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id && dropTarget.dayIndex === dayIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(dayIndex, String(resource.id)) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"props.withDragSlotSelect ? dayIndex : undefined\"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :tabindex=\"isStatic ? -1 : resourceIndex === 0 && dayIndex === 0 ? 0 : -1\"\n :aria-label=\"`${String(resource.label)} ${dayjs(day).format('MMMM D, YYYY')}`\"\n @keydown=\"\n handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex: dayIndex,\n event: $event,\n })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown($event, dayIndex, String(resource.id))\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('dayClick', {\n date: day,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot name=\"dayCell\" :resource=\"resource\" :date=\"day\" />\n </UnstyledButton>\n </div>\n </div>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ResourcesMonthViewComponent, { varsResolver } from './ResourcesMonthView.vue'\nimport type { ResourcesMonthViewFactory } from './ResourcesMonthView.types'\nimport classes from './ResourcesMonthView.module.css'\n\nexport const ResourcesMonthView = factory<ResourcesMonthViewFactory>(ResourcesMonthViewComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n ResourcesMonthViewCssVariables,\n ResourcesMonthViewDayClickData,\n ResourcesMonthViewEmits,\n ResourcesMonthViewFactory,\n ResourcesMonthViewOwnProps,\n ResourcesMonthViewOwnStylesNames,\n ResourcesMonthViewProps,\n ResourcesMonthViewSlots,\n ResourcesMonthViewStylesNames,\n} from './ResourcesMonthView.types'\n",".root {\n height: 100%;\n}\n","<script lang=\"ts\">\nimport type { ResourcesScheduleOwnProps } from './ResourcesSchedule.types'\n\nconst defaultProps = {\n defaultView: 'day',\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n} satisfies Partial<ResourcesScheduleOwnProps>\n\nexport { defaultProps }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, useAttrs, useSlots } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport type { DateStringValue, ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport { ResourcesDayView } from '../ResourcesDayView'\nimport { ResourcesMonthView } from '../ResourcesMonthView'\nimport { ResourcesWeekView } from '../ResourcesWeekView'\nimport { resolveEventRenderers } from '../shared'\nimport type {\n ResourcesScheduleEmits,\n ResourcesScheduleSlots,\n ResourcesScheduleViewLevel,\n} from './ResourcesSchedule.types'\nimport classes from './ResourcesSchedule.module.css'\n\ndefineOptions({\n name: 'ResourcesSchedule',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesScheduleOwnProps>(), {\n date: undefined,\n defaultDate: undefined,\n onDateChange: undefined,\n view: undefined,\n defaultView: undefined,\n onViewChange: undefined,\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n renderEventBody: undefined,\n renderResourceLabel: undefined,\n onEventDrop: undefined,\n canDragEvent: undefined,\n onEventDragStart: undefined,\n onEventDragEnd: undefined,\n onTimeSlotClick: undefined,\n onDayClick: undefined,\n onEventClick: undefined,\n onSlotDragEnd: undefined,\n mode: undefined,\n onExternalEventDrop: undefined,\n onEventResize: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n dayViewProps: undefined,\n weekViewProps: undefined,\n monthViewProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesScheduleSlots>()\n\nconst emit = defineEmits<ResourcesScheduleEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('ResourcesSchedule', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesSchedule',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n})\n\nconst [currentDate, setCurrentDate] = useUncontrolled<DateStringValue>({\n value: () => (props.date === undefined ? undefined : toDateString(props.date)),\n defaultValue: toDateString(props.defaultDate ?? dayjs()),\n onChange: (value) => {\n emit('update:date', value)\n emit('dateChange', value)\n },\n})\n\nconst [currentView, setCurrentView] = useUncontrolled<ResourcesScheduleViewLevel>({\n value: () => props.view,\n defaultValue: props.defaultView,\n finalValue: 'day',\n onChange: (value) => {\n emit('update:view', value)\n emit('viewChange', value)\n },\n})\n\n/** The views offer a year level that this component does not support, so it is ignored. */\nconst changeView = (view: ScheduleViewLevel) => {\n if (view === 'day' || view === 'week' || view === 'month') {\n setCurrentView(view)\n }\n}\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst eventRenderers = computed(() =>\n resolveEventRenderers({ renderEventBody: props.renderEventBody }, slots),\n)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst sharedProps = computed(() => ({\n resources: props.resources,\n date: currentDate.value,\n events: props.events,\n locale: props.locale,\n radius: props.radius,\n labels: props.labels,\n mode: props.mode,\n renderResourceLabel: props.renderResourceLabel,\n withEventsDragAndDrop: isStatic.value ? false : props.withEventsDragAndDrop,\n canDragEvent: props.canDragEvent,\n withDragSlotSelect: props.withDragSlotSelect,\n recurrenceExpansionLimit: props.recurrenceExpansionLimit,\n onDateChange: setCurrentDate,\n onViewChange: changeView,\n onEventDrop: (data: any) => emit('eventDrop', data),\n onEventDragStart: (event: any) => emit('eventDragStart', event),\n onEventDragEnd: () => emit('eventDragEnd'),\n onEventClick: (event: any, nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n onSlotDragEnd: (data: any) => emit('slotDragEnd', data),\n onExternalEventDrop: (data: any) => emit('externalEventDrop', data),\n ...eventRenderers.value,\n ...stylesApi.value,\n}))\n\nconst timeViewProps = computed(() => ({\n onTimeSlotClick: (data: any) => emit('timeSlotClick', data),\n withEventResize: isStatic.value ? false : props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n onEventResize: (data: any) => emit('eventResize', data),\n}))\n\nconst activeView = computed(() => {\n switch (currentView.value) {\n case 'week':\n return ResourcesWeekView\n case 'month':\n return ResourcesMonthView\n default:\n return ResourcesDayView\n }\n})\n\nconst activeViewProps = computed(() => {\n switch (currentView.value) {\n case 'week':\n return { ...sharedProps.value, ...timeViewProps.value, ...props.weekViewProps }\n case 'month':\n return {\n ...sharedProps.value,\n onDayClick: (data: any) => emit('dayClick', data),\n ...props.monthViewProps,\n }\n default:\n return { ...sharedProps.value, ...timeViewProps.value, ...props.dayViewProps }\n }\n})\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('root') }\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\">\n <template v-if=\"slots.corner\" #corner=\"payload\">\n <slot name=\"corner\" v-bind=\"payload\" />\n </template>\n <template v-if=\"slots.resourceLabel\" #resourceLabel=\"payload\">\n <slot name=\"resourceLabel\" v-bind=\"payload\" />\n </template>\n <template v-if=\"slots.groupLabel\" #groupLabel=\"payload\">\n <slot name=\"groupLabel\" v-bind=\"payload\" />\n </template>\n </component>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport type { ResourcesScheduleOwnProps } from './ResourcesSchedule.types'\n\nconst defaultProps = {\n defaultView: 'day',\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n} satisfies Partial<ResourcesScheduleOwnProps>\n\nexport { defaultProps }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, useAttrs, useSlots } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport type { DateStringValue, ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport { ResourcesDayView } from '../ResourcesDayView'\nimport { ResourcesMonthView } from '../ResourcesMonthView'\nimport { ResourcesWeekView } from '../ResourcesWeekView'\nimport { resolveEventRenderers } from '../shared'\nimport type {\n ResourcesScheduleEmits,\n ResourcesScheduleSlots,\n ResourcesScheduleViewLevel,\n} from './ResourcesSchedule.types'\nimport classes from './ResourcesSchedule.module.css'\n\ndefineOptions({\n name: 'ResourcesSchedule',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesScheduleOwnProps>(), {\n date: undefined,\n defaultDate: undefined,\n onDateChange: undefined,\n view: undefined,\n defaultView: undefined,\n onViewChange: undefined,\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n renderEventBody: undefined,\n renderResourceLabel: undefined,\n onEventDrop: undefined,\n canDragEvent: undefined,\n onEventDragStart: undefined,\n onEventDragEnd: undefined,\n onTimeSlotClick: undefined,\n onDayClick: undefined,\n onEventClick: undefined,\n onSlotDragEnd: undefined,\n mode: undefined,\n onExternalEventDrop: undefined,\n onEventResize: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n dayViewProps: undefined,\n weekViewProps: undefined,\n monthViewProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesScheduleSlots>()\n\nconst emit = defineEmits<ResourcesScheduleEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('ResourcesSchedule', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesSchedule',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n})\n\nconst [currentDate, setCurrentDate] = useUncontrolled<DateStringValue>({\n value: () => (props.date === undefined ? undefined : toDateString(props.date)),\n defaultValue: toDateString(props.defaultDate ?? dayjs()),\n onChange: (value) => {\n emit('update:date', value)\n emit('dateChange', value)\n },\n})\n\nconst [currentView, setCurrentView] = useUncontrolled<ResourcesScheduleViewLevel>({\n value: () => props.view,\n defaultValue: props.defaultView,\n finalValue: 'day',\n onChange: (value) => {\n emit('update:view', value)\n emit('viewChange', value)\n },\n})\n\n/** The views offer a year level that this component does not support, so it is ignored. */\nconst changeView = (view: ScheduleViewLevel) => {\n if (view === 'day' || view === 'week' || view === 'month') {\n setCurrentView(view)\n }\n}\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst eventRenderers = computed(() =>\n resolveEventRenderers({ renderEventBody: props.renderEventBody }, slots),\n)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst sharedProps = computed(() => ({\n resources: props.resources,\n date: currentDate.value,\n events: props.events,\n locale: props.locale,\n radius: props.radius,\n labels: props.labels,\n mode: props.mode,\n renderResourceLabel: props.renderResourceLabel,\n withEventsDragAndDrop: isStatic.value ? false : props.withEventsDragAndDrop,\n canDragEvent: props.canDragEvent,\n withDragSlotSelect: props.withDragSlotSelect,\n recurrenceExpansionLimit: props.recurrenceExpansionLimit,\n onDateChange: setCurrentDate,\n onViewChange: changeView,\n onEventDrop: (data: any) => emit('eventDrop', data),\n onEventDragStart: (event: any) => emit('eventDragStart', event),\n onEventDragEnd: () => emit('eventDragEnd'),\n onEventClick: (event: any, nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n onSlotDragEnd: (data: any) => emit('slotDragEnd', data),\n onExternalEventDrop: (data: any) => emit('externalEventDrop', data),\n ...eventRenderers.value,\n ...stylesApi.value,\n}))\n\nconst timeViewProps = computed(() => ({\n onTimeSlotClick: (data: any) => emit('timeSlotClick', data),\n withEventResize: isStatic.value ? false : props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n onEventResize: (data: any) => emit('eventResize', data),\n}))\n\nconst activeView = computed(() => {\n switch (currentView.value) {\n case 'week':\n return ResourcesWeekView\n case 'month':\n return ResourcesMonthView\n default:\n return ResourcesDayView\n }\n})\n\nconst activeViewProps = computed(() => {\n switch (currentView.value) {\n case 'week':\n return { ...sharedProps.value, ...timeViewProps.value, ...props.weekViewProps }\n case 'month':\n return {\n ...sharedProps.value,\n onDayClick: (data: any) => emit('dayClick', data),\n ...props.monthViewProps,\n }\n default:\n return { ...sharedProps.value, ...timeViewProps.value, ...props.dayViewProps }\n }\n})\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('root') }\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\">\n <template v-if=\"slots.corner\" #corner=\"payload\">\n <slot name=\"corner\" v-bind=\"payload\" />\n </template>\n <template v-if=\"slots.resourceLabel\" #resourceLabel=\"payload\">\n <slot name=\"resourceLabel\" v-bind=\"payload\" />\n </template>\n <template v-if=\"slots.groupLabel\" #groupLabel=\"payload\">\n <slot name=\"groupLabel\" v-bind=\"payload\" />\n </template>\n </component>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ResourcesScheduleComponent from './ResourcesSchedule.vue'\nimport type { ResourcesScheduleFactory } from './ResourcesSchedule.types'\nimport classes from './ResourcesSchedule.module.css'\n\nexport const ResourcesSchedule = factory<ResourcesScheduleFactory>(ResourcesScheduleComponent, {\n classes,\n})\n\nexport type {\n ResourcesScheduleEmits,\n ResourcesScheduleFactory,\n ResourcesScheduleOwnProps,\n ResourcesScheduleOwnStylesNames,\n ResourcesScheduleProps,\n ResourcesScheduleSlots,\n ResourcesScheduleStylesNames,\n ResourcesScheduleViewLevel,\n ResourcesScheduleViewProps,\n} from './ResourcesSchedule.types'\n"],"mappings":";;;;;;;AA0BA,IAAa,0BAA0C;CACrD,OAAO;CACP,MAAM;CACN,UAAU;CACV,MAAM;CACN,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACR,SAAS;CACT,UAAU;CACV,aAAa;CACb,YAAY;CACZ,iBAAiB;CACjB,kBAAkB;CAClB,mBAAmB;CACnB,kBAAkB;CAClB,iBAAiB;CACjB,UAAU;CACV,YAAY,sBAA8B,IAAI,kBAAkB;CAChE,UAAU;CACV,WAAW;CACX,cAAc;AAChB;AAIA,SAA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F,MAAM,aAAa,eAAe;GAChC,QAAQ,YAAY,OAApB;IACE,KAAK,QACH,OAAO;IACT,KAAK,SACH,OAAO;IACT,SACE,OAAO;GACX;EACF,CAAC;EAED,MAAM,kBAAkB,eAAe;GACrC,QAAQ,YAAY,OAApB;IACE,KAAK,QACH,OAAO;KAAE,GAAG,YAAY;KAAO,GAAG,cAAc;KAAO,GAAG,MAAM;IAAc;IAChF,KAAK,SACH,OAAO;KACL,GAAG,YAAY;KACf,aAAa,SAAc,KAAK,YAAY,IAAI;KAChD,GAAG,MAAM;IACX;IACF,SACE,OAAO;KAAE,GAAG,YAAY;KAAO,GAAG,cAAc;KAAO,GAAG,MAAM;IAAa;GACjF;EACF,CAAC;;uBAIC,YAYM,MAAA,GAAA,GAAA,eAAA,mBAAA;IAAA,GAZY,MAAA,KAAA;IAAK,GAAK,MAAA,SAAA,EAAS,MAAA;GAAA,CAAA,CAAA,GAAA;2BAWvB,EAAA,UAAA,GAVZ,YAUY,wBAVI,WAAA,KAAU,GAAA,eAAA,mBAAU,gBAAA,KAAe,CAAA,GAAA,YAAA,EAAA,GAAA,EAAA,GAAA;KACjC,MAAA,KAAA,EAAM,SAAA;YAAS;mBAAQ,YAAO,CAC5C,WAAuC,KAAA,QAAA,UAAA,eAAA,mBAAX,OAAO,CAAA,CAAA,CAAA,CAAA;;;KAErB,MAAA,KAAA,EAAM,gBAAA;YAAgB;mBAAe,YAAO,CAC1D,WAA8C,KAAA,QAAA,iBAAA,eAAA,mBAAX,OAAO,CAAA,CAAA,CAAA,CAAA;;;KAE5B,MAAA,KAAA,EAAM,aAAA;YAAa;mBAAY,YAAO,CACpD,WAA2C,KAAA,QAAA,cAAA,eAAA,mBAAX,OAAO,CAAA,CAAA,CAAA,CAAA;;;;;;;;CEpMoB,GAA4B,EAC7F,SAAA,iCACF,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/labels.ts","../src/utils/format-date/format-date.ts","../src/utils/get-weekdays-names/get-weekdays-names.ts","../src/utils/get-start-of-week/get-start-of-week.ts","../src/utils/get-end-of-week/get-end-of-week.ts","../src/utils/get-week-number/get-week-number.ts","../src/utils/get-month-days/get-month-days.ts","../src/utils/is-after-min-date/is-after-min-date.ts","../src/utils/is-before-max-date/is-before-max-date.ts","../src/utils/is-same-month/is-same-month.ts","../src/utils/get-months-by-quarter/get-months-by-quarter.ts","../src/utils/clamp-interval-minutes/clamp-interval-minutes.ts","../src/utils/parse-time-string/parse-time-string.ts","../src/utils/to-time-string/to-time-string.ts","../src/utils/get-day-time-intervals/get-day-time-intervals.ts","../src/utils/to-date-string/to-date-string.ts","../src/utils/get-week-days/get-week-days.ts","../src/utils/get-months-list/get-months-list.ts","../src/utils/get-years-list/get-years-list.ts","../src/utils/next-week/next-week.ts","../src/utils/previous-week/previous-week.ts","../src/utils/get-current-time-position/get-current-time-position.ts","../src/utils/is-in-time-range/is-in-time-range.ts","../src/utils/is-all-day-event/is-all-day-event.ts","../src/utils/validate-event/validate-event.ts","../src/utils/sort-events/sort-events.ts","../src/utils/is-events-overlap/is-events-overlap.ts","../src/utils/get-visible-events/get-visible-events.ts","../src/utils/is-multiday-event/is-multiday-event.ts","../src/utils/is-event-in-time-range/is-event-in-time-range.ts","../src/utils/is-within-week/is-within-week.ts","../src/utils/get-month-range/get-month-range.ts","../src/utils/get-day-position/get-day-position.ts","../src/utils/calculate-drop-time/calculate-drop-time.ts","../src/utils/calculate-month-drop-date/calculate-month-drop-date.ts","../src/utils/get-business-hours-mod/get-business-hours-mod.ts","../src/utils/expand-recurring-events/expand-recurring-events.ts","../src/utils/get-ordered-resources/get-ordered-resources.ts","../src/utils/get-group-to-resource-id-map/get-group-to-resource-id-map.ts","../src/utils/handle-resources-grid-key-down/handle-resources-grid-key-down.ts","../src/components/shared.ts","../src/hooks/use-event-resize.ts","../src/components/CurrentTimeIndicator/CurrentTimeIndicator.module.css","../src/components/CurrentTimeIndicator/CurrentTimeIndicator.vue","../src/components/CurrentTimeIndicator/CurrentTimeIndicator.vue","../src/components/CurrentTimeIndicator/CurrentTimeIndicator.ts","../src/components/DragContext/DragContext.ts","../src/components/ScheduleEvent/ScheduleEvent.module.css","../src/components/ScheduleEvent/ScheduleEvent.vue","../src/components/ScheduleEvent/ScheduleEvent.vue","../src/components/ScheduleEvent/ScheduleEvent.ts","../src/components/MoreEvents/MoreEvents.module.css","../src/components/MoreEvents/MoreEvents.vue","../src/components/MoreEvents/MoreEvents.vue","../src/components/MoreEvents/MoreEvents.ts","../src/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.vue","../src/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.vue","../src/components/ScheduleHeader/ScheduleHeader.context.ts","../src/components/ScheduleHeader/ScheduleHeader.module.css","../src/components/ScheduleHeader/ScheduleHeader.vue","../src/components/ScheduleHeader/ScheduleHeader.vue","../src/components/ScheduleHeader/HeaderControl/HeaderControl.module.css","../src/components/ScheduleHeader/HeaderControl/HeaderControl.vue","../src/components/ScheduleHeader/HeaderControl/HeaderControl.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderNext.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderNext.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderPrevious.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderPrevious.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderToday.vue","../src/components/ScheduleHeader/HeaderControl/ScheduleHeaderToday.vue","../src/components/ScheduleHeader/HeaderControl/HeaderControl.ts","../src/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.module.css","../src/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.vue","../src/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.vue","../src/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.ts","../src/components/ScheduleHeader/ViewSelect/ViewSelect.module.css","../src/components/ScheduleHeader/ViewSelect/ViewSelect.vue","../src/components/ScheduleHeader/ViewSelect/ViewSelect.vue","../src/components/ScheduleHeader/ViewSelect/ViewSelect.ts","../src/components/ScheduleHeader/ScheduleHeader.ts","../src/components/ScheduleHeader/ScheduleHeaderBase.vue","../src/components/ScheduleHeader/ScheduleHeaderBase.vue","../src/components/ScheduleHeader/ScheduleHeaderBase.ts","../src/components/use-slot-drag-select.ts","../src/components/use-slot-drop-target.ts","../src/components/DayView/get-day-view-events/get-day-positioned-events.ts","../src/components/DayView/get-day-view-events/get-day-view-events.ts","../src/components/DayView/DayView.module.css","../src/components/DayView/DayView.vue","../src/components/DayView/DayView.vue","../src/components/DayView/DayView.ts","../src/components/MobileMonthView/get-mobile-month-view-events.ts","../src/components/MobileMonthView/MobileMonthView.module.css","../src/components/MobileMonthView/MobileMonthView.vue","../src/components/MobileMonthView/MobileMonthView.vue","../src/components/MobileMonthView/MobileMonthView.ts","../src/components/keyboard-navigation.ts","../src/components/MonthView/get-month-view-events/add-event-to-day-groups.ts","../src/components/MonthView/get-month-view-events/calculate-event-position-in-week.ts","../src/components/MonthView/get-month-view-events/find-available-row.ts","../src/components/MonthView/get-month-view-events/get-weeks-in-range.ts","../src/components/MonthView/get-month-view-events/get-month-positioned-events.ts","../src/components/MonthView/get-month-view-events/get-month-view-events.ts","../src/components/MonthView/get-renderable-month-event-segments.ts","../src/components/MonthView/MonthView.module.css","../src/components/MonthView/MonthView.vue","../src/components/MonthView/MonthView.vue","../src/components/MonthView/MonthView.ts","../src/components/WeekView/get-week-label/get-week-label.ts","../src/components/WeekView/get-week-view-events/filter-week-view-events.ts","../src/components/WeekView/get-week-view-events/assign-event-rows.ts","../src/components/WeekView/get-week-view-events/calculate-all-day-event-offset.ts","../src/components/WeekView/get-week-view-events/calculate-all-day-event-width.ts","../src/components/WeekView/get-week-view-events/calculate-event-days.ts","../src/components/WeekView/get-week-view-events/calculate-regular-event-overlaps.ts","../src/components/WeekView/get-week-view-events/find-available-column.ts","../src/components/WeekView/get-week-view-events/get-event-end-date.ts","../src/components/WeekView/get-week-view-events/get-hanging-status.ts","../src/components/WeekView/get-week-view-events/get-week-positioned-events.ts","../src/components/WeekView/get-week-view-events/get-week-view-events.ts","../src/components/WeekView/WeekView.module.css","../src/components/WeekView/WeekView.vue","../src/components/WeekView/WeekView.vue","../src/components/WeekView/WeekView.ts","../src/components/YearView/get-year-view-events/get-year-view-events.ts","../src/components/YearView/YearView.module.css","../src/components/YearView/YearView.vue","../src/components/YearView/YearView.vue","../src/components/YearView/YearView.ts","../src/components/Schedule/Schedule.module.css","../src/components/Schedule/Schedule.vue","../src/components/Schedule/Schedule.vue","../src/components/Schedule/Schedule.ts","../src/hooks/use-horizontal-event-resize.ts","../src/components/ResourcesDayView/get-overlap-clusters/get-overlap-clusters.ts","../src/components/ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events.ts","../src/components/ResourcesDayView/ResourcesDayView.module.css","../src/components/ResourcesDayView/ResourcesDayView.vue","../src/components/ResourcesDayView/ResourcesDayView.vue","../src/components/ResourcesDayView/ResourcesDayView.ts","../src/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.ts","../src/components/ResourcesWeekView/ResourcesWeekView.module.css","../src/components/ResourcesWeekView/ResourcesWeekView.vue","../src/components/ResourcesWeekView/ResourcesWeekView.vue","../src/components/ResourcesWeekView/ResourcesWeekView.ts","../src/components/ResourcesMonthView/get-resources-month-view-layout/get-resources-month-view-layout.ts","../src/components/ResourcesMonthView/ResourcesMonthView.module.css","../src/components/ResourcesMonthView/ResourcesMonthView.vue","../src/components/ResourcesMonthView/ResourcesMonthView.vue","../src/components/ResourcesMonthView/ResourcesMonthView.ts","../src/components/ResourcesSchedule/ResourcesSchedule.module.css","../src/components/ResourcesSchedule/ResourcesSchedule.vue","../src/components/ResourcesSchedule/ResourcesSchedule.vue","../src/components/ResourcesSchedule/ResourcesSchedule.ts"],"sourcesContent":["export interface ScheduleLabels {\n day: string\n week: string\n month: string\n year: string\n allDay: string\n weekday: string\n timeSlot: string\n today: string\n next: string\n previous: string\n more: string\n selectMonth: string\n selectYear: string\n switchToDayView: string\n switchToWeekView: string\n switchToMonthView: string\n switchToYearView: string\n viewSelectLabel: string\n noEvents: string\n moreLabel: (hiddenEventsCount: number) => string\n resource?: string\n resources?: string\n resourceSlot?: string\n}\n\nexport const DEFAULT_SCHEDULE_LABELS: ScheduleLabels = {\n today: 'Today',\n next: 'Next',\n previous: 'Previous',\n more: 'More',\n day: 'Day',\n week: 'Week',\n month: 'Month',\n year: 'Year',\n allDay: 'All day',\n weekday: 'Weekday',\n timeSlot: 'Time slot',\n selectMonth: 'Select month',\n selectYear: 'Select year',\n switchToDayView: 'Switch to day view',\n switchToWeekView: 'Switch to week view',\n switchToMonthView: 'Switch to month view',\n switchToYearView: 'Switch to year view',\n viewSelectLabel: 'Calendar view',\n noEvents: 'No events',\n moreLabel: (hiddenEventsCount: number) => `+${hiddenEventsCount} more`,\n resource: 'Resource',\n resources: 'Resources',\n resourceSlot: 'Resource time slot',\n}\n\nexport type ScheduleLabelsOverride = Partial<ScheduleLabels>\n\nexport function getLabel<K extends keyof ScheduleLabels>(\n key: K,\n override?: ScheduleLabelsOverride,\n): ScheduleLabels[K] {\n if (override) {\n return { ...DEFAULT_SCHEDULE_LABELS, ...override }[key]\n }\n\n return DEFAULT_SCHEDULE_LABELS[key]\n}\n","import dayjs from 'dayjs'\nimport { DateLabelFormat } from '../../types'\n\nexport interface FormatDateInput {\n locale: string\n date: string | Date | dayjs.Dayjs\n format: DateLabelFormat\n}\n\nexport function formatDate({ locale, date, format }: FormatDateInput) {\n if (typeof format === 'function') {\n return format(dayjs(date).format('YYYY-MM-DD HH:mm:ss'))\n }\n\n return dayjs(date).locale(locale).format(format)\n}\n","import dayjs from 'dayjs'\nimport type { VNodeChild } from 'vue'\nimport type { DateLabelFormat, DayOfWeek } from '../../types'\nimport { formatDate } from '../format-date/format-date'\n\ninterface GetWeekdaysNamesInput {\n locale: string\n format?: DateLabelFormat\n firstDayOfWeek?: DayOfWeek\n}\n\nexport function getWeekdaysNames({\n locale,\n format = 'dd',\n firstDayOfWeek = 1,\n}: GetWeekdaysNamesInput) {\n const baseDate = dayjs().day(firstDayOfWeek)\n const labels: VNodeChild[] = []\n\n for (let i = 0; i < 7; i += 1) {\n labels.push(formatDate({ locale, date: baseDate.add(i, 'days'), format }))\n }\n\n return labels\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek } from '../../types'\n\ninterface GetStartOfWeekInput {\n date: AnyDateValue\n firstDayOfWeek?: DayOfWeek\n}\n\nexport function getStartOfWeek({ date, firstDayOfWeek = 1 }: GetStartOfWeekInput) {\n let value = dayjs(date)\n\n while (value.day() !== firstDayOfWeek) {\n value = value.subtract(1, 'day')\n }\n\n return value.format('YYYY-MM-DD')\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek } from '../../types'\n\nexport function getEndOfWeek(date: AnyDateValue, firstDayOfWeek: DayOfWeek = 1) {\n let value = dayjs(date)\n\n if (!value.isValid()) {\n return value\n }\n\n const lastDayOfWeek = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1\n while (value.day() !== lastDayOfWeek) {\n value = value.add(1, 'day')\n }\n\n return value.format('YYYY-MM-DD')\n}\n","import dayjs from 'dayjs'\nimport isoWeek from 'dayjs/plugin/isoWeek.js'\nimport { AnyDateValue } from '../../types'\n\ndayjs.extend(isoWeek)\n\nexport function getWeekNumber(week: AnyDateValue | AnyDateValue[]): number {\n if (Array.isArray(week)) {\n const monday = week.find((date) => dayjs(date).day() === 1)\n return dayjs(monday).isoWeek()\n }\n\n return dayjs(week).isoWeek()\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, DayOfWeek } from '../../types'\nimport { getEndOfWeek } from '../get-end-of-week/get-end-of-week'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\n\ninterface GetMonthDaysInput {\n month: AnyDateValue\n firstDayOfWeek: DayOfWeek | undefined\n consistentWeeks: boolean | undefined\n}\n\nexport function getMonthDays({\n month,\n firstDayOfWeek = 1,\n consistentWeeks,\n}: GetMonthDaysInput): DateStringValue[][] {\n const day = dayjs(month).subtract(dayjs(month).date() - 1, 'day')\n const start = dayjs(day.format('YYYY-MM-DD'))\n const startOfMonth = start.format('YYYY-MM-DD')\n const endOfMonth = start.add(+start.daysInMonth() - 1, 'day').format('YYYY-MM-DD')\n const endDate = getEndOfWeek(endOfMonth, firstDayOfWeek)\n const weeks: DateStringValue[][] = []\n\n let date = dayjs(getStartOfWeek({ date: startOfMonth, firstDayOfWeek }))\n\n while (dayjs(date).isBefore(endDate, 'day')) {\n const days: DateStringValue[] = []\n\n for (let i = 0; i < 7; i += 1) {\n days.push(date.format('YYYY-MM-DD 00:00:00'))\n date = date.add(1, 'day')\n }\n\n weeks.push(days)\n }\n\n if (consistentWeeks && weeks.length < 6) {\n const lastWeek = weeks[weeks.length - 1]\n const lastDay = lastWeek[lastWeek.length - 1]\n let nextDay = dayjs(lastDay).add(1, 'day')\n\n while (weeks.length < 6) {\n const days: DateStringValue[] = []\n\n for (let i = 0; i < 7; i += 1) {\n days.push(nextDay.format('YYYY-MM-DD 00:00:00'))\n nextDay = nextDay.add(1, 'day')\n }\n\n weeks.push(days)\n }\n }\n\n return weeks\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\n\nexport function isAfterMinDate(date: AnyDateValue, minDate: AnyDateValue | undefined) {\n return minDate ? dayjs(date).isAfter(dayjs(minDate).subtract(1, 'day'), 'day') : true\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\n\nexport function isBeforeMaxDate(date: AnyDateValue, maxDate: AnyDateValue | undefined) {\n return maxDate ? dayjs(date).isBefore(dayjs(maxDate).add(1, 'day'), 'day') : true\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\n\nexport function isSameMonth(date: AnyDateValue, comparison: AnyDateValue) {\n return dayjs(date).format('YYYY-MM') === dayjs(comparison).format('YYYY-MM')\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue } from '../../types'\n\nexport function getMonthsByQuarter(year: AnyDateValue) {\n const startOfYear = dayjs(year).startOf('year').toDate()\n\n const results: DateStringValue[][] = [[], [], [], []]\n let currentMonthIndex = 0\n\n for (let i = 0; i < 4; i += 1) {\n for (let j = 0; j < 3; j += 1) {\n results[i].push(dayjs(startOfYear).add(currentMonthIndex, 'months').format('YYYY-MM-DD'))\n currentMonthIndex += 1\n }\n }\n\n return results\n}\n","/**\n * Clamps interval minutes to a value that keeps the time grid consistent:\n *\n * - Values of 60 or less must divide evenly into an hour.\n * - Values above an hour must be a whole number of hours.\n *\n * Invalid values fall back to 60 and the result is capped to one day.\n */\nexport function clampIntervalMinutes(intervalMinutes: number): number {\n const rounded = Math.round(Math.max(1, Math.min(1440, intervalMinutes)))\n\n if (rounded <= 60) {\n return 60 % rounded === 0 ? rounded : 60\n }\n\n return rounded % 60 === 0 ? rounded : 60\n}\n","export interface ParsedTime {\n hours: number\n minutes: number\n seconds: number\n}\n\nexport function parseTimeString(time: string): ParsedTime {\n const [hours, minutes, seconds] = time.split(':').map(Number)\n return { hours, minutes, seconds: seconds || 0 }\n}\n","import { ParsedTime } from '../parse-time-string/parse-time-string'\n\nexport function toTimeString({ hours, minutes, seconds }: ParsedTime) {\n return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`\n}\n","import { clampIntervalMinutes } from '../clamp-interval-minutes/clamp-interval-minutes'\nimport { parseTimeString } from '../parse-time-string/parse-time-string'\nimport { toTimeString } from '../to-time-string/to-time-string'\n\nexport interface DayTimeInterval {\n /** Start time of the interval in HH:mm:ss format */\n startTime: string\n\n /** End time of the interval in HH:mm:ss format */\n endTime: string\n\n /** Duration of the interval in seconds */\n duration: number\n\n /** Indicates if the interval starts at the beginning of an hour */\n isHourStart: boolean\n}\n\nexport interface GetDayTimeIntervalsInput {\n /** Start time in HH:mm:ss format */\n startTime: string\n\n /** End time in HH:mm:ss format, end of the day by default */\n endTime?: string\n\n /** Interval in minutes, 60 by default */\n intervalMinutes?: number\n}\n\nexport function getDayTimeIntervals({\n startTime,\n endTime,\n intervalMinutes: _intervalMinutes = 60,\n}: GetDayTimeIntervalsInput): DayTimeInterval[] {\n const intervalMinutes = clampIntervalMinutes(_intervalMinutes)\n\n const start = parseTimeString(startTime)\n const end = endTime ? parseTimeString(endTime) : { hours: 23, minutes: 59, seconds: 59 }\n\n const startSeconds = start.hours * 3600 + start.minutes * 60 + start.seconds\n const endSeconds = end.hours * 3600 + end.minutes * 60 + end.seconds\n const intervalSeconds = intervalMinutes * 60\n\n const intervals: DayTimeInterval[] = []\n let currentSeconds = startSeconds\n\n while (currentSeconds < endSeconds) {\n const intervalStartSeconds = currentSeconds\n let intervalEndSeconds = currentSeconds + intervalSeconds\n\n if (intervalEndSeconds > endSeconds) {\n intervalEndSeconds = endSeconds\n }\n\n const startHours = Math.floor(intervalStartSeconds / 3600)\n const startMinutes = Math.floor((intervalStartSeconds % 3600) / 60)\n const startSecs = intervalStartSeconds % 60\n\n const endHours = Math.floor(intervalEndSeconds / 3600)\n const endMinutes = Math.floor((intervalEndSeconds % 3600) / 60)\n const endSecs = intervalEndSeconds % 60\n\n const durationSeconds = intervalEndSeconds - intervalStartSeconds\n const isHourStart = startMinutes === 0 && startSecs === 0\n\n intervals.push({\n startTime: toTimeString({ hours: startHours, minutes: startMinutes, seconds: startSecs }),\n endTime: toTimeString({ hours: endHours, minutes: endMinutes, seconds: endSecs }),\n duration: durationSeconds,\n isHourStart,\n })\n\n currentSeconds = intervalEndSeconds\n }\n\n return intervals\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue } from '../../types'\n\nexport function toDateString(date: AnyDateValue): DateStringValue {\n return dayjs(date).format('YYYY-MM-DD 00:00:00')\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, DayOfWeek } from '../../types'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\nimport { toDateString } from '../to-date-string/to-date-string'\n\nexport interface GetWeekDaysInput {\n /** Week to generate days for */\n week: AnyDateValue\n\n /** Indices of weekend days, 0-6, where 0 is Sunday and 6 is Saturday. The default value is defined by `DatesProvider`. */\n weekendDays?: DayOfWeek[]\n\n /** If set to false, weekend days are hidden @default true */\n withWeekendDays?: boolean\n\n /** Number 0-6, where 0 – Sunday and 6 – Saturday @default 1 */\n firstDayOfWeek?: DayOfWeek\n}\n\n/** Returns a list of days in a given week */\nexport function getWeekDays({\n week,\n weekendDays,\n withWeekendDays = true,\n firstDayOfWeek = 1,\n}: GetWeekDaysInput): DateStringValue[] {\n const days: DateStringValue[] = []\n\n let current = dayjs(getStartOfWeek({ date: week, firstDayOfWeek }))\n\n for (let i = 0; i < 7; i += 1) {\n const dayOfWeek = current.day()\n const isWeekend = weekendDays && weekendDays.includes(dayOfWeek as DayOfWeek)\n\n if (!isWeekend || withWeekendDays) {\n days.push(toDateString(current))\n }\n\n current = current.add(1, 'day')\n }\n\n return days\n}\n","import dayjs from 'dayjs'\nimport { DateLabelFormat } from '../../types'\nimport { formatDate } from '../format-date/format-date'\n\ninterface GetMonthsListInput {\n locale: string\n format: DateLabelFormat\n}\n\ninterface MonthData {\n month: number\n name: string\n}\n\nexport function getMonthsList({ locale, format }: GetMonthsListInput) {\n const months: MonthData[] = []\n const date = dayjs().locale(locale).startOf('year')\n\n for (let i = 0; i < 12; i++) {\n months.push({ month: i, name: formatDate({ date: date.add(i, 'month'), format, locale }) })\n }\n\n return months\n}\n","interface GetYearsListInput {\n startYear: number\n endYear: number\n}\n\nexport function getYearsList({ startYear, endYear }: GetYearsListInput) {\n const years: number[] = []\n\n for (let year = startYear; year <= endYear; year++) {\n years.push(year)\n }\n\n return years\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, DayOfWeek } from '../../types'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\nimport { toDateString } from '../to-date-string/to-date-string'\n\nexport function nextWeek(date: AnyDateValue, firstDayOfWeek: DayOfWeek): DateStringValue {\n const start = getStartOfWeek({ date, firstDayOfWeek })\n return toDateString(dayjs(start).set('date', dayjs(start).date() + 7))\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, DayOfWeek } from '../../types'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\nimport { toDateString } from '../to-date-string/to-date-string'\n\nexport function previousWeek(date: AnyDateValue, firstDayOfWeek: DayOfWeek): DateStringValue {\n const start = getStartOfWeek({ date, firstDayOfWeek })\n return toDateString(dayjs(start).set('date', dayjs(start).date() - 7))\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\nimport { clampIntervalMinutes } from '../clamp-interval-minutes/clamp-interval-minutes'\n\ninterface GetCurrentTimePositionInput {\n startTime?: string\n endTime?: string\n now?: AnyDateValue\n\n /** Number of minutes per time slot. Used to align the indicator to whole slots when `endTime` does not divide evenly. */\n intervalMinutes?: number\n}\n\nexport function getCurrentTimePosition(input?: GetCurrentTimePositionInput) {\n const now = dayjs(input?.now)\n\n if (!input?.startTime || !input?.endTime) {\n const startOf = now.startOf('date')\n const diffInMinutes = now.diff(startOf, 'minute')\n return (diffInMinutes / 1440) * 100\n }\n\n const [startHour, startMinute, startSecond = 0] = input.startTime.split(':').map(Number)\n const [endHour, endMinute, endSecond = 0] = input.endTime.split(':').map(Number)\n\n const startOfDay = now.startOf('date')\n const startDateTime = startOfDay.hour(startHour).minute(startMinute).second(startSecond)\n const endDateTime = startOfDay.hour(endHour).minute(endMinute).second(endSecond)\n\n const literalSeconds = endDateTime.diff(startDateTime, 'second')\n const intervalSeconds =\n input.intervalMinutes !== undefined\n ? clampIntervalMinutes(input.intervalMinutes) * 60\n : undefined\n const totalSeconds = intervalSeconds\n ? Math.ceil(literalSeconds / intervalSeconds) * intervalSeconds\n : literalSeconds\n const currentSeconds = now.diff(startDateTime, 'second')\n\n return (currentSeconds / totalSeconds) * 100\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue } from '../../types'\nimport { parseTimeString } from '../parse-time-string/parse-time-string'\n\ninterface IsInTimeRangeInput {\n date: AnyDateValue\n startTime?: string\n endTime?: string\n}\n\n/** Returns true if the given date's time is within the specified time range */\nexport function isInTimeRange({\n date,\n startTime = '00:00:00',\n endTime = '23:59:59',\n}: IsInTimeRangeInput) {\n const targetDate = dayjs(date)\n const parsedStartTime = parseTimeString(startTime)\n const parsedEndTime = parseTimeString(endTime)\n\n const startDateTime = targetDate\n .hour(parsedStartTime.hours)\n .minute(parsedStartTime.minutes)\n .second(parsedStartTime.seconds)\n\n const endDateTime = targetDate\n .hour(parsedEndTime.hours)\n .minute(parsedEndTime.minutes)\n .second(parsedEndTime.seconds)\n\n return targetDate.isAfter(startDateTime) && targetDate.isBefore(endDateTime)\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, ScheduleEventData } from '../../types'\n\ninterface IsAllDayEventInput {\n event: ScheduleEventData\n date: AnyDateValue\n}\n\nexport function isAllDayEvent({ event, date }: IsAllDayEventInput) {\n const dayStart = dayjs(date).startOf('day')\n const nextDayStart = dayStart.add(1, 'day')\n const sameDayEnd = nextDayStart.subtract(1, 'second')\n const startTime = dayjs(event.start)\n const endTime = dayjs(event.end)\n\n return startTime.isSame(dayStart) && (endTime.isSame(nextDayStart) || endTime.isSame(sameDayEnd))\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\n\nexport function validateEvent(eventData: ScheduleEventData) {\n if (!dayjs(eventData.start).isValid()) {\n throw new Error(`[@mantine/schedule] Invalid start date for event id: ${eventData.id}`)\n }\n\n if (!dayjs(eventData.end).isValid()) {\n throw new Error(`[@mantine/schedule] Invalid end date for event id: ${eventData.id}`)\n }\n\n if (dayjs(eventData.end).isBefore(dayjs(eventData.start))) {\n throw new Error(\n `[@mantine/schedule] Event end date is before start date for event id: ${eventData.id}`,\n )\n }\n\n return eventData\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\n\n/** Sorts events by start time, then by duration (longer first) */\nexport function sortEvents<T extends ScheduleEventData>(events: T[]): T[] {\n return [...events].sort((a: T, b: T) => {\n const startDiff = dayjs(a.start).diff(dayjs(b.start))\n\n if (startDiff !== 0) {\n return startDiff\n }\n\n return dayjs(b.end).diff(dayjs(b.start)) - dayjs(a.end).diff(dayjs(a.start))\n })\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\n\ninterface CachedTimestamps {\n start: ScheduleEventData['start']\n end: ScheduleEventData['end']\n startTimestamp: number\n endTimestamp: number\n}\n\nconst timestampsCache = new WeakMap<ScheduleEventData, CachedTimestamps>()\n\nfunction getTimestamps(event: ScheduleEventData) {\n const cached = timestampsCache.get(event)\n if (cached && cached.start === event.start && cached.end === event.end) return cached\n const next = {\n start: event.start,\n end: event.end,\n startTimestamp: dayjs(event.start).valueOf(),\n endTimestamp: dayjs(event.end).valueOf(),\n }\n timestampsCache.set(event, next)\n return next\n}\n\n/** Returns true if two events overlap in time */\nexport function isEventsOverlap(event1: ScheduleEventData, event2: ScheduleEventData) {\n const first = getTimestamps(event1)\n const second = getTimestamps(event2)\n return first.startTimestamp < second.endTimestamp && second.startTimestamp < first.endTimestamp\n}\n","interface GetVisibleEventsInput {\n maxEvents: number\n totalEvents: number\n}\n\nexport function getVisibleEvents({ maxEvents, totalEvents }: GetVisibleEventsInput) {\n if (totalEvents <= maxEvents) {\n return {\n visibleEventsCount: totalEvents,\n hiddenEventsCount: 0,\n }\n }\n\n return {\n visibleEventsCount: maxEvents - 1,\n hiddenEventsCount: totalEvents - (maxEvents - 1),\n }\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\n\nexport function isMultidayEvent(event: ScheduleEventData) {\n const startDate = dayjs(event.start).startOf('day')\n const rawEnd = dayjs(event.end)\n const endAtMidnight = rawEnd.hour() === 0 && rawEnd.minute() === 0 && rawEnd.second() === 0\n const endDate = endAtMidnight ? rawEnd.startOf('day').subtract(1, 'day') : rawEnd.startOf('day')\n return endDate.isAfter(startDate)\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\nimport { isMultidayEvent } from '../is-multiday-event/is-multiday-event'\n\ninterface IsEventInTimeRangeInput {\n event: ScheduleEventData\n startTime?: string\n endTime?: string\n}\n\nfunction spansFullDay(event: ScheduleEventData) {\n const start = dayjs(event.start)\n const end = dayjs(event.end)\n if (!start.isSame(start.startOf('day'))) {\n return false\n }\n const nextDayStart = start.startOf('day').add(1, 'day')\n return end.isSame(nextDayStart) || end.isSame(nextDayStart.subtract(1, 'second'))\n}\n\nexport function isEventInTimeRange({ event, startTime, endTime }: IsEventInTimeRangeInput) {\n if (isMultidayEvent(event) || spansFullDay(event)) {\n return true\n }\n\n if (!startTime || !endTime) {\n return true\n }\n\n const [startHour, startMinute] = startTime.split(':').map(Number)\n const [endHour, endMinute] = endTime.split(':').map(Number)\n const timeWindowStartMinutes = startHour * 60 + startMinute\n const timeWindowEndMinutes = endHour * 60 + endMinute\n\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n const eventStartMinutes = eventStart.hour() * 60 + eventStart.minute()\n const eventEndMinutes = eventEnd.hour() * 60 + eventEnd.minute()\n\n return !(eventEndMinutes <= timeWindowStartMinutes || eventStartMinutes >= timeWindowEndMinutes)\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport { getStartOfWeek } from '../get-start-of-week/get-start-of-week'\n\ninterface IsWithinWeekInput {\n event: ScheduleEventData\n targetWeek: AnyDateValue\n firstDayOfWeek: DayOfWeek\n}\n\nexport function isWithinWeek({ event, targetWeek, firstDayOfWeek }: IsWithinWeekInput) {\n const startOfWeek = dayjs(getStartOfWeek({ date: targetWeek, firstDayOfWeek }))\n const endOfWeek = startOfWeek.add(7, 'day')\n return dayjs(event.start).isBefore(endOfWeek) && dayjs(event.end).isAfter(startOfWeek)\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek } from '../../types'\nimport { getMonthDays } from '../get-month-days/get-month-days'\nimport { toDateString } from '../to-date-string/to-date-string'\n\ninterface GetMonthRangeInput {\n month: AnyDateValue\n withOutsideDays: boolean | undefined\n consistentWeeks: boolean | undefined\n firstDayOfWeek: DayOfWeek\n}\n\n/** Returns start and end dates as displayed in MonthView */\nexport function getMonthRange({\n month,\n withOutsideDays,\n consistentWeeks,\n firstDayOfWeek,\n}: GetMonthRangeInput) {\n if (!withOutsideDays) {\n return {\n start: toDateString(dayjs(month).startOf('month')),\n end: toDateString(dayjs(month).endOf('month')),\n }\n }\n\n const days = getMonthDays({ month, firstDayOfWeek, consistentWeeks })\n\n return {\n start: days[0][0],\n end: days[days.length - 1][6],\n }\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../types'\nimport { clampIntervalMinutes } from '../clamp-interval-minutes/clamp-interval-minutes'\nimport { parseTimeString } from '../parse-time-string/parse-time-string'\n\ninterface GetDayPositionInput {\n /** Event data to calculate position for */\n event: ScheduleEventData\n\n /** Start time boundary for the day in HH:mm:ss format, `00:00:00` by default */\n startTime?: string\n\n /** End time boundary for the day in HH:mm:ss format, `23:59:59` by default */\n endTime?: string\n\n /** Number of minutes per time slot, `60` by default. Used to align the canvas to whole slots when `endTime` does not divide evenly. */\n intervalMinutes?: number\n}\n\n/** Calculates day position within given start and end time boundaries. Returns top and height in percentages. */\nexport function getDayPosition({\n event,\n startTime = '00:00:00',\n endTime = '23:59:59',\n intervalMinutes = 60,\n}: GetDayPositionInput) {\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n\n const parsedStartTime = parseTimeString(startTime)\n const parsedEndTime = parseTimeString(endTime)\n\n const startOfDay = eventStart.startOf('date')\n const boundaryStart = startOfDay\n .hour(parsedStartTime.hours)\n .minute(parsedStartTime.minutes)\n .second(parsedStartTime.seconds)\n const literalEnd = startOfDay\n .hour(parsedEndTime.hours)\n .minute(parsedEndTime.minutes)\n .second(parsedEndTime.seconds)\n\n const intervalSeconds = clampIntervalMinutes(intervalMinutes) * 60\n const literalRangeSeconds = literalEnd.diff(boundaryStart, 'second')\n const totalSeconds = Math.ceil(literalRangeSeconds / intervalSeconds) * intervalSeconds\n\n const clippedEventStart = eventStart.isBefore(boundaryStart) ? boundaryStart : eventStart\n const eventStartSeconds = clippedEventStart.diff(boundaryStart, 'second')\n\n const clippedEventEnd = eventEnd.isAfter(literalEnd) ? literalEnd : eventEnd\n const eventEndSeconds = clippedEventEnd.diff(boundaryStart, 'second')\n\n const startPercent = (eventStartSeconds / totalSeconds) * 100\n const endPercent = (eventEndSeconds / totalSeconds) * 100\n\n return {\n top: startPercent,\n height: endPercent - startPercent,\n }\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, ScheduleEventData } from '../../types'\nimport { clampIntervalMinutes } from '../clamp-interval-minutes/clamp-interval-minutes'\nimport { parseTimeString } from '../parse-time-string/parse-time-string'\n\nexport interface CalculateDropTimeInput {\n /** The event being dragged */\n draggedEvent: ScheduleEventData\n\n /** Target date where event will be dropped */\n targetDate: AnyDateValue\n\n /** Target time slot start time in HH:mm:ss format */\n targetSlotTime: string\n\n /** Mouse Y position relative to the slot */\n mouseYOffset?: number\n\n /** Height of one slot in pixels */\n slotHeight?: number\n\n /** Minutes per slot */\n intervalMinutes?: number\n\n /** Pointer offset along the time axis within the target slot, in px. */\n slotOffset?: number\n\n /** Size of the target slot along the time axis, in px. */\n slotSize?: number\n\n /** Snap step for the resulting start time, in minutes. */\n dragIntervalMinutes?: number\n\n /** Start time boundary of the schedule in HH:mm:ss format. */\n startTime?: string\n\n /** End time boundary of the schedule in HH:mm:ss format. */\n endTime?: string\n}\n\nexport interface CalculateDropTimeResult {\n /** New start date/time for the event */\n start: Date\n\n /** New end date/time for the event */\n end: Date\n}\n\nexport function calculateDropTime({\n draggedEvent,\n targetDate,\n targetSlotTime,\n mouseYOffset = 0,\n slotHeight = 64,\n intervalMinutes = 15,\n slotOffset,\n slotSize,\n dragIntervalMinutes,\n startTime,\n endTime,\n}: CalculateDropTimeInput): CalculateDropTimeResult {\n const eventDuration = dayjs(draggedEvent.end).diff(dayjs(draggedEvent.start), 'millisecond')\n\n const parsedTime = parseTimeString(targetSlotTime)\n const targetDay = dayjs(targetDate).startOf('day')\n\n const baseTargetTime = targetDay.hour(parsedTime.hours).minute(parsedTime.minutes).second(0)\n\n let finalTargetTime = baseTargetTime\n\n const offset = slotOffset ?? mouseYOffset\n const size = slotSize ?? slotHeight\n\n if (dragIntervalMinutes != null) {\n const clampedDrag = clampIntervalMinutes(dragIntervalMinutes)\n const gridInterval = clampIntervalMinutes(intervalMinutes)\n const slotStartMinutes = parsedTime.hours * 60 + parsedTime.minutes\n const offsetRatio = size > 0 ? offset / size : 0\n const rawStartMinutes = slotStartMinutes + offsetRatio * gridInterval\n let snappedStartMinutes = Math.round(rawStartMinutes / clampedDrag) * clampedDrag\n\n const parsedEnd = endTime ? parseTimeString(endTime) : null\n const parsedStart = startTime ? parseTimeString(startTime) : null\n const maxStart = parsedEnd\n ? Math.floor((parsedEnd.hours * 60 + parsedEnd.minutes - 1) / clampedDrag) * clampedDrag\n : null\n const minStart = parsedStart\n ? Math.ceil((parsedStart.hours * 60 + parsedStart.minutes) / clampedDrag) * clampedDrag\n : null\n\n if (minStart !== null && maxStart !== null && minStart > maxStart) {\n snappedStartMinutes = parsedStart!.hours * 60 + parsedStart!.minutes\n } else {\n if (maxStart !== null) snappedStartMinutes = Math.min(snappedStartMinutes, maxStart)\n if (minStart !== null) snappedStartMinutes = Math.max(snappedStartMinutes, minStart)\n }\n\n const dayOffset = Math.floor(snappedStartMinutes / 1440)\n const minutesInDay = snappedStartMinutes - dayOffset * 1440\n finalTargetTime = targetDay\n .add(dayOffset, 'day')\n .hour(Math.floor(minutesInDay / 60))\n .minute(minutesInDay % 60)\n .second(0)\n } else if (offset > 0 && size > 0) {\n const offsetRatio = offset / size\n const offsetMinutes = Math.round(offsetRatio * intervalMinutes)\n finalTargetTime = baseTargetTime.add(offsetMinutes, 'minute')\n }\n\n const newStart = finalTargetTime.toDate()\n const newEnd = finalTargetTime.add(eventDuration, 'millisecond').toDate()\n\n return {\n start: newStart,\n end: newEnd,\n }\n}\n","import dayjs from 'dayjs'\nimport { DateStringValue, ScheduleEventData } from '../../types'\n\nexport interface CalculateMonthDropDateInput {\n /** The event being dragged */\n draggedEvent: ScheduleEventData\n\n /** The target day where the event is being dropped */\n targetDay: DateStringValue\n}\n\nexport interface CalculateMonthDropDateResult {\n /** New start date for the event */\n start: Date\n\n /** New end date for the event */\n end: Date\n}\n\nexport function calculateMonthDropDate({\n draggedEvent,\n targetDay,\n}: CalculateMonthDropDateInput): CalculateMonthDropDateResult {\n const eventDuration = dayjs(draggedEvent.end).diff(dayjs(draggedEvent.start), 'millisecond')\n\n const originalStartTime = dayjs(draggedEvent.start)\n const targetDayStart = dayjs(targetDay).startOf('day')\n\n const newStart = targetDayStart\n .hour(originalStartTime.hour())\n .minute(originalStartTime.minute())\n .second(originalStartTime.second())\n .millisecond(originalStartTime.millisecond())\n\n const newEnd = newStart.add(eventDuration, 'millisecond')\n\n return {\n start: newStart.toDate(),\n end: newEnd.toDate(),\n }\n}\n","import { DayOfWeek } from '../../types'\n\n/** Business hours range in `HH:mm:ss` format */\nexport type BusinessHoursRange = [string, string]\n\n/** Per-day business hours map keyed by day of the week (0 – Sunday, 6 – Saturday). `null` marks a day as fully outside business hours. */\nexport type BusinessHoursPerDay = Partial<Record<DayOfWeek, BusinessHoursRange | null>>\n\n/** Business hours value – tuple applies to every day, record configures business hours per day */\nexport type BusinessHoursValue = BusinessHoursRange | BusinessHoursPerDay\n\nexport interface GetBusinessHoursModInput {\n time: string\n businessHours?: BusinessHoursValue\n highlightBusinessHours?: boolean\n dayOfWeek?: DayOfWeek\n}\n\nexport interface BusinessHoursMod {\n 'business-hours': boolean\n 'non-business-hours': boolean\n}\n\nfunction isBusinessHoursRange(value: BusinessHoursValue): value is BusinessHoursRange {\n return (\n Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'string' &&\n typeof value[1] === 'string'\n )\n}\n\n/**\n * Determines if a given time is within business hours and returns modifier object\n * @param time - Time string in HH:mm:ss format\n * @param businessHours - Tuple of [start, end] times in HH:mm:ss format, or per-day record keyed by day of the week\n * @param highlightBusinessHours - Whether to highlight business hours\n * @param dayOfWeek - Day of the week (0 – Sunday, 6 – Saturday), used to resolve per-day business hours\n * @returns Modifier object for styling business/non-business hours\n */\nexport function getBusinessHoursMod({\n time,\n businessHours,\n highlightBusinessHours,\n dayOfWeek,\n}: GetBusinessHoursModInput): BusinessHoursMod {\n if (!highlightBusinessHours || !businessHours) {\n return {\n 'business-hours': false,\n 'non-business-hours': false,\n }\n }\n\n let range: [string, string] | null\n if (isBusinessHoursRange(businessHours)) {\n range = businessHours\n } else {\n if (dayOfWeek === undefined) {\n return {\n 'business-hours': false,\n 'non-business-hours': false,\n }\n }\n range = businessHours[dayOfWeek] ?? null\n }\n\n if (!range) {\n return {\n 'business-hours': false,\n 'non-business-hours': true,\n }\n }\n\n const [start, end] = range\n const isInBusinessHours = time >= start && time < end\n\n return {\n 'business-hours': isInBusinessHours,\n 'non-business-hours': !isInBusinessHours,\n }\n}\n","import dayjs from 'dayjs'\nimport * as rruleAll from 'rrule'\n\nfunction resolveRRule(ns: Record<string, unknown>): typeof rruleAll.RRule {\n const interop = (ns.default ?? ns) as typeof rruleAll\n return interop.RRule\n}\nconst RRule = resolveRRule(rruleAll as unknown as Record<string, unknown>)\nimport { DateTimeStringValue, ScheduleEventData, ScheduleRecurrenceData } from '../../types'\nimport { validateEvent } from '../validate-event/validate-event'\n\ninterface ExpandRecurringEventsInput {\n events: ScheduleEventData[] | undefined\n rangeStart: Date | string\n rangeEnd: Date | string\n expansionLimit?: number\n}\n\nfunction getRecurrenceKey(recurringEventId: string | number, recurrenceId: DateTimeStringValue) {\n return `${recurringEventId}::${recurrenceId}`\n}\n\nfunction overlapsRange(\n eventStart: dayjs.Dayjs,\n eventEnd: dayjs.Dayjs,\n rangeStart: dayjs.Dayjs,\n rangeEnd: dayjs.Dayjs,\n) {\n return (\n (eventEnd.isAfter(rangeStart) || eventEnd.isSame(rangeStart)) &&\n (eventStart.isBefore(rangeEnd) || eventStart.isSame(rangeEnd))\n )\n}\n\nfunction getExdateSet(recurrence: ScheduleRecurrenceData | undefined) {\n if (!recurrence?.exdate) {\n return new Set<string>()\n }\n\n const values = recurrence.exdate\n .map((value) => dayjs(value))\n .filter((value) => value.isValid())\n .map((value) => value.format('YYYY-MM-DD HH:mm:ss'))\n\n return new Set(values)\n}\n\nfunction toWallClockDate(value: dayjs.Dayjs) {\n return new Date(\n Date.UTC(\n value.year(),\n value.month(),\n value.date(),\n value.hour(),\n value.minute(),\n value.second(),\n value.millisecond(),\n ),\n )\n}\n\nfunction fromWallClockDate(value: Date) {\n const result = new Date(2000, 0, 1, 12)\n result.setFullYear(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate())\n result.setHours(\n value.getUTCHours(),\n value.getUTCMinutes(),\n value.getUTCSeconds(),\n value.getUTCMilliseconds(),\n )\n return dayjs(result)\n}\n\nfunction getWallClockDurationMs(start: dayjs.Dayjs, end: dayjs.Dayjs) {\n return toWallClockDate(end).getTime() - toWallClockDate(start).getTime()\n}\n\nfunction getRRuleString(rule: string) {\n const normalized = rule.trim()\n if (!normalized.includes('\\n')) {\n return normalized.startsWith('RRULE:') ? normalized.replace(/^RRULE:/, '') : normalized\n }\n\n const rruleLine = normalized\n .split('\\n')\n .map((line) => line.trim())\n .find((line) => line.startsWith('RRULE:'))\n\n return rruleLine ? rruleLine.replace(/^RRULE:/, '') : normalized\n}\n\nfunction getOccurrenceStartsInRange(\n event: ScheduleEventData,\n rangeStart: dayjs.Dayjs,\n rangeEnd: dayjs.Dayjs,\n expansionLimit: number,\n durationMs: number,\n) {\n const dtstart = dayjs(event.recurrence?.dtstart || event.start)\n if (!dtstart.isValid() || !event.recurrence) {\n return []\n }\n\n try {\n const options = RRule.parseString(getRRuleString(event.recurrence.rrule))\n options.dtstart = toWallClockDate(dtstart)\n const rule = new RRule(options)\n\n const searchStart = new Date(toWallClockDate(rangeStart).getTime() - Math.max(0, durationMs))\n return rule.between(searchStart, toWallClockDate(rangeEnd), true).slice(0, expansionLimit)\n } catch {\n return []\n }\n}\n\nfunction isEventInRange(event: ScheduleEventData, rangeStart: dayjs.Dayjs, rangeEnd: dayjs.Dayjs) {\n const start = dayjs(event.start)\n const end = dayjs(event.end)\n\n if (!start.isValid() || !end.isValid()) {\n return false\n }\n\n return overlapsRange(start, end, rangeStart, rangeEnd)\n}\n\nfunction createGeneratedInstance(\n event: ScheduleEventData,\n occurrenceStart: dayjs.Dayjs,\n occurrenceEnd: dayjs.Dayjs,\n): ScheduleEventData {\n const recurrenceId = occurrenceStart.format('YYYY-MM-DD HH:mm:ss')\n const { recurrence: _recurrence, ...eventWithoutRecurrence } = event\n\n return {\n ...eventWithoutRecurrence,\n id: `${event.id}::${recurrenceId}`,\n start: occurrenceStart.format('YYYY-MM-DD HH:mm:ss'),\n end: occurrenceEnd.format('YYYY-MM-DD HH:mm:ss'),\n recurringEventId: event.id,\n recurrenceId,\n recurringInstance: {\n isRecurringInstance: true,\n recurringEventId: event.id,\n recurrenceId,\n originalStart: occurrenceStart.format('YYYY-MM-DD HH:mm:ss'),\n originalEnd: occurrenceEnd.format('YYYY-MM-DD HH:mm:ss'),\n },\n }\n}\n\nconst DEFAULT_EXPANSION_LIMIT = 2000\n\nexport function expandRecurringEvents({\n events,\n rangeStart,\n rangeEnd,\n expansionLimit = DEFAULT_EXPANSION_LIMIT,\n}: ExpandRecurringEventsInput): ScheduleEventData[] {\n if (!events || events.length === 0) {\n return []\n }\n\n const start = dayjs(rangeStart)\n const end = dayjs(rangeEnd)\n\n if (!start.isValid() || !end.isValid()) {\n return []\n }\n\n const regularEvents: ScheduleEventData[] = []\n const recurringEvents: ScheduleEventData[] = []\n const overrides = new Map<string, ScheduleEventData>()\n\n for (const event of events) {\n if (event.recurringEventId && event.recurrenceId) {\n overrides.set(getRecurrenceKey(event.recurringEventId, event.recurrenceId), event)\n continue\n }\n\n if (event.recurrence?.rrule) {\n recurringEvents.push(event)\n continue\n }\n\n regularEvents.push(event)\n }\n\n const output: ScheduleEventData[] = []\n const consumedOverrideIds = new Set<string | number>()\n\n for (const event of regularEvents) {\n if (isEventInRange(event, start, end)) {\n output.push(validateEvent(event))\n }\n }\n\n for (const event of recurringEvents) {\n const eventStart = dayjs(event.recurrence?.dtstart || event.start)\n const eventEnd = dayjs(event.end)\n\n if (!eventStart.isValid() || !eventEnd.isValid()) {\n continue\n }\n\n const durationMs = getWallClockDurationMs(dayjs(event.start), eventEnd)\n if (durationMs < 0) {\n continue\n }\n\n const exdate = getExdateSet(event.recurrence)\n const starts = getOccurrenceStartsInRange(event, start, end, expansionLimit, durationMs)\n\n for (const wallClockStart of starts) {\n const occurrenceStart = fromWallClockDate(wallClockStart)\n const recurrenceId = occurrenceStart.format('YYYY-MM-DD HH:mm:ss')\n if (exdate.has(recurrenceId)) {\n continue\n }\n\n const overrideKey = getRecurrenceKey(event.id, recurrenceId)\n const override = overrides.get(overrideKey)\n if (override) {\n if (isEventInRange(override, start, end)) {\n output.push(validateEvent(override))\n consumedOverrideIds.add(override.id)\n }\n continue\n }\n\n const occurrenceEnd = fromWallClockDate(new Date(wallClockStart.getTime() + durationMs))\n const generated = createGeneratedInstance(event, occurrenceStart, occurrenceEnd)\n if (overlapsRange(dayjs(generated.start), dayjs(generated.end), start, end)) {\n output.push(validateEvent(generated))\n }\n }\n }\n\n for (const override of overrides.values()) {\n if (consumedOverrideIds.has(override.id)) {\n continue\n }\n if (isEventInRange(override, start, end)) {\n output.push(validateEvent(override))\n }\n }\n\n return output\n}\n\nexport { DEFAULT_EXPANSION_LIMIT }\n","import type { ScheduleResourceData, ScheduleResourceGroup } from '../../types'\n\nexport interface GroupRange {\n group: ScheduleResourceGroup\n startIndex: number\n count: number\n}\n\nexport interface ResourceGroupInfo {\n group: ScheduleResourceGroup\n position: 'first' | 'middle' | 'last' | 'only'\n count: number\n}\n\nexport interface OrderedResourcesResult {\n orderedResources: ScheduleResourceData[]\n groupRanges: GroupRange[]\n resourceGroupMap: Array<ResourceGroupInfo | null>\n}\n\nexport function getOrderedResources(\n resources: ScheduleResourceData[],\n groups: ScheduleResourceGroup[] | undefined,\n): OrderedResourcesResult {\n if (!groups?.length) {\n return { orderedResources: resources, groupRanges: [], resourceGroupMap: [] }\n }\n\n const resourceMap = new Map(resources.map((resource) => [resource.id, resource]))\n const usedIds = new Set<string | number>()\n const orderedResources: ScheduleResourceData[] = []\n const groupRanges: GroupRange[] = []\n\n groups.forEach((group) => {\n const startIndex = orderedResources.length\n group.resourceIds.forEach((id) => {\n const resource = resourceMap.get(id)\n if (resource && !usedIds.has(id)) {\n orderedResources.push(resource)\n usedIds.add(id)\n }\n })\n const count = orderedResources.length - startIndex\n if (count) groupRanges.push({ group, startIndex, count })\n })\n\n resources.forEach((resource) => {\n if (!usedIds.has(resource.id)) orderedResources.push(resource)\n })\n\n const resourceGroupMap: Array<ResourceGroupInfo | null> = Array(orderedResources.length).fill(\n null,\n )\n groupRanges.forEach(({ group, startIndex, count }) => {\n for (let index = 0; index < count; index += 1) {\n const position: ResourceGroupInfo['position'] =\n count === 1 ? 'only' : index === 0 ? 'first' : index === count - 1 ? 'last' : 'middle'\n resourceGroupMap[startIndex + index] = { group, position, count }\n }\n })\n\n return { orderedResources, groupRanges, resourceGroupMap }\n}\n","import type { ScheduleResourceData } from '../../types'\n\nexport function getGroupToResourceIdMap(\n resources: ScheduleResourceData[],\n): Map<string, string | number> {\n return new Map(resources.map((resource) => [String(resource.id), resource.id]))\n}\n","export type ResourcesGridControls = Array<Array<HTMLButtonElement | undefined>>\n\nexport interface HandleResourcesGridKeyDownInput {\n controls: ResourcesGridControls\n resourceIndex: number\n slotIndex: number\n event: KeyboardEvent\n}\n\nexport function handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex,\n event,\n}: HandleResourcesGridKeyDownInput): void {\n const deltas: Record<string, [number, number]> = {\n ArrowLeft: [0, -1],\n ArrowRight: [0, 1],\n ArrowUp: [-1, 0],\n ArrowDown: [1, 0],\n }\n const delta = deltas[event.key]\n if (!delta) return\n event.preventDefault()\n\n let row = resourceIndex + delta[0]\n let column = slotIndex + delta[1]\n while (row >= 0 && row < controls.length) {\n const rowControls = controls[row] || []\n if (delta[0] !== 0) column = Math.min(column, rowControls.length - 1)\n if (column < 0 || column >= rowControls.length) return\n const control = rowControls[column]\n if (control && !control.disabled && !control.hasAttribute('data-hidden')) {\n control.focus()\n return\n }\n row += delta[0]\n column += delta[1]\n }\n}\n","import dayjs from 'dayjs'\nimport { computed, onScopeDispose, type ComputedRef } from 'vue'\nimport type { EventSlots, RenderEvent, RenderEventBody } from '../component-props'\nimport type {\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n} from '../types'\nimport { expandRecurringEvents, formatDate, toDateString } from '../utils'\n\n/**\n * Resolves a schedule `radius` prop to a CSS value.\n *\n * Deliberately not `getRadius` from the core package: this accepts any CSS length\n * (`12px`, `1em`, `clamp(...)`) alongside the `theme.radius` keys, and treats a plain\n * number as pixels rather than rem.\n */\nexport function resolveScheduleRadius(radius: string | number | undefined): string | undefined {\n if (radius === undefined) {\n return undefined\n }\n\n if (typeof radius === 'number') {\n return `${radius}px`\n }\n\n return ['xs', 'sm', 'md', 'lg', 'xl'].includes(radius)\n ? `var(--mantine-radius-${radius})`\n : radius\n}\n\n/** A callback coalesced to one animation frame, with the pending frame cancellable. */\nexport interface RafThrottled<Args extends unknown[]> {\n (...args: Args): void\n\n /** Drops the pending frame. Call this the moment the gesture ends. */\n cancel: () => void\n}\n\n/**\n * Runs `callback` at most once per animation frame with the most recent arguments.\n *\n * Pointer and drag events fire far faster than the browser paints. Handling every one of them\n * means the schedule reads layout and re-renders several times per frame, which makes the drag\n * fall behind the pointer and keep catching up after it has stopped. Coalescing to one frame\n * keeps the work bounded, and `cancel` guarantees nothing lands after the drop.\n */\nexport function rafThrottle<Args extends unknown[]>(\n callback: (...args: Args) => void,\n): RafThrottled<Args> {\n let frame = 0\n let pending: Args | null = null\n\n const run = () => {\n frame = 0\n const args = pending\n pending = null\n\n if (args) {\n callback(...args)\n }\n }\n\n const throttled = ((...args: Args) => {\n pending = args\n\n if (frame === 0) {\n frame = requestAnimationFrame(run)\n }\n }) as RafThrottled<Args>\n\n throttled.cancel = () => {\n if (frame !== 0) {\n cancelAnimationFrame(frame)\n }\n\n frame = 0\n pending = null\n }\n\n onScopeDispose(throttled.cancel, true)\n\n return throttled\n}\n\n/**\n * Styles produced by `getStyles` for one selector. `any` matches the core signature: the value\n * is spread onto an element, where `class` and `style` accept every shape Vue supports.\n */\nexport type SelectorStyles = { class: any; style: any }\n\n/**\n * Memoizes `getStyles(selector)` for selectors that take no per-element options.\n *\n * A view renders the same selector for hundreds of slots, and every `getStyles` call rebuilds\n * the class list and merges the resolved styles and CSS variables. Wrapping each selector in a\n * `computed` turns that into one evaluation per selector per change of the theme or the props,\n * instead of one per element per render — which is what a drag re-render is made of.\n */\nexport function useStaticStyles<Selector extends string>(\n getStyles: (selector: Selector) => SelectorStyles,\n) {\n const cache = new Map<Selector, ComputedRef<SelectorStyles>>()\n\n return (selector: Selector): SelectorStyles => {\n let entry = cache.get(selector)\n\n if (!entry) {\n entry = computed(() => getStyles(selector))\n cache.set(selector, entry)\n }\n\n return entry.value\n }\n}\n\n/** Converts a `slotHeight` / `rowHeight` style prop to a CSS length. */\nexport function cssSize(value: string | number | undefined): string | undefined {\n return typeof value === 'number' ? `${value}px` : value\n}\n\nexport function getExpandedEvents(\n events: ScheduleEventData[] | undefined,\n rangeStart: Date | string,\n rangeEnd: Date | string,\n expansionLimit: number,\n) {\n return expandRecurringEvents({ events, rangeStart, rangeEnd, expansionLimit })\n}\n\nexport function formatLabel(\n date: Date | string,\n locale: string | undefined,\n format: DateLabelFormat,\n) {\n return formatDate({ date, locale: locale || 'en', format })\n}\n\n/** The `renderEvent` / `renderEventBody` pair a view hands down to `ScheduleEvent`. */\nexport interface EventRenderers {\n renderEvent?: RenderEvent\n renderEventBody?: RenderEventBody\n}\n\n/**\n * Folds the `event` / `eventBody` scoped slots into the equivalent render props, so a view\n * forwards a single object down to every `ScheduleEvent` it renders instead of re-declaring\n * the slots at each call site. Slots win over props, matching the rest of the library.\n */\nexport function resolveEventRenderers(props: EventRenderers, slots: EventSlots): EventRenderers {\n return {\n renderEvent: slots.event\n ? (event, renderProps) => slots.event!({ ...renderProps, event })\n : props.renderEvent,\n renderEventBody: slots.eventBody\n ? (event) => slots.eventBody!({ event })\n : props.renderEventBody,\n }\n}\n\n/** Reads the event referenced by a native drag payload, if the drag started inside a schedule. */\nexport function getDropEvent(\n events: ScheduleEventData[] | undefined,\n transfer: DataTransfer | null,\n) {\n const raw = transfer?.getData('application/json')\n\n if (!raw) {\n return undefined\n }\n\n try {\n const data: unknown = JSON.parse(raw)\n\n if (typeof data !== 'object' || data === null || !('eventId' in data)) {\n return undefined\n }\n\n const eventId = (data as { eventId: unknown }).eventId\n\n if (typeof eventId !== 'string' && typeof eventId !== 'number') {\n return undefined\n }\n\n return events?.find((event) => String(event.id) === String(eventId))\n } catch {\n return undefined\n }\n}\n\n/**\n * Attribute the views put on their `ScrollArea` viewport so they can find it again without\n * depending on Mantine static classes, which a consumer can turn off.\n */\nexport const SCROLL_VIEWPORT_ATTRIBUTE = 'data-schedule-viewport'\n\n/** Props spread onto the viewport of a view's `ScrollArea`. */\nexport const scheduleViewportProps = { [SCROLL_VIEWPORT_ATTRIBUTE]: '' }\n\n/** Finds the `ScrollArea` viewport that contains `node`. */\nexport function getScrollAreaViewport(node: HTMLElement | null | undefined) {\n return node?.closest<HTMLElement>(`[${SCROLL_VIEWPORT_ATTRIBUTE}]`) ?? null\n}\n\n/**\n * Scrolls the viewport around `target` so that `target` sits at its start.\n *\n * The second pass runs a frame later because a `ScrollArea` viewport is still being laid out\n * on the tick it mounts, so the first offsets it reports are not final.\n */\nexport function scrollSlotIntoView(target: HTMLElement | null | undefined, axis: 'x' | 'y' = 'y') {\n const viewport = getScrollAreaViewport(target)\n\n if (!viewport || !target) {\n return\n }\n\n const scroll = () => {\n if (axis === 'x') {\n viewport.scrollLeft = target.offsetLeft\n } else {\n viewport.scrollTop = target.offsetTop\n }\n }\n\n scroll()\n requestAnimationFrame(scroll)\n}\n\nexport function moveEventTo(event: ScheduleEventData, newStart: dayjs.ConfigType) {\n const start = dayjs(event.start)\n const duration = dayjs(event.end).diff(start, 'second')\n const nextStart = dayjs(newStart)\n\n return {\n eventId: event.id,\n newStart: nextStart.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n newEnd: nextStart.add(duration, 'second').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n event,\n }\n}\n\nexport function moveEventToAllDay(event: ScheduleEventData, date: dayjs.ConfigType) {\n const dayStart = dayjs(date).startOf('day')\n const spanDays = Math.max(\n 1,\n dayjs(event.end).startOf('day').diff(dayjs(event.start).startOf('day'), 'day'),\n )\n\n return {\n eventId: event.id,\n newStart: dayStart.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n newEnd: dayStart.add(spanDays, 'day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n event,\n }\n}\n\nexport function todayString(): DateStringValue {\n return toDateString(dayjs())\n}\n","import dayjs from 'dayjs'\nimport { onBeforeUnmount, shallowRef } from 'vue'\nimport { rafThrottle } from '../components/shared'\nimport type { EventDropData } from '../component-props'\nimport type { DateTimeStringValue, ScheduleEventData, ScheduleMode } from '../types'\nimport { clampIntervalMinutes, parseTimeString } from '../utils'\n\ntype ResizeEdge = 'top' | 'bottom'\n\ninterface ResizeState {\n eventId: string | number\n event: ScheduleEventData\n edge: ResizeEdge\n container: HTMLElement\n originalTop: number\n originalHeight: number\n currentTop: number\n currentHeight: number\n eventDate: string\n originalStart: DateTimeStringValue\n originalEnd: DateTimeStringValue\n startMinutes: number\n literalRange: number\n totalMinutes: number\n intervalMinutes: number\n minHeightPercent: number\n}\n\ninterface HandleResizeStartInput {\n event: ScheduleEventData\n edge: ResizeEdge\n container: HTMLElement\n originalTop: number\n originalHeight: number\n eventDate: string\n pointerEvent: PointerEvent\n}\n\nexport interface UseEventResizeInput {\n enabled: () => boolean\n mode: () => ScheduleMode\n startTime: () => string\n endTime: () => string\n intervalMinutes: () => number\n resizeIntervalMinutes?: () => number | undefined\n onEventResize: (data: EventDropData) => void\n canResizeEvent: () => ((event: ScheduleEventData) => boolean) | undefined\n}\n\nexport function useEventResize(input: UseEventResizeInput) {\n const resizeState = shallowRef<ResizeState | null>(null)\n let justResized = false\n let savedUserSelect: string | null = null\n\n const clampAndSnap = (minutes: number, state: ResizeState): number => {\n const snapped = Math.round(minutes / state.intervalMinutes) * state.intervalMinutes\n return Math.max(0, Math.min(state.literalRange, snapped))\n }\n\n const snapPercent = (percent: number, state: ResizeState): number => {\n const minutes = (percent / 100) * state.totalMinutes\n return (clampAndSnap(minutes, state) / state.totalMinutes) * 100\n }\n\n const percentToDateTime = (\n percent: number,\n eventDate: string,\n state: ResizeState,\n ): DateTimeStringValue => {\n const minutes = (percent / 100) * state.totalMinutes\n const totalMinutes = state.startMinutes + clampAndSnap(minutes, state)\n const hours = Math.floor(totalMinutes / 60)\n const mins = totalMinutes % 60\n return `${eventDate} ${String(hours).padStart(2, '0')}:${String(mins).padStart(2, '0')}:00`\n }\n\n /**\n * Coalesced to one animation frame: `pointermove` outruns paint, and each step reads layout\n * and re-renders the grid. Without this the preview trails the pointer and keeps moving after\n * it stops.\n */\n const handlePointerMove = rafThrottle((clientY: number) => {\n const state = resizeState.value\n if (!state) return\n\n const containerRect = state.container.getBoundingClientRect()\n if (containerRect.height === 0) return\n\n const relativeY = clientY - containerRect.top\n const rawPercent = Math.max(0, Math.min(100, (relativeY / containerRect.height) * 100))\n const snappedPercent = snapPercent(rawPercent, state)\n let currentTop = state.originalTop\n let currentHeight = state.originalHeight\n\n if (state.edge === 'bottom') {\n currentHeight = Math.max(state.minHeightPercent, snappedPercent - state.originalTop)\n } else {\n const originalBottom = state.originalTop + state.originalHeight\n currentTop = Math.min(snappedPercent, originalBottom - state.minHeightPercent)\n currentHeight = originalBottom - currentTop\n }\n\n resizeState.value = { ...state, currentTop, currentHeight }\n })\n\n const trackPointer = (event: PointerEvent) => handlePointerMove(event.clientY)\n\n const removeDocumentListeners = () => {\n handlePointerMove.cancel()\n document.removeEventListener('pointermove', trackPointer)\n document.removeEventListener('pointerup', handlePointerUp)\n if (savedUserSelect !== null) {\n document.body.style.userSelect = savedUserSelect\n savedUserSelect = null\n }\n }\n\n const handlePointerUp = () => {\n // Drop the pending frame first, so a stale step cannot land after the gesture ended.\n handlePointerMove.cancel()\n const state = resizeState.value\n if (\n state &&\n (state.currentTop !== state.originalTop || state.currentHeight !== state.originalHeight)\n ) {\n const newStart =\n state.edge === 'top'\n ? percentToDateTime(state.currentTop, state.eventDate, state)\n : state.originalStart\n const newEnd =\n state.edge === 'bottom'\n ? percentToDateTime(state.currentTop + state.currentHeight, state.eventDate, state)\n : state.originalEnd\n\n input.onEventResize({ eventId: state.eventId, newStart, newEnd, event: state.event })\n }\n\n resizeState.value = null\n removeDocumentListeners()\n justResized = true\n requestAnimationFrame(() => {\n justResized = false\n })\n }\n\n const handleResizeStart = ({\n event,\n edge,\n container,\n originalTop,\n originalHeight,\n eventDate,\n pointerEvent,\n }: HandleResizeStartInput) => {\n if (!input.enabled() || input.mode() === 'static') return\n\n pointerEvent.preventDefault()\n pointerEvent.stopPropagation()\n\n const parsedStartTime = parseTimeString(input.startTime())\n const parsedEndTime = parseTimeString(input.endTime())\n const startMinutes = parsedStartTime.hours * 60 + parsedStartTime.minutes\n const endMinutes = parsedEndTime.hours * 60 + parsedEndTime.minutes\n const intervalMinutes = clampIntervalMinutes(\n input.resizeIntervalMinutes?.() ?? input.intervalMinutes(),\n )\n const literalRange = endMinutes - startMinutes\n const totalMinutes = Math.ceil(literalRange / intervalMinutes) * intervalMinutes\n\n resizeState.value = {\n eventId: event.id,\n event,\n edge,\n container,\n originalTop,\n originalHeight,\n currentTop: originalTop,\n currentHeight: originalHeight,\n eventDate,\n originalStart: dayjs(event.start).format('YYYY-MM-DD HH:mm:ss'),\n originalEnd: dayjs(event.end).format('YYYY-MM-DD HH:mm:ss'),\n startMinutes,\n literalRange,\n totalMinutes,\n intervalMinutes,\n minHeightPercent: (intervalMinutes / totalMinutes) * 100,\n }\n\n savedUserSelect = document.body.style.userSelect\n document.body.style.userSelect = 'none'\n document.addEventListener('pointermove', trackPointer)\n document.addEventListener('pointerup', handlePointerUp)\n }\n\n const getResizePosition = (eventId: string | number) => {\n const state = resizeState.value\n return state?.eventId === eventId\n ? { top: state.currentTop, height: state.currentHeight }\n : null\n }\n\n const isResizableEvent = (event: ScheduleEventData): boolean =>\n input.enabled() &&\n input.mode() !== 'static' &&\n event.display !== 'background' &&\n (input.canResizeEvent()?.(event) ?? true)\n\n onBeforeUnmount(removeDocumentListeners)\n\n return {\n handleResizeStart,\n getResizePosition,\n isResizableEvent,\n wasResizing: () => justResized,\n }\n}\n",".currentTimeIndicator {\n --time-bubble-height: 18px;\n --thumb-size: 12px;\n --_indicator-color: var(--indicator-color, var(--mantine-color-red-7));\n\n position: absolute;\n pointer-events: none;\n left: 0;\n right: 0;\n top: var(--top-offset);\n height: 2px;\n z-index: 2;\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.currentTimeIndicatorLine {\n height: 100%;\n position: absolute;\n top: 0;\n background-color: var(--_indicator-color);\n inset-inline-start: var(--start-offset);\n inset-inline-end: var(--end-offset);\n}\n\n.currentTimeIndicatorThumb {\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 inset-inline-start: calc(var(--start-offset) - (var(--thumb-size) / 2 - 1px));\n}\n\n.currentTimeIndicatorTimeBubble {\n position: absolute;\n height: var(--time-bubble-height);\n width: var(--time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n inset-inline-start: var(--time-bubble-start-offset);\n top: calc(-1 * (var(--time-bubble-height) / 2 - 1px));\n z-index: 2;\n text-transform: uppercase;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver, getThemeColor } from '@mantine-vue/core'\n\nconst defaultProps = {\n color: 'red',\n startOffset: '0px',\n endOffset: '0px',\n topOffset: '0px',\n timeBubbleStartOffset: '0px',\n withTimeBubble: true,\n withThumb: true,\n currentTimeFormat: 'HH:mm',\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n} as const\n\n// Time-dependent values reach the module-scoped resolver through the styles context.\nconst varsResolver = createVarsResolver<any>(\n (theme, { color, startOffset, endOffset, topOffset, timeBubbleStartOffset }, ctx) => ({\n currentTimeIndicator: {\n '--indicator-color': getThemeColor(color, theme),\n '--start-offset': startOffset,\n '--end-offset': endOffset,\n '--top-offset': `calc(${ctx.offsetPercent}% + ${topOffset})`,\n '--time-bubble-start-offset': timeBubbleStartOffset,\n // A format with AM/PM needs a wider bubble than a 24h one.\n '--time-bubble-width': ctx.hasMeridiem ? '64px' : '46px',\n },\n }),\n)\n\nconst TICK_INTERVAL = 30_000\n\nexport { defaultProps, varsResolver, TICK_INTERVAL }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, onBeforeUnmount, onMounted, ref, useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { formatDate, getCurrentTimePosition, isInTimeRange } from '../../utils'\nimport type { CurrentTimeIndicatorOwnProps } from './CurrentTimeIndicator.types'\nimport classes from './CurrentTimeIndicator.module.css'\n\ndefineOptions({\n name: 'CurrentTimeIndicator',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<CurrentTimeIndicatorOwnProps>(), {\n color: undefined,\n startOffset: undefined,\n endOffset: undefined,\n topOffset: undefined,\n timeBubbleStartOffset: undefined,\n withTimeBubble: undefined,\n withThumb: undefined,\n currentTimeFormat: undefined,\n locale: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n getCurrentTime: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst attrs = useAttrs()\n\nconst props = useProps('CurrentTimeIndicator', defaultProps, rawProps)\n\n/** Bumped on every tick so the computed values below re-evaluate. */\nconst tick = ref(0)\nlet timer: ReturnType<typeof setInterval> | undefined\n\nonMounted(() => {\n timer = setInterval(() => {\n tick.value += 1\n }, TICK_INTERVAL)\n})\n\nonBeforeUnmount(() => clearInterval(timer))\n\nconst now = computed(() => {\n void tick.value\n return props.getCurrentTime ? dayjs(props.getCurrentTime()) : dayjs()\n})\n\nconst visible = computed(() =>\n isInTimeRange({ date: now.value, startTime: props.startTime, endTime: props.endTime }),\n)\n\nconst offsetPercent = computed(() =>\n getCurrentTimePosition({\n now: now.value,\n startTime: props.startTime,\n endTime: props.endTime,\n intervalMinutes: props.intervalMinutes,\n }),\n)\n\nconst formattedTime = computed(() =>\n props.withTimeBubble\n ? formatDate({\n date: now.value,\n locale: props.locale || 'en',\n format: props.currentTimeFormat!,\n })\n : '',\n)\n\nconst getStyles = useStyles({\n name: 'CurrentTimeIndicator',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'currentTimeIndicator',\n // Getters keep the context live without re-creating the styles resolver on every tick.\n stylesCtx: {\n get offsetPercent() {\n return offsetPercent.value\n },\n get hasMeridiem() {\n return String(formattedTime.value).toLowerCase().includes('m')\n },\n },\n})\n</script>\n\n<template>\n <Box v-if=\"visible\" v-bind=\"{ ...attrs, ...getStyles('currentTimeIndicator') }\">\n <div v-if=\"props.withTimeBubble\" v-bind=\"getStyles('currentTimeIndicatorTimeBubble')\">\n {{ formattedTime }}\n </div>\n <div v-if=\"props.withThumb\" v-bind=\"getStyles('currentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('currentTimeIndicatorLine')\" />\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver, getThemeColor } from '@mantine-vue/core'\n\nconst defaultProps = {\n color: 'red',\n startOffset: '0px',\n endOffset: '0px',\n topOffset: '0px',\n timeBubbleStartOffset: '0px',\n withTimeBubble: true,\n withThumb: true,\n currentTimeFormat: 'HH:mm',\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n} as const\n\n// Time-dependent values reach the module-scoped resolver through the styles context.\nconst varsResolver = createVarsResolver<any>(\n (theme, { color, startOffset, endOffset, topOffset, timeBubbleStartOffset }, ctx) => ({\n currentTimeIndicator: {\n '--indicator-color': getThemeColor(color, theme),\n '--start-offset': startOffset,\n '--end-offset': endOffset,\n '--top-offset': `calc(${ctx.offsetPercent}% + ${topOffset})`,\n '--time-bubble-start-offset': timeBubbleStartOffset,\n // A format with AM/PM needs a wider bubble than a 24h one.\n '--time-bubble-width': ctx.hasMeridiem ? '64px' : '46px',\n },\n }),\n)\n\nconst TICK_INTERVAL = 30_000\n\nexport { defaultProps, varsResolver, TICK_INTERVAL }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, onBeforeUnmount, onMounted, ref, useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { formatDate, getCurrentTimePosition, isInTimeRange } from '../../utils'\nimport type { CurrentTimeIndicatorOwnProps } from './CurrentTimeIndicator.types'\nimport classes from './CurrentTimeIndicator.module.css'\n\ndefineOptions({\n name: 'CurrentTimeIndicator',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<CurrentTimeIndicatorOwnProps>(), {\n color: undefined,\n startOffset: undefined,\n endOffset: undefined,\n topOffset: undefined,\n timeBubbleStartOffset: undefined,\n withTimeBubble: undefined,\n withThumb: undefined,\n currentTimeFormat: undefined,\n locale: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n getCurrentTime: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst attrs = useAttrs()\n\nconst props = useProps('CurrentTimeIndicator', defaultProps, rawProps)\n\n/** Bumped on every tick so the computed values below re-evaluate. */\nconst tick = ref(0)\nlet timer: ReturnType<typeof setInterval> | undefined\n\nonMounted(() => {\n timer = setInterval(() => {\n tick.value += 1\n }, TICK_INTERVAL)\n})\n\nonBeforeUnmount(() => clearInterval(timer))\n\nconst now = computed(() => {\n void tick.value\n return props.getCurrentTime ? dayjs(props.getCurrentTime()) : dayjs()\n})\n\nconst visible = computed(() =>\n isInTimeRange({ date: now.value, startTime: props.startTime, endTime: props.endTime }),\n)\n\nconst offsetPercent = computed(() =>\n getCurrentTimePosition({\n now: now.value,\n startTime: props.startTime,\n endTime: props.endTime,\n intervalMinutes: props.intervalMinutes,\n }),\n)\n\nconst formattedTime = computed(() =>\n props.withTimeBubble\n ? formatDate({\n date: now.value,\n locale: props.locale || 'en',\n format: props.currentTimeFormat!,\n })\n : '',\n)\n\nconst getStyles = useStyles({\n name: 'CurrentTimeIndicator',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'currentTimeIndicator',\n // Getters keep the context live without re-creating the styles resolver on every tick.\n stylesCtx: {\n get offsetPercent() {\n return offsetPercent.value\n },\n get hasMeridiem() {\n return String(formattedTime.value).toLowerCase().includes('m')\n },\n },\n})\n</script>\n\n<template>\n <Box v-if=\"visible\" v-bind=\"{ ...attrs, ...getStyles('currentTimeIndicator') }\">\n <div v-if=\"props.withTimeBubble\" v-bind=\"getStyles('currentTimeIndicatorTimeBubble')\">\n {{ formattedTime }}\n </div>\n <div v-if=\"props.withThumb\" v-bind=\"getStyles('currentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('currentTimeIndicatorLine')\" />\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport CurrentTimeIndicatorComponent, { varsResolver } from './CurrentTimeIndicator.vue'\nimport type { CurrentTimeIndicatorFactory } from './CurrentTimeIndicator.types'\nimport classes from './CurrentTimeIndicator.module.css'\n\nexport const CurrentTimeIndicator = factory<CurrentTimeIndicatorFactory>(\n CurrentTimeIndicatorComponent,\n { classes, varsResolver },\n)\n\nexport type {\n CurrentTimeIndicatorCssVariables,\n CurrentTimeIndicatorFactory,\n CurrentTimeIndicatorOwnProps,\n CurrentTimeIndicatorProps,\n CurrentTimeIndicatorStylesNames,\n} from './CurrentTimeIndicator.types'\n","import {\n inject,\n onScopeDispose,\n provide,\n shallowRef,\n type InjectionKey,\n type ShallowRef,\n} from 'vue'\nimport type { DropTarget, ScheduleEventData } from '../../types'\n\nexport interface DragContextValue {\n readonly draggedEvent: ScheduleEventData | null\n\n readonly dragOverTarget: DropTarget | null\n\n readonly isDragging: boolean\n\n readonly isSlotDragging: boolean\n}\n\nconst IDLE: DragContextValue = {\n draggedEvent: null,\n dragOverTarget: null,\n isDragging: false,\n isSlotDragging: false,\n}\n\nexport const DragContext: InjectionKey<DragContextValue> = Symbol('mantine-schedule-drag-context')\n\nexport function provideDragContext(value: DragContextValue) {\n provide(DragContext, value)\n}\n\n/**\n * Reads the drag state of the surrounding view. Components rendered outside a schedule get an\n * idle state rather than `undefined`, so they never have to null-check it.\n */\nexport function useDragContext(): DragContextValue {\n return inject(DragContext, IDLE)\n}\n\nexport interface ScheduleDragState {\n draggedEvent: ShallowRef<ScheduleEventData | null>\n\n startEventDrag: (event: ScheduleEventData) => void\n\n /**\n * Ends the drag. Safe to call more than once: only the first call after a `startEventDrag`\n * takes effect, so the component's own `dragend` and the document safety net cannot both\n * report the same drag.\n */\n endEventDrag: () => void\n}\n\nexport interface ProvideScheduleDragStateInput {\n /** Slot the pointer is currently over, owned by the view because it also drives the highlight. */\n dragOverTarget?: () => DropTarget | null\n\n isSlotDragging?: () => boolean\n\n /**\n * Called exactly once per drag, however it ended: dropped, cancelled, or ended after the\n * dragged element was already replaced. Use it to clear view-local drag state.\n */\n onDragEnd?: () => void\n}\n\n/**\n * Publishes the view's drag state to the events it renders, so an event can tell that *some*\n * other event is being dragged and dim itself.\n *\n * The context is a getter-backed object rather than a snapshot: it is provided once during\n * `setup`, and every read stays reactive as the drag progresses.\n *\n * The end of a drag is detected on `document` rather than only through the dragged event's own\n * `dragend`. A successful drop usually makes the consumer move the event, which re-renders it\n * under a different key: the original element is gone by the time the browser would fire\n * `dragend` on it, so that event never arrives. Relying on it alone would leave the schedule\n * stuck in the dragging state, with every event non-interactive.\n */\nexport function provideScheduleDragState(\n input: ProvideScheduleDragStateInput = {},\n): ScheduleDragState {\n const draggedEvent = shallowRef<ScheduleEventData | null>(null)\n\n provideDragContext({\n get draggedEvent() {\n return draggedEvent.value\n },\n get dragOverTarget() {\n return input.dragOverTarget?.() ?? null\n },\n get isDragging() {\n return draggedEvent.value !== null\n },\n get isSlotDragging() {\n return input.isSlotDragging?.() ?? false\n },\n })\n\n const endEventDrag = () => {\n if (draggedEvent.value === null) {\n return\n }\n\n draggedEvent.value = null\n stopWatchingDocument()\n input.onDragEnd?.()\n }\n\n // Capture phase, so the drag cannot be left open by a handler that stops propagation.\n const watchOptions = { capture: true } as const\n\n function startWatchingDocument() {\n document.addEventListener('drop', endEventDrag, watchOptions)\n document.addEventListener('dragend', endEventDrag, watchOptions)\n }\n\n function stopWatchingDocument() {\n document.removeEventListener('drop', endEventDrag, watchOptions)\n document.removeEventListener('dragend', endEventDrag, watchOptions)\n }\n\n onScopeDispose(stopWatchingDocument, true)\n\n return {\n draggedEvent,\n startEventDrag: (event) => {\n if (draggedEvent.value === null) {\n startWatchingDocument()\n }\n\n draggedEvent.value = event\n },\n endEventDrag,\n }\n}\n",".event {\n padding: 1px;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n flex: 1 0 auto;\n position: relative;\n z-index: 3;\n\n &:where([data-auto-size]) {\n container-type: size;\n }\n\n &:where([data-draggable]) .eventInner {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n }\n\n &:where([data-dragging]) {\n opacity: 0.2;\n\n .eventInner {\n cursor: grabbing;\n }\n }\n\n &:where([data-any-dragging]:not([data-dragging])) {\n pointer-events: none;\n\n .eventInner {\n pointer-events: none;\n }\n }\n\n &:where([data-static]) {\n pointer-events: none;\n cursor: default;\n }\n\n &:where([data-resizing]) {\n z-index: 10;\n\n .eventInner {\n @mixin hover {\n background-color: var(--event-bg);\n }\n }\n }\n\n &:where([data-hanging='start'], [data-hanging='both']) {\n &::before {\n content: '';\n position: absolute;\n inset-block: 2px;\n inset-inline-start: 2px;\n width: 2px;\n background-color: var(--event-color);\n border-radius: 10px;\n opacity: 0.3;\n }\n\n .eventInner {\n padding-inline-start: 6px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n }\n\n &:where([data-hanging='end'], [data-hanging='both']) {\n &::after {\n content: '';\n position: absolute;\n inset-block: 2px;\n inset-inline-end: 2px;\n width: 2px;\n background-color: var(--event-color);\n border-radius: 10px;\n opacity: 0.3;\n }\n\n .eventInner {\n padding-inline-end: 6px;\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n }\n\n &:where([data-clip-start]) {\n .eventInner {\n padding-inline-start: 12px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);\n }\n }\n\n &:where([data-clip-end]) {\n .eventInner {\n padding-inline-end: 12px;\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);\n }\n }\n\n &:where([data-clip-start][data-clip-end]) {\n .eventInner {\n clip-path: polygon(\n 10px 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 10px 100%,\n 0 50%\n );\n }\n }\n}\n\n.eventInner {\n background-color: var(--event-bg);\n color: var(--event-color);\n pointer-events: all;\n border-radius: min(var(--event-radius), 50%);\n font-weight: var(--mantine-font-weight-medium);\n font-size: 12px;\n line-height: 1;\n padding: 3px 4px;\n width: 100%;\n height: 100%;\n cursor: pointer;\n user-select: none;\n overflow: hidden;\n\n &:where([data-nowrap]) {\n white-space: nowrap;\n text-overflow: ellipsis;\n line-height: 1.25;\n }\n\n &:where([data-size='md']) {\n font-size: 14px;\n padding: 4px 6px;\n }\n\n @mixin hover {\n background-color: var(--event-hover);\n }\n\n &:where([data-auto-size]) {\n @container (max-width: 12px) {\n padding-inline: 0;\n }\n\n @container (min-width: 16px) {\n width: calc(100% - 2px);\n margin-inline: auto;\n }\n\n @container (max-height: 18px) {\n font-size: 9px;\n padding-block: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n }\n\n .event[data-static] & {\n cursor: default;\n pointer-events: none;\n\n @mixin hover {\n background-color: var(--event-bg);\n }\n }\n\n :where([data-slot-dragging]) & {\n pointer-events: none;\n }\n}\n\n.eventResizeHandle {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n width: 40%;\n max-width: 40px;\n height: 4px;\n border-radius: 2px;\n cursor: ns-resize;\n pointer-events: all;\n z-index: 4;\n touch-action: none;\n background-color: var(--event-color);\n opacity: 0;\n transition: opacity 100ms ease;\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='top']) {\n top: -2px;\n }\n\n &:where([data-edge='bottom']) {\n bottom: -2px;\n }\n\n .event:where(:hover, [data-resizing]) & {\n opacity: 0.5;\n }\n\n @mixin hover {\n opacity: 0.8;\n }\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\n\nconst defaultProps = {\n radius: 'sm',\n size: 'sm',\n mode: 'default',\n} as const\n\n// Colors come from each event's data rather than a component-level color prop.\nconst varsResolver = createVarsResolver<any>((theme, { event, radius }) => {\n const colors = theme.variantColorResolver({\n color: event?.color || theme.primaryColor,\n theme,\n variant: event?.variant || 'light',\n autoContrast: true,\n })\n\n return {\n event: {\n '--event-color': colors.color,\n '--event-bg': colors.background,\n '--event-hover': colors.hover,\n '--event-radius': resolveScheduleRadius(radius),\n },\n }\n})\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, h, onBeforeUnmount, ref, useAttrs, useSlots, type VNodeChild } from 'vue'\nimport { Box, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useDragContext } from '../DragContext'\nimport type {\n ScheduleEventEmits,\n ScheduleEventOwnProps,\n ScheduleEventResizeEdge,\n ScheduleEventSlots,\n} from './ScheduleEvent.types'\nimport classes from './ScheduleEvent.module.css'\n\ndefineOptions({\n name: 'ScheduleEvent',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleEventOwnProps>(), {\n radius: undefined,\n size: undefined,\n mode: undefined,\n hanging: undefined,\n renderEvent: undefined,\n renderEventBody: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleEventSlots>()\n\nconst emit = defineEmits<ScheduleEventEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst dragContext = useDragContext()\n\nconst props = useProps('ScheduleEvent', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ScheduleEvent',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'event',\n})\n\nconst isNativeDragging = ref(false)\n\n/**\n * Ends the native drag, however it ended. Idempotent, because it is reached from both the\n * element's own `dragend` and a `document` listener.\n *\n * The element handler alone is not enough: `dragend` fires on the element the drag started\n * from, which a schedule usually re-renders under a different key the moment the drop is\n * handled — so this element can be gone before the browser gets there and the event never\n * arrives. `document` catches both the drop and the cancel: exactly one of them always fires,\n * and both bubble.\n */\nconst stopNativeDrag = () => {\n if (!isNativeDragging.value) {\n return\n }\n\n isNativeDragging.value = false\n document.removeEventListener('drop', stopNativeDrag, true)\n document.removeEventListener('dragend', stopNativeDrag, true)\n emit('eventDragEnd')\n}\n\nonBeforeUnmount(() => {\n document.removeEventListener('drop', stopNativeDrag, true)\n document.removeEventListener('dragend', stopNativeDrag, true)\n})\n\nconst isStatic = computed(() => props.mode === 'static')\nconst isDraggable = computed(() => props.draggable && !isStatic.value)\nconst withResizeHandles = computed(() => Boolean(props.withResize) && !isStatic.value)\n\nconst body = computed<VNodeChild>(\n () =>\n slots.eventBody?.({ event: props.event }) ??\n props.renderEventBody?.(props.event) ??\n slots.default?.() ??\n props.event.title,\n)\n\nconst handleDragStart = (nativeEvent: DragEvent) => {\n if (!isDraggable.value) {\n nativeEvent.preventDefault()\n return\n }\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.effectAllowed = 'move'\n nativeEvent.dataTransfer.setData(\n 'application/json',\n JSON.stringify({ eventId: props.event.id }),\n )\n }\n\n isNativeDragging.value = true\n document.addEventListener('drop', stopNativeDrag, true)\n document.addEventListener('dragend', stopNativeDrag, true)\n emit('eventDragStart', props.event)\n}\n\nconst handleResizeStart = (edge: ScheduleEventResizeEdge, nativeEvent: PointerEvent) => {\n emit('resizeStart', edge, nativeEvent)\n}\n\nconst isBeingDragged = computed(() => props.isDragging || isNativeDragging.value)\n\nconst rootMod = computed(() => [\n {\n autoSize: props.autoSize,\n hanging: props.hanging,\n draggable: isDraggable.value,\n dragging: isBeingDragged.value,\n // Set on every event while a drag is in progress, so the ones that are not being dragged\n // can step back visually.\n anyDragging: dragContext.isDragging,\n static: isStatic.value,\n resizing: props.isResizing,\n resizable: withResizeHandles.value,\n },\n (attrs as any).mod,\n])\n\n/**\n * Everything spread onto the root element. `renderEvent` receives the same object, so a\n * custom root behaves like the built-in one.\n */\nconst rootProps = computed(() => ({\n ...attrs,\n ...getStyles('event'),\n 'data-event-id': props.event.id,\n title: props.event.title,\n mod: rootMod.value,\n draggable: isDraggable.value,\n tabindex: isStatic.value ? -1 : 0,\n onDragstart: handleDragStart,\n // The element's own `dragend` is the fast path; `stopNativeDrag` also listens on `document`\n // for the case where this element is replaced before the browser gets to fire it.\n onDragend: isStatic.value ? undefined : stopNativeDrag,\n onClick: isStatic.value\n ? undefined\n : (attrs.onClick as ((event: MouseEvent) => void) | undefined),\n}))\n\n/**\n * Default children as a functional component, so the template and the `renderEvent`\n * payload share one definition instead of building the tree twice.\n */\nconst EventChildren = () => [\n withResizeHandles.value\n ? h(Box, {\n ...getStyles('eventResizeHandle'),\n mod: { edge: 'top' },\n onPointerdown: (nativeEvent: PointerEvent) => handleResizeStart('top', nativeEvent),\n })\n : null,\n h(\n Box,\n {\n ...getStyles('eventInner'),\n mod: {\n nowrap: props.nowrap,\n size: props.size,\n autoSize: props.autoSize,\n hanging: props.hanging,\n },\n },\n () => body.value,\n ),\n withResizeHandles.value\n ? h(Box, {\n ...getStyles('eventResizeHandle'),\n mod: { edge: 'bottom' },\n onPointerdown: (nativeEvent: PointerEvent) => handleResizeStart('bottom', nativeEvent),\n })\n : null,\n]\n\nconst customEvent = computed<VNodeChild>(() => {\n if (!slots.event && !props.renderEvent) {\n return null\n }\n\n const payload = { ...rootProps.value, children: h(EventChildren) }\n return (\n slots.event?.({ ...payload, event: props.event }) ??\n props.renderEvent?.(props.event, payload) ??\n null\n )\n})\n\nconst renderCustomEvent = () => customEvent.value\n</script>\n\n<template>\n <component :is=\"renderCustomEvent\" v-if=\"customEvent\" />\n <UnstyledButton v-else v-bind=\"rootProps\">\n <EventChildren />\n </UnstyledButton>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\n\nconst defaultProps = {\n radius: 'sm',\n size: 'sm',\n mode: 'default',\n} as const\n\n// Colors come from each event's data rather than a component-level color prop.\nconst varsResolver = createVarsResolver<any>((theme, { event, radius }) => {\n const colors = theme.variantColorResolver({\n color: event?.color || theme.primaryColor,\n theme,\n variant: event?.variant || 'light',\n autoContrast: true,\n })\n\n return {\n event: {\n '--event-color': colors.color,\n '--event-bg': colors.background,\n '--event-hover': colors.hover,\n '--event-radius': resolveScheduleRadius(radius),\n },\n }\n})\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, h, onBeforeUnmount, ref, useAttrs, useSlots, type VNodeChild } from 'vue'\nimport { Box, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useDragContext } from '../DragContext'\nimport type {\n ScheduleEventEmits,\n ScheduleEventOwnProps,\n ScheduleEventResizeEdge,\n ScheduleEventSlots,\n} from './ScheduleEvent.types'\nimport classes from './ScheduleEvent.module.css'\n\ndefineOptions({\n name: 'ScheduleEvent',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleEventOwnProps>(), {\n radius: undefined,\n size: undefined,\n mode: undefined,\n hanging: undefined,\n renderEvent: undefined,\n renderEventBody: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleEventSlots>()\n\nconst emit = defineEmits<ScheduleEventEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst dragContext = useDragContext()\n\nconst props = useProps('ScheduleEvent', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ScheduleEvent',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'event',\n})\n\nconst isNativeDragging = ref(false)\n\n/**\n * Ends the native drag, however it ended. Idempotent, because it is reached from both the\n * element's own `dragend` and a `document` listener.\n *\n * The element handler alone is not enough: `dragend` fires on the element the drag started\n * from, which a schedule usually re-renders under a different key the moment the drop is\n * handled — so this element can be gone before the browser gets there and the event never\n * arrives. `document` catches both the drop and the cancel: exactly one of them always fires,\n * and both bubble.\n */\nconst stopNativeDrag = () => {\n if (!isNativeDragging.value) {\n return\n }\n\n isNativeDragging.value = false\n document.removeEventListener('drop', stopNativeDrag, true)\n document.removeEventListener('dragend', stopNativeDrag, true)\n emit('eventDragEnd')\n}\n\nonBeforeUnmount(() => {\n document.removeEventListener('drop', stopNativeDrag, true)\n document.removeEventListener('dragend', stopNativeDrag, true)\n})\n\nconst isStatic = computed(() => props.mode === 'static')\nconst isDraggable = computed(() => props.draggable && !isStatic.value)\nconst withResizeHandles = computed(() => Boolean(props.withResize) && !isStatic.value)\n\nconst body = computed<VNodeChild>(\n () =>\n slots.eventBody?.({ event: props.event }) ??\n props.renderEventBody?.(props.event) ??\n slots.default?.() ??\n props.event.title,\n)\n\nconst handleDragStart = (nativeEvent: DragEvent) => {\n if (!isDraggable.value) {\n nativeEvent.preventDefault()\n return\n }\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.effectAllowed = 'move'\n nativeEvent.dataTransfer.setData(\n 'application/json',\n JSON.stringify({ eventId: props.event.id }),\n )\n }\n\n isNativeDragging.value = true\n document.addEventListener('drop', stopNativeDrag, true)\n document.addEventListener('dragend', stopNativeDrag, true)\n emit('eventDragStart', props.event)\n}\n\nconst handleResizeStart = (edge: ScheduleEventResizeEdge, nativeEvent: PointerEvent) => {\n emit('resizeStart', edge, nativeEvent)\n}\n\nconst isBeingDragged = computed(() => props.isDragging || isNativeDragging.value)\n\nconst rootMod = computed(() => [\n {\n autoSize: props.autoSize,\n hanging: props.hanging,\n draggable: isDraggable.value,\n dragging: isBeingDragged.value,\n // Set on every event while a drag is in progress, so the ones that are not being dragged\n // can step back visually.\n anyDragging: dragContext.isDragging,\n static: isStatic.value,\n resizing: props.isResizing,\n resizable: withResizeHandles.value,\n },\n (attrs as any).mod,\n])\n\n/**\n * Everything spread onto the root element. `renderEvent` receives the same object, so a\n * custom root behaves like the built-in one.\n */\nconst rootProps = computed(() => ({\n ...attrs,\n ...getStyles('event'),\n 'data-event-id': props.event.id,\n title: props.event.title,\n mod: rootMod.value,\n draggable: isDraggable.value,\n tabindex: isStatic.value ? -1 : 0,\n onDragstart: handleDragStart,\n // The element's own `dragend` is the fast path; `stopNativeDrag` also listens on `document`\n // for the case where this element is replaced before the browser gets to fire it.\n onDragend: isStatic.value ? undefined : stopNativeDrag,\n onClick: isStatic.value\n ? undefined\n : (attrs.onClick as ((event: MouseEvent) => void) | undefined),\n}))\n\n/**\n * Default children as a functional component, so the template and the `renderEvent`\n * payload share one definition instead of building the tree twice.\n */\nconst EventChildren = () => [\n withResizeHandles.value\n ? h(Box, {\n ...getStyles('eventResizeHandle'),\n mod: { edge: 'top' },\n onPointerdown: (nativeEvent: PointerEvent) => handleResizeStart('top', nativeEvent),\n })\n : null,\n h(\n Box,\n {\n ...getStyles('eventInner'),\n mod: {\n nowrap: props.nowrap,\n size: props.size,\n autoSize: props.autoSize,\n hanging: props.hanging,\n },\n },\n () => body.value,\n ),\n withResizeHandles.value\n ? h(Box, {\n ...getStyles('eventResizeHandle'),\n mod: { edge: 'bottom' },\n onPointerdown: (nativeEvent: PointerEvent) => handleResizeStart('bottom', nativeEvent),\n })\n : null,\n]\n\nconst customEvent = computed<VNodeChild>(() => {\n if (!slots.event && !props.renderEvent) {\n return null\n }\n\n const payload = { ...rootProps.value, children: h(EventChildren) }\n return (\n slots.event?.({ ...payload, event: props.event }) ??\n props.renderEvent?.(props.event, payload) ??\n null\n )\n})\n\nconst renderCustomEvent = () => customEvent.value\n</script>\n\n<template>\n <component :is=\"renderCustomEvent\" v-if=\"customEvent\" />\n <UnstyledButton v-else v-bind=\"rootProps\">\n <EventChildren />\n </UnstyledButton>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ScheduleEventComponent, { varsResolver } from './ScheduleEvent.vue'\nimport type { ScheduleEventFactory } from './ScheduleEvent.types'\nimport classes from './ScheduleEvent.module.css'\n\nexport const ScheduleEvent = factory<ScheduleEventFactory>(ScheduleEventComponent, {\n classes,\n varsResolver,\n})\n\nexport type { RenderEvent, RenderEventBody, ScheduleEventRenderProps } from '../../component-props'\n\nexport type {\n ScheduleEventCssVariables,\n ScheduleEventEmits,\n ScheduleEventFactory,\n ScheduleEventHanging,\n ScheduleEventOwnProps,\n ScheduleEventProps,\n ScheduleEventResizeEdge,\n ScheduleEventSlots,\n ScheduleEventStylesNames,\n} from './ScheduleEvent.types'\n",".moreEventsButton {\n color: var(--mantine-color-dimmed);\n font-size: 13px;\n pointer-events: all;\n flex: 1;\n\n @mixin hover {\n color: var(--mantine-color-bright);\n text-decoration: underline;\n }\n\n &:where([data-static]) {\n cursor: default;\n\n @mixin hover {\n color: var(--mantine-color-dimmed);\n text-decoration: none;\n }\n }\n}\n\n.moreEventsDropdown {\n padding: 4px;\n}\n\n.moreEventsList {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n","<script lang=\"ts\">\nconst defaultProps = {\n dropdownType: 'popover',\n mode: 'default',\n} as const\n\n/** Pulls the popover back over the control it replaces, so the list covers the day cell. */\nconst POPOVER_OFFSET = -46\n\nexport { defaultProps, POPOVER_OFFSET }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { Box, Modal, Popover, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport type { ScheduleEventData } from '../../types'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { resolveEventRenderers } from '../shared'\nimport type { MoreEventsEmits, MoreEventsOwnProps, MoreEventsSlots } from './MoreEvents.types'\nimport classes from './MoreEvents.module.css'\n\ndefineOptions({\n name: 'MoreEvents',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MoreEventsOwnProps>(), {\n radius: undefined,\n modalTitle: undefined,\n dropdownType: undefined,\n popoverProps: undefined,\n modalProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n labels: undefined,\n mode: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MoreEventsSlots>()\n\nconst emit = defineEmits<MoreEventsEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('MoreEvents', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MoreEvents',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'moreEventsButton',\n})\n\nconst opened = ref(false)\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst close = () => {\n opened.value = false\n emit('dropdownClose')\n}\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n emit('eventClick', event, nativeEvent)\n}\n\nconst handlePopoverChange = (value: boolean) => {\n if (!value) {\n close()\n }\n}\n</script>\n\n<template>\n <!--\n The modal and the popover both wrap the same list. Rendering the modal alongside a\n disabled popover keeps a single target control for either dropdown type.\n -->\n <Modal\n v-if=\"props.dropdownType === 'modal'\"\n v-bind=\"props.modalProps\"\n :opened=\"opened\"\n :radius=\"props.radius\"\n :title=\"props.modalTitle\"\n @close=\"close\"\n >\n <Box v-bind=\"getStyles('moreEventsList')\">\n <ScheduleEvent\n v-for=\"event in props.events\"\n :key=\"event.id\"\n :event=\"event\"\n :radius=\"props.radius ?? 'sm'\"\n size=\"md\"\n :mode=\"props.mode\"\n v-bind=\"eventRenderers\"\n @click=\"clickEvent(event, $event)\"\n />\n </Box>\n </Modal>\n\n <Popover\n position=\"bottom-start\"\n :width=\"260\"\n :opened=\"opened\"\n trap-focus\n :return-focus=\"false\"\n :disabled=\"props.dropdownType === 'modal'\"\n :radius=\"props.radius\"\n :transition-props=\"{ transition: 'pop', duration: 120 }\"\n :offset=\"POPOVER_OFFSET\"\n v-bind=\"props.popoverProps\"\n @change=\"handlePopoverChange\"\n >\n <Popover.Target>\n <UnstyledButton\n v-bind=\"{ ...attrs, ...getStyles('moreEventsButton') }\"\n :mod=\"{ static: props.mode === 'static' }\"\n :aria-expanded=\"opened\"\n @click=\"opened = !opened\"\n >\n {{ getLabel('moreLabel', props.labels)(props.moreEventsCount) }}\n </UnstyledButton>\n </Popover.Target>\n\n <Popover.Dropdown v-bind=\"getStyles('moreEventsDropdown')\">\n <Box v-bind=\"getStyles('moreEventsList')\">\n <ScheduleEvent\n v-for=\"event in props.events\"\n :key=\"event.id\"\n :event=\"event\"\n :radius=\"props.radius ?? 'sm'\"\n size=\"md\"\n :mode=\"props.mode\"\n v-bind=\"eventRenderers\"\n @click=\"clickEvent(event, $event)\"\n />\n </Box>\n </Popover.Dropdown>\n </Popover>\n</template>\n","<script lang=\"ts\">\nconst defaultProps = {\n dropdownType: 'popover',\n mode: 'default',\n} as const\n\n/** Pulls the popover back over the control it replaces, so the list covers the day cell. */\nconst POPOVER_OFFSET = -46\n\nexport { defaultProps, POPOVER_OFFSET }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { Box, Modal, Popover, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport type { ScheduleEventData } from '../../types'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { resolveEventRenderers } from '../shared'\nimport type { MoreEventsEmits, MoreEventsOwnProps, MoreEventsSlots } from './MoreEvents.types'\nimport classes from './MoreEvents.module.css'\n\ndefineOptions({\n name: 'MoreEvents',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MoreEventsOwnProps>(), {\n radius: undefined,\n modalTitle: undefined,\n dropdownType: undefined,\n popoverProps: undefined,\n modalProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n labels: undefined,\n mode: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MoreEventsSlots>()\n\nconst emit = defineEmits<MoreEventsEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('MoreEvents', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MoreEvents',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'moreEventsButton',\n})\n\nconst opened = ref(false)\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst close = () => {\n opened.value = false\n emit('dropdownClose')\n}\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n emit('eventClick', event, nativeEvent)\n}\n\nconst handlePopoverChange = (value: boolean) => {\n if (!value) {\n close()\n }\n}\n</script>\n\n<template>\n <!--\n The modal and the popover both wrap the same list. Rendering the modal alongside a\n disabled popover keeps a single target control for either dropdown type.\n -->\n <Modal\n v-if=\"props.dropdownType === 'modal'\"\n v-bind=\"props.modalProps\"\n :opened=\"opened\"\n :radius=\"props.radius\"\n :title=\"props.modalTitle\"\n @close=\"close\"\n >\n <Box v-bind=\"getStyles('moreEventsList')\">\n <ScheduleEvent\n v-for=\"event in props.events\"\n :key=\"event.id\"\n :event=\"event\"\n :radius=\"props.radius ?? 'sm'\"\n size=\"md\"\n :mode=\"props.mode\"\n v-bind=\"eventRenderers\"\n @click=\"clickEvent(event, $event)\"\n />\n </Box>\n </Modal>\n\n <Popover\n position=\"bottom-start\"\n :width=\"260\"\n :opened=\"opened\"\n trap-focus\n :return-focus=\"false\"\n :disabled=\"props.dropdownType === 'modal'\"\n :radius=\"props.radius\"\n :transition-props=\"{ transition: 'pop', duration: 120 }\"\n :offset=\"POPOVER_OFFSET\"\n v-bind=\"props.popoverProps\"\n @change=\"handlePopoverChange\"\n >\n <Popover.Target>\n <UnstyledButton\n v-bind=\"{ ...attrs, ...getStyles('moreEventsButton') }\"\n :mod=\"{ static: props.mode === 'static' }\"\n :aria-expanded=\"opened\"\n @click=\"opened = !opened\"\n >\n {{ getLabel('moreLabel', props.labels)(props.moreEventsCount) }}\n </UnstyledButton>\n </Popover.Target>\n\n <Popover.Dropdown v-bind=\"getStyles('moreEventsDropdown')\">\n <Box v-bind=\"getStyles('moreEventsList')\">\n <ScheduleEvent\n v-for=\"event in props.events\"\n :key=\"event.id\"\n :event=\"event\"\n :radius=\"props.radius ?? 'sm'\"\n size=\"md\"\n :mode=\"props.mode\"\n v-bind=\"eventRenderers\"\n @click=\"clickEvent(event, $event)\"\n />\n </Box>\n </Popover.Dropdown>\n </Popover>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport MoreEventsComponent from './MoreEvents.vue'\nimport type { MoreEventsFactory } from './MoreEvents.types'\nimport classes from './MoreEvents.module.css'\n\nexport const MoreEvents = factory<MoreEventsFactory>(MoreEventsComponent, { classes })\n\nexport type {\n MoreEventsDropdownType,\n MoreEventsEmits,\n MoreEventsFactory,\n MoreEventsOwnProps,\n MoreEventsProps,\n MoreEventsSlots,\n MoreEventsStylesNames,\n} from './MoreEvents.types'\n","<script setup lang=\"ts\">\nimport { computed, h, onBeforeUnmount, ref, useAttrs, useSlots } from 'vue'\nimport { Box, UnstyledButton, useMantineTheme } from '@mantine-vue/core'\nimport type {\n ScheduleBackgroundEventEmits,\n ScheduleBackgroundEventOwnProps,\n ScheduleBackgroundEventSlots,\n} from './ScheduleBackgroundEvent.types'\n\ndefineOptions({ name: 'ScheduleBackgroundEvent', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ScheduleBackgroundEventOwnProps>(), {\n interactive: false,\n renderEvent: undefined,\n renderEventBody: undefined,\n})\nconst emit = defineEmits<ScheduleBackgroundEventEmits>()\ndefineSlots<ScheduleBackgroundEventSlots>()\n\nconst attrs = useAttrs()\nconst slots = useSlots()\nconst theme = useMantineTheme()\nconst dragPassthrough = ref(false)\n\nconst resetDragPassthrough = () => {\n dragPassthrough.value = false\n}\n\nconst enableDragPassthrough = () => {\n if (!props.interactive || dragPassthrough.value) return\n dragPassthrough.value = true\n document.addEventListener('dragend', resetDragPassthrough, { once: true })\n document.addEventListener('drop', resetDragPassthrough, { once: true })\n document.addEventListener('pointermove', resetDragPassthrough, { once: true })\n}\n\nonBeforeUnmount(() => {\n document.removeEventListener('dragend', resetDragPassthrough)\n document.removeEventListener('drop', resetDragPassthrough)\n document.removeEventListener('pointermove', resetDragPassthrough)\n})\n\nconst rootProps = computed(() => {\n const colors = theme.value.variantColorResolver({\n color: props.event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n const style = [\n attrs.style,\n {\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n '--bg-event-hover': colors.hover,\n ...(dragPassthrough.value ? { pointerEvents: 'none' } : {}),\n },\n ]\n\n return {\n ...attrs,\n style,\n mod: [attrs.mod, { interactive: props.interactive }],\n ...(props.interactive\n ? {\n 'data-event-id': props.event.id,\n title: props.event.title,\n onClick: (event: MouseEvent) => emit('eventClick', props.event, event),\n onDragenter: enableDragPassthrough,\n onDragover: enableDragPassthrough,\n }\n : {}),\n }\n})\n\nconst content = () =>\n slots.default?.({ event: props.event }) ??\n props.renderEventBody?.(props.event) ??\n props.event.title\n\nconst render = () => {\n const component = props.interactive ? UnstyledButton : Box\n if (props.renderEvent) {\n return props.renderEvent(props.event, { ...rootProps.value, children: content() } as any)\n }\n return h(component as any, rootProps.value as any, { default: content })\n}\n</script>\n\n<template>\n <render />\n</template>\n","<script setup lang=\"ts\">\nimport { computed, h, onBeforeUnmount, ref, useAttrs, useSlots } from 'vue'\nimport { Box, UnstyledButton, useMantineTheme } from '@mantine-vue/core'\nimport type {\n ScheduleBackgroundEventEmits,\n ScheduleBackgroundEventOwnProps,\n ScheduleBackgroundEventSlots,\n} from './ScheduleBackgroundEvent.types'\n\ndefineOptions({ name: 'ScheduleBackgroundEvent', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ScheduleBackgroundEventOwnProps>(), {\n interactive: false,\n renderEvent: undefined,\n renderEventBody: undefined,\n})\nconst emit = defineEmits<ScheduleBackgroundEventEmits>()\ndefineSlots<ScheduleBackgroundEventSlots>()\n\nconst attrs = useAttrs()\nconst slots = useSlots()\nconst theme = useMantineTheme()\nconst dragPassthrough = ref(false)\n\nconst resetDragPassthrough = () => {\n dragPassthrough.value = false\n}\n\nconst enableDragPassthrough = () => {\n if (!props.interactive || dragPassthrough.value) return\n dragPassthrough.value = true\n document.addEventListener('dragend', resetDragPassthrough, { once: true })\n document.addEventListener('drop', resetDragPassthrough, { once: true })\n document.addEventListener('pointermove', resetDragPassthrough, { once: true })\n}\n\nonBeforeUnmount(() => {\n document.removeEventListener('dragend', resetDragPassthrough)\n document.removeEventListener('drop', resetDragPassthrough)\n document.removeEventListener('pointermove', resetDragPassthrough)\n})\n\nconst rootProps = computed(() => {\n const colors = theme.value.variantColorResolver({\n color: props.event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n const style = [\n attrs.style,\n {\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n '--bg-event-hover': colors.hover,\n ...(dragPassthrough.value ? { pointerEvents: 'none' } : {}),\n },\n ]\n\n return {\n ...attrs,\n style,\n mod: [attrs.mod, { interactive: props.interactive }],\n ...(props.interactive\n ? {\n 'data-event-id': props.event.id,\n title: props.event.title,\n onClick: (event: MouseEvent) => emit('eventClick', props.event, event),\n onDragenter: enableDragPassthrough,\n onDragover: enableDragPassthrough,\n }\n : {}),\n }\n})\n\nconst content = () =>\n slots.default?.({ event: props.event }) ??\n props.renderEventBody?.(props.event) ??\n props.event.title\n\nconst render = () => {\n const component = props.interactive ? UnstyledButton : Box\n if (props.renderEvent) {\n return props.renderEvent(props.event, { ...rootProps.value, children: content() } as any)\n }\n return h(component as any, rootProps.value as any, { default: content })\n}\n</script>\n\n<template>\n <render />\n</template>\n","import { computed, inject, provide, type ComputedRef, type InjectionKey } from 'vue'\nimport type { ScheduleLabelsOverride } from '../../labels'\n\nconst ScheduleHeaderLabelsKey: InjectionKey<() => ScheduleLabelsOverride | undefined> = Symbol(\n 'mantine-schedule-header-labels',\n)\n\n/**\n * Shares the header's `labels` with the compound components rendered inside it.\n * A getter is provided rather than the value so the labels stay reactive.\n */\nexport function provideScheduleHeaderLabels(labels: () => ScheduleLabelsOverride | undefined) {\n provide(ScheduleHeaderLabelsKey, labels)\n}\n\n/**\n * Merges a control's own `labels` over the ones provided by the surrounding `ScheduleHeader`,\n * so overriding a single key does not drop the rest. Must be called during `setup`.\n */\nexport function useScheduleHeaderLabels(\n override: () => ScheduleLabelsOverride | undefined,\n): ComputedRef<ScheduleLabelsOverride | undefined> {\n const contextLabels = inject(ScheduleHeaderLabelsKey, undefined)\n\n return computed(() => {\n const inherited = contextLabels?.()\n const own = override()\n\n if (!own) {\n return inherited\n }\n\n if (!inherited) {\n return own\n }\n\n return { ...inherited, ...own }\n })\n}\n",".header {\n --schedule-header-gap: 8px;\n\n display: flex;\n flex-wrap: wrap;\n gap: var(--schedule-header-gap);\n margin-bottom: var(--schedule-header-gap);\n container-type: inline-size;\n}\n\n.navigationGroup {\n display: flex;\n gap: var(--schedule-header-gap);\n align-items: center;\n\n @container (width <= 600px) {\n flex: 1;\n\n & > :not([data-square]) {\n flex: 1;\n }\n }\n}\n\n.todayControl {\n @container (width <= 600px) {\n display: none;\n }\n}\n\n.viewSelect {\n @container (width <= 600px) {\n display: none;\n }\n}\n\n.compactViewSelect {\n display: none;\n font-weight: var(--mantine-font-weight-medium);\n\n @container (width <= 600px) {\n display: block;\n flex: 1 1 100%;\n }\n}\n","<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { provideScheduleHeaderLabels } from './ScheduleHeader.context'\nimport type { ScheduleHeaderOwnProps, ScheduleHeaderSlots } from './ScheduleHeader.types'\nimport classes from './ScheduleHeader.module.css'\n\ndefineOptions({\n name: 'ScheduleHeader',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleHeaderOwnProps>(), {\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleHeaderSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ScheduleHeader', null, rawProps)\n\nconst getStyles = useStyles({\n name: 'ScheduleHeader',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'header',\n})\n\nprovideScheduleHeaderLabels(() => props.labels)\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('header') }\">\n <slot />\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { provideScheduleHeaderLabels } from './ScheduleHeader.context'\nimport type { ScheduleHeaderOwnProps, ScheduleHeaderSlots } from './ScheduleHeader.types'\nimport classes from './ScheduleHeader.module.css'\n\ndefineOptions({\n name: 'ScheduleHeader',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleHeaderOwnProps>(), {\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleHeaderSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ScheduleHeader', null, rawProps)\n\nconst getStyles = useStyles({\n name: 'ScheduleHeader',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'header',\n})\n\nprovideScheduleHeaderLabels(() => props.labels)\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('header') }\">\n <slot />\n </Box>\n</template>\n",".headerControl {\n --control-size: 32px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n user-select: none;\n min-width: var(--control-size);\n height: var(--control-size);\n border-radius: var(--schedule-radius, var(--control-radius, var(--mantine-radius-default)));\n border: 1px solid var(--mantine-color-default-border);\n color: var(--mantine-color-default-color);\n background: var(--mantine-color-default);\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-transform: capitalize;\n\n &:where([data-interactive]) {\n cursor: pointer;\n\n @mixin hover {\n background-color: var(--mantine-color-default-hover);\n }\n }\n\n &:where(:not([data-square])) {\n padding-inline: 12px;\n }\n\n &:where([data-active]) {\n background-color: var(--mantine-primary-color-filled);\n border-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n\n @mixin hover {\n background-color: var(--mantine-primary-color-filled-hover);\n border-color: var(--mantine-primary-color-filled-hover);\n }\n }\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../../shared'\n\nconst defaultProps = {\n interactive: true,\n} as const\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n headerControl: {\n '--control-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\nimport classes from './HeaderControl.module.css'\n\ndefineOptions({\n name: 'HeaderControl',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('HeaderControl', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'HeaderControl',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'headerControl',\n})\n\nconst rootStyles = computed(() => getStyles('headerControl', { active: props.interactive }))\n\nconst rootMod = computed(() => [\n { active: props.active, square: props.square, interactive: props.interactive },\n (attrs as any).mod,\n])\n\n/** A non-interactive control stays in the DOM as a button but out of the tab order. */\nconst tabindex = computed(() =>\n props.interactive ? (attrs as { tabindex?: number | string }).tabindex : -1,\n)\n</script>\n\n<template>\n <UnstyledButton v-bind=\"{ ...attrs, ...rootStyles }\" :mod=\"rootMod\" :tabindex=\"tabindex\">\n <slot />\n </UnstyledButton>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../../shared'\n\nconst defaultProps = {\n interactive: true,\n} as const\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n headerControl: {\n '--control-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\nimport classes from './HeaderControl.module.css'\n\ndefineOptions({\n name: 'HeaderControl',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('HeaderControl', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'HeaderControl',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'headerControl',\n})\n\nconst rootStyles = computed(() => getStyles('headerControl', { active: props.interactive }))\n\nconst rootMod = computed(() => [\n { active: props.active, square: props.square, interactive: props.interactive },\n (attrs as any).mod,\n])\n\n/** A non-interactive control stays in the DOM as a button but out of the tab order. */\nconst tabindex = computed(() =>\n props.interactive ? (attrs as { tabindex?: number | string }).tabindex : -1,\n)\n</script>\n\n<template>\n <UnstyledButton v-bind=\"{ ...attrs, ...rootStyles }\" :mod=\"rootMod\" :tabindex=\"tabindex\">\n <slot />\n </UnstyledButton>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { AccordionChevron, useDirection } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderNext',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\n/** The chevron points down by default, so it is rotated onto the reading direction. */\nconst chevronStyle = computed(() => ({\n transform: `rotate(${dir.value === 'rtl' ? 90 : -90}deg)`,\n}))\n</script>\n\n<template>\n <HeaderControl\n data-type=\"next\"\n :aria-label=\"getLabel('next', labels)\"\n square\n :active=\"props.active\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>\n <AccordionChevron :style=\"chevronStyle\" />\n </slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { AccordionChevron, useDirection } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderNext',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\n/** The chevron points down by default, so it is rotated onto the reading direction. */\nconst chevronStyle = computed(() => ({\n transform: `rotate(${dir.value === 'rtl' ? 90 : -90}deg)`,\n}))\n</script>\n\n<template>\n <HeaderControl\n data-type=\"next\"\n :aria-label=\"getLabel('next', labels)\"\n square\n :active=\"props.active\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>\n <AccordionChevron :style=\"chevronStyle\" />\n </slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { AccordionChevron, useDirection } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderPrevious',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\n/** The chevron points down by default, so it is rotated onto the reading direction. */\nconst chevronStyle = computed(() => ({\n transform: `rotate(${dir.value === 'rtl' ? -90 : 90}deg)`,\n}))\n</script>\n\n<template>\n <HeaderControl\n data-type=\"previous\"\n :aria-label=\"getLabel('previous', labels)\"\n square\n :active=\"props.active\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>\n <AccordionChevron :style=\"chevronStyle\" />\n </slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { AccordionChevron, useDirection } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderPrevious',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\n/** The chevron points down by default, so it is rotated onto the reading direction. */\nconst chevronStyle = computed(() => ({\n transform: `rotate(${dir.value === 'rtl' ? -90 : 90}deg)`,\n}))\n</script>\n\n<template>\n <HeaderControl\n data-type=\"previous\"\n :aria-label=\"getLabel('previous', labels)\"\n square\n :active=\"props.active\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>\n <AccordionChevron :style=\"chevronStyle\" />\n </slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderToday',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n</script>\n\n<template>\n <HeaderControl\n data-type=\"today\"\n :aria-label=\"getLabel('today', labels)\"\n :active=\"props.active\"\n :square=\"props.square\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>{{ getLabel('today', labels) }}</slot>\n </HeaderControl>\n</template>\n","<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { getLabel } from '../../../labels'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport HeaderControl from './HeaderControl.vue'\nimport type { HeaderControlOwnProps, HeaderControlSlots } from './HeaderControl.types'\n\ndefineOptions({\n name: 'ScheduleHeaderToday',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<HeaderControlOwnProps>(), {\n interactive: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<HeaderControlSlots>()\n\nconst attrs = useAttrs()\nconst labels = useScheduleHeaderLabels(() => props.labels)\n</script>\n\n<template>\n <HeaderControl\n data-type=\"today\"\n :aria-label=\"getLabel('today', labels)\"\n :active=\"props.active\"\n :square=\"props.square\"\n :radius=\"props.radius\"\n :interactive=\"props.interactive\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n :styles=\"props.styles\"\n :vars=\"props.vars\"\n :unstyled=\"props.unstyled\"\n v-bind=\"attrs\"\n >\n <slot>{{ getLabel('today', labels) }}</slot>\n </HeaderControl>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport HeaderControlComponent, { varsResolver } from './HeaderControl.vue'\nimport ScheduleHeaderNextComponent from './ScheduleHeaderNext.vue'\nimport ScheduleHeaderPreviousComponent from './ScheduleHeaderPrevious.vue'\nimport ScheduleHeaderTodayComponent from './ScheduleHeaderToday.vue'\nimport type { HeaderControlFactory } from './HeaderControl.types'\nimport classes from './HeaderControl.module.css'\n\nexport const HeaderControl = factory<HeaderControlFactory>(HeaderControlComponent, {\n classes,\n varsResolver,\n})\n\n/** `HeaderControl` preset that navigates to the next period. */\nexport const ScheduleHeaderNext = factory<HeaderControlFactory>(ScheduleHeaderNextComponent, {\n classes,\n varsResolver,\n})\n\n/** `HeaderControl` preset that navigates to the previous period. */\nexport const ScheduleHeaderPrevious = factory<HeaderControlFactory>(\n ScheduleHeaderPreviousComponent,\n { classes, varsResolver },\n)\n\n/** `HeaderControl` preset that navigates to today. */\nexport const ScheduleHeaderToday = factory<HeaderControlFactory>(ScheduleHeaderTodayComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n HeaderControlCssVariables,\n HeaderControlFactory,\n HeaderControlOwnProps,\n HeaderControlProps,\n HeaderControlSlots,\n HeaderControlStylesNames,\n} from './HeaderControl.types'\n",".monthYearSelectTarget {\n text-transform: capitalize;\n min-width: 80px;\n\n &:where([data-with-months]) {\n min-width: 140px;\n }\n}\n\n.monthYearSelectList {\n flex: 1;\n}\n\n.monthYearSelectDropdown {\n display: flex;\n gap: var(--mantine-spacing-sm);\n padding: 8px 4px;\n\n &:where([data-with-months]) {\n padding: var(--mantine-spacing-sm);\n }\n}\n\n.monthYearSelectLabel {\n font-weight: var(--mantine-font-weight-medium);\n font-size: var(--mantine-font-size-sm);\n padding-inline: 8px;\n margin-bottom: 6px;\n}\n\n.monthYearSelectControl {\n display: block;\n width: 100%;\n padding: 6px 8px;\n font-size: var(--mantine-font-size-sm);\n line-height: 1;\n border-radius: var(--schedule-radius, var(--control-radius, var(--mantine-radius-default)));\n font-variant-numeric: tabular-nums;\n text-transform: capitalize;\n\n &:where([data-type='year']) {\n text-align: center;\n }\n\n @mixin hover {\n background-color: var(--mantine-color-default-hover);\n }\n\n &:where([data-active]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n\n @mixin hover {\n background-color: var(--mantine-primary-color-filled-hover);\n }\n }\n}\n","<script lang=\"ts\">\nconst defaultProps = {\n monthsListFormat: 'MMMM',\n withMonths: true,\n} as const\n\n/** Fallback radius of the dropdown, so it follows the schedule radius when one is set. */\nconst DEFAULT_DROPDOWN_RADIUS = 'var(--schedule-radius, var(--mantine-radius-default))'\n\nexport { defaultProps, DEFAULT_DROPDOWN_RADIUS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport {\n Box,\n createScopedKeydownHandler,\n Popover,\n UnstyledButton,\n useProps,\n useStyles,\n} from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { formatDate, getMonthsList, getYearsList } from '../../../utils'\nimport { HeaderControl } from '../HeaderControl'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport type { MonthYearSelectEmits, MonthYearSelectOwnProps } from './MonthYearSelect.types'\nimport classes from './MonthYearSelect.module.css'\n\ndefineOptions({\n name: 'MonthYearSelect',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MonthYearSelectOwnProps>(), {\n locale: undefined,\n startYear: undefined,\n endYear: undefined,\n yearValue: undefined,\n monthValue: undefined,\n monthsListFormat: undefined,\n labelFormat: undefined,\n radius: undefined,\n getYearControlProps: undefined,\n getMonthControlProps: undefined,\n withMonths: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<MonthYearSelectEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('MonthYearSelect', defaultProps, rawProps)\n\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\nconst getStyles = useStyles({\n name: 'MonthYearSelect',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'monthYearSelectTarget',\n})\n\nconst opened = ref(false)\n\n/** Captured once so the default year range does not shift while the dropdown is open. */\nconst today = new Date()\n\nconst startYear = computed(() => props.startYear ?? today.getFullYear() - 5)\nconst endYear = computed(() => props.endYear ?? today.getFullYear() + 5)\n\nconst selectedDate = computed(\n () => new Date(props.yearValue ?? today.getFullYear(), props.monthValue ?? today.getMonth(), 1),\n)\n\n/**\n * When the selected year falls outside the offered range no control can be focused by the\n * roving tabindex, so the first one takes the tab stop instead.\n */\nconst hasActiveYear = computed(\n () =>\n props.yearValue !== undefined &&\n props.yearValue >= startYear.value &&\n props.yearValue <= endYear.value,\n)\n\nconst months = computed(() =>\n props.withMonths\n ? getMonthsList({ locale: props.locale || 'en', format: props.monthsListFormat! })\n : [],\n)\n\nconst years = computed(() => getYearsList({ startYear: startYear.value, endYear: endYear.value }))\n\nconst targetLabel = computed(() =>\n formatDate({\n date: selectedDate.value,\n locale: props.locale || 'en',\n format: props.labelFormat || (props.withMonths ? 'MMMM YYYY' : 'YYYY'),\n }),\n)\n\nconst selectMonth = (month: number) => {\n emit('update:monthValue', month)\n emit('monthChange', month)\n}\n\nconst selectYear = (year: number) => {\n emit('update:yearValue', year)\n emit('yearChange', year)\n\n // Without a month list there is nothing left to pick, so the dropdown closes itself.\n if (!props.withMonths) {\n opened.value = false\n }\n}\n\n/**\n * Roving focus inside one dropdown list. A handler returned by `getMonthControlProps` or\n * `getYearControlProps` is not composed in here: Vue already merges the two `keydown`\n * listeners and would otherwise call the consumer's twice.\n */\nconst monthKeydownHandler = createScopedKeydownHandler({\n siblingSelector: '[data-type=\"month\"]:not(:disabled)',\n parentSelector: '[data-list]',\n activateOnFocus: false,\n loop: true,\n orientation: 'vertical',\n})\n\nconst yearKeydownHandler = createScopedKeydownHandler({\n siblingSelector: '[data-type=\"year\"]:not(:disabled)',\n parentSelector: '[data-list]',\n activateOnFocus: false,\n loop: true,\n orientation: 'vertical',\n})\n\nconst monthControlProps = (month: number) => props.getMonthControlProps?.(month) ?? {}\nconst yearControlProps = (year: number) => props.getYearControlProps?.(year) ?? {}\n</script>\n\n<template>\n <Popover\n position=\"bottom-start\"\n trap-focus\n :transition-props=\"{ transition: 'pop', duration: 120 }\"\n :radius=\"props.radius || DEFAULT_DROPDOWN_RADIUS\"\n shadow=\"md\"\n :offset=\"3\"\n :width=\"props.withMonths ? undefined : 'target'\"\n :opened=\"opened\"\n @change=\"opened = $event\"\n >\n <Popover.Target>\n <HeaderControl\n v-bind=\"{ ...attrs, ...getStyles('monthYearSelectTarget') }\"\n :radius=\"props.radius\"\n :data-with-months=\"props.withMonths || undefined\"\n @click=\"opened = !opened\"\n >\n {{ targetLabel }}\n </HeaderControl>\n </Popover.Target>\n\n <Popover.Dropdown\n v-bind=\"getStyles('monthYearSelectDropdown')\"\n :data-with-months=\"props.withMonths || undefined\"\n >\n <Box v-if=\"props.withMonths\" v-bind=\"getStyles('monthYearSelectList')\" data-list>\n <Box v-bind=\"getStyles('monthYearSelectLabel')\">{{ getLabel('month', labels) }}</Box>\n <UnstyledButton\n v-for=\"month in months\"\n :key=\"month.month\"\n v-bind=\"{\n ...monthControlProps(month.month),\n ...getStyles('monthYearSelectControl', {\n className: monthControlProps(month.month).class,\n }),\n }\"\n :mod=\"{ type: 'month', active: month.month === props.monthValue }\"\n :tabindex=\"month.month === props.monthValue ? 0 : -1\"\n :aria-label=\"`${getLabel('selectMonth', labels)} ${month.name}`\"\n @keydown=\"monthKeydownHandler\"\n @click=\"selectMonth(month.month)\"\n >\n {{ month.name }}\n </UnstyledButton>\n </Box>\n\n <Box v-bind=\"getStyles('monthYearSelectList')\" data-list>\n <Box v-if=\"props.withMonths\" v-bind=\"getStyles('monthYearSelectLabel')\">\n {{ getLabel('year', labels) }}\n </Box>\n <UnstyledButton\n v-for=\"(year, index) in years\"\n :key=\"year\"\n v-bind=\"{\n ...yearControlProps(year),\n ...getStyles('monthYearSelectControl', { className: yearControlProps(year).class }),\n }\"\n :mod=\"{ type: 'year', active: year === props.yearValue }\"\n :tabindex=\"hasActiveYear ? (year === props.yearValue ? 0 : -1) : index === 0 ? 0 : -1\"\n :aria-label=\"`${getLabel('selectYear', labels)} ${year}`\"\n @keydown=\"yearKeydownHandler\"\n @click=\"selectYear(year)\"\n >\n {{ year }}\n </UnstyledButton>\n </Box>\n </Popover.Dropdown>\n </Popover>\n</template>\n","<script lang=\"ts\">\nconst defaultProps = {\n monthsListFormat: 'MMMM',\n withMonths: true,\n} as const\n\n/** Fallback radius of the dropdown, so it follows the schedule radius when one is set. */\nconst DEFAULT_DROPDOWN_RADIUS = 'var(--schedule-radius, var(--mantine-radius-default))'\n\nexport { defaultProps, DEFAULT_DROPDOWN_RADIUS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport {\n Box,\n createScopedKeydownHandler,\n Popover,\n UnstyledButton,\n useProps,\n useStyles,\n} from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { formatDate, getMonthsList, getYearsList } from '../../../utils'\nimport { HeaderControl } from '../HeaderControl'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport type { MonthYearSelectEmits, MonthYearSelectOwnProps } from './MonthYearSelect.types'\nimport classes from './MonthYearSelect.module.css'\n\ndefineOptions({\n name: 'MonthYearSelect',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MonthYearSelectOwnProps>(), {\n locale: undefined,\n startYear: undefined,\n endYear: undefined,\n yearValue: undefined,\n monthValue: undefined,\n monthsListFormat: undefined,\n labelFormat: undefined,\n radius: undefined,\n getYearControlProps: undefined,\n getMonthControlProps: undefined,\n withMonths: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<MonthYearSelectEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('MonthYearSelect', defaultProps, rawProps)\n\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\nconst getStyles = useStyles({\n name: 'MonthYearSelect',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'monthYearSelectTarget',\n})\n\nconst opened = ref(false)\n\n/** Captured once so the default year range does not shift while the dropdown is open. */\nconst today = new Date()\n\nconst startYear = computed(() => props.startYear ?? today.getFullYear() - 5)\nconst endYear = computed(() => props.endYear ?? today.getFullYear() + 5)\n\nconst selectedDate = computed(\n () => new Date(props.yearValue ?? today.getFullYear(), props.monthValue ?? today.getMonth(), 1),\n)\n\n/**\n * When the selected year falls outside the offered range no control can be focused by the\n * roving tabindex, so the first one takes the tab stop instead.\n */\nconst hasActiveYear = computed(\n () =>\n props.yearValue !== undefined &&\n props.yearValue >= startYear.value &&\n props.yearValue <= endYear.value,\n)\n\nconst months = computed(() =>\n props.withMonths\n ? getMonthsList({ locale: props.locale || 'en', format: props.monthsListFormat! })\n : [],\n)\n\nconst years = computed(() => getYearsList({ startYear: startYear.value, endYear: endYear.value }))\n\nconst targetLabel = computed(() =>\n formatDate({\n date: selectedDate.value,\n locale: props.locale || 'en',\n format: props.labelFormat || (props.withMonths ? 'MMMM YYYY' : 'YYYY'),\n }),\n)\n\nconst selectMonth = (month: number) => {\n emit('update:monthValue', month)\n emit('monthChange', month)\n}\n\nconst selectYear = (year: number) => {\n emit('update:yearValue', year)\n emit('yearChange', year)\n\n // Without a month list there is nothing left to pick, so the dropdown closes itself.\n if (!props.withMonths) {\n opened.value = false\n }\n}\n\n/**\n * Roving focus inside one dropdown list. A handler returned by `getMonthControlProps` or\n * `getYearControlProps` is not composed in here: Vue already merges the two `keydown`\n * listeners and would otherwise call the consumer's twice.\n */\nconst monthKeydownHandler = createScopedKeydownHandler({\n siblingSelector: '[data-type=\"month\"]:not(:disabled)',\n parentSelector: '[data-list]',\n activateOnFocus: false,\n loop: true,\n orientation: 'vertical',\n})\n\nconst yearKeydownHandler = createScopedKeydownHandler({\n siblingSelector: '[data-type=\"year\"]:not(:disabled)',\n parentSelector: '[data-list]',\n activateOnFocus: false,\n loop: true,\n orientation: 'vertical',\n})\n\nconst monthControlProps = (month: number) => props.getMonthControlProps?.(month) ?? {}\nconst yearControlProps = (year: number) => props.getYearControlProps?.(year) ?? {}\n</script>\n\n<template>\n <Popover\n position=\"bottom-start\"\n trap-focus\n :transition-props=\"{ transition: 'pop', duration: 120 }\"\n :radius=\"props.radius || DEFAULT_DROPDOWN_RADIUS\"\n shadow=\"md\"\n :offset=\"3\"\n :width=\"props.withMonths ? undefined : 'target'\"\n :opened=\"opened\"\n @change=\"opened = $event\"\n >\n <Popover.Target>\n <HeaderControl\n v-bind=\"{ ...attrs, ...getStyles('monthYearSelectTarget') }\"\n :radius=\"props.radius\"\n :data-with-months=\"props.withMonths || undefined\"\n @click=\"opened = !opened\"\n >\n {{ targetLabel }}\n </HeaderControl>\n </Popover.Target>\n\n <Popover.Dropdown\n v-bind=\"getStyles('monthYearSelectDropdown')\"\n :data-with-months=\"props.withMonths || undefined\"\n >\n <Box v-if=\"props.withMonths\" v-bind=\"getStyles('monthYearSelectList')\" data-list>\n <Box v-bind=\"getStyles('monthYearSelectLabel')\">{{ getLabel('month', labels) }}</Box>\n <UnstyledButton\n v-for=\"month in months\"\n :key=\"month.month\"\n v-bind=\"{\n ...monthControlProps(month.month),\n ...getStyles('monthYearSelectControl', {\n className: monthControlProps(month.month).class,\n }),\n }\"\n :mod=\"{ type: 'month', active: month.month === props.monthValue }\"\n :tabindex=\"month.month === props.monthValue ? 0 : -1\"\n :aria-label=\"`${getLabel('selectMonth', labels)} ${month.name}`\"\n @keydown=\"monthKeydownHandler\"\n @click=\"selectMonth(month.month)\"\n >\n {{ month.name }}\n </UnstyledButton>\n </Box>\n\n <Box v-bind=\"getStyles('monthYearSelectList')\" data-list>\n <Box v-if=\"props.withMonths\" v-bind=\"getStyles('monthYearSelectLabel')\">\n {{ getLabel('year', labels) }}\n </Box>\n <UnstyledButton\n v-for=\"(year, index) in years\"\n :key=\"year\"\n v-bind=\"{\n ...yearControlProps(year),\n ...getStyles('monthYearSelectControl', { className: yearControlProps(year).class }),\n }\"\n :mod=\"{ type: 'year', active: year === props.yearValue }\"\n :tabindex=\"hasActiveYear ? (year === props.yearValue ? 0 : -1) : index === 0 ? 0 : -1\"\n :aria-label=\"`${getLabel('selectYear', labels)} ${year}`\"\n @keydown=\"yearKeydownHandler\"\n @click=\"selectYear(year)\"\n >\n {{ year }}\n </UnstyledButton>\n </Box>\n </Popover.Dropdown>\n </Popover>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport MonthYearSelectComponent from './MonthYearSelect.vue'\nimport type { MonthYearSelectFactory } from './MonthYearSelect.types'\nimport classes from './MonthYearSelect.module.css'\n\nexport const MonthYearSelect = factory<MonthYearSelectFactory>(MonthYearSelectComponent, {\n classes,\n})\n\nexport type {\n MonthYearSelectEmits,\n MonthYearSelectFactory,\n MonthYearSelectOwnProps,\n MonthYearSelectProps,\n MonthYearSelectStylesNames,\n} from './MonthYearSelect.types'\n",".viewSelect {\n display: flex;\n gap: 4px;\n}\n","<script lang=\"ts\">\nimport type { ScheduleViewLevel } from '../../../types'\n\nconst defaultProps = {\n views: ['day', 'week', 'month', 'year'],\n} as const\n\nconst SWITCH_LABELS: Record<\n ScheduleViewLevel,\n 'switchToDayView' | 'switchToWeekView' | 'switchToMonthView' | 'switchToYearView'\n> = {\n day: 'switchToDayView',\n week: 'switchToWeekView',\n month: 'switchToMonthView',\n year: 'switchToYearView',\n}\n\nexport { defaultProps, SWITCH_LABELS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { HeaderControl } from '../HeaderControl'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport type { ViewSelectEmits, ViewSelectOwnProps } from './ViewSelect.types'\nimport classes from './ViewSelect.module.css'\n\ndefineOptions({\n name: 'ViewSelect',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ViewSelectOwnProps>(), {\n views: undefined,\n modelValue: undefined,\n value: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<ViewSelectEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ViewSelect', defaultProps, rawProps)\n\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\nconst getStyles = useStyles({\n name: 'ViewSelect',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'viewSelect',\n})\n\nconst selected = computed(() => props.modelValue ?? props.value)\n\nconst select = (view: ScheduleViewLevel) => {\n emit('update:modelValue', view)\n emit('change', view)\n}\n\n/** Roving tabindex across the tablist, matching the WAI-ARIA tabs pattern. */\nconst handleKeydown = (nativeEvent: KeyboardEvent, index: number) => {\n const controls = (\n nativeEvent.currentTarget as HTMLElement\n ).parentElement?.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]')\n\n if (!controls?.length) {\n return\n }\n\n let next = index\n\n if (nativeEvent.key === 'ArrowRight') {\n next = (index + 1) % controls.length\n } else if (nativeEvent.key === 'ArrowLeft') {\n next = (index - 1 + controls.length) % controls.length\n } else if (nativeEvent.key === 'Home') {\n next = 0\n } else if (nativeEvent.key === 'End') {\n next = controls.length - 1\n } else {\n return\n }\n\n nativeEvent.preventDefault()\n controls[next]?.focus()\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('viewSelect') }\"\n role=\"tablist\"\n :aria-label=\"getLabel('viewSelectLabel', labels)\"\n >\n <HeaderControl\n v-for=\"(view, index) in props.views\"\n :key=\"view\"\n :active=\"view === selected\"\n :radius=\"props.radius\"\n role=\"tab\"\n :data-type=\"view\"\n :aria-selected=\"view === selected\"\n :aria-label=\"getLabel(SWITCH_LABELS[view], labels)\"\n :tabindex=\"view === selected ? 0 : -1\"\n @click=\"select(view)\"\n @keydown=\"handleKeydown($event, index)\"\n >\n {{ getLabel(view, labels) }}\n </HeaderControl>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport type { ScheduleViewLevel } from '../../../types'\n\nconst defaultProps = {\n views: ['day', 'week', 'month', 'year'],\n} as const\n\nconst SWITCH_LABELS: Record<\n ScheduleViewLevel,\n 'switchToDayView' | 'switchToWeekView' | 'switchToMonthView' | 'switchToYearView'\n> = {\n day: 'switchToDayView',\n week: 'switchToWeekView',\n month: 'switchToMonthView',\n year: 'switchToYearView',\n}\n\nexport { defaultProps, SWITCH_LABELS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../../labels'\nimport { HeaderControl } from '../HeaderControl'\nimport { useScheduleHeaderLabels } from '../ScheduleHeader.context'\nimport type { ViewSelectEmits, ViewSelectOwnProps } from './ViewSelect.types'\nimport classes from './ViewSelect.module.css'\n\ndefineOptions({\n name: 'ViewSelect',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ViewSelectOwnProps>(), {\n views: undefined,\n modelValue: undefined,\n value: undefined,\n radius: undefined,\n labels: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<ViewSelectEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ViewSelect', defaultProps, rawProps)\n\nconst labels = useScheduleHeaderLabels(() => props.labels)\n\nconst getStyles = useStyles({\n name: 'ViewSelect',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'viewSelect',\n})\n\nconst selected = computed(() => props.modelValue ?? props.value)\n\nconst select = (view: ScheduleViewLevel) => {\n emit('update:modelValue', view)\n emit('change', view)\n}\n\n/** Roving tabindex across the tablist, matching the WAI-ARIA tabs pattern. */\nconst handleKeydown = (nativeEvent: KeyboardEvent, index: number) => {\n const controls = (\n nativeEvent.currentTarget as HTMLElement\n ).parentElement?.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]')\n\n if (!controls?.length) {\n return\n }\n\n let next = index\n\n if (nativeEvent.key === 'ArrowRight') {\n next = (index + 1) % controls.length\n } else if (nativeEvent.key === 'ArrowLeft') {\n next = (index - 1 + controls.length) % controls.length\n } else if (nativeEvent.key === 'Home') {\n next = 0\n } else if (nativeEvent.key === 'End') {\n next = controls.length - 1\n } else {\n return\n }\n\n nativeEvent.preventDefault()\n controls[next]?.focus()\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('viewSelect') }\"\n role=\"tablist\"\n :aria-label=\"getLabel('viewSelectLabel', labels)\"\n >\n <HeaderControl\n v-for=\"(view, index) in props.views\"\n :key=\"view\"\n :active=\"view === selected\"\n :radius=\"props.radius\"\n role=\"tab\"\n :data-type=\"view\"\n :aria-selected=\"view === selected\"\n :aria-label=\"getLabel(SWITCH_LABELS[view], labels)\"\n :tabindex=\"view === selected ? 0 : -1\"\n @click=\"select(view)\"\n @keydown=\"handleKeydown($event, index)\"\n >\n {{ getLabel(view, labels) }}\n </HeaderControl>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ViewSelectComponent from './ViewSelect.vue'\nimport type { ViewSelectFactory } from './ViewSelect.types'\nimport classes from './ViewSelect.module.css'\n\nexport const ViewSelect = factory<ViewSelectFactory>(ViewSelectComponent, { classes })\n\nexport type {\n ViewSelectEmits,\n ViewSelectFactory,\n ViewSelectOwnProps,\n ViewSelectProps,\n ViewSelectStylesNames,\n} from './ViewSelect.types'\n","import { factory } from '@mantine-vue/core'\nimport ScheduleHeaderComponent from './ScheduleHeader.vue'\nimport {\n HeaderControl,\n ScheduleHeaderNext,\n ScheduleHeaderPrevious,\n ScheduleHeaderToday,\n} from './HeaderControl'\nimport { MonthYearSelect } from './MonthYearSelect'\nimport { ViewSelect } from './ViewSelect'\nimport type { ScheduleHeaderFactory } from './ScheduleHeader.types'\nimport classes from './ScheduleHeader.module.css'\n\nexport const ScheduleHeader = factory<\n ScheduleHeaderFactory & {\n staticComponents: {\n Control: typeof HeaderControl\n Previous: typeof ScheduleHeaderPrevious\n Next: typeof ScheduleHeaderNext\n Today: typeof ScheduleHeaderToday\n ViewSelect: typeof ViewSelect\n MonthYearSelect: typeof MonthYearSelect\n }\n }\n>(ScheduleHeaderComponent, {\n classes,\n Control: HeaderControl,\n Previous: ScheduleHeaderPrevious,\n Next: ScheduleHeaderNext,\n Today: ScheduleHeaderToday,\n ViewSelect,\n MonthYearSelect,\n})\n\nexport type {\n CombinedScheduleHeaderStylesNames,\n ScheduleHeaderFactory,\n ScheduleHeaderOwnProps,\n ScheduleHeaderProps,\n ScheduleHeaderSlots,\n ScheduleHeaderStylesNames,\n} from './ScheduleHeader.types'\n","<script lang=\"ts\">\nimport dayjs from 'dayjs'\nimport type { ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport type { ScheduleHeaderNavigationHandlers } from './ScheduleHeaderBase.types'\n\nconst DEFAULT_VIEWS: ScheduleViewLevel[] = ['day', 'week', 'month', 'year']\n\n/** Builds the previous/next/today handlers for a view that steps by a single `unit`. */\nexport function createHeaderNavigation(\n date: Date | string,\n unit: 'day' | 'week' | 'month' | 'year',\n): ScheduleHeaderNavigationHandlers {\n return {\n previous: () => toDateString(dayjs(date).subtract(1, unit)),\n next: () => toDateString(dayjs(date).add(1, unit)),\n today: () => toDateString(dayjs()),\n }\n}\n\nexport { DEFAULT_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { Box, NativeSelect, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport { ScheduleHeader } from './ScheduleHeader'\nimport type {\n ScheduleHeaderBaseEmits,\n ScheduleHeaderBaseProps,\n ScheduleHeaderBaseSlots,\n} from './ScheduleHeaderBase.types'\nimport classes from './ScheduleHeader.module.css'\n\ndefineOptions({\n name: 'ScheduleHeaderBase',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleHeaderBaseProps>(), {\n labels: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleHeaderBaseSlots>()\n\nconst emit = defineEmits<ScheduleHeaderBaseEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ScheduleHeader', null, rawProps)\n\n/**\n * The layout selectors live in the `ScheduleHeader` Styles API, so a view that forwards its\n * `classNames` reaches them through the same names it documents.\n */\nconst getStyles = useStyles({\n name: 'ScheduleHeader',\n props,\n classes,\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'header',\n})\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst views = computed(() => props.viewSelectProps?.views ?? DEFAULT_VIEWS)\n\nconst compactData = computed(() =>\n views.value.map((view) => ({ value: view, label: getLabel(view, props.labels) })),\n)\n\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n\nconst renderTitle = () => props.control.title\n</script>\n\n<template>\n <ScheduleHeader v-bind=\"{ ...attrs, ...stylesApi }\" :labels=\"props.labels\">\n <Box v-bind=\"getStyles('navigationGroup')\">\n <ScheduleHeader.Previous\n v-bind=\"{ ...stylesApi, ...props.previousControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.previous())\"\n />\n\n <ScheduleHeader.MonthYearSelect\n v-if=\"props.control.monthYearSelect\"\n v-bind=\"{ ...stylesApi, ...props.control.monthYearSelect }\"\n :labels=\"props.labels\"\n />\n <ScheduleHeader.Control\n v-else\n v-bind=\"stylesApi\"\n :interactive=\"false\"\n :style=\"props.control.miw === undefined ? undefined : { minWidth: props.control.miw }\"\n >\n <component :is=\"renderTitle\" v-if=\"props.control.title !== undefined\" />\n <slot v-else name=\"title\" />\n </ScheduleHeader.Control>\n\n <ScheduleHeader.Next\n v-bind=\"{ ...stylesApi, ...props.nextControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.next())\"\n />\n </Box>\n\n <Box v-bind=\"getStyles('todayControl')\">\n <ScheduleHeader.Today\n v-bind=\"{ ...stylesApi, ...props.todayControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.today())\"\n />\n </Box>\n\n <NativeSelect\n :class=\"getStyles('compactViewSelect').class\"\n :model-value=\"props.view\"\n size=\"sm\"\n :data=\"compactData\"\n :aria-label=\"getLabel('viewSelectLabel', props.labels)\"\n @change=\"changeView($event as ScheduleViewLevel)\"\n />\n\n <Box v-bind=\"getStyles('viewSelect', { style: { marginInlineStart: 'auto' } })\">\n <ScheduleHeader.ViewSelect\n v-bind=\"{ ...stylesApi, ...props.viewSelectProps }\"\n :model-value=\"props.view\"\n :labels=\"props.labels\"\n @change=\"changeView\"\n />\n </Box>\n </ScheduleHeader>\n</template>\n","<script lang=\"ts\">\nimport dayjs from 'dayjs'\nimport type { ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport type { ScheduleHeaderNavigationHandlers } from './ScheduleHeaderBase.types'\n\nconst DEFAULT_VIEWS: ScheduleViewLevel[] = ['day', 'week', 'month', 'year']\n\n/** Builds the previous/next/today handlers for a view that steps by a single `unit`. */\nexport function createHeaderNavigation(\n date: Date | string,\n unit: 'day' | 'week' | 'month' | 'year',\n): ScheduleHeaderNavigationHandlers {\n return {\n previous: () => toDateString(dayjs(date).subtract(1, unit)),\n next: () => toDateString(dayjs(date).add(1, unit)),\n today: () => toDateString(dayjs()),\n }\n}\n\nexport { DEFAULT_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue'\nimport { Box, NativeSelect, useProps, useStyles } from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport { ScheduleHeader } from './ScheduleHeader'\nimport type {\n ScheduleHeaderBaseEmits,\n ScheduleHeaderBaseProps,\n ScheduleHeaderBaseSlots,\n} from './ScheduleHeaderBase.types'\nimport classes from './ScheduleHeader.module.css'\n\ndefineOptions({\n name: 'ScheduleHeaderBase',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleHeaderBaseProps>(), {\n labels: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleHeaderBaseSlots>()\n\nconst emit = defineEmits<ScheduleHeaderBaseEmits>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('ScheduleHeader', null, rawProps)\n\n/**\n * The layout selectors live in the `ScheduleHeader` Styles API, so a view that forwards its\n * `classNames` reaches them through the same names it documents.\n */\nconst getStyles = useStyles({\n name: 'ScheduleHeader',\n props,\n classes,\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n rootSelector: 'header',\n})\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst views = computed(() => props.viewSelectProps?.views ?? DEFAULT_VIEWS)\n\nconst compactData = computed(() =>\n views.value.map((view) => ({ value: view, label: getLabel(view, props.labels) })),\n)\n\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n\nconst renderTitle = () => props.control.title\n</script>\n\n<template>\n <ScheduleHeader v-bind=\"{ ...attrs, ...stylesApi }\" :labels=\"props.labels\">\n <Box v-bind=\"getStyles('navigationGroup')\">\n <ScheduleHeader.Previous\n v-bind=\"{ ...stylesApi, ...props.previousControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.previous())\"\n />\n\n <ScheduleHeader.MonthYearSelect\n v-if=\"props.control.monthYearSelect\"\n v-bind=\"{ ...stylesApi, ...props.control.monthYearSelect }\"\n :labels=\"props.labels\"\n />\n <ScheduleHeader.Control\n v-else\n v-bind=\"stylesApi\"\n :interactive=\"false\"\n :style=\"props.control.miw === undefined ? undefined : { minWidth: props.control.miw }\"\n >\n <component :is=\"renderTitle\" v-if=\"props.control.title !== undefined\" />\n <slot v-else name=\"title\" />\n </ScheduleHeader.Control>\n\n <ScheduleHeader.Next\n v-bind=\"{ ...stylesApi, ...props.nextControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.next())\"\n />\n </Box>\n\n <Box v-bind=\"getStyles('todayControl')\">\n <ScheduleHeader.Today\n v-bind=\"{ ...stylesApi, ...props.todayControlProps }\"\n @click=\"emit('dateChange', props.navigationHandlers.today())\"\n />\n </Box>\n\n <NativeSelect\n :class=\"getStyles('compactViewSelect').class\"\n :model-value=\"props.view\"\n size=\"sm\"\n :data=\"compactData\"\n :aria-label=\"getLabel('viewSelectLabel', props.labels)\"\n @change=\"changeView($event as ScheduleViewLevel)\"\n />\n\n <Box v-bind=\"getStyles('viewSelect', { style: { marginInlineStart: 'auto' } })\">\n <ScheduleHeader.ViewSelect\n v-bind=\"{ ...stylesApi, ...props.viewSelectProps }\"\n :model-value=\"props.view\"\n :labels=\"props.labels\"\n @change=\"changeView\"\n />\n </Box>\n </ScheduleHeader>\n</template>\n","import ScheduleHeaderBaseComponent, { createHeaderNavigation } from './ScheduleHeaderBase.vue'\n\n/**\n * Header shared by every view. Internal building block: views expose the parts of it they\n * support through their own props rather than rendering it directly.\n */\nexport const ScheduleHeaderBase = ScheduleHeaderBaseComponent\n\nexport { createHeaderNavigation }\n\nexport type {\n ScheduleHeaderBaseEmits,\n ScheduleHeaderBaseProps,\n ScheduleHeaderBaseSlots,\n ScheduleHeaderControl,\n ScheduleHeaderNavigationHandlers,\n} from './ScheduleHeaderBase.types'\n","import { onBeforeUnmount, shallowRef, watch, type Ref } from 'vue'\nimport { rafThrottle } from './shared'\n\ninterface SelectedRange {\n group: string\n start: number\n end: number\n}\n\ninterface DragState {\n group: string\n startIndex: number\n currentIndex: number\n}\n\nexport interface UseSlotDragSelectInput {\n enabled: () => boolean\n\n onDragEnd?: (startIndex: number, endIndex: number, group: string) => void\n}\n\nexport interface SlotDragSelect {\n handleSlotPointerDown: (event: PointerEvent, index: number, group: string) => void\n\n isSlotSelected: (index: number, group: string) => boolean\n\n isDragging: () => boolean\n}\n\n/**\n * Slot drag-selection shared by the day, week and month views. It tracks a selected range as the\n * pointer moves across elements carrying `data-drag-slot-index` / `data-drag-slot-group`.\n *\n * Hit testing goes through `elementsFromPoint`, which reads layout, so it is coalesced to one\n * animation frame: a fast pointer would otherwise queue up more hit tests and re-renders than the\n * browser can paint, and the selection would keep growing after the pointer stopped.\n */\nexport function useSlotDragSelect(input: UseSlotDragSelectInput): SlotDragSelect {\n const selectedRange = shallowRef<SelectedRange | null>(null)\n let drag: DragState | null = null\n let savedUserSelect = ''\n\n const resolveIndexAt = rafThrottle((clientX: number, clientY: number) => {\n if (!drag) {\n return\n }\n\n for (const element of document.elementsFromPoint(clientX, clientY)) {\n const indexAttr = element.getAttribute?.('data-drag-slot-index')\n const groupAttr = element.getAttribute?.('data-drag-slot-group')\n\n if (indexAttr == null || groupAttr == null) {\n continue\n }\n\n if (groupAttr === drag.group) {\n const nextIndex = Number(indexAttr)\n\n if (!Number.isNaN(nextIndex) && nextIndex !== drag.currentIndex) {\n drag.currentIndex = nextIndex\n selectedRange.value = {\n group: groupAttr,\n start: Math.min(drag.startIndex, nextIndex),\n end: Math.max(drag.startIndex, nextIndex),\n }\n }\n }\n\n // The topmost slot under the pointer decides; anything below it is covered.\n break\n }\n })\n\n const handlePointerMove = (event: PointerEvent) => {\n if (drag) {\n resolveIndexAt(event.clientX, event.clientY)\n }\n }\n\n const handlePointerUp = () => {\n // Drop the pending hit test first: the gesture is over, so its result is stale by definition.\n resolveIndexAt.cancel()\n\n if (drag) {\n const { startIndex, currentIndex, group } = drag\n\n if (startIndex !== currentIndex) {\n input.onDragEnd?.(\n Math.min(startIndex, currentIndex),\n Math.max(startIndex, currentIndex),\n group,\n )\n }\n }\n\n drag = null\n selectedRange.value = null\n }\n\n const removeListeners = () => {\n resolveIndexAt.cancel()\n document.body.style.userSelect = savedUserSelect\n document.removeEventListener('pointermove', handlePointerMove)\n document.removeEventListener('pointerup', handlePointerUp)\n }\n\n watch(\n () => selectedRange.value !== null,\n (isDragging) => {\n if (isDragging) {\n savedUserSelect = document.body.style.userSelect\n document.body.style.userSelect = 'none'\n document.addEventListener('pointermove', handlePointerMove)\n document.addEventListener('pointerup', handlePointerUp)\n } else {\n removeListeners()\n }\n },\n )\n\n onBeforeUnmount(() => {\n if (selectedRange.value !== null) {\n removeListeners()\n }\n })\n\n const handleSlotPointerDown = (_event: PointerEvent, index: number, group: string) => {\n if (!input.enabled()) {\n return\n }\n\n drag = { group, startIndex: index, currentIndex: index }\n selectedRange.value = { group, start: index, end: index }\n }\n\n const isSlotSelected = (index: number, group: string) => {\n const range = selectedRange.value\n\n if (!range || range.group !== group) {\n return false\n }\n\n return index >= range.start && index <= range.end\n }\n\n const isDragging = () => selectedRange.value !== null\n\n return { handleSlotPointerDown, isSlotSelected, isDragging }\n}\n\nexport type SelectedRangeRef = Ref<SelectedRange | null>\n","import { shallowRef } from 'vue'\nimport type { DateStringValue, DateTimeStringValue } from '../types'\nimport { clampIntervalMinutes, parseTimeString } from '../utils'\nimport { rafThrottle } from './shared'\n\nexport interface SlotDropTarget {\n date: DateStringValue\n\n slotIndex: number\n}\n\nexport interface SlotDropInterval {\n startTime: string\n}\n\nexport interface ResolveSlotInput {\n container: HTMLElement | null | undefined\n\n date: DateStringValue\n\n intervals: SlotDropInterval[]\n\n intervalMinutes?: number\n\n dragIntervalMinutes?: number\n\n startTime?: string\n\n endTime?: string\n}\n\nexport interface ResolvedSlotDrop {\n slotIndex: number\n target: DateTimeStringValue\n}\n\nfunction resolveSlotIndex(\n { container, intervals }: ResolveSlotInput,\n clientY: number,\n eventTarget: Element | null,\n) {\n if (!container || intervals.length === 0) {\n return -1\n }\n\n // Fast path: the pointer is over a slot, so the index is already on the element.\n const slot = eventTarget?.closest<HTMLElement>('[data-time-slot-index]')\n\n if (slot && container.contains(slot)) {\n const index = Number(slot.dataset.timeSlotIndex)\n\n if (Number.isInteger(index)) {\n return index\n }\n }\n\n // Slow path: the pointer is over an event or a gap, so the slots have to be measured. This\n // reads layout, which is why the caller only ever reaches it once per animation frame.\n const slots = container.querySelectorAll<HTMLElement>('[data-time-slot-index]')\n\n return Array.from(slots).findIndex((element) => {\n const rect = element.getBoundingClientRect()\n return clientY >= rect.top && clientY <= rect.bottom\n })\n}\n\nfunction resolveTarget(\n input: ResolveSlotInput,\n slotIndex: number,\n clientY: number,\n): DateTimeStringValue | undefined {\n const interval = input.intervals[slotIndex]\n if (!interval) return undefined\n\n if (input.dragIntervalMinutes == null) {\n return `${input.date} ${interval.startTime}` as DateTimeStringValue\n }\n\n const slots = input.container?.querySelectorAll<HTMLElement>('[data-time-slot-index]')\n const rect = slots?.[slotIndex]?.getBoundingClientRect()\n const parsed = parseTimeString(interval.startTime)\n const gridInterval = clampIntervalMinutes(input.intervalMinutes ?? 15)\n const dragInterval = clampIntervalMinutes(input.dragIntervalMinutes)\n const offsetRatio = rect && rect.height > 0 ? (clientY - rect.top) / rect.height : 0\n let minutes =\n Math.round((parsed.hours * 60 + parsed.minutes + offsetRatio * gridInterval) / dragInterval) *\n dragInterval\n\n const start = input.startTime ? parseTimeString(input.startTime) : null\n const end = input.endTime ? parseTimeString(input.endTime) : null\n const min = start\n ? Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval\n : 0\n const max = end\n ? Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval\n : 1439\n minutes = min > max ? start!.hours * 60 + start!.minutes : Math.max(min, Math.min(max, minutes))\n\n return `${input.date} ${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}:00` as DateTimeStringValue\n}\n\n/**\n * Tracks the time slot a drag is hovering over.\n *\n * `dragover` fires many times per frame and the fallback that measures slots reads layout, so\n * resolving the target on every event makes the highlight lag behind the pointer and keep\n * catching up after it stops. The resolution is therefore coalesced to one animation frame, the\n * state is only written when the slot actually changes, and any pending frame is dropped as soon\n * as the drag leaves or the drop happens — so nothing lands after the fact.\n */\nexport function useSlotDropTarget() {\n const dropTarget = shallowRef<SlotDropTarget | null>(null)\n\n const setTarget = (next: SlotDropTarget | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (current && next && current.date === next.date && current.slotIndex === next.slotIndex) {\n return\n }\n\n dropTarget.value = next\n }\n\n const resolveLater = rafThrottle(\n (input: ResolveSlotInput, clientY: number, eventTarget: Element | null) => {\n const slotIndex = resolveSlotIndex(input, clientY, eventTarget)\n setTarget(slotIndex < 0 ? null : { date: input.date, slotIndex })\n },\n )\n\n const reset = () => {\n resolveLater.cancel()\n setTarget(null)\n }\n\n return {\n dropTarget,\n\n isTarget: (date: DateStringValue, slotIndex: number) =>\n dropTarget.value?.date === date && dropTarget.value.slotIndex === slotIndex,\n\n /**\n * Accepts the drag and schedules the target update. `preventDefault` and `dropEffect` run\n * synchronously because the browser reads them as the handler returns.\n */\n dragOver: (nativeEvent: DragEvent, input: ResolveSlotInput) => {\n nativeEvent.preventDefault()\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.dropEffect = nativeEvent.dataTransfer.types.includes(\n 'application/json',\n )\n ? 'move'\n : 'copy'\n }\n\n resolveLater(\n input,\n nativeEvent.clientY,\n nativeEvent.target instanceof Element ? nativeEvent.target : null,\n )\n },\n\n dragLeave: (nativeEvent: DragEvent, container: HTMLElement | null | undefined) => {\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !container?.contains(nativeEvent.relatedTarget)\n ) {\n reset()\n }\n },\n\n drop: (nativeEvent: DragEvent, input: ResolveSlotInput): ResolvedSlotDrop | undefined => {\n const slotIndex = resolveSlotIndex(\n input,\n nativeEvent.clientY,\n nativeEvent.target instanceof Element ? nativeEvent.target : null,\n )\n\n reset()\n\n const target = resolveTarget(input, slotIndex, nativeEvent.clientY)\n return target ? { slotIndex, target } : undefined\n },\n\n reset,\n }\n}\n","import { AnyDateValue, DayPositionedEventData, ScheduleEventData } from '../../../types'\nimport { getDayPosition, isAllDayEvent, isEventsOverlap, sortEvents } from '../../../utils'\n\ninterface ColumnHasConflictOptions {\n columns: ScheduleEventData[][]\n columnIndex: number\n event: ScheduleEventData\n allDay: boolean\n date: AnyDateValue\n}\n\nfunction columnHasConflict({\n columns,\n columnIndex,\n event,\n allDay,\n date,\n}: ColumnHasConflictOptions): boolean {\n if (!columns[columnIndex]) {\n return false\n }\n\n return columns[columnIndex].some((e) => {\n const eAllDay = isAllDayEvent({ event: e, date })\n const hasTimeConflict = isEventsOverlap(e, event)\n\n // Don't count all-day events as overlaps\n if (allDay || eAllDay) {\n return false\n }\n\n return hasTimeConflict\n })\n}\n\ninterface GetDayPositionedEventsInput {\n /** Date at which events are positioned, used to check if events are all-day */\n date: AnyDateValue\n\n /** List of all events that belong to the given date, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[]\n\n /** Start time of the day view, used to calculate event positions */\n startTime?: string\n\n /** End time of the day view, used to calculate event positions */\n endTime?: string\n\n /** Number of minutes per time slot, used to align the canvas to whole slots */\n intervalMinutes?: number\n}\n\nexport function getDayPositionedEvents({\n events,\n startTime,\n endTime,\n intervalMinutes,\n date,\n}: GetDayPositionedEventsInput) {\n const columns: ScheduleEventData[][] = []\n const positioned: DayPositionedEventData[] = []\n\n const sorted = sortEvents(events)\n\n for (const event of sorted) {\n const allDay = isAllDayEvent({ event, date })\n\n let column = 0\n\n while (columnHasConflict({ columns, columnIndex: column, event, allDay, date })) {\n column++\n }\n\n if (!columns[column]) {\n columns[column] = []\n }\n\n columns[column].push(event)\n\n const verticalPosition = allDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event, startTime, endTime, intervalMinutes })\n\n positioned.push({\n ...event,\n position: {\n ...verticalPosition,\n allDay,\n column,\n\n // set later\n width: 0,\n offset: 0,\n overlaps: 0,\n },\n })\n }\n for (const positionedEvent of positioned) {\n const { allDay, column } = positionedEvent.position\n\n if (allDay) {\n positionedEvent.position.overlaps = 1\n positionedEvent.position.width = 100\n positionedEvent.position.offset = 0\n continue\n }\n\n // Find events that directly overlap with this event\n const directlyOverlapping: DayPositionedEventData[] = []\n\n for (const otherEvent of positioned) {\n if (otherEvent === positionedEvent || otherEvent.position.allDay) {\n continue\n }\n\n if (isEventsOverlap(otherEvent, positionedEvent)) {\n directlyOverlapping.push(otherEvent)\n }\n }\n\n // Find the max column by also checking overlaps of overlapping events\n // This ensures we account for the full column group\n let maxColumn = column\n\n for (const overlappingEvent of directlyOverlapping) {\n maxColumn = Math.max(maxColumn, overlappingEvent.position.column)\n\n // Check what overlaps with each overlapping event\n for (const otherEvent of positioned) {\n if (otherEvent === overlappingEvent || otherEvent.position.allDay) {\n continue\n }\n\n if (isEventsOverlap(otherEvent, overlappingEvent)) {\n maxColumn = Math.max(maxColumn, otherEvent.position.column)\n }\n }\n }\n\n const totalColumns = maxColumn + 1\n\n // Find the first occupied column to the right of this event\n // Events expand to fill empty columns but stop at the next occupied column\n let nextOccupiedColumn = totalColumns\n\n for (const other of directlyOverlapping) {\n if (other.position.column > column && other.position.column < nextOccupiedColumn) {\n nextOccupiedColumn = other.position.column\n }\n }\n\n const columnsSpanned = nextOccupiedColumn - column\n\n positionedEvent.position.overlaps = totalColumns\n positionedEvent.position.width = (columnsSpanned / totalColumns) * 100\n positionedEvent.position.offset = (column * 100) / totalColumns\n }\n\n return positioned\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayPositionedEventData, ScheduleEventData } from '../../../types'\nimport { getDayPosition, isAllDayEvent, isEventInTimeRange, validateEvent } from '../../../utils'\nimport { getDayPositionedEvents } from './get-day-positioned-events'\n\ninterface GetDayViewEventsInput {\n events: ScheduleEventData[] | undefined\n date: AnyDateValue\n startTime?: string\n endTime?: string\n intervalMinutes?: number\n}\n\nexport function getDayViewEvents({\n events,\n date,\n startTime,\n endTime,\n intervalMinutes,\n}: GetDayViewEventsInput) {\n if (events === undefined) {\n return {\n allDayEvents: [],\n regularEvents: [],\n backgroundTimedEvents: [],\n backgroundAllDayEvents: [],\n }\n }\n\n const ids = new Set<string | number>()\n const filteredEvents: ScheduleEventData[] = []\n const backgroundFiltered: ScheduleEventData[] = []\n const dayStart = dayjs(date).startOf('day')\n const dayEnd = dayjs(date).endOf('day')\n\n for (const event of events) {\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n const isOnDay = eventStart.isSame(dayStart, 'day')\n const spansIntoDay =\n !isOnDay &&\n event.display === 'background' &&\n eventStart.isBefore(dayEnd) &&\n eventEnd.isAfter(dayStart)\n\n if (isOnDay || spansIntoDay) {\n if (isOnDay && !isEventInTimeRange({ event, startTime, endTime })) {\n continue\n }\n\n const validated = validateEvent(event)\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(`[@mantine/schedule] DayView: Duplicated event ids found: ${event.id}`)\n }\n\n if (event.display === 'background') {\n backgroundFiltered.push(validated)\n } else {\n filteredEvents.push(validated)\n }\n }\n }\n\n const positionedEvents = getDayPositionedEvents({\n events: filteredEvents,\n startTime,\n endTime,\n intervalMinutes,\n date,\n })\n\n const allDayEvents: DayPositionedEventData[] = []\n const regularEvents: DayPositionedEventData[] = []\n\n for (const event of positionedEvents) {\n if (event.position.allDay) {\n allDayEvents.push(event)\n } else {\n regularEvents.push(event)\n }\n }\n\n const backgroundTimedEvents: DayPositionedEventData[] = []\n const backgroundAllDayEvents: DayPositionedEventData[] = []\n for (const event of backgroundFiltered) {\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd\n\n const clippedEvent = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n }\n\n const allDay = isAllDayEvent({ event: clippedEvent, date })\n\n if (allDay) {\n backgroundAllDayEvents.push({\n ...event,\n position: {\n top: 0,\n height: 100,\n allDay: true,\n width: 100,\n offset: 0,\n column: 0,\n overlaps: 1,\n },\n })\n } else {\n const { top, height } = getDayPosition({\n event: clippedEvent,\n startTime,\n endTime,\n intervalMinutes,\n })\n if (height <= 0) {\n continue\n }\n backgroundTimedEvents.push({\n ...event,\n position: { top, height, allDay: false, width: 100, offset: 0, column: 0, overlaps: 1 },\n })\n }\n }\n\n return { allDayEvents, regularEvents, backgroundTimedEvents, backgroundAllDayEvents }\n}\n",".dayView {\n --slot-height: var(--day-view-slot-height, 64px); /* total height of 1 hour slot */\n --all-day-slot-height: var(--day-view-all-day-slot-height, 44px); /* height of all day slot */\n --day-view-slot-labels-width: 80px;\n --day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n @mixin where-light {\n --day-view-border-color: var(--mantine-color-gray-3);\n --day-view-business-hours-bg: var(--mantine-color-white);\n --day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --day-view-border-color: var(--mantine-color-dark-4);\n --day-view-business-hours-bg: var(--mantine-color-dark-7);\n --day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.dayViewScrollArea {\n border: 1px solid var(--day-view-border-color);\n border-radius: var(--day-view-radius);\n overflow: hidden;\n\n :where(:global(.mantine-ScrollArea-scrollbar)) {\n z-index: 4;\n }\n}\n\n.dayViewInner {\n display: flex;\n}\n\n.dayViewTimeSlots {\n position: relative;\n\n &:where(:first-of-type) .dayViewSlot:where([data-first]) {\n border-top-color: transparent;\n }\n}\n\n.dayViewSlotLabels {\n width: var(--day-view-slot-labels-width);\n}\n\n.dayViewSlotLabel {\n height: var(--slot-height);\n border-top: 1px solid var(--day-view-border-color);\n font-size: var(--mantine-font-size-sm);\n text-align: right;\n padding: 4px 8px;\n font-variant-numeric: tabular-nums;\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where(:first-of-type) {\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n}\n\n.dayViewSlots {\n flex: 1;\n}\n\n.dayViewSlot {\n display: block;\n width: 100%;\n border-top: 1px dotted var(--day-view-border-color);\n height: calc(var(--slot-height) * var(--slot-size));\n position: relative;\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-hour-start]) {\n border-top: 1px solid var(--day-view-border-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where([data-all-day]) {\n height: var(--all-day-slot-height);\n border-top: 0;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--day-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.dayViewBackgroundEvent {\n position: absolute;\n border-radius: 0;\n pointer-events: none;\n z-index: 2;\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n}\n\n.dayViewAllDay {\n position: relative;\n height: var(--all-day-slot-height);\n}\n\n.dayViewAllDayEvents {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n pointer-events: none;\n z-index: 3;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 15,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n slotHeight: 64,\n headerFormat: 'MMMM D, YYYY',\n withAllDaySlot: true,\n allDaySlotHeight: 44,\n maxAllDayEvents: 3,\n} as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotHeight, allDaySlotHeight }) => ({\n dayView: {\n '--day-view-radius': resolveScheduleRadius(radius),\n '--day-view-slot-height': cssSize(slotHeight),\n '--day-view-all-day-slot-height': cssSize(allDaySlotHeight),\n },\n }),\n)\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useEventResize } from '../../hooks/use-event-resize'\nimport { getLabel } from '../../labels'\nimport type { DateTimeStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getDayTimeIntervals,\n getVisibleEvents,\n toDateString,\n} from '../../utils'\nimport { CurrentTimeIndicator } from '../CurrentTimeIndicator'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n moveEventToAllDay,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { useSlotDropTarget } from '../use-slot-drop-target'\nimport { getDayViewEvents } from './get-day-view-events/get-day-view-events'\nimport type { DayViewEmits, DayViewOwnProps, DayViewSlots } from './DayView.types'\nimport classes from './DayView.module.css'\n\ndefineOptions({\n name: 'DayView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<DayViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n withInteractiveBackgroundEvents: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n eventDragInterval: undefined,\n eventResizeInterval: undefined,\n slotLabelFormat: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n slotHeight: undefined,\n businessHours: undefined,\n canDragEvent: undefined,\n startScrollTime: undefined,\n canResizeEvent: undefined,\n headerFormat: undefined,\n withAllDaySlot: undefined,\n allDaySlotHeight: undefined,\n maxAllDayEvents: undefined,\n moreEventsProps: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<DayViewSlots>()\n\nconst emit = defineEmits<DayViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('DayView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'DayView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'dayView',\n})\n\n/**\n * Cached per selector: the slot list re-renders on every step of a drag, and rebuilding the\n * same class list once per slot is what makes that re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst timeSlotsContainer = ref<HTMLElement | null>(null)\n\nconst slotDropTarget = useSlotDropTarget()\n\nconst date = computed(() => toDateString(props.date))\nconst datePart = computed(() => dayjs(date.value).format('YYYY-MM-DD'))\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? dayjs()))\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst showCurrentTimeIndicator = computed(\n () => props.withCurrentTimeIndicator ?? dayjs(date.value).isSame(now.value, 'day'),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n dayjs(date.value).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(date.value).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst dayEvents = computed(() =>\n getDayViewEvents({\n events: expandedEvents.value,\n date: date.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst hourStartIntervals = computed(() => intervals.value.filter((slot) => slot.isHourStart))\n\nconst allDayCounts = computed(() =>\n getVisibleEvents({\n maxEvents: props.maxAllDayEvents!,\n totalEvents: dayEvents.value.allDayEvents.length,\n }),\n)\n\nconst visibleAllDayEvents = computed(() =>\n dayEvents.value.allDayEvents.slice(0, allDayCounts.value.visibleEventsCount),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst eventResize = useEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n resizeIntervalMinutes: () => props.eventResizeInterval,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex) => {\n const startSlot = intervals.value[startIndex]\n const endSlot = intervals.value[endIndex]\n\n if (startSlot && endSlot) {\n emit(\n 'slotDragEnd',\n `${datePart.value} ${startSlot.startTime}` as DateTimeStringValue,\n `${datePart.value} ${endSlot.endTime}` as DateTimeStringValue,\n )\n }\n },\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = slotDropTarget.dropTarget.value\n return target\n ? {\n date: target.date,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n slotDropTarget.reset()\n emit('eventDragEnd')\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n const target = timeSlotsContainer.value?.querySelector<HTMLElement>(\n `[data-time-slot-index=\"${targetIndex}\"]`,\n )\n\n scrollSlotIntoView(target)\n})\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst emitDrop = (nativeEvent: DragEvent, target: DateTimeStringValue) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventTo(event, target))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, target)\n }\n}\n\nconst emitAllDayDrop = (nativeEvent: DragEvent) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventToAllDay(event, datePart.value))\n } else if (nativeEvent.dataTransfer) {\n emit(\n 'externalEventDrop',\n nativeEvent.dataTransfer,\n `${datePart.value} 00:00:00` as DateTimeStringValue,\n )\n }\n}\n\nconst clickAllDaySlot = (nativeEvent: MouseEvent) =>\n emit('allDaySlotClick', date.value, nativeEvent)\n\nconst clickTimeSlot = (slotIndex: number, nativeEvent: MouseEvent) => {\n const slot = intervals.value[slotIndex]\n const start = dayjs(`${datePart.value} ${slot.startTime}`)\n emit('timeSlotClick', {\n slotStart: start.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n slotEnd: start\n .add(props.intervalMinutes!, 'minute')\n .format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n nativeEvent,\n })\n}\n\nconst dropInput = () => ({\n container: timeSlotsContainer.value,\n date: datePart.value,\n intervals: intervals.value,\n intervalMinutes: props.intervalMinutes,\n dragIntervalMinutes: props.eventDragInterval,\n startTime: props.startTime,\n endTime: props.endTime,\n})\n\nconst handleGridDragOver = (nativeEvent: DragEvent) =>\n slotDropTarget.dragOver(nativeEvent, dropInput())\n\nconst handleGridDragLeave = (nativeEvent: DragEvent) =>\n slotDropTarget.dragLeave(nativeEvent, timeSlotsContainer.value)\n\nconst handleGridDrop = (nativeEvent: DragEvent) => {\n const target = slotDropTarget.drop(nativeEvent, dropInput())\n\n if (target) {\n emitDrop(nativeEvent, target.target)\n }\n}\n\nconst handleSlotKeydown = (nativeEvent: KeyboardEvent, index: number) => {\n const nextIndex =\n nativeEvent.key === 'ArrowDown' ? index + 1 : nativeEvent.key === 'ArrowUp' ? index - 1 : -1\n\n if (nextIndex < 0 || nextIndex >= intervals.value.length) {\n return\n }\n\n nativeEvent.preventDefault()\n timeSlotsContainer.value\n ?.querySelector<HTMLButtonElement>(`[data-time-slot-index=\"${nextIndex}\"]`)\n ?.focus()\n}\n\nconst businessHoursMods = computed(() =>\n intervals.value.map((slot) =>\n props.highlightBusinessHours\n ? getBusinessHoursMod({\n time: slot.startTime,\n businessHours: props.businessHours || ['09:00:00', '17:00:00'],\n highlightBusinessHours: true,\n dayOfWeek: dayjs(`${datePart.value} ${slot.startTime}`).day() as DayOfWeek,\n })\n : { 'business-hours': false, 'non-business-hours': false },\n ),\n)\n\nconst backgroundEventStyle = (position: { top: number; height: number }) => ({\n top: `${position.top}%`,\n bottom: `${100 - position.top - position.height}%`,\n minHeight: '1px',\n})\n\nconst regularEventStyle = (event: ScheduleEventData & { position: any }) => {\n const resizePosition = eventResize.getResizePosition(event.id)\n const top = resizePosition?.top ?? event.position.top\n const height = resizePosition?.height ?? event.position.height\n\n return {\n position: 'absolute' as const,\n top: `${top}%`,\n bottom: `${100 - top - height}%`,\n minHeight: '1px',\n width: `${event.position.width}%`,\n insetInlineStart: `${event.position.offset}%`,\n }\n}\n\nconst startEventResize = (\n event: ScheduleEventData & { position: any },\n edge: 'top' | 'bottom',\n pointerEvent: PointerEvent,\n) => {\n if (!timeSlotsContainer.value) {\n return\n }\n\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainer.value,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: datePart.value,\n pointerEvent,\n })\n}\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickResizableEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!eventResize.wasResizing()) {\n clickEvent(event, nativeEvent)\n }\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('dayView') }\"\n :mod=\"[{ static: isStatic, 'slot-dragging': slotDragSelect.isDragging() }, (attrs as any).mod]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"day\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(date, 'day')\"\n :control=\"{\n title: formatDate({ date, locale: props.locale || 'en', format: props.headerFormat! }),\n }\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"emit('dateChange', $event)\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <ScrollArea.Autosize\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('dayViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <Box v-bind=\"getStyles('dayViewInner')\">\n <div v-bind=\"getStyles('dayViewSlotLabels')\">\n <Box\n v-if=\"props.withAllDaySlot\"\n v-bind=\"getStyles('dayViewSlotLabel')\"\n :mod=\"{ 'all-day': true }\"\n >\n {{ getLabel('allDay', props.labels) }}\n </Box>\n <Box\n v-for=\"slot in hourStartIntervals\"\n :key=\"slot.startTime\"\n v-bind=\"staticStyles('dayViewSlotLabel')\"\n >\n {{\n formatDate({\n date: `${datePart} ${slot.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </Box>\n </div>\n\n <div v-bind=\"getStyles('dayViewSlots')\">\n <div v-if=\"props.withAllDaySlot\" v-bind=\"getStyles('dayViewAllDay')\">\n <ScheduleBackgroundEvent\n v-for=\"event in dayEvents.backgroundAllDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...staticStyles('dayViewBackgroundEvent') }\"\n :style=\"{ top: 0, height: '100%', width: '100%' }\"\n @event-click=\"clickEvent\"\n />\n\n <div v-bind=\"getStyles('dayViewAllDayEvents')\">\n <ScheduleEvent\n v-for=\"event in visibleAllDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n nowrap\n :mode=\"props.mode\"\n :draggable=\"\n !isStatic &&\n props.withEventsDragAndDrop === true &&\n (props.canDragEvent?.(event) ?? true)\n \"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(event, $event)\"\n />\n\n <MoreEvents\n v-if=\"allDayCounts.hiddenEventsCount > 0\"\n :events=\"dayEvents.allDayEvents\"\n :more-events-count=\"allDayCounts.hiddenEventsCount\"\n :labels=\"props.labels\"\n :mode=\"props.mode\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"clickEvent\"\n />\n </div>\n\n <UnstyledButton\n v-bind=\"getStyles('dayViewSlot')\"\n :mod=\"{ 'all-day': true, static: isStatic }\"\n :tabindex=\"isStatic ? -1 : 0\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${getLabel('allDay', props.labels)}`\"\n @click=\"isStatic ? undefined : clickAllDaySlot($event)\"\n @dragover.prevent\n @drop=\"emitAllDayDrop\"\n />\n </div>\n\n <div\n ref=\"timeSlotsContainer\"\n v-bind=\"getStyles('dayViewTimeSlots')\"\n @dragover=\"withDragHandlers ? handleGridDragOver($event) : undefined\"\n @dragleave=\"withDragHandlers ? handleGridDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleGridDrop($event) : undefined\"\n >\n <ScheduleBackgroundEvent\n v-for=\"event in dayEvents.backgroundTimedEvents\"\n :key=\"event.id\"\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...staticStyles('dayViewBackgroundEvent') }\"\n :style=\"backgroundEventStyle(event.position)\"\n @event-click=\"clickEvent\"\n />\n\n <ScheduleEvent\n v-for=\"event in dayEvents.regularEvents\"\n :key=\"event.id\"\n :event=\"event\"\n auto-size\n :mode=\"props.mode\"\n :style=\"regularEventStyle(event)\"\n :draggable=\"\n !isStatic &&\n props.withEventsDragAndDrop === true &&\n (props.canDragEvent?.(event) ?? true)\n \"\n :with-resize=\"eventResize.isResizableEvent(event)\"\n :is-resizing=\"eventResize.getResizePosition(event.id) !== null\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickResizableEvent(event, $event)\"\n @resize-start=\"(edge, pointerEvent) => startEventResize(event, edge, pointerEvent)\"\n />\n\n <CurrentTimeIndicator\n v-if=\"showCurrentTimeIndicator\"\n start-offset=\"calc(var(--day-view-slot-labels-width) * -1)\"\n end-offset=\"0rem\"\n top-offset=\"0rem\"\n time-bubble-start-offset=\"calc(var(--day-view-slot-labels-width) * -1 + 30px)\"\n :current-time-format=\"props.slotLabelFormat\"\n :start-time=\"props.startTime\"\n :end-time=\"props.endTime\"\n :interval-minutes=\"props.intervalMinutes\"\n :with-time-bubble=\"props.withCurrentTimeBubble\"\n :with-thumb=\"!props.withCurrentTimeBubble\"\n :get-current-time=\"props.getCurrentTime\"\n :locale=\"props.locale\"\n v-bind=\"stylesApi\"\n />\n\n <UnstyledButton\n v-for=\"(slot, index) in intervals\"\n :key=\"slot.startTime\"\n v-bind=\"staticStyles('dayViewSlot')\"\n :data-time-slot-index=\"index\"\n :data-drag-slot-index=\"withSlotSelect ? index : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? datePart : undefined\"\n :style=\"{ '--slot-size': String(props.intervalMinutes! / 60) }\"\n :mod=\"{\n first: index === 0,\n 'hour-start': slot.isHourStart,\n static: isStatic,\n 'drop-target': slotDropTarget.isTarget(datePart, index),\n 'drag-selected': slotDragSelect.isSlotSelected(index, datePart),\n 'business-hours': businessHoursMods[index]['business-hours'],\n 'non-business-hours': businessHoursMods[index]['non-business-hours'],\n }\"\n :tabindex=\"isStatic ? -1 : index === 0 ? 0 : -1\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${slot.startTime} - ${slot.endTime}`\"\n @keydown=\"isStatic ? undefined : handleSlotKeydown($event, index)\"\n @click=\"clickTimeSlot(index, $event)\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown($event, index, datePart)\n : undefined\n \"\n @dragover.prevent\n />\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 15,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n slotHeight: 64,\n headerFormat: 'MMMM D, YYYY',\n withAllDaySlot: true,\n allDaySlotHeight: 44,\n maxAllDayEvents: 3,\n} as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotHeight, allDaySlotHeight }) => ({\n dayView: {\n '--day-view-radius': resolveScheduleRadius(radius),\n '--day-view-slot-height': cssSize(slotHeight),\n '--day-view-all-day-slot-height': cssSize(allDaySlotHeight),\n },\n }),\n)\n\nexport { defaultProps, varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useEventResize } from '../../hooks/use-event-resize'\nimport { getLabel } from '../../labels'\nimport type { DateTimeStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getDayTimeIntervals,\n getVisibleEvents,\n toDateString,\n} from '../../utils'\nimport { CurrentTimeIndicator } from '../CurrentTimeIndicator'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n moveEventToAllDay,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { useSlotDropTarget } from '../use-slot-drop-target'\nimport { getDayViewEvents } from './get-day-view-events/get-day-view-events'\nimport type { DayViewEmits, DayViewOwnProps, DayViewSlots } from './DayView.types'\nimport classes from './DayView.module.css'\n\ndefineOptions({\n name: 'DayView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<DayViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n withInteractiveBackgroundEvents: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n eventDragInterval: undefined,\n eventResizeInterval: undefined,\n slotLabelFormat: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n slotHeight: undefined,\n businessHours: undefined,\n canDragEvent: undefined,\n startScrollTime: undefined,\n canResizeEvent: undefined,\n headerFormat: undefined,\n withAllDaySlot: undefined,\n allDaySlotHeight: undefined,\n maxAllDayEvents: undefined,\n moreEventsProps: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<DayViewSlots>()\n\nconst emit = defineEmits<DayViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('DayView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'DayView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'dayView',\n})\n\n/**\n * Cached per selector: the slot list re-renders on every step of a drag, and rebuilding the\n * same class list once per slot is what makes that re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst timeSlotsContainer = ref<HTMLElement | null>(null)\n\nconst slotDropTarget = useSlotDropTarget()\n\nconst date = computed(() => toDateString(props.date))\nconst datePart = computed(() => dayjs(date.value).format('YYYY-MM-DD'))\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? dayjs()))\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst showCurrentTimeIndicator = computed(\n () => props.withCurrentTimeIndicator ?? dayjs(date.value).isSame(now.value, 'day'),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n dayjs(date.value).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(date.value).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst dayEvents = computed(() =>\n getDayViewEvents({\n events: expandedEvents.value,\n date: date.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst hourStartIntervals = computed(() => intervals.value.filter((slot) => slot.isHourStart))\n\nconst allDayCounts = computed(() =>\n getVisibleEvents({\n maxEvents: props.maxAllDayEvents!,\n totalEvents: dayEvents.value.allDayEvents.length,\n }),\n)\n\nconst visibleAllDayEvents = computed(() =>\n dayEvents.value.allDayEvents.slice(0, allDayCounts.value.visibleEventsCount),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst eventResize = useEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n resizeIntervalMinutes: () => props.eventResizeInterval,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex) => {\n const startSlot = intervals.value[startIndex]\n const endSlot = intervals.value[endIndex]\n\n if (startSlot && endSlot) {\n emit(\n 'slotDragEnd',\n `${datePart.value} ${startSlot.startTime}` as DateTimeStringValue,\n `${datePart.value} ${endSlot.endTime}` as DateTimeStringValue,\n )\n }\n },\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = slotDropTarget.dropTarget.value\n return target\n ? {\n date: target.date,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n slotDropTarget.reset()\n emit('eventDragEnd')\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n const target = timeSlotsContainer.value?.querySelector<HTMLElement>(\n `[data-time-slot-index=\"${targetIndex}\"]`,\n )\n\n scrollSlotIntoView(target)\n})\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst emitDrop = (nativeEvent: DragEvent, target: DateTimeStringValue) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventTo(event, target))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, target)\n }\n}\n\nconst emitAllDayDrop = (nativeEvent: DragEvent) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventToAllDay(event, datePart.value))\n } else if (nativeEvent.dataTransfer) {\n emit(\n 'externalEventDrop',\n nativeEvent.dataTransfer,\n `${datePart.value} 00:00:00` as DateTimeStringValue,\n )\n }\n}\n\nconst clickAllDaySlot = (nativeEvent: MouseEvent) =>\n emit('allDaySlotClick', date.value, nativeEvent)\n\nconst clickTimeSlot = (slotIndex: number, nativeEvent: MouseEvent) => {\n const slot = intervals.value[slotIndex]\n const start = dayjs(`${datePart.value} ${slot.startTime}`)\n emit('timeSlotClick', {\n slotStart: start.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n slotEnd: start\n .add(props.intervalMinutes!, 'minute')\n .format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n nativeEvent,\n })\n}\n\nconst dropInput = () => ({\n container: timeSlotsContainer.value,\n date: datePart.value,\n intervals: intervals.value,\n intervalMinutes: props.intervalMinutes,\n dragIntervalMinutes: props.eventDragInterval,\n startTime: props.startTime,\n endTime: props.endTime,\n})\n\nconst handleGridDragOver = (nativeEvent: DragEvent) =>\n slotDropTarget.dragOver(nativeEvent, dropInput())\n\nconst handleGridDragLeave = (nativeEvent: DragEvent) =>\n slotDropTarget.dragLeave(nativeEvent, timeSlotsContainer.value)\n\nconst handleGridDrop = (nativeEvent: DragEvent) => {\n const target = slotDropTarget.drop(nativeEvent, dropInput())\n\n if (target) {\n emitDrop(nativeEvent, target.target)\n }\n}\n\nconst handleSlotKeydown = (nativeEvent: KeyboardEvent, index: number) => {\n const nextIndex =\n nativeEvent.key === 'ArrowDown' ? index + 1 : nativeEvent.key === 'ArrowUp' ? index - 1 : -1\n\n if (nextIndex < 0 || nextIndex >= intervals.value.length) {\n return\n }\n\n nativeEvent.preventDefault()\n timeSlotsContainer.value\n ?.querySelector<HTMLButtonElement>(`[data-time-slot-index=\"${nextIndex}\"]`)\n ?.focus()\n}\n\nconst businessHoursMods = computed(() =>\n intervals.value.map((slot) =>\n props.highlightBusinessHours\n ? getBusinessHoursMod({\n time: slot.startTime,\n businessHours: props.businessHours || ['09:00:00', '17:00:00'],\n highlightBusinessHours: true,\n dayOfWeek: dayjs(`${datePart.value} ${slot.startTime}`).day() as DayOfWeek,\n })\n : { 'business-hours': false, 'non-business-hours': false },\n ),\n)\n\nconst backgroundEventStyle = (position: { top: number; height: number }) => ({\n top: `${position.top}%`,\n bottom: `${100 - position.top - position.height}%`,\n minHeight: '1px',\n})\n\nconst regularEventStyle = (event: ScheduleEventData & { position: any }) => {\n const resizePosition = eventResize.getResizePosition(event.id)\n const top = resizePosition?.top ?? event.position.top\n const height = resizePosition?.height ?? event.position.height\n\n return {\n position: 'absolute' as const,\n top: `${top}%`,\n bottom: `${100 - top - height}%`,\n minHeight: '1px',\n width: `${event.position.width}%`,\n insetInlineStart: `${event.position.offset}%`,\n }\n}\n\nconst startEventResize = (\n event: ScheduleEventData & { position: any },\n edge: 'top' | 'bottom',\n pointerEvent: PointerEvent,\n) => {\n if (!timeSlotsContainer.value) {\n return\n }\n\n eventResize.handleResizeStart({\n event,\n edge,\n container: timeSlotsContainer.value,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: datePart.value,\n pointerEvent,\n })\n}\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickResizableEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!eventResize.wasResizing()) {\n clickEvent(event, nativeEvent)\n }\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('dayView') }\"\n :mod=\"[{ static: isStatic, 'slot-dragging': slotDragSelect.isDragging() }, (attrs as any).mod]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"day\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(date, 'day')\"\n :control=\"{\n title: formatDate({ date, locale: props.locale || 'en', format: props.headerFormat! }),\n }\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"emit('dateChange', $event)\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <ScrollArea.Autosize\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('dayViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <Box v-bind=\"getStyles('dayViewInner')\">\n <div v-bind=\"getStyles('dayViewSlotLabels')\">\n <Box\n v-if=\"props.withAllDaySlot\"\n v-bind=\"getStyles('dayViewSlotLabel')\"\n :mod=\"{ 'all-day': true }\"\n >\n {{ getLabel('allDay', props.labels) }}\n </Box>\n <Box\n v-for=\"slot in hourStartIntervals\"\n :key=\"slot.startTime\"\n v-bind=\"staticStyles('dayViewSlotLabel')\"\n >\n {{\n formatDate({\n date: `${datePart} ${slot.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </Box>\n </div>\n\n <div v-bind=\"getStyles('dayViewSlots')\">\n <div v-if=\"props.withAllDaySlot\" v-bind=\"getStyles('dayViewAllDay')\">\n <ScheduleBackgroundEvent\n v-for=\"event in dayEvents.backgroundAllDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...staticStyles('dayViewBackgroundEvent') }\"\n :style=\"{ top: 0, height: '100%', width: '100%' }\"\n @event-click=\"clickEvent\"\n />\n\n <div v-bind=\"getStyles('dayViewAllDayEvents')\">\n <ScheduleEvent\n v-for=\"event in visibleAllDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n nowrap\n :mode=\"props.mode\"\n :draggable=\"\n !isStatic &&\n props.withEventsDragAndDrop === true &&\n (props.canDragEvent?.(event) ?? true)\n \"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(event, $event)\"\n />\n\n <MoreEvents\n v-if=\"allDayCounts.hiddenEventsCount > 0\"\n :events=\"dayEvents.allDayEvents\"\n :more-events-count=\"allDayCounts.hiddenEventsCount\"\n :labels=\"props.labels\"\n :mode=\"props.mode\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"clickEvent\"\n />\n </div>\n\n <UnstyledButton\n v-bind=\"getStyles('dayViewSlot')\"\n :mod=\"{ 'all-day': true, static: isStatic }\"\n :tabindex=\"isStatic ? -1 : 0\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${getLabel('allDay', props.labels)}`\"\n @click=\"isStatic ? undefined : clickAllDaySlot($event)\"\n @dragover.prevent\n @drop=\"emitAllDayDrop\"\n />\n </div>\n\n <div\n ref=\"timeSlotsContainer\"\n v-bind=\"getStyles('dayViewTimeSlots')\"\n @dragover=\"withDragHandlers ? handleGridDragOver($event) : undefined\"\n @dragleave=\"withDragHandlers ? handleGridDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleGridDrop($event) : undefined\"\n >\n <ScheduleBackgroundEvent\n v-for=\"event in dayEvents.backgroundTimedEvents\"\n :key=\"event.id\"\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...staticStyles('dayViewBackgroundEvent') }\"\n :style=\"backgroundEventStyle(event.position)\"\n @event-click=\"clickEvent\"\n />\n\n <ScheduleEvent\n v-for=\"event in dayEvents.regularEvents\"\n :key=\"event.id\"\n :event=\"event\"\n auto-size\n :mode=\"props.mode\"\n :style=\"regularEventStyle(event)\"\n :draggable=\"\n !isStatic &&\n props.withEventsDragAndDrop === true &&\n (props.canDragEvent?.(event) ?? true)\n \"\n :with-resize=\"eventResize.isResizableEvent(event)\"\n :is-resizing=\"eventResize.getResizePosition(event.id) !== null\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickResizableEvent(event, $event)\"\n @resize-start=\"(edge, pointerEvent) => startEventResize(event, edge, pointerEvent)\"\n />\n\n <CurrentTimeIndicator\n v-if=\"showCurrentTimeIndicator\"\n start-offset=\"calc(var(--day-view-slot-labels-width) * -1)\"\n end-offset=\"0rem\"\n top-offset=\"0rem\"\n time-bubble-start-offset=\"calc(var(--day-view-slot-labels-width) * -1 + 30px)\"\n :current-time-format=\"props.slotLabelFormat\"\n :start-time=\"props.startTime\"\n :end-time=\"props.endTime\"\n :interval-minutes=\"props.intervalMinutes\"\n :with-time-bubble=\"props.withCurrentTimeBubble\"\n :with-thumb=\"!props.withCurrentTimeBubble\"\n :get-current-time=\"props.getCurrentTime\"\n :locale=\"props.locale\"\n v-bind=\"stylesApi\"\n />\n\n <UnstyledButton\n v-for=\"(slot, index) in intervals\"\n :key=\"slot.startTime\"\n v-bind=\"staticStyles('dayViewSlot')\"\n :data-time-slot-index=\"index\"\n :data-drag-slot-index=\"withSlotSelect ? index : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? datePart : undefined\"\n :style=\"{ '--slot-size': String(props.intervalMinutes! / 60) }\"\n :mod=\"{\n first: index === 0,\n 'hour-start': slot.isHourStart,\n static: isStatic,\n 'drop-target': slotDropTarget.isTarget(datePart, index),\n 'drag-selected': slotDragSelect.isSlotSelected(index, datePart),\n 'business-hours': businessHoursMods[index]['business-hours'],\n 'non-business-hours': businessHoursMods[index]['non-business-hours'],\n }\"\n :tabindex=\"isStatic ? -1 : index === 0 ? 0 : -1\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${slot.startTime} - ${slot.endTime}`\"\n @keydown=\"isStatic ? undefined : handleSlotKeydown($event, index)\"\n @click=\"clickTimeSlot(index, $event)\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown($event, index, datePart)\n : undefined\n \"\n @dragover.prevent\n />\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport DayViewComponent, { varsResolver } from './DayView.vue'\nimport type { DayViewFactory } from './DayView.types'\nimport classes from './DayView.module.css'\n\nexport const DayView = factory<DayViewFactory>(DayViewComponent, { classes, varsResolver })\n\nexport type {\n DayViewCssVariables,\n DayViewEmits,\n DayViewFactory,\n DayViewOwnProps,\n DayViewOwnStylesNames,\n DayViewProps,\n DayViewSlots,\n DayViewStylesNames,\n} from './DayView.types'\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, ScheduleEventData } from '../../types'\nimport { isMultidayEvent, validateEvent } from '../../utils'\n\nexport type GroupedEvents = Record<DateStringValue, ScheduleEventData[]>\n\nfunction groupEventByDate(event: ScheduleEventData, groupedEvents: GroupedEvents) {\n if (isMultidayEvent(event)) {\n const startDate = dayjs(event.start).startOf('day')\n const endDate = dayjs(event.end).startOf('day')\n\n for (\n let date = startDate;\n date.isBefore(endDate) || date.isSame(endDate);\n date = date.add(1, 'day')\n ) {\n const dateKey = date.format('YYYY-MM-DD')\n if (!groupedEvents[dateKey]) {\n groupedEvents[dateKey] = []\n }\n groupedEvents[dateKey].push(event)\n }\n\n return\n }\n\n const eventDate = dayjs(event.start).format('YYYY-MM-DD')\n if (!groupedEvents[eventDate]) {\n groupedEvents[eventDate] = []\n }\n groupedEvents[eventDate].push(event)\n}\n\ninterface GetMobileMonthViewEventsInput {\n date: AnyDateValue\n events: ScheduleEventData[] | undefined\n}\n\nexport function getMobileMonthViewEvents({ date, events }: GetMobileMonthViewEventsInput) {\n const groupedEvents: GroupedEvents = {}\n\n if (events === undefined) {\n return groupedEvents\n }\n\n const ids = new Set<string | number>()\n\n for (const event of events) {\n if (event.display === 'background') {\n continue\n }\n\n if (dayjs(event.start).isSame(dayjs(date), 'month')) {\n groupEventByDate(validateEvent(event), groupedEvents)\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(\n `[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}`,\n )\n }\n }\n }\n\n return groupedEvents\n}\n",".mobileMonthView {\n --mobile-month-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --week-numbers-offset: 0rem;\n --day-base-color: var(--mantine-color-text);\n --day-dimmed-color: alpha(var(--day-base-color), 0.5);\n\n display: flex;\n flex-direction: column;\n height: 100%;\n\n @mixin where-light {\n --mobile-month-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --mobile-month-view-border-color: var(--mantine-color-dark-4);\n }\n\n &:where([data-with-week-numbers]) {\n --week-numbers-offset: 32px;\n }\n}\n\n.mobileMonthViewHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--mantine-spacing-sm);\n border-bottom: 1px solid var(--mobile-month-view-border-color);\n}\n\n.mobileMonthViewHeaderBackButton {\n display: flex;\n align-items: center;\n gap: 4px;\n font-weight: var(--mantine-font-weight-medium);\n cursor: pointer;\n user-select: none;\n font-size: var(--mobile-month-view-font-size);\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.mobileMonthViewHeaderLabel {\n user-select: none;\n font-weight: var(--mantine-font-weight-semibold);\n text-transform: capitalize;\n}\n\n.mobileMonthViewCalendar {\n --mobile-month-view-font-size: clamp(6px, 3.5cqw, 22px);\n\n container-type: inline-size;\n padding: var(--mantine-spacing-sm);\n border-bottom: 1px solid var(--mobile-month-view-border-color);\n}\n\n.mobileMonthViewWeekdays {\n display: flex;\n margin-bottom: var(--mantine-spacing-xs);\n}\n\n.mobileMonthViewWeekdaysCorner {\n flex: 0 0 var(--week-numbers-offset);\n}\n\n.mobileMonthViewWeekday {\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n font-size: var(--mobile-month-view-font-size);\n font-weight: var(--mantine-font-weight-medium);\n text-align: center;\n text-transform: capitalize;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n user-select: none;\n color: var(--day-dimmed-color);\n padding-block: 4px;\n}\n\n.mobileMonthViewWeek {\n display: flex;\n}\n\n.mobileMonthViewWeekNumber {\n flex: 0 0 calc(var(--week-numbers-offset) - rem(4px));\n margin-inline-end: rem(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n border-radius: var(--mobile-month-view-radius);\n padding: 4px;\n font-weight: var(--mantine-font-weight-medium);\n cursor: pointer;\n user-select: none;\n color: var(--day-dimmed-color);\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.mobileMonthViewDay {\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n height: 48px;\n padding: 4px;\n font-weight: var(--mantine-font-weight-medium);\n font-size: var(--mobile-month-view-font-size);\n color: var(--day-base-color);\n cursor: pointer;\n user-select: none;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n z-index: 0;\n\n &::before {\n width: 32px;\n height: 32px;\n border-radius: 100%;\n content: '';\n position: absolute;\n top: 7px;\n left: calc(50% - 16px);\n z-index: -1;\n pointer-events: none;\n }\n\n &:focus {\n z-index: 1;\n }\n\n &:where([data-hidden]) {\n visibility: hidden;\n pointer-events: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-outside]) {\n color: var(--day-dimmed-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-today]:not([data-selected])) {\n @mixin where-light {\n &::before {\n background-color: var(--mantine-color-gray-2);\n }\n }\n\n @mixin where-dark {\n &::before {\n background-color: var(--mantine-color-dark-5);\n }\n }\n }\n\n &:where([data-selected]) {\n color: var(--mantine-primary-color-contrast);\n\n &::before {\n background-color: var(--mantine-primary-color-filled);\n }\n\n @mixin hover {\n &::before {\n background-color: var(--mantine-primary-color-filled-hover);\n }\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.mobileMonthViewDayIndicators {\n position: absolute;\n bottom: 2px;\n inset-inline: 0;\n display: flex;\n justify-content: center;\n padding-inline-start: 2px;\n}\n\n.mobileMonthViewDayIndicator {\n width: 5px;\n height: 5px;\n border-radius: 100%;\n margin-inline-start: -1px;\n}\n\n.mobileMonthViewEventsList {\n flex: 1;\n display: flex;\n flex-direction: column;\n min-height: 0;\n padding: var(--mantine-spacing-sm);\n}\n\n.mobileMonthViewEventsHeader {\n margin-bottom: var(--mantine-spacing-sm);\n font-weight: var(--mantine-font-weight-semibold);\n text-transform: capitalize;\n}\n\n.mobileMonthViewEvent {\n display: block;\n width: 100%;\n text-align: start;\n cursor: pointer;\n\n &:where(:not(:last-child)) {\n border-bottom: 1px solid var(--mobile-month-view-border-color);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n}\n\n.mobileMonthViewEventBody {\n display: flex;\n gap: var(--mantine-spacing-sm);\n padding: var(--mantine-spacing-xs) 0;\n}\n\n.mobileMonthViewEventColor {\n width: 4px;\n border-radius: 2px;\n flex-shrink: 0;\n}\n\n.mobileMonthViewEventTime {\n margin-top: 2px;\n font-size: var(--mantine-font-size-xs);\n color: var(--mantine-color-dimmed);\n}\n\n.mobileMonthViewNoEvents {\n color: var(--mantine-color-dimmed);\n text-align: center;\n padding-block: var(--mantine-spacing-xl);\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { MobileMonthViewOwnProps } from './MobileMonthView.types'\n\nconst defaultProps = {\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n withHeader: true,\n withWeekDays: true,\n firstDayOfWeek: 1,\n weekdayFormat: 'dd',\n weekendDays: [0, 6],\n consistentWeeks: true,\n highlightToday: true,\n eventsHeaderFormat: 'dddd, MMMM D',\n} satisfies Partial<MobileMonthViewOwnProps>\n\nconst MAX_DAY_INDICATORS = 3\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n mobileMonthView: {\n '--mobile-month-view-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver, MAX_DAY_INDICATORS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, h, useAttrs, useSlots, type VNodeChild } from 'vue'\nimport {\n AccordionChevron,\n Box,\n getThemeColor,\n Text,\n UnstyledButton,\n useDirection,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport { getLabel } from '../../labels'\nimport type { DateStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport { formatDate, getMonthDays, getWeekNumber, getWeekdaysNames } from '../../utils'\nimport { getExpandedEvents } from '../shared'\nimport { getMobileMonthViewEvents } from './get-mobile-month-view-events'\nimport type { MobileMonthViewEmits, MobileMonthViewSlots } from './MobileMonthView.types'\nimport classes from './MobileMonthView.module.css'\n\ndefineOptions({\n name: 'MobileMonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MobileMonthViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n selectedDate: undefined,\n defaultSelectedDate: undefined,\n withWeekDays: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n getWeekNumberProps: undefined,\n getDayProps: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n eventsHeaderFormat: undefined,\n renderHeader: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MobileMonthViewSlots>()\n\nconst emit = defineEmits<MobileMonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('MobileMonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MobileMonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'mobileMonthView',\n})\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst toDayKey = (value: Date | DateStringValue | null | undefined) =>\n value ? (dayjs(value).format('YYYY-MM-DD') as DateStringValue) : null\n\nconst [selected, setSelected] = useUncontrolled<DateStringValue | null>({\n // `null` is a meaningful selection (nothing selected), so only `undefined` means uncontrolled.\n value: () => (props.selectedDate === undefined ? undefined : toDayKey(props.selectedDate)),\n defaultValue: dayjs(props.defaultSelectedDate ?? undefined).format(\n 'YYYY-MM-DD',\n ) as DateStringValue,\n finalValue: null,\n onChange: (value) => {\n emit('update:selectedDate', value)\n emit('selectedDateChange', value)\n },\n})\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\n\nconst weeks = computed(() =>\n getMonthDays({\n month: month.value,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n weeks.value[0][0],\n dayjs(weeks.value.at(-1)!.at(-1)!).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst eventsByDay = computed(() =>\n getMobileMonthViewEvents({ date: month.value, events: expandedEvents.value }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\nconst selectedEvents = computed(() =>\n selected.value ? eventsByDay.value[selected.value] || [] : [],\n)\n\nconst dayProps = (date: string | Date) => props.getDayProps?.(toDayKey(date)!) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDayKey(weekStart)!) ?? {}\n\nconst isOutside = (date: string | Date) => !dayjs(date).isSame(month.value, 'month')\n\n/** Outside days keep their cell so the grid stays aligned, but render nothing. */\nconst isRendered = (date: string | Date) => !isOutside(date) || Boolean(props.withOutsideDays)\n\nconst dayIndicators = (date: string | Date) =>\n (eventsByDay.value[toDayKey(date)!] || []).slice(0, MAX_DAY_INDICATORS)\n\nconst indicatorStyle = (event: ScheduleEventData) => ({\n background: `var(--mantine-color-${event.color}-6, ${event.color})`,\n})\n\nconst selectDay = (date: string | Date, nativeEvent: MouseEvent) => {\n const value = toDayKey(date)!\n setSelected(value)\n emit('dayClick', value, nativeEvent)\n}\n\nconst isAllDayEvent = (event: ScheduleEventData) =>\n dayjs(event.start).format('HH:mm') === '00:00' && dayjs(event.end).format('HH:mm') === '00:00'\n\nconst eventTimeLabel = (event: ScheduleEventData) =>\n isAllDayEvent(event)\n ? getLabel('allDay', props.labels)\n : `${dayjs(event.start).format('HH:mm')} – ${dayjs(event.end).format('HH:mm')}`\n\n/**\n * Default header as a functional component, so the template and the `renderHeader` payload\n * share one definition instead of building the tree twice.\n */\nconst DefaultHeader = () => [\n h(\n UnstyledButton,\n {\n ...getStyles('mobileMonthViewHeaderBackButton'),\n mod: { static: isStatic.value },\n tabindex: isStatic.value ? -1 : 0,\n onClick: isStatic.value ? undefined : () => emit('yearClick'),\n },\n () => [\n h(AccordionChevron, {\n size: 20,\n style: { transform: `rotate(${dir.value === 'rtl' ? -90 : 90}deg)` },\n }),\n month.value.format('YYYY'),\n ],\n ),\n h(Text, getStyles('mobileMonthViewHeaderLabel'), () =>\n formatDate({ date: month.value, locale: props.locale || 'en', format: 'MMMM YYYY' }),\n ),\n]\n\nconst headerPayload = computed(() => ({\n mode: props.mode!,\n date: props.date,\n defaultHeader: h(DefaultHeader) as VNodeChild,\n}))\n\nconst customHeader = computed<VNodeChild>(() => {\n if (!slots.header && !props.renderHeader) {\n return null\n }\n\n return slots.header?.(headerPayload.value) ?? props.renderHeader?.(headerPayload.value) ?? null\n})\n\nconst renderHeaderContent = () => customHeader.value ?? h(DefaultHeader)\n\nconst listEventProps = (event: ScheduleEventData) => ({\n type: 'button' as const,\n ...getStyles('mobileMonthViewEvent'),\n tabindex: isStatic.value ? -1 : 0,\n onClick: isStatic.value\n ? undefined\n : (nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n})\n\nconst EventBody = (event: ScheduleEventData) => () =>\n h(Box, getStyles('mobileMonthViewEventBody'), () => [\n h(\n 'div',\n getStyles('mobileMonthViewEventColor', {\n style: { backgroundColor: getThemeColor(event.color, theme.value) },\n }),\n ),\n h('div', [\n h(Text, getStyles('mobileMonthViewEventTitle'), () => event.title),\n h(Text, getStyles('mobileMonthViewEventTime'), () => eventTimeLabel(event)),\n ]),\n ])\n\nconst renderListEvent = (event: ScheduleEventData) => () => {\n const children = h(EventBody(event))\n const rootProps = listEventProps(event)\n const payload = { ...rootProps, children }\n\n return (\n slots.event?.({ ...payload, event }) ??\n props.renderEvent?.(event, payload) ??\n h(UnstyledButton, rootProps, () => children)\n )\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('mobileMonthView') }\"\n :mod=\"[{ 'with-week-numbers': props.withWeekNumbers }, (attrs as any).mod]\"\n >\n <div v-if=\"props.withHeader\" v-bind=\"getStyles('mobileMonthViewHeader')\">\n <component :is=\"renderHeaderContent\" />\n </div>\n\n <Box\n v-bind=\"getStyles('mobileMonthViewCalendar')\"\n :mod=\"{ 'with-weekdays': props.withWeekDays }\"\n >\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('mobileMonthViewWeekdays')\">\n <span v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('mobileMonthViewWeekdaysCorner')\" />\n <span\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"getStyles('mobileMonthViewWeekday')\"\n >\n {{ weekday }}\n </span>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"getStyles('mobileMonthViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('mobileMonthViewWeekNumber', {\n className: weekNumberProps(week[0]).class,\n }),\n }\"\n :mod=\"{ static: isStatic }\"\n :tabindex=\"isStatic ? -1 : 0\"\n @click=\"emit('weekNumberClick', toDayKey(week[0])!, $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <UnstyledButton\n v-for=\"date in week\"\n :key=\"toDayKey(date)!\"\n v-bind=\"{\n ...dayProps(date),\n ...getStyles('mobileMonthViewDay', { className: dayProps(date).class }),\n }\"\n :mod=\"{\n outside: isOutside(date),\n weekend: props.weekendDays!.includes(dayjs(date).day() as DayOfWeek),\n today: props.highlightToday && dayjs(date).isSame(dayjs(), 'day'),\n selected: selected === toDayKey(date),\n static: isStatic,\n hidden: !isRendered(date),\n }\"\n :tabindex=\"isStatic || !isRendered(date) ? -1 : 0\"\n :aria-label=\"formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\"\n :aria-selected=\"selected === toDayKey(date) || undefined\"\n @click=\"isStatic || !isRendered(date) ? undefined : selectDay(date, $event)\"\n >\n <template v-if=\"isRendered(date)\">\n {{ dayjs(date).date() }}\n <span\n v-if=\"dayIndicators(date).length\"\n v-bind=\"getStyles('mobileMonthViewDayIndicators')\"\n >\n <span\n v-for=\"event in dayIndicators(date)\"\n :key=\"event.id\"\n v-bind=\"getStyles('mobileMonthViewDayIndicator')\"\n :style=\"indicatorStyle(event)\"\n />\n </span>\n </template>\n </UnstyledButton>\n </div>\n </Box>\n\n <Box v-bind=\"getStyles('mobileMonthViewEventsList')\">\n <Text v-bind=\"getStyles('mobileMonthViewEventsHeader')\">\n {{\n selected\n ? formatDate({\n date: selected,\n locale: props.locale || 'en',\n format: props.eventsHeaderFormat!,\n })\n : ''\n }}\n </Text>\n\n <template v-if=\"selectedEvents.length\">\n <component :is=\"renderListEvent(event)\" v-for=\"event in selectedEvents\" :key=\"event.id\" />\n </template>\n <Text v-else v-bind=\"getStyles('mobileMonthViewNoEvents')\">\n {{ getLabel('noEvents', props.labels) }}\n </Text>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { MobileMonthViewOwnProps } from './MobileMonthView.types'\n\nconst defaultProps = {\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n withHeader: true,\n withWeekDays: true,\n firstDayOfWeek: 1,\n weekdayFormat: 'dd',\n weekendDays: [0, 6],\n consistentWeeks: true,\n highlightToday: true,\n eventsHeaderFormat: 'dddd, MMMM D',\n} satisfies Partial<MobileMonthViewOwnProps>\n\nconst MAX_DAY_INDICATORS = 3\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n mobileMonthView: {\n '--mobile-month-view-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver, MAX_DAY_INDICATORS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, h, useAttrs, useSlots, type VNodeChild } from 'vue'\nimport {\n AccordionChevron,\n Box,\n getThemeColor,\n Text,\n UnstyledButton,\n useDirection,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport { getLabel } from '../../labels'\nimport type { DateStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport { formatDate, getMonthDays, getWeekNumber, getWeekdaysNames } from '../../utils'\nimport { getExpandedEvents } from '../shared'\nimport { getMobileMonthViewEvents } from './get-mobile-month-view-events'\nimport type { MobileMonthViewEmits, MobileMonthViewSlots } from './MobileMonthView.types'\nimport classes from './MobileMonthView.module.css'\n\ndefineOptions({\n name: 'MobileMonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MobileMonthViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n selectedDate: undefined,\n defaultSelectedDate: undefined,\n withWeekDays: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n getWeekNumberProps: undefined,\n getDayProps: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n eventsHeaderFormat: undefined,\n renderHeader: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MobileMonthViewSlots>()\n\nconst emit = defineEmits<MobileMonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst { dir } = useDirection()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('MobileMonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MobileMonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'mobileMonthView',\n})\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst toDayKey = (value: Date | DateStringValue | null | undefined) =>\n value ? (dayjs(value).format('YYYY-MM-DD') as DateStringValue) : null\n\nconst [selected, setSelected] = useUncontrolled<DateStringValue | null>({\n // `null` is a meaningful selection (nothing selected), so only `undefined` means uncontrolled.\n value: () => (props.selectedDate === undefined ? undefined : toDayKey(props.selectedDate)),\n defaultValue: dayjs(props.defaultSelectedDate ?? undefined).format(\n 'YYYY-MM-DD',\n ) as DateStringValue,\n finalValue: null,\n onChange: (value) => {\n emit('update:selectedDate', value)\n emit('selectedDateChange', value)\n },\n})\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\n\nconst weeks = computed(() =>\n getMonthDays({\n month: month.value,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n weeks.value[0][0],\n dayjs(weeks.value.at(-1)!.at(-1)!).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst eventsByDay = computed(() =>\n getMobileMonthViewEvents({ date: month.value, events: expandedEvents.value }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\nconst selectedEvents = computed(() =>\n selected.value ? eventsByDay.value[selected.value] || [] : [],\n)\n\nconst dayProps = (date: string | Date) => props.getDayProps?.(toDayKey(date)!) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDayKey(weekStart)!) ?? {}\n\nconst isOutside = (date: string | Date) => !dayjs(date).isSame(month.value, 'month')\n\n/** Outside days keep their cell so the grid stays aligned, but render nothing. */\nconst isRendered = (date: string | Date) => !isOutside(date) || Boolean(props.withOutsideDays)\n\nconst dayIndicators = (date: string | Date) =>\n (eventsByDay.value[toDayKey(date)!] || []).slice(0, MAX_DAY_INDICATORS)\n\nconst indicatorStyle = (event: ScheduleEventData) => ({\n background: `var(--mantine-color-${event.color}-6, ${event.color})`,\n})\n\nconst selectDay = (date: string | Date, nativeEvent: MouseEvent) => {\n const value = toDayKey(date)!\n setSelected(value)\n emit('dayClick', value, nativeEvent)\n}\n\nconst isAllDayEvent = (event: ScheduleEventData) =>\n dayjs(event.start).format('HH:mm') === '00:00' && dayjs(event.end).format('HH:mm') === '00:00'\n\nconst eventTimeLabel = (event: ScheduleEventData) =>\n isAllDayEvent(event)\n ? getLabel('allDay', props.labels)\n : `${dayjs(event.start).format('HH:mm')} – ${dayjs(event.end).format('HH:mm')}`\n\n/**\n * Default header as a functional component, so the template and the `renderHeader` payload\n * share one definition instead of building the tree twice.\n */\nconst DefaultHeader = () => [\n h(\n UnstyledButton,\n {\n ...getStyles('mobileMonthViewHeaderBackButton'),\n mod: { static: isStatic.value },\n tabindex: isStatic.value ? -1 : 0,\n onClick: isStatic.value ? undefined : () => emit('yearClick'),\n },\n () => [\n h(AccordionChevron, {\n size: 20,\n style: { transform: `rotate(${dir.value === 'rtl' ? -90 : 90}deg)` },\n }),\n month.value.format('YYYY'),\n ],\n ),\n h(Text, getStyles('mobileMonthViewHeaderLabel'), () =>\n formatDate({ date: month.value, locale: props.locale || 'en', format: 'MMMM YYYY' }),\n ),\n]\n\nconst headerPayload = computed(() => ({\n mode: props.mode!,\n date: props.date,\n defaultHeader: h(DefaultHeader) as VNodeChild,\n}))\n\nconst customHeader = computed<VNodeChild>(() => {\n if (!slots.header && !props.renderHeader) {\n return null\n }\n\n return slots.header?.(headerPayload.value) ?? props.renderHeader?.(headerPayload.value) ?? null\n})\n\nconst renderHeaderContent = () => customHeader.value ?? h(DefaultHeader)\n\nconst listEventProps = (event: ScheduleEventData) => ({\n type: 'button' as const,\n ...getStyles('mobileMonthViewEvent'),\n tabindex: isStatic.value ? -1 : 0,\n onClick: isStatic.value\n ? undefined\n : (nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n})\n\nconst EventBody = (event: ScheduleEventData) => () =>\n h(Box, getStyles('mobileMonthViewEventBody'), () => [\n h(\n 'div',\n getStyles('mobileMonthViewEventColor', {\n style: { backgroundColor: getThemeColor(event.color, theme.value) },\n }),\n ),\n h('div', [\n h(Text, getStyles('mobileMonthViewEventTitle'), () => event.title),\n h(Text, getStyles('mobileMonthViewEventTime'), () => eventTimeLabel(event)),\n ]),\n ])\n\nconst renderListEvent = (event: ScheduleEventData) => () => {\n const children = h(EventBody(event))\n const rootProps = listEventProps(event)\n const payload = { ...rootProps, children }\n\n return (\n slots.event?.({ ...payload, event }) ??\n props.renderEvent?.(event, payload) ??\n h(UnstyledButton, rootProps, () => children)\n )\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('mobileMonthView') }\"\n :mod=\"[{ 'with-week-numbers': props.withWeekNumbers }, (attrs as any).mod]\"\n >\n <div v-if=\"props.withHeader\" v-bind=\"getStyles('mobileMonthViewHeader')\">\n <component :is=\"renderHeaderContent\" />\n </div>\n\n <Box\n v-bind=\"getStyles('mobileMonthViewCalendar')\"\n :mod=\"{ 'with-weekdays': props.withWeekDays }\"\n >\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('mobileMonthViewWeekdays')\">\n <span v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('mobileMonthViewWeekdaysCorner')\" />\n <span\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"getStyles('mobileMonthViewWeekday')\"\n >\n {{ weekday }}\n </span>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"getStyles('mobileMonthViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('mobileMonthViewWeekNumber', {\n className: weekNumberProps(week[0]).class,\n }),\n }\"\n :mod=\"{ static: isStatic }\"\n :tabindex=\"isStatic ? -1 : 0\"\n @click=\"emit('weekNumberClick', toDayKey(week[0])!, $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <UnstyledButton\n v-for=\"date in week\"\n :key=\"toDayKey(date)!\"\n v-bind=\"{\n ...dayProps(date),\n ...getStyles('mobileMonthViewDay', { className: dayProps(date).class }),\n }\"\n :mod=\"{\n outside: isOutside(date),\n weekend: props.weekendDays!.includes(dayjs(date).day() as DayOfWeek),\n today: props.highlightToday && dayjs(date).isSame(dayjs(), 'day'),\n selected: selected === toDayKey(date),\n static: isStatic,\n hidden: !isRendered(date),\n }\"\n :tabindex=\"isStatic || !isRendered(date) ? -1 : 0\"\n :aria-label=\"formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\"\n :aria-selected=\"selected === toDayKey(date) || undefined\"\n @click=\"isStatic || !isRendered(date) ? undefined : selectDay(date, $event)\"\n >\n <template v-if=\"isRendered(date)\">\n {{ dayjs(date).date() }}\n <span\n v-if=\"dayIndicators(date).length\"\n v-bind=\"getStyles('mobileMonthViewDayIndicators')\"\n >\n <span\n v-for=\"event in dayIndicators(date)\"\n :key=\"event.id\"\n v-bind=\"getStyles('mobileMonthViewDayIndicator')\"\n :style=\"indicatorStyle(event)\"\n />\n </span>\n </template>\n </UnstyledButton>\n </div>\n </Box>\n\n <Box v-bind=\"getStyles('mobileMonthViewEventsList')\">\n <Text v-bind=\"getStyles('mobileMonthViewEventsHeader')\">\n {{\n selected\n ? formatDate({\n date: selected,\n locale: props.locale || 'en',\n format: props.eventsHeaderFormat!,\n })\n : ''\n }}\n </Text>\n\n <template v-if=\"selectedEvents.length\">\n <component :is=\"renderListEvent(event)\" v-for=\"event in selectedEvents\" :key=\"event.id\" />\n </template>\n <Text v-else v-bind=\"getStyles('mobileMonthViewNoEvents')\">\n {{ getLabel('noEvents', props.labels) }}\n </Text>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport MobileMonthViewComponent, { varsResolver } from './MobileMonthView.vue'\nimport type { MobileMonthViewFactory } from './MobileMonthView.types'\nimport classes from './MobileMonthView.module.css'\n\nexport const MobileMonthView = factory<MobileMonthViewFactory>(MobileMonthViewComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n MobileMonthViewCssVariables,\n MobileMonthViewEmits,\n MobileMonthViewFactory,\n MobileMonthViewHeaderPayload,\n MobileMonthViewOwnProps,\n MobileMonthViewProps,\n MobileMonthViewSlots,\n MobileMonthViewStylesNames,\n} from './MobileMonthView.types'\n","export function handleGridKeydown({\n event,\n index,\n columns,\n total,\n getControl,\n}: {\n event: KeyboardEvent\n index: number\n columns: number\n total: number\n getControl: (index: number) => HTMLButtonElement | null\n}): void {\n const step =\n event.key === 'ArrowRight'\n ? 1\n : event.key === 'ArrowLeft'\n ? -1\n : event.key === 'ArrowDown'\n ? columns\n : event.key === 'ArrowUp'\n ? -columns\n : 0\n\n if (step === 0) return\n event.preventDefault()\n\n for (let next = index + step; next >= 0 && next < total; next += step) {\n const control = getControl(next)\n if (control && !control.disabled && !control.hasAttribute('data-hidden')) {\n control.focus()\n return\n }\n }\n}\n","import dayjs from 'dayjs'\nimport { MonthPositionedEventData } from '../../../types'\n\ninterface AddEventToDayGroupsInput {\n positionedEvent: MonthPositionedEventData\n eventStart: dayjs.Dayjs\n eventEnd: dayjs.Dayjs\n groupedByDay: { [date: string]: MonthPositionedEventData[] }\n eventsAddedToDay: Set<string>\n weekIdx: number\n}\n\nexport function addEventToDayGroups({\n positionedEvent,\n eventStart,\n eventEnd,\n groupedByDay,\n eventsAddedToDay,\n weekIdx,\n}: AddEventToDayGroupsInput): void {\n if (weekIdx === 0 || !eventsAddedToDay.has(positionedEvent.id.toString())) {\n let dayDate = eventStart\n while (dayDate.isBefore(eventEnd) || dayDate.isSame(eventEnd, 'day')) {\n const dayDateStr = dayDate.format('YYYY-MM-DD 00:00:00')\n if (groupedByDay[dayDateStr]) {\n groupedByDay[dayDateStr].push(positionedEvent)\n }\n dayDate = dayDate.add(1, 'day')\n }\n eventsAddedToDay.add(positionedEvent.id.toString())\n }\n}\n","import dayjs from 'dayjs'\n\nexport type HangingStatus = 'none' | 'start' | 'end' | 'both'\n\ninterface CalculateEventPositionInput {\n eventStart: dayjs.Dayjs\n eventEnd: dayjs.Dayjs\n weekStart: dayjs.Dayjs\n weekEnd: dayjs.Dayjs\n isMultiday: boolean\n}\n\ninterface EventPositionInWeek {\n startDayIndex: number\n daysSpanned: number\n startOffset: number\n width: number\n hanging: HangingStatus\n}\n\nexport function calculateEventPositionInWeek({\n eventStart,\n eventEnd,\n weekStart,\n weekEnd,\n isMultiday,\n}: CalculateEventPositionInput): EventPositionInWeek {\n let displayStart = eventStart\n let displayEnd = eventEnd\n\n const hangingStart = eventStart.isBefore(weekStart)\n const hangingEnd = eventEnd.isAfter(weekEnd)\n const hanging: HangingStatus =\n hangingStart && hangingEnd ? 'both' : hangingStart ? 'start' : hangingEnd ? 'end' : 'none'\n\n if (displayStart.isBefore(weekStart)) {\n displayStart = weekStart\n }\n if (displayEnd.isAfter(weekEnd)) {\n displayEnd = weekEnd\n }\n\n const startDayIndex = displayStart.diff(weekStart, 'day')\n const endDayIndex = displayEnd.diff(weekStart, 'day')\n const daysSpanned = Math.max(1, endDayIndex - startDayIndex + (isMultiday ? 1 : 0))\n\n const startOffset = (startDayIndex / 7) * 100\n const width = (daysSpanned / 7) * 100\n\n return {\n startDayIndex,\n daysSpanned,\n startOffset,\n width,\n hanging,\n }\n}\n","import dayjs from 'dayjs'\nimport { MonthPositionedEventData } from '../../../types'\n\ninterface FindAvailableRowInput {\n existingEvents: MonthPositionedEventData[]\n startDayIndex: number\n daysSpanned: number\n weekStart: dayjs.Dayjs\n}\n\nexport function findAvailableRow({\n existingEvents,\n startDayIndex,\n daysSpanned,\n weekStart,\n}: FindAvailableRowInput): number {\n let row = 0\n\n for (const existing of existingEvents) {\n const existingStart = dayjs(existing.start).startOf('day')\n const existingDisplayStart =\n existingStart.isBefore(weekStart) || existingStart.isSame(weekStart, 'day')\n ? weekStart\n : existingStart\n const existingDayIndex = existingDisplayStart.diff(weekStart, 'day')\n const existingWidth = existing.position?.width || 0\n const existingDaysSpanned = (existingWidth / 100) * 7\n\n if (\n existingDayIndex + existingDaysSpanned > startDayIndex &&\n existingDayIndex < startDayIndex + daysSpanned\n ) {\n row = Math.max(row, (existing.position?.row || 0) + 1)\n }\n }\n\n return row\n}\n","import dayjs from 'dayjs'\nimport { DateStringValue, DayOfWeek, MonthPositionedEventData } from '../../../types'\nimport { getStartOfWeek } from '../../../utils'\n\ninterface GetWeeksInRangeInput {\n rangeStart: dayjs.Dayjs\n rangeEnd: dayjs.Dayjs\n firstDayOfWeek: DayOfWeek\n}\n\ninterface GetWeeksInRangeOutput {\n weeks: DateStringValue[][]\n groupedByDay: Record<string, MonthPositionedEventData[]>\n}\n\nexport function getWeeksInRange({\n rangeStart,\n rangeEnd,\n firstDayOfWeek,\n}: GetWeeksInRangeInput): GetWeeksInRangeOutput {\n const weeks: DateStringValue[][] = []\n const groupedByDay: Record<string, MonthPositionedEventData[]> = {}\n\n const startOfFirstWeekStr = getStartOfWeek({\n date: rangeStart.format('YYYY-MM-DD'),\n firstDayOfWeek,\n })\n\n let currentDate = dayjs(startOfFirstWeekStr)\n\n while (currentDate.isBefore(rangeEnd) || currentDate.isSame(rangeEnd, 'day')) {\n const week: DateStringValue[] = []\n for (let i = 0; i < 7; i++) {\n const dateStr = currentDate.format('YYYY-MM-DD 00:00:00')\n week.push(dateStr)\n if (!groupedByDay[dateStr]) {\n groupedByDay[dateStr] = []\n }\n currentDate = currentDate.add(1, 'day')\n }\n weeks.push(week)\n }\n\n return { weeks, groupedByDay }\n}\n","import dayjs from 'dayjs'\nimport {\n AnyDateValue,\n DateStringValue,\n DayOfWeek,\n MonthPositionedEventData,\n ScheduleEventData,\n} from '../../../types'\nimport { addEventToDayGroups } from './add-event-to-day-groups'\nimport { calculateEventPositionInWeek } from './calculate-event-position-in-week'\nimport { findAvailableRow } from './find-available-row'\nimport { getWeeksInRange } from './get-weeks-in-range'\n\ninterface GetMonthPositionedEventsInput {\n /** Date (month start) at which events are positioned */\n date: AnyDateValue\n\n /** List of all events that belong to the given month, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[]\n\n /** First day of the week, 0 - Sunday, 1 - Monday, etc., used to calculate events positions */\n firstDayOfWeek?: DayOfWeek\n\n /** Range of dates for which events should be displayed (includes outside days if withOutsideDays is true) */\n range?: {\n start: DateStringValue\n end: DateStringValue\n }\n}\n\n/** Events grouped by week index and by day */\nexport interface GroupedMonthEvents {\n /** Events grouped by week index (index within month) */\n groupedByWeek: {\n [weekIndex: string]: MonthPositionedEventData[]\n }\n\n /** Events grouped by day (YYYY-MM-DD format) */\n groupedByDay: {\n [date: string]: MonthPositionedEventData[]\n }\n\n /** Background events grouped by week index */\n backgroundByWeek: {\n [weekIndex: string]: MonthPositionedEventData[]\n }\n}\n\nexport function getMonthPositionedEvents({\n date,\n events,\n firstDayOfWeek = 1,\n range,\n}: GetMonthPositionedEventsInput): GroupedMonthEvents {\n const groupedByWeek: GroupedMonthEvents['groupedByWeek'] = {}\n const backgroundByWeek: GroupedMonthEvents['backgroundByWeek'] = {}\n const eventsAddedToDay = new Set<string>()\n\n const rangeStart = range ? dayjs(range.start) : dayjs(date).startOf('month')\n const rangeEnd = range ? dayjs(range.end) : dayjs(date).startOf('month').endOf('month')\n\n const { weeks, groupedByDay } = getWeeksInRange({\n rangeStart,\n rangeEnd,\n firstDayOfWeek,\n })\n\n for (let i = 0; i < weeks.length; i++) {\n groupedByWeek[i.toString()] = []\n backgroundByWeek[i.toString()] = []\n }\n\n for (const event of events) {\n const eventStart = dayjs(event.start).startOf('day')\n const rawEnd = dayjs(event.end)\n const endAtMidnight = rawEnd.hour() === 0 && rawEnd.minute() === 0 && rawEnd.second() === 0\n const eventEnd = endAtMidnight\n ? rawEnd.startOf('day').subtract(1, 'day')\n : rawEnd.startOf('day')\n const isMultiday = eventEnd.isAfter(eventStart)\n\n for (let weekIdx = 0; weekIdx < weeks.length; weekIdx++) {\n const week = weeks[weekIdx]\n const weekStart = dayjs(week[0]).startOf('day')\n const weekEnd = dayjs(week[6]).endOf('day')\n\n if (\n (eventStart.isBefore(weekEnd) || eventStart.isSame(weekEnd, 'day')) &&\n (eventEnd.isAfter(weekStart) || eventEnd.isSame(weekStart, 'day'))\n ) {\n const { startDayIndex, daysSpanned, startOffset, width, hanging } =\n calculateEventPositionInWeek({\n eventStart,\n eventEnd,\n weekStart,\n weekEnd,\n isMultiday,\n })\n\n if (event.display === 'background') {\n backgroundByWeek[weekIdx.toString()].push({\n ...event,\n position: {\n startOffset,\n width,\n weekIndex: weekIdx,\n row: 0,\n hanging,\n },\n })\n continue\n }\n\n const row = findAvailableRow({\n existingEvents: groupedByWeek[weekIdx.toString()],\n startDayIndex,\n daysSpanned,\n weekStart,\n })\n\n const positionedEvent: MonthPositionedEventData = {\n ...event,\n position: {\n startOffset,\n width,\n weekIndex: weekIdx,\n row,\n hanging,\n },\n }\n\n groupedByWeek[weekIdx.toString()].push(positionedEvent)\n\n addEventToDayGroups({\n positionedEvent,\n eventStart,\n eventEnd,\n groupedByDay,\n eventsAddedToDay,\n weekIdx,\n })\n }\n }\n }\n\n return {\n groupedByWeek,\n groupedByDay,\n backgroundByWeek,\n }\n}\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DayOfWeek, ScheduleEventData } from '../../../types'\nimport { getMonthRange, validateEvent } from '../../../utils'\nimport { getMonthPositionedEvents, GroupedMonthEvents } from './get-month-positioned-events'\n\ninterface UseMonthViewEventsInput {\n /** Date (month start) at which events are positioned */\n date: AnyDateValue\n\n /** List of all events that belong to the given month, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[] | undefined\n\n /** First day of the week, 0 - Sunday, 1 - Monday, etc., used to calculate events positions */\n firstDayOfWeek?: DayOfWeek\n\n /** If true, events for outside days are included */\n withOutsideDays?: boolean\n\n /** If true, month will show events for consistent number of weeks (6) */\n consistentWeeks?: boolean\n}\n\nexport function getMonthViewEvents({\n date,\n events,\n firstDayOfWeek = 1,\n withOutsideDays,\n consistentWeeks,\n}: UseMonthViewEventsInput): GroupedMonthEvents {\n if (events === undefined) {\n return { groupedByDay: {}, groupedByWeek: {}, backgroundByWeek: {} }\n }\n\n const ids = new Set<string | number>()\n const filteredEvents: ScheduleEventData[] = []\n\n const range = getMonthRange({ month: date, withOutsideDays, consistentWeeks, firstDayOfWeek })\n\n for (const event of events) {\n if (\n dayjs(event.end).isAfter(range.start, 'day') ||\n dayjs(event.start).isBefore(range.end, 'day')\n ) {\n filteredEvents.push(validateEvent(event))\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(`[@mantine/schedule] MonthView: Duplicated event ids found: ${event.id}`)\n }\n }\n }\n\n return getMonthPositionedEvents({\n date,\n events: filteredEvents,\n firstDayOfWeek,\n range,\n })\n}\n","import { DateStringValue, MonthEventPositionData, MonthPositionedEventData } from '../../types'\n\nconst DAYS_IN_WEEK = 7\nconst DAY_WIDTH = 100 / DAYS_IN_WEEK\n\ninterface GetRenderableMonthEventSegmentsInput {\n events: MonthPositionedEventData[]\n groupedByDay: Record<string, MonthPositionedEventData[]>\n maxEventsPerDay: number\n week: DateStringValue[]\n}\n\ninterface EventDayRange {\n startDayIndex: number\n endDayIndex: number\n}\n\ninterface SegmentRange extends EventDayRange {\n row: number\n}\n\nexport interface RenderableMonthEventSegment {\n event: MonthPositionedEventData\n position: MonthEventPositionData\n clipStart: boolean\n clipEnd: boolean\n key: string\n}\n\nfunction getEventDayRange(event: MonthPositionedEventData): EventDayRange {\n const startDayIndex = Math.max(0, Math.round(event.position.startOffset / DAY_WIDTH))\n const daysSpanned = Math.max(1, Math.round(event.position.width / DAY_WIDTH))\n\n return {\n startDayIndex,\n endDayIndex: Math.min(DAYS_IN_WEEK - 1, startDayIndex + daysSpanned - 1),\n }\n}\n\nfunction getFirstAvailableRow(usedRows: Set<number>, maxEventsPerDay: number): number | null {\n for (let row = 0; row < maxEventsPerDay; row += 1) {\n if (!usedRows.has(row)) {\n return row\n }\n }\n\n return null\n}\n\nfunction getSegmentHanging(\n originalHanging: MonthEventPositionData['hanging'],\n touchesStart: boolean,\n touchesEnd: boolean,\n): MonthEventPositionData['hanging'] {\n const hangsFromStart = touchesStart && (originalHanging === 'start' || originalHanging === 'both')\n const hangsFromEnd = touchesEnd && (originalHanging === 'end' || originalHanging === 'both')\n\n if (hangsFromStart && hangsFromEnd) {\n return 'both'\n }\n\n if (hangsFromStart) {\n return 'start'\n }\n\n if (hangsFromEnd) {\n return 'end'\n }\n\n return 'none'\n}\n\nfunction getSegmentPosition(\n event: MonthPositionedEventData,\n segment: SegmentRange,\n eventRange: EventDayRange,\n): MonthEventPositionData {\n const touchesStart = segment.startDayIndex === eventRange.startDayIndex\n const touchesEnd = segment.endDayIndex === eventRange.endDayIndex\n\n return {\n ...event.position,\n startOffset: (segment.startDayIndex / DAYS_IN_WEEK) * 100,\n width: ((segment.endDayIndex - segment.startDayIndex + 1) / DAYS_IN_WEEK) * 100,\n row: segment.row,\n hanging: getSegmentHanging(event.position.hanging, touchesStart, touchesEnd),\n }\n}\n\nfunction getEventKey(event: MonthPositionedEventData): string | number {\n return event.id\n}\n\nexport function getRenderableMonthEventSegments({\n events,\n groupedByDay,\n maxEventsPerDay,\n week,\n}: GetRenderableMonthEventSegmentsInput): RenderableMonthEventSegment[] {\n const eventIndexes = new Map<MonthPositionedEventData, number>()\n const eventRanges = new Map<MonthPositionedEventData, EventDayRange>()\n const renderRows = new Map<MonthPositionedEventData, Map<number, number>>()\n\n events.forEach((event, index) => {\n eventIndexes.set(event, index)\n eventRanges.set(event, getEventDayRange(event))\n })\n\n const setRenderRow = (event: MonthPositionedEventData, dayIndex: number, row: number) => {\n if (!renderRows.has(event)) {\n renderRows.set(event, new Map())\n }\n\n renderRows.get(event)!.set(dayIndex, row)\n }\n\n for (let dayIndex = 0; dayIndex < week.length; dayIndex += 1) {\n const dayEvents = groupedByDay[week[dayIndex]] || []\n const dayEventIds = new Set(dayEvents.map((event) => getEventKey(event)))\n const dayWeekEvents = events.filter((event) => {\n const range = eventRanges.get(event)!\n return (\n dayEventIds.has(getEventKey(event)) &&\n dayIndex >= range.startDayIndex &&\n dayIndex <= range.endDayIndex\n )\n })\n\n if (dayEvents.length > maxEventsPerDay) {\n dayWeekEvents.forEach((event) => {\n if (event.position.row < maxEventsPerDay) {\n setRenderRow(event, dayIndex, event.position.row)\n }\n })\n\n continue\n }\n\n const usedRows = new Set<number>()\n const sortedDayEvents = [...dayWeekEvents].sort((a, b) => {\n const rowDiff = a.position.row - b.position.row\n\n if (rowDiff !== 0) {\n return rowDiff\n }\n\n return eventIndexes.get(a)! - eventIndexes.get(b)!\n })\n\n sortedDayEvents.forEach((event) => {\n let row = event.position.row\n\n if (row >= maxEventsPerDay || usedRows.has(row)) {\n const availableRow = getFirstAvailableRow(usedRows, maxEventsPerDay)\n\n if (availableRow === null) {\n return\n }\n\n row = availableRow\n }\n\n usedRows.add(row)\n setRenderRow(event, dayIndex, row)\n })\n }\n\n return events.flatMap((event) => {\n const eventRange = eventRanges.get(event)!\n const eventRenderRows = renderRows.get(event)\n const segments: RenderableMonthEventSegment[] = []\n let currentSegment: SegmentRange | null = null\n\n const addSegment = (segment: SegmentRange) => {\n const position = getSegmentPosition(event, segment, eventRange)\n\n segments.push({\n event,\n position,\n clipStart: segment.startDayIndex > eventRange.startDayIndex,\n clipEnd: segment.endDayIndex < eventRange.endDayIndex,\n key: `${event.id}-${event.position.weekIndex}-${segment.startDayIndex}-${segment.endDayIndex}-${segment.row}`,\n })\n }\n\n for (\n let dayIndex = eventRange.startDayIndex;\n dayIndex <= eventRange.endDayIndex;\n dayIndex += 1\n ) {\n const row = eventRenderRows?.get(dayIndex)\n\n if (row === undefined) {\n if (currentSegment) {\n addSegment(currentSegment)\n currentSegment = null\n }\n\n continue\n }\n\n if (currentSegment && currentSegment.row === row) {\n currentSegment.endDayIndex = dayIndex\n } else {\n if (currentSegment) {\n addSegment(currentSegment)\n }\n\n currentSegment = {\n startDayIndex: dayIndex,\n endDayIndex: dayIndex,\n row,\n }\n }\n }\n\n if (currentSegment) {\n addSegment(currentSegment)\n }\n\n return segments\n })\n}\n",".monthView {\n --week-numbers-offset: 0rem;\n --month-view-border: 1px solid var(--month-view-border-color);\n --month-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --day-base-color: var(--mantine-color-text);\n --min-day-width: 84px;\n\n &:where([data-with-week-numbers]) {\n --week-numbers-offset: 42px;\n }\n\n @mixin where-light {\n --month-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --month-view-border-color: var(--mantine-color-dark-4);\n }\n}\n\n.monthViewWeekdays {\n display: flex;\n}\n\n.monthViewWeek {\n display: flex;\n position: relative;\n min-width: calc(var(--min-day-width) * 7 + var(--week-numbers-offset));\n}\n\n.monthViewWeekNumber {\n flex: 0 0 var(--week-numbers-offset);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n padding: 4px;\n border-block-start: var(--month-view-border);\n border-block-end: none;\n border-inline-start: var(--month-view-border);\n border-inline-end: none;\n font-weight: var(--mantine-font-weight-medium);\n cursor: pointer;\n user-select: none;\n\n :where(.monthViewWeek:first-child) & {\n border-start-start-radius: var(--month-view-radius);\n\n :where([data-with-weekdays] .monthView) & {\n border-start-start-radius: 0;\n }\n }\n\n :where(.monthViewWeek:last-child) & {\n border-block-end: var(--month-view-border);\n border-end-start-radius: var(--month-view-radius);\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.monthViewWeekday {\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n min-width: var(--min-day-width);\n height: 36px;\n font-size: var(--mantine-font-size-sm);\n border-block-start: var(--month-view-border);\n border-block-end: none;\n border-inline-start: var(--month-view-border);\n border-inline-end: none;\n font-weight: var(--mantine-font-weight-medium);\n text-align: center;\n text-transform: capitalize;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n user-select: none;\n\n &:where(:first-child) {\n border-start-start-radius: var(--month-view-radius);\n\n :where([data-with-week-numbers] .monthView) & {\n border-start-start-radius: 0;\n }\n }\n\n &:where(:last-child) {\n border-inline-end: var(--month-view-border);\n border-start-end-radius: var(--month-view-radius);\n }\n}\n\n.monthViewWeekdaysCorner {\n flex: 0 0 var(--week-numbers-offset);\n border-block-start: var(--month-view-border);\n border-inline-start: var(--month-view-border);\n border-start-start-radius: var(--month-view-radius);\n}\n\n.monthViewDay {\n min-width: var(--min-day-width);\n flex: 0 0 calc(100% / 7 - var(--week-numbers-offset) / 7);\n height: calc(52px + var(--month-view-max-events, 2) * 24px);\n padding: 4px;\n font-weight: var(--mantine-font-weight-medium);\n border-block-start: var(--month-view-border);\n border-block-end: none;\n border-inline-start: var(--month-view-border);\n border-inline-end: none;\n color: var(--day-base-color);\n cursor: pointer;\n display: flex;\n align-items: flex-start;\n position: relative;\n\n &:where(:last-child) {\n border-inline-end: var(--month-view-border);\n\n :where(.monthViewWeek:last-child) & {\n border-block-end: var(--month-view-border);\n border-end-end-radius: var(--month-view-radius);\n }\n\n :where(.monthViewWeek:first-child) & {\n border-start-end-radius: var(--month-view-radius);\n\n :where(:not([data-with-weekdays])) .monthView & {\n border-start-end-radius: var(--month-view-radius);\n }\n }\n }\n\n &:where(:first-of-type) {\n :where(.monthViewWeek:first-child) & {\n border-start-start-radius: var(--month-view-radius);\n\n :where([data-with-week-numbers]) .monthView & {\n border-start-start-radius: 0;\n }\n\n :where([data-with-weekdays]) .monthView & {\n border-start-start-radius: 0;\n }\n }\n\n :where(.monthViewWeek:last-child) & {\n border-end-start-radius: var(--month-view-radius);\n }\n\n :where([data-with-week-numbers]) .monthViewWeek:last-child & {\n border-end-start-radius: 0;\n }\n }\n\n :where(.monthViewWeek:last-child) & {\n border-block-end: var(--month-view-border);\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-outside]) {\n color: alpha(var(--day-base-color), 0.4);\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n\n @mixin hover {\n &:where(:not([data-static])) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\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: 0px;\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\n.monthViewDayLabel {\n width: 26px;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 100%;\n font-size: var(--mantine-font-size-sm);\n user-select: none;\n\n &:where([data-today]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n }\n}\n\n.monthViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--month-view-radius);\n background-color: var(--bg-event-bg);\n top: 0;\n bottom: -21px;\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.monthViewEvents {\n position: absolute;\n inset-inline: 0;\n inset-inline-start: var(--week-numbers-offset);\n top: 30px;\n bottom: 22px;\n pointer-events: none;\n z-index: 3;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { MonthViewOwnProps } from './MonthView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n firstDayOfWeek: 1,\n weekdayFormat: 'ddd',\n weekendDays: [0, 6],\n withWeekDays: true,\n consistentWeeks: true,\n highlightToday: true,\n withOutsideDays: true,\n maxEventsPerDay: 2,\n} satisfies Partial<MonthViewOwnProps>\n\n/** Vertical offset of the first event row, past the day label, in px. */\nconst EVENTS_TOP_OFFSET = 28\n\n/** Vertical step between stacked event rows, in px. */\nconst EVENT_ROW_HEIGHT = 22\n\n/** Group name of the month grid for slot drag selection – a month has a single grid. */\nconst MONTH_SLOT_GROUP = 'month'\n\nconst COLUMNS = 7\n\n/** `maxEventsPerDay` is clamped so the CSS grid keeps a workable row height. */\nfunction clampMaxEvents(value: number) {\n return Math.min(10, Math.max(1, value))\n}\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius, maxEventsPerDay }) => ({\n monthView: {\n '--month-view-radius': resolveScheduleRadius(radius),\n '--month-view-max-events': String(\n clampMaxEvents(maxEventsPerDay ?? defaultProps.maxEventsPerDay),\n ),\n },\n}))\n\nexport {\n defaultProps,\n varsResolver,\n clampMaxEvents,\n EVENTS_TOP_OFFSET,\n EVENT_ROW_HEIGHT,\n MONTH_SLOT_GROUP,\n COLUMNS,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n} from '../../types'\nimport {\n calculateMonthDropDate,\n formatDate,\n getMonthDays,\n getWeekNumber,\n getWeekdaysNames,\n toDateString,\n} from '../../utils'\nimport { handleGridKeydown } from '../keyboard-navigation'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getMonthViewEvents } from './get-month-view-events/get-month-view-events'\nimport { getRenderableMonthEventSegments } from './get-renderable-month-event-segments'\nimport type { MonthViewEmits, MonthViewSlots } from './MonthView.types'\nimport classes from './MonthView.module.css'\n\ndefineOptions({\n name: 'MonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MonthViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n withInteractiveBackgroundEvents: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekDays: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n withOutsideDays: undefined,\n maxEventsPerDay: undefined,\n getDayProps: undefined,\n getWeekNumberProps: undefined,\n canDragEvent: undefined,\n monthYearSelectProps: undefined,\n moreEventsProps: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MonthViewSlots>()\n\nconst emit = defineEmits<MonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('MonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'monthView',\n})\n\n/**\n * Cached per selector: the grid renders one cell per day of the month, and rebuilding the same\n * class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst monthGrid = ref<HTMLElement | null>(null)\n\nconst dropTarget = shallowRef<DateStringValue | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\n\nconst maxEventsPerDay = computed(() => clampMaxEvents(props.maxEventsPerDay!))\n\nconst weeks = computed(() =>\n getMonthDays({\n month: month.value,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst flatDays = computed(() => weeks.value.flat().map((date) => toDateString(date)))\n\nconst firstFocusableDayIndex = computed(() =>\n weeks.value\n .flat()\n .findIndex((date) => props.withOutsideDays || dayjs(date).isSame(month.value, 'month')),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n weeks.value[0][0],\n dayjs(weeks.value.at(-1)!.at(-1)!).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst grouped = computed(() =>\n getMonthViewEvents({\n date: month.value,\n events: expandedEvents.value,\n firstDayOfWeek: props.firstDayOfWeek,\n withOutsideDays: props.withOutsideDays,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst weekSegments = computed(() =>\n weeks.value.map((week, weekIndex) =>\n getRenderableMonthEventSegments({\n events: grouped.value.groupedByWeek[String(weekIndex)] || [],\n groupedByDay: grouped.value.groupedByDay,\n maxEventsPerDay: maxEventsPerDay.value,\n week,\n }),\n ),\n)\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex) => {\n const startDay = flatDays.value[startIndex]\n const endDay = flatDays.value[endIndex]\n\n if (startDay && endDay) {\n emit(\n 'slotDragEnd',\n dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n )\n }\n },\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => (dropTarget.value ? { date: dropTarget.value } : null),\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n highlightDay.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n monthValue: month.value.month(),\n yearValue: month.value.year(),\n onMonthChange: (value: number) => changeDate(toDateString(month.value.month(value))),\n onYearChange: (value: number) => changeDate(toDateString(month.value.year(value))),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst dayProps = (date: string) => props.getDayProps?.(toDateString(date)) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDateString(weekStart)) ?? {}\n\nconst isOutside = (date: string | Date) => !dayjs(date).isSame(month.value, 'month')\n\n/** Outside days are rendered as empty placeholders when `withOutsideDays` is off. */\nconst isHiddenDay = (date: string | Date) => isOutside(date) && !props.withOutsideDays\n\nconst dayEvents = (date: string | Date) =>\n grouped.value.groupedByDay[dayjs(date).format('YYYY-MM-DD 00:00:00')] || []\n\nconst hiddenEventsCount = (date: string | Date) =>\n Math.max(0, dayEvents(date).length - maxEventsPerDay.value)\n\nconst handleDayKeydown = (nativeEvent: KeyboardEvent, gridIndex: number) => {\n handleGridKeydown({\n event: nativeEvent,\n index: gridIndex,\n columns: COLUMNS,\n total: weeks.value.length * COLUMNS,\n getControl: (index) =>\n monthGrid.value?.querySelector<HTMLButtonElement>(\n `[data-grid-index=\"${index}\"]:not([data-hidden])`,\n ) ?? null,\n })\n}\n\nconst setDropTarget = (next: DateStringValue | null) => {\n if (dropTarget.value !== next) {\n dropTarget.value = next\n }\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and every change\n * of the highlight re-renders the whole month grid.\n */\nconst highlightDay = rafThrottle((date: DateStringValue) => setDropTarget(date))\n\nconst handleDragOver = (nativeEvent: DragEvent, date: string | Date) => {\n // `preventDefault` and `dropEffect` stay synchronous: the browser reads them as the handler\n // returns, so they cannot be deferred to the next frame.\n nativeEvent.preventDefault()\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.dropEffect = nativeEvent.dataTransfer.types.includes(\n 'application/json',\n )\n ? 'move'\n : 'copy'\n }\n\n highlightDay(toDateString(date))\n}\n\nconst handleDragLeave = (nativeEvent: DragEvent) => {\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !monthGrid.value?.contains(nativeEvent.relatedTarget)\n ) {\n highlightDay.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleDrop = (nativeEvent: DragEvent, date: string | Date) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n highlightDay.cancel()\n setDropTarget(null)\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n const { start } = calculateMonthDropDate({\n draggedEvent: event,\n targetDay: toDateString(date),\n })\n emit('eventDrop', moveEventTo(event, start))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, toDateString(date))\n }\n}\n\nconst segmentStyle = (position: { startOffset: number; width: number; row: number }) => ({\n position: 'absolute' as const,\n insetInlineStart: `${position.startOffset}%`,\n width: `${position.width}%`,\n top: `${EVENTS_TOP_OFFSET + position.row * EVENT_ROW_HEIGHT}px`,\n})\n\nconst backgroundSegmentStyle = (position: { startOffset: number; width: number }) => ({\n insetInlineStart: `calc(${position.startOffset}% + 2px)`,\n width: `calc(${position.width}% - 3px)`,\n})\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('monthView') }\"\n :mod=\"[\n {\n 'with-week-numbers': props.withWeekNumbers,\n 'with-weekdays': props.withWeekDays,\n static: isStatic,\n 'slot-dragging': slotDragSelect.isDragging(),\n },\n (attrs as any).mod,\n ]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"month\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'month')\"\n :control=\"headerControl\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('monthViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div ref=\"monthGrid\" v-bind=\"getStyles('monthViewInner')\">\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('monthViewWeekdays')\">\n <div v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('monthViewWeekdaysCorner')\" />\n <div\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"staticStyles('monthViewWeekday')\"\n >\n {{ weekday }}\n </div>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"staticStyles('monthViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n type=\"button\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('monthViewWeekNumber', { className: weekNumberProps(week[0]).class }),\n }\"\n @click=\"emit('weekNumberClick', toDateString(week[0]), $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <div\n v-for=\"(date, dayIndex) in week\"\n :key=\"toDateString(date)\"\n v-bind=\"staticStyles('monthViewDay')\"\n :data-outside=\"isOutside(date) || undefined\"\n :data-weekend=\"props.weekendDays!.includes(dayjs(date).day() as DayOfWeek) || undefined\"\n :data-static=\"isStatic || undefined\"\n :data-drop-target=\"dropTarget === toDateString(date) || undefined\"\n :data-drag-selected=\"\n slotDragSelect.isSlotSelected(weekIndex * COLUMNS + dayIndex, MONTH_SLOT_GROUP) ||\n undefined\n \"\n :data-drag-slot-index=\"withSlotSelect ? weekIndex * COLUMNS + dayIndex : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? MONTH_SLOT_GROUP : undefined\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown(\n $event,\n weekIndex * COLUMNS + dayIndex,\n MONTH_SLOT_GROUP,\n )\n : undefined\n \"\n @dragover=\"withDragHandlers ? handleDragOver($event, date) : $event.preventDefault()\"\n @dragleave=\"withDragHandlers ? handleDragLeave($event) : undefined\"\n @drop=\"handleDrop($event, date)\"\n >\n <UnstyledButton\n type=\"button\"\n v-bind=\"{\n ...dayProps(date as string),\n ...getStyles('monthViewDayLabel', { className: dayProps(date as string).class }),\n }\"\n :disabled=\"isStatic\"\n :data-grid-index=\"weekIndex * COLUMNS + dayIndex\"\n :data-outside=\"isOutside(date) || undefined\"\n :data-hidden=\"isHiddenDay(date) || undefined\"\n :aria-label=\"\n formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\n \"\n :data-today=\"\n (props.highlightToday && dayjs(date).isSame(dayjs(), 'day')) || undefined\n \"\n :tabindex=\"\n isStatic ? -1 : weekIndex * COLUMNS + dayIndex === firstFocusableDayIndex ? 0 : -1\n \"\n @click=\"emit('dayClick', toDateString(date), $event)\"\n @keydown=\"\n isStatic ? undefined : handleDayKeydown($event, weekIndex * COLUMNS + dayIndex)\n \"\n >\n {{ isHiddenDay(date) ? '' : dayjs(date).date() }}\n </UnstyledButton>\n\n <MoreEvents\n v-if=\"hiddenEventsCount(date) > 0\"\n :events=\"dayEvents(date)\"\n :more-events-count=\"hiddenEventsCount(date)\"\n :labels=\"props.labels\"\n :mode=\"props.mode\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"clickEvent\"\n />\n </div>\n\n <div v-bind=\"getStyles('monthViewEvents')\">\n <ScheduleBackgroundEvent\n v-for=\"event in grouped.backgroundByWeek[String(weekIndex)] || []\"\n :key=\"`background-${event.id}-${weekIndex}`\"\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...staticStyles('monthViewBackgroundEvent') }\"\n :style=\"backgroundSegmentStyle(event.position)\"\n @event-click=\"clickEvent\"\n />\n\n <ScheduleEvent\n v-for=\"segment in weekSegments[weekIndex]\"\n :key=\"segment.key\"\n :event=\"segment.event\"\n nowrap\n :hanging=\"segment.position.hanging\"\n :mode=\"props.mode\"\n :data-clip-start=\"segment.clipStart || undefined\"\n :data-clip-end=\"segment.clipEnd || undefined\"\n :style=\"segmentStyle(segment.position)\"\n :draggable=\"isDraggableEvent(segment.event)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(segment.event, $event)\"\n />\n </div>\n </div>\n </div>\n </ScrollArea>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { MonthViewOwnProps } from './MonthView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n firstDayOfWeek: 1,\n weekdayFormat: 'ddd',\n weekendDays: [0, 6],\n withWeekDays: true,\n consistentWeeks: true,\n highlightToday: true,\n withOutsideDays: true,\n maxEventsPerDay: 2,\n} satisfies Partial<MonthViewOwnProps>\n\n/** Vertical offset of the first event row, past the day label, in px. */\nconst EVENTS_TOP_OFFSET = 28\n\n/** Vertical step between stacked event rows, in px. */\nconst EVENT_ROW_HEIGHT = 22\n\n/** Group name of the month grid for slot drag selection – a month has a single grid. */\nconst MONTH_SLOT_GROUP = 'month'\n\nconst COLUMNS = 7\n\n/** `maxEventsPerDay` is clamped so the CSS grid keeps a workable row height. */\nfunction clampMaxEvents(value: number) {\n return Math.min(10, Math.max(1, value))\n}\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius, maxEventsPerDay }) => ({\n monthView: {\n '--month-view-radius': resolveScheduleRadius(radius),\n '--month-view-max-events': String(\n clampMaxEvents(maxEventsPerDay ?? defaultProps.maxEventsPerDay),\n ),\n },\n}))\n\nexport {\n defaultProps,\n varsResolver,\n clampMaxEvents,\n EVENTS_TOP_OFFSET,\n EVENT_ROW_HEIGHT,\n MONTH_SLOT_GROUP,\n COLUMNS,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n} from '../../types'\nimport {\n calculateMonthDropDate,\n formatDate,\n getMonthDays,\n getWeekNumber,\n getWeekdaysNames,\n toDateString,\n} from '../../utils'\nimport { handleGridKeydown } from '../keyboard-navigation'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getMonthViewEvents } from './get-month-view-events/get-month-view-events'\nimport { getRenderableMonthEventSegments } from './get-renderable-month-event-segments'\nimport type { MonthViewEmits, MonthViewSlots } from './MonthView.types'\nimport classes from './MonthView.module.css'\n\ndefineOptions({\n name: 'MonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<MonthViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n withInteractiveBackgroundEvents: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekDays: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n withOutsideDays: undefined,\n maxEventsPerDay: undefined,\n getDayProps: undefined,\n getWeekNumberProps: undefined,\n canDragEvent: undefined,\n monthYearSelectProps: undefined,\n moreEventsProps: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<MonthViewSlots>()\n\nconst emit = defineEmits<MonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('MonthView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'MonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'monthView',\n})\n\n/**\n * Cached per selector: the grid renders one cell per day of the month, and rebuilding the same\n * class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst monthGrid = ref<HTMLElement | null>(null)\n\nconst dropTarget = shallowRef<DateStringValue | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\n\nconst maxEventsPerDay = computed(() => clampMaxEvents(props.maxEventsPerDay!))\n\nconst weeks = computed(() =>\n getMonthDays({\n month: month.value,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst flatDays = computed(() => weeks.value.flat().map((date) => toDateString(date)))\n\nconst firstFocusableDayIndex = computed(() =>\n weeks.value\n .flat()\n .findIndex((date) => props.withOutsideDays || dayjs(date).isSame(month.value, 'month')),\n)\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n weeks.value[0][0],\n dayjs(weeks.value.at(-1)!.at(-1)!).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst grouped = computed(() =>\n getMonthViewEvents({\n date: month.value,\n events: expandedEvents.value,\n firstDayOfWeek: props.firstDayOfWeek,\n withOutsideDays: props.withOutsideDays,\n consistentWeeks: props.consistentWeeks,\n }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst weekSegments = computed(() =>\n weeks.value.map((week, weekIndex) =>\n getRenderableMonthEventSegments({\n events: grouped.value.groupedByWeek[String(weekIndex)] || [],\n groupedByDay: grouped.value.groupedByDay,\n maxEventsPerDay: maxEventsPerDay.value,\n week,\n }),\n ),\n)\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex) => {\n const startDay = flatDays.value[startIndex]\n const endDay = flatDays.value[endIndex]\n\n if (startDay && endDay) {\n emit(\n 'slotDragEnd',\n dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n )\n }\n },\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => (dropTarget.value ? { date: dropTarget.value } : null),\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n highlightDay.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n monthValue: month.value.month(),\n yearValue: month.value.year(),\n onMonthChange: (value: number) => changeDate(toDateString(month.value.month(value))),\n onYearChange: (value: number) => changeDate(toDateString(month.value.year(value))),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst dayProps = (date: string) => props.getDayProps?.(toDateString(date)) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDateString(weekStart)) ?? {}\n\nconst isOutside = (date: string | Date) => !dayjs(date).isSame(month.value, 'month')\n\n/** Outside days are rendered as empty placeholders when `withOutsideDays` is off. */\nconst isHiddenDay = (date: string | Date) => isOutside(date) && !props.withOutsideDays\n\nconst dayEvents = (date: string | Date) =>\n grouped.value.groupedByDay[dayjs(date).format('YYYY-MM-DD 00:00:00')] || []\n\nconst hiddenEventsCount = (date: string | Date) =>\n Math.max(0, dayEvents(date).length - maxEventsPerDay.value)\n\nconst handleDayKeydown = (nativeEvent: KeyboardEvent, gridIndex: number) => {\n handleGridKeydown({\n event: nativeEvent,\n index: gridIndex,\n columns: COLUMNS,\n total: weeks.value.length * COLUMNS,\n getControl: (index) =>\n monthGrid.value?.querySelector<HTMLButtonElement>(\n `[data-grid-index=\"${index}\"]:not([data-hidden])`,\n ) ?? null,\n })\n}\n\nconst setDropTarget = (next: DateStringValue | null) => {\n if (dropTarget.value !== next) {\n dropTarget.value = next\n }\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and every change\n * of the highlight re-renders the whole month grid.\n */\nconst highlightDay = rafThrottle((date: DateStringValue) => setDropTarget(date))\n\nconst handleDragOver = (nativeEvent: DragEvent, date: string | Date) => {\n // `preventDefault` and `dropEffect` stay synchronous: the browser reads them as the handler\n // returns, so they cannot be deferred to the next frame.\n nativeEvent.preventDefault()\n\n if (nativeEvent.dataTransfer) {\n nativeEvent.dataTransfer.dropEffect = nativeEvent.dataTransfer.types.includes(\n 'application/json',\n )\n ? 'move'\n : 'copy'\n }\n\n highlightDay(toDateString(date))\n}\n\nconst handleDragLeave = (nativeEvent: DragEvent) => {\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !monthGrid.value?.contains(nativeEvent.relatedTarget)\n ) {\n highlightDay.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleDrop = (nativeEvent: DragEvent, date: string | Date) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n highlightDay.cancel()\n setDropTarget(null)\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n const { start } = calculateMonthDropDate({\n draggedEvent: event,\n targetDay: toDateString(date),\n })\n emit('eventDrop', moveEventTo(event, start))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, toDateString(date))\n }\n}\n\nconst segmentStyle = (position: { startOffset: number; width: number; row: number }) => ({\n position: 'absolute' as const,\n insetInlineStart: `${position.startOffset}%`,\n width: `${position.width}%`,\n top: `${EVENTS_TOP_OFFSET + position.row * EVENT_ROW_HEIGHT}px`,\n})\n\nconst backgroundSegmentStyle = (position: { startOffset: number; width: number }) => ({\n insetInlineStart: `calc(${position.startOffset}% + 2px)`,\n width: `calc(${position.width}% - 3px)`,\n})\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('monthView') }\"\n :mod=\"[\n {\n 'with-week-numbers': props.withWeekNumbers,\n 'with-weekdays': props.withWeekDays,\n static: isStatic,\n 'slot-dragging': slotDragSelect.isDragging(),\n },\n (attrs as any).mod,\n ]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"month\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'month')\"\n :control=\"headerControl\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('monthViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div ref=\"monthGrid\" v-bind=\"getStyles('monthViewInner')\">\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('monthViewWeekdays')\">\n <div v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('monthViewWeekdaysCorner')\" />\n <div\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"staticStyles('monthViewWeekday')\"\n >\n {{ weekday }}\n </div>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"staticStyles('monthViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n type=\"button\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('monthViewWeekNumber', { className: weekNumberProps(week[0]).class }),\n }\"\n @click=\"emit('weekNumberClick', toDateString(week[0]), $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <div\n v-for=\"(date, dayIndex) in week\"\n :key=\"toDateString(date)\"\n v-bind=\"staticStyles('monthViewDay')\"\n :data-outside=\"isOutside(date) || undefined\"\n :data-weekend=\"props.weekendDays!.includes(dayjs(date).day() as DayOfWeek) || undefined\"\n :data-static=\"isStatic || undefined\"\n :data-drop-target=\"dropTarget === toDateString(date) || undefined\"\n :data-drag-selected=\"\n slotDragSelect.isSlotSelected(weekIndex * COLUMNS + dayIndex, MONTH_SLOT_GROUP) ||\n undefined\n \"\n :data-drag-slot-index=\"withSlotSelect ? weekIndex * COLUMNS + dayIndex : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? MONTH_SLOT_GROUP : undefined\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown(\n $event,\n weekIndex * COLUMNS + dayIndex,\n MONTH_SLOT_GROUP,\n )\n : undefined\n \"\n @dragover=\"withDragHandlers ? handleDragOver($event, date) : $event.preventDefault()\"\n @dragleave=\"withDragHandlers ? handleDragLeave($event) : undefined\"\n @drop=\"handleDrop($event, date)\"\n >\n <UnstyledButton\n type=\"button\"\n v-bind=\"{\n ...dayProps(date as string),\n ...getStyles('monthViewDayLabel', { className: dayProps(date as string).class }),\n }\"\n :disabled=\"isStatic\"\n :data-grid-index=\"weekIndex * COLUMNS + dayIndex\"\n :data-outside=\"isOutside(date) || undefined\"\n :data-hidden=\"isHiddenDay(date) || undefined\"\n :aria-label=\"\n formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\n \"\n :data-today=\"\n (props.highlightToday && dayjs(date).isSame(dayjs(), 'day')) || undefined\n \"\n :tabindex=\"\n isStatic ? -1 : weekIndex * COLUMNS + dayIndex === firstFocusableDayIndex ? 0 : -1\n \"\n @click=\"emit('dayClick', toDateString(date), $event)\"\n @keydown=\"\n isStatic ? undefined : handleDayKeydown($event, weekIndex * COLUMNS + dayIndex)\n \"\n >\n {{ isHiddenDay(date) ? '' : dayjs(date).date() }}\n </UnstyledButton>\n\n <MoreEvents\n v-if=\"hiddenEventsCount(date) > 0\"\n :events=\"dayEvents(date)\"\n :more-events-count=\"hiddenEventsCount(date)\"\n :labels=\"props.labels\"\n :mode=\"props.mode\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"clickEvent\"\n />\n </div>\n\n <div v-bind=\"getStyles('monthViewEvents')\">\n <ScheduleBackgroundEvent\n v-for=\"event in grouped.backgroundByWeek[String(weekIndex)] || []\"\n :key=\"`background-${event.id}-${weekIndex}`\"\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...staticStyles('monthViewBackgroundEvent') }\"\n :style=\"backgroundSegmentStyle(event.position)\"\n @event-click=\"clickEvent\"\n />\n\n <ScheduleEvent\n v-for=\"segment in weekSegments[weekIndex]\"\n :key=\"segment.key\"\n :event=\"segment.event\"\n nowrap\n :hanging=\"segment.position.hanging\"\n :mode=\"props.mode\"\n :data-clip-start=\"segment.clipStart || undefined\"\n :data-clip-end=\"segment.clipEnd || undefined\"\n :style=\"segmentStyle(segment.position)\"\n :draggable=\"isDraggableEvent(segment.event)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(segment.event, $event)\"\n />\n </div>\n </div>\n </div>\n </ScrollArea>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport MonthViewComponent, { varsResolver } from './MonthView.vue'\nimport type { MonthViewFactory } from './MonthView.types'\nimport classes from './MonthView.module.css'\n\nexport const MonthView = factory<MonthViewFactory>(MonthViewComponent, { classes, varsResolver })\n\nexport type {\n MonthViewCssVariables,\n MonthViewEmits,\n MonthViewFactory,\n MonthViewOwnProps,\n MonthViewOwnStylesNames,\n MonthViewProps,\n MonthViewSlots,\n MonthViewStylesNames,\n} from './MonthView.types'\n","import dayjs from 'dayjs'\nimport type { VNodeChild } from 'vue'\nimport { DateLabelFormat, DateStringValue } from '../../../types'\nimport { formatDate } from '../../../utils'\n\ninterface GetWeekLabelInput {\n weekdays: Date[] | string[]\n locale: string\n weekLabelFormat: DateLabelFormat\n renderWeekLabel?: (params: { weekStart: DateStringValue; weekEnd: DateStringValue }) => VNodeChild\n}\n\nexport function getWeekLabel({\n weekdays,\n locale,\n weekLabelFormat,\n renderWeekLabel,\n}: GetWeekLabelInput) {\n if (renderWeekLabel) {\n return renderWeekLabel({\n weekStart: dayjs(weekdays[0]).format('YYYY-MM-DD'),\n weekEnd: dayjs(weekdays[weekdays.length - 1]).format('YYYY-MM-DD'),\n })\n }\n\n return `${formatDate({\n locale,\n date: weekdays[0],\n format: weekLabelFormat,\n })} – ${formatDate({\n locale,\n date: weekdays[weekdays.length - 1],\n format: weekLabelFormat,\n })}, ${formatDate({ locale, date: weekdays[0], format: 'YYYY' })}`\n}\n","import { AnyDateValue, DayOfWeek, ScheduleEventData } from '../../../types'\nimport { isEventInTimeRange, isWithinWeek, validateEvent } from '../../../utils'\n\nexport interface FilterWeekViewEventsInput {\n /** Date (week start) at which events are positioned, used to check if events are all-day */\n date: AnyDateValue\n\n /** List of all events that belong to the given week, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[] | undefined\n\n /** Start time of the week view, used to calculate event positions */\n startTime?: string\n\n /** End time of the week view, used to calculate event positions */\n endTime?: string\n\n /** First day of the week, 0 - Sunday, 1 - Monday, etc., used to calculate events positions */\n firstDayOfWeek?: DayOfWeek\n}\n\nexport function filterWeekViewEvents({\n date,\n events,\n startTime,\n endTime,\n firstDayOfWeek = 1,\n}: FilterWeekViewEventsInput): ScheduleEventData[] {\n if (events === undefined) {\n return []\n }\n\n const ids = new Set<string | number>()\n const filteredEvents: ScheduleEventData[] = []\n\n for (const event of events) {\n if (\n isWithinWeek({ event, targetWeek: date, firstDayOfWeek }) &&\n isEventInTimeRange({ event, startTime, endTime })\n ) {\n filteredEvents.push(validateEvent(event))\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(`[@mantine/schedule] WeekView: Duplicated event ids found: ${event.id}`)\n }\n }\n }\n\n return filteredEvents\n}\n","import { ScheduleEventData, WeekPositionedEventData } from '../../../types'\nimport { isEventsOverlap } from '../../../utils'\n\nexport function assignEventRows(events: WeekPositionedEventData[]): Map<ScheduleEventData, number> {\n const eventRows = new Map<ScheduleEventData, number>()\n\n for (const event of events) {\n let row = 0\n\n while (true) {\n let hasConflict = false\n\n for (const [otherEvent, otherRow] of eventRows.entries()) {\n if (otherRow === row && isEventsOverlap(event, otherEvent)) {\n hasConflict = true\n break\n }\n }\n\n if (!hasConflict) {\n break\n }\n\n row++\n }\n\n eventRows.set(event, row)\n }\n\n return eventRows\n}\n","import dayjs, { Dayjs } from 'dayjs'\nimport { DateStringValue } from '../../../types'\n\ninterface CalculateAllDayEventOffsetInput {\n eventStartDate: Dayjs\n weekStartDate: Dayjs\n weekDays: DateStringValue[]\n visibleDaysCount: number\n hangingStart: boolean\n}\n\nexport function calculateAllDayEventOffset({\n eventStartDate,\n weekStartDate,\n weekDays,\n visibleDaysCount,\n hangingStart,\n}: CalculateAllDayEventOffsetInput): number {\n let displayStartDate = eventStartDate\n\n if (hangingStart) {\n displayStartDate = weekStartDate\n }\n\n if (!weekDays.some((day) => dayjs(day).isSame(displayStartDate, 'day'))) {\n displayStartDate = dayjs(weekDays[0])\n }\n\n const visibleDaysBeforeEvent =\n weekDays.filter(\n (day) => dayjs(day).isBefore(displayStartDate) || dayjs(day).isSame(displayStartDate, 'day'),\n ).length - 1\n\n return (visibleDaysBeforeEvent / visibleDaysCount) * 100\n}\n","import dayjs, { Dayjs } from 'dayjs'\nimport { DateStringValue } from '../../../types'\n\ninterface CalculateAllDayEventWidthInput {\n eventStartDate: Dayjs\n actualEndDate: Dayjs\n weekStartDate: Dayjs\n weekEndDate: Dayjs\n weekDays: DateStringValue[]\n visibleDaysCount: number\n}\n\nexport function calculateAllDayEventWidth({\n eventStartDate,\n actualEndDate,\n weekStartDate,\n weekEndDate,\n weekDays,\n visibleDaysCount,\n}: CalculateAllDayEventWidthInput): number {\n let displayStartDate = eventStartDate\n if (eventStartDate.isBefore(weekStartDate)) {\n displayStartDate = weekStartDate\n }\n\n let displayEndDate = actualEndDate\n if (actualEndDate.isAfter(weekEndDate)) {\n displayEndDate = weekEndDate\n }\n\n const visibleDaysSpanned = weekDays.filter(\n (day) =>\n (dayjs(day).isAfter(displayStartDate) || dayjs(day).isSame(displayStartDate, 'day')) &&\n (dayjs(day).isBefore(displayEndDate) || dayjs(day).isSame(displayEndDate, 'day')),\n ).length\n\n return (visibleDaysSpanned / visibleDaysCount) * 100\n}\n","import dayjs, { Dayjs } from 'dayjs'\nimport { DateStringValue, ScheduleEventData } from '../../../types'\n\ninterface CalculateEventDaysInput {\n event: ScheduleEventData\n weekDays: DateStringValue[]\n actualEndDate: Dayjs\n}\n\nexport function calculateEventDays({ event, weekDays, actualEndDate }: CalculateEventDaysInput) {\n const eventStartDate = dayjs(event.start).startOf('day')\n\n return weekDays.filter((day) => {\n const dayDate = dayjs(day).startOf('day')\n return (\n (dayDate.isAfter(eventStartDate) || dayDate.isSame(eventStartDate)) &&\n (dayDate.isBefore(actualEndDate) || dayDate.isSame(actualEndDate))\n )\n })\n}\n","import { WeekPositionedEventData } from '../../../types'\nimport { isEventsOverlap } from '../../../utils'\n\nexport function calculateRegularEventOverlaps(events: WeekPositionedEventData[]): void {\n for (const event of events) {\n let maxOverlappingColumn = event.position.column\n\n for (const otherEvent of events) {\n if (isEventsOverlap(event, otherEvent)) {\n maxOverlappingColumn = Math.max(maxOverlappingColumn, otherEvent.position.column)\n }\n }\n\n const overlaps = maxOverlappingColumn + 1\n event.position.overlaps = overlaps\n event.position.width = 100 / overlaps\n event.position.offset = (event.position.column * 100) / overlaps\n }\n}\n","import { ScheduleEventData } from '../../../types'\nimport { isEventsOverlap } from '../../../utils'\n\nexport interface ColumnEvent {\n event: ScheduleEventData\n allDay: boolean\n}\n\ninterface FindAvailableColumnInput {\n columns: Map<string, ColumnEvent[]>\n event: ScheduleEventData\n allDay: boolean\n}\n\nfunction columnHasConflict({\n columns,\n columnIndex,\n event,\n allDay,\n}: FindAvailableColumnInput & { columnIndex: number }): boolean {\n const columnKey = `col-${columnIndex}`\n if (!columns.has(columnKey)) {\n return false\n }\n\n const columnEvents = columns.get(columnKey)!\n\n return columnEvents.some((columnEvent) => {\n const hasTimeConflict = isEventsOverlap(columnEvent.event, event)\n\n if (allDay && columnEvent.allDay) {\n return hasTimeConflict\n }\n\n if (allDay || columnEvent.allDay) {\n return false\n }\n\n return hasTimeConflict\n })\n}\n\nexport function findAvailableColumn(input: FindAvailableColumnInput): number {\n let column = 0\n\n while (columnHasConflict({ ...input, columnIndex: column })) {\n column++\n }\n\n return column\n}\n","import dayjs from 'dayjs'\nimport { ScheduleEventData } from '../../../types'\n\nexport function getEventEndDate(event: ScheduleEventData) {\n const eventEndDate = dayjs(event.end).startOf('day')\n\n if (dayjs(event.end).hour() === 0 && dayjs(event.end).minute() === 0) {\n return eventEndDate.subtract(1, 'day')\n }\n\n return eventEndDate\n}\n","import dayjs, { Dayjs } from 'dayjs'\nimport { DateStringValue } from '../../../types'\n\ninterface GetHangingStatusInput {\n eventStartDate: Dayjs\n actualEndDate: Dayjs\n weekDays: DateStringValue[]\n}\n\nexport function getHangingStatus({\n eventStartDate,\n actualEndDate,\n weekDays,\n}: GetHangingStatusInput): 'start' | 'end' | 'both' | 'none' {\n const weekStartDate = dayjs(weekDays[0])\n const weekEndDate = dayjs(weekDays[weekDays.length - 1])\n\n const hangingStart = eventStartDate.isBefore(weekStartDate)\n const hangingEnd = actualEndDate.isAfter(weekEndDate)\n\n if (hangingStart && hangingEnd) {\n return 'both'\n }\n\n if (hangingStart) {\n return 'start'\n }\n\n if (hangingEnd) {\n return 'end'\n }\n\n return 'none'\n}\n","import dayjs from 'dayjs'\nimport {\n AnyDateValue,\n DateStringValue,\n DayOfWeek,\n ScheduleEventData,\n WeekPositionedEventData,\n} from '../../../types'\nimport { getDayPosition, getWeekDays, isAllDayEvent, sortEvents } from '../../../utils'\nimport { assignEventRows } from './assign-event-rows'\nimport { calculateAllDayEventOffset } from './calculate-all-day-event-offset'\nimport { calculateAllDayEventWidth } from './calculate-all-day-event-width'\nimport { calculateEventDays } from './calculate-event-days'\nimport { calculateRegularEventOverlaps } from './calculate-regular-event-overlaps'\nimport { findAvailableColumn, type ColumnEvent } from './find-available-column'\nimport { getEventEndDate } from './get-event-end-date'\nimport { getHangingStatus } from './get-hanging-status'\n\nexport interface GetWeekPositionedEventsInput {\n /** Date (week start) at which events are positioned, used to check if events are all-day */\n date: AnyDateValue\n\n /** List of all events that belong to the given week, extra events must be filtered out before passing to the function */\n events: ScheduleEventData[]\n\n /** Start time of the week view, used to calculate event positions */\n startTime?: string\n\n /** End time of the week view, used to calculate event positions */\n endTime?: string\n\n /** Number of minutes per time slot, used to align the canvas to whole slots */\n intervalMinutes?: number\n\n /** First day of the week, 0 - Sunday, 1 - Monday, etc., used to calculate events positions */\n firstDayOfWeek?: DayOfWeek\n\n /** Indices of weekend days, 0-6, where 0 is Sunday and 6 is Saturday */\n weekendDays?: DayOfWeek[]\n\n /** If set to false, weekend days are hidden @default true */\n withWeekendDays?: boolean\n}\n\n/** Events grouped by week day date (YYYY-MM-DD 00:00:00) and by columns */\nexport interface GroupedWeekEvents {\n allDayEvents: WeekPositionedEventData[]\n regularEvents: Record<DateStringValue, WeekPositionedEventData[]>\n backgroundEvents: Record<DateStringValue, WeekPositionedEventData[]>\n}\n\nexport function getWeekPositionedEvents({\n date,\n events,\n startTime,\n endTime,\n intervalMinutes,\n firstDayOfWeek = 1,\n weekendDays = [0, 6],\n withWeekendDays = true,\n}: GetWeekPositionedEventsInput): GroupedWeekEvents {\n const weekDays = getWeekDays({ week: date, firstDayOfWeek, withWeekendDays, weekendDays })\n const visibleDaysCount = weekDays.length\n const weekStartDate = dayjs(weekDays[0])\n const weekEndDate = dayjs(weekDays[weekDays.length - 1])\n\n const grouped: GroupedWeekEvents = {\n allDayEvents: [],\n regularEvents: Object.fromEntries(weekDays.map((day) => [day, []])),\n backgroundEvents: Object.fromEntries(weekDays.map((day) => [day, []])),\n }\n\n const columns = new Map<string, ColumnEvent[]>()\n const allDayColumns = new Map<string, ColumnEvent[]>()\n const sorted = sortEvents(events)\n\n for (const event of sorted) {\n if (event.display === 'background') {\n const eventStartDate = dayjs(event.start).startOf('day')\n const actualEndDate = getEventEndDate(event)\n const eventWeekDays = calculateEventDays({ event, weekDays, actualEndDate })\n const hanging = getHangingStatus({ eventStartDate, actualEndDate, weekDays })\n\n for (const day of eventWeekDays) {\n const visibleDayIndex = weekDays.indexOf(day)\n if (visibleDayIndex === -1) {\n continue\n }\n\n const dayStart = dayjs(day)\n const dayEnd = dayStart.endOf('day')\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd\n\n const clippedEvent = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n }\n\n const isAllDay = isAllDayEvent({ event: clippedEvent, date: day })\n const verticalPosition = isAllDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event: clippedEvent, startTime, endTime, intervalMinutes })\n\n if (!isAllDay && verticalPosition.height <= 0) {\n continue\n }\n\n const dayWeekOffset = (visibleDayIndex / visibleDaysCount) * 100\n\n grouped.backgroundEvents[day].push({\n ...event,\n position: {\n ...verticalPosition,\n allDay: isAllDay,\n column: 0,\n width: 100,\n offset: 0,\n overlaps: 1,\n weekOffset: dayWeekOffset,\n row: 0,\n hanging,\n },\n })\n }\n\n continue\n }\n const eventStartDate = dayjs(event.start).startOf('day')\n const actualEndDate = getEventEndDate(event)\n const eventWeekDays = calculateEventDays({ event, weekDays, actualEndDate })\n\n if (eventWeekDays.length === 0) {\n continue\n }\n\n const isMultiday = actualEndDate.isAfter(eventStartDate)\n const hanging = getHangingStatus({ eventStartDate, actualEndDate, weekDays })\n const isActuallyAllDay = eventWeekDays.some((day) => isAllDayEvent({ event, date: day }))\n const allDay = isMultiday || isActuallyAllDay\n\n const columnMap = allDay ? allDayColumns : columns\n const column = findAvailableColumn({\n columns: columnMap,\n event,\n allDay,\n })\n\n const columnKey = `col-${column}`\n if (!columnMap.has(columnKey)) {\n columnMap.set(columnKey, [])\n }\n columnMap.get(columnKey)!.push({ event, allDay: isActuallyAllDay })\n\n const verticalPosition = allDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event, startTime, endTime, intervalMinutes })\n\n if (allDay) {\n const offset = calculateAllDayEventOffset({\n eventStartDate,\n weekStartDate,\n weekDays,\n visibleDaysCount,\n hangingStart: hanging === 'start' || hanging === 'both',\n })\n\n grouped.allDayEvents.push({\n ...event,\n position: {\n ...verticalPosition,\n allDay,\n column,\n width: 0,\n offset,\n overlaps: 0,\n row: 0,\n hanging,\n },\n })\n } else {\n for (const day of eventWeekDays) {\n const visibleDayIndex = weekDays.indexOf(day)\n\n if (visibleDayIndex === -1) {\n continue\n }\n\n const dayWeekOffset = (visibleDayIndex / visibleDaysCount) * 100\n\n grouped.regularEvents[day].push({\n ...event,\n position: {\n ...verticalPosition,\n allDay,\n column,\n width: 0,\n offset: 0,\n overlaps: 0,\n weekOffset: dayWeekOffset,\n row: 0,\n hanging,\n },\n })\n }\n }\n }\n\n for (const day of weekDays) {\n calculateRegularEventOverlaps(grouped.regularEvents[day])\n }\n\n if (grouped.allDayEvents.length > 0) {\n const eventRows = assignEventRows(grouped.allDayEvents)\n const assignedRows = new Set<number>()\n\n for (const event of grouped.allDayEvents) {\n const row = eventRows.get(event)!\n event.position.row = row\n assignedRows.add(row)\n }\n\n const rowCount = Math.max(...assignedRows) + 1\n\n for (const event of grouped.allDayEvents) {\n const eventStartDate = dayjs(event.start).startOf('day')\n const actualEndDate = getEventEndDate(event)\n\n event.position.width = calculateAllDayEventWidth({\n eventStartDate,\n actualEndDate,\n weekStartDate,\n weekEndDate,\n weekDays,\n visibleDaysCount,\n })\n\n event.position.overlaps = rowCount\n }\n }\n\n return grouped\n}\n","import { ScheduleEventData } from '../../../types'\nimport { filterWeekViewEvents } from './filter-week-view-events'\nimport {\n getWeekPositionedEvents,\n GetWeekPositionedEventsInput,\n GroupedWeekEvents,\n} from './get-week-positioned-events'\n\ninterface GetWeekViewEventsInput extends Omit<GetWeekPositionedEventsInput, 'events'> {\n events: ScheduleEventData[] | undefined\n}\n\nexport function getWeekViewEvents(input: GetWeekViewEventsInput): GroupedWeekEvents {\n return getWeekPositionedEvents({ ...input, events: filterWeekViewEvents(input) })\n}\n",".weekView {\n --week-view-week-day-height: 58px;\n --week-view-all-day-slots-height: 48px;\n --week-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --week-view-slots-label-width: 80px;\n --week-view-min-slot-width: 80px;\n --week-view-slot-height: 64px;\n\n @mixin where-light {\n --week-view-border-color: var(--mantine-color-gray-3);\n --week-view-business-hours-bg: var(--mantine-color-white);\n --week-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --week-view-border-color: var(--mantine-color-dark-4);\n --week-view-business-hours-bg: var(--mantine-color-dark-7);\n --week-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.weekViewRoot {\n --indicator-labels-offset: calc(var(--week-view-slots-label-width) / var(--number-of-days));\n\n border: 1px solid var(--week-view-border-color);\n border-radius: var(--week-view-radius);\n overflow: hidden;\n}\n\n.weekViewInner {\n display: flex;\n position: relative;\n overflow: hidden;\n}\n\n.weekViewScrollArea {\n :where(:global(.mantine-ScrollArea-scrollbar)) {\n z-index: 4;\n }\n}\n\n.weekViewHeader {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--week-view-border-color);\n margin-bottom: -1px;\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n}\n\n.weekViewCorner {\n height: var(--week-view-week-day-height);\n flex: 0 0 var(--week-view-slots-label-width);\n min-width: var(--week-view-slots-label-width);\n line-height: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.weekViewSlotLabels {\n flex: 0 0 var(--week-view-slots-label-width);\n min-width: var(--week-view-slots-label-width);\n background-color: var(--mantine-color-body);\n}\n\n.weekViewSlotLabel {\n border-top: 1px solid var(--week-view-border-color);\n text-align: right;\n height: var(--week-view-slot-height);\n padding: 4px;\n padding-inline-end: 8px;\n font-size: var(--mantine-font-size-sm);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n\n &:where([data-business-hours]) {\n background-color: var(--week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--week-view-non-business-hours-bg);\n }\n}\n\n.weekViewDay {\n flex: 1;\n border-inline-start: 1px solid var(--week-view-border-color);\n}\n\n.weekViewDayLabel {\n height: var(--week-view-week-day-height);\n min-width: var(--week-view-min-slot-width);\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n cursor: pointer;\n flex: 1;\n border-inline-start: 1px solid var(--week-view-border-color);\n padding-inline-start: 5px;\n\n &:where([data-weekend]) {\n color: var(--mantine-color-error);\n }\n\n &:where([data-today]) {\n gap: 6px;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.weekViewDayNumber {\n text-align: center;\n width: 26px;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 100%;\n font-size: var(--mantine-font-size-sm);\n\n :where(.weekViewDayLabel[data-today]) & {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n }\n}\n\n.weekViewDayWeekday {\n text-align: center;\n font-size: var(--mantine-font-size-sm);\n text-transform: capitalize;\n}\n\n.weekViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--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.weekViewDaySlots {\n position: relative;\n}\n\n.weekViewDaySlot {\n display: block;\n width: 100%;\n border-top: 1px solid var(--week-view-border-color);\n height: var(--week-view-slot-height);\n min-width: var(--week-view-min-slot-width);\n padding: 4px;\n cursor: pointer;\n position: relative;\n\n &:where(:focus) {\n z-index: 1;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where([data-business-hours]) {\n background-color: var(--week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--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.weekViewWeekLabel {\n text-align: center;\n margin-bottom: 4px;\n font-size: var(--mantine-font-size-sm);\n}\n\n.weekViewWeekNumber {\n font-weight: var(--mantine-font-weight-medium);\n text-align: center;\n font-size: var(--mantine-font-size-lg);\n}\n\n.weekViewAllDaySlots {\n display: flex;\n height: var(--week-view-all-day-slots-height);\n}\n\n.weekViewAllDaySlotsLabel {\n flex: 0 0 var(--week-view-slots-label-width);\n text-align: right;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n}\n\n.weekViewAllDaySlotsEvents {\n position: absolute;\n inset: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n.weekViewAllDaySlotsList {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n\n & > .weekViewDaySlot {\n flex: 1;\n border-inline-start: 1px solid var(--week-view-border-color);\n height: 100%;\n }\n\n &:hover,\n &:focus-within {\n .weekViewAllDaySlotsEvents {\n overflow: visible;\n\n &::before {\n content: '';\n position: absolute;\n top: 100%;\n height: calc(var(--week-view-all-day-slots-height) / 2 * var(--extra-rows));\n inset-inline: 0;\n z-index: 1;\n pointer-events: all;\n }\n }\n }\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { WeekViewOwnProps } from './WeekView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeIndicator: true,\n withCurrentTimeBubble: true,\n slotHeight: 64,\n firstDayOfWeek: 1,\n weekdayFormat: 'ddd',\n dayFormat: 'D',\n withWeekNumber: true,\n withAllDaySlots: true,\n allDaySlotHeight: 44,\n weekendDays: [0, 6],\n withWeekendDays: true,\n weekLabelFormat: 'MMM D',\n} satisfies Partial<WeekViewOwnProps>\n\n/** Vertical step between stacked all-day event rows, in px. */\nconst ALL_DAY_ROW_HEIGHT = 22\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotHeight, allDaySlotHeight, allDaySlotsHeight }) => ({\n weekView: {\n '--week-view-radius': resolveScheduleRadius(radius),\n '--week-view-slot-height': cssSize(slotHeight),\n '--week-view-all-day-slots-height': cssSize(allDaySlotsHeight ?? allDaySlotHeight),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, ALL_DAY_ROW_HEIGHT }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useEventResize } from '../../hooks/use-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n} from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getDayTimeIntervals,\n getWeekDays,\n getWeekNumber,\n} from '../../utils'\nimport { CurrentTimeIndicator } from '../CurrentTimeIndicator'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n moveEventToAllDay,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { useSlotDropTarget } from '../use-slot-drop-target'\nimport { getWeekLabel } from './get-week-label/get-week-label'\nimport { getWeekViewEvents } from './get-week-view-events/get-week-view-events'\nimport type { WeekViewEmits, WeekViewSlots } from './WeekView.types'\nimport classes from './WeekView.module.css'\n\ndefineOptions({\n name: 'WeekView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<WeekViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n withInteractiveBackgroundEvents: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n eventDragInterval: undefined,\n eventResizeInterval: undefined,\n slotLabelFormat: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n slotHeight: undefined,\n businessHours: undefined,\n canDragEvent: undefined,\n startScrollTime: undefined,\n canResizeEvent: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n dayFormat: undefined,\n withWeekNumber: undefined,\n withWeekNumbers: undefined,\n withAllDaySlots: undefined,\n withAllDaySlot: undefined,\n allDaySlotHeight: undefined,\n allDaySlotsHeight: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n weekLabelFormat: undefined,\n renderWeekLabel: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<WeekViewSlots>()\n\nconst emit = defineEmits<WeekViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('WeekView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'WeekView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'weekView',\n})\n\n/**\n * Cached per selector: a week renders one slot per day and interval, and rebuilding the same\n * class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst weekRoot = ref<HTMLElement | null>(null)\nconst setWeekRoot = (node: Element | null) => {\n weekRoot.value = node instanceof HTMLElement ? node : null\n}\n\nconst daySlotsContainers = new Map<string, HTMLElement>()\n\nconst slotDropTarget = useSlotDropTarget()\n\nconst isStatic = computed(() => props.mode === 'static')\n\n/** The plural names are the deprecated aliases; the canonical prop wins when both are set. */\nconst withWeekNumber = computed(() => props.withWeekNumbers ?? props.withWeekNumber)\nconst withAllDaySlots = computed(() => props.withAllDaySlot ?? props.withAllDaySlots)\n\nconst days = computed(() =>\n getWeekDays({\n week: props.date,\n firstDayOfWeek: props.firstDayOfWeek,\n withWeekendDays: props.withWeekendDays,\n weekendDays: props.weekendDays,\n }),\n)\n\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? dayjs()))\n\nconst currentWeekdayIndex = computed(() => {\n if (!props.withCurrentTimeIndicator) {\n return -1\n }\n\n return props.forceCurrentTimeIndicator\n ? days.value.findIndex((date) => dayjs(date).day() === now.value.day())\n : days.value.findIndex((date) => dayjs(date).isSame(now.value, 'day'))\n})\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n dayjs(days.value[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(days.value.at(-1)).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst grouped = computed(() =>\n getWeekViewEvents({\n date: props.date,\n events: expandedEvents.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n firstDayOfWeek: props.firstDayOfWeek,\n weekendDays: props.weekendDays,\n withWeekendDays: props.withWeekendDays,\n }),\n)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst weekLabel = computed(() =>\n getWeekLabel({\n weekdays: days.value,\n locale: props.locale || 'en',\n weekLabelFormat: props.weekLabelFormat!,\n renderWeekLabel: slots.weekLabel\n ? (payload) => slots.weekLabel!(payload)\n : props.renderWeekLabel,\n }),\n)\n\nconst rootVars = computed(() => ({\n '--number-of-days': String(days.value.length),\n '--indicator-offset-index':\n currentWeekdayIndex.value === -1 ? undefined : String(currentWeekdayIndex.value + 1),\n}))\n\n/**\n * Everything the template needs per day column.\n *\n * `days` holds `YYYY-MM-DD 00:00:00` strings, so the grid used to re-derive the day key, the\n * weekend flag and both labels for each of the hundreds of slots it renders. Doing it once per\n * day instead is what keeps a drag re-render cheap.\n */\nconst dayColumns = computed(() =>\n days.value.map((date) => {\n const day = dayjs(date)\n\n return {\n date,\n key: day.format('YYYY-MM-DD') as DateStringValue,\n isWeekend: props.weekendDays!.includes(day.day() as DayOfWeek),\n isToday: day.isSame(now.value, 'day'),\n weekdayLabel: formatDate({\n date,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n }),\n dayLabel: formatDate({ date, locale: props.locale || 'en', format: props.dayFormat! }),\n }\n }),\n)\n\nconst slotLabels = computed(() =>\n intervals.value.map((slot) =>\n formatDate({\n date: `${dayColumns.value[0]?.key} ${slot.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n }),\n ),\n)\n\nconst businessHoursMods = computed(() =>\n days.value.map((date) =>\n intervals.value.map((slot) =>\n getBusinessHoursMod({\n time: slot.startTime,\n businessHours: props.businessHours || ['09:00:00', '17:00:00'],\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayjs(date).day() as DayOfWeek,\n }),\n ),\n ),\n)\n\nconst eventResize = useEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n resizeIntervalMinutes: () => props.eventResizeInterval,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex, group) => {\n const slotDate = dayjs(group).format('YYYY-MM-DD')\n const startSlot = intervals.value[startIndex]\n const endSlot = intervals.value[endIndex]\n\n if (startSlot && endSlot) {\n emit(\n 'slotDragEnd',\n `${slotDate} ${startSlot.startTime}` as DateTimeStringValue,\n `${slotDate} ${endSlot.endTime}` as DateTimeStringValue,\n )\n }\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n const target = weekRoot.value?.querySelector<HTMLElement>(\n `[data-week-day-index=\"0\"][data-time-slot-index=\"${targetIndex}\"]`,\n )\n\n scrollSlotIntoView(target)\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = slotDropTarget.dropTarget.value\n return target\n ? {\n date: target.date,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n slotDropTarget.reset()\n emit('eventDragEnd')\n },\n})\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst setDaySlotsContainer = (date: string) => (element: unknown) => {\n if (element instanceof HTMLElement) {\n daySlotsContainers.set(date, element)\n } else {\n daySlotsContainers.delete(date)\n }\n}\n\nconst focusWeekControl = (nativeEvent: KeyboardEvent, selector: string) => {\n const control = weekRoot.value?.querySelector<HTMLButtonElement>(selector)\n\n if (!control || control.disabled) {\n return\n }\n\n nativeEvent.preventDefault()\n control.focus()\n}\n\nconst handleDayLabelKeydown = (nativeEvent: KeyboardEvent, dayIndex: number) => {\n const next =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : -1\n\n if (next >= 0 && next < days.value.length) {\n focusWeekControl(nativeEvent, `[data-weekday-index=\"${next}\"]`)\n }\n}\n\nconst handleAllDaySlotKeydown = (nativeEvent: KeyboardEvent, dayIndex: number) => {\n if (nativeEvent.key === 'ArrowDown') {\n focusWeekControl(nativeEvent, `[data-week-day-index=\"${dayIndex}\"][data-time-slot-index=\"0\"]`)\n return\n }\n\n const next =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : -1\n\n if (next >= 0 && next < days.value.length) {\n focusWeekControl(nativeEvent, `[data-all-day-index=\"${next}\"]`)\n }\n}\n\nconst handleTimeSlotKeydown = (nativeEvent: KeyboardEvent, dayIndex: number, slotIndex: number) => {\n if (nativeEvent.key === 'ArrowUp' && slotIndex === 0 && withAllDaySlots.value) {\n focusWeekControl(nativeEvent, `[data-all-day-index=\"${dayIndex}\"]`)\n return\n }\n\n const nextDay =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : dayIndex\n const nextSlot =\n nativeEvent.key === 'ArrowDown'\n ? slotIndex + 1\n : nativeEvent.key === 'ArrowUp'\n ? slotIndex - 1\n : slotIndex\n\n if (\n nextDay >= 0 &&\n nextDay < days.value.length &&\n nextSlot >= 0 &&\n nextSlot < intervals.value.length &&\n (nextDay !== dayIndex || nextSlot !== slotIndex)\n ) {\n focusWeekControl(\n nativeEvent,\n `[data-week-day-index=\"${nextDay}\"][data-time-slot-index=\"${nextSlot}\"]`,\n )\n }\n}\n\nconst clickDayLabel = (date: string) => {\n emit('viewChange', 'day')\n emit('dateChange', date as DateStringValue)\n}\n\nconst clickTimeSlot = (date: string, slotIndex: number, nativeEvent: MouseEvent) => {\n const datePart = dayjs(date).format('YYYY-MM-DD')\n const slot = intervals.value[slotIndex]\n\n emit('timeSlotClick', {\n slotStart: `${datePart} ${slot.startTime}` as DateTimeStringValue,\n slotEnd: `${datePart} ${slot.endTime}` as DateTimeStringValue,\n nativeEvent,\n })\n}\n\nconst emitDrop = (nativeEvent: DragEvent, target: DateTimeStringValue) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventTo(event, target))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, target)\n }\n}\n\nconst emitAllDayDrop = (nativeEvent: DragEvent, date: string) => {\n nativeEvent.preventDefault()\n const dayKey = dayjs(date).format('YYYY-MM-DD')\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventToAllDay(event, dayKey))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, `${dayKey} 00:00:00` as DateTimeStringValue)\n }\n}\n\nconst dropInput = (date: string) => ({\n container: daySlotsContainers.get(date),\n date: dayjs(date).format('YYYY-MM-DD') as DateStringValue,\n intervals: intervals.value,\n intervalMinutes: props.intervalMinutes,\n dragIntervalMinutes: props.eventDragInterval,\n startTime: props.startTime,\n endTime: props.endTime,\n})\n\nconst handleDayDragOver = (nativeEvent: DragEvent, date: string) =>\n slotDropTarget.dragOver(nativeEvent, dropInput(date))\n\nconst handleDayDragLeave = (nativeEvent: DragEvent, date: string) =>\n slotDropTarget.dragLeave(nativeEvent, daySlotsContainers.get(date))\n\nconst handleDayDrop = (nativeEvent: DragEvent, date: string) => {\n const target = slotDropTarget.drop(nativeEvent, dropInput(date))\n\n if (target) {\n emitDrop(nativeEvent, target.target)\n }\n}\n\nconst allDayEventStyle = (position: { offset: number; width: number; row: number }) => ({\n position: 'absolute' as const,\n insetInlineStart: `${position.offset}%`,\n width: `${position.width}%`,\n top: `${position.row * ALL_DAY_ROW_HEIGHT}px`,\n})\n\nconst backgroundEventStyle = (position: { top: number; height: number }) => ({\n top: `${position.top}%`,\n bottom: `${100 - position.top - position.height}%`,\n minHeight: '1px',\n width: '100%',\n})\n\nconst regularEventStyle = (event: ScheduleEventData & { position: any }) => {\n const resizePosition = eventResize.getResizePosition(event.id)\n const top = resizePosition?.top ?? event.position.top\n const height = resizePosition?.height ?? event.position.height\n\n return {\n position: 'absolute' as const,\n top: `${top}%`,\n bottom: `${100 - top - height}%`,\n minHeight: '1px',\n width: `${event.position.width}%`,\n insetInlineStart: `${event.position.offset}%`,\n }\n}\n\nconst startEventResize = (\n event: ScheduleEventData & { position: any },\n date: string,\n edge: 'top' | 'bottom',\n pointerEvent: PointerEvent,\n) => {\n const container = daySlotsContainers.get(date)\n\n if (!container) {\n return\n }\n\n eventResize.handleResizeStart({\n event,\n edge,\n container,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent,\n })\n}\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickResizableEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!eventResize.wasResizing()) {\n clickEvent(event, nativeEvent)\n }\n}\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('weekView') }\"\n :mod=\"[{ static: isStatic, 'slot-dragging': slotDragSelect.isDragging() }, (attrs as any).mod]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"week\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'week')\"\n :control=\"{ title: weekLabel }\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"emit('dateChange', $event)\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <Box\n :root-ref=\"setWeekRoot\"\n v-bind=\"getStyles('weekViewRoot', { style: rootVars })\"\n :mod=\"{ 'with-weekends': props.withWeekendDays }\"\n >\n <ScrollArea.Autosize\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('weekViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div v-bind=\"getStyles('weekViewHeader')\">\n <div v-bind=\"getStyles('weekViewCorner')\">\n <template v-if=\"withWeekNumber\">\n <div v-bind=\"getStyles('weekViewWeekLabel')\">\n {{ getLabel('week', props.labels) }}\n </div>\n <div v-bind=\"getStyles('weekViewWeekNumber')\">{{ getWeekNumber(days) }}</div>\n </template>\n </div>\n\n <UnstyledButton\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDayLabel')\"\n :data-weekday-index=\"dayIndex\"\n :data-weekend=\"column.isWeekend || undefined\"\n :aria-label=\"`${getLabel('weekday', props.labels)} ${column.key}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleDayLabelKeydown($event, dayIndex)\"\n @click=\"isStatic ? undefined : clickDayLabel(column.date)\"\n >\n <span v-bind=\"staticStyles('weekViewDayWeekday')\">{{ column.weekdayLabel }}</span>\n <span\n v-bind=\"staticStyles('weekViewDayNumber')\"\n :data-today=\"column.isToday || undefined\"\n >\n {{ column.dayLabel }}\n </span>\n </UnstyledButton>\n </div>\n\n <div v-if=\"withAllDaySlots\" v-bind=\"getStyles('weekViewAllDaySlots')\">\n <div v-bind=\"getStyles('weekViewAllDaySlotsLabel')\">\n {{ getLabel('allDay', props.labels) }}\n </div>\n\n <div v-bind=\"getStyles('weekViewAllDaySlotsList')\">\n <div v-bind=\"getStyles('weekViewAllDaySlotsEvents')\">\n <ScheduleEvent\n v-for=\"event in grouped.allDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n nowrap\n :hanging=\"event.position.hanging\"\n :mode=\"props.mode\"\n :style=\"allDayEventStyle(event.position)\"\n :draggable=\"isDraggableEvent(event)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(event, $event)\"\n />\n </div>\n\n <UnstyledButton\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDaySlot')\"\n :disabled=\"isStatic\"\n :data-all-day-index=\"dayIndex\"\n :aria-label=\"`${getLabel('allDay', props.labels)} ${column.key}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleAllDaySlotKeydown($event, dayIndex)\"\n @click=\"emit('allDaySlotClick', column.date, $event)\"\n @dragover.prevent\n @drop=\"emitAllDayDrop($event, column.date)\"\n />\n </div>\n </div>\n\n <Box v-bind=\"getStyles('weekViewInner')\">\n <div v-bind=\"getStyles('weekViewSlotLabels')\">\n <div\n v-for=\"(label, slotIndex) in slotLabels\"\n :key=\"slotIndex\"\n v-bind=\"staticStyles('weekViewSlotLabel')\"\n >\n {{ label }}\n </div>\n </div>\n\n <CurrentTimeIndicator\n v-if=\"props.withCurrentTimeIndicator && currentWeekdayIndex !== -1\"\n start-offset=\"calc(100% - (100% / var(--number-of-days)) * (var(--number-of-days) - var(--indicator-offset-index) + 1) + ((var(--number-of-days) - var(--indicator-offset-index) + 1) * var(--indicator-labels-offset)))\"\n end-offset=\"calc((100% / var(--number-of-days)) * (var(--number-of-days) - var(--indicator-offset-index)) - (var(--number-of-days) - var(--indicator-offset-index)) * var(--indicator-labels-offset))\"\n time-bubble-start-offset=\"calc(var(--week-view-slots-label-width) - var(--time-bubble-width))\"\n :current-time-format=\"props.slotLabelFormat\"\n :with-time-bubble=\"props.withCurrentTimeBubble\"\n :with-thumb=\"props.withCurrentTimeBubble ? currentWeekdayIndex !== 0 : true\"\n :locale=\"props.locale\"\n :start-time=\"props.startTime\"\n :end-time=\"props.endTime\"\n :interval-minutes=\"props.intervalMinutes\"\n :get-current-time=\"props.getCurrentTime\"\n v-bind=\"stylesApi\"\n />\n\n <div\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n v-bind=\"staticStyles('weekViewDay')\"\n >\n <div\n :ref=\"setDaySlotsContainer(column.date)\"\n v-bind=\"staticStyles('weekViewDaySlots')\"\n @dragover=\"withDragHandlers ? handleDayDragOver($event, column.date) : undefined\"\n @dragleave=\"withDragHandlers ? handleDayDragLeave($event, column.date) : undefined\"\n @drop=\"withDragHandlers ? handleDayDrop($event, column.date) : undefined\"\n >\n <UnstyledButton\n v-for=\"(slot, slotIndex) in intervals\"\n :key=\"slot.startTime\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDaySlot')\"\n :data-week-day-index=\"dayIndex\"\n :data-time-slot-index=\"slotIndex\"\n :data-drag-slot-index=\"withSlotSelect ? slotIndex : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? column.key : undefined\"\n :data-drop-target=\"slotDropTarget.isTarget(column.key, slotIndex) || undefined\"\n :data-drag-selected=\"\n slotDragSelect.isSlotSelected(slotIndex, column.key) || undefined\n \"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n :disabled=\"isStatic\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${column.key} ${slot.startTime} - ${slot.endTime}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 && slotIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleTimeSlotKeydown($event, dayIndex, slotIndex)\"\n @click=\"clickTimeSlot(column.date, slotIndex, $event)\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown($event, slotIndex, column.key)\n : undefined\n \"\n @dragover.prevent\n />\n\n <ScheduleBackgroundEvent\n v-for=\"event in grouped.backgroundEvents[column.date] || []\"\n :key=\"`background-${event.id}`\"\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...staticStyles('weekViewBackgroundEvent') }\"\n :style=\"backgroundEventStyle(event.position)\"\n @event-click=\"clickEvent\"\n />\n\n <ScheduleEvent\n v-for=\"event in grouped.regularEvents[column.date] || []\"\n :key=\"`${event.id}-${column.date}`\"\n :event=\"event\"\n auto-size\n :mode=\"props.mode\"\n :style=\"regularEventStyle(event)\"\n :draggable=\"isDraggableEvent(event)\"\n :with-resize=\"eventResize.isResizableEvent(event)\"\n :is-resizing=\"eventResize.getResizePosition(event.id) !== null\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickResizableEvent(event, $event)\"\n @resize-start=\"\n (edge, pointerEvent) => startEventResize(event, column.date, edge, pointerEvent)\n \"\n />\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { WeekViewOwnProps } from './WeekView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeIndicator: true,\n withCurrentTimeBubble: true,\n slotHeight: 64,\n firstDayOfWeek: 1,\n weekdayFormat: 'ddd',\n dayFormat: 'D',\n withWeekNumber: true,\n withAllDaySlots: true,\n allDaySlotHeight: 44,\n weekendDays: [0, 6],\n withWeekendDays: true,\n weekLabelFormat: 'MMM D',\n} satisfies Partial<WeekViewOwnProps>\n\n/** Vertical step between stacked all-day event rows, in px. */\nconst ALL_DAY_ROW_HEIGHT = 22\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotHeight, allDaySlotHeight, allDaySlotsHeight }) => ({\n weekView: {\n '--week-view-radius': resolveScheduleRadius(radius),\n '--week-view-slot-height': cssSize(slotHeight),\n '--week-view-all-day-slots-height': cssSize(allDaySlotsHeight ?? allDaySlotHeight),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, ALL_DAY_ROW_HEIGHT }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, useAttrs, useSlots } from 'vue'\nimport { Box, ScrollArea, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport { useEventResize } from '../../hooks/use-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n} from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getDayTimeIntervals,\n getWeekDays,\n getWeekNumber,\n} from '../../utils'\nimport { CurrentTimeIndicator } from '../CurrentTimeIndicator'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { provideScheduleDragState } from '../DragContext'\nimport {\n getDropEvent,\n getExpandedEvents,\n moveEventTo,\n moveEventToAllDay,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { useSlotDropTarget } from '../use-slot-drop-target'\nimport { getWeekLabel } from './get-week-label/get-week-label'\nimport { getWeekViewEvents } from './get-week-view-events/get-week-view-events'\nimport type { WeekViewEmits, WeekViewSlots } from './WeekView.types'\nimport classes from './WeekView.module.css'\n\ndefineOptions({\n name: 'WeekView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<WeekViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n withInteractiveBackgroundEvents: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n eventDragInterval: undefined,\n eventResizeInterval: undefined,\n slotLabelFormat: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n slotHeight: undefined,\n businessHours: undefined,\n canDragEvent: undefined,\n startScrollTime: undefined,\n canResizeEvent: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n dayFormat: undefined,\n withWeekNumber: undefined,\n withWeekNumbers: undefined,\n withAllDaySlots: undefined,\n withAllDaySlot: undefined,\n allDaySlotHeight: undefined,\n allDaySlotsHeight: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n weekLabelFormat: undefined,\n renderWeekLabel: undefined,\n scrollAreaProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<WeekViewSlots>()\n\nconst emit = defineEmits<WeekViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('WeekView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'WeekView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'weekView',\n})\n\n/**\n * Cached per selector: a week renders one slot per day and interval, and rebuilding the same\n * class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst weekRoot = ref<HTMLElement | null>(null)\nconst setWeekRoot = (node: Element | null) => {\n weekRoot.value = node instanceof HTMLElement ? node : null\n}\n\nconst daySlotsContainers = new Map<string, HTMLElement>()\n\nconst slotDropTarget = useSlotDropTarget()\n\nconst isStatic = computed(() => props.mode === 'static')\n\n/** The plural names are the deprecated aliases; the canonical prop wins when both are set. */\nconst withWeekNumber = computed(() => props.withWeekNumbers ?? props.withWeekNumber)\nconst withAllDaySlots = computed(() => props.withAllDaySlot ?? props.withAllDaySlots)\n\nconst days = computed(() =>\n getWeekDays({\n week: props.date,\n firstDayOfWeek: props.firstDayOfWeek,\n withWeekendDays: props.withWeekendDays,\n weekendDays: props.weekendDays,\n }),\n)\n\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? dayjs()))\n\nconst currentWeekdayIndex = computed(() => {\n if (!props.withCurrentTimeIndicator) {\n return -1\n }\n\n return props.forceCurrentTimeIndicator\n ? days.value.findIndex((date) => dayjs(date).day() === now.value.day())\n : days.value.findIndex((date) => dayjs(date).isSame(now.value, 'day'))\n})\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n dayjs(days.value[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n dayjs(days.value.at(-1)).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst grouped = computed(() =>\n getWeekViewEvents({\n date: props.date,\n events: expandedEvents.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n firstDayOfWeek: props.firstDayOfWeek,\n weekendDays: props.weekendDays,\n withWeekendDays: props.withWeekendDays,\n }),\n)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst withSlotSelect = computed(() => Boolean(props.withDragSlotSelect) && !isStatic.value)\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst weekLabel = computed(() =>\n getWeekLabel({\n weekdays: days.value,\n locale: props.locale || 'en',\n weekLabelFormat: props.weekLabelFormat!,\n renderWeekLabel: slots.weekLabel\n ? (payload) => slots.weekLabel!(payload)\n : props.renderWeekLabel,\n }),\n)\n\nconst rootVars = computed(() => ({\n '--number-of-days': String(days.value.length),\n '--indicator-offset-index':\n currentWeekdayIndex.value === -1 ? undefined : String(currentWeekdayIndex.value + 1),\n}))\n\n/**\n * Everything the template needs per day column.\n *\n * `days` holds `YYYY-MM-DD 00:00:00` strings, so the grid used to re-derive the day key, the\n * weekend flag and both labels for each of the hundreds of slots it renders. Doing it once per\n * day instead is what keeps a drag re-render cheap.\n */\nconst dayColumns = computed(() =>\n days.value.map((date) => {\n const day = dayjs(date)\n\n return {\n date,\n key: day.format('YYYY-MM-DD') as DateStringValue,\n isWeekend: props.weekendDays!.includes(day.day() as DayOfWeek),\n isToday: day.isSame(now.value, 'day'),\n weekdayLabel: formatDate({\n date,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n }),\n dayLabel: formatDate({ date, locale: props.locale || 'en', format: props.dayFormat! }),\n }\n }),\n)\n\nconst slotLabels = computed(() =>\n intervals.value.map((slot) =>\n formatDate({\n date: `${dayColumns.value[0]?.key} ${slot.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n }),\n ),\n)\n\nconst businessHoursMods = computed(() =>\n days.value.map((date) =>\n intervals.value.map((slot) =>\n getBusinessHoursMod({\n time: slot.startTime,\n businessHours: props.businessHours || ['09:00:00', '17:00:00'],\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayjs(date).day() as DayOfWeek,\n }),\n ),\n ),\n)\n\nconst eventResize = useEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n resizeIntervalMinutes: () => props.eventResizeInterval,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nconst slotDragSelect = useSlotDragSelect({\n enabled: () => withSlotSelect.value,\n onDragEnd: (startIndex, endIndex, group) => {\n const slotDate = dayjs(group).format('YYYY-MM-DD')\n const startSlot = intervals.value[startIndex]\n const endSlot = intervals.value[endIndex]\n\n if (startSlot && endSlot) {\n emit(\n 'slotDragEnd',\n `${slotDate} ${startSlot.startTime}` as DateTimeStringValue,\n `${slotDate} ${endSlot.endTime}` as DateTimeStringValue,\n )\n }\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n const target = weekRoot.value?.querySelector<HTMLElement>(\n `[data-week-day-index=\"0\"][data-time-slot-index=\"${targetIndex}\"]`,\n )\n\n scrollSlotIntoView(target)\n})\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = slotDropTarget.dropTarget.value\n return target\n ? {\n date: target.date,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotDragSelect.isDragging(),\n onDragEnd: () => {\n slotDropTarget.reset()\n emit('eventDragEnd')\n },\n})\n\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) =>\n emit('eventClick', event, nativeEvent)\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst setDaySlotsContainer = (date: string) => (element: unknown) => {\n if (element instanceof HTMLElement) {\n daySlotsContainers.set(date, element)\n } else {\n daySlotsContainers.delete(date)\n }\n}\n\nconst focusWeekControl = (nativeEvent: KeyboardEvent, selector: string) => {\n const control = weekRoot.value?.querySelector<HTMLButtonElement>(selector)\n\n if (!control || control.disabled) {\n return\n }\n\n nativeEvent.preventDefault()\n control.focus()\n}\n\nconst handleDayLabelKeydown = (nativeEvent: KeyboardEvent, dayIndex: number) => {\n const next =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : -1\n\n if (next >= 0 && next < days.value.length) {\n focusWeekControl(nativeEvent, `[data-weekday-index=\"${next}\"]`)\n }\n}\n\nconst handleAllDaySlotKeydown = (nativeEvent: KeyboardEvent, dayIndex: number) => {\n if (nativeEvent.key === 'ArrowDown') {\n focusWeekControl(nativeEvent, `[data-week-day-index=\"${dayIndex}\"][data-time-slot-index=\"0\"]`)\n return\n }\n\n const next =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : -1\n\n if (next >= 0 && next < days.value.length) {\n focusWeekControl(nativeEvent, `[data-all-day-index=\"${next}\"]`)\n }\n}\n\nconst handleTimeSlotKeydown = (nativeEvent: KeyboardEvent, dayIndex: number, slotIndex: number) => {\n if (nativeEvent.key === 'ArrowUp' && slotIndex === 0 && withAllDaySlots.value) {\n focusWeekControl(nativeEvent, `[data-all-day-index=\"${dayIndex}\"]`)\n return\n }\n\n const nextDay =\n nativeEvent.key === 'ArrowRight'\n ? dayIndex + 1\n : nativeEvent.key === 'ArrowLeft'\n ? dayIndex - 1\n : dayIndex\n const nextSlot =\n nativeEvent.key === 'ArrowDown'\n ? slotIndex + 1\n : nativeEvent.key === 'ArrowUp'\n ? slotIndex - 1\n : slotIndex\n\n if (\n nextDay >= 0 &&\n nextDay < days.value.length &&\n nextSlot >= 0 &&\n nextSlot < intervals.value.length &&\n (nextDay !== dayIndex || nextSlot !== slotIndex)\n ) {\n focusWeekControl(\n nativeEvent,\n `[data-week-day-index=\"${nextDay}\"][data-time-slot-index=\"${nextSlot}\"]`,\n )\n }\n}\n\nconst clickDayLabel = (date: string) => {\n emit('viewChange', 'day')\n emit('dateChange', date as DateStringValue)\n}\n\nconst clickTimeSlot = (date: string, slotIndex: number, nativeEvent: MouseEvent) => {\n const datePart = dayjs(date).format('YYYY-MM-DD')\n const slot = intervals.value[slotIndex]\n\n emit('timeSlotClick', {\n slotStart: `${datePart} ${slot.startTime}` as DateTimeStringValue,\n slotEnd: `${datePart} ${slot.endTime}` as DateTimeStringValue,\n nativeEvent,\n })\n}\n\nconst emitDrop = (nativeEvent: DragEvent, target: DateTimeStringValue) => {\n nativeEvent.preventDefault()\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventTo(event, target))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, target)\n }\n}\n\nconst emitAllDayDrop = (nativeEvent: DragEvent, date: string) => {\n nativeEvent.preventDefault()\n const dayKey = dayjs(date).format('YYYY-MM-DD')\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', moveEventToAllDay(event, dayKey))\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', nativeEvent.dataTransfer, `${dayKey} 00:00:00` as DateTimeStringValue)\n }\n}\n\nconst dropInput = (date: string) => ({\n container: daySlotsContainers.get(date),\n date: dayjs(date).format('YYYY-MM-DD') as DateStringValue,\n intervals: intervals.value,\n intervalMinutes: props.intervalMinutes,\n dragIntervalMinutes: props.eventDragInterval,\n startTime: props.startTime,\n endTime: props.endTime,\n})\n\nconst handleDayDragOver = (nativeEvent: DragEvent, date: string) =>\n slotDropTarget.dragOver(nativeEvent, dropInput(date))\n\nconst handleDayDragLeave = (nativeEvent: DragEvent, date: string) =>\n slotDropTarget.dragLeave(nativeEvent, daySlotsContainers.get(date))\n\nconst handleDayDrop = (nativeEvent: DragEvent, date: string) => {\n const target = slotDropTarget.drop(nativeEvent, dropInput(date))\n\n if (target) {\n emitDrop(nativeEvent, target.target)\n }\n}\n\nconst allDayEventStyle = (position: { offset: number; width: number; row: number }) => ({\n position: 'absolute' as const,\n insetInlineStart: `${position.offset}%`,\n width: `${position.width}%`,\n top: `${position.row * ALL_DAY_ROW_HEIGHT}px`,\n})\n\nconst backgroundEventStyle = (position: { top: number; height: number }) => ({\n top: `${position.top}%`,\n bottom: `${100 - position.top - position.height}%`,\n minHeight: '1px',\n width: '100%',\n})\n\nconst regularEventStyle = (event: ScheduleEventData & { position: any }) => {\n const resizePosition = eventResize.getResizePosition(event.id)\n const top = resizePosition?.top ?? event.position.top\n const height = resizePosition?.height ?? event.position.height\n\n return {\n position: 'absolute' as const,\n top: `${top}%`,\n bottom: `${100 - top - height}%`,\n minHeight: '1px',\n width: `${event.position.width}%`,\n insetInlineStart: `${event.position.offset}%`,\n }\n}\n\nconst startEventResize = (\n event: ScheduleEventData & { position: any },\n date: string,\n edge: 'top' | 'bottom',\n pointerEvent: PointerEvent,\n) => {\n const container = daySlotsContainers.get(date)\n\n if (!container) {\n return\n }\n\n eventResize.handleResizeStart({\n event,\n edge,\n container,\n originalTop: event.position.top,\n originalHeight: event.position.height,\n eventDate: dayjs(date).format('YYYY-MM-DD'),\n pointerEvent,\n })\n}\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickResizableEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!eventResize.wasResizing()) {\n clickEvent(event, nativeEvent)\n }\n}\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n !isStatic.value && props.withEventsDragAndDrop === true && (props.canDragEvent?.(event) ?? true)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('weekView') }\"\n :mod=\"[{ static: isStatic, 'slot-dragging': slotDragSelect.isDragging() }, (attrs as any).mod]\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"week\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'week')\"\n :control=\"{ title: weekLabel }\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"emit('dateChange', $event)\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <Box\n :root-ref=\"setWeekRoot\"\n v-bind=\"getStyles('weekViewRoot', { style: rootVars })\"\n :mod=\"{ 'with-weekends': props.withWeekendDays }\"\n >\n <ScrollArea.Autosize\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('weekViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div v-bind=\"getStyles('weekViewHeader')\">\n <div v-bind=\"getStyles('weekViewCorner')\">\n <template v-if=\"withWeekNumber\">\n <div v-bind=\"getStyles('weekViewWeekLabel')\">\n {{ getLabel('week', props.labels) }}\n </div>\n <div v-bind=\"getStyles('weekViewWeekNumber')\">{{ getWeekNumber(days) }}</div>\n </template>\n </div>\n\n <UnstyledButton\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDayLabel')\"\n :data-weekday-index=\"dayIndex\"\n :data-weekend=\"column.isWeekend || undefined\"\n :aria-label=\"`${getLabel('weekday', props.labels)} ${column.key}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleDayLabelKeydown($event, dayIndex)\"\n @click=\"isStatic ? undefined : clickDayLabel(column.date)\"\n >\n <span v-bind=\"staticStyles('weekViewDayWeekday')\">{{ column.weekdayLabel }}</span>\n <span\n v-bind=\"staticStyles('weekViewDayNumber')\"\n :data-today=\"column.isToday || undefined\"\n >\n {{ column.dayLabel }}\n </span>\n </UnstyledButton>\n </div>\n\n <div v-if=\"withAllDaySlots\" v-bind=\"getStyles('weekViewAllDaySlots')\">\n <div v-bind=\"getStyles('weekViewAllDaySlotsLabel')\">\n {{ getLabel('allDay', props.labels) }}\n </div>\n\n <div v-bind=\"getStyles('weekViewAllDaySlotsList')\">\n <div v-bind=\"getStyles('weekViewAllDaySlotsEvents')\">\n <ScheduleEvent\n v-for=\"event in grouped.allDayEvents\"\n :key=\"event.id\"\n :event=\"event\"\n nowrap\n :hanging=\"event.position.hanging\"\n :mode=\"props.mode\"\n :style=\"allDayEventStyle(event.position)\"\n :draggable=\"isDraggableEvent(event)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickEvent(event, $event)\"\n />\n </div>\n\n <UnstyledButton\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDaySlot')\"\n :disabled=\"isStatic\"\n :data-all-day-index=\"dayIndex\"\n :aria-label=\"`${getLabel('allDay', props.labels)} ${column.key}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleAllDaySlotKeydown($event, dayIndex)\"\n @click=\"emit('allDaySlotClick', column.date, $event)\"\n @dragover.prevent\n @drop=\"emitAllDayDrop($event, column.date)\"\n />\n </div>\n </div>\n\n <Box v-bind=\"getStyles('weekViewInner')\">\n <div v-bind=\"getStyles('weekViewSlotLabels')\">\n <div\n v-for=\"(label, slotIndex) in slotLabels\"\n :key=\"slotIndex\"\n v-bind=\"staticStyles('weekViewSlotLabel')\"\n >\n {{ label }}\n </div>\n </div>\n\n <CurrentTimeIndicator\n v-if=\"props.withCurrentTimeIndicator && currentWeekdayIndex !== -1\"\n start-offset=\"calc(100% - (100% / var(--number-of-days)) * (var(--number-of-days) - var(--indicator-offset-index) + 1) + ((var(--number-of-days) - var(--indicator-offset-index) + 1) * var(--indicator-labels-offset)))\"\n end-offset=\"calc((100% / var(--number-of-days)) * (var(--number-of-days) - var(--indicator-offset-index)) - (var(--number-of-days) - var(--indicator-offset-index)) * var(--indicator-labels-offset))\"\n time-bubble-start-offset=\"calc(var(--week-view-slots-label-width) - var(--time-bubble-width))\"\n :current-time-format=\"props.slotLabelFormat\"\n :with-time-bubble=\"props.withCurrentTimeBubble\"\n :with-thumb=\"props.withCurrentTimeBubble ? currentWeekdayIndex !== 0 : true\"\n :locale=\"props.locale\"\n :start-time=\"props.startTime\"\n :end-time=\"props.endTime\"\n :interval-minutes=\"props.intervalMinutes\"\n :get-current-time=\"props.getCurrentTime\"\n v-bind=\"stylesApi\"\n />\n\n <div\n v-for=\"(column, dayIndex) in dayColumns\"\n :key=\"column.date\"\n v-bind=\"staticStyles('weekViewDay')\"\n >\n <div\n :ref=\"setDaySlotsContainer(column.date)\"\n v-bind=\"staticStyles('weekViewDaySlots')\"\n @dragover=\"withDragHandlers ? handleDayDragOver($event, column.date) : undefined\"\n @dragleave=\"withDragHandlers ? handleDayDragLeave($event, column.date) : undefined\"\n @drop=\"withDragHandlers ? handleDayDrop($event, column.date) : undefined\"\n >\n <UnstyledButton\n v-for=\"(slot, slotIndex) in intervals\"\n :key=\"slot.startTime\"\n type=\"button\"\n v-bind=\"staticStyles('weekViewDaySlot')\"\n :data-week-day-index=\"dayIndex\"\n :data-time-slot-index=\"slotIndex\"\n :data-drag-slot-index=\"withSlotSelect ? slotIndex : undefined\"\n :data-drag-slot-group=\"withSlotSelect ? column.key : undefined\"\n :data-drop-target=\"slotDropTarget.isTarget(column.key, slotIndex) || undefined\"\n :data-drag-selected=\"\n slotDragSelect.isSlotSelected(slotIndex, column.key) || undefined\n \"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n :disabled=\"isStatic\"\n :aria-label=\"`${getLabel('timeSlot', props.labels)} ${column.key} ${slot.startTime} - ${slot.endTime}`\"\n :tabindex=\"isStatic ? -1 : dayIndex === 0 && slotIndex === 0 ? 0 : -1\"\n @keydown=\"isStatic ? undefined : handleTimeSlotKeydown($event, dayIndex, slotIndex)\"\n @click=\"clickTimeSlot(column.date, slotIndex, $event)\"\n @pointerdown=\"\n withSlotSelect\n ? slotDragSelect.handleSlotPointerDown($event, slotIndex, column.key)\n : undefined\n \"\n @dragover.prevent\n />\n\n <ScheduleBackgroundEvent\n v-for=\"event in grouped.backgroundEvents[column.date] || []\"\n :key=\"`background-${event.id}`\"\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...staticStyles('weekViewBackgroundEvent') }\"\n :style=\"backgroundEventStyle(event.position)\"\n @event-click=\"clickEvent\"\n />\n\n <ScheduleEvent\n v-for=\"event in grouped.regularEvents[column.date] || []\"\n :key=\"`${event.id}-${column.date}`\"\n :event=\"event\"\n auto-size\n :mode=\"props.mode\"\n :style=\"regularEventStyle(event)\"\n :draggable=\"isDraggableEvent(event)\"\n :with-resize=\"eventResize.isResizableEvent(event)\"\n :is-resizing=\"eventResize.getResizePosition(event.id) !== null\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"clickResizableEvent(event, $event)\"\n @resize-start=\"\n (edge, pointerEvent) => startEventResize(event, column.date, edge, pointerEvent)\n \"\n />\n </div>\n </div>\n </Box>\n </ScrollArea.Autosize>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport WeekViewComponent, { varsResolver } from './WeekView.vue'\nimport type { WeekViewFactory } from './WeekView.types'\nimport classes from './WeekView.module.css'\n\nexport const WeekView = factory<WeekViewFactory>(WeekViewComponent, { classes, varsResolver })\n\nexport type {\n WeekLabelPayload,\n WeekViewCssVariables,\n WeekViewEmits,\n WeekViewFactory,\n WeekViewOwnProps,\n WeekViewOwnStylesNames,\n WeekViewProps,\n WeekViewSlots,\n WeekViewStylesNames,\n} from './WeekView.types'\n","import dayjs from 'dayjs'\nimport { AnyDateValue, DateStringValue, ScheduleEventData } from '../../../types'\nimport { isMultidayEvent, validateEvent } from '../../../utils'\n\nexport type GroupedEvents = Record<DateStringValue, ScheduleEventData[]>\n\nfunction groupEventByDate(event: ScheduleEventData, groupedEvents: GroupedEvents) {\n if (isMultidayEvent(event)) {\n const startDate = dayjs(event.start).startOf('day')\n const endDate = dayjs(event.end).startOf('day')\n\n for (\n let date = startDate;\n date.isBefore(endDate) || date.isSame(endDate);\n date = date.add(1, 'day')\n ) {\n const dateKey = date.format('YYYY-MM-DD')\n if (!groupedEvents[dateKey]) {\n groupedEvents[dateKey] = []\n }\n groupedEvents[dateKey].push(event)\n }\n\n return\n }\n\n const eventDate = dayjs(event.start).format('YYYY-MM-DD')\n if (!groupedEvents[eventDate]) {\n groupedEvents[eventDate] = []\n }\n groupedEvents[eventDate].push(event)\n}\n\ninterface GetYearViewEventsInput {\n date: AnyDateValue\n events: ScheduleEventData[] | undefined\n}\n\nexport function getYearViewEvents({ date, events }: GetYearViewEventsInput) {\n const groupedEvents: GroupedEvents = {}\n\n if (events === undefined) {\n return groupedEvents\n }\n\n const ids = new Set<string | number>()\n\n for (const event of events) {\n if (dayjs(event.start).isSame(dayjs(date), 'year')) {\n groupEventByDate(validateEvent(event), groupedEvents)\n\n if (!ids.has(event.id)) {\n ids.add(event.id)\n } else {\n throw new Error(`[@mantine/schedule] YearView: Duplicated event ids found: ${event.id}`)\n }\n }\n }\n\n return groupedEvents\n}\n",".yearView {\n --year-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --year-view-font-size: var(--mantine-font-size-sm);\n --year-view-columns: 7;\n container-type: inline-size;\n\n @mixin where-light {\n --year-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --year-view-border-color: var(--mantine-color-dark-4);\n }\n}\n\n.yearViewMonths {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n\n @container (width <= 850px) {\n --year-view-font-size: calc(var(--mantine-font-size-sm) - 2px);\n }\n\n @container (width <= 750px) {\n grid-template-columns: repeat(2, 1fr);\n --year-view-font-size: var(--mantine-font-size-xs);\n }\n\n @container (width <= 520px) {\n --year-view-font-size: calc(var(--mantine-font-size-xs) - 2px);\n }\n\n @container (width <= 420px) {\n grid-template-columns: 1fr;\n --year-view-font-size: var(--mantine-font-size-xs);\n }\n}\n\n.yearViewMonth {\n --week-numbers-offset: 0rem;\n --day-base-color: var(--mantine-color-text);\n --day-dimmed-color: alpha(var(--day-base-color), 0.35);\n\n &:where([data-with-week-numbers]) {\n --week-numbers-offset: 28px;\n }\n\n min-width: 0;\n border: 1px solid var(--year-view-border-color);\n padding: var(--mantine-spacing-md);\n margin-top: -1px;\n margin-inline-start: -1px;\n\n &:where(:nth-child(3n + 1)) {\n margin-inline-start: 0;\n }\n\n &:where(:nth-child(-n + 3)) {\n margin-top: 0;\n }\n\n &:where(:nth-child(1)) {\n border-start-start-radius: var(--year-view-radius);\n }\n\n &:where(:nth-child(3)) {\n border-start-end-radius: var(--year-view-radius);\n }\n\n &:where(:nth-last-child(3)) {\n border-end-start-radius: var(--year-view-radius);\n }\n\n &:where(:nth-last-child(1)) {\n border-end-end-radius: var(--year-view-radius);\n }\n\n @container (width <= 750px) {\n border: 0;\n padding: 8px;\n margin: 0;\n\n &:where([data-with-week-numbers]) {\n --week-numbers-offset: 14px;\n }\n }\n\n @container (width <= 420px) {\n padding: 6px;\n }\n}\n\n.yearViewWeekdays {\n display: flex;\n}\n\n.yearViewWeek {\n display: flex;\n}\n\n.yearViewWeekNumber {\n flex: 0 0 calc(var(--week-numbers-offset) - rem(4px));\n margin-inline-end: rem(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--year-view-font-size);\n border-radius: var(--year-view-radius);\n padding: 4px;\n font-weight: var(--mantine-font-weight-medium);\n cursor: pointer;\n user-select: none;\n color: var(--day-dimmed-color);\n\n @container (width <= 750px) {\n padding: 0;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.yearViewWeekday {\n flex: 0 0\n calc(100% / var(--year-view-columns) - var(--week-numbers-offset) / var(--year-view-columns));\n height: 36px;\n font-size: var(--year-view-font-size);\n font-weight: var(--mantine-font-weight-medium);\n text-align: center;\n text-transform: capitalize;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n user-select: none;\n color: var(--day-dimmed-color);\n\n @container (width <= 750px) {\n height: auto;\n padding-block: 2px;\n }\n}\n\n.yearViewWeekdaysCorner {\n flex: 0 0 var(--week-numbers-offset);\n}\n\n.yearViewDay {\n flex: 0 0\n calc(100% / var(--year-view-columns) - var(--week-numbers-offset) / var(--year-view-columns));\n padding: 4px;\n font-size: var(--year-view-font-size);\n color: var(--day-base-color);\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 100%;\n aspect-ratio: 1;\n position: relative;\n\n @container (width <= 750px) {\n padding: 0;\n }\n\n &:where([data-day-placeholder]) {\n background-color: transparent;\n cursor: default;\n pointer-events: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-outside]) {\n color: var(--day-dimmed-color);\n }\n\n @mixin hover {\n &:where(:not([data-today], [data-day-placeholder])) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n\n &:where([data-today]:not([data-outside])) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n\n @mixin hover {\n background-color: var(--mantine-primary-color-filled-hover);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.yearViewMonthCaption {\n padding-inline: var(--mantine-spacing-sm);\n width: 100%;\n padding-block: 4px;\n margin-bottom: 4px;\n font-size: var(--year-view-font-size);\n font-weight: var(--mantine-font-weight-medium);\n text-transform: capitalize;\n border-radius: var(--year-view-radius);\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.yearViewDayIndicators {\n position: absolute;\n bottom: 0;\n inset-inline: 0;\n display: flex;\n justify-content: center;\n padding-inline-start: 2px;\n}\n\n.yearViewDayIndicator {\n width: 8px;\n height: 8px;\n border-radius: 100%;\n margin-inline-start: -2px;\n border: 1px solid var(--mantine-color-body);\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { YearViewOwnProps } from './YearView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n firstDayOfWeek: 1,\n weekdayFormat: 'dd',\n weekendDays: [0, 6],\n withWeekendDays: true,\n withWeekDays: true,\n highlightToday: true,\n withOutsideDays: true,\n monthsListFormat: 'MMMM',\n} satisfies Partial<YearViewOwnProps>\n\nconst COLUMNS = 7\n\nconst MAX_DAY_INDICATORS = 3\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n yearView: {\n '--year-view-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver, COLUMNS, MAX_DAY_INDICATORS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, ref, useAttrs } from 'vue'\nimport { Box, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type { DateStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport {\n formatDate,\n getMonthDays,\n getWeekNumber,\n getWeekdaysNames,\n toDateString,\n} from '../../utils'\nimport { handleGridKeydown } from '../keyboard-navigation'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { getExpandedEvents, useStaticStyles } from '../shared'\nimport { getYearViewEvents } from './get-year-view-events/get-year-view-events'\nimport type { YearViewEmits, YearViewSlots } from './YearView.types'\nimport classes from './YearView.module.css'\n\ndefineOptions({\n name: 'YearView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<YearViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n withWeekDays: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n withOutsideDays: undefined,\n monthsListFormat: undefined,\n getDayProps: undefined,\n renderDay: undefined,\n getWeekNumberProps: undefined,\n monthYearSelectProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<YearViewEmits>()\ndefineSlots<YearViewSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('YearView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'YearView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'yearView',\n})\n\n/**\n * Cached per selector: a year renders twelve month grids, so the same class list would\n * otherwise be rebuilt for several hundred day cells on every render.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst yearGrid = ref<HTMLElement | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst year = computed(() => dayjs(props.date).startOf('year'))\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n year.value.startOf('year').format('YYYY-MM-DD HH:mm:ss'),\n year.value.endOf('year').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst eventsByDay = computed(() =>\n getYearViewEvents({ date: year.value, events: expandedEvents.value }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }).filter((_, index) => !hiddenWeekendColumns.value.has(index)),\n)\n\nconst hiddenWeekendColumns = computed(() => {\n if (props.withWeekendDays !== false) return new Set<number>()\n return new Set(\n Array.from({ length: 7 }, (_, index) => index).filter((index) =>\n props.weekendDays!.includes(((props.firstDayOfWeek! + index) % 7) as DayOfWeek),\n ),\n )\n})\n\nconst columnsCount = computed(() => 7 - hiddenWeekendColumns.value.size)\nconst visibleWeek = (week: DateStringValue[]) =>\n props.withWeekendDays === false\n ? week.filter((date) => !props.weekendDays!.includes(dayjs(date).day() as DayOfWeek))\n : week\n\n/**\n * Every month with the grid offset its cells start at, so a single roving tabindex can walk\n * the whole year rather than restarting in each month.\n */\nconst months = computed(() => {\n let offset = 0\n\n return Array.from({ length: 12 }, (_, monthIndex) => {\n const month = year.value.month(monthIndex)\n const weeks = getMonthDays({\n month,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n })\n const entry = { month, monthIndex, weeks, offset }\n offset += weeks.length * columnsCount.value\n return entry\n })\n})\n\nconst totalYearGridCells = computed(() =>\n months.value.reduce((total, { weeks }) => total + weeks.length * columnsCount.value, 0),\n)\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n yearValue: year.value.year(),\n withMonths: false,\n labelFormat: 'YYYY',\n onYearChange: (value: number) => emit('dateChange', toDateString(year.value.year(value))),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\n\nconst dayProps = (date: string | Date) => props.getDayProps?.(toDateString(date)) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDateString(weekStart)) ?? {}\n\nconst isOutside = (date: string | Date, month: dayjs.Dayjs) => !dayjs(date).isSame(month, 'month')\n\nconst dayEvents = (date: string | Date) => eventsByDay.value[dayjs(date).format('YYYY-MM-DD')] || []\n\nconst indicatorStyle = (event: ScheduleEventData) => ({\n background: `var(--mantine-color-${event.color}-6, ${event.color})`,\n})\n\nconst handleDayKeydown = (nativeEvent: KeyboardEvent, gridIndex: number) => {\n handleGridKeydown({\n event: nativeEvent,\n index: gridIndex,\n columns: columnsCount.value,\n total: totalYearGridCells.value,\n getControl: (index) => {\n const control =\n yearGrid.value?.querySelector<HTMLButtonElement>(`[data-year-grid-index=\"${index}\"]`) ??\n null\n // Days of the neighbouring months are visible but never focusable.\n return control?.hasAttribute('data-outside') ? null : control\n },\n })\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('yearView') }\"\n :style=\"[getStyles('yearView').style, { '--year-view-columns': columnsCount }, attrs.style]\"\n :data-without-weekend-days=\"hiddenWeekendColumns.size > 0 || undefined\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"year\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'year')\"\n :control=\"headerControl\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <div ref=\"yearGrid\" v-bind=\"getStyles('yearViewMonths')\">\n <section\n v-for=\"{ month, weeks, offset } in months\"\n :key=\"month.month()\"\n v-bind=\"getStyles('yearViewMonth')\"\n :data-with-week-numbers=\"props.withWeekNumbers || undefined\"\n >\n <UnstyledButton\n type=\"button\"\n v-bind=\"getStyles('yearViewMonthCaption')\"\n @click=\"emit('monthClick', toDateString(month))\"\n >\n {{\n formatDate({\n date: month,\n locale: props.locale || 'en',\n format: props.monthsListFormat!,\n })\n }}\n </UnstyledButton>\n\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('yearViewWeekdays')\">\n <span v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('yearViewWeekdaysCorner')\" />\n <span\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"staticStyles('yearViewWeekday')\"\n >\n {{ weekday }}\n </span>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"staticStyles('yearViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n type=\"button\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('yearViewWeekNumber', { className: weekNumberProps(week[0]).class }),\n }\"\n @click=\"emit('weekNumberClick', toDateString(week[0]), $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <template v-for=\"(date, dayIndex) in visibleWeek(week)\" :key=\"toDateString(date)\">\n <div\n v-if=\"isOutside(date, month) && !props.withOutsideDays\"\n v-bind=\"staticStyles('yearViewDay')\"\n data-day-placeholder\n />\n <UnstyledButton\n v-else\n type=\"button\"\n v-bind=\"{\n ...dayProps(date),\n ...getStyles('yearViewDay', { className: dayProps(date).class }),\n }\"\n :disabled=\"isStatic\"\n :data-year-grid-index=\"offset + weekIndex * columnsCount + dayIndex\"\n :data-outside=\"isOutside(date, month) || undefined\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(date).day() as DayOfWeek) || undefined\n \"\n :data-today=\"\n (props.highlightToday && dayjs(date).isSame(dayjs(), 'day')) || undefined\n \"\n :aria-label=\"\n formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\n \"\n :tabindex=\"\n isStatic || isOutside(date, month) ? -1 : dayjs(date).date() === 1 ? 0 : -1\n \"\n @keydown=\"\n isStatic\n ? undefined\n : handleDayKeydown($event, offset + weekIndex * columnsCount + dayIndex)\n \"\n @click=\"emit('dayClick', toDateString(date), $event)\"\n >\n <slot name=\"day\" :date=\"toDateString(date)\" :events=\"dayEvents(date)\">\n <component\n :is=\"() => props.renderDay!(toDateString(date), dayEvents(date))\"\n v-if=\"props.renderDay\"\n />\n <template v-else>\n {{ dayjs(date).date() }}\n <span v-if=\"dayEvents(date).length\" v-bind=\"getStyles('yearViewDayIndicators')\">\n <span\n v-for=\"event in dayEvents(date).slice(0, MAX_DAY_INDICATORS)\"\n :key=\"event.id\"\n v-bind=\"getStyles('yearViewDayIndicator')\"\n :style=\"indicatorStyle(event)\"\n />\n </span>\n </template>\n </slot>\n </UnstyledButton>\n </template>\n </div>\n </section>\n </div>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { resolveScheduleRadius } from '../shared'\nimport type { YearViewOwnProps } from './YearView.types'\n\nconst defaultProps = {\n mode: 'default',\n withHeader: true,\n recurrenceExpansionLimit: 2000,\n firstDayOfWeek: 1,\n weekdayFormat: 'dd',\n weekendDays: [0, 6],\n withWeekendDays: true,\n withWeekDays: true,\n highlightToday: true,\n withOutsideDays: true,\n monthsListFormat: 'MMMM',\n} satisfies Partial<YearViewOwnProps>\n\nconst COLUMNS = 7\n\nconst MAX_DAY_INDICATORS = 3\n\nconst varsResolver = createVarsResolver<any>((_theme, { radius }) => ({\n yearView: {\n '--year-view-radius': resolveScheduleRadius(radius),\n },\n}))\n\nexport { defaultProps, varsResolver, COLUMNS, MAX_DAY_INDICATORS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, ref, useAttrs } from 'vue'\nimport { Box, UnstyledButton, useProps, useStyles } from '@mantine-vue/core'\nimport type { DateStringValue, DayOfWeek, ScheduleEventData } from '../../types'\nimport {\n formatDate,\n getMonthDays,\n getWeekNumber,\n getWeekdaysNames,\n toDateString,\n} from '../../utils'\nimport { handleGridKeydown } from '../keyboard-navigation'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport { getExpandedEvents, useStaticStyles } from '../shared'\nimport { getYearViewEvents } from './get-year-view-events/get-year-view-events'\nimport type { YearViewEmits, YearViewSlots } from './YearView.types'\nimport classes from './YearView.module.css'\n\ndefineOptions({\n name: 'YearView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<YearViewOwnProps>(), {\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n mode: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n recurrenceExpansionLimit: undefined,\n firstDayOfWeek: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n withWeekDays: undefined,\n consistentWeeks: undefined,\n highlightToday: undefined,\n withOutsideDays: undefined,\n monthsListFormat: undefined,\n getDayProps: undefined,\n renderDay: undefined,\n getWeekNumberProps: undefined,\n monthYearSelectProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\nconst emit = defineEmits<YearViewEmits>()\ndefineSlots<YearViewSlots>()\n\nconst attrs = useAttrs()\n\nconst props = useProps('YearView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'YearView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'yearView',\n})\n\n/**\n * Cached per selector: a year renders twelve month grids, so the same class list would\n * otherwise be rebuilt for several hundred day cells on every render.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst yearGrid = ref<HTMLElement | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst year = computed(() => dayjs(props.date).startOf('year'))\n\nconst expandedEvents = computed(() =>\n getExpandedEvents(\n props.events,\n year.value.startOf('year').format('YYYY-MM-DD HH:mm:ss'),\n year.value.endOf('year').format('YYYY-MM-DD HH:mm:ss'),\n props.recurrenceExpansionLimit!,\n ),\n)\n\nconst eventsByDay = computed(() =>\n getYearViewEvents({ date: year.value, events: expandedEvents.value }),\n)\n\nconst weekdays = computed(() =>\n getWeekdaysNames({\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n firstDayOfWeek: props.firstDayOfWeek,\n }).filter((_, index) => !hiddenWeekendColumns.value.has(index)),\n)\n\nconst hiddenWeekendColumns = computed(() => {\n if (props.withWeekendDays !== false) return new Set<number>()\n return new Set(\n Array.from({ length: 7 }, (_, index) => index).filter((index) =>\n props.weekendDays!.includes(((props.firstDayOfWeek! + index) % 7) as DayOfWeek),\n ),\n )\n})\n\nconst columnsCount = computed(() => 7 - hiddenWeekendColumns.value.size)\nconst visibleWeek = (week: DateStringValue[]) =>\n props.withWeekendDays === false\n ? week.filter((date) => !props.weekendDays!.includes(dayjs(date).day() as DayOfWeek))\n : week\n\n/**\n * Every month with the grid offset its cells start at, so a single roving tabindex can walk\n * the whole year rather than restarting in each month.\n */\nconst months = computed(() => {\n let offset = 0\n\n return Array.from({ length: 12 }, (_, monthIndex) => {\n const month = year.value.month(monthIndex)\n const weeks = getMonthDays({\n month,\n firstDayOfWeek: props.firstDayOfWeek,\n consistentWeeks: props.consistentWeeks,\n })\n const entry = { month, monthIndex, weeks, offset }\n offset += weeks.length * columnsCount.value\n return entry\n })\n})\n\nconst totalYearGridCells = computed(() =>\n months.value.reduce((total, { weeks }) => total + weeks.length * columnsCount.value, 0),\n)\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n yearValue: year.value.year(),\n withMonths: false,\n labelFormat: 'YYYY',\n onYearChange: (value: number) => emit('dateChange', toDateString(year.value.year(value))),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\n\nconst dayProps = (date: string | Date) => props.getDayProps?.(toDateString(date)) ?? {}\nconst weekNumberProps = (weekStart: string | Date) =>\n props.getWeekNumberProps?.(toDateString(weekStart)) ?? {}\n\nconst isOutside = (date: string | Date, month: dayjs.Dayjs) => !dayjs(date).isSame(month, 'month')\n\nconst dayEvents = (date: string | Date) => eventsByDay.value[dayjs(date).format('YYYY-MM-DD')] || []\n\nconst indicatorStyle = (event: ScheduleEventData) => ({\n background: `var(--mantine-color-${event.color}-6, ${event.color})`,\n})\n\nconst handleDayKeydown = (nativeEvent: KeyboardEvent, gridIndex: number) => {\n handleGridKeydown({\n event: nativeEvent,\n index: gridIndex,\n columns: columnsCount.value,\n total: totalYearGridCells.value,\n getControl: (index) => {\n const control =\n yearGrid.value?.querySelector<HTMLButtonElement>(`[data-year-grid-index=\"${index}\"]`) ??\n null\n // Days of the neighbouring months are visible but never focusable.\n return control?.hasAttribute('data-outside') ? null : control\n },\n })\n}\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('yearView') }\"\n :style=\"[getStyles('yearView').style, { '--year-view-columns': columnsCount }, attrs.style]\"\n :data-without-weekend-days=\"hiddenWeekendColumns.size > 0 || undefined\"\n >\n <ScheduleHeaderBase\n v-if=\"props.withHeader\"\n view=\"year\"\n :labels=\"props.labels\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'year')\"\n :control=\"headerControl\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"props.viewSelectProps\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"emit('viewChange', $event)\"\n />\n\n <div ref=\"yearGrid\" v-bind=\"getStyles('yearViewMonths')\">\n <section\n v-for=\"{ month, weeks, offset } in months\"\n :key=\"month.month()\"\n v-bind=\"getStyles('yearViewMonth')\"\n :data-with-week-numbers=\"props.withWeekNumbers || undefined\"\n >\n <UnstyledButton\n type=\"button\"\n v-bind=\"getStyles('yearViewMonthCaption')\"\n @click=\"emit('monthClick', toDateString(month))\"\n >\n {{\n formatDate({\n date: month,\n locale: props.locale || 'en',\n format: props.monthsListFormat!,\n })\n }}\n </UnstyledButton>\n\n <div v-if=\"props.withWeekDays\" v-bind=\"getStyles('yearViewWeekdays')\">\n <span v-if=\"props.withWeekNumbers\" v-bind=\"getStyles('yearViewWeekdaysCorner')\" />\n <span\n v-for=\"(weekday, index) in weekdays\"\n :key=\"index\"\n v-bind=\"staticStyles('yearViewWeekday')\"\n >\n {{ weekday }}\n </span>\n </div>\n\n <div\n v-for=\"(week, weekIndex) in weeks\"\n :key=\"`week-${weekIndex}`\"\n v-bind=\"staticStyles('yearViewWeek')\"\n >\n <UnstyledButton\n v-if=\"props.withWeekNumbers\"\n type=\"button\"\n v-bind=\"{\n ...weekNumberProps(week[0]),\n ...getStyles('yearViewWeekNumber', { className: weekNumberProps(week[0]).class }),\n }\"\n @click=\"emit('weekNumberClick', toDateString(week[0]), $event)\"\n >\n {{ getWeekNumber(week) }}\n </UnstyledButton>\n\n <template v-for=\"(date, dayIndex) in visibleWeek(week)\" :key=\"toDateString(date)\">\n <div\n v-if=\"isOutside(date, month) && !props.withOutsideDays\"\n v-bind=\"staticStyles('yearViewDay')\"\n data-day-placeholder\n />\n <UnstyledButton\n v-else\n type=\"button\"\n v-bind=\"{\n ...dayProps(date),\n ...getStyles('yearViewDay', { className: dayProps(date).class }),\n }\"\n :disabled=\"isStatic\"\n :data-year-grid-index=\"offset + weekIndex * columnsCount + dayIndex\"\n :data-outside=\"isOutside(date, month) || undefined\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(date).day() as DayOfWeek) || undefined\n \"\n :data-today=\"\n (props.highlightToday && dayjs(date).isSame(dayjs(), 'day')) || undefined\n \"\n :aria-label=\"\n formatDate({ date, locale: props.locale || 'en', format: 'MMMM D, YYYY' })\n \"\n :tabindex=\"\n isStatic || isOutside(date, month) ? -1 : dayjs(date).date() === 1 ? 0 : -1\n \"\n @keydown=\"\n isStatic\n ? undefined\n : handleDayKeydown($event, offset + weekIndex * columnsCount + dayIndex)\n \"\n @click=\"emit('dayClick', toDateString(date), $event)\"\n >\n <slot name=\"day\" :date=\"toDateString(date)\" :events=\"dayEvents(date)\">\n <component\n :is=\"() => props.renderDay!(toDateString(date), dayEvents(date))\"\n v-if=\"props.renderDay\"\n />\n <template v-else>\n {{ dayjs(date).date() }}\n <span v-if=\"dayEvents(date).length\" v-bind=\"getStyles('yearViewDayIndicators')\">\n <span\n v-for=\"event in dayEvents(date).slice(0, MAX_DAY_INDICATORS)\"\n :key=\"event.id\"\n v-bind=\"getStyles('yearViewDayIndicator')\"\n :style=\"indicatorStyle(event)\"\n />\n </span>\n </template>\n </slot>\n </UnstyledButton>\n </template>\n </div>\n </section>\n </div>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport YearViewComponent, { varsResolver } from './YearView.vue'\nimport type { YearViewFactory } from './YearView.types'\nimport classes from './YearView.module.css'\n\nexport const YearView = factory<YearViewFactory>(YearViewComponent, { classes, varsResolver })\n\nexport type {\n YearViewCssVariables,\n YearViewEmits,\n YearViewFactory,\n YearViewOwnProps,\n YearViewOwnStylesNames,\n YearViewProps,\n YearViewStylesNames,\n} from './YearView.types'\n",".root {\n &:where([data-layout='responsive']) {\n container-type: inline-size;\n }\n}\n\n.desktopView {\n display: block;\n height: 100%;\n\n @container (width <= 600px) {\n display: none;\n }\n}\n\n.mobileView {\n display: none;\n height: 100%;\n\n @container (width <= 600px) {\n display: block;\n }\n}\n","<script lang=\"ts\">\nimport type { ScheduleOwnProps } from './Schedule.types'\n\nconst defaultProps = {\n defaultView: 'week',\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n layout: 'default',\n} satisfies Partial<ScheduleOwnProps>\n\nexport { defaultProps }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, useAttrs, useSlots } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport type { DateStringValue, ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport { DayView } from '../DayView'\nimport { MobileMonthView } from '../MobileMonthView'\nimport { MonthView } from '../MonthView'\nimport { resolveEventRenderers } from '../shared'\nimport { WeekView } from '../WeekView'\nimport { YearView } from '../YearView'\nimport type { ScheduleEmits, ScheduleSlots } from './Schedule.types'\nimport classes from './Schedule.module.css'\n\ndefineOptions({\n name: 'Schedule',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleOwnProps>(), {\n date: undefined,\n defaultDate: undefined,\n view: undefined,\n defaultView: undefined,\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n renderEventBody: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n withInteractiveBackgroundEvents: undefined,\n recurrenceExpansionLimit: undefined,\n layout: undefined,\n dayViewProps: undefined,\n weekViewProps: undefined,\n monthViewProps: undefined,\n yearViewProps: undefined,\n mobileMonthViewProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleSlots>()\n\nconst emit = defineEmits<ScheduleEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('Schedule', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'Schedule',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n})\n\nconst [currentDate, setCurrentDate] = useUncontrolled<DateStringValue>({\n value: () => (props.date === undefined ? undefined : toDateString(props.date)),\n defaultValue: toDateString(props.defaultDate ?? dayjs()),\n onChange: (value) => {\n emit('update:date', value)\n emit('dateChange', value)\n },\n})\n\nconst [currentView, setCurrentView] = useUncontrolled<ScheduleViewLevel>({\n value: () => props.view,\n defaultValue: props.defaultView,\n finalValue: 'week',\n onChange: (value) => {\n emit('update:view', value)\n emit('viewChange', value)\n },\n})\n\nconst eventRenderers = computed(() =>\n resolveEventRenderers({ renderEventBody: props.renderEventBody }, slots),\n)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst sharedProps = computed(() => ({\n date: currentDate.value,\n events: props.events,\n locale: props.locale,\n radius: props.radius,\n labels: props.labels,\n mode: props.mode,\n withEventsDragAndDrop: props.withEventsDragAndDrop,\n canDragEvent: props.canDragEvent,\n withDragSlotSelect: props.withDragSlotSelect,\n withExternalEventDrop: props.withExternalEventDrop,\n withEventResize: props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n withInteractiveBackgroundEvents:\n props.mode === 'static' ? false : props.withInteractiveBackgroundEvents,\n recurrenceExpansionLimit: props.recurrenceExpansionLimit,\n ...eventRenderers.value,\n ...stylesApi.value,\n}))\n\n/**\n * Listeners re-emitted from the active view. They are `on*` keys rather than template `@`\n * bindings because a single object has to be spread onto whichever view is rendered — which is\n * exactly what the compiler produces for a template listener anyway.\n */\nconst sharedListeners = {\n onDateChange: (date: DateStringValue) => setCurrentDate(date),\n onViewChange: (view: ScheduleViewLevel) => setCurrentView(view),\n onEventDrop: (data: any) => emit('eventDrop', data),\n onEventDragStart: (event: any) => emit('eventDragStart', event),\n onEventDragEnd: () => emit('eventDragEnd'),\n onTimeSlotClick: (data: any) => emit('timeSlotClick', data),\n onAllDaySlotClick: (date: any, nativeEvent: MouseEvent) =>\n emit('allDaySlotClick', date, nativeEvent),\n onEventClick: (event: any, nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n onDayClick: (date: any, nativeEvent: MouseEvent) => emit('dayClick', date, nativeEvent),\n onMonthClick: (month: any) => emit('monthClick', month),\n onSlotDragEnd: (rangeStart: any, rangeEnd: any) => emit('slotDragEnd', rangeStart, rangeEnd),\n onExternalEventDrop: (dataTransfer: DataTransfer, dateTime: any) =>\n emit('externalEventDrop', dataTransfer, dateTime),\n onEventResize: (data: any) => emit('eventResize', data),\n}\n\nconst views = {\n day: DayView,\n week: WeekView,\n month: MonthView,\n year: YearView,\n} as const\n\nconst activeView = computed(() => views[currentView.value])\n\nconst activeViewProps = computed(() => {\n const perView = {\n day: props.dayViewProps,\n week: {\n ...(slots.weekLabel ? { renderWeekLabel: (payload: any) => slots.weekLabel!(payload) } : {}),\n ...props.weekViewProps,\n },\n month: props.monthViewProps,\n year: props.yearViewProps,\n }\n\n return { ...sharedProps.value, ...sharedListeners, ...perView[currentView.value] }\n})\n\n/**\n * The responsive layout shows the year view unchanged on narrow screens, because\n * `MobileMonthView` has no year equivalent.\n */\nconst mobileView = computed(() => (currentView.value === 'year' ? YearView : MobileMonthView))\n\nconst mobileViewProps = computed(() => {\n if (currentView.value === 'year') {\n return { ...sharedProps.value, ...sharedListeners, ...props.yearViewProps }\n }\n\n const viewProps = props.mobileMonthViewProps\n\n return {\n ...sharedProps.value,\n ...sharedListeners,\n ...(slots.header ? { renderHeader: (payload: any) => slots.header!(payload) } : {}),\n ...viewProps,\n onYearClick: () => setCurrentView('year'),\n // Both the schedule-level and the view-level listener run, matching the desktop view.\n onDayClick: (date: DateStringValue, nativeEvent: MouseEvent) => {\n emit('dayClick', date, nativeEvent)\n viewProps?.onDayClick?.(date, nativeEvent)\n },\n }\n})\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('root') }\"\n :mod=\"[{ layout: props.layout }, (attrs as any).mod]\"\n >\n <template v-if=\"props.layout !== 'responsive'\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\" />\n </template>\n\n <template v-else>\n <Box v-bind=\"getStyles('desktopView')\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\" />\n </Box>\n <Box v-bind=\"getStyles('mobileView')\">\n <component :is=\"mobileView\" v-bind=\"mobileViewProps\" />\n </Box>\n </template>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport type { ScheduleOwnProps } from './Schedule.types'\n\nconst defaultProps = {\n defaultView: 'week',\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n layout: 'default',\n} satisfies Partial<ScheduleOwnProps>\n\nexport { defaultProps }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, useAttrs, useSlots } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport type { DateStringValue, ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport { DayView } from '../DayView'\nimport { MobileMonthView } from '../MobileMonthView'\nimport { MonthView } from '../MonthView'\nimport { resolveEventRenderers } from '../shared'\nimport { WeekView } from '../WeekView'\nimport { YearView } from '../YearView'\nimport type { ScheduleEmits, ScheduleSlots } from './Schedule.types'\nimport classes from './Schedule.module.css'\n\ndefineOptions({\n name: 'Schedule',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ScheduleOwnProps>(), {\n date: undefined,\n defaultDate: undefined,\n view: undefined,\n defaultView: undefined,\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n renderEventBody: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n withInteractiveBackgroundEvents: undefined,\n recurrenceExpansionLimit: undefined,\n layout: undefined,\n dayViewProps: undefined,\n weekViewProps: undefined,\n monthViewProps: undefined,\n yearViewProps: undefined,\n mobileMonthViewProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ScheduleSlots>()\n\nconst emit = defineEmits<ScheduleEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('Schedule', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'Schedule',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n})\n\nconst [currentDate, setCurrentDate] = useUncontrolled<DateStringValue>({\n value: () => (props.date === undefined ? undefined : toDateString(props.date)),\n defaultValue: toDateString(props.defaultDate ?? dayjs()),\n onChange: (value) => {\n emit('update:date', value)\n emit('dateChange', value)\n },\n})\n\nconst [currentView, setCurrentView] = useUncontrolled<ScheduleViewLevel>({\n value: () => props.view,\n defaultValue: props.defaultView,\n finalValue: 'week',\n onChange: (value) => {\n emit('update:view', value)\n emit('viewChange', value)\n },\n})\n\nconst eventRenderers = computed(() =>\n resolveEventRenderers({ renderEventBody: props.renderEventBody }, slots),\n)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst sharedProps = computed(() => ({\n date: currentDate.value,\n events: props.events,\n locale: props.locale,\n radius: props.radius,\n labels: props.labels,\n mode: props.mode,\n withEventsDragAndDrop: props.withEventsDragAndDrop,\n canDragEvent: props.canDragEvent,\n withDragSlotSelect: props.withDragSlotSelect,\n withExternalEventDrop: props.withExternalEventDrop,\n withEventResize: props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n withInteractiveBackgroundEvents:\n props.mode === 'static' ? false : props.withInteractiveBackgroundEvents,\n recurrenceExpansionLimit: props.recurrenceExpansionLimit,\n ...eventRenderers.value,\n ...stylesApi.value,\n}))\n\n/**\n * Listeners re-emitted from the active view. They are `on*` keys rather than template `@`\n * bindings because a single object has to be spread onto whichever view is rendered — which is\n * exactly what the compiler produces for a template listener anyway.\n */\nconst sharedListeners = {\n onDateChange: (date: DateStringValue) => setCurrentDate(date),\n onViewChange: (view: ScheduleViewLevel) => setCurrentView(view),\n onEventDrop: (data: any) => emit('eventDrop', data),\n onEventDragStart: (event: any) => emit('eventDragStart', event),\n onEventDragEnd: () => emit('eventDragEnd'),\n onTimeSlotClick: (data: any) => emit('timeSlotClick', data),\n onAllDaySlotClick: (date: any, nativeEvent: MouseEvent) =>\n emit('allDaySlotClick', date, nativeEvent),\n onEventClick: (event: any, nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n onDayClick: (date: any, nativeEvent: MouseEvent) => emit('dayClick', date, nativeEvent),\n onMonthClick: (month: any) => emit('monthClick', month),\n onSlotDragEnd: (rangeStart: any, rangeEnd: any) => emit('slotDragEnd', rangeStart, rangeEnd),\n onExternalEventDrop: (dataTransfer: DataTransfer, dateTime: any) =>\n emit('externalEventDrop', dataTransfer, dateTime),\n onEventResize: (data: any) => emit('eventResize', data),\n}\n\nconst views = {\n day: DayView,\n week: WeekView,\n month: MonthView,\n year: YearView,\n} as const\n\nconst activeView = computed(() => views[currentView.value])\n\nconst activeViewProps = computed(() => {\n const perView = {\n day: props.dayViewProps,\n week: {\n ...(slots.weekLabel ? { renderWeekLabel: (payload: any) => slots.weekLabel!(payload) } : {}),\n ...props.weekViewProps,\n },\n month: props.monthViewProps,\n year: props.yearViewProps,\n }\n\n return { ...sharedProps.value, ...sharedListeners, ...perView[currentView.value] }\n})\n\n/**\n * The responsive layout shows the year view unchanged on narrow screens, because\n * `MobileMonthView` has no year equivalent.\n */\nconst mobileView = computed(() => (currentView.value === 'year' ? YearView : MobileMonthView))\n\nconst mobileViewProps = computed(() => {\n if (currentView.value === 'year') {\n return { ...sharedProps.value, ...sharedListeners, ...props.yearViewProps }\n }\n\n const viewProps = props.mobileMonthViewProps\n\n return {\n ...sharedProps.value,\n ...sharedListeners,\n ...(slots.header ? { renderHeader: (payload: any) => slots.header!(payload) } : {}),\n ...viewProps,\n onYearClick: () => setCurrentView('year'),\n // Both the schedule-level and the view-level listener run, matching the desktop view.\n onDayClick: (date: DateStringValue, nativeEvent: MouseEvent) => {\n emit('dayClick', date, nativeEvent)\n viewProps?.onDayClick?.(date, nativeEvent)\n },\n }\n})\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('root') }\"\n :mod=\"[{ layout: props.layout }, (attrs as any).mod]\"\n >\n <template v-if=\"props.layout !== 'responsive'\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\" />\n </template>\n\n <template v-else>\n <Box v-bind=\"getStyles('desktopView')\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\" />\n </Box>\n <Box v-bind=\"getStyles('mobileView')\">\n <component :is=\"mobileView\" v-bind=\"mobileViewProps\" />\n </Box>\n </template>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ScheduleComponent from './Schedule.vue'\nimport type { ScheduleFactory } from './Schedule.types'\nimport classes from './Schedule.module.css'\n\nexport const Schedule = factory<ScheduleFactory>(ScheduleComponent, { classes })\n\nexport type {\n ScheduleEmits,\n ScheduleFactory,\n ScheduleLayout,\n ScheduleOwnProps,\n ScheduleOwnStylesNames,\n ScheduleProps,\n ScheduleSlots,\n ScheduleStylesNames,\n} from './Schedule.types'\n","import dayjs from 'dayjs'\nimport { onBeforeUnmount, shallowRef } from 'vue'\nimport { rafThrottle } from '../components/shared'\nimport type { EventDropData } from '../component-props'\nimport type { DateTimeStringValue, ScheduleEventData, ScheduleMode } from '../types'\nimport { clampIntervalMinutes, parseTimeString } from '../utils'\n\ntype ResizeEdge = 'start' | 'end'\n\ninterface ResizeState {\n event: ScheduleEventData\n edge: ResizeEdge\n container: HTMLElement\n originalLeft: number\n originalWidth: number\n currentLeft: number\n currentWidth: number\n eventDate: string\n originalStart: DateTimeStringValue\n originalEnd: DateTimeStringValue\n dayIndex: number\n dayCount: number\n}\n\nexport function useHorizontalEventResize(input: {\n enabled: () => boolean\n mode: () => ScheduleMode\n startTime: () => string\n endTime: () => string\n intervalMinutes: () => number\n resizeIntervalMinutes?: () => number | undefined\n onEventResize: (data: EventDropData) => void\n canResizeEvent: () => ((event: ScheduleEventData) => boolean) | undefined\n}) {\n const state = shallowRef<ResizeState | null>(null)\n let justResized = false\n let savedUserSelect = ''\n\n const metrics = () => {\n const start = parseTimeString(input.startTime())\n const end = parseTimeString(input.endTime())\n const startMinutes = start.hours * 60 + start.minutes\n const literalRange = end.hours * 60 + end.minutes - startMinutes\n const interval = clampIntervalMinutes(\n input.resizeIntervalMinutes?.() ?? input.intervalMinutes(),\n )\n const total = Math.ceil(literalRange / interval) * interval\n return { startMinutes, literalRange, interval, total, minWidth: (interval / total) * 100 }\n }\n const snap = (percent: number) => {\n const { literalRange, interval, total } = metrics()\n const minutes = Math.max(\n 0,\n Math.min(literalRange, Math.round(((percent / 100) * total) / interval) * interval),\n )\n return (minutes / total) * 100\n }\n const toDateTime = (percent: number, date: string): DateTimeStringValue => {\n const { startMinutes, total } = metrics()\n const minutes = startMinutes + Math.round((snap(percent) / 100) * total)\n return `${date} ${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}:00`\n }\n /**\n * Coalesced to one animation frame: `pointermove` outruns paint, and each step reads layout\n * and re-renders the grid.\n */\n const move = rafThrottle((clientX: number) => {\n if (!state.value) return\n const rect = state.value.container.getBoundingClientRect()\n const dayWidth = rect.width / state.value.dayCount\n const raw = ((clientX - rect.left - state.value.dayIndex * dayWidth) / dayWidth) * 100\n const point = snap(raw)\n const { minWidth } = metrics()\n const current = state.value\n if (current.edge === 'end') {\n current.currentWidth = Math.max(minWidth, point - current.originalLeft)\n } else {\n const right = current.originalLeft + current.originalWidth\n current.currentLeft = Math.min(point, right - minWidth)\n current.currentWidth = right - current.currentLeft\n }\n state.value = { ...current }\n })\n const trackPointer = (event: PointerEvent) => move(event.clientX)\n const cleanup = () => {\n move.cancel()\n document.removeEventListener('pointermove', trackPointer)\n document.removeEventListener('pointerup', finish)\n document.body.style.userSelect = savedUserSelect\n }\n const finish = () => {\n // Drop the pending frame first, so a stale step cannot land after the gesture ended.\n move.cancel()\n const current = state.value\n if (\n current &&\n (current.currentLeft !== current.originalLeft ||\n current.currentWidth !== current.originalWidth)\n ) {\n input.onEventResize({\n eventId: current.event.id,\n newStart:\n current.edge === 'start'\n ? toDateTime(current.currentLeft, current.eventDate)\n : current.originalStart,\n newEnd:\n current.edge === 'end'\n ? toDateTime(current.currentLeft + current.currentWidth, current.eventDate)\n : current.originalEnd,\n event: current.event,\n })\n }\n state.value = null\n cleanup()\n justResized = true\n requestAnimationFrame(() => (justResized = false))\n }\n const handleResizeStart = (params: {\n event: ScheduleEventData\n edge: ResizeEdge\n container: HTMLElement\n originalLeft: number\n originalWidth: number\n eventDate: string\n pointerEvent: PointerEvent\n dayIndex?: number\n dayCount?: number\n }) => {\n if (!input.enabled() || input.mode() === 'static') return\n params.pointerEvent.preventDefault()\n params.pointerEvent.stopPropagation()\n state.value = {\n ...params,\n currentLeft: params.originalLeft,\n currentWidth: params.originalWidth,\n originalStart: dayjs(params.event.start).format('YYYY-MM-DD HH:mm:ss'),\n originalEnd: dayjs(params.event.end).format('YYYY-MM-DD HH:mm:ss'),\n dayIndex: params.dayIndex ?? 0,\n dayCount: params.dayCount ?? 1,\n }\n savedUserSelect = document.body.style.userSelect\n document.body.style.userSelect = 'none'\n document.addEventListener('pointermove', trackPointer)\n document.addEventListener('pointerup', finish)\n }\n onBeforeUnmount(cleanup)\n return {\n state,\n handleResizeStart,\n getResizePosition: (id: string | number) =>\n state.value?.event.id === id\n ? { left: state.value.currentLeft, width: state.value.currentWidth }\n : null,\n isResizableEvent: (event: ScheduleEventData) =>\n input.enabled() &&\n input.mode() !== 'static' &&\n event.display !== 'background' &&\n (input.canResizeEvent()?.(event) ?? true),\n wasResizing: () => justResized,\n }\n}\n","import type { DayPositionedEventData } from '../../../types'\n\nexport function getOverlapClusters(events: DayPositionedEventData[]): DayPositionedEventData[][] {\n const sorted = [...events].sort((a, b) => a.position.top - b.position.top)\n const clusters: DayPositionedEventData[][] = []\n let current: DayPositionedEventData[] = []\n let end = -1\n sorted.forEach((event) => {\n if (current.length && event.position.top >= end) {\n clusters.push(current)\n current = []\n end = -1\n }\n current.push(event)\n end = Math.max(end, event.position.top + event.position.height)\n })\n if (current.length) clusters.push(current)\n return clusters\n}\n","import dayjs from 'dayjs'\nimport type {\n AnyDateValue,\n DayPositionedEventData,\n ScheduleEventData,\n ScheduleResourceData,\n} from '../../../types'\nimport { getDayPosition, isAllDayEvent, isEventInTimeRange, validateEvent } from '../../../utils'\nimport { getDayPositionedEvents } from '../../DayView/get-day-view-events/get-day-positioned-events'\n\nexport interface ResourcesDayViewEventsResult {\n regularEvents: Record<string | number, DayPositionedEventData[]>\n allDayEvents: Record<string | number, DayPositionedEventData[]>\n backgroundTimedEvents: Record<string | number, DayPositionedEventData[]>\n backgroundAllDayEvents: Record<string | number, DayPositionedEventData[]>\n}\n\nexport function getResourcesDayViewEvents({\n events,\n resources,\n date,\n startTime,\n endTime,\n intervalMinutes,\n}: {\n events: ScheduleEventData[] | undefined\n resources: ScheduleResourceData[]\n date: AnyDateValue\n startTime?: string\n endTime?: string\n intervalMinutes?: number\n}): ResourcesDayViewEventsResult {\n const result: ResourcesDayViewEventsResult = {\n regularEvents: {},\n allDayEvents: {},\n backgroundTimedEvents: {},\n backgroundAllDayEvents: {},\n }\n resources.forEach((resource) => {\n result.regularEvents[resource.id] = []\n result.allDayEvents[resource.id] = []\n result.backgroundTimedEvents[resource.id] = []\n result.backgroundAllDayEvents[resource.id] = []\n })\n if (!events) return result\n\n const dayStart = dayjs(date).startOf('day')\n const dayEnd = dayjs(date).endOf('day')\n const regular = new Map<string | number, ScheduleEventData[]>(\n resources.map((resource) => [resource.id, []]),\n )\n const background = new Map<string | number, ScheduleEventData[]>(\n resources.map((resource) => [resource.id, []]),\n )\n const seen = new Set<string | number>()\n\n events.forEach((event) => {\n if (event.resourceId === undefined || !regular.has(event.resourceId)) return\n const eventStart = dayjs(event.start)\n const eventEnd = dayjs(event.end)\n const startsOnDay = eventStart.isSame(dayStart, 'day')\n if (!startsOnDay && !(eventStart.isBefore(dayEnd) && eventEnd.isAfter(dayStart))) return\n if (startsOnDay && !isEventInTimeRange({ event, startTime, endTime })) return\n if (seen.has(event.id)) {\n throw new Error(\n `[@mantine/schedule] ResourcesDayView: Duplicated event ids found: ${event.id}`,\n )\n }\n seen.add(event.id)\n const validated = validateEvent(event)\n if (event.display === 'background') {\n background.get(event.resourceId)!.push(validated)\n return\n }\n const clipped = startsOnDay\n ? validated\n : {\n ...validated,\n start: (eventStart.isBefore(dayStart) ? dayStart : eventStart).format(\n 'YYYY-MM-DD HH:mm:ss',\n ),\n end: (eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd).format('YYYY-MM-DD HH:mm:ss'),\n }\n if (isEventInTimeRange({ event: clipped, startTime, endTime })) {\n regular.get(event.resourceId)!.push(clipped)\n }\n })\n\n resources.forEach((resource) => {\n getDayPositionedEvents({\n events: regular.get(resource.id)!,\n startTime,\n endTime,\n date,\n intervalMinutes,\n }).forEach((event) => {\n const target = event.position.allDay ? result.allDayEvents : result.regularEvents\n target[resource.id].push(event)\n })\n\n background.get(resource.id)!.forEach((event) => {\n const clippedStart = dayjs(event.start).isBefore(dayStart) ? dayStart : dayjs(event.start)\n const clippedEnd = dayjs(event.end).isAfter(dayEnd) ? dayEnd : dayjs(event.end)\n const clipped = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n }\n const allDay = isAllDayEvent({ event: clipped, date })\n const position = allDay\n ? { top: 0, height: 100 }\n : getDayPosition({ event: clipped, startTime, endTime, intervalMinutes })\n if (!allDay && position.height <= 0) return\n const target = allDay ? result.backgroundAllDayEvents : result.backgroundTimedEvents\n target[resource.id].push({\n ...event,\n position: {\n ...position,\n allDay,\n width: 100,\n offset: 0,\n column: 0,\n overlaps: 1,\n },\n })\n })\n })\n return result\n}\n",".resourcesDayView {\n --resources-day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-day-view-resource-label-width: 120px;\n --resources-day-view-slot-width: 80px;\n --resources-day-view-row-height: 64px;\n --resources-day-view-group-label-width: 80px;\n --resources-day-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-day-view-border-color: var(--mantine-color-gray-3);\n --resources-day-view-business-hours-bg: var(--mantine-color-white);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-day-view-border-color: var(--mantine-color-dark-4);\n --resources-day-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesDayViewRoot {\n border: 1px solid var(--resources-day-view-border-color);\n border-radius: var(--resources-day-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesDayViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesDayViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n.resourcesDayViewTimeLabelsRow {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-day-view-border-color);\n margin-bottom: -1px;\n transition: box-shadow 100ms ease;\n &:where([data-scrolled]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n}\n.resourcesDayViewCorner {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n position: sticky;\n left: 0;\n z-index: 11;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n.resourcesDayViewTimeLabel {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n}\n.resourcesDayViewRow {\n display: flex;\n border-top: 1px solid var(--resources-day-view-border-color);\n}\n.resourcesDayViewResourceLabel {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 11;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n &:where([data-has-groups]) {\n left: var(--resources-day-view-group-label-width);\n }\n}\n.resourcesDayViewGroupColumn,\n.resourcesDayViewGroupColumnEmpty {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n}\n.resourcesDayViewGroupColumn {\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 overflow: visible;\n &:where([data-group-position='first'], [data-group-position='only']) {\n z-index: 13;\n }\n &:where([data-group-position='middle'], [data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-day-view-row-height) + 1px);\n }\n}\n.resourcesDayViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-day-view-row-height);\n}\n.resourcesDayViewRowSlot {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n min-height: var(--resources-day-view-row-height);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n cursor: pointer;\n position: relative;\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where(:focus) {\n z-index: 1;\n }\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\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 @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-primary-color-2);\n }\n }\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n.resourcesDayViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-day-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n position: absolute;\n pointer-events: none;\n top: 37px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n}\n.resourcesDayViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n inset-block: 0;\n background-color: var(--_indicator-color);\n}\n.resourcesDayViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: -5px;\n left: -5px;\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}\n.resourcesDayViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n text-transform: uppercase;\n top: 0;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n.resourcesDayViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-day-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n}\n.resourcesDayViewAllDayEvent {\n position: absolute;\n inset-inline: 1px;\n height: var(--resources-day-view-all-day-height);\n z-index: 3;\n}\n.resourcesDayViewEventWrapper {\n position: absolute;\n z-index: 3;\n}\n.resourcesDayViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n &:where([data-edge='start']) {\n left: -2px;\n }\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n.resourcesDayViewEventWrapper:hover .resourcesDayViewResizeHandle {\n opacity: 0.5;\n}\n.resourcesDayViewEventWrapper .resourcesDayViewResizeHandle:hover,\n.resourcesDayViewEventWrapper[data-resizing] .resourcesDayViewResizeHandle[data-active] {\n opacity: 0.8;\n}\n.resourcesDayViewEventWrapper[data-resizing] .resourcesDayViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n}\n.resourcesDayView:where([data-event-interaction]) .resourcesDayViewRowSlot {\n pointer-events: none;\n}\n.resourcesDayView:where([data-resizing]) * {\n cursor: ew-resize !important;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesDayViewOwnProps } from './ResourcesDayView.types'\n\nconst defaultProps = {\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n withHeader: true,\n headerFormat: 'MMMM D, YYYY',\n slotWidth: 80,\n rowHeight: 64,\n groupLabelWidth: 80,\n businessHours: ['09:00:00', '17:00:00'],\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n maxEventsPerTimeSlot: 2,\n} satisfies Partial<ResourcesDayViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesDayView: {\n '--resources-day-view-radius': resolveScheduleRadius(radius),\n '--resources-day-view-slot-width': cssSize(slotWidth),\n '--resources-day-view-row-height': cssSize(rowHeight),\n '--resources-day-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, RESOURCE_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n expandRecurringEvents,\n formatDate,\n getBusinessHoursMod,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getOrderedResources,\n handleResourcesGridKeyDown,\n isInTimeRange,\n clampIntervalMinutes,\n parseTimeString,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getOverlapClusters } from './get-overlap-clusters/get-overlap-clusters'\nimport { getResourcesDayViewEvents } from './get-resources-day-view-events/get-resources-day-view-events'\nimport type { ResourcesDayViewEmits, ResourcesDayViewSlots } from './ResourcesDayView.types'\nimport classes from './ResourcesDayView.module.css'\n\ndefineOptions({\n name: 'ResourcesDayView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesDayViewOwnProps>(), {\n groups: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n eventDragInterval: undefined,\n eventResizeInterval: undefined,\n slotLabelFormat: undefined,\n radius: undefined,\n startScrollTime: undefined,\n scrollAreaProps: undefined,\n locale: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n headerFormat: undefined,\n events: undefined,\n slotWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n labels: undefined,\n businessHours: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n withInteractiveBackgroundEvents: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesDayViewSlots>()\n\nconst emit = defineEmits<ResourcesDayViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('ResourcesDayView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesDayView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesDayView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; slotIndex: number } | null>(null)\nconst scrolled = ref(false)\nconst scrolledX = ref(false)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst date = computed(() => dayjs(props.date).format('YYYY-MM-DD') as DateStringValue)\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? new Date()))\nconst dayOfWeek = computed(() => dayjs(props.date).day() as DayOfWeek)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst resourceIdMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst expandedEvents = computed(() =>\n expandRecurringEvents({\n events: props.events,\n rangeStart: dayjs(props.date).startOf('day').toDate(),\n rangeEnd: dayjs(props.date).endOf('day').toDate(),\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst positioned = computed(() =>\n getResourcesDayViewEvents({\n date: props.date,\n events: expandedEvents.value,\n resources: props.resources,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst businessHoursMods = computed(() =>\n intervals.value.map((interval) =>\n getBusinessHoursMod({\n time: interval.startTime,\n businessHours: props.businessHours,\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayOfWeek.value,\n }),\n ),\n)\n\nconst showIndicator = computed(\n () =>\n (props.withCurrentTimeIndicator ?? dayjs(props.date).isSame(now.value, 'day')) &&\n isInTimeRange({\n date: now.value.toDate(),\n startTime: props.startTime!,\n endTime: props.endTime!,\n }),\n)\n\nconst indicatorOffset = computed(() =>\n getCurrentTimePosition({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n now: now.value,\n }),\n)\n\nconst currentTime = computed(() =>\n formatDate({ date: now.value, locale: props.locale || 'en', format: props.slotLabelFormat! }),\n)\n\nconst headerLabel = computed(() =>\n formatDate({ date: props.date, locale: props.locale || 'en', format: props.headerFormat! }),\n)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const first = intervals.value[start]\n const last = intervals.value[end]\n\n if (first && last) {\n emit('slotDragEnd', {\n rangeStart: `${date.value} ${first.startTime}` as DateTimeStringValue,\n rangeEnd: `${date.value} ${last.endTime}` as DateTimeStringValue,\n resourceId: resourceIdMap.value.get(group),\n })\n }\n },\n})\n\nconst resize = useHorizontalEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n resizeIntervalMinutes: () => props.eventResizeInterval,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n scrollSlotIntoView(controls[0]?.[targetIndex], 'x')\n})\n\nconst setControl = (resourceIndex: number, slotIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][slotIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n const node = (element as { $el?: HTMLElement } | null)?.$el ?? element\n\n if (node instanceof HTMLElement) {\n rowContainers.set(resourceIndex, node)\n }\n}\n\nconst withDragHandlers = computed(\n () => Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop),\n)\n\nconst getSlotIndexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container || intervals.value.length === 0) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(\n intervals.value.length - 1,\n Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * intervals.value.length),\n ),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, slotIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const interval = intervals.value[slotIndex]\n\n if (!interval) {\n return\n }\n\n const target = getSnappedDropTarget(nativeEvent, slotIndex)\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', { ...moveEventTo(event, target), resourceId })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: target,\n resourceId,\n })\n }\n}\n\nconst getSnappedDropTarget = (nativeEvent: DragEvent, slotIndex: number) => {\n const interval = intervals.value[slotIndex]\n if (!interval || props.eventDragInterval == null) {\n return `${date.value} ${interval?.startTime ?? '00:00:00'}` as DateTimeStringValue\n }\n\n const container =\n nativeEvent.currentTarget instanceof HTMLElement ? nativeEvent.currentTarget : null\n const rect = container?.getBoundingClientRect()\n const slotSize = rect && rect.width > 0 ? rect.width / intervals.value.length : 0\n const slotOffset = rect ? nativeEvent.clientX - rect.left - slotIndex * slotSize : 0\n const parsed = parseTimeString(interval.startTime)\n const dragInterval = clampIntervalMinutes(props.eventDragInterval)\n const raw =\n parsed.hours * 60 +\n parsed.minutes +\n (slotSize > 0 ? slotOffset / slotSize : 0) * props.intervalMinutes!\n const start = parseTimeString(props.startTime!)\n const end = parseTimeString(props.endTime!)\n const min = Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval\n const max = Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval\n const minutes =\n min > max\n ? start.hours * 60 + start.minutes\n : Math.max(min, Math.min(max, Math.round(raw / dragInterval) * dragInterval))\n return `${date.value} ${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}:00` as DateTimeStringValue\n}\n\nconst setDropTarget = (next: { resourceId: string | number; slotIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.slotIndex === next.slotIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const slotIndex = getSlotIndexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(slotIndex < 0 ? null : { resourceId, slotIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n if (isStatic.value) {\n return\n }\n\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const related = nativeEvent.relatedTarget\n const current = nativeEvent.currentTarget\n\n if (\n !(related instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(related)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const slotIndex = getSlotIndexAtPoint(nativeEvent, resourceIndex)\n\n if (slotIndex >= 0) {\n emitDrop(nativeEvent, resource.id, slotIndex)\n }\n}\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-day-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst backgroundEvents = (resourceId: string | number) => [\n ...(positioned.value.backgroundTimedEvents[resourceId] || []),\n ...(positioned.value.backgroundAllDayEvents[resourceId] || []),\n]\n\nconst backgroundEventStyle = (event: ScheduleEventData & { position: any }) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n return {\n left: `${event.position.top}%`,\n right: `${100 - event.position.top - event.position.height}%`,\n minWidth: '1px',\n top: 0,\n height: '100%',\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n }\n}\n\nconst allDayEvents = (resourceId: string | number) =>\n positioned.value.allDayEvents[resourceId] || []\n\nconst allDayEventStyle = (index: number) => ({\n top: `calc(${index} * (var(--resources-day-view-all-day-height) + 2px) + 2px)`,\n})\n\nconst allRegularEvents = (resourceId: string | number) =>\n positioned.value.regularEvents[resourceId] || []\n\nconst visibleRegularEvents = (resourceId: string | number) =>\n allRegularEvents(resourceId).filter(\n (event) => event.position.column < Math.max(1, props.maxEventsPerTimeSlot!),\n )\n\nconst eventWrapperStyle = (event: ScheduleEventData & { position: any }) => {\n const position = resize.getResizePosition(event.id)\n const left = position?.left ?? event.position.top\n const width = position?.width ?? event.position.height\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n\n return {\n left: `calc(${left}% + 1px)`,\n width: `calc(${width}% - 2px)`,\n top: `${event.position.offset}%`,\n height: `${event.position.width}%`,\n '--event-color': colors.color,\n }\n}\n\nconst moreClusters = (resourceId: string | number) =>\n getOverlapClusters(allRegularEvents(resourceId))\n .filter((cluster) =>\n cluster.some((event) => event.position.column >= props.maxEventsPerTimeSlot!),\n )\n .map((cluster) => {\n const left = Math.min(...cluster.map((event) => event.position.top))\n const right = Math.max(...cluster.map((event) => event.position.top + event.position.height))\n\n return {\n cluster,\n hiddenCount: cluster.filter((event) => event.position.column >= props.maxEventsPerTimeSlot!)\n .length,\n style: {\n position: 'absolute' as const,\n left: `calc(${left}% + 1px)`,\n width: `calc(${right - left}% - 2px)`,\n bottom: 0,\n height: '22px',\n zIndex: 4,\n },\n }\n })\n\nconst cornerStyle = computed(() =>\n hasGroups.value\n ? {\n flexBasis:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n }\n : undefined,\n)\n\nconst indicatorStyle = computed(() => ({\n '--indicator-left-offset': hasGroups.value\n ? `calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width) + (100% - var(--resources-day-view-resource-label-width) - var(--resources-day-view-group-label-width)) * ${indicatorOffset.value} / 100)`\n : `calc(var(--resources-day-view-resource-label-width) + (100% - var(--resources-day-view-resource-label-width)) * ${indicatorOffset.value} / 100)`,\n '--_time-bubble-width': String(currentTime.value).toLowerCase().includes('m') ? '64px' : '46px',\n}))\n\nconst rowMinHeight = (resourceId: string | number) => {\n const count = allDayEvents(resourceId).length\n\n return count\n ? {\n minHeight: `max(var(--resources-day-view-row-height), calc(${count} * (var(--resources-day-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined\n}\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!resize.wasResizing()) {\n emit('eventClick', event, nativeEvent)\n }\n}\n\nconst startResize = (\n event: ScheduleEventData & { position: any },\n resourceIndex: number,\n edge: 'start' | 'end',\n pointerEvent: PointerEvent,\n) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container) {\n return\n }\n\n resize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: date.value,\n pointerEvent,\n })\n}\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n return target\n ? {\n date: date.value,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesDayView') }\"\n :root-ref=\"setRootElement\"\n :data-resizing=\"resize.state.value ? true : undefined\"\n :data-event-interaction=\"resize.state.value ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :date=\"date\" :label=\"headerLabel\">\n <ScheduleHeaderBase\n view=\"day\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'day')\"\n :control=\"{ title: headerLabel }\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesDayViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesDayViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n @scroll-position-change=\"\n (position) => {\n scrolled = position.y !== 0\n scrolledX = position.x !== 0\n }\n \"\n >\n <div v-bind=\"getStyles('resourcesDayViewInner')\">\n <Box\n v-bind=\"getStyles('resourcesDayViewTimeLabelsRow')\"\n :data-scrolled=\"scrolled || undefined\"\n >\n <div v-bind=\"getStyles('resourcesDayViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <Box\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"interval.startTime\"\n v-bind=\"staticStyles('resourcesDayViewTimeLabel')\"\n :data-business-hours=\"businessHoursMods[slotIndex]['business-hours'] || undefined\"\n :data-non-business-hours=\"\n businessHoursMods[slotIndex]['non-business-hours'] || undefined\n \"\n >\n <slot\n name=\"timeLabel\"\n :label=\"\n formatDate({\n date: `${date} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n \"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n >\n {{\n formatDate({\n date: `${date} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </slot>\n </Box>\n </Box>\n\n <Box\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesDayViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesDayViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesDayViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <Box\n v-bind=\"staticStyles('resourcesDayViewResourceLabel')\"\n :data-scrolled-x=\"scrolledX || undefined\"\n :data-has-groups=\"groupInfo(resourceIndex) !== undefined || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </Box>\n\n <Box\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"getStyles('resourcesDayViewRowSlots', { style: rowMinHeight(resource.id) })\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"withDragHandlers ? handleRowDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <template v-for=\"event in backgroundEvents(resource.id)\" :key=\"`bg-${event.id}`\">\n <slot name=\"backgroundEvent\" :event=\"event\">\n <ScheduleBackgroundEvent\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...getStyles('resourcesDayViewBackgroundEvent') }\"\n :style=\"backgroundEventStyle(event)\"\n @event-click=\"clickEvent\"\n >\n </ScheduleBackgroundEvent>\n </slot>\n </template>\n\n <template\n v-for=\"(event, index) in allDayEvents(resource.id)\"\n :key=\"`all-${event.id}`\"\n >\n <Box\n v-bind=\"\n getStyles('resourcesDayViewAllDayEvent', { style: allDayEventStyle(index) })\n \"\n >\n <slot name=\"allDayEvent\" :event=\"event\">\n <ScheduleEvent\n :event=\"event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @click=\"\n isStatic ? undefined : emit('eventClick', event, $event as MouseEvent)\n \"\n />\n </slot>\n </Box>\n </template>\n\n <Box\n v-for=\"event in visibleRegularEvents(resource.id)\"\n :key=\"event.id\"\n v-bind=\"\n getStyles('resourcesDayViewEventWrapper', { style: eventWrapperStyle(event) })\n \"\n :data-resizing=\"resize.getResizePosition(event.id) !== null || undefined\"\n >\n <ScheduleEvent\n :event=\"event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(event)\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"isStatic ? undefined : clickEvent(event, $event as MouseEvent)\"\n />\n\n <template v-if=\"resize.isResizableEvent(event)\">\n <div\n v-for=\"edge in ['start', 'end'] as const\"\n :key=\"edge\"\n v-bind=\"staticStyles('resourcesDayViewResizeHandle')\"\n :data-edge=\"edge\"\n :data-active=\"resize.state.value?.edge === edge || undefined\"\n :aria-label=\"`${\n edge === 'start' ? 'Resize event start' : 'Resize event end'\n } ${event.title}`\"\n @dragstart.prevent\n @pointerdown=\"startResize(event, resourceIndex, edge, $event)\"\n />\n </template>\n </Box>\n\n <template\n v-for=\"entry in moreClusters(resource.id)\"\n :key=\"`more-${entry.cluster[0].id}`\"\n >\n <slot name=\"moreEvents\" :events=\"entry.cluster\" :hidden-count=\"entry.hiddenCount\">\n <MoreEvents\n :events=\"entry.cluster\"\n :more-events-count=\"entry.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"entry.style\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <UnstyledButton\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"interval.startTime\"\n :ref=\"setControl(resourceIndex, slotIndex)\"\n v-bind=\"staticStyles('resourcesDayViewRowSlot')\"\n :data-business-hours=\"businessHoursMods[slotIndex]['business-hours'] || undefined\"\n :data-non-business-hours=\"\n businessHoursMods[slotIndex]['non-business-hours'] || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id && dropTarget.slotIndex === slotIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(slotIndex, String(resource.id)) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"props.withDragSlotSelect ? slotIndex : undefined\"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :aria-label=\"`${getLabel('resourceSlot', props.labels)} ${String(resource.label)} ${date} ${interval.startTime} - ${interval.endTime}`\"\n :tabindex=\"isStatic ? -1 : resourceIndex === 0 && slotIndex === 0 ? 0 : -1\"\n @keydown=\"\n handleResourcesGridKeyDown({ controls, resourceIndex, slotIndex, event: $event })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown($event, slotIndex, String(resource.id))\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('timeSlotClick', {\n slotStart: `${date} ${interval.startTime}` as DateTimeStringValue,\n slotEnd: `${date} ${interval.endTime}` as DateTimeStringValue,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot\n name=\"timeSlot\"\n :resource=\"resource\"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n />\n </UnstyledButton>\n </Box>\n </Box>\n\n <template v-if=\"showIndicator\">\n <slot name=\"currentTimeIndicator\" :time=\"currentTime\" :offset=\"indicatorOffset\">\n <Box\n v-bind=\"\n getStyles('resourcesDayViewCurrentTimeIndicator', { style: indicatorStyle })\n \"\n >\n <div\n v-if=\"props.withCurrentTimeBubble\"\n v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorTimeBubble')\"\n >\n {{ currentTime }}\n </div>\n <div v-else v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorLine')\" />\n </Box>\n </slot>\n </template>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesDayViewOwnProps } from './ResourcesDayView.types'\n\nconst defaultProps = {\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n withHeader: true,\n headerFormat: 'MMMM D, YYYY',\n slotWidth: 80,\n rowHeight: 64,\n groupLabelWidth: 80,\n businessHours: ['09:00:00', '17:00:00'],\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n maxEventsPerTimeSlot: 2,\n} satisfies Partial<ResourcesDayViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesDayView: {\n '--resources-day-view-radius': resolveScheduleRadius(radius),\n '--resources-day-view-slot-width': cssSize(slotWidth),\n '--resources-day-view-row-height': cssSize(rowHeight),\n '--resources-day-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, RESOURCE_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n expandRecurringEvents,\n formatDate,\n getBusinessHoursMod,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getOrderedResources,\n handleResourcesGridKeyDown,\n isInTimeRange,\n clampIntervalMinutes,\n parseTimeString,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getOverlapClusters } from './get-overlap-clusters/get-overlap-clusters'\nimport { getResourcesDayViewEvents } from './get-resources-day-view-events/get-resources-day-view-events'\nimport type { ResourcesDayViewEmits, ResourcesDayViewSlots } from './ResourcesDayView.types'\nimport classes from './ResourcesDayView.module.css'\n\ndefineOptions({\n name: 'ResourcesDayView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesDayViewOwnProps>(), {\n groups: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n eventDragInterval: undefined,\n eventResizeInterval: undefined,\n slotLabelFormat: undefined,\n radius: undefined,\n startScrollTime: undefined,\n scrollAreaProps: undefined,\n locale: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n headerFormat: undefined,\n events: undefined,\n slotWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n labels: undefined,\n businessHours: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n withInteractiveBackgroundEvents: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesDayViewSlots>()\n\nconst emit = defineEmits<ResourcesDayViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('ResourcesDayView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesDayView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesDayView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; slotIndex: number } | null>(null)\nconst scrolled = ref(false)\nconst scrolledX = ref(false)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst date = computed(() => dayjs(props.date).format('YYYY-MM-DD') as DateStringValue)\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? new Date()))\nconst dayOfWeek = computed(() => dayjs(props.date).day() as DayOfWeek)\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst resourceIdMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst expandedEvents = computed(() =>\n expandRecurringEvents({\n events: props.events,\n rangeStart: dayjs(props.date).startOf('day').toDate(),\n rangeEnd: dayjs(props.date).endOf('day').toDate(),\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst positioned = computed(() =>\n getResourcesDayViewEvents({\n date: props.date,\n events: expandedEvents.value,\n resources: props.resources,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst businessHoursMods = computed(() =>\n intervals.value.map((interval) =>\n getBusinessHoursMod({\n time: interval.startTime,\n businessHours: props.businessHours,\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayOfWeek.value,\n }),\n ),\n)\n\nconst showIndicator = computed(\n () =>\n (props.withCurrentTimeIndicator ?? dayjs(props.date).isSame(now.value, 'day')) &&\n isInTimeRange({\n date: now.value.toDate(),\n startTime: props.startTime!,\n endTime: props.endTime!,\n }),\n)\n\nconst indicatorOffset = computed(() =>\n getCurrentTimePosition({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n now: now.value,\n }),\n)\n\nconst currentTime = computed(() =>\n formatDate({ date: now.value, locale: props.locale || 'en', format: props.slotLabelFormat! }),\n)\n\nconst headerLabel = computed(() =>\n formatDate({ date: props.date, locale: props.locale || 'en', format: props.headerFormat! }),\n)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const first = intervals.value[start]\n const last = intervals.value[end]\n\n if (first && last) {\n emit('slotDragEnd', {\n rangeStart: `${date.value} ${first.startTime}` as DateTimeStringValue,\n rangeEnd: `${date.value} ${last.endTime}` as DateTimeStringValue,\n resourceId: resourceIdMap.value.get(group),\n })\n }\n },\n})\n\nconst resize = useHorizontalEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n resizeIntervalMinutes: () => props.eventResizeInterval,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nonMounted(async () => {\n if (!props.startScrollTime) {\n return\n }\n\n await nextTick()\n\n const targetIndex = intervals.value.findIndex(\n (interval) => interval.startTime >= props.startScrollTime!,\n )\n\n if (targetIndex < 0) {\n return\n }\n\n scrollSlotIntoView(controls[0]?.[targetIndex], 'x')\n})\n\nconst setControl = (resourceIndex: number, slotIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][slotIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n const node = (element as { $el?: HTMLElement } | null)?.$el ?? element\n\n if (node instanceof HTMLElement) {\n rowContainers.set(resourceIndex, node)\n }\n}\n\nconst withDragHandlers = computed(\n () => Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop),\n)\n\nconst getSlotIndexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container || intervals.value.length === 0) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(\n intervals.value.length - 1,\n Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * intervals.value.length),\n ),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, slotIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const interval = intervals.value[slotIndex]\n\n if (!interval) {\n return\n }\n\n const target = getSnappedDropTarget(nativeEvent, slotIndex)\n const event = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', { ...moveEventTo(event, target), resourceId })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: target,\n resourceId,\n })\n }\n}\n\nconst getSnappedDropTarget = (nativeEvent: DragEvent, slotIndex: number) => {\n const interval = intervals.value[slotIndex]\n if (!interval || props.eventDragInterval == null) {\n return `${date.value} ${interval?.startTime ?? '00:00:00'}` as DateTimeStringValue\n }\n\n const container =\n nativeEvent.currentTarget instanceof HTMLElement ? nativeEvent.currentTarget : null\n const rect = container?.getBoundingClientRect()\n const slotSize = rect && rect.width > 0 ? rect.width / intervals.value.length : 0\n const slotOffset = rect ? nativeEvent.clientX - rect.left - slotIndex * slotSize : 0\n const parsed = parseTimeString(interval.startTime)\n const dragInterval = clampIntervalMinutes(props.eventDragInterval)\n const raw =\n parsed.hours * 60 +\n parsed.minutes +\n (slotSize > 0 ? slotOffset / slotSize : 0) * props.intervalMinutes!\n const start = parseTimeString(props.startTime!)\n const end = parseTimeString(props.endTime!)\n const min = Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval\n const max = Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval\n const minutes =\n min > max\n ? start.hours * 60 + start.minutes\n : Math.max(min, Math.min(max, Math.round(raw / dragInterval) * dragInterval))\n return `${date.value} ${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}:00` as DateTimeStringValue\n}\n\nconst setDropTarget = (next: { resourceId: string | number; slotIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.slotIndex === next.slotIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const slotIndex = getSlotIndexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(slotIndex < 0 ? null : { resourceId, slotIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n if (isStatic.value) {\n return\n }\n\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const related = nativeEvent.relatedTarget\n const current = nativeEvent.currentTarget\n\n if (\n !(related instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(related)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const slotIndex = getSlotIndexAtPoint(nativeEvent, resourceIndex)\n\n if (slotIndex >= 0) {\n emitDrop(nativeEvent, resource.id, slotIndex)\n }\n}\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-day-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst backgroundEvents = (resourceId: string | number) => [\n ...(positioned.value.backgroundTimedEvents[resourceId] || []),\n ...(positioned.value.backgroundAllDayEvents[resourceId] || []),\n]\n\nconst backgroundEventStyle = (event: ScheduleEventData & { position: any }) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n return {\n left: `${event.position.top}%`,\n right: `${100 - event.position.top - event.position.height}%`,\n minWidth: '1px',\n top: 0,\n height: '100%',\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n }\n}\n\nconst allDayEvents = (resourceId: string | number) =>\n positioned.value.allDayEvents[resourceId] || []\n\nconst allDayEventStyle = (index: number) => ({\n top: `calc(${index} * (var(--resources-day-view-all-day-height) + 2px) + 2px)`,\n})\n\nconst allRegularEvents = (resourceId: string | number) =>\n positioned.value.regularEvents[resourceId] || []\n\nconst visibleRegularEvents = (resourceId: string | number) =>\n allRegularEvents(resourceId).filter(\n (event) => event.position.column < Math.max(1, props.maxEventsPerTimeSlot!),\n )\n\nconst eventWrapperStyle = (event: ScheduleEventData & { position: any }) => {\n const position = resize.getResizePosition(event.id)\n const left = position?.left ?? event.position.top\n const width = position?.width ?? event.position.height\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n\n return {\n left: `calc(${left}% + 1px)`,\n width: `calc(${width}% - 2px)`,\n top: `${event.position.offset}%`,\n height: `${event.position.width}%`,\n '--event-color': colors.color,\n }\n}\n\nconst moreClusters = (resourceId: string | number) =>\n getOverlapClusters(allRegularEvents(resourceId))\n .filter((cluster) =>\n cluster.some((event) => event.position.column >= props.maxEventsPerTimeSlot!),\n )\n .map((cluster) => {\n const left = Math.min(...cluster.map((event) => event.position.top))\n const right = Math.max(...cluster.map((event) => event.position.top + event.position.height))\n\n return {\n cluster,\n hiddenCount: cluster.filter((event) => event.position.column >= props.maxEventsPerTimeSlot!)\n .length,\n style: {\n position: 'absolute' as const,\n left: `calc(${left}% + 1px)`,\n width: `calc(${right - left}% - 2px)`,\n bottom: 0,\n height: '22px',\n zIndex: 4,\n },\n }\n })\n\nconst cornerStyle = computed(() =>\n hasGroups.value\n ? {\n flexBasis:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width))',\n }\n : undefined,\n)\n\nconst indicatorStyle = computed(() => ({\n '--indicator-left-offset': hasGroups.value\n ? `calc(var(--resources-day-view-resource-label-width) + var(--resources-day-view-group-label-width) + (100% - var(--resources-day-view-resource-label-width) - var(--resources-day-view-group-label-width)) * ${indicatorOffset.value} / 100)`\n : `calc(var(--resources-day-view-resource-label-width) + (100% - var(--resources-day-view-resource-label-width)) * ${indicatorOffset.value} / 100)`,\n '--_time-bubble-width': String(currentTime.value).toLowerCase().includes('m') ? '64px' : '46px',\n}))\n\nconst rowMinHeight = (resourceId: string | number) => {\n const count = allDayEvents(resourceId).length\n\n return count\n ? {\n minHeight: `max(var(--resources-day-view-row-height), calc(${count} * (var(--resources-day-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined\n}\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!resize.wasResizing()) {\n emit('eventClick', event, nativeEvent)\n }\n}\n\nconst startResize = (\n event: ScheduleEventData & { position: any },\n resourceIndex: number,\n edge: 'start' | 'end',\n pointerEvent: PointerEvent,\n) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container) {\n return\n }\n\n resize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: date.value,\n pointerEvent,\n })\n}\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n return target\n ? {\n date: date.value,\n slotIndex: target.slotIndex,\n time: intervals.value[target.slotIndex]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesDayView') }\"\n :root-ref=\"setRootElement\"\n :data-resizing=\"resize.state.value ? true : undefined\"\n :data-event-interaction=\"resize.state.value ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :date=\"date\" :label=\"headerLabel\">\n <ScheduleHeaderBase\n view=\"day\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'day')\"\n :control=\"{ title: headerLabel }\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesDayViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesDayViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n @scroll-position-change=\"\n (position) => {\n scrolled = position.y !== 0\n scrolledX = position.x !== 0\n }\n \"\n >\n <div v-bind=\"getStyles('resourcesDayViewInner')\">\n <Box\n v-bind=\"getStyles('resourcesDayViewTimeLabelsRow')\"\n :data-scrolled=\"scrolled || undefined\"\n >\n <div v-bind=\"getStyles('resourcesDayViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <Box\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"interval.startTime\"\n v-bind=\"staticStyles('resourcesDayViewTimeLabel')\"\n :data-business-hours=\"businessHoursMods[slotIndex]['business-hours'] || undefined\"\n :data-non-business-hours=\"\n businessHoursMods[slotIndex]['non-business-hours'] || undefined\n \"\n >\n <slot\n name=\"timeLabel\"\n :label=\"\n formatDate({\n date: `${date} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n \"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n >\n {{\n formatDate({\n date: `${date} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </slot>\n </Box>\n </Box>\n\n <Box\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesDayViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesDayViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesDayViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <Box\n v-bind=\"staticStyles('resourcesDayViewResourceLabel')\"\n :data-scrolled-x=\"scrolledX || undefined\"\n :data-has-groups=\"groupInfo(resourceIndex) !== undefined || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </Box>\n\n <Box\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"getStyles('resourcesDayViewRowSlots', { style: rowMinHeight(resource.id) })\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"withDragHandlers ? handleRowDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <template v-for=\"event in backgroundEvents(resource.id)\" :key=\"`bg-${event.id}`\">\n <slot name=\"backgroundEvent\" :event=\"event\">\n <ScheduleBackgroundEvent\n :event=\"event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{ ...eventRenderers, ...getStyles('resourcesDayViewBackgroundEvent') }\"\n :style=\"backgroundEventStyle(event)\"\n @event-click=\"clickEvent\"\n >\n </ScheduleBackgroundEvent>\n </slot>\n </template>\n\n <template\n v-for=\"(event, index) in allDayEvents(resource.id)\"\n :key=\"`all-${event.id}`\"\n >\n <Box\n v-bind=\"\n getStyles('resourcesDayViewAllDayEvent', { style: allDayEventStyle(index) })\n \"\n >\n <slot name=\"allDayEvent\" :event=\"event\">\n <ScheduleEvent\n :event=\"event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @click=\"\n isStatic ? undefined : emit('eventClick', event, $event as MouseEvent)\n \"\n />\n </slot>\n </Box>\n </template>\n\n <Box\n v-for=\"event in visibleRegularEvents(resource.id)\"\n :key=\"event.id\"\n v-bind=\"\n getStyles('resourcesDayViewEventWrapper', { style: eventWrapperStyle(event) })\n \"\n :data-resizing=\"resize.getResizePosition(event.id) !== null || undefined\"\n >\n <ScheduleEvent\n :event=\"event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(event)\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"isStatic ? undefined : clickEvent(event, $event as MouseEvent)\"\n />\n\n <template v-if=\"resize.isResizableEvent(event)\">\n <div\n v-for=\"edge in ['start', 'end'] as const\"\n :key=\"edge\"\n v-bind=\"staticStyles('resourcesDayViewResizeHandle')\"\n :data-edge=\"edge\"\n :data-active=\"resize.state.value?.edge === edge || undefined\"\n :aria-label=\"`${\n edge === 'start' ? 'Resize event start' : 'Resize event end'\n } ${event.title}`\"\n @dragstart.prevent\n @pointerdown=\"startResize(event, resourceIndex, edge, $event)\"\n />\n </template>\n </Box>\n\n <template\n v-for=\"entry in moreClusters(resource.id)\"\n :key=\"`more-${entry.cluster[0].id}`\"\n >\n <slot name=\"moreEvents\" :events=\"entry.cluster\" :hidden-count=\"entry.hiddenCount\">\n <MoreEvents\n :events=\"entry.cluster\"\n :more-events-count=\"entry.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"entry.style\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <UnstyledButton\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"interval.startTime\"\n :ref=\"setControl(resourceIndex, slotIndex)\"\n v-bind=\"staticStyles('resourcesDayViewRowSlot')\"\n :data-business-hours=\"businessHoursMods[slotIndex]['business-hours'] || undefined\"\n :data-non-business-hours=\"\n businessHoursMods[slotIndex]['non-business-hours'] || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id && dropTarget.slotIndex === slotIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(slotIndex, String(resource.id)) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"props.withDragSlotSelect ? slotIndex : undefined\"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :aria-label=\"`${getLabel('resourceSlot', props.labels)} ${String(resource.label)} ${date} ${interval.startTime} - ${interval.endTime}`\"\n :tabindex=\"isStatic ? -1 : resourceIndex === 0 && slotIndex === 0 ? 0 : -1\"\n @keydown=\"\n handleResourcesGridKeyDown({ controls, resourceIndex, slotIndex, event: $event })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown($event, slotIndex, String(resource.id))\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('timeSlotClick', {\n slotStart: `${date} ${interval.startTime}` as DateTimeStringValue,\n slotEnd: `${date} ${interval.endTime}` as DateTimeStringValue,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot\n name=\"timeSlot\"\n :resource=\"resource\"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n />\n </UnstyledButton>\n </Box>\n </Box>\n\n <template v-if=\"showIndicator\">\n <slot name=\"currentTimeIndicator\" :time=\"currentTime\" :offset=\"indicatorOffset\">\n <Box\n v-bind=\"\n getStyles('resourcesDayViewCurrentTimeIndicator', { style: indicatorStyle })\n \"\n >\n <div\n v-if=\"props.withCurrentTimeBubble\"\n v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorTimeBubble')\"\n >\n {{ currentTime }}\n </div>\n <div v-else v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('resourcesDayViewCurrentTimeIndicatorLine')\" />\n </Box>\n </slot>\n </template>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ResourcesDayViewComponent, { varsResolver } from './ResourcesDayView.vue'\nimport type { ResourcesDayViewFactory } from './ResourcesDayView.types'\nimport classes from './ResourcesDayView.module.css'\n\nexport const ResourcesDayView = factory<ResourcesDayViewFactory>(ResourcesDayViewComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n ResourceExternalDropData,\n ResourceSlotDragEndData,\n ResourceTimeSlotClickData,\n ResourceViewDropData,\n ResourcesDayViewCssVariables,\n ResourcesDayViewEmits,\n ResourcesDayViewFactory,\n ResourcesDayViewOwnProps,\n ResourcesDayViewOwnStylesNames,\n ResourcesDayViewProps,\n ResourcesDayViewSlots,\n ResourcesDayViewStylesNames,\n} from './ResourcesDayView.types'\n","import dayjs from 'dayjs'\nimport type { ScheduleEventData, ScheduleResourceData } from '../../../types'\nimport { expandRecurringEvents, isMultidayEvent } from '../../../utils'\nimport {\n getResourcesDayViewEvents,\n type ResourcesDayViewEventsResult,\n} from '../../ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events'\nimport { calculateEventDays } from '../../WeekView/get-week-view-events/calculate-event-days'\nimport { getEventEndDate } from '../../WeekView/get-week-view-events/get-event-end-date'\n\nexport interface ResourcesWeekViewAllDayBar {\n event: ScheduleEventData\n startDayIndex: number\n endDayIndex: number\n row: number\n}\n\nexport interface ResourcesWeekViewEventsResult {\n byDay: Record<string, ResourcesDayViewEventsResult>\n allDayBars: Record<string | number, ResourcesWeekViewAllDayBar[]>\n}\n\nfunction assignAllDayRows(bars: ResourcesWeekViewAllDayBar[]): void {\n const rowEnds: number[] = []\n ;[...bars]\n .sort((a, b) => a.startDayIndex - b.startDayIndex || a.endDayIndex - b.endDayIndex)\n .forEach((bar) => {\n let row = 0\n while (row < rowEnds.length && rowEnds[row] >= bar.startDayIndex) row += 1\n rowEnds[row] = bar.endDayIndex\n bar.row = row\n })\n}\n\nexport function getResourcesWeekViewEvents({\n events,\n resources,\n weekdays,\n startTime,\n endTime,\n intervalMinutes,\n expansionLimit,\n}: {\n events: ScheduleEventData[] | undefined\n resources: ScheduleResourceData[]\n weekdays: string[]\n startTime?: string\n endTime?: string\n intervalMinutes?: number\n expansionLimit?: number\n}): ResourcesWeekViewEventsResult {\n const expanded = expandRecurringEvents({\n events,\n rangeStart: dayjs(weekdays[0]).startOf('day').toDate(),\n rangeEnd: dayjs(weekdays.at(-1)).endOf('day').toDate(),\n expansionLimit,\n })\n const seen = new Set<string | number>()\n expanded?.forEach((event) => {\n if (seen.has(event.id)) {\n throw new Error(\n `[@mantine/schedule] ResourcesWeekView: Duplicated event ids found: ${event.id}`,\n )\n }\n seen.add(event.id)\n })\n\n const byDay: Record<string, ResourcesDayViewEventsResult> = {}\n const assigned = new Set<string | number>()\n const spanning = (event: ScheduleEventData) =>\n event.display !== 'background' && isMultidayEvent(event)\n weekdays.forEach((day) => {\n const dayEvents = expanded?.filter((event) => {\n if (assigned.has(event.id) || spanning(event)) return false\n const start = dayjs(event.start)\n const dayStart = dayjs(day).startOf('day')\n if (start.isSame(dayStart, 'day')) {\n assigned.add(event.id)\n return true\n }\n return (\n event.display === 'background' &&\n start.isBefore(dayjs(day).endOf('day')) &&\n dayjs(event.end).isAfter(dayStart)\n )\n })\n byDay[day] = getResourcesDayViewEvents({\n events: dayEvents,\n resources,\n date: day,\n startTime,\n endTime,\n intervalMinutes,\n })\n })\n\n const allDayBars: Record<string | number, ResourcesWeekViewAllDayBar[]> = {}\n resources.forEach((resource) => (allDayBars[resource.id] = []))\n weekdays.forEach((day, dayIndex) => {\n resources.forEach((resource) => {\n byDay[day].allDayEvents[resource.id]?.forEach((event) =>\n allDayBars[resource.id].push({\n event,\n startDayIndex: dayIndex,\n endDayIndex: dayIndex,\n row: 0,\n }),\n )\n })\n })\n expanded?.forEach((event) => {\n if (!spanning(event) || event.resourceId === undefined || !(event.resourceId in allDayBars))\n return\n const days = calculateEventDays({\n event,\n weekDays: weekdays,\n actualEndDate: getEventEndDate(event),\n })\n if (!days.length) return\n allDayBars[event.resourceId].push({\n event,\n startDayIndex: weekdays.indexOf(days[0]),\n endDayIndex: weekdays.indexOf(days.at(-1)!),\n row: 0,\n })\n })\n resources.forEach((resource) => assignAllDayRows(allDayBars[resource.id]))\n return { byDay, allDayBars }\n}\n",".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 @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 @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.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.resourcesWeekViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n.resourcesWeekViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\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.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.resourcesWeekViewHeaderContent {\n display: flex;\n flex-direction: column;\n}\n.resourcesWeekViewDayLabelsRow {\n display: flex;\n border-bottom: 1px solid var(--resources-week-view-border-color);\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 &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\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.resourcesWeekViewTimeLabelsRow {\n display: flex;\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 &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n}\n.resourcesWeekViewRow {\n display: flex;\n border-top: 1px solid var(--resources-week-view-border-color);\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 &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n &:where([data-has-groups]) {\n left: var(--resources-week-view-group-label-width);\n }\n}\n.resourcesWeekViewGroupColumn,\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.resourcesWeekViewGroupColumn {\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 overflow: visible;\n &:where([data-group-position='first'], [data-group-position='only']) {\n z-index: 13;\n }\n &:where([data-group-position='middle'], [data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-week-view-row-height) + 1px);\n }\n}\n.resourcesWeekViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-week-view-row-height);\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 &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where(:focus) {\n z-index: 1;\n }\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-color-blue-4);\n border-radius: 2px;\n }\n }\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-primary-color-2);\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.resourcesWeekViewAllDayEvent {\n position: absolute;\n height: var(--resources-week-view-all-day-height);\n z-index: 2;\n}\n.resourcesWeekViewEventWrapper {\n position: absolute;\n z-index: 3;\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 &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n &:where([data-edge='start']) {\n left: -2px;\n }\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n.resourcesWeekViewEventWrapper:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n}\n.resourcesWeekViewEventWrapper .resourcesWeekViewResizeHandle:hover,\n.resourcesWeekViewEventWrapper[data-resizing] .resourcesWeekViewResizeHandle[data-active] {\n opacity: 0.8;\n}\n.resourcesWeekViewEventWrapper[data-resizing] .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n}\n.resourcesWeekView:where([data-event-interaction]) .resourcesWeekViewRowSlot {\n pointer-events: none;\n}\n.resourcesWeekView:where([data-resizing]) * {\n cursor: ew-resize !important;\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 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.resourcesWeekViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n inset-block: 0;\n background-color: var(--_indicator-color);\n}\n.resourcesWeekViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: -5px;\n left: -5px;\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}\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 text-transform: uppercase;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesWeekViewOwnProps } from './ResourcesWeekView.types'\n\nconst defaultProps = {\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n withHeader: true,\n weekLabelFormat: 'MMM DD',\n slotWidth: 60,\n rowHeight: 64,\n groupLabelWidth: 80,\n businessHours: ['09:00:00', '17:00:00'],\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n maxEventsPerTimeSlot: 2,\n firstDayOfWeek: 1,\n weekendDays: [0, 6],\n withWeekendDays: true,\n weekdayFormat: 'ddd D',\n highlightToday: true,\n} satisfies Partial<ResourcesWeekViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesWeekView: {\n '--resources-week-view-radius': resolveScheduleRadius(radius),\n '--resources-week-view-slot-width': cssSize(slotWidth),\n '--resources-week-view-row-height': cssSize(rowHeight),\n '--resources-week-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, RESOURCE_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getOrderedResources,\n getWeekDays,\n handleResourcesGridKeyDown,\n isInTimeRange,\n clampIntervalMinutes,\n parseTimeString,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { getOverlapClusters } from '../ResourcesDayView/get-overlap-clusters/get-overlap-clusters'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getWeekLabel } from '../WeekView/get-week-label/get-week-label'\nimport { getResourcesWeekViewEvents } from './get-resources-week-view-events/get-resources-week-view-events'\nimport type { ResourcesWeekViewEmits, ResourcesWeekViewSlots } from './ResourcesWeekView.types'\nimport classes from './ResourcesWeekView.module.css'\n\ndefineOptions({\n name: 'ResourcesWeekView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesWeekViewOwnProps>(), {\n groups: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n eventDragInterval: undefined,\n eventResizeInterval: undefined,\n slotLabelFormat: undefined,\n radius: undefined,\n startScrollDateTime: undefined,\n scrollAreaProps: undefined,\n locale: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n weekLabelFormat: undefined,\n renderWeekLabel: undefined,\n events: undefined,\n slotWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n labels: undefined,\n businessHours: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n withInteractiveBackgroundEvents: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n firstDayOfWeek: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n weekdayFormat: undefined,\n highlightToday: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesWeekViewSlots>()\n\nconst emit = defineEmits<ResourcesWeekViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('ResourcesWeekView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesWeekView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesWeekView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; flatIndex: number } | null>(null)\nconst scrolledX = ref(false)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst weekdays = computed(() =>\n getWeekDays({\n week: props.date,\n firstDayOfWeek: props.firstDayOfWeek,\n weekendDays: props.weekendDays,\n withWeekendDays: props.withWeekendDays,\n }).map((day) => dayjs(day).format('YYYY-MM-DD') as DateStringValue),\n)\n\nconst slotsPerDay = computed(() => intervals.value.length)\nconst dayCount = computed(() => weekdays.value.length)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst resourceIdMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst weekEvents = computed(() =>\n getResourcesWeekViewEvents({\n events: props.events,\n resources: props.resources,\n weekdays: weekdays.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? new Date()))\n\nconst todayIndex = computed(() =>\n weekdays.value.findIndex((day) => dayjs(day).isSame(now.value, 'day')),\n)\n\nconst showIndicator = computed(\n () =>\n (props.withCurrentTimeIndicator ?? todayIndex.value !== -1) &&\n todayIndex.value !== -1 &&\n isInTimeRange({\n date: now.value.toDate(),\n startTime: props.startTime!,\n endTime: props.endTime!,\n }),\n)\n\nconst indicatorOffset = computed(() => {\n const timeOffset = getCurrentTimePosition({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n now: now.value,\n })\n\n return ((todayIndex.value + timeOffset / 100) / dayCount.value) * 100\n})\n\nconst currentTime = computed(() =>\n formatDate({ date: now.value, locale: props.locale || 'en', format: props.slotLabelFormat! }),\n)\n\nconst weekStart = computed(() => weekdays.value[0])\nconst weekEnd = computed(() => weekdays.value.at(-1)!)\n\nconst headerLabel = computed(\n () =>\n props.renderWeekLabel?.({ weekStart: weekStart.value, weekEnd: weekEnd.value }) ??\n getWeekLabel({\n weekdays: weekdays.value,\n locale: props.locale || 'en',\n weekLabelFormat: props.weekLabelFormat!,\n }),\n)\n\nconst businessHoursMods = computed(() =>\n weekdays.value.map((day) =>\n intervals.value.map((interval) =>\n getBusinessHoursMod({\n time: interval.startTime,\n businessHours: props.businessHours,\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayjs(day).day() as DayOfWeek,\n }),\n ),\n ),\n)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const count = slotsPerDay.value\n const startDay = weekdays.value[Math.floor(start / count)]\n const endDay = weekdays.value[Math.floor(end / count)]\n const first = intervals.value[start % count]\n const last = intervals.value[end % count]\n\n if (first && last && startDay && endDay) {\n emit('slotDragEnd', {\n rangeStart: `${startDay} ${first.startTime}` as DateTimeStringValue,\n rangeEnd: `${endDay} ${last.endTime}` as DateTimeStringValue,\n resourceId: resourceIdMap.value.get(group),\n })\n }\n },\n})\n\nconst resize = useHorizontalEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n resizeIntervalMinutes: () => props.eventResizeInterval,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nonMounted(async () => {\n if (!props.startScrollDateTime) {\n return\n }\n\n await nextTick()\n\n const target = dayjs(props.startScrollDateTime)\n const dayIndex = weekdays.value.findIndex((day) => dayjs(day).isSame(target, 'day'))\n\n if (dayIndex < 0) {\n return\n }\n\n const targetTime = target.format('HH:mm:ss')\n const intervalIndex = intervals.value.findIndex((interval) => interval.startTime >= targetTime)\n\n if (intervalIndex < 0) {\n return\n }\n\n const flatIndex = dayIndex * slotsPerDay.value + intervalIndex\n\n scrollSlotIntoView(controls[0]?.[flatIndex], 'x')\n})\n\nconst setControl = (resourceIndex: number, flatIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][flatIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n const node = (element as { $el?: HTMLElement } | null)?.$el ?? element\n\n if (node instanceof HTMLElement) {\n rowContainers.set(resourceIndex, node)\n }\n}\n\nconst withDragHandlers = computed(\n () => Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop),\n)\n\nconst getFlatIndexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n const count = slotsPerDay.value * dayCount.value\n\n if (!container || count === 0) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(count - 1, Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * count)),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, flatIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const count = slotsPerDay.value\n const day = weekdays.value[Math.floor(flatIndex / count)]\n const interval = intervals.value[flatIndex % count]\n\n if (!day || !interval) {\n return\n }\n\n const target = getSnappedDropTarget(nativeEvent, day, flatIndex, interval.startTime)\n const event = getDropEvent(props.events, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', { ...moveEventTo(event, target), resourceId })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: target,\n resourceId,\n })\n }\n}\n\nconst getSnappedDropTarget = (\n nativeEvent: DragEvent,\n day: DateStringValue,\n flatIndex: number,\n slotStartTime: string,\n) => {\n if (props.eventDragInterval == null) {\n return `${day} ${slotStartTime}` as DateTimeStringValue\n }\n\n const container =\n nativeEvent.currentTarget instanceof HTMLElement ? nativeEvent.currentTarget : null\n const rect = container?.getBoundingClientRect()\n const totalSlots = slotsPerDay.value * dayCount.value\n const slotSize = rect && rect.width > 0 ? rect.width / totalSlots : 0\n const slotOffset = rect ? nativeEvent.clientX - rect.left - flatIndex * slotSize : 0\n const parsed = parseTimeString(slotStartTime)\n const dragInterval = clampIntervalMinutes(props.eventDragInterval)\n const raw =\n parsed.hours * 60 +\n parsed.minutes +\n (slotSize > 0 ? slotOffset / slotSize : 0) * props.intervalMinutes!\n const start = parseTimeString(props.startTime!)\n const end = parseTimeString(props.endTime!)\n const min = Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval\n const max = Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval\n const minutes =\n min > max\n ? start.hours * 60 + start.minutes\n : Math.max(min, Math.min(max, Math.round(raw / dragInterval) * dragInterval))\n return `${day} ${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}:00` as DateTimeStringValue\n}\n\nconst setDropTarget = (next: { resourceId: string | number; flatIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.flatIndex === next.flatIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const flatIndex = getFlatIndexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(flatIndex < 0 ? null : { resourceId, flatIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n if (isStatic.value) {\n return\n }\n\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const related = nativeEvent.relatedTarget\n const current = nativeEvent.currentTarget\n\n if (\n !(related instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(related)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const flatIndex = getFlatIndexAtPoint(nativeEvent, resourceIndex)\n\n if (flatIndex >= 0) {\n emitDrop(nativeEvent, resource.id, flatIndex)\n }\n}\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-week-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst dayOffset = (dayIndex: number) => (dayIndex / dayCount.value) * 100\nconst dayWidth = computed(() => 100 / dayCount.value)\n\nconst backgroundEvents = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) => {\n const data = weekEvents.value.byDay[day]\n\n return [\n ...(data.backgroundTimedEvents[resourceId] || []),\n ...(data.backgroundAllDayEvents[resourceId] || []),\n ].map((event) => ({ event, day, dayIndex }))\n })\n\nconst backgroundEventStyle = (event: ScheduleEventData & { position: any }, dayIndex: number) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n return {\n left: `${dayOffset(dayIndex) + (event.position.top / 100) * dayWidth.value}%`,\n right: `${\n 100 -\n dayOffset(dayIndex) -\n ((event.position.top + event.position.height) / 100) * dayWidth.value\n }%`,\n minWidth: '1px',\n top: 0,\n height: '100%',\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n }\n}\n\nconst regularEvents = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) =>\n (weekEvents.value.byDay[day].regularEvents[resourceId] || [])\n .filter((event) => event.position.column < Math.max(1, props.maxEventsPerTimeSlot!))\n .map((event) => ({ event, day, dayIndex })),\n )\n\nconst eventWrapperStyle = (event: ScheduleEventData & { position: any }, dayIndex: number) => {\n const position = resize.getResizePosition(event.id)\n const relativeLeft = position?.left ?? event.position.top\n const relativeWidth = position?.width ?? event.position.height\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n\n return {\n '--event-color': colors.color,\n left: `calc(${dayOffset(dayIndex) + (relativeLeft / 100) * dayWidth.value}% + 1px)`,\n width: `calc(${(relativeWidth / 100) * dayWidth.value}% - 2px)`,\n top: `${event.position.offset}%`,\n height: `${event.position.width}%`,\n }\n}\n\nconst moreClusters = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) =>\n getOverlapClusters(weekEvents.value.byDay[day].regularEvents[resourceId] || [])\n .filter((cluster) =>\n cluster.some((event) => event.position.column >= props.maxEventsPerTimeSlot!),\n )\n .map((cluster) => {\n const left = Math.min(...cluster.map((event) => event.position.top))\n const right = Math.max(\n ...cluster.map((event) => event.position.top + event.position.height),\n )\n\n return {\n cluster,\n day,\n hiddenCount: cluster.filter(\n (event) => event.position.column >= props.maxEventsPerTimeSlot!,\n ).length,\n style: {\n position: 'absolute' as const,\n left: `calc(${dayOffset(dayIndex) + (left / 100) * dayWidth.value}% + 1px)`,\n width: `calc(${((right - left) / 100) * dayWidth.value}% - 2px)`,\n bottom: 0,\n height: '22px',\n zIndex: 4,\n },\n }\n }),\n )\n\nconst allDayBars = (resourceId: string | number) => weekEvents.value.allDayBars[resourceId] || []\n\nconst allDayBarStyle = (bar: { startDayIndex: number; endDayIndex: number; row: number }) => ({\n left: `calc(${(bar.startDayIndex / dayCount.value) * 100}% + 1px)`,\n width: `calc(${((bar.endDayIndex - bar.startDayIndex + 1) / dayCount.value) * 100}% - 2px)`,\n top: `calc(${bar.row} * (var(--resources-week-view-all-day-height) + 2px) + 2px)`,\n})\n\nconst rowMinHeight = (resourceId: string | number) => {\n const bars = allDayBars(resourceId)\n const rows = bars.length ? Math.max(...bars.map((bar) => bar.row)) + 1 : 0\n\n return rows\n ? {\n minHeight: `max(var(--resources-week-view-row-height), calc(${rows} * (var(--resources-week-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined\n}\n\nconst cornerStyle = computed(() =>\n hasGroups.value\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\nconst dayLabelStyle = computed(() => ({\n flex: `0 0 calc(var(--resources-week-view-slot-width) * ${slotsPerDay.value})`,\n}))\n\nconst indicatorStyle = computed(() => ({\n '--indicator-left-offset': hasGroups.value\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)) * ${indicatorOffset.value} / 100)`\n : `calc(var(--resources-week-view-resource-label-width) + (100% - var(--resources-week-view-resource-label-width)) * ${indicatorOffset.value} / 100)`,\n '--_time-bubble-width': String(currentTime.value).toLowerCase().includes('m') ? '64px' : '46px',\n}))\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!resize.wasResizing()) {\n emit('eventClick', event, nativeEvent)\n }\n}\n\nconst startResize = (\n event: ScheduleEventData & { position: any },\n day: DateStringValue,\n dayIndex: number,\n resourceIndex: number,\n edge: 'start' | 'end',\n pointerEvent: PointerEvent,\n) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container) {\n return\n }\n\n resize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: day,\n dayIndex,\n dayCount: dayCount.value,\n pointerEvent,\n })\n}\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n\n if (!target) {\n return null\n }\n\n const count = slotsPerDay.value\n const day = weekdays.value[Math.floor(target.flatIndex / count)]\n\n return day\n ? {\n date: day,\n slotIndex: target.flatIndex % count,\n time: intervals.value[target.flatIndex % count]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesWeekView') }\"\n :root-ref=\"setRootElement\"\n :data-resizing=\"resize.state.value ? true : undefined\"\n :data-event-interaction=\"resize.state.value ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :week-start=\"weekStart\" :week-end=\"weekEnd\" :label=\"headerLabel\">\n <ScheduleHeaderBase\n view=\"week\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'week')\"\n :control=\"{ title: headerLabel }\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesWeekViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesWeekViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n @scroll-position-change=\"(position) => (scrolledX = position.x !== 0)\"\n >\n <div v-bind=\"getStyles('resourcesWeekViewInner')\">\n <Box v-bind=\"getStyles('resourcesWeekViewHeaderRows')\">\n <div v-bind=\"getStyles('resourcesWeekViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <div v-bind=\"getStyles('resourcesWeekViewHeaderContent')\">\n <div v-bind=\"getStyles('resourcesWeekViewDayLabelsRow')\">\n <Box\n v-for=\"day in weekdays\"\n :key=\"day\"\n v-bind=\"getStyles('resourcesWeekViewDayLabel', { style: dayLabelStyle })\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-today=\"(props.highlightToday && dayjs(day).isSame(now, 'day')) || undefined\"\n >\n <slot\n name=\"dayLabel\"\n :date=\"day\"\n :label=\"\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n \"\n >\n {{\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n }}\n </slot>\n </Box>\n </div>\n\n <div v-bind=\"getStyles('resourcesWeekViewTimeLabelsRow')\">\n <template v-for=\"(day, dayIndex) in weekdays\" :key=\"day\">\n <Box\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"`${day}-${interval.startTime}`\"\n v-bind=\"staticStyles('resourcesWeekViewTimeLabel')\"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n >\n <slot\n name=\"timeLabel\"\n :date=\"day\"\n :label=\"\n formatDate({\n date: `${day} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n \"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n >\n {{\n formatDate({\n date: `${day} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </slot>\n </Box>\n </template>\n </div>\n </div>\n </Box>\n\n <Box\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesWeekViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesWeekViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesWeekViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <Box\n v-bind=\"staticStyles('resourcesWeekViewResourceLabel')\"\n :data-scrolled-x=\"scrolledX || undefined\"\n :data-has-groups=\"groupInfo(resourceIndex) !== undefined || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </Box>\n\n <Box\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"getStyles('resourcesWeekViewRowSlots', { style: rowMinHeight(resource.id) })\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"withDragHandlers ? handleRowDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <template\n v-for=\"entry in backgroundEvents(resource.id)\"\n :key=\"`bg-${entry.day}-${entry.event.id}`\"\n >\n <slot name=\"backgroundEvent\" :event=\"entry.event\" :date=\"entry.day\">\n <ScheduleBackgroundEvent\n :event=\"entry.event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{\n ...eventRenderers,\n ...getStyles('resourcesWeekViewBackgroundEvent'),\n }\"\n :style=\"backgroundEventStyle(entry.event, entry.dayIndex)\"\n @event-click=\"clickEvent\"\n />\n </slot>\n </template>\n\n <template v-for=\"bar in allDayBars(resource.id)\" :key=\"`all-${bar.event.id}`\">\n <Box\n v-bind=\"getStyles('resourcesWeekViewAllDayEvent', { style: allDayBarStyle(bar) })\"\n >\n <slot\n name=\"allDayEvent\"\n :event=\"bar.event\"\n :start-day-index=\"bar.startDayIndex\"\n :end-day-index=\"bar.endDayIndex\"\n >\n <ScheduleEvent\n :event=\"bar.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @click=\"\n isStatic ? undefined : emit('eventClick', bar.event, $event as MouseEvent)\n \"\n />\n </slot>\n </Box>\n </template>\n\n <Box\n v-for=\"entry in regularEvents(resource.id)\"\n :key=\"`${entry.day}-${entry.event.id}`\"\n v-bind=\"\n getStyles('resourcesWeekViewEventWrapper', {\n style: eventWrapperStyle(entry.event, entry.dayIndex),\n })\n \"\n :data-resizing=\"resize.getResizePosition(entry.event.id) !== null || undefined\"\n >\n <ScheduleEvent\n :event=\"entry.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(entry.event)\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"isStatic ? undefined : clickEvent(entry.event, $event as MouseEvent)\"\n />\n\n <template v-if=\"resize.isResizableEvent(entry.event)\">\n <div\n v-for=\"edge in ['start', 'end'] as const\"\n :key=\"edge\"\n v-bind=\"staticStyles('resourcesWeekViewResizeHandle')\"\n :data-edge=\"edge\"\n :data-active=\"resize.state.value?.edge === edge || undefined\"\n :aria-label=\"`${\n edge === 'start' ? 'Resize event start' : 'Resize event end'\n } ${entry.event.title}`\"\n @dragstart.prevent\n @pointerdown=\"\n startResize(\n entry.event,\n entry.day,\n entry.dayIndex,\n resourceIndex,\n edge,\n $event,\n )\n \"\n />\n </template>\n </Box>\n\n <template\n v-for=\"entry in moreClusters(resource.id)\"\n :key=\"`more-${entry.day}-${entry.cluster[0].id}`\"\n >\n <slot\n name=\"moreEvents\"\n :events=\"entry.cluster\"\n :hidden-count=\"entry.hiddenCount\"\n :date=\"entry.day\"\n >\n <MoreEvents\n :events=\"entry.cluster\"\n :more-events-count=\"entry.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"entry.style\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <template v-for=\"(day, dayIndex) in weekdays\" :key=\"`slots-${day}`\">\n <UnstyledButton\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"`${day}-${interval.startTime}`\"\n :ref=\"setControl(resourceIndex, dayIndex * slotsPerDay + slotIndex)\"\n v-bind=\"staticStyles('resourcesWeekViewRowSlot')\"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id &&\n dropTarget.flatIndex === dayIndex * slotsPerDay + slotIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(\n dayIndex * slotsPerDay + slotIndex,\n String(resource.id),\n ) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"\n props.withDragSlotSelect ? dayIndex * slotsPerDay + slotIndex : undefined\n \"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :aria-label=\"`${getLabel('resourceSlot', props.labels)} ${String(resource.label)} ${day} ${interval.startTime} - ${interval.endTime}`\"\n :tabindex=\"\n isStatic\n ? -1\n : resourceIndex === 0 && dayIndex === 0 && slotIndex === 0\n ? 0\n : -1\n \"\n @keydown=\"\n handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex: dayIndex * slotsPerDay + slotIndex,\n event: $event,\n })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown(\n $event,\n dayIndex * slotsPerDay + slotIndex,\n String(resource.id),\n )\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('timeSlotClick', {\n slotStart: `${day} ${interval.startTime}` as DateTimeStringValue,\n slotEnd: `${day} ${interval.endTime}` as DateTimeStringValue,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot\n name=\"timeSlot\"\n :resource=\"resource\"\n :date=\"day\"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n />\n </UnstyledButton>\n </template>\n </Box>\n </Box>\n\n <template v-if=\"showIndicator\">\n <slot\n name=\"currentTimeIndicator\"\n :time=\"currentTime\"\n :offset=\"indicatorOffset\"\n :date=\"weekdays[todayIndex]\"\n >\n <Box\n v-bind=\"\n getStyles('resourcesWeekViewCurrentTimeIndicator', { style: indicatorStyle })\n \"\n >\n <div\n v-if=\"props.withCurrentTimeBubble\"\n v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorTimeBubble')\"\n >\n {{ currentTime }}\n </div>\n <div v-else v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorLine')\" />\n </Box>\n </slot>\n </template>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesWeekViewOwnProps } from './ResourcesWeekView.types'\n\nconst defaultProps = {\n startTime: '00:00:00',\n endTime: '23:59:59',\n intervalMinutes: 60,\n slotLabelFormat: 'HH:mm',\n withCurrentTimeBubble: true,\n withHeader: true,\n weekLabelFormat: 'MMM DD',\n slotWidth: 60,\n rowHeight: 64,\n groupLabelWidth: 80,\n businessHours: ['09:00:00', '17:00:00'],\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n maxEventsPerTimeSlot: 2,\n firstDayOfWeek: 1,\n weekendDays: [0, 6],\n withWeekendDays: true,\n weekdayFormat: 'ddd D',\n highlightToday: true,\n} satisfies Partial<ResourcesWeekViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, slotWidth, rowHeight, groupLabelWidth }) => ({\n resourcesWeekView: {\n '--resources-week-view-radius': resolveScheduleRadius(radius),\n '--resources-week-view-slot-width': cssSize(slotWidth),\n '--resources-week-view-row-height': cssSize(rowHeight),\n '--resources-week-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, RESOURCE_VIEWS }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots } from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { useHorizontalEventResize } from '../../hooks/use-horizontal-event-resize'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n formatDate,\n getBusinessHoursMod,\n getCurrentTimePosition,\n getDayTimeIntervals,\n getGroupToResourceIdMap,\n getOrderedResources,\n getWeekDays,\n handleResourcesGridKeyDown,\n isInTimeRange,\n clampIntervalMinutes,\n parseTimeString,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { getOverlapClusters } from '../ResourcesDayView/get-overlap-clusters/get-overlap-clusters'\nimport { ScheduleBackgroundEvent } from '../ScheduleBackgroundEvent'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase, createHeaderNavigation } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n moveEventTo,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport { getWeekLabel } from '../WeekView/get-week-label/get-week-label'\nimport { getResourcesWeekViewEvents } from './get-resources-week-view-events/get-resources-week-view-events'\nimport type { ResourcesWeekViewEmits, ResourcesWeekViewSlots } from './ResourcesWeekView.types'\nimport classes from './ResourcesWeekView.module.css'\n\ndefineOptions({\n name: 'ResourcesWeekView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesWeekViewOwnProps>(), {\n groups: undefined,\n startTime: undefined,\n endTime: undefined,\n intervalMinutes: undefined,\n eventDragInterval: undefined,\n eventResizeInterval: undefined,\n slotLabelFormat: undefined,\n radius: undefined,\n startScrollDateTime: undefined,\n scrollAreaProps: undefined,\n locale: undefined,\n withCurrentTimeIndicator: undefined,\n withCurrentTimeBubble: undefined,\n getCurrentTime: undefined,\n withHeader: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n weekLabelFormat: undefined,\n renderWeekLabel: undefined,\n events: undefined,\n slotWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n labels: undefined,\n businessHours: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n withInteractiveBackgroundEvents: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n mode: undefined,\n canResizeEvent: undefined,\n recurrenceExpansionLimit: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n firstDayOfWeek: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n weekdayFormat: undefined,\n highlightToday: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesWeekViewSlots>()\n\nconst emit = defineEmits<ResourcesWeekViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\nconst theme = useSafeMantineTheme()\n\nconst props = useProps('ResourcesWeekView', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesWeekView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesWeekView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; flatIndex: number } | null>(null)\nconst scrolledX = ref(false)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst intervals = computed(() =>\n getDayTimeIntervals({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n }),\n)\n\nconst weekdays = computed(() =>\n getWeekDays({\n week: props.date,\n firstDayOfWeek: props.firstDayOfWeek,\n weekendDays: props.weekendDays,\n withWeekendDays: props.withWeekendDays,\n }).map((day) => dayjs(day).format('YYYY-MM-DD') as DateStringValue),\n)\n\nconst slotsPerDay = computed(() => intervals.value.length)\nconst dayCount = computed(() => weekdays.value.length)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst resourceIdMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst weekEvents = computed(() =>\n getResourcesWeekViewEvents({\n events: props.events,\n resources: props.resources,\n weekdays: weekdays.value,\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\nconst now = computed(() => dayjs(props.getCurrentTime?.() ?? new Date()))\n\nconst todayIndex = computed(() =>\n weekdays.value.findIndex((day) => dayjs(day).isSame(now.value, 'day')),\n)\n\nconst showIndicator = computed(\n () =>\n (props.withCurrentTimeIndicator ?? todayIndex.value !== -1) &&\n todayIndex.value !== -1 &&\n isInTimeRange({\n date: now.value.toDate(),\n startTime: props.startTime!,\n endTime: props.endTime!,\n }),\n)\n\nconst indicatorOffset = computed(() => {\n const timeOffset = getCurrentTimePosition({\n startTime: props.startTime!,\n endTime: props.endTime!,\n intervalMinutes: props.intervalMinutes!,\n now: now.value,\n })\n\n return ((todayIndex.value + timeOffset / 100) / dayCount.value) * 100\n})\n\nconst currentTime = computed(() =>\n formatDate({ date: now.value, locale: props.locale || 'en', format: props.slotLabelFormat! }),\n)\n\nconst weekStart = computed(() => weekdays.value[0])\nconst weekEnd = computed(() => weekdays.value.at(-1)!)\n\nconst headerLabel = computed(\n () =>\n props.renderWeekLabel?.({ weekStart: weekStart.value, weekEnd: weekEnd.value }) ??\n getWeekLabel({\n weekdays: weekdays.value,\n locale: props.locale || 'en',\n weekLabelFormat: props.weekLabelFormat!,\n }),\n)\n\nconst businessHoursMods = computed(() =>\n weekdays.value.map((day) =>\n intervals.value.map((interval) =>\n getBusinessHoursMod({\n time: interval.startTime,\n businessHours: props.businessHours,\n highlightBusinessHours: props.highlightBusinessHours,\n dayOfWeek: dayjs(day).day() as DayOfWeek,\n }),\n ),\n ),\n)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const count = slotsPerDay.value\n const startDay = weekdays.value[Math.floor(start / count)]\n const endDay = weekdays.value[Math.floor(end / count)]\n const first = intervals.value[start % count]\n const last = intervals.value[end % count]\n\n if (first && last && startDay && endDay) {\n emit('slotDragEnd', {\n rangeStart: `${startDay} ${first.startTime}` as DateTimeStringValue,\n rangeEnd: `${endDay} ${last.endTime}` as DateTimeStringValue,\n resourceId: resourceIdMap.value.get(group),\n })\n }\n },\n})\n\nconst resize = useHorizontalEventResize({\n enabled: () => Boolean(props.withEventResize),\n mode: () => props.mode!,\n startTime: () => props.startTime!,\n endTime: () => props.endTime!,\n intervalMinutes: () => props.intervalMinutes!,\n resizeIntervalMinutes: () => props.eventResizeInterval,\n onEventResize: (data) => emit('eventResize', data),\n canResizeEvent: () => props.canResizeEvent,\n})\n\nonMounted(async () => {\n if (!props.startScrollDateTime) {\n return\n }\n\n await nextTick()\n\n const target = dayjs(props.startScrollDateTime)\n const dayIndex = weekdays.value.findIndex((day) => dayjs(day).isSame(target, 'day'))\n\n if (dayIndex < 0) {\n return\n }\n\n const targetTime = target.format('HH:mm:ss')\n const intervalIndex = intervals.value.findIndex((interval) => interval.startTime >= targetTime)\n\n if (intervalIndex < 0) {\n return\n }\n\n const flatIndex = dayIndex * slotsPerDay.value + intervalIndex\n\n scrollSlotIntoView(controls[0]?.[flatIndex], 'x')\n})\n\nconst setControl = (resourceIndex: number, flatIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][flatIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n const node = (element as { $el?: HTMLElement } | null)?.$el ?? element\n\n if (node instanceof HTMLElement) {\n rowContainers.set(resourceIndex, node)\n }\n}\n\nconst withDragHandlers = computed(\n () => Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop),\n)\n\nconst getFlatIndexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n const count = slotsPerDay.value * dayCount.value\n\n if (!container || count === 0) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(count - 1, Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * count)),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, flatIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const count = slotsPerDay.value\n const day = weekdays.value[Math.floor(flatIndex / count)]\n const interval = intervals.value[flatIndex % count]\n\n if (!day || !interval) {\n return\n }\n\n const target = getSnappedDropTarget(nativeEvent, day, flatIndex, interval.startTime)\n const event = getDropEvent(props.events, nativeEvent.dataTransfer)\n\n if (event) {\n emit('eventDrop', { ...moveEventTo(event, target), resourceId })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: target,\n resourceId,\n })\n }\n}\n\nconst getSnappedDropTarget = (\n nativeEvent: DragEvent,\n day: DateStringValue,\n flatIndex: number,\n slotStartTime: string,\n) => {\n if (props.eventDragInterval == null) {\n return `${day} ${slotStartTime}` as DateTimeStringValue\n }\n\n const container =\n nativeEvent.currentTarget instanceof HTMLElement ? nativeEvent.currentTarget : null\n const rect = container?.getBoundingClientRect()\n const totalSlots = slotsPerDay.value * dayCount.value\n const slotSize = rect && rect.width > 0 ? rect.width / totalSlots : 0\n const slotOffset = rect ? nativeEvent.clientX - rect.left - flatIndex * slotSize : 0\n const parsed = parseTimeString(slotStartTime)\n const dragInterval = clampIntervalMinutes(props.eventDragInterval)\n const raw =\n parsed.hours * 60 +\n parsed.minutes +\n (slotSize > 0 ? slotOffset / slotSize : 0) * props.intervalMinutes!\n const start = parseTimeString(props.startTime!)\n const end = parseTimeString(props.endTime!)\n const min = Math.ceil((start.hours * 60 + start.minutes) / dragInterval) * dragInterval\n const max = Math.floor((end.hours * 60 + end.minutes - 1) / dragInterval) * dragInterval\n const minutes =\n min > max\n ? start.hours * 60 + start.minutes\n : Math.max(min, Math.min(max, Math.round(raw / dragInterval) * dragInterval))\n return `${day} ${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}:00` as DateTimeStringValue\n}\n\nconst setDropTarget = (next: { resourceId: string | number; flatIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.flatIndex === next.flatIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const flatIndex = getFlatIndexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(flatIndex < 0 ? null : { resourceId, flatIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n if (isStatic.value) {\n return\n }\n\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const related = nativeEvent.relatedTarget\n const current = nativeEvent.currentTarget\n\n if (\n !(related instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(related)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const flatIndex = getFlatIndexAtPoint(nativeEvent, resourceIndex)\n\n if (flatIndex >= 0) {\n emitDrop(nativeEvent, resource.id, flatIndex)\n }\n}\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-week-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst dayOffset = (dayIndex: number) => (dayIndex / dayCount.value) * 100\nconst dayWidth = computed(() => 100 / dayCount.value)\n\nconst backgroundEvents = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) => {\n const data = weekEvents.value.byDay[day]\n\n return [\n ...(data.backgroundTimedEvents[resourceId] || []),\n ...(data.backgroundAllDayEvents[resourceId] || []),\n ].map((event) => ({ event, day, dayIndex }))\n })\n\nconst backgroundEventStyle = (event: ScheduleEventData & { position: any }, dayIndex: number) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: 'light',\n autoContrast: true,\n })\n return {\n left: `${dayOffset(dayIndex) + (event.position.top / 100) * dayWidth.value}%`,\n right: `${\n 100 -\n dayOffset(dayIndex) -\n ((event.position.top + event.position.height) / 100) * dayWidth.value\n }%`,\n minWidth: '1px',\n top: 0,\n height: '100%',\n '--bg-event-bg': colors.background,\n '--bg-event-color': colors.color,\n }\n}\n\nconst regularEvents = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) =>\n (weekEvents.value.byDay[day].regularEvents[resourceId] || [])\n .filter((event) => event.position.column < Math.max(1, props.maxEventsPerTimeSlot!))\n .map((event) => ({ event, day, dayIndex })),\n )\n\nconst eventWrapperStyle = (event: ScheduleEventData & { position: any }, dayIndex: number) => {\n const position = resize.getResizePosition(event.id)\n const relativeLeft = position?.left ?? event.position.top\n const relativeWidth = position?.width ?? event.position.height\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n\n return {\n '--event-color': colors.color,\n left: `calc(${dayOffset(dayIndex) + (relativeLeft / 100) * dayWidth.value}% + 1px)`,\n width: `calc(${(relativeWidth / 100) * dayWidth.value}% - 2px)`,\n top: `${event.position.offset}%`,\n height: `${event.position.width}%`,\n }\n}\n\nconst moreClusters = (resourceId: string | number) =>\n weekdays.value.flatMap((day, dayIndex) =>\n getOverlapClusters(weekEvents.value.byDay[day].regularEvents[resourceId] || [])\n .filter((cluster) =>\n cluster.some((event) => event.position.column >= props.maxEventsPerTimeSlot!),\n )\n .map((cluster) => {\n const left = Math.min(...cluster.map((event) => event.position.top))\n const right = Math.max(\n ...cluster.map((event) => event.position.top + event.position.height),\n )\n\n return {\n cluster,\n day,\n hiddenCount: cluster.filter(\n (event) => event.position.column >= props.maxEventsPerTimeSlot!,\n ).length,\n style: {\n position: 'absolute' as const,\n left: `calc(${dayOffset(dayIndex) + (left / 100) * dayWidth.value}% + 1px)`,\n width: `calc(${((right - left) / 100) * dayWidth.value}% - 2px)`,\n bottom: 0,\n height: '22px',\n zIndex: 4,\n },\n }\n }),\n )\n\nconst allDayBars = (resourceId: string | number) => weekEvents.value.allDayBars[resourceId] || []\n\nconst allDayBarStyle = (bar: { startDayIndex: number; endDayIndex: number; row: number }) => ({\n left: `calc(${(bar.startDayIndex / dayCount.value) * 100}% + 1px)`,\n width: `calc(${((bar.endDayIndex - bar.startDayIndex + 1) / dayCount.value) * 100}% - 2px)`,\n top: `calc(${bar.row} * (var(--resources-week-view-all-day-height) + 2px) + 2px)`,\n})\n\nconst rowMinHeight = (resourceId: string | number) => {\n const bars = allDayBars(resourceId)\n const rows = bars.length ? Math.max(...bars.map((bar) => bar.row)) + 1 : 0\n\n return rows\n ? {\n minHeight: `max(var(--resources-week-view-row-height), calc(${rows} * (var(--resources-week-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined\n}\n\nconst cornerStyle = computed(() =>\n hasGroups.value\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\nconst dayLabelStyle = computed(() => ({\n flex: `0 0 calc(var(--resources-week-view-slot-width) * ${slotsPerDay.value})`,\n}))\n\nconst indicatorStyle = computed(() => ({\n '--indicator-left-offset': hasGroups.value\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)) * ${indicatorOffset.value} / 100)`\n : `calc(var(--resources-week-view-resource-label-width) + (100% - var(--resources-week-view-resource-label-width)) * ${indicatorOffset.value} / 100)`,\n '--_time-bubble-width': String(currentTime.value).toLowerCase().includes('m') ? '64px' : '46px',\n}))\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\n/** A click that ends a resize gesture must not be reported as an event click. */\nconst clickEvent = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!resize.wasResizing()) {\n emit('eventClick', event, nativeEvent)\n }\n}\n\nconst startResize = (\n event: ScheduleEventData & { position: any },\n day: DateStringValue,\n dayIndex: number,\n resourceIndex: number,\n edge: 'start' | 'end',\n pointerEvent: PointerEvent,\n) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container) {\n return\n }\n\n resize.handleResizeStart({\n event,\n edge,\n container,\n originalLeft: event.position.top,\n originalWidth: event.position.height,\n eventDate: day,\n dayIndex,\n dayCount: dayCount.value,\n pointerEvent,\n })\n}\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n\n if (!target) {\n return null\n }\n\n const count = slotsPerDay.value\n const day = weekdays.value[Math.floor(target.flatIndex / count)]\n\n return day\n ? {\n date: day,\n slotIndex: target.flatIndex % count,\n time: intervals.value[target.flatIndex % count]?.startTime,\n }\n : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesWeekView') }\"\n :root-ref=\"setRootElement\"\n :data-resizing=\"resize.state.value ? true : undefined\"\n :data-event-interaction=\"resize.state.value ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :week-start=\"weekStart\" :week-end=\"weekEnd\" :label=\"headerLabel\">\n <ScheduleHeaderBase\n view=\"week\"\n :navigation-handlers=\"createHeaderNavigation(props.date, 'week')\"\n :control=\"{ title: headerLabel }\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesWeekViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesWeekViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n @scroll-position-change=\"(position) => (scrolledX = position.x !== 0)\"\n >\n <div v-bind=\"getStyles('resourcesWeekViewInner')\">\n <Box v-bind=\"getStyles('resourcesWeekViewHeaderRows')\">\n <div v-bind=\"getStyles('resourcesWeekViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <div v-bind=\"getStyles('resourcesWeekViewHeaderContent')\">\n <div v-bind=\"getStyles('resourcesWeekViewDayLabelsRow')\">\n <Box\n v-for=\"day in weekdays\"\n :key=\"day\"\n v-bind=\"getStyles('resourcesWeekViewDayLabel', { style: dayLabelStyle })\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-today=\"(props.highlightToday && dayjs(day).isSame(now, 'day')) || undefined\"\n >\n <slot\n name=\"dayLabel\"\n :date=\"day\"\n :label=\"\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n \"\n >\n {{\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n }}\n </slot>\n </Box>\n </div>\n\n <div v-bind=\"getStyles('resourcesWeekViewTimeLabelsRow')\">\n <template v-for=\"(day, dayIndex) in weekdays\" :key=\"day\">\n <Box\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"`${day}-${interval.startTime}`\"\n v-bind=\"staticStyles('resourcesWeekViewTimeLabel')\"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n >\n <slot\n name=\"timeLabel\"\n :date=\"day\"\n :label=\"\n formatDate({\n date: `${day} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n \"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n >\n {{\n formatDate({\n date: `${day} ${interval.startTime}`,\n locale: props.locale || 'en',\n format: props.slotLabelFormat!,\n })\n }}\n </slot>\n </Box>\n </template>\n </div>\n </div>\n </Box>\n\n <Box\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesWeekViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesWeekViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesWeekViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <Box\n v-bind=\"staticStyles('resourcesWeekViewResourceLabel')\"\n :data-scrolled-x=\"scrolledX || undefined\"\n :data-has-groups=\"groupInfo(resourceIndex) !== undefined || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </Box>\n\n <Box\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"getStyles('resourcesWeekViewRowSlots', { style: rowMinHeight(resource.id) })\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"withDragHandlers ? handleRowDragLeave($event) : undefined\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <template\n v-for=\"entry in backgroundEvents(resource.id)\"\n :key=\"`bg-${entry.day}-${entry.event.id}`\"\n >\n <slot name=\"backgroundEvent\" :event=\"entry.event\" :date=\"entry.day\">\n <ScheduleBackgroundEvent\n :event=\"entry.event\"\n :interactive=\"Boolean(props.withInteractiveBackgroundEvents) && !isStatic\"\n v-bind=\"{\n ...eventRenderers,\n ...getStyles('resourcesWeekViewBackgroundEvent'),\n }\"\n :style=\"backgroundEventStyle(entry.event, entry.dayIndex)\"\n @event-click=\"clickEvent\"\n />\n </slot>\n </template>\n\n <template v-for=\"bar in allDayBars(resource.id)\" :key=\"`all-${bar.event.id}`\">\n <Box\n v-bind=\"getStyles('resourcesWeekViewAllDayEvent', { style: allDayBarStyle(bar) })\"\n >\n <slot\n name=\"allDayEvent\"\n :event=\"bar.event\"\n :start-day-index=\"bar.startDayIndex\"\n :end-day-index=\"bar.endDayIndex\"\n >\n <ScheduleEvent\n :event=\"bar.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @click=\"\n isStatic ? undefined : emit('eventClick', bar.event, $event as MouseEvent)\n \"\n />\n </slot>\n </Box>\n </template>\n\n <Box\n v-for=\"entry in regularEvents(resource.id)\"\n :key=\"`${entry.day}-${entry.event.id}`\"\n v-bind=\"\n getStyles('resourcesWeekViewEventWrapper', {\n style: eventWrapperStyle(entry.event, entry.dayIndex),\n })\n \"\n :data-resizing=\"resize.getResizePosition(entry.event.id) !== null || undefined\"\n >\n <ScheduleEvent\n :event=\"entry.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(entry.event)\"\n :style=\"{ width: '100%', height: '100%' }\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"isStatic ? undefined : clickEvent(entry.event, $event as MouseEvent)\"\n />\n\n <template v-if=\"resize.isResizableEvent(entry.event)\">\n <div\n v-for=\"edge in ['start', 'end'] as const\"\n :key=\"edge\"\n v-bind=\"staticStyles('resourcesWeekViewResizeHandle')\"\n :data-edge=\"edge\"\n :data-active=\"resize.state.value?.edge === edge || undefined\"\n :aria-label=\"`${\n edge === 'start' ? 'Resize event start' : 'Resize event end'\n } ${entry.event.title}`\"\n @dragstart.prevent\n @pointerdown=\"\n startResize(\n entry.event,\n entry.day,\n entry.dayIndex,\n resourceIndex,\n edge,\n $event,\n )\n \"\n />\n </template>\n </Box>\n\n <template\n v-for=\"entry in moreClusters(resource.id)\"\n :key=\"`more-${entry.day}-${entry.cluster[0].id}`\"\n >\n <slot\n name=\"moreEvents\"\n :events=\"entry.cluster\"\n :hidden-count=\"entry.hiddenCount\"\n :date=\"entry.day\"\n >\n <MoreEvents\n :events=\"entry.cluster\"\n :more-events-count=\"entry.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"entry.style\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <template v-for=\"(day, dayIndex) in weekdays\" :key=\"`slots-${day}`\">\n <UnstyledButton\n v-for=\"(interval, slotIndex) in intervals\"\n :key=\"`${day}-${interval.startTime}`\"\n :ref=\"setControl(resourceIndex, dayIndex * slotsPerDay + slotIndex)\"\n v-bind=\"staticStyles('resourcesWeekViewRowSlot')\"\n :data-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['business-hours'] || undefined\n \"\n :data-non-business-hours=\"\n businessHoursMods[dayIndex][slotIndex]['non-business-hours'] || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id &&\n dropTarget.flatIndex === dayIndex * slotsPerDay + slotIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(\n dayIndex * slotsPerDay + slotIndex,\n String(resource.id),\n ) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"\n props.withDragSlotSelect ? dayIndex * slotsPerDay + slotIndex : undefined\n \"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :aria-label=\"`${getLabel('resourceSlot', props.labels)} ${String(resource.label)} ${day} ${interval.startTime} - ${interval.endTime}`\"\n :tabindex=\"\n isStatic\n ? -1\n : resourceIndex === 0 && dayIndex === 0 && slotIndex === 0\n ? 0\n : -1\n \"\n @keydown=\"\n handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex: dayIndex * slotsPerDay + slotIndex,\n event: $event,\n })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown(\n $event,\n dayIndex * slotsPerDay + slotIndex,\n String(resource.id),\n )\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('timeSlotClick', {\n slotStart: `${day} ${interval.startTime}` as DateTimeStringValue,\n slotEnd: `${day} ${interval.endTime}` as DateTimeStringValue,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot\n name=\"timeSlot\"\n :resource=\"resource\"\n :date=\"day\"\n :start-time=\"interval.startTime\"\n :end-time=\"interval.endTime\"\n />\n </UnstyledButton>\n </template>\n </Box>\n </Box>\n\n <template v-if=\"showIndicator\">\n <slot\n name=\"currentTimeIndicator\"\n :time=\"currentTime\"\n :offset=\"indicatorOffset\"\n :date=\"weekdays[todayIndex]\"\n >\n <Box\n v-bind=\"\n getStyles('resourcesWeekViewCurrentTimeIndicator', { style: indicatorStyle })\n \"\n >\n <div\n v-if=\"props.withCurrentTimeBubble\"\n v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorTimeBubble')\"\n >\n {{ currentTime }}\n </div>\n <div v-else v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorThumb')\" />\n <div v-bind=\"getStyles('resourcesWeekViewCurrentTimeIndicatorLine')\" />\n </Box>\n </slot>\n </template>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ResourcesWeekViewComponent, { varsResolver } from './ResourcesWeekView.vue'\nimport type { ResourcesWeekViewFactory } from './ResourcesWeekView.types'\nimport classes from './ResourcesWeekView.module.css'\n\nexport const ResourcesWeekView = factory<ResourcesWeekViewFactory>(ResourcesWeekViewComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n ResourcesWeekViewCssVariables,\n ResourcesWeekViewEmits,\n ResourcesWeekViewFactory,\n ResourcesWeekViewOwnProps,\n ResourcesWeekViewOwnStylesNames,\n ResourcesWeekViewProps,\n ResourcesWeekViewSlots,\n ResourcesWeekViewStylesNames,\n} from './ResourcesWeekView.types'\n","import dayjs from 'dayjs'\nimport type { DateStringValue, ScheduleEventData } from '../../../types'\n\n/** One day cell of a resource row: the events that fit, and how many did not. */\nexport interface ResourcesMonthViewCellLayout {\n /** Events that fit into the cell, with the row they occupy. */\n visible: Array<{ event: ScheduleEventData; row: number }>\n\n /** Number of events that did not fit. */\n hiddenCount: number\n}\n\n/** A multi-day event bar spanning a run of consecutive day columns on one row. */\nexport interface ResourcesMonthViewSegment {\n event: ScheduleEventData\n\n /** Index of the first day column the bar covers. */\n start: number\n\n /** Index of the last day column the bar covers. */\n end: number\n\n /** Row the bar occupies inside the cells it covers. */\n row: number\n\n /** Which ends of the bar continue outside the displayed month. */\n hanging: 'start' | 'end' | 'both' | 'none'\n\n /** Whether any covered cell also hides events, which shortens the bar. */\n hidden: boolean\n}\n\nexport interface ResourcesMonthViewRowLayout {\n /** Events of the resource per day column, sorted the way they are laid out. */\n eventsByDay: ScheduleEventData[][]\n\n /** Layout of every day cell of the row. */\n layouts: ResourcesMonthViewCellLayout[]\n\n /** Multi-day bars of the row. */\n segments: ResourcesMonthViewSegment[]\n}\n\nexport interface GetResourcesMonthViewLayoutInput {\n /** Day columns of the month, `YYYY-MM-DD`. */\n days: DateStringValue[]\n\n /** Events already expanded for the displayed month. */\n events: ScheduleEventData[] | undefined\n\n /** Resource the row belongs to. */\n resourceId: string | number\n\n /** Number of event rows a cell can show before the rest collapse into a \"more\" control. */\n maxRows: number\n}\n\n/** An event is multi-day when it ends on a later calendar day than it starts. */\nexport function isMultiDayEvent(event: ScheduleEventData) {\n return dayjs(event.end).startOf('day').isAfter(dayjs(event.start).startOf('day'))\n}\n\n/** Longer events come first, then earlier ones, so bars stack predictably. */\nexport function compareMonthEvents(a: ScheduleEventData, b: ScheduleEventData) {\n const aSpan = dayjs(a.end).startOf('day').diff(dayjs(a.start).startOf('day'), 'day')\n const bSpan = dayjs(b.end).startOf('day').diff(dayjs(b.start).startOf('day'), 'day')\n return aSpan === bSpan ? dayjs(a.start).valueOf() - dayjs(b.start).valueOf() : bSpan - aSpan\n}\n\n/**\n * Lays out one resource row of the month grid.\n *\n * Each event keeps the row it was given on the previous day whenever that row is still free,\n * so a multi-day event forms an unbroken bar instead of stepping between rows.\n */\nexport function getResourcesMonthViewLayout({\n days,\n events,\n resourceId,\n maxRows,\n}: GetResourcesMonthViewLayoutInput): ResourcesMonthViewRowLayout {\n const monthStart = dayjs(days[0]).startOf('day')\n const monthEnd = dayjs(days.at(-1)).add(1, 'day').startOf('day')\n\n const eventsByDay = days.map((day) =>\n (events || [])\n .filter(\n (event) =>\n event.resourceId === resourceId &&\n dayjs(event.start).isBefore(dayjs(day).endOf('day')) &&\n dayjs(event.end).isAfter(dayjs(day).startOf('day')),\n )\n .sort(compareMonthEvents),\n )\n\n const layouts: ResourcesMonthViewCellLayout[] = []\n const lastRow = new Map<string | number, number>()\n const rowByEvent = new Map<string | number, Map<number, number>>()\n\n eventsByDay.forEach((eventList, dayIndex) => {\n const used = new Set<number>()\n const visible: ResourcesMonthViewCellLayout['visible'] = []\n let hiddenCount = 0\n\n eventList.forEach((event) => {\n let row = lastRow.get(event.id)\n\n if (row === undefined || row >= maxRows || used.has(row)) {\n row = Array.from({ length: maxRows }, (_, index) => index).find((index) => !used.has(index))\n }\n\n if (row === undefined) {\n hiddenCount += 1\n return\n }\n\n used.add(row)\n visible.push({ event, row })\n lastRow.set(event.id, row)\n\n if (!rowByEvent.has(event.id)) {\n rowByEvent.set(event.id, new Map())\n }\n\n rowByEvent.get(event.id)!.set(dayIndex, row)\n })\n\n layouts.push({ visible, hiddenCount })\n })\n\n const segments: ResourcesMonthViewSegment[] = []\n const multiDayEvents = [\n ...new Map(\n eventsByDay\n .flat()\n .filter(isMultiDayEvent)\n .map((event) => [event.id, event]),\n ).values(),\n ]\n\n multiDayEvents.forEach((event) => {\n const rowsForEvent = rowByEvent.get(event.id)\n let run: { start: number; end: number; row: number } | null = null\n\n const flush = () => {\n if (!run) {\n return\n }\n\n const before = dayjs(event.start).isBefore(monthStart)\n const after = dayjs(event.end).isAfter(monthEnd)\n\n segments.push({\n event,\n ...run,\n hanging: before && after ? 'both' : before ? 'start' : after ? 'end' : 'none',\n hidden: Array.from(\n { length: run.end - run.start + 1 },\n (_, index) => layouts[run!.start + index].hiddenCount > 0,\n ).some(Boolean),\n })\n\n run = null\n }\n\n days.forEach((_day, index) => {\n const row = rowsForEvent?.get(index)\n\n if (row === undefined) {\n flush()\n } else if (run && run.row === row && run.end === index - 1) {\n run.end = index\n } else {\n flush()\n run = { start: index, end: index, row }\n }\n })\n\n flush()\n })\n\n return { eventsByDay, layouts, segments }\n}\n",".resourcesMonthView {\n --resources-month-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-month-view-resource-label-width: 120px;\n --resources-month-view-day-width: 80px;\n --resources-month-view-row-height: 64px;\n --resources-month-view-group-label-width: 80px;\n\n @mixin where-light {\n --resources-month-view-border-color: var(--mantine-color-gray-3);\n }\n\n @mixin where-dark {\n --resources-month-view-border-color: var(--mantine-color-dark-4);\n }\n}\n\n.resourcesMonthViewRoot {\n border: 1px solid var(--resources-month-view-border-color);\n border-radius: var(--resources-month-view-radius);\n overflow: hidden;\n max-width: fit-content;\n}\n\n.resourcesMonthViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesMonthViewInner {\n display: inline-flex;\n flex-direction: column;\n}\n.resourcesMonthViewDayLabelsRow {\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-month-view-border-color);\n margin-bottom: -1px;\n}\n.resourcesMonthViewCorner {\n flex: 0 0 var(--resources-month-view-resource-label-width);\n min-width: var(--resources-month-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\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 background-color: var(--mantine-color-body);\n}\n.resourcesMonthViewDayLabel {\n flex: 0 0 var(--resources-month-view-day-width);\n min-width: var(--resources-month-view-day-width);\n max-width: var(--resources-month-view-day-width);\n height: 42px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n &:where([data-today]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast);\n }\n}\n.resourcesMonthViewDayLabelWeekday {\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n text-transform: capitalize;\n line-height: 1;\n margin-bottom: 3px;\n}\n.resourcesMonthViewDayLabelNumber {\n font-weight: var(--mantine-font-weight-medium);\n font-size: 12px;\n line-height: 1;\n}\n.resourcesMonthViewRow {\n display: flex;\n border-top: 1px solid var(--resources-month-view-border-color);\n}\n.resourcesMonthViewResourceLabel {\n flex: 0 0 var(--resources-month-view-resource-label-width);\n min-width: var(--resources-month-view-resource-label-width);\n display: flex;\n align-items: 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-month-view-border-color);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n &:where([data-has-groups]) {\n left: var(--resources-month-view-group-label-width);\n }\n}\n.resourcesMonthViewGroupColumn,\n.resourcesMonthViewGroupColumnEmpty {\n flex: 0 0 var(--resources-month-view-group-label-width);\n min-width: var(--resources-month-view-group-label-width);\n min-height: var(--resources-month-view-row-height);\n position: sticky;\n left: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n}\n.resourcesMonthViewGroupColumn {\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 overflow: visible;\n &:where([data-group-position='first'], [data-group-position='only']) {\n z-index: 6;\n }\n &:where([data-group-position='middle'], [data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-month-view-row-height) + 1px);\n }\n}\n.resourcesMonthViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-month-view-row-height);\n}\n.resourcesMonthViewCell {\n flex: 0 0 var(--resources-month-view-day-width);\n min-width: var(--resources-month-view-day-width);\n max-width: var(--resources-month-view-day-width);\n min-height: var(--resources-month-view-row-height);\n border-inline-end: 1px solid var(--resources-month-view-border-color);\n cursor: pointer;\n position: relative;\n overflow: hidden;\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n &:where(:focus) {\n z-index: 1;\n }\n @mixin hover {\n &:where(:not([data-static])) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n &:where([data-weekend]) {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-8);\n }\n }\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-color-blue-4);\n border-radius: 2px;\n }\n }\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid var(--mantine-primary-color-2);\n }\n }\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n.resourcesMonthView:where([data-event-interaction]) .resourcesMonthViewCell {\n pointer-events: none;\n}\n\n.resourcesMonthViewEventWrapper {\n &:hover .resourcesMonthViewResizeHandle {\n opacity: 0.5;\n }\n & .resourcesMonthViewResizeHandle:hover {\n opacity: 0.8;\n }\n &:where([data-resizing]) .resourcesMonthViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n &:where([data-resizing]) .resourcesMonthViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesMonthViewResizeHandle {\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 touch-action: none;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n &:where([data-edge='start']) {\n inset-inline-start: -2px;\n }\n &:where([data-edge='end']) {\n inset-inline-end: -2px;\n }\n}\n\n.resourcesMonthView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n & .resourcesMonthViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n & .resourcesMonthViewResizeHandle {\n opacity: 0;\n }\n }\n}\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesMonthViewOwnProps } from './ResourcesMonthView.types'\n\nconst defaultProps = {\n weekdayFormat: 'ddd',\n weekendDays: [0, 6],\n withWeekendDays: true,\n highlightToday: true,\n withHeader: true,\n dayWidth: 80,\n rowHeight: 64,\n groupLabelWidth: 80,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n recurrenceExpansionLimit: 2000,\n withEventResize: false,\n} satisfies Partial<ResourcesMonthViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\n/** Height reserved for the \"more events\" control at the bottom of a cell, in px. */\nconst MORE_EVENTS_HEIGHT = 18\n\n/** `maxEventsPerTimeSlot` is clamped so the cells keep a workable row height. */\nfunction clampMaxRows(value: number) {\n return Math.min(10, Math.max(1, value))\n}\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, dayWidth, rowHeight, groupLabelWidth }) => ({\n resourcesMonthView: {\n '--resources-month-view-radius': resolveScheduleRadius(radius),\n '--resources-month-view-day-width': cssSize(dayWidth),\n '--resources-month-view-row-height': cssSize(rowHeight),\n '--resources-month-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, clampMaxRows, RESOURCE_VIEWS, MORE_EVENTS_HEIGHT }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n useAttrs,\n useSlots,\n} from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n formatDate,\n getGroupToResourceIdMap,\n getOrderedResources,\n handleResourcesGridKeyDown,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport {\n getResourcesMonthViewLayout,\n isMultiDayEvent,\n type ResourcesMonthViewSegment,\n} from './get-resources-month-view-layout/get-resources-month-view-layout'\nimport type { ResourcesMonthViewEmits, ResourcesMonthViewSlots } from './ResourcesMonthView.types'\nimport classes from './ResourcesMonthView.module.css'\n\ndefineOptions({\n name: 'ResourcesMonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesMonthViewOwnProps>(), {\n groups: undefined,\n locale: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n startScrollDate: undefined,\n highlightToday: undefined,\n radius: undefined,\n withHeader: undefined,\n monthYearSelectProps: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n events: undefined,\n dayWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n labels: undefined,\n mode: undefined,\n scrollAreaProps: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n recurrenceExpansionLimit: undefined,\n withEventResize: undefined,\n canResizeEvent: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesMonthViewSlots>()\n\nconst emit = defineEmits<ResourcesMonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('ResourcesMonthView', defaultProps, rawProps)\nconst theme = useSafeMantineTheme()\n\nconst getStyles = useStyles({\n name: 'ResourcesMonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesMonthView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; dayIndex: number } | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\nconst monthString = computed(() => month.value.format('YYYY-MM-DD') as DateStringValue)\n\nconst maxRows = computed(() => clampMaxRows(props.maxEventsPerTimeSlot!))\n\nconst days = computed(() =>\n Array.from({ length: month.value.daysInMonth() }, (_, index) => month.value.date(index + 1))\n .filter((day) => props.withWeekendDays || !props.weekendDays!.includes(day.day() as DayOfWeek))\n .map((day) => day.format('YYYY-MM-DD') as DateStringValue),\n)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst idMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst expandedEvents = computed(() =>\n expandRecurringEvents({\n events: props.events,\n rangeStart: month.value.toDate(),\n rangeEnd: month.value.endOf('month').toDate(),\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\ntype ResizeEdge = 'start' | 'end'\ntype ResizeState = {\n event: ScheduleEventData\n edge: ResizeEdge\n resourceIndex: number\n originalStart: DateTimeStringValue\n originalEnd: DateTimeStringValue\n start: DateTimeStringValue\n end: DateTimeStringValue\n dayIndex: number\n}\nconst resizeState = shallowRef<ResizeState | null>(null)\nlet justResized = false\n\nconst effectiveEvents = computed(() => {\n const state = resizeState.value\n return state\n ? expandedEvents.value.map((event) =>\n event.id === state.event.id ? { ...event, start: state.start, end: state.end } : event,\n )\n : expandedEvents.value\n})\n\nconst rowLayouts = computed(() =>\n ordered.value.orderedResources.map((resource) =>\n getResourcesMonthViewLayout({\n days: days.value,\n events: effectiveEvents.value,\n resourceId: resource.id,\n maxRows: maxRows.value,\n }),\n ),\n)\n\nconst singleDayEvents = (rowIndex: number) =>\n rowLayouts.value[rowIndex].layouts.flatMap((layout, dayIndex) =>\n layout.visible\n .filter(({ event }) => !isMultiDayEvent(event))\n .map(({ event, row }) => ({\n event,\n row,\n dayIndex,\n compressed: layout.hiddenCount > 0 && !isStatic.value,\n })),\n )\n\nconst cellsWithHiddenEvents = (rowIndex: number) =>\n rowLayouts.value[rowIndex].layouts\n .map((layout, dayIndex) => ({ layout, dayIndex }))\n .filter(({ layout }) => layout.hiddenCount > 0 && !isStatic.value)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const first = days.value[start]\n const last = days.value[end]\n\n if (first && last) {\n emit('slotDragEnd', {\n rangeStart: `${first} 00:00:00` as DateTimeStringValue,\n rangeEnd: dayjs(last).endOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n resourceId: idMap.value.get(group) ?? group,\n })\n }\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollDate) {\n return\n }\n\n await nextTick()\n\n const index = days.value.indexOf(\n dayjs(props.startScrollDate).format('YYYY-MM-DD') as DateStringValue,\n )\n\n if (index < 0) {\n return\n }\n\n scrollSlotIntoView(controls[0]?.[index], 'x')\n})\n\nconst setControl = (resourceIndex: number, dayIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][dayIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n if (element instanceof HTMLElement) {\n rowContainers.set(resourceIndex, element)\n }\n}\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst indexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container || !days.value.length) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(\n days.value.length - 1,\n Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * days.value.length),\n ),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, dayIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const day = days.value[dayIndex]\n\n if (!day) {\n return\n }\n\n const dragged = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (dragged) {\n const next = calculateMonthDropDate({ draggedEvent: dragged, targetDay: day })\n\n emit('eventDrop', {\n eventId: dragged.id,\n newStart: dayjs(next.start).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n newEnd: dayjs(next.end).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n event: dragged,\n resourceId,\n })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: `${day} 00:00:00` as DateTimeStringValue,\n resourceId,\n })\n }\n}\n\nconst setDropTarget = (next: { resourceId: string | number; dayIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.dayIndex === next.dayIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const dayIndex = indexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(dayIndex < 0 ? null : { resourceId, dayIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const current = nativeEvent.currentTarget\n\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(nativeEvent.relatedTarget)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const dayIndex = indexAtPoint(nativeEvent, resourceIndex)\n\n if (dayIndex >= 0) {\n emitDrop(nativeEvent, resource.id, dayIndex)\n }\n}\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-month-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst rowGeometry = (row: number, compressed: boolean) =>\n compressed\n ? {\n top: `calc((100% - ${MORE_EVENTS_HEIGHT}px) * ${row} / ${maxRows.value} + 1px)`,\n height: `calc((100% - ${MORE_EVENTS_HEIGHT}px) / ${maxRows.value} - 2px)`,\n }\n : {\n top: `calc(${(row / maxRows.value) * 100}% + 1px)`,\n height: `calc(${100 / maxRows.value}% - 2px)`,\n }\n\nconst singleEventStyle = (entry: { row: number; dayIndex: number; compressed: boolean }) => ({\n position: 'absolute' as const,\n left: `calc(${(entry.dayIndex / days.value.length) * 100}% + 1px)`,\n width: `calc(${100 / days.value.length}% - 2px)`,\n ...rowGeometry(entry.row, entry.compressed),\n zIndex: 3,\n})\n\nconst segmentStyle = (segment: ResourcesMonthViewSegment) => ({\n position: 'absolute' as const,\n left: `calc(${(segment.start / days.value.length) * 100}% + 1px)`,\n width: `calc(${((segment.end - segment.start + 1) / days.value.length) * 100}% - 2px)`,\n ...rowGeometry(segment.row, segment.hidden),\n zIndex: 3,\n})\n\nconst moreEventsStyle = (dayIndex: number) => ({\n position: 'absolute' as const,\n bottom: '1px',\n left: `calc(${(dayIndex / days.value.length) * 100}% + 1px)`,\n width: `calc(${100 / days.value.length}% - 2px)`,\n height: `${MORE_EVENTS_HEIGHT}px`,\n zIndex: 4,\n})\n\nconst cornerStyle = computed(() =>\n hasGroups.value\n ? {\n flexBasis:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n }\n : undefined,\n)\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n monthValue: month.value.month(),\n yearValue: month.value.year(),\n onMonthChange: (value: number) =>\n emit('dateChange', month.value.month(value).format('YYYY-MM-DD') as DateStringValue),\n onYearChange: (value: number) =>\n emit('dateChange', month.value.year(value).format('YYYY-MM-DD') as DateStringValue),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n const day = target ? days.value[target.dayIndex] : undefined\n return day ? { date: day } : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst isResizableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventResize) &&\n !isStatic.value &&\n event.display !== 'background' &&\n (props.canResizeEvent?.(event) ?? true)\n\nconst isResizingEvent = (event: ScheduleEventData) => resizeState.value?.event.id === event.id\n\nconst calculateResizeDates = (event: ScheduleEventData, edge: ResizeEdge, targetDay: string) => {\n const originalStart = dayjs(event.start)\n const originalEnd = dayjs(event.end)\n const target = dayjs(targetDay).startOf('day')\n const endAtMidnight =\n originalEnd.hour() === 0 && originalEnd.minute() === 0 && originalEnd.second() === 0\n const endDay = endAtMidnight\n ? originalEnd.subtract(1, 'day').startOf('day')\n : originalEnd.startOf('day')\n const withTime = (day: dayjs.Dayjs, source: dayjs.Dayjs) =>\n day.startOf('day').hour(source.hour()).minute(source.minute()).second(source.second())\n\n if (edge === 'start') {\n let start = withTime(target.isAfter(endDay) ? endDay : target, originalStart)\n if (!start.isBefore(originalEnd)) start = start.subtract(1, 'day')\n return {\n start: start.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n end: originalEnd.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n }\n }\n\n const day = target.isBefore(originalStart.startOf('day')) ? originalStart.startOf('day') : target\n let end = endAtMidnight ? day.add(1, 'day').startOf('day') : withTime(day, originalEnd)\n if (!end.isAfter(originalStart)) end = end.add(1, 'day')\n return {\n start: originalStart.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n end: end.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n }\n}\n\nconst handleResizeMove = (event: PointerEvent) => {\n const state = resizeState.value\n if (!state) return\n const dayIndex = (controls[state.resourceIndex] ?? []).findIndex((cell) => {\n if (!cell) return false\n const rect = cell.getBoundingClientRect()\n return event.clientX >= rect.left && event.clientX <= rect.right\n })\n if (dayIndex < 0 || dayIndex === state.dayIndex || !days.value[dayIndex]) return\n resizeState.value = {\n ...state,\n ...calculateResizeDates(state.event, state.edge, days.value[dayIndex]),\n dayIndex,\n }\n}\n\nconst stopResizeListeners = () => {\n document.removeEventListener('pointermove', handleResizeMove)\n document.removeEventListener('pointerup', handleResizeEnd)\n document.removeEventListener('pointercancel', handleResizeCancel)\n}\n\nconst finishResize = (emitChange: boolean) => {\n const state = resizeState.value\n stopResizeListeners()\n resizeState.value = null\n if (\n emitChange &&\n state &&\n (state.start !== state.originalStart || state.end !== state.originalEnd)\n ) {\n emit('eventResize', {\n eventId: state.event.id,\n newStart: state.start,\n newEnd: state.end,\n event: state.event,\n })\n }\n justResized = true\n requestAnimationFrame(() => (justResized = false))\n}\nfunction handleResizeEnd() {\n finishResize(true)\n}\nfunction handleResizeCancel() {\n finishResize(false)\n}\n\nconst handleResizeStart = (\n event: ScheduleEventData,\n edge: ResizeEdge,\n resourceIndex: number,\n pointerEvent: PointerEvent,\n) => {\n if (!isResizableEvent(event)) return\n pointerEvent.preventDefault()\n pointerEvent.stopPropagation()\n const start = dayjs(event.start).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue\n const end = dayjs(event.end).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue\n resizeState.value = {\n event,\n edge,\n resourceIndex,\n originalStart: start,\n originalEnd: end,\n start,\n end,\n dayIndex: -1,\n }\n document.addEventListener('pointermove', handleResizeMove)\n document.addEventListener('pointerup', handleResizeEnd)\n document.addEventListener('pointercancel', handleResizeCancel)\n}\n\nonBeforeUnmount(stopResizeListeners)\n\nconst emitEventClick = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!isStatic.value && !justResized) emit('eventClick', event, nativeEvent)\n}\n\nconst eventWrapperStyle = (event: ScheduleEventData, style: Record<string, unknown>) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n return { ...style, '--event-color': colors.color }\n}\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesMonthView') }\"\n :root-ref=\"setRootElement\"\n :data-event-interaction=\"dropTarget || resizeState ? true : undefined\"\n :data-resizing=\"resizeState ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :month=\"monthString\">\n <ScheduleHeaderBase\n view=\"month\"\n :navigation-handlers=\"{\n previous: () => month.subtract(1, 'month').format('YYYY-MM-DD'),\n next: () => month.add(1, 'month').format('YYYY-MM-DD'),\n today: () => dayjs().format('YYYY-MM-DD'),\n }\"\n :control=\"headerControl\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesMonthViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n scrollbars=\"x\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesMonthViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div v-bind=\"getStyles('resourcesMonthViewInner')\">\n <div v-bind=\"getStyles('resourcesMonthViewDayLabelsRow')\">\n <div v-bind=\"getStyles('resourcesMonthViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <template v-for=\"day in days\" :key=\"day\">\n <slot\n name=\"dayLabel\"\n :date=\"day\"\n :weekday=\"\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n \"\n :day=\"dayjs(day).date()\"\n >\n <div\n v-bind=\"staticStyles('resourcesMonthViewDayLabel')\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-today=\"\n (props.highlightToday && dayjs(day).isSame(dayjs(), 'day')) || undefined\n \"\n >\n <span v-bind=\"staticStyles('resourcesMonthViewDayLabelWeekday')\">\n {{\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n }}\n </span>\n <span v-bind=\"staticStyles('resourcesMonthViewDayLabelNumber')\">\n {{ dayjs(day).date() }}\n </span>\n </div>\n </slot>\n </template>\n </div>\n\n <div\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesMonthViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesMonthViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesMonthViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <div\n v-bind=\"staticStyles('resourcesMonthViewResourceLabel')\"\n :data-has-groups=\"hasGroups || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </div>\n\n <div\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"staticStyles('resourcesMonthViewRowSlots')\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"handleRowDragLeave($event)\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <Box\n v-for=\"entry in singleDayEvents(resourceIndex)\"\n :key=\"`${entry.event.id}-${entry.dayIndex}`\"\n v-bind=\"getStyles('resourcesMonthViewEventWrapper')\"\n :style=\"eventWrapperStyle(entry.event, singleEventStyle(entry))\"\n :data-resizing=\"isResizingEvent(entry.event) || undefined\"\n >\n <ScheduleEvent\n :event=\"entry.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(entry.event)\"\n :is-resizing=\"isResizingEvent(entry.event)\"\n style=\"width: 100%; height: 100%\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"emitEventClick(entry.event, $event as MouseEvent)\"\n />\n <div\n v-if=\"isResizableEvent(entry.event)\"\n v-bind=\"getStyles('resourcesMonthViewResizeHandle')\"\n data-edge=\"start\"\n :data-active=\"\n (isResizingEvent(entry.event) && resizeState?.edge === 'start') || undefined\n \"\n @pointerdown=\"handleResizeStart(entry.event, 'start', resourceIndex, $event)\"\n />\n <div\n v-if=\"isResizableEvent(entry.event)\"\n v-bind=\"getStyles('resourcesMonthViewResizeHandle')\"\n data-edge=\"end\"\n :data-active=\"\n (isResizingEvent(entry.event) && resizeState?.edge === 'end') || undefined\n \"\n @pointerdown=\"handleResizeStart(entry.event, 'end', resourceIndex, $event)\"\n />\n </Box>\n\n <Box\n v-for=\"segment in rowLayouts[resourceIndex].segments\"\n :key=\"`${segment.event.id}-${segment.start}`\"\n v-bind=\"getStyles('resourcesMonthViewEventWrapper')\"\n :style=\"eventWrapperStyle(segment.event, segmentStyle(segment))\"\n :data-resizing=\"isResizingEvent(segment.event) || undefined\"\n >\n <ScheduleEvent\n :event=\"segment.event\"\n :hanging=\"segment.hanging\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(segment.event)\"\n :is-resizing=\"isResizingEvent(segment.event)\"\n style=\"width: 100%; height: 100%\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"emitEventClick(segment.event, $event as MouseEvent)\"\n />\n <div\n v-if=\"\n isResizableEvent(segment.event) &&\n segment.hanging !== 'start' &&\n segment.hanging !== 'both'\n \"\n v-bind=\"getStyles('resourcesMonthViewResizeHandle')\"\n data-edge=\"start\"\n :data-active=\"\n (isResizingEvent(segment.event) && resizeState?.edge === 'start') || undefined\n \"\n @pointerdown=\"handleResizeStart(segment.event, 'start', resourceIndex, $event)\"\n />\n <div\n v-if=\"\n isResizableEvent(segment.event) &&\n segment.hanging !== 'end' &&\n segment.hanging !== 'both'\n \"\n v-bind=\"getStyles('resourcesMonthViewResizeHandle')\"\n data-edge=\"end\"\n :data-active=\"\n (isResizingEvent(segment.event) && resizeState?.edge === 'end') || undefined\n \"\n @pointerdown=\"handleResizeStart(segment.event, 'end', resourceIndex, $event)\"\n />\n </Box>\n\n <template\n v-for=\"entry in cellsWithHiddenEvents(resourceIndex)\"\n :key=\"`more-${entry.dayIndex}`\"\n >\n <slot\n name=\"moreEvents\"\n :events=\"rowLayouts[resourceIndex].eventsByDay[entry.dayIndex]\"\n :hidden-count=\"entry.layout.hiddenCount\"\n :resource=\"resource\"\n :date=\"days[entry.dayIndex]\"\n >\n <MoreEvents\n :events=\"rowLayouts[resourceIndex].eventsByDay[entry.dayIndex]\"\n :more-events-count=\"entry.layout.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"moreEventsStyle(entry.dayIndex)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <UnstyledButton\n v-for=\"(day, dayIndex) in days\"\n :key=\"day\"\n :ref=\"setControl(resourceIndex, dayIndex)\"\n v-bind=\"staticStyles('resourcesMonthViewCell')\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id && dropTarget.dayIndex === dayIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(dayIndex, String(resource.id)) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"props.withDragSlotSelect ? dayIndex : undefined\"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :tabindex=\"isStatic ? -1 : resourceIndex === 0 && dayIndex === 0 ? 0 : -1\"\n :aria-label=\"`${String(resource.label)} ${dayjs(day).format('MMMM D, YYYY')}`\"\n @keydown=\"\n handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex: dayIndex,\n event: $event,\n })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown($event, dayIndex, String(resource.id))\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('dayClick', {\n date: day,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot name=\"dayCell\" :resource=\"resource\" :date=\"day\" />\n </UnstyledButton>\n </div>\n </div>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver } from '@mantine-vue/core'\nimport { cssSize, resolveScheduleRadius } from '../shared'\nimport type { ResourcesMonthViewOwnProps } from './ResourcesMonthView.types'\n\nconst defaultProps = {\n weekdayFormat: 'ddd',\n weekendDays: [0, 6],\n withWeekendDays: true,\n highlightToday: true,\n withHeader: true,\n dayWidth: 80,\n rowHeight: 64,\n groupLabelWidth: 80,\n mode: 'default',\n maxEventsPerTimeSlot: 2,\n recurrenceExpansionLimit: 2000,\n withEventResize: false,\n} satisfies Partial<ResourcesMonthViewOwnProps>\n\n/** View levels the header offers – a resource schedule has no year view. */\nconst RESOURCE_VIEWS = ['day', 'week', 'month'] as const\n\n/** Height reserved for the \"more events\" control at the bottom of a cell, in px. */\nconst MORE_EVENTS_HEIGHT = 18\n\n/** `maxEventsPerTimeSlot` is clamped so the cells keep a workable row height. */\nfunction clampMaxRows(value: number) {\n return Math.min(10, Math.max(1, value))\n}\n\nconst varsResolver = createVarsResolver<any>(\n (_theme, { radius, dayWidth, rowHeight, groupLabelWidth }) => ({\n resourcesMonthView: {\n '--resources-month-view-radius': resolveScheduleRadius(radius),\n '--resources-month-view-day-width': cssSize(dayWidth),\n '--resources-month-view-row-height': cssSize(rowHeight),\n '--resources-month-view-group-label-width': cssSize(groupLabelWidth),\n },\n }),\n)\n\nexport { defaultProps, varsResolver, clampMaxRows, RESOURCE_VIEWS, MORE_EVENTS_HEIGHT }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n useAttrs,\n useSlots,\n} from 'vue'\nimport {\n Box,\n ScrollArea,\n UnstyledButton,\n useProps,\n useSafeMantineTheme,\n useStyles,\n} from '@mantine-vue/core'\nimport { getLabel } from '../../labels'\nimport type {\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleViewLevel,\n} from '../../types'\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n formatDate,\n getGroupToResourceIdMap,\n getOrderedResources,\n handleResourcesGridKeyDown,\n type ResourceGroupInfo,\n type ResourcesGridControls,\n} from '../../utils'\nimport { provideScheduleDragState } from '../DragContext'\nimport { MoreEvents } from '../MoreEvents'\nimport { ScheduleEvent } from '../ScheduleEvent'\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase'\nimport {\n getDropEvent,\n rafThrottle,\n resolveEventRenderers,\n scheduleViewportProps,\n scrollSlotIntoView,\n useStaticStyles,\n} from '../shared'\nimport { useSlotDragSelect } from '../use-slot-drag-select'\nimport {\n getResourcesMonthViewLayout,\n isMultiDayEvent,\n type ResourcesMonthViewSegment,\n} from './get-resources-month-view-layout/get-resources-month-view-layout'\nimport type { ResourcesMonthViewEmits, ResourcesMonthViewSlots } from './ResourcesMonthView.types'\nimport classes from './ResourcesMonthView.module.css'\n\ndefineOptions({\n name: 'ResourcesMonthView',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesMonthViewOwnProps>(), {\n groups: undefined,\n locale: undefined,\n weekdayFormat: undefined,\n weekendDays: undefined,\n withWeekendDays: undefined,\n startScrollDate: undefined,\n highlightToday: undefined,\n radius: undefined,\n withHeader: undefined,\n monthYearSelectProps: undefined,\n previousControlProps: undefined,\n nextControlProps: undefined,\n todayControlProps: undefined,\n viewSelectProps: undefined,\n events: undefined,\n dayWidth: undefined,\n rowHeight: undefined,\n groupLabelWidth: undefined,\n renderEventBody: undefined,\n renderEvent: undefined,\n renderResourceLabel: undefined,\n renderGroupLabel: undefined,\n canDragEvent: undefined,\n labels: undefined,\n mode: undefined,\n scrollAreaProps: undefined,\n maxEventsPerTimeSlot: undefined,\n moreEventsProps: undefined,\n recurrenceExpansionLimit: undefined,\n withEventResize: undefined,\n canResizeEvent: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesMonthViewSlots>()\n\nconst emit = defineEmits<ResourcesMonthViewEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('ResourcesMonthView', defaultProps, rawProps)\nconst theme = useSafeMantineTheme()\n\nconst getStyles = useStyles({\n name: 'ResourcesMonthView',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n varsResolver,\n rootSelector: 'resourcesMonthView',\n})\n\n/**\n * Cached per selector: a resource grid renders one cell per resource and slot, and rebuilding\n * the same class list for each of them is what makes a drag re-render expensive.\n */\nconst staticStyles = useStaticStyles(getStyles)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst eventRenderers = computed(() => resolveEventRenderers(props, slots))\n\nconst controls: ResourcesGridControls = []\nconst rowContainers = new Map<number, HTMLElement>()\n\nconst rootElement = ref<HTMLElement | null>(null)\nconst setRootElement = (node: Element | null) => {\n rootElement.value = node instanceof HTMLElement ? node : null\n}\n\nconst dropTarget = shallowRef<{ resourceId: string | number; dayIndex: number } | null>(null)\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst month = computed(() => dayjs(props.date).startOf('month'))\nconst monthString = computed(() => month.value.format('YYYY-MM-DD') as DateStringValue)\n\nconst maxRows = computed(() => clampMaxRows(props.maxEventsPerTimeSlot!))\n\nconst days = computed(() =>\n Array.from({ length: month.value.daysInMonth() }, (_, index) => month.value.date(index + 1))\n .filter((day) => props.withWeekendDays || !props.weekendDays!.includes(day.day() as DayOfWeek))\n .map((day) => day.format('YYYY-MM-DD') as DateStringValue),\n)\n\nconst ordered = computed(() => getOrderedResources(props.resources, props.groups))\nconst idMap = computed(() => getGroupToResourceIdMap(props.resources))\nconst hasGroups = computed(() => ordered.value.groupRanges.length > 0)\n\nconst expandedEvents = computed(() =>\n expandRecurringEvents({\n events: props.events,\n rangeStart: month.value.toDate(),\n rangeEnd: month.value.endOf('month').toDate(),\n expansionLimit: props.recurrenceExpansionLimit!,\n }),\n)\n\ntype ResizeEdge = 'start' | 'end'\ntype ResizeState = {\n event: ScheduleEventData\n edge: ResizeEdge\n resourceIndex: number\n originalStart: DateTimeStringValue\n originalEnd: DateTimeStringValue\n start: DateTimeStringValue\n end: DateTimeStringValue\n dayIndex: number\n}\nconst resizeState = shallowRef<ResizeState | null>(null)\nlet justResized = false\n\nconst effectiveEvents = computed(() => {\n const state = resizeState.value\n return state\n ? expandedEvents.value.map((event) =>\n event.id === state.event.id ? { ...event, start: state.start, end: state.end } : event,\n )\n : expandedEvents.value\n})\n\nconst rowLayouts = computed(() =>\n ordered.value.orderedResources.map((resource) =>\n getResourcesMonthViewLayout({\n days: days.value,\n events: effectiveEvents.value,\n resourceId: resource.id,\n maxRows: maxRows.value,\n }),\n ),\n)\n\nconst singleDayEvents = (rowIndex: number) =>\n rowLayouts.value[rowIndex].layouts.flatMap((layout, dayIndex) =>\n layout.visible\n .filter(({ event }) => !isMultiDayEvent(event))\n .map(({ event, row }) => ({\n event,\n row,\n dayIndex,\n compressed: layout.hiddenCount > 0 && !isStatic.value,\n })),\n )\n\nconst cellsWithHiddenEvents = (rowIndex: number) =>\n rowLayouts.value[rowIndex].layouts\n .map((layout, dayIndex) => ({ layout, dayIndex }))\n .filter(({ layout }) => layout.hiddenCount > 0 && !isStatic.value)\n\nconst slotSelect = useSlotDragSelect({\n enabled: () => Boolean(props.withDragSlotSelect) && !isStatic.value,\n onDragEnd: (start, end, group) => {\n const first = days.value[start]\n const last = days.value[end]\n\n if (first && last) {\n emit('slotDragEnd', {\n rangeStart: `${first} 00:00:00` as DateTimeStringValue,\n rangeEnd: dayjs(last).endOf('day').format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n resourceId: idMap.value.get(group) ?? group,\n })\n }\n },\n})\n\nonMounted(async () => {\n if (!props.startScrollDate) {\n return\n }\n\n await nextTick()\n\n const index = days.value.indexOf(\n dayjs(props.startScrollDate).format('YYYY-MM-DD') as DateStringValue,\n )\n\n if (index < 0) {\n return\n }\n\n scrollSlotIntoView(controls[0]?.[index], 'x')\n})\n\nconst setControl = (resourceIndex: number, dayIndex: number) => (element: unknown) => {\n const button = (element as { $el?: HTMLButtonElement } | null)?.$el ?? element\n controls[resourceIndex] ||= []\n controls[resourceIndex][dayIndex] = button instanceof HTMLButtonElement ? button : undefined\n}\n\nconst setRowContainer = (resourceIndex: number) => (element: unknown) => {\n if (element instanceof HTMLElement) {\n rowContainers.set(resourceIndex, element)\n }\n}\n\nconst withDragHandlers = computed(\n () =>\n !isStatic.value &&\n (Boolean(props.withEventsDragAndDrop) || Boolean(props.withExternalEventDrop)),\n)\n\nconst indexAtPoint = (nativeEvent: DragEvent, resourceIndex: number) => {\n const container = rowContainers.get(resourceIndex)\n\n if (!container || !days.value.length) {\n return -1\n }\n\n const rect = container.getBoundingClientRect()\n\n if (rect.width <= 0) {\n return -1\n }\n\n return Math.max(\n 0,\n Math.min(\n days.value.length - 1,\n Math.floor(((nativeEvent.clientX - rect.left) / rect.width) * days.value.length),\n ),\n )\n}\n\nconst emitDrop = (nativeEvent: DragEvent, resourceId: string | number, dayIndex: number) => {\n nativeEvent.preventDefault()\n // Drop the pending frame first, so a stale highlight cannot land after the drop.\n resolveDropTarget.cancel()\n setDropTarget(null)\n const day = days.value[dayIndex]\n\n if (!day) {\n return\n }\n\n const dragged = getDropEvent(expandedEvents.value, nativeEvent.dataTransfer)\n\n if (dragged) {\n const next = calculateMonthDropDate({ draggedEvent: dragged, targetDay: day })\n\n emit('eventDrop', {\n eventId: dragged.id,\n newStart: dayjs(next.start).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n newEnd: dayjs(next.end).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n event: dragged,\n resourceId,\n })\n } else if (nativeEvent.dataTransfer) {\n emit('externalEventDrop', {\n dataTransfer: nativeEvent.dataTransfer,\n dropDateTime: `${day} 00:00:00` as DateTimeStringValue,\n resourceId,\n })\n }\n}\n\nconst setDropTarget = (next: { resourceId: string | number; dayIndex: number } | null) => {\n const current = dropTarget.value\n\n if (current === next) {\n return\n }\n\n if (\n current &&\n next &&\n current.resourceId === next.resourceId &&\n current.dayIndex === next.dayIndex\n ) {\n return\n }\n\n dropTarget.value = next\n}\n\n/**\n * Coalesced to one animation frame: `dragover` fires several times per frame, and resolving the\n * target measures the row, so handling every event would read layout and re-render the grid\n * faster than the browser can paint.\n */\nconst resolveDropTarget = rafThrottle(\n (nativeEvent: DragEvent, resourceId: string | number, resourceIndex: number) => {\n const dayIndex = indexAtPoint(nativeEvent, resourceIndex)\n setDropTarget(dayIndex < 0 ? null : { resourceId, dayIndex })\n },\n)\n\nconst handleRowDragOver = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n // `preventDefault` stays synchronous: the browser reads it as the handler returns.\n nativeEvent.preventDefault()\n resolveDropTarget(nativeEvent, resource.id, resourceIndex)\n}\n\nconst handleRowDragLeave = (nativeEvent: DragEvent) => {\n const current = nativeEvent.currentTarget\n\n if (\n !(nativeEvent.relatedTarget instanceof Node) ||\n !(current instanceof HTMLElement) ||\n !current.contains(nativeEvent.relatedTarget)\n ) {\n resolveDropTarget.cancel()\n setDropTarget(null)\n }\n}\n\nconst handleRowDrop = (\n nativeEvent: DragEvent,\n resource: { id: string | number },\n resourceIndex: number,\n) => {\n const dayIndex = indexAtPoint(nativeEvent, resourceIndex)\n\n if (dayIndex >= 0) {\n emitDrop(nativeEvent, resource.id, dayIndex)\n }\n}\n\nconst groupInfo = (resourceIndex: number) =>\n hasGroups.value ? ordered.value.resourceGroupMap[resourceIndex] : undefined\n\nconst groupStarts = (info: ResourceGroupInfo) =>\n info.position === 'first' || info.position === 'only'\n\nconst groupCellStyle = (info: ResourceGroupInfo) =>\n info.count > 1\n ? {\n transform: `translateY(calc((${info.count - 1} * (var(--resources-month-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n\nconst rowGeometry = (row: number, compressed: boolean) =>\n compressed\n ? {\n top: `calc((100% - ${MORE_EVENTS_HEIGHT}px) * ${row} / ${maxRows.value} + 1px)`,\n height: `calc((100% - ${MORE_EVENTS_HEIGHT}px) / ${maxRows.value} - 2px)`,\n }\n : {\n top: `calc(${(row / maxRows.value) * 100}% + 1px)`,\n height: `calc(${100 / maxRows.value}% - 2px)`,\n }\n\nconst singleEventStyle = (entry: { row: number; dayIndex: number; compressed: boolean }) => ({\n position: 'absolute' as const,\n left: `calc(${(entry.dayIndex / days.value.length) * 100}% + 1px)`,\n width: `calc(${100 / days.value.length}% - 2px)`,\n ...rowGeometry(entry.row, entry.compressed),\n zIndex: 3,\n})\n\nconst segmentStyle = (segment: ResourcesMonthViewSegment) => ({\n position: 'absolute' as const,\n left: `calc(${(segment.start / days.value.length) * 100}% + 1px)`,\n width: `calc(${((segment.end - segment.start + 1) / days.value.length) * 100}% - 2px)`,\n ...rowGeometry(segment.row, segment.hidden),\n zIndex: 3,\n})\n\nconst moreEventsStyle = (dayIndex: number) => ({\n position: 'absolute' as const,\n bottom: '1px',\n left: `calc(${(dayIndex / days.value.length) * 100}% + 1px)`,\n width: `calc(${100 / days.value.length}% - 2px)`,\n height: `${MORE_EVENTS_HEIGHT}px`,\n zIndex: 4,\n})\n\nconst cornerStyle = computed(() =>\n hasGroups.value\n ? {\n flexBasis:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n }\n : undefined,\n)\n\nconst headerControl = computed(() => ({\n monthYearSelect: {\n locale: props.locale,\n monthValue: month.value.month(),\n yearValue: month.value.year(),\n onMonthChange: (value: number) =>\n emit('dateChange', month.value.month(value).format('YYYY-MM-DD') as DateStringValue),\n onYearChange: (value: number) =>\n emit('dateChange', month.value.year(value).format('YYYY-MM-DD') as DateStringValue),\n ...props.monthYearSelectProps,\n },\n}))\n\nconst isDraggableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventsDragAndDrop) && !isStatic.value && (props.canDragEvent?.(event) ?? true)\n\nconst dragState = provideScheduleDragState({\n dragOverTarget: () => {\n const target = dropTarget.value\n const day = target ? days.value[target.dayIndex] : undefined\n return day ? { date: day } : null\n },\n isSlotDragging: () => slotSelect.isDragging(),\n onDragEnd: () => {\n resolveDropTarget.cancel()\n setDropTarget(null)\n emit('eventDragEnd')\n },\n})\n\nconst dragStart = (event: ScheduleEventData) => {\n dragState.startEventDrag(event)\n emit('eventDragStart', event)\n}\n\nconst dragEnd = () => dragState.endEventDrag()\n\nconst isResizableEvent = (event: ScheduleEventData) =>\n Boolean(props.withEventResize) &&\n !isStatic.value &&\n event.display !== 'background' &&\n (props.canResizeEvent?.(event) ?? true)\n\nconst isResizingEvent = (event: ScheduleEventData) => resizeState.value?.event.id === event.id\n\nconst calculateResizeDates = (event: ScheduleEventData, edge: ResizeEdge, targetDay: string) => {\n const originalStart = dayjs(event.start)\n const originalEnd = dayjs(event.end)\n const target = dayjs(targetDay).startOf('day')\n const endAtMidnight =\n originalEnd.hour() === 0 && originalEnd.minute() === 0 && originalEnd.second() === 0\n const endDay = endAtMidnight\n ? originalEnd.subtract(1, 'day').startOf('day')\n : originalEnd.startOf('day')\n const withTime = (day: dayjs.Dayjs, source: dayjs.Dayjs) =>\n day.startOf('day').hour(source.hour()).minute(source.minute()).second(source.second())\n\n if (edge === 'start') {\n let start = withTime(target.isAfter(endDay) ? endDay : target, originalStart)\n if (!start.isBefore(originalEnd)) start = start.subtract(1, 'day')\n return {\n start: start.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n end: originalEnd.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n }\n }\n\n const day = target.isBefore(originalStart.startOf('day')) ? originalStart.startOf('day') : target\n let end = endAtMidnight ? day.add(1, 'day').startOf('day') : withTime(day, originalEnd)\n if (!end.isAfter(originalStart)) end = end.add(1, 'day')\n return {\n start: originalStart.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n end: end.format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue,\n }\n}\n\nconst handleResizeMove = (event: PointerEvent) => {\n const state = resizeState.value\n if (!state) return\n const dayIndex = (controls[state.resourceIndex] ?? []).findIndex((cell) => {\n if (!cell) return false\n const rect = cell.getBoundingClientRect()\n return event.clientX >= rect.left && event.clientX <= rect.right\n })\n if (dayIndex < 0 || dayIndex === state.dayIndex || !days.value[dayIndex]) return\n resizeState.value = {\n ...state,\n ...calculateResizeDates(state.event, state.edge, days.value[dayIndex]),\n dayIndex,\n }\n}\n\nconst stopResizeListeners = () => {\n document.removeEventListener('pointermove', handleResizeMove)\n document.removeEventListener('pointerup', handleResizeEnd)\n document.removeEventListener('pointercancel', handleResizeCancel)\n}\n\nconst finishResize = (emitChange: boolean) => {\n const state = resizeState.value\n stopResizeListeners()\n resizeState.value = null\n if (\n emitChange &&\n state &&\n (state.start !== state.originalStart || state.end !== state.originalEnd)\n ) {\n emit('eventResize', {\n eventId: state.event.id,\n newStart: state.start,\n newEnd: state.end,\n event: state.event,\n })\n }\n justResized = true\n requestAnimationFrame(() => (justResized = false))\n}\nfunction handleResizeEnd() {\n finishResize(true)\n}\nfunction handleResizeCancel() {\n finishResize(false)\n}\n\nconst handleResizeStart = (\n event: ScheduleEventData,\n edge: ResizeEdge,\n resourceIndex: number,\n pointerEvent: PointerEvent,\n) => {\n if (!isResizableEvent(event)) return\n pointerEvent.preventDefault()\n pointerEvent.stopPropagation()\n const start = dayjs(event.start).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue\n const end = dayjs(event.end).format('YYYY-MM-DD HH:mm:ss') as DateTimeStringValue\n resizeState.value = {\n event,\n edge,\n resourceIndex,\n originalStart: start,\n originalEnd: end,\n start,\n end,\n dayIndex: -1,\n }\n document.addEventListener('pointermove', handleResizeMove)\n document.addEventListener('pointerup', handleResizeEnd)\n document.addEventListener('pointercancel', handleResizeCancel)\n}\n\nonBeforeUnmount(stopResizeListeners)\n\nconst emitEventClick = (event: ScheduleEventData, nativeEvent: MouseEvent) => {\n if (!isStatic.value && !justResized) emit('eventClick', event, nativeEvent)\n}\n\nconst eventWrapperStyle = (event: ScheduleEventData, style: Record<string, unknown>) => {\n const colors = theme.value.variantColorResolver({\n color: event.color || theme.value.primaryColor,\n theme: theme.value,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n return { ...style, '--event-color': colors.color }\n}\n\nconst changeDate = (value: DateStringValue) => emit('dateChange', value)\nconst changeView = (view: ScheduleViewLevel) => emit('viewChange', view)\n</script>\n\n<template>\n <Box\n v-bind=\"{ ...attrs, ...getStyles('resourcesMonthView') }\"\n :root-ref=\"setRootElement\"\n :data-event-interaction=\"dropTarget || resizeState ? true : undefined\"\n :data-resizing=\"resizeState ? true : undefined\"\n >\n <template v-if=\"props.withHeader\">\n <slot name=\"header\" :month=\"monthString\">\n <ScheduleHeaderBase\n view=\"month\"\n :navigation-handlers=\"{\n previous: () => month.subtract(1, 'month').format('YYYY-MM-DD'),\n next: () => month.add(1, 'month').format('YYYY-MM-DD'),\n today: () => dayjs().format('YYYY-MM-DD'),\n }\"\n :control=\"headerControl\"\n :labels=\"props.labels\"\n :previous-control-props=\"props.previousControlProps\"\n :next-control-props=\"props.nextControlProps\"\n :today-control-props=\"props.todayControlProps\"\n :view-select-props=\"{ views: RESOURCE_VIEWS, ...props.viewSelectProps }\"\n v-bind=\"stylesApi\"\n @date-change=\"changeDate\"\n @view-change=\"changeView\"\n />\n </slot>\n </template>\n\n <Box v-bind=\"getStyles('resourcesMonthViewRoot')\">\n <ScrollArea\n :scrollbar-size=\"4\"\n scrollbars=\"x\"\n v-bind=\"{ ...props.scrollAreaProps, ...getStyles('resourcesMonthViewScrollArea') }\"\n :viewport-props=\"{ ...scheduleViewportProps, ...props.scrollAreaProps?.viewportProps }\"\n >\n <div v-bind=\"getStyles('resourcesMonthViewInner')\">\n <div v-bind=\"getStyles('resourcesMonthViewDayLabelsRow')\">\n <div v-bind=\"getStyles('resourcesMonthViewCorner', { style: cornerStyle })\">\n <slot name=\"corner\" :resources=\"ordered.orderedResources\">\n {{ getLabel('resources', props.labels) }}\n </slot>\n </div>\n\n <template v-for=\"day in days\" :key=\"day\">\n <slot\n name=\"dayLabel\"\n :date=\"day\"\n :weekday=\"\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n \"\n :day=\"dayjs(day).date()\"\n >\n <div\n v-bind=\"staticStyles('resourcesMonthViewDayLabel')\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-today=\"\n (props.highlightToday && dayjs(day).isSame(dayjs(), 'day')) || undefined\n \"\n >\n <span v-bind=\"staticStyles('resourcesMonthViewDayLabelWeekday')\">\n {{\n formatDate({\n date: day,\n locale: props.locale || 'en',\n format: props.weekdayFormat!,\n })\n }}\n </span>\n <span v-bind=\"staticStyles('resourcesMonthViewDayLabelNumber')\">\n {{ dayjs(day).date() }}\n </span>\n </div>\n </slot>\n </template>\n </div>\n\n <div\n v-for=\"(resource, resourceIndex) in ordered.orderedResources\"\n :key=\"resource.id\"\n v-bind=\"staticStyles('resourcesMonthViewRow')\"\n >\n <template v-if=\"groupInfo(resourceIndex) !== undefined\">\n <Box\n v-if=\"groupInfo(resourceIndex) === null\"\n v-bind=\"staticStyles('resourcesMonthViewGroupColumnEmpty')\"\n />\n <Box\n v-else\n v-bind=\"staticStyles('resourcesMonthViewGroupColumn')\"\n :data-group-position=\"groupInfo(resourceIndex)!.position\"\n >\n <span\n v-if=\"groupStarts(groupInfo(resourceIndex)!)\"\n :style=\"groupCellStyle(groupInfo(resourceIndex)!)\"\n >\n <slot name=\"groupLabel\" :group=\"groupInfo(resourceIndex)!.group\">\n <component\n :is=\"() => props.renderGroupLabel!(groupInfo(resourceIndex)!.group)\"\n v-if=\"props.renderGroupLabel\"\n />\n <template v-else>{{ groupInfo(resourceIndex)!.group.label }}</template>\n </slot>\n </span>\n </Box>\n </template>\n\n <div\n v-bind=\"staticStyles('resourcesMonthViewResourceLabel')\"\n :data-has-groups=\"hasGroups || undefined\"\n >\n <slot name=\"resourceLabel\" :resource=\"resource\">\n <component\n :is=\"() => props.renderResourceLabel!(resource)\"\n v-if=\"props.renderResourceLabel\"\n />\n <template v-else>{{ resource.label }}</template>\n </slot>\n </div>\n\n <div\n :ref=\"setRowContainer(resourceIndex)\"\n v-bind=\"staticStyles('resourcesMonthViewRowSlots')\"\n @dragover=\"\n withDragHandlers ? handleRowDragOver($event, resource, resourceIndex) : undefined\n \"\n @dragleave=\"handleRowDragLeave($event)\"\n @drop=\"withDragHandlers ? handleRowDrop($event, resource, resourceIndex) : undefined\"\n >\n <Box\n v-for=\"entry in singleDayEvents(resourceIndex)\"\n :key=\"`${entry.event.id}-${entry.dayIndex}`\"\n v-bind=\"getStyles('resourcesMonthViewEventWrapper')\"\n :style=\"eventWrapperStyle(entry.event, singleEventStyle(entry))\"\n :data-resizing=\"isResizingEvent(entry.event) || undefined\"\n >\n <ScheduleEvent\n :event=\"entry.event\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(entry.event)\"\n :is-resizing=\"isResizingEvent(entry.event)\"\n style=\"width: 100%; height: 100%\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"emitEventClick(entry.event, $event as MouseEvent)\"\n />\n <div\n v-if=\"isResizableEvent(entry.event)\"\n v-bind=\"getStyles('resourcesMonthViewResizeHandle')\"\n data-edge=\"start\"\n :data-active=\"\n (isResizingEvent(entry.event) && resizeState?.edge === 'start') || undefined\n \"\n @pointerdown=\"handleResizeStart(entry.event, 'start', resourceIndex, $event)\"\n />\n <div\n v-if=\"isResizableEvent(entry.event)\"\n v-bind=\"getStyles('resourcesMonthViewResizeHandle')\"\n data-edge=\"end\"\n :data-active=\"\n (isResizingEvent(entry.event) && resizeState?.edge === 'end') || undefined\n \"\n @pointerdown=\"handleResizeStart(entry.event, 'end', resourceIndex, $event)\"\n />\n </Box>\n\n <Box\n v-for=\"segment in rowLayouts[resourceIndex].segments\"\n :key=\"`${segment.event.id}-${segment.start}`\"\n v-bind=\"getStyles('resourcesMonthViewEventWrapper')\"\n :style=\"eventWrapperStyle(segment.event, segmentStyle(segment))\"\n :data-resizing=\"isResizingEvent(segment.event) || undefined\"\n >\n <ScheduleEvent\n :event=\"segment.event\"\n :hanging=\"segment.hanging\"\n auto-size\n nowrap\n :radius=\"props.radius\"\n :mode=\"props.mode\"\n :draggable=\"isDraggableEvent(segment.event)\"\n :is-resizing=\"isResizingEvent(segment.event)\"\n style=\"width: 100%; height: 100%\"\n v-bind=\"{ ...eventRenderers, ...stylesApi }\"\n @event-drag-start=\"dragStart\"\n @event-drag-end=\"dragEnd\"\n @click=\"emitEventClick(segment.event, $event as MouseEvent)\"\n />\n <div\n v-if=\"\n isResizableEvent(segment.event) &&\n segment.hanging !== 'start' &&\n segment.hanging !== 'both'\n \"\n v-bind=\"getStyles('resourcesMonthViewResizeHandle')\"\n data-edge=\"start\"\n :data-active=\"\n (isResizingEvent(segment.event) && resizeState?.edge === 'start') || undefined\n \"\n @pointerdown=\"handleResizeStart(segment.event, 'start', resourceIndex, $event)\"\n />\n <div\n v-if=\"\n isResizableEvent(segment.event) &&\n segment.hanging !== 'end' &&\n segment.hanging !== 'both'\n \"\n v-bind=\"getStyles('resourcesMonthViewResizeHandle')\"\n data-edge=\"end\"\n :data-active=\"\n (isResizingEvent(segment.event) && resizeState?.edge === 'end') || undefined\n \"\n @pointerdown=\"handleResizeStart(segment.event, 'end', resourceIndex, $event)\"\n />\n </Box>\n\n <template\n v-for=\"entry in cellsWithHiddenEvents(resourceIndex)\"\n :key=\"`more-${entry.dayIndex}`\"\n >\n <slot\n name=\"moreEvents\"\n :events=\"rowLayouts[resourceIndex].eventsByDay[entry.dayIndex]\"\n :hidden-count=\"entry.layout.hiddenCount\"\n :resource=\"resource\"\n :date=\"days[entry.dayIndex]\"\n >\n <MoreEvents\n :events=\"rowLayouts[resourceIndex].eventsByDay[entry.dayIndex]\"\n :more-events-count=\"entry.layout.hiddenCount\"\n :mode=\"props.mode\"\n :labels=\"props.labels\"\n :style=\"moreEventsStyle(entry.dayIndex)\"\n v-bind=\"{ ...eventRenderers, ...stylesApi, ...props.moreEventsProps }\"\n @event-click=\"(event, nativeEvent) => emit('eventClick', event, nativeEvent)\"\n />\n </slot>\n </template>\n\n <UnstyledButton\n v-for=\"(day, dayIndex) in days\"\n :key=\"day\"\n :ref=\"setControl(resourceIndex, dayIndex)\"\n v-bind=\"staticStyles('resourcesMonthViewCell')\"\n :data-weekend=\"\n props.weekendDays!.includes(dayjs(day).day() as DayOfWeek) || undefined\n \"\n :data-drop-target=\"\n (dropTarget?.resourceId === resource.id && dropTarget.dayIndex === dayIndex) ||\n undefined\n \"\n :data-drag-selected=\"\n slotSelect.isSlotSelected(dayIndex, String(resource.id)) || undefined\n \"\n :data-static=\"isStatic || undefined\"\n :data-drag-slot-index=\"props.withDragSlotSelect ? dayIndex : undefined\"\n :data-drag-slot-group=\"props.withDragSlotSelect ? String(resource.id) : undefined\"\n :tabindex=\"isStatic ? -1 : resourceIndex === 0 && dayIndex === 0 ? 0 : -1\"\n :aria-label=\"`${String(resource.label)} ${dayjs(day).format('MMMM D, YYYY')}`\"\n @keydown=\"\n handleResourcesGridKeyDown({\n controls,\n resourceIndex,\n slotIndex: dayIndex,\n event: $event,\n })\n \"\n @pointerdown=\"\n isStatic\n ? undefined\n : slotSelect.handleSlotPointerDown($event, dayIndex, String(resource.id))\n \"\n @click=\"\n isStatic\n ? undefined\n : emit('dayClick', {\n date: day,\n nativeEvent: $event,\n resourceId: resource.id,\n })\n \"\n >\n <slot name=\"dayCell\" :resource=\"resource\" :date=\"day\" />\n </UnstyledButton>\n </div>\n </div>\n </div>\n </ScrollArea>\n </Box>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ResourcesMonthViewComponent, { varsResolver } from './ResourcesMonthView.vue'\nimport type { ResourcesMonthViewFactory } from './ResourcesMonthView.types'\nimport classes from './ResourcesMonthView.module.css'\n\nexport const ResourcesMonthView = factory<ResourcesMonthViewFactory>(ResourcesMonthViewComponent, {\n classes,\n varsResolver,\n})\n\nexport type {\n ResourcesMonthViewCssVariables,\n ResourcesMonthViewDayClickData,\n ResourcesMonthViewEmits,\n ResourcesMonthViewFactory,\n ResourcesMonthViewOwnProps,\n ResourcesMonthViewOwnStylesNames,\n ResourcesMonthViewProps,\n ResourcesMonthViewSlots,\n ResourcesMonthViewStylesNames,\n} from './ResourcesMonthView.types'\n",".root {\n height: 100%;\n}\n","<script lang=\"ts\">\nimport type { ResourcesScheduleOwnProps } from './ResourcesSchedule.types'\n\nconst defaultProps = {\n defaultView: 'day',\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n} satisfies Partial<ResourcesScheduleOwnProps>\n\nexport { defaultProps }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, useAttrs, useSlots } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport type { DateStringValue, ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport { ResourcesDayView } from '../ResourcesDayView'\nimport { ResourcesMonthView } from '../ResourcesMonthView'\nimport { ResourcesWeekView } from '../ResourcesWeekView'\nimport { resolveEventRenderers } from '../shared'\nimport type {\n ResourcesScheduleEmits,\n ResourcesScheduleSlots,\n ResourcesScheduleViewLevel,\n} from './ResourcesSchedule.types'\nimport classes from './ResourcesSchedule.module.css'\n\ndefineOptions({\n name: 'ResourcesSchedule',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesScheduleOwnProps>(), {\n date: undefined,\n defaultDate: undefined,\n onDateChange: undefined,\n view: undefined,\n defaultView: undefined,\n onViewChange: undefined,\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n renderEventBody: undefined,\n renderResourceLabel: undefined,\n onEventDrop: undefined,\n canDragEvent: undefined,\n onEventDragStart: undefined,\n onEventDragEnd: undefined,\n onTimeSlotClick: undefined,\n onDayClick: undefined,\n onEventClick: undefined,\n onSlotDragEnd: undefined,\n mode: undefined,\n onExternalEventDrop: undefined,\n onEventResize: undefined,\n canResizeEvent: undefined,\n withInteractiveBackgroundEvents: undefined,\n recurrenceExpansionLimit: undefined,\n dayViewProps: undefined,\n weekViewProps: undefined,\n monthViewProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesScheduleSlots>()\n\nconst emit = defineEmits<ResourcesScheduleEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('ResourcesSchedule', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesSchedule',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n})\n\nconst [currentDate, setCurrentDate] = useUncontrolled<DateStringValue>({\n value: () => (props.date === undefined ? undefined : toDateString(props.date)),\n defaultValue: toDateString(props.defaultDate ?? dayjs()),\n onChange: (value) => {\n emit('update:date', value)\n emit('dateChange', value)\n },\n})\n\nconst [currentView, setCurrentView] = useUncontrolled<ResourcesScheduleViewLevel>({\n value: () => props.view,\n defaultValue: props.defaultView,\n finalValue: 'day',\n onChange: (value) => {\n emit('update:view', value)\n emit('viewChange', value)\n },\n})\n\n/** The views offer a year level that this component does not support, so it is ignored. */\nconst changeView = (view: ScheduleViewLevel) => {\n if (view === 'day' || view === 'week' || view === 'month') {\n setCurrentView(view)\n }\n}\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst eventRenderers = computed(() =>\n resolveEventRenderers({ renderEventBody: props.renderEventBody }, slots),\n)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst sharedProps = computed(() => ({\n resources: props.resources,\n date: currentDate.value,\n events: props.events,\n locale: props.locale,\n radius: props.radius,\n labels: props.labels,\n mode: props.mode,\n renderResourceLabel: props.renderResourceLabel,\n withEventsDragAndDrop: isStatic.value ? false : props.withEventsDragAndDrop,\n canDragEvent: props.canDragEvent,\n withDragSlotSelect: props.withDragSlotSelect,\n recurrenceExpansionLimit: props.recurrenceExpansionLimit,\n withInteractiveBackgroundEvents: isStatic.value ? false : props.withInteractiveBackgroundEvents,\n onDateChange: setCurrentDate,\n onViewChange: changeView,\n onEventDrop: (data: any) => emit('eventDrop', data),\n onEventDragStart: (event: any) => emit('eventDragStart', event),\n onEventDragEnd: () => emit('eventDragEnd'),\n onEventClick: (event: any, nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n onSlotDragEnd: (data: any) => emit('slotDragEnd', data),\n onExternalEventDrop: (data: any) => emit('externalEventDrop', data),\n ...eventRenderers.value,\n ...stylesApi.value,\n}))\n\nconst timeViewProps = computed(() => ({\n onTimeSlotClick: (data: any) => emit('timeSlotClick', data),\n withEventResize: isStatic.value ? false : props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n onEventResize: (data: any) => emit('eventResize', data),\n}))\n\nconst activeView = computed(() => {\n switch (currentView.value) {\n case 'week':\n return ResourcesWeekView\n case 'month':\n return ResourcesMonthView\n default:\n return ResourcesDayView\n }\n})\n\nconst activeViewProps = computed(() => {\n switch (currentView.value) {\n case 'week':\n return { ...sharedProps.value, ...timeViewProps.value, ...props.weekViewProps }\n case 'month':\n return {\n ...sharedProps.value,\n withEventResize: isStatic.value ? false : props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n onEventResize: (data: any) => emit('eventResize', data),\n onDayClick: (data: any) => emit('dayClick', data),\n ...props.monthViewProps,\n }\n default:\n return { ...sharedProps.value, ...timeViewProps.value, ...props.dayViewProps }\n }\n})\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('root') }\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\">\n <template v-if=\"slots.corner\" #corner=\"payload\">\n <slot name=\"corner\" v-bind=\"payload\" />\n </template>\n <template v-if=\"slots.resourceLabel\" #resourceLabel=\"payload\">\n <slot name=\"resourceLabel\" v-bind=\"payload\" />\n </template>\n <template v-if=\"slots.groupLabel\" #groupLabel=\"payload\">\n <slot name=\"groupLabel\" v-bind=\"payload\" />\n </template>\n </component>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport type { ResourcesScheduleOwnProps } from './ResourcesSchedule.types'\n\nconst defaultProps = {\n defaultView: 'day',\n mode: 'default',\n recurrenceExpansionLimit: 2000,\n} satisfies Partial<ResourcesScheduleOwnProps>\n\nexport { defaultProps }\n</script>\n\n<script setup lang=\"ts\">\nimport dayjs from 'dayjs'\nimport { computed, useAttrs, useSlots } from 'vue'\nimport { Box, useProps, useStyles } from '@mantine-vue/core'\nimport { useUncontrolled } from '@mantine-vue/hooks'\nimport type { DateStringValue, ScheduleViewLevel } from '../../types'\nimport { toDateString } from '../../utils'\nimport { ResourcesDayView } from '../ResourcesDayView'\nimport { ResourcesMonthView } from '../ResourcesMonthView'\nimport { ResourcesWeekView } from '../ResourcesWeekView'\nimport { resolveEventRenderers } from '../shared'\nimport type {\n ResourcesScheduleEmits,\n ResourcesScheduleSlots,\n ResourcesScheduleViewLevel,\n} from './ResourcesSchedule.types'\nimport classes from './ResourcesSchedule.module.css'\n\ndefineOptions({\n name: 'ResourcesSchedule',\n inheritAttrs: false,\n})\n\nconst rawProps = withDefaults(defineProps<ResourcesScheduleOwnProps>(), {\n date: undefined,\n defaultDate: undefined,\n onDateChange: undefined,\n view: undefined,\n defaultView: undefined,\n onViewChange: undefined,\n events: undefined,\n locale: undefined,\n radius: undefined,\n labels: undefined,\n renderEventBody: undefined,\n renderResourceLabel: undefined,\n onEventDrop: undefined,\n canDragEvent: undefined,\n onEventDragStart: undefined,\n onEventDragEnd: undefined,\n onTimeSlotClick: undefined,\n onDayClick: undefined,\n onEventClick: undefined,\n onSlotDragEnd: undefined,\n mode: undefined,\n onExternalEventDrop: undefined,\n onEventResize: undefined,\n canResizeEvent: undefined,\n withInteractiveBackgroundEvents: undefined,\n recurrenceExpansionLimit: undefined,\n dayViewProps: undefined,\n weekViewProps: undefined,\n monthViewProps: undefined,\n classNames: undefined,\n styles: undefined,\n vars: undefined,\n})\n\ndefineSlots<ResourcesScheduleSlots>()\n\nconst emit = defineEmits<ResourcesScheduleEmits>()\n\nconst slots = useSlots()\nconst attrs = useAttrs()\n\nconst props = useProps('ResourcesSchedule', defaultProps, rawProps)\n\nconst getStyles = useStyles({\n name: 'ResourcesSchedule',\n props,\n classes,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n})\n\nconst [currentDate, setCurrentDate] = useUncontrolled<DateStringValue>({\n value: () => (props.date === undefined ? undefined : toDateString(props.date)),\n defaultValue: toDateString(props.defaultDate ?? dayjs()),\n onChange: (value) => {\n emit('update:date', value)\n emit('dateChange', value)\n },\n})\n\nconst [currentView, setCurrentView] = useUncontrolled<ResourcesScheduleViewLevel>({\n value: () => props.view,\n defaultValue: props.defaultView,\n finalValue: 'day',\n onChange: (value) => {\n emit('update:view', value)\n emit('viewChange', value)\n },\n})\n\n/** The views offer a year level that this component does not support, so it is ignored. */\nconst changeView = (view: ScheduleViewLevel) => {\n if (view === 'day' || view === 'week' || view === 'month') {\n setCurrentView(view)\n }\n}\n\nconst isStatic = computed(() => props.mode === 'static')\n\nconst eventRenderers = computed(() =>\n resolveEventRenderers({ renderEventBody: props.renderEventBody }, slots),\n)\n\nconst stylesApi = computed(() => ({\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n}))\n\nconst sharedProps = computed(() => ({\n resources: props.resources,\n date: currentDate.value,\n events: props.events,\n locale: props.locale,\n radius: props.radius,\n labels: props.labels,\n mode: props.mode,\n renderResourceLabel: props.renderResourceLabel,\n withEventsDragAndDrop: isStatic.value ? false : props.withEventsDragAndDrop,\n canDragEvent: props.canDragEvent,\n withDragSlotSelect: props.withDragSlotSelect,\n recurrenceExpansionLimit: props.recurrenceExpansionLimit,\n withInteractiveBackgroundEvents: isStatic.value ? false : props.withInteractiveBackgroundEvents,\n onDateChange: setCurrentDate,\n onViewChange: changeView,\n onEventDrop: (data: any) => emit('eventDrop', data),\n onEventDragStart: (event: any) => emit('eventDragStart', event),\n onEventDragEnd: () => emit('eventDragEnd'),\n onEventClick: (event: any, nativeEvent: MouseEvent) => emit('eventClick', event, nativeEvent),\n onSlotDragEnd: (data: any) => emit('slotDragEnd', data),\n onExternalEventDrop: (data: any) => emit('externalEventDrop', data),\n ...eventRenderers.value,\n ...stylesApi.value,\n}))\n\nconst timeViewProps = computed(() => ({\n onTimeSlotClick: (data: any) => emit('timeSlotClick', data),\n withEventResize: isStatic.value ? false : props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n onEventResize: (data: any) => emit('eventResize', data),\n}))\n\nconst activeView = computed(() => {\n switch (currentView.value) {\n case 'week':\n return ResourcesWeekView\n case 'month':\n return ResourcesMonthView\n default:\n return ResourcesDayView\n }\n})\n\nconst activeViewProps = computed(() => {\n switch (currentView.value) {\n case 'week':\n return { ...sharedProps.value, ...timeViewProps.value, ...props.weekViewProps }\n case 'month':\n return {\n ...sharedProps.value,\n withEventResize: isStatic.value ? false : props.withEventResize,\n canResizeEvent: props.canResizeEvent,\n onEventResize: (data: any) => emit('eventResize', data),\n onDayClick: (data: any) => emit('dayClick', data),\n ...props.monthViewProps,\n }\n default:\n return { ...sharedProps.value, ...timeViewProps.value, ...props.dayViewProps }\n }\n})\n</script>\n\n<template>\n <Box v-bind=\"{ ...attrs, ...getStyles('root') }\">\n <component :is=\"activeView\" v-bind=\"activeViewProps\">\n <template v-if=\"slots.corner\" #corner=\"payload\">\n <slot name=\"corner\" v-bind=\"payload\" />\n </template>\n <template v-if=\"slots.resourceLabel\" #resourceLabel=\"payload\">\n <slot name=\"resourceLabel\" v-bind=\"payload\" />\n </template>\n <template v-if=\"slots.groupLabel\" #groupLabel=\"payload\">\n <slot name=\"groupLabel\" v-bind=\"payload\" />\n </template>\n </component>\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport ResourcesScheduleComponent from './ResourcesSchedule.vue'\nimport type { ResourcesScheduleFactory } from './ResourcesSchedule.types'\nimport classes from './ResourcesSchedule.module.css'\n\nexport const ResourcesSchedule = factory<ResourcesScheduleFactory>(ResourcesScheduleComponent, {\n classes,\n})\n\nexport type {\n ResourcesScheduleEmits,\n ResourcesScheduleFactory,\n ResourcesScheduleOwnProps,\n ResourcesScheduleOwnStylesNames,\n ResourcesScheduleProps,\n ResourcesScheduleSlots,\n ResourcesScheduleStylesNames,\n ResourcesScheduleViewLevel,\n ResourcesScheduleViewProps,\n} from './ResourcesSchedule.types'\n"],"mappings":";;;;;;;AA0BA,IAAa,0BAA0C;CACrD,OAAO;CACP,MAAM;CACN,UAAU;CACV,MAAM;CACN,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACR,SAAS;CACT,UAAU;CACV,aAAa;CACb,YAAY;CACZ,iBAAiB;CACjB,kBAAkB;CAClB,mBAAmB;CACnB,kBAAkB;CAClB,iBAAiB;CACjB,UAAU;CACV,YAAY,sBAA8B,IAAI,kBAAkB;CAChE,UAAU;CACV,WAAW;CACX,cAAc;AAChB;AAIA,SAAgB,SACd,KACA,UACmB;CACnB,IAAI,UACF,OAAO;EAAE,GAAG;EAAyB,GAAG;CAAS,EAAE;C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