mood-ui 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-display/calendar/AgendaView.cjs.map +1 -1
- package/dist/components/data-display/calendar/AgendaView.mjs.map +1 -1
- package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs +11 -6
- package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs +18 -13
- package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/Calendar.vue_vue_type_script_setup_true_lang.mjs +4 -4
- package/dist/components/data-display/calendar/Calendar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/DayView.cjs.map +1 -1
- package/dist/components/data-display/calendar/DayView.mjs.map +1 -1
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs +14 -9
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs +22 -17
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/MonthView.cjs +1 -1
- package/dist/components/data-display/calendar/MonthView.cjs.map +1 -1
- package/dist/components/data-display/calendar/MonthView.mjs +1 -1
- package/dist/components/data-display/calendar/MonthView.mjs.map +1 -1
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs +15 -17
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs +18 -20
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/Scheduler.cjs.map +1 -1
- package/dist/components/data-display/calendar/Scheduler.mjs.map +1 -1
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs +14 -9
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs +22 -17
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/WeekView.cjs.map +1 -1
- package/dist/components/data-display/calendar/WeekView.mjs.map +1 -1
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs +14 -9
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs +22 -17
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.cjs.map +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.mjs.map +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/Banner.vue_vue_type_script_setup_true_lang.mjs +4 -4
- package/dist/components/feedback/Banner.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/Drawer.cjs.map +1 -1
- package/dist/components/feedback/Drawer.mjs.map +1 -1
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs +4 -9
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs +9 -14
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/Modal.cjs.map +1 -1
- package/dist/components/feedback/Modal.mjs.map +1 -1
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs +4 -9
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs +9 -14
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/Tooltip.cjs.map +1 -1
- package/dist/components/feedback/Tooltip.mjs.map +1 -1
- package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs +44 -17
- package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs +44 -17
- package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/Combobox.cjs.map +1 -1
- package/dist/components/forms/Combobox.mjs.map +1 -1
- package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/PhoneInput.cjs.map +1 -1
- package/dist/components/forms/PhoneInput.mjs.map +1 -1
- package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs +6 -1
- package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs +6 -1
- package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/SearchInput.cjs.map +1 -1
- package/dist/components/forms/SearchInput.mjs.map +1 -1
- package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs +8 -6
- package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs +8 -6
- package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/layout/PopoverPanel.cjs +1 -1
- package/dist/components/layout/PopoverPanel.cjs.map +1 -1
- package/dist/components/layout/PopoverPanel.mjs +1 -1
- package/dist/components/layout/PopoverPanel.mjs.map +1 -1
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/navigation/Switcher.cjs.map +1 -1
- package/dist/components/navigation/Switcher.mjs.map +1 -1
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs +38 -40
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs +38 -40
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/composables/eventColors.cjs +51 -27
- package/dist/composables/eventColors.cjs.map +1 -1
- package/dist/composables/eventColors.mjs +51 -27
- package/dist/composables/eventColors.mjs.map +1 -1
- package/dist/composables/useBodyScrollLock.cjs +44 -0
- package/dist/composables/useBodyScrollLock.cjs.map +1 -0
- package/dist/composables/useBodyScrollLock.mjs +43 -0
- package/dist/composables/useBodyScrollLock.mjs.map +1 -0
- package/dist/composables/useCalendarTheme.cjs +29 -8
- package/dist/composables/useCalendarTheme.cjs.map +1 -1
- package/dist/composables/useCalendarTheme.mjs +29 -8
- package/dist/composables/useCalendarTheme.mjs.map +1 -1
- package/dist/composables/usePopover.cjs +44 -12
- package/dist/composables/usePopover.cjs.map +1 -1
- package/dist/composables/usePopover.mjs +44 -12
- package/dist/composables/usePopover.mjs.map +1 -1
- package/dist/mood-ui.css +9 -9
- package/dist/types/composables/eventColors.d.ts +2 -2
- package/dist/types/composables/useBodyScrollLock.d.ts +19 -0
- package/dist/types/composables/useCalendarTheme.d.ts +2 -0
- package/dist/types/interfaces/data-display/calendar/AgendaView.interface.d.ts +5 -0
- package/dist/types/interfaces/data-display/calendar/DayView.interface.d.ts +5 -0
- package/dist/types/interfaces/data-display/calendar/MonthView.interface.d.ts +5 -0
- package/dist/types/interfaces/data-display/calendar/Scheduler.interface.d.ts +5 -0
- package/dist/types/interfaces/data-display/calendar/WeekView.interface.d.ts +5 -0
- package/dist/types/utils/calendarTooltip.d.ts +13 -0
- package/dist/types/utils/cssLength.d.ts +5 -0
- package/dist/types/utils/tooltipArrow.d.ts +34 -0
- package/dist/utils/calendarTooltip.cjs +18 -0
- package/dist/utils/calendarTooltip.cjs.map +1 -0
- package/dist/utils/calendarTooltip.mjs +18 -0
- package/dist/utils/calendarTooltip.mjs.map +1 -0
- package/dist/utils/cssLength.cjs +13 -0
- package/dist/utils/cssLength.cjs.map +1 -0
- package/dist/utils/cssLength.mjs +13 -0
- package/dist/utils/cssLength.mjs.map +1 -0
- package/dist/utils/tooltipArrow.cjs +37 -0
- package/dist/utils/tooltipArrow.cjs.map +1 -0
- package/dist/utils/tooltipArrow.mjs +36 -0
- package/dist/utils/tooltipArrow.mjs.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthView.mjs","names":[],"sources":["../../../../src/components/data-display/calendar/MonthView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['flex flex-col bg-card overflow-hidden focus:outline-none', containerRadiusClass, bordered ? 'border border-border' : '']\" \n @keydown=\"handleKeydown\" \n > \n <slot name=\"header\" :monthLabel=\"monthLabel\" :year=\"currentYear\" :goToToday=\"handleToday\" :prev=\"handlePrevMonth\" :next=\"handleNextMonth\"> \n <CalendarHeader \n :label=\"`${monthLabel} ${currentYear}`\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearJump\" \n :showTodayButton=\"true\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :isMonthDisabled=\"(i: number) => isMonthDisabled(i, currentYear)\" \n :isPrevMonthDisabled=\"false\" \n :isPrevDisabled=\"isPrevMonthDisabled\" \n :isNextDisabled=\"isNextMonthDisabled\" \n :isPrevYearDisabled=\"isPrevYearDisabled\" \n :isNextYearDisabled=\"isNextYearDisabled\" \n :useFocusRingForToday=\"true\" \n prevLabel=\"Previous month\" \n nextLabel=\"Next month\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrevMonth\" \n @next=\"handleNextMonth\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div class=\"grid border-b border-border\" :style=\"gridTemplateColumns\"> \n <div v-if=\"showWeekNumbers\" class=\"px-2 py-2 text-center text-xs font-medium text-muted-foreground border-r border-border\"> \n # \n </div> \n <div \n v-for=\"(label, i) in weekDayLabels\" \n :key=\"i\" \n :class=\"[ \n 'px-2 py-2 text-center text-xs font-medium tracking-wide truncate', \n dayNameCaseClass, \n highlightWeekends && isWeekendCol(i) ? 'text-rose-500' : 'text-muted-foreground', \n ]\" \n > \n {{ label }} \n </div> \n </div> \n \n <div ref=\"gridRef\" class=\"flex-1 flex flex-col\"> \n <div \n v-for=\"(week, wIdx) in weeksData\" \n :key=\"wIdx\" \n class=\"flex-1 flex min-h-24 relative border-t border-border first:border-t-0\" \n > \n <div \n v-if=\"showWeekNumbers\" \n class=\"w-10 shrink-0 px-2 py-1 flex items-start justify-center text-xs font-medium text-muted-foreground border-r border-border\" \n > \n {{ getWeekNumber(week.days[0].date) }} \n </div> \n \n <div class=\"flex-1 relative grid grid-cols-7\"> \n <div \n v-for=\"(day, dIdx) in week.days\" \n :key=\"day.date.toISOString()\" \n :tabindex=\"keyboardNavigation && day.date.getTime() === focusedDate.getTime() ? 0 : -1\"\n :ref=\"(el: unknown) => setDayRef(day.date, el as HTMLElement | null)\"\n :data-day-key=\"day.date.toDateString()\"\n @click=\"handleDayClick(day, $event)\"\n @dblclick=\"handleDayDblClick(day, $event)\"\n @focus=\"keyboardNavigation && (focusedDate = day.date)\"\n @dragover.prevent=\"onDragOver(day, $event)\"\n @drop.prevent=\"onDrop(day, $event)\" \n :class=\"[ \n 'relative flex flex-col border-l border-border first:border-l-0 transition-colors focus:outline-none', \n day.isOutside ? 'bg-muted/50' : 'bg-card', \n day.disabled \n ? 'cursor-not-allowed bg-muted text-muted-foreground month-disabled-day' \n : 'cursor-pointer hover:bg-muted', \n highlightWeekends && isWeekendCol(dIdx) && !day.isOutside && !day.disabled ? 'bg-rose-50/40' : '', \n dragOverKey === day.date.toDateString() ? dropTargetBgClass : '', \n ]\" \n > \n <div \n v-if=\"keyboardNavigation && day.date.getTime() === focusedDate.getTime()\" \n :class=\"['absolute inset-0 pointer-events-none z-30 ring-2 ring-inset', focusRingColorClass]\" \n ></div> \n <slot name=\"day\" :day=\"day\" :events=\"eventsForDay(day.date)\"> \n <div class=\"flex items-center justify-end px-1.5 pt-1 pb-0.5 h-7\"> \n <span \n :class=\"[ \n 'inline-flex items-center justify-center text-xs font-medium w-6 h-6', \n day.isToday ? [todayBgClass, pillRadiusClass] : '', \n !day.isToday && day.isOutside ? 'text-muted-foreground/40' : '', \n !day.isToday && !day.isOutside ? 'text-foreground/80' : '', \n ]\" \n > \n {{ day.day }} \n </span> \n </div> \n \n <div class=\"flex-1\" :style=\"{ paddingBottom: `${visibleLanes * laneHeight + (week.overflow[dIdx] > 0 ? 18 : 0)}px` }\"></div> \n \n <button \n v-if=\"week.overflow[dIdx] > 0\" \n type=\"button\" \n @click.stop=\"handleMoreClick(day.date, $event)\" \n class=\"absolute left-1.5 right-1.5 text-left text-[11px] text-muted-foreground hover:text-foreground font-medium px-1 py-0.5 cursor-pointer focus:outline-none z-20\" \n :style=\"{ bottom: '2px' }\" \n > \n + {{ week.overflow[dIdx] }} more \n </button> \n </slot> \n </div> \n \n <div\n v-for=\"seg in week.visibleSegments\"\n :key=\"seg.key\"\n :draggable=\"draggableEvents && !seg.event.allDay ? true : draggableEvents\"\n @dragstart=\"onDragStart(seg.event, $event)\"\n @dragend=\"onDragEnd\"\n @click.stop=\"handleEventClick(seg.event, $event)\"\n @mouseenter=\"onEventEnter(seg.event, !!seg.event.allDay, $event)\"\n @mousemove=\"onEventMove\"\n @mouseleave=\"onEventLeave\"\n @touchstart.passive=\"draggableEvents && onEventTouchStart(seg.event, $event)\"\n @touchmove=\"draggableEvents && onEventTouchMove($event)\"\n @touchend.passive=\"draggableEvents && onEventTouchEnd($event)\"\n @touchcancel.passive=\"onTouchDragCancel\" \n :style=\"{ \n left: `calc(${(seg.startCol / 7) * 100}% + 4px)`, \n width: `calc(${(seg.span / 7) * 100}% - 8px)`, \n top: `${28 + seg.lane * laneHeight}px`, \n height: `${laneHeight - 2}px`, \n }\" \n :class=\"[ \n 'absolute z-10 truncate text-xs px-1.5 flex items-center cursor-pointer transition-opacity hover:opacity-80 select-none', \n eventRadiusClass, \n draggableEvents ? 'cursor-grab active:cursor-grabbing' : '', \n eventColorClass(seg.event.color), \n draggingId === seg.event.id ? 'opacity-50' : '', \n ]\" \n > \n <slot name=\"event\" :event=\"seg.event\" :segment=\"seg\"> \n <span v-if=\"!seg.event.allDay && seg.isFirst\" class=\"font-semibold mr-1\"> \n {{ formatEventTime(seg.event.start) }} \n </span> \n <span class=\"truncate\">{{ seg.event.title }}</span> \n </slot> \n </div> \n </div> \n </div> \n </div> \n \n <CalendarEventTooltip :state=\"hoverState\" :style=\"tooltipStyle\" :formatTime=\"formatEventTime\"> \n <template #default=\"{ event, allDay }\"> \n <slot name=\"event-tooltip\" :event=\"event\" :allDay=\"allDay\" /> \n </template> \n </CalendarEventTooltip> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { ref, computed, watch, nextTick } from 'vue'; \nimport gsap from 'gsap'; \nimport { useCalendar, startOfDay, type CalendarDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport { useResolvedColor, useResolvedRadius } from '../../../composables/useModoConfig'; \nimport { eventColorClassStrong as eventColorClass } from '../../../composables/eventColors'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { MonthView, CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nconst props = withDefaults(defineProps<MonthView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n firstDayOfWeek: 0, \n color: 'default', \n maxEventsPerDay: 3, \n showWeekNumbers: false, \n fixedWeeks: true, \n showHeader: true, \n bordered: true, \n keyboardNavigation: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n highlightWeekends: false, \n showOutsideDays: true, \n showMonthYearSelects: true, \n showYearJump: true, \n draggableEvents: true, \n laneHeight: 22, \n}); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [date: Date]; \n 'event-click': [event: CalendarEvent, nativeEvent: MouseEvent]; \n 'day-click': [date: Date, events: CalendarEvent[], nativeEvent: MouseEvent]; \n 'more-click': [date: Date, events: CalendarEvent[], nativeEvent: MouseEvent]; \n 'create-event': [date: Date, nativeEvent: MouseEvent | KeyboardEvent]; \n 'event-drop': [event: CalendarEvent, newStart: Date, newEnd: Date | undefined]; \n}>(); \n \nconst currentDate = ref(new Date(props.modelValue)); \nconst focusedDate = ref(startOfDay(new Date(props.modelValue))); \nwatch(() => props.modelValue, (v) => { if (v) { currentDate.value = new Date(v); focusedDate.value = startOfDay(new Date(v)); } }); \n \nconst modelRef = computed({ \n get: () => currentDate.value, \n set: (v) => { currentDate.value = v; }, \n}); \n \nconst localeRef = computed(() => props.locale); \nconst firstDowRef = computed(() => props.firstDayOfWeek); \nconst fixedWeeksRef = computed(() => props.fixedWeeks); \nconst minDateRef = computed(() => props.minDate); \nconst maxDateRef = computed(() => props.maxDate); \nconst weekdayFormatRef = computed(() => props.dayNameFormat); \nconst showOutsideRef = computed(() => props.showOutsideDays); \nconst disabledDatesRef = computed(() => props.disabledDates); \nconst disabledDowRef = computed(() => props.disabledDaysOfWeek); \n \nconst { \n currentMonth, \n currentYear, \n monthLabel, \n weekDayLabels, \n calendarDays, \n prevMonth, \n nextMonth, \n prevYear, \n nextYear, \n goToToday, \n} = useCalendar({ \n modelValue: modelRef as unknown as import('vue').Ref<Date | null | undefined>, \n locale: localeRef, \n firstDayOfWeek: firstDowRef, \n fixedWeeks: fixedWeeksRef, \n minDate: minDateRef, \n maxDate: maxDateRef, \n disabledDates: disabledDatesRef, \n disabledDaysOfWeek: disabledDowRef, \n weekdayFormat: weekdayFormatRef, \n showOutsideDays: showOutsideRef, \n}); \n \nconst gridRef = ref<HTMLElement | null>(null); \nconst rootRef = ref<HTMLElement | null>(null); \nconst dayRefs = ref<Map<string, HTMLElement>>(new Map()); \nconst setDayRef = (date: Date, el: HTMLElement | null) => { \n const k = date.toDateString(); \n if (el) dayRefs.value.set(k, el); \n else dayRefs.value.delete(k); \n}; \n \nconst selectedMonth = computed({ \n get: () => currentMonth.value, \n set: (v: number) => { const dir = v > currentMonth.value ? 1 : -1; currentMonth.value = v; nextTick(() => animateChange(dir)); }, \n}); \nconst selectedYear = computed({ \n get: () => currentYear.value, \n set: (v: number) => { const dir = v > currentYear.value ? 1 : -1; currentYear.value = v; nextTick(() => animateChange(dir)); }, \n}); \n \nconst monthOptions = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n return Array.from({ length: 12 }, (_, i) => \n new Date(2024, i, 1).toLocaleString(locale, { month: 'long' }) \n ); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minYear ?? (props.minDate ? props.minDate.getFullYear() : currentYear.value - 10); \n const max = props.maxYear ?? (props.maxDate ? props.maxDate.getFullYear() : currentYear.value + 10); \n const out: number[] = []; \n for (let y = min; y <= max; y++) out.push(y); \n if (!out.includes(currentYear.value)) out.push(currentYear.value); \n return out.sort((a, b) => a - b); \n}); \n \nconst gridTemplateColumns = computed(() => { \n if (props.showWeekNumbers) return { gridTemplateColumns: '2.5rem repeat(7, minmax(0, 1fr))' }; \n return { gridTemplateColumns: 'repeat(7, minmax(0, 1fr))' }; \n}); \n \nconst isWeekendCol = (colIdx: number) => { \n const dow = (props.firstDayOfWeek + colIdx) % 7; \n return dow === 0 || dow === 6; \n}; \n \nconst getWeekNumber = (date: Date) => { \n const target = new Date(date.valueOf()); \n const dayNr = (date.getDay() + 6) % 7; \n target.setDate(target.getDate() - dayNr + 3); \n const firstThursday = target.valueOf(); \n target.setMonth(0, 1); \n if (target.getDay() !== 4) { \n target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7); \n } \n return 1 + Math.ceil((firstThursday - target.valueOf()) / 604800000); \n}; \n \nconst lastDayOfMonth = (y: number, mo: number) => new Date(y, mo + 1, 0); \nconst firstDayOfMonth = (y: number, mo: number) => new Date(y, mo, 1); \n \nconst isMonthDisabled = (month: number, year: number) => { \n const min = props.minDate; \n const max = props.maxDate; \n const end = lastDayOfMonth(year, month); \n const start = firstDayOfMonth(year, month); \n if (min && end < startOfDay(min)) return true; \n if (max && start > startOfDay(max)) return true; \n return false; \n}; \n \nconst isPrevMonthDisabled = computed(() => { \n if (!props.minDate) return false; \n const prev = new Date(currentYear.value, currentMonth.value, 0); \n return prev < startOfDay(props.minDate); \n}); \nconst isNextMonthDisabled = computed(() => { \n if (!props.maxDate) return false; \n const next = new Date(currentYear.value, currentMonth.value + 1, 1); \n return next > startOfDay(props.maxDate); \n}); \nconst isPrevYearDisabled = computed(() => { \n if (props.minYear !== undefined && currentYear.value <= props.minYear) return true; \n if (props.minDate && new Date(currentYear.value - 1, 11, 31) < startOfDay(props.minDate)) return true; \n return false; \n}); \nconst isNextYearDisabled = computed(() => { \n if (props.maxYear !== undefined && currentYear.value >= props.maxYear) return true; \n if (props.maxDate && new Date(currentYear.value + 1, 0, 1) > startOfDay(props.maxDate)) return true; \n return false; \n}); \n \ninterface EventSegment { \n key: string; \n event: CalendarEvent; \n startCol: number; \n span: number; \n lane: number; \n isFirst: boolean; \n} \n \ninterface WeekData { \n days: CalendarDay[]; \n visibleSegments: EventSegment[]; \n overflow: number[]; \n} \n \nconst visibleLanes = computed(() => props.maxEventsPerDay); \n \nconst dayMs = 86400000; \n \nconst getEventDayRange = (ev: CalendarEvent) => { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n return { s, e }; \n}; \n \nconst weeksData = computed<WeekData[]>(() => { \n const days = calendarDays.value; \n const weeks: CalendarDay[][] = []; \n for (let i = 0; i < days.length; i += 7) weeks.push(days.slice(i, i + 7)); \n \n const sortedEvents = [...props.events].sort((a, b) => { \n const aLen = (a.end ? startOfDay(a.end).getTime() : startOfDay(a.start).getTime()) - startOfDay(a.start).getTime(); \n const bLen = (b.end ? startOfDay(b.end).getTime() : startOfDay(b.start).getTime()) - startOfDay(b.start).getTime(); \n if (bLen !== aLen) return bLen - aLen; \n return a.start.getTime() - b.start.getTime(); \n }); \n \n return weeks.map((weekDays) => { \n const weekStart = startOfDay(weekDays[0].date); \n const weekEnd = startOfDay(weekDays[6].date); \n \n const segs: Omit<EventSegment, 'key'>[] = []; \n const lanesTaken: Set<number>[] = Array.from({ length: 7 }, () => new Set()); \n \n const weekEvents = sortedEvents.filter(ev => { \n const { s, e } = getEventDayRange(ev); \n return e.getTime() >= weekStart.getTime() && s.getTime() <= weekEnd.getTime(); \n }); \n \n for (const ev of weekEvents) { \n const { s, e } = getEventDayRange(ev); \n const segStart = s.getTime() < weekStart.getTime() ? weekStart : s; \n const segEnd = e.getTime() > weekEnd.getTime() ? weekEnd : e; \n const startCol = Math.round((segStart.getTime() - weekStart.getTime()) / dayMs); \n const span = Math.round((segEnd.getTime() - segStart.getTime()) / dayMs) + 1; \n \n let lane = 0; \n while (true) { \n let ok = true; \n for (let c = startCol; c < startCol + span; c++) { \n if (lanesTaken[c].has(lane)) { ok = false; break; } \n } \n if (ok) break; \n lane++; \n } \n for (let c = startCol; c < startCol + span; c++) lanesTaken[c].add(lane); \n \n segs.push({ \n event: ev, \n startCol, \n span, \n lane, \n isFirst: s.getTime() >= weekStart.getTime(), \n }); \n } \n \n const visibleSegments: EventSegment[] = segs \n .filter(s => s.lane < visibleLanes.value) \n .map(s => ({ ...s, key: `${s.event.id}-${s.startCol}` })); \n \n const overflow = Array.from({ length: 7 }, (_, c) => { \n let count = 0; \n for (const s of segs) { \n if (s.lane >= visibleLanes.value && c >= s.startCol && c < s.startCol + s.span) count++; \n } \n return count; \n }); \n \n return { days: weekDays, visibleSegments, overflow }; \n }); \n}); \n \nconst eventsForDay = (date: Date): CalendarEvent[] => { \n return props.events \n .filter(ev => { \n const { s, e } = getEventDayRange(ev); \n const d0 = startOfDay(date).getTime(); \n return d0 >= s.getTime() && d0 <= e.getTime(); \n }) \n .sort((a, b) => { \n if (a.allDay && !b.allDay) return -1; \n if (!a.allDay && b.allDay) return 1; \n return a.start.getTime() - b.start.getTime(); \n }); \n}; \n \nconst formatEventTime = (d: Date) => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n return d.toLocaleTimeString(locale, { hour: '2-digit', minute: '2-digit' }); \n}; \n \nconst animateChange = (direction: 1 | -1) => { \n if (!gridRef.value) return; \n gsap.fromTo( \n gridRef.value, \n { opacity: 0, x: 20 * direction }, \n { opacity: 1, x: 0, duration: 0.25, ease: 'power2.out' } \n ); \n}; \n \nconst handlePrevMonth = () => { prevMonth(); nextTick(() => animateChange(-1)); }; \nconst handleNextMonth = () => { nextMonth(); nextTick(() => animateChange(1)); }; \nconst handlePrevYear = () => { prevYear(); nextTick(() => animateChange(-1)); }; \nconst handleNextYear = () => { nextYear(); nextTick(() => animateChange(1)); }; \nconst handleToday = () => { \n const now = goToToday(); \n currentDate.value = now; \n focusedDate.value = startOfDay(now); \n emit('update:modelValue', now); \n nextTick(() => animateChange(1)); \n}; \n \nconst clickTimer = ref<ReturnType<typeof setTimeout> | null>(null); \nconst DOUBLE_CLICK_DELAY = 220; \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \n \nconst handleDayClick = (day: CalendarDay, e: MouseEvent) => { \n if (day.disabled) return; \n currentDate.value = day.date; \n focusedDate.value = startOfDay(day.date); \n emit('update:modelValue', day.date); \n if (clickTimer.value) clearTimeout(clickTimer.value); \n clickTimer.value = setTimeout(() => { \n emit('day-click', day.date, eventsForDay(day.date), e); \n clickTimer.value = null; \n }, DOUBLE_CLICK_DELAY); \n}; \n \nconst handleDayDblClick = (day: CalendarDay, e: MouseEvent) => { \n if (day.disabled) return; \n if (clickTimer.value) { clearTimeout(clickTimer.value); clickTimer.value = null; } \n emit('create-event', day.date, e); \n}; \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => emit('event-click', ev, e); \nconst handleMoreClick = (date: Date, e: MouseEvent) => emit('more-click', date, eventsForDay(date), e); \n \nconst draggingId = ref<string | number | null>(null);\nconst dragOverKey = ref<string | null>(null);\n\nconst onDragStart = (ev: CalendarEvent, e: DragEvent) => {\n if (!props.draggableEvents) return;\n draggingId.value = ev.id;\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', String(ev.id));\n }\n};\nconst onDragEnd = () => {\n draggingId.value = null;\n dragOverKey.value = null;\n};\nconst onDragOver = (day: CalendarDay, e: DragEvent) => {\n if (!props.draggableEvents || draggingId.value === null) return;\n if (day.disabled) { if (e.dataTransfer) e.dataTransfer.dropEffect = 'none'; return; }\n if (e.dataTransfer) e.dataTransfer.dropEffect = 'move';\n dragOverKey.value = day.date.toDateString();\n};\nconst onDrop = (day: CalendarDay, _e: DragEvent) => {\n if (!props.draggableEvents || draggingId.value === null) return;\n if (day.disabled) { onDragEnd(); return; }\n const ev = props.events.find(e => e.id === draggingId.value);\n if (!ev) { onDragEnd(); return; }\n const oldStart = startOfDay(ev.start);\n const diff = startOfDay(day.date).getTime() - oldStart.getTime();\n const newStart = new Date(ev.start.getTime() + diff);\n const newEnd = ev.end ? new Date(ev.end.getTime() + diff) : undefined;\n emit('event-drop', ev, newStart, newEnd);\n onDragEnd();\n};\n\n/* ---------- Touch drag (mobile — HTML5 drag API doesn't work on touch) ---------- */\n\nlet touchHoldTimer: ReturnType<typeof setTimeout> | null = null;\nlet touchDragEventId: string | number | null = null;\nconst touchDragActive = ref(false);\nlet touchDragEl: HTMLElement | null = null;\n\nconst onEventTouchStart = (ev: CalendarEvent, e: TouchEvent) => {\n touchDragEventId = ev.id;\n touchDragEl = e.currentTarget as HTMLElement;\n touchHoldTimer = setTimeout(() => {\n touchDragActive.value = true;\n draggingId.value = ev.id;\n }, 350);\n};\n\nconst onEventTouchMove = (e: TouchEvent) => {\n if (!touchDragActive.value) {\n // Touch moved before hold — cancel pending drag.\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n touchDragEventId = null;\n return;\n }\n e.preventDefault();\n const touch = e.touches[0];\n // Temporarily hide the dragged element so elementFromPoint returns the day underneath.\n if (touchDragEl) touchDragEl.style.pointerEvents = 'none';\n const target = document.elementFromPoint(touch.clientX, touch.clientY);\n if (touchDragEl) touchDragEl.style.pointerEvents = '';\n const dayEl = (target as Element | null)?.closest('[data-day-key]') as HTMLElement | null;\n dragOverKey.value = dayEl?.dataset.dayKey ?? null;\n};\n\nconst onEventTouchEnd = (e: TouchEvent) => {\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n if (!touchDragActive.value) { touchDragEventId = null; return; }\n\n const touch = e.changedTouches[0];\n if (touchDragEl) touchDragEl.style.pointerEvents = 'none';\n const target = document.elementFromPoint(touch.clientX, touch.clientY);\n if (touchDragEl) touchDragEl.style.pointerEvents = '';\n\n const dayKey = (target as Element | null)?.closest('[data-day-key]')\n ?.getAttribute('data-day-key');\n\n if (dayKey && touchDragEventId !== null) {\n for (const week of weeksData.value) {\n const day = week.days.find(d => d.date.toDateString() === dayKey);\n if (day) { onDrop(day, {} as DragEvent); break; }\n }\n }\n onTouchDragCancel();\n};\n\nconst onTouchDragCancel = () => {\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n touchDragActive.value = false;\n touchDragEventId = null;\n touchDragEl = null;\n draggingId.value = null;\n dragOverKey.value = null;\n}; \n \nconst focusDay = (date: Date) => { \n focusedDate.value = startOfDay(date); \n nextTick(() => { \n const el = dayRefs.value.get(focusedDate.value.toDateString()); \n if (el) el.focus(); \n else rootRef.value?.focus(); \n }); \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.keyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n const d = new Date(focusedDate.value); \n let handled = true; \n if (e.key === 'ArrowLeft') d.setDate(d.getDate() - 1); \n else if (e.key === 'ArrowRight') d.setDate(d.getDate() + 1); \n else if (e.key === 'ArrowUp') d.setDate(d.getDate() - 7); \n else if (e.key === 'ArrowDown') d.setDate(d.getDate() + 7); \n else if (e.key === 'Home') d.setDate(d.getDate() - ((d.getDay() - props.firstDayOfWeek + 7) % 7)); \n else if (e.key === 'End') d.setDate(d.getDate() + (6 - ((d.getDay() - props.firstDayOfWeek + 7) % 7))); \n else if (e.key === 'PageUp') d.setMonth(d.getMonth() - 1); \n else if (e.key === 'PageDown') d.setMonth(d.getMonth() + 1); \n else if (e.key === 'Enter' || e.key === ' ') { emit('day-click', focusedDate.value, eventsForDay(focusedDate.value), e as unknown as MouseEvent); handled = true; } \n else if (e.key.toLowerCase() === 'c') { emit('create-event', focusedDate.value, e); handled = true; } \n else if (e.key.toLowerCase() === 't') handleToday(); \n else handled = false; \n \n if (handled) { \n e.preventDefault(); \n if (e.key.startsWith('Arrow') || e.key === 'Home' || e.key === 'End' || e.key === 'PageUp' || e.key === 'PageDown') { \n if (d.getMonth() !== currentMonth.value || d.getFullYear() !== currentYear.value) { \n currentMonth.value = d.getMonth(); \n currentYear.value = d.getFullYear(); \n nextTick(() => animateChange(d > focusedDate.value ? 1 : -1)); \n } \n focusDay(d); \n } \n } \n}; \n \nwatch([currentMonth, currentYear], () => { \n currentDate.value = new Date(currentYear.value, currentMonth.value, 1); \n if (focusedDate.value.getMonth() !== currentMonth.value || focusedDate.value.getFullYear() !== currentYear.value) { \n const lastDay = new Date(currentYear.value, currentMonth.value + 1, 0).getDate(); \n const targetDay = Math.min(focusedDate.value.getDate(), lastDay); \n focusedDate.value = new Date(currentYear.value, currentMonth.value, targetDay); \n } \n}); \n \nconst focusGrid = () => { \n nextTick(() => { \n const el = dayRefs.value.get(focusedDate.value.toDateString()); \n if (el) el.focus(); \n else rootRef.value?.focus(); \n }); \n}; \n \ndefineExpose({ focusGrid }); \n \nconst resolvedColor = useResolvedColor(() => props.color); \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst todayBgClass = computed(() => ({ \n default: 'bg-foreground text-background', \n primary: 'bg-primary text-primary-foreground', \n danger: 'bg-destructive text-destructive-foreground', \n success: 'bg-success text-success-foreground', \n warning: 'bg-warning text-warning-foreground', \n}[resolvedColor.value] ?? 'bg-primary text-primary-foreground')); \n \nconst { \n todayTextClass, \n focusRingColorClass, \n containerRadiusClass, \n eventRadiusClass, \n pillRadiusClass, \n dayNameCaseClass, \n} = useCalendarTheme({ \n color: () => resolvedColor.value, \n radius: () => resolvedRadius.value, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst dropTargetBgClass = computed(() => ({ \n default: 'bg-muted', \n primary: 'bg-primary-subtle', \n danger: 'bg-destructive-subtle', \n success: 'bg-success-subtle', \n warning: 'bg-warning-subtle', \n}[resolvedColor.value] ?? 'bg-primary-subtle')); \n</script> \n \n<style scoped> \n.month-disabled-day { \n background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, 0.04) 6px 7px); \n} \n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"MonthView.mjs","names":[],"sources":["../../../../src/components/data-display/calendar/MonthView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['flex flex-col bg-card overflow-hidden focus:outline-none', containerRadiusClass, bordered ? 'border border-border' : '']\" \n :style=\"{ maxHeight: toCssLength(maxHeight) }\"\n @keydown=\"handleKeydown\" \n > \n <slot name=\"header\" :monthLabel=\"monthLabel\" :year=\"currentYear\" :goToToday=\"handleToday\" :prev=\"handlePrevMonth\" :next=\"handleNextMonth\"> \n <CalendarHeader \n :label=\"`${monthLabel} ${currentYear}`\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearJump\" \n :showTodayButton=\"true\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :isMonthDisabled=\"(i: number) => isMonthDisabled(i, currentYear)\" \n :isPrevMonthDisabled=\"false\" \n :isPrevDisabled=\"isPrevMonthDisabled\" \n :isNextDisabled=\"isNextMonthDisabled\" \n :isPrevYearDisabled=\"isPrevYearDisabled\" \n :isNextYearDisabled=\"isNextYearDisabled\" \n :useFocusRingForToday=\"true\" \n prevLabel=\"Previous month\" \n nextLabel=\"Next month\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrevMonth\" \n @next=\"handleNextMonth\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div class=\"grid border-b border-border\" :style=\"gridTemplateColumns\"> \n <div v-if=\"showWeekNumbers\" class=\"px-2 py-2 text-center text-xs font-medium text-muted-foreground border-r border-border\"> \n # \n </div> \n <div \n v-for=\"(label, i) in weekDayLabels\" \n :key=\"i\" \n :class=\"[ \n 'px-2 py-2 text-center text-xs font-medium tracking-wide truncate', \n dayNameCaseClass, \n highlightWeekends && isWeekendCol(i) ? 'text-rose-500' : 'text-muted-foreground', \n ]\" \n > \n {{ label }} \n </div> \n </div> \n \n <!--\n The week rows keep their `min-h-24`, so a capped `maxHeight` has to\n scroll here rather than clip against the root's `overflow-hidden`.\n With no cap there is nothing to overflow and no scrollbar appears.\n -->\n <div ref=\"gridRef\" class=\"flex-1 flex flex-col overflow-y-auto\">\n <div \n v-for=\"(week, wIdx) in weeksData\" \n :key=\"wIdx\" \n class=\"flex-1 flex min-h-24 relative border-t border-border first:border-t-0\" \n > \n <div \n v-if=\"showWeekNumbers\" \n class=\"w-10 shrink-0 px-2 py-1 flex items-start justify-center text-xs font-medium text-muted-foreground border-r border-border\" \n > \n {{ getWeekNumber(week.days[0].date) }} \n </div> \n \n <div class=\"flex-1 relative grid grid-cols-7\"> \n <div \n v-for=\"(day, dIdx) in week.days\" \n :key=\"day.date.toISOString()\" \n :tabindex=\"keyboardNavigation && day.date.getTime() === focusedDate.getTime() ? 0 : -1\"\n :ref=\"(el: unknown) => setDayRef(day.date, el as HTMLElement | null)\"\n :data-day-key=\"day.date.toDateString()\"\n @click=\"handleDayClick(day, $event)\"\n @dblclick=\"handleDayDblClick(day, $event)\"\n @focus=\"keyboardNavigation && (focusedDate = day.date)\"\n @dragover.prevent=\"onDragOver(day, $event)\"\n @drop.prevent=\"onDrop(day, $event)\" \n :class=\"[ \n 'relative flex flex-col border-l border-border first:border-l-0 transition-colors focus:outline-none', \n day.isOutside ? 'bg-muted/50' : 'bg-card', \n day.disabled \n ? 'cursor-not-allowed bg-muted text-muted-foreground month-disabled-day' \n : 'cursor-pointer hover:bg-muted', \n highlightWeekends && isWeekendCol(dIdx) && !day.isOutside && !day.disabled ? 'bg-rose-50/40' : '', \n dragOverKey === day.date.toDateString() ? dropTargetBgClass : '', \n ]\" \n > \n <div \n v-if=\"keyboardNavigation && day.date.getTime() === focusedDate.getTime()\" \n :class=\"['absolute inset-0 pointer-events-none z-30 ring-2 ring-inset', focusRingColorClass]\" \n ></div> \n <slot name=\"day\" :day=\"day\" :events=\"eventsForDay(day.date)\"> \n <div class=\"flex items-center justify-end px-1.5 pt-1 pb-0.5 h-7\"> \n <span \n :class=\"[ \n 'inline-flex items-center justify-center text-xs font-medium w-6 h-6', \n day.isToday ? [todayBgClass, pillRadiusClass] : '', \n !day.isToday && day.isOutside ? 'text-muted-foreground/40' : '', \n !day.isToday && !day.isOutside ? 'text-foreground/80' : '', \n ]\" \n > \n {{ day.day }} \n </span> \n </div> \n \n <div class=\"flex-1\" :style=\"{ paddingBottom: `${visibleLanes * laneHeight + (week.overflow[dIdx] > 0 ? 18 : 0)}px` }\"></div> \n \n <button \n v-if=\"week.overflow[dIdx] > 0\" \n type=\"button\" \n @click.stop=\"handleMoreClick(day.date, $event)\" \n class=\"absolute left-1.5 right-1.5 text-left text-[11px] text-muted-foreground hover:text-foreground font-medium px-1 py-0.5 cursor-pointer focus:outline-none z-20\" \n :style=\"{ bottom: '2px' }\" \n > \n + {{ week.overflow[dIdx] }} more \n </button> \n </slot> \n </div> \n \n <div\n v-for=\"seg in week.visibleSegments\"\n :key=\"seg.key\"\n :draggable=\"draggableEvents && !seg.event.allDay ? true : draggableEvents\"\n @dragstart=\"onDragStart(seg.event, $event)\"\n @dragend=\"onDragEnd\"\n @click.stop=\"handleEventClick(seg.event, $event)\"\n @mouseenter=\"onEventEnter(seg.event, !!seg.event.allDay, $event)\"\n @mousemove=\"onEventMove\"\n @mouseleave=\"onEventLeave\"\n @touchstart.passive=\"draggableEvents && onEventTouchStart(seg.event, $event)\"\n @touchmove=\"draggableEvents && onEventTouchMove($event)\"\n @touchend.passive=\"draggableEvents && onEventTouchEnd($event)\"\n @touchcancel.passive=\"onTouchDragCancel\" \n :style=\"{ \n left: `calc(${(seg.startCol / 7) * 100}% + 4px)`, \n width: `calc(${(seg.span / 7) * 100}% - 8px)`, \n top: `${28 + seg.lane * laneHeight}px`, \n height: `${laneHeight - 2}px`, \n }\" \n :class=\"[ \n 'absolute z-10 truncate text-xs px-1.5 flex items-center cursor-pointer transition-opacity hover:opacity-80 select-none', \n eventRadiusClass, \n draggableEvents ? 'cursor-grab active:cursor-grabbing' : '', \n eventColorClass(seg.event.color, showEventAccent), \n draggingId === seg.event.id ? 'opacity-50' : '', \n ]\" \n > \n <slot name=\"event\" :event=\"seg.event\" :segment=\"seg\"> \n <span v-if=\"!seg.event.allDay && seg.isFirst\" class=\"font-semibold mr-1\"> \n {{ formatEventTime(seg.event.start) }} \n </span> \n <span class=\"truncate\">{{ seg.event.title }}</span> \n </slot> \n </div> \n </div> \n </div> \n </div> \n \n <CalendarEventTooltip :state=\"hoverState\" :style=\"tooltipStyle\" :formatTime=\"formatEventTime\"> \n <!--\n A provided slot replaces the built-in card, so it gets the surface\n here; with no slot the fallback content keeps rendering its own.\n -->\n <template v-if=\"$slots['event-tooltip']\" #default=\"{ event, allDay }\">\n <div :class=\"CALENDAR_TOOLTIP_SURFACE\">\n <slot name=\"event-tooltip\" :event=\"event\" :allDay=\"allDay\" />\n </div>\n </template>\n </CalendarEventTooltip> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { ref, computed, watch, nextTick } from 'vue'; \nimport gsap from 'gsap'; \nimport { useCalendar, startOfDay, type CalendarDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport { useResolvedColor, useResolvedRadius } from '../../../composables/useModoConfig'; \nimport { eventColorClassStrong as eventColorClass } from '../../../composables/eventColors'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { MonthView, CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nimport { toCssLength } from '../../../utils/cssLength';\n\nimport { CALENDAR_TOOLTIP_SURFACE } from '../../../utils/calendarTooltip';\n\nconst props = withDefaults(defineProps<MonthView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n firstDayOfWeek: 0, \n color: 'default', \n maxEventsPerDay: 3, \n showWeekNumbers: false, \n fixedWeeks: true, \n showHeader: true, \n bordered: true, \n keyboardNavigation: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n highlightWeekends: false, \n showOutsideDays: true, \n showMonthYearSelects: true, \n showYearJump: true, \n draggableEvents: true, \n laneHeight: 22, \n}); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [date: Date]; \n 'event-click': [event: CalendarEvent, nativeEvent: MouseEvent]; \n 'day-click': [date: Date, events: CalendarEvent[], nativeEvent: MouseEvent]; \n 'more-click': [date: Date, events: CalendarEvent[], nativeEvent: MouseEvent]; \n 'create-event': [date: Date, nativeEvent: MouseEvent | KeyboardEvent]; \n 'event-drop': [event: CalendarEvent, newStart: Date, newEnd: Date | undefined]; \n}>(); \n \nconst currentDate = ref(new Date(props.modelValue)); \nconst focusedDate = ref(startOfDay(new Date(props.modelValue))); \nwatch(() => props.modelValue, (v) => { if (v) { currentDate.value = new Date(v); focusedDate.value = startOfDay(new Date(v)); } }); \n \nconst modelRef = computed({ \n get: () => currentDate.value, \n set: (v) => { currentDate.value = v; }, \n}); \n \nconst localeRef = computed(() => props.locale); \nconst firstDowRef = computed(() => props.firstDayOfWeek); \nconst fixedWeeksRef = computed(() => props.fixedWeeks); \nconst minDateRef = computed(() => props.minDate); \nconst maxDateRef = computed(() => props.maxDate); \nconst weekdayFormatRef = computed(() => props.dayNameFormat); \nconst showOutsideRef = computed(() => props.showOutsideDays); \nconst disabledDatesRef = computed(() => props.disabledDates); \nconst disabledDowRef = computed(() => props.disabledDaysOfWeek); \n \nconst { \n currentMonth, \n currentYear, \n monthLabel, \n weekDayLabels, \n calendarDays, \n prevMonth, \n nextMonth, \n prevYear, \n nextYear, \n goToToday, \n} = useCalendar({ \n modelValue: modelRef as unknown as import('vue').Ref<Date | null | undefined>, \n locale: localeRef, \n firstDayOfWeek: firstDowRef, \n fixedWeeks: fixedWeeksRef, \n minDate: minDateRef, \n maxDate: maxDateRef, \n disabledDates: disabledDatesRef, \n disabledDaysOfWeek: disabledDowRef, \n weekdayFormat: weekdayFormatRef, \n showOutsideDays: showOutsideRef, \n}); \n \nconst gridRef = ref<HTMLElement | null>(null); \nconst rootRef = ref<HTMLElement | null>(null); \nconst dayRefs = ref<Map<string, HTMLElement>>(new Map()); \nconst setDayRef = (date: Date, el: HTMLElement | null) => { \n const k = date.toDateString(); \n if (el) dayRefs.value.set(k, el); \n else dayRefs.value.delete(k); \n}; \n \nconst selectedMonth = computed({ \n get: () => currentMonth.value, \n set: (v: number) => { const dir = v > currentMonth.value ? 1 : -1; currentMonth.value = v; nextTick(() => animateChange(dir)); }, \n}); \nconst selectedYear = computed({ \n get: () => currentYear.value, \n set: (v: number) => { const dir = v > currentYear.value ? 1 : -1; currentYear.value = v; nextTick(() => animateChange(dir)); }, \n}); \n \nconst monthOptions = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n return Array.from({ length: 12 }, (_, i) => \n new Date(2024, i, 1).toLocaleString(locale, { month: 'long' }) \n ); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minYear ?? (props.minDate ? props.minDate.getFullYear() : currentYear.value - 10); \n const max = props.maxYear ?? (props.maxDate ? props.maxDate.getFullYear() : currentYear.value + 10); \n const out: number[] = []; \n for (let y = min; y <= max; y++) out.push(y); \n if (!out.includes(currentYear.value)) out.push(currentYear.value); \n return out.sort((a, b) => a - b); \n}); \n \nconst gridTemplateColumns = computed(() => { \n if (props.showWeekNumbers) return { gridTemplateColumns: '2.5rem repeat(7, minmax(0, 1fr))' }; \n return { gridTemplateColumns: 'repeat(7, minmax(0, 1fr))' }; \n}); \n \nconst isWeekendCol = (colIdx: number) => { \n const dow = (props.firstDayOfWeek + colIdx) % 7; \n return dow === 0 || dow === 6; \n}; \n \nconst getWeekNumber = (date: Date) => { \n const target = new Date(date.valueOf()); \n const dayNr = (date.getDay() + 6) % 7; \n target.setDate(target.getDate() - dayNr + 3); \n const firstThursday = target.valueOf(); \n target.setMonth(0, 1); \n if (target.getDay() !== 4) { \n target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7); \n } \n return 1 + Math.ceil((firstThursday - target.valueOf()) / 604800000); \n}; \n \nconst lastDayOfMonth = (y: number, mo: number) => new Date(y, mo + 1, 0); \nconst firstDayOfMonth = (y: number, mo: number) => new Date(y, mo, 1); \n \nconst isMonthDisabled = (month: number, year: number) => { \n const min = props.minDate; \n const max = props.maxDate; \n const end = lastDayOfMonth(year, month); \n const start = firstDayOfMonth(year, month); \n if (min && end < startOfDay(min)) return true; \n if (max && start > startOfDay(max)) return true; \n return false; \n}; \n \nconst isPrevMonthDisabled = computed(() => { \n if (!props.minDate) return false; \n const prev = new Date(currentYear.value, currentMonth.value, 0); \n return prev < startOfDay(props.minDate); \n}); \nconst isNextMonthDisabled = computed(() => { \n if (!props.maxDate) return false; \n const next = new Date(currentYear.value, currentMonth.value + 1, 1); \n return next > startOfDay(props.maxDate); \n}); \nconst isPrevYearDisabled = computed(() => { \n if (props.minYear !== undefined && currentYear.value <= props.minYear) return true; \n if (props.minDate && new Date(currentYear.value - 1, 11, 31) < startOfDay(props.minDate)) return true; \n return false; \n}); \nconst isNextYearDisabled = computed(() => { \n if (props.maxYear !== undefined && currentYear.value >= props.maxYear) return true; \n if (props.maxDate && new Date(currentYear.value + 1, 0, 1) > startOfDay(props.maxDate)) return true; \n return false; \n}); \n \ninterface EventSegment { \n key: string; \n event: CalendarEvent; \n startCol: number; \n span: number; \n lane: number; \n isFirst: boolean; \n} \n \ninterface WeekData { \n days: CalendarDay[]; \n visibleSegments: EventSegment[]; \n overflow: number[]; \n} \n \nconst visibleLanes = computed(() => props.maxEventsPerDay); \n \nconst dayMs = 86400000; \n \nconst getEventDayRange = (ev: CalendarEvent) => { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n return { s, e }; \n}; \n \nconst weeksData = computed<WeekData[]>(() => { \n const days = calendarDays.value; \n const weeks: CalendarDay[][] = []; \n for (let i = 0; i < days.length; i += 7) weeks.push(days.slice(i, i + 7)); \n \n const sortedEvents = [...props.events].sort((a, b) => { \n const aLen = (a.end ? startOfDay(a.end).getTime() : startOfDay(a.start).getTime()) - startOfDay(a.start).getTime(); \n const bLen = (b.end ? startOfDay(b.end).getTime() : startOfDay(b.start).getTime()) - startOfDay(b.start).getTime(); \n if (bLen !== aLen) return bLen - aLen; \n return a.start.getTime() - b.start.getTime(); \n }); \n \n return weeks.map((weekDays) => { \n const weekStart = startOfDay(weekDays[0].date); \n const weekEnd = startOfDay(weekDays[6].date); \n \n const segs: Omit<EventSegment, 'key'>[] = []; \n const lanesTaken: Set<number>[] = Array.from({ length: 7 }, () => new Set()); \n \n const weekEvents = sortedEvents.filter(ev => { \n const { s, e } = getEventDayRange(ev); \n return e.getTime() >= weekStart.getTime() && s.getTime() <= weekEnd.getTime(); \n }); \n \n for (const ev of weekEvents) { \n const { s, e } = getEventDayRange(ev); \n const segStart = s.getTime() < weekStart.getTime() ? weekStart : s; \n const segEnd = e.getTime() > weekEnd.getTime() ? weekEnd : e; \n const startCol = Math.round((segStart.getTime() - weekStart.getTime()) / dayMs); \n const span = Math.round((segEnd.getTime() - segStart.getTime()) / dayMs) + 1; \n \n let lane = 0; \n while (true) { \n let ok = true; \n for (let c = startCol; c < startCol + span; c++) { \n if (lanesTaken[c].has(lane)) { ok = false; break; } \n } \n if (ok) break; \n lane++; \n } \n for (let c = startCol; c < startCol + span; c++) lanesTaken[c].add(lane); \n \n segs.push({ \n event: ev, \n startCol, \n span, \n lane, \n isFirst: s.getTime() >= weekStart.getTime(), \n }); \n } \n \n const visibleSegments: EventSegment[] = segs \n .filter(s => s.lane < visibleLanes.value) \n .map(s => ({ ...s, key: `${s.event.id}-${s.startCol}` })); \n \n const overflow = Array.from({ length: 7 }, (_, c) => { \n let count = 0; \n for (const s of segs) { \n if (s.lane >= visibleLanes.value && c >= s.startCol && c < s.startCol + s.span) count++; \n } \n return count; \n }); \n \n return { days: weekDays, visibleSegments, overflow }; \n }); \n}); \n \nconst eventsForDay = (date: Date): CalendarEvent[] => { \n return props.events \n .filter(ev => { \n const { s, e } = getEventDayRange(ev); \n const d0 = startOfDay(date).getTime(); \n return d0 >= s.getTime() && d0 <= e.getTime(); \n }) \n .sort((a, b) => { \n if (a.allDay && !b.allDay) return -1; \n if (!a.allDay && b.allDay) return 1; \n return a.start.getTime() - b.start.getTime(); \n }); \n}; \n \nconst formatEventTime = (d: Date) => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n return d.toLocaleTimeString(locale, { hour: '2-digit', minute: '2-digit' }); \n}; \n \nconst animateChange = (direction: 1 | -1) => { \n if (!gridRef.value) return; \n gsap.fromTo( \n gridRef.value, \n { opacity: 0, x: 20 * direction }, \n { opacity: 1, x: 0, duration: 0.25, ease: 'power2.out' } \n ); \n}; \n \nconst handlePrevMonth = () => { prevMonth(); nextTick(() => animateChange(-1)); }; \nconst handleNextMonth = () => { nextMonth(); nextTick(() => animateChange(1)); }; \nconst handlePrevYear = () => { prevYear(); nextTick(() => animateChange(-1)); }; \nconst handleNextYear = () => { nextYear(); nextTick(() => animateChange(1)); }; \nconst handleToday = () => { \n const now = goToToday(); \n currentDate.value = now; \n focusedDate.value = startOfDay(now); \n emit('update:modelValue', now); \n nextTick(() => animateChange(1)); \n}; \n \nconst clickTimer = ref<ReturnType<typeof setTimeout> | null>(null); \nconst DOUBLE_CLICK_DELAY = 220; \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \n \nconst handleDayClick = (day: CalendarDay, e: MouseEvent) => { \n if (day.disabled) return; \n currentDate.value = day.date; \n focusedDate.value = startOfDay(day.date); \n emit('update:modelValue', day.date); \n if (clickTimer.value) clearTimeout(clickTimer.value); \n clickTimer.value = setTimeout(() => { \n emit('day-click', day.date, eventsForDay(day.date), e); \n clickTimer.value = null; \n }, DOUBLE_CLICK_DELAY); \n}; \n \nconst handleDayDblClick = (day: CalendarDay, e: MouseEvent) => { \n if (day.disabled) return; \n if (clickTimer.value) { clearTimeout(clickTimer.value); clickTimer.value = null; } \n emit('create-event', day.date, e); \n}; \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => emit('event-click', ev, e); \nconst handleMoreClick = (date: Date, e: MouseEvent) => emit('more-click', date, eventsForDay(date), e); \n \nconst draggingId = ref<string | number | null>(null);\nconst dragOverKey = ref<string | null>(null);\n\nconst onDragStart = (ev: CalendarEvent, e: DragEvent) => {\n if (!props.draggableEvents) return;\n draggingId.value = ev.id;\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', String(ev.id));\n }\n};\nconst onDragEnd = () => {\n draggingId.value = null;\n dragOverKey.value = null;\n};\nconst onDragOver = (day: CalendarDay, e: DragEvent) => {\n if (!props.draggableEvents || draggingId.value === null) return;\n if (day.disabled) { if (e.dataTransfer) e.dataTransfer.dropEffect = 'none'; return; }\n if (e.dataTransfer) e.dataTransfer.dropEffect = 'move';\n dragOverKey.value = day.date.toDateString();\n};\nconst onDrop = (day: CalendarDay, _e: DragEvent) => {\n if (!props.draggableEvents || draggingId.value === null) return;\n if (day.disabled) { onDragEnd(); return; }\n const ev = props.events.find(e => e.id === draggingId.value);\n if (!ev) { onDragEnd(); return; }\n const oldStart = startOfDay(ev.start);\n const diff = startOfDay(day.date).getTime() - oldStart.getTime();\n const newStart = new Date(ev.start.getTime() + diff);\n const newEnd = ev.end ? new Date(ev.end.getTime() + diff) : undefined;\n emit('event-drop', ev, newStart, newEnd);\n onDragEnd();\n};\n\n/* ---------- Touch drag (mobile — HTML5 drag API doesn't work on touch) ---------- */\n\nlet touchHoldTimer: ReturnType<typeof setTimeout> | null = null;\nlet touchDragEventId: string | number | null = null;\nconst touchDragActive = ref(false);\nlet touchDragEl: HTMLElement | null = null;\n\nconst onEventTouchStart = (ev: CalendarEvent, e: TouchEvent) => {\n touchDragEventId = ev.id;\n touchDragEl = e.currentTarget as HTMLElement;\n touchHoldTimer = setTimeout(() => {\n touchDragActive.value = true;\n draggingId.value = ev.id;\n }, 350);\n};\n\nconst onEventTouchMove = (e: TouchEvent) => {\n if (!touchDragActive.value) {\n // Touch moved before hold — cancel pending drag.\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n touchDragEventId = null;\n return;\n }\n e.preventDefault();\n const touch = e.touches[0];\n // Temporarily hide the dragged element so elementFromPoint returns the day underneath.\n if (touchDragEl) touchDragEl.style.pointerEvents = 'none';\n const target = document.elementFromPoint(touch.clientX, touch.clientY);\n if (touchDragEl) touchDragEl.style.pointerEvents = '';\n const dayEl = (target as Element | null)?.closest('[data-day-key]') as HTMLElement | null;\n dragOverKey.value = dayEl?.dataset.dayKey ?? null;\n};\n\nconst onEventTouchEnd = (e: TouchEvent) => {\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n if (!touchDragActive.value) { touchDragEventId = null; return; }\n\n const touch = e.changedTouches[0];\n if (touchDragEl) touchDragEl.style.pointerEvents = 'none';\n const target = document.elementFromPoint(touch.clientX, touch.clientY);\n if (touchDragEl) touchDragEl.style.pointerEvents = '';\n\n const dayKey = (target as Element | null)?.closest('[data-day-key]')\n ?.getAttribute('data-day-key');\n\n if (dayKey && touchDragEventId !== null) {\n for (const week of weeksData.value) {\n const day = week.days.find(d => d.date.toDateString() === dayKey);\n if (day) { onDrop(day, {} as DragEvent); break; }\n }\n }\n onTouchDragCancel();\n};\n\nconst onTouchDragCancel = () => {\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n touchDragActive.value = false;\n touchDragEventId = null;\n touchDragEl = null;\n draggingId.value = null;\n dragOverKey.value = null;\n}; \n \nconst focusDay = (date: Date) => { \n focusedDate.value = startOfDay(date); \n nextTick(() => { \n const el = dayRefs.value.get(focusedDate.value.toDateString()); \n if (el) el.focus(); \n else rootRef.value?.focus(); \n }); \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.keyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n const d = new Date(focusedDate.value); \n let handled = true; \n if (e.key === 'ArrowLeft') d.setDate(d.getDate() - 1); \n else if (e.key === 'ArrowRight') d.setDate(d.getDate() + 1); \n else if (e.key === 'ArrowUp') d.setDate(d.getDate() - 7); \n else if (e.key === 'ArrowDown') d.setDate(d.getDate() + 7); \n else if (e.key === 'Home') d.setDate(d.getDate() - ((d.getDay() - props.firstDayOfWeek + 7) % 7)); \n else if (e.key === 'End') d.setDate(d.getDate() + (6 - ((d.getDay() - props.firstDayOfWeek + 7) % 7))); \n else if (e.key === 'PageUp') d.setMonth(d.getMonth() - 1); \n else if (e.key === 'PageDown') d.setMonth(d.getMonth() + 1); \n else if (e.key === 'Enter' || e.key === ' ') { emit('day-click', focusedDate.value, eventsForDay(focusedDate.value), e as unknown as MouseEvent); handled = true; } \n else if (e.key.toLowerCase() === 'c') { emit('create-event', focusedDate.value, e); handled = true; } \n else if (e.key.toLowerCase() === 't') handleToday(); \n else handled = false; \n \n if (handled) { \n e.preventDefault(); \n if (e.key.startsWith('Arrow') || e.key === 'Home' || e.key === 'End' || e.key === 'PageUp' || e.key === 'PageDown') { \n if (d.getMonth() !== currentMonth.value || d.getFullYear() !== currentYear.value) { \n currentMonth.value = d.getMonth(); \n currentYear.value = d.getFullYear(); \n nextTick(() => animateChange(d > focusedDate.value ? 1 : -1)); \n } \n focusDay(d); \n } \n } \n}; \n \nwatch([currentMonth, currentYear], () => { \n currentDate.value = new Date(currentYear.value, currentMonth.value, 1); \n if (focusedDate.value.getMonth() !== currentMonth.value || focusedDate.value.getFullYear() !== currentYear.value) { \n const lastDay = new Date(currentYear.value, currentMonth.value + 1, 0).getDate(); \n const targetDay = Math.min(focusedDate.value.getDate(), lastDay); \n focusedDate.value = new Date(currentYear.value, currentMonth.value, targetDay); \n } \n}); \n \nconst focusGrid = () => { \n nextTick(() => { \n const el = dayRefs.value.get(focusedDate.value.toDateString()); \n if (el) el.focus(); \n else rootRef.value?.focus(); \n }); \n}; \n \ndefineExpose({ focusGrid }); \n \nconst resolvedColor = useResolvedColor(() => props.color); \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst { \n todayTextClass, \n todayBgClass, \n focusRingColorClass, \n containerRadiusClass, \n eventRadiusClass, \n showEventAccent, \n pillRadiusClass, \n dayNameCaseClass, \n} = useCalendarTheme({ \n color: () => resolvedColor.value, \n radius: () => resolvedRadius.value, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst dropTargetBgClass = computed(() => ({ \n default: 'bg-muted', \n primary: 'bg-primary-subtle', \n danger: 'bg-destructive-subtle', \n success: 'bg-success-subtle', \n warning: 'bg-warning-subtle', \n}[resolvedColor.value] ?? 'bg-primary-subtle')); \n</script> \n \n<style scoped> \n.month-disabled-day { \n background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, 0.04) 6px 7px); \n} \n</style>\n"],"mappings":""}
|
package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs
CHANGED
|
@@ -6,6 +6,8 @@ const require_useCalendarTheme = require("../../../composables/useCalendarTheme.
|
|
|
6
6
|
const require_useEventHover = require("../../../composables/useEventHover.cjs");
|
|
7
7
|
const require_CalendarEventTooltip = require("./CalendarEventTooltip.cjs");
|
|
8
8
|
const require_CalendarHeader = require("./CalendarHeader.cjs");
|
|
9
|
+
const require_cssLength = require("../../../utils/cssLength.cjs");
|
|
10
|
+
const require_calendarTooltip = require("../../../utils/calendarTooltip.cjs");
|
|
9
11
|
let vue = require("vue");
|
|
10
12
|
let gsap = require("gsap");
|
|
11
13
|
gsap = require_runtime.__toESM(gsap, 1);
|
|
@@ -70,6 +72,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
|
|
|
70
72
|
type: Boolean,
|
|
71
73
|
default: true
|
|
72
74
|
},
|
|
75
|
+
maxHeight: {},
|
|
73
76
|
keyboardNavigation: {
|
|
74
77
|
type: Boolean,
|
|
75
78
|
default: true
|
|
@@ -532,14 +535,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
|
|
|
532
535
|
__expose({ focusGrid });
|
|
533
536
|
const resolvedColor = require_useModoConfig.useResolvedColor(() => props.color);
|
|
534
537
|
const resolvedRadius = require_useModoConfig.useResolvedRadius(() => props.radius);
|
|
535
|
-
const todayBgClass
|
|
536
|
-
default: "bg-foreground text-background",
|
|
537
|
-
primary: "bg-primary text-primary-foreground",
|
|
538
|
-
danger: "bg-destructive text-destructive-foreground",
|
|
539
|
-
success: "bg-success text-success-foreground",
|
|
540
|
-
warning: "bg-warning text-warning-foreground"
|
|
541
|
-
})[resolvedColor.value] ?? "bg-primary text-primary-foreground");
|
|
542
|
-
const { todayTextClass, focusRingColorClass, containerRadiusClass, eventRadiusClass, pillRadiusClass, dayNameCaseClass } = require_useCalendarTheme.useCalendarTheme({
|
|
538
|
+
const { todayTextClass, todayBgClass, focusRingColorClass, containerRadiusClass, eventRadiusClass, showEventAccent, pillRadiusClass, dayNameCaseClass } = require_useCalendarTheme.useCalendarTheme({
|
|
543
539
|
color: () => resolvedColor.value,
|
|
544
540
|
radius: () => resolvedRadius.value,
|
|
545
541
|
dayNameCase: () => props.dayNameCase
|
|
@@ -561,6 +557,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
|
|
|
561
557
|
(0, vue.unref)(containerRadiusClass),
|
|
562
558
|
__props.bordered ? "border border-border" : ""
|
|
563
559
|
]),
|
|
560
|
+
style: (0, vue.normalizeStyle)({ maxHeight: (0, vue.unref)(require_cssLength.toCssLength)(__props.maxHeight) }),
|
|
564
561
|
onKeydown: handleKeydown
|
|
565
562
|
}, [
|
|
566
563
|
(0, vue.renderSlot)(_ctx.$slots, "header", {
|
|
@@ -636,7 +633,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
|
|
|
636
633
|
(0, vue.createElementVNode)("div", {
|
|
637
634
|
ref_key: "gridRef",
|
|
638
635
|
ref: gridRef,
|
|
639
|
-
class: "flex-1 flex flex-col"
|
|
636
|
+
class: "flex-1 flex flex-col overflow-y-auto"
|
|
640
637
|
}, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(weeksData.value, (week, wIdx) => {
|
|
641
638
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
642
639
|
key: wIdx,
|
|
@@ -669,7 +666,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
|
|
|
669
666
|
}, () => [
|
|
670
667
|
(0, vue.createElementVNode)("div", _hoisted_5, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)([
|
|
671
668
|
"inline-flex items-center justify-center text-xs font-medium w-6 h-6",
|
|
672
|
-
day.isToday ? [todayBgClass
|
|
669
|
+
day.isToday ? [(0, vue.unref)(todayBgClass), (0, vue.unref)(pillRadiusClass)] : "",
|
|
673
670
|
!day.isToday && day.isOutside ? "text-muted-foreground/40" : "",
|
|
674
671
|
!day.isToday && !day.isOutside ? "text-foreground/80" : ""
|
|
675
672
|
]) }, (0, vue.toDisplayString)(day.day), 3)]),
|
|
@@ -709,7 +706,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
|
|
|
709
706
|
"absolute z-10 truncate text-xs px-1.5 flex items-center cursor-pointer transition-opacity hover:opacity-80 select-none",
|
|
710
707
|
(0, vue.unref)(eventRadiusClass),
|
|
711
708
|
__props.draggableEvents ? "cursor-grab active:cursor-grabbing" : "",
|
|
712
|
-
(0, vue.unref)(require_eventColors.eventColorClassStrong)(seg.event.color),
|
|
709
|
+
(0, vue.unref)(require_eventColors.eventColorClassStrong)(seg.event.color, (0, vue.unref)(showEventAccent)),
|
|
713
710
|
draggingId.value === seg.event.id ? "opacity-50" : ""
|
|
714
711
|
])
|
|
715
712
|
}, [(0, vue.renderSlot)(_ctx.$slots, "event", {
|
|
@@ -722,14 +719,15 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
|
|
|
722
719
|
state: (0, vue.unref)(hoverState),
|
|
723
720
|
style: (0, vue.normalizeStyle)((0, vue.unref)(tooltipStyle)),
|
|
724
721
|
formatTime: formatEventTime
|
|
725
|
-
}, {
|
|
726
|
-
|
|
722
|
+
}, (0, vue.createSlots)({ _: 2 }, [_ctx.$slots["event-tooltip"] ? {
|
|
723
|
+
name: "default",
|
|
724
|
+
fn: (0, vue.withCtx)(({ event, allDay }) => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(require_calendarTooltip.CALENDAR_TOOLTIP_SURFACE)) }, [(0, vue.renderSlot)(_ctx.$slots, "event-tooltip", {
|
|
727
725
|
event,
|
|
728
726
|
allDay
|
|
729
|
-
}, void 0, true)]),
|
|
730
|
-
|
|
731
|
-
},
|
|
732
|
-
],
|
|
727
|
+
}, void 0, true)], 2)]),
|
|
728
|
+
key: "0"
|
|
729
|
+
} : void 0]), 1032, ["state", "style"])
|
|
730
|
+
], 38);
|
|
733
731
|
};
|
|
734
732
|
}
|
|
735
733
|
});
|
package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthView.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../../src/components/data-display/calendar/MonthView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['flex flex-col bg-card overflow-hidden focus:outline-none', containerRadiusClass, bordered ? 'border border-border' : '']\" \n @keydown=\"handleKeydown\" \n > \n <slot name=\"header\" :monthLabel=\"monthLabel\" :year=\"currentYear\" :goToToday=\"handleToday\" :prev=\"handlePrevMonth\" :next=\"handleNextMonth\"> \n <CalendarHeader \n :label=\"`${monthLabel} ${currentYear}`\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearJump\" \n :showTodayButton=\"true\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :isMonthDisabled=\"(i: number) => isMonthDisabled(i, currentYear)\" \n :isPrevMonthDisabled=\"false\" \n :isPrevDisabled=\"isPrevMonthDisabled\" \n :isNextDisabled=\"isNextMonthDisabled\" \n :isPrevYearDisabled=\"isPrevYearDisabled\" \n :isNextYearDisabled=\"isNextYearDisabled\" \n :useFocusRingForToday=\"true\" \n prevLabel=\"Previous month\" \n nextLabel=\"Next month\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrevMonth\" \n @next=\"handleNextMonth\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div class=\"grid border-b border-border\" :style=\"gridTemplateColumns\"> \n <div v-if=\"showWeekNumbers\" class=\"px-2 py-2 text-center text-xs font-medium text-muted-foreground border-r border-border\"> \n # \n </div> \n <div \n v-for=\"(label, i) in weekDayLabels\" \n :key=\"i\" \n :class=\"[ \n 'px-2 py-2 text-center text-xs font-medium tracking-wide truncate', \n dayNameCaseClass, \n highlightWeekends && isWeekendCol(i) ? 'text-rose-500' : 'text-muted-foreground', \n ]\" \n > \n {{ label }} \n </div> \n </div> \n \n <div ref=\"gridRef\" class=\"flex-1 flex flex-col\"> \n <div \n v-for=\"(week, wIdx) in weeksData\" \n :key=\"wIdx\" \n class=\"flex-1 flex min-h-24 relative border-t border-border first:border-t-0\" \n > \n <div \n v-if=\"showWeekNumbers\" \n class=\"w-10 shrink-0 px-2 py-1 flex items-start justify-center text-xs font-medium text-muted-foreground border-r border-border\" \n > \n {{ getWeekNumber(week.days[0].date) }} \n </div> \n \n <div class=\"flex-1 relative grid grid-cols-7\"> \n <div \n v-for=\"(day, dIdx) in week.days\" \n :key=\"day.date.toISOString()\" \n :tabindex=\"keyboardNavigation && day.date.getTime() === focusedDate.getTime() ? 0 : -1\"\n :ref=\"(el: unknown) => setDayRef(day.date, el as HTMLElement | null)\"\n :data-day-key=\"day.date.toDateString()\"\n @click=\"handleDayClick(day, $event)\"\n @dblclick=\"handleDayDblClick(day, $event)\"\n @focus=\"keyboardNavigation && (focusedDate = day.date)\"\n @dragover.prevent=\"onDragOver(day, $event)\"\n @drop.prevent=\"onDrop(day, $event)\" \n :class=\"[ \n 'relative flex flex-col border-l border-border first:border-l-0 transition-colors focus:outline-none', \n day.isOutside ? 'bg-muted/50' : 'bg-card', \n day.disabled \n ? 'cursor-not-allowed bg-muted text-muted-foreground month-disabled-day' \n : 'cursor-pointer hover:bg-muted', \n highlightWeekends && isWeekendCol(dIdx) && !day.isOutside && !day.disabled ? 'bg-rose-50/40' : '', \n dragOverKey === day.date.toDateString() ? dropTargetBgClass : '', \n ]\" \n > \n <div \n v-if=\"keyboardNavigation && day.date.getTime() === focusedDate.getTime()\" \n :class=\"['absolute inset-0 pointer-events-none z-30 ring-2 ring-inset', focusRingColorClass]\" \n ></div> \n <slot name=\"day\" :day=\"day\" :events=\"eventsForDay(day.date)\"> \n <div class=\"flex items-center justify-end px-1.5 pt-1 pb-0.5 h-7\"> \n <span \n :class=\"[ \n 'inline-flex items-center justify-center text-xs font-medium w-6 h-6', \n day.isToday ? [todayBgClass, pillRadiusClass] : '', \n !day.isToday && day.isOutside ? 'text-muted-foreground/40' : '', \n !day.isToday && !day.isOutside ? 'text-foreground/80' : '', \n ]\" \n > \n {{ day.day }} \n </span> \n </div> \n \n <div class=\"flex-1\" :style=\"{ paddingBottom: `${visibleLanes * laneHeight + (week.overflow[dIdx] > 0 ? 18 : 0)}px` }\"></div> \n \n <button \n v-if=\"week.overflow[dIdx] > 0\" \n type=\"button\" \n @click.stop=\"handleMoreClick(day.date, $event)\" \n class=\"absolute left-1.5 right-1.5 text-left text-[11px] text-muted-foreground hover:text-foreground font-medium px-1 py-0.5 cursor-pointer focus:outline-none z-20\" \n :style=\"{ bottom: '2px' }\" \n > \n + {{ week.overflow[dIdx] }} more \n </button> \n </slot> \n </div> \n \n <div\n v-for=\"seg in week.visibleSegments\"\n :key=\"seg.key\"\n :draggable=\"draggableEvents && !seg.event.allDay ? true : draggableEvents\"\n @dragstart=\"onDragStart(seg.event, $event)\"\n @dragend=\"onDragEnd\"\n @click.stop=\"handleEventClick(seg.event, $event)\"\n @mouseenter=\"onEventEnter(seg.event, !!seg.event.allDay, $event)\"\n @mousemove=\"onEventMove\"\n @mouseleave=\"onEventLeave\"\n @touchstart.passive=\"draggableEvents && onEventTouchStart(seg.event, $event)\"\n @touchmove=\"draggableEvents && onEventTouchMove($event)\"\n @touchend.passive=\"draggableEvents && onEventTouchEnd($event)\"\n @touchcancel.passive=\"onTouchDragCancel\" \n :style=\"{ \n left: `calc(${(seg.startCol / 7) * 100}% + 4px)`, \n width: `calc(${(seg.span / 7) * 100}% - 8px)`, \n top: `${28 + seg.lane * laneHeight}px`, \n height: `${laneHeight - 2}px`, \n }\" \n :class=\"[ \n 'absolute z-10 truncate text-xs px-1.5 flex items-center cursor-pointer transition-opacity hover:opacity-80 select-none', \n eventRadiusClass, \n draggableEvents ? 'cursor-grab active:cursor-grabbing' : '', \n eventColorClass(seg.event.color), \n draggingId === seg.event.id ? 'opacity-50' : '', \n ]\" \n > \n <slot name=\"event\" :event=\"seg.event\" :segment=\"seg\"> \n <span v-if=\"!seg.event.allDay && seg.isFirst\" class=\"font-semibold mr-1\"> \n {{ formatEventTime(seg.event.start) }} \n </span> \n <span class=\"truncate\">{{ seg.event.title }}</span> \n </slot> \n </div> \n </div> \n </div> \n </div> \n \n <CalendarEventTooltip :state=\"hoverState\" :style=\"tooltipStyle\" :formatTime=\"formatEventTime\"> \n <template #default=\"{ event, allDay }\"> \n <slot name=\"event-tooltip\" :event=\"event\" :allDay=\"allDay\" /> \n </template> \n </CalendarEventTooltip> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { ref, computed, watch, nextTick } from 'vue'; \nimport gsap from 'gsap'; \nimport { useCalendar, startOfDay, type CalendarDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport { useResolvedColor, useResolvedRadius } from '../../../composables/useModoConfig'; \nimport { eventColorClassStrong as eventColorClass } from '../../../composables/eventColors'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { MonthView, CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nconst props = withDefaults(defineProps<MonthView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n firstDayOfWeek: 0, \n color: 'default', \n maxEventsPerDay: 3, \n showWeekNumbers: false, \n fixedWeeks: true, \n showHeader: true, \n bordered: true, \n keyboardNavigation: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n highlightWeekends: false, \n showOutsideDays: true, \n showMonthYearSelects: true, \n showYearJump: true, \n draggableEvents: true, \n laneHeight: 22, \n}); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [date: Date]; \n 'event-click': [event: CalendarEvent, nativeEvent: MouseEvent]; \n 'day-click': [date: Date, events: CalendarEvent[], nativeEvent: MouseEvent]; \n 'more-click': [date: Date, events: CalendarEvent[], nativeEvent: MouseEvent]; \n 'create-event': [date: Date, nativeEvent: MouseEvent | KeyboardEvent]; \n 'event-drop': [event: CalendarEvent, newStart: Date, newEnd: Date | undefined]; \n}>(); \n \nconst currentDate = ref(new Date(props.modelValue)); \nconst focusedDate = ref(startOfDay(new Date(props.modelValue))); \nwatch(() => props.modelValue, (v) => { if (v) { currentDate.value = new Date(v); focusedDate.value = startOfDay(new Date(v)); } }); \n \nconst modelRef = computed({ \n get: () => currentDate.value, \n set: (v) => { currentDate.value = v; }, \n}); \n \nconst localeRef = computed(() => props.locale); \nconst firstDowRef = computed(() => props.firstDayOfWeek); \nconst fixedWeeksRef = computed(() => props.fixedWeeks); \nconst minDateRef = computed(() => props.minDate); \nconst maxDateRef = computed(() => props.maxDate); \nconst weekdayFormatRef = computed(() => props.dayNameFormat); \nconst showOutsideRef = computed(() => props.showOutsideDays); \nconst disabledDatesRef = computed(() => props.disabledDates); \nconst disabledDowRef = computed(() => props.disabledDaysOfWeek); \n \nconst { \n currentMonth, \n currentYear, \n monthLabel, \n weekDayLabels, \n calendarDays, \n prevMonth, \n nextMonth, \n prevYear, \n nextYear, \n goToToday, \n} = useCalendar({ \n modelValue: modelRef as unknown as import('vue').Ref<Date | null | undefined>, \n locale: localeRef, \n firstDayOfWeek: firstDowRef, \n fixedWeeks: fixedWeeksRef, \n minDate: minDateRef, \n maxDate: maxDateRef, \n disabledDates: disabledDatesRef, \n disabledDaysOfWeek: disabledDowRef, \n weekdayFormat: weekdayFormatRef, \n showOutsideDays: showOutsideRef, \n}); \n \nconst gridRef = ref<HTMLElement | null>(null); \nconst rootRef = ref<HTMLElement | null>(null); \nconst dayRefs = ref<Map<string, HTMLElement>>(new Map()); \nconst setDayRef = (date: Date, el: HTMLElement | null) => { \n const k = date.toDateString(); \n if (el) dayRefs.value.set(k, el); \n else dayRefs.value.delete(k); \n}; \n \nconst selectedMonth = computed({ \n get: () => currentMonth.value, \n set: (v: number) => { const dir = v > currentMonth.value ? 1 : -1; currentMonth.value = v; nextTick(() => animateChange(dir)); }, \n}); \nconst selectedYear = computed({ \n get: () => currentYear.value, \n set: (v: number) => { const dir = v > currentYear.value ? 1 : -1; currentYear.value = v; nextTick(() => animateChange(dir)); }, \n}); \n \nconst monthOptions = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n return Array.from({ length: 12 }, (_, i) => \n new Date(2024, i, 1).toLocaleString(locale, { month: 'long' }) \n ); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minYear ?? (props.minDate ? props.minDate.getFullYear() : currentYear.value - 10); \n const max = props.maxYear ?? (props.maxDate ? props.maxDate.getFullYear() : currentYear.value + 10); \n const out: number[] = []; \n for (let y = min; y <= max; y++) out.push(y); \n if (!out.includes(currentYear.value)) out.push(currentYear.value); \n return out.sort((a, b) => a - b); \n}); \n \nconst gridTemplateColumns = computed(() => { \n if (props.showWeekNumbers) return { gridTemplateColumns: '2.5rem repeat(7, minmax(0, 1fr))' }; \n return { gridTemplateColumns: 'repeat(7, minmax(0, 1fr))' }; \n}); \n \nconst isWeekendCol = (colIdx: number) => { \n const dow = (props.firstDayOfWeek + colIdx) % 7; \n return dow === 0 || dow === 6; \n}; \n \nconst getWeekNumber = (date: Date) => { \n const target = new Date(date.valueOf()); \n const dayNr = (date.getDay() + 6) % 7; \n target.setDate(target.getDate() - dayNr + 3); \n const firstThursday = target.valueOf(); \n target.setMonth(0, 1); \n if (target.getDay() !== 4) { \n target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7); \n } \n return 1 + Math.ceil((firstThursday - target.valueOf()) / 604800000); \n}; \n \nconst lastDayOfMonth = (y: number, mo: number) => new Date(y, mo + 1, 0); \nconst firstDayOfMonth = (y: number, mo: number) => new Date(y, mo, 1); \n \nconst isMonthDisabled = (month: number, year: number) => { \n const min = props.minDate; \n const max = props.maxDate; \n const end = lastDayOfMonth(year, month); \n const start = firstDayOfMonth(year, month); \n if (min && end < startOfDay(min)) return true; \n if (max && start > startOfDay(max)) return true; \n return false; \n}; \n \nconst isPrevMonthDisabled = computed(() => { \n if (!props.minDate) return false; \n const prev = new Date(currentYear.value, currentMonth.value, 0); \n return prev < startOfDay(props.minDate); \n}); \nconst isNextMonthDisabled = computed(() => { \n if (!props.maxDate) return false; \n const next = new Date(currentYear.value, currentMonth.value + 1, 1); \n return next > startOfDay(props.maxDate); \n}); \nconst isPrevYearDisabled = computed(() => { \n if (props.minYear !== undefined && currentYear.value <= props.minYear) return true; \n if (props.minDate && new Date(currentYear.value - 1, 11, 31) < startOfDay(props.minDate)) return true; \n return false; \n}); \nconst isNextYearDisabled = computed(() => { \n if (props.maxYear !== undefined && currentYear.value >= props.maxYear) return true; \n if (props.maxDate && new Date(currentYear.value + 1, 0, 1) > startOfDay(props.maxDate)) return true; \n return false; \n}); \n \ninterface EventSegment { \n key: string; \n event: CalendarEvent; \n startCol: number; \n span: number; \n lane: number; \n isFirst: boolean; \n} \n \ninterface WeekData { \n days: CalendarDay[]; \n visibleSegments: EventSegment[]; \n overflow: number[]; \n} \n \nconst visibleLanes = computed(() => props.maxEventsPerDay); \n \nconst dayMs = 86400000; \n \nconst getEventDayRange = (ev: CalendarEvent) => { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n return { s, e }; \n}; \n \nconst weeksData = computed<WeekData[]>(() => { \n const days = calendarDays.value; \n const weeks: CalendarDay[][] = []; \n for (let i = 0; i < days.length; i += 7) weeks.push(days.slice(i, i + 7)); \n \n const sortedEvents = [...props.events].sort((a, b) => { \n const aLen = (a.end ? startOfDay(a.end).getTime() : startOfDay(a.start).getTime()) - startOfDay(a.start).getTime(); \n const bLen = (b.end ? startOfDay(b.end).getTime() : startOfDay(b.start).getTime()) - startOfDay(b.start).getTime(); \n if (bLen !== aLen) return bLen - aLen; \n return a.start.getTime() - b.start.getTime(); \n }); \n \n return weeks.map((weekDays) => { \n const weekStart = startOfDay(weekDays[0].date); \n const weekEnd = startOfDay(weekDays[6].date); \n \n const segs: Omit<EventSegment, 'key'>[] = []; \n const lanesTaken: Set<number>[] = Array.from({ length: 7 }, () => new Set()); \n \n const weekEvents = sortedEvents.filter(ev => { \n const { s, e } = getEventDayRange(ev); \n return e.getTime() >= weekStart.getTime() && s.getTime() <= weekEnd.getTime(); \n }); \n \n for (const ev of weekEvents) { \n const { s, e } = getEventDayRange(ev); \n const segStart = s.getTime() < weekStart.getTime() ? weekStart : s; \n const segEnd = e.getTime() > weekEnd.getTime() ? weekEnd : e; \n const startCol = Math.round((segStart.getTime() - weekStart.getTime()) / dayMs); \n const span = Math.round((segEnd.getTime() - segStart.getTime()) / dayMs) + 1; \n \n let lane = 0; \n while (true) { \n let ok = true; \n for (let c = startCol; c < startCol + span; c++) { \n if (lanesTaken[c].has(lane)) { ok = false; break; } \n } \n if (ok) break; \n lane++; \n } \n for (let c = startCol; c < startCol + span; c++) lanesTaken[c].add(lane); \n \n segs.push({ \n event: ev, \n startCol, \n span, \n lane, \n isFirst: s.getTime() >= weekStart.getTime(), \n }); \n } \n \n const visibleSegments: EventSegment[] = segs \n .filter(s => s.lane < visibleLanes.value) \n .map(s => ({ ...s, key: `${s.event.id}-${s.startCol}` })); \n \n const overflow = Array.from({ length: 7 }, (_, c) => { \n let count = 0; \n for (const s of segs) { \n if (s.lane >= visibleLanes.value && c >= s.startCol && c < s.startCol + s.span) count++; \n } \n return count; \n }); \n \n return { days: weekDays, visibleSegments, overflow }; \n }); \n}); \n \nconst eventsForDay = (date: Date): CalendarEvent[] => { \n return props.events \n .filter(ev => { \n const { s, e } = getEventDayRange(ev); \n const d0 = startOfDay(date).getTime(); \n return d0 >= s.getTime() && d0 <= e.getTime(); \n }) \n .sort((a, b) => { \n if (a.allDay && !b.allDay) return -1; \n if (!a.allDay && b.allDay) return 1; \n return a.start.getTime() - b.start.getTime(); \n }); \n}; \n \nconst formatEventTime = (d: Date) => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n return d.toLocaleTimeString(locale, { hour: '2-digit', minute: '2-digit' }); \n}; \n \nconst animateChange = (direction: 1 | -1) => { \n if (!gridRef.value) return; \n gsap.fromTo( \n gridRef.value, \n { opacity: 0, x: 20 * direction }, \n { opacity: 1, x: 0, duration: 0.25, ease: 'power2.out' } \n ); \n}; \n \nconst handlePrevMonth = () => { prevMonth(); nextTick(() => animateChange(-1)); }; \nconst handleNextMonth = () => { nextMonth(); nextTick(() => animateChange(1)); }; \nconst handlePrevYear = () => { prevYear(); nextTick(() => animateChange(-1)); }; \nconst handleNextYear = () => { nextYear(); nextTick(() => animateChange(1)); }; \nconst handleToday = () => { \n const now = goToToday(); \n currentDate.value = now; \n focusedDate.value = startOfDay(now); \n emit('update:modelValue', now); \n nextTick(() => animateChange(1)); \n}; \n \nconst clickTimer = ref<ReturnType<typeof setTimeout> | null>(null); \nconst DOUBLE_CLICK_DELAY = 220; \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \n \nconst handleDayClick = (day: CalendarDay, e: MouseEvent) => { \n if (day.disabled) return; \n currentDate.value = day.date; \n focusedDate.value = startOfDay(day.date); \n emit('update:modelValue', day.date); \n if (clickTimer.value) clearTimeout(clickTimer.value); \n clickTimer.value = setTimeout(() => { \n emit('day-click', day.date, eventsForDay(day.date), e); \n clickTimer.value = null; \n }, DOUBLE_CLICK_DELAY); \n}; \n \nconst handleDayDblClick = (day: CalendarDay, e: MouseEvent) => { \n if (day.disabled) return; \n if (clickTimer.value) { clearTimeout(clickTimer.value); clickTimer.value = null; } \n emit('create-event', day.date, e); \n}; \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => emit('event-click', ev, e); \nconst handleMoreClick = (date: Date, e: MouseEvent) => emit('more-click', date, eventsForDay(date), e); \n \nconst draggingId = ref<string | number | null>(null);\nconst dragOverKey = ref<string | null>(null);\n\nconst onDragStart = (ev: CalendarEvent, e: DragEvent) => {\n if (!props.draggableEvents) return;\n draggingId.value = ev.id;\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', String(ev.id));\n }\n};\nconst onDragEnd = () => {\n draggingId.value = null;\n dragOverKey.value = null;\n};\nconst onDragOver = (day: CalendarDay, e: DragEvent) => {\n if (!props.draggableEvents || draggingId.value === null) return;\n if (day.disabled) { if (e.dataTransfer) e.dataTransfer.dropEffect = 'none'; return; }\n if (e.dataTransfer) e.dataTransfer.dropEffect = 'move';\n dragOverKey.value = day.date.toDateString();\n};\nconst onDrop = (day: CalendarDay, _e: DragEvent) => {\n if (!props.draggableEvents || draggingId.value === null) return;\n if (day.disabled) { onDragEnd(); return; }\n const ev = props.events.find(e => e.id === draggingId.value);\n if (!ev) { onDragEnd(); return; }\n const oldStart = startOfDay(ev.start);\n const diff = startOfDay(day.date).getTime() - oldStart.getTime();\n const newStart = new Date(ev.start.getTime() + diff);\n const newEnd = ev.end ? new Date(ev.end.getTime() + diff) : undefined;\n emit('event-drop', ev, newStart, newEnd);\n onDragEnd();\n};\n\n/* ---------- Touch drag (mobile — HTML5 drag API doesn't work on touch) ---------- */\n\nlet touchHoldTimer: ReturnType<typeof setTimeout> | null = null;\nlet touchDragEventId: string | number | null = null;\nconst touchDragActive = ref(false);\nlet touchDragEl: HTMLElement | null = null;\n\nconst onEventTouchStart = (ev: CalendarEvent, e: TouchEvent) => {\n touchDragEventId = ev.id;\n touchDragEl = e.currentTarget as HTMLElement;\n touchHoldTimer = setTimeout(() => {\n touchDragActive.value = true;\n draggingId.value = ev.id;\n }, 350);\n};\n\nconst onEventTouchMove = (e: TouchEvent) => {\n if (!touchDragActive.value) {\n // Touch moved before hold — cancel pending drag.\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n touchDragEventId = null;\n return;\n }\n e.preventDefault();\n const touch = e.touches[0];\n // Temporarily hide the dragged element so elementFromPoint returns the day underneath.\n if (touchDragEl) touchDragEl.style.pointerEvents = 'none';\n const target = document.elementFromPoint(touch.clientX, touch.clientY);\n if (touchDragEl) touchDragEl.style.pointerEvents = '';\n const dayEl = (target as Element | null)?.closest('[data-day-key]') as HTMLElement | null;\n dragOverKey.value = dayEl?.dataset.dayKey ?? null;\n};\n\nconst onEventTouchEnd = (e: TouchEvent) => {\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n if (!touchDragActive.value) { touchDragEventId = null; return; }\n\n const touch = e.changedTouches[0];\n if (touchDragEl) touchDragEl.style.pointerEvents = 'none';\n const target = document.elementFromPoint(touch.clientX, touch.clientY);\n if (touchDragEl) touchDragEl.style.pointerEvents = '';\n\n const dayKey = (target as Element | null)?.closest('[data-day-key]')\n ?.getAttribute('data-day-key');\n\n if (dayKey && touchDragEventId !== null) {\n for (const week of weeksData.value) {\n const day = week.days.find(d => d.date.toDateString() === dayKey);\n if (day) { onDrop(day, {} as DragEvent); break; }\n }\n }\n onTouchDragCancel();\n};\n\nconst onTouchDragCancel = () => {\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n touchDragActive.value = false;\n touchDragEventId = null;\n touchDragEl = null;\n draggingId.value = null;\n dragOverKey.value = null;\n}; \n \nconst focusDay = (date: Date) => { \n focusedDate.value = startOfDay(date); \n nextTick(() => { \n const el = dayRefs.value.get(focusedDate.value.toDateString()); \n if (el) el.focus(); \n else rootRef.value?.focus(); \n }); \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.keyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n const d = new Date(focusedDate.value); \n let handled = true; \n if (e.key === 'ArrowLeft') d.setDate(d.getDate() - 1); \n else if (e.key === 'ArrowRight') d.setDate(d.getDate() + 1); \n else if (e.key === 'ArrowUp') d.setDate(d.getDate() - 7); \n else if (e.key === 'ArrowDown') d.setDate(d.getDate() + 7); \n else if (e.key === 'Home') d.setDate(d.getDate() - ((d.getDay() - props.firstDayOfWeek + 7) % 7)); \n else if (e.key === 'End') d.setDate(d.getDate() + (6 - ((d.getDay() - props.firstDayOfWeek + 7) % 7))); \n else if (e.key === 'PageUp') d.setMonth(d.getMonth() - 1); \n else if (e.key === 'PageDown') d.setMonth(d.getMonth() + 1); \n else if (e.key === 'Enter' || e.key === ' ') { emit('day-click', focusedDate.value, eventsForDay(focusedDate.value), e as unknown as MouseEvent); handled = true; } \n else if (e.key.toLowerCase() === 'c') { emit('create-event', focusedDate.value, e); handled = true; } \n else if (e.key.toLowerCase() === 't') handleToday(); \n else handled = false; \n \n if (handled) { \n e.preventDefault(); \n if (e.key.startsWith('Arrow') || e.key === 'Home' || e.key === 'End' || e.key === 'PageUp' || e.key === 'PageDown') { \n if (d.getMonth() !== currentMonth.value || d.getFullYear() !== currentYear.value) { \n currentMonth.value = d.getMonth(); \n currentYear.value = d.getFullYear(); \n nextTick(() => animateChange(d > focusedDate.value ? 1 : -1)); \n } \n focusDay(d); \n } \n } \n}; \n \nwatch([currentMonth, currentYear], () => { \n currentDate.value = new Date(currentYear.value, currentMonth.value, 1); \n if (focusedDate.value.getMonth() !== currentMonth.value || focusedDate.value.getFullYear() !== currentYear.value) { \n const lastDay = new Date(currentYear.value, currentMonth.value + 1, 0).getDate(); \n const targetDay = Math.min(focusedDate.value.getDate(), lastDay); \n focusedDate.value = new Date(currentYear.value, currentMonth.value, targetDay); \n } \n}); \n \nconst focusGrid = () => { \n nextTick(() => { \n const el = dayRefs.value.get(focusedDate.value.toDateString()); \n if (el) el.focus(); \n else rootRef.value?.focus(); \n }); \n}; \n \ndefineExpose({ focusGrid }); \n \nconst resolvedColor = useResolvedColor(() => props.color); \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst todayBgClass = computed(() => ({ \n default: 'bg-foreground text-background', \n primary: 'bg-primary text-primary-foreground', \n danger: 'bg-destructive text-destructive-foreground', \n success: 'bg-success text-success-foreground', \n warning: 'bg-warning text-warning-foreground', \n}[resolvedColor.value] ?? 'bg-primary text-primary-foreground')); \n \nconst { \n todayTextClass, \n focusRingColorClass, \n containerRadiusClass, \n eventRadiusClass, \n pillRadiusClass, \n dayNameCaseClass, \n} = useCalendarTheme({ \n color: () => resolvedColor.value, \n radius: () => resolvedRadius.value, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst dropTargetBgClass = computed(() => ({ \n default: 'bg-muted', \n primary: 'bg-primary-subtle', \n danger: 'bg-destructive-subtle', \n success: 'bg-success-subtle', \n warning: 'bg-warning-subtle', \n}[resolvedColor.value] ?? 'bg-primary-subtle')); \n</script> \n \n<style scoped> \n.month-disabled-day { \n background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, 0.04) 6px 7px); \n} \n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4WA,IAAM,QAAQ;AAoHd,IAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAzS3B,MAAM,QAAQ;EAsBd,MAAM,OAAO;EASb,MAAM,eAAA,GAAA,IAAA,KAAkB,IAAI,KAAK,MAAM,WAAW,CAAC;EACnD,MAAM,eAAA,GAAA,IAAA,KAAkB,oBAAA,WAAW,IAAI,KAAK,MAAM,WAAW,CAAC,CAAC;EAC/D,CAAA,GAAA,IAAA,aAAY,MAAM,aAAa,MAAM;GAAE,IAAI,GAAG;IAAE,YAAY,QAAQ,IAAI,KAAK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,OAAI,IAAA,IAAA;qBAAiE,IAAI,OAAO,QAAA,WAAU;mBAA8C,QAAA,aAAU,EAAA;;OAM3R,QAAA,GAAA,IAAA,gBAAK;;uBAAwL,iBAAgB;QAA+B,QAAA,kBAAe,uCAAA;uBAA2E,oBAAA,sBAAe,CAAC,IAAI,MAAM,MAAK;QAAgC,WAAA,UAAe,IAAI,MAAM,KAAE,eAAA;;8BAa1Z,KAAA,QAAA,SAAA;OALa,OAAO,IAAI;OAAQ,SAAS;eAKzC,CAAA,CAJU,IAAI,MAAM,UAAU,IAAI,YAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAE9B,QAFP,aAAA,GAAA,IAAA,iBACO,gBAAgB,IAAI,MAAM,MAAK,CAAA,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,GAAA,GAAA,IAAA,oBAEa,QAAnD,aAAA,GAAA,IAAA,iBAA0B,IAAI,MAAM,MAAK,EAAA,EAAA,CAAA,EAAA,KAAA,CAAA,EAAA,IAAA,WAAA;;;yBAWtC,6BAAA,SAAA;KAJA,QAAA,GAAA,IAAA,OAAO,WAAU;KAAG,QAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,OAAO,aAAY,CAAA;KAAG,YAAY;;KAC9D,UAAA,GAAA,IAAA,UACsD,EAD3C,OAAO,aAAM,EAAA,GAAA,IAAA,YAC8B,KAAA,QAAA,iBAAA;MAA1B;MAAgB"}
|
|
1
|
+
{"version":3,"file":"MonthView.vue_vue_type_script_setup_true_lang.cjs","names":["$slots"],"sources":["../../../../src/components/data-display/calendar/MonthView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['flex flex-col bg-card overflow-hidden focus:outline-none', containerRadiusClass, bordered ? 'border border-border' : '']\" \n :style=\"{ maxHeight: toCssLength(maxHeight) }\"\n @keydown=\"handleKeydown\" \n > \n <slot name=\"header\" :monthLabel=\"monthLabel\" :year=\"currentYear\" :goToToday=\"handleToday\" :prev=\"handlePrevMonth\" :next=\"handleNextMonth\"> \n <CalendarHeader \n :label=\"`${monthLabel} ${currentYear}`\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearJump\" \n :showTodayButton=\"true\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :isMonthDisabled=\"(i: number) => isMonthDisabled(i, currentYear)\" \n :isPrevMonthDisabled=\"false\" \n :isPrevDisabled=\"isPrevMonthDisabled\" \n :isNextDisabled=\"isNextMonthDisabled\" \n :isPrevYearDisabled=\"isPrevYearDisabled\" \n :isNextYearDisabled=\"isNextYearDisabled\" \n :useFocusRingForToday=\"true\" \n prevLabel=\"Previous month\" \n nextLabel=\"Next month\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrevMonth\" \n @next=\"handleNextMonth\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div class=\"grid border-b border-border\" :style=\"gridTemplateColumns\"> \n <div v-if=\"showWeekNumbers\" class=\"px-2 py-2 text-center text-xs font-medium text-muted-foreground border-r border-border\"> \n # \n </div> \n <div \n v-for=\"(label, i) in weekDayLabels\" \n :key=\"i\" \n :class=\"[ \n 'px-2 py-2 text-center text-xs font-medium tracking-wide truncate', \n dayNameCaseClass, \n highlightWeekends && isWeekendCol(i) ? 'text-rose-500' : 'text-muted-foreground', \n ]\" \n > \n {{ label }} \n </div> \n </div> \n \n <!--\n The week rows keep their `min-h-24`, so a capped `maxHeight` has to\n scroll here rather than clip against the root's `overflow-hidden`.\n With no cap there is nothing to overflow and no scrollbar appears.\n -->\n <div ref=\"gridRef\" class=\"flex-1 flex flex-col overflow-y-auto\">\n <div \n v-for=\"(week, wIdx) in weeksData\" \n :key=\"wIdx\" \n class=\"flex-1 flex min-h-24 relative border-t border-border first:border-t-0\" \n > \n <div \n v-if=\"showWeekNumbers\" \n class=\"w-10 shrink-0 px-2 py-1 flex items-start justify-center text-xs font-medium text-muted-foreground border-r border-border\" \n > \n {{ getWeekNumber(week.days[0].date) }} \n </div> \n \n <div class=\"flex-1 relative grid grid-cols-7\"> \n <div \n v-for=\"(day, dIdx) in week.days\" \n :key=\"day.date.toISOString()\" \n :tabindex=\"keyboardNavigation && day.date.getTime() === focusedDate.getTime() ? 0 : -1\"\n :ref=\"(el: unknown) => setDayRef(day.date, el as HTMLElement | null)\"\n :data-day-key=\"day.date.toDateString()\"\n @click=\"handleDayClick(day, $event)\"\n @dblclick=\"handleDayDblClick(day, $event)\"\n @focus=\"keyboardNavigation && (focusedDate = day.date)\"\n @dragover.prevent=\"onDragOver(day, $event)\"\n @drop.prevent=\"onDrop(day, $event)\" \n :class=\"[ \n 'relative flex flex-col border-l border-border first:border-l-0 transition-colors focus:outline-none', \n day.isOutside ? 'bg-muted/50' : 'bg-card', \n day.disabled \n ? 'cursor-not-allowed bg-muted text-muted-foreground month-disabled-day' \n : 'cursor-pointer hover:bg-muted', \n highlightWeekends && isWeekendCol(dIdx) && !day.isOutside && !day.disabled ? 'bg-rose-50/40' : '', \n dragOverKey === day.date.toDateString() ? dropTargetBgClass : '', \n ]\" \n > \n <div \n v-if=\"keyboardNavigation && day.date.getTime() === focusedDate.getTime()\" \n :class=\"['absolute inset-0 pointer-events-none z-30 ring-2 ring-inset', focusRingColorClass]\" \n ></div> \n <slot name=\"day\" :day=\"day\" :events=\"eventsForDay(day.date)\"> \n <div class=\"flex items-center justify-end px-1.5 pt-1 pb-0.5 h-7\"> \n <span \n :class=\"[ \n 'inline-flex items-center justify-center text-xs font-medium w-6 h-6', \n day.isToday ? [todayBgClass, pillRadiusClass] : '', \n !day.isToday && day.isOutside ? 'text-muted-foreground/40' : '', \n !day.isToday && !day.isOutside ? 'text-foreground/80' : '', \n ]\" \n > \n {{ day.day }} \n </span> \n </div> \n \n <div class=\"flex-1\" :style=\"{ paddingBottom: `${visibleLanes * laneHeight + (week.overflow[dIdx] > 0 ? 18 : 0)}px` }\"></div> \n \n <button \n v-if=\"week.overflow[dIdx] > 0\" \n type=\"button\" \n @click.stop=\"handleMoreClick(day.date, $event)\" \n class=\"absolute left-1.5 right-1.5 text-left text-[11px] text-muted-foreground hover:text-foreground font-medium px-1 py-0.5 cursor-pointer focus:outline-none z-20\" \n :style=\"{ bottom: '2px' }\" \n > \n + {{ week.overflow[dIdx] }} more \n </button> \n </slot> \n </div> \n \n <div\n v-for=\"seg in week.visibleSegments\"\n :key=\"seg.key\"\n :draggable=\"draggableEvents && !seg.event.allDay ? true : draggableEvents\"\n @dragstart=\"onDragStart(seg.event, $event)\"\n @dragend=\"onDragEnd\"\n @click.stop=\"handleEventClick(seg.event, $event)\"\n @mouseenter=\"onEventEnter(seg.event, !!seg.event.allDay, $event)\"\n @mousemove=\"onEventMove\"\n @mouseleave=\"onEventLeave\"\n @touchstart.passive=\"draggableEvents && onEventTouchStart(seg.event, $event)\"\n @touchmove=\"draggableEvents && onEventTouchMove($event)\"\n @touchend.passive=\"draggableEvents && onEventTouchEnd($event)\"\n @touchcancel.passive=\"onTouchDragCancel\" \n :style=\"{ \n left: `calc(${(seg.startCol / 7) * 100}% + 4px)`, \n width: `calc(${(seg.span / 7) * 100}% - 8px)`, \n top: `${28 + seg.lane * laneHeight}px`, \n height: `${laneHeight - 2}px`, \n }\" \n :class=\"[ \n 'absolute z-10 truncate text-xs px-1.5 flex items-center cursor-pointer transition-opacity hover:opacity-80 select-none', \n eventRadiusClass, \n draggableEvents ? 'cursor-grab active:cursor-grabbing' : '', \n eventColorClass(seg.event.color, showEventAccent), \n draggingId === seg.event.id ? 'opacity-50' : '', \n ]\" \n > \n <slot name=\"event\" :event=\"seg.event\" :segment=\"seg\"> \n <span v-if=\"!seg.event.allDay && seg.isFirst\" class=\"font-semibold mr-1\"> \n {{ formatEventTime(seg.event.start) }} \n </span> \n <span class=\"truncate\">{{ seg.event.title }}</span> \n </slot> \n </div> \n </div> \n </div> \n </div> \n \n <CalendarEventTooltip :state=\"hoverState\" :style=\"tooltipStyle\" :formatTime=\"formatEventTime\"> \n <!--\n A provided slot replaces the built-in card, so it gets the surface\n here; with no slot the fallback content keeps rendering its own.\n -->\n <template v-if=\"$slots['event-tooltip']\" #default=\"{ event, allDay }\">\n <div :class=\"CALENDAR_TOOLTIP_SURFACE\">\n <slot name=\"event-tooltip\" :event=\"event\" :allDay=\"allDay\" />\n </div>\n </template>\n </CalendarEventTooltip> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { ref, computed, watch, nextTick } from 'vue'; \nimport gsap from 'gsap'; \nimport { useCalendar, startOfDay, type CalendarDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport { useResolvedColor, useResolvedRadius } from '../../../composables/useModoConfig'; \nimport { eventColorClassStrong as eventColorClass } from '../../../composables/eventColors'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { MonthView, CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nimport { toCssLength } from '../../../utils/cssLength';\n\nimport { CALENDAR_TOOLTIP_SURFACE } from '../../../utils/calendarTooltip';\n\nconst props = withDefaults(defineProps<MonthView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n firstDayOfWeek: 0, \n color: 'default', \n maxEventsPerDay: 3, \n showWeekNumbers: false, \n fixedWeeks: true, \n showHeader: true, \n bordered: true, \n keyboardNavigation: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n highlightWeekends: false, \n showOutsideDays: true, \n showMonthYearSelects: true, \n showYearJump: true, \n draggableEvents: true, \n laneHeight: 22, \n}); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [date: Date]; \n 'event-click': [event: CalendarEvent, nativeEvent: MouseEvent]; \n 'day-click': [date: Date, events: CalendarEvent[], nativeEvent: MouseEvent]; \n 'more-click': [date: Date, events: CalendarEvent[], nativeEvent: MouseEvent]; \n 'create-event': [date: Date, nativeEvent: MouseEvent | KeyboardEvent]; \n 'event-drop': [event: CalendarEvent, newStart: Date, newEnd: Date | undefined]; \n}>(); \n \nconst currentDate = ref(new Date(props.modelValue)); \nconst focusedDate = ref(startOfDay(new Date(props.modelValue))); \nwatch(() => props.modelValue, (v) => { if (v) { currentDate.value = new Date(v); focusedDate.value = startOfDay(new Date(v)); } }); \n \nconst modelRef = computed({ \n get: () => currentDate.value, \n set: (v) => { currentDate.value = v; }, \n}); \n \nconst localeRef = computed(() => props.locale); \nconst firstDowRef = computed(() => props.firstDayOfWeek); \nconst fixedWeeksRef = computed(() => props.fixedWeeks); \nconst minDateRef = computed(() => props.minDate); \nconst maxDateRef = computed(() => props.maxDate); \nconst weekdayFormatRef = computed(() => props.dayNameFormat); \nconst showOutsideRef = computed(() => props.showOutsideDays); \nconst disabledDatesRef = computed(() => props.disabledDates); \nconst disabledDowRef = computed(() => props.disabledDaysOfWeek); \n \nconst { \n currentMonth, \n currentYear, \n monthLabel, \n weekDayLabels, \n calendarDays, \n prevMonth, \n nextMonth, \n prevYear, \n nextYear, \n goToToday, \n} = useCalendar({ \n modelValue: modelRef as unknown as import('vue').Ref<Date | null | undefined>, \n locale: localeRef, \n firstDayOfWeek: firstDowRef, \n fixedWeeks: fixedWeeksRef, \n minDate: minDateRef, \n maxDate: maxDateRef, \n disabledDates: disabledDatesRef, \n disabledDaysOfWeek: disabledDowRef, \n weekdayFormat: weekdayFormatRef, \n showOutsideDays: showOutsideRef, \n}); \n \nconst gridRef = ref<HTMLElement | null>(null); \nconst rootRef = ref<HTMLElement | null>(null); \nconst dayRefs = ref<Map<string, HTMLElement>>(new Map()); \nconst setDayRef = (date: Date, el: HTMLElement | null) => { \n const k = date.toDateString(); \n if (el) dayRefs.value.set(k, el); \n else dayRefs.value.delete(k); \n}; \n \nconst selectedMonth = computed({ \n get: () => currentMonth.value, \n set: (v: number) => { const dir = v > currentMonth.value ? 1 : -1; currentMonth.value = v; nextTick(() => animateChange(dir)); }, \n}); \nconst selectedYear = computed({ \n get: () => currentYear.value, \n set: (v: number) => { const dir = v > currentYear.value ? 1 : -1; currentYear.value = v; nextTick(() => animateChange(dir)); }, \n}); \n \nconst monthOptions = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n return Array.from({ length: 12 }, (_, i) => \n new Date(2024, i, 1).toLocaleString(locale, { month: 'long' }) \n ); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minYear ?? (props.minDate ? props.minDate.getFullYear() : currentYear.value - 10); \n const max = props.maxYear ?? (props.maxDate ? props.maxDate.getFullYear() : currentYear.value + 10); \n const out: number[] = []; \n for (let y = min; y <= max; y++) out.push(y); \n if (!out.includes(currentYear.value)) out.push(currentYear.value); \n return out.sort((a, b) => a - b); \n}); \n \nconst gridTemplateColumns = computed(() => { \n if (props.showWeekNumbers) return { gridTemplateColumns: '2.5rem repeat(7, minmax(0, 1fr))' }; \n return { gridTemplateColumns: 'repeat(7, minmax(0, 1fr))' }; \n}); \n \nconst isWeekendCol = (colIdx: number) => { \n const dow = (props.firstDayOfWeek + colIdx) % 7; \n return dow === 0 || dow === 6; \n}; \n \nconst getWeekNumber = (date: Date) => { \n const target = new Date(date.valueOf()); \n const dayNr = (date.getDay() + 6) % 7; \n target.setDate(target.getDate() - dayNr + 3); \n const firstThursday = target.valueOf(); \n target.setMonth(0, 1); \n if (target.getDay() !== 4) { \n target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7); \n } \n return 1 + Math.ceil((firstThursday - target.valueOf()) / 604800000); \n}; \n \nconst lastDayOfMonth = (y: number, mo: number) => new Date(y, mo + 1, 0); \nconst firstDayOfMonth = (y: number, mo: number) => new Date(y, mo, 1); \n \nconst isMonthDisabled = (month: number, year: number) => { \n const min = props.minDate; \n const max = props.maxDate; \n const end = lastDayOfMonth(year, month); \n const start = firstDayOfMonth(year, month); \n if (min && end < startOfDay(min)) return true; \n if (max && start > startOfDay(max)) return true; \n return false; \n}; \n \nconst isPrevMonthDisabled = computed(() => { \n if (!props.minDate) return false; \n const prev = new Date(currentYear.value, currentMonth.value, 0); \n return prev < startOfDay(props.minDate); \n}); \nconst isNextMonthDisabled = computed(() => { \n if (!props.maxDate) return false; \n const next = new Date(currentYear.value, currentMonth.value + 1, 1); \n return next > startOfDay(props.maxDate); \n}); \nconst isPrevYearDisabled = computed(() => { \n if (props.minYear !== undefined && currentYear.value <= props.minYear) return true; \n if (props.minDate && new Date(currentYear.value - 1, 11, 31) < startOfDay(props.minDate)) return true; \n return false; \n}); \nconst isNextYearDisabled = computed(() => { \n if (props.maxYear !== undefined && currentYear.value >= props.maxYear) return true; \n if (props.maxDate && new Date(currentYear.value + 1, 0, 1) > startOfDay(props.maxDate)) return true; \n return false; \n}); \n \ninterface EventSegment { \n key: string; \n event: CalendarEvent; \n startCol: number; \n span: number; \n lane: number; \n isFirst: boolean; \n} \n \ninterface WeekData { \n days: CalendarDay[]; \n visibleSegments: EventSegment[]; \n overflow: number[]; \n} \n \nconst visibleLanes = computed(() => props.maxEventsPerDay); \n \nconst dayMs = 86400000; \n \nconst getEventDayRange = (ev: CalendarEvent) => { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n return { s, e }; \n}; \n \nconst weeksData = computed<WeekData[]>(() => { \n const days = calendarDays.value; \n const weeks: CalendarDay[][] = []; \n for (let i = 0; i < days.length; i += 7) weeks.push(days.slice(i, i + 7)); \n \n const sortedEvents = [...props.events].sort((a, b) => { \n const aLen = (a.end ? startOfDay(a.end).getTime() : startOfDay(a.start).getTime()) - startOfDay(a.start).getTime(); \n const bLen = (b.end ? startOfDay(b.end).getTime() : startOfDay(b.start).getTime()) - startOfDay(b.start).getTime(); \n if (bLen !== aLen) return bLen - aLen; \n return a.start.getTime() - b.start.getTime(); \n }); \n \n return weeks.map((weekDays) => { \n const weekStart = startOfDay(weekDays[0].date); \n const weekEnd = startOfDay(weekDays[6].date); \n \n const segs: Omit<EventSegment, 'key'>[] = []; \n const lanesTaken: Set<number>[] = Array.from({ length: 7 }, () => new Set()); \n \n const weekEvents = sortedEvents.filter(ev => { \n const { s, e } = getEventDayRange(ev); \n return e.getTime() >= weekStart.getTime() && s.getTime() <= weekEnd.getTime(); \n }); \n \n for (const ev of weekEvents) { \n const { s, e } = getEventDayRange(ev); \n const segStart = s.getTime() < weekStart.getTime() ? weekStart : s; \n const segEnd = e.getTime() > weekEnd.getTime() ? weekEnd : e; \n const startCol = Math.round((segStart.getTime() - weekStart.getTime()) / dayMs); \n const span = Math.round((segEnd.getTime() - segStart.getTime()) / dayMs) + 1; \n \n let lane = 0; \n while (true) { \n let ok = true; \n for (let c = startCol; c < startCol + span; c++) { \n if (lanesTaken[c].has(lane)) { ok = false; break; } \n } \n if (ok) break; \n lane++; \n } \n for (let c = startCol; c < startCol + span; c++) lanesTaken[c].add(lane); \n \n segs.push({ \n event: ev, \n startCol, \n span, \n lane, \n isFirst: s.getTime() >= weekStart.getTime(), \n }); \n } \n \n const visibleSegments: EventSegment[] = segs \n .filter(s => s.lane < visibleLanes.value) \n .map(s => ({ ...s, key: `${s.event.id}-${s.startCol}` })); \n \n const overflow = Array.from({ length: 7 }, (_, c) => { \n let count = 0; \n for (const s of segs) { \n if (s.lane >= visibleLanes.value && c >= s.startCol && c < s.startCol + s.span) count++; \n } \n return count; \n }); \n \n return { days: weekDays, visibleSegments, overflow }; \n }); \n}); \n \nconst eventsForDay = (date: Date): CalendarEvent[] => { \n return props.events \n .filter(ev => { \n const { s, e } = getEventDayRange(ev); \n const d0 = startOfDay(date).getTime(); \n return d0 >= s.getTime() && d0 <= e.getTime(); \n }) \n .sort((a, b) => { \n if (a.allDay && !b.allDay) return -1; \n if (!a.allDay && b.allDay) return 1; \n return a.start.getTime() - b.start.getTime(); \n }); \n}; \n \nconst formatEventTime = (d: Date) => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n return d.toLocaleTimeString(locale, { hour: '2-digit', minute: '2-digit' }); \n}; \n \nconst animateChange = (direction: 1 | -1) => { \n if (!gridRef.value) return; \n gsap.fromTo( \n gridRef.value, \n { opacity: 0, x: 20 * direction }, \n { opacity: 1, x: 0, duration: 0.25, ease: 'power2.out' } \n ); \n}; \n \nconst handlePrevMonth = () => { prevMonth(); nextTick(() => animateChange(-1)); }; \nconst handleNextMonth = () => { nextMonth(); nextTick(() => animateChange(1)); }; \nconst handlePrevYear = () => { prevYear(); nextTick(() => animateChange(-1)); }; \nconst handleNextYear = () => { nextYear(); nextTick(() => animateChange(1)); }; \nconst handleToday = () => { \n const now = goToToday(); \n currentDate.value = now; \n focusedDate.value = startOfDay(now); \n emit('update:modelValue', now); \n nextTick(() => animateChange(1)); \n}; \n \nconst clickTimer = ref<ReturnType<typeof setTimeout> | null>(null); \nconst DOUBLE_CLICK_DELAY = 220; \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \n \nconst handleDayClick = (day: CalendarDay, e: MouseEvent) => { \n if (day.disabled) return; \n currentDate.value = day.date; \n focusedDate.value = startOfDay(day.date); \n emit('update:modelValue', day.date); \n if (clickTimer.value) clearTimeout(clickTimer.value); \n clickTimer.value = setTimeout(() => { \n emit('day-click', day.date, eventsForDay(day.date), e); \n clickTimer.value = null; \n }, DOUBLE_CLICK_DELAY); \n}; \n \nconst handleDayDblClick = (day: CalendarDay, e: MouseEvent) => { \n if (day.disabled) return; \n if (clickTimer.value) { clearTimeout(clickTimer.value); clickTimer.value = null; } \n emit('create-event', day.date, e); \n}; \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => emit('event-click', ev, e); \nconst handleMoreClick = (date: Date, e: MouseEvent) => emit('more-click', date, eventsForDay(date), e); \n \nconst draggingId = ref<string | number | null>(null);\nconst dragOverKey = ref<string | null>(null);\n\nconst onDragStart = (ev: CalendarEvent, e: DragEvent) => {\n if (!props.draggableEvents) return;\n draggingId.value = ev.id;\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', String(ev.id));\n }\n};\nconst onDragEnd = () => {\n draggingId.value = null;\n dragOverKey.value = null;\n};\nconst onDragOver = (day: CalendarDay, e: DragEvent) => {\n if (!props.draggableEvents || draggingId.value === null) return;\n if (day.disabled) { if (e.dataTransfer) e.dataTransfer.dropEffect = 'none'; return; }\n if (e.dataTransfer) e.dataTransfer.dropEffect = 'move';\n dragOverKey.value = day.date.toDateString();\n};\nconst onDrop = (day: CalendarDay, _e: DragEvent) => {\n if (!props.draggableEvents || draggingId.value === null) return;\n if (day.disabled) { onDragEnd(); return; }\n const ev = props.events.find(e => e.id === draggingId.value);\n if (!ev) { onDragEnd(); return; }\n const oldStart = startOfDay(ev.start);\n const diff = startOfDay(day.date).getTime() - oldStart.getTime();\n const newStart = new Date(ev.start.getTime() + diff);\n const newEnd = ev.end ? new Date(ev.end.getTime() + diff) : undefined;\n emit('event-drop', ev, newStart, newEnd);\n onDragEnd();\n};\n\n/* ---------- Touch drag (mobile — HTML5 drag API doesn't work on touch) ---------- */\n\nlet touchHoldTimer: ReturnType<typeof setTimeout> | null = null;\nlet touchDragEventId: string | number | null = null;\nconst touchDragActive = ref(false);\nlet touchDragEl: HTMLElement | null = null;\n\nconst onEventTouchStart = (ev: CalendarEvent, e: TouchEvent) => {\n touchDragEventId = ev.id;\n touchDragEl = e.currentTarget as HTMLElement;\n touchHoldTimer = setTimeout(() => {\n touchDragActive.value = true;\n draggingId.value = ev.id;\n }, 350);\n};\n\nconst onEventTouchMove = (e: TouchEvent) => {\n if (!touchDragActive.value) {\n // Touch moved before hold — cancel pending drag.\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n touchDragEventId = null;\n return;\n }\n e.preventDefault();\n const touch = e.touches[0];\n // Temporarily hide the dragged element so elementFromPoint returns the day underneath.\n if (touchDragEl) touchDragEl.style.pointerEvents = 'none';\n const target = document.elementFromPoint(touch.clientX, touch.clientY);\n if (touchDragEl) touchDragEl.style.pointerEvents = '';\n const dayEl = (target as Element | null)?.closest('[data-day-key]') as HTMLElement | null;\n dragOverKey.value = dayEl?.dataset.dayKey ?? null;\n};\n\nconst onEventTouchEnd = (e: TouchEvent) => {\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n if (!touchDragActive.value) { touchDragEventId = null; return; }\n\n const touch = e.changedTouches[0];\n if (touchDragEl) touchDragEl.style.pointerEvents = 'none';\n const target = document.elementFromPoint(touch.clientX, touch.clientY);\n if (touchDragEl) touchDragEl.style.pointerEvents = '';\n\n const dayKey = (target as Element | null)?.closest('[data-day-key]')\n ?.getAttribute('data-day-key');\n\n if (dayKey && touchDragEventId !== null) {\n for (const week of weeksData.value) {\n const day = week.days.find(d => d.date.toDateString() === dayKey);\n if (day) { onDrop(day, {} as DragEvent); break; }\n }\n }\n onTouchDragCancel();\n};\n\nconst onTouchDragCancel = () => {\n if (touchHoldTimer) { clearTimeout(touchHoldTimer); touchHoldTimer = null; }\n touchDragActive.value = false;\n touchDragEventId = null;\n touchDragEl = null;\n draggingId.value = null;\n dragOverKey.value = null;\n}; \n \nconst focusDay = (date: Date) => { \n focusedDate.value = startOfDay(date); \n nextTick(() => { \n const el = dayRefs.value.get(focusedDate.value.toDateString()); \n if (el) el.focus(); \n else rootRef.value?.focus(); \n }); \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.keyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n const d = new Date(focusedDate.value); \n let handled = true; \n if (e.key === 'ArrowLeft') d.setDate(d.getDate() - 1); \n else if (e.key === 'ArrowRight') d.setDate(d.getDate() + 1); \n else if (e.key === 'ArrowUp') d.setDate(d.getDate() - 7); \n else if (e.key === 'ArrowDown') d.setDate(d.getDate() + 7); \n else if (e.key === 'Home') d.setDate(d.getDate() - ((d.getDay() - props.firstDayOfWeek + 7) % 7)); \n else if (e.key === 'End') d.setDate(d.getDate() + (6 - ((d.getDay() - props.firstDayOfWeek + 7) % 7))); \n else if (e.key === 'PageUp') d.setMonth(d.getMonth() - 1); \n else if (e.key === 'PageDown') d.setMonth(d.getMonth() + 1); \n else if (e.key === 'Enter' || e.key === ' ') { emit('day-click', focusedDate.value, eventsForDay(focusedDate.value), e as unknown as MouseEvent); handled = true; } \n else if (e.key.toLowerCase() === 'c') { emit('create-event', focusedDate.value, e); handled = true; } \n else if (e.key.toLowerCase() === 't') handleToday(); \n else handled = false; \n \n if (handled) { \n e.preventDefault(); \n if (e.key.startsWith('Arrow') || e.key === 'Home' || e.key === 'End' || e.key === 'PageUp' || e.key === 'PageDown') { \n if (d.getMonth() !== currentMonth.value || d.getFullYear() !== currentYear.value) { \n currentMonth.value = d.getMonth(); \n currentYear.value = d.getFullYear(); \n nextTick(() => animateChange(d > focusedDate.value ? 1 : -1)); \n } \n focusDay(d); \n } \n } \n}; \n \nwatch([currentMonth, currentYear], () => { \n currentDate.value = new Date(currentYear.value, currentMonth.value, 1); \n if (focusedDate.value.getMonth() !== currentMonth.value || focusedDate.value.getFullYear() !== currentYear.value) { \n const lastDay = new Date(currentYear.value, currentMonth.value + 1, 0).getDate(); \n const targetDay = Math.min(focusedDate.value.getDate(), lastDay); \n focusedDate.value = new Date(currentYear.value, currentMonth.value, targetDay); \n } \n}); \n \nconst focusGrid = () => { \n nextTick(() => { \n const el = dayRefs.value.get(focusedDate.value.toDateString()); \n if (el) el.focus(); \n else rootRef.value?.focus(); \n }); \n}; \n \ndefineExpose({ focusGrid }); \n \nconst resolvedColor = useResolvedColor(() => props.color); \nconst resolvedRadius = useResolvedRadius(() => props.radius); \n \nconst { \n todayTextClass, \n todayBgClass, \n focusRingColorClass, \n containerRadiusClass, \n eventRadiusClass, \n showEventAccent, \n pillRadiusClass, \n dayNameCaseClass, \n} = useCalendarTheme({ \n color: () => resolvedColor.value, \n radius: () => resolvedRadius.value, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst dropTargetBgClass = computed(() => ({ \n default: 'bg-muted', \n primary: 'bg-primary-subtle', \n danger: 'bg-destructive-subtle', \n success: 'bg-success-subtle', \n warning: 'bg-warning-subtle', \n}[resolvedColor.value] ?? 'bg-primary-subtle')); \n</script> \n \n<style scoped> \n.month-disabled-day { \n background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, 0.04) 6px 7px); \n} \n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4XA,IAAM,QAAQ;AAoHd,IAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAzS3B,MAAM,QAAQ;EAsBd,MAAM,OAAO;EASb,MAAM,eAAA,GAAA,IAAA,KAAkB,IAAI,KAAK,MAAM,WAAW,CAAC;EACnD,MAAM,eAAA,GAAA,IAAA,KAAkB,oBAAA,WAAW,IAAI,KAAK,MAAM,WAAW,CAAC,CAAC;EAC/D,CAAA,GAAA,IAAA,aAAY,MAAM,aAAa,MAAM;GAAE,IAAI,GAAG;IAAE,YAAY,QAAQ,IAAI,KAAK,EAAE;IAAE,YAAY,QAAQ,oBAAA,WAAW,IAAI,KAAK,EAAE,CAAC;;IAAM;EAElI,MAAM,YAAA,GAAA,IAAA,UAAoB;GACtB,WAAW,YAAY;GACvB,MAAM,MAAM;IAAE,YAAY,QAAQ;;GACrC,CAAC;EAEF,MAAM,aAAA,GAAA,IAAA,gBAA2B,MAAM,OAAO;EAC9C,MAAM,eAAA,GAAA,IAAA,gBAA6B,MAAM,eAAe;EACxD,MAAM,iBAAA,GAAA,IAAA,gBAA+B,MAAM,WAAW;EACtD,MAAM,cAAA,GAAA,I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JU,IAAI,MAAM,UAAU,IAAI,YAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAE9B,QAFP,aAAA,GAAA,IAAA,iBACO,gBAAgB,IAAI,MAAM,MAAK,CAAA,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,GAAA,GAAA,IAAA,oBAEa,QAAnD,aAAA,GAAA,IAAA,iBAA0B,IAAI,MAAM,MAAK,EAAA,EAAA,CAAA,EAAA,KAAA,CAAA,EAAA,IAAA,WAAA;;;yBAiBtC,6BAAA,SAAA;KAVA,QAAA,GAAA,IAAA,OAAO,WAAU;KAAG,QAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,OAAO,aAAY,CAAA;KAAG,YAAY;uCAKzDA,KAAAA,OAAM,mBAAA;WAAoB;2BAGhC,EAH2C,OAAO,aAAM,EAAA,GAAA,IAAA,oBAGxD,OAAA,EAFA,QAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,OAAO,wBAAA,yBAAwB,CAAA,EAAA,EAAA,EAAA,GAAA,IAAA,YAC4B,KAAA,QAAA,iBAAA;MAA1B;MAAgB"}
|
package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs
CHANGED
|
@@ -5,8 +5,10 @@ import { useCalendarTheme } from "../../../composables/useCalendarTheme.mjs";
|
|
|
5
5
|
import { useEventHover } from "../../../composables/useEventHover.mjs";
|
|
6
6
|
import CalendarEventTooltip_default from "./CalendarEventTooltip.mjs";
|
|
7
7
|
import CalendarHeader_default from "./CalendarHeader.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
8
|
+
import { toCssLength } from "../../../utils/cssLength.mjs";
|
|
9
|
+
import { CALENDAR_TOOLTIP_SURFACE } from "../../../utils/calendarTooltip.mjs";
|
|
10
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, openBlock, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx, withModifiers } from "vue";
|
|
11
|
+
import gsap$1 from "gsap";
|
|
10
12
|
//#region src/components/data-display/calendar/MonthView.vue?vue&type=script&setup=true&lang.ts
|
|
11
13
|
var _hoisted_1 = {
|
|
12
14
|
key: 0,
|
|
@@ -68,6 +70,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
68
70
|
type: Boolean,
|
|
69
71
|
default: true
|
|
70
72
|
},
|
|
73
|
+
maxHeight: {},
|
|
71
74
|
keyboardNavigation: {
|
|
72
75
|
type: Boolean,
|
|
73
76
|
default: true
|
|
@@ -313,7 +316,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
313
316
|
};
|
|
314
317
|
const animateChange = (direction) => {
|
|
315
318
|
if (!gridRef.value) return;
|
|
316
|
-
gsap.fromTo(gridRef.value, {
|
|
319
|
+
gsap$1.fromTo(gridRef.value, {
|
|
317
320
|
opacity: 0,
|
|
318
321
|
x: 20 * direction
|
|
319
322
|
}, {
|
|
@@ -530,14 +533,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
530
533
|
__expose({ focusGrid });
|
|
531
534
|
const resolvedColor = useResolvedColor(() => props.color);
|
|
532
535
|
const resolvedRadius = useResolvedRadius(() => props.radius);
|
|
533
|
-
const todayBgClass
|
|
534
|
-
default: "bg-foreground text-background",
|
|
535
|
-
primary: "bg-primary text-primary-foreground",
|
|
536
|
-
danger: "bg-destructive text-destructive-foreground",
|
|
537
|
-
success: "bg-success text-success-foreground",
|
|
538
|
-
warning: "bg-warning text-warning-foreground"
|
|
539
|
-
})[resolvedColor.value] ?? "bg-primary text-primary-foreground");
|
|
540
|
-
const { todayTextClass, focusRingColorClass, containerRadiusClass, eventRadiusClass, pillRadiusClass, dayNameCaseClass } = useCalendarTheme({
|
|
536
|
+
const { todayTextClass, todayBgClass, focusRingColorClass, containerRadiusClass, eventRadiusClass, showEventAccent, pillRadiusClass, dayNameCaseClass } = useCalendarTheme({
|
|
541
537
|
color: () => resolvedColor.value,
|
|
542
538
|
radius: () => resolvedRadius.value,
|
|
543
539
|
dayNameCase: () => props.dayNameCase
|
|
@@ -559,6 +555,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
559
555
|
unref(containerRadiusClass),
|
|
560
556
|
__props.bordered ? "border border-border" : ""
|
|
561
557
|
]),
|
|
558
|
+
style: normalizeStyle({ maxHeight: unref(toCssLength)(__props.maxHeight) }),
|
|
562
559
|
onKeydown: handleKeydown
|
|
563
560
|
}, [
|
|
564
561
|
renderSlot(_ctx.$slots, "header", {
|
|
@@ -634,7 +631,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
634
631
|
createElementVNode("div", {
|
|
635
632
|
ref_key: "gridRef",
|
|
636
633
|
ref: gridRef,
|
|
637
|
-
class: "flex-1 flex flex-col"
|
|
634
|
+
class: "flex-1 flex flex-col overflow-y-auto"
|
|
638
635
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(weeksData.value, (week, wIdx) => {
|
|
639
636
|
return openBlock(), createElementBlock("div", {
|
|
640
637
|
key: wIdx,
|
|
@@ -667,7 +664,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
667
664
|
}, () => [
|
|
668
665
|
createElementVNode("div", _hoisted_5, [createElementVNode("span", { class: normalizeClass([
|
|
669
666
|
"inline-flex items-center justify-center text-xs font-medium w-6 h-6",
|
|
670
|
-
day.isToday ? [todayBgClass
|
|
667
|
+
day.isToday ? [unref(todayBgClass), unref(pillRadiusClass)] : "",
|
|
671
668
|
!day.isToday && day.isOutside ? "text-muted-foreground/40" : "",
|
|
672
669
|
!day.isToday && !day.isOutside ? "text-foreground/80" : ""
|
|
673
670
|
]) }, toDisplayString(day.day), 3)]),
|
|
@@ -707,7 +704,7 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
707
704
|
"absolute z-10 truncate text-xs px-1.5 flex items-center cursor-pointer transition-opacity hover:opacity-80 select-none",
|
|
708
705
|
unref(eventRadiusClass),
|
|
709
706
|
__props.draggableEvents ? "cursor-grab active:cursor-grabbing" : "",
|
|
710
|
-
unref(eventColorClassStrong)(seg.event.color),
|
|
707
|
+
unref(eventColorClassStrong)(seg.event.color, unref(showEventAccent)),
|
|
711
708
|
draggingId.value === seg.event.id ? "opacity-50" : ""
|
|
712
709
|
])
|
|
713
710
|
}, [renderSlot(_ctx.$slots, "event", {
|
|
@@ -720,14 +717,15 @@ var MonthView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
720
717
|
state: unref(hoverState),
|
|
721
718
|
style: normalizeStyle(unref(tooltipStyle)),
|
|
722
719
|
formatTime: formatEventTime
|
|
723
|
-
}, {
|
|
724
|
-
|
|
720
|
+
}, createSlots({ _: 2 }, [_ctx.$slots["event-tooltip"] ? {
|
|
721
|
+
name: "default",
|
|
722
|
+
fn: withCtx(({ event, allDay }) => [createElementVNode("div", { class: normalizeClass(unref(CALENDAR_TOOLTIP_SURFACE)) }, [renderSlot(_ctx.$slots, "event-tooltip", {
|
|
725
723
|
event,
|
|
726
724
|
allDay
|
|
727
|
-
}, void 0, true)]),
|
|
728
|
-
|
|
729
|
-
},
|
|
730
|
-
],
|
|
725
|
+
}, void 0, true)], 2)]),
|
|
726
|
+
key: "0"
|
|
727
|
+
} : void 0]), 1032, ["state", "style"])
|
|
728
|
+
], 38);
|
|
731
729
|
};
|
|
732
730
|
}
|
|
733
731
|
});
|