@savvycal/calendar 0.10.2 → 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 +1 -1
- 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 +8 -8
|
@@ -1,115 +1,117 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useCallback as y, useRef as
|
|
1
|
+
import { jsxs as q, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as y, useRef as J, useState as It, useEffect as Q, useMemo as p } from "react";
|
|
3
|
+
import { Temporal as $t } from "temporal-polyfill";
|
|
3
4
|
import { cn as x } from "../../lib/utils.js";
|
|
4
|
-
import { generateTimeSlots as
|
|
5
|
-
import { groupByResource as
|
|
6
|
-
import { computeUnavailableBlocks as
|
|
7
|
-
import { resourceGridViewDefaults as
|
|
8
|
-
import { GridHeader as
|
|
9
|
-
import { ResourceColumn as
|
|
10
|
-
import { TimeGutter as
|
|
11
|
-
import { SlotInteractionLayer as
|
|
5
|
+
import { generateTimeSlots as xt, formatDateLabel as Et, formatTimeRange as X } from "../../lib/time.js";
|
|
6
|
+
import { groupByResource as jt, computePositionedEvents as Nt } from "../../lib/overlap.js";
|
|
7
|
+
import { computeUnavailableBlocks as Lt } from "../../lib/availability.js";
|
|
8
|
+
import { resourceGridViewDefaults as Bt } from "./defaults.js";
|
|
9
|
+
import { GridHeader as Mt } from "./GridHeader.js";
|
|
10
|
+
import { ResourceColumn as Ot } from "./ResourceColumn.js";
|
|
11
|
+
import { TimeGutter as Wt } from "../shared/TimeGutter.js";
|
|
12
|
+
import { SlotInteractionLayer as At } from "../shared/SlotInteractionLayer.js";
|
|
12
13
|
import { SelectionOverlay as Gt } from "../shared/SelectionOverlay.js";
|
|
13
|
-
import { UnavailabilityOverlay as
|
|
14
|
-
import { NowIndicator as
|
|
15
|
-
import { AllDayRow as
|
|
16
|
-
import { useEffectiveHourHeight as
|
|
17
|
-
import { useInitialScroll as
|
|
18
|
-
import { useAnnouncer as
|
|
19
|
-
import { getEventLabel as
|
|
20
|
-
function
|
|
14
|
+
import { UnavailabilityOverlay as Vt } from "../shared/UnavailabilityOverlay.js";
|
|
15
|
+
import { NowIndicator as Kt } from "../shared/NowIndicator.js";
|
|
16
|
+
import { AllDayRow as Pt } from "../shared/AllDayRow.js";
|
|
17
|
+
import { useEffectiveHourHeight as zt } from "../shared/useEffectiveHourHeight.js";
|
|
18
|
+
import { useInitialScroll as Ft } from "../shared/useInitialScroll.js";
|
|
19
|
+
import { useAnnouncer as qt } from "../shared/useAnnouncer.js";
|
|
20
|
+
import { getEventLabel as Y, getClientNameLabel as _ } from "../../lib/accessibility.js";
|
|
21
|
+
function fe({
|
|
21
22
|
date: a,
|
|
22
|
-
timeZone:
|
|
23
|
+
timeZone: n,
|
|
23
24
|
resources: r,
|
|
24
25
|
events: E,
|
|
25
26
|
availability: T,
|
|
26
27
|
unavailability: w,
|
|
27
28
|
defaultUnavailable: v,
|
|
28
29
|
timeAxis: C,
|
|
29
|
-
initialScrollHour:
|
|
30
|
+
initialScrollHour: U,
|
|
30
31
|
onEventClick: j,
|
|
31
|
-
snapDuration:
|
|
32
|
-
placeholderDuration:
|
|
32
|
+
snapDuration: N,
|
|
33
|
+
placeholderDuration: Z,
|
|
33
34
|
selectedRange: f,
|
|
34
|
-
onSelect:
|
|
35
|
+
onSelect: m,
|
|
35
36
|
onSlotClick: S,
|
|
36
|
-
className:
|
|
37
|
-
classNames:
|
|
38
|
-
hourHeight:
|
|
39
|
-
columnMinWidth:
|
|
40
|
-
renderHeader:
|
|
37
|
+
className: tt,
|
|
38
|
+
classNames: L,
|
|
39
|
+
hourHeight: et = 60,
|
|
40
|
+
columnMinWidth: ot = 120,
|
|
41
|
+
renderHeader: rt,
|
|
41
42
|
renderEvent: D,
|
|
42
|
-
selectionAppearance:
|
|
43
|
-
dragPreviewAppearance:
|
|
43
|
+
selectionAppearance: it,
|
|
44
|
+
dragPreviewAppearance: nt,
|
|
44
45
|
selectionRef: lt,
|
|
45
46
|
selectionLingerMs: k = 0,
|
|
46
47
|
selectedEventId: B,
|
|
47
48
|
selectedEventRef: M,
|
|
48
|
-
renderCorner:
|
|
49
|
-
|
|
49
|
+
renderCorner: at,
|
|
50
|
+
formatGutterLabel: O,
|
|
51
|
+
eventGap: mt,
|
|
50
52
|
eventLayout: dt = "columns",
|
|
51
53
|
stackOffset: ct = 8,
|
|
52
|
-
eventMinWidth:
|
|
53
|
-
eventMaxStack:
|
|
54
|
-
onOverflowClick:
|
|
55
|
-
renderOverflowPopover:
|
|
54
|
+
eventMinWidth: st,
|
|
55
|
+
eventMaxStack: ut,
|
|
56
|
+
onOverflowClick: W,
|
|
57
|
+
renderOverflowPopover: ft
|
|
56
58
|
}) {
|
|
57
|
-
const
|
|
59
|
+
const d = C?.startHour ?? 0, c = C?.endHour ?? 24, I = C?.intervalMinutes ?? 60, {
|
|
58
60
|
effectiveHourHeight: s,
|
|
59
|
-
rootRef:
|
|
60
|
-
headerRef:
|
|
61
|
-
allDayRef:
|
|
62
|
-
gridRef:
|
|
63
|
-
headerHeight:
|
|
64
|
-
containerHeight:
|
|
65
|
-
} =
|
|
66
|
-
|
|
67
|
-
rootRef:
|
|
68
|
-
initialScrollHour:
|
|
69
|
-
startHour:
|
|
70
|
-
endHour:
|
|
61
|
+
rootRef: A,
|
|
62
|
+
headerRef: pt,
|
|
63
|
+
allDayRef: ht,
|
|
64
|
+
gridRef: gt,
|
|
65
|
+
headerHeight: G,
|
|
66
|
+
containerHeight: yt
|
|
67
|
+
} = zt(et, c - d);
|
|
68
|
+
Ft({
|
|
69
|
+
rootRef: A,
|
|
70
|
+
initialScrollHour: U,
|
|
71
|
+
startHour: d,
|
|
72
|
+
endHour: c,
|
|
71
73
|
effectiveHourHeight: s,
|
|
72
|
-
containerHeight:
|
|
74
|
+
containerHeight: yt,
|
|
73
75
|
scrollKey: a.toString()
|
|
74
76
|
});
|
|
75
77
|
const i = y(
|
|
76
|
-
(t) => x(
|
|
77
|
-
[
|
|
78
|
-
), b =
|
|
78
|
+
(t) => x(Bt[t], L?.[t]),
|
|
79
|
+
[L]
|
|
80
|
+
), b = J(null), h = J(null), [Tt, V] = It(
|
|
79
81
|
null
|
|
80
82
|
);
|
|
81
|
-
|
|
83
|
+
Q(() => {
|
|
82
84
|
if (f)
|
|
83
85
|
h.current !== null && (clearTimeout(h.current), h.current = null), b.current = f;
|
|
84
86
|
else if (b.current && k > 0) {
|
|
85
87
|
const t = b.current;
|
|
86
|
-
b.current = null,
|
|
87
|
-
h.current = null,
|
|
88
|
+
b.current = null, V(t), h.current = setTimeout(() => {
|
|
89
|
+
h.current = null, V(null);
|
|
88
90
|
}, k);
|
|
89
91
|
}
|
|
90
92
|
}, [f, k]);
|
|
91
|
-
const H = f ??
|
|
92
|
-
() =>
|
|
93
|
-
[
|
|
94
|
-
), { allDayEvents:
|
|
93
|
+
const H = f ?? Tt, $ = p(
|
|
94
|
+
() => xt({ startHour: d, endHour: c, intervalMinutes: I }),
|
|
95
|
+
[d, c, I]
|
|
96
|
+
), { allDayEvents: K, timedEvents: P } = p(() => {
|
|
95
97
|
const t = [], e = [];
|
|
96
98
|
for (const o of E)
|
|
97
99
|
o.allDay ? t.push(o) : e.push(o);
|
|
98
100
|
return { allDayEvents: t, timedEvents: e };
|
|
99
|
-
}, [E]),
|
|
100
|
-
() =>
|
|
101
|
-
[
|
|
102
|
-
),
|
|
103
|
-
() =>
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
}, [E]), wt = p(
|
|
102
|
+
() => jt(K),
|
|
103
|
+
[K]
|
|
104
|
+
), vt = p(
|
|
105
|
+
() => Nt(
|
|
106
|
+
P,
|
|
107
|
+
n,
|
|
106
108
|
a,
|
|
109
|
+
d,
|
|
107
110
|
c,
|
|
108
|
-
m,
|
|
109
111
|
s
|
|
110
112
|
),
|
|
111
|
-
[
|
|
112
|
-
),
|
|
113
|
+
[P, n, a, d, c, s]
|
|
114
|
+
), bt = p(() => {
|
|
113
115
|
if (!v && !T && !w)
|
|
114
116
|
return /* @__PURE__ */ new Map();
|
|
115
117
|
const t = /* @__PURE__ */ new Set([
|
|
@@ -118,13 +120,13 @@ function me({
|
|
|
118
120
|
...v ? r.map((o) => o.id) : []
|
|
119
121
|
]), e = /* @__PURE__ */ new Map();
|
|
120
122
|
for (const o of t) {
|
|
121
|
-
const u = T?.[o], F =
|
|
123
|
+
const u = T?.[o], F = Lt(
|
|
122
124
|
v && u === void 0 ? [] : u,
|
|
123
125
|
w?.[o],
|
|
124
|
-
|
|
126
|
+
n,
|
|
125
127
|
a,
|
|
128
|
+
d,
|
|
126
129
|
c,
|
|
127
|
-
m,
|
|
128
130
|
s
|
|
129
131
|
);
|
|
130
132
|
F.length > 0 && e.set(o, F);
|
|
@@ -135,39 +137,39 @@ function me({
|
|
|
135
137
|
r,
|
|
136
138
|
T,
|
|
137
139
|
w,
|
|
138
|
-
|
|
140
|
+
n,
|
|
139
141
|
a,
|
|
142
|
+
d,
|
|
140
143
|
c,
|
|
141
|
-
m,
|
|
142
144
|
s
|
|
143
|
-
]), { message:
|
|
144
|
-
() => `Schedule for ${
|
|
145
|
+
]), { message: Ht, announce: g } = qt(), Rt = p(
|
|
146
|
+
() => `Schedule for ${Et(a)}`,
|
|
145
147
|
[a]
|
|
146
148
|
), z = y(
|
|
147
149
|
(t) => {
|
|
148
|
-
if (
|
|
149
|
-
const e = [
|
|
150
|
+
if (m?.(null), j?.(t), t.allDay) {
|
|
151
|
+
const e = [Y(t), "all day"], o = _(t);
|
|
150
152
|
o && e.push(o), g(`Selected: ${e.join(", ")}`);
|
|
151
153
|
} else {
|
|
152
154
|
const e = [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
], o =
|
|
155
|
+
Y(t),
|
|
156
|
+
X(t.startTime, t.endTime, n)
|
|
157
|
+
], o = _(t);
|
|
156
158
|
o && e.push(o);
|
|
157
159
|
const u = r.find((R) => R.id === t.resourceId);
|
|
158
160
|
u && e.push(u.name), g(`Selected: ${e.join(", ")}`);
|
|
159
161
|
}
|
|
160
162
|
},
|
|
161
|
-
[
|
|
162
|
-
),
|
|
163
|
+
[m, j, n, r, g]
|
|
164
|
+
), Ct = y(
|
|
163
165
|
(t) => {
|
|
164
|
-
|
|
166
|
+
m?.(null), W?.(t);
|
|
165
167
|
},
|
|
166
|
-
[
|
|
167
|
-
),
|
|
168
|
+
[m, W]
|
|
169
|
+
), St = y(
|
|
168
170
|
(t) => {
|
|
169
171
|
if (!t) {
|
|
170
|
-
|
|
172
|
+
m?.(null);
|
|
171
173
|
return;
|
|
172
174
|
}
|
|
173
175
|
const e = {
|
|
@@ -175,12 +177,12 @@ function me({
|
|
|
175
177
|
startTime: t.startTime,
|
|
176
178
|
endTime: t.endTime
|
|
177
179
|
};
|
|
178
|
-
|
|
179
|
-
const o = [
|
|
180
|
+
m?.(e);
|
|
181
|
+
const o = [X(t.startTime, t.endTime, n)], u = r.find((R) => R.id === t.columnId);
|
|
180
182
|
u && o.push(u.name), g(`Selected time: ${o.join(", ")}`);
|
|
181
183
|
},
|
|
182
|
-
[
|
|
183
|
-
),
|
|
184
|
+
[m, n, r, g]
|
|
185
|
+
), Dt = y(
|
|
184
186
|
(t) => {
|
|
185
187
|
const e = r.find((o) => o.id === t.columnId);
|
|
186
188
|
e && S?.({
|
|
@@ -191,74 +193,74 @@ function me({
|
|
|
191
193
|
},
|
|
192
194
|
[S, r]
|
|
193
195
|
);
|
|
194
|
-
|
|
195
|
-
if (!f || !
|
|
196
|
+
Q(() => {
|
|
197
|
+
if (!f || !m) return;
|
|
196
198
|
const t = (e) => {
|
|
197
|
-
e.key === "Escape" &&
|
|
199
|
+
e.key === "Escape" && m(null);
|
|
198
200
|
};
|
|
199
201
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
200
|
-
}, [f,
|
|
201
|
-
const
|
|
202
|
-
return /* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
202
|
+
}, [f, m]);
|
|
203
|
+
const kt = s * I / 60;
|
|
204
|
+
return /* @__PURE__ */ q("div", { ref: A, className: x(i("root"), tt), children: [
|
|
205
|
+
/* @__PURE__ */ q(
|
|
204
206
|
"div",
|
|
205
207
|
{
|
|
206
|
-
ref:
|
|
208
|
+
ref: gt,
|
|
207
209
|
className: i("grid"),
|
|
208
210
|
role: "region",
|
|
209
211
|
"aria-roledescription": "calendar",
|
|
210
|
-
"aria-label":
|
|
212
|
+
"aria-label": Rt,
|
|
211
213
|
style: {
|
|
212
214
|
display: "grid",
|
|
213
|
-
gridTemplateColumns: `max-content repeat(${r.length}, minmax(${
|
|
214
|
-
gridTemplateRows: `auto auto repeat(${$.length}, ${
|
|
215
|
+
gridTemplateColumns: `max-content repeat(${r.length}, minmax(${ot}px, 1fr))`,
|
|
216
|
+
gridTemplateRows: `auto auto repeat(${$.length}, ${kt}px)`
|
|
215
217
|
},
|
|
216
218
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ l(
|
|
218
220
|
"div",
|
|
219
221
|
{
|
|
220
|
-
ref:
|
|
222
|
+
ref: pt,
|
|
221
223
|
className: i("cornerCell"),
|
|
222
224
|
style: { gridRow: 1, gridColumn: 1 },
|
|
223
|
-
children:
|
|
225
|
+
children: at?.({ timeZone: n, date: a })
|
|
224
226
|
}
|
|
225
227
|
),
|
|
226
|
-
r.map((t, e) => /* @__PURE__ */
|
|
227
|
-
|
|
228
|
+
r.map((t, e) => /* @__PURE__ */ l(
|
|
229
|
+
Mt,
|
|
228
230
|
{
|
|
229
231
|
resource: t,
|
|
230
232
|
column: e + 2,
|
|
231
233
|
cls: i,
|
|
232
|
-
renderHeader:
|
|
234
|
+
renderHeader: rt
|
|
233
235
|
},
|
|
234
236
|
t.id
|
|
235
237
|
)),
|
|
236
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ l(
|
|
237
239
|
"div",
|
|
238
240
|
{
|
|
239
|
-
ref:
|
|
241
|
+
ref: ht,
|
|
240
242
|
className: x(i("allDayCell"), "left-0 z-30"),
|
|
241
243
|
style: {
|
|
242
244
|
gridRow: 2,
|
|
243
245
|
gridColumn: 1,
|
|
244
|
-
top:
|
|
246
|
+
top: G
|
|
245
247
|
}
|
|
246
248
|
}
|
|
247
249
|
),
|
|
248
|
-
r.map((t, e) => /* @__PURE__ */
|
|
250
|
+
r.map((t, e) => /* @__PURE__ */ l(
|
|
249
251
|
"div",
|
|
250
252
|
{
|
|
251
253
|
className: i("allDayCell"),
|
|
252
254
|
style: {
|
|
253
255
|
gridRow: 2,
|
|
254
256
|
gridColumn: e + 2,
|
|
255
|
-
top:
|
|
257
|
+
top: G,
|
|
256
258
|
...e === r.length - 1 ? { borderRightWidth: 0 } : {}
|
|
257
259
|
},
|
|
258
|
-
children: /* @__PURE__ */
|
|
259
|
-
|
|
260
|
+
children: /* @__PURE__ */ l(
|
|
261
|
+
Pt,
|
|
260
262
|
{
|
|
261
|
-
events:
|
|
263
|
+
events: wt.get(t.id) ?? [],
|
|
262
264
|
cls: i,
|
|
263
265
|
onEventClick: z,
|
|
264
266
|
selectedEventId: B,
|
|
@@ -268,10 +270,15 @@ function me({
|
|
|
268
270
|
},
|
|
269
271
|
`allday-${t.id}`
|
|
270
272
|
)),
|
|
271
|
-
$.map((t) => /* @__PURE__ */
|
|
272
|
-
|
|
273
|
+
$.map((t) => /* @__PURE__ */ l(
|
|
274
|
+
Wt,
|
|
273
275
|
{
|
|
274
|
-
label:
|
|
276
|
+
label: O ? O(
|
|
277
|
+
$t.PlainTime.from({
|
|
278
|
+
hour: t.hour,
|
|
279
|
+
minute: t.minute
|
|
280
|
+
})
|
|
281
|
+
) : t.label,
|
|
275
282
|
row: t.index + 3,
|
|
276
283
|
isHourStart: t.isHourStart,
|
|
277
284
|
isFirst: t.index === 0,
|
|
@@ -280,7 +287,7 @@ function me({
|
|
|
280
287
|
t.index
|
|
281
288
|
)),
|
|
282
289
|
$.map(
|
|
283
|
-
(t) => r.map((e, o) => /* @__PURE__ */
|
|
290
|
+
(t) => r.map((e, o) => /* @__PURE__ */ l(
|
|
284
291
|
"div",
|
|
285
292
|
{
|
|
286
293
|
className: i(t.isHourStart ? "bodyCell" : "bodyCellMinor"),
|
|
@@ -296,9 +303,9 @@ function me({
|
|
|
296
303
|
))
|
|
297
304
|
),
|
|
298
305
|
r.map((t, e) => {
|
|
299
|
-
const o =
|
|
300
|
-
return o ? /* @__PURE__ */
|
|
301
|
-
|
|
306
|
+
const o = bt.get(t.id);
|
|
307
|
+
return o ? /* @__PURE__ */ l(
|
|
308
|
+
Vt,
|
|
302
309
|
{
|
|
303
310
|
blocks: o,
|
|
304
311
|
column: e + 2,
|
|
@@ -307,46 +314,46 @@ function me({
|
|
|
307
314
|
`unavail-${t.id}`
|
|
308
315
|
) : null;
|
|
309
316
|
}),
|
|
310
|
-
|
|
311
|
-
|
|
317
|
+
N != null && r.map((t, e) => /* @__PURE__ */ l(
|
|
318
|
+
At,
|
|
312
319
|
{
|
|
313
320
|
columnId: t.id,
|
|
314
321
|
fallbackColor: t.color,
|
|
315
322
|
column: e + 2,
|
|
316
323
|
date: a,
|
|
317
|
-
timeZone:
|
|
318
|
-
startHour:
|
|
319
|
-
endHour:
|
|
324
|
+
timeZone: n,
|
|
325
|
+
startHour: d,
|
|
326
|
+
endHour: c,
|
|
320
327
|
hourHeight: s,
|
|
321
|
-
snapDuration:
|
|
322
|
-
placeholderDuration:
|
|
328
|
+
snapDuration: N,
|
|
329
|
+
placeholderDuration: Z ?? 15,
|
|
323
330
|
cls: i,
|
|
324
|
-
onSlotClick: S ?
|
|
325
|
-
onSelect:
|
|
326
|
-
dragPreviewAppearance:
|
|
331
|
+
onSlotClick: S ? Dt : void 0,
|
|
332
|
+
onSelect: m ? St : void 0,
|
|
333
|
+
dragPreviewAppearance: nt,
|
|
327
334
|
renderEvent: D
|
|
328
335
|
},
|
|
329
336
|
`slot-${t.id}`
|
|
330
337
|
)),
|
|
331
|
-
r.map((t, e) => /* @__PURE__ */
|
|
332
|
-
|
|
338
|
+
r.map((t, e) => /* @__PURE__ */ l(
|
|
339
|
+
Ot,
|
|
333
340
|
{
|
|
334
341
|
resource: t,
|
|
335
|
-
positionedEvents:
|
|
342
|
+
positionedEvents: vt.get(t.id) ?? [],
|
|
336
343
|
column: e + 2,
|
|
337
|
-
timeZone:
|
|
344
|
+
timeZone: n,
|
|
338
345
|
cls: i,
|
|
339
346
|
onEventClick: z,
|
|
340
347
|
renderEvent: D,
|
|
341
|
-
eventGap:
|
|
348
|
+
eventGap: mt,
|
|
342
349
|
eventLayout: dt,
|
|
343
350
|
stackOffset: ct,
|
|
344
351
|
selectedEventId: B,
|
|
345
352
|
selectedEventRef: M,
|
|
346
|
-
eventMinWidth:
|
|
347
|
-
eventMaxStack:
|
|
348
|
-
onOverflowClick:
|
|
349
|
-
renderOverflowPopover:
|
|
353
|
+
eventMinWidth: st,
|
|
354
|
+
eventMaxStack: ut,
|
|
355
|
+
onOverflowClick: Ct,
|
|
356
|
+
renderOverflowPopover: ft
|
|
350
357
|
},
|
|
351
358
|
t.id
|
|
352
359
|
)),
|
|
@@ -354,7 +361,7 @@ function me({
|
|
|
354
361
|
const t = r.findIndex(
|
|
355
362
|
(e) => e.id === H.resourceId
|
|
356
363
|
);
|
|
357
|
-
return t === -1 ? null : /* @__PURE__ */
|
|
364
|
+
return t === -1 ? null : /* @__PURE__ */ l(
|
|
358
365
|
Gt,
|
|
359
366
|
{
|
|
360
367
|
startTime: H.startTime,
|
|
@@ -362,23 +369,24 @@ function me({
|
|
|
362
369
|
fallbackColor: r[t].color,
|
|
363
370
|
column: t + 2,
|
|
364
371
|
viewDate: a,
|
|
365
|
-
timeZone:
|
|
366
|
-
startHour:
|
|
372
|
+
timeZone: n,
|
|
373
|
+
startHour: d,
|
|
374
|
+
endHour: c,
|
|
367
375
|
hourHeight: s,
|
|
368
376
|
cls: i,
|
|
369
|
-
appearance:
|
|
377
|
+
appearance: it,
|
|
370
378
|
selectionRef: lt,
|
|
371
379
|
renderEvent: D
|
|
372
380
|
}
|
|
373
381
|
);
|
|
374
382
|
})(),
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
|
|
383
|
+
/* @__PURE__ */ l(
|
|
384
|
+
Kt,
|
|
377
385
|
{
|
|
378
386
|
date: a,
|
|
379
|
-
timeZone:
|
|
380
|
-
startHour:
|
|
381
|
-
endHour:
|
|
387
|
+
timeZone: n,
|
|
388
|
+
startHour: d,
|
|
389
|
+
endHour: c,
|
|
382
390
|
hourHeight: s,
|
|
383
391
|
cls: i
|
|
384
392
|
}
|
|
@@ -386,7 +394,7 @@ function me({
|
|
|
386
394
|
]
|
|
387
395
|
}
|
|
388
396
|
),
|
|
389
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ l(
|
|
390
398
|
"div",
|
|
391
399
|
{
|
|
392
400
|
"aria-live": "polite",
|
|
@@ -403,11 +411,11 @@ function me({
|
|
|
403
411
|
whiteSpace: "nowrap",
|
|
404
412
|
borderWidth: 0
|
|
405
413
|
},
|
|
406
|
-
children:
|
|
414
|
+
children: Ht
|
|
407
415
|
}
|
|
408
416
|
)
|
|
409
417
|
] });
|
|
410
418
|
}
|
|
411
419
|
export {
|
|
412
|
-
|
|
420
|
+
fe as ResourceGridView
|
|
413
421
|
};
|
|
@@ -24,7 +24,7 @@ const e = {
|
|
|
24
24
|
unavailableOverlay: "cal-unavailable-overlay",
|
|
25
25
|
overflowChip: "absolute right-0.5 min-w-9 h-[22px] p-0 border-0 cursor-pointer select-none text-center rounded-md bg-cal-surface ring-1 ring-cal-event-ring shadow-lg shadow-cal-event-shadow hover:ring-cal-event-ring-selected",
|
|
26
26
|
overflowChipLabel: "block px-1 py-0.5 text-cal-text-body text-xs/4 font-medium",
|
|
27
|
-
overflowPopover: "w-64 rounded-lg bg-cal-surface p-1 shadow-lg shadow-cal-event-shadow ring-1 ring-cal-event-ring max-h-
|
|
27
|
+
overflowPopover: "w-64 rounded-lg bg-cal-surface p-1 shadow-lg shadow-cal-event-shadow ring-1 ring-cal-event-ring max-h-[min(20rem,calc(100dvh-1rem))] overflow-auto",
|
|
28
28
|
overflowPopoverEvent: "block w-full rounded-md px-2 py-1.5 text-left cursor-pointer hover:bg-cal-event-bg",
|
|
29
29
|
overflowPopoverTitle: "text-cal-text-body text-xs/4 font-medium truncate",
|
|
30
30
|
overflowPopoverTime: "text-cal-text-muted text-xs/4"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Marks empty grid surfaces (time slots, day cells). While a popover is
|
|
4
|
+
* open, a press on one only dismisses the popover; it doesn't also start
|
|
5
|
+
* a selection or fire a slot click underneath.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DISMISS_ONLY_ATTR = "data-popover-dismiss-only";
|
|
8
|
+
interface PopoverPosition {
|
|
9
|
+
top: number;
|
|
10
|
+
left: number;
|
|
11
|
+
}
|
|
12
|
+
interface AnchoredPopoverProps {
|
|
13
|
+
/** The element that opened the popover. Presses on it aren't treated as outside presses, and focus returns to it on Escape. */
|
|
14
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
/** Viewport position for the popover, given its rendered size. */
|
|
17
|
+
getPosition: (size: {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
}) => PopoverPosition | null;
|
|
21
|
+
ariaLabel: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A fixed-position dialog for overflow lists. Mount it while open. It
|
|
27
|
+
* portals to document.body so no ancestor's clipping, stacking, or
|
|
28
|
+
* transform can trap it, and copies the `.dark` class when the trigger
|
|
29
|
+
* is inside a dark-mode scope. Escape closes only this popover; focus
|
|
30
|
+
* moves in on open and back to the trigger on Escape or when the popover
|
|
31
|
+
* unmounts with focus inside.
|
|
32
|
+
*/
|
|
33
|
+
export declare function AnchoredPopover({ triggerRef, onClose, getPosition, ariaLabel, className, children, }: AnchoredPopoverProps): import('react').ReactPortal | null;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=AnchoredPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchoredPopover.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnchoredPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAqB7D,UAAU,eAAe;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,oBAAoB;IAC5B,+HAA+H;IAC/H,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kEAAkE;IAClE,WAAW,EAAE,CAAC,IAAI,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,KAAK,eAAe,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,QAAQ,GACT,EAAE,oBAAoB,sCAsHtB"}
|