mood-ui 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/components/data-display/calendar/AgendaView.cjs.map +1 -1
  2. package/dist/components/data-display/calendar/AgendaView.mjs.map +1 -1
  3. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs +4 -1
  4. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  5. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs +4 -1
  6. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  7. package/dist/components/data-display/calendar/DayView.cjs.map +1 -1
  8. package/dist/components/data-display/calendar/DayView.mjs.map +1 -1
  9. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs +7 -4
  10. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  11. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs +7 -4
  12. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  13. package/dist/components/data-display/calendar/MonthView.cjs +1 -1
  14. package/dist/components/data-display/calendar/MonthView.cjs.map +1 -1
  15. package/dist/components/data-display/calendar/MonthView.mjs +1 -1
  16. package/dist/components/data-display/calendar/MonthView.mjs.map +1 -1
  17. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs +8 -12
  18. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  19. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs +8 -12
  20. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  21. package/dist/components/data-display/calendar/Scheduler.cjs.map +1 -1
  22. package/dist/components/data-display/calendar/Scheduler.mjs.map +1 -1
  23. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs +7 -4
  24. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  25. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs +7 -4
  26. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  27. package/dist/components/data-display/calendar/WeekView.cjs.map +1 -1
  28. package/dist/components/data-display/calendar/WeekView.mjs.map +1 -1
  29. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs +7 -4
  30. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  31. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs +7 -4
  32. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  33. package/dist/components/data-display/date-picker/DateTimePicker.cjs.map +1 -1
  34. package/dist/components/data-display/date-picker/DateTimePicker.mjs.map +1 -1
  35. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs +1 -1
  36. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  37. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs +1 -1
  38. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  39. package/dist/components/feedback/Drawer.cjs.map +1 -1
  40. package/dist/components/feedback/Drawer.mjs.map +1 -1
  41. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs +4 -9
  42. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  43. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs +4 -9
  44. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  45. package/dist/components/feedback/Modal.cjs.map +1 -1
  46. package/dist/components/feedback/Modal.mjs.map +1 -1
  47. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs +4 -9
  48. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  49. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs +4 -9
  50. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  51. package/dist/components/feedback/Tooltip.cjs.map +1 -1
  52. package/dist/components/feedback/Tooltip.mjs.map +1 -1
  53. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs +44 -17
  54. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  55. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs +44 -17
  56. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  57. package/dist/components/forms/Combobox.cjs.map +1 -1
  58. package/dist/components/forms/Combobox.mjs.map +1 -1
  59. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs +2 -2
  60. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  61. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs +2 -2
  62. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  63. package/dist/components/forms/PhoneInput.cjs.map +1 -1
  64. package/dist/components/forms/PhoneInput.mjs.map +1 -1
  65. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs +6 -1
  66. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  67. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs +6 -1
  68. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  69. package/dist/components/forms/SearchInput.cjs.map +1 -1
  70. package/dist/components/forms/SearchInput.mjs.map +1 -1
  71. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs +8 -6
  72. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  73. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs +8 -6
  74. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  75. package/dist/components/layout/PopoverPanel.cjs +1 -1
  76. package/dist/components/layout/PopoverPanel.cjs.map +1 -1
  77. package/dist/components/layout/PopoverPanel.mjs +1 -1
  78. package/dist/components/layout/PopoverPanel.mjs.map +1 -1
  79. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs +2 -2
  80. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  81. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs +2 -2
  82. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  83. package/dist/components/navigation/Switcher.cjs.map +1 -1
  84. package/dist/components/navigation/Switcher.mjs.map +1 -1
  85. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs +38 -40
  86. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  87. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs +38 -40
  88. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  89. package/dist/composables/eventColors.cjs +51 -27
  90. package/dist/composables/eventColors.cjs.map +1 -1
  91. package/dist/composables/eventColors.mjs +51 -27
  92. package/dist/composables/eventColors.mjs.map +1 -1
  93. package/dist/composables/useBodyScrollLock.cjs +44 -0
  94. package/dist/composables/useBodyScrollLock.cjs.map +1 -0
  95. package/dist/composables/useBodyScrollLock.mjs +43 -0
  96. package/dist/composables/useBodyScrollLock.mjs.map +1 -0
  97. package/dist/composables/useCalendarTheme.cjs +29 -8
  98. package/dist/composables/useCalendarTheme.cjs.map +1 -1
  99. package/dist/composables/useCalendarTheme.mjs +29 -8
  100. package/dist/composables/useCalendarTheme.mjs.map +1 -1
  101. package/dist/composables/usePopover.cjs +44 -12
  102. package/dist/composables/usePopover.cjs.map +1 -1
  103. package/dist/composables/usePopover.mjs +44 -12
  104. package/dist/composables/usePopover.mjs.map +1 -1
  105. package/dist/mood-ui.css +9 -9
  106. package/dist/types/composables/eventColors.d.ts +2 -2
  107. package/dist/types/composables/useBodyScrollLock.d.ts +19 -0
  108. package/dist/types/composables/useCalendarTheme.d.ts +2 -0
  109. package/dist/types/interfaces/data-display/calendar/AgendaView.interface.d.ts +5 -0
  110. package/dist/types/interfaces/data-display/calendar/DayView.interface.d.ts +5 -0
  111. package/dist/types/interfaces/data-display/calendar/MonthView.interface.d.ts +5 -0
  112. package/dist/types/interfaces/data-display/calendar/Scheduler.interface.d.ts +5 -0
  113. package/dist/types/interfaces/data-display/calendar/WeekView.interface.d.ts +5 -0
  114. package/dist/types/utils/cssLength.d.ts +5 -0
  115. package/dist/types/utils/tooltipArrow.d.ts +34 -0
  116. package/dist/utils/cssLength.cjs +13 -0
  117. package/dist/utils/cssLength.cjs.map +1 -0
  118. package/dist/utils/cssLength.mjs +13 -0
  119. package/dist/utils/cssLength.mjs.map +1 -0
  120. package/dist/utils/tooltipArrow.cjs +37 -0
  121. package/dist/utils/tooltipArrow.cjs.map +1 -0
  122. package/dist/utils/tooltipArrow.mjs +36 -0
  123. package/dist/utils/tooltipArrow.mjs.map +1 -0
  124. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AgendaView.cjs","names":[],"sources":["../../../../src/components/data-display/calendar/AgendaView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['relative flex flex-col bg-card overflow-hidden focus:outline-none', containerRadiusClass, bordered ? 'border border-border' : '']\" \n @keydown=\"handleKeydown\" \n > \n <slot name=\"header\" :label=\"headerLabel\" :goToToday=\"handleToday\" :prev=\"handlePrev\" :next=\"handleNext\" :prevYear=\"handlePrevYear\" :nextYear=\"handleNextYear\"> \n <CalendarHeader \n :label=\"headerLabel\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearNavigation\" \n :showTodayButton=\"showTodayButton\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrev\" \n @next=\"handleNext\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div ref=\"scrollRef\" class=\"flex-1 overflow-y-auto\" @scroll=\"onScroll\"> \n <div v-if=\"!groups.length\" class=\"flex-1 flex items-center justify-center py-12 text-sm text-muted-foreground\"> \n <slot name=\"empty\">{{ emptyText ?? loc.agenda.empty }}</slot> \n </div> \n \n <template v-for=\"(g, gi) in groups\" :key=\"g.key\"> \n <div \n v-if=\"showMonthSeparator && g.showMonthHeader\" \n class=\"sticky top-0 z-20 bg-card/95 backdrop-blur px-4 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground border-b border-border\" \n > \n {{ g.monthLabel }} \n </div> \n \n <div \n :data-dkey=\"g.key\" \n :class=\"[ \n 'grid border-b border-border transition-colors', \n g.isToday ? 'bg-muted/40' : '', \n g.disabled ? 'opacity-60' : '', \n ]\" \n style=\"grid-template-columns: 5rem 1fr;\" \n > \n <div class=\"flex flex-col items-center justify-start py-4 border-r border-border\"> \n <slot name=\"day-header\" :date=\"g.date\" :isToday=\"g.isToday\" :events=\"g.events\"> \n <span :class=\"['text-[10px] font-medium tracking-wider text-muted-foreground', dayNameCaseClass]\">{{ g.weekdayLabel }}</span> \n <span \n :class=\"[ \n 'mt-1 inline-flex items-center justify-center text-base font-semibold w-9 h-9', \n pillRadiusClass, \n g.isToday ? [todayBgClass] : 'text-foreground', \n ]\" \n >{{ g.day }}</span> \n <span v-if=\"isHighlightedDate(g.date)\" :class=\"['mt-1 w-1 h-1 rounded-full', highlightDotClass]\"></span> \n </slot> \n </div> \n \n <div class=\"py-2 px-3\"> \n <div v-if=\"!g.events.length\" class=\"py-2 text-xs text-muted-foreground/60 italic\"> \n No events \n </div> \n <div v-else class=\"flex flex-col\"> \n <button \n v-for=\"ev in g.events\" \n :key=\"`${g.key}-${ev.id}`\" \n :data-eid=\"ev.id\" \n type=\"button\" \n @click=\"handleEventClick(ev, $event)\" \n @mouseenter=\"onEventEnter(ev, !!ev.allDay, $event)\" \n @mousemove=\"onEventMove\" \n @mouseleave=\"onEventLeave\" \n :class=\"['group flex items-start gap-3 py-2 px-2 -mx-2 cursor-pointer transition-colors hover:bg-muted/70 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-ring', eventRadiusClass]\" \n > \n <span class=\"shrink-0 w-16 pt-0.5 text-[11px] font-medium text-muted-foreground tabular-nums\"> \n <template v-if=\"ev.allDay\">All day</template> \n <template v-else>{{ formatEventTime(ev.start) }}</template> \n </span> \n <span \n class=\"shrink-0 mt-1.5 w-2 h-2\" \n :style=\"ev.colorHex ? { backgroundColor: ev.colorHex } : undefined\" \n :class=\"[pillRadiusClass, !ev.colorHex ? dotColorClass(ev.color) : '']\" \n ></span> \n <span class=\"flex-1 min-w-0\"> \n <slot name=\"event\" :event=\"ev\"> \n <span class=\"block text-sm font-medium text-foreground truncate\">{{ ev.title }}</span> \n <span v-if=\"!ev.allDay && ev.end\" class=\"block text-[11px] text-muted-foreground\"> \n {{ formatEventTime(ev.start) }} – {{ formatEventTime(ev.end) }} \n </span> \n <span v-if=\"ev.description\" class=\"block text-xs text-muted-foreground truncate mt-0.5\">{{ ev.description }}</span> \n </slot> \n </span> \n <span v-if=\"ev.readonly\" class=\"shrink-0 mt-0.5 text-[9px] uppercase tracking-wider text-muted-foreground border border-border px-1 rounded\">Locked</span> \n </button> \n </div> \n </div> \n </div> \n <div v-if=\"gi === groups.length - 1\" class=\"h-1\"></div> \n </template> \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, onMounted } from 'vue'; \nimport gsap from 'gsap'; \nimport { isSameDay, startOfDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useModoLocale } from '../../../composables/useModoConfig'; \n \nconst loc = useModoLocale(); \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { AgendaView } from '../../../interfaces/data-display/calendar/AgendaView.interface'; \nimport type { CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nconst props = withDefaults(defineProps<AgendaView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n color: 'default', \n bordered: true, \n daysToShow: 30, \n daysBefore: 0, \n showEmptyDays: false, \n showHeader: true, \n showMonthSeparator: true, \n showYearNavigation: false, \n showMonthYearSelects: false, \n showTodayButton: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n format: '24h', \n readonly: false, \n highlightedDates: () => [], \n disabledDates: () => [], \n disabledWeekdays: () => [], \n // emptyText resolves against locale when not provided. \n loadMoreChunk: 30, \n enableKeyboardNavigation: true, \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 'create-event': [date: Date, allDay: boolean, nativeEvent: MouseEvent | KeyboardEvent]; \n 'load-more': [direction: 'forward' | 'backward']; \n}>(); \n \nconst firstOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth(), 1); \nconst daysInMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate(); \n \nconst anchorDate = ref(firstOfMonth(new Date(props.modelValue))); \nconst daysForwardShown = ref(Math.max(props.daysToShow, daysInMonth(anchorDate.value))); \n \nwatch(() => props.modelValue, (v) => { \n if (!v) return; \n const f = firstOfMonth(new Date(v)); \n if (f.getTime() === anchorDate.value.getTime()) return; \n anchorDate.value = f; \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(f)); \n}); \nwatch(() => props.daysToShow, (n) => { daysForwardShown.value = Math.max(n, daysInMonth(anchorDate.value)); }); \n \nconst rootRef = ref<HTMLElement | null>(null); \nconst scrollRef = ref<HTMLElement | null>(null); \nconst today = new Date(); \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \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', hour12: props.format === '12h' }); \n}; \n \nconst isHighlightedDate = (d: Date) => props.highlightedDates.some(h => isSameDay(h, d)); \nconst isDisabledDate = (d: Date) => props.disabledDates.some(x => isSameDay(x, d)); \nconst isDisabledWeekday = (d: Date) => props.disabledWeekdays.includes(d.getDay()); \nconst isDayDisabled = (d: Date) => { \n if (props.minDate && startOfDay(d) < startOfDay(props.minDate)) return true; \n if (props.maxDate && startOfDay(d) > startOfDay(props.maxDate)) return true; \n return isDisabledDate(d) || isDisabledWeekday(d); \n}; \n \ninterface DayGroup { \n key: string; \n date: Date; \n day: number; \n weekdayLabel: string; \n monthLabel: string; \n showMonthHeader: boolean; \n isToday: boolean; \n disabled: boolean; \n events: CalendarEvent[]; \n} \n \nconst rangeDates = computed<Date[]>(() => { \n const anchor = anchorDate.value; \n const list: Date[] = []; \n for (let i = 0; i < daysForwardShown.value; i++) { \n const d = new Date(anchor); \n d.setDate(d.getDate() + i); \n const sod = startOfDay(d); \n if (props.minDate && sod < startOfDay(props.minDate)) continue; \n if (props.maxDate && sod > startOfDay(props.maxDate)) continue; \n list.push(sod); \n } \n return list; \n}); \n \nconst eventsByDay = computed<Map<string, CalendarEvent[]>>(() => { \n const map = new Map<string, CalendarEvent[]>(); \n for (const ev of props.events) { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n const d = new Date(s); \n while (d.getTime() <= e.getTime()) { \n const k = d.toDateString(); \n if (!map.has(k)) map.set(k, []); \n map.get(k)!.push(ev); \n d.setDate(d.getDate() + 1); \n } \n } \n for (const list of map.values()) { \n list.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 return map; \n}); \n \nconst isoKey = (d: Date) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`; \nconst parseIsoKey = (s: string): Date | null => { \n const m = s.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/); \n if (!m) return null; \n return new Date(parseInt(m[1]), parseInt(m[2]) - 1, parseInt(m[3])); \n}; \n \nconst groups = computed<DayGroup[]>(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const result: DayGroup[] = []; \n let lastMonthKey = ''; \n for (const date of rangeDates.value) { \n const key = isoKey(date); \n const evts = eventsByDay.value.get(date.toDateString()) ?? []; \n if (!props.showEmptyDays && !evts.length) continue; \n const monthKey = `${date.getFullYear()}-${date.getMonth()}`; \n const showMonthHeader = monthKey !== lastMonthKey; \n lastMonthKey = monthKey; \n result.push({ \n key, \n date, \n day: date.getDate(), \n weekdayLabel: date.toLocaleDateString(locale, { weekday: props.dayNameFormat }), \n monthLabel: date.toLocaleDateString(locale, { month: 'long', year: 'numeric' }), \n showMonthHeader, \n isToday: isSameDay(date, today), \n disabled: isDayDisabled(date), \n events: evts, \n }); \n } \n return result; \n}); \n \nconst headerLabel = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const d = visibleDate.value ?? anchorDate.value; \n return d.toLocaleDateString(locale, { month: 'long', year: 'numeric' }); \n}); \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => { \n emit('event-click', ev, e); \n}; \n \nconst afterNavigate = (scrollTarget?: Date, animateScroll = false) => { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) { animateIn(); return; } \n const scEl = scrollRef.value; \n let target = 0; \n if (scrollTarget) { \n const key = isoKey(startOfDay(scrollTarget)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n } \n } \n if (animateScroll && target > 0) { \n scEl.scrollTop = 0; \n animateIn(); \n gsap.to(scEl, { scrollTop: target, duration: 0.7, ease: 'power3.inOut', delay: 0.15 }); \n } else { \n scEl.scrollTop = target; \n animateIn(); \n } \n visibleDate.value = anchorDate.value; \n }); \n}; \nconst handlePrev = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNext = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleToday = () => { \n const n = new Date(); \n const wasCurrentMonth = firstOfMonth(n).getTime() === anchorDate.value.getTime(); \n anchorDate.value = firstOfMonth(n); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(n, !wasCurrentMonth); \n if (wasCurrentMonth && scrollRef.value && rootRef.value) { \n nextTick(() => { \n const key = isoKey(startOfDay(n)); \n const el = rootRef.value!.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value!.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value!.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value!, { scrollTop: target, duration: 0.6, ease: 'power3.inOut' }); \n }); \n } \n}; \nconst handlePrevYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNextYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \n \nconst animateIn = () => { \n if (!rootRef.value) return; \n const els = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n if (!els.length) return; \n gsap.fromTo( \n els, \n { opacity: 0, y: 8 }, \n { opacity: 1, y: 0, duration: 0.35, ease: 'power2.out', stagger: { amount: 0.2 } } \n ); \n}; \n \nlet loadingMore = false; \nconst visibleDate = ref<Date | null>(null); \nconst canExtend = () => { \n if (!props.maxDate) return true; \n const last = rangeDates.value[rangeDates.value.length - 1]; \n return !(last && startOfDay(last) >= startOfDay(props.maxDate)); \n}; \nconst onScroll = () => { \n if (!scrollRef.value) return; \n const el = scrollRef.value; \n if (rootRef.value) { \n const scRect = el.getBoundingClientRect(); \n const headers = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n let pick: Date | null = null; \n for (const h of headers) { \n const r = h.getBoundingClientRect(); \n if (r.bottom > scRect.top + 8) { \n const k = h.getAttribute('data-dkey'); \n if (k) pick = parseIsoKey(k); \n break; \n } \n } \n if (pick) visibleDate.value = pick; \n } \n if (loadingMore) return; \n const remaining = el.scrollHeight - (el.scrollTop + el.clientHeight); \n if (remaining < 120) { \n if (!canExtend()) return; \n loadingMore = true; \n daysForwardShown.value += props.loadMoreChunk; \n emit('load-more', 'forward'); \n setTimeout(() => { loadingMore = false; }, 120); \n } \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.enableKeyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n if (e.key === 'ArrowLeft' || e.key === 'PageUp') { e.preventDefault(); handlePrev(); } \n else if (e.key === 'ArrowRight' || e.key === 'PageDown') { e.preventDefault(); handleNext(); } \n else if (e.key.toLowerCase() === 't') { e.preventDefault(); handleToday(); } \n}; \n \nonMounted(() => { \n nextTick(() => { \n visibleDate.value = anchorDate.value; \n animateIn(); \n if (scrollRef.value && rootRef.value) { \n const todayMonth = firstOfMonth(today); \n if (todayMonth.getTime() === anchorDate.value.getTime()) { \n const key = isoKey(startOfDay(today)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scEl = scrollRef.value; \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n if (target > 0) { \n gsap.to(scEl, { scrollTop: target, duration: 0.9, ease: 'power3.inOut', delay: 0.25 }); \n } \n } \n } \n } \n }); \n}); \n \ndefineExpose({ \n scrollToDate(date: Date) { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) return; \n const key = isoKey(startOfDay(date)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value, { scrollTop: target, duration: 0.45, ease: 'power3.inOut' }); \n }); \n }, \n}); \n \nconst { todayTextClass, dayNameCaseClass, focusRingColorClass, highlightDotClass, containerRadiusClass, eventRadiusClass, pillRadiusClass, todayBgClass, resolvedColor } = useCalendarTheme({ \n color: () => props.color, \n radius: () => props.radius, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst DOT_THEMED: Record<string, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \nconst DOT_SEMANTIC: Record<string, string> = { \n info: 'bg-info', \n purple: 'bg-purple', \n pink: 'bg-pink', \n}; \nconst dotColorClass = (c?: CalendarEvent['color']) => { \n if (!c) return DOT_THEMED.default; \n return DOT_THEMED[c] ?? DOT_SEMANTIC[c] ?? DOT_THEMED.default; \n}; \n \nconst localeValue = computed(() => (props.locale === 'default' ? undefined : props.locale)); \n \nconst monthOptions = computed(() => { \n const base = new Date(2024, 0, 1); \n return Array.from({ length: 12 }, (_, i) => { \n const d = new Date(base); \n d.setMonth(i); \n return d.toLocaleString(localeValue.value, { month: 'long' }); \n }); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minDate?.getFullYear() ?? anchorDate.value.getFullYear() - 10; \n const max = props.maxDate?.getFullYear() ?? anchorDate.value.getFullYear() + 10; \n const list: number[] = []; \n for (let y = min; y <= max; y++) list.push(y); \n return list; \n}); \n \nconst selectedMonth = computed({ \n get: () => anchorDate.value.getMonth(), \n set: (mm: number) => { \n const d = new Date(anchorDate.value); \n d.setDate(1); \n d.setMonth(mm); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n \nconst selectedYear = computed({ \n get: () => anchorDate.value.getFullYear(), \n set: (yy: number) => { \n const d = new Date(anchorDate.value); \n d.setFullYear(yy); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n</script>\n"],"mappings":""}
