@burdenoff/microfe-calendar 2026.1123.2 → 2026.1124.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AgendaView.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +596 -0
- package/dist/generated/wspace-operations.js +190 -85
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/translations/en.d.ts +292 -0
- package/dist/v2/CalendarPageV2.js +87 -14
- package/dist/v2/CalendarPageV2.js.map +1 -1
- package/dist/v2/colors.d.ts +23 -0
- package/dist/v2/colors.js +92 -0
- package/dist/v2/colors.js.map +1 -0
- package/dist/v2/data/enums.d.ts +6 -0
- package/dist/v2/data/enums.js +10 -0
- package/dist/v2/data/enums.js.map +1 -0
- package/dist/v2/data/errors.d.ts +4 -0
- package/dist/v2/data/errors.js +17 -0
- package/dist/v2/data/errors.js.map +1 -0
- package/dist/v2/data/invalidation.js +19 -0
- package/dist/v2/data/invalidation.js.map +1 -0
- package/dist/v2/data/normalize.js +181 -16
- package/dist/v2/data/normalize.js.map +1 -1
- package/dist/v2/data/serialWrites.d.ts +17 -0
- package/dist/v2/data/serialWrites.js +21 -0
- package/dist/v2/data/serialWrites.js.map +1 -0
- package/dist/v2/data/useCalendarsV2.d.ts +10 -1
- package/dist/v2/data/useCalendarsV2.js +68 -16
- package/dist/v2/data/useCalendarsV2.js.map +1 -1
- package/dist/v2/data/useEventActions.d.ts +49 -0
- package/dist/v2/data/useEventActions.js +399 -0
- package/dist/v2/data/useEventActions.js.map +1 -0
- package/dist/v2/data/useEventForPeek.d.ts +17 -0
- package/dist/v2/data/useEventForPeek.js +29 -0
- package/dist/v2/data/useEventForPeek.js.map +1 -0
- package/dist/v2/data/useEventSearchV2.d.ts +15 -0
- package/dist/v2/data/useEventSearchV2.js +80 -0
- package/dist/v2/data/useEventSearchV2.js.map +1 -0
- package/dist/v2/data/useEventsInRangeV2.js +78 -0
- package/dist/v2/data/useEventsInRangeV2.js.map +1 -0
- package/dist/v2/data/useFreeBusy.d.ts +5 -0
- package/dist/v2/data/useFreeBusy.js +83 -0
- package/dist/v2/data/useFreeBusy.js.map +1 -0
- package/dist/v2/data/useKeyedLoad.js +47 -0
- package/dist/v2/data/useKeyedLoad.js.map +1 -0
- package/dist/v2/data/useRoomsV2.d.ts +28 -0
- package/dist/v2/data/useRoomsV2.js +45 -0
- package/dist/v2/data/useRoomsV2.js.map +1 -0
- package/dist/v2/day/DayPanel.d.ts +6 -0
- package/dist/v2/day/DayPanel.js +215 -0
- package/dist/v2/day/DayPanel.js.map +1 -0
- package/dist/v2/day/daySummary.d.ts +37 -0
- package/dist/v2/day/daySummary.js +37 -0
- package/dist/v2/day/daySummary.js.map +1 -0
- package/dist/v2/dialogs/CalendarDialogsV2.d.ts +1 -0
- package/dist/v2/dialogs/CalendarDialogsV2.js +17 -0
- package/dist/v2/dialogs/CalendarDialogsV2.js.map +1 -0
- package/dist/v2/dialogs/ShortcutsDialog.d.ts +4 -0
- package/dist/v2/dialogs/ShortcutsDialog.js +42 -0
- package/dist/v2/dialogs/ShortcutsDialog.js.map +1 -0
- package/dist/v2/events/eventLook.d.ts +46 -0
- package/dist/v2/events/eventLook.js +35 -0
- package/dist/v2/events/eventLook.js.map +1 -0
- package/dist/v2/events/eventModel.d.ts +92 -0
- package/dist/v2/events/eventModel.js +116 -0
- package/dist/v2/events/eventModel.js.map +1 -0
- package/dist/v2/events/localChanges.d.ts +4 -0
- package/dist/v2/events/localChanges.js +23 -0
- package/dist/v2/events/localChanges.js.map +1 -0
- package/dist/v2/format.d.ts +67 -0
- package/dist/v2/format.js +112 -0
- package/dist/v2/format.js.map +1 -0
- package/dist/v2/grid/AllDayRow.d.ts +20 -0
- package/dist/v2/grid/AllDayRow.js +94 -0
- package/dist/v2/grid/AllDayRow.js.map +1 -0
- package/dist/v2/grid/EventBlock.d.ts +21 -0
- package/dist/v2/grid/EventBlock.js +112 -0
- package/dist/v2/grid/EventBlock.js.map +1 -0
- package/dist/v2/grid/GridParts.d.ts +40 -0
- package/dist/v2/grid/GridParts.js +204 -0
- package/dist/v2/grid/GridParts.js.map +1 -0
- package/dist/v2/grid/QuickCreate.d.ts +1 -0
- package/dist/v2/grid/QuickCreate.js +175 -0
- package/dist/v2/grid/QuickCreate.js.map +1 -0
- package/dist/v2/grid/TimeGrid.d.ts +1 -0
- package/dist/v2/grid/TimeGrid.js +179 -0
- package/dist/v2/grid/TimeGrid.js.map +1 -0
- package/dist/v2/grid/geometry.d.ts +72 -0
- package/dist/v2/grid/geometry.js +85 -0
- package/dist/v2/grid/geometry.js.map +1 -0
- package/dist/v2/grid/layout.d.ts +24 -0
- package/dist/v2/grid/layout.js +77 -0
- package/dist/v2/grid/layout.js.map +1 -0
- package/dist/v2/grid/useGridDrag.d.ts +42 -0
- package/dist/v2/grid/useGridDrag.js +181 -0
- package/dist/v2/grid/useGridDrag.js.map +1 -0
- package/dist/v2/grid/useSlotCursor.d.ts +32 -0
- package/dist/v2/grid/useSlotCursor.js +57 -0
- package/dist/v2/grid/useSlotCursor.js.map +1 -0
- package/dist/v2/grid/workingHours.d.ts +21 -0
- package/dist/v2/grid/workingHours.js +101 -0
- package/dist/v2/grid/workingHours.js.map +1 -0
- package/dist/v2/hooks/useAvailableHeight.d.ts +2 -0
- package/dist/v2/hooks/useAvailableHeight.js +25 -0
- package/dist/v2/hooks/useAvailableHeight.js.map +1 -0
- package/dist/v2/hooks/useCalendarShortcuts.d.ts +9 -0
- package/dist/v2/hooks/useCalendarShortcuts.js +60 -0
- package/dist/v2/hooks/useCalendarShortcuts.js.map +1 -0
- package/dist/v2/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/v2/hooks/useDebouncedValue.js +12 -0
- package/dist/v2/hooks/useDebouncedValue.js.map +1 -0
- package/dist/v2/hooks/useMediaQuery.d.ts +5 -0
- package/dist/v2/hooks/useMediaQuery.js +17 -0
- package/dist/v2/hooks/useMediaQuery.js.map +1 -0
- package/dist/v2/hooks/useNow.d.ts +2 -0
- package/dist/v2/hooks/useNow.js +31 -0
- package/dist/v2/hooks/useNow.js.map +1 -0
- package/dist/v2/limits.d.ts +6 -0
- package/dist/v2/limits.js +5 -0
- package/dist/v2/limits.js.map +1 -0
- package/dist/v2/list/EventListRow.d.ts +10 -0
- package/dist/v2/list/EventListRow.js +109 -0
- package/dist/v2/list/EventListRow.js.map +1 -0
- package/dist/v2/list/ListViewV2.d.ts +12 -0
- package/dist/v2/list/ListViewV2.js +90 -0
- package/dist/v2/list/ListViewV2.js.map +1 -0
- package/dist/v2/month/MonthView.d.ts +1 -0
- package/dist/v2/month/MonthView.js +324 -0
- package/dist/v2/month/MonthView.js.map +1 -0
- package/dist/v2/month/monthLayout.d.ts +39 -0
- package/dist/v2/month/monthLayout.js +29 -0
- package/dist/v2/month/monthLayout.js.map +1 -0
- package/dist/v2/page/CalendarChrome.d.ts +2 -0
- package/dist/v2/page/CalendarChrome.js +295 -0
- package/dist/v2/page/CalendarChrome.js.map +1 -0
- package/dist/v2/page/CalendarPageContext.d.ts +92 -0
- package/dist/v2/page/CalendarPageContext.js +11 -0
- package/dist/v2/page/CalendarPageContext.js.map +1 -0
- package/dist/v2/page/pageHelpers.d.ts +19 -0
- package/dist/v2/page/pageHelpers.js +39 -0
- package/dist/v2/page/pageHelpers.js.map +1 -0
- package/dist/v2/page/useCalendarPageModel.d.ts +2 -0
- package/dist/v2/page/useCalendarPageModel.js +198 -0
- package/dist/v2/page/useCalendarPageModel.js.map +1 -0
- package/dist/v2/page/viewState.d.ts +70 -0
- package/dist/v2/page/viewState.js +47 -0
- package/dist/v2/page/viewState.js.map +1 -0
- package/dist/v2/peek/EventPeek.d.ts +2 -0
- package/dist/v2/peek/EventPeek.js +92 -0
- package/dist/v2/peek/EventPeek.js.map +1 -0
- package/dist/v2/peek/PeekEvent.d.ts +4 -0
- package/dist/v2/peek/PeekEvent.js +443 -0
- package/dist/v2/peek/PeekEvent.js.map +1 -0
- package/dist/v2/peek/PeekParts.d.ts +14 -0
- package/dist/v2/peek/PeekParts.js +75 -0
- package/dist/v2/peek/PeekParts.js.map +1 -0
- package/dist/v2/prefs/calendarPrefs.d.ts +2 -2
- package/dist/v2/prefs/calendarPrefs.js +35 -34
- package/dist/v2/prefs/calendarPrefs.js.map +1 -1
- package/dist/v2/rail/CalendarRail.d.ts +3 -0
- package/dist/v2/rail/CalendarRail.js +284 -0
- package/dist/v2/rail/CalendarRail.js.map +1 -0
- package/dist/v2/rail/railStatus.d.ts +54 -0
- package/dist/v2/rail/railStatus.js +84 -0
- package/dist/v2/rail/railStatus.js.map +1 -0
- package/dist/v2/rail/syncWords.d.ts +10 -0
- package/dist/v2/rail/syncWords.js +75 -0
- package/dist/v2/rail/syncWords.js.map +1 -0
- package/dist/v2/rail/useMonthEventDates.d.ts +4 -0
- package/dist/v2/rail/useMonthEventDates.js +30 -0
- package/dist/v2/rail/useMonthEventDates.js.map +1 -0
- package/dist/v2/routes.js +4 -1
- package/dist/v2/routes.js.map +1 -1
- package/dist/v2/search/SearchResults.d.ts +1 -0
- package/dist/v2/search/SearchResults.js +88 -0
- package/dist/v2/search/SearchResults.js.map +1 -0
- package/dist/v2/search/searchModel.d.ts +20 -0
- package/dist/v2/search/searchModel.js +22 -0
- package/dist/v2/search/searchModel.js.map +1 -0
- package/dist/v2/state/calendarV2Store.d.ts +4 -1
- package/dist/v2/state/calendarV2Store.js +3 -1
- package/dist/v2/state/calendarV2Store.js.map +1 -1
- package/dist/v2/state/useCalendarV2Navigation.d.ts +1 -0
- package/dist/v2/state/useCalendarV2Navigation.js +4 -1
- package/dist/v2/state/useCalendarV2Navigation.js.map +1 -1
- package/dist/v2/states/CalendarStates.d.ts +18 -0
- package/dist/v2/states/CalendarStates.js +122 -0
- package/dist/v2/states/CalendarStates.js.map +1 -0
- package/dist/v2/styles.d.ts +32 -0
- package/dist/v2/styles.js +10 -0
- package/dist/v2/styles.js.map +1 -0
- package/dist/v2/time/calendarTime.js +121 -35
- package/dist/v2/time/calendarTime.js.map +1 -1
- package/dist/v2/types.d.ts +22 -2
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { eventsOnDay as e } from "../events/eventModel.js";
|
|
2
|
+
import { formatDay as t } from "../format.js";
|
|
3
|
+
import { useCalendarPage as n } from "../page/CalendarPageContext.js";
|
|
4
|
+
import { VIEW_PANEL as r } from "../styles.js";
|
|
5
|
+
import { EventListRow as i } from "./EventListRow.js";
|
|
6
|
+
import { Plus as a } from "lucide-react";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
import { Button as c, EmptyState as l, addDays as u } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
import { cn as d } from "@burdenoff/fe-libs/utils";
|
|
10
|
+
// src/v2/list/ListViewV2.tsx
|
|
11
|
+
function f({ date: e }) {
|
|
12
|
+
let { tr: r, format: i, today: a } = n(), c = e === a, l = c ? r("calendar.v2.today", "Today") : e === u(a, 1) ? r("calendar.v2.tomorrow", "Tomorrow") : e === u(a, -1) ? r("calendar.v2.yesterday", "Yesterday") : null;
|
|
13
|
+
return /* @__PURE__ */ s("div", {
|
|
14
|
+
className: "flex w-[92px] shrink-0 flex-wrap content-start items-baseline gap-x-1.5 pt-2.5 max-md:w-auto max-md:pt-2",
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ o("span", {
|
|
17
|
+
className: d("text-2xl font-semibold tabular-nums max-md:text-lg", c ? "text-action-primary-bg" : "text-text-primary"),
|
|
18
|
+
children: t(e, i, "dayNumber")
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ o("span", {
|
|
21
|
+
className: d("text-xs font-semibold uppercase", c ? "text-action-primary-bg" : "text-text-secondary"),
|
|
22
|
+
children: t(e, i, "weekday")
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ s("span", {
|
|
25
|
+
className: d("w-full text-xs text-text-muted max-md:w-auto", c && "font-semibold text-action-primary-bg"),
|
|
26
|
+
children: [t(e, i, "monthShort"), l ? ` · ${l}` : ""]
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function p({ groups: e, label: r }) {
|
|
32
|
+
let { format: a, today: c } = n();
|
|
33
|
+
return /* @__PURE__ */ o("ul", {
|
|
34
|
+
className: "min-h-0 flex-1 overflow-y-auto",
|
|
35
|
+
"aria-label": r,
|
|
36
|
+
children: e.map((e) => /* @__PURE__ */ s("li", {
|
|
37
|
+
"aria-label": t(e.date, a, "full"),
|
|
38
|
+
className: d("flex gap-4 border-b border-border-default px-4 py-2 last:border-b-0 max-md:flex-col max-md:gap-0 max-md:px-3", e.date < c && "opacity-80"),
|
|
39
|
+
children: [/* @__PURE__ */ o(f, { date: e.date }), /* @__PURE__ */ o("div", {
|
|
40
|
+
className: "min-w-0 flex-1",
|
|
41
|
+
children: e.events.map((t) => /* @__PURE__ */ o(i, {
|
|
42
|
+
event: t,
|
|
43
|
+
day: e.date
|
|
44
|
+
}, t.id))
|
|
45
|
+
})]
|
|
46
|
+
}, e.date))
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function m() {
|
|
50
|
+
let t = n(), { tr: i, timeZone: u, days: d, events: f } = t, m = d.map((t) => ({
|
|
51
|
+
date: t,
|
|
52
|
+
events: e(f, t, u)
|
|
53
|
+
})).filter((e) => e.events.length > 0), h = t.state.kind === "ready" && t.state.empty;
|
|
54
|
+
return /* @__PURE__ */ o("section", {
|
|
55
|
+
className: r,
|
|
56
|
+
"aria-label": i("calendar.v2.listLabel", "List"),
|
|
57
|
+
children: m.length > 0 ? /* @__PURE__ */ o(p, {
|
|
58
|
+
groups: m,
|
|
59
|
+
label: i("calendar.v2.listLabel", "List")
|
|
60
|
+
}) : h ? /* @__PURE__ */ o("div", {
|
|
61
|
+
className: "grid flex-1 place-items-center p-6",
|
|
62
|
+
children: /* @__PURE__ */ o(l, {
|
|
63
|
+
size: "panel",
|
|
64
|
+
kind: "first-use",
|
|
65
|
+
illustration: "calendar",
|
|
66
|
+
title: i("calendar.v2.emptyList", "Nothing in these two weeks"),
|
|
67
|
+
description: i("calendar.v2.emptyListBody", "New events and invitations show here, grouped by day."),
|
|
68
|
+
action: /* @__PURE__ */ s(c, {
|
|
69
|
+
type: "button",
|
|
70
|
+
onClick: () => {
|
|
71
|
+
let e = t.days.includes(t.today) ? t.today : t.days[0] ?? t.today, n = t.workingHoursOn(e)?.start ?? 540;
|
|
72
|
+
t.openEventDialog({
|
|
73
|
+
date: e,
|
|
74
|
+
start: n,
|
|
75
|
+
end: n + t.prefs.defaultDuration,
|
|
76
|
+
allDay: !1
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
children: [/* @__PURE__ */ o(a, { "aria-hidden": "true" }), i("calendar.v2.newEvent", "New event")]
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
}) : t.state.kind === "ready" ? /* @__PURE__ */ o("p", {
|
|
83
|
+
className: "grid flex-1 place-items-center p-6 text-center text-sm text-text-secondary",
|
|
84
|
+
children: i("calendar.v2.partialNothing", "Nothing to show from the calendars that loaded.")
|
|
85
|
+
}) : null
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export { p as DayGroups, m as ListViewV2 };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=ListViewV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListViewV2.js","names":["DayHeading","useCalendarPage","isToday","date","today","relative","tr","addDays","cn","formatDay","format","DayGroups","label","groups","group","EventListRow","event","ListViewV2","page","days","eventsOnDay","events","timeZone","showEmpty","VIEW_PANEL","EmptyState","Button","day","start","Plus"],"sources":["../../../src/v2/list/ListViewV2.tsx"],"sourcesContent":["/**\n * The List view (BOFF-15698 A1): two weeks from its day, grouped by day, with Join on today's\n * calls and what waits on the person (invitations, maybes, rooms waiting). Days with nothing\n * on them are left out; two weeks with nothing say so.\n */\nimport { Plus } from 'lucide-react';\nimport { addDays, Button, EmptyState, type DateValue } from '@burdenoff/fe-libs/ui';\nimport { cn } from '@burdenoff/fe-libs/utils';\nimport { eventsOnDay } from '../events/eventModel';\nimport { formatDay } from '../format';\nimport { useCalendarPage } from '../page/CalendarPageContext';\nimport { VIEW_PANEL } from '../styles';\nimport type { CalendarEventV2 } from '../types';\nimport { EventListRow } from './EventListRow';\n\nexport interface DayGroup {\n date: DateValue;\n events: CalendarEventV2[];\n}\n\n/** A day's heading in a list: the date large, its weekday, the month and \"Today\". */\nfunction DayHeading({ date }: { date: DateValue }) {\n const { tr, format, today } = useCalendarPage();\n const isToday = date === today;\n const relative = isToday\n ? tr('calendar.v2.today', 'Today')\n : date === addDays(today, 1)\n ? tr('calendar.v2.tomorrow', 'Tomorrow')\n : date === addDays(today, -1)\n ? tr('calendar.v2.yesterday', 'Yesterday')\n : null;\n return (\n <div className=\"flex w-[92px] shrink-0 flex-wrap content-start items-baseline gap-x-1.5 pt-2.5 max-md:w-auto max-md:pt-2\">\n <span\n className={cn(\n 'text-2xl font-semibold tabular-nums max-md:text-lg',\n isToday ? 'text-action-primary-bg' : 'text-text-primary'\n )}\n >\n {formatDay(date, format, 'dayNumber')}\n </span>\n <span\n className={cn(\n 'text-xs font-semibold uppercase',\n isToday ? 'text-action-primary-bg' : 'text-text-secondary'\n )}\n >\n {formatDay(date, format, 'weekday')}\n </span>\n <span\n className={cn(\n 'w-full text-xs text-text-muted max-md:w-auto',\n isToday && 'font-semibold text-action-primary-bg'\n )}\n >\n {formatDay(date, format, 'monthShort')}\n {relative ? ` · ${relative}` : ''}\n </span>\n </div>\n );\n}\n\n/** Days and their events, each day's heading on the left (above on phones). */\nexport function DayGroups({ groups, label }: { groups: readonly DayGroup[]; label: string }) {\n const { format, today } = useCalendarPage();\n return (\n <ul className=\"min-h-0 flex-1 overflow-y-auto\" aria-label={label}>\n {groups.map((group) => (\n <li\n key={group.date}\n aria-label={formatDay(group.date, format, 'full')}\n className={cn(\n 'flex gap-4 border-b border-border-default px-4 py-2 last:border-b-0 max-md:flex-col max-md:gap-0 max-md:px-3',\n group.date < today && 'opacity-80'\n )}\n >\n <DayHeading date={group.date} />\n <div className=\"min-w-0 flex-1\">\n {group.events.map((event) => (\n <EventListRow key={event.id} event={event} day={group.date} />\n ))}\n </div>\n </li>\n ))}\n </ul>\n );\n}\n\nexport function ListViewV2() {\n const page = useCalendarPage();\n const { tr, timeZone, days, events } = page;\n const groups = days\n .map((date) => ({ date, events: eventsOnDay(events, date, timeZone) }))\n .filter((group) => group.events.length > 0);\n const showEmpty = page.state.kind === 'ready' && page.state.empty;\n\n return (\n <section className={VIEW_PANEL} aria-label={tr('calendar.v2.listLabel', 'List')}>\n {groups.length > 0 ? (\n <DayGroups groups={groups} label={tr('calendar.v2.listLabel', 'List')} />\n ) : showEmpty ? (\n <div className=\"grid flex-1 place-items-center p-6\">\n <EmptyState\n size=\"panel\"\n kind=\"first-use\"\n illustration=\"calendar\"\n title={tr('calendar.v2.emptyList', 'Nothing in these two weeks')}\n description={tr(\n 'calendar.v2.emptyListBody',\n 'New events and invitations show here, grouped by day.'\n )}\n action={\n <Button\n type=\"button\"\n onClick={() => {\n const day = page.days.includes(page.today)\n ? page.today\n : (page.days[0] ?? page.today);\n const start = page.workingHoursOn(day)?.start ?? 9 * 60;\n page.openEventDialog({\n date: day,\n start,\n end: start + page.prefs.defaultDuration,\n allDay: false,\n });\n }}\n >\n <Plus aria-hidden=\"true\" />\n {tr('calendar.v2.newEvent', 'New event')}\n </Button>\n }\n />\n </div>\n ) : page.state.kind === 'ready' ? (\n <p className=\"grid flex-1 place-items-center p-6 text-center text-sm text-text-secondary\">\n {tr('calendar.v2.partialNothing', 'Nothing to show from the calendars that loaded.')}\n </p>\n ) : null}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;AAqBA,SAASA,EAAW,EAAE,WAA6B;CACjD,IAAM,EAAE,OAAI,WAAQ,aAAUC,EAAgB,GACxCC,IAAUC,MAASC,GACnBC,IAAWH,IACbI,EAAG,qBAAqB,OAAO,IAC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AQC,EAAYC,GAAQlB,GAAMmB,CAAQ;CAAE,EAAE,CAAC,CACtE,QAAQ,MAAUR,EAAM,OAAO,SAAS,CAAC,GACtCS,IAAYL,EAAK,MAAM,SAAS,WAAWA,EAAK,MAAM;CAE5D,OACE,kBAAC,WAAD;EAAS,WAAWM;EAAY,cAAYlB,EAAG,yBAAyB,MAAM;EAC3E,UAAAO,EAAO,SAAS,IACf,kBAACF,GAAD;GAAmB;GAAQ,OAAOL,EAAG,yBAAyB,MAAM;EAAI,CAAA,IACtEiB,IACF,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACE,GAAD;IACE,MAAK;IACL,MAAK;IACL,cAAa;IACb,OAAOnB,EAAG,yBAAyB,4BAA4B;IAC/D,aAAaA,EACX,6BACA,uDACF;IACA,QACE,kBAACoB,GAAD;KACE,MAAK;KACL,eAAe;MACb,IAAMC,IAAMT,EAAK,KAAK,SAASA,EAAK,KAAK,IACrCA,EAAK,QACJA,EAAK,KAAK,MAAMA,EAAK,OACpBU,IAAQV,EAAK,eAAeS,CAAG,CAAC,EAAE,SAAS;MACjD,EAAK,gBAAgB;OACnB,MAAMA;OACN;OACA,KAAKC,IAAQV,EAAK,MAAM;OACxB,QAAQ;MACV,CAAC;KACH;KAbF,UAAA,CAeE,kBAACW,GAAD,EAAM,eAAY,OAAQ,CAAA,GACzBvB,EAAG,wBAAwB,WAAW,CACjC;;GAEX,CAAA;EACE,CAAA,IACHY,EAAK,MAAM,SAAS,UACtB,kBAAC,KAAD;GAAG,WAAU;GACV,UAAAZ,EAAG,8BAA8B,iDAAiD;EAClF,CAAA,IACD;CACG,CAAA;AAEb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MonthView(): import('react').JSX.Element;
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { calendarHueStyle as e } from "../colors.js";
|
|
2
|
+
import { allDayItems as t, eventsOnDay as n, isAllDayRow as r } from "../events/eventModel.js";
|
|
3
|
+
import { formatDay as i, formatInstantTime as a } from "../format.js";
|
|
4
|
+
import { EventListRow as o } from "../list/EventListRow.js";
|
|
5
|
+
import { useCalendarPage as s } from "../page/CalendarPageContext.js";
|
|
6
|
+
import { eventDays as c, instantToZoned as l, isWeekendDay as u } from "../time/calendarTime.js";
|
|
7
|
+
import { EVENT_BORDER as d, EVENT_FILL as f, FOCUS_RING as p, ICON_BUTTON as m, VIEW_PANEL as h } from "../styles.js";
|
|
8
|
+
import { fitMonthWeek as g, monthLinesFor as _, weekRows as v } from "./monthLayout.js";
|
|
9
|
+
import { useEffect as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
10
|
+
import { Plus as C, X as w } from "lucide-react";
|
|
11
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
12
|
+
import { Button as D, Popover as O, PopoverContent as k, PopoverTrigger as A, monthOf as j } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { cn as M } from "@burdenoff/fe-libs/utils";
|
|
14
|
+
// src/v2/month/MonthView.tsx
|
|
15
|
+
var N = (e) => e.id;
|
|
16
|
+
function P(e) {
|
|
17
|
+
let t = x(null), [n, r] = S(0);
|
|
18
|
+
return y(() => {
|
|
19
|
+
let n = t.current;
|
|
20
|
+
if (!n) return;
|
|
21
|
+
let i = () => r(n.clientHeight / Math.max(1, e));
|
|
22
|
+
if (i(), typeof ResizeObserver != "function") return;
|
|
23
|
+
let a = new ResizeObserver(i);
|
|
24
|
+
return a.observe(n), () => a.disconnect();
|
|
25
|
+
}, [e]), {
|
|
26
|
+
ref: t,
|
|
27
|
+
height: n
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function F() {
|
|
31
|
+
return s().compact ? /* @__PURE__ */ T(V, {}) : /* @__PURE__ */ T(L, {});
|
|
32
|
+
}
|
|
33
|
+
function I({ week: e, short: t }) {
|
|
34
|
+
let { format: n } = s();
|
|
35
|
+
return /* @__PURE__ */ T("div", {
|
|
36
|
+
className: "grid grid-cols-7 border-b border-border-default",
|
|
37
|
+
children: e.map((e) => /* @__PURE__ */ T("div", {
|
|
38
|
+
className: M("px-2 py-2 text-[11px] font-semibold uppercase tracking-[0.06em] text-text-secondary", t && "text-center", u(e) && "text-text-muted"),
|
|
39
|
+
children: i(e, n, "weekday")
|
|
40
|
+
}, e))
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function L() {
|
|
44
|
+
let n = s(), { format: a, timeZone: o, events: l, nav: u } = n, m = b(() => v(n.days), [n.days]), y = j(u.date), { ref: x, height: S } = P(m.length), C = _(S), w = b(() => m.map((e) => {
|
|
45
|
+
let n = e[0] ?? u.date, i = e[e.length - 1] ?? u.date, a = /* @__PURE__ */ new Map();
|
|
46
|
+
for (let t of l) {
|
|
47
|
+
if (r(t)) continue;
|
|
48
|
+
let n = c(t, o);
|
|
49
|
+
for (let r of e) {
|
|
50
|
+
if (r < n.start || r > n.end) continue;
|
|
51
|
+
let e = a.get(r);
|
|
52
|
+
e ? e.push(t) : a.set(r, [t]);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
for (let e of a.values()) e.sort((e, t) => e.start.getTime() - t.start.getTime());
|
|
56
|
+
return g(e, t(l, n, i, o), a, C, N);
|
|
57
|
+
}), [
|
|
58
|
+
l,
|
|
59
|
+
C,
|
|
60
|
+
u.date,
|
|
61
|
+
o,
|
|
62
|
+
m
|
|
63
|
+
]), D = (e, t) => {
|
|
64
|
+
let r = n.workingHoursOn(e)?.start ?? 540;
|
|
65
|
+
n.closePeek(), n.openQuickCreate({
|
|
66
|
+
date: e,
|
|
67
|
+
start: r,
|
|
68
|
+
end: r + n.prefs.defaultDuration,
|
|
69
|
+
allDay: !1,
|
|
70
|
+
anchor: t
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ E("section", {
|
|
74
|
+
className: h,
|
|
75
|
+
"aria-label": i(`${y}-01`, a, "monthYear"),
|
|
76
|
+
children: [/* @__PURE__ */ T(I, { week: m[0] ?? [] }), /* @__PURE__ */ T("div", {
|
|
77
|
+
ref: x,
|
|
78
|
+
className: "grid min-h-0 flex-1",
|
|
79
|
+
style: { gridTemplateRows: `repeat(${m.length}, minmax(0, 1fr))` },
|
|
80
|
+
children: m.map((t, r) => {
|
|
81
|
+
let i = w[r];
|
|
82
|
+
return i ? /* @__PURE__ */ E("div", {
|
|
83
|
+
className: "relative grid grid-cols-7 border-b border-border-subtle last:border-b-0",
|
|
84
|
+
children: [i.cells.map((e) => /* @__PURE__ */ T(R, {
|
|
85
|
+
cell: e,
|
|
86
|
+
month: y,
|
|
87
|
+
laneCount: i.laneCount,
|
|
88
|
+
onAdd: D
|
|
89
|
+
}, e.date)), i.bars.map((t) => {
|
|
90
|
+
let r = n.lookOf(t.event), i = {
|
|
91
|
+
...e(n.hueOf(t.event.calendarId)),
|
|
92
|
+
top: 26 + t.lane * 18,
|
|
93
|
+
height: 16,
|
|
94
|
+
insetInlineStart: `calc(${t.firstIndex / 7 * 100}% + 3px)`,
|
|
95
|
+
width: `calc(${(t.lastIndex - t.firstIndex + 1) / 7 * 100}% - 6px)`
|
|
96
|
+
};
|
|
97
|
+
return /* @__PURE__ */ T("button", {
|
|
98
|
+
type: "button",
|
|
99
|
+
"data-event-id": t.event.id,
|
|
100
|
+
"aria-label": n.labelOf(t.event),
|
|
101
|
+
"aria-haspopup": "dialog",
|
|
102
|
+
style: i,
|
|
103
|
+
onClick: (e) => n.openPeek(t.event, e.currentTarget),
|
|
104
|
+
className: M("absolute z-[1] flex min-w-0 items-center rounded px-1.5 text-start text-[11px] font-semibold", d, f, p, r.faded && "opacity-60", t.continuesBefore && "rounded-s-none", t.continuesAfter && "rounded-e-none", u.eventId === t.event.id && "outline-2 outline-offset-1 outline-[var(--color-focus-ring)]"),
|
|
105
|
+
children: /* @__PURE__ */ T("span", {
|
|
106
|
+
className: "truncate",
|
|
107
|
+
children: r.title
|
|
108
|
+
})
|
|
109
|
+
}, t.event.id);
|
|
110
|
+
})]
|
|
111
|
+
}, t[0]) : null;
|
|
112
|
+
})
|
|
113
|
+
})]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function R({ cell: e, month: t, laneCount: n, onAdd: r }) {
|
|
117
|
+
let { tr: a, format: o, today: c, nav: l } = s(), d = j(e.date) !== t, f = e.date === c, m = e.date.endsWith("-01") ? `${i(e.date, o, "dayNumber")} ${i(e.date, o, "monthShort")}` : i(e.date, o, "dayNumber"), h = i(e.date, o, "full");
|
|
118
|
+
return /* @__PURE__ */ E("div", {
|
|
119
|
+
"data-month-day": e.date,
|
|
120
|
+
className: M("relative min-w-0 overflow-hidden border-s border-border-subtle first:border-s-0", d && "bg-bg-sunken/50", u(e.date) && !d && "bg-bg-sunken/25"),
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ T("button", {
|
|
123
|
+
type: "button",
|
|
124
|
+
tabIndex: -1,
|
|
125
|
+
"aria-label": a("calendar.v2.addOnDay", "Add an event on {{day}}", { day: h }),
|
|
126
|
+
onClick: (t) => r(e.date, t.currentTarget),
|
|
127
|
+
className: "absolute inset-0 z-0 cursor-default focus-visible:outline-none"
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ T("button", {
|
|
130
|
+
type: "button",
|
|
131
|
+
onClick: () => l.goTo({
|
|
132
|
+
view: "day",
|
|
133
|
+
date: e.date
|
|
134
|
+
}),
|
|
135
|
+
"aria-current": f ? "date" : void 0,
|
|
136
|
+
"aria-label": a("calendar.v2.openDay", "{{day}}. Open the day", { day: h }),
|
|
137
|
+
className: M("relative z-[1] ms-1 mt-1 inline-grid h-5 min-w-5 place-items-center rounded-full px-1 text-xs font-semibold tabular-nums hover:bg-bg-sunken", p, f ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg" : d ? "text-text-muted" : "text-text-primary"),
|
|
138
|
+
children: m
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ E("div", {
|
|
141
|
+
className: "pointer-events-none relative z-[1] flex flex-col *:pointer-events-auto",
|
|
142
|
+
style: { marginTop: n * 18 },
|
|
143
|
+
children: [e.shown.map((t) => /* @__PURE__ */ T(z, {
|
|
144
|
+
event: t,
|
|
145
|
+
day: e.date
|
|
146
|
+
}, t.id)), e.more > 0 ? /* @__PURE__ */ T(B, {
|
|
147
|
+
date: e.date,
|
|
148
|
+
count: e.more
|
|
149
|
+
}) : null]
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function z({ event: t, day: n }) {
|
|
155
|
+
let r = s(), i = r.lookOf(t), o = l(t.start, r.timeZone).date < n;
|
|
156
|
+
return /* @__PURE__ */ E("button", {
|
|
157
|
+
type: "button",
|
|
158
|
+
"data-event-id": t.id,
|
|
159
|
+
"aria-label": r.labelOf(t),
|
|
160
|
+
"aria-haspopup": "dialog",
|
|
161
|
+
style: {
|
|
162
|
+
...e(r.hueOf(t.calendarId)),
|
|
163
|
+
height: 18
|
|
164
|
+
},
|
|
165
|
+
onClick: (e) => r.openPeek(t, e.currentTarget),
|
|
166
|
+
className: M("mx-1 flex min-w-0 items-center gap-1 rounded px-1 text-start text-[11px] leading-none hover:bg-bg-sunken", p, i.faded && "opacity-60", r.nav.eventId === t.id && "outline-2 outline-offset-1 outline-[var(--color-focus-ring)]"),
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ T("i", {
|
|
169
|
+
"aria-hidden": "true",
|
|
170
|
+
className: M("size-[7px] shrink-0 rounded-full", i.invitation ? "border border-[var(--cal-hue)]" : i.busyOnly ? "bg-border-strong" : "bg-[var(--cal-hue)]")
|
|
171
|
+
}),
|
|
172
|
+
/* @__PURE__ */ T("time", {
|
|
173
|
+
className: "shrink-0 tabular-nums text-text-secondary",
|
|
174
|
+
children: o ? `– ${a(t.end, r.timeZone, r.format)}` : a(t.start, r.timeZone, r.format)
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ T("span", {
|
|
177
|
+
className: M("min-w-0 truncate text-text-primary", i.declined && "line-through"),
|
|
178
|
+
children: i.title
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
function B({ date: e, count: t }) {
|
|
184
|
+
let r = s(), { tr: a, format: c, today: l, nav: u } = r, [d, f] = S(!1), h = n(r.events, e, r.timeZone);
|
|
185
|
+
return /* @__PURE__ */ E(O, {
|
|
186
|
+
open: d,
|
|
187
|
+
onOpenChange: f,
|
|
188
|
+
children: [/* @__PURE__ */ T(A, {
|
|
189
|
+
asChild: !0,
|
|
190
|
+
children: /* @__PURE__ */ T("button", {
|
|
191
|
+
type: "button",
|
|
192
|
+
className: M("mx-1 rounded px-1 text-start text-[11px] leading-[18px] font-semibold text-text-link hover:underline", p),
|
|
193
|
+
children: a("calendar.v2.moreCount", "+{{count}} more", { count: t })
|
|
194
|
+
})
|
|
195
|
+
}), /* @__PURE__ */ E(k, {
|
|
196
|
+
align: "start",
|
|
197
|
+
className: "flex max-h-[min(480px,70vh)] w-[360px] flex-col p-0",
|
|
198
|
+
children: [/* @__PURE__ */ E("div", {
|
|
199
|
+
className: "flex items-start gap-2 border-b border-border-subtle p-3",
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ E("div", {
|
|
202
|
+
className: "min-w-0 flex-1",
|
|
203
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
204
|
+
className: "text-base font-bold text-text-primary",
|
|
205
|
+
children: i(e, c, "long")
|
|
206
|
+
}), /* @__PURE__ */ T("p", {
|
|
207
|
+
className: "text-xs text-text-secondary",
|
|
208
|
+
children: e === l ? a("calendar.v2.today", "Today") : i(e, c, "date")
|
|
209
|
+
})]
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ T(D, {
|
|
212
|
+
type: "button",
|
|
213
|
+
variant: "ghost",
|
|
214
|
+
size: "sm",
|
|
215
|
+
onClick: () => u.goTo({
|
|
216
|
+
view: "day",
|
|
217
|
+
date: e
|
|
218
|
+
}),
|
|
219
|
+
children: a("calendar.v2.openDayShort", "Open day")
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ T("button", {
|
|
222
|
+
type: "button",
|
|
223
|
+
className: m,
|
|
224
|
+
"aria-label": a("calendar.v2.close", "Close"),
|
|
225
|
+
onClick: () => f(!1),
|
|
226
|
+
children: /* @__PURE__ */ T(w, { "aria-hidden": "true" })
|
|
227
|
+
})
|
|
228
|
+
]
|
|
229
|
+
}), /* @__PURE__ */ T("div", {
|
|
230
|
+
className: "min-h-0 overflow-y-auto px-3",
|
|
231
|
+
children: h.map((t) => /* @__PURE__ */ T(o, {
|
|
232
|
+
event: t,
|
|
233
|
+
day: e,
|
|
234
|
+
dense: !0
|
|
235
|
+
}, t.id))
|
|
236
|
+
})]
|
|
237
|
+
})]
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function V() {
|
|
241
|
+
let t = s(), { tr: r, format: a, timeZone: c, events: l, today: u, nav: d } = t, f = b(() => v(t.days), [t.days]), m = j(d.date), [g, _] = S(null), y = g && t.days.includes(g) ? g : t.days.includes(u) && j(u) === m ? u : `${m}-01`, x = n(l, y, c);
|
|
242
|
+
return /* @__PURE__ */ E("div", {
|
|
243
|
+
className: "flex min-h-0 flex-1 flex-col gap-2.5",
|
|
244
|
+
children: [/* @__PURE__ */ E("section", {
|
|
245
|
+
className: M(h, "flex-none"),
|
|
246
|
+
"aria-label": i(`${m}-01`, a, "monthYear"),
|
|
247
|
+
children: [/* @__PURE__ */ T(I, {
|
|
248
|
+
week: f[0] ?? [],
|
|
249
|
+
short: !0
|
|
250
|
+
}), /* @__PURE__ */ T("div", {
|
|
251
|
+
className: "grid",
|
|
252
|
+
children: f.map((o) => /* @__PURE__ */ T("div", {
|
|
253
|
+
className: "grid grid-cols-7 border-b border-border-subtle last:border-b-0",
|
|
254
|
+
children: o.map((o) => {
|
|
255
|
+
let s = n(l, o, c), d = j(o) !== m;
|
|
256
|
+
return /* @__PURE__ */ E("button", {
|
|
257
|
+
type: "button",
|
|
258
|
+
"aria-pressed": y === o,
|
|
259
|
+
"aria-current": o === u ? "date" : void 0,
|
|
260
|
+
"aria-label": r("calendar.v2.dayEvents", "{{day}}: {{count}} events", {
|
|
261
|
+
day: i(o, a, "full"),
|
|
262
|
+
count: s.length
|
|
263
|
+
}),
|
|
264
|
+
onClick: () => _(o),
|
|
265
|
+
className: M("flex h-12 min-w-0 flex-col items-center justify-center gap-1 border-s border-border-subtle first:border-s-0", p, d && "bg-bg-sunken/50", y === o && "bg-accent-soft"),
|
|
266
|
+
children: [/* @__PURE__ */ T("span", {
|
|
267
|
+
className: M("grid h-6 min-w-6 place-items-center rounded-full text-sm font-semibold tabular-nums", o === u ? "bg-action-primary-bg text-action-primary-text" : d ? "text-text-muted" : "text-text-primary"),
|
|
268
|
+
children: i(o, a, "dayNumber")
|
|
269
|
+
}), /* @__PURE__ */ T("span", {
|
|
270
|
+
className: "flex h-1.5 gap-0.5",
|
|
271
|
+
"aria-hidden": "true",
|
|
272
|
+
children: s.slice(0, 3).map((n) => /* @__PURE__ */ T("i", {
|
|
273
|
+
className: "size-1.5 rounded-full bg-[var(--cal-hue)]",
|
|
274
|
+
style: e(t.hueOf(n.calendarId))
|
|
275
|
+
}, n.id))
|
|
276
|
+
})]
|
|
277
|
+
}, o);
|
|
278
|
+
})
|
|
279
|
+
}, o[0]))
|
|
280
|
+
})]
|
|
281
|
+
}), /* @__PURE__ */ E("section", {
|
|
282
|
+
className: M(h, "px-3"),
|
|
283
|
+
"aria-label": i(y, a, "full"),
|
|
284
|
+
children: [/* @__PURE__ */ E("div", {
|
|
285
|
+
className: "flex items-center gap-2 border-b border-border-subtle py-2.5",
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ T("b", {
|
|
288
|
+
className: "text-sm text-text-primary",
|
|
289
|
+
children: i(y, a, "long")
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ T("span", { className: "flex-1" }),
|
|
292
|
+
/* @__PURE__ */ E(D, {
|
|
293
|
+
type: "button",
|
|
294
|
+
variant: "outline",
|
|
295
|
+
size: "sm",
|
|
296
|
+
onClick: () => {
|
|
297
|
+
let e = t.workingHoursOn(y)?.start ?? 540;
|
|
298
|
+
t.openEventDialog({
|
|
299
|
+
date: y,
|
|
300
|
+
start: e,
|
|
301
|
+
end: e + t.prefs.defaultDuration,
|
|
302
|
+
allDay: !1
|
|
303
|
+
});
|
|
304
|
+
},
|
|
305
|
+
children: [/* @__PURE__ */ T(C, { "aria-hidden": "true" }), r("calendar.v2.add", "Add")]
|
|
306
|
+
})
|
|
307
|
+
]
|
|
308
|
+
}), /* @__PURE__ */ T("div", {
|
|
309
|
+
className: "min-h-0 overflow-y-auto",
|
|
310
|
+
children: x.length > 0 ? x.map((e) => /* @__PURE__ */ T(o, {
|
|
311
|
+
event: e,
|
|
312
|
+
day: y,
|
|
313
|
+
dense: !0
|
|
314
|
+
}, e.id)) : /* @__PURE__ */ T("p", {
|
|
315
|
+
className: "py-3 text-sm text-text-secondary",
|
|
316
|
+
children: t.state.kind === "ready" && t.state.failedCalendarIds.length > 0 ? r("calendar.v2.partialNothing", "Nothing to show from the calendars that loaded.") : r("calendar.v2.nothingThisDay", "Nothing on this day.")
|
|
317
|
+
})
|
|
318
|
+
})]
|
|
319
|
+
})]
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
export { F as MonthView };
|
|
323
|
+
|
|
324
|
+
//# sourceMappingURL=MonthView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonthView.js","names":["eventKey","event","useRowHeight","ref","useRef","height","setHeight","useState","useEffect","element","update","rows","observer","MonthView","useCalendarPage","PhoneMonth","WideMonth","WeekdayHeader","week","cn","short","isWeekendDay","day","formatDay","format","page","weeks","useMemo","weekRows","month","monthOf","nav","lines","monthLinesFor","fitted","first","last","timedByDay","events","isAllDayRow","span","eventDays","timeZone","list","a","b","fitMonthWeek","allDayItems","startAt","start","VIEW_PANEL","fit","weekIndex","MonthCell","cell","look","bar","style","calendarHueStyle","clickEvent","EVENT_BORDER","EVENT_FILL","FOCUS_RING","outside","isToday","today","dayLabel","dayName","tr","onAdd","laneCount","MonthEventLine","DayMore","startedBefore","instantToZoned","formatInstantTime","open","setOpen","eventsOnDay","date","Popover","PopoverTrigger","PopoverContent","Button","ICON_BUTTON","X","EventListRow","picked","setPicked","selected","dayEvents","on","Plus"],"sources":["../../../src/v2/month/MonthView.tsx"],"sourcesContent":["/**\n * The Month view (BOFF-15698 A1). On wide screens the week rows fill the height; each day shows\n * what fits (at most three lines: many-day bars, then timed events), then \"+N more\", which opens\n * the whole day. A click on a day's free space starts an event there. Phones show dots and, under\n * the month, the picked day's events.\n */\nimport { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';\nimport { Plus, X } from 'lucide-react';\nimport {\n Button,\n monthOf,\n Popover,\n PopoverContent,\n PopoverTrigger,\n type DateValue,\n type MonthValue,\n} from '@burdenoff/fe-libs/ui';\nimport { cn } from '@burdenoff/fe-libs/utils';\nimport { calendarHueStyle } from '../colors';\nimport { allDayItems, eventsOnDay, isAllDayRow } from '../events/eventModel';\nimport { formatDay, formatInstantTime } from '../format';\nimport { EventListRow } from '../list/EventListRow';\nimport { useCalendarPage } from '../page/CalendarPageContext';\nimport { eventDays, instantToZoned, isWeekendDay } from '../time/calendarTime';\nimport {\n EVENT_BORDER,\n EVENT_FILL,\n EVENT_SELECTED,\n FOCUS_RING,\n ICON_BUTTON,\n VIEW_PANEL,\n} from '../styles';\nimport type { CalendarEventV2 } from '../types';\nimport {\n fitMonthWeek,\n monthLinesFor,\n MONTH_DAY_HEADER_PX,\n MONTH_LINE_PX,\n weekRows,\n type MonthCellFit,\n} from './monthLayout';\n\nconst eventKey = (event: CalendarEventV2) => event.id;\n\nfunction useRowHeight(rows: number) {\n const ref = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState(0);\n useEffect(() => {\n const element = ref.current;\n if (!element) return undefined;\n const update = () => setHeight(element.clientHeight / Math.max(1, rows));\n update();\n if (typeof ResizeObserver !== 'function') return undefined;\n const observer = new ResizeObserver(update);\n observer.observe(element);\n return () => observer.disconnect();\n }, [rows]);\n return { ref, height };\n}\n\nexport function MonthView() {\n const page = useCalendarPage();\n return page.compact ? <PhoneMonth /> : <WideMonth />;\n}\n\nfunction WeekdayHeader({ week, short }: { week: readonly DateValue[]; short?: boolean }) {\n const { format } = useCalendarPage();\n return (\n <div className=\"grid grid-cols-7 border-b border-border-default\">\n {week.map((day) => (\n <div\n key={day}\n className={cn(\n 'px-2 py-2 text-[11px] font-semibold uppercase tracking-[0.06em] text-text-secondary',\n short && 'text-center',\n isWeekendDay(day) && 'text-text-muted'\n )}\n >\n {formatDay(day, format, 'weekday')}\n </div>\n ))}\n </div>\n );\n}\n\nfunction WideMonth() {\n const page = useCalendarPage();\n const { format, timeZone, events, nav } = page;\n const weeks = useMemo(() => weekRows(page.days), [page.days]);\n const month = monthOf(nav.date);\n const { ref, height } = useRowHeight(weeks.length);\n const lines = monthLinesFor(height);\n\n const fitted = useMemo(\n () =>\n weeks.map((week) => {\n const first = week[0] ?? nav.date;\n const last = week[week.length - 1] ?? nav.date;\n // A timed event over midnight shows on each of its days, as the grid shows it.\n const timedByDay = new Map<DateValue, CalendarEventV2[]>();\n for (const event of events) {\n if (isAllDayRow(event)) continue;\n const span = eventDays(event, timeZone);\n for (const day of week) {\n if (day < span.start || day > span.end) continue;\n const list = timedByDay.get(day);\n if (list) list.push(event);\n else timedByDay.set(day, [event]);\n }\n }\n for (const list of timedByDay.values())\n list.sort((a, b) => a.start.getTime() - b.start.getTime());\n return fitMonthWeek(\n week,\n allDayItems(events, first, last, timeZone),\n timedByDay,\n lines,\n eventKey\n );\n }),\n [events, lines, nav.date, timeZone, weeks]\n );\n\n const startAt = (day: DateValue, anchor: HTMLElement) => {\n const start = page.workingHoursOn(day)?.start ?? 9 * 60;\n page.closePeek();\n page.openQuickCreate({\n date: day,\n start,\n end: start + page.prefs.defaultDuration,\n allDay: false,\n anchor,\n });\n };\n\n return (\n <section className={VIEW_PANEL} aria-label={formatDay(`${month}-01`, format, 'monthYear')}>\n <WeekdayHeader week={weeks[0] ?? []} />\n <div\n ref={ref}\n className=\"grid min-h-0 flex-1\"\n style={{ gridTemplateRows: `repeat(${weeks.length}, minmax(0, 1fr))` }}\n >\n {weeks.map((week, weekIndex) => {\n const fit = fitted[weekIndex];\n if (!fit) return null;\n return (\n <div\n key={week[0]}\n className=\"relative grid grid-cols-7 border-b border-border-subtle last:border-b-0\"\n >\n {fit.cells.map((cell) => (\n <MonthCell\n key={cell.date}\n cell={cell}\n month={month}\n laneCount={fit.laneCount}\n onAdd={startAt}\n />\n ))}\n {fit.bars.map((bar) => {\n const look = page.lookOf(bar.event);\n const style: CSSProperties = {\n ...calendarHueStyle(page.hueOf(bar.event.calendarId)),\n top: MONTH_DAY_HEADER_PX + bar.lane * MONTH_LINE_PX,\n height: MONTH_LINE_PX - 2,\n insetInlineStart: `calc(${(bar.firstIndex / 7) * 100}% + 3px)`,\n width: `calc(${((bar.lastIndex - bar.firstIndex + 1) / 7) * 100}% - 6px)`,\n };\n return (\n <button\n key={bar.event.id}\n type=\"button\"\n data-event-id={bar.event.id}\n aria-label={page.labelOf(bar.event)}\n aria-haspopup=\"dialog\"\n style={style}\n onClick={(clickEvent) => page.openPeek(bar.event, clickEvent.currentTarget)}\n className={cn(\n 'absolute z-[1] flex min-w-0 items-center rounded px-1.5 text-start text-[11px] font-semibold',\n EVENT_BORDER,\n EVENT_FILL,\n FOCUS_RING,\n look.faded && 'opacity-60',\n bar.continuesBefore && 'rounded-s-none',\n bar.continuesAfter && 'rounded-e-none',\n nav.eventId === bar.event.id && EVENT_SELECTED\n )}\n >\n <span className=\"truncate\">{look.title}</span>\n </button>\n );\n })}\n </div>\n );\n })}\n </div>\n </section>\n );\n}\n\n/**\n * One day of a wide month: its number (opens the day), the bars' lanes left free, its events\n * and \"+N more\". A click on its free space starts an event there: a button behind the content,\n * out of the tab order (the keyboard has the day number, New event and N).\n */\nfunction MonthCell({\n cell,\n month,\n laneCount,\n onAdd,\n}: {\n cell: MonthCellFit<CalendarEventV2>;\n month: MonthValue;\n laneCount: number;\n onAdd: (day: DateValue, anchor: HTMLElement) => void;\n}) {\n const { tr, format, today, nav } = useCalendarPage();\n const outside = monthOf(cell.date) !== month;\n const isToday = cell.date === today;\n const dayLabel = cell.date.endsWith('-01')\n ? `${formatDay(cell.date, format, 'dayNumber')} ${formatDay(cell.date, format, 'monthShort')}`\n : formatDay(cell.date, format, 'dayNumber');\n const dayName = formatDay(cell.date, format, 'full');\n return (\n <div\n data-month-day={cell.date}\n className={cn(\n 'relative min-w-0 overflow-hidden border-s border-border-subtle first:border-s-0',\n outside && 'bg-bg-sunken/50',\n isWeekendDay(cell.date) && !outside && 'bg-bg-sunken/25'\n )}\n >\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={tr('calendar.v2.addOnDay', 'Add an event on {{day}}', { day: dayName })}\n onClick={(clickEvent) => onAdd(cell.date, clickEvent.currentTarget)}\n className=\"absolute inset-0 z-0 cursor-default focus-visible:outline-none\"\n />\n <button\n type=\"button\"\n onClick={() => nav.goTo({ view: 'day', date: cell.date })}\n aria-current={isToday ? 'date' : undefined}\n aria-label={tr('calendar.v2.openDay', '{{day}}. Open the day', { day: dayName })}\n className={cn(\n 'relative z-[1] ms-1 mt-1 inline-grid h-5 min-w-5 place-items-center rounded-full px-1 text-xs font-semibold tabular-nums hover:bg-bg-sunken',\n FOCUS_RING,\n isToday\n ? 'bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg'\n : outside\n ? 'text-text-muted'\n : 'text-text-primary'\n )}\n >\n {dayLabel}\n </button>\n <div\n className=\"pointer-events-none relative z-[1] flex flex-col *:pointer-events-auto\"\n style={{ marginTop: laneCount * MONTH_LINE_PX }}\n >\n {cell.shown.map((event) => (\n <MonthEventLine key={event.id} event={event} day={cell.date} />\n ))}\n {cell.more > 0 ? <DayMore date={cell.date} count={cell.more} /> : null}\n </div>\n </div>\n );\n}\n\n/** A timed event on a day of the month: its start, or on the day it runs on to, its end. */\nfunction MonthEventLine({ event, day }: { event: CalendarEventV2; day: DateValue }) {\n const page = useCalendarPage();\n const look = page.lookOf(event);\n const startedBefore = instantToZoned(event.start, page.timeZone).date < day;\n return (\n <button\n type=\"button\"\n data-event-id={event.id}\n aria-label={page.labelOf(event)}\n aria-haspopup=\"dialog\"\n style={{ ...calendarHueStyle(page.hueOf(event.calendarId)), height: MONTH_LINE_PX }}\n onClick={(clickEvent) => page.openPeek(event, clickEvent.currentTarget)}\n className={cn(\n 'mx-1 flex min-w-0 items-center gap-1 rounded px-1 text-start text-[11px] leading-none hover:bg-bg-sunken',\n FOCUS_RING,\n look.faded && 'opacity-60',\n page.nav.eventId === event.id && EVENT_SELECTED\n )}\n >\n <i\n aria-hidden=\"true\"\n className={cn(\n 'size-[7px] shrink-0 rounded-full',\n look.invitation\n ? 'border border-[var(--cal-hue)]'\n : look.busyOnly\n ? 'bg-border-strong'\n : 'bg-[var(--cal-hue)]'\n )}\n />\n <time className=\"shrink-0 tabular-nums text-text-secondary\">\n {startedBefore\n ? `– ${formatInstantTime(event.end, page.timeZone, page.format)}`\n : formatInstantTime(event.start, page.timeZone, page.format)}\n </time>\n <span className={cn('min-w-0 truncate text-text-primary', look.declined && 'line-through')}>\n {look.title}\n </span>\n </button>\n );\n}\n\n/** \"+N more\": the whole day in a popover. */\nfunction DayMore({ date, count }: { date: DateValue; count: number }) {\n const page = useCalendarPage();\n const { tr, format, today, nav } = page;\n const [open, setOpen] = useState(false);\n const events = eventsOnDay(page.events, date, page.timeZone);\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className={cn(\n 'mx-1 rounded px-1 text-start text-[11px] leading-[18px] font-semibold text-text-link hover:underline',\n FOCUS_RING\n )}\n >\n {tr('calendar.v2.moreCount', '+{{count}} more', { count })}\n </button>\n </PopoverTrigger>\n <PopoverContent align=\"start\" className=\"flex max-h-[min(480px,70vh)] w-[360px] flex-col p-0\">\n <div className=\"flex items-start gap-2 border-b border-border-subtle p-3\">\n <div className=\"min-w-0 flex-1\">\n <h3 className=\"text-base font-bold text-text-primary\">\n {formatDay(date, format, 'long')}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {date === today ? tr('calendar.v2.today', 'Today') : formatDay(date, format, 'date')}\n </p>\n </div>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => nav.goTo({ view: 'day', date })}\n >\n {tr('calendar.v2.openDayShort', 'Open day')}\n </Button>\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.close', 'Close')}\n onClick={() => setOpen(false)}\n >\n <X aria-hidden=\"true\" />\n </button>\n </div>\n <div className=\"min-h-0 overflow-y-auto px-3\">\n {events.map((event) => (\n <EventListRow key={event.id} event={event} day={date} dense />\n ))}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\n/** Phones: a dot per event (up to three), and the picked day's events under the month. */\nfunction PhoneMonth() {\n const page = useCalendarPage();\n const { tr, format, timeZone, events, today, nav } = page;\n const weeks = useMemo(() => weekRows(page.days), [page.days]);\n const month = monthOf(nav.date);\n const [picked, setPicked] = useState<DateValue | null>(null);\n const selected =\n picked && page.days.includes(picked)\n ? picked\n : page.days.includes(today) && monthOf(today) === month\n ? today\n : `${month}-01`;\n const dayEvents = eventsOnDay(events, selected, timeZone);\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col gap-2.5\">\n <section\n className={cn(VIEW_PANEL, 'flex-none')}\n aria-label={formatDay(`${month}-01`, format, 'monthYear')}\n >\n <WeekdayHeader week={weeks[0] ?? []} short />\n <div className=\"grid\">\n {weeks.map((week) => (\n <div\n key={week[0]}\n className=\"grid grid-cols-7 border-b border-border-subtle last:border-b-0\"\n >\n {week.map((day) => {\n const on = eventsOnDay(events, day, timeZone);\n const outside = monthOf(day) !== month;\n return (\n <button\n key={day}\n type=\"button\"\n aria-pressed={selected === day}\n aria-current={day === today ? 'date' : undefined}\n aria-label={tr('calendar.v2.dayEvents', '{{day}}: {{count}} events', {\n day: formatDay(day, format, 'full'),\n count: on.length,\n })}\n onClick={() => setPicked(day)}\n className={cn(\n 'flex h-12 min-w-0 flex-col items-center justify-center gap-1 border-s border-border-subtle first:border-s-0',\n FOCUS_RING,\n outside && 'bg-bg-sunken/50',\n selected === day && 'bg-accent-soft'\n )}\n >\n <span\n className={cn(\n 'grid h-6 min-w-6 place-items-center rounded-full text-sm font-semibold tabular-nums',\n day === today\n ? 'bg-action-primary-bg text-action-primary-text'\n : outside\n ? 'text-text-muted'\n : 'text-text-primary'\n )}\n >\n {formatDay(day, format, 'dayNumber')}\n </span>\n <span className=\"flex h-1.5 gap-0.5\" aria-hidden=\"true\">\n {on.slice(0, 3).map((event) => (\n <i\n key={event.id}\n className=\"size-1.5 rounded-full bg-[var(--cal-hue)]\"\n style={calendarHueStyle(page.hueOf(event.calendarId))}\n />\n ))}\n </span>\n </button>\n );\n })}\n </div>\n ))}\n </div>\n </section>\n <section className={cn(VIEW_PANEL, 'px-3')} aria-label={formatDay(selected, format, 'full')}>\n <div className=\"flex items-center gap-2 border-b border-border-subtle py-2.5\">\n <b className=\"text-sm text-text-primary\">{formatDay(selected, format, 'long')}</b>\n <span className=\"flex-1\" />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => {\n const start = page.workingHoursOn(selected)?.start ?? 9 * 60;\n page.openEventDialog({\n date: selected,\n start,\n end: start + page.prefs.defaultDuration,\n allDay: false,\n });\n }}\n >\n <Plus aria-hidden=\"true\" />\n {tr('calendar.v2.add', 'Add')}\n </Button>\n </div>\n <div className=\"min-h-0 overflow-y-auto\">\n {dayEvents.length > 0 ? (\n dayEvents.map((event) => (\n <EventListRow key={event.id} event={event} day={selected} dense />\n ))\n ) : (\n <p className=\"py-3 text-sm text-text-secondary\">\n {page.state.kind === 'ready' && page.state.failedCalendarIds.length > 0\n ? tr(\n 'calendar.v2.partialNothing',\n 'Nothing to show from the calendars that loa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@@
|
|
|
1
|
+
import { DateValue } from '@burdenoff/fe-libs/ui';
|
|
2
|
+
import { AllDayItem } from '../events/eventModel';
|
|
3
|
+
import { AllDayBar } from '../types';
|
|
4
|
+
/** The most lines a day shows. */
|
|
5
|
+
export declare const MAX_MONTH_LINES = 3;
|
|
6
|
+
/** The lines a day shows before its row is measured. */
|
|
7
|
+
export declare const DEFAULT_MONTH_LINES = 3;
|
|
8
|
+
/** A line's height in pixels (an event, a bar or "+N more"). */
|
|
9
|
+
export declare const MONTH_LINE_PX = 18;
|
|
10
|
+
/** The day number's row at the top of a cell. */
|
|
11
|
+
export declare const MONTH_DAY_HEADER_PX = 26;
|
|
12
|
+
/** Room under the last line. */
|
|
13
|
+
export declare const MONTH_CELL_PADDING_PX = 4;
|
|
14
|
+
/** The lines a day of a week row `rowHeight` pixels tall holds: 1 to 3 (3 before it is measured). */
|
|
15
|
+
export declare function monthLinesFor(rowHeight: number): number;
|
|
16
|
+
/** One day of a fitted week. */
|
|
17
|
+
export interface MonthCellFit<T> {
|
|
18
|
+
date: DateValue;
|
|
19
|
+
/** The timed events shown, in order. */
|
|
20
|
+
shown: T[];
|
|
21
|
+
/** What "+N more" counts: timed events and bars that didn't fit. 0: no "+N more". */
|
|
22
|
+
more: number;
|
|
23
|
+
}
|
|
24
|
+
/** A fitted week: the bars shown at the top, and each day's events. */
|
|
25
|
+
export interface MonthWeekFit<T> {
|
|
26
|
+
bars: AllDayBar<T>[];
|
|
27
|
+
/** Lanes the bars take (timed events start below them). */
|
|
28
|
+
laneCount: number;
|
|
29
|
+
cells: MonthCellFit<T>[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Fits one week row of `lines` lines a day. All-day bars take lanes from the top (leaving a
|
|
33
|
+
* line for at least one more thing); each day's timed events fill the lines below them; when
|
|
34
|
+
* the day holds more than fits, one line goes to "+N more", counting the timed events and the
|
|
35
|
+
* bars that were left out.
|
|
36
|
+
*/
|
|
37
|
+
export declare function fitMonthWeek<T>(days: readonly DateValue[], allDay: readonly AllDayItem<T>[], timedByDay: ReadonlyMap<DateValue, readonly T[]>, lines: number, keyOf: (event: T) => string): MonthWeekFit<T>;
|
|
38
|
+
/** The month grid's days as week rows of seven. */
|
|
39
|
+
export declare function weekRows(days: readonly DateValue[]): DateValue[][];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { allDayLanes as e } from "../grid/layout.js";
|
|
2
|
+
function t(e) {
|
|
3
|
+
if (!Number.isFinite(e) || e <= 0) return 3;
|
|
4
|
+
let t = Math.floor((e - 26 - 4) / 18);
|
|
5
|
+
return Math.max(1, Math.min(3, t));
|
|
6
|
+
}
|
|
7
|
+
function n(t, n, r, i, a) {
|
|
8
|
+
let o = e(n, t, Infinity, a), s = Math.max(0, i - 1), c = Math.min(o.totalLanes, s);
|
|
9
|
+
return {
|
|
10
|
+
bars: o.bars.filter((e) => e.lane < c),
|
|
11
|
+
laneCount: c,
|
|
12
|
+
cells: t.map((e, t) => {
|
|
13
|
+
let n = r.get(e) ?? [], a = o.bars.filter((e) => e.firstIndex <= t && e.lastIndex >= t).filter((e) => e.lane >= c).length, s = Math.max(0, i - c), l = n.length + a > s ? Math.max(0, s - 1) : s, u = n.slice(0, l);
|
|
14
|
+
return {
|
|
15
|
+
date: e,
|
|
16
|
+
shown: u,
|
|
17
|
+
more: n.length - u.length + a
|
|
18
|
+
};
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function r(e) {
|
|
23
|
+
let t = [];
|
|
24
|
+
for (let n = 0; n < e.length; n += 7) t.push(e.slice(n, n + 7));
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
export { n as fitMonthWeek, t as monthLinesFor, r as weekRows };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=monthLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monthLayout.js","names":["monthLinesFor","rowHeight","lines","fitMonthWeek","all","allDayLanes","allDay","days","keyOf","laneLimit","shownLanes","bar","timed","timedByDay","date","hiddenBars","index","room","showCount","shown","weekRows","rows"],"sources":["../../../src/v2/month/monthLayout.ts"],"sourcesContent":["/**\n * Fitting a month (BOFF-15698 A1). Each week row is as tall as the view allows; a day shows as\n * many lines as fit, at most three, all-day bars first, then timed events by start. When a day\n * has more than its lines hold, its last line says \"+N more\" (and opens the whole day). Pure.\n */\nimport type { DateValue } from '@burdenoff/fe-libs/ui';\nimport type { AllDayItem } from '../events/eventModel';\nimport { allDayLanes } from '../grid/layout';\nimport type { AllDayBar } from '../types';\n\n/** The most lines a day shows. */\nexport const MAX_MONTH_LINES = 3;\n/** The lines a day shows before its row is measured. */\nexport const DEFAULT_MONTH_LINES = 3;\n/** A line's height in pixels (an event, a bar or \"+N more\"). */\nexport const MONTH_LINE_PX = 18;\n/** The day number's row at the top of a cell. */\nexport const MONTH_DAY_HEADER_PX = 26;\n/** Room under the last line. */\nexport const MONTH_CELL_PADDING_PX = 4;\n\n/** The lines a day of a week row `rowHeight` pixels tall holds: 1 to 3 (3 before it is measured). */\nexport function monthLinesFor(rowHeight: number): number {\n if (!Number.isFinite(rowHeight) || rowHeight <= 0) return DEFAULT_MONTH_LINES;\n const lines = Math.floor(\n (rowHeight - MONTH_DAY_HEADER_PX - MONTH_CELL_PADDING_PX) / MONTH_LINE_PX\n );\n return Math.max(1, Math.min(MAX_MONTH_LINES, lines));\n}\n\n/** One day of a fitted week. */\nexport interface MonthCellFit<T> {\n date: DateValue;\n /** The timed events shown, in order. */\n shown: T[];\n /** What \"+N more\" counts: timed events and bars that didn't fit. 0: no \"+N more\". */\n more: number;\n}\n\n/** A fitted week: the bars shown at the top, and each day's events. */\nexport interface MonthWeekFit<T> {\n bars: AllDayBar<T>[];\n /** Lanes the bars take (timed events start below them). */\n laneCount: number;\n cells: MonthCellFit<T>[];\n}\n\n/**\n * Fits one week row of `lines` lines a day. All-day bars take lanes from the top (leaving a\n * line for at least one more thing); each day's timed events fill the lines below them; when\n * the day holds more than fits, one line goes to \"+N more\", counting the timed events and the\n * bars that were left out.\n */\nexport function fitMonthWeek<T>(\n days: readonly DateValue[],\n allDay: readonly AllDayItem<T>[],\n timedByDay: ReadonlyMap<DateValue, readonly T[]>,\n lines: number,\n keyOf: (event: T) => string\n): MonthWeekFit<T> {\n const all = allDayLanes(allDay, days, Number.POSITIVE_INFINITY, keyOf);\n const laneLimit = Math.max(0, lines - 1);\n const shownLanes = Math.min(all.totalLanes, laneLimit);\n const bars = all.bars.filter((bar) => bar.lane < shownLanes);\n const cells = days.map((date, index) => {\n const timed = timedByDay.get(date) ?? [];\n const covering = all.bars.filter((bar) => bar.firstIndex <= index && bar.lastIndex >= index);\n const hiddenBars = covering.filter((bar) => bar.lane >= shownLanes).length;\n const room = Math.max(0, lines - shownLanes);\n const total = timed.length + hiddenBars;\n const showCount = total > room ? Math.max(0, room - 1) : room;\n const shown = timed.slice(0, showCount);\n return { date, shown, more: timed.length - shown.length + hiddenBars };\n });\n return { bars, laneCount: shownLanes, cells };\n}\n\n/** The month grid's days as week rows of seven. */\nexport function weekRows(days: readonly DateValue[]): DateValue[][] {\n const rows: DateValue[][] = [];\n for (let index = 0; index < days.length; index += 7) rows.push(days.slice(index, index + 7));\n return rows;\n}\n"],"mappings":";AAsBA,SAAgBA,EAAc,GAA2B;CACvD,IAAI,CAAC,OAAO,SAASC,CAAS,KAAKA,KAAa,GAAG,OAAA;CACnD,IAAMC,IAAQ,KAAK,OAChBD,IAAA,KAAA,KAAA,EACH;CACA,OAAO,KAAK,IAAI,GAAG,KAAK,IAAA,GAAqBC,CAAK,CAAC;AACrD;AAyBA,SAAgBC,EACd,GACA,GACA,GACA,GACA,GACiB;CACjB,IAAMC,IAAMC,EAAYC,GAAQC,GAAM,UAA0BC,CAAK,GAC/DC,IAAY,KAAK,IAAI,GAAGP,IAAQ,CAAC,GACjCQ,IAAa,KAAK,IAAIN,EAAI,YAAYK,CAAS;CAYrD,OAAO;EAAE,MAXIL,EAAI,KAAK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