@savvycal/calendar 0.10.3 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +187 -20
- package/dist/components/day-grid-view/AllDayEventChip.d.ts.map +1 -1
- package/dist/components/day-grid-view/AllDayEventChip.js +47 -41
- package/dist/components/day-grid-view/AllDaySection.d.ts +15 -0
- package/dist/components/day-grid-view/AllDaySection.d.ts.map +1 -1
- package/dist/components/day-grid-view/AllDaySection.js +93 -29
- package/dist/components/day-grid-view/BackgroundEventLayer.d.ts +19 -0
- package/dist/components/day-grid-view/BackgroundEventLayer.d.ts.map +1 -0
- package/dist/components/day-grid-view/BackgroundEventLayer.js +55 -0
- package/dist/components/day-grid-view/DayGridView.d.ts +1 -1
- package/dist/components/day-grid-view/DayGridView.d.ts.map +1 -1
- package/dist/components/day-grid-view/DayGridView.js +375 -263
- package/dist/components/day-grid-view/defaults.js +1 -1
- package/dist/components/month-view/MonthEventItem.d.ts +22 -0
- package/dist/components/month-view/MonthEventItem.d.ts.map +1 -0
- package/dist/components/month-view/MonthEventItem.js +95 -0
- package/dist/components/month-view/MonthMoreButton.d.ts +22 -0
- package/dist/components/month-view/MonthMoreButton.d.ts.map +1 -0
- package/dist/components/month-view/MonthMoreButton.js +122 -0
- package/dist/components/month-view/MonthView.d.ts +3 -0
- package/dist/components/month-view/MonthView.d.ts.map +1 -0
- package/dist/components/month-view/MonthView.js +281 -0
- package/dist/components/month-view/MonthWeekRow.d.ts +40 -0
- package/dist/components/month-view/MonthWeekRow.d.ts.map +1 -0
- package/dist/components/month-view/MonthWeekRow.js +192 -0
- package/dist/components/month-view/defaults.d.ts +3 -0
- package/dist/components/month-view/defaults.d.ts.map +1 -0
- package/dist/components/month-view/defaults.js +32 -0
- package/dist/components/month-view/index.d.ts +3 -0
- package/dist/components/month-view/index.d.ts.map +1 -0
- package/dist/components/resource-grid-view/ResourceGridView.d.ts +1 -1
- package/dist/components/resource-grid-view/ResourceGridView.d.ts.map +1 -1
- package/dist/components/resource-grid-view/ResourceGridView.js +163 -155
- package/dist/components/resource-grid-view/defaults.js +1 -1
- package/dist/components/shared/AnchoredPopover.d.ts +35 -0
- package/dist/components/shared/AnchoredPopover.d.ts.map +1 -0
- package/dist/components/shared/AnchoredPopover.js +91 -0
- package/dist/components/shared/EventChip.d.ts.map +1 -1
- package/dist/components/shared/EventChip.js +58 -64
- package/dist/components/shared/OverflowChip.d.ts.map +1 -1
- package/dist/components/shared/OverflowChip.js +67 -89
- package/dist/components/shared/SelectionOverlay.d.ts +1 -0
- package/dist/components/shared/SelectionOverlay.d.ts.map +1 -1
- package/dist/components/shared/SelectionOverlay.js +28 -27
- package/dist/components/shared/SlotInteractionLayer.d.ts +27 -5
- package/dist/components/shared/SlotInteractionLayer.d.ts.map +1 -1
- package/dist/components/shared/SlotInteractionLayer.js +186 -145
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -10
- package/dist/lib/accessibility.d.ts +8 -0
- package/dist/lib/accessibility.d.ts.map +1 -1
- package/dist/lib/accessibility.js +31 -4
- package/dist/lib/lanes.d.ts +25 -0
- package/dist/lib/lanes.d.ts.map +1 -0
- package/dist/lib/lanes.js +32 -0
- package/dist/lib/month.d.ts +64 -0
- package/dist/lib/month.d.ts.map +1 -0
- package/dist/lib/month.js +110 -0
- package/dist/lib/overlap.d.ts.map +1 -1
- package/dist/lib/overlap.js +157 -179
- package/dist/lib/time.d.ts +4 -0
- package/dist/lib/time.d.ts.map +1 -1
- package/dist/lib/time.js +20 -12
- package/dist/types/calendar.d.ts +164 -0
- package/dist/types/calendar.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,374 +1,486 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { Temporal as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { generateDateRange as
|
|
6
|
-
import { layoutAllDayEvents as
|
|
7
|
-
import { computeUnavailableBlocks as
|
|
8
|
-
import { UnavailabilityOverlay as
|
|
9
|
-
import { dayGridViewDefaults as
|
|
10
|
-
import { DayHeader as
|
|
11
|
-
import { DayColumn as
|
|
12
|
-
import { TimeGutter as
|
|
13
|
-
import { SlotInteractionLayer as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { jsxs as st, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as l, useCallback as g, useRef as dt, useState as ut, useEffect as ct } from "react";
|
|
3
|
+
import { Temporal as f } from "temporal-polyfill";
|
|
4
|
+
import { cn as K } from "../../lib/utils.js";
|
|
5
|
+
import { generateDateRange as Jt, shiftDays as I, generateTimeSlots as Qt, formatDayOfWeek as C, formatTimeRange as Xt } from "../../lib/time.js";
|
|
6
|
+
import { layoutAllDayEvents as Yt, computePositionedEventsByDate as Zt } from "../../lib/overlap.js";
|
|
7
|
+
import { computeUnavailableBlocks as te } from "../../lib/availability.js";
|
|
8
|
+
import { UnavailabilityOverlay as ee } from "../shared/UnavailabilityOverlay.js";
|
|
9
|
+
import { dayGridViewDefaults as re } from "./defaults.js";
|
|
10
|
+
import { DayHeader as ne } from "./DayHeader.js";
|
|
11
|
+
import { DayColumn as oe } from "./DayColumn.js";
|
|
12
|
+
import { TimeGutter as ae } from "../shared/TimeGutter.js";
|
|
13
|
+
import { SlotInteractionLayer as ie } from "../shared/SlotInteractionLayer.js";
|
|
14
|
+
import { BackgroundEventLayer as le } from "./BackgroundEventLayer.js";
|
|
15
|
+
import { SelectionOverlay as se } from "../shared/SelectionOverlay.js";
|
|
16
|
+
import { NowIndicator as de } from "../shared/NowIndicator.js";
|
|
17
|
+
import { AllDaySection as ue } from "./AllDaySection.js";
|
|
18
|
+
import { useEffectiveHourHeight as ce } from "../shared/useEffectiveHourHeight.js";
|
|
19
|
+
import { useInitialScroll as me } from "../shared/useInitialScroll.js";
|
|
20
|
+
import { useAnnouncer as fe } from "../shared/useAnnouncer.js";
|
|
21
|
+
import { describeEvent as pe } from "../../lib/accessibility.js";
|
|
22
|
+
function Ne({
|
|
23
|
+
activeRange: p,
|
|
23
24
|
timeZone: n,
|
|
24
|
-
events:
|
|
25
|
-
availability:
|
|
26
|
-
unavailability:
|
|
27
|
-
defaultUnavailable:
|
|
28
|
-
timeAxis:
|
|
29
|
-
initialScrollHour:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
25
|
+
events: V,
|
|
26
|
+
availability: x,
|
|
27
|
+
unavailability: M,
|
|
28
|
+
defaultUnavailable: q,
|
|
29
|
+
timeAxis: E,
|
|
30
|
+
initialScrollHour: mt,
|
|
31
|
+
scrollKey: ft,
|
|
32
|
+
onEventClick: z,
|
|
33
|
+
snapDuration: F,
|
|
34
|
+
placeholderDuration: pt,
|
|
35
|
+
selectedRange: T,
|
|
36
|
+
onSelect: i,
|
|
37
|
+
onSlotClick: B,
|
|
38
|
+
className: Dt,
|
|
39
|
+
classNames: U,
|
|
40
|
+
hourHeight: ht = 60,
|
|
41
|
+
columnMinWidth: yt = 120,
|
|
42
|
+
renderHeader: gt,
|
|
43
|
+
renderEvent: k,
|
|
44
|
+
selectionAppearance: Tt,
|
|
45
|
+
dragPreviewAppearance: vt,
|
|
46
|
+
selectionRef: _,
|
|
47
|
+
selectionLingerMs: A = 0,
|
|
48
|
+
selectedEventId: J,
|
|
49
|
+
selectedEventRef: Q,
|
|
50
|
+
renderCorner: wt,
|
|
51
|
+
formatGutterLabel: X,
|
|
52
|
+
backgroundEvents: H,
|
|
53
|
+
renderBackgroundEvent: St,
|
|
54
|
+
onSlotHover: R,
|
|
55
|
+
multiDaySelection: N = !1,
|
|
56
|
+
eventGap: Ct,
|
|
57
|
+
eventLayout: $t = "columns",
|
|
58
|
+
stackOffset: Ht = 8,
|
|
59
|
+
eventMinWidth: Pt,
|
|
60
|
+
eventMaxStack: bt,
|
|
61
|
+
onOverflowClick: Y,
|
|
62
|
+
renderOverflowPopover: It
|
|
56
63
|
}) {
|
|
57
|
-
const
|
|
58
|
-
() =>
|
|
59
|
-
[
|
|
60
|
-
),
|
|
61
|
-
effectiveHourHeight:
|
|
64
|
+
const u = E?.startHour ?? 0, c = E?.endHour ?? 24, O = E?.intervalMinutes ?? 60, o = l(
|
|
65
|
+
() => Jt(p.startDate, p.endDate),
|
|
66
|
+
[p.startDate, p.endDate]
|
|
67
|
+
), Z = l(() => f.Now.plainDateISO(n).toString(), [n]), {
|
|
68
|
+
effectiveHourHeight: D,
|
|
62
69
|
rootRef: P,
|
|
63
|
-
headerRef:
|
|
64
|
-
allDayRef:
|
|
65
|
-
gridRef:
|
|
66
|
-
headerHeight:
|
|
67
|
-
containerHeight:
|
|
68
|
-
} =
|
|
69
|
-
|
|
70
|
+
headerRef: xt,
|
|
71
|
+
allDayRef: W,
|
|
72
|
+
gridRef: j,
|
|
73
|
+
headerHeight: tt,
|
|
74
|
+
containerHeight: Mt
|
|
75
|
+
} = ce(ht, c - u);
|
|
76
|
+
me({
|
|
70
77
|
rootRef: P,
|
|
71
|
-
initialScrollHour:
|
|
72
|
-
startHour:
|
|
73
|
-
endHour:
|
|
74
|
-
effectiveHourHeight:
|
|
75
|
-
containerHeight:
|
|
76
|
-
scrollKey: `${
|
|
78
|
+
initialScrollHour: mt,
|
|
79
|
+
startHour: u,
|
|
80
|
+
endHour: c,
|
|
81
|
+
effectiveHourHeight: D,
|
|
82
|
+
containerHeight: Mt,
|
|
83
|
+
scrollKey: `${p.startDate.toString()}/${p.endDate.toString()}/${ft ?? ""}`
|
|
77
84
|
});
|
|
78
|
-
const
|
|
79
|
-
(t) =>
|
|
80
|
-
[
|
|
81
|
-
),
|
|
82
|
-
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
else if (
|
|
86
|
-
const t =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
85
|
+
const s = g(
|
|
86
|
+
(t) => K(re[t], U?.[t]),
|
|
87
|
+
[U]
|
|
88
|
+
), b = dt(null), $ = dt(null), [Et, et] = ut(null);
|
|
89
|
+
ct(() => {
|
|
90
|
+
if (T)
|
|
91
|
+
$.current !== null && (clearTimeout($.current), $.current = null), b.current = T;
|
|
92
|
+
else if (b.current && A > 0) {
|
|
93
|
+
const t = b.current;
|
|
94
|
+
b.current = null, et(t), $.current = setTimeout(() => {
|
|
95
|
+
$.current = null, et(null);
|
|
96
|
+
}, A);
|
|
90
97
|
}
|
|
91
|
-
}, [
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
}, [T, A]);
|
|
99
|
+
const y = T ?? Et, [v, Bt] = ut(null), kt = l(() => {
|
|
100
|
+
if (!y || y.allDay) return [];
|
|
101
|
+
const { startTime: t, endTime: e, endDate: r } = y, a = t.withTimeZone(n).toPlainDate(), h = r ? a.until(r).days + 1 : 1;
|
|
102
|
+
return Array.from({ length: Math.max(h, 1) }, (m, S) => ({
|
|
103
|
+
startTime: I(t, S, n),
|
|
104
|
+
endTime: I(e, S, n)
|
|
105
|
+
}));
|
|
106
|
+
}, [y, n]), At = l(() => {
|
|
107
|
+
if (!y?.allDay) return null;
|
|
108
|
+
const t = y.startTime.withTimeZone(n).toPlainDate();
|
|
109
|
+
return {
|
|
110
|
+
startDate: t,
|
|
111
|
+
endDate: y.endDate ?? t
|
|
112
|
+
};
|
|
113
|
+
}, [y, n]), Rt = l(() => {
|
|
114
|
+
const t = /* @__PURE__ */ new Map();
|
|
115
|
+
if (!v) return t;
|
|
116
|
+
const e = f.PlainDate.from(v.columnId), r = f.PlainDate.from(v.endColumnId), a = f.PlainDate.compare(e, r) <= 0 ? e : r, h = Math.abs(e.until(r).days) + 1, m = {
|
|
117
|
+
startMin: v.startMin,
|
|
118
|
+
endMin: v.endMin
|
|
119
|
+
};
|
|
120
|
+
for (let S = 0; S < h; S++)
|
|
121
|
+
t.set(a.add({ days: S }).toString(), m);
|
|
122
|
+
return t;
|
|
123
|
+
}, [v]), G = l(
|
|
124
|
+
() => Qt({ startHour: u, endHour: c, intervalMinutes: O }),
|
|
125
|
+
[u, c, O]
|
|
126
|
+
), { allDayEvents: rt, timedEvents: nt } = l(() => {
|
|
127
|
+
const t = [], e = [];
|
|
128
|
+
for (const r of V)
|
|
129
|
+
r.allDay ? t.push(r) : e.push(r);
|
|
130
|
+
return { allDayEvents: t, timedEvents: e };
|
|
131
|
+
}, [V]), Nt = l(
|
|
132
|
+
() => Yt(rt, o),
|
|
133
|
+
[rt, o]
|
|
134
|
+
), Ot = l(
|
|
135
|
+
() => Zt(
|
|
136
|
+
nt,
|
|
106
137
|
n,
|
|
107
138
|
o,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
139
|
+
u,
|
|
140
|
+
c,
|
|
141
|
+
D
|
|
111
142
|
),
|
|
112
|
-
[
|
|
113
|
-
),
|
|
114
|
-
() =>
|
|
115
|
-
[
|
|
116
|
-
),
|
|
117
|
-
if (
|
|
143
|
+
[nt, n, o, u, c, D]
|
|
144
|
+
), L = l(
|
|
145
|
+
() => q ? x ?? [] : x,
|
|
146
|
+
[q, x]
|
|
147
|
+
), Wt = l(() => {
|
|
148
|
+
if (L === void 0 && !M)
|
|
118
149
|
return /* @__PURE__ */ new Map();
|
|
119
150
|
const t = /* @__PURE__ */ new Map();
|
|
120
|
-
for (const
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
151
|
+
for (const e of o) {
|
|
152
|
+
const r = te(
|
|
153
|
+
L,
|
|
154
|
+
M,
|
|
124
155
|
n,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
156
|
+
e,
|
|
157
|
+
u,
|
|
158
|
+
c,
|
|
159
|
+
D
|
|
129
160
|
);
|
|
130
|
-
|
|
161
|
+
r.length > 0 && t.set(e.toString(), r);
|
|
131
162
|
}
|
|
132
163
|
return t;
|
|
133
164
|
}, [
|
|
134
|
-
|
|
135
|
-
|
|
165
|
+
L,
|
|
166
|
+
M,
|
|
136
167
|
n,
|
|
137
168
|
o,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
]), { message:
|
|
142
|
-
const t =
|
|
143
|
-
return `Schedule for ${t} to ${
|
|
144
|
-
}, [
|
|
169
|
+
u,
|
|
170
|
+
c,
|
|
171
|
+
D
|
|
172
|
+
]), { message: jt, announce: w } = fe(), Gt = l(() => {
|
|
173
|
+
const t = C(p.startDate), e = C(p.endDate);
|
|
174
|
+
return `Schedule for ${t} to ${e}`;
|
|
175
|
+
}, [p.startDate, p.endDate]), ot = g(
|
|
145
176
|
(t) => {
|
|
146
|
-
|
|
147
|
-
const r = [Y(t), "all day"], e = _(t);
|
|
148
|
-
e && r.push(e), h(`Selected: ${r.join(", ")}`);
|
|
149
|
-
} else {
|
|
150
|
-
const r = [
|
|
151
|
-
Y(t),
|
|
152
|
-
X(t.startTime, t.endTime, n)
|
|
153
|
-
], e = _(t);
|
|
154
|
-
e && r.push(e), h(`Selected: ${r.join(", ")}`);
|
|
155
|
-
}
|
|
177
|
+
i?.(null), z?.(t), w(`Selected: ${pe(t, n)}`);
|
|
156
178
|
},
|
|
157
|
-
[
|
|
158
|
-
),
|
|
179
|
+
[i, z, n, w]
|
|
180
|
+
), Lt = g(
|
|
159
181
|
(t) => {
|
|
160
|
-
|
|
182
|
+
i?.(null), Y?.(t);
|
|
161
183
|
},
|
|
162
|
-
[
|
|
163
|
-
),
|
|
184
|
+
[i, Y]
|
|
185
|
+
), Kt = g(
|
|
164
186
|
(t) => {
|
|
165
187
|
if (!t) {
|
|
166
|
-
|
|
188
|
+
i?.(null);
|
|
167
189
|
return;
|
|
168
190
|
}
|
|
169
|
-
const
|
|
191
|
+
const e = {
|
|
170
192
|
startTime: t.startTime,
|
|
171
193
|
endTime: t.endTime
|
|
172
194
|
};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
195
|
+
if (t.endColumnId && t.endColumnId !== t.columnId) {
|
|
196
|
+
const a = f.PlainDate.from(t.columnId), h = f.PlainDate.from(t.endColumnId), m = a.until(h).days;
|
|
197
|
+
m < 0 ? (e.startTime = I(t.startTime, m, n), e.endTime = I(t.endTime, m, n), e.endDate = a) : e.endDate = h;
|
|
198
|
+
}
|
|
199
|
+
i?.(e);
|
|
200
|
+
const r = [Xt(t.startTime, t.endTime, n)];
|
|
201
|
+
e.endDate && r.push(
|
|
202
|
+
`${C(
|
|
203
|
+
e.startTime.withTimeZone(n).toPlainDate()
|
|
204
|
+
)} to ${C(e.endDate)}`
|
|
205
|
+
), w(`Selected time: ${r.join(", ")}`);
|
|
206
|
+
},
|
|
207
|
+
[i, n, w]
|
|
208
|
+
), Vt = g(
|
|
209
|
+
(t) => {
|
|
210
|
+
if (!t) {
|
|
211
|
+
i?.(null);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const { startDate: e, endDate: r } = t, a = {
|
|
215
|
+
startTime: e.toZonedDateTime(n),
|
|
216
|
+
endTime: e.add({ days: 1 }).toZonedDateTime(n),
|
|
217
|
+
allDay: !0
|
|
218
|
+
};
|
|
219
|
+
f.PlainDate.compare(r, e) > 0 && (a.endDate = r), i?.(a), w(
|
|
220
|
+
`Selected days: ${C(e)} to ${C(r)}`
|
|
221
|
+
);
|
|
176
222
|
},
|
|
177
|
-
[
|
|
178
|
-
),
|
|
223
|
+
[i, n, w]
|
|
224
|
+
), at = g(
|
|
179
225
|
(t) => {
|
|
180
|
-
const r =
|
|
181
|
-
|
|
182
|
-
|
|
226
|
+
const e = j.current?.querySelectorAll("[data-day-column]"), r = P.current, a = W.current;
|
|
227
|
+
if (!e || e.length === 0 || !r || !a) return null;
|
|
228
|
+
const h = Math.min(
|
|
229
|
+
Math.max(t, a.getBoundingClientRect().right),
|
|
230
|
+
r.getBoundingClientRect().right - 1
|
|
231
|
+
);
|
|
232
|
+
for (const m of e)
|
|
233
|
+
if (h < m.getBoundingClientRect().right)
|
|
234
|
+
return m.dataset.dayColumn ?? null;
|
|
235
|
+
return e[e.length - 1].dataset.dayColumn ?? null;
|
|
236
|
+
},
|
|
237
|
+
[j, P, W]
|
|
238
|
+
), qt = g(
|
|
239
|
+
(t) => {
|
|
240
|
+
R?.(
|
|
241
|
+
t && {
|
|
242
|
+
date: f.PlainDate.from(t.columnId),
|
|
243
|
+
startTime: t.startTime,
|
|
244
|
+
endTime: t.endTime
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
},
|
|
248
|
+
[R]
|
|
249
|
+
), zt = l(
|
|
250
|
+
() => (H ?? []).filter((t) => t.layer !== "above"),
|
|
251
|
+
[H]
|
|
252
|
+
), Ft = l(
|
|
253
|
+
() => (H ?? []).filter((t) => t.layer === "above"),
|
|
254
|
+
[H]
|
|
255
|
+
), it = (t, e) => t.length > 0 && o.map((r, a) => /* @__PURE__ */ d(
|
|
256
|
+
le,
|
|
257
|
+
{
|
|
258
|
+
events: t,
|
|
259
|
+
date: r,
|
|
260
|
+
column: a + 2,
|
|
261
|
+
timeZone: n,
|
|
262
|
+
startHour: u,
|
|
263
|
+
endHour: c,
|
|
264
|
+
hourHeight: D,
|
|
265
|
+
renderBackgroundEvent: St
|
|
266
|
+
},
|
|
267
|
+
`${e}-${r.toString()}`
|
|
268
|
+
)), Ut = g(
|
|
269
|
+
(t) => {
|
|
270
|
+
const e = f.PlainDate.from(t.columnId);
|
|
271
|
+
B?.({
|
|
272
|
+
date: e,
|
|
183
273
|
startTime: t.startTime,
|
|
184
274
|
endTime: t.endTime
|
|
185
275
|
});
|
|
186
276
|
},
|
|
187
|
-
[
|
|
277
|
+
[B]
|
|
188
278
|
);
|
|
189
|
-
|
|
190
|
-
if (!
|
|
191
|
-
const t = (
|
|
192
|
-
|
|
279
|
+
ct(() => {
|
|
280
|
+
if (!T || !i) return;
|
|
281
|
+
const t = (e) => {
|
|
282
|
+
e.key === "Escape" && i(null);
|
|
193
283
|
};
|
|
194
284
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
195
|
-
}, [
|
|
196
|
-
const
|
|
197
|
-
return /* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
285
|
+
}, [T, i]);
|
|
286
|
+
const _t = D * O / 60, lt = o.find((t) => t.toString() === Z);
|
|
287
|
+
return /* @__PURE__ */ st("div", { ref: P, className: K(s("root"), Dt), children: [
|
|
288
|
+
/* @__PURE__ */ st(
|
|
199
289
|
"div",
|
|
200
290
|
{
|
|
201
|
-
ref:
|
|
202
|
-
className:
|
|
291
|
+
ref: j,
|
|
292
|
+
className: s("grid"),
|
|
203
293
|
role: "region",
|
|
204
294
|
"aria-roledescription": "calendar",
|
|
205
|
-
"aria-label":
|
|
295
|
+
"aria-label": Gt,
|
|
206
296
|
style: {
|
|
207
297
|
display: "grid",
|
|
208
|
-
gridTemplateColumns: `max-content repeat(${o.length}, minmax(${
|
|
209
|
-
gridTemplateRows: `auto auto repeat(${
|
|
298
|
+
gridTemplateColumns: `max-content repeat(${o.length}, minmax(${yt}px, 1fr))`,
|
|
299
|
+
gridTemplateRows: `auto auto repeat(${G.length}, ${_t}px)`
|
|
210
300
|
},
|
|
211
301
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ d(
|
|
213
303
|
"div",
|
|
214
304
|
{
|
|
215
|
-
ref:
|
|
216
|
-
className:
|
|
305
|
+
ref: xt,
|
|
306
|
+
className: s("cornerCell"),
|
|
217
307
|
style: { gridRow: 1, gridColumn: 1 },
|
|
218
|
-
children:
|
|
308
|
+
children: wt?.({ timeZone: n })
|
|
219
309
|
}
|
|
220
310
|
),
|
|
221
|
-
o.map((t,
|
|
222
|
-
|
|
311
|
+
o.map((t, e) => /* @__PURE__ */ d(
|
|
312
|
+
ne,
|
|
223
313
|
{
|
|
224
314
|
date: t,
|
|
225
|
-
isToday: t.toString() ===
|
|
226
|
-
column:
|
|
227
|
-
cls:
|
|
228
|
-
renderHeader:
|
|
315
|
+
isToday: t.toString() === Z,
|
|
316
|
+
column: e + 2,
|
|
317
|
+
cls: s,
|
|
318
|
+
renderHeader: gt
|
|
229
319
|
},
|
|
230
320
|
t.toString()
|
|
231
321
|
)),
|
|
232
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ d(
|
|
233
323
|
"div",
|
|
234
324
|
{
|
|
235
|
-
ref:
|
|
236
|
-
className:
|
|
325
|
+
ref: W,
|
|
326
|
+
className: K(s("allDayCell"), "left-0 z-30"),
|
|
237
327
|
style: {
|
|
238
328
|
gridRow: 2,
|
|
239
329
|
gridColumn: 1,
|
|
240
|
-
top:
|
|
330
|
+
top: tt
|
|
241
331
|
}
|
|
242
332
|
}
|
|
243
333
|
),
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
|
|
334
|
+
/* @__PURE__ */ d(
|
|
335
|
+
ue,
|
|
246
336
|
{
|
|
247
|
-
positioned:
|
|
337
|
+
positioned: Nt,
|
|
248
338
|
dates: o,
|
|
249
|
-
headerHeight:
|
|
250
|
-
cls:
|
|
251
|
-
onEventClick:
|
|
252
|
-
selectedEventId:
|
|
253
|
-
selectedEventRef:
|
|
339
|
+
headerHeight: tt,
|
|
340
|
+
cls: s,
|
|
341
|
+
onEventClick: ot,
|
|
342
|
+
selectedEventId: J,
|
|
343
|
+
selectedEventRef: Q,
|
|
344
|
+
onSelectDays: N && i ? Vt : void 0,
|
|
345
|
+
resolveColumnId: at,
|
|
346
|
+
selectedDays: At,
|
|
347
|
+
selectionRef: _
|
|
254
348
|
}
|
|
255
349
|
),
|
|
256
|
-
|
|
257
|
-
|
|
350
|
+
G.map((t) => /* @__PURE__ */ d(
|
|
351
|
+
ae,
|
|
258
352
|
{
|
|
259
|
-
label:
|
|
353
|
+
label: X ? X(
|
|
354
|
+
f.PlainTime.from({
|
|
355
|
+
hour: t.hour,
|
|
356
|
+
minute: t.minute
|
|
357
|
+
})
|
|
358
|
+
) : t.label,
|
|
260
359
|
row: t.index + 3,
|
|
261
360
|
isHourStart: t.isHourStart,
|
|
262
361
|
isFirst: t.index === 0,
|
|
263
|
-
cls:
|
|
362
|
+
cls: s
|
|
264
363
|
},
|
|
265
364
|
t.index
|
|
266
365
|
)),
|
|
267
|
-
|
|
268
|
-
(t) => o.map((
|
|
366
|
+
G.map(
|
|
367
|
+
(t) => o.map((e, r) => /* @__PURE__ */ d(
|
|
269
368
|
"div",
|
|
270
369
|
{
|
|
271
|
-
className:
|
|
370
|
+
className: s(t.isHourStart ? "bodyCell" : "bodyCellMinor"),
|
|
272
371
|
style: {
|
|
273
372
|
gridRow: t.index + 3,
|
|
274
|
-
gridColumn:
|
|
373
|
+
gridColumn: r + 2,
|
|
275
374
|
...t.isHourStart ? {} : { borderTopStyle: "dotted" },
|
|
276
375
|
...t.index === 0 ? { borderTopWidth: 0 } : {},
|
|
277
|
-
...
|
|
376
|
+
...r === o.length - 1 ? { borderRightWidth: 0 } : {}
|
|
278
377
|
}
|
|
279
378
|
},
|
|
280
|
-
`${t.index}-${
|
|
379
|
+
`${t.index}-${e.toString()}`
|
|
281
380
|
))
|
|
282
381
|
),
|
|
283
|
-
o.map((t,
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
|
|
382
|
+
o.map((t, e) => {
|
|
383
|
+
const r = Wt.get(t.toString());
|
|
384
|
+
return r ? /* @__PURE__ */ d(
|
|
385
|
+
ee,
|
|
287
386
|
{
|
|
288
|
-
blocks:
|
|
289
|
-
column:
|
|
290
|
-
cls:
|
|
387
|
+
blocks: r,
|
|
388
|
+
column: e + 2,
|
|
389
|
+
cls: s
|
|
291
390
|
},
|
|
292
391
|
`unavail-${t.toString()}`
|
|
293
392
|
) : null;
|
|
294
393
|
}),
|
|
295
|
-
|
|
296
|
-
|
|
394
|
+
it(zt, "below"),
|
|
395
|
+
F != null && o.map((t, e) => /* @__PURE__ */ d(
|
|
396
|
+
ie,
|
|
297
397
|
{
|
|
298
398
|
columnId: t.toString(),
|
|
299
|
-
column:
|
|
399
|
+
column: e + 2,
|
|
300
400
|
date: t,
|
|
301
401
|
timeZone: n,
|
|
302
|
-
startHour:
|
|
303
|
-
endHour:
|
|
304
|
-
hourHeight:
|
|
305
|
-
snapDuration:
|
|
306
|
-
placeholderDuration:
|
|
307
|
-
cls:
|
|
308
|
-
onSlotClick:
|
|
309
|
-
onSelect:
|
|
310
|
-
|
|
311
|
-
|
|
402
|
+
startHour: u,
|
|
403
|
+
endHour: c,
|
|
404
|
+
hourHeight: D,
|
|
405
|
+
snapDuration: F,
|
|
406
|
+
placeholderDuration: pt ?? 15,
|
|
407
|
+
cls: s,
|
|
408
|
+
onSlotClick: B ? Ut : void 0,
|
|
409
|
+
onSelect: i ? Kt : void 0,
|
|
410
|
+
onSlotHover: R ? qt : void 0,
|
|
411
|
+
resolveColumnId: N && i ? at : void 0,
|
|
412
|
+
onDragPreviewChange: N && i ? Bt : void 0,
|
|
413
|
+
previewRange: Rt.get(t.toString()) ?? null,
|
|
414
|
+
dragPreviewAppearance: vt,
|
|
415
|
+
renderEvent: k
|
|
312
416
|
},
|
|
313
417
|
`slot-${t.toString()}`
|
|
314
418
|
)),
|
|
315
|
-
o.map((t,
|
|
316
|
-
|
|
419
|
+
o.map((t, e) => /* @__PURE__ */ d(
|
|
420
|
+
oe,
|
|
317
421
|
{
|
|
318
|
-
positionedEvents:
|
|
319
|
-
column:
|
|
422
|
+
positionedEvents: Ot.get(t.toString()) ?? [],
|
|
423
|
+
column: e + 2,
|
|
320
424
|
timeZone: n,
|
|
321
|
-
cls:
|
|
322
|
-
onEventClick:
|
|
323
|
-
renderEvent:
|
|
324
|
-
eventGap:
|
|
325
|
-
eventLayout:
|
|
326
|
-
stackOffset:
|
|
327
|
-
selectedEventId:
|
|
328
|
-
selectedEventRef:
|
|
329
|
-
eventMinWidth:
|
|
330
|
-
eventMaxStack:
|
|
331
|
-
onOverflowClick:
|
|
332
|
-
renderOverflowPopover:
|
|
425
|
+
cls: s,
|
|
426
|
+
onEventClick: ot,
|
|
427
|
+
renderEvent: k,
|
|
428
|
+
eventGap: Ct,
|
|
429
|
+
eventLayout: $t,
|
|
430
|
+
stackOffset: Ht,
|
|
431
|
+
selectedEventId: J,
|
|
432
|
+
selectedEventRef: Q,
|
|
433
|
+
eventMinWidth: Pt,
|
|
434
|
+
eventMaxStack: bt,
|
|
435
|
+
onOverflowClick: Lt,
|
|
436
|
+
renderOverflowPopover: It
|
|
333
437
|
},
|
|
334
438
|
t.toString()
|
|
335
439
|
)),
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
)
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
440
|
+
it(Ft, "above"),
|
|
441
|
+
(() => {
|
|
442
|
+
let t = !1;
|
|
443
|
+
return kt.map((e) => {
|
|
444
|
+
const r = e.startTime.withTimeZone(n).toPlainDate(), a = o.findIndex(
|
|
445
|
+
(m) => f.PlainDate.compare(m, r) === 0
|
|
446
|
+
);
|
|
447
|
+
if (a === -1) return null;
|
|
448
|
+
const h = t ? void 0 : _;
|
|
449
|
+
return t = !0, /* @__PURE__ */ d(
|
|
450
|
+
se,
|
|
451
|
+
{
|
|
452
|
+
startTime: e.startTime,
|
|
453
|
+
endTime: e.endTime,
|
|
454
|
+
column: a + 2,
|
|
455
|
+
viewDate: o[a],
|
|
456
|
+
timeZone: n,
|
|
457
|
+
startHour: u,
|
|
458
|
+
endHour: c,
|
|
459
|
+
hourHeight: D,
|
|
460
|
+
cls: s,
|
|
461
|
+
appearance: Tt,
|
|
462
|
+
selectionRef: h,
|
|
463
|
+
renderEvent: k
|
|
464
|
+
},
|
|
465
|
+
`selection-${r.toString()}`
|
|
466
|
+
);
|
|
467
|
+
});
|
|
356
468
|
})(),
|
|
357
|
-
|
|
358
|
-
|
|
469
|
+
lt && /* @__PURE__ */ d(
|
|
470
|
+
de,
|
|
359
471
|
{
|
|
360
|
-
date:
|
|
472
|
+
date: lt,
|
|
361
473
|
timeZone: n,
|
|
362
|
-
startHour:
|
|
363
|
-
endHour:
|
|
364
|
-
hourHeight:
|
|
365
|
-
cls:
|
|
474
|
+
startHour: u,
|
|
475
|
+
endHour: c,
|
|
476
|
+
hourHeight: D,
|
|
477
|
+
cls: s
|
|
366
478
|
}
|
|
367
479
|
)
|
|
368
480
|
]
|
|
369
481
|
}
|
|
370
482
|
),
|
|
371
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ d(
|
|
372
484
|
"div",
|
|
373
485
|
{
|
|
374
486
|
"aria-live": "polite",
|
|
@@ -385,11 +497,11 @@ function fr({
|
|
|
385
497
|
whiteSpace: "nowrap",
|
|
386
498
|
borderWidth: 0
|
|
387
499
|
},
|
|
388
|
-
children:
|
|
500
|
+
children: jt
|
|
389
501
|
}
|
|
390
502
|
)
|
|
391
503
|
] });
|
|
392
504
|
}
|
|
393
505
|
export {
|
|
394
|
-
|
|
506
|
+
Ne as DayGridView
|
|
395
507
|
};
|