1
+ {"version":3,"file":"AgendaView.cjs","names":[],"sources":["../../../../src/components/data-display/calendar/AgendaView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['relative 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\" :label=\"headerLabel\" :goToToday=\"handleToday\" :prev=\"handlePrev\" :next=\"handleNext\" :prevYear=\"handlePrevYear\" :nextYear=\"handleNextYear\"> \n <CalendarHeader \n :label=\"headerLabel\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearNavigation\" \n :showTodayButton=\"showTodayButton\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrev\" \n @next=\"handleNext\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div ref=\"scrollRef\" class=\"flex-1 overflow-y-auto\" @scroll=\"onScroll\"> \n <div v-if=\"!groups.length\" class=\"flex-1 flex items-center justify-center py-12 text-sm text-muted-foreground\"> \n <slot name=\"empty\">{{ emptyText ?? loc.agenda.empty }}</slot> \n </div> \n \n <template v-for=\"(g, gi) in groups\" :key=\"g.key\"> \n <div \n v-if=\"showMonthSeparator && g.showMonthHeader\" \n class=\"sticky top-0 z-20 bg-card/95 backdrop-blur px-4 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground border-b border-border\" \n > \n {{ g.monthLabel }} \n </div> \n \n <div \n :data-dkey=\"g.key\" \n :class=\"[ \n 'grid border-b border-border transition-colors', \n g.isToday ? 'bg-muted/40' : '', \n g.disabled ? 'opacity-60' : '', \n ]\" \n style=\"grid-template-columns: 5rem 1fr;\" \n > \n <div class=\"flex flex-col items-center justify-start py-4 border-r border-border\"> \n <slot name=\"day-header\" :date=\"g.date\" :isToday=\"g.isToday\" :events=\"g.events\"> \n <span :class=\"['text-[10px] font-medium tracking-wider text-muted-foreground', dayNameCaseClass]\">{{ g.weekdayLabel }}</span> \n <span \n :class=\"[ \n 'mt-1 inline-flex items-center justify-center text-base font-semibold w-9 h-9', \n pillRadiusClass, \n g.isToday ? [todayBgClass] : 'text-foreground', \n ]\" \n >{{ g.day }}</span> \n <span v-if=\"isHighlightedDate(g.date)\" :class=\"['mt-1 w-1 h-1 rounded-full', highlightDotClass]\"></span> \n </slot> \n </div> \n \n <div class=\"py-2 px-3\"> \n <div v-if=\"!g.events.length\" class=\"py-2 text-xs text-muted-foreground/60 italic\"> \n No events \n </div> \n <div v-else class=\"flex flex-col\"> \n <button \n v-for=\"ev in g.events\" \n :key=\"`${g.key}-${ev.id}`\" \n :data-eid=\"ev.id\" \n type=\"button\" \n @click=\"handleEventClick(ev, $event)\" \n @mouseenter=\"onEventEnter(ev, !!ev.allDay, $event)\" \n @mousemove=\"onEventMove\" \n @mouseleave=\"onEventLeave\" \n :class=\"['group flex items-start gap-3 py-2 px-2 -mx-2 cursor-pointer transition-colors hover:bg-muted/70 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-ring', eventRadiusClass]\" \n > \n <span class=\"shrink-0 w-16 pt-0.5 text-[11px] font-medium text-muted-foreground tabular-nums\"> \n <template v-if=\"ev.allDay\">All day</template> \n <template v-else>{{ formatEventTime(ev.start) }}</template> \n </span> \n <span \n class=\"shrink-0 mt-1.5 w-2 h-2\" \n :style=\"ev.colorHex ? { backgroundColor: ev.colorHex } : undefined\" \n :class=\"[pillRadiusClass, !ev.colorHex ? dotColorClass(ev.color) : '']\" \n ></span> \n <span class=\"flex-1 min-w-0\"> \n <slot name=\"event\" :event=\"ev\"> \n <span class=\"block text-sm font-medium text-foreground truncate\">{{ ev.title }}</span> \n <span v-if=\"!ev.allDay && ev.end\" class=\"block text-[11px] text-muted-foreground\"> \n {{ formatEventTime(ev.start) }} – {{ formatEventTime(ev.end) }} \n </span> \n <span v-if=\"ev.description\" class=\"block text-xs text-muted-foreground truncate mt-0.5\">{{ ev.description }}</span> \n </slot> \n </span> \n <span v-if=\"ev.readonly\" class=\"shrink-0 mt-0.5 text-[9px] uppercase tracking-wider text-muted-foreground border border-border px-1 rounded\">Locked</span> \n </button> \n </div> \n </div> \n </div> \n <div v-if=\"gi === groups.length - 1\" class=\"h-1\"></div> \n </template> \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, onMounted } from 'vue'; \nimport gsap from 'gsap'; \nimport { isSameDay, startOfDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useModoLocale } from '../../../composables/useModoConfig'; \n \nconst loc = useModoLocale(); \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { AgendaView } from '../../../interfaces/data-display/calendar/AgendaView.interface'; \nimport type { CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nimport { toCssLength } from '../../../utils/cssLength';\n\nconst props = withDefaults(defineProps<AgendaView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n color: 'default', \n bordered: true, \n daysToShow: 30, \n daysBefore: 0, \n showEmptyDays: false, \n showHeader: true, \n showMonthSeparator: true, \n showYearNavigation: false, \n showMonthYearSelects: false, \n showTodayButton: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n format: '24h', \n readonly: false, \n highlightedDates: () => [], \n disabledDates: () => [], \n disabledWeekdays: () => [], \n // emptyText resolves against locale when not provided. \n loadMoreChunk: 30, \n enableKeyboardNavigation: true, \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 'create-event': [date: Date, allDay: boolean, nativeEvent: MouseEvent | KeyboardEvent]; \n 'load-more': [direction: 'forward' | 'backward']; \n}>(); \n \nconst firstOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth(), 1); \nconst daysInMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate(); \n \nconst anchorDate = ref(firstOfMonth(new Date(props.modelValue))); \nconst daysForwardShown = ref(Math.max(props.daysToShow, daysInMonth(anchorDate.value))); \n \nwatch(() => props.modelValue, (v) => { \n if (!v) return; \n const f = firstOfMonth(new Date(v)); \n if (f.getTime() === anchorDate.value.getTime()) return; \n anchorDate.value = f; \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(f)); \n}); \nwatch(() => props.daysToShow, (n) => { daysForwardShown.value = Math.max(n, daysInMonth(anchorDate.value)); }); \n \nconst rootRef = ref<HTMLElement | null>(null); \nconst scrollRef = ref<HTMLElement | null>(null); \nconst today = new Date(); \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \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', hour12: props.format === '12h' }); \n}; \n \nconst isHighlightedDate = (d: Date) => props.highlightedDates.some(h => isSameDay(h, d)); \nconst isDisabledDate = (d: Date) => props.disabledDates.some(x => isSameDay(x, d)); \nconst isDisabledWeekday = (d: Date) => props.disabledWeekdays.includes(d.getDay()); \nconst isDayDisabled = (d: Date) => { \n if (props.minDate && startOfDay(d) < startOfDay(props.minDate)) return true; \n if (props.maxDate && startOfDay(d) > startOfDay(props.maxDate)) return true; \n return isDisabledDate(d) || isDisabledWeekday(d); \n}; \n \ninterface DayGroup { \n key: string; \n date: Date; \n day: number; \n weekdayLabel: string; \n monthLabel: string; \n showMonthHeader: boolean; \n isToday: boolean; \n disabled: boolean; \n events: CalendarEvent[]; \n} \n \nconst rangeDates = computed<Date[]>(() => { \n const anchor = anchorDate.value; \n const list: Date[] = []; \n for (let i = 0; i < daysForwardShown.value; i++) { \n const d = new Date(anchor); \n d.setDate(d.getDate() + i); \n const sod = startOfDay(d); \n if (props.minDate && sod < startOfDay(props.minDate)) continue; \n if (props.maxDate && sod > startOfDay(props.maxDate)) continue; \n list.push(sod); \n } \n return list; \n}); \n \nconst eventsByDay = computed<Map<string, CalendarEvent[]>>(() => { \n const map = new Map<string, CalendarEvent[]>(); \n for (const ev of props.events) { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n const d = new Date(s); \n while (d.getTime() <= e.getTime()) { \n const k = d.toDateString(); \n if (!map.has(k)) map.set(k, []); \n map.get(k)!.push(ev); \n d.setDate(d.getDate() + 1); \n } \n } \n for (const list of map.values()) { \n list.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 return map; \n}); \n \nconst isoKey = (d: Date) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`; \nconst parseIsoKey = (s: string): Date | null => { \n const m = s.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/); \n if (!m) return null; \n return new Date(parseInt(m[1]), parseInt(m[2]) - 1, parseInt(m[3])); \n}; \n \nconst groups = computed<DayGroup[]>(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const result: DayGroup[] = []; \n let lastMonthKey = ''; \n for (const date of rangeDates.value) { \n const key = isoKey(date); \n const evts = eventsByDay.value.get(date.toDateString()) ?? []; \n if (!props.showEmptyDays && !evts.length) continue; \n const monthKey = `${date.getFullYear()}-${date.getMonth()}`; \n const showMonthHeader = monthKey !== lastMonthKey; \n lastMonthKey = monthKey; \n result.push({ \n key, \n date, \n day: date.getDate(), \n weekdayLabel: date.toLocaleDateString(locale, { weekday: props.dayNameFormat }), \n monthLabel: date.toLocaleDateString(locale, { month: 'long', year: 'numeric' }), \n showMonthHeader, \n isToday: isSameDay(date, today), \n disabled: isDayDisabled(date), \n events: evts, \n }); \n } \n return result; \n}); \n \nconst headerLabel = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const d = visibleDate.value ?? anchorDate.value; \n return d.toLocaleDateString(locale, { month: 'long', year: 'numeric' }); \n}); \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => { \n emit('event-click', ev, e); \n}; \n \nconst afterNavigate = (scrollTarget?: Date, animateScroll = false) => { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) { animateIn(); return; } \n const scEl = scrollRef.value; \n let target = 0; \n if (scrollTarget) { \n const key = isoKey(startOfDay(scrollTarget)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n } \n } \n if (animateScroll && target > 0) { \n scEl.scrollTop = 0; \n animateIn(); \n gsap.to(scEl, { scrollTop: target, duration: 0.7, ease: 'power3.inOut', delay: 0.15 }); \n } else { \n scEl.scrollTop = target; \n animateIn(); \n } \n visibleDate.value = anchorDate.value; \n }); \n}; \nconst handlePrev = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNext = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleToday = () => { \n const n = new Date(); \n const wasCurrentMonth = firstOfMonth(n).getTime() === anchorDate.value.getTime(); \n anchorDate.value = firstOfMonth(n); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(n, !wasCurrentMonth); \n if (wasCurrentMonth && scrollRef.value && rootRef.value) { \n nextTick(() => { \n const key = isoKey(startOfDay(n)); \n const el = rootRef.value!.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value!.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value!.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value!, { scrollTop: target, duration: 0.6, ease: 'power3.inOut' }); \n }); \n } \n}; \nconst handlePrevYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNextYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \n \nconst animateIn = () => { \n if (!rootRef.value) return; \n const els = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n if (!els.length) return; \n gsap.fromTo( \n els, \n { opacity: 0, y: 8 }, \n { opacity: 1, y: 0, duration: 0.35, ease: 'power2.out', stagger: { amount: 0.2 } } \n ); \n}; \n \nlet loadingMore = false; \nconst visibleDate = ref<Date | null>(null); \nconst canExtend = () => { \n if (!props.maxDate) return true; \n const last = rangeDates.value[rangeDates.value.length - 1]; \n return !(last && startOfDay(last) >= startOfDay(props.maxDate)); \n}; \nconst onScroll = () => { \n if (!scrollRef.value) return; \n const el = scrollRef.value; \n if (rootRef.value) { \n const scRect = el.getBoundingClientRect(); \n const headers = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n let pick: Date | null = null; \n for (const h of headers) { \n const r = h.getBoundingClientRect(); \n if (r.bottom > scRect.top + 8) { \n const k = h.getAttribute('data-dkey'); \n if (k) pick = parseIsoKey(k); \n break; \n } \n } \n if (pick) visibleDate.value = pick; \n } \n if (loadingMore) return; \n const remaining = el.scrollHeight - (el.scrollTop + el.clientHeight); \n if (remaining < 120) { \n if (!canExtend()) return; \n loadingMore = true; \n daysForwardShown.value += props.loadMoreChunk; \n emit('load-more', 'forward'); \n setTimeout(() => { loadingMore = false; }, 120); \n } \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.enableKeyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n if (e.key === 'ArrowLeft' || e.key === 'PageUp') { e.preventDefault(); handlePrev(); } \n else if (e.key === 'ArrowRight' || e.key === 'PageDown') { e.preventDefault(); handleNext(); } \n else if (e.key.toLowerCase() === 't') { e.preventDefault(); handleToday(); } \n}; \n \nonMounted(() => { \n nextTick(() => { \n visibleDate.value = anchorDate.value; \n animateIn(); \n if (scrollRef.value && rootRef.value) { \n const todayMonth = firstOfMonth(today); \n if (todayMonth.getTime() === anchorDate.value.getTime()) { \n const key = isoKey(startOfDay(today)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scEl = scrollRef.value; \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n if (target > 0) { \n gsap.to(scEl, { scrollTop: target, duration: 0.9, ease: 'power3.inOut', delay: 0.25 }); \n } \n } \n } \n } \n }); \n}); \n \ndefineExpose({ \n scrollToDate(date: Date) { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) return; \n const key = isoKey(startOfDay(date)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value, { scrollTop: target, duration: 0.45, ease: 'power3.inOut' }); \n }); \n }, \n}); \n \nconst { todayTextClass, dayNameCaseClass, focusRingColorClass, highlightDotClass, containerRadiusClass, eventRadiusClass, pillRadiusClass, todayBgClass, resolvedColor } = useCalendarTheme({ \n color: () => props.color, \n radius: () => props.radius, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst DOT_THEMED: Record<string, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \nconst DOT_SEMANTIC: Record<string, string> = { \n info: 'bg-info', \n purple: 'bg-purple', \n pink: 'bg-pink', \n}; \nconst dotColorClass = (c?: CalendarEvent['color']) => { \n if (!c) return DOT_THEMED.default; \n return DOT_THEMED[c] ?? DOT_SEMANTIC[c] ?? DOT_THEMED.default; \n}; \n \nconst localeValue = computed(() => (props.locale === 'default' ? undefined : props.locale)); \n \nconst monthOptions = computed(() => { \n const base = new Date(2024, 0, 1); \n return Array.from({ length: 12 }, (_, i) => { \n const d = new Date(base); \n d.setMonth(i); \n return d.toLocaleString(localeValue.value, { month: 'long' }); \n }); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minDate?.getFullYear() ?? anchorDate.value.getFullYear() - 10; \n const max = props.maxDate?.getFullYear() ?? anchorDate.value.getFullYear() + 10; \n const list: number[] = []; \n for (let y = min; y <= max; y++) list.push(y); \n return list; \n}); \n \nconst selectedMonth = computed({ \n get: () => anchorDate.value.getMonth(), \n set: (mm: number) => { \n const d = new Date(anchorDate.value); \n d.setDate(1); \n d.setMonth(mm); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n \nconst selectedYear = computed({ \n get: () => anchorDate.value.getFullYear(), \n set: (yy: number) => { \n const d = new Date(anchorDate.value); \n d.setFullYear(yy); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n</script>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"AgendaView.mjs","names":[],"sources":["../../../../src/components/data-display/calendar/AgendaView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['relative flex flex-col bg-card overflow-hidden focus:outline-none', containerRadiusClass, bordered ? 'border border-border' : '']\" \n @keydown=\"handleKeydown\" \n > \n <slot name=\"header\" :label=\"headerLabel\" :goToToday=\"handleToday\" :prev=\"handlePrev\" :next=\"handleNext\" :prevYear=\"handlePrevYear\" :nextYear=\"handleNextYear\"> \n <CalendarHeader \n :label=\"headerLabel\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearNavigation\" \n :showTodayButton=\"showTodayButton\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrev\" \n @next=\"handleNext\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div ref=\"scrollRef\" class=\"flex-1 overflow-y-auto\" @scroll=\"onScroll\"> \n <div v-if=\"!groups.length\" class=\"flex-1 flex items-center justify-center py-12 text-sm text-muted-foreground\"> \n <slot name=\"empty\">{{ emptyText ?? loc.agenda.empty }}</slot> \n </div> \n \n <template v-for=\"(g, gi) in groups\" :key=\"g.key\"> \n <div \n v-if=\"showMonthSeparator && g.showMonthHeader\" \n class=\"sticky top-0 z-20 bg-card/95 backdrop-blur px-4 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground border-b border-border\" \n > \n {{ g.monthLabel }} \n </div> \n \n <div \n :data-dkey=\"g.key\" \n :class=\"[ \n 'grid border-b border-border transition-colors', \n g.isToday ? 'bg-muted/40' : '', \n g.disabled ? 'opacity-60' : '', \n ]\" \n style=\"grid-template-columns: 5rem 1fr;\" \n > \n <div class=\"flex flex-col items-center justify-start py-4 border-r border-border\"> \n <slot name=\"day-header\" :date=\"g.date\" :isToday=\"g.isToday\" :events=\"g.events\"> \n <span :class=\"['text-[10px] font-medium tracking-wider text-muted-foreground', dayNameCaseClass]\">{{ g.weekdayLabel }}</span> \n <span \n :class=\"[ \n 'mt-1 inline-flex items-center justify-center text-base font-semibold w-9 h-9', \n pillRadiusClass, \n g.isToday ? [todayBgClass] : 'text-foreground', \n ]\" \n >{{ g.day }}</span> \n <span v-if=\"isHighlightedDate(g.date)\" :class=\"['mt-1 w-1 h-1 rounded-full', highlightDotClass]\"></span> \n </slot> \n </div> \n \n <div class=\"py-2 px-3\"> \n <div v-if=\"!g.events.length\" class=\"py-2 text-xs text-muted-foreground/60 italic\"> \n No events \n </div> \n <div v-else class=\"flex flex-col\"> \n <button \n v-for=\"ev in g.events\" \n :key=\"`${g.key}-${ev.id}`\" \n :data-eid=\"ev.id\" \n type=\"button\" \n @click=\"handleEventClick(ev, $event)\" \n @mouseenter=\"onEventEnter(ev, !!ev.allDay, $event)\" \n @mousemove=\"onEventMove\" \n @mouseleave=\"onEventLeave\" \n :class=\"['group flex items-start gap-3 py-2 px-2 -mx-2 cursor-pointer transition-colors hover:bg-muted/70 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-ring', eventRadiusClass]\" \n > \n <span class=\"shrink-0 w-16 pt-0.5 text-[11px] font-medium text-muted-foreground tabular-nums\"> \n <template v-if=\"ev.allDay\">All day</template> \n <template v-else>{{ formatEventTime(ev.start) }}</template> \n </span> \n <span \n class=\"shrink-0 mt-1.5 w-2 h-2\" \n :style=\"ev.colorHex ? { backgroundColor: ev.colorHex } : undefined\" \n :class=\"[pillRadiusClass, !ev.colorHex ? dotColorClass(ev.color) : '']\" \n ></span> \n <span class=\"flex-1 min-w-0\"> \n <slot name=\"event\" :event=\"ev\"> \n <span class=\"block text-sm font-medium text-foreground truncate\">{{ ev.title }}</span> \n <span v-if=\"!ev.allDay && ev.end\" class=\"block text-[11px] text-muted-foreground\"> \n {{ formatEventTime(ev.start) }} – {{ formatEventTime(ev.end) }} \n </span> \n <span v-if=\"ev.description\" class=\"block text-xs text-muted-foreground truncate mt-0.5\">{{ ev.description }}</span> \n </slot> \n </span> \n <span v-if=\"ev.readonly\" class=\"shrink-0 mt-0.5 text-[9px] uppercase tracking-wider text-muted-foreground border border-border px-1 rounded\">Locked</span> \n </button> \n </div> \n </div> \n </div> \n <div v-if=\"gi === groups.length - 1\" class=\"h-1\"></div> \n </template> \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, onMounted } from 'vue'; \nimport gsap from 'gsap'; \nimport { isSameDay, startOfDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useModoLocale } from '../../../composables/useModoConfig'; \n \nconst loc = useModoLocale(); \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { AgendaView } from '../../../interfaces/data-display/calendar/AgendaView.interface'; \nimport type { CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nconst props = withDefaults(defineProps<AgendaView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n color: 'default', \n bordered: true, \n daysToShow: 30, \n daysBefore: 0, \n showEmptyDays: false, \n showHeader: true, \n showMonthSeparator: true, \n showYearNavigation: false, \n showMonthYearSelects: false, \n showTodayButton: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n format: '24h', \n readonly: false, \n highlightedDates: () => [], \n disabledDates: () => [], \n disabledWeekdays: () => [], \n // emptyText resolves against locale when not provided. \n loadMoreChunk: 30, \n enableKeyboardNavigation: true, \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 'create-event': [date: Date, allDay: boolean, nativeEvent: MouseEvent | KeyboardEvent]; \n 'load-more': [direction: 'forward' | 'backward']; \n}>(); \n \nconst firstOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth(), 1); \nconst daysInMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate(); \n \nconst anchorDate = ref(firstOfMonth(new Date(props.modelValue))); \nconst daysForwardShown = ref(Math.max(props.daysToShow, daysInMonth(anchorDate.value))); \n \nwatch(() => props.modelValue, (v) => { \n if (!v) return; \n const f = firstOfMonth(new Date(v)); \n if (f.getTime() === anchorDate.value.getTime()) return; \n anchorDate.value = f; \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(f)); \n}); \nwatch(() => props.daysToShow, (n) => { daysForwardShown.value = Math.max(n, daysInMonth(anchorDate.value)); }); \n \nconst rootRef = ref<HTMLElement | null>(null); \nconst scrollRef = ref<HTMLElement | null>(null); \nconst today = new Date(); \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \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', hour12: props.format === '12h' }); \n}; \n \nconst isHighlightedDate = (d: Date) => props.highlightedDates.some(h => isSameDay(h, d)); \nconst isDisabledDate = (d: Date) => props.disabledDates.some(x => isSameDay(x, d)); \nconst isDisabledWeekday = (d: Date) => props.disabledWeekdays.includes(d.getDay()); \nconst isDayDisabled = (d: Date) => { \n if (props.minDate && startOfDay(d) < startOfDay(props.minDate)) return true; \n if (props.maxDate && startOfDay(d) > startOfDay(props.maxDate)) return true; \n return isDisabledDate(d) || isDisabledWeekday(d); \n}; \n \ninterface DayGroup { \n key: string; \n date: Date; \n day: number; \n weekdayLabel: string; \n monthLabel: string; \n showMonthHeader: boolean; \n isToday: boolean; \n disabled: boolean; \n events: CalendarEvent[]; \n} \n \nconst rangeDates = computed<Date[]>(() => { \n const anchor = anchorDate.value; \n const list: Date[] = []; \n for (let i = 0; i < daysForwardShown.value; i++) { \n const d = new Date(anchor); \n d.setDate(d.getDate() + i); \n const sod = startOfDay(d); \n if (props.minDate && sod < startOfDay(props.minDate)) continue; \n if (props.maxDate && sod > startOfDay(props.maxDate)) continue; \n list.push(sod); \n } \n return list; \n}); \n \nconst eventsByDay = computed<Map<string, CalendarEvent[]>>(() => { \n const map = new Map<string, CalendarEvent[]>(); \n for (const ev of props.events) { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n const d = new Date(s); \n while (d.getTime() <= e.getTime()) { \n const k = d.toDateString(); \n if (!map.has(k)) map.set(k, []); \n map.get(k)!.push(ev); \n d.setDate(d.getDate() + 1); \n } \n } \n for (const list of map.values()) { \n list.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 return map; \n}); \n \nconst isoKey = (d: Date) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`; \nconst parseIsoKey = (s: string): Date | null => { \n const m = s.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/); \n if (!m) return null; \n return new Date(parseInt(m[1]), parseInt(m[2]) - 1, parseInt(m[3])); \n}; \n \nconst groups = computed<DayGroup[]>(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const result: DayGroup[] = []; \n let lastMonthKey = ''; \n for (const date of rangeDates.value) { \n const key = isoKey(date); \n const evts = eventsByDay.value.get(date.toDateString()) ?? []; \n if (!props.showEmptyDays && !evts.length) continue; \n const monthKey = `${date.getFullYear()}-${date.getMonth()}`; \n const showMonthHeader = monthKey !== lastMonthKey; \n lastMonthKey = monthKey; \n result.push({ \n key, \n date, \n day: date.getDate(), \n weekdayLabel: date.toLocaleDateString(locale, { weekday: props.dayNameFormat }), \n monthLabel: date.toLocaleDateString(locale, { month: 'long', year: 'numeric' }), \n showMonthHeader, \n isToday: isSameDay(date, today), \n disabled: isDayDisabled(date), \n events: evts, \n }); \n } \n return result; \n}); \n \nconst headerLabel = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const d = visibleDate.value ?? anchorDate.value; \n return d.toLocaleDateString(locale, { month: 'long', year: 'numeric' }); \n}); \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => { \n emit('event-click', ev, e); \n}; \n \nconst afterNavigate = (scrollTarget?: Date, animateScroll = false) => { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) { animateIn(); return; } \n const scEl = scrollRef.value; \n let target = 0; \n if (scrollTarget) { \n const key = isoKey(startOfDay(scrollTarget)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n } \n } \n if (animateScroll && target > 0) { \n scEl.scrollTop = 0; \n animateIn(); \n gsap.to(scEl, { scrollTop: target, duration: 0.7, ease: 'power3.inOut', delay: 0.15 }); \n } else { \n scEl.scrollTop = target; \n animateIn(); \n } \n visibleDate.value = anchorDate.value; \n }); \n}; \nconst handlePrev = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNext = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleToday = () => { \n const n = new Date(); \n const wasCurrentMonth = firstOfMonth(n).getTime() === anchorDate.value.getTime(); \n anchorDate.value = firstOfMonth(n); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(n, !wasCurrentMonth); \n if (wasCurrentMonth && scrollRef.value && rootRef.value) { \n nextTick(() => { \n const key = isoKey(startOfDay(n)); \n const el = rootRef.value!.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value!.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value!.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value!, { scrollTop: target, duration: 0.6, ease: 'power3.inOut' }); \n }); \n } \n}; \nconst handlePrevYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNextYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \n \nconst animateIn = () => { \n if (!rootRef.value) return; \n const els = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n if (!els.length) return; \n gsap.fromTo( \n els, \n { opacity: 0, y: 8 }, \n { opacity: 1, y: 0, duration: 0.35, ease: 'power2.out', stagger: { amount: 0.2 } } \n ); \n}; \n \nlet loadingMore = false; \nconst visibleDate = ref<Date | null>(null); \nconst canExtend = () => { \n if (!props.maxDate) return true; \n const last = rangeDates.value[rangeDates.value.length - 1]; \n return !(last && startOfDay(last) >= startOfDay(props.maxDate)); \n}; \nconst onScroll = () => { \n if (!scrollRef.value) return; \n const el = scrollRef.value; \n if (rootRef.value) { \n const scRect = el.getBoundingClientRect(); \n const headers = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n let pick: Date | null = null; \n for (const h of headers) { \n const r = h.getBoundingClientRect(); \n if (r.bottom > scRect.top + 8) { \n const k = h.getAttribute('data-dkey'); \n if (k) pick = parseIsoKey(k); \n break; \n } \n } \n if (pick) visibleDate.value = pick; \n } \n if (loadingMore) return; \n const remaining = el.scrollHeight - (el.scrollTop + el.clientHeight); \n if (remaining < 120) { \n if (!canExtend()) return; \n loadingMore = true; \n daysForwardShown.value += props.loadMoreChunk; \n emit('load-more', 'forward'); \n setTimeout(() => { loadingMore = false; }, 120); \n } \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.enableKeyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n if (e.key === 'ArrowLeft' || e.key === 'PageUp') { e.preventDefault(); handlePrev(); } \n else if (e.key === 'ArrowRight' || e.key === 'PageDown') { e.preventDefault(); handleNext(); } \n else if (e.key.toLowerCase() === 't') { e.preventDefault(); handleToday(); } \n}; \n \nonMounted(() => { \n nextTick(() => { \n visibleDate.value = anchorDate.value; \n animateIn(); \n if (scrollRef.value && rootRef.value) { \n const todayMonth = firstOfMonth(today); \n if (todayMonth.getTime() === anchorDate.value.getTime()) { \n const key = isoKey(startOfDay(today)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scEl = scrollRef.value; \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n if (target > 0) { \n gsap.to(scEl, { scrollTop: target, duration: 0.9, ease: 'power3.inOut', delay: 0.25 }); \n } \n } \n } \n } \n }); \n}); \n \ndefineExpose({ \n scrollToDate(date: Date) { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) return; \n const key = isoKey(startOfDay(date)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value, { scrollTop: target, duration: 0.45, ease: 'power3.inOut' }); \n }); \n }, \n}); \n \nconst { todayTextClass, dayNameCaseClass, focusRingColorClass, highlightDotClass, containerRadiusClass, eventRadiusClass, pillRadiusClass, todayBgClass, resolvedColor } = useCalendarTheme({ \n color: () => props.color, \n radius: () => props.radius, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst DOT_THEMED: Record<string, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \nconst DOT_SEMANTIC: Record<string, string> = { \n info: 'bg-info', \n purple: 'bg-purple', \n pink: 'bg-pink', \n}; \nconst dotColorClass = (c?: CalendarEvent['color']) => { \n if (!c) return DOT_THEMED.default; \n return DOT_THEMED[c] ?? DOT_SEMANTIC[c] ?? DOT_THEMED.default; \n}; \n \nconst localeValue = computed(() => (props.locale === 'default' ? undefined : props.locale)); \n \nconst monthOptions = computed(() => { \n const base = new Date(2024, 0, 1); \n return Array.from({ length: 12 }, (_, i) => { \n const d = new Date(base); \n d.setMonth(i); \n return d.toLocaleString(localeValue.value, { month: 'long' }); \n }); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minDate?.getFullYear() ?? anchorDate.value.getFullYear() - 10; \n const max = props.maxDate?.getFullYear() ?? anchorDate.value.getFullYear() + 10; \n const list: number[] = []; \n for (let y = min; y <= max; y++) list.push(y); \n return list; \n}); \n \nconst selectedMonth = computed({ \n get: () => anchorDate.value.getMonth(), \n set: (mm: number) => { \n const d = new Date(anchorDate.value); \n d.setDate(1); \n d.setMonth(mm); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n \nconst selectedYear = computed({ \n get: () => anchorDate.value.getFullYear(), \n set: (yy: number) => { \n const d = new Date(anchorDate.value); \n d.setFullYear(yy); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n</script>\n"],"mappings":""}
1
+ {"version":3,"file":"AgendaView.mjs","names":[],"sources":["../../../../src/components/data-display/calendar/AgendaView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['relative 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\" :label=\"headerLabel\" :goToToday=\"handleToday\" :prev=\"handlePrev\" :next=\"handleNext\" :prevYear=\"handlePrevYear\" :nextYear=\"handleNextYear\"> \n <CalendarHeader \n :label=\"headerLabel\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearNavigation\" \n :showTodayButton=\"showTodayButton\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrev\" \n @next=\"handleNext\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div ref=\"scrollRef\" class=\"flex-1 overflow-y-auto\" @scroll=\"onScroll\"> \n <div v-if=\"!groups.length\" class=\"flex-1 flex items-center justify-center py-12 text-sm text-muted-foreground\"> \n <slot name=\"empty\">{{ emptyText ?? loc.agenda.empty }}</slot> \n </div> \n \n <template v-for=\"(g, gi) in groups\" :key=\"g.key\"> \n <div \n v-if=\"showMonthSeparator && g.showMonthHeader\" \n class=\"sticky top-0 z-20 bg-card/95 backdrop-blur px-4 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground border-b border-border\" \n > \n {{ g.monthLabel }} \n </div> \n \n <div \n :data-dkey=\"g.key\" \n :class=\"[ \n 'grid border-b border-border transition-colors', \n g.isToday ? 'bg-muted/40' : '', \n g.disabled ? 'opacity-60' : '', \n ]\" \n style=\"grid-template-columns: 5rem 1fr;\" \n > \n <div class=\"flex flex-col items-center justify-start py-4 border-r border-border\"> \n <slot name=\"day-header\" :date=\"g.date\" :isToday=\"g.isToday\" :events=\"g.events\"> \n <span :class=\"['text-[10px] font-medium tracking-wider text-muted-foreground', dayNameCaseClass]\">{{ g.weekdayLabel }}</span> \n <span \n :class=\"[ \n 'mt-1 inline-flex items-center justify-center text-base font-semibold w-9 h-9', \n pillRadiusClass, \n g.isToday ? [todayBgClass] : 'text-foreground', \n ]\" \n >{{ g.day }}</span> \n <span v-if=\"isHighlightedDate(g.date)\" :class=\"['mt-1 w-1 h-1 rounded-full', highlightDotClass]\"></span> \n </slot> \n </div> \n \n <div class=\"py-2 px-3\"> \n <div v-if=\"!g.events.length\" class=\"py-2 text-xs text-muted-foreground/60 italic\"> \n No events \n </div> \n <div v-else class=\"flex flex-col\"> \n <button \n v-for=\"ev in g.events\" \n :key=\"`${g.key}-${ev.id}`\" \n :data-eid=\"ev.id\" \n type=\"button\" \n @click=\"handleEventClick(ev, $event)\" \n @mouseenter=\"onEventEnter(ev, !!ev.allDay, $event)\" \n @mousemove=\"onEventMove\" \n @mouseleave=\"onEventLeave\" \n :class=\"['group flex items-start gap-3 py-2 px-2 -mx-2 cursor-pointer transition-colors hover:bg-muted/70 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-ring', eventRadiusClass]\" \n > \n <span class=\"shrink-0 w-16 pt-0.5 text-[11px] font-medium text-muted-foreground tabular-nums\"> \n <template v-if=\"ev.allDay\">All day</template> \n <template v-else>{{ formatEventTime(ev.start) }}</template> \n </span> \n <span \n class=\"shrink-0 mt-1.5 w-2 h-2\" \n :style=\"ev.colorHex ? { backgroundColor: ev.colorHex } : undefined\" \n :class=\"[pillRadiusClass, !ev.colorHex ? dotColorClass(ev.color) : '']\" \n ></span> \n <span class=\"flex-1 min-w-0\"> \n <slot name=\"event\" :event=\"ev\"> \n <span class=\"block text-sm font-medium text-foreground truncate\">{{ ev.title }}</span> \n <span v-if=\"!ev.allDay && ev.end\" class=\"block text-[11px] text-muted-foreground\"> \n {{ formatEventTime(ev.start) }} – {{ formatEventTime(ev.end) }} \n </span> \n <span v-if=\"ev.description\" class=\"block text-xs text-muted-foreground truncate mt-0.5\">{{ ev.description }}</span> \n </slot> \n </span> \n <span v-if=\"ev.readonly\" class=\"shrink-0 mt-0.5 text-[9px] uppercase tracking-wider text-muted-foreground border border-border px-1 rounded\">Locked</span> \n </button> \n </div> \n </div> \n </div> \n <div v-if=\"gi === groups.length - 1\" class=\"h-1\"></div> \n </template> \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, onMounted } from 'vue'; \nimport gsap from 'gsap'; \nimport { isSameDay, startOfDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useModoLocale } from '../../../composables/useModoConfig'; \n \nconst loc = useModoLocale(); \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { AgendaView } from '../../../interfaces/data-display/calendar/AgendaView.interface'; \nimport type { CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nimport { toCssLength } from '../../../utils/cssLength';\n\nconst props = withDefaults(defineProps<AgendaView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n color: 'default', \n bordered: true, \n daysToShow: 30, \n daysBefore: 0, \n showEmptyDays: false, \n showHeader: true, \n showMonthSeparator: true, \n showYearNavigation: false, \n showMonthYearSelects: false, \n showTodayButton: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n format: '24h', \n readonly: false, \n highlightedDates: () => [], \n disabledDates: () => [], \n disabledWeekdays: () => [], \n // emptyText resolves against locale when not provided. \n loadMoreChunk: 30, \n enableKeyboardNavigation: true, \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 'create-event': [date: Date, allDay: boolean, nativeEvent: MouseEvent | KeyboardEvent]; \n 'load-more': [direction: 'forward' | 'backward']; \n}>(); \n \nconst firstOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth(), 1); \nconst daysInMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate(); \n \nconst anchorDate = ref(firstOfMonth(new Date(props.modelValue))); \nconst daysForwardShown = ref(Math.max(props.daysToShow, daysInMonth(anchorDate.value))); \n \nwatch(() => props.modelValue, (v) => { \n if (!v) return; \n const f = firstOfMonth(new Date(v)); \n if (f.getTime() === anchorDate.value.getTime()) return; \n anchorDate.value = f; \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(f)); \n}); \nwatch(() => props.daysToShow, (n) => { daysForwardShown.value = Math.max(n, daysInMonth(anchorDate.value)); }); \n \nconst rootRef = ref<HTMLElement | null>(null); \nconst scrollRef = ref<HTMLElement | null>(null); \nconst today = new Date(); \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \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', hour12: props.format === '12h' }); \n}; \n \nconst isHighlightedDate = (d: Date) => props.highlightedDates.some(h => isSameDay(h, d)); \nconst isDisabledDate = (d: Date) => props.disabledDates.some(x => isSameDay(x, d)); \nconst isDisabledWeekday = (d: Date) => props.disabledWeekdays.includes(d.getDay()); \nconst isDayDisabled = (d: Date) => { \n if (props.minDate && startOfDay(d) < startOfDay(props.minDate)) return true; \n if (props.maxDate && startOfDay(d) > startOfDay(props.maxDate)) return true; \n return isDisabledDate(d) || isDisabledWeekday(d); \n}; \n \ninterface DayGroup { \n key: string; \n date: Date; \n day: number; \n weekdayLabel: string; \n monthLabel: string; \n showMonthHeader: boolean; \n isToday: boolean; \n disabled: boolean; \n events: CalendarEvent[]; \n} \n \nconst rangeDates = computed<Date[]>(() => { \n const anchor = anchorDate.value; \n const list: Date[] = []; \n for (let i = 0; i < daysForwardShown.value; i++) { \n const d = new Date(anchor); \n d.setDate(d.getDate() + i); \n const sod = startOfDay(d); \n if (props.minDate && sod < startOfDay(props.minDate)) continue; \n if (props.maxDate && sod > startOfDay(props.maxDate)) continue; \n list.push(sod); \n } \n return list; \n}); \n \nconst eventsByDay = computed<Map<string, CalendarEvent[]>>(() => { \n const map = new Map<string, CalendarEvent[]>(); \n for (const ev of props.events) { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n const d = new Date(s); \n while (d.getTime() <= e.getTime()) { \n const k = d.toDateString(); \n if (!map.has(k)) map.set(k, []); \n map.get(k)!.push(ev); \n d.setDate(d.getDate() + 1); \n } \n } \n for (const list of map.values()) { \n list.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 return map; \n}); \n \nconst isoKey = (d: Date) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`; \nconst parseIsoKey = (s: string): Date | null => { \n const m = s.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/); \n if (!m) return null; \n return new Date(parseInt(m[1]), parseInt(m[2]) - 1, parseInt(m[3])); \n}; \n \nconst groups = computed<DayGroup[]>(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const result: DayGroup[] = []; \n let lastMonthKey = ''; \n for (const date of rangeDates.value) { \n const key = isoKey(date); \n const evts = eventsByDay.value.get(date.toDateString()) ?? []; \n if (!props.showEmptyDays && !evts.length) continue; \n const monthKey = `${date.getFullYear()}-${date.getMonth()}`; \n const showMonthHeader = monthKey !== lastMonthKey; \n lastMonthKey = monthKey; \n result.push({ \n key, \n date, \n day: date.getDate(), \n weekdayLabel: date.toLocaleDateString(locale, { weekday: props.dayNameFormat }), \n monthLabel: date.toLocaleDateString(locale, { month: 'long', year: 'numeric' }), \n showMonthHeader, \n isToday: isSameDay(date, today), \n disabled: isDayDisabled(date), \n events: evts, \n }); \n } \n return result; \n}); \n \nconst headerLabel = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const d = visibleDate.value ?? anchorDate.value; \n return d.toLocaleDateString(locale, { month: 'long', year: 'numeric' }); \n}); \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => { \n emit('event-click', ev, e); \n}; \n \nconst afterNavigate = (scrollTarget?: Date, animateScroll = false) => { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) { animateIn(); return; } \n const scEl = scrollRef.value; \n let target = 0; \n if (scrollTarget) { \n const key = isoKey(startOfDay(scrollTarget)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n } \n } \n if (animateScroll && target > 0) { \n scEl.scrollTop = 0; \n animateIn(); \n gsap.to(scEl, { scrollTop: target, duration: 0.7, ease: 'power3.inOut', delay: 0.15 }); \n } else { \n scEl.scrollTop = target; \n animateIn(); \n } \n visibleDate.value = anchorDate.value; \n }); \n}; \nconst handlePrev = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNext = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleToday = () => { \n const n = new Date(); \n const wasCurrentMonth = firstOfMonth(n).getTime() === anchorDate.value.getTime(); \n anchorDate.value = firstOfMonth(n); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(n, !wasCurrentMonth); \n if (wasCurrentMonth && scrollRef.value && rootRef.value) { \n nextTick(() => { \n const key = isoKey(startOfDay(n)); \n const el = rootRef.value!.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value!.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value!.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value!, { scrollTop: target, duration: 0.6, ease: 'power3.inOut' }); \n }); \n } \n}; \nconst handlePrevYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNextYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \n \nconst animateIn = () => { \n if (!rootRef.value) return; \n const els = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n if (!els.length) return; \n gsap.fromTo( \n els, \n { opacity: 0, y: 8 }, \n { opacity: 1, y: 0, duration: 0.35, ease: 'power2.out', stagger: { amount: 0.2 } } \n ); \n}; \n \nlet loadingMore = false; \nconst visibleDate = ref<Date | null>(null); \nconst canExtend = () => { \n if (!props.maxDate) return true; \n const last = rangeDates.value[rangeDates.value.length - 1]; \n return !(last && startOfDay(last) >= startOfDay(props.maxDate)); \n}; \nconst onScroll = () => { \n if (!scrollRef.value) return; \n const el = scrollRef.value; \n if (rootRef.value) { \n const scRect = el.getBoundingClientRect(); \n const headers = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n let pick: Date | null = null; \n for (const h of headers) { \n const r = h.getBoundingClientRect(); \n if (r.bottom > scRect.top + 8) { \n const k = h.getAttribute('data-dkey'); \n if (k) pick = parseIsoKey(k); \n break; \n } \n } \n if (pick) visibleDate.value = pick; \n } \n if (loadingMore) return; \n const remaining = el.scrollHeight - (el.scrollTop + el.clientHeight); \n if (remaining < 120) { \n if (!canExtend()) return; \n loadingMore = true; \n daysForwardShown.value += props.loadMoreChunk; \n emit('load-more', 'forward'); \n setTimeout(() => { loadingMore = false; }, 120); \n } \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.enableKeyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n if (e.key === 'ArrowLeft' || e.key === 'PageUp') { e.preventDefault(); handlePrev(); } \n else if (e.key === 'ArrowRight' || e.key === 'PageDown') { e.preventDefault(); handleNext(); } \n else if (e.key.toLowerCase() === 't') { e.preventDefault(); handleToday(); } \n}; \n \nonMounted(() => { \n nextTick(() => { \n visibleDate.value = anchorDate.value; \n animateIn(); \n if (scrollRef.value && rootRef.value) { \n const todayMonth = firstOfMonth(today); \n if (todayMonth.getTime() === anchorDate.value.getTime()) { \n const key = isoKey(startOfDay(today)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scEl = scrollRef.value; \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n if (target > 0) { \n gsap.to(scEl, { scrollTop: target, duration: 0.9, ease: 'power3.inOut', delay: 0.25 }); \n } \n } \n } \n } \n }); \n}); \n \ndefineExpose({ \n scrollToDate(date: Date) { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) return; \n const key = isoKey(startOfDay(date)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value, { scrollTop: target, duration: 0.45, ease: 'power3.inOut' }); \n }); \n }, \n}); \n \nconst { todayTextClass, dayNameCaseClass, focusRingColorClass, highlightDotClass, containerRadiusClass, eventRadiusClass, pillRadiusClass, todayBgClass, resolvedColor } = useCalendarTheme({ \n color: () => props.color, \n radius: () => props.radius, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst DOT_THEMED: Record<string, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \nconst DOT_SEMANTIC: Record<string, string> = { \n info: 'bg-info', \n purple: 'bg-purple', \n pink: 'bg-pink', \n}; \nconst dotColorClass = (c?: CalendarEvent['color']) => { \n if (!c) return DOT_THEMED.default; \n return DOT_THEMED[c] ?? DOT_SEMANTIC[c] ?? DOT_THEMED.default; \n}; \n \nconst localeValue = computed(() => (props.locale === 'default' ? undefined : props.locale)); \n \nconst monthOptions = computed(() => { \n const base = new Date(2024, 0, 1); \n return Array.from({ length: 12 }, (_, i) => { \n const d = new Date(base); \n d.setMonth(i); \n return d.toLocaleString(localeValue.value, { month: 'long' }); \n }); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minDate?.getFullYear() ?? anchorDate.value.getFullYear() - 10; \n const max = props.maxDate?.getFullYear() ?? anchorDate.value.getFullYear() + 10; \n const list: number[] = []; \n for (let y = min; y <= max; y++) list.push(y); \n return list; \n}); \n \nconst selectedMonth = computed({ \n get: () => anchorDate.value.getMonth(), \n set: (mm: number) => { \n const d = new Date(anchorDate.value); \n d.setDate(1); \n d.setMonth(mm); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n \nconst selectedYear = computed({ \n get: () => anchorDate.value.getFullYear(), \n set: (yy: number) => { \n const d = new Date(anchorDate.value); \n d.setFullYear(yy); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n</script>\n"],"mappings":""}
@@ -5,6 +5,7 @@ const require_useCalendarTheme = require("../../../composables/useCalendarTheme.
5
5
  const require_useEventHover = require("../../../composables/useEventHover.cjs");
6
6
  const require_CalendarEventTooltip = require("./CalendarEventTooltip.cjs");
7
7
  const require_CalendarHeader = require("./CalendarHeader.cjs");
8
+ const require_cssLength = require("../../../utils/cssLength.cjs");
8
9
  let vue = require("vue");
9
10
  let gsap = require("gsap");
10
11
  gsap = require_runtime.__toESM(gsap, 1);
@@ -64,6 +65,7 @@ var AgendaView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
64
65
  type: Boolean,
65
66
  default: true
66
67
  },
68
+ maxHeight: {},
67
69
  minDate: {},
68
70
  maxDate: {},
69
71
  daysToShow: { default: 30 },
@@ -489,6 +491,7 @@ var AgendaView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
489
491
  (0, vue.unref)(containerRadiusClass),
490
492
  __props.bordered ? "border border-border" : ""
491
493
  ]),
494
+ style: (0, vue.normalizeStyle)({ maxHeight: (0, vue.unref)(require_cssLength.toCssLength)(__props.maxHeight) }),
492
495
  onKeydown: handleKeydown
493
496
  }, [
494
497
  (0, vue.renderSlot)(_ctx.$slots, "header", {
@@ -605,7 +608,7 @@ var AgendaView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
605
608
  })]),
606
609
  _: 3
607
610
  }, 8, ["state", "style"])
608
- ], 34);
611
+ ], 38);
609
612
  };
610
613
  }
611
614
  });
@@ -1 +1 @@
1
- {"version":3,"file":"AgendaView.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../../src/components/data-display/calendar/AgendaView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['relative flex flex-col bg-card overflow-hidden focus:outline-none', containerRadiusClass, bordered ? 'border border-border' : '']\" \n @keydown=\"handleKeydown\" \n > \n <slot name=\"header\" :label=\"headerLabel\" :goToToday=\"handleToday\" :prev=\"handlePrev\" :next=\"handleNext\" :prevYear=\"handlePrevYear\" :nextYear=\"handleNextYear\"> \n <CalendarHeader \n :label=\"headerLabel\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearNavigation\" \n :showTodayButton=\"showTodayButton\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrev\" \n @next=\"handleNext\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div ref=\"scrollRef\" class=\"flex-1 overflow-y-auto\" @scroll=\"onScroll\"> \n <div v-if=\"!groups.length\" class=\"flex-1 flex items-center justify-center py-12 text-sm text-muted-foreground\"> \n <slot name=\"empty\">{{ emptyText ?? loc.agenda.empty }}</slot> \n </div> \n \n <template v-for=\"(g, gi) in groups\" :key=\"g.key\"> \n <div \n v-if=\"showMonthSeparator && g.showMonthHeader\" \n class=\"sticky top-0 z-20 bg-card/95 backdrop-blur px-4 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground border-b border-border\" \n > \n {{ g.monthLabel }} \n </div> \n \n <div \n :data-dkey=\"g.key\" \n :class=\"[ \n 'grid border-b border-border transition-colors', \n g.isToday ? 'bg-muted/40' : '', \n g.disabled ? 'opacity-60' : '', \n ]\" \n style=\"grid-template-columns: 5rem 1fr;\" \n > \n <div class=\"flex flex-col items-center justify-start py-4 border-r border-border\"> \n <slot name=\"day-header\" :date=\"g.date\" :isToday=\"g.isToday\" :events=\"g.events\"> \n <span :class=\"['text-[10px] font-medium tracking-wider text-muted-foreground', dayNameCaseClass]\">{{ g.weekdayLabel }}</span> \n <span \n :class=\"[ \n 'mt-1 inline-flex items-center justify-center text-base font-semibold w-9 h-9', \n pillRadiusClass, \n g.isToday ? [todayBgClass] : 'text-foreground', \n ]\" \n >{{ g.day }}</span> \n <span v-if=\"isHighlightedDate(g.date)\" :class=\"['mt-1 w-1 h-1 rounded-full', highlightDotClass]\"></span> \n </slot> \n </div> \n \n <div class=\"py-2 px-3\"> \n <div v-if=\"!g.events.length\" class=\"py-2 text-xs text-muted-foreground/60 italic\"> \n No events \n </div> \n <div v-else class=\"flex flex-col\"> \n <button \n v-for=\"ev in g.events\" \n :key=\"`${g.key}-${ev.id}`\" \n :data-eid=\"ev.id\" \n type=\"button\" \n @click=\"handleEventClick(ev, $event)\" \n @mouseenter=\"onEventEnter(ev, !!ev.allDay, $event)\" \n @mousemove=\"onEventMove\" \n @mouseleave=\"onEventLeave\" \n :class=\"['group flex items-start gap-3 py-2 px-2 -mx-2 cursor-pointer transition-colors hover:bg-muted/70 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-ring', eventRadiusClass]\" \n > \n <span class=\"shrink-0 w-16 pt-0.5 text-[11px] font-medium text-muted-foreground tabular-nums\"> \n <template v-if=\"ev.allDay\">All day</template> \n <template v-else>{{ formatEventTime(ev.start) }}</template> \n </span> \n <span \n class=\"shrink-0 mt-1.5 w-2 h-2\" \n :style=\"ev.colorHex ? { backgroundColor: ev.colorHex } : undefined\" \n :class=\"[pillRadiusClass, !ev.colorHex ? dotColorClass(ev.color) : '']\" \n ></span> \n <span class=\"flex-1 min-w-0\"> \n <slot name=\"event\" :event=\"ev\"> \n <span class=\"block text-sm font-medium text-foreground truncate\">{{ ev.title }}</span> \n <span v-if=\"!ev.allDay && ev.end\" class=\"block text-[11px] text-muted-foreground\"> \n {{ formatEventTime(ev.start) }} – {{ formatEventTime(ev.end) }} \n </span> \n <span v-if=\"ev.description\" class=\"block text-xs text-muted-foreground truncate mt-0.5\">{{ ev.description }}</span> \n </slot> \n </span> \n <span v-if=\"ev.readonly\" class=\"shrink-0 mt-0.5 text-[9px] uppercase tracking-wider text-muted-foreground border border-border px-1 rounded\">Locked</span> \n </button> \n </div> \n </div> \n </div> \n <div v-if=\"gi === groups.length - 1\" class=\"h-1\"></div> \n </template> \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, onMounted } from 'vue'; \nimport gsap from 'gsap'; \nimport { isSameDay, startOfDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useModoLocale } from '../../../composables/useModoConfig'; \n \nconst loc = useModoLocale(); \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { AgendaView } from '../../../interfaces/data-display/calendar/AgendaView.interface'; \nimport type { CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nconst props = withDefaults(defineProps<AgendaView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n color: 'default', \n bordered: true, \n daysToShow: 30, \n daysBefore: 0, \n showEmptyDays: false, \n showHeader: true, \n showMonthSeparator: true, \n showYearNavigation: false, \n showMonthYearSelects: false, \n showTodayButton: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n format: '24h', \n readonly: false, \n highlightedDates: () => [], \n disabledDates: () => [], \n disabledWeekdays: () => [], \n // emptyText resolves against locale when not provided. \n loadMoreChunk: 30, \n enableKeyboardNavigation: true, \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 'create-event': [date: Date, allDay: boolean, nativeEvent: MouseEvent | KeyboardEvent]; \n 'load-more': [direction: 'forward' | 'backward']; \n}>(); \n \nconst firstOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth(), 1); \nconst daysInMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate(); \n \nconst anchorDate = ref(firstOfMonth(new Date(props.modelValue))); \nconst daysForwardShown = ref(Math.max(props.daysToShow, daysInMonth(anchorDate.value))); \n \nwatch(() => props.modelValue, (v) => { \n if (!v) return; \n const f = firstOfMonth(new Date(v)); \n if (f.getTime() === anchorDate.value.getTime()) return; \n anchorDate.value = f; \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(f)); \n}); \nwatch(() => props.daysToShow, (n) => { daysForwardShown.value = Math.max(n, daysInMonth(anchorDate.value)); }); \n \nconst rootRef = ref<HTMLElement | null>(null); \nconst scrollRef = ref<HTMLElement | null>(null); \nconst today = new Date(); \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \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', hour12: props.format === '12h' }); \n}; \n \nconst isHighlightedDate = (d: Date) => props.highlightedDates.some(h => isSameDay(h, d)); \nconst isDisabledDate = (d: Date) => props.disabledDates.some(x => isSameDay(x, d)); \nconst isDisabledWeekday = (d: Date) => props.disabledWeekdays.includes(d.getDay()); \nconst isDayDisabled = (d: Date) => { \n if (props.minDate && startOfDay(d) < startOfDay(props.minDate)) return true; \n if (props.maxDate && startOfDay(d) > startOfDay(props.maxDate)) return true; \n return isDisabledDate(d) || isDisabledWeekday(d); \n}; \n \ninterface DayGroup { \n key: string; \n date: Date; \n day: number; \n weekdayLabel: string; \n monthLabel: string; \n showMonthHeader: boolean; \n isToday: boolean; \n disabled: boolean; \n events: CalendarEvent[]; \n} \n \nconst rangeDates = computed<Date[]>(() => { \n const anchor = anchorDate.value; \n const list: Date[] = []; \n for (let i = 0; i < daysForwardShown.value; i++) { \n const d = new Date(anchor); \n d.setDate(d.getDate() + i); \n const sod = startOfDay(d); \n if (props.minDate && sod < startOfDay(props.minDate)) continue; \n if (props.maxDate && sod > startOfDay(props.maxDate)) continue; \n list.push(sod); \n } \n return list; \n}); \n \nconst eventsByDay = computed<Map<string, CalendarEvent[]>>(() => { \n const map = new Map<string, CalendarEvent[]>(); \n for (const ev of props.events) { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n const d = new Date(s); \n while (d.getTime() <= e.getTime()) { \n const k = d.toDateString(); \n if (!map.has(k)) map.set(k, []); \n map.get(k)!.push(ev); \n d.setDate(d.getDate() + 1); \n } \n } \n for (const list of map.values()) { \n list.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 return map; \n}); \n \nconst isoKey = (d: Date) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`; \nconst parseIsoKey = (s: string): Date | null => { \n const m = s.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/); \n if (!m) return null; \n return new Date(parseInt(m[1]), parseInt(m[2]) - 1, parseInt(m[3])); \n}; \n \nconst groups = computed<DayGroup[]>(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const result: DayGroup[] = []; \n let lastMonthKey = ''; \n for (const date of rangeDates.value) { \n const key = isoKey(date); \n const evts = eventsByDay.value.get(date.toDateString()) ?? []; \n if (!props.showEmptyDays && !evts.length) continue; \n const monthKey = `${date.getFullYear()}-${date.getMonth()}`; \n const showMonthHeader = monthKey !== lastMonthKey; \n lastMonthKey = monthKey; \n result.push({ \n key, \n date, \n day: date.getDate(), \n weekdayLabel: date.toLocaleDateString(locale, { weekday: props.dayNameFormat }), \n monthLabel: date.toLocaleDateString(locale, { month: 'long', year: 'numeric' }), \n showMonthHeader, \n isToday: isSameDay(date, today), \n disabled: isDayDisabled(date), \n events: evts, \n }); \n } \n return result; \n}); \n \nconst headerLabel = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const d = visibleDate.value ?? anchorDate.value; \n return d.toLocaleDateString(locale, { month: 'long', year: 'numeric' }); \n}); \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => { \n emit('event-click', ev, e); \n}; \n \nconst afterNavigate = (scrollTarget?: Date, animateScroll = false) => { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) { animateIn(); return; } \n const scEl = scrollRef.value; \n let target = 0; \n if (scrollTarget) { \n const key = isoKey(startOfDay(scrollTarget)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n } \n } \n if (animateScroll && target > 0) { \n scEl.scrollTop = 0; \n animateIn(); \n gsap.to(scEl, { scrollTop: target, duration: 0.7, ease: 'power3.inOut', delay: 0.15 }); \n } else { \n scEl.scrollTop = target; \n animateIn(); \n } \n visibleDate.value = anchorDate.value; \n }); \n}; \nconst handlePrev = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNext = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleToday = () => { \n const n = new Date(); \n const wasCurrentMonth = firstOfMonth(n).getTime() === anchorDate.value.getTime(); \n anchorDate.value = firstOfMonth(n); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(n, !wasCurrentMonth); \n if (wasCurrentMonth && scrollRef.value && rootRef.value) { \n nextTick(() => { \n const key = isoKey(startOfDay(n)); \n const el = rootRef.value!.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value!.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value!.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value!, { scrollTop: target, duration: 0.6, ease: 'power3.inOut' }); \n }); \n } \n}; \nconst handlePrevYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNextYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \n \nconst animateIn = () => { \n if (!rootRef.value) return; \n const els = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n if (!els.length) return; \n gsap.fromTo( \n els, \n { opacity: 0, y: 8 }, \n { opacity: 1, y: 0, duration: 0.35, ease: 'power2.out', stagger: { amount: 0.2 } } \n ); \n}; \n \nlet loadingMore = false; \nconst visibleDate = ref<Date | null>(null); \nconst canExtend = () => { \n if (!props.maxDate) return true; \n const last = rangeDates.value[rangeDates.value.length - 1]; \n return !(last && startOfDay(last) >= startOfDay(props.maxDate)); \n}; \nconst onScroll = () => { \n if (!scrollRef.value) return; \n const el = scrollRef.value; \n if (rootRef.value) { \n const scRect = el.getBoundingClientRect(); \n const headers = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n let pick: Date | null = null; \n for (const h of headers) { \n const r = h.getBoundingClientRect(); \n if (r.bottom > scRect.top + 8) { \n const k = h.getAttribute('data-dkey'); \n if (k) pick = parseIsoKey(k); \n break; \n } \n } \n if (pick) visibleDate.value = pick; \n } \n if (loadingMore) return; \n const remaining = el.scrollHeight - (el.scrollTop + el.clientHeight); \n if (remaining < 120) { \n if (!canExtend()) return; \n loadingMore = true; \n daysForwardShown.value += props.loadMoreChunk; \n emit('load-more', 'forward'); \n setTimeout(() => { loadingMore = false; }, 120); \n } \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.enableKeyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n if (e.key === 'ArrowLeft' || e.key === 'PageUp') { e.preventDefault(); handlePrev(); } \n else if (e.key === 'ArrowRight' || e.key === 'PageDown') { e.preventDefault(); handleNext(); } \n else if (e.key.toLowerCase() === 't') { e.preventDefault(); handleToday(); } \n}; \n \nonMounted(() => { \n nextTick(() => { \n visibleDate.value = anchorDate.value; \n animateIn(); \n if (scrollRef.value && rootRef.value) { \n const todayMonth = firstOfMonth(today); \n if (todayMonth.getTime() === anchorDate.value.getTime()) { \n const key = isoKey(startOfDay(today)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scEl = scrollRef.value; \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n if (target > 0) { \n gsap.to(scEl, { scrollTop: target, duration: 0.9, ease: 'power3.inOut', delay: 0.25 }); \n } \n } \n } \n } \n }); \n}); \n \ndefineExpose({ \n scrollToDate(date: Date) { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) return; \n const key = isoKey(startOfDay(date)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value, { scrollTop: target, duration: 0.45, ease: 'power3.inOut' }); \n }); \n }, \n}); \n \nconst { todayTextClass, dayNameCaseClass, focusRingColorClass, highlightDotClass, containerRadiusClass, eventRadiusClass, pillRadiusClass, todayBgClass, resolvedColor } = useCalendarTheme({ \n color: () => props.color, \n radius: () => props.radius, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst DOT_THEMED: Record<string, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \nconst DOT_SEMANTIC: Record<string, string> = { \n info: 'bg-info', \n purple: 'bg-purple', \n pink: 'bg-pink', \n}; \nconst dotColorClass = (c?: CalendarEvent['color']) => { \n if (!c) return DOT_THEMED.default; \n return DOT_THEMED[c] ?? DOT_SEMANTIC[c] ?? DOT_THEMED.default; \n}; \n \nconst localeValue = computed(() => (props.locale === 'default' ? undefined : props.locale)); \n \nconst monthOptions = computed(() => { \n const base = new Date(2024, 0, 1); \n return Array.from({ length: 12 }, (_, i) => { \n const d = new Date(base); \n d.setMonth(i); \n return d.toLocaleString(localeValue.value, { month: 'long' }); \n }); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minDate?.getFullYear() ?? anchorDate.value.getFullYear() - 10; \n const max = props.maxDate?.getFullYear() ?? anchorDate.value.getFullYear() + 10; \n const list: number[] = []; \n for (let y = min; y <= max; y++) list.push(y); \n return list; \n}); \n \nconst selectedMonth = computed({ \n get: () => anchorDate.value.getMonth(), \n set: (mm: number) => { \n const d = new Date(anchorDate.value); \n d.setDate(1); \n d.setMonth(mm); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n \nconst selectedYear = computed({ \n get: () => anchorDate.value.getFullYear(), \n set: (yy: number) => { \n const d = new Date(anchorDate.value); \n d.setFullYear(yy); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6HA,MAAM,MAAM,sBAAA,eAAe;EAO3B,MAAM,QAAQ;EA0Bd,MAAM,OAAO;EAQb,MAAM,gBAAgB,MAAY,IAAI,KAAK,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,EAAE;EAC5E,MAAM,eAAe,MAAY,IAAI,KAAK,EAAE,aAAa,EAAE,EAAE,UAAU,GAAG,GAAG,EAAE,CAAC,SAAS;EAEzF,MAAM,cAAA,GAAA,IAAA,KAAiB,aAAa,IAAI,KAAK,MAAM,WAAW,CAAC,CAAC;EAChE,MAA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AA,GAAA,IAAA,oBAA2I,QAA1J,aAA6I,SAAM,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA;;;MAKxJ,OAAO,OAAA,MAAO,SAAM,MAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAAwB,OAAvD,YAAuD,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA;;;yBAQxC,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":"AgendaView.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../../src/components/data-display/calendar/AgendaView.vue"],"sourcesContent":["<template> \n <div \n ref=\"rootRef\" \n tabindex=\"-1\" \n :class=\"['relative 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\" :label=\"headerLabel\" :goToToday=\"handleToday\" :prev=\"handlePrev\" :next=\"handleNext\" :prevYear=\"handlePrevYear\" :nextYear=\"handleNextYear\"> \n <CalendarHeader \n :label=\"headerLabel\" \n :showHeader=\"showHeader\" \n :showYearJump=\"showYearNavigation\" \n :showTodayButton=\"showTodayButton\" \n :showMonthYearSelects=\"showMonthYearSelects\" \n :monthOptions=\"monthOptions\" \n :yearOptions=\"yearOptions\" \n v-model:selectedMonth=\"selectedMonth\" \n v-model:selectedYear=\"selectedYear\" \n :color=\"resolvedColor\" \n :focusRingColorClass=\"focusRingColorClass\" \n :todayTextClass=\"todayTextClass\" \n :todayRadiusClass=\"pillRadiusClass\" \n :dayNameCaseClass=\"dayNameCaseClass\" \n @prev=\"handlePrev\" \n @next=\"handleNext\" \n @prevYear=\"handlePrevYear\" \n @nextYear=\"handleNextYear\" \n @today=\"handleToday\" \n /> \n </slot> \n \n <div ref=\"scrollRef\" class=\"flex-1 overflow-y-auto\" @scroll=\"onScroll\"> \n <div v-if=\"!groups.length\" class=\"flex-1 flex items-center justify-center py-12 text-sm text-muted-foreground\"> \n <slot name=\"empty\">{{ emptyText ?? loc.agenda.empty }}</slot> \n </div> \n \n <template v-for=\"(g, gi) in groups\" :key=\"g.key\"> \n <div \n v-if=\"showMonthSeparator && g.showMonthHeader\" \n class=\"sticky top-0 z-20 bg-card/95 backdrop-blur px-4 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground border-b border-border\" \n > \n {{ g.monthLabel }} \n </div> \n \n <div \n :data-dkey=\"g.key\" \n :class=\"[ \n 'grid border-b border-border transition-colors', \n g.isToday ? 'bg-muted/40' : '', \n g.disabled ? 'opacity-60' : '', \n ]\" \n style=\"grid-template-columns: 5rem 1fr;\" \n > \n <div class=\"flex flex-col items-center justify-start py-4 border-r border-border\"> \n <slot name=\"day-header\" :date=\"g.date\" :isToday=\"g.isToday\" :events=\"g.events\"> \n <span :class=\"['text-[10px] font-medium tracking-wider text-muted-foreground', dayNameCaseClass]\">{{ g.weekdayLabel }}</span> \n <span \n :class=\"[ \n 'mt-1 inline-flex items-center justify-center text-base font-semibold w-9 h-9', \n pillRadiusClass, \n g.isToday ? [todayBgClass] : 'text-foreground', \n ]\" \n >{{ g.day }}</span> \n <span v-if=\"isHighlightedDate(g.date)\" :class=\"['mt-1 w-1 h-1 rounded-full', highlightDotClass]\"></span> \n </slot> \n </div> \n \n <div class=\"py-2 px-3\"> \n <div v-if=\"!g.events.length\" class=\"py-2 text-xs text-muted-foreground/60 italic\"> \n No events \n </div> \n <div v-else class=\"flex flex-col\"> \n <button \n v-for=\"ev in g.events\" \n :key=\"`${g.key}-${ev.id}`\" \n :data-eid=\"ev.id\" \n type=\"button\" \n @click=\"handleEventClick(ev, $event)\" \n @mouseenter=\"onEventEnter(ev, !!ev.allDay, $event)\" \n @mousemove=\"onEventMove\" \n @mouseleave=\"onEventLeave\" \n :class=\"['group flex items-start gap-3 py-2 px-2 -mx-2 cursor-pointer transition-colors hover:bg-muted/70 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-ring', eventRadiusClass]\" \n > \n <span class=\"shrink-0 w-16 pt-0.5 text-[11px] font-medium text-muted-foreground tabular-nums\"> \n <template v-if=\"ev.allDay\">All day</template> \n <template v-else>{{ formatEventTime(ev.start) }}</template> \n </span> \n <span \n class=\"shrink-0 mt-1.5 w-2 h-2\" \n :style=\"ev.colorHex ? { backgroundColor: ev.colorHex } : undefined\" \n :class=\"[pillRadiusClass, !ev.colorHex ? dotColorClass(ev.color) : '']\" \n ></span> \n <span class=\"flex-1 min-w-0\"> \n <slot name=\"event\" :event=\"ev\"> \n <span class=\"block text-sm font-medium text-foreground truncate\">{{ ev.title }}</span> \n <span v-if=\"!ev.allDay && ev.end\" class=\"block text-[11px] text-muted-foreground\"> \n {{ formatEventTime(ev.start) }} – {{ formatEventTime(ev.end) }} \n </span> \n <span v-if=\"ev.description\" class=\"block text-xs text-muted-foreground truncate mt-0.5\">{{ ev.description }}</span> \n </slot> \n </span> \n <span v-if=\"ev.readonly\" class=\"shrink-0 mt-0.5 text-[9px] uppercase tracking-wider text-muted-foreground border border-border px-1 rounded\">Locked</span> \n </button> \n </div> \n </div> \n </div> \n <div v-if=\"gi === groups.length - 1\" class=\"h-1\"></div> \n </template> \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, onMounted } from 'vue'; \nimport gsap from 'gsap'; \nimport { isSameDay, startOfDay } from '../../../composables/useCalendar'; \nimport { useCalendarTheme } from '../../../composables/useCalendarTheme'; \nimport { useModoLocale } from '../../../composables/useModoConfig'; \n \nconst loc = useModoLocale(); \nimport { useEventHover } from '../../../composables/useEventHover'; \nimport CalendarEventTooltip from './CalendarEventTooltip.vue'; \nimport CalendarHeader from './CalendarHeader.vue'; \nimport type { AgendaView } from '../../../interfaces/data-display/calendar/AgendaView.interface'; \nimport type { CalendarEvent } from '../../../interfaces/data-display/calendar/MonthView.interface'; \n \nimport { toCssLength } from '../../../utils/cssLength';\n\nconst props = withDefaults(defineProps<AgendaView>(), { \n modelValue: () => new Date(), \n events: () => [], \n locale: 'default', \n color: 'default', \n bordered: true, \n daysToShow: 30, \n daysBefore: 0, \n showEmptyDays: false, \n showHeader: true, \n showMonthSeparator: true, \n showYearNavigation: false, \n showMonthYearSelects: false, \n showTodayButton: true, \n dayNameFormat: 'short', \n dayNameCase: 'upper', \n format: '24h', \n readonly: false, \n highlightedDates: () => [], \n disabledDates: () => [], \n disabledWeekdays: () => [], \n // emptyText resolves against locale when not provided. \n loadMoreChunk: 30, \n enableKeyboardNavigation: true, \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 'create-event': [date: Date, allDay: boolean, nativeEvent: MouseEvent | KeyboardEvent]; \n 'load-more': [direction: 'forward' | 'backward']; \n}>(); \n \nconst firstOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth(), 1); \nconst daysInMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate(); \n \nconst anchorDate = ref(firstOfMonth(new Date(props.modelValue))); \nconst daysForwardShown = ref(Math.max(props.daysToShow, daysInMonth(anchorDate.value))); \n \nwatch(() => props.modelValue, (v) => { \n if (!v) return; \n const f = firstOfMonth(new Date(v)); \n if (f.getTime() === anchorDate.value.getTime()) return; \n anchorDate.value = f; \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(f)); \n}); \nwatch(() => props.daysToShow, (n) => { daysForwardShown.value = Math.max(n, daysInMonth(anchorDate.value)); }); \n \nconst rootRef = ref<HTMLElement | null>(null); \nconst scrollRef = ref<HTMLElement | null>(null); \nconst today = new Date(); \n \nconst { hoverState, onEventEnter, onEventMove, onEventLeave, tooltipStyle } = useEventHover<CalendarEvent>(); \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', hour12: props.format === '12h' }); \n}; \n \nconst isHighlightedDate = (d: Date) => props.highlightedDates.some(h => isSameDay(h, d)); \nconst isDisabledDate = (d: Date) => props.disabledDates.some(x => isSameDay(x, d)); \nconst isDisabledWeekday = (d: Date) => props.disabledWeekdays.includes(d.getDay()); \nconst isDayDisabled = (d: Date) => { \n if (props.minDate && startOfDay(d) < startOfDay(props.minDate)) return true; \n if (props.maxDate && startOfDay(d) > startOfDay(props.maxDate)) return true; \n return isDisabledDate(d) || isDisabledWeekday(d); \n}; \n \ninterface DayGroup { \n key: string; \n date: Date; \n day: number; \n weekdayLabel: string; \n monthLabel: string; \n showMonthHeader: boolean; \n isToday: boolean; \n disabled: boolean; \n events: CalendarEvent[]; \n} \n \nconst rangeDates = computed<Date[]>(() => { \n const anchor = anchorDate.value; \n const list: Date[] = []; \n for (let i = 0; i < daysForwardShown.value; i++) { \n const d = new Date(anchor); \n d.setDate(d.getDate() + i); \n const sod = startOfDay(d); \n if (props.minDate && sod < startOfDay(props.minDate)) continue; \n if (props.maxDate && sod > startOfDay(props.maxDate)) continue; \n list.push(sod); \n } \n return list; \n}); \n \nconst eventsByDay = computed<Map<string, CalendarEvent[]>>(() => { \n const map = new Map<string, CalendarEvent[]>(); \n for (const ev of props.events) { \n const s = startOfDay(ev.start); \n const e = startOfDay(ev.end ?? ev.start); \n const d = new Date(s); \n while (d.getTime() <= e.getTime()) { \n const k = d.toDateString(); \n if (!map.has(k)) map.set(k, []); \n map.get(k)!.push(ev); \n d.setDate(d.getDate() + 1); \n } \n } \n for (const list of map.values()) { \n list.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 return map; \n}); \n \nconst isoKey = (d: Date) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`; \nconst parseIsoKey = (s: string): Date | null => { \n const m = s.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/); \n if (!m) return null; \n return new Date(parseInt(m[1]), parseInt(m[2]) - 1, parseInt(m[3])); \n}; \n \nconst groups = computed<DayGroup[]>(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const result: DayGroup[] = []; \n let lastMonthKey = ''; \n for (const date of rangeDates.value) { \n const key = isoKey(date); \n const evts = eventsByDay.value.get(date.toDateString()) ?? []; \n if (!props.showEmptyDays && !evts.length) continue; \n const monthKey = `${date.getFullYear()}-${date.getMonth()}`; \n const showMonthHeader = monthKey !== lastMonthKey; \n lastMonthKey = monthKey; \n result.push({ \n key, \n date, \n day: date.getDate(), \n weekdayLabel: date.toLocaleDateString(locale, { weekday: props.dayNameFormat }), \n monthLabel: date.toLocaleDateString(locale, { month: 'long', year: 'numeric' }), \n showMonthHeader, \n isToday: isSameDay(date, today), \n disabled: isDayDisabled(date), \n events: evts, \n }); \n } \n return result; \n}); \n \nconst headerLabel = computed(() => { \n const locale = props.locale === 'default' ? undefined : props.locale; \n const d = visibleDate.value ?? anchorDate.value; \n return d.toLocaleDateString(locale, { month: 'long', year: 'numeric' }); \n}); \n \nconst handleEventClick = (ev: CalendarEvent, e: MouseEvent) => { \n emit('event-click', ev, e); \n}; \n \nconst afterNavigate = (scrollTarget?: Date, animateScroll = false) => { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) { animateIn(); return; } \n const scEl = scrollRef.value; \n let target = 0; \n if (scrollTarget) { \n const key = isoKey(startOfDay(scrollTarget)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n } \n } \n if (animateScroll && target > 0) { \n scEl.scrollTop = 0; \n animateIn(); \n gsap.to(scEl, { scrollTop: target, duration: 0.7, ease: 'power3.inOut', delay: 0.15 }); \n } else { \n scEl.scrollTop = target; \n animateIn(); \n } \n visibleDate.value = anchorDate.value; \n }); \n}; \nconst handlePrev = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNext = () => { \n const d = new Date(anchorDate.value); \n d.setMonth(d.getMonth() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleToday = () => { \n const n = new Date(); \n const wasCurrentMonth = firstOfMonth(n).getTime() === anchorDate.value.getTime(); \n anchorDate.value = firstOfMonth(n); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(n, !wasCurrentMonth); \n if (wasCurrentMonth && scrollRef.value && rootRef.value) { \n nextTick(() => { \n const key = isoKey(startOfDay(n)); \n const el = rootRef.value!.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value!.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value!.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value!, { scrollTop: target, duration: 0.6, ease: 'power3.inOut' }); \n }); \n } \n}; \nconst handlePrevYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() - 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \nconst handleNextYear = () => { \n const d = new Date(anchorDate.value); \n d.setFullYear(d.getFullYear() + 1); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n}; \n \nconst animateIn = () => { \n if (!rootRef.value) return; \n const els = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n if (!els.length) return; \n gsap.fromTo( \n els, \n { opacity: 0, y: 8 }, \n { opacity: 1, y: 0, duration: 0.35, ease: 'power2.out', stagger: { amount: 0.2 } } \n ); \n}; \n \nlet loadingMore = false; \nconst visibleDate = ref<Date | null>(null); \nconst canExtend = () => { \n if (!props.maxDate) return true; \n const last = rangeDates.value[rangeDates.value.length - 1]; \n return !(last && startOfDay(last) >= startOfDay(props.maxDate)); \n}; \nconst onScroll = () => { \n if (!scrollRef.value) return; \n const el = scrollRef.value; \n if (rootRef.value) { \n const scRect = el.getBoundingClientRect(); \n const headers = rootRef.value.querySelectorAll<HTMLElement>('[data-dkey]'); \n let pick: Date | null = null; \n for (const h of headers) { \n const r = h.getBoundingClientRect(); \n if (r.bottom > scRect.top + 8) { \n const k = h.getAttribute('data-dkey'); \n if (k) pick = parseIsoKey(k); \n break; \n } \n } \n if (pick) visibleDate.value = pick; \n } \n if (loadingMore) return; \n const remaining = el.scrollHeight - (el.scrollTop + el.clientHeight); \n if (remaining < 120) { \n if (!canExtend()) return; \n loadingMore = true; \n daysForwardShown.value += props.loadMoreChunk; \n emit('load-more', 'forward'); \n setTimeout(() => { loadingMore = false; }, 120); \n } \n}; \n \nconst handleKeydown = (e: KeyboardEvent) => { \n if (!props.enableKeyboardNavigation) return; \n const target = e.target as HTMLElement; \n if (target.tagName === 'SELECT' || target.tagName === 'INPUT') return; \n if (e.key === 'ArrowLeft' || e.key === 'PageUp') { e.preventDefault(); handlePrev(); } \n else if (e.key === 'ArrowRight' || e.key === 'PageDown') { e.preventDefault(); handleNext(); } \n else if (e.key.toLowerCase() === 't') { e.preventDefault(); handleToday(); } \n}; \n \nonMounted(() => { \n nextTick(() => { \n visibleDate.value = anchorDate.value; \n animateIn(); \n if (scrollRef.value && rootRef.value) { \n const todayMonth = firstOfMonth(today); \n if (todayMonth.getTime() === anchorDate.value.getTime()) { \n const key = isoKey(startOfDay(today)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (el) { \n const scEl = scrollRef.value; \n const scRect = scEl.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scEl.scrollTop + (elRect.top - scRect.top) - 12; \n if (target > 0) { \n gsap.to(scEl, { scrollTop: target, duration: 0.9, ease: 'power3.inOut', delay: 0.25 }); \n } \n } \n } \n } \n }); \n}); \n \ndefineExpose({ \n scrollToDate(date: Date) { \n nextTick(() => { \n if (!scrollRef.value || !rootRef.value) return; \n const key = isoKey(startOfDay(date)); \n const el = rootRef.value.querySelector<HTMLElement>(`[data-dkey=\"${key}\"]`); \n if (!el) return; \n const scRect = scrollRef.value.getBoundingClientRect(); \n const elRect = el.getBoundingClientRect(); \n const target = scrollRef.value.scrollTop + (elRect.top - scRect.top) - 12; \n gsap.to(scrollRef.value, { scrollTop: target, duration: 0.45, ease: 'power3.inOut' }); \n }); \n }, \n}); \n \nconst { todayTextClass, dayNameCaseClass, focusRingColorClass, highlightDotClass, containerRadiusClass, eventRadiusClass, pillRadiusClass, todayBgClass, resolvedColor } = useCalendarTheme({ \n color: () => props.color, \n radius: () => props.radius, \n dayNameCase: () => props.dayNameCase, \n}); \n \nconst DOT_THEMED: Record<string, string> = { \n default: 'bg-muted-foreground', \n primary: 'bg-primary', \n danger: 'bg-destructive', \n success: 'bg-success', \n warning: 'bg-warning', \n}; \nconst DOT_SEMANTIC: Record<string, string> = { \n info: 'bg-info', \n purple: 'bg-purple', \n pink: 'bg-pink', \n}; \nconst dotColorClass = (c?: CalendarEvent['color']) => { \n if (!c) return DOT_THEMED.default; \n return DOT_THEMED[c] ?? DOT_SEMANTIC[c] ?? DOT_THEMED.default; \n}; \n \nconst localeValue = computed(() => (props.locale === 'default' ? undefined : props.locale)); \n \nconst monthOptions = computed(() => { \n const base = new Date(2024, 0, 1); \n return Array.from({ length: 12 }, (_, i) => { \n const d = new Date(base); \n d.setMonth(i); \n return d.toLocaleString(localeValue.value, { month: 'long' }); \n }); \n}); \n \nconst yearOptions = computed(() => { \n const min = props.minDate?.getFullYear() ?? anchorDate.value.getFullYear() - 10; \n const max = props.maxDate?.getFullYear() ?? anchorDate.value.getFullYear() + 10; \n const list: number[] = []; \n for (let y = min; y <= max; y++) list.push(y); \n return list; \n}); \n \nconst selectedMonth = computed({ \n get: () => anchorDate.value.getMonth(), \n set: (mm: number) => { \n const d = new Date(anchorDate.value); \n d.setDate(1); \n d.setMonth(mm); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n \nconst selectedYear = computed({ \n get: () => anchorDate.value.getFullYear(), \n set: (yy: number) => { \n const d = new Date(anchorDate.value); \n d.setFullYear(yy); \n anchorDate.value = firstOfMonth(d); \n daysForwardShown.value = Math.max(props.daysToShow, daysInMonth(anchorDate.value)); \n emit('update:modelValue', anchorDate.value); \n afterNavigate(); \n }, \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8HA,MAAM,MAAM,sBAAA,eAAe;EAS3B,MAAM,QAAQ;EA0Bd,MAAM,OAAO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,oBAEtB,QAFP,cAAA,GAAA,IAAA,iBACO,gBAAgB,GAAG,MAAK,CAAA,GAAI,SAAA,GAAA,IAAA,iBAAM,gBAAgB,GAAG,IAAG,CAAA,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA;SAEnD,GAAG,gBAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAAoG,QAAnH,cAAA,GAAA,IAAA,iBAA2F,GAAG,YAAW,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA;;QAGrG,GAAG,aAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAA2I,QAA1J,aAA6I,SAAM,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA;;;MAKxJ,OAAO,OAAA,MAAO,SAAM,MAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAAwB,OAAvD,YAAuD,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA;;;yBAQxC,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"}
@@ -4,6 +4,7 @@ import { useCalendarTheme } from "../../../composables/useCalendarTheme.mjs";
4
4
  import { useEventHover } from "../../../composables/useEventHover.mjs";
5
5
  import CalendarEventTooltip_default from "./CalendarEventTooltip.mjs";
6
6
  import CalendarHeader_default from "./CalendarHeader.mjs";
7
+ import { toCssLength } from "../../../utils/cssLength.mjs";
7
8
  import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
8
9
  import gsap from "gsap";
9
10
  //#region src/components/data-display/calendar/AgendaView.vue?vue&type=script&setup=true&lang.ts
@@ -62,6 +63,7 @@ var AgendaView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
62
63
  type: Boolean,
63
64
  default: true
64
65
  },
66
+ maxHeight: {},
65
67
  minDate: {},
66
68
  maxDate: {},
67
69
  daysToShow: { default: 30 },
@@ -487,6 +489,7 @@ var AgendaView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
487
489
  unref(containerRadiusClass),
488
490
  __props.bordered ? "border border-border" : ""
489
491
  ]),
492
+ style: normalizeStyle({ maxHeight: unref(toCssLength)(__props.maxHeight) }),
490
493
  onKeydown: handleKeydown
491
494
  }, [
492
495
  renderSlot(_ctx.$slots, "header", {
@@ -603,7 +606,7 @@ var AgendaView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
603
606
  })]),
604
607
  _: 3
605
608
  }, 8, ["state", "style"])
606
- ], 34);
609
+ ], 38);
607
610
  };
608
611
  }
609
612
  });