@kumix/ui 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/dist/components/motion/animated-toast-stack.js +3 -3
- package/dist/components/motion/animated-toast-stack.js.map +1 -1
- package/dist/components/motion/button/base.d.ts +8 -1
- package/dist/components/motion/button/base.d.ts.map +1 -1
- package/dist/components/motion/button/base.js +14 -1
- package/dist/components/motion/button/base.js.map +1 -1
- package/dist/components/motion/button/index.d.ts +2 -2
- package/dist/components/motion/button/index.js +2 -2
- package/dist/components/motion/checkbox.d.ts +3 -1
- package/dist/components/motion/checkbox.d.ts.map +1 -1
- package/dist/components/motion/checkbox.js +2 -1
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/morphing-tabs.d.ts +36 -0
- package/dist/components/motion/morphing-tabs.d.ts.map +1 -0
- package/dist/components/motion/morphing-tabs.js +518 -0
- package/dist/components/motion/morphing-tabs.js.map +1 -0
- package/dist/components/motion/signup-form.d.ts +56 -0
- package/dist/components/motion/signup-form.d.ts.map +1 -0
- package/dist/components/motion/signup-form.js +337 -0
- package/dist/components/motion/signup-form.js.map +1 -0
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/autocomplete.d.ts +1 -1
- package/dist/components/reui/badge.d.ts +2 -2
- package/dist/components/reui/data-grid/data-grid-column-filter.js +2 -2
- package/dist/components/reui/data-grid/data-grid.d.ts +4 -0
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +6 -2
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts +32 -1
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +32 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.js +19 -4
- package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-resource-view.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js +16 -4
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js +33 -5
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
- package/dist/components/reui/filters.js +3 -3
- package/dist/components/reui/frame.d.ts +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +1 -1
- package/dist/components/reui/gantt/gantt-view.js +3 -3
- package/dist/components/reui/icon-tile.d.ts +1 -1
- package/dist/components/reui/number-field.d.ts +3 -3
- package/dist/components/reui/phone-input.js +1 -1
- package/dist/components/reui/rating.d.ts +1 -1
- package/dist/components/ui/attachment.d.ts +3 -3
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/empty.d.ts +1 -1
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/item.d.ts +2 -2
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/questionnaire.d.ts +2 -1
- package/dist/components/ui/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire.js +11 -4
- package/dist/components/ui/questionnaire.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.js +2 -2
- package/dist/components/ui/toggle.d.ts +1 -1
- package/package.json +74 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-calendar-month-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-month-view.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type Ref,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, format, getWeek } from \"date-fns\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../ui/popover\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarDay,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n useEventCalendarViewSettings,\n useEventCalendarWeek,\n} from \"./event-calendar\";\nimport { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from \"./event-calendar-dnd\";\nimport { EVENT_CALENDAR_GHOST, EventCalendarEvent } from \"./event-calendar-event\";\nimport {\n getDayKey,\n getRangeKey,\n resolveOffDay,\n toZoned,\n zonedStartOfDay,\n} from \"./event-calendar-lib\";\nimport type {\n EventCalendarDateRange,\n EventCalendarDragState,\n EventCalendarEventId,\n EventCalendarSegment,\n} from \"./event-calendar-types\";\n\n// Layout-effect on the client (measure before paint, no flash), plain effect on\n// the server (never runs there) to avoid the SSR useLayoutEffect warning.\nconst useIsoLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// An occurrence key encodes the start instant and is also the chip's React key,\n// so committing a move re-keys the chip: React remounts it and the browser\n// drops focus to <body>. The chip that owns focus is recorded here so the cell\n// rendering its replacement can hand focus back. Module scope because the drop\n// can land in a different cell than the one the chip left, and only one element\n// holds focus at a time anyway.\nlet focusedChip: {\n node: HTMLElement;\n eventId: EventCalendarEventId;\n recurrenceIndex?: number;\n} | null = null;\n\n/** Give focus back to the recorded chip's replacement, if `root` renders it. */\nfunction restoreChipFocus(root: HTMLElement | null, segments: EventCalendarSegment[]) {\n const pending = focusedChip;\n // Only a chip removed WHILE focused needs help: a node still in the tree, or\n // a focus that has already moved on by itself, is left alone.\n if (!root || !pending || pending.node.isConnected) return;\n const active = document.activeElement;\n if (active && active !== document.body) return;\n const index = segments.findIndex(\n (segment) =>\n segment.occurrence.eventId === pending.eventId &&\n segment.occurrence.recurrenceIndex === pending.recurrenceIndex,\n );\n if (index < 0) return;\n const chip = root.querySelectorAll<HTMLElement>(\"[data-slot=event-calendar-event]\")[index];\n if (!chip) return;\n // cleared first: focus() re-records through the new chip's own onFocus\n focusedChip = null;\n chip.focus();\n}\n\ninterface EventCalendarMonthViewProps extends useRender.ComponentProps<\"div\"> {\n maxEventsPerCell?: number | \"auto\";\n}\n\nfunction EventCalendarMonthView({\n className,\n render,\n maxEventsPerCell,\n ...props\n}: EventCalendarMonthViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const visibleRange = useEventCalendarSelector<unknown, EventCalendarDateRange>(\n (state) => state.visibleRange,\n {\n isEqual: (a, b) => getRangeKey(a) === getRangeKey(b),\n },\n );\n const anchorDate = useEventCalendarSelector((state) => state.date);\n\n const { effective } = useEventCalendarViewSettings();\n const weeks = useMemo(() => {\n const days: Date[] = [];\n let cursor = zonedStartOfDay(visibleRange.start, settings.timeZone);\n while (cursor < visibleRange.end) {\n days.push(cursor);\n cursor = zonedStartOfDay(addDays(toZoned(cursor, settings.timeZone), 1), settings.timeZone);\n }\n const rows: Date[][] = [];\n for (let i = 0; i < days.length; i += 7) rows.push(days.slice(i, i + 7));\n if (effective.weekends) return rows;\n return rows.map((row) =>\n row.filter((day) => !settings.weekendDays.includes(toZoned(day, settings.timeZone).getDay())),\n );\n }, [visibleRange, settings.timeZone, settings.weekendDays, effective.weekends]);\n\n const headerDays = weeks[0] ?? [];\n const title = settings.i18n.functions.formatTitle(\"month\", {\n date: toZoned(anchorDate, settings.timeZone),\n activeRange: instance.api.getActiveRange(),\n visibleRange,\n locale: settings.locale,\n });\n\n const gridTemplateColumns = `${effective.weekNumbers ? \"var(--ec-week-number-w, 2.75rem) \" : \"\"}repeat(${headerDays.length}, minmax(0, 1fr))`;\n const cap = maxEventsPerCell ?? viewConfig.maxEventsPerCell;\n const contained = viewConfig.scrollMode !== \"page\";\n\n // \"auto\" fits as many event rows as the cell height allows and rolls the rest\n // into \"+N more\". Only the contained mode gives a cell a bounded height to\n // measure; page mode grows to fit, so \"auto\" there keeps the fixed fallback.\n const autoFit = cap === \"auto\" && contained;\n // slotProbe resolves the event-row height (--ec-month-bar-h) to px, honoring\n // the current font size and any consumer override; contentProbe is the first\n // cell's flex-1 content area, whose height is the event space per cell.\n const slotProbeRef = useRef<HTMLDivElement | null>(null);\n const contentProbeRef = useRef<HTMLDivElement | null>(null);\n const [autoCap, setAutoCap] = useState<number | null>(null);\n const measureCap = useCallback(() => {\n const content = contentProbeRef.current;\n const slot = slotProbeRef.current;\n if (!content || !slot) return;\n const laneH = slot.getBoundingClientRect().height;\n if (laneH <= 0) return;\n const cs = getComputedStyle(content);\n const inner = content.clientHeight - (parseFloat(cs.paddingTop) || 0);\n const gap = parseFloat(cs.rowGap) || 0;\n // N rows occupy N*laneH - gap (the last row has no trailing gap)\n setAutoCap(Math.max(1, Math.floor((inner + gap) / laneH)));\n }, []);\n useIsoLayoutEffect(() => {\n if (!autoFit) {\n setAutoCap(null);\n return;\n }\n const content = contentProbeRef.current;\n if (!content || typeof ResizeObserver === \"undefined\") return;\n measureCap();\n const observer = new ResizeObserver(measureCap);\n observer.observe(content);\n return () => observer.disconnect();\n // re-observe the first cell after a re-layout (row count or month change)\n }, [autoFit, measureCap, weeks.length, anchorDate]);\n const resolvedCap = cap === \"auto\" ? (autoFit ? (autoCap ?? 3) : 3) : cap;\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-month-view\",\n \"data-view\": \"month\",\n role: \"grid\",\n \"aria-label\": title,\n className: cn(\n \"flex flex-col border-t\",\n contained && \"min-h-0 flex-1 overflow-hidden\",\n viewConfig.classNames?.monthView,\n className,\n ),\n children: (\n <>\n <div\n role=\"row\"\n data-slot=\"event-calendar-month-header\"\n // @container scopes the narrow-label breakpoint to the header row\n className={cn(\"@container grid border-b\", viewConfig.classNames?.monthHeader)}\n style={{ gridTemplateColumns }}\n >\n {effective.weekNumbers && (\n <div\n role=\"columnheader\"\n aria-hidden\n className={cn(\"border-e px-2 py-1.5\", viewConfig.classNames?.weekNumber)}\n />\n )}\n {headerDays.map((day) => (\n <div\n key={day.getTime()}\n role=\"columnheader\"\n className={cn(\n \"truncate px-2 py-1.5 font-medium text-muted-foreground\",\n viewConfig.classNames?.monthDayHeader,\n )}\n >\n {viewConfig.renderDayHeader?.({\n day,\n view: \"month\",\n isToday:\n getDayKey(day, settings.timeZone) === getDayKey(new Date(), settings.timeZone),\n }) ?? (\n <>\n <span className=\"@max-[36rem]:hidden\">\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.monthDayHeader, {\n locale: settings.locale,\n })}\n </span>\n <span className=\"@max-[36rem]:inline hidden\">\n {format(\n toZoned(day, settings.timeZone),\n settings.i18n.formats.monthDayHeaderNarrow,\n { locale: settings.locale },\n )}\n </span>\n </>\n )}\n </div>\n ))}\n </div>\n <div\n data-slot=\"event-calendar-month-body\"\n className={cn(\"grid\", contained && \"min-h-0 flex-1\", viewConfig.classNames?.monthBody)}\n style={{\n gridTemplateRows: contained\n ? `repeat(${weeks.length}, minmax(0, 1fr))`\n : `repeat(${weeks.length}, minmax(var(--ec-month-row-min-h, 8rem), auto))`,\n }}\n >\n {weeks.map((week, rowIndex) => (\n <EventCalendarMonthWeek\n key={rowIndex}\n week={week}\n gridTemplateColumns={gridTemplateColumns}\n showWeekNumber={effective.weekNumbers}\n cap={resolvedCap}\n autoFit={autoFit}\n contentRef={rowIndex === 0 ? contentProbeRef : undefined}\n />\n ))}\n </div>\n {autoFit && (\n <div\n ref={slotProbeRef}\n aria-hidden\n className=\"pointer-events-none invisible absolute h-(--ec-month-bar-h,1.75rem) w-0\"\n />\n )}\n </>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"month\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\n/**\n * One month week row. Multi-day / all-day events render as CONTINUOUS bars in\n * an overlay grid that spans day columns (colStart -> colSpan) and stacks by\n * lane; single-day timed events render inside each cell below the reserved bar\n * lanes. This is what makes a cross-day event read as one whole block instead\n * of a chip repeated per cell.\n */\nfunction EventCalendarMonthWeek({\n week,\n gridTemplateColumns,\n showWeekNumber,\n cap,\n autoFit,\n contentRef,\n}: {\n week: Date[];\n gridTemplateColumns: string;\n showWeekNumber: boolean;\n cap: number;\n autoFit: boolean;\n /** Set on the first week only: forwarded to its first cell's content area so\n * the view can measure the per-cell event height for \"auto\". */\n contentRef?: Ref<HTMLDivElement>;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { bars, rowStart } = useEventCalendarWeek(week[0]);\n const colOffset = showWeekNumber ? 1 : 0;\n const dayMs = 86400000;\n const rowStartMs = zonedStartOfDay(rowStart ?? week[0], settings.timeZone).getTime();\n // Day offsets from the TRUE row start (0-6) for each visible column, so a\n // weekends-hidden month still places bars on the right days.\n const offsets = week.map((d) =>\n Math.round((zonedStartOfDay(d, settings.timeZone).getTime() - rowStartMs) / dayMs),\n );\n /** Clamp a day-offset span onto the visible columns; null = fully hidden. */\n const gridPos = (colStart: number, colSpan: number) => {\n let start = -1;\n let end = -1;\n for (let o = colStart; o < colStart + colSpan; o++) {\n const col = offsets.indexOf(o);\n if (col === -1) continue;\n if (start === -1) start = col;\n end = col;\n }\n return start === -1 ? null : { col: start, span: end - start + 1 };\n };\n // bars fit within the cap; deeper lanes fall into each day's \"+N more\"\n const visibleBars = bars.filter((b) => (b.lane ?? 0) < cap);\n const covers = (b: EventCalendarSegment, dayOffset: number) =>\n (b.colStart ?? 0) <= dayOffset && dayOffset < (b.colStart ?? 0) + (b.colSpan ?? 1);\n // Occurrence keys of the bars hidden in each column (lane >= cap). Threaded to\n // the cell so its \"+N more\" popover can list the hidden bars WITHOUT re-listing\n // the visible ones (day buckets carry no lane, so the week row - which owns bar\n // laning - is the only place that knows which bars are hidden).\n const hiddenBarKeysByCol = week.map(\n (_, col) =>\n new Set(\n bars\n .filter((b) => (b.lane ?? 0) >= cap && covers(b, offsets[col]))\n .map((b) => b.occurrence.key),\n ),\n );\n\n // Live move/resize ghost at the PROPOSED day span. Standardized treatment\n // (EVENT_CALENDAR_GHOST): move = the event carried as a full clone, resize =\n // the same clone with a dashed boundary; invalid adds destructive marking\n // while the engine shows the not-allowed cursor + validation hint.\n const dragGhost = useEventCalendarSelector<\n unknown,\n | (Pick<\n EventCalendarDragState,\n \"kind\" | \"valid\" | \"occurrence\" | \"proposedStart\" | \"proposedEnd\" | \"proposedAllDay\"\n > & {\n colStart: number;\n colSpan: number;\n isStart: boolean;\n isEnd: boolean;\n color?: string;\n })\n | null\n >(\n (state) => {\n const drag = state.drag;\n if (!drag) return null;\n const rowEndMs = rowStartMs + 7 * dayMs;\n const startDayMs = zonedStartOfDay(drag.proposedStart, settings.timeZone).getTime();\n // exclusive end -> the last covered day\n const lastDayMs = zonedStartOfDay(\n new Date(drag.proposedEnd.getTime() - 1),\n settings.timeZone,\n ).getTime();\n if (startDayMs >= rowEndMs || lastDayMs < rowStartMs) return null;\n const startCol = Math.max(0, Math.round((startDayMs - rowStartMs) / dayMs));\n const endCol = Math.min(6, Math.round((lastDayMs - rowStartMs) / dayMs));\n if (endCol < startCol) return null;\n return {\n kind: drag.kind,\n valid: drag.valid,\n occurrence: drag.occurrence,\n proposedStart: drag.proposedStart,\n proposedEnd: drag.proposedEnd,\n proposedAllDay: drag.proposedAllDay,\n colStart: startCol,\n colSpan: endCol - startCol + 1,\n isStart: startDayMs >= rowStartMs,\n isEnd: lastDayMs < rowEndMs,\n color: drag.occurrence.event.color,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.colStart === b.colStart &&\n a.colSpan === b.colSpan &&\n a.valid === b.valid &&\n a.kind === b.kind &&\n a.proposedAllDay === b.proposedAllDay &&\n a.proposedStart.getTime() === b.proposedStart.getTime() &&\n a.proposedEnd.getTime() === b.proposedEnd.getTime()),\n },\n );\n const ghostPos = dragGhost ? gridPos(dragGhost.colStart, dragGhost.colSpan) : null;\n const ghostLane = dragGhost\n ? (bars.find((b) => b.occurrence.key === dragGhost.occurrence.key)?.lane ?? 0)\n : 0;\n // A single-day timed MOVE is indicated INLINE in the target cell (a\n // placeholder at the time-sorted position, rendered by EventCalendarMonthCell)\n // rather than as a bar in this overlay, so only bar drags and every resize\n // render the overlay ghost. Bars = all-day or multi-day (span > 1 day).\n const ghostIsBar =\n !!dragGhost &&\n (dragGhost.kind !== \"move\" ||\n dragGhost.proposedAllDay ||\n dragGhost.proposedEnd.getTime() - dragGhost.proposedStart.getTime() > dayMs);\n\n return (\n <div\n role=\"row\"\n data-slot=\"event-calendar-month-row\"\n className={cn(\n \"relative grid min-h-0 border-b last:border-b-0\",\n viewConfig.classNames?.monthRow,\n )}\n style={{ gridTemplateColumns }}\n >\n {showWeekNumber && (\n <div\n role=\"rowheader\"\n data-slot=\"event-calendar-week-number\"\n className={cn(\n \"border-e px-2 pt-1 text-muted-foreground tabular-nums\",\n viewConfig.classNames?.weekNumber,\n )}\n >\n {settings.i18n.labels.week(\n getWeek(toZoned(week[0], settings.timeZone), {\n // locale supplies firstWeekContainsDate, so a de/ISO calendar\n // numbers the year-boundary weeks its own way instead of falling\n // back to US numbering; weekStartsOn stays explicit so the number\n // keeps matching the rendered grid\n locale: settings.locale,\n weekStartsOn: settings.weekStartsOn,\n }),\n )}\n </div>\n )}\n {week.map((day, col) => (\n <EventCalendarMonthCell\n key={day.getTime()}\n day={day}\n cap={cap}\n // Reserve lane space only for bars that pass through THIS cell, so a\n // short multi-day event does not push down timed events in unrelated\n // cells of the same row. Reserve down to the deepest covering bar\n // lane so timed events always sit below every bar in their own cell.\n reservedLanes={visibleBars.reduce(\n (max, b) => (covers(b, offsets[col]) ? Math.max(max, (b.lane ?? 0) + 1) : max),\n 0,\n )}\n hiddenBarKeys={hiddenBarKeysByCol[col]}\n isLast={col === week.length - 1}\n autoFit={autoFit}\n contentRef={col === 0 ? contentRef : undefined}\n />\n ))}\n {/* Continuous bar overlay: one element per bar, placed by grid-column so\n a cross-day span is a single unbroken block. pointer-events pass\n through the gaps to the cells below. NOT aria-hidden - these are the\n real interactive bars. */}\n {(visibleBars.length > 0 || (dragGhost && ghostPos && ghostIsBar)) && (\n <div\n data-slot=\"event-calendar-month-bar-overlay\"\n className={cn(\n \"pointer-events-none absolute inset-x-0 top-0 z-10 grid pt-1.5\",\n viewConfig.classNames?.monthBarOverlay,\n )}\n style={{\n gridTemplateColumns,\n gridAutoRows: \"var(--ec-month-bar-h, 1.75rem)\",\n }}\n >\n {visibleBars.map((bar) => {\n const pos = gridPos(bar.colStart ?? 0, bar.colSpan ?? 1);\n if (!pos) return null;\n return (\n <div\n key={bar.occurrence.key}\n className={cn(\"pointer-events-auto min-w-0 px-1\", viewConfig.classNames?.monthBar)}\n style={{\n gridColumn: `${colOffset + pos.col + 1} / span ${pos.span}`,\n gridRow: (bar.lane ?? 0) + 1,\n }}\n >\n {/* lane height minus the 2px inter-lane gap */}\n <EventCalendarEvent\n segment={bar}\n className=\"h-[calc(var(--ec-month-bar-h,1.75rem)-0.125rem)]\"\n />\n </div>\n );\n })}\n {dragGhost && ghostPos && ghostIsBar && (\n <div\n aria-hidden\n className={cn(\"min-w-0 px-1\", viewConfig.classNames?.monthBar)}\n style={{\n gridColumn: `${colOffset + ghostPos.col + 1} / span ${ghostPos.span}`,\n gridRow: ghostLane + 1,\n }}\n >\n <div\n data-slot=\"event-calendar-drag-ghost\"\n data-kind={dragGhost.kind}\n data-drop-invalid={!dragGhost.valid || undefined}\n className={cn(\n \"h-[calc(var(--ec-month-bar-h,1.75rem)-0.125rem)]\",\n dragGhost.kind === \"move\"\n ? // faint drop placeholder only: the cursor-attached\n // carry clone owns the visual during moves\n cn(\n EVENT_CALENDAR_GHOST.move,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid,\n )\n : cn(\n EVENT_CALENDAR_GHOST.resize,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize,\n ),\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n \"--ec-event-color\": dragGhost.color ?? \"var(--color-primary)\",\n } as CSSProperties\n }\n >\n {dragGhost.kind !== \"move\" && (\n <EventCalendarEvent\n preview\n segment={{\n occurrence: {\n ...dragGhost.occurrence,\n start: dragGhost.proposedStart,\n end: dragGhost.proposedEnd,\n },\n day: week[ghostPos.col] ?? week[0],\n isStart: dragGhost.isStart,\n isEnd: dragGhost.isEnd,\n continuesBefore: !dragGhost.isStart,\n continuesAfter: !dragGhost.isEnd,\n }}\n className={cn(\n \"inset-ring-0 h-full\",\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent,\n )}\n />\n )}\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nfunction EventCalendarMonthCell({\n day,\n cap,\n reservedLanes,\n hiddenBarKeys,\n isLast,\n autoFit,\n contentRef,\n}: {\n day: Date;\n cap: number;\n reservedLanes: number;\n /** Occurrence keys of the bars hidden in THIS column (lane >= cap), from the\n * week row. Lets the cell list hidden bars in its overflow popover without\n * re-listing the bars already visible in the row overlay. */\n hiddenBarKeys: Set<string>;\n /** Last column in the row - drops the right border so the grid's outer edge\n * is owned by the container, not a doubled cell border. Passed explicitly\n * because the bar overlay renders after the cells, so `:last-child` is\n * unreliable on rows that have bars. */\n isLast: boolean;\n /** When true, the \"+N more\" chip is treated as taking a row so the visible\n * chips + indicator always fit the measured cell height. */\n autoFit: boolean;\n /** Set on the first cell only: measured to derive the \"auto\" cap. */\n contentRef?: Ref<HTMLDivElement>;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const gestures = useEventCalendarGestures();\n const { segments, isToday, isOutside } = useEventCalendarDay(day);\n\n const dayStart = zonedStartOfDay(day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const { effective } = useEventCalendarViewSettings();\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n\n const isDropTarget = useEventCalendarSelector<unknown, \"valid\" | \"invalid\" | null>((state) => {\n const drag = state.drag;\n if (!drag) return null;\n const covered = drag.proposedStart < dayEnd && drag.proposedEnd > dayStart;\n if (!covered) return null;\n return drag.valid ? \"valid\" : \"invalid\";\n });\n // Hide hover affordances mid-gesture: the only intent is the drop target.\n // Gated on the one thing that reads it: a plain global boolean flips for all\n // 42 cells the moment a gesture starts and again when it ends, which is pure\n // waste in the default configuration where no add button renders.\n const isInteracting = useEventCalendarSelector<unknown, boolean>((state) =>\n viewConfig.showDayAddButton ? state.drag !== null || state.slotDraft !== null : false,\n );\n const inDraft = useEventCalendarSelector<unknown, { isStart: boolean; isEnd: boolean } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return null;\n if (draft.start >= dayEnd || draft.end <= dayStart) return null;\n return {\n isStart: draft.start >= dayStart,\n isEnd: draft.end <= dayEnd,\n };\n },\n {\n isEqual: (a, b) =>\n a === b || (a !== null && b !== null && a.isStart === b.isStart && a.isEnd === b.isEnd),\n },\n );\n // A single-day timed MOVE landing on THIS day: expose the proposed\n // minute-of-day (+ color/validity) so the cell can render a drop placeholder\n // at the correct time-sorted position, instead of the overlay marking a bar\n // over the first chip. Skipped for bars (they keep the overlay ghost) and for\n // a no-op move back onto the event's own day (the dimmed source already marks\n // the spot).\n const inlineDrop = useEventCalendarSelector<\n unknown,\n { min: number; valid: boolean; color?: string } | null\n >(\n (state) => {\n const drag = state.drag;\n if (drag?.kind !== \"move\" || drag.proposedAllDay) return null;\n if (drag.proposedEnd.getTime() - drag.proposedStart.getTime() > 86400000) return null;\n const dropDayMs = zonedStartOfDay(drag.proposedStart, settings.timeZone).getTime();\n if (dropDayMs !== dayStart.getTime()) return null;\n if (\n zonedStartOfDay(drag.occurrence.start, settings.timeZone).getTime() === dayStart.getTime()\n )\n return null;\n return {\n min: (drag.proposedStart.getTime() - dropDayMs) / 60000,\n valid: drag.valid,\n color: drag.occurrence.event.color,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null && b !== null && a.min === b.min && a.valid === b.valid && a.color === b.color),\n },\n );\n\n // Bars (allDay/multi-day) are drawn by the week-row overlay; the cell renders\n // only single-day timed events, below the reserved bar lanes.\n const extraHidden = hiddenBarKeys.size;\n const hiddenBarSegs = segments.allDay.filter((s) => hiddenBarKeys.has(s.occurrence.key));\n const m = segments.timed.length;\n const timedSlots = Math.max(0, cap - reservedLanes);\n\n // Static (at-rest) split: what the cell shows with no drag, and - crucially -\n // what the \"+N more\" popover lists. The popover carries ONLY the hidden events\n // (hidden bars + timed past the cap), never the chips already visible in the\n // cell, so it never duplicates them. autoFit gives up one timed row to the\n // \"+N more\" indicator so the visible chips fit the clipped cell height.\n const staticOverflow = extraHidden > 0 || m > timedSlots;\n const staticShown = autoFit && staticOverflow ? Math.max(0, timedSlots - 1) : timedSlots;\n const overflowSegments = [...hiddenBarSegs, ...segments.timed.slice(staticShown)];\n\n // Live split: while a timed chip is dragged onto this day, render the day\n // exactly as it will look AFTER the drop. The dragged chip is a phantom in the\n // time-sorted order and is shown as the placeholder - inline where it lands,\n // or ON the \"+N more\" indicator when it lands in the overflow bucket (so the\n // user sees the drop will push it into \"more\"). The \"+N more\" count always\n // reflects the post-drop hidden total.\n let visibleTimed: EventCalendarSegment[];\n let overflowCount: number;\n let placeholderIndex: number;\n let placeholderAtMore: boolean;\n if (!inlineDrop) {\n visibleTimed = segments.timed.slice(0, staticShown);\n overflowCount = overflowSegments.length;\n placeholderIndex = -1;\n placeholderAtMore = false;\n } else {\n // rank of the dragged chip in the resulting time-sorted list (chips are\n // time-ordered, so this is the count starting at or before its time)\n const insertRank = segments.timed.filter((s) => (s.startMin ?? 0) <= inlineDrop.min).length;\n const dropOverflow = extraHidden > 0 || m + 1 > timedSlots;\n // rows for timed items INCLUDING the phantom, before the \"+N more\" row\n const vis = !dropOverflow ? m + 1 : autoFit ? Math.max(0, timedSlots - 1) : timedSlots;\n placeholderAtMore = insertRank >= vis;\n visibleTimed = placeholderAtMore\n ? segments.timed.slice(0, vis)\n : segments.timed.slice(0, Math.max(0, vis - 1));\n placeholderIndex = placeholderAtMore ? -1 : insertRank;\n overflowCount = extraHidden + (m - visibleTimed.length) + (placeholderAtMore ? 1 : 0);\n }\n\n // No dep array: the replacement for a chip that lost focus to a commit can\n // appear on any re-render of any cell, and a cell with nothing to restore\n // bails after two comparisons.\n const rootRef = useRef<HTMLDivElement | null>(null);\n useIsoLayoutEffect(() => {\n restoreChipFocus(rootRef.current, visibleTimed);\n });\n\n // Faint dashed drop placeholder, tinted to the dragged event's color, echoing\n // the move ghost (EVENT_CALENDAR_GHOST.move); one chip-height tall so chips\n // shift by exactly one row when it is inserted.\n const dropPlaceholder = inlineDrop ? (\n <div\n key=\"ec-drop-placeholder\"\n aria-hidden\n data-slot=\"event-calendar-drop-placeholder\"\n data-drop-invalid={!inlineDrop.valid || undefined}\n className={cn(\n \"shrink-0 rounded-sm border border-dashed\",\n inlineDrop.valid\n ? \"border-(--ec-event-color)/50 bg-(--ec-event-color)/8\"\n : \"border-destructive/70 bg-destructive/10\",\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n \"--ec-event-color\": inlineDrop.color ?? \"var(--color-primary)\",\n height: \"calc(var(--ec-month-bar-h, 1.75rem) - 0.125rem)\",\n } as CSSProperties\n }\n />\n ) : null;\n\n const defaultContent = (\n <>\n <div\n ref={contentRef}\n className={cn(\n // gap-0.5 pairs with the 0.125rem subtraction in the lane spacer\n // below; changing the gap requires renderMonthCell\n // px-1 matches the all-day bar wrapper inset so single-day chips and\n // multi-day bars line up on the same left/right edge in a cell\n \"flex min-h-0 flex-1 flex-col gap-0.5 overflow-hidden px-1 pt-1.5\",\n viewConfig.classNames?.monthCellContent,\n )}\n >\n {reservedLanes > 0 && (\n <div\n aria-hidden\n className=\"shrink-0\"\n style={{\n // lane height already carries the 2px inter-lane gap; subtract\n // it so spacer + the column's own gap-0.5 = the SAME 2px rhythm\n // between the last bar and the first timed chip\n height: `calc(${reservedLanes} * var(--ec-month-bar-h, 1.75rem) - 0.125rem)`,\n }}\n />\n )}\n {visibleTimed.flatMap((segment, i) => {\n const chip = (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n // Remember the chip holding focus so a commit that re-keys it can\n // hand focus back to the remounted one (see restoreChipFocus)\n onFocus={(e) => {\n focusedChip = {\n node: e.currentTarget,\n eventId: segment.occurrence.eventId,\n recurrenceIndex: segment.occurrence.recurrenceIndex,\n };\n }}\n // A chip still in the tree lost focus on its own, so there is\n // nothing to restore; only a blur from the remount is kept.\n onBlur={(e) => {\n if (e.currentTarget.isConnected) focusedChip = null;\n }}\n // Hold a fixed height like the all-day lane above; without this\n // the chip flex-shrinks to whatever room the cell has left, so\n // cells with a reserved bar lane or a second chip render shorter\n // chips.\n className=\"shrink-0\"\n />\n );\n return i === placeholderIndex ? [dropPlaceholder, chip] : [chip];\n })}\n {placeholderIndex >= 0 && placeholderIndex >= visibleTimed.length && dropPlaceholder}\n {overflowCount > 0 && (\n <EventCalendarMoreIndicator\n day={day}\n count={overflowCount}\n segments={overflowSegments}\n dropInto={\n placeholderAtMore && inlineDrop\n ? { color: inlineDrop.color, valid: inlineDrop.valid }\n : undefined\n }\n />\n )}\n </div>\n {/* Day number + add affordance, bottom-right (Notion-style) */}\n <div\n className={cn(\n \"flex items-center justify-end gap-1 px-2 pb-1.5\",\n viewConfig.classNames?.monthCellFooter,\n )}\n >\n {viewConfig.showDayAddButton && !isInteracting && (\n <button\n type=\"button\"\n data-slot=\"event-calendar-day-add\"\n aria-label={settings.i18n.labels.addEvent}\n // a different icon/markup is a renderMonthCell job\n className={cn(\n \"flex size-5 cursor-pointer items-center justify-center rounded-sm bg-primary text-primary-foreground opacity-0 transition-opacity focus-visible:opacity-100 group-hover/ec-cell:opacity-100\",\n viewConfig.classNames?.dayAddButton,\n )}\n onClick={(e) => {\n e.stopPropagation();\n settings.onSlotClick?.({ date: day, allDay: true, view: \"month\" }, e);\n }}\n >\n <PlusIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n )}\n <span\n data-slot=\"event-calendar-month-day-number\"\n className={cn(\n \"flex size-5 items-center justify-center rounded-full\",\n isOutside && \"text-muted-foreground\",\n // the filled circle already marks today; keep the number the same\n // weight/size as the other days so it does not read as larger\n // Same font-size as every other day; a lighter weight cancels the\n // way white digits on the filled circle read bolder/larger than the\n // dark-on-light numbers around them.\n isToday && \"bg-primary font-light text-primary-foreground\",\n viewConfig.classNames?.monthDayNumber,\n )}\n >\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.monthCellDay, {\n locale: settings.locale,\n })}\n </span>\n </div>\n </>\n );\n\n const content =\n viewConfig.renderMonthCell?.({\n day,\n segments,\n isToday,\n isOutside,\n overflowCount,\n defaultContent,\n }) ?? defaultContent;\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n ref={rootRef}\n role=\"gridcell\"\n data-slot=\"event-calendar-month-cell\"\n data-today={isToday || undefined}\n data-outside={isOutside || undefined}\n data-weekend={\n settings.weekendDays.includes(toZoned(day, settings.timeZone).getDay()) || undefined\n }\n data-ec-day={dayStart.getTime()}\n data-drop-target={isDropTarget ?? undefined}\n data-off={isOff || undefined}\n data-draft={inDraft ? \"\" : undefined}\n aria-label={format(\n toZoned(day, settings.timeZone),\n settings.i18n.formats.monthCellAriaLabel,\n { locale: settings.locale },\n )}\n className={cn(\n \"group/ec-cell relative flex min-h-0 min-w-0 flex-col overflow-hidden\",\n !isLast && \"border-e\",\n isOutside && !settings.showOutsideDays && \"invisible\",\n isOff && offClassName,\n isToday &&\n cn(\"relative border-b-2 border-b-primary/40 bg-primary/3\", viewConfig.todayClassName),\n viewConfig.dayClassName?.(day),\n // No drop-target bg fill on move/resize - the dragged bar + not-allowed\n // cursor carry the feedback; a cell-wide color wash is too distracting.\n // data-drop-target stays as an opt-in styling hook.\n inDraft && \"bg-primary/5\",\n viewConfig.classNames?.monthCell,\n )}\n onPointerDown={(e) => {\n const target = e.target as HTMLElement;\n if (target.closest(\"[data-slot=event-calendar-event]\")) return;\n if (target.closest(\"[data-slot=event-calendar-more]\")) return;\n gestures.beginCreate(e, day, true);\n }}\n onClick={(e) => {\n if (wasRecentDrag() || wasRecentChipPress()) return;\n settings.onSlotClick?.({ date: day, allDay: true, view: \"month\" }, e);\n }}\n >\n {inDraft && (\n <span\n aria-hidden\n data-slot=\"event-calendar-slot-draft\"\n className={cn(\n \"pointer-events-none absolute inset-0 z-10 border-primary/40 border-y border-dashed\",\n inDraft.isStart && \"border-s\",\n inDraft.isEnd && \"border-e\",\n viewConfig.classNames?.slotDraft,\n )}\n />\n )}\n {content}\n </div>\n );\n}\n\ninterface EventCalendarMoreIndicatorProps {\n day: Date;\n count: number;\n /** The OVERFLOW (hidden) segments for this day - bars first, then timed. The\n * popover lists only these, never the chips already visible in the cell. */\n segments: EventCalendarSegment[];\n /** Set while a timed chip is dragged and will land in THIS overflow bucket:\n * the indicator itself becomes the drop placeholder (dashed, event-tinted) so\n * it reads as \"the chip joins the +N more list\". */\n dropInto?: { color?: string; valid: boolean };\n}\n\n/**\n * \"+N more\" trigger opening a popover with the day's full event list.\n * onMoreClick returning false suppresses the built-in popover.\n */\nfunction EventCalendarMoreIndicator({\n day,\n count,\n segments,\n dropInto,\n}: EventCalendarMoreIndicatorProps) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const [open, setOpen] = useState(false);\n const headerId = useId();\n\n // Grabbing a chip from this list starts a drag; close the popover so it does\n // not sit over the drop target while the event is carried to another day.\n const isDragging = useEventCalendarSelector<unknown, boolean>((state) => state.drag !== null);\n useEffect(() => {\n if (isDragging) setOpen(false);\n }, [isDragging]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n data-slot=\"event-calendar-more\"\n data-drop-into={dropInto ? \"\" : undefined}\n data-drop-invalid={dropInto && !dropInto.valid ? \"\" : undefined}\n className={cn(\n \"cursor-pointer truncate rounded-sm px-1.5 text-start text-muted-foreground hover:text-foreground\",\n // While a dragged chip will land in this overflow bucket, the \"+N more\"\n // link itself becomes the drop placeholder: dashed, event-tinted, one\n // chip tall, so the drop target is unmistakable.\n dropInto &&\n cn(\n \"flex shrink-0 items-center border border-dashed\",\n dropInto.valid\n ? \"border-(--ec-event-color)/50 bg-(--ec-event-color)/8 text-foreground\"\n : \"border-destructive/70 bg-destructive/10 text-destructive\",\n ),\n viewConfig.classNames?.moreIndicator,\n )}\n style={\n dropInto\n ? ({\n \"--ec-event-color\": dropInto.color ?? \"var(--color-primary)\",\n height: \"calc(var(--ec-month-bar-h, 1.75rem) - 0.125rem)\",\n } as CSSProperties)\n : undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n const verdict = settings.onMoreClick?.(\n day,\n segments.map((segment) => segment.occurrence),\n e,\n );\n if (verdict === false) {\n e.preventDefault();\n setOpen(false);\n }\n }}\n >\n {viewConfig.renderMoreIndicator?.({ day, count, segments }) ??\n settings.i18n.labels.more(count)}\n </PopoverTrigger>\n <PopoverContent\n data-slot=\"event-calendar-more-popover\"\n align={viewConfig.morePopoverAlign}\n // The popover is a dialog, so it needs a name. The built-in body already\n // renders the day header this list belongs to, so point at that; a\n // consumer body has no header to point at and gets the same formatted\n // day as a label instead.\n aria-labelledby={viewConfig.renderMoreContent ? undefined : headerId}\n aria-label={\n viewConfig.renderMoreContent\n ? format(toZoned(day, settings.timeZone), settings.i18n.formats.moreDayHeader, {\n locale: settings.locale,\n })\n : undefined\n }\n // PopoverContent is unlayered (flex-col gap-4 p-4); override with !.\n // text-xs re-establishes the calendar's base type here because this\n // content is portaled out of the root subtree and cannot inherit it.\n className={cn(\"w-64 gap-1! p-2! text-xs\", viewConfig.classNames?.morePopover)}\n onClick={(e: React.MouseEvent) => e.stopPropagation()}\n >\n {viewConfig.renderMoreContent ? (\n viewConfig.renderMoreContent({\n day,\n segments,\n close: () => setOpen(false),\n })\n ) : (\n <EventCalendarMoreDefaultContent day={day} segments={segments} headerId={headerId} />\n )}\n </PopoverContent>\n </Popover>\n );\n}\n\n/** Built-in \"+N more\" popover body: day header + the day's chips. */\nfunction EventCalendarMoreDefaultContent({\n day,\n segments,\n headerId,\n}: {\n day: Date;\n segments: EventCalendarSegment[];\n /** Names the popover dialog: the header IS the list's accessible name. */\n headerId?: string;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n return (\n <>\n <div\n id={headerId}\n className={cn(\n \"px-1 py-1 font-medium text-muted-foreground text-xs\",\n viewConfig.classNames?.morePopoverHeader,\n )}\n >\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.moreDayHeader, {\n locale: settings.locale,\n })}\n </div>\n {/* The scroll region breaks out of the popover's right padding (-me-2)\n so the scrollbar sits flush in the gutter; the list then pads itself\n back (ps-1 aligns with the header, pe-4 clears the ~10px bar with a\n gap) and adds py-1 so the first/last focus ring is not clipped by\n the overflow. Layout is identical with or without a scrollbar. */}\n {viewConfig.scrollbars === \"native\" ? (\n <div\n data-ec-native-scroll=\"\"\n className=\"-me-2 max-h-(--ec-more-max-height,16rem) min-h-0 overflow-y-auto\"\n >\n <div className=\"flex flex-col gap-1 py-1 ps-1 pe-4\">\n {segments.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n className=\"py-0.5\"\n />\n ))}\n </div>\n </div>\n ) : (\n <ScrollArea className=\"-me-2 min-h-0 **:data-[slot=scroll-area-viewport]:max-h-(--ec-more-max-height,16rem)\">\n <div className=\"flex flex-col gap-1 py-1 ps-1 pe-4\">\n {segments.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n className=\"py-0.5\"\n />\n ))}\n </div>\n </ScrollArea>\n )}\n </>\n );\n}\n\nexport type { EventCalendarMonthViewProps, EventCalendarMoreIndicatorProps };\nexport { EventCalendarMonthView, EventCalendarMoreIndicator };\n"],"mappings":";;;;;;;;;;;;;;;AAiDA,MAAM,qBAAqB,OAAO,WAAW,cAAc,kBAAkB;AAQ7E,IAAI,cAIO;;AAGX,SAAS,iBAAiB,MAA0B,UAAkC;CACpF,MAAM,UAAU;CAGhB,IAAI,CAAC,QAAQ,CAAC,WAAW,QAAQ,KAAK,aAAa;CACnD,MAAM,SAAS,SAAS;CACxB,IAAI,UAAU,WAAW,SAAS,MAAM;CACxC,MAAM,QAAQ,SAAS,WACpB,YACC,QAAQ,WAAW,YAAY,QAAQ,WACvC,QAAQ,WAAW,oBAAoB,QAAQ,eACnD;CACA,IAAI,QAAQ,GAAG;CACf,MAAM,OAAO,KAAK,iBAA8B,kCAAkC,CAAC,CAAC;CACpF,IAAI,CAAC,MAAM;CAEX,cAAc;CACd,KAAK,MAAM;AACb;AAMA,SAAS,uBAAuB,EAC9B,WACA,QACA,kBACA,GAAG,SAC2B;CAC9B,MAAM,WAAW,iBAAiB;CAClC,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,MAAM,eAAe,0BAClB,UAAU,MAAM,cACjB,EACE,UAAU,GAAG,MAAM,YAAY,CAAC,MAAM,YAAY,CAAC,EACrD,CACF;CACA,MAAM,aAAa,0BAA0B,UAAU,MAAM,IAAI;CAEjE,MAAM,EAAE,cAAc,6BAA6B;CACnD,MAAM,QAA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,WAAW,oBACV,WAAW,kBAAkB;IAC3B;IACA;IACA,aAAa,QAAQ,KAAK;GAC5B,CAAC,IAED,oBAAC,iCAAD;IAAsC;IAAe;IAAoB;GAAW,CAAA;EAExE,CAAA,CACT;;AAEb;;AAGA,SAAS,gCAAgC,EACvC,KACA,UACA,YAMC;CACD,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,OAAD;EACE,IAAI;EACJ,WAAW,GACT,uDACA,WAAW,YAAY,iBACzB;EAEC,UAAA,OAAO,QAAQ,KAAK,SAAS,QAAQ,GAAG,SAAS,KAAK,QAAQ,eAAe,EAC5E,QAAQ,SAAS,OACnB,CAAC;CACE,CAAA,GAMJ,WAAW,eAAe,WACzB,oBAAC,OAAD;EACE,yBAAsB;EACtB,WAAU;EAEV,UAAA,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,SAAS,KAAK,YACb,oBAAC,oBAAD;IAEW;IACT,WAAU;GACX,GAHM,QAAQ,WAAW,GAGzB,CACF;EACE,CAAA;CACF,CAAA,IAEL,oBAAC,YAAD;EAAY,WAAU;EACpB,UAAA,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,SAAS,KAAK,YACb,oBAAC,oBAAD;IAEW;IACT,WAAU;GACX,GAHM,QAAQ,WAAW,GAGzB,CACF;EACE,CAAA;CACK,CAAA,CAEd,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"event-calendar-month-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-month-view.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type Ref,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, format, getWeek } from \"date-fns\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../ui/popover\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarDay,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n useEventCalendarViewSettings,\n useEventCalendarWeek,\n} from \"./event-calendar\";\nimport { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from \"./event-calendar-dnd\";\nimport {\n EVENT_CALENDAR_GHOST,\n EVENT_CALENDAR_SLOT_DRAFT,\n EventCalendarEvent,\n} from \"./event-calendar-event\";\nimport {\n getDayKey,\n getRangeKey,\n resolveOffDay,\n toZoned,\n zonedStartOfDay,\n} from \"./event-calendar-lib\";\nimport type {\n EventCalendarDateRange,\n EventCalendarDragState,\n EventCalendarEventId,\n EventCalendarSegment,\n} from \"./event-calendar-types\";\n\n// Layout-effect on the client (measure before paint, no flash), plain effect on\n// the server (never runs there) to avoid the SSR useLayoutEffect warning.\nconst useIsoLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// An occurrence key encodes the start instant and is also the chip's React key,\n// so committing a move re-keys the chip: React remounts it and the browser\n// drops focus to <body>. The chip that owns focus is recorded here so the cell\n// rendering its replacement can hand focus back. Module scope because the drop\n// can land in a different cell than the one the chip left, and only one element\n// holds focus at a time anyway.\nlet focusedChip: {\n node: HTMLElement;\n eventId: EventCalendarEventId;\n recurrenceIndex?: number;\n} | null = null;\n\n/** Give focus back to the recorded chip's replacement, if `root` renders it. */\nfunction restoreChipFocus(root: HTMLElement | null, segments: EventCalendarSegment[]) {\n const pending = focusedChip;\n // Only a chip removed WHILE focused needs help: a node still in the tree, or\n // a focus that has already moved on by itself, is left alone.\n if (!root || !pending || pending.node.isConnected) return;\n const active = document.activeElement;\n if (active && active !== document.body) return;\n const index = segments.findIndex(\n (segment) =>\n segment.occurrence.eventId === pending.eventId &&\n segment.occurrence.recurrenceIndex === pending.recurrenceIndex,\n );\n if (index < 0) return;\n const chip = root.querySelectorAll<HTMLElement>(\"[data-slot=event-calendar-event]\")[index];\n if (!chip) return;\n // cleared first: focus() re-records through the new chip's own onFocus\n focusedChip = null;\n chip.focus();\n}\n\ninterface EventCalendarMonthViewProps extends useRender.ComponentProps<\"div\"> {\n maxEventsPerCell?: number | \"auto\";\n}\n\nfunction EventCalendarMonthView({\n className,\n render,\n maxEventsPerCell,\n ...props\n}: EventCalendarMonthViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const visibleRange = useEventCalendarSelector<unknown, EventCalendarDateRange>(\n (state) => state.visibleRange,\n {\n isEqual: (a, b) => getRangeKey(a) === getRangeKey(b),\n },\n );\n const anchorDate = useEventCalendarSelector((state) => state.date);\n\n const { effective } = useEventCalendarViewSettings();\n const weeks = useMemo(() => {\n const days: Date[] = [];\n let cursor = zonedStartOfDay(visibleRange.start, settings.timeZone);\n while (cursor < visibleRange.end) {\n days.push(cursor);\n cursor = zonedStartOfDay(addDays(toZoned(cursor, settings.timeZone), 1), settings.timeZone);\n }\n const rows: Date[][] = [];\n for (let i = 0; i < days.length; i += 7) rows.push(days.slice(i, i + 7));\n if (effective.weekends) return rows;\n return rows.map((row) =>\n row.filter((day) => !settings.weekendDays.includes(toZoned(day, settings.timeZone).getDay())),\n );\n }, [visibleRange, settings.timeZone, settings.weekendDays, effective.weekends]);\n\n const headerDays = weeks[0] ?? [];\n const title = settings.i18n.functions.formatTitle(\"month\", {\n date: toZoned(anchorDate, settings.timeZone),\n activeRange: instance.api.getActiveRange(),\n visibleRange,\n locale: settings.locale,\n });\n\n const gridTemplateColumns = `${effective.weekNumbers ? \"var(--ec-week-number-w, 2.75rem) \" : \"\"}repeat(${headerDays.length}, minmax(0, 1fr))`;\n const cap = maxEventsPerCell ?? viewConfig.maxEventsPerCell;\n const contained = viewConfig.scrollMode !== \"page\";\n\n // \"auto\" fits as many event rows as the cell height allows and rolls the rest\n // into \"+N more\". Only the contained mode gives a cell a bounded height to\n // measure; page mode grows to fit, so \"auto\" there keeps the fixed fallback.\n const autoFit = cap === \"auto\" && contained;\n // slotProbe resolves the event-row height (--ec-month-bar-h) to px, honoring\n // the current font size and any consumer override; contentProbe is the first\n // cell's flex-1 content area, whose height is the event space per cell.\n const slotProbeRef = useRef<HTMLDivElement | null>(null);\n const contentProbeRef = useRef<HTMLDivElement | null>(null);\n const [autoCap, setAutoCap] = useState<number | null>(null);\n const measureCap = useCallback(() => {\n const content = contentProbeRef.current;\n const slot = slotProbeRef.current;\n if (!content || !slot) return;\n const laneH = slot.getBoundingClientRect().height;\n if (laneH <= 0) return;\n const cs = getComputedStyle(content);\n const inner = content.clientHeight - (parseFloat(cs.paddingTop) || 0);\n const gap = parseFloat(cs.rowGap) || 0;\n // N rows occupy N*laneH - gap (the last row has no trailing gap)\n setAutoCap(Math.max(1, Math.floor((inner + gap) / laneH)));\n }, []);\n useIsoLayoutEffect(() => {\n if (!autoFit) {\n setAutoCap(null);\n return;\n }\n const content = contentProbeRef.current;\n if (!content || typeof ResizeObserver === \"undefined\") return;\n measureCap();\n const observer = new ResizeObserver(measureCap);\n observer.observe(content);\n return () => observer.disconnect();\n // re-observe the first cell after a re-layout (row count or month change)\n }, [autoFit, measureCap, weeks.length, anchorDate]);\n const resolvedCap = cap === \"auto\" ? (autoFit ? (autoCap ?? 3) : 3) : cap;\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-month-view\",\n \"data-view\": \"month\",\n role: \"grid\",\n \"aria-label\": title,\n className: cn(\n \"flex flex-col border-t\",\n contained && \"min-h-0 flex-1 overflow-hidden\",\n viewConfig.classNames?.monthView,\n className,\n ),\n children: (\n <>\n <div\n role=\"row\"\n data-slot=\"event-calendar-month-header\"\n // @container scopes the narrow-label breakpoint to the header row\n className={cn(\"@container grid border-b\", viewConfig.classNames?.monthHeader)}\n style={{ gridTemplateColumns }}\n >\n {effective.weekNumbers && (\n <div\n role=\"columnheader\"\n aria-hidden\n className={cn(\"border-e px-2 py-1.5\", viewConfig.classNames?.weekNumber)}\n />\n )}\n {headerDays.map((day) => (\n <div\n key={day.getTime()}\n role=\"columnheader\"\n className={cn(\n \"truncate px-2 py-1.5 font-medium text-muted-foreground\",\n viewConfig.classNames?.monthDayHeader,\n )}\n >\n {viewConfig.renderDayHeader?.({\n day,\n view: \"month\",\n isToday:\n getDayKey(day, settings.timeZone) === getDayKey(new Date(), settings.timeZone),\n }) ?? (\n <>\n <span className=\"@max-[36rem]:hidden\">\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.monthDayHeader, {\n locale: settings.locale,\n })}\n </span>\n <span className=\"@max-[36rem]:inline hidden\">\n {format(\n toZoned(day, settings.timeZone),\n settings.i18n.formats.monthDayHeaderNarrow,\n { locale: settings.locale },\n )}\n </span>\n </>\n )}\n </div>\n ))}\n </div>\n <div\n data-slot=\"event-calendar-month-body\"\n className={cn(\"grid\", contained && \"min-h-0 flex-1\", viewConfig.classNames?.monthBody)}\n style={{\n gridTemplateRows: contained\n ? `repeat(${weeks.length}, minmax(0, 1fr))`\n : `repeat(${weeks.length}, minmax(var(--ec-month-row-min-h, 8rem), auto))`,\n }}\n >\n {weeks.map((week, rowIndex) => (\n <EventCalendarMonthWeek\n key={rowIndex}\n week={week}\n gridTemplateColumns={gridTemplateColumns}\n showWeekNumber={effective.weekNumbers}\n cap={resolvedCap}\n autoFit={autoFit}\n contentRef={rowIndex === 0 ? contentProbeRef : undefined}\n />\n ))}\n </div>\n {autoFit && (\n <div\n ref={slotProbeRef}\n aria-hidden\n className=\"pointer-events-none invisible absolute h-(--ec-month-bar-h,1.75rem) w-0\"\n />\n )}\n </>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"month\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\n/**\n * One month week row. Multi-day / all-day events render as CONTINUOUS bars in\n * an overlay grid that spans day columns (colStart -> colSpan) and stacks by\n * lane; single-day timed events render inside each cell below the reserved bar\n * lanes. This is what makes a cross-day event read as one whole block instead\n * of a chip repeated per cell.\n */\nfunction EventCalendarMonthWeek({\n week,\n gridTemplateColumns,\n showWeekNumber,\n cap,\n autoFit,\n contentRef,\n}: {\n week: Date[];\n gridTemplateColumns: string;\n showWeekNumber: boolean;\n cap: number;\n autoFit: boolean;\n /** Set on the first week only: forwarded to its first cell's content area so\n * the view can measure the per-cell event height for \"auto\". */\n contentRef?: Ref<HTMLDivElement>;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { bars, rowStart } = useEventCalendarWeek(week[0]);\n const colOffset = showWeekNumber ? 1 : 0;\n const dayMs = 86400000;\n const rowStartMs = zonedStartOfDay(rowStart ?? week[0], settings.timeZone).getTime();\n // Day offsets from the TRUE row start (0-6) for each visible column, so a\n // weekends-hidden month still places bars on the right days.\n const offsets = week.map((d) =>\n Math.round((zonedStartOfDay(d, settings.timeZone).getTime() - rowStartMs) / dayMs),\n );\n /** Clamp a day-offset span onto the visible columns; null = fully hidden. */\n const gridPos = (colStart: number, colSpan: number) => {\n let start = -1;\n let end = -1;\n for (let o = colStart; o < colStart + colSpan; o++) {\n const col = offsets.indexOf(o);\n if (col === -1) continue;\n if (start === -1) start = col;\n end = col;\n }\n return start === -1 ? null : { col: start, span: end - start + 1 };\n };\n // bars fit within the cap; deeper lanes fall into each day's \"+N more\"\n const visibleBars = bars.filter((b) => (b.lane ?? 0) < cap);\n const covers = (b: EventCalendarSegment, dayOffset: number) =>\n (b.colStart ?? 0) <= dayOffset && dayOffset < (b.colStart ?? 0) + (b.colSpan ?? 1);\n // Occurrence keys of the bars hidden in each column (lane >= cap). Threaded to\n // the cell so its \"+N more\" popover can list the hidden bars WITHOUT re-listing\n // the visible ones (day buckets carry no lane, so the week row - which owns bar\n // laning - is the only place that knows which bars are hidden).\n const hiddenBarKeysByCol = week.map(\n (_, col) =>\n new Set(\n bars\n .filter((b) => (b.lane ?? 0) >= cap && covers(b, offsets[col]))\n .map((b) => b.occurrence.key),\n ),\n );\n\n // Live move/resize ghost at the PROPOSED day span. Standardized treatment\n // (EVENT_CALENDAR_GHOST): move = the event carried as a full clone, resize =\n // the same clone with a dashed boundary; invalid adds destructive marking\n // while the engine shows the not-allowed cursor + validation hint.\n const dragGhost = useEventCalendarSelector<\n unknown,\n | (Pick<\n EventCalendarDragState,\n \"kind\" | \"valid\" | \"occurrence\" | \"proposedStart\" | \"proposedEnd\" | \"proposedAllDay\"\n > & {\n colStart: number;\n colSpan: number;\n isStart: boolean;\n isEnd: boolean;\n color?: string;\n })\n | null\n >(\n (state) => {\n const drag = state.drag;\n if (!drag) return null;\n const rowEndMs = rowStartMs + 7 * dayMs;\n const startDayMs = zonedStartOfDay(drag.proposedStart, settings.timeZone).getTime();\n // exclusive end -> the last covered day\n const lastDayMs = zonedStartOfDay(\n new Date(drag.proposedEnd.getTime() - 1),\n settings.timeZone,\n ).getTime();\n if (startDayMs >= rowEndMs || lastDayMs < rowStartMs) return null;\n const startCol = Math.max(0, Math.round((startDayMs - rowStartMs) / dayMs));\n const endCol = Math.min(6, Math.round((lastDayMs - rowStartMs) / dayMs));\n if (endCol < startCol) return null;\n return {\n kind: drag.kind,\n valid: drag.valid,\n occurrence: drag.occurrence,\n proposedStart: drag.proposedStart,\n proposedEnd: drag.proposedEnd,\n proposedAllDay: drag.proposedAllDay,\n colStart: startCol,\n colSpan: endCol - startCol + 1,\n isStart: startDayMs >= rowStartMs,\n isEnd: lastDayMs < rowEndMs,\n color: drag.occurrence.event.color,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.colStart === b.colStart &&\n a.colSpan === b.colSpan &&\n a.valid === b.valid &&\n a.kind === b.kind &&\n a.proposedAllDay === b.proposedAllDay &&\n a.proposedStart.getTime() === b.proposedStart.getTime() &&\n a.proposedEnd.getTime() === b.proposedEnd.getTime()),\n },\n );\n const ghostPos = dragGhost ? gridPos(dragGhost.colStart, dragGhost.colSpan) : null;\n const ghostLane = dragGhost\n ? (bars.find((b) => b.occurrence.key === dragGhost.occurrence.key)?.lane ?? 0)\n : 0;\n // A single-day timed MOVE is indicated INLINE in the target cell (a\n // placeholder at the time-sorted position, rendered by EventCalendarMonthCell)\n // rather than as a bar in this overlay, so only bar drags and every resize\n // render the overlay ghost. Bars = all-day or multi-day (span > 1 day).\n const ghostIsBar =\n !!dragGhost &&\n (dragGhost.kind !== \"move\" ||\n dragGhost.proposedAllDay ||\n dragGhost.proposedEnd.getTime() - dragGhost.proposedStart.getTime() > dayMs);\n\n return (\n <div\n role=\"row\"\n data-slot=\"event-calendar-month-row\"\n className={cn(\n \"relative grid min-h-0 border-b last:border-b-0\",\n viewConfig.classNames?.monthRow,\n )}\n style={{ gridTemplateColumns }}\n >\n {showWeekNumber && (\n <div\n role=\"rowheader\"\n data-slot=\"event-calendar-week-number\"\n className={cn(\n \"border-e px-2 pt-1 text-muted-foreground tabular-nums\",\n viewConfig.classNames?.weekNumber,\n )}\n >\n {settings.i18n.labels.week(\n getWeek(toZoned(week[0], settings.timeZone), {\n // locale supplies firstWeekContainsDate, so a de/ISO calendar\n // numbers the year-boundary weeks its own way instead of falling\n // back to US numbering; weekStartsOn stays explicit so the number\n // keeps matching the rendered grid\n locale: settings.locale,\n weekStartsOn: settings.weekStartsOn,\n }),\n )}\n </div>\n )}\n {week.map((day, col) => (\n <EventCalendarMonthCell\n key={day.getTime()}\n day={day}\n cap={cap}\n // Reserve lane space only for bars that pass through THIS cell, so a\n // short multi-day event does not push down timed events in unrelated\n // cells of the same row. Reserve down to the deepest covering bar\n // lane so timed events always sit below every bar in their own cell.\n reservedLanes={visibleBars.reduce(\n (max, b) => (covers(b, offsets[col]) ? Math.max(max, (b.lane ?? 0) + 1) : max),\n 0,\n )}\n hiddenBarKeys={hiddenBarKeysByCol[col]}\n isLast={col === week.length - 1}\n autoFit={autoFit}\n contentRef={col === 0 ? contentRef : undefined}\n />\n ))}\n {/* Continuous bar overlay: one element per bar, placed by grid-column so\n a cross-day span is a single unbroken block. pointer-events pass\n through the gaps to the cells below. NOT aria-hidden - these are the\n real interactive bars. */}\n {(visibleBars.length > 0 || (dragGhost && ghostPos && ghostIsBar)) && (\n <div\n data-slot=\"event-calendar-month-bar-overlay\"\n className={cn(\n \"pointer-events-none absolute inset-x-0 top-0 z-10 grid pt-1.5\",\n viewConfig.classNames?.monthBarOverlay,\n )}\n style={{\n gridTemplateColumns,\n gridAutoRows: \"var(--ec-month-bar-h, 1.75rem)\",\n }}\n >\n {visibleBars.map((bar) => {\n const pos = gridPos(bar.colStart ?? 0, bar.colSpan ?? 1);\n if (!pos) return null;\n return (\n <div\n key={bar.occurrence.key}\n className={cn(\"pointer-events-auto min-w-0 px-1\", viewConfig.classNames?.monthBar)}\n style={{\n gridColumn: `${colOffset + pos.col + 1} / span ${pos.span}`,\n gridRow: (bar.lane ?? 0) + 1,\n }}\n >\n {/* lane height minus the 2px inter-lane gap */}\n <EventCalendarEvent\n segment={bar}\n className=\"h-[calc(var(--ec-month-bar-h,1.75rem)-0.125rem)]\"\n />\n </div>\n );\n })}\n {dragGhost && ghostPos && ghostIsBar && (\n <div\n aria-hidden\n className={cn(\"min-w-0 px-1\", viewConfig.classNames?.monthBar)}\n style={{\n gridColumn: `${colOffset + ghostPos.col + 1} / span ${ghostPos.span}`,\n gridRow: ghostLane + 1,\n }}\n >\n <div\n data-slot=\"event-calendar-drag-ghost\"\n data-kind={dragGhost.kind}\n data-drop-invalid={!dragGhost.valid || undefined}\n className={cn(\n \"h-[calc(var(--ec-month-bar-h,1.75rem)-0.125rem)]\",\n dragGhost.kind === \"move\"\n ? // faint drop placeholder only: the cursor-attached\n // carry clone owns the visual during moves\n cn(\n EVENT_CALENDAR_GHOST.move,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid,\n )\n : cn(\n EVENT_CALENDAR_GHOST.resize,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize,\n ),\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n \"--ec-event-color\": dragGhost.color ?? \"var(--color-primary)\",\n } as CSSProperties\n }\n >\n {dragGhost.kind !== \"move\" && (\n <EventCalendarEvent\n preview\n segment={{\n occurrence: {\n ...dragGhost.occurrence,\n start: dragGhost.proposedStart,\n end: dragGhost.proposedEnd,\n },\n day: week[ghostPos.col] ?? week[0],\n isStart: dragGhost.isStart,\n isEnd: dragGhost.isEnd,\n continuesBefore: !dragGhost.isStart,\n continuesAfter: !dragGhost.isEnd,\n }}\n className={cn(\n \"inset-ring-0 h-full\",\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent,\n )}\n />\n )}\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nfunction EventCalendarMonthCell({\n day,\n cap,\n reservedLanes,\n hiddenBarKeys,\n isLast,\n autoFit,\n contentRef,\n}: {\n day: Date;\n cap: number;\n reservedLanes: number;\n /** Occurrence keys of the bars hidden in THIS column (lane >= cap), from the\n * week row. Lets the cell list hidden bars in its overflow popover without\n * re-listing the bars already visible in the row overlay. */\n hiddenBarKeys: Set<string>;\n /** Last column in the row - drops the right border so the grid's outer edge\n * is owned by the container, not a doubled cell border. Passed explicitly\n * because the bar overlay renders after the cells, so `:last-child` is\n * unreliable on rows that have bars. */\n isLast: boolean;\n /** When true, the \"+N more\" chip is treated as taking a row so the visible\n * chips + indicator always fit the measured cell height. */\n autoFit: boolean;\n /** Set on the first cell only: measured to derive the \"auto\" cap. */\n contentRef?: Ref<HTMLDivElement>;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const gestures = useEventCalendarGestures();\n const { segments, isToday, isOutside } = useEventCalendarDay(day);\n\n const dayStart = zonedStartOfDay(day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const { effective } = useEventCalendarViewSettings();\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n\n const isDropTarget = useEventCalendarSelector<unknown, \"valid\" | \"invalid\" | null>((state) => {\n const drag = state.drag;\n if (!drag) return null;\n const covered = drag.proposedStart < dayEnd && drag.proposedEnd > dayStart;\n if (!covered) return null;\n return drag.valid ? \"valid\" : \"invalid\";\n });\n // Hide hover affordances mid-gesture: the only intent is the drop target.\n // Gated on the one thing that reads it: a plain global boolean flips for all\n // 42 cells the moment a gesture starts and again when it ends, which is pure\n // waste in the default configuration where no add button renders.\n const isInteracting = useEventCalendarSelector<unknown, boolean>((state) =>\n viewConfig.showDayAddButton ? state.drag !== null || state.slotDraft !== null : false,\n );\n const inDraft = useEventCalendarSelector<unknown, { isStart: boolean; isEnd: boolean } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return null;\n if (draft.start >= dayEnd || draft.end <= dayStart) return null;\n return {\n isStart: draft.start >= dayStart,\n isEnd: draft.end <= dayEnd,\n };\n },\n {\n isEqual: (a, b) =>\n a === b || (a !== null && b !== null && a.isStart === b.isStart && a.isEnd === b.isEnd),\n },\n );\n\n // Month drag-create selects whole DAYS, so the readout is a date range rather\n // than a time range. Held separately from `inDraft` above, which only knows\n // whether this cell is an edge of the selection, not what the selection is.\n const draftRange = useEventCalendarSelector<unknown, { start: Date; end: Date } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return null;\n return { start: draft.start, end: draft.end };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.start.getTime() === b.start.getTime() &&\n a.end.getTime() === b.end.getTime()),\n },\n );\n // A single-day timed MOVE landing on THIS day: expose the proposed\n // minute-of-day (+ color/validity) so the cell can render a drop placeholder\n // at the correct time-sorted position, instead of the overlay marking a bar\n // over the first chip. Skipped for bars (they keep the overlay ghost) and for\n // a no-op move back onto the event's own day (the dimmed source already marks\n // the spot).\n const inlineDrop = useEventCalendarSelector<\n unknown,\n { min: number; valid: boolean; color?: string } | null\n >(\n (state) => {\n const drag = state.drag;\n if (drag?.kind !== \"move\" || drag.proposedAllDay) return null;\n if (drag.proposedEnd.getTime() - drag.proposedStart.getTime() > 86400000) return null;\n const dropDayMs = zonedStartOfDay(drag.proposedStart, settings.timeZone).getTime();\n if (dropDayMs !== dayStart.getTime()) return null;\n if (\n zonedStartOfDay(drag.occurrence.start, settings.timeZone).getTime() === dayStart.getTime()\n )\n return null;\n return {\n min: (drag.proposedStart.getTime() - dropDayMs) / 60000,\n valid: drag.valid,\n color: drag.occurrence.event.color,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null && b !== null && a.min === b.min && a.valid === b.valid && a.color === b.color),\n },\n );\n\n // Bars (allDay/multi-day) are drawn by the week-row overlay; the cell renders\n // only single-day timed events, below the reserved bar lanes.\n const extraHidden = hiddenBarKeys.size;\n const hiddenBarSegs = segments.allDay.filter((s) => hiddenBarKeys.has(s.occurrence.key));\n const m = segments.timed.length;\n const timedSlots = Math.max(0, cap - reservedLanes);\n\n // Static (at-rest) split: what the cell shows with no drag, and - crucially -\n // what the \"+N more\" popover lists. The popover carries ONLY the hidden events\n // (hidden bars + timed past the cap), never the chips already visible in the\n // cell, so it never duplicates them. autoFit gives up one timed row to the\n // \"+N more\" indicator so the visible chips fit the clipped cell height.\n const staticOverflow = extraHidden > 0 || m > timedSlots;\n const staticShown = autoFit && staticOverflow ? Math.max(0, timedSlots - 1) : timedSlots;\n const overflowSegments = [...hiddenBarSegs, ...segments.timed.slice(staticShown)];\n\n // Live split: while a timed chip is dragged onto this day, render the day\n // exactly as it will look AFTER the drop. The dragged chip is a phantom in the\n // time-sorted order and is shown as the placeholder - inline where it lands,\n // or ON the \"+N more\" indicator when it lands in the overflow bucket (so the\n // user sees the drop will push it into \"more\"). The \"+N more\" count always\n // reflects the post-drop hidden total.\n let visibleTimed: EventCalendarSegment[];\n let overflowCount: number;\n let placeholderIndex: number;\n let placeholderAtMore: boolean;\n if (!inlineDrop) {\n visibleTimed = segments.timed.slice(0, staticShown);\n overflowCount = overflowSegments.length;\n placeholderIndex = -1;\n placeholderAtMore = false;\n } else {\n // rank of the dragged chip in the resulting time-sorted list (chips are\n // time-ordered, so this is the count starting at or before its time)\n const insertRank = segments.timed.filter((s) => (s.startMin ?? 0) <= inlineDrop.min).length;\n const dropOverflow = extraHidden > 0 || m + 1 > timedSlots;\n // rows for timed items INCLUDING the phantom, before the \"+N more\" row\n const vis = !dropOverflow ? m + 1 : autoFit ? Math.max(0, timedSlots - 1) : timedSlots;\n placeholderAtMore = insertRank >= vis;\n visibleTimed = placeholderAtMore\n ? segments.timed.slice(0, vis)\n : segments.timed.slice(0, Math.max(0, vis - 1));\n placeholderIndex = placeholderAtMore ? -1 : insertRank;\n overflowCount = extraHidden + (m - visibleTimed.length) + (placeholderAtMore ? 1 : 0);\n }\n\n // No dep array: the replacement for a chip that lost focus to a commit can\n // appear on any re-render of any cell, and a cell with nothing to restore\n // bails after two comparisons.\n const rootRef = useRef<HTMLDivElement | null>(null);\n useIsoLayoutEffect(() => {\n restoreChipFocus(rootRef.current, visibleTimed);\n });\n\n // Faint dashed drop placeholder, tinted to the dragged event's color, echoing\n // the move ghost (EVENT_CALENDAR_GHOST.move); one chip-height tall so chips\n // shift by exactly one row when it is inserted.\n const dropPlaceholder = inlineDrop ? (\n <div\n key=\"ec-drop-placeholder\"\n aria-hidden\n data-slot=\"event-calendar-drop-placeholder\"\n data-drop-invalid={!inlineDrop.valid || undefined}\n className={cn(\n \"shrink-0 rounded-sm border border-dashed\",\n inlineDrop.valid\n ? \"border-(--ec-event-color)/50 bg-(--ec-event-color)/8\"\n : \"border-destructive/70 bg-destructive/10\",\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n \"--ec-event-color\": inlineDrop.color ?? \"var(--color-primary)\",\n height: \"calc(var(--ec-month-bar-h, 1.75rem) - 0.125rem)\",\n } as CSSProperties\n }\n />\n ) : null;\n\n const defaultContent = (\n <>\n <div\n ref={contentRef}\n className={cn(\n // gap-0.5 pairs with the 0.125rem subtraction in the lane spacer\n // below; changing the gap requires renderMonthCell\n // px-1 matches the all-day bar wrapper inset so single-day chips and\n // multi-day bars line up on the same left/right edge in a cell\n \"flex min-h-0 flex-1 flex-col gap-0.5 overflow-hidden px-1 pt-1.5\",\n viewConfig.classNames?.monthCellContent,\n )}\n >\n {reservedLanes > 0 && (\n <div\n aria-hidden\n className=\"shrink-0\"\n style={{\n // lane height already carries the 2px inter-lane gap; subtract\n // it so spacer + the column's own gap-0.5 = the SAME 2px rhythm\n // between the last bar and the first timed chip\n height: `calc(${reservedLanes} * var(--ec-month-bar-h, 1.75rem) - 0.125rem)`,\n }}\n />\n )}\n {visibleTimed.flatMap((segment, i) => {\n const chip = (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n // Remember the chip holding focus so a commit that re-keys it can\n // hand focus back to the remounted one (see restoreChipFocus)\n onFocus={(e) => {\n focusedChip = {\n node: e.currentTarget,\n eventId: segment.occurrence.eventId,\n recurrenceIndex: segment.occurrence.recurrenceIndex,\n };\n }}\n // A chip still in the tree lost focus on its own, so there is\n // nothing to restore; only a blur from the remount is kept.\n onBlur={(e) => {\n if (e.currentTarget.isConnected) focusedChip = null;\n }}\n // Hold a fixed height like the all-day lane above; without this\n // the chip flex-shrinks to whatever room the cell has left, so\n // cells with a reserved bar lane or a second chip render shorter\n // chips.\n className=\"shrink-0\"\n />\n );\n return i === placeholderIndex ? [dropPlaceholder, chip] : [chip];\n })}\n {placeholderIndex >= 0 && placeholderIndex >= visibleTimed.length && dropPlaceholder}\n {overflowCount > 0 && (\n <EventCalendarMoreIndicator\n day={day}\n count={overflowCount}\n segments={overflowSegments}\n dropInto={\n placeholderAtMore && inlineDrop\n ? { color: inlineDrop.color, valid: inlineDrop.valid }\n : undefined\n }\n />\n )}\n </div>\n {/* Day number + add affordance, bottom-right (Notion-style) */}\n <div\n className={cn(\n \"flex items-center justify-end gap-1 px-2 pb-1.5\",\n viewConfig.classNames?.monthCellFooter,\n )}\n >\n {viewConfig.showDayAddButton && !isInteracting && (\n <button\n type=\"button\"\n data-slot=\"event-calendar-day-add\"\n aria-label={settings.i18n.labels.addEvent}\n // a different icon/markup is a renderMonthCell job\n className={cn(\n \"flex size-5 cursor-pointer items-center justify-center rounded-sm bg-primary text-primary-foreground opacity-0 transition-opacity focus-visible:opacity-100 group-hover/ec-cell:opacity-100\",\n viewConfig.classNames?.dayAddButton,\n )}\n onClick={(e) => {\n e.stopPropagation();\n settings.onSlotClick?.({ date: day, allDay: true, view: \"month\" }, e);\n }}\n >\n <PlusIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n )}\n <span\n data-slot=\"event-calendar-month-day-number\"\n className={cn(\n \"flex size-5 items-center justify-center rounded-full\",\n isOutside && \"text-muted-foreground\",\n // the filled circle already marks today; keep the number the same\n // weight/size as the other days so it does not read as larger\n // Same font-size as every other day; a lighter weight cancels the\n // way white digits on the filled circle read bolder/larger than the\n // dark-on-light numbers around them.\n isToday && \"bg-primary font-light text-primary-foreground\",\n viewConfig.classNames?.monthDayNumber,\n )}\n >\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.monthCellDay, {\n locale: settings.locale,\n })}\n </span>\n </div>\n </>\n );\n\n const content =\n viewConfig.renderMonthCell?.({\n day,\n segments,\n isToday,\n isOutside,\n overflowCount,\n defaultContent,\n }) ?? defaultContent;\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n ref={rootRef}\n role=\"gridcell\"\n data-slot=\"event-calendar-month-cell\"\n data-today={isToday || undefined}\n data-outside={isOutside || undefined}\n data-weekend={\n settings.weekendDays.includes(toZoned(day, settings.timeZone).getDay()) || undefined\n }\n data-ec-day={dayStart.getTime()}\n data-drop-target={isDropTarget ?? undefined}\n data-off={isOff || undefined}\n data-draft={inDraft ? \"\" : undefined}\n aria-label={format(\n toZoned(day, settings.timeZone),\n settings.i18n.formats.monthCellAriaLabel,\n { locale: settings.locale },\n )}\n className={cn(\n \"group/ec-cell relative flex min-h-0 min-w-0 flex-col overflow-hidden\",\n !isLast && \"border-e\",\n isOutside && !settings.showOutsideDays && \"invisible\",\n isOff && offClassName,\n isToday &&\n cn(\"relative border-b-2 border-b-primary/40 bg-primary/3\", viewConfig.todayClassName),\n viewConfig.dayClassName?.(day),\n // No drop-target bg fill on move/resize - the dragged bar + not-allowed\n // cursor carry the feedback; a cell-wide color wash is too distracting.\n // data-drop-target stays as an opt-in styling hook.\n inDraft && EVENT_CALENDAR_SLOT_DRAFT.surface,\n viewConfig.classNames?.monthCell,\n )}\n onPointerDown={(e) => {\n const target = e.target as HTMLElement;\n if (target.closest(\"[data-slot=event-calendar-event]\")) return;\n if (target.closest(\"[data-slot=event-calendar-more]\")) return;\n gestures.beginCreate(e, day, true);\n }}\n onClick={(e) => {\n if (wasRecentDrag() || wasRecentChipPress()) return;\n settings.onSlotClick?.({ date: day, allDay: true, view: \"month\" }, e);\n }}\n >\n {inDraft && (\n <span\n aria-hidden\n data-slot=\"event-calendar-slot-draft\"\n className={cn(\n \"pointer-events-none absolute inset-0 z-10\",\n EVENT_CALENDAR_SLOT_DRAFT.segment,\n inDraft.isStart && EVENT_CALENDAR_SLOT_DRAFT.segmentStart,\n inDraft.isEnd && EVENT_CALENDAR_SLOT_DRAFT.segmentEnd,\n viewConfig.classNames?.slotDraft,\n )}\n >\n {/* Date-range readout, the month-view counterpart of the time-grid\n one. Rendered only on the FIRST cell of the selection, otherwise\n a three-day drag would repeat the same label three times. Pinned\n to the bottom because the day number owns the top of the cell,\n and given its own surface so it stays legible over event chips. */}\n {inDraft.isStart && draftRange && (\n <span className={cn(\"absolute inset-x-1 bottom-1\", EVENT_CALENDAR_SLOT_DRAFT.label)}>\n {settings.i18n.functions.formatDayRange(\n {\n start: toZoned(draftRange.start, settings.timeZone),\n end: toZoned(draftRange.end, settings.timeZone),\n },\n { locale: settings.locale },\n )}\n </span>\n )}\n </span>\n )}\n {content}\n </div>\n );\n}\n\ninterface EventCalendarMoreIndicatorProps {\n day: Date;\n count: number;\n /** The OVERFLOW (hidden) segments for this day - bars first, then timed. The\n * popover lists only these, never the chips already visible in the cell. */\n segments: EventCalendarSegment[];\n /** Set while a timed chip is dragged and will land in THIS overflow bucket:\n * the indicator itself becomes the drop placeholder (dashed, event-tinted) so\n * it reads as \"the chip joins the +N more list\". */\n dropInto?: { color?: string; valid: boolean };\n}\n\n/**\n * \"+N more\" trigger opening a popover with the day's full event list.\n * onMoreClick returning false suppresses the built-in popover.\n */\nfunction EventCalendarMoreIndicator({\n day,\n count,\n segments,\n dropInto,\n}: EventCalendarMoreIndicatorProps) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const [open, setOpen] = useState(false);\n const headerId = useId();\n\n // Grabbing a chip from this list starts a drag; close the popover so it does\n // not sit over the drop target while the event is carried to another day.\n const isDragging = useEventCalendarSelector<unknown, boolean>((state) => state.drag !== null);\n useEffect(() => {\n if (isDragging) setOpen(false);\n }, [isDragging]);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n data-slot=\"event-calendar-more\"\n data-drop-into={dropInto ? \"\" : undefined}\n data-drop-invalid={dropInto && !dropInto.valid ? \"\" : undefined}\n className={cn(\n \"cursor-pointer truncate rounded-sm px-1.5 text-start text-muted-foreground hover:text-foreground\",\n // While a dragged chip will land in this overflow bucket, the \"+N more\"\n // link itself becomes the drop placeholder: dashed, event-tinted, one\n // chip tall, so the drop target is unmistakable.\n dropInto &&\n cn(\n \"flex shrink-0 items-center border border-dashed\",\n dropInto.valid\n ? \"border-(--ec-event-color)/50 bg-(--ec-event-color)/8 text-foreground\"\n : \"border-destructive/70 bg-destructive/10 text-destructive\",\n ),\n viewConfig.classNames?.moreIndicator,\n )}\n style={\n dropInto\n ? ({\n \"--ec-event-color\": dropInto.color ?? \"var(--color-primary)\",\n height: \"calc(var(--ec-month-bar-h, 1.75rem) - 0.125rem)\",\n } as CSSProperties)\n : undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n const verdict = settings.onMoreClick?.(\n day,\n segments.map((segment) => segment.occurrence),\n e,\n );\n if (verdict === false) {\n e.preventDefault();\n setOpen(false);\n }\n }}\n >\n {viewConfig.renderMoreIndicator?.({ day, count, segments }) ??\n settings.i18n.labels.more(count)}\n </PopoverTrigger>\n <PopoverContent\n data-slot=\"event-calendar-more-popover\"\n align={viewConfig.morePopoverAlign}\n // The popover is a dialog, so it needs a name. The built-in body already\n // renders the day header this list belongs to, so point at that; a\n // consumer body has no header to point at and gets the same formatted\n // day as a label instead.\n aria-labelledby={viewConfig.renderMoreContent ? undefined : headerId}\n aria-label={\n viewConfig.renderMoreContent\n ? format(toZoned(day, settings.timeZone), settings.i18n.formats.moreDayHeader, {\n locale: settings.locale,\n })\n : undefined\n }\n // PopoverContent is unlayered (flex-col gap-4 p-4); override with !.\n // text-xs re-establishes the calendar's base type here because this\n // content is portaled out of the root subtree and cannot inherit it.\n className={cn(\"w-64 gap-1! p-2! text-xs\", viewConfig.classNames?.morePopover)}\n onClick={(e: React.MouseEvent) => e.stopPropagation()}\n >\n {viewConfig.renderMoreContent ? (\n viewConfig.renderMoreContent({\n day,\n segments,\n close: () => setOpen(false),\n })\n ) : (\n <EventCalendarMoreDefaultContent day={day} segments={segments} headerId={headerId} />\n )}\n </PopoverContent>\n </Popover>\n );\n}\n\n/** Built-in \"+N more\" popover body: day header + the day's chips. */\nfunction EventCalendarMoreDefaultContent({\n day,\n segments,\n headerId,\n}: {\n day: Date;\n segments: EventCalendarSegment[];\n /** Names the popover dialog: the header IS the list's accessible name. */\n headerId?: string;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n return (\n <>\n <div\n id={headerId}\n className={cn(\n \"px-1 py-1 font-medium text-muted-foreground text-xs\",\n viewConfig.classNames?.morePopoverHeader,\n )}\n >\n {format(toZoned(day, settings.timeZone), settings.i18n.formats.moreDayHeader, {\n locale: settings.locale,\n })}\n </div>\n {/* The scroll region breaks out of the popover's right padding (-me-2)\n so the scrollbar sits flush in the gutter; the list then pads itself\n back (ps-1 aligns with the header, pe-4 clears the ~10px bar with a\n gap) and adds py-1 so the first/last focus ring is not clipped by\n the overflow. Layout is identical with or without a scrollbar. */}\n {viewConfig.scrollbars === \"native\" ? (\n <div\n data-ec-native-scroll=\"\"\n className=\"-me-2 max-h-(--ec-more-max-height,16rem) min-h-0 overflow-y-auto\"\n >\n <div className=\"flex flex-col gap-1 py-1 ps-1 pe-4\">\n {segments.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n className=\"py-0.5\"\n />\n ))}\n </div>\n </div>\n ) : (\n <ScrollArea className=\"-me-2 min-h-0 **:data-[slot=scroll-area-viewport]:max-h-(--ec-more-max-height,16rem)\">\n <div className=\"flex flex-col gap-1 py-1 ps-1 pe-4\">\n {segments.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n className=\"py-0.5\"\n />\n ))}\n </div>\n </ScrollArea>\n )}\n </>\n );\n}\n\nexport type { EventCalendarMonthViewProps, EventCalendarMoreIndicatorProps };\nexport { EventCalendarMonthView, EventCalendarMoreIndicator };\n"],"mappings":";;;;;;;;;;;;;;;AAqDA,MAAM,qBAAqB,OAAO,WAAW,cAAc,kBAAkB;AAQ7E,IAAI,cAIO;;AAGX,SAAS,iBAAiB,MAA0B,UAAkC;CACpF,MAAM,UAAU;CAGhB,IAAI,CAAC,QAAQ,CAAC,WAAW,QAAQ,KAAK,aAAa;CACnD,MAAM,SAAS,SAAS;CACxB,IAAI,UAAU,WAAW,SAAS,MAAM;CACxC,MAAM,QAAQ,SAAS,WACpB,YACC,QAAQ,WAAW,YAAY,QAAQ,WACvC,QAAQ,WAAW,oBAAoB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B;GAAW,CAAA;EAExE,CAAA,CACT;;AAEb;;AAGA,SAAS,gCAAgC,EACvC,KACA,UACA,YAMC;CACD,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,OAAD;EACE,IAAI;EACJ,WAAW,GACT,uDACA,WAAW,YAAY,iBACzB;EAEC,UAAA,OAAO,QAAQ,KAAK,SAAS,QAAQ,GAAG,SAAS,KAAK,QAAQ,eAAe,EAC5E,QAAQ,SAAS,OACnB,CAAC;CACE,CAAA,GAMJ,WAAW,eAAe,WACzB,oBAAC,OAAD;EACE,yBAAsB;EACtB,WAAU;EAEV,UAAA,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,SAAS,KAAK,YACb,oBAAC,oBAAD;IAEW;IACT,WAAU;GACX,GAHM,QAAQ,WAAW,GAGzB,CACF;EACE,CAAA;CACF,CAAA,IAEL,oBAAC,YAAD;EAAY,WAAU;EACpB,UAAA,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,SAAS,KAAK,YACb,oBAAC,oBAAD;IAEW;IACT,WAAU;GACX,GAHM,QAAQ,WAAW,GAGzB,CACF;EACE,CAAA;CACK,CAAA,CAEd,EAAA,CAAA;AAEN"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { Button } from "../../ui/button.js";
|
|
3
3
|
import { Calendar } from "../../ui/calendar.js";
|
|
4
4
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from "../../ui/dropdown-menu.js";
|
|
5
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../ui/tooltip.js";
|
|
6
5
|
import { Popover, PopoverContent, PopoverTrigger } from "../../ui/popover.js";
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../ui/tooltip.js";
|
|
7
7
|
import { toZoned } from "./event-calendar-lib.js";
|
|
8
8
|
import { useEventCalendarNavigation, useEventCalendarSettings, useEventCalendarView, useEventCalendarViewConfig } from "./event-calendar.js";
|
|
9
9
|
import { useState } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-calendar-resource-view.d.ts","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-resource-view.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"event-calendar-resource-view.d.ts","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-resource-view.tsx"],"mappings":";;UA2CU,uCAAuC,UAAU;EACzD;EACA;EACA;;EAEA;;;iBAIO,4BACP,WACA,QACA,cACA,YACA,YACA,UAAU,iBACP,SACF,iDAA8B,IAAA"}
|
|
@@ -3,7 +3,7 @@ import { ScrollArea } from "../../ui/scroll-area.js";
|
|
|
3
3
|
import { flattenResources, getDayKey, getDayTotalMinutes, packTimedSegments, resolveOffDay, snapMinutes, toZoned, zonedStartOfDay } from "./event-calendar-lib.js";
|
|
4
4
|
import { EventCalendarViewContext, useEventCalendar, useEventCalendarDay, useEventCalendarSelector, useEventCalendarSettings, useEventCalendarViewConfig, useEventCalendarViewSettings } from "./event-calendar.js";
|
|
5
5
|
import { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from "./event-calendar-dnd.js";
|
|
6
|
-
import { EVENT_CALENDAR_GHOST, EventCalendarEvent } from "./event-calendar-event.js";
|
|
6
|
+
import { EVENT_CALENDAR_GHOST, EVENT_CALENDAR_SLOT_DRAFT, EventCalendarEvent } from "./event-calendar-event.js";
|
|
7
7
|
import { EventCalendarNowIndicator, EventCalendarTimeGutter, minuteBlockStyle } from "./event-calendar-time-grid.js";
|
|
8
8
|
import { useEffect, useMemo, useRef } from "react";
|
|
9
9
|
import { cn } from "@kumix/utils";
|
|
@@ -188,7 +188,7 @@ function EventCalendarResourceAllDayCell({ resource, day }) {
|
|
|
188
188
|
"data-ec-day": dayStart.getTime(),
|
|
189
189
|
"data-drop-target": isDropTarget ?? void 0,
|
|
190
190
|
"data-off": isOff || void 0,
|
|
191
|
-
className: cn("relative flex min-h-[calc(var(--ec-month-bar-h,1.625rem)+0.625rem)] min-w-0 flex-col gap-0.5 border-e px-1 py-1.5 last:border-e-0", isOff && offClassName, viewConfig.dayClassName?.(day), inDraft && cn(
|
|
191
|
+
className: cn("relative flex min-h-[calc(var(--ec-month-bar-h,1.625rem)+0.625rem)] min-w-0 flex-col gap-0.5 border-e px-1 py-1.5 last:border-e-0", isOff && offClassName, viewConfig.dayClassName?.(day), inDraft && cn(EVENT_CALENDAR_SLOT_DRAFT.surface, EVENT_CALENDAR_SLOT_DRAFT.segment, EVENT_CALENDAR_SLOT_DRAFT.segmentStart, EVENT_CALENDAR_SLOT_DRAFT.segmentEnd, viewConfig.classNames?.slotDraft), viewConfig.classNames?.allDayCell),
|
|
192
192
|
onPointerDown: (e) => {
|
|
193
193
|
if (e.target === e.currentTarget) gestures.beginCreate(e, day, true);
|
|
194
194
|
},
|
|
@@ -257,6 +257,14 @@ function EventCalendarResourceColumn({ resource, day, startHour, endHour, interv
|
|
|
257
257
|
proposedEnd: drag.proposedEnd
|
|
258
258
|
};
|
|
259
259
|
}, { isEqual: (a, b) => a === b || a !== null && b !== null && a.window[0] === b.window[0] && a.window[1] === b.window[1] && a.valid === b.valid && a.proposedStart.getTime() === b.proposedStart.getTime() && a.proposedEnd.getTime() === b.proposedEnd.getTime() });
|
|
260
|
+
const draftRange = useEventCalendarSelector((state) => {
|
|
261
|
+
const draft = state.slotDraft;
|
|
262
|
+
if (!draft || draft.allDay || draft.resourceId !== resource.id) return null;
|
|
263
|
+
return {
|
|
264
|
+
start: draft.start,
|
|
265
|
+
end: draft.end
|
|
266
|
+
};
|
|
267
|
+
}, { isEqual: (a, b) => a === b || a !== null && b !== null && a.start.getTime() === b.start.getTime() && a.end.getTime() === b.end.getTime() });
|
|
260
268
|
const draftWindow = useEventCalendarSelector((state) => {
|
|
261
269
|
const draft = state.slotDraft;
|
|
262
270
|
if (!draft || draft.allDay || draft.resourceId !== resource.id) return null;
|
|
@@ -352,8 +360,12 @@ function EventCalendarResourceColumn({ resource, day, startHour, endHour, interv
|
|
|
352
360
|
}),
|
|
353
361
|
draftWindow && /* @__PURE__ */ jsx("div", {
|
|
354
362
|
"data-slot": "event-calendar-slot-draft",
|
|
355
|
-
className: cn("pointer-events-none absolute inset-x-0.5 z-40
|
|
356
|
-
style: minuteBlockStyle(draftWindow[0], draftWindow[1], boundsStartMin)
|
|
363
|
+
className: cn(EVENT_CALENDAR_SLOT_DRAFT.box, "pointer-events-none absolute inset-x-0.5 z-40 overflow-hidden", viewConfig.classNames?.slotDraft),
|
|
364
|
+
style: minuteBlockStyle(draftWindow[0], draftWindow[1], boundsStartMin),
|
|
365
|
+
children: draftRange && /* @__PURE__ */ jsx("span", {
|
|
366
|
+
className: cn("block", EVENT_CALENDAR_SLOT_DRAFT.label),
|
|
367
|
+
children: settings.i18n.functions.formatEventTime(toZoned(draftRange.start, settings.timeZone), toZoned(draftRange.end, settings.timeZone), false, { locale: settings.locale })
|
|
368
|
+
})
|
|
357
369
|
})
|
|
358
370
|
]
|
|
359
371
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-calendar-resource-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-resource-view.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, useEffect, useMemo, useRef } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, addMinutes } from \"date-fns\";\n\nimport { cn } from \"@kumix/utils\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarDay,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n useEventCalendarViewSettings,\n} from \"./event-calendar\";\nimport { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from \"./event-calendar-dnd\";\nimport { EVENT_CALENDAR_GHOST, EventCalendarEvent } from \"./event-calendar-event\";\nimport {\n flattenResources,\n getDayKey,\n getDayTotalMinutes,\n packTimedSegments,\n resolveOffDay,\n snapMinutes,\n toZoned,\n zonedStartOfDay,\n} from \"./event-calendar-lib\";\nimport {\n EventCalendarNowIndicator,\n EventCalendarTimeGutter,\n minuteBlockStyle,\n} from \"./event-calendar-time-grid\";\nimport type { EventCalendarResource, EventCalendarSegment } from \"./event-calendar-types\";\n\nconst EMPTY_ALL_DAY_SEGMENTS: EventCalendarSegment[] = [];\n\ninterface EventCalendarResourceViewProps extends useRender.ComponentProps<\"div\"> {\n dayStartHour?: number;\n dayEndHour?: number;\n showAllDay?: boolean;\n /** Gutter/gridline interval in minutes; defaults to the interval view config. */\n interval?: number;\n}\n\n/** Leaf resources become booking columns for the anchor day. */\nfunction EventCalendarResourceView({\n className,\n render,\n dayStartHour,\n dayEndHour,\n showAllDay = true,\n interval: intervalProp,\n ...props\n}: EventCalendarResourceViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const anchorDate = useEventCalendarSelector((state) => state.date, {\n isEqual: (a, b) => a.getTime() === b.getTime(),\n });\n\n const startHour = dayStartHour ?? settings.dayStartHour;\n const endHour = dayEndHour ?? settings.dayEndHour;\n const interval = Math.min(Math.max(intervalProp ?? viewConfig.interval, 5), 240);\n const contained = viewConfig.scrollMode !== \"page\";\n const day = zonedStartOfDay(anchorDate, settings.timeZone);\n\n const resources = useMemo(\n () =>\n flattenResources(settings.resources)\n .filter(({ resource }) => !resource.children?.length)\n .map(({ resource }) => resource),\n [settings.resources],\n );\n\n // Initial scroll + api.scrollToTime (same contract as the time grid)\n const scrollRef = useRef<HTMLDivElement | null>(null);\n useEffect(() => {\n if (!contained) return;\n const el = scrollRef.current;\n if (!el) return;\n const viewport = el.querySelector<HTMLElement>(\"[data-slot=scroll-area-viewport]\");\n const slotRow = el.querySelector<HTMLElement>(\"[data-slot=event-calendar-time-gutter] > div\");\n const slotPx = slotRow?.getBoundingClientRect().height || 64;\n const pxPerMinute = slotPx / interval;\n const scrollTo = (minutes: number) => {\n // keep the hour label above the target line visible (it hangs -top-2)\n viewport?.scrollTo({\n top: Math.max(0, (minutes - startHour * 60) * pxPerMinute - 12),\n });\n };\n scrollTo(viewConfig.scrollToHour * 60);\n instance.internals.registerScrollHandler((time) => {\n const minutes =\n typeof time === \"number\"\n ? time\n : toZoned(time, settings.timeZone).getHours() * 60 +\n toZoned(time, settings.timeZone).getMinutes();\n scrollTo(minutes);\n });\n // Classic (width-consuming) scrollbars squeeze the scrolling track while\n // the header/all-day rows outside keep full width, drifting the column\n // borders. Mirror the measured gutter onto those rows via a CSS var -\n // 0px for overlay scrollbars and the custom ScrollArea, so both modes\n // lay out identically.\n const root = el.closest<HTMLElement>(\n \"[data-slot=event-calendar-time-grid], [data-slot=event-calendar-resource-view]\",\n );\n const syncScrollbarGutter = () => {\n root?.style.setProperty(\n \"--ec-scrollbar-w\",\n `${viewport ? viewport.offsetWidth - viewport.clientWidth : 0}px`,\n );\n };\n syncScrollbarGutter();\n const gutterObserver = viewport ? new ResizeObserver(syncScrollbarGutter) : null;\n if (viewport) gutterObserver?.observe(viewport);\n return () => {\n instance.internals.registerScrollHandler(null);\n gutterObserver?.disconnect();\n };\n }, [contained, instance, settings.timeZone, startHour, interval, viewConfig.scrollToHour]);\n\n const slots = useMemo(() => {\n const result: number[] = [];\n for (let m = startHour * 60; m < endHour * 60; m += interval) {\n result.push(m);\n }\n return result;\n }, [startHour, endHour, interval]);\n\n // All-day segments for renderAllDaySection - the same index bucket the\n // cells read; inert (stable empty array, so the subscription never\n // re-renders) while the override is unset.\n const allDaySegments = useEventCalendarSelector<unknown, EventCalendarSegment[]>(\n () =>\n viewConfig.renderAllDaySection\n ? (instance.internals.getIndex().byDay.get(getDayKey(day, settings.timeZone))?.allDay ??\n EMPTY_ALL_DAY_SEGMENTS)\n : EMPTY_ALL_DAY_SEGMENTS,\n {\n isEqual: (a, b) =>\n a === b || (a.length === b.length && a.every((segment, i) => segment === b[i])),\n },\n );\n\n const gridTemplateColumns = `repeat(${resources.length || 1}, minmax(var(--ec-resource-col-min,8rem), 1fr))`;\n\n const track = (\n <div className=\"relative flex\">\n {/* shared gutter component, so renderTimeGutterSlot and\n classNames.timeGutter customizations apply here too */}\n <EventCalendarTimeGutter\n days={[day]}\n slots={slots}\n startHour={startHour}\n interval={interval}\n />\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <EventCalendarResourceColumn\n key={resource.id}\n resource={resource}\n day={day}\n startHour={startHour}\n endHour={endHour}\n interval={interval}\n />\n ))}\n </div>\n {effective.nowIndicator && (\n <EventCalendarNowIndicator days={[day]} startHour={startHour} endHour={endHour} />\n )}\n </div>\n );\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-resource-view\",\n \"data-view\": \"resource\",\n className: cn(\n \"flex flex-col border-t\",\n contained && \"min-h-0 flex-1 overflow-hidden\",\n viewConfig.classNames?.timeGrid,\n className,\n ),\n style: { \"--ec-hour-height\": \"4rem\" } as CSSProperties,\n children: (\n <>\n {/* Resource header row */}\n <div\n className={cn(\n \"flex border-b pe-(--ec-scrollbar-w,0px)\",\n !contained && \"sticky top-(--ec-sticky-offset,0px) z-20 bg-background\",\n viewConfig.classNames?.timeGridHeader,\n )}\n >\n <div className=\"w-(--ec-gutter-width,4.5rem) shrink-0 border-e\" />\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <div\n key={resource.id}\n data-slot=\"event-calendar-resource-header\"\n className={cn(\n \"min-w-0 truncate border-e px-2 py-1.5 text-center font-medium last:border-e-0\",\n viewConfig.classNames?.resourceHeader,\n )}\n >\n {viewConfig.renderResourceHeader?.({ resource }) ?? resource.title}\n </div>\n ))}\n </div>\n </div>\n {/* All-day row per resource */}\n {showAllDay && (\n <div\n data-slot=\"event-calendar-all-day-section\"\n className={cn(\n \"flex border-b pe-(--ec-scrollbar-w,0px)\",\n viewConfig.classNames?.allDaySection,\n )}\n >\n {viewConfig.renderAllDaySection?.({\n days: [day],\n segments: allDaySegments,\n }) ?? (\n <>\n <div\n className={cn(\n // pt-1.5 matches the all-day cell's top inset; the inner box is\n // one bar-row tall and centers the label so it sits on the SAME\n // baseline as the first all-day chip and stays top-aligned when\n // the chips wrap onto more lanes (mirrors the time-grid label)\n \"w-(--ec-gutter-width,4.5rem) shrink-0 border-e ps-2 pe-2.5 pt-1.5 text-muted-foreground\",\n viewConfig.classNames?.allDayLabel,\n )}\n >\n <span className=\"flex h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)] items-center justify-end\">\n {settings.i18n.labels.allDay}\n </span>\n </div>\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <EventCalendarResourceAllDayCell\n key={resource.id}\n resource={resource}\n day={day}\n />\n ))}\n </div>\n </>\n )}\n </div>\n )}\n {contained ? (\n <div ref={scrollRef} className=\"min-h-0 flex-1\">\n {viewConfig.scrollbars === \"native\" ? (\n <div\n data-slot=\"scroll-area-viewport\"\n data-ec-native-scroll=\"\"\n className=\"h-full overflow-y-auto\"\n >\n {track}\n </div>\n ) : (\n <ScrollArea className=\"h-full\">{track}</ScrollArea>\n )}\n </div>\n ) : (\n track\n )}\n </>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"resource\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\nfunction EventCalendarResourceAllDayCell({\n resource,\n day,\n}: {\n resource: EventCalendarResource;\n day: Date;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const gestures = useEventCalendarGestures();\n const { segments } = useEventCalendarDay(day);\n const mine = segments.allDay.filter(\n (segment) => segment.occurrence.event.resourceId === resource.id,\n );\n const dayStart = zonedStartOfDay(day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n const isDropTarget = useEventCalendarSelector<unknown, \"valid\" | \"invalid\" | null>((state) => {\n const drag = state.drag;\n if (!drag?.proposedDayGranular) return null;\n const covered = drag.proposedStart < dayEnd && drag.proposedEnd > dayStart;\n if (!covered) return null;\n return drag.valid ? \"valid\" : \"invalid\";\n });\n // Slot-draft highlight, mirroring the time-grid all-day cell. The dnd\n // layer's all-day create branch does not plumb resourceId into the draft,\n // so every resource cell covering the day highlights together.\n const inDraft = useEventCalendarSelector<unknown, boolean>((state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return false;\n return draft.start < dayEnd && draft.end > dayStart;\n });\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n data-slot=\"event-calendar-all-day-cell\"\n // data-ec-day makes this a DnD day target: without it collectSurface()\n // finds no cells and dragging an all-day chip silently converts it to\n // a timed event via the column branch\n data-ec-day={dayStart.getTime()}\n data-drop-target={isDropTarget ?? undefined}\n data-off={isOff || undefined}\n className={cn(\n // reserve one bar row so the all-day row keeps the same height with or\n // without events, matching the time-grid all-day row (which reserves\n // the same via its bars-grid minHeight)\n \"relative flex min-h-[calc(var(--ec-month-bar-h,1.625rem)+0.625rem)] min-w-0 flex-col gap-0.5 border-e px-1 py-1.5 last:border-e-0\",\n isOff && offClassName,\n viewConfig.dayClassName?.(day),\n inDraft && cn(\"bg-primary/10\", viewConfig.classNames?.slotDraft),\n viewConfig.classNames?.allDayCell,\n )}\n onPointerDown={(e) => {\n if (e.target === e.currentTarget) gestures.beginCreate(e, day, true);\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget && !wasRecentDrag() && !wasRecentChipPress()) {\n settings.onSlotClick?.(\n {\n date: dayStart,\n allDay: true,\n view: \"resource\",\n resourceId: resource.id,\n },\n e,\n );\n }\n }}\n >\n {mine.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n // one bar-row tall, matching the time-grid all-day bars so the row\n // height stays identical across views (and equals the reserved min)\n className=\"h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)]\"\n />\n ))}\n {isDropTarget && (\n <span\n aria-hidden\n data-slot=\"event-calendar-drop-indicator\"\n data-drop-target={isDropTarget}\n className={cn(\n \"pointer-events-none absolute inset-0.5 z-10 rounded-sm border border-dashed\",\n isDropTarget === \"valid\" ? \"border-primary/50\" : \"border-destructive/60\",\n viewConfig.classNames?.dropIndicator,\n )}\n />\n )}\n </div>\n );\n}\n\nfunction EventCalendarResourceColumn({\n resource,\n day,\n startHour,\n endHour,\n interval,\n}: {\n resource: EventCalendarResource;\n day: Date;\n startHour: number;\n endHour: number;\n interval: number;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const gestures = useEventCalendarGestures();\n const { segments, isToday } = useEventCalendarDay(day);\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n\n const timeZone = settings.timeZone;\n const dayStart = zonedStartOfDay(day, timeZone);\n const totalMinutes = getDayTotalMinutes(day, timeZone);\n const boundsStartMin = startHour * 60;\n const boundsEndMin = Math.min(endHour * 60, totalMinutes);\n const boundsMinutes = Math.max(60, boundsEndMin - boundsStartMin);\n\n // Filter this resource's timed segments and repack per column.\n // Clones keep the shared index cache untouched. Segments the day bounds clip\n // away are dropped here too, otherwise they hold a column nobody can see and\n // leave a phantom empty half beside the first in-bounds chip.\n const packed = useMemo(() => {\n const mine = segments.timed\n .filter((segment) => {\n if (segment.occurrence.event.resourceId !== resource.id) return false;\n const startMin = Math.max(segment.startMin ?? 0, boundsStartMin);\n const endMin = Math.min(segment.endMin ?? startMin, boundsEndMin);\n return endMin > boundsStartMin && startMin < boundsEndMin;\n })\n .map((segment) => ({ ...segment }) as EventCalendarSegment);\n packTimedSegments(mine);\n return mine;\n }, [segments.timed, resource.id, boundsStartMin, boundsEndMin]);\n\n const dragGhost = useEventCalendarSelector<\n unknown,\n {\n window: [number, number];\n valid: boolean;\n kind: string;\n color?: string;\n title: string;\n occurrence: EventCalendarSegment[\"occurrence\"];\n proposedStart: Date;\n proposedEnd: Date;\n } | null\n >(\n (state) => {\n const drag = state.drag;\n if (!drag || drag.proposedDayGranular) return null;\n // Moves carry a proposedResourceId (they can cross columns); resizes stay\n // in place and leave it undefined, so fall back to the event's own\n // resource - otherwise the resize ghost is filtered out of every column.\n const targetResourceId = drag.proposedResourceId ?? drag.occurrence.event.resourceId;\n if (targetResourceId !== resource.id) return null;\n const from = Math.max(\n (drag.proposedStart.getTime() - dayStart.getTime()) / 60000,\n boundsStartMin,\n );\n const to = Math.min((drag.proposedEnd.getTime() - dayStart.getTime()) / 60000, boundsEndMin);\n if (to <= from) return null;\n return {\n window: [from, to] as [number, number],\n valid: drag.valid,\n kind: drag.kind,\n color: drag.occurrence.event.color,\n title: drag.occurrence.event.title,\n occurrence: drag.occurrence,\n proposedStart: drag.proposedStart,\n proposedEnd: drag.proposedEnd,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.window[0] === b.window[0] &&\n a.window[1] === b.window[1] &&\n a.valid === b.valid &&\n a.proposedStart.getTime() === b.proposedStart.getTime() &&\n a.proposedEnd.getTime() === b.proposedEnd.getTime()),\n },\n );\n\n const draftWindow = useEventCalendarSelector<unknown, [number, number] | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft || draft.allDay || draft.resourceId !== resource.id) {\n return null;\n }\n const from = Math.max((draft.start.getTime() - dayStart.getTime()) / 60000, boundsStartMin);\n const to = Math.min((draft.end.getTime() - dayStart.getTime()) / 60000, boundsEndMin);\n return to > from ? [from, to] : null;\n },\n {\n isEqual: (a, b) => a === b || (a !== null && b !== null && a[0] === b[0] && a[1] === b[1]),\n },\n );\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n data-slot=\"event-calendar-day-column\"\n data-today={isToday || undefined}\n data-off={isOff || undefined}\n data-ec-day={dayStart.getTime()}\n data-ec-bounds-start={boundsStartMin}\n data-ec-bounds-end={boundsEndMin}\n data-ec-resource={resource.id}\n data-drop-target={dragGhost ? (dragGhost.valid ? \"valid\" : \"invalid\") : undefined}\n role=\"group\"\n aria-label={resource.title}\n className={cn(\n \"relative min-w-0 border-e last:border-e-0\",\n isOff && offClassName,\n // the resource view is a single day, so today gets no column tint (the\n // header marks it); only a consumer todayClassName can tint it\n isToday && viewConfig.todayClassName,\n viewConfig.dayClassName?.(day),\n viewConfig.classNames?.dayColumn,\n )}\n style={{\n height: `calc(var(--ec-hour-height) * ${boundsMinutes / 60})`,\n backgroundImage: `repeating-linear-gradient(to bottom, transparent, transparent calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60}))`,\n }}\n onPointerDown={(e) => {\n if (e.target === e.currentTarget) gestures.beginCreate(e, day, false);\n }}\n onClick={(e) => {\n if (e.target !== e.currentTarget || wasRecentDrag() || wasRecentChipPress()) return;\n const rect = e.currentTarget.getBoundingClientRect();\n const pxPerMinute = rect.height / boundsMinutes;\n const minutes = snapMinutes(\n boundsStartMin + (e.clientY - rect.top) / pxPerMinute,\n settings.snapDuration,\n );\n const clamped = Math.min(\n Math.max(minutes, boundsStartMin),\n boundsEndMin - settings.slotDuration,\n );\n settings.onSlotClick?.(\n {\n date: addMinutes(dayStart, clamped),\n end: addMinutes(dayStart, clamped + settings.slotDuration),\n allDay: false,\n view: \"resource\",\n resourceId: resource.id,\n },\n e,\n );\n }}\n >\n {packed.map((segment) => {\n const startMin = Math.max(segment.startMin ?? 0, boundsStartMin);\n const endMin = Math.min(segment.endMin ?? startMin, boundsEndMin);\n if (endMin <= boundsStartMin || startMin >= boundsEndMin) return null;\n const columnCount = segment.columnCount ?? 1;\n const column = segment.column ?? 0;\n const span = segment.columnSpan ?? 1;\n const zIndex = segment.occurrence.event.zIndex ?? 10 + column;\n // Strict side-by-side columns - no cascade overlap (fade-truncate +\n // hover reveal carry the legibility); the ring separates neighbors.\n const colPct = 100 / columnCount;\n return (\n <div\n key={segment.occurrence.key}\n // min-h keeps 15-min chips readable (Google-style: the block may\n // slightly outgrow its true window); hover raises a squeezed\n // cascade chip above its overlapping neighbors\n className=\"absolute z-(--ec-z) min-h-(--ec-event-min-h,1.5rem) px-0.5 hover:z-40\"\n style={\n {\n ...minuteBlockStyle(startMin, endMin, boundsStartMin),\n left: `${column * colPct}%`,\n width: `${span * colPct}%`,\n \"--ec-z\": zIndex,\n } as CSSProperties\n }\n >\n <EventCalendarEvent\n segment={segment}\n className={cn(\n columnCount > 1 && \"ring-1 ring-background\",\n // short chips: single centered row, exact-fit line height so\n // the title never slices mid-glyph\n endMin - startMin < viewConfig.compactEventMinutes\n ? \"h-full gap-1 py-0 leading-4\"\n : \"h-full flex-col items-start justify-start gap-0 py-1\",\n viewConfig.classNames?.timedChip,\n )}\n />\n </div>\n );\n })}\n {/* Standardized ghost (EVENT_CALENDAR_GHOST): faint drop placeholder\n for moves (the cursor-attached carry clone owns the visual), dashed\n clone for resizes, destructive marking when invalid. */}\n {dragGhost && (\n <div\n data-slot=\"event-calendar-drag-ghost\"\n data-kind={dragGhost.kind}\n data-drop-invalid={!dragGhost.valid || undefined}\n className={cn(\n \"pointer-events-none absolute inset-x-0.5 z-50 min-h-(--ec-event-min-h,1.5rem)\",\n dragGhost.kind === \"move\"\n ? cn(EVENT_CALENDAR_GHOST.move, !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid)\n : cn(\n EVENT_CALENDAR_GHOST.resize,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize,\n ),\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n ...minuteBlockStyle(dragGhost.window[0], dragGhost.window[1], boundsStartMin),\n \"--ec-event-color\": dragGhost.color ?? \"var(--color-primary)\",\n } as CSSProperties\n }\n >\n {dragGhost.kind !== \"move\" && (\n <EventCalendarEvent\n preview\n segment={{\n occurrence: {\n ...dragGhost.occurrence,\n start: dragGhost.proposedStart,\n end: dragGhost.proposedEnd,\n allDay: false,\n },\n day,\n isStart: true,\n isEnd: true,\n continuesBefore: false,\n continuesAfter: false,\n startMin: dragGhost.window[0],\n endMin: dragGhost.window[1],\n }}\n className={cn(\n dragGhost.window[1] - dragGhost.window[0] < viewConfig.compactEventMinutes\n ? \"h-full gap-1 py-0 leading-4\"\n : \"h-full flex-col items-start justify-start gap-0 py-1\",\n viewConfig.classNames?.timedChip,\n \"inset-ring-0\",\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent,\n )}\n />\n )}\n </div>\n )}\n {draftWindow && (\n <div\n data-slot=\"event-calendar-slot-draft\"\n className={cn(\n \"pointer-events-none absolute inset-x-0.5 z-40 rounded-sm border border-primary/40 border-dashed bg-primary/5\",\n viewConfig.classNames?.slotDraft,\n )}\n style={minuteBlockStyle(draftWindow[0], draftWindow[1], boundsStartMin)}\n />\n )}\n </div>\n );\n}\n\nexport type { EventCalendarResourceViewProps };\nexport { EventCalendarResourceView };\n"],"mappings":";;;;;;;;;;;;;;AAqCA,MAAM,yBAAiD,CAAC;;AAWxD,SAAS,0BAA0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S,SACf,GAAG,qBAAqB,MAAM,CAAC,UAAU,SAAS,qBAAqB,OAAO,IAC9E,GACE,qBAAqB,QACrB,CAAC,UAAU,SAAS,qBAAqB,aAC3C,GACJ,WAAW,YAAY,SACzB;IACA,OACE;KACE,GAAG,iBAAiB,UAAU,OAAO,IAAI,UAAU,OAAO,IAAI,cAAc;KAC5E,oBAAoB,UAAU,SAAS;IACzC;IAGD,UAAA,UAAU,SAAS,UAClB,oBAAC,oBAAD;KACE,SAAA;KACA,SAAS;MACP,YAAY;OACV,GAAG,UAAU;OACb,OAAO,UAAU;OACjB,KAAK,UAAU;OACf,QAAQ;MACV;MACA;MACA,SAAS;MACT,OAAO;MACP,iBAAiB;MACjB,gBAAgB;MAChB,UAAU,UAAU,OAAO;MAC3B,QAAQ,UAAU,OAAO;KAC3B;KACA,WAAW,GACT,UAAU,OAAO,KAAK,UAAU,OAAO,KAAK,WAAW,sBACnD,gCACA,wDACJ,WAAW,YAAY,WACvB,gBACA,CAAC,UAAU,SAAS,qBAAqB,cAC3C;IACD,CAAA;GAEA,CAAA;GAEN,eACC,oBAAC,OAAD;IACE,aAAU;IACV,WAAW,GACT,gHACA,WAAW,YAAY,SACzB;IACA,OAAO,iBAAiB,YAAY,IAAI,YAAY,IAAI,cAAc;GACvE,CAAA;EAEA;;AAET"}
|
|
1
|
+
{"version":3,"file":"event-calendar-resource-view.js","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-resource-view.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, useEffect, useMemo, useRef } from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { addDays, addMinutes } from \"date-fns\";\n\nimport { cn } from \"@kumix/utils\";\nimport { ScrollArea } from \"../../ui/scroll-area\";\nimport {\n EventCalendarViewContext,\n useEventCalendar,\n useEventCalendarDay,\n useEventCalendarSelector,\n useEventCalendarSettings,\n useEventCalendarViewConfig,\n useEventCalendarViewSettings,\n} from \"./event-calendar\";\nimport { useEventCalendarGestures, wasRecentChipPress, wasRecentDrag } from \"./event-calendar-dnd\";\nimport {\n EVENT_CALENDAR_GHOST,\n EVENT_CALENDAR_SLOT_DRAFT,\n EventCalendarEvent,\n} from \"./event-calendar-event\";\nimport {\n flattenResources,\n getDayKey,\n getDayTotalMinutes,\n packTimedSegments,\n resolveOffDay,\n snapMinutes,\n toZoned,\n zonedStartOfDay,\n} from \"./event-calendar-lib\";\nimport {\n EventCalendarNowIndicator,\n EventCalendarTimeGutter,\n minuteBlockStyle,\n} from \"./event-calendar-time-grid\";\nimport type { EventCalendarResource, EventCalendarSegment } from \"./event-calendar-types\";\n\nconst EMPTY_ALL_DAY_SEGMENTS: EventCalendarSegment[] = [];\n\ninterface EventCalendarResourceViewProps extends useRender.ComponentProps<\"div\"> {\n dayStartHour?: number;\n dayEndHour?: number;\n showAllDay?: boolean;\n /** Gutter/gridline interval in minutes; defaults to the interval view config. */\n interval?: number;\n}\n\n/** Leaf resources become booking columns for the anchor day. */\nfunction EventCalendarResourceView({\n className,\n render,\n dayStartHour,\n dayEndHour,\n showAllDay = true,\n interval: intervalProp,\n ...props\n}: EventCalendarResourceViewProps) {\n const instance = useEventCalendar();\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const anchorDate = useEventCalendarSelector((state) => state.date, {\n isEqual: (a, b) => a.getTime() === b.getTime(),\n });\n\n const startHour = dayStartHour ?? settings.dayStartHour;\n const endHour = dayEndHour ?? settings.dayEndHour;\n const interval = Math.min(Math.max(intervalProp ?? viewConfig.interval, 5), 240);\n const contained = viewConfig.scrollMode !== \"page\";\n const day = zonedStartOfDay(anchorDate, settings.timeZone);\n\n const resources = useMemo(\n () =>\n flattenResources(settings.resources)\n .filter(({ resource }) => !resource.children?.length)\n .map(({ resource }) => resource),\n [settings.resources],\n );\n\n // Initial scroll + api.scrollToTime (same contract as the time grid)\n const scrollRef = useRef<HTMLDivElement | null>(null);\n useEffect(() => {\n if (!contained) return;\n const el = scrollRef.current;\n if (!el) return;\n const viewport = el.querySelector<HTMLElement>(\"[data-slot=scroll-area-viewport]\");\n const slotRow = el.querySelector<HTMLElement>(\"[data-slot=event-calendar-time-gutter] > div\");\n const slotPx = slotRow?.getBoundingClientRect().height || 64;\n const pxPerMinute = slotPx / interval;\n const scrollTo = (minutes: number) => {\n // keep the hour label above the target line visible (it hangs -top-2)\n viewport?.scrollTo({\n top: Math.max(0, (minutes - startHour * 60) * pxPerMinute - 12),\n });\n };\n scrollTo(viewConfig.scrollToHour * 60);\n instance.internals.registerScrollHandler((time) => {\n const minutes =\n typeof time === \"number\"\n ? time\n : toZoned(time, settings.timeZone).getHours() * 60 +\n toZoned(time, settings.timeZone).getMinutes();\n scrollTo(minutes);\n });\n // Classic (width-consuming) scrollbars squeeze the scrolling track while\n // the header/all-day rows outside keep full width, drifting the column\n // borders. Mirror the measured gutter onto those rows via a CSS var -\n // 0px for overlay scrollbars and the custom ScrollArea, so both modes\n // lay out identically.\n const root = el.closest<HTMLElement>(\n \"[data-slot=event-calendar-time-grid], [data-slot=event-calendar-resource-view]\",\n );\n const syncScrollbarGutter = () => {\n root?.style.setProperty(\n \"--ec-scrollbar-w\",\n `${viewport ? viewport.offsetWidth - viewport.clientWidth : 0}px`,\n );\n };\n syncScrollbarGutter();\n const gutterObserver = viewport ? new ResizeObserver(syncScrollbarGutter) : null;\n if (viewport) gutterObserver?.observe(viewport);\n return () => {\n instance.internals.registerScrollHandler(null);\n gutterObserver?.disconnect();\n };\n }, [contained, instance, settings.timeZone, startHour, interval, viewConfig.scrollToHour]);\n\n const slots = useMemo(() => {\n const result: number[] = [];\n for (let m = startHour * 60; m < endHour * 60; m += interval) {\n result.push(m);\n }\n return result;\n }, [startHour, endHour, interval]);\n\n // All-day segments for renderAllDaySection - the same index bucket the\n // cells read; inert (stable empty array, so the subscription never\n // re-renders) while the override is unset.\n const allDaySegments = useEventCalendarSelector<unknown, EventCalendarSegment[]>(\n () =>\n viewConfig.renderAllDaySection\n ? (instance.internals.getIndex().byDay.get(getDayKey(day, settings.timeZone))?.allDay ??\n EMPTY_ALL_DAY_SEGMENTS)\n : EMPTY_ALL_DAY_SEGMENTS,\n {\n isEqual: (a, b) =>\n a === b || (a.length === b.length && a.every((segment, i) => segment === b[i])),\n },\n );\n\n const gridTemplateColumns = `repeat(${resources.length || 1}, minmax(var(--ec-resource-col-min,8rem), 1fr))`;\n\n const track = (\n <div className=\"relative flex\">\n {/* shared gutter component, so renderTimeGutterSlot and\n classNames.timeGutter customizations apply here too */}\n <EventCalendarTimeGutter\n days={[day]}\n slots={slots}\n startHour={startHour}\n interval={interval}\n />\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <EventCalendarResourceColumn\n key={resource.id}\n resource={resource}\n day={day}\n startHour={startHour}\n endHour={endHour}\n interval={interval}\n />\n ))}\n </div>\n {effective.nowIndicator && (\n <EventCalendarNowIndicator days={[day]} startHour={startHour} endHour={endHour} />\n )}\n </div>\n );\n\n const defaultProps = {\n \"data-slot\": \"event-calendar-resource-view\",\n \"data-view\": \"resource\",\n className: cn(\n \"flex flex-col border-t\",\n contained && \"min-h-0 flex-1 overflow-hidden\",\n viewConfig.classNames?.timeGrid,\n className,\n ),\n style: { \"--ec-hour-height\": \"4rem\" } as CSSProperties,\n children: (\n <>\n {/* Resource header row */}\n <div\n className={cn(\n \"flex border-b pe-(--ec-scrollbar-w,0px)\",\n !contained && \"sticky top-(--ec-sticky-offset,0px) z-20 bg-background\",\n viewConfig.classNames?.timeGridHeader,\n )}\n >\n <div className=\"w-(--ec-gutter-width,4.5rem) shrink-0 border-e\" />\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <div\n key={resource.id}\n data-slot=\"event-calendar-resource-header\"\n className={cn(\n \"min-w-0 truncate border-e px-2 py-1.5 text-center font-medium last:border-e-0\",\n viewConfig.classNames?.resourceHeader,\n )}\n >\n {viewConfig.renderResourceHeader?.({ resource }) ?? resource.title}\n </div>\n ))}\n </div>\n </div>\n {/* All-day row per resource */}\n {showAllDay && (\n <div\n data-slot=\"event-calendar-all-day-section\"\n className={cn(\n \"flex border-b pe-(--ec-scrollbar-w,0px)\",\n viewConfig.classNames?.allDaySection,\n )}\n >\n {viewConfig.renderAllDaySection?.({\n days: [day],\n segments: allDaySegments,\n }) ?? (\n <>\n <div\n className={cn(\n // pt-1.5 matches the all-day cell's top inset; the inner box is\n // one bar-row tall and centers the label so it sits on the SAME\n // baseline as the first all-day chip and stays top-aligned when\n // the chips wrap onto more lanes (mirrors the time-grid label)\n \"w-(--ec-gutter-width,4.5rem) shrink-0 border-e ps-2 pe-2.5 pt-1.5 text-muted-foreground\",\n viewConfig.classNames?.allDayLabel,\n )}\n >\n <span className=\"flex h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)] items-center justify-end\">\n {settings.i18n.labels.allDay}\n </span>\n </div>\n <div className=\"grid min-w-0 flex-1\" style={{ gridTemplateColumns }}>\n {resources.map((resource) => (\n <EventCalendarResourceAllDayCell\n key={resource.id}\n resource={resource}\n day={day}\n />\n ))}\n </div>\n </>\n )}\n </div>\n )}\n {contained ? (\n <div ref={scrollRef} className=\"min-h-0 flex-1\">\n {viewConfig.scrollbars === \"native\" ? (\n <div\n data-slot=\"scroll-area-viewport\"\n data-ec-native-scroll=\"\"\n className=\"h-full overflow-y-auto\"\n >\n {track}\n </div>\n ) : (\n <ScrollArea className=\"h-full\">{track}</ScrollArea>\n )}\n </div>\n ) : (\n track\n )}\n </>\n ),\n };\n\n return (\n <EventCalendarViewContext.Provider value={{ view: \"resource\" }}>\n {useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(defaultProps, props),\n })}\n </EventCalendarViewContext.Provider>\n );\n}\n\nfunction EventCalendarResourceAllDayCell({\n resource,\n day,\n}: {\n resource: EventCalendarResource;\n day: Date;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const gestures = useEventCalendarGestures();\n const { segments } = useEventCalendarDay(day);\n const mine = segments.allDay.filter(\n (segment) => segment.occurrence.event.resourceId === resource.id,\n );\n const dayStart = zonedStartOfDay(day, settings.timeZone);\n const dayEnd = addDays(toZoned(dayStart, settings.timeZone), 1);\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n const isDropTarget = useEventCalendarSelector<unknown, \"valid\" | \"invalid\" | null>((state) => {\n const drag = state.drag;\n if (!drag?.proposedDayGranular) return null;\n const covered = drag.proposedStart < dayEnd && drag.proposedEnd > dayStart;\n if (!covered) return null;\n return drag.valid ? \"valid\" : \"invalid\";\n });\n // Slot-draft highlight, mirroring the time-grid all-day cell. The dnd\n // layer's all-day create branch does not plumb resourceId into the draft,\n // so every resource cell covering the day highlights together.\n const inDraft = useEventCalendarSelector<unknown, boolean>((state) => {\n const draft = state.slotDraft;\n if (!draft?.allDay) return false;\n return draft.start < dayEnd && draft.end > dayStart;\n });\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n data-slot=\"event-calendar-all-day-cell\"\n // data-ec-day makes this a DnD day target: without it collectSurface()\n // finds no cells and dragging an all-day chip silently converts it to\n // a timed event via the column branch\n data-ec-day={dayStart.getTime()}\n data-drop-target={isDropTarget ?? undefined}\n data-off={isOff || undefined}\n className={cn(\n // reserve one bar row so the all-day row keeps the same height with or\n // without events, matching the time-grid all-day row (which reserves\n // the same via its bars-grid minHeight)\n \"relative flex min-h-[calc(var(--ec-month-bar-h,1.625rem)+0.625rem)] min-w-0 flex-col gap-0.5 border-e px-1 py-1.5 last:border-e-0\",\n isOff && offClassName,\n viewConfig.dayClassName?.(day),\n inDraft &&\n cn(\n EVENT_CALENDAR_SLOT_DRAFT.surface,\n EVENT_CALENDAR_SLOT_DRAFT.segment,\n EVENT_CALENDAR_SLOT_DRAFT.segmentStart,\n EVENT_CALENDAR_SLOT_DRAFT.segmentEnd,\n viewConfig.classNames?.slotDraft,\n ),\n viewConfig.classNames?.allDayCell,\n )}\n onPointerDown={(e) => {\n if (e.target === e.currentTarget) gestures.beginCreate(e, day, true);\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget && !wasRecentDrag() && !wasRecentChipPress()) {\n settings.onSlotClick?.(\n {\n date: dayStart,\n allDay: true,\n view: \"resource\",\n resourceId: resource.id,\n },\n e,\n );\n }\n }}\n >\n {mine.map((segment) => (\n <EventCalendarEvent\n key={segment.occurrence.key}\n segment={segment}\n // one bar-row tall, matching the time-grid all-day bars so the row\n // height stays identical across views (and equals the reserved min)\n className=\"h-[calc(var(--ec-month-bar-h,1.625rem)-0.125rem)]\"\n />\n ))}\n {isDropTarget && (\n <span\n aria-hidden\n data-slot=\"event-calendar-drop-indicator\"\n data-drop-target={isDropTarget}\n className={cn(\n \"pointer-events-none absolute inset-0.5 z-10 rounded-sm border border-dashed\",\n isDropTarget === \"valid\" ? \"border-primary/50\" : \"border-destructive/60\",\n viewConfig.classNames?.dropIndicator,\n )}\n />\n )}\n </div>\n );\n}\n\nfunction EventCalendarResourceColumn({\n resource,\n day,\n startHour,\n endHour,\n interval,\n}: {\n resource: EventCalendarResource;\n day: Date;\n startHour: number;\n endHour: number;\n interval: number;\n}) {\n const settings = useEventCalendarSettings();\n const viewConfig = useEventCalendarViewConfig();\n const { effective } = useEventCalendarViewSettings();\n const gestures = useEventCalendarGestures();\n const { segments, isToday } = useEventCalendarDay(day);\n const isOff = resolveOffDay(\n day,\n settings.timeZone,\n effective.offDays\n ? typeof viewConfig.offDays === \"object\"\n ? viewConfig.offDays\n : true\n : false,\n settings.weekendDays,\n );\n const offClassName =\n (typeof viewConfig.offDays === \"object\" && viewConfig.offDays.className) || \"bg-muted/25\";\n\n const timeZone = settings.timeZone;\n const dayStart = zonedStartOfDay(day, timeZone);\n const totalMinutes = getDayTotalMinutes(day, timeZone);\n const boundsStartMin = startHour * 60;\n const boundsEndMin = Math.min(endHour * 60, totalMinutes);\n const boundsMinutes = Math.max(60, boundsEndMin - boundsStartMin);\n\n // Filter this resource's timed segments and repack per column.\n // Clones keep the shared index cache untouched. Segments the day bounds clip\n // away are dropped here too, otherwise they hold a column nobody can see and\n // leave a phantom empty half beside the first in-bounds chip.\n const packed = useMemo(() => {\n const mine = segments.timed\n .filter((segment) => {\n if (segment.occurrence.event.resourceId !== resource.id) return false;\n const startMin = Math.max(segment.startMin ?? 0, boundsStartMin);\n const endMin = Math.min(segment.endMin ?? startMin, boundsEndMin);\n return endMin > boundsStartMin && startMin < boundsEndMin;\n })\n .map((segment) => ({ ...segment }) as EventCalendarSegment);\n packTimedSegments(mine);\n return mine;\n }, [segments.timed, resource.id, boundsStartMin, boundsEndMin]);\n\n const dragGhost = useEventCalendarSelector<\n unknown,\n {\n window: [number, number];\n valid: boolean;\n kind: string;\n color?: string;\n title: string;\n occurrence: EventCalendarSegment[\"occurrence\"];\n proposedStart: Date;\n proposedEnd: Date;\n } | null\n >(\n (state) => {\n const drag = state.drag;\n if (!drag || drag.proposedDayGranular) return null;\n // Moves carry a proposedResourceId (they can cross columns); resizes stay\n // in place and leave it undefined, so fall back to the event's own\n // resource - otherwise the resize ghost is filtered out of every column.\n const targetResourceId = drag.proposedResourceId ?? drag.occurrence.event.resourceId;\n if (targetResourceId !== resource.id) return null;\n const from = Math.max(\n (drag.proposedStart.getTime() - dayStart.getTime()) / 60000,\n boundsStartMin,\n );\n const to = Math.min((drag.proposedEnd.getTime() - dayStart.getTime()) / 60000, boundsEndMin);\n if (to <= from) return null;\n return {\n window: [from, to] as [number, number],\n valid: drag.valid,\n kind: drag.kind,\n color: drag.occurrence.event.color,\n title: drag.occurrence.event.title,\n occurrence: drag.occurrence,\n proposedStart: drag.proposedStart,\n proposedEnd: drag.proposedEnd,\n };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.window[0] === b.window[0] &&\n a.window[1] === b.window[1] &&\n a.valid === b.valid &&\n a.proposedStart.getTime() === b.proposedStart.getTime() &&\n a.proposedEnd.getTime() === b.proposedEnd.getTime()),\n },\n );\n\n // Instants behind `draftWindow` below, for the range readout. Same\n // resource filter, so a draft on a neighbouring resource never labels this\n // column.\n const draftRange = useEventCalendarSelector<unknown, { start: Date; end: Date } | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft || draft.allDay || draft.resourceId !== resource.id) {\n return null;\n }\n return { start: draft.start, end: draft.end };\n },\n {\n isEqual: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.start.getTime() === b.start.getTime() &&\n a.end.getTime() === b.end.getTime()),\n },\n );\n\n const draftWindow = useEventCalendarSelector<unknown, [number, number] | null>(\n (state) => {\n const draft = state.slotDraft;\n if (!draft || draft.allDay || draft.resourceId !== resource.id) {\n return null;\n }\n const from = Math.max((draft.start.getTime() - dayStart.getTime()) / 60000, boundsStartMin);\n const to = Math.min((draft.end.getTime() - dayStart.getTime()) / 60000, boundsEndMin);\n return to > from ? [from, to] : null;\n },\n {\n isEqual: (a, b) => a === b || (a !== null && b !== null && a[0] === b[0] && a[1] === b[1]),\n },\n );\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: pointer/gesture surface; keyboard via toolbar\n <div\n data-slot=\"event-calendar-day-column\"\n data-today={isToday || undefined}\n data-off={isOff || undefined}\n data-ec-day={dayStart.getTime()}\n data-ec-bounds-start={boundsStartMin}\n data-ec-bounds-end={boundsEndMin}\n data-ec-resource={resource.id}\n data-drop-target={dragGhost ? (dragGhost.valid ? \"valid\" : \"invalid\") : undefined}\n role=\"group\"\n aria-label={resource.title}\n className={cn(\n \"relative min-w-0 border-e last:border-e-0\",\n isOff && offClassName,\n // the resource view is a single day, so today gets no column tint (the\n // header marks it); only a consumer todayClassName can tint it\n isToday && viewConfig.todayClassName,\n viewConfig.dayClassName?.(day),\n viewConfig.classNames?.dayColumn,\n )}\n style={{\n height: `calc(var(--ec-hour-height) * ${boundsMinutes / 60})`,\n backgroundImage: `repeating-linear-gradient(to bottom, transparent, transparent calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60} - var(--ec-slot-line-width, 1px)), var(--ec-slot-line-color, var(--color-border)) calc(var(--ec-hour-height) * ${interval / 60}))`,\n }}\n onPointerDown={(e) => {\n if (e.target === e.currentTarget) gestures.beginCreate(e, day, false);\n }}\n onClick={(e) => {\n if (e.target !== e.currentTarget || wasRecentDrag() || wasRecentChipPress()) return;\n const rect = e.currentTarget.getBoundingClientRect();\n const pxPerMinute = rect.height / boundsMinutes;\n const minutes = snapMinutes(\n boundsStartMin + (e.clientY - rect.top) / pxPerMinute,\n settings.snapDuration,\n );\n const clamped = Math.min(\n Math.max(minutes, boundsStartMin),\n boundsEndMin - settings.slotDuration,\n );\n settings.onSlotClick?.(\n {\n date: addMinutes(dayStart, clamped),\n end: addMinutes(dayStart, clamped + settings.slotDuration),\n allDay: false,\n view: \"resource\",\n resourceId: resource.id,\n },\n e,\n );\n }}\n >\n {packed.map((segment) => {\n const startMin = Math.max(segment.startMin ?? 0, boundsStartMin);\n const endMin = Math.min(segment.endMin ?? startMin, boundsEndMin);\n if (endMin <= boundsStartMin || startMin >= boundsEndMin) return null;\n const columnCount = segment.columnCount ?? 1;\n const column = segment.column ?? 0;\n const span = segment.columnSpan ?? 1;\n const zIndex = segment.occurrence.event.zIndex ?? 10 + column;\n // Strict side-by-side columns - no cascade overlap (fade-truncate +\n // hover reveal carry the legibility); the ring separates neighbors.\n const colPct = 100 / columnCount;\n return (\n <div\n key={segment.occurrence.key}\n // min-h keeps 15-min chips readable (Google-style: the block may\n // slightly outgrow its true window); hover raises a squeezed\n // cascade chip above its overlapping neighbors\n className=\"absolute z-(--ec-z) min-h-(--ec-event-min-h,1.5rem) px-0.5 hover:z-40\"\n style={\n {\n ...minuteBlockStyle(startMin, endMin, boundsStartMin),\n left: `${column * colPct}%`,\n width: `${span * colPct}%`,\n \"--ec-z\": zIndex,\n } as CSSProperties\n }\n >\n <EventCalendarEvent\n segment={segment}\n className={cn(\n columnCount > 1 && \"ring-1 ring-background\",\n // short chips: single centered row, exact-fit line height so\n // the title never slices mid-glyph\n endMin - startMin < viewConfig.compactEventMinutes\n ? \"h-full gap-1 py-0 leading-4\"\n : \"h-full flex-col items-start justify-start gap-0 py-1\",\n viewConfig.classNames?.timedChip,\n )}\n />\n </div>\n );\n })}\n {/* Standardized ghost (EVENT_CALENDAR_GHOST): faint drop placeholder\n for moves (the cursor-attached carry clone owns the visual), dashed\n clone for resizes, destructive marking when invalid. */}\n {dragGhost && (\n <div\n data-slot=\"event-calendar-drag-ghost\"\n data-kind={dragGhost.kind}\n data-drop-invalid={!dragGhost.valid || undefined}\n className={cn(\n \"pointer-events-none absolute inset-x-0.5 z-50 min-h-(--ec-event-min-h,1.5rem)\",\n dragGhost.kind === \"move\"\n ? cn(EVENT_CALENDAR_GHOST.move, !dragGhost.valid && EVENT_CALENDAR_GHOST.invalid)\n : cn(\n EVENT_CALENDAR_GHOST.resize,\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidResize,\n ),\n viewConfig.classNames?.dragGhost,\n )}\n style={\n {\n ...minuteBlockStyle(dragGhost.window[0], dragGhost.window[1], boundsStartMin),\n \"--ec-event-color\": dragGhost.color ?? \"var(--color-primary)\",\n } as CSSProperties\n }\n >\n {dragGhost.kind !== \"move\" && (\n <EventCalendarEvent\n preview\n segment={{\n occurrence: {\n ...dragGhost.occurrence,\n start: dragGhost.proposedStart,\n end: dragGhost.proposedEnd,\n allDay: false,\n },\n day,\n isStart: true,\n isEnd: true,\n continuesBefore: false,\n continuesAfter: false,\n startMin: dragGhost.window[0],\n endMin: dragGhost.window[1],\n }}\n className={cn(\n dragGhost.window[1] - dragGhost.window[0] < viewConfig.compactEventMinutes\n ? \"h-full gap-1 py-0 leading-4\"\n : \"h-full flex-col items-start justify-start gap-0 py-1\",\n viewConfig.classNames?.timedChip,\n \"inset-ring-0\",\n !dragGhost.valid && EVENT_CALENDAR_GHOST.invalidContent,\n )}\n />\n )}\n </div>\n )}\n {draftWindow && (\n <div\n data-slot=\"event-calendar-slot-draft\"\n className={cn(\n EVENT_CALENDAR_SLOT_DRAFT.box,\n \"pointer-events-none absolute inset-x-0.5 z-40 overflow-hidden\",\n viewConfig.classNames?.slotDraft,\n )}\n style={minuteBlockStyle(draftWindow[0], draftWindow[1], boundsStartMin)}\n >\n {draftRange && (\n <span className={cn(\"block\", EVENT_CALENDAR_SLOT_DRAFT.label)}>\n {settings.i18n.functions.formatEventTime(\n toZoned(draftRange.start, settings.timeZone),\n toZoned(draftRange.end, settings.timeZone),\n false,\n { locale: settings.locale },\n )}\n </span>\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport type { EventCalendarResourceViewProps };\nexport { EventCalendarResourceView };\n"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAM,yBAAiD,CAAC;;AAWxD,SAAS,0BAA0B,EACjC,WACA,QACA,cACA,YACA,aAAa,MACb,UAAU,cACV,GAAG,SAC8B;CACjC,MAAM,WAAW,iBAAiB;CAClC,MAAM,WAAW,yBAAyB;CAC1C,MAAM,aAAa,2BAA2B;CAC9C,MAAM,EAAE,cAAc,6BAA6B;CACnD,MAAM,aAAa,0BAA0B,UAAU,MAAM,MAAM,EACjE,UAAU,GAAG,MAAM,EAAE,QAAQ,MAAM,EAAE,QAAQ,EAC/C,CAAC;CAED,MAAM,YAAY,gBAAgB,SAAS;CAC3C,MAAM,UAAU,cAAc,SAAS;CACvC,MAAM,WAAW,KAAK,IAAI,KAAK,IAAI,gBAAgB,WAAW,UAAU,CAAC,GAAG,GAAG;CAC/E,MAAM,YAAY,WAAW,eAAe;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ACE,qBAAqB,QACrB,CAAC,UAAU,SAAS,qBAAqB,aAC3C,GACJ,WAAW,YAAY,SACzB;IACA,OACE;KACE,GAAG,iBAAiB,UAAU,OAAO,IAAI,UAAU,OAAO,IAAI,cAAc;KAC5E,oBAAoB,UAAU,SAAS;IACzC;IAGD,UAAA,UAAU,SAAS,UAClB,oBAAC,oBAAD;KACE,SAAA;KACA,SAAS;MACP,YAAY;OACV,GAAG,UAAU;OACb,OAAO,UAAU;OACjB,KAAK,UAAU;OACf,QAAQ;MACV;MACA;MACA,SAAS;MACT,OAAO;MACP,iBAAiB;MACjB,gBAAgB;MAChB,UAAU,UAAU,OAAO;MAC3B,QAAQ,UAAU,OAAO;KAC3B;KACA,WAAW,GACT,UAAU,OAAO,KAAK,UAAU,OAAO,KAAK,WAAW,sBACnD,gCACA,wDACJ,WAAW,YAAY,WACvB,gBACA,CAAC,UAAU,SAAS,qBAAqB,cAC3C;IACD,CAAA;GAEA,CAAA;GAEN,eACC,oBAAC,OAAD;IACE,aAAU;IACV,WAAW,GACT,0BAA0B,KAC1B,iEACA,WAAW,YAAY,SACzB;IACA,OAAO,iBAAiB,YAAY,IAAI,YAAY,IAAI,cAAc;IAErE,UAAA,cACC,oBAAC,QAAD;KAAM,WAAW,GAAG,SAAS,0BAA0B,KAAK;KACzD,UAAA,SAAS,KAAK,UAAU,gBACvB,QAAQ,WAAW,OAAO,SAAS,QAAQ,GAC3C,QAAQ,WAAW,KAAK,SAAS,QAAQ,GACzC,OACA,EAAE,QAAQ,SAAS,OAAO,CAC5B;IACI,CAAA;GAEL,CAAA;EAEJ;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-calendar-time-grid.d.ts","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-time-grid.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"event-calendar-time-grid.d.ts","names":[],"sources":["../../../../src/components/reui/event-calendar/event-calendar-time-grid.tsx"],"mappings":";;;;;iBA2CS,OAAO,sBAAsB;UAkB5B,mCAAmC,UAAU;EACrD,MAAM,QAAQ;EACd;EACA;EACA;;EAEA;;iBAGO,wBACP,MACA,WACA,QACA,cACA,YACA,YACA,UAAU,iBACP,SACF,6CAA0B,IAAA;iBAkpBpB,0BACP,MACA,OACA,WACA;EAEA,MAAM;EACN;EACA;EACA;oBACD,IAAA;;iBAmDQ,iBAAiB,kBAAkB,gBAAgB,yBAAyB;iBAmV5E,4BACP,MACA,WACA;EAEA,MAAM;EACN;EACA;IACE;KAsDC,oBAAoB,KAAK;iBAErB,sBAAsB,OAAO,oCAAiB,IAAA;iBAI9C,qBAAqB,OAAO,oCAAiB,IAAA;iBAI7C,sBAAsB,OAAO,oCAAiB,IAAA"}
|