@innosolutions/inno-calendar 1.0.42 → 1.0.45
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/{agenda-widget-T3gRKIGT.js → agenda-widget-55kGr5r1.js} +575 -538
- package/dist/agenda-widget-55kGr5r1.js.map +1 -0
- package/dist/agenda-widget-BoBAv_EB.cjs +2 -0
- package/dist/agenda-widget-BoBAv_EB.cjs.map +1 -0
- package/dist/components/header/calendar-header.d.ts.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/{tailwind-calendar-D8KhczoX.js → tailwind-calendar-C3pTnlko.js} +2 -2
- package/dist/{tailwind-calendar-D8KhczoX.js.map → tailwind-calendar-C3pTnlko.js.map} +1 -1
- package/dist/{tailwind-calendar-BxJipbwX.cjs → tailwind-calendar-e6gekmW5.cjs} +2 -2
- package/dist/{tailwind-calendar-BxJipbwX.cjs.map → tailwind-calendar-e6gekmW5.cjs.map} +1 -1
- package/dist/week-view-DYhRfubT.cjs +11 -0
- package/dist/week-view-DYhRfubT.cjs.map +1 -0
- package/dist/{week-view-DkcVXsF-.js → week-view-DbktCaJh.js} +653 -650
- package/dist/week-view-DbktCaJh.js.map +1 -0
- package/package.json +2 -2
- package/dist/agenda-widget-DgFecsZZ.cjs +0 -2
- package/dist/agenda-widget-DgFecsZZ.cjs.map +0 -1
- package/dist/agenda-widget-T3gRKIGT.js.map +0 -1
- package/dist/week-view-DkcVXsF-.js.map +0 -1
- package/dist/week-view-ICpX-1oo.cjs +0 -11
- package/dist/week-view-ICpX-1oo.cjs.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as pt } from "react/jsx-runtime";
|
|
2
2
|
import * as ee from "react";
|
|
3
|
-
import { useState as J, useCallback as
|
|
3
|
+
import { useState as J, useCallback as W, useRef as te, forwardRef as $e, createElement as Le, useMemo as F, useLayoutEffect as Ie, useEffect as Ae } from "react";
|
|
4
4
|
import { c as d, a as ft } from "./index-DtaLkIY8.js";
|
|
5
5
|
import * as V from "@radix-ui/react-dropdown-menu";
|
|
6
6
|
import { formatEventTimeDisplay as X, getEventsCountInView as gt, getRangeText as xt, groupEventsByDate as yt, isToday as ce, detectAllDayEvent as De, isSameDay as le, getEventsForDay as He, separateEventsByDuration as rt, calculateOverlappingPositions as ot, getVisibleHoursArray as at, isWorkingHour as it, formatHourLabel as Ce, generateMonthGrid as bt, startOfDay as Ge, getWeekDays as wt } from "./utils.mjs";
|
|
7
|
-
import { a as Re, b as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
const re =
|
|
11
|
-
|
|
7
|
+
import { a as Re, b as Oe } from "./slot-selection-context-D2eu2o-7.js";
|
|
8
|
+
import * as pe from "@radix-ui/react-popover";
|
|
9
|
+
import * as be from "@radix-ui/react-tooltip";
|
|
10
|
+
const re = pe.Root, oe = pe.Trigger, Nn = pe.Anchor, Q = ee.forwardRef(({ className: t, align: n = "center", sideOffset: o = 4, ...a }, i) => /* @__PURE__ */ e(pe.Portal, { children: /* @__PURE__ */ e(
|
|
11
|
+
pe.Content,
|
|
12
12
|
{
|
|
13
13
|
ref: i,
|
|
14
14
|
align: n,
|
|
@@ -20,9 +20,9 @@ const re = he.Root, oe = he.Trigger, vn = he.Anchor, Q = ee.forwardRef(({ classN
|
|
|
20
20
|
...a
|
|
21
21
|
}
|
|
22
22
|
) }));
|
|
23
|
-
Q.displayName =
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
Q.displayName = pe.Content.displayName;
|
|
24
|
+
const kn = be.Provider, ie = be.Root, se = be.Trigger, ne = ee.forwardRef(({ className: t, sideOffset: n = 4, ...o }, a) => /* @__PURE__ */ e(
|
|
25
|
+
be.Content,
|
|
26
26
|
{
|
|
27
27
|
ref: a,
|
|
28
28
|
sideOffset: n,
|
|
@@ -33,7 +33,7 @@ const Nn = ye.Provider, ie = ye.Root, se = ye.Trigger, ne = ee.forwardRef(({ cla
|
|
|
33
33
|
...o
|
|
34
34
|
}
|
|
35
35
|
));
|
|
36
|
-
ne.displayName =
|
|
36
|
+
ne.displayName = be.Content.displayName;
|
|
37
37
|
function de(t) {
|
|
38
38
|
return {
|
|
39
39
|
blue: {
|
|
@@ -118,7 +118,7 @@ function de(t) {
|
|
|
118
118
|
}
|
|
119
119
|
}[t ?? "blue"];
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function je(t) {
|
|
122
122
|
const n = new Date(t);
|
|
123
123
|
return n.setHours(0, 0, 0, 0), n;
|
|
124
124
|
}
|
|
@@ -128,39 +128,39 @@ function Se({
|
|
|
128
128
|
badgeVariant: o = "colored",
|
|
129
129
|
onClick: a,
|
|
130
130
|
className: i,
|
|
131
|
-
showTime:
|
|
131
|
+
showTime: f = !0,
|
|
132
132
|
showDescription: s = !1,
|
|
133
|
-
showParticipants:
|
|
134
|
-
style:
|
|
133
|
+
showParticipants: x = !1,
|
|
134
|
+
style: N,
|
|
135
135
|
disablePopover: l = !1,
|
|
136
|
-
renderPopover:
|
|
137
|
-
enableDrag:
|
|
136
|
+
renderPopover: y,
|
|
137
|
+
enableDrag: v = !1,
|
|
138
138
|
enablePageTransition: m = !1,
|
|
139
139
|
pageTransitionDuration: g = 400
|
|
140
140
|
}) {
|
|
141
|
-
const u = de(t.color), [
|
|
142
|
-
if (!
|
|
141
|
+
const u = de(t.color), [b, w] = J(!1), [L, T] = J(!1), [A, O] = J(!1), [B, E] = J(null), M = te(null), I = Re(), S = t.endDate < je(/* @__PURE__ */ new Date()), $ = t.isCanceled ?? !1, q = v && I && !$ && !S, D = t.data, h = D?.meetingTookPlace ?? t.meetingTookPlace ?? !1, _ = $ ? /* @__PURE__ */ e(Nt, { className: "h-3 w-3 text-zinc-800 dark:text-zinc-200" }) : h ? /* @__PURE__ */ e(vt, { className: d("h-3 w-3", u.text) }) : null, R = t.scheduleTypeName || D?.scheduleTypeName || D?.typeName, P = D?.productName, k = D?.nrParticipant, c = D?.siteName, p = D?.siteCity, C = [c, p].filter(Boolean).join(", "), H = W(() => {
|
|
142
|
+
if (!L) {
|
|
143
143
|
if (l && a) {
|
|
144
144
|
a(t);
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
if (m && M.current) {
|
|
148
148
|
const U = M.current.getBoundingClientRect();
|
|
149
|
-
|
|
150
|
-
} else l ||
|
|
149
|
+
E(U), O(!0);
|
|
150
|
+
} else l || w(!0);
|
|
151
151
|
}
|
|
152
|
-
}, [
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
}, [L, l, a, t, m]);
|
|
153
|
+
W(() => {
|
|
154
|
+
O(!1), E(null), l || w(!0);
|
|
155
155
|
}, [l]);
|
|
156
|
-
const z =
|
|
157
|
-
|
|
158
|
-
}, []), Y =
|
|
156
|
+
const z = W(() => {
|
|
157
|
+
w(!1);
|
|
158
|
+
}, []), Y = W(
|
|
159
159
|
(U) => {
|
|
160
160
|
q && (U.dataTransfer.effectAllowed = "move", U.dataTransfer.setData("text/plain", t.id), T(!0), I?.startDrag?.(t));
|
|
161
161
|
},
|
|
162
162
|
[q, t, I]
|
|
163
|
-
),
|
|
163
|
+
), j = W(() => {
|
|
164
164
|
T(!1), I?.isDragging && I.endDrag?.();
|
|
165
165
|
}, [I]);
|
|
166
166
|
if (n === "dot") {
|
|
@@ -175,7 +175,7 @@ function Se({
|
|
|
175
175
|
t.isCanceled && "opacity-50",
|
|
176
176
|
i
|
|
177
177
|
),
|
|
178
|
-
style:
|
|
178
|
+
style: N,
|
|
179
179
|
"aria-label": t.title
|
|
180
180
|
}
|
|
181
181
|
);
|
|
@@ -185,12 +185,12 @@ function Se({
|
|
|
185
185
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
186
186
|
/* @__PURE__ */ e("div", { className: "text-xs opacity-80", children: X(t) })
|
|
187
187
|
] }) })
|
|
188
|
-
] }) : /* @__PURE__ */ r(re, { open:
|
|
188
|
+
] }) : /* @__PURE__ */ r(re, { open: b, onOpenChange: w, children: [
|
|
189
189
|
/* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ r(ie, { children: [
|
|
190
190
|
/* @__PURE__ */ e(se, { asChild: !0, children: U }),
|
|
191
191
|
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e("div", { className: "font-medium", children: t.title }) })
|
|
192
192
|
] }) }),
|
|
193
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children:
|
|
193
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: z }) : /* @__PURE__ */ e(ye, { event: t, onClose: z }) })
|
|
194
194
|
] });
|
|
195
195
|
}
|
|
196
196
|
if (n === "compact") {
|
|
@@ -201,7 +201,7 @@ function Se({
|
|
|
201
201
|
tabIndex: 0,
|
|
202
202
|
draggable: !!q,
|
|
203
203
|
onDragStart: Y,
|
|
204
|
-
onDragEnd:
|
|
204
|
+
onDragEnd: j,
|
|
205
205
|
onClick: l ? H : void 0,
|
|
206
206
|
onKeyDown: (K) => {
|
|
207
207
|
(K.key === "Enter" || K.key === " ") && (K.preventDefault(), H());
|
|
@@ -209,7 +209,7 @@ function Se({
|
|
|
209
209
|
className: d(
|
|
210
210
|
"group flex w-full relative items-center shadow-[0_0_1px_rgba(0,0,0,0.3)] gap-0 rounded px-1.5 py-1 text-left text-xs transition-colors hover:opacity-80",
|
|
211
211
|
q ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
|
|
212
|
-
|
|
212
|
+
L && "opacity-50",
|
|
213
213
|
// Cancelled events get gray background with strikethrough
|
|
214
214
|
$ || // Past events get neutral zinc styling
|
|
215
215
|
S ? "bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 line-through" : [
|
|
@@ -219,7 +219,7 @@ function Se({
|
|
|
219
219
|
],
|
|
220
220
|
i
|
|
221
221
|
),
|
|
222
|
-
style:
|
|
222
|
+
style: N,
|
|
223
223
|
children: [
|
|
224
224
|
["dot", "mixed"].includes(o) && !S && /* @__PURE__ */ e(
|
|
225
225
|
"svg",
|
|
@@ -261,7 +261,7 @@ function Se({
|
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
] }) }),
|
|
264
|
-
/* @__PURE__ */ e("div", { className: "flex gap-0.5", children:
|
|
264
|
+
/* @__PURE__ */ e("div", { className: "flex gap-0.5", children: _ })
|
|
265
265
|
]
|
|
266
266
|
}
|
|
267
267
|
);
|
|
@@ -271,9 +271,9 @@ function Se({
|
|
|
271
271
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
272
272
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) })
|
|
273
273
|
] }) })
|
|
274
|
-
] }) : /* @__PURE__ */ r(re, { open:
|
|
274
|
+
] }) : /* @__PURE__ */ r(re, { open: b, onOpenChange: w, children: [
|
|
275
275
|
/* @__PURE__ */ e(oe, { asChild: !0, children: U }),
|
|
276
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children:
|
|
276
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: z }) : /* @__PURE__ */ e(ye, { event: t, onClose: z }) })
|
|
277
277
|
] });
|
|
278
278
|
}
|
|
279
279
|
const G = /* @__PURE__ */ r(
|
|
@@ -302,7 +302,7 @@ function Se({
|
|
|
302
302
|
],
|
|
303
303
|
i
|
|
304
304
|
),
|
|
305
|
-
style:
|
|
305
|
+
style: N,
|
|
306
306
|
children: [
|
|
307
307
|
/* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-1", children: [
|
|
308
308
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
@@ -337,18 +337,18 @@ function Se({
|
|
|
337
337
|
}
|
|
338
338
|
)
|
|
339
339
|
] }),
|
|
340
|
-
|
|
340
|
+
_
|
|
341
341
|
] }),
|
|
342
342
|
P && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: P }),
|
|
343
|
-
|
|
344
|
-
/* @__PURE__ */ e(
|
|
343
|
+
k != null && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
344
|
+
/* @__PURE__ */ e(Ee, { className: "h-3 w-3 shrink-0" }),
|
|
345
345
|
/* @__PURE__ */ r("span", { children: [
|
|
346
|
-
|
|
346
|
+
k,
|
|
347
347
|
" participant",
|
|
348
|
-
|
|
348
|
+
k !== 1 ? "s" : ""
|
|
349
349
|
] })
|
|
350
350
|
] }),
|
|
351
|
-
|
|
351
|
+
f && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
352
352
|
/* @__PURE__ */ e(Pe, { className: "h-3 w-3 shrink-0" }),
|
|
353
353
|
/* @__PURE__ */ e("span", { children: X(t) })
|
|
354
354
|
] }),
|
|
@@ -357,8 +357,8 @@ function Se({
|
|
|
357
357
|
/* @__PURE__ */ e("span", { className: "truncate", children: C })
|
|
358
358
|
] }),
|
|
359
359
|
s && t.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: t.description }),
|
|
360
|
-
|
|
361
|
-
/* @__PURE__ */ e(
|
|
360
|
+
x && t.participants && t.participants.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
361
|
+
/* @__PURE__ */ e(Ee, { className: "h-3 w-3 shrink-0" }),
|
|
362
362
|
/* @__PURE__ */ e("span", { className: "truncate", children: t.participants.map((U) => U.name).join(", ") })
|
|
363
363
|
] })
|
|
364
364
|
]
|
|
@@ -370,9 +370,9 @@ function Se({
|
|
|
370
370
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
371
371
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) })
|
|
372
372
|
] }) })
|
|
373
|
-
] }) : /* @__PURE__ */ r(re, { open:
|
|
373
|
+
] }) : /* @__PURE__ */ r(re, { open: b, onOpenChange: w, children: [
|
|
374
374
|
/* @__PURE__ */ e(oe, { asChild: !0, children: G }),
|
|
375
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children:
|
|
375
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: z }) : /* @__PURE__ */ e(ye, { event: t, onClose: z }) })
|
|
376
376
|
] });
|
|
377
377
|
}
|
|
378
378
|
function Pe({ className: t }) {
|
|
@@ -429,7 +429,7 @@ function Nt({ className: t }) {
|
|
|
429
429
|
}
|
|
430
430
|
);
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function Ee({ className: t }) {
|
|
433
433
|
return /* @__PURE__ */ r(
|
|
434
434
|
"svg",
|
|
435
435
|
{
|
|
@@ -469,7 +469,7 @@ function st({ className: t }) {
|
|
|
469
469
|
}
|
|
470
470
|
);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function ye({
|
|
473
473
|
event: t,
|
|
474
474
|
onClose: n
|
|
475
475
|
}) {
|
|
@@ -517,30 +517,30 @@ function lt({
|
|
|
517
517
|
hourHeight: o = 96,
|
|
518
518
|
badgeVariant: a = "colored",
|
|
519
519
|
onClick: i,
|
|
520
|
-
className:
|
|
520
|
+
className: f,
|
|
521
521
|
disablePopover: s = !1,
|
|
522
|
-
renderPopover:
|
|
523
|
-
enableDrag:
|
|
522
|
+
renderPopover: x,
|
|
523
|
+
enableDrag: N = !0
|
|
524
524
|
}) {
|
|
525
|
-
const l = de(t.color), [
|
|
526
|
-
m || (s && i ? i(t) : s ||
|
|
527
|
-
}, [m, s, i, t]), P =
|
|
528
|
-
|
|
529
|
-
}, []),
|
|
525
|
+
const l = de(t.color), [y, v] = J(!1), [m, g] = J(!1), u = Re(), b = (t.endDate.getTime() - t.startDate.getTime()) / (1e3 * 60), w = b / 60 * o - 8, L = t.endDate < je(/* @__PURE__ */ new Date()), T = t.isCanceled ?? !1, A = N && u && !T && !L, O = b < 35, B = b > 25, E = b >= 45, M = t.data, I = t.scheduleTypeName || M?.scheduleTypeName || M?.typeName, S = M?.productName, $ = M?.nrParticipant, q = M?.siteName, D = M?.siteCity, h = [q, D].filter(Boolean).join(", "), _ = a === "dot", R = W(() => {
|
|
526
|
+
m || (s && i ? i(t) : s || v(!0));
|
|
527
|
+
}, [m, s, i, t]), P = W(() => {
|
|
528
|
+
v(!1);
|
|
529
|
+
}, []), k = W(
|
|
530
530
|
(z) => {
|
|
531
531
|
if (!A) return;
|
|
532
532
|
z.dataTransfer.effectAllowed = "move", z.dataTransfer.setData("text/plain", t.id);
|
|
533
|
-
const Y = z.currentTarget,
|
|
533
|
+
const Y = z.currentTarget, j = Y.getBoundingClientRect();
|
|
534
534
|
z.dataTransfer.setDragImage(
|
|
535
535
|
Y,
|
|
536
|
-
z.clientX -
|
|
537
|
-
z.clientY -
|
|
536
|
+
z.clientX - j.left,
|
|
537
|
+
z.clientY - j.top
|
|
538
538
|
), g(!0), u?.startDrag?.(t);
|
|
539
539
|
},
|
|
540
540
|
[A, t, u]
|
|
541
|
-
), c =
|
|
541
|
+
), c = W(() => {
|
|
542
542
|
g(!1), u?.isDragging && u.endDrag?.();
|
|
543
|
-
}, [u]),
|
|
543
|
+
}, [u]), p = W(
|
|
544
544
|
(z) => {
|
|
545
545
|
(z.key === "Enter" || z.key === " ") && (z.preventDefault(), R());
|
|
546
546
|
},
|
|
@@ -551,9 +551,9 @@ function lt({
|
|
|
551
551
|
role: "button",
|
|
552
552
|
tabIndex: 0,
|
|
553
553
|
draggable: !!A,
|
|
554
|
-
onDragStart:
|
|
554
|
+
onDragStart: k,
|
|
555
555
|
onDragEnd: c,
|
|
556
|
-
onKeyDown:
|
|
556
|
+
onKeyDown: p,
|
|
557
557
|
onClick: m ? void 0 : R,
|
|
558
558
|
className: d(
|
|
559
559
|
"group flex w-full select-none flex-col gap-0.5 overflow-hidden rounded-md border-l-[3px] px-2 py-1.5 text-xs text-left",
|
|
@@ -564,24 +564,24 @@ function lt({
|
|
|
564
564
|
m && "opacity-50",
|
|
565
565
|
// Cancelled events get gray background with strikethrough
|
|
566
566
|
T || // Past events get neutral zinc styling with strikethrough
|
|
567
|
-
|
|
567
|
+
L ? "bg-zinc-100 dark:bg-zinc-800 border-l-zinc-400 dark:border-l-zinc-600 text-zinc-500 dark:text-zinc-400 line-through" : [
|
|
568
568
|
// Colored/mixed variants
|
|
569
|
-
!
|
|
569
|
+
!_ && [
|
|
570
570
|
l.bg,
|
|
571
571
|
l.accentBorder,
|
|
572
572
|
l.text
|
|
573
573
|
],
|
|
574
574
|
// Dot variant - neutral background
|
|
575
|
-
|
|
575
|
+
_ && "bg-neutral-50 dark:bg-neutral-900 border-l-neutral-400 dark:border-l-neutral-600"
|
|
576
576
|
],
|
|
577
577
|
// Short events center content
|
|
578
|
-
|
|
579
|
-
|
|
578
|
+
O && "py-0 justify-center",
|
|
579
|
+
f
|
|
580
580
|
),
|
|
581
|
-
style: { height: `${Math.max(
|
|
581
|
+
style: { height: `${Math.max(w, 20)}px` },
|
|
582
582
|
children: [
|
|
583
583
|
/* @__PURE__ */ r("div", { className: "flex items-start gap-1.5 min-w-0", children: [
|
|
584
|
-
["mixed", "dot"].includes(a) && !
|
|
584
|
+
["mixed", "dot"].includes(a) && !L && !T && /* @__PURE__ */ e(
|
|
585
585
|
"svg",
|
|
586
586
|
{
|
|
587
587
|
width: "8",
|
|
@@ -598,7 +598,7 @@ function lt({
|
|
|
598
598
|
{
|
|
599
599
|
className: d(
|
|
600
600
|
"font-semibold truncate leading-tight",
|
|
601
|
-
!
|
|
601
|
+
!L && !T && _ && "text-foreground"
|
|
602
602
|
),
|
|
603
603
|
children: [
|
|
604
604
|
t.title,
|
|
@@ -611,25 +611,25 @@ function lt({
|
|
|
611
611
|
}
|
|
612
612
|
) })
|
|
613
613
|
] }),
|
|
614
|
-
|
|
614
|
+
E && S && /* @__PURE__ */ e(
|
|
615
615
|
"p",
|
|
616
616
|
{
|
|
617
617
|
className: d(
|
|
618
618
|
"text-[11px] truncate leading-tight",
|
|
619
|
-
|
|
619
|
+
_ ? "text-muted-foreground" : "opacity-80"
|
|
620
620
|
),
|
|
621
621
|
children: S
|
|
622
622
|
}
|
|
623
623
|
),
|
|
624
|
-
|
|
624
|
+
E && $ != null && /* @__PURE__ */ r(
|
|
625
625
|
"div",
|
|
626
626
|
{
|
|
627
627
|
className: d(
|
|
628
628
|
"flex items-center gap-1 text-[11px] leading-tight",
|
|
629
|
-
|
|
629
|
+
_ ? "text-muted-foreground" : "opacity-80"
|
|
630
630
|
),
|
|
631
631
|
children: [
|
|
632
|
-
/* @__PURE__ */ e(
|
|
632
|
+
/* @__PURE__ */ e(Ee, { className: "h-3 w-3 shrink-0" }),
|
|
633
633
|
/* @__PURE__ */ r("span", { children: [
|
|
634
634
|
$,
|
|
635
635
|
" participant",
|
|
@@ -638,12 +638,12 @@ function lt({
|
|
|
638
638
|
]
|
|
639
639
|
}
|
|
640
640
|
),
|
|
641
|
-
|
|
641
|
+
B && /* @__PURE__ */ r(
|
|
642
642
|
"div",
|
|
643
643
|
{
|
|
644
644
|
className: d(
|
|
645
645
|
"flex items-center gap-1 text-[11px] tabular-nums leading-tight",
|
|
646
|
-
|
|
646
|
+
_ ? "text-muted-foreground" : "opacity-90"
|
|
647
647
|
),
|
|
648
648
|
children: [
|
|
649
649
|
/* @__PURE__ */ e(Pe, { className: "h-3 w-3 shrink-0" }),
|
|
@@ -651,16 +651,16 @@ function lt({
|
|
|
651
651
|
]
|
|
652
652
|
}
|
|
653
653
|
),
|
|
654
|
-
|
|
654
|
+
E && h && /* @__PURE__ */ r(
|
|
655
655
|
"div",
|
|
656
656
|
{
|
|
657
657
|
className: d(
|
|
658
658
|
"flex items-center gap-1 text-[11px] truncate leading-tight",
|
|
659
|
-
|
|
659
|
+
_ ? "text-muted-foreground" : "opacity-80"
|
|
660
660
|
),
|
|
661
661
|
children: [
|
|
662
662
|
/* @__PURE__ */ e(st, { className: "h-3 w-3 shrink-0" }),
|
|
663
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
663
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: h })
|
|
664
664
|
]
|
|
665
665
|
}
|
|
666
666
|
)
|
|
@@ -682,7 +682,7 @@ function lt({
|
|
|
682
682
|
$ !== 1 ? "s" : ""
|
|
683
683
|
] }),
|
|
684
684
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) }),
|
|
685
|
-
|
|
685
|
+
h && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: h })
|
|
686
686
|
] }) });
|
|
687
687
|
return s ? /* @__PURE__ */ e(
|
|
688
688
|
"div",
|
|
@@ -709,28 +709,28 @@ function lt({
|
|
|
709
709
|
width: n.minWidth ? `max(${n.minWidth}px, ${n.width}%)` : `${n.width}%`,
|
|
710
710
|
minWidth: n.minWidth ? `${n.minWidth}px` : void 0
|
|
711
711
|
},
|
|
712
|
-
children: /* @__PURE__ */ r(re, { open:
|
|
712
|
+
children: /* @__PURE__ */ r(re, { open: y, onOpenChange: v, children: [
|
|
713
713
|
/* @__PURE__ */ e(oe, { asChild: !0, children: C }),
|
|
714
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children:
|
|
714
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: x ? x({ event: t, onClose: P }) : /* @__PURE__ */ e(ye, { event: t, onClose: P }) })
|
|
715
715
|
] })
|
|
716
716
|
}
|
|
717
717
|
);
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function Dn({
|
|
720
720
|
event: t,
|
|
721
721
|
spanDays: n,
|
|
722
722
|
isStart: o,
|
|
723
723
|
isEnd: a,
|
|
724
724
|
onClick: i,
|
|
725
|
-
className:
|
|
725
|
+
className: f,
|
|
726
726
|
disablePopover: s = !1,
|
|
727
|
-
renderPopover:
|
|
727
|
+
renderPopover: x
|
|
728
728
|
}) {
|
|
729
|
-
const
|
|
730
|
-
s && i ? i(t) : s ||
|
|
731
|
-
}, [s, i, t]), u =
|
|
732
|
-
|
|
733
|
-
}, []),
|
|
729
|
+
const N = de(t.color), [l, y] = J(!1), v = t.endDate < je(/* @__PURE__ */ new Date()), m = t.isCanceled ?? !1, g = W(() => {
|
|
730
|
+
s && i ? i(t) : s || y(!0);
|
|
731
|
+
}, [s, i, t]), u = W(() => {
|
|
732
|
+
y(!1);
|
|
733
|
+
}, []), b = /* @__PURE__ */ e(
|
|
734
734
|
"button",
|
|
735
735
|
{
|
|
736
736
|
type: "button",
|
|
@@ -739,26 +739,26 @@ function kn({
|
|
|
739
739
|
"flex h-5 items-center px-1.5 text-xs font-medium transition-opacity hover:opacity-80",
|
|
740
740
|
// Cancelled events get gray background with strikethrough
|
|
741
741
|
m || // Past events get neutral zinc styling with strikethrough
|
|
742
|
-
|
|
742
|
+
v ? "bg-zinc-200 dark:bg-zinc-700 text-zinc-500 dark:text-zinc-400 line-through" : [N.dot, "text-white"],
|
|
743
743
|
o && "rounded-l",
|
|
744
744
|
a && "rounded-r",
|
|
745
745
|
!o && "border-l-0",
|
|
746
746
|
!a && "border-r-0",
|
|
747
|
-
|
|
747
|
+
f
|
|
748
748
|
),
|
|
749
749
|
style: { width: `${n * 100}%` },
|
|
750
750
|
children: o && /* @__PURE__ */ e("span", { className: "truncate", children: t.title })
|
|
751
751
|
}
|
|
752
|
-
),
|
|
752
|
+
), w = /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
753
753
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
754
754
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) })
|
|
755
755
|
] }) });
|
|
756
756
|
return s ? /* @__PURE__ */ r(ie, { children: [
|
|
757
|
-
/* @__PURE__ */ e(se, { asChild: !0, children:
|
|
758
|
-
|
|
759
|
-
] }) : /* @__PURE__ */ r(re, { open: l, onOpenChange:
|
|
760
|
-
/* @__PURE__ */ e(oe, { asChild: !0, children:
|
|
761
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children:
|
|
757
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: b }),
|
|
758
|
+
w
|
|
759
|
+
] }) : /* @__PURE__ */ r(re, { open: l, onOpenChange: y, children: [
|
|
760
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: b }),
|
|
761
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: x ? x({ event: t, onClose: u }) : /* @__PURE__ */ e(ye, { event: t, onClose: u }) })
|
|
762
762
|
] });
|
|
763
763
|
}
|
|
764
764
|
if (typeof window < "u" && !document.getElementById("inno-calendar-event-marquee-style")) {
|
|
@@ -777,32 +777,32 @@ if (typeof window < "u" && !document.getElementById("inno-calendar-event-marquee
|
|
|
777
777
|
const Ue = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, qe = ft, dt = (t, n) => (o) => {
|
|
778
778
|
var a;
|
|
779
779
|
if (n?.variants == null) return qe(t, o?.class, o?.className);
|
|
780
|
-
const { variants: i, defaultVariants:
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
const m = Ue(
|
|
780
|
+
const { variants: i, defaultVariants: f } = n, s = Object.keys(i).map((l) => {
|
|
781
|
+
const y = o?.[l], v = f?.[l];
|
|
782
|
+
if (y === null) return null;
|
|
783
|
+
const m = Ue(y) || Ue(v);
|
|
784
784
|
return i[l][m];
|
|
785
|
-
}),
|
|
786
|
-
let [
|
|
787
|
-
return m === void 0 || (l[
|
|
788
|
-
}, {}),
|
|
789
|
-
let { class:
|
|
785
|
+
}), x = o && Object.entries(o).reduce((l, y) => {
|
|
786
|
+
let [v, m] = y;
|
|
787
|
+
return m === void 0 || (l[v] = m), l;
|
|
788
|
+
}, {}), N = n == null || (a = n.compoundVariants) === null || a === void 0 ? void 0 : a.reduce((l, y) => {
|
|
789
|
+
let { class: v, className: m, ...g } = y;
|
|
790
790
|
return Object.entries(g).every((u) => {
|
|
791
|
-
let [
|
|
792
|
-
return Array.isArray(
|
|
793
|
-
...
|
|
794
|
-
...
|
|
795
|
-
}[
|
|
796
|
-
...
|
|
797
|
-
...
|
|
798
|
-
}[
|
|
791
|
+
let [b, w] = u;
|
|
792
|
+
return Array.isArray(w) ? w.includes({
|
|
793
|
+
...f,
|
|
794
|
+
...x
|
|
795
|
+
}[b]) : {
|
|
796
|
+
...f,
|
|
797
|
+
...x
|
|
798
|
+
}[b] === w;
|
|
799
799
|
}) ? [
|
|
800
800
|
...l,
|
|
801
|
-
|
|
801
|
+
v,
|
|
802
802
|
m
|
|
803
803
|
] : l;
|
|
804
804
|
}, []);
|
|
805
|
-
return qe(t, s,
|
|
805
|
+
return qe(t, s, N, o?.class, o?.className);
|
|
806
806
|
}, kt = dt(
|
|
807
807
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
808
808
|
{
|
|
@@ -828,11 +828,11 @@ const Ue = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, qe = ft, d
|
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
830
|
), me = $e(
|
|
831
|
-
({ className: t, variant: n, size: o, loading: a, disabled: i, children:
|
|
831
|
+
({ className: t, variant: n, size: o, loading: a, disabled: i, children: f, ...s }, x) => /* @__PURE__ */ r(
|
|
832
832
|
"button",
|
|
833
833
|
{
|
|
834
834
|
className: d(kt({ variant: n, size: o, className: t })),
|
|
835
|
-
ref:
|
|
835
|
+
ref: x,
|
|
836
836
|
disabled: i || a,
|
|
837
837
|
...s,
|
|
838
838
|
children: [
|
|
@@ -866,7 +866,7 @@ const Ue = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, qe = ft, d
|
|
|
866
866
|
]
|
|
867
867
|
}
|
|
868
868
|
),
|
|
869
|
-
|
|
869
|
+
f
|
|
870
870
|
]
|
|
871
871
|
}
|
|
872
872
|
)
|
|
@@ -906,32 +906,32 @@ const Tt = $e(
|
|
|
906
906
|
strokeWidth: o = 2,
|
|
907
907
|
absoluteStrokeWidth: a,
|
|
908
908
|
className: i = "",
|
|
909
|
-
children:
|
|
909
|
+
children: f,
|
|
910
910
|
iconNode: s,
|
|
911
|
-
...
|
|
912
|
-
},
|
|
911
|
+
...x
|
|
912
|
+
}, N) => Le(
|
|
913
913
|
"svg",
|
|
914
914
|
{
|
|
915
|
-
ref:
|
|
915
|
+
ref: N,
|
|
916
916
|
...St,
|
|
917
917
|
width: n,
|
|
918
918
|
height: n,
|
|
919
919
|
stroke: t,
|
|
920
920
|
strokeWidth: a ? Number(o) * 24 / Number(n) : o,
|
|
921
921
|
className: ct("lucide", i),
|
|
922
|
-
...!
|
|
923
|
-
...
|
|
922
|
+
...!f && !Mt(x) && { "aria-hidden": "true" },
|
|
923
|
+
...x
|
|
924
924
|
},
|
|
925
925
|
[
|
|
926
|
-
...s.map(([l,
|
|
927
|
-
...Array.isArray(
|
|
926
|
+
...s.map(([l, y]) => Le(l, y)),
|
|
927
|
+
...Array.isArray(f) ? f : [f]
|
|
928
928
|
]
|
|
929
929
|
)
|
|
930
930
|
);
|
|
931
931
|
const Fe = (t, n) => {
|
|
932
932
|
const o = $e(
|
|
933
|
-
({ className: a, ...i },
|
|
934
|
-
ref:
|
|
933
|
+
({ className: a, ...i }, f) => Le(Tt, {
|
|
934
|
+
ref: f,
|
|
935
935
|
iconNode: n,
|
|
936
936
|
className: ct(
|
|
937
937
|
`lucide-${Dt(Ke(t))}`,
|
|
@@ -943,9 +943,9 @@ const Fe = (t, n) => {
|
|
|
943
943
|
);
|
|
944
944
|
return o.displayName = Ke(t), o;
|
|
945
945
|
};
|
|
946
|
-
const zt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]],
|
|
947
|
-
const
|
|
948
|
-
const
|
|
946
|
+
const zt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Wt = Fe("check", zt);
|
|
947
|
+
const Lt = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], At = Fe("chevron-right", Lt);
|
|
948
|
+
const Et = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], _t = Fe("circle", Et), Xe = V.Root, Ye = V.Trigger, Bt = ee.forwardRef(({ className: t, inset: n, children: o, ...a }, i) => /* @__PURE__ */ r(
|
|
949
949
|
V.SubTrigger,
|
|
950
950
|
{
|
|
951
951
|
ref: i,
|
|
@@ -974,7 +974,7 @@ const $t = ee.forwardRef(({ className: t, ...n }, o) => /* @__PURE__ */ e(
|
|
|
974
974
|
}
|
|
975
975
|
));
|
|
976
976
|
$t.displayName = V.SubContent.displayName;
|
|
977
|
-
const
|
|
977
|
+
const _e = ee.forwardRef(({ className: t, sideOffset: n = 4, ...o }, a) => /* @__PURE__ */ e(V.Portal, { children: /* @__PURE__ */ e(
|
|
978
978
|
V.Content,
|
|
979
979
|
{
|
|
980
980
|
ref: a,
|
|
@@ -986,7 +986,7 @@ const Ee = ee.forwardRef(({ className: t, sideOffset: n = 4, ...o }, a) => /* @_
|
|
|
986
986
|
...o
|
|
987
987
|
}
|
|
988
988
|
) }));
|
|
989
|
-
|
|
989
|
+
_e.displayName = V.Content.displayName;
|
|
990
990
|
const Be = ee.forwardRef(({ className: t, inset: n, ...o }, a) => /* @__PURE__ */ e(
|
|
991
991
|
V.Item,
|
|
992
992
|
{
|
|
@@ -1011,7 +1011,7 @@ const It = ee.forwardRef(({ className: t, children: n, checked: o = !1, ...a },
|
|
|
1011
1011
|
checked: o,
|
|
1012
1012
|
...a,
|
|
1013
1013
|
children: [
|
|
1014
|
-
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(V.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
1014
|
+
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(V.ItemIndicator, { children: /* @__PURE__ */ e(Wt, { className: "h-4 w-4" }) }) }),
|
|
1015
1015
|
n
|
|
1016
1016
|
]
|
|
1017
1017
|
}
|
|
@@ -1027,7 +1027,7 @@ const Ht = ee.forwardRef(({ className: t, children: n, ...o }, a) => /* @__PURE_
|
|
|
1027
1027
|
),
|
|
1028
1028
|
...o,
|
|
1029
1029
|
children: [
|
|
1030
|
-
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(V.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
1030
|
+
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(V.ItemIndicator, { children: /* @__PURE__ */ e(_t, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1031
1031
|
n
|
|
1032
1032
|
]
|
|
1033
1033
|
}
|
|
@@ -1042,7 +1042,7 @@ const Rt = ee.forwardRef(({ className: t, inset: n, ...o }, a) => /* @__PURE__ *
|
|
|
1042
1042
|
}
|
|
1043
1043
|
));
|
|
1044
1044
|
Rt.displayName = V.Label.displayName;
|
|
1045
|
-
const
|
|
1045
|
+
const Ot = ee.forwardRef(({ className: t, ...n }, o) => /* @__PURE__ */ e(
|
|
1046
1046
|
V.Separator,
|
|
1047
1047
|
{
|
|
1048
1048
|
ref: o,
|
|
@@ -1050,8 +1050,8 @@ const jt = ee.forwardRef(({ className: t, ...n }, o) => /* @__PURE__ */ e(
|
|
|
1050
1050
|
...n
|
|
1051
1051
|
}
|
|
1052
1052
|
));
|
|
1053
|
-
|
|
1054
|
-
const
|
|
1053
|
+
Ot.displayName = V.Separator.displayName;
|
|
1054
|
+
const jt = dt(
|
|
1055
1055
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
1056
1056
|
{
|
|
1057
1057
|
variants: {
|
|
@@ -1066,7 +1066,7 @@ const Ot = dt(
|
|
|
1066
1066
|
}
|
|
1067
1067
|
);
|
|
1068
1068
|
function Pt({ className: t, variant: n, ...o }) {
|
|
1069
|
-
return /* @__PURE__ */ e("div", { className: d(
|
|
1069
|
+
return /* @__PURE__ */ e("div", { className: d(jt({ variant: n }), t), ...o });
|
|
1070
1070
|
}
|
|
1071
1071
|
function Ft({ className: t }) {
|
|
1072
1072
|
return /* @__PURE__ */ e(
|
|
@@ -1124,19 +1124,19 @@ function Ut({
|
|
|
1124
1124
|
events: o = [],
|
|
1125
1125
|
onNavigatePrev: a,
|
|
1126
1126
|
onNavigateNext: i,
|
|
1127
|
-
weekStartsOn:
|
|
1127
|
+
weekStartsOn: f = 1,
|
|
1128
1128
|
showEventCount: s = !0,
|
|
1129
|
-
className:
|
|
1129
|
+
className: x
|
|
1130
1130
|
}) {
|
|
1131
|
-
const
|
|
1132
|
-
return /* @__PURE__ */ r("div", { className: d("min-w-0 flex-1",
|
|
1131
|
+
const N = Gt[t.getMonth()], l = t.getFullYear(), y = s ? gt(o, t, n, f) : 0, v = xt(t, n);
|
|
1132
|
+
return /* @__PURE__ */ r("div", { className: d("min-w-0 flex-1", x), children: [
|
|
1133
1133
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 sm:gap-2 flex-wrap", children: [
|
|
1134
1134
|
/* @__PURE__ */ r("span", { className: "text-base sm:text-lg font-semibold truncate", children: [
|
|
1135
|
-
|
|
1135
|
+
N,
|
|
1136
1136
|
" ",
|
|
1137
1137
|
l
|
|
1138
1138
|
] }),
|
|
1139
|
-
s && /* @__PURE__ */ e(Pt, { variant: "outline", className: "px-1 sm:px-1.5 text-[10px] sm:text-xs shrink-0", children:
|
|
1139
|
+
s && /* @__PURE__ */ e(Pt, { variant: "outline", className: "px-1 sm:px-1.5 text-[10px] sm:text-xs shrink-0", children: y })
|
|
1140
1140
|
] }),
|
|
1141
1141
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 sm:gap-2", children: [
|
|
1142
1142
|
/* @__PURE__ */ e(
|
|
@@ -1149,7 +1149,7 @@ function Ut({
|
|
|
1149
1149
|
children: /* @__PURE__ */ e(Ft, {})
|
|
1150
1150
|
}
|
|
1151
1151
|
),
|
|
1152
|
-
/* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children:
|
|
1152
|
+
/* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children: v }),
|
|
1153
1153
|
/* @__PURE__ */ e(
|
|
1154
1154
|
me,
|
|
1155
1155
|
{
|
|
@@ -1226,7 +1226,7 @@ function Xt({ className: t }) {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
);
|
|
1228
1228
|
}
|
|
1229
|
-
function
|
|
1229
|
+
function he({ className: t }) {
|
|
1230
1230
|
return /* @__PURE__ */ r(
|
|
1231
1231
|
"svg",
|
|
1232
1232
|
{
|
|
@@ -1408,29 +1408,32 @@ const tn = [
|
|
|
1408
1408
|
{ value: "year", label: "Year", icon: en }
|
|
1409
1409
|
// { value: 'agenda', label: 'Agenda', icon: ListIcon }, NOTE: Not needed currently
|
|
1410
1410
|
], Qe = [
|
|
1411
|
-
{ value: "timeline-day", label: "1 Day", icon:
|
|
1412
|
-
{ value: "timeline-3day", label: "3 Days", icon:
|
|
1413
|
-
{ value: "timeline-week", label: "7 Days", icon:
|
|
1411
|
+
{ value: "timeline-day", label: "1 Day", icon: he },
|
|
1412
|
+
{ value: "timeline-3day", label: "3 Days", icon: he },
|
|
1413
|
+
{ value: "timeline-week", label: "7 Days", icon: he }
|
|
1414
|
+
], nn = [
|
|
1415
|
+
{ value: "resource-day", label: "1 Day", icon: he },
|
|
1416
|
+
{ value: "resource-week", label: "7 Days", icon: he }
|
|
1414
1417
|
];
|
|
1415
|
-
function
|
|
1418
|
+
function Cn({
|
|
1416
1419
|
currentDate: t,
|
|
1417
1420
|
view: n,
|
|
1418
1421
|
events: o = [],
|
|
1419
1422
|
onNavigateToday: a,
|
|
1420
1423
|
onNavigatePrev: i,
|
|
1421
|
-
onNavigateNext:
|
|
1424
|
+
onNavigateNext: f,
|
|
1422
1425
|
onNavigate: s,
|
|
1423
|
-
onViewChange:
|
|
1424
|
-
onAddEvent:
|
|
1426
|
+
onViewChange: x,
|
|
1427
|
+
onAddEvent: N,
|
|
1425
1428
|
availableViews: l = ["day", "week", "month", "agenda"],
|
|
1426
|
-
showTimelineViews:
|
|
1427
|
-
timelineViews:
|
|
1429
|
+
showTimelineViews: y = !1,
|
|
1430
|
+
timelineViews: v,
|
|
1428
1431
|
settingsContent: m,
|
|
1429
1432
|
showSettings: g = !1,
|
|
1430
1433
|
filterContent: u,
|
|
1431
|
-
actions:
|
|
1432
|
-
className:
|
|
1433
|
-
weekStartsOn:
|
|
1434
|
+
actions: b,
|
|
1435
|
+
className: w,
|
|
1436
|
+
weekStartsOn: L = 1,
|
|
1434
1437
|
labels: T = {}
|
|
1435
1438
|
}) {
|
|
1436
1439
|
const A = F(
|
|
@@ -1442,46 +1445,46 @@ function Dn({
|
|
|
1442
1445
|
...T
|
|
1443
1446
|
}),
|
|
1444
1447
|
[T]
|
|
1445
|
-
),
|
|
1448
|
+
), O = () => {
|
|
1446
1449
|
a?.(), s?.("today");
|
|
1447
|
-
},
|
|
1450
|
+
}, B = () => {
|
|
1448
1451
|
i?.(), s?.("prev");
|
|
1449
|
-
},
|
|
1450
|
-
|
|
1452
|
+
}, E = () => {
|
|
1453
|
+
f?.(), s?.("next");
|
|
1451
1454
|
}, M = ["day", "week", "month", "year", "agenda"].includes(
|
|
1452
1455
|
n
|
|
1453
1456
|
), I = n.startsWith("timeline-") || n.startsWith("resource-"), S = tn.filter(
|
|
1454
|
-
(
|
|
1455
|
-
), $ = M ? S.find((
|
|
1456
|
-
return /* @__PURE__ */ r("div", { className: d("flex flex-col w-full gap-3 mb-2",
|
|
1457
|
+
(h) => l.includes(h.value)
|
|
1458
|
+
), $ = M ? S.find((h) => h.value === n) : null, q = [...Qe, ...nn], D = I ? q.find((h) => h.value === n) : null;
|
|
1459
|
+
return /* @__PURE__ */ r("div", { className: d("flex flex-col w-full gap-3 mb-2", w), children: [
|
|
1457
1460
|
/* @__PURE__ */ r("div", { className: "flex lg:flex-row flex-col w-full justify-between gap-3", children: [
|
|
1458
1461
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1459
1462
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [
|
|
1460
|
-
/* @__PURE__ */ e(Kt, { onClick:
|
|
1463
|
+
/* @__PURE__ */ e(Kt, { onClick: O }),
|
|
1461
1464
|
/* @__PURE__ */ e(
|
|
1462
1465
|
Ut,
|
|
1463
1466
|
{
|
|
1464
1467
|
date: t,
|
|
1465
1468
|
view: n,
|
|
1466
1469
|
events: o,
|
|
1467
|
-
onNavigatePrev:
|
|
1468
|
-
onNavigateNext:
|
|
1469
|
-
weekStartsOn:
|
|
1470
|
+
onNavigatePrev: B,
|
|
1471
|
+
onNavigateNext: E,
|
|
1472
|
+
weekStartsOn: L
|
|
1470
1473
|
}
|
|
1471
1474
|
)
|
|
1472
1475
|
] }),
|
|
1473
|
-
|
|
1476
|
+
N && /* @__PURE__ */ e(
|
|
1474
1477
|
me,
|
|
1475
1478
|
{
|
|
1476
1479
|
size: "icon",
|
|
1477
1480
|
className: "shrink-0 lg:hidden",
|
|
1478
|
-
onClick:
|
|
1481
|
+
onClick: N,
|
|
1479
1482
|
children: /* @__PURE__ */ e(Ze, { className: "size-4" })
|
|
1480
1483
|
}
|
|
1481
1484
|
)
|
|
1482
1485
|
] }),
|
|
1483
1486
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 sm:gap-2 overflow-x-auto pb-1 -mb-1 scrollbar-none", children: [
|
|
1484
|
-
|
|
1487
|
+
x && S.length > 0 && /* @__PURE__ */ r(Xe, { children: [
|
|
1485
1488
|
/* @__PURE__ */ r(
|
|
1486
1489
|
Ye,
|
|
1487
1490
|
{
|
|
@@ -1497,26 +1500,26 @@ function Dn({
|
|
|
1497
1500
|
]
|
|
1498
1501
|
}
|
|
1499
1502
|
),
|
|
1500
|
-
/* @__PURE__ */ e(
|
|
1501
|
-
const
|
|
1503
|
+
/* @__PURE__ */ e(_e, { align: "start", className: "min-w-[120px]", children: S.map((h) => {
|
|
1504
|
+
const _ = h.icon;
|
|
1502
1505
|
return /* @__PURE__ */ r(
|
|
1503
1506
|
Be,
|
|
1504
1507
|
{
|
|
1505
|
-
onClick: () =>
|
|
1508
|
+
onClick: () => x(h.value),
|
|
1506
1509
|
className: d(
|
|
1507
1510
|
"gap-2",
|
|
1508
|
-
n ===
|
|
1511
|
+
n === h.value && "bg-accent"
|
|
1509
1512
|
),
|
|
1510
1513
|
children: [
|
|
1511
|
-
/* @__PURE__ */ e(
|
|
1512
|
-
/* @__PURE__ */ e("span", { children:
|
|
1514
|
+
/* @__PURE__ */ e(_, { className: "size-4" }),
|
|
1515
|
+
/* @__PURE__ */ e("span", { children: h.label })
|
|
1513
1516
|
]
|
|
1514
1517
|
},
|
|
1515
|
-
|
|
1518
|
+
h.value
|
|
1516
1519
|
);
|
|
1517
1520
|
}) })
|
|
1518
1521
|
] }),
|
|
1519
|
-
|
|
1522
|
+
y && x && /* @__PURE__ */ r(Xe, { children: [
|
|
1520
1523
|
/* @__PURE__ */ r(
|
|
1521
1524
|
Ye,
|
|
1522
1525
|
{
|
|
@@ -1526,28 +1529,28 @@ function Dn({
|
|
|
1526
1529
|
I ? "bg-primary text-primary-foreground hover:bg-primary/90" : "border border-input bg-white hover:bg-zinc-50 hover:text-accent-foreground"
|
|
1527
1530
|
),
|
|
1528
1531
|
children: [
|
|
1529
|
-
/* @__PURE__ */ e(
|
|
1530
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children:
|
|
1532
|
+
/* @__PURE__ */ e(he, { className: "size-4" }),
|
|
1533
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: D?.label ?? A.resourceView }),
|
|
1531
1534
|
/* @__PURE__ */ e(Je, { className: "size-3 opacity-60" })
|
|
1532
1535
|
]
|
|
1533
1536
|
}
|
|
1534
1537
|
),
|
|
1535
|
-
/* @__PURE__ */ e(
|
|
1536
|
-
const
|
|
1538
|
+
/* @__PURE__ */ e(_e, { align: "start", className: "min-w-[120px]", children: Qe.map((h) => {
|
|
1539
|
+
const _ = h.icon;
|
|
1537
1540
|
return /* @__PURE__ */ r(
|
|
1538
1541
|
Be,
|
|
1539
1542
|
{
|
|
1540
|
-
onClick: () =>
|
|
1543
|
+
onClick: () => x(h.value),
|
|
1541
1544
|
className: d(
|
|
1542
1545
|
"gap-2",
|
|
1543
|
-
n ===
|
|
1546
|
+
n === h.value && "bg-accent"
|
|
1544
1547
|
),
|
|
1545
1548
|
children: [
|
|
1546
|
-
/* @__PURE__ */ e(
|
|
1547
|
-
/* @__PURE__ */ e("span", { children:
|
|
1549
|
+
/* @__PURE__ */ e(_, { className: "size-4" }),
|
|
1550
|
+
/* @__PURE__ */ e("span", { children: h.label })
|
|
1548
1551
|
]
|
|
1549
1552
|
},
|
|
1550
|
-
|
|
1553
|
+
h.value
|
|
1551
1554
|
);
|
|
1552
1555
|
}) })
|
|
1553
1556
|
] }),
|
|
@@ -1571,12 +1574,12 @@ function Dn({
|
|
|
1571
1574
|
}
|
|
1572
1575
|
)
|
|
1573
1576
|
] }),
|
|
1574
|
-
|
|
1575
|
-
|
|
1577
|
+
b,
|
|
1578
|
+
N && /* @__PURE__ */ r(
|
|
1576
1579
|
me,
|
|
1577
1580
|
{
|
|
1578
1581
|
className: "hidden lg:flex shrink-0 max-h-10",
|
|
1579
|
-
onClick:
|
|
1582
|
+
onClick: N,
|
|
1580
1583
|
children: [
|
|
1581
1584
|
/* @__PURE__ */ e(Ze, { className: "size-4" }),
|
|
1582
1585
|
A.addEvent
|
|
@@ -1588,47 +1591,47 @@ function Dn({
|
|
|
1588
1591
|
u && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 pb-1 -mb-1 scrollbar-none", children: u })
|
|
1589
1592
|
] });
|
|
1590
1593
|
}
|
|
1591
|
-
function
|
|
1594
|
+
function Sn({
|
|
1592
1595
|
events: t,
|
|
1593
1596
|
date: n,
|
|
1594
1597
|
daysAhead: o = 60,
|
|
1595
1598
|
badgeVariant: a = "colored",
|
|
1596
1599
|
onEventClick: i,
|
|
1597
|
-
className:
|
|
1600
|
+
className: f,
|
|
1598
1601
|
renderEvent: s,
|
|
1599
|
-
renderPopover:
|
|
1600
|
-
slots:
|
|
1602
|
+
renderPopover: x,
|
|
1603
|
+
slots: N,
|
|
1601
1604
|
classNames: l
|
|
1602
1605
|
}) {
|
|
1603
|
-
const
|
|
1606
|
+
const y = F(() => {
|
|
1604
1607
|
const m = new Date(n);
|
|
1605
1608
|
m.setHours(0, 0, 0, 0);
|
|
1606
1609
|
const g = new Date(m);
|
|
1607
1610
|
return g.setDate(g.getDate() + o), t.filter((u) => u.endDate >= m && u.startDate <= g);
|
|
1608
|
-
}, [t, o, n]),
|
|
1609
|
-
const m = yt(
|
|
1610
|
-
for (const [u,
|
|
1611
|
+
}, [t, o, n]), v = F(() => {
|
|
1612
|
+
const m = yt(y), g = [];
|
|
1613
|
+
for (const [u, b] of m)
|
|
1611
1614
|
g.push({
|
|
1612
1615
|
date: new Date(u),
|
|
1613
1616
|
dateKey: u,
|
|
1614
|
-
events:
|
|
1617
|
+
events: b
|
|
1615
1618
|
});
|
|
1616
|
-
return g.sort((u,
|
|
1617
|
-
}, [
|
|
1618
|
-
return
|
|
1619
|
+
return g.sort((u, b) => u.date.getTime() - b.date.getTime()), g;
|
|
1620
|
+
}, [y]);
|
|
1621
|
+
return v.length === 0 ? /* @__PURE__ */ e("div", { className: d("flex flex-col items-center justify-center h-full py-12", f), children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
1619
1622
|
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "No events found" }),
|
|
1620
1623
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground/70", children: "No events scheduled for this period" })
|
|
1621
|
-
] }) }) : /* @__PURE__ */ r("div", { className: d("flex flex-col h-full overflow-auto", l?.agendaList,
|
|
1624
|
+
] }) }) : /* @__PURE__ */ r("div", { className: d("flex flex-col h-full overflow-auto", l?.agendaList, f), children: [
|
|
1622
1625
|
/* @__PURE__ */ e("div", { className: "sticky top-0 z-10 bg-background border-b px-4 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1623
1626
|
/* @__PURE__ */ e("h2", { className: "text-lg font-medium", children: "Schedule" }),
|
|
1624
1627
|
/* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
|
|
1625
|
-
|
|
1628
|
+
y.length,
|
|
1626
1629
|
" event",
|
|
1627
|
-
|
|
1630
|
+
y.length !== 1 ? "s" : ""
|
|
1628
1631
|
] })
|
|
1629
1632
|
] }) }),
|
|
1630
|
-
/* @__PURE__ */ e("div", { className: "flex-1", children:
|
|
1631
|
-
const
|
|
1633
|
+
/* @__PURE__ */ e("div", { className: "flex-1", children: v.map(({ date: m, dateKey: g, events: u }) => {
|
|
1634
|
+
const b = ce(m), w = m.toLocaleDateString([], { weekday: "short" }), L = m.getDate(), T = m.toLocaleDateString([], { month: "short" });
|
|
1632
1635
|
return /* @__PURE__ */ r("div", { className: d("", l?.agendaDayGroup), children: [
|
|
1633
1636
|
/* @__PURE__ */ e(
|
|
1634
1637
|
"div",
|
|
@@ -1644,9 +1647,9 @@ function Cn({
|
|
|
1644
1647
|
{
|
|
1645
1648
|
className: d(
|
|
1646
1649
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
1647
|
-
|
|
1650
|
+
b ? "text-primary" : "text-muted-foreground"
|
|
1648
1651
|
),
|
|
1649
|
-
children:
|
|
1652
|
+
children: w
|
|
1650
1653
|
}
|
|
1651
1654
|
),
|
|
1652
1655
|
/* @__PURE__ */ e(
|
|
@@ -1655,9 +1658,9 @@ function Cn({
|
|
|
1655
1658
|
className: d(
|
|
1656
1659
|
"flex items-center justify-center rounded-full mt-0.5",
|
|
1657
1660
|
"size-10 text-xl font-normal",
|
|
1658
|
-
|
|
1661
|
+
b ? "bg-primary text-primary-foreground" : "text-foreground"
|
|
1659
1662
|
),
|
|
1660
|
-
children:
|
|
1663
|
+
children: L
|
|
1661
1664
|
}
|
|
1662
1665
|
)
|
|
1663
1666
|
] }),
|
|
@@ -1677,8 +1680,8 @@ function Cn({
|
|
|
1677
1680
|
variant: "full",
|
|
1678
1681
|
badgeVariant: a,
|
|
1679
1682
|
onClick: i,
|
|
1680
|
-
disablePopover: !!i && !
|
|
1681
|
-
renderPopover:
|
|
1683
|
+
disablePopover: !!i && !x,
|
|
1684
|
+
renderPopover: x,
|
|
1682
1685
|
showTime: !0,
|
|
1683
1686
|
showDescription: !0,
|
|
1684
1687
|
showParticipants: !0,
|
|
@@ -1691,30 +1694,30 @@ function Cn({
|
|
|
1691
1694
|
}) })
|
|
1692
1695
|
] });
|
|
1693
1696
|
}
|
|
1694
|
-
const
|
|
1695
|
-
function
|
|
1697
|
+
const we = 360, ve = 480, Te = 280;
|
|
1698
|
+
function rn({
|
|
1696
1699
|
isOpen: t,
|
|
1697
1700
|
onClose: n,
|
|
1698
1701
|
date: o,
|
|
1699
1702
|
events: a,
|
|
1700
1703
|
anchorRect: i,
|
|
1701
|
-
badgeVariant:
|
|
1704
|
+
badgeVariant: f = "colored",
|
|
1702
1705
|
onEventClick: s,
|
|
1703
|
-
renderEvent:
|
|
1704
|
-
renderPopover:
|
|
1706
|
+
renderEvent: x,
|
|
1707
|
+
renderPopover: N,
|
|
1705
1708
|
className: l
|
|
1706
1709
|
}) {
|
|
1707
|
-
const
|
|
1708
|
-
() => [...a].sort((
|
|
1710
|
+
const y = te(null), v = te(null), [m, g] = J("closed"), u = F(
|
|
1711
|
+
() => [...a].sort((B, E) => B.startDate.getTime() - E.startDate.getTime()),
|
|
1709
1712
|
[a]
|
|
1710
|
-
),
|
|
1711
|
-
if (!i) return { top: 0, left: 0, width:
|
|
1712
|
-
const
|
|
1713
|
-
let M = i.left + i.width / 2 -
|
|
1714
|
-
M = Math.max(16, Math.min(M,
|
|
1715
|
-
const I = Math.min(a.length * 68 + 80,
|
|
1713
|
+
), b = F(() => {
|
|
1714
|
+
if (!i) return { top: 0, left: 0, width: we, maxHeight: ve };
|
|
1715
|
+
const B = typeof window < "u" ? window.innerWidth : 1200, E = typeof window < "u" ? window.innerHeight : 800;
|
|
1716
|
+
let M = i.left + i.width / 2 - we / 2;
|
|
1717
|
+
M = Math.max(16, Math.min(M, B - we - 16));
|
|
1718
|
+
const I = Math.min(a.length * 68 + 80, ve);
|
|
1716
1719
|
let S = i.top + i.height / 2 - I / 2;
|
|
1717
|
-
return S = Math.max(16, Math.min(S,
|
|
1720
|
+
return S = Math.max(16, Math.min(S, E - I - 16)), { top: S, left: M, width: we, maxHeight: ve };
|
|
1718
1721
|
}, [i, a.length]);
|
|
1719
1722
|
Ie(() => {
|
|
1720
1723
|
if (t && i)
|
|
@@ -1725,28 +1728,28 @@ function nn({
|
|
|
1725
1728
|
});
|
|
1726
1729
|
else if (!t && m === "open") {
|
|
1727
1730
|
g("exiting");
|
|
1728
|
-
const
|
|
1731
|
+
const B = setTimeout(() => {
|
|
1729
1732
|
g("closed");
|
|
1730
1733
|
}, Te);
|
|
1731
|
-
return () => clearTimeout(
|
|
1734
|
+
return () => clearTimeout(B);
|
|
1732
1735
|
}
|
|
1733
1736
|
}, [t, i]), Ae(() => {
|
|
1734
1737
|
if (m === "closed") return;
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1738
|
+
const B = (E) => {
|
|
1739
|
+
E.key === "Escape" && (E.stopPropagation(), n());
|
|
1737
1740
|
};
|
|
1738
|
-
return document.addEventListener("keydown",
|
|
1741
|
+
return document.addEventListener("keydown", B), () => document.removeEventListener("keydown", B);
|
|
1739
1742
|
}, [m, n]), Ae(() => {
|
|
1740
|
-
m === "open" &&
|
|
1743
|
+
m === "open" && v.current && v.current.focus();
|
|
1741
1744
|
}, [m]);
|
|
1742
|
-
const
|
|
1743
|
-
(
|
|
1744
|
-
|
|
1745
|
+
const w = W(
|
|
1746
|
+
(B) => {
|
|
1747
|
+
B.target === y.current && n();
|
|
1745
1748
|
},
|
|
1746
1749
|
[n]
|
|
1747
1750
|
);
|
|
1748
1751
|
if (m === "closed") return null;
|
|
1749
|
-
const
|
|
1752
|
+
const L = m === "entering" || m === "exiting", T = L && i ? {
|
|
1750
1753
|
// Collapsed state: match the day cell exactly
|
|
1751
1754
|
position: "fixed",
|
|
1752
1755
|
top: i.top,
|
|
@@ -1760,14 +1763,14 @@ function nn({
|
|
|
1760
1763
|
} : {
|
|
1761
1764
|
// Expanded state: full panel
|
|
1762
1765
|
position: "fixed",
|
|
1763
|
-
top:
|
|
1764
|
-
left:
|
|
1765
|
-
width:
|
|
1766
|
-
maxHeight:
|
|
1766
|
+
top: b.top,
|
|
1767
|
+
left: b.left,
|
|
1768
|
+
width: b.width,
|
|
1769
|
+
maxHeight: b.maxHeight,
|
|
1767
1770
|
opacity: 1,
|
|
1768
1771
|
transform: "scale(1)",
|
|
1769
1772
|
borderRadius: "12px"
|
|
1770
|
-
}, A =
|
|
1773
|
+
}, A = L ? 0 : 1, O = o.toLocaleDateString(void 0, {
|
|
1771
1774
|
weekday: "long",
|
|
1772
1775
|
month: "long",
|
|
1773
1776
|
day: "numeric"
|
|
@@ -1776,9 +1779,9 @@ function nn({
|
|
|
1776
1779
|
/* @__PURE__ */ e(
|
|
1777
1780
|
"div",
|
|
1778
1781
|
{
|
|
1779
|
-
ref:
|
|
1782
|
+
ref: y,
|
|
1780
1783
|
role: "presentation",
|
|
1781
|
-
onClick:
|
|
1784
|
+
onClick: w,
|
|
1782
1785
|
className: "ic-expansion-backdrop",
|
|
1783
1786
|
style: {
|
|
1784
1787
|
position: "fixed",
|
|
@@ -1793,10 +1796,10 @@ function nn({
|
|
|
1793
1796
|
/* @__PURE__ */ r(
|
|
1794
1797
|
"div",
|
|
1795
1798
|
{
|
|
1796
|
-
ref:
|
|
1799
|
+
ref: v,
|
|
1797
1800
|
role: "dialog",
|
|
1798
1801
|
"aria-modal": "true",
|
|
1799
|
-
"aria-label": `Events for ${
|
|
1802
|
+
"aria-label": `Events for ${O}`,
|
|
1800
1803
|
tabIndex: -1,
|
|
1801
1804
|
className: d(
|
|
1802
1805
|
"ic-expansion-panel",
|
|
@@ -1813,7 +1816,7 @@ function nn({
|
|
|
1813
1816
|
children: [
|
|
1814
1817
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between px-4 py-3 border-b bg-muted/30", children: [
|
|
1815
1818
|
/* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
1816
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground", children:
|
|
1819
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground", children: O }),
|
|
1817
1820
|
/* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground", children: [
|
|
1818
1821
|
a.length,
|
|
1819
1822
|
" event",
|
|
@@ -1851,28 +1854,28 @@ function nn({
|
|
|
1851
1854
|
"div",
|
|
1852
1855
|
{
|
|
1853
1856
|
className: "overflow-y-auto px-3 py-2 space-y-1.5",
|
|
1854
|
-
style: { maxHeight: `${
|
|
1857
|
+
style: { maxHeight: `${ve - 64}px` },
|
|
1855
1858
|
children: [
|
|
1856
|
-
u.map((
|
|
1859
|
+
u.map((B) => /* @__PURE__ */ e(
|
|
1857
1860
|
"div",
|
|
1858
1861
|
{
|
|
1859
|
-
onPointerDown: (
|
|
1860
|
-
children:
|
|
1862
|
+
onPointerDown: (E) => E.stopPropagation(),
|
|
1863
|
+
children: x ? x({ event: B, variant: "compact" }) : /* @__PURE__ */ e(
|
|
1861
1864
|
Se,
|
|
1862
1865
|
{
|
|
1863
|
-
event:
|
|
1866
|
+
event: B,
|
|
1864
1867
|
variant: "compact",
|
|
1865
|
-
badgeVariant:
|
|
1866
|
-
onClick: (
|
|
1867
|
-
n(), s?.(
|
|
1868
|
+
badgeVariant: f,
|
|
1869
|
+
onClick: (E) => {
|
|
1870
|
+
n(), s?.(E);
|
|
1868
1871
|
},
|
|
1869
|
-
disablePopover: !!s && !
|
|
1870
|
-
renderPopover:
|
|
1872
|
+
disablePopover: !!s && !N,
|
|
1873
|
+
renderPopover: N,
|
|
1871
1874
|
showTime: !0
|
|
1872
1875
|
}
|
|
1873
1876
|
)
|
|
1874
1877
|
},
|
|
1875
|
-
|
|
1878
|
+
B.id
|
|
1876
1879
|
)),
|
|
1877
1880
|
a.length === 0 && /* @__PURE__ */ e("div", { className: "py-6 text-center text-sm text-muted-foreground", children: "No events" })
|
|
1878
1881
|
]
|
|
@@ -1883,16 +1886,16 @@ function nn({
|
|
|
1883
1886
|
)
|
|
1884
1887
|
] });
|
|
1885
1888
|
}
|
|
1886
|
-
function
|
|
1889
|
+
function on({
|
|
1887
1890
|
event: t,
|
|
1888
1891
|
date: n,
|
|
1889
1892
|
onEventClick: o,
|
|
1890
1893
|
disablePopover: a,
|
|
1891
1894
|
renderPopover: i
|
|
1892
1895
|
}) {
|
|
1893
|
-
const [
|
|
1896
|
+
const [f, s] = J(!1), x = de(t.color), N = De(t), l = le(t.startDate, n), y = le(t.endDate, n), v = N && le(t.startDate, t.endDate), m = W(() => {
|
|
1894
1897
|
a && o ? o(t) : a || s(!0);
|
|
1895
|
-
}, [a, o, t]), g =
|
|
1898
|
+
}, [a, o, t]), g = W(() => {
|
|
1896
1899
|
s(!1);
|
|
1897
1900
|
}, []), u = /* @__PURE__ */ r(
|
|
1898
1901
|
"button",
|
|
@@ -1903,31 +1906,31 @@ function rn({
|
|
|
1903
1906
|
className: d(
|
|
1904
1907
|
"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium transition-opacity hover:opacity-80",
|
|
1905
1908
|
"sm:px-2 sm:py-1 sm:text-xs",
|
|
1906
|
-
|
|
1907
|
-
|
|
1909
|
+
x.bg,
|
|
1910
|
+
x.text,
|
|
1908
1911
|
t.isCanceled && "opacity-60 line-through"
|
|
1909
1912
|
),
|
|
1910
1913
|
children: [
|
|
1911
|
-
!
|
|
1912
|
-
!
|
|
1913
|
-
!
|
|
1914
|
+
!v && l && !y && "→ ",
|
|
1915
|
+
!v && !l && y && " ←",
|
|
1916
|
+
!v && !l && !y && "↔ ",
|
|
1914
1917
|
/* @__PURE__ */ e("span", { className: "truncate max-w-24 sm:max-w-32", children: t.title }),
|
|
1915
|
-
|
|
1918
|
+
v && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-70 sm:text-[10px]", children: "All day" })
|
|
1916
1919
|
]
|
|
1917
1920
|
}
|
|
1918
|
-
),
|
|
1921
|
+
), b = /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
1919
1922
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
1920
1923
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) })
|
|
1921
1924
|
] }) });
|
|
1922
1925
|
return a ? /* @__PURE__ */ r(ie, { children: [
|
|
1923
1926
|
/* @__PURE__ */ e(se, { asChild: !0, children: u }),
|
|
1924
|
-
|
|
1925
|
-
] }) : /* @__PURE__ */ r(re, { open:
|
|
1927
|
+
b
|
|
1928
|
+
] }) : /* @__PURE__ */ r(re, { open: f, onOpenChange: s, children: [
|
|
1926
1929
|
/* @__PURE__ */ e(oe, { asChild: !0, children: u }),
|
|
1927
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children: i ? i({ event: t, onClose: g }) : /* @__PURE__ */ e(
|
|
1930
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: i ? i({ event: t, onClose: g }) : /* @__PURE__ */ e(an, { event: t, onClose: g }) })
|
|
1928
1931
|
] });
|
|
1929
1932
|
}
|
|
1930
|
-
function
|
|
1933
|
+
function an({
|
|
1931
1934
|
event: t,
|
|
1932
1935
|
onClose: n
|
|
1933
1936
|
}) {
|
|
@@ -1956,22 +1959,22 @@ function on({
|
|
|
1956
1959
|
) })
|
|
1957
1960
|
] });
|
|
1958
1961
|
}
|
|
1959
|
-
function
|
|
1962
|
+
function sn({
|
|
1960
1963
|
events: t,
|
|
1961
1964
|
date: n,
|
|
1962
1965
|
onEventClick: o,
|
|
1963
1966
|
disablePopover: a = !1,
|
|
1964
1967
|
renderPopover: i,
|
|
1965
|
-
className:
|
|
1968
|
+
className: f
|
|
1966
1969
|
}) {
|
|
1967
1970
|
if (t.length === 0) return null;
|
|
1968
|
-
const s = t.some((l) => De(l) && le(l.startDate, l.endDate)),
|
|
1971
|
+
const s = t.some((l) => De(l) && le(l.startDate, l.endDate)), x = t.some(
|
|
1969
1972
|
(l) => !le(l.startDate, l.endDate) || De(l) && !le(l.startDate, l.endDate)
|
|
1970
|
-
),
|
|
1971
|
-
return /* @__PURE__ */ r("div", { className: d("border-b bg-muted/20 px-2 py-1.5 space-y-1", "sm:px-4 sm:py-2",
|
|
1972
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children:
|
|
1973
|
+
), N = s && x ? "All day / Multi-day" : s ? "All day" : "Multi-day";
|
|
1974
|
+
return /* @__PURE__ */ r("div", { className: d("border-b bg-muted/20 px-2 py-1.5 space-y-1", "sm:px-4 sm:py-2", f), children: [
|
|
1975
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children: N }),
|
|
1973
1976
|
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.map((l) => /* @__PURE__ */ e(
|
|
1974
|
-
|
|
1977
|
+
on,
|
|
1975
1978
|
{
|
|
1976
1979
|
event: l,
|
|
1977
1980
|
date: n,
|
|
@@ -1983,84 +1986,84 @@ function an({
|
|
|
1983
1986
|
)) })
|
|
1984
1987
|
] });
|
|
1985
1988
|
}
|
|
1986
|
-
const
|
|
1989
|
+
const ln = 5;
|
|
1987
1990
|
function ut({
|
|
1988
1991
|
slot: t,
|
|
1989
1992
|
onSelectionStart: n,
|
|
1990
1993
|
onSelectionMove: o,
|
|
1991
1994
|
onSelectionEnd: a,
|
|
1992
1995
|
isSelected: i = !1,
|
|
1993
|
-
isSelecting:
|
|
1996
|
+
isSelecting: f = !1,
|
|
1994
1997
|
disabled: s = !1,
|
|
1995
|
-
ariaLabel:
|
|
1996
|
-
children:
|
|
1998
|
+
ariaLabel: x,
|
|
1999
|
+
children: N,
|
|
1997
2000
|
className: l,
|
|
1998
|
-
height:
|
|
1999
|
-
style:
|
|
2001
|
+
height: y,
|
|
2002
|
+
style: v,
|
|
2000
2003
|
dataAttributes: m
|
|
2001
2004
|
}) {
|
|
2002
|
-
const g = te(null), u = te(!1),
|
|
2003
|
-
(
|
|
2004
|
-
s ||
|
|
2005
|
+
const g = te(null), u = te(!1), b = te(!1), w = te(null), [L, T] = J(!1), A = Re(), O = W(
|
|
2006
|
+
(D) => {
|
|
2007
|
+
s || D.button !== 0 && D.pointerType === "mouse" || (D.preventDefault(), g.current = { x: D.clientX, y: D.clientY }, u.current = !1, b.current = !0, n?.(t));
|
|
2005
2008
|
},
|
|
2006
2009
|
[s, t, n]
|
|
2007
|
-
),
|
|
2008
|
-
(
|
|
2009
|
-
if (!(g.current &&
|
|
2010
|
-
const
|
|
2011
|
-
Math.sqrt(
|
|
2010
|
+
), B = W(
|
|
2011
|
+
(D) => {
|
|
2012
|
+
if (!(g.current && b.current && !s)) return;
|
|
2013
|
+
const h = D.clientX - g.current.x, _ = D.clientY - g.current.y;
|
|
2014
|
+
Math.sqrt(h * h + _ * _) >= ln && (u.current = !0);
|
|
2012
2015
|
},
|
|
2013
2016
|
[s]
|
|
2014
|
-
),
|
|
2015
|
-
(
|
|
2016
|
-
s || (
|
|
2017
|
+
), E = W(
|
|
2018
|
+
(D) => {
|
|
2019
|
+
s || (D.buttons > 0 || f) && o?.(t);
|
|
2017
2020
|
},
|
|
2018
|
-
[s,
|
|
2019
|
-
), M =
|
|
2020
|
-
s || (a?.(), g.current = null, u.current = !1,
|
|
2021
|
-
}, [s, a]), I =
|
|
2022
|
-
(
|
|
2021
|
+
[s, f, t, o]
|
|
2022
|
+
), M = W(() => {
|
|
2023
|
+
s || (a?.(), g.current = null, u.current = !1, b.current = !1);
|
|
2024
|
+
}, [s, a]), I = W(
|
|
2025
|
+
(D) => {
|
|
2023
2026
|
if (!A?.isDragging || s) return;
|
|
2024
|
-
|
|
2025
|
-
const
|
|
2026
|
-
A.updateDragPreview?.(t.date,
|
|
2027
|
+
D.preventDefault(), D.dataTransfer.dropEffect = "move", T(!0);
|
|
2028
|
+
const h = /* @__PURE__ */ new Date(), _ = t.hour ?? h.getHours(), R = t.minute ?? (h.getMinutes() >= 30 ? 30 : 0);
|
|
2029
|
+
A.updateDragPreview?.(t.date, _, R);
|
|
2027
2030
|
},
|
|
2028
2031
|
[A, s, t]
|
|
2029
|
-
), S =
|
|
2032
|
+
), S = W(() => {
|
|
2030
2033
|
T(!1);
|
|
2031
|
-
}, []), $ =
|
|
2032
|
-
(
|
|
2033
|
-
|
|
2034
|
+
}, []), $ = W(
|
|
2035
|
+
(D) => {
|
|
2036
|
+
D.preventDefault(), T(!1), !(!A?.isDragging || s) && A.endDrag?.();
|
|
2034
2037
|
},
|
|
2035
2038
|
[A, s]
|
|
2036
2039
|
);
|
|
2037
2040
|
Ae(() => {
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2041
|
+
const D = () => {
|
|
2042
|
+
b.current && (b.current = !1, g.current = null, u.current = !1);
|
|
2040
2043
|
};
|
|
2041
|
-
return window.addEventListener("pointerup",
|
|
2042
|
-
window.removeEventListener("pointerup",
|
|
2044
|
+
return window.addEventListener("pointerup", D), window.addEventListener("pointercancel", D), () => {
|
|
2045
|
+
window.removeEventListener("pointerup", D), window.removeEventListener("pointercancel", D);
|
|
2043
2046
|
};
|
|
2044
2047
|
}, []);
|
|
2045
|
-
const q =
|
|
2046
|
-
(
|
|
2047
|
-
s || (
|
|
2048
|
+
const q = W(
|
|
2049
|
+
(D) => {
|
|
2050
|
+
s || (D.key === "Enter" || D.key === " ") && (D.preventDefault(), n?.(t), a?.());
|
|
2048
2051
|
},
|
|
2049
2052
|
[s, t, n, a]
|
|
2050
2053
|
);
|
|
2051
2054
|
return /* @__PURE__ */ e(
|
|
2052
2055
|
"button",
|
|
2053
2056
|
{
|
|
2054
|
-
ref:
|
|
2057
|
+
ref: w,
|
|
2055
2058
|
type: "button",
|
|
2056
|
-
"aria-label":
|
|
2059
|
+
"aria-label": x,
|
|
2057
2060
|
"aria-disabled": s,
|
|
2058
2061
|
"aria-pressed": i,
|
|
2059
2062
|
disabled: s,
|
|
2060
|
-
onPointerDown:
|
|
2061
|
-
onPointerMove:
|
|
2063
|
+
onPointerDown: O,
|
|
2064
|
+
onPointerMove: B,
|
|
2062
2065
|
onPointerUp: M,
|
|
2063
|
-
onPointerEnter:
|
|
2066
|
+
onPointerEnter: E,
|
|
2064
2067
|
onKeyDown: q,
|
|
2065
2068
|
onDragOver: I,
|
|
2066
2069
|
onDragLeave: S,
|
|
@@ -2069,18 +2072,18 @@ function ut({
|
|
|
2069
2072
|
"select-none touch-none cursor-pointer transition-colors",
|
|
2070
2073
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
2071
2074
|
// Hover state (only when not in selection)
|
|
2072
|
-
!(
|
|
2075
|
+
!(f || s) && "hover:bg-blue-50/60",
|
|
2073
2076
|
// Selection state — blue tint matching the primary color
|
|
2074
2077
|
i && "bg-blue-100/70",
|
|
2075
2078
|
// Drag over state - visual feedback when event is dragged over
|
|
2076
|
-
|
|
2079
|
+
L && "bg-primary/20 ring-2 ring-primary ring-inset",
|
|
2077
2080
|
// Disabled state
|
|
2078
2081
|
s && "cursor-not-allowed opacity-50",
|
|
2079
2082
|
l
|
|
2080
2083
|
),
|
|
2081
|
-
style: { height:
|
|
2084
|
+
style: { height: y, ...v },
|
|
2082
2085
|
...m,
|
|
2083
|
-
children:
|
|
2086
|
+
children: N
|
|
2084
2087
|
}
|
|
2085
2088
|
);
|
|
2086
2089
|
}
|
|
@@ -2090,60 +2093,60 @@ function mt({
|
|
|
2090
2093
|
hour: o,
|
|
2091
2094
|
minute: a,
|
|
2092
2095
|
ariaLabel: i,
|
|
2093
|
-
...
|
|
2096
|
+
...f
|
|
2094
2097
|
}) {
|
|
2095
|
-
const s = t ?? { date: n, hour: o ?? 0, minute: a ?? 0 },
|
|
2096
|
-
return /* @__PURE__ */ e(ut, { slot: s, ariaLabel:
|
|
2098
|
+
const s = t ?? { date: n, hour: o ?? 0, minute: a ?? 0 }, x = i ?? `Add event at ${(s.hour ?? 0).toString().padStart(2, "0")}:${(s.minute ?? 0).toString().padStart(2, "0")} on ${s.date.toLocaleDateString()}`;
|
|
2099
|
+
return /* @__PURE__ */ e(ut, { slot: s, ariaLabel: x, ...f });
|
|
2097
2100
|
}
|
|
2098
|
-
function
|
|
2099
|
-
const i = t ?? { date: n },
|
|
2100
|
-
return /* @__PURE__ */ e(ut, { slot: i, ariaLabel:
|
|
2101
|
+
function dn({ slot: t, date: n, ariaLabel: o, ...a }) {
|
|
2102
|
+
const i = t ?? { date: n }, f = o ?? `Select ${i.date.toLocaleDateString()}`;
|
|
2103
|
+
return /* @__PURE__ */ e(ut, { slot: i, ariaLabel: f, ...a });
|
|
2101
2104
|
}
|
|
2102
|
-
const
|
|
2103
|
-
function
|
|
2105
|
+
const fe = 96, ze = 72, We = 80;
|
|
2106
|
+
function Mn({
|
|
2104
2107
|
events: t,
|
|
2105
2108
|
date: n,
|
|
2106
2109
|
visibleHours: o = { startHour: 0, endHour: 24 },
|
|
2107
2110
|
workingHours: a,
|
|
2108
2111
|
slotDuration: i = 30,
|
|
2109
|
-
badgeVariant:
|
|
2112
|
+
badgeVariant: f = "colored",
|
|
2110
2113
|
onEventClick: s,
|
|
2111
|
-
onSlotSelect:
|
|
2112
|
-
className:
|
|
2114
|
+
onSlotSelect: x,
|
|
2115
|
+
className: N,
|
|
2113
2116
|
renderEvent: l,
|
|
2114
|
-
renderPopover:
|
|
2115
|
-
slots:
|
|
2117
|
+
renderPopover: y,
|
|
2118
|
+
slots: v,
|
|
2116
2119
|
classNames: m
|
|
2117
2120
|
}) {
|
|
2118
|
-
const g = 60 / i, u = 100 / g,
|
|
2119
|
-
const
|
|
2121
|
+
const g = 60 / i, u = 100 / g, b = F(() => {
|
|
2122
|
+
const k = [];
|
|
2120
2123
|
for (let c = 0; c < g; c++)
|
|
2121
|
-
|
|
2122
|
-
return
|
|
2123
|
-
}, [g, i]),
|
|
2124
|
-
const
|
|
2125
|
-
for (const
|
|
2126
|
-
c.set(
|
|
2124
|
+
k.push(c * i);
|
|
2125
|
+
return k;
|
|
2126
|
+
}, [g, i]), w = F(() => He(t, n), [t, n]), { singleDay: L, multiDay: T } = F(() => rt(w), [w]), A = F(() => {
|
|
2127
|
+
const k = ot(L, n, o, fe), c = /* @__PURE__ */ new Map();
|
|
2128
|
+
for (const p of k)
|
|
2129
|
+
c.set(p.event.id, p.position);
|
|
2127
2130
|
return c;
|
|
2128
|
-
}, [
|
|
2129
|
-
if (!
|
|
2130
|
-
const
|
|
2131
|
-
return
|
|
2132
|
-
}, [
|
|
2131
|
+
}, [L, n, o]), O = F(() => at(o), [o]), B = /* @__PURE__ */ new Date(), E = ce(n), M = F(() => {
|
|
2132
|
+
if (!E) return 0;
|
|
2133
|
+
const k = B.getHours() + B.getMinutes() / 60;
|
|
2134
|
+
return k < o.startHour || k > o.endHour ? -1 : (k - o.startHour) * fe;
|
|
2135
|
+
}, [E, o, B]), I = te(null);
|
|
2133
2136
|
Ie(() => {
|
|
2134
|
-
const
|
|
2135
|
-
if (!
|
|
2137
|
+
const k = I.current;
|
|
2138
|
+
if (!k) return;
|
|
2136
2139
|
const c = () => {
|
|
2137
|
-
let
|
|
2138
|
-
if (
|
|
2140
|
+
let p;
|
|
2141
|
+
if (E) {
|
|
2139
2142
|
const H = (/* @__PURE__ */ new Date()).getHours();
|
|
2140
|
-
|
|
2143
|
+
p = Math.max(H - 1, o.startHour);
|
|
2141
2144
|
} else {
|
|
2142
2145
|
const H = n.getDay(), z = a?.[H];
|
|
2143
|
-
z?.enabled && z.from > 0 ?
|
|
2146
|
+
z?.enabled && z.from > 0 ? p = Math.max(z.from - 1, o.startHour) : p = Math.max(7, o.startHour);
|
|
2144
2147
|
}
|
|
2145
|
-
const C = (
|
|
2146
|
-
|
|
2148
|
+
const C = (p - o.startHour) * fe;
|
|
2149
|
+
k.scrollTo({
|
|
2147
2150
|
top: C,
|
|
2148
2151
|
behavior: "instant"
|
|
2149
2152
|
});
|
|
@@ -2151,26 +2154,26 @@ function Sn({
|
|
|
2151
2154
|
requestAnimationFrame(() => {
|
|
2152
2155
|
requestAnimationFrame(c);
|
|
2153
2156
|
});
|
|
2154
|
-
}, [n, a, o,
|
|
2155
|
-
const S =
|
|
2156
|
-
(
|
|
2157
|
-
S?.startSelection(
|
|
2157
|
+
}, [n, a, o, E]);
|
|
2158
|
+
const S = Oe(), $ = W(
|
|
2159
|
+
(k) => {
|
|
2160
|
+
S?.startSelection(k);
|
|
2158
2161
|
},
|
|
2159
2162
|
[S]
|
|
2160
|
-
), q =
|
|
2161
|
-
(
|
|
2162
|
-
S?.updateSelection(
|
|
2163
|
+
), q = W(
|
|
2164
|
+
(k) => {
|
|
2165
|
+
S?.updateSelection(k);
|
|
2163
2166
|
},
|
|
2164
2167
|
[S]
|
|
2165
|
-
),
|
|
2168
|
+
), D = W(() => {
|
|
2166
2169
|
S?.endSelection();
|
|
2167
|
-
}, [S]),
|
|
2168
|
-
(
|
|
2169
|
-
s?.(
|
|
2170
|
+
}, [S]), h = W(
|
|
2171
|
+
(k) => {
|
|
2172
|
+
s?.(k);
|
|
2170
2173
|
},
|
|
2171
2174
|
[s]
|
|
2172
|
-
),
|
|
2173
|
-
return /* @__PURE__ */ r("div", { className: d("flex flex-col h-full",
|
|
2175
|
+
), _ = n.toLocaleDateString([], { weekday: "short" }), R = n.getDate(), P = ce(n);
|
|
2176
|
+
return /* @__PURE__ */ r("div", { className: d("flex flex-col h-full", N), children: [
|
|
2174
2177
|
/* @__PURE__ */ e(
|
|
2175
2178
|
"div",
|
|
2176
2179
|
{
|
|
@@ -2187,7 +2190,7 @@ function Sn({
|
|
|
2187
2190
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
2188
2191
|
P ? "text-primary" : "text-muted-foreground"
|
|
2189
2192
|
),
|
|
2190
|
-
children:
|
|
2193
|
+
children: _
|
|
2191
2194
|
}
|
|
2192
2195
|
),
|
|
2193
2196
|
/* @__PURE__ */ e(
|
|
@@ -2205,13 +2208,13 @@ function Sn({
|
|
|
2205
2208
|
}
|
|
2206
2209
|
),
|
|
2207
2210
|
T.length > 0 && /* @__PURE__ */ e(
|
|
2208
|
-
|
|
2211
|
+
sn,
|
|
2209
2212
|
{
|
|
2210
2213
|
events: T,
|
|
2211
2214
|
date: n,
|
|
2212
|
-
onEventClick:
|
|
2213
|
-
disablePopover: !!s && !
|
|
2214
|
-
renderPopover:
|
|
2215
|
+
onEventClick: h,
|
|
2216
|
+
disablePopover: !!s && !y,
|
|
2217
|
+
renderPopover: y,
|
|
2215
2218
|
...m?.multiDayBanner && { className: m.multiDayBanner }
|
|
2216
2219
|
}
|
|
2217
2220
|
),
|
|
@@ -2221,8 +2224,8 @@ function Sn({
|
|
|
2221
2224
|
ref: I,
|
|
2222
2225
|
className: d("flex-1", m?.scrollContainer),
|
|
2223
2226
|
children: /* @__PURE__ */ r("div", { className: "relative min-h-full", children: [
|
|
2224
|
-
|
|
2225
|
-
const C = !it(n,
|
|
2227
|
+
O.map((k, c) => {
|
|
2228
|
+
const C = !it(n, k, a);
|
|
2226
2229
|
return /* @__PURE__ */ r(
|
|
2227
2230
|
"div",
|
|
2228
2231
|
{
|
|
@@ -2232,7 +2235,7 @@ function Sn({
|
|
|
2232
2235
|
m?.timeSlot,
|
|
2233
2236
|
C ? m?.timeSlotNonWorking : m?.timeSlotWorking
|
|
2234
2237
|
),
|
|
2235
|
-
style: { height:
|
|
2238
|
+
style: { height: fe },
|
|
2236
2239
|
children: [
|
|
2237
2240
|
/* @__PURE__ */ e(
|
|
2238
2241
|
"div",
|
|
@@ -2249,15 +2252,15 @@ function Sn({
|
|
|
2249
2252
|
"text-[10px] sm:text-xs text-muted-foreground",
|
|
2250
2253
|
m?.timeGutterLabel
|
|
2251
2254
|
),
|
|
2252
|
-
children: Ce(
|
|
2255
|
+
children: Ce(k)
|
|
2253
2256
|
}
|
|
2254
2257
|
) })
|
|
2255
2258
|
}
|
|
2256
2259
|
),
|
|
2257
2260
|
/* @__PURE__ */ r("div", { className: "relative flex-1", children: [
|
|
2258
|
-
|
|
2261
|
+
E && !C && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-primary/5" }),
|
|
2259
2262
|
c !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
|
|
2260
|
-
|
|
2263
|
+
b.slice(1).map((H) => /* @__PURE__ */ e(
|
|
2261
2264
|
"div",
|
|
2262
2265
|
{
|
|
2263
2266
|
className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
|
|
@@ -2265,15 +2268,15 @@ function Sn({
|
|
|
2265
2268
|
},
|
|
2266
2269
|
H
|
|
2267
2270
|
)),
|
|
2268
|
-
|
|
2269
|
-
const Y = { date: n, hour:
|
|
2271
|
+
b.map((H, z) => {
|
|
2272
|
+
const Y = { date: n, hour: k, minute: H };
|
|
2270
2273
|
return /* @__PURE__ */ e(
|
|
2271
2274
|
mt,
|
|
2272
2275
|
{
|
|
2273
2276
|
slot: Y,
|
|
2274
2277
|
onSelectionStart: $,
|
|
2275
2278
|
onSelectionMove: q,
|
|
2276
|
-
onSelectionEnd:
|
|
2279
|
+
onSelectionEnd: D,
|
|
2277
2280
|
isSelected: S?.isSlotSelected(Y) ?? !1,
|
|
2278
2281
|
isSelecting: S?.isSelecting ?? !1,
|
|
2279
2282
|
disabled: C,
|
|
@@ -2282,7 +2285,7 @@ function Sn({
|
|
|
2282
2285
|
top: `${z * u}%`,
|
|
2283
2286
|
height: `${u}%`
|
|
2284
2287
|
},
|
|
2285
|
-
ariaLabel: `Add event at ${Ce(
|
|
2288
|
+
ariaLabel: `Add event at ${Ce(k)}:${String(H).padStart(2, "0")}`
|
|
2286
2289
|
},
|
|
2287
2290
|
H
|
|
2288
2291
|
);
|
|
@@ -2290,7 +2293,7 @@ function Sn({
|
|
|
2290
2293
|
] })
|
|
2291
2294
|
]
|
|
2292
2295
|
},
|
|
2293
|
-
|
|
2296
|
+
k
|
|
2294
2297
|
);
|
|
2295
2298
|
}),
|
|
2296
2299
|
/* @__PURE__ */ e(
|
|
@@ -2298,10 +2301,10 @@ function Sn({
|
|
|
2298
2301
|
{
|
|
2299
2302
|
className: "absolute top-0 bottom-0 right-0 pointer-events-none",
|
|
2300
2303
|
style: { left: ze },
|
|
2301
|
-
children:
|
|
2302
|
-
const c = A.get(
|
|
2304
|
+
children: L.map((k) => {
|
|
2305
|
+
const c = A.get(k.id);
|
|
2303
2306
|
if (!c) return null;
|
|
2304
|
-
const
|
|
2307
|
+
const p = `calc(${c.width}% - 2px)`, C = `max(${We}px, ${p})`;
|
|
2305
2308
|
return l ? /* @__PURE__ */ e(
|
|
2306
2309
|
"div",
|
|
2307
2310
|
{
|
|
@@ -2310,34 +2313,34 @@ function Sn({
|
|
|
2310
2313
|
top: `${c.top}px`,
|
|
2311
2314
|
left: `${c.left}%`,
|
|
2312
2315
|
width: C,
|
|
2313
|
-
minWidth: `${
|
|
2316
|
+
minWidth: `${We}px`
|
|
2314
2317
|
},
|
|
2315
|
-
children: l({ event:
|
|
2318
|
+
children: l({ event: k, position: c })
|
|
2316
2319
|
},
|
|
2317
|
-
|
|
2320
|
+
k.id
|
|
2318
2321
|
) : /* @__PURE__ */ e(
|
|
2319
2322
|
lt,
|
|
2320
2323
|
{
|
|
2321
|
-
event:
|
|
2324
|
+
event: k,
|
|
2322
2325
|
position: {
|
|
2323
2326
|
top: c.top,
|
|
2324
2327
|
left: c.left,
|
|
2325
2328
|
width: c.width,
|
|
2326
|
-
minWidth:
|
|
2329
|
+
minWidth: We
|
|
2327
2330
|
},
|
|
2328
|
-
hourHeight:
|
|
2329
|
-
badgeVariant:
|
|
2331
|
+
hourHeight: fe,
|
|
2332
|
+
badgeVariant: f,
|
|
2330
2333
|
onClick: s,
|
|
2331
|
-
disablePopover: !!s && !
|
|
2332
|
-
renderPopover:
|
|
2334
|
+
disablePopover: !!s && !y,
|
|
2335
|
+
renderPopover: y,
|
|
2333
2336
|
className: d("pointer-events-auto", m?.eventCard)
|
|
2334
2337
|
},
|
|
2335
|
-
|
|
2338
|
+
k.id
|
|
2336
2339
|
);
|
|
2337
2340
|
})
|
|
2338
2341
|
}
|
|
2339
2342
|
),
|
|
2340
|
-
|
|
2343
|
+
E && M >= 0 && /* @__PURE__ */ r(
|
|
2341
2344
|
"div",
|
|
2342
2345
|
{
|
|
2343
2346
|
className: d(
|
|
@@ -2359,7 +2362,7 @@ function Sn({
|
|
|
2359
2362
|
)
|
|
2360
2363
|
] });
|
|
2361
2364
|
}
|
|
2362
|
-
const
|
|
2365
|
+
const cn = [
|
|
2363
2366
|
{ full: "Monday", short: "Mon", tiny: "M" },
|
|
2364
2367
|
{ full: "Tuesday", short: "Tue", tiny: "T" },
|
|
2365
2368
|
{ full: "Wednesday", short: "Wed", tiny: "W" },
|
|
@@ -2367,7 +2370,7 @@ const dn = [
|
|
|
2367
2370
|
{ full: "Friday", short: "Fri", tiny: "F" },
|
|
2368
2371
|
{ full: "Saturday", short: "Sat", tiny: "S" },
|
|
2369
2372
|
{ full: "Sunday", short: "Sun", tiny: "S" }
|
|
2370
|
-
],
|
|
2373
|
+
], un = [
|
|
2371
2374
|
{ full: "Sunday", short: "Sun", tiny: "S" },
|
|
2372
2375
|
{ full: "Monday", short: "Mon", tiny: "M" },
|
|
2373
2376
|
{ full: "Tuesday", short: "Tue", tiny: "T" },
|
|
@@ -2375,49 +2378,49 @@ const dn = [
|
|
|
2375
2378
|
{ full: "Thursday", short: "Thu", tiny: "T" },
|
|
2376
2379
|
{ full: "Friday", short: "Fri", tiny: "F" },
|
|
2377
2380
|
{ full: "Saturday", short: "Sat", tiny: "S" }
|
|
2378
|
-
],
|
|
2379
|
-
function
|
|
2381
|
+
], ge = 3;
|
|
2382
|
+
function Tn({
|
|
2380
2383
|
events: t,
|
|
2381
2384
|
date: n,
|
|
2382
2385
|
weekStartsOn: o = 1,
|
|
2383
2386
|
badgeVariant: a = "colored",
|
|
2384
2387
|
onEventClick: i,
|
|
2385
|
-
onSlotSelect:
|
|
2388
|
+
onSlotSelect: f,
|
|
2386
2389
|
onDayClick: s,
|
|
2387
|
-
className:
|
|
2388
|
-
renderEvent:
|
|
2390
|
+
className: x,
|
|
2391
|
+
renderEvent: N,
|
|
2389
2392
|
renderPopover: l,
|
|
2390
|
-
showMoreMode:
|
|
2391
|
-
showMoreEventsInPopover:
|
|
2393
|
+
showMoreMode: y,
|
|
2394
|
+
showMoreEventsInPopover: v = !1,
|
|
2392
2395
|
slots: m,
|
|
2393
2396
|
classNames: g
|
|
2394
2397
|
}) {
|
|
2395
|
-
const u =
|
|
2396
|
-
const
|
|
2397
|
-
for (const
|
|
2398
|
-
const R =
|
|
2399
|
-
P.sort((
|
|
2398
|
+
const u = y ?? (v ? "popover" : "expand"), b = m?.dayCellHeader, w = m?.dayCellFooter, [L, T] = J(null), [A, O] = J(null), B = F(() => bt(n, o), [n, o]), E = F(() => {
|
|
2399
|
+
const h = /* @__PURE__ */ new Map();
|
|
2400
|
+
for (const _ of B) {
|
|
2401
|
+
const R = _.date.toDateString(), P = He(t, _.date);
|
|
2402
|
+
P.sort((k, c) => k.startDate.getTime() - c.startDate.getTime()), h.set(R, P);
|
|
2400
2403
|
}
|
|
2401
|
-
return
|
|
2402
|
-
}, [
|
|
2403
|
-
(
|
|
2404
|
-
M?.startSelection(
|
|
2404
|
+
return h;
|
|
2405
|
+
}, [B, t]), M = Oe(), I = W(
|
|
2406
|
+
(h) => {
|
|
2407
|
+
M?.startSelection(h);
|
|
2405
2408
|
},
|
|
2406
2409
|
[M]
|
|
2407
|
-
), S =
|
|
2408
|
-
(
|
|
2409
|
-
M?.updateSelection(
|
|
2410
|
+
), S = W(
|
|
2411
|
+
(h) => {
|
|
2412
|
+
M?.updateSelection(h);
|
|
2410
2413
|
},
|
|
2411
2414
|
[M]
|
|
2412
|
-
), $ =
|
|
2415
|
+
), $ = W(() => {
|
|
2413
2416
|
M?.endSelection();
|
|
2414
|
-
}, [M]), q =
|
|
2415
|
-
(
|
|
2416
|
-
s?.(
|
|
2417
|
+
}, [M]), q = W(
|
|
2418
|
+
(h) => {
|
|
2419
|
+
s?.(h);
|
|
2417
2420
|
},
|
|
2418
2421
|
[s]
|
|
2419
|
-
),
|
|
2420
|
-
return /* @__PURE__ */ r("div", { className: d("flex flex-col h-full overflow-hidden",
|
|
2422
|
+
), D = o === 0 ? un : cn;
|
|
2423
|
+
return /* @__PURE__ */ r("div", { className: d("flex flex-col h-full overflow-hidden", x), children: [
|
|
2421
2424
|
/* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-auto", children: /* @__PURE__ */ r("div", { className: "flex flex-col flex-1 min-w-[560px] sm:min-w-0", children: [
|
|
2422
2425
|
/* @__PURE__ */ e(
|
|
2423
2426
|
"div",
|
|
@@ -2426,81 +2429,81 @@ function Mn({
|
|
|
2426
2429
|
"grid grid-cols-7 border-b !sticky !top-0 bg-background z-10",
|
|
2427
2430
|
g?.weekdayHeader
|
|
2428
2431
|
),
|
|
2429
|
-
children:
|
|
2432
|
+
children: D.map((h, _) => /* @__PURE__ */ r(
|
|
2430
2433
|
"div",
|
|
2431
2434
|
{
|
|
2432
2435
|
className: d(
|
|
2433
2436
|
"py-2 sm:py-2.5 text-center text-[11px] uppercase font-medium tracking-wide text-muted-foreground",
|
|
2434
|
-
|
|
2437
|
+
_ >= 5 && "text-muted-foreground/70",
|
|
2435
2438
|
// Weekend
|
|
2436
2439
|
g?.weekdayLabel
|
|
2437
2440
|
),
|
|
2438
2441
|
children: [
|
|
2439
|
-
/* @__PURE__ */ e("span", { className: "sm:hidden", children:
|
|
2440
|
-
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children:
|
|
2442
|
+
/* @__PURE__ */ e("span", { className: "sm:hidden", children: h.short }),
|
|
2443
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: h.short })
|
|
2441
2444
|
]
|
|
2442
2445
|
},
|
|
2443
|
-
|
|
2446
|
+
h.full
|
|
2444
2447
|
))
|
|
2445
2448
|
}
|
|
2446
2449
|
),
|
|
2447
|
-
/* @__PURE__ */ e("div", { className: d("grid grid-cols-7 auto-rows-min", g?.monthGrid), children:
|
|
2448
|
-
const
|
|
2450
|
+
/* @__PURE__ */ e("div", { className: d("grid grid-cols-7 auto-rows-min", g?.monthGrid), children: B.map((h) => {
|
|
2451
|
+
const _ = h.date.toDateString(), R = E.get(_) || [], P = ce(h.date), k = h.date.getDay() === 0 || h.date.getDay() === 6, c = R.length > ge;
|
|
2449
2452
|
return /* @__PURE__ */ r(
|
|
2450
|
-
|
|
2453
|
+
dn,
|
|
2451
2454
|
{
|
|
2452
|
-
date:
|
|
2453
|
-
dataAttributes: { "data-day-key":
|
|
2455
|
+
date: h.date,
|
|
2456
|
+
dataAttributes: { "data-day-key": _ },
|
|
2454
2457
|
onSelectionStart: I,
|
|
2455
2458
|
onSelectionMove: S,
|
|
2456
2459
|
onSelectionEnd: $,
|
|
2457
|
-
isSelected: M?.isSlotSelected({ date:
|
|
2460
|
+
isSelected: M?.isSlotSelected({ date: h.date }) ?? !1,
|
|
2458
2461
|
isSelecting: M?.isSelecting ?? !1,
|
|
2459
2462
|
className: d(
|
|
2460
2463
|
"relative flex flex-col border-r border-b text-left min-h-[80px] sm:min-h-[100px] overflow-hidden",
|
|
2461
2464
|
"[&:nth-child(7n)]:border-r-0",
|
|
2462
|
-
!
|
|
2463
|
-
|
|
2465
|
+
!h.isCurrentMonth && "bg-muted/20",
|
|
2466
|
+
k && h.isCurrentMonth && "bg-muted/10",
|
|
2464
2467
|
g?.dayCell,
|
|
2465
2468
|
P && g?.dayCellToday,
|
|
2466
|
-
!
|
|
2467
|
-
|
|
2469
|
+
!h.isCurrentMonth && g?.dayCellOutside,
|
|
2470
|
+
k && g?.dayCellWeekend
|
|
2468
2471
|
),
|
|
2469
|
-
ariaLabel: `${
|
|
2472
|
+
ariaLabel: `${h.date.toLocaleDateString()} - ${R.length} events. Click to create event, double-click to view day.`,
|
|
2470
2473
|
children: [
|
|
2471
2474
|
/* @__PURE__ */ e(
|
|
2472
2475
|
"div",
|
|
2473
2476
|
{
|
|
2474
2477
|
className: d(
|
|
2475
2478
|
"flex items-center justify-center p-1",
|
|
2476
|
-
!
|
|
2479
|
+
!h.isCurrentMonth && "text-muted-foreground/40",
|
|
2477
2480
|
g?.dayCellNumber
|
|
2478
2481
|
),
|
|
2479
2482
|
children: /* @__PURE__ */ e(
|
|
2480
2483
|
"button",
|
|
2481
2484
|
{
|
|
2482
2485
|
type: "button",
|
|
2483
|
-
onClick: (
|
|
2484
|
-
|
|
2486
|
+
onClick: (p) => {
|
|
2487
|
+
p.stopPropagation(), q(h.date);
|
|
2485
2488
|
},
|
|
2486
2489
|
className: d(
|
|
2487
2490
|
"flex items-center justify-center rounded-full transition-colors",
|
|
2488
2491
|
"size-7 text-sm font-normal",
|
|
2489
2492
|
P ? "bg-primary text-primary-foreground" : "hover:bg-muted"
|
|
2490
2493
|
),
|
|
2491
|
-
children:
|
|
2494
|
+
children: h.date.getDate()
|
|
2492
2495
|
}
|
|
2493
2496
|
)
|
|
2494
2497
|
}
|
|
2495
2498
|
),
|
|
2496
|
-
|
|
2497
|
-
|
|
2499
|
+
b && /* @__PURE__ */ e(
|
|
2500
|
+
b,
|
|
2498
2501
|
{
|
|
2499
|
-
date:
|
|
2502
|
+
date: h.date,
|
|
2500
2503
|
events: R,
|
|
2501
2504
|
isToday: P,
|
|
2502
|
-
isCurrentMonth:
|
|
2503
|
-
isWeekend:
|
|
2505
|
+
isCurrentMonth: h.isCurrentMonth,
|
|
2506
|
+
isWeekend: k,
|
|
2504
2507
|
view: "month"
|
|
2505
2508
|
}
|
|
2506
2509
|
),
|
|
@@ -2512,16 +2515,16 @@ function Mn({
|
|
|
2512
2515
|
g?.dayCellContent
|
|
2513
2516
|
),
|
|
2514
2517
|
children: [
|
|
2515
|
-
R.slice(0,
|
|
2518
|
+
R.slice(0, ge).map((p) => /* @__PURE__ */ e(
|
|
2516
2519
|
"div",
|
|
2517
2520
|
{
|
|
2518
2521
|
onPointerDown: (C) => {
|
|
2519
2522
|
C.stopPropagation();
|
|
2520
2523
|
},
|
|
2521
|
-
children:
|
|
2524
|
+
children: N ? N({ event: p, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2522
2525
|
Se,
|
|
2523
2526
|
{
|
|
2524
|
-
event:
|
|
2527
|
+
event: p,
|
|
2525
2528
|
variant: "compact",
|
|
2526
2529
|
badgeVariant: a,
|
|
2527
2530
|
onClick: i,
|
|
@@ -2535,18 +2538,18 @@ function Mn({
|
|
|
2535
2538
|
}
|
|
2536
2539
|
)
|
|
2537
2540
|
},
|
|
2538
|
-
|
|
2541
|
+
p.id
|
|
2539
2542
|
)),
|
|
2540
2543
|
c && u === "expand" && /* @__PURE__ */ r(
|
|
2541
2544
|
"button",
|
|
2542
2545
|
{
|
|
2543
2546
|
type: "button",
|
|
2544
|
-
onPointerDown: (
|
|
2545
|
-
onClick: (
|
|
2546
|
-
|
|
2547
|
-
const C = document.querySelector(`[data-day-key="${
|
|
2548
|
-
|
|
2549
|
-
date:
|
|
2547
|
+
onPointerDown: (p) => p.stopPropagation(),
|
|
2548
|
+
onClick: (p) => {
|
|
2549
|
+
p.stopPropagation();
|
|
2550
|
+
const C = document.querySelector(`[data-day-key="${_}"]`);
|
|
2551
|
+
O({
|
|
2552
|
+
date: h.date,
|
|
2550
2553
|
events: R,
|
|
2551
2554
|
rect: C?.getBoundingClientRect() ?? new DOMRect(window.innerWidth / 2 - 180, window.innerHeight / 2 - 240, 0, 0)
|
|
2552
2555
|
});
|
|
@@ -2557,7 +2560,7 @@ function Mn({
|
|
|
2557
2560
|
),
|
|
2558
2561
|
children: [
|
|
2559
2562
|
"+",
|
|
2560
|
-
R.length -
|
|
2563
|
+
R.length - ge,
|
|
2561
2564
|
" more"
|
|
2562
2565
|
]
|
|
2563
2566
|
}
|
|
@@ -2565,16 +2568,16 @@ function Mn({
|
|
|
2565
2568
|
c && u === "popover" && /* @__PURE__ */ r(
|
|
2566
2569
|
re,
|
|
2567
2570
|
{
|
|
2568
|
-
open:
|
|
2569
|
-
onOpenChange: (
|
|
2571
|
+
open: L === _,
|
|
2572
|
+
onOpenChange: (p) => T(p ? _ : null),
|
|
2570
2573
|
children: [
|
|
2571
2574
|
/* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2572
2575
|
"button",
|
|
2573
2576
|
{
|
|
2574
2577
|
type: "button",
|
|
2575
|
-
onPointerDown: (
|
|
2576
|
-
onClick: (
|
|
2577
|
-
|
|
2578
|
+
onPointerDown: (p) => p.stopPropagation(),
|
|
2579
|
+
onClick: (p) => {
|
|
2580
|
+
p.stopPropagation(), T(_);
|
|
2578
2581
|
},
|
|
2579
2582
|
className: d(
|
|
2580
2583
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
@@ -2582,7 +2585,7 @@ function Mn({
|
|
|
2582
2585
|
),
|
|
2583
2586
|
children: [
|
|
2584
2587
|
"+",
|
|
2585
|
-
R.length -
|
|
2588
|
+
R.length - ge,
|
|
2586
2589
|
" more"
|
|
2587
2590
|
]
|
|
2588
2591
|
}
|
|
@@ -2594,10 +2597,10 @@ function Mn({
|
|
|
2594
2597
|
side: "right",
|
|
2595
2598
|
sideOffset: 8,
|
|
2596
2599
|
className: "w-72 max-h-80 overflow-y-auto p-2",
|
|
2597
|
-
onPointerDown: (
|
|
2600
|
+
onPointerDown: (p) => p.stopPropagation(),
|
|
2598
2601
|
children: [
|
|
2599
2602
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-2 pb-2 border-b", children: [
|
|
2600
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children:
|
|
2603
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: h.date.toLocaleDateString(void 0, {
|
|
2601
2604
|
weekday: "short",
|
|
2602
2605
|
month: "short",
|
|
2603
2606
|
day: "numeric"
|
|
@@ -2607,10 +2610,10 @@ function Mn({
|
|
|
2607
2610
|
" events"
|
|
2608
2611
|
] })
|
|
2609
2612
|
] }),
|
|
2610
|
-
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: R.map((
|
|
2613
|
+
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: R.map((p) => /* @__PURE__ */ e("div", { children: N ? N({ event: p, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2611
2614
|
Se,
|
|
2612
2615
|
{
|
|
2613
|
-
event:
|
|
2616
|
+
event: p,
|
|
2614
2617
|
variant: "compact",
|
|
2615
2618
|
badgeVariant: a,
|
|
2616
2619
|
onClick: (C) => {
|
|
@@ -2620,7 +2623,7 @@ function Mn({
|
|
|
2620
2623
|
renderPopover: l,
|
|
2621
2624
|
showTime: !0
|
|
2622
2625
|
}
|
|
2623
|
-
) },
|
|
2626
|
+
) }, p.id)) })
|
|
2624
2627
|
]
|
|
2625
2628
|
}
|
|
2626
2629
|
)
|
|
@@ -2630,8 +2633,8 @@ function Mn({
|
|
|
2630
2633
|
c && u === "dayView" && /* @__PURE__ */ r(
|
|
2631
2634
|
"div",
|
|
2632
2635
|
{
|
|
2633
|
-
onPointerDown: (
|
|
2634
|
-
|
|
2636
|
+
onPointerDown: (p) => {
|
|
2637
|
+
p.stopPropagation(), q(h.date);
|
|
2635
2638
|
},
|
|
2636
2639
|
className: d(
|
|
2637
2640
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
@@ -2639,7 +2642,7 @@ function Mn({
|
|
|
2639
2642
|
),
|
|
2640
2643
|
children: [
|
|
2641
2644
|
"+",
|
|
2642
|
-
R.length -
|
|
2645
|
+
R.length - ge,
|
|
2643
2646
|
" more"
|
|
2644
2647
|
]
|
|
2645
2648
|
}
|
|
@@ -2647,93 +2650,93 @@ function Mn({
|
|
|
2647
2650
|
]
|
|
2648
2651
|
}
|
|
2649
2652
|
),
|
|
2650
|
-
|
|
2651
|
-
|
|
2653
|
+
w && /* @__PURE__ */ e(
|
|
2654
|
+
w,
|
|
2652
2655
|
{
|
|
2653
|
-
date:
|
|
2656
|
+
date: h.date,
|
|
2654
2657
|
events: R,
|
|
2655
2658
|
isToday: P,
|
|
2656
|
-
isCurrentMonth:
|
|
2657
|
-
isWeekend:
|
|
2659
|
+
isCurrentMonth: h.isCurrentMonth,
|
|
2660
|
+
isWeekend: k,
|
|
2658
2661
|
view: "month"
|
|
2659
2662
|
}
|
|
2660
2663
|
)
|
|
2661
2664
|
]
|
|
2662
2665
|
},
|
|
2663
|
-
|
|
2666
|
+
_
|
|
2664
2667
|
);
|
|
2665
2668
|
}) })
|
|
2666
2669
|
] }) }),
|
|
2667
2670
|
/* @__PURE__ */ e(
|
|
2668
|
-
|
|
2671
|
+
rn,
|
|
2669
2672
|
{
|
|
2670
2673
|
isOpen: A !== null,
|
|
2671
|
-
onClose: () =>
|
|
2674
|
+
onClose: () => O(null),
|
|
2672
2675
|
date: A?.date ?? /* @__PURE__ */ new Date(),
|
|
2673
2676
|
events: A?.events ?? [],
|
|
2674
2677
|
anchorRect: A?.rect ?? null,
|
|
2675
2678
|
badgeVariant: a,
|
|
2676
2679
|
onEventClick: i,
|
|
2677
|
-
renderEvent:
|
|
2680
|
+
renderEvent: N,
|
|
2678
2681
|
renderPopover: l
|
|
2679
2682
|
}
|
|
2680
2683
|
)
|
|
2681
2684
|
] });
|
|
2682
2685
|
}
|
|
2683
|
-
const Me = 26, et = 2,
|
|
2686
|
+
const Me = 26, et = 2, Ne = 4;
|
|
2684
2687
|
function tt(t, n) {
|
|
2685
2688
|
const o = Ge(t);
|
|
2686
2689
|
for (let i = 0; i < n.length; i++) {
|
|
2687
|
-
const
|
|
2688
|
-
if (
|
|
2690
|
+
const f = n[i];
|
|
2691
|
+
if (f && le(o, f)) return i;
|
|
2689
2692
|
}
|
|
2690
2693
|
const a = n[0];
|
|
2691
2694
|
return a && o < Ge(a) ? -1 : 7;
|
|
2692
2695
|
}
|
|
2693
|
-
function
|
|
2696
|
+
function mn(t) {
|
|
2694
2697
|
const n = [...t].sort((a, i) => {
|
|
2695
|
-
const
|
|
2696
|
-
return s !==
|
|
2698
|
+
const f = a.endCol - a.startCol, s = i.endCol - i.startCol;
|
|
2699
|
+
return s !== f ? s - f : a.startCol - i.startCol;
|
|
2697
2700
|
}), o = [];
|
|
2698
2701
|
return n.map((a) => {
|
|
2699
2702
|
let i = -1;
|
|
2700
2703
|
for (let s = 0; s < o.length; s++) {
|
|
2701
|
-
const
|
|
2702
|
-
if (!
|
|
2703
|
-
let
|
|
2704
|
+
const x = o[s];
|
|
2705
|
+
if (!x) continue;
|
|
2706
|
+
let N = !0;
|
|
2704
2707
|
for (let l = a.startCol; l <= a.endCol; l++)
|
|
2705
|
-
if (
|
|
2706
|
-
|
|
2708
|
+
if (x[l]) {
|
|
2709
|
+
N = !1;
|
|
2707
2710
|
break;
|
|
2708
2711
|
}
|
|
2709
|
-
if (
|
|
2712
|
+
if (N) {
|
|
2710
2713
|
i = s;
|
|
2711
2714
|
break;
|
|
2712
2715
|
}
|
|
2713
2716
|
}
|
|
2714
2717
|
i === -1 && (i = o.length, o.push(new Array(7).fill(!1)));
|
|
2715
|
-
const
|
|
2716
|
-
if (
|
|
2718
|
+
const f = o[i];
|
|
2719
|
+
if (f)
|
|
2717
2720
|
for (let s = a.startCol; s <= a.endCol; s++)
|
|
2718
|
-
|
|
2721
|
+
f[s] = !0;
|
|
2719
2722
|
return { ...a, row: i };
|
|
2720
2723
|
});
|
|
2721
2724
|
}
|
|
2722
|
-
function
|
|
2725
|
+
function hn({
|
|
2723
2726
|
pe: t,
|
|
2724
2727
|
onEventClick: n,
|
|
2725
2728
|
disablePopover: o,
|
|
2726
2729
|
renderPopover: a
|
|
2727
2730
|
}) {
|
|
2728
|
-
const [i,
|
|
2729
|
-
o && n ? n(t.event) : o ||
|
|
2730
|
-
}, [o, n, t.event]),
|
|
2731
|
-
|
|
2731
|
+
const [i, f] = J(!1), s = de(t.event.color), x = W(() => {
|
|
2732
|
+
o && n ? n(t.event) : o || f(!0);
|
|
2733
|
+
}, [o, n, t.event]), N = W(() => {
|
|
2734
|
+
f(!1);
|
|
2732
2735
|
}, []), l = /* @__PURE__ */ r(
|
|
2733
2736
|
"button",
|
|
2734
2737
|
{
|
|
2735
2738
|
type: "button",
|
|
2736
|
-
onClick:
|
|
2739
|
+
onClick: x,
|
|
2737
2740
|
className: d(
|
|
2738
2741
|
"inline-flex items-center gap-1 rounded text-[10px] font-medium transition-opacity hover:opacity-80 mx-0.5 overflow-hidden w-full",
|
|
2739
2742
|
"sm:text-xs",
|
|
@@ -2756,22 +2759,22 @@ function mn({
|
|
|
2756
2759
|
t.continuesAfter && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-60 flex-shrink-0", children: "▸" })
|
|
2757
2760
|
]
|
|
2758
2761
|
}
|
|
2759
|
-
),
|
|
2762
|
+
), y = /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
2760
2763
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.event.title }),
|
|
2761
2764
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t.event) })
|
|
2762
|
-
] }) }),
|
|
2765
|
+
] }) }), v = {
|
|
2763
2766
|
gridColumn: `${t.startCol + 2} / ${t.endCol + 3}`,
|
|
2764
2767
|
gridRow: t.row + 1
|
|
2765
2768
|
};
|
|
2766
|
-
return o ? /* @__PURE__ */ e("div", { style:
|
|
2769
|
+
return o ? /* @__PURE__ */ e("div", { style: v, children: /* @__PURE__ */ r(ie, { children: [
|
|
2767
2770
|
/* @__PURE__ */ e(se, { asChild: !0, children: l }),
|
|
2768
|
-
|
|
2769
|
-
] }) }) : /* @__PURE__ */ e("div", { style:
|
|
2771
|
+
y
|
|
2772
|
+
] }) }) : /* @__PURE__ */ e("div", { style: v, children: /* @__PURE__ */ r(re, { open: i, onOpenChange: f, children: [
|
|
2770
2773
|
/* @__PURE__ */ e(oe, { asChild: !0, children: l }),
|
|
2771
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children: a ? a({ event: t.event, onClose:
|
|
2774
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: a ? a({ event: t.event, onClose: N }) : /* @__PURE__ */ e(pn, { event: t.event, onClose: N }) })
|
|
2772
2775
|
] }) });
|
|
2773
2776
|
}
|
|
2774
|
-
function
|
|
2777
|
+
function pn({
|
|
2775
2778
|
event: t,
|
|
2776
2779
|
onClose: n
|
|
2777
2780
|
}) {
|
|
@@ -2809,54 +2812,54 @@ function hn({
|
|
|
2809
2812
|
) })
|
|
2810
2813
|
] });
|
|
2811
2814
|
}
|
|
2812
|
-
function
|
|
2815
|
+
function fn({
|
|
2813
2816
|
events: t,
|
|
2814
2817
|
weekDays: n,
|
|
2815
2818
|
hourColumnWidth: o,
|
|
2816
2819
|
minDayColumnWidth: a,
|
|
2817
2820
|
dayColumnWidths: i,
|
|
2818
|
-
onEventClick:
|
|
2821
|
+
onEventClick: f,
|
|
2819
2822
|
disablePopover: s = !1,
|
|
2820
|
-
renderPopover:
|
|
2821
|
-
className:
|
|
2823
|
+
renderPopover: x,
|
|
2824
|
+
className: N
|
|
2822
2825
|
}) {
|
|
2823
2826
|
const l = F(() => {
|
|
2824
2827
|
if (t.length === 0) return [];
|
|
2825
|
-
const
|
|
2826
|
-
const T = tt(
|
|
2827
|
-
if (
|
|
2828
|
-
const
|
|
2828
|
+
const w = t.map((L) => {
|
|
2829
|
+
const T = tt(L.startDate, n), A = tt(L.endDate, n), O = Math.max(0, T), B = Math.min(6, A);
|
|
2830
|
+
if (O > 6 || B < 0) return null;
|
|
2831
|
+
const E = T < 0, M = A > 6, S = De(L) && le(L.startDate, L.endDate);
|
|
2829
2832
|
return {
|
|
2830
|
-
event:
|
|
2831
|
-
startCol:
|
|
2832
|
-
endCol:
|
|
2833
|
-
continuesBefore:
|
|
2833
|
+
event: L,
|
|
2834
|
+
startCol: O,
|
|
2835
|
+
endCol: B,
|
|
2836
|
+
continuesBefore: E,
|
|
2834
2837
|
continuesAfter: M,
|
|
2835
2838
|
isSingleDayAllDay: S
|
|
2836
2839
|
};
|
|
2837
2840
|
}).filter(Boolean);
|
|
2838
|
-
return
|
|
2841
|
+
return mn(w);
|
|
2839
2842
|
}, [t, n]);
|
|
2840
2843
|
if (l.length === 0) return null;
|
|
2841
|
-
const
|
|
2844
|
+
const y = Math.max(...l.map((w) => w.row)) + 1, v = Math.min(y, Ne), m = y > Ne, g = m ? l.filter((w) => w.row >= Ne).length : 0, u = [
|
|
2842
2845
|
`${o}px`,
|
|
2843
|
-
...i.map((
|
|
2844
|
-
].join(" "),
|
|
2846
|
+
...i.map((w) => w > a ? `${w}px` : `minmax(${a}px, 1fr)`)
|
|
2847
|
+
].join(" "), b = v * Me + (v - 1) * et + 8;
|
|
2845
2848
|
return /* @__PURE__ */ r(
|
|
2846
2849
|
"div",
|
|
2847
2850
|
{
|
|
2848
2851
|
className: d(
|
|
2849
2852
|
"ic-all-day-row border-b bg-muted/20 relative",
|
|
2850
|
-
|
|
2853
|
+
N
|
|
2851
2854
|
),
|
|
2852
2855
|
style: {
|
|
2853
2856
|
display: "grid",
|
|
2854
2857
|
gridTemplateColumns: u,
|
|
2855
|
-
gridTemplateRows: `repeat(${
|
|
2858
|
+
gridTemplateRows: `repeat(${v}, ${Me}px)`,
|
|
2856
2859
|
gap: `${et}px 0`,
|
|
2857
2860
|
paddingTop: 4,
|
|
2858
2861
|
paddingBottom: 4,
|
|
2859
|
-
minHeight:
|
|
2862
|
+
minHeight: b
|
|
2860
2863
|
},
|
|
2861
2864
|
children: [
|
|
2862
2865
|
/* @__PURE__ */ e(
|
|
@@ -2865,31 +2868,31 @@ function pn({
|
|
|
2865
2868
|
className: "flex items-start justify-center pt-1 text-[10px] font-medium text-muted-foreground",
|
|
2866
2869
|
style: {
|
|
2867
2870
|
gridColumn: 1,
|
|
2868
|
-
gridRow: `1 / span ${
|
|
2871
|
+
gridRow: `1 / span ${v}`
|
|
2869
2872
|
},
|
|
2870
2873
|
children: /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: "All day" })
|
|
2871
2874
|
}
|
|
2872
2875
|
),
|
|
2873
|
-
n.map((
|
|
2876
|
+
n.map((w, L) => /* @__PURE__ */ e(
|
|
2874
2877
|
"div",
|
|
2875
2878
|
{
|
|
2876
2879
|
className: "pointer-events-none border-r last:border-r-0",
|
|
2877
2880
|
style: {
|
|
2878
|
-
gridColumn:
|
|
2879
|
-
gridRow: `1 / span ${
|
|
2881
|
+
gridColumn: L + 2,
|
|
2882
|
+
gridRow: `1 / span ${v}`
|
|
2880
2883
|
}
|
|
2881
2884
|
},
|
|
2882
|
-
|
|
2885
|
+
w.toDateString()
|
|
2883
2886
|
)),
|
|
2884
|
-
l.filter((
|
|
2885
|
-
|
|
2887
|
+
l.filter((w) => w.row < Ne).map((w) => /* @__PURE__ */ e(
|
|
2888
|
+
hn,
|
|
2886
2889
|
{
|
|
2887
|
-
pe:
|
|
2888
|
-
onEventClick:
|
|
2890
|
+
pe: w,
|
|
2891
|
+
onEventClick: f,
|
|
2889
2892
|
disablePopover: s,
|
|
2890
|
-
renderPopover:
|
|
2893
|
+
renderPopover: x
|
|
2891
2894
|
},
|
|
2892
|
-
|
|
2895
|
+
w.event.id
|
|
2893
2896
|
)),
|
|
2894
2897
|
m && /* @__PURE__ */ r(
|
|
2895
2898
|
"div",
|
|
@@ -2897,7 +2900,7 @@ function pn({
|
|
|
2897
2900
|
className: "text-[10px] text-muted-foreground font-medium px-2 flex items-center",
|
|
2898
2901
|
style: {
|
|
2899
2902
|
gridColumn: `2 / ${n.length + 2}`,
|
|
2900
|
-
gridRow:
|
|
2903
|
+
gridRow: v
|
|
2901
2904
|
},
|
|
2902
2905
|
children: [
|
|
2903
2906
|
"+",
|
|
@@ -2910,46 +2913,46 @@ function pn({
|
|
|
2910
2913
|
}
|
|
2911
2914
|
);
|
|
2912
2915
|
}
|
|
2913
|
-
const ue = 96,
|
|
2914
|
-
function
|
|
2916
|
+
const ue = 96, xe = 56, nt = 72, Z = 120, ke = 100, gn = 3;
|
|
2917
|
+
function zn({
|
|
2915
2918
|
events: t,
|
|
2916
2919
|
date: n,
|
|
2917
2920
|
weekStartsOn: o = 1,
|
|
2918
2921
|
visibleHours: a = { startHour: 0, endHour: 24 },
|
|
2919
2922
|
workingHours: i,
|
|
2920
|
-
slotDuration:
|
|
2923
|
+
slotDuration: f = 30,
|
|
2921
2924
|
badgeVariant: s = "colored",
|
|
2922
|
-
onEventClick:
|
|
2923
|
-
onSlotSelect:
|
|
2925
|
+
onEventClick: x,
|
|
2926
|
+
onSlotSelect: N,
|
|
2924
2927
|
onDayClick: l,
|
|
2925
|
-
className:
|
|
2926
|
-
renderEvent:
|
|
2928
|
+
className: y,
|
|
2929
|
+
renderEvent: v,
|
|
2927
2930
|
renderPopover: m,
|
|
2928
2931
|
slots: g,
|
|
2929
2932
|
classNames: u
|
|
2930
2933
|
}) {
|
|
2931
|
-
const
|
|
2934
|
+
const b = 60 / f, w = 100 / b, L = F(() => {
|
|
2932
2935
|
const c = [];
|
|
2933
|
-
for (let
|
|
2934
|
-
c.push(
|
|
2936
|
+
for (let p = 0; p < b; p++)
|
|
2937
|
+
c.push(p * f);
|
|
2935
2938
|
return c;
|
|
2936
|
-
}, [
|
|
2939
|
+
}, [b, f]), T = F(
|
|
2937
2940
|
() => wt(n, o),
|
|
2938
2941
|
[n, o]
|
|
2939
2942
|
), A = F(
|
|
2940
2943
|
() => at(a),
|
|
2941
2944
|
[a]
|
|
2942
|
-
),
|
|
2945
|
+
), O = F(() => {
|
|
2943
2946
|
const c = /* @__PURE__ */ new Map();
|
|
2944
|
-
for (const
|
|
2945
|
-
const C =
|
|
2947
|
+
for (const p of T) {
|
|
2948
|
+
const C = p.toDateString(), H = He(t, p), { singleDay: z, multiDay: Y } = rt(H), j = ot(
|
|
2946
2949
|
z,
|
|
2947
|
-
|
|
2950
|
+
p,
|
|
2948
2951
|
a,
|
|
2949
2952
|
ue
|
|
2950
2953
|
), G = /* @__PURE__ */ new Map();
|
|
2951
2954
|
let U = 1;
|
|
2952
|
-
for (const K of
|
|
2955
|
+
for (const K of j)
|
|
2953
2956
|
if (G.set(K.event.id, K.position), K.position.width > 0) {
|
|
2954
2957
|
const ae = Math.round(100 / K.position.width);
|
|
2955
2958
|
U = Math.max(U, ae);
|
|
@@ -2962,34 +2965,34 @@ function Tn({
|
|
|
2962
2965
|
});
|
|
2963
2966
|
}
|
|
2964
2967
|
return c;
|
|
2965
|
-
}, [T, t, a]),
|
|
2968
|
+
}, [T, t, a]), B = F(() => {
|
|
2966
2969
|
const c = /* @__PURE__ */ new Map();
|
|
2967
|
-
for (const { multiDay:
|
|
2968
|
-
for (const C of
|
|
2970
|
+
for (const { multiDay: p } of O.values())
|
|
2971
|
+
for (const C of p)
|
|
2969
2972
|
c.set(C.id, C);
|
|
2970
2973
|
return Array.from(c.values());
|
|
2971
|
-
}, [
|
|
2974
|
+
}, [O]), E = /* @__PURE__ */ new Date(), M = T.findIndex((c) => ce(c)), I = F(() => {
|
|
2972
2975
|
if (M < 0) return -1;
|
|
2973
|
-
const c =
|
|
2976
|
+
const c = E.getHours() + E.getMinutes() / 60;
|
|
2974
2977
|
return c < a.startHour || c > a.endHour ? -1 : (c - a.startHour) * ue;
|
|
2975
|
-
}, [M, a,
|
|
2978
|
+
}, [M, a, E]), S = te(null);
|
|
2976
2979
|
Ie(() => {
|
|
2977
2980
|
const c = S.current;
|
|
2978
2981
|
if (!c) return;
|
|
2979
|
-
const
|
|
2982
|
+
const p = () => {
|
|
2980
2983
|
let C;
|
|
2981
2984
|
if (M !== -1) {
|
|
2982
2985
|
const z = (/* @__PURE__ */ new Date()).getHours();
|
|
2983
2986
|
C = Math.max(z - 1, a.startHour);
|
|
2984
2987
|
} else {
|
|
2985
2988
|
const Y = (/* @__PURE__ */ new Date()).getDay();
|
|
2986
|
-
let
|
|
2987
|
-
if (!
|
|
2989
|
+
let j = i?.[Y];
|
|
2990
|
+
if (!j?.enabled || j.from === 0) {
|
|
2988
2991
|
const G = i?.[1];
|
|
2989
|
-
G?.enabled && (
|
|
2992
|
+
G?.enabled && (j = G);
|
|
2990
2993
|
}
|
|
2991
|
-
|
|
2992
|
-
|
|
2994
|
+
j?.enabled && j.from > 0 ? C = Math.max(
|
|
2995
|
+
j.from - 1,
|
|
2993
2996
|
a.startHour
|
|
2994
2997
|
) : C = Math.max(7, a.startHour);
|
|
2995
2998
|
}
|
|
@@ -3000,47 +3003,47 @@ function Tn({
|
|
|
3000
3003
|
});
|
|
3001
3004
|
};
|
|
3002
3005
|
requestAnimationFrame(() => {
|
|
3003
|
-
requestAnimationFrame(
|
|
3006
|
+
requestAnimationFrame(p);
|
|
3004
3007
|
});
|
|
3005
3008
|
}, [n, i, a, M]);
|
|
3006
|
-
const $ =
|
|
3009
|
+
const $ = Oe(), q = W(
|
|
3007
3010
|
(c) => {
|
|
3008
3011
|
$?.startSelection(c);
|
|
3009
3012
|
},
|
|
3010
3013
|
[$]
|
|
3011
|
-
),
|
|
3014
|
+
), D = W(
|
|
3012
3015
|
(c) => {
|
|
3013
3016
|
$?.updateSelection(c);
|
|
3014
3017
|
},
|
|
3015
3018
|
[$]
|
|
3016
|
-
),
|
|
3019
|
+
), h = W(() => {
|
|
3017
3020
|
$?.endSelection();
|
|
3018
|
-
}, [$]),
|
|
3021
|
+
}, [$]), _ = W(
|
|
3019
3022
|
(c) => {
|
|
3020
|
-
|
|
3023
|
+
x?.(c);
|
|
3021
3024
|
},
|
|
3022
|
-
[
|
|
3023
|
-
), R =
|
|
3025
|
+
[x]
|
|
3026
|
+
), R = xe + 7 * Z, P = F(() => {
|
|
3024
3027
|
const c = [];
|
|
3025
|
-
for (const
|
|
3026
|
-
const C =
|
|
3027
|
-
z >
|
|
3028
|
-
Math.max(Z, z *
|
|
3028
|
+
for (const p of T) {
|
|
3029
|
+
const C = p.toDateString(), z = O.get(C)?.maxOverlapping ?? 1;
|
|
3030
|
+
z > gn ? c.push(
|
|
3031
|
+
Math.max(Z, z * ke)
|
|
3029
3032
|
) : c.push(Z);
|
|
3030
3033
|
}
|
|
3031
3034
|
return c;
|
|
3032
|
-
}, [T,
|
|
3033
|
-
return /* @__PURE__ */ r("div", { className: d("ic-week-view flex flex-col h-full",
|
|
3034
|
-
|
|
3035
|
-
|
|
3035
|
+
}, [T, O]), k = xe + P.reduce((c, p) => c + p, 0);
|
|
3036
|
+
return /* @__PURE__ */ r("div", { className: d("ic-week-view flex flex-col h-full", y), children: [
|
|
3037
|
+
B.length > 0 && /* @__PURE__ */ e(
|
|
3038
|
+
fn,
|
|
3036
3039
|
{
|
|
3037
|
-
events:
|
|
3040
|
+
events: B,
|
|
3038
3041
|
weekDays: T,
|
|
3039
|
-
hourColumnWidth:
|
|
3042
|
+
hourColumnWidth: xe,
|
|
3040
3043
|
minDayColumnWidth: Z,
|
|
3041
3044
|
dayColumnWidths: P,
|
|
3042
|
-
onEventClick:
|
|
3043
|
-
disablePopover: !!
|
|
3045
|
+
onEventClick: _,
|
|
3046
|
+
disablePopover: !!x && !m,
|
|
3044
3047
|
renderPopover: m,
|
|
3045
3048
|
...u?.multiDayBanner && {
|
|
3046
3049
|
className: u.multiDayBanner
|
|
@@ -3055,24 +3058,24 @@ function Tn({
|
|
|
3055
3058
|
"ic-week-scroll-container flex-1",
|
|
3056
3059
|
u?.scrollContainer
|
|
3057
3060
|
),
|
|
3058
|
-
children: /* @__PURE__ */ r("div", { style: { minWidth: Math.max(R,
|
|
3061
|
+
children: /* @__PURE__ */ r("div", { style: { minWidth: Math.max(R, k) }, children: [
|
|
3059
3062
|
/* @__PURE__ */ e("div", { className: "ic-week-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */ r("div", { className: "flex", children: [
|
|
3060
3063
|
/* @__PURE__ */ e(
|
|
3061
3064
|
"div",
|
|
3062
3065
|
{
|
|
3063
3066
|
className: "flex-shrink-0 flex items-end justify-center pb-2 text-[10px] text-muted-foreground/70",
|
|
3064
|
-
style: { width:
|
|
3067
|
+
style: { width: xe, height: nt },
|
|
3065
3068
|
children: /* @__PURE__ */ r("span", { className: "hidden sm:inline", children: [
|
|
3066
3069
|
"GMT",
|
|
3067
3070
|
(() => {
|
|
3068
|
-
const c = (/* @__PURE__ */ new Date()).getTimezoneOffset(),
|
|
3069
|
-
return
|
|
3071
|
+
const c = (/* @__PURE__ */ new Date()).getTimezoneOffset(), p = Math.abs(Math.floor(c / 60)), C = c <= 0 ? "+" : "-";
|
|
3072
|
+
return p > 0 ? `${C}${String(p).padStart(2, "0")}` : "";
|
|
3070
3073
|
})()
|
|
3071
3074
|
] })
|
|
3072
3075
|
}
|
|
3073
3076
|
),
|
|
3074
|
-
T.map((c,
|
|
3075
|
-
const C = ce(c), H = P[
|
|
3077
|
+
T.map((c, p) => {
|
|
3078
|
+
const C = ce(c), H = P[p] ?? Z, z = H > Z;
|
|
3076
3079
|
return /* @__PURE__ */ r(
|
|
3077
3080
|
"div",
|
|
3078
3081
|
{
|
|
@@ -3123,13 +3126,13 @@ function Tn({
|
|
|
3123
3126
|
"ic-hour-column sticky left-0 z-10 bg-zinc-50 border-r",
|
|
3124
3127
|
u?.timeGutter
|
|
3125
3128
|
),
|
|
3126
|
-
style: { width:
|
|
3127
|
-
children: A.map((c,
|
|
3129
|
+
style: { width: xe },
|
|
3130
|
+
children: A.map((c, p) => /* @__PURE__ */ e(
|
|
3128
3131
|
"div",
|
|
3129
3132
|
{
|
|
3130
3133
|
className: "relative",
|
|
3131
3134
|
style: { height: ue },
|
|
3132
|
-
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children:
|
|
3135
|
+
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children: p !== 0 && /* @__PURE__ */ e(
|
|
3133
3136
|
"span",
|
|
3134
3137
|
{
|
|
3135
3138
|
className: d(
|
|
@@ -3144,8 +3147,8 @@ function Tn({
|
|
|
3144
3147
|
))
|
|
3145
3148
|
}
|
|
3146
3149
|
),
|
|
3147
|
-
/* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children: T.map((c,
|
|
3148
|
-
const C = c.toDateString(), H =
|
|
3150
|
+
/* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children: T.map((c, p) => {
|
|
3151
|
+
const C = c.toDateString(), H = O.get(C), z = P[p] ?? Z, Y = z > Z;
|
|
3149
3152
|
return /* @__PURE__ */ r(
|
|
3150
3153
|
"div",
|
|
3151
3154
|
{
|
|
@@ -3154,10 +3157,10 @@ function Tn({
|
|
|
3154
3157
|
minWidth: Y ? z : Z
|
|
3155
3158
|
},
|
|
3156
3159
|
children: [
|
|
3157
|
-
A.map((
|
|
3160
|
+
A.map((j, G) => {
|
|
3158
3161
|
const K = !it(
|
|
3159
3162
|
c,
|
|
3160
|
-
|
|
3163
|
+
j,
|
|
3161
3164
|
i
|
|
3162
3165
|
);
|
|
3163
3166
|
return /* @__PURE__ */ r(
|
|
@@ -3173,7 +3176,7 @@ function Tn({
|
|
|
3173
3176
|
style: { height: ue },
|
|
3174
3177
|
children: [
|
|
3175
3178
|
G !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
|
|
3176
|
-
|
|
3179
|
+
L.slice(1).map((ae) => /* @__PURE__ */ e(
|
|
3177
3180
|
"div",
|
|
3178
3181
|
{
|
|
3179
3182
|
className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
|
|
@@ -3181,10 +3184,10 @@ function Tn({
|
|
|
3181
3184
|
},
|
|
3182
3185
|
ae
|
|
3183
3186
|
)),
|
|
3184
|
-
|
|
3187
|
+
L.map((ae, ht) => {
|
|
3185
3188
|
const Ve = {
|
|
3186
3189
|
date: c,
|
|
3187
|
-
hour:
|
|
3190
|
+
hour: j,
|
|
3188
3191
|
minute: ae
|
|
3189
3192
|
};
|
|
3190
3193
|
return /* @__PURE__ */ e(
|
|
@@ -3192,31 +3195,31 @@ function Tn({
|
|
|
3192
3195
|
{
|
|
3193
3196
|
slot: Ve,
|
|
3194
3197
|
onSelectionStart: q,
|
|
3195
|
-
onSelectionMove:
|
|
3196
|
-
onSelectionEnd:
|
|
3198
|
+
onSelectionMove: D,
|
|
3199
|
+
onSelectionEnd: h,
|
|
3197
3200
|
isSelected: $?.isSlotSelected(Ve) ?? !1,
|
|
3198
3201
|
isSelecting: $?.isSelecting ?? !1,
|
|
3199
3202
|
disabled: K,
|
|
3200
3203
|
className: "absolute inset-x-0",
|
|
3201
3204
|
style: {
|
|
3202
|
-
top: `${ht *
|
|
3203
|
-
height: `${
|
|
3205
|
+
top: `${ht * w}%`,
|
|
3206
|
+
height: `${w}%`
|
|
3204
3207
|
},
|
|
3205
|
-
ariaLabel: `Add event on ${c.toLocaleDateString()} at ${Ce(
|
|
3208
|
+
ariaLabel: `Add event on ${c.toLocaleDateString()} at ${Ce(j)}:${String(ae).padStart(2, "0")}`
|
|
3206
3209
|
},
|
|
3207
3210
|
ae
|
|
3208
3211
|
);
|
|
3209
3212
|
})
|
|
3210
3213
|
]
|
|
3211
3214
|
},
|
|
3212
|
-
|
|
3215
|
+
j
|
|
3213
3216
|
);
|
|
3214
3217
|
}),
|
|
3215
|
-
H?.singleDay.map((
|
|
3216
|
-
const G = H.positions.get(
|
|
3218
|
+
H?.singleDay.map((j) => {
|
|
3219
|
+
const G = H.positions.get(j.id);
|
|
3217
3220
|
if (!G) return null;
|
|
3218
|
-
const U = `calc(${G.width}% - 2px)`, K = `max(${
|
|
3219
|
-
return
|
|
3221
|
+
const U = `calc(${G.width}% - 2px)`, K = `max(${ke}px, ${U})`;
|
|
3222
|
+
return v ? /* @__PURE__ */ e(
|
|
3220
3223
|
"div",
|
|
3221
3224
|
{
|
|
3222
3225
|
className: "absolute pointer-events-auto p-0.5",
|
|
@@ -3224,35 +3227,35 @@ function Tn({
|
|
|
3224
3227
|
top: `${G.top}px`,
|
|
3225
3228
|
left: `${G.left}%`,
|
|
3226
3229
|
width: K,
|
|
3227
|
-
minWidth: `${
|
|
3230
|
+
minWidth: `${ke}px`
|
|
3228
3231
|
},
|
|
3229
|
-
children:
|
|
3232
|
+
children: v({ event: j, position: G })
|
|
3230
3233
|
},
|
|
3231
|
-
|
|
3234
|
+
j.id
|
|
3232
3235
|
) : /* @__PURE__ */ e(
|
|
3233
3236
|
lt,
|
|
3234
3237
|
{
|
|
3235
|
-
event:
|
|
3238
|
+
event: j,
|
|
3236
3239
|
position: {
|
|
3237
3240
|
top: G.top,
|
|
3238
3241
|
left: G.left,
|
|
3239
3242
|
width: G.width,
|
|
3240
|
-
minWidth:
|
|
3243
|
+
minWidth: ke
|
|
3241
3244
|
},
|
|
3242
3245
|
hourHeight: ue,
|
|
3243
3246
|
badgeVariant: s,
|
|
3244
|
-
onClick:
|
|
3245
|
-
disablePopover: !!
|
|
3247
|
+
onClick: x,
|
|
3248
|
+
disablePopover: !!x && !m,
|
|
3246
3249
|
renderPopover: m,
|
|
3247
3250
|
className: d(
|
|
3248
3251
|
"pointer-events-auto",
|
|
3249
3252
|
u?.eventCard
|
|
3250
3253
|
)
|
|
3251
3254
|
},
|
|
3252
|
-
|
|
3255
|
+
j.id
|
|
3253
3256
|
);
|
|
3254
3257
|
}),
|
|
3255
|
-
|
|
3258
|
+
p === M && I >= 0 && /* @__PURE__ */ r(
|
|
3256
3259
|
"div",
|
|
3257
3260
|
{
|
|
3258
3261
|
className: d(
|
|
@@ -3278,35 +3281,35 @@ function Tn({
|
|
|
3278
3281
|
] });
|
|
3279
3282
|
}
|
|
3280
3283
|
export {
|
|
3281
|
-
|
|
3284
|
+
Sn as A,
|
|
3282
3285
|
me as B,
|
|
3283
|
-
|
|
3286
|
+
Cn as C,
|
|
3284
3287
|
Ut as D,
|
|
3285
3288
|
lt as E,
|
|
3286
|
-
|
|
3289
|
+
Tn as M,
|
|
3287
3290
|
re as P,
|
|
3288
3291
|
mt as T,
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3292
|
+
zn as W,
|
|
3293
|
+
rn as a,
|
|
3294
|
+
dn as b,
|
|
3295
|
+
Mn as c,
|
|
3293
3296
|
Se as d,
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
+
sn as e,
|
|
3298
|
+
Dn as f,
|
|
3299
|
+
Nn as g,
|
|
3297
3300
|
Q as h,
|
|
3298
3301
|
oe as i,
|
|
3299
3302
|
Kt as j,
|
|
3300
3303
|
ie as k,
|
|
3301
3304
|
ne as l,
|
|
3302
|
-
|
|
3305
|
+
kn as m,
|
|
3303
3306
|
se as n,
|
|
3304
3307
|
kt as o,
|
|
3305
3308
|
de as p,
|
|
3306
3309
|
Xe as q,
|
|
3307
3310
|
Ye as r,
|
|
3308
|
-
|
|
3311
|
+
_e as s,
|
|
3309
3312
|
Be as t,
|
|
3310
3313
|
Pt as u
|
|
3311
3314
|
};
|
|
3312
|
-
//# sourceMappingURL=week-view-
|
|
3315
|
+
//# sourceMappingURL=week-view-DbktCaJh.js.map
|