@innosolutions/inno-calendar 1.0.41 → 1.0.43
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-B5Sgvvry.cjs → agenda-widget-6s0aP1-t.cjs} +2 -2
- package/dist/{agenda-widget-B5Sgvvry.cjs.map → agenda-widget-6s0aP1-t.cjs.map} +1 -1
- package/dist/{agenda-widget-C5uR9Raa.js → agenda-widget-berMFJOV.js} +2 -2
- package/dist/{agenda-widget-C5uR9Raa.js.map → agenda-widget-berMFJOV.js.map} +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/views/day-view.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-B2vvMCsL.cjs → tailwind-calendar-BvRVRpnC.cjs} +2 -2
- package/dist/{tailwind-calendar-B2vvMCsL.cjs.map → tailwind-calendar-BvRVRpnC.cjs.map} +1 -1
- package/dist/{tailwind-calendar-C1_6GoL0.js → tailwind-calendar-ayfrJLXl.js} +2 -2
- package/dist/{tailwind-calendar-C1_6GoL0.js.map → tailwind-calendar-ayfrJLXl.js.map} +1 -1
- package/dist/{week-view-Dh-gHd0m.js → week-view-BvwBOdd6.js} +399 -390
- package/dist/week-view-BvwBOdd6.js.map +1 -0
- package/dist/{week-view-DBsCYSce.cjs → week-view-COv7gU-n.cjs} +3 -3
- package/dist/week-view-COv7gU-n.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/week-view-DBsCYSce.cjs.map +0 -1
- package/dist/week-view-Dh-gHd0m.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
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 L, useRef as te, forwardRef as $e, createElement as
|
|
3
|
+
import { useState as J, useCallback as L, useRef as te, forwardRef as $e, createElement as Le, useMemo as F, useLayoutEffect as Ie, useEffect as We } 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
|
|
7
|
+
import { a as Re, b as Oe } from "./slot-selection-context-D2eu2o-7.js";
|
|
8
8
|
import * as he from "@radix-ui/react-popover";
|
|
9
9
|
import * as ye from "@radix-ui/react-tooltip";
|
|
10
10
|
const re = he.Root, oe = he.Trigger, vn = he.Anchor, Q = ee.forwardRef(({ className: t, align: n = "center", sideOffset: o = 4, ...a }, i) => /* @__PURE__ */ e(he.Portal, { children: /* @__PURE__ */ e(
|
|
@@ -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
|
}
|
|
@@ -131,37 +131,37 @@ function Se({
|
|
|
131
131
|
showTime: p = !0,
|
|
132
132
|
showDescription: s = !1,
|
|
133
133
|
showParticipants: y = !1,
|
|
134
|
-
style:
|
|
134
|
+
style: D,
|
|
135
135
|
disablePopover: l = !1,
|
|
136
136
|
renderPopover: b,
|
|
137
|
-
enableDrag:
|
|
137
|
+
enableDrag: k = !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), [N, v] = J(!1), [z, M] = J(!1), [W, O] = J(!1), [_, E] = J(null), T = te(null), I = Re(), S = t.endDate < je(/* @__PURE__ */ new Date()), $ = t.isCanceled ?? !1, q = k && I && !$ && !S, f = t.data, x = f?.meetingTookPlace ?? t.meetingTookPlace ?? !1, B = $ ? /* @__PURE__ */ e(Nt, { className: "h-3 w-3 text-zinc-800 dark:text-zinc-200" }) : x ? /* @__PURE__ */ e(vt, { className: d("h-3 w-3", u.text) }) : null, R = t.scheduleTypeName || f?.scheduleTypeName || f?.typeName, P = f?.productName, w = f?.nrParticipant, c = f?.siteName, h = f?.siteCity, C = [c, h].filter(Boolean).join(", "), H = L(() => {
|
|
142
|
+
if (!z) {
|
|
143
143
|
if (l && a) {
|
|
144
144
|
a(t);
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
if (m &&
|
|
148
|
-
const U =
|
|
149
|
-
|
|
147
|
+
if (m && T.current) {
|
|
148
|
+
const U = T.current.getBoundingClientRect();
|
|
149
|
+
E(U), O(!0);
|
|
150
150
|
} else l || v(!0);
|
|
151
151
|
}
|
|
152
|
-
}, [
|
|
152
|
+
}, [z, l, a, t, m]);
|
|
153
153
|
L(() => {
|
|
154
|
-
|
|
154
|
+
O(!1), E(null), l || v(!0);
|
|
155
155
|
}, [l]);
|
|
156
|
-
const
|
|
156
|
+
const A = L(() => {
|
|
157
157
|
v(!1);
|
|
158
158
|
}, []), Y = L(
|
|
159
159
|
(U) => {
|
|
160
|
-
q && (U.dataTransfer.effectAllowed = "move", U.dataTransfer.setData("text/plain", t.id),
|
|
160
|
+
q && (U.dataTransfer.effectAllowed = "move", U.dataTransfer.setData("text/plain", t.id), M(!0), I?.startDrag?.(t));
|
|
161
161
|
},
|
|
162
162
|
[q, t, I]
|
|
163
|
-
),
|
|
164
|
-
|
|
163
|
+
), j = L(() => {
|
|
164
|
+
M(!1), I?.isDragging && I.endDrag?.();
|
|
165
165
|
}, [I]);
|
|
166
166
|
if (n === "dot") {
|
|
167
167
|
const U = /* @__PURE__ */ e(
|
|
@@ -175,7 +175,7 @@ function Se({
|
|
|
175
175
|
t.isCanceled && "opacity-50",
|
|
176
176
|
i
|
|
177
177
|
),
|
|
178
|
-
style:
|
|
178
|
+
style: D,
|
|
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: N, onOpenChange: v, 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: b ? b({ event: t, onClose:
|
|
193
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose: A }) : /* @__PURE__ */ e(xe, { event: t, onClose: A }) })
|
|
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
|
+
z && "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: D,
|
|
223
223
|
children: [
|
|
224
224
|
["dot", "mixed"].includes(o) && !S && /* @__PURE__ */ e(
|
|
225
225
|
"svg",
|
|
@@ -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: N, onOpenChange: v, children: [
|
|
275
275
|
/* @__PURE__ */ e(oe, { asChild: !0, children: U }),
|
|
276
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose:
|
|
276
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose: A }) : /* @__PURE__ */ e(xe, { event: t, onClose: A }) })
|
|
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: D,
|
|
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: [
|
|
@@ -340,12 +340,12 @@ function Se({
|
|
|
340
340
|
B
|
|
341
341
|
] }),
|
|
342
342
|
P && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: P }),
|
|
343
|
-
|
|
344
|
-
/* @__PURE__ */ e(
|
|
343
|
+
w != 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
|
+
w,
|
|
347
347
|
" participant",
|
|
348
|
-
|
|
348
|
+
w !== 1 ? "s" : ""
|
|
349
349
|
] })
|
|
350
350
|
] }),
|
|
351
351
|
p && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
@@ -358,7 +358,7 @@ function Se({
|
|
|
358
358
|
] }),
|
|
359
359
|
s && t.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: t.description }),
|
|
360
360
|
y && t.participants && t.participants.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
361
|
-
/* @__PURE__ */ e(
|
|
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: N, onOpenChange: v, children: [
|
|
374
374
|
/* @__PURE__ */ e(oe, { asChild: !0, children: G }),
|
|
375
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose:
|
|
375
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose: A }) : /* @__PURE__ */ e(xe, { event: t, onClose: A }) })
|
|
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
|
{
|
|
@@ -520,29 +520,29 @@ function lt({
|
|
|
520
520
|
className: p,
|
|
521
521
|
disablePopover: s = !1,
|
|
522
522
|
renderPopover: y,
|
|
523
|
-
enableDrag:
|
|
523
|
+
enableDrag: D = !0
|
|
524
524
|
}) {
|
|
525
|
-
const l = de(t.color), [b,
|
|
526
|
-
m || (s && i ? i(t) : s ||
|
|
525
|
+
const l = de(t.color), [b, k] = J(!1), [m, g] = J(!1), u = Re(), N = (t.endDate.getTime() - t.startDate.getTime()) / (1e3 * 60), v = N / 60 * o - 8, z = t.endDate < je(/* @__PURE__ */ new Date()), M = t.isCanceled ?? !1, W = D && u && !M && !z, O = N < 35, _ = N > 25, E = N >= 45, T = t.data, I = t.scheduleTypeName || T?.scheduleTypeName || T?.typeName, S = T?.productName, $ = T?.nrParticipant, q = T?.siteName, f = T?.siteCity, x = [q, f].filter(Boolean).join(", "), B = a === "dot", R = L(() => {
|
|
526
|
+
m || (s && i ? i(t) : s || k(!0));
|
|
527
527
|
}, [m, s, i, t]), P = L(() => {
|
|
528
|
-
|
|
529
|
-
}, []),
|
|
530
|
-
(
|
|
531
|
-
if (!
|
|
532
|
-
|
|
533
|
-
const Y =
|
|
534
|
-
|
|
528
|
+
k(!1);
|
|
529
|
+
}, []), w = L(
|
|
530
|
+
(A) => {
|
|
531
|
+
if (!W) return;
|
|
532
|
+
A.dataTransfer.effectAllowed = "move", A.dataTransfer.setData("text/plain", t.id);
|
|
533
|
+
const Y = A.currentTarget, j = Y.getBoundingClientRect();
|
|
534
|
+
A.dataTransfer.setDragImage(
|
|
535
535
|
Y,
|
|
536
|
-
|
|
537
|
-
|
|
536
|
+
A.clientX - j.left,
|
|
537
|
+
A.clientY - j.top
|
|
538
538
|
), g(!0), u?.startDrag?.(t);
|
|
539
539
|
},
|
|
540
|
-
[
|
|
540
|
+
[W, t, u]
|
|
541
541
|
), c = L(() => {
|
|
542
542
|
g(!1), u?.isDragging && u.endDrag?.();
|
|
543
543
|
}, [u]), h = L(
|
|
544
|
-
(
|
|
545
|
-
(
|
|
544
|
+
(A) => {
|
|
545
|
+
(A.key === "Enter" || A.key === " ") && (A.preventDefault(), R());
|
|
546
546
|
},
|
|
547
547
|
[R]
|
|
548
548
|
), C = /* @__PURE__ */ r(
|
|
@@ -550,8 +550,8 @@ function lt({
|
|
|
550
550
|
{
|
|
551
551
|
role: "button",
|
|
552
552
|
tabIndex: 0,
|
|
553
|
-
draggable: !!
|
|
554
|
-
onDragStart:
|
|
553
|
+
draggable: !!W,
|
|
554
|
+
onDragStart: w,
|
|
555
555
|
onDragEnd: c,
|
|
556
556
|
onKeyDown: h,
|
|
557
557
|
onClick: m ? void 0 : R,
|
|
@@ -560,11 +560,11 @@ function lt({
|
|
|
560
560
|
"shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]",
|
|
561
561
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
562
562
|
"transition-all",
|
|
563
|
-
|
|
563
|
+
W ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
|
|
564
564
|
m && "opacity-50",
|
|
565
565
|
// Cancelled events get gray background with strikethrough
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
M || // Past events get neutral zinc styling with strikethrough
|
|
567
|
+
z ? "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
|
!B && [
|
|
570
570
|
l.bg,
|
|
@@ -575,13 +575,13 @@ function lt({
|
|
|
575
575
|
B && "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
|
-
|
|
578
|
+
O && "py-0 justify-center",
|
|
579
579
|
p
|
|
580
580
|
),
|
|
581
581
|
style: { height: `${Math.max(v, 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) && !z && !M && /* @__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
|
+
!z && !M && B && "text-foreground"
|
|
602
602
|
),
|
|
603
603
|
children: [
|
|
604
604
|
t.title,
|
|
@@ -611,7 +611,7 @@ function lt({
|
|
|
611
611
|
}
|
|
612
612
|
) })
|
|
613
613
|
] }),
|
|
614
|
-
|
|
614
|
+
E && S && /* @__PURE__ */ e(
|
|
615
615
|
"p",
|
|
616
616
|
{
|
|
617
617
|
className: d(
|
|
@@ -621,7 +621,7 @@ function lt({
|
|
|
621
621
|
children: S
|
|
622
622
|
}
|
|
623
623
|
),
|
|
624
|
-
|
|
624
|
+
E && $ != null && /* @__PURE__ */ r(
|
|
625
625
|
"div",
|
|
626
626
|
{
|
|
627
627
|
className: d(
|
|
@@ -629,7 +629,7 @@ function lt({
|
|
|
629
629
|
B ? "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,7 +638,7 @@ function lt({
|
|
|
638
638
|
]
|
|
639
639
|
}
|
|
640
640
|
),
|
|
641
|
-
|
|
641
|
+
_ && /* @__PURE__ */ r(
|
|
642
642
|
"div",
|
|
643
643
|
{
|
|
644
644
|
className: d(
|
|
@@ -651,7 +651,7 @@ function lt({
|
|
|
651
651
|
]
|
|
652
652
|
}
|
|
653
653
|
),
|
|
654
|
-
|
|
654
|
+
E && x && /* @__PURE__ */ r(
|
|
655
655
|
"div",
|
|
656
656
|
{
|
|
657
657
|
className: d(
|
|
@@ -709,7 +709,7 @@ 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: b, onOpenChange:
|
|
712
|
+
children: /* @__PURE__ */ r(re, { open: b, onOpenChange: k, children: [
|
|
713
713
|
/* @__PURE__ */ e(oe, { asChild: !0, children: C }),
|
|
714
714
|
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: P }) : /* @__PURE__ */ e(xe, { event: t, onClose: P }) })
|
|
715
715
|
] })
|
|
@@ -726,11 +726,11 @@ function kn({
|
|
|
726
726
|
disablePopover: s = !1,
|
|
727
727
|
renderPopover: y
|
|
728
728
|
}) {
|
|
729
|
-
const
|
|
729
|
+
const D = de(t.color), [l, b] = J(!1), k = t.endDate < je(/* @__PURE__ */ new Date()), m = t.isCanceled ?? !1, g = L(() => {
|
|
730
730
|
s && i ? i(t) : s || b(!0);
|
|
731
731
|
}, [s, i, t]), u = L(() => {
|
|
732
732
|
b(!1);
|
|
733
|
-
}, []),
|
|
733
|
+
}, []), N = /* @__PURE__ */ e(
|
|
734
734
|
"button",
|
|
735
735
|
{
|
|
736
736
|
type: "button",
|
|
@@ -739,7 +739,7 @@ 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
|
+
k ? "bg-zinc-200 dark:bg-zinc-700 text-zinc-500 dark:text-zinc-400 line-through" : [D.dot, "text-white"],
|
|
743
743
|
o && "rounded-l",
|
|
744
744
|
a && "rounded-r",
|
|
745
745
|
!o && "border-l-0",
|
|
@@ -754,10 +754,10 @@ function kn({
|
|
|
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:
|
|
757
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: N }),
|
|
758
758
|
v
|
|
759
759
|
] }) : /* @__PURE__ */ r(re, { open: l, onOpenChange: b, children: [
|
|
760
|
-
/* @__PURE__ */ e(oe, { asChild: !0, children:
|
|
760
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: N }),
|
|
761
761
|
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: u }) : /* @__PURE__ */ e(xe, { event: t, onClose: u }) })
|
|
762
762
|
] });
|
|
763
763
|
}
|
|
@@ -778,31 +778,31 @@ const Ue = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, qe = ft, d
|
|
|
778
778
|
var a;
|
|
779
779
|
if (n?.variants == null) return qe(t, o?.class, o?.className);
|
|
780
780
|
const { variants: i, defaultVariants: p } = n, s = Object.keys(i).map((l) => {
|
|
781
|
-
const b = o?.[l],
|
|
781
|
+
const b = o?.[l], k = p?.[l];
|
|
782
782
|
if (b === null) return null;
|
|
783
|
-
const m = Ue(b) || Ue(
|
|
783
|
+
const m = Ue(b) || Ue(k);
|
|
784
784
|
return i[l][m];
|
|
785
785
|
}), y = o && Object.entries(o).reduce((l, b) => {
|
|
786
|
-
let [
|
|
787
|
-
return m === void 0 || (l[
|
|
788
|
-
}, {}),
|
|
789
|
-
let { class:
|
|
786
|
+
let [k, m] = b;
|
|
787
|
+
return m === void 0 || (l[k] = m), l;
|
|
788
|
+
}, {}), D = n == null || (a = n.compoundVariants) === null || a === void 0 ? void 0 : a.reduce((l, b) => {
|
|
789
|
+
let { class: k, className: m, ...g } = b;
|
|
790
790
|
return Object.entries(g).every((u) => {
|
|
791
|
-
let [
|
|
791
|
+
let [N, v] = u;
|
|
792
792
|
return Array.isArray(v) ? v.includes({
|
|
793
793
|
...p,
|
|
794
794
|
...y
|
|
795
|
-
}[
|
|
795
|
+
}[N]) : {
|
|
796
796
|
...p,
|
|
797
797
|
...y
|
|
798
|
-
}[
|
|
798
|
+
}[N] === v;
|
|
799
799
|
}) ? [
|
|
800
800
|
...l,
|
|
801
|
-
|
|
801
|
+
k,
|
|
802
802
|
m
|
|
803
803
|
] : l;
|
|
804
804
|
}, []);
|
|
805
|
-
return qe(t, s,
|
|
805
|
+
return qe(t, s, D, 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
|
{
|
|
@@ -909,10 +909,10 @@ const Tt = $e(
|
|
|
909
909
|
children: p,
|
|
910
910
|
iconNode: s,
|
|
911
911
|
...y
|
|
912
|
-
},
|
|
912
|
+
}, D) => Le(
|
|
913
913
|
"svg",
|
|
914
914
|
{
|
|
915
|
-
ref:
|
|
915
|
+
ref: D,
|
|
916
916
|
...St,
|
|
917
917
|
width: n,
|
|
918
918
|
height: n,
|
|
@@ -923,14 +923,14 @@ const Tt = $e(
|
|
|
923
923
|
...y
|
|
924
924
|
},
|
|
925
925
|
[
|
|
926
|
-
...s.map(([l, b]) =>
|
|
926
|
+
...s.map(([l, b]) => Le(l, b)),
|
|
927
927
|
...Array.isArray(p) ? p : [p]
|
|
928
928
|
]
|
|
929
929
|
)
|
|
930
930
|
);
|
|
931
931
|
const Fe = (t, n) => {
|
|
932
932
|
const o = $e(
|
|
933
|
-
({ className: a, ...i }, p) =>
|
|
933
|
+
({ className: a, ...i }, p) => Le(Tt, {
|
|
934
934
|
ref: p,
|
|
935
935
|
iconNode: n,
|
|
936
936
|
className: ct(
|
|
@@ -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" }]], At = Fe("check", zt);
|
|
947
|
+
const Lt = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Wt = 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,
|
|
@@ -957,7 +957,7 @@ const _t = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Et = Fe
|
|
|
957
957
|
...a,
|
|
958
958
|
children: [
|
|
959
959
|
o,
|
|
960
|
-
/* @__PURE__ */ e(
|
|
960
|
+
/* @__PURE__ */ e(Wt, { className: "ml-auto h-4 w-4" })
|
|
961
961
|
]
|
|
962
962
|
}
|
|
963
963
|
));
|
|
@@ -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(At, { 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(
|
|
@@ -1128,11 +1128,11 @@ function Ut({
|
|
|
1128
1128
|
showEventCount: s = !0,
|
|
1129
1129
|
className: y
|
|
1130
1130
|
}) {
|
|
1131
|
-
const
|
|
1131
|
+
const D = Gt[t.getMonth()], l = t.getFullYear(), b = s ? gt(o, t, n, p) : 0, k = xt(t, n);
|
|
1132
1132
|
return /* @__PURE__ */ r("div", { className: d("min-w-0 flex-1", y), 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
|
+
D,
|
|
1136
1136
|
" ",
|
|
1137
1137
|
l
|
|
1138
1138
|
] }),
|
|
@@ -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: k }),
|
|
1153
1153
|
/* @__PURE__ */ e(
|
|
1154
1154
|
me,
|
|
1155
1155
|
{
|
|
@@ -1421,61 +1421,61 @@ function Dn({
|
|
|
1421
1421
|
onNavigateNext: p,
|
|
1422
1422
|
onNavigate: s,
|
|
1423
1423
|
onViewChange: y,
|
|
1424
|
-
onAddEvent:
|
|
1424
|
+
onAddEvent: D,
|
|
1425
1425
|
availableViews: l = ["day", "week", "month", "agenda"],
|
|
1426
1426
|
showTimelineViews: b = !1,
|
|
1427
|
-
timelineViews:
|
|
1427
|
+
timelineViews: k,
|
|
1428
1428
|
settingsContent: m,
|
|
1429
1429
|
showSettings: g = !1,
|
|
1430
1430
|
filterContent: u,
|
|
1431
|
-
actions:
|
|
1431
|
+
actions: N,
|
|
1432
1432
|
className: v,
|
|
1433
|
-
weekStartsOn:
|
|
1434
|
-
labels:
|
|
1433
|
+
weekStartsOn: z = 1,
|
|
1434
|
+
labels: M = {}
|
|
1435
1435
|
}) {
|
|
1436
|
-
const
|
|
1436
|
+
const W = F(
|
|
1437
1437
|
() => ({
|
|
1438
1438
|
today: "Today",
|
|
1439
1439
|
addEvent: "Add Event",
|
|
1440
1440
|
calendarView: "Calendar View",
|
|
1441
1441
|
resourceView: "Resource View",
|
|
1442
|
-
...
|
|
1442
|
+
...M
|
|
1443
1443
|
}),
|
|
1444
|
-
[
|
|
1445
|
-
),
|
|
1444
|
+
[M]
|
|
1445
|
+
), O = () => {
|
|
1446
1446
|
a?.(), s?.("today");
|
|
1447
|
-
}, E = () => {
|
|
1448
|
-
i?.(), s?.("prev");
|
|
1449
1447
|
}, _ = () => {
|
|
1448
|
+
i?.(), s?.("prev");
|
|
1449
|
+
}, E = () => {
|
|
1450
1450
|
p?.(), s?.("next");
|
|
1451
|
-
},
|
|
1451
|
+
}, T = ["day", "week", "month", "year", "agenda"].includes(
|
|
1452
1452
|
n
|
|
1453
1453
|
), I = n.startsWith("timeline-") || n.startsWith("resource-"), S = tn.filter(
|
|
1454
1454
|
(f) => l.includes(f.value)
|
|
1455
|
-
), $ =
|
|
1455
|
+
), $ = T ? S.find((f) => f.value === n) : null, q = I ? Qe.find((f) => f.value === n) : null;
|
|
1456
1456
|
return /* @__PURE__ */ r("div", { className: d("flex flex-col w-full gap-3 mb-2", v), children: [
|
|
1457
1457
|
/* @__PURE__ */ r("div", { className: "flex lg:flex-row flex-col w-full justify-between gap-3", children: [
|
|
1458
1458
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1459
1459
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [
|
|
1460
|
-
/* @__PURE__ */ e(Kt, { onClick:
|
|
1460
|
+
/* @__PURE__ */ e(Kt, { onClick: O }),
|
|
1461
1461
|
/* @__PURE__ */ e(
|
|
1462
1462
|
Ut,
|
|
1463
1463
|
{
|
|
1464
1464
|
date: t,
|
|
1465
1465
|
view: n,
|
|
1466
1466
|
events: o,
|
|
1467
|
-
onNavigatePrev:
|
|
1468
|
-
onNavigateNext:
|
|
1469
|
-
weekStartsOn:
|
|
1467
|
+
onNavigatePrev: _,
|
|
1468
|
+
onNavigateNext: E,
|
|
1469
|
+
weekStartsOn: z
|
|
1470
1470
|
}
|
|
1471
1471
|
)
|
|
1472
1472
|
] }),
|
|
1473
|
-
|
|
1473
|
+
D && /* @__PURE__ */ e(
|
|
1474
1474
|
me,
|
|
1475
1475
|
{
|
|
1476
1476
|
size: "icon",
|
|
1477
1477
|
className: "shrink-0 lg:hidden",
|
|
1478
|
-
onClick:
|
|
1478
|
+
onClick: D,
|
|
1479
1479
|
children: /* @__PURE__ */ e(Ze, { className: "size-4" })
|
|
1480
1480
|
}
|
|
1481
1481
|
)
|
|
@@ -1488,16 +1488,16 @@ function Dn({
|
|
|
1488
1488
|
className: d(
|
|
1489
1489
|
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
1490
1490
|
"h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",
|
|
1491
|
-
|
|
1491
|
+
T ? "bg-primary text-primary-foreground hover:bg-primary/90" : "border border-input bg-background hover:bg-accent hover:text-accent-foreground"
|
|
1492
1492
|
),
|
|
1493
1493
|
children: [
|
|
1494
1494
|
/* @__PURE__ */ e(Xt, { className: "size-4" }),
|
|
1495
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: $?.label ??
|
|
1495
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: $?.label ?? W.calendarView }),
|
|
1496
1496
|
/* @__PURE__ */ e(Je, { className: "size-3 opacity-60" })
|
|
1497
1497
|
]
|
|
1498
1498
|
}
|
|
1499
1499
|
),
|
|
1500
|
-
/* @__PURE__ */ e(
|
|
1500
|
+
/* @__PURE__ */ e(_e, { align: "start", className: "min-w-[120px]", children: S.map((f) => {
|
|
1501
1501
|
const x = f.icon;
|
|
1502
1502
|
return /* @__PURE__ */ r(
|
|
1503
1503
|
Be,
|
|
@@ -1527,12 +1527,12 @@ function Dn({
|
|
|
1527
1527
|
),
|
|
1528
1528
|
children: [
|
|
1529
1529
|
/* @__PURE__ */ e(ke, { className: "size-4" }),
|
|
1530
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: q?.label ??
|
|
1530
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: q?.label ?? W.resourceView }),
|
|
1531
1531
|
/* @__PURE__ */ e(Je, { className: "size-3 opacity-60" })
|
|
1532
1532
|
]
|
|
1533
1533
|
}
|
|
1534
1534
|
),
|
|
1535
|
-
/* @__PURE__ */ e(
|
|
1535
|
+
/* @__PURE__ */ e(_e, { align: "start", className: "min-w-[120px]", children: Qe.map((f) => {
|
|
1536
1536
|
const x = f.icon;
|
|
1537
1537
|
return /* @__PURE__ */ r(
|
|
1538
1538
|
Be,
|
|
@@ -1571,15 +1571,15 @@ function Dn({
|
|
|
1571
1571
|
}
|
|
1572
1572
|
)
|
|
1573
1573
|
] }),
|
|
1574
|
-
|
|
1575
|
-
|
|
1574
|
+
N,
|
|
1575
|
+
D && /* @__PURE__ */ r(
|
|
1576
1576
|
me,
|
|
1577
1577
|
{
|
|
1578
1578
|
className: "hidden lg:flex shrink-0 max-h-10",
|
|
1579
|
-
onClick:
|
|
1579
|
+
onClick: D,
|
|
1580
1580
|
children: [
|
|
1581
1581
|
/* @__PURE__ */ e(Ze, { className: "size-4" }),
|
|
1582
|
-
|
|
1582
|
+
W.addEvent
|
|
1583
1583
|
]
|
|
1584
1584
|
}
|
|
1585
1585
|
)
|
|
@@ -1597,7 +1597,7 @@ function Cn({
|
|
|
1597
1597
|
className: p,
|
|
1598
1598
|
renderEvent: s,
|
|
1599
1599
|
renderPopover: y,
|
|
1600
|
-
slots:
|
|
1600
|
+
slots: D,
|
|
1601
1601
|
classNames: l
|
|
1602
1602
|
}) {
|
|
1603
1603
|
const b = F(() => {
|
|
@@ -1605,17 +1605,17 @@ function Cn({
|
|
|
1605
1605
|
m.setHours(0, 0, 0, 0);
|
|
1606
1606
|
const g = new Date(m);
|
|
1607
1607
|
return g.setDate(g.getDate() + o), t.filter((u) => u.endDate >= m && u.startDate <= g);
|
|
1608
|
-
}, [t, o, n]),
|
|
1608
|
+
}, [t, o, n]), k = F(() => {
|
|
1609
1609
|
const m = yt(b), g = [];
|
|
1610
|
-
for (const [u,
|
|
1610
|
+
for (const [u, N] of m)
|
|
1611
1611
|
g.push({
|
|
1612
1612
|
date: new Date(u),
|
|
1613
1613
|
dateKey: u,
|
|
1614
|
-
events:
|
|
1614
|
+
events: N
|
|
1615
1615
|
});
|
|
1616
|
-
return g.sort((u,
|
|
1616
|
+
return g.sort((u, N) => u.date.getTime() - N.date.getTime()), g;
|
|
1617
1617
|
}, [b]);
|
|
1618
|
-
return
|
|
1618
|
+
return k.length === 0 ? /* @__PURE__ */ e("div", { className: d("flex flex-col items-center justify-center h-full py-12", p), children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
1619
1619
|
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "No events found" }),
|
|
1620
1620
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground/70", children: "No events scheduled for this period" })
|
|
1621
1621
|
] }) }) : /* @__PURE__ */ r("div", { className: d("flex flex-col h-full overflow-auto", l?.agendaList, p), children: [
|
|
@@ -1627,8 +1627,8 @@ function Cn({
|
|
|
1627
1627
|
b.length !== 1 ? "s" : ""
|
|
1628
1628
|
] })
|
|
1629
1629
|
] }) }),
|
|
1630
|
-
/* @__PURE__ */ e("div", { className: "flex-1", children:
|
|
1631
|
-
const
|
|
1630
|
+
/* @__PURE__ */ e("div", { className: "flex-1", children: k.map(({ date: m, dateKey: g, events: u }) => {
|
|
1631
|
+
const N = ce(m), v = m.toLocaleDateString([], { weekday: "short" }), z = m.getDate(), M = m.toLocaleDateString([], { month: "short" });
|
|
1632
1632
|
return /* @__PURE__ */ r("div", { className: d("", l?.agendaDayGroup), children: [
|
|
1633
1633
|
/* @__PURE__ */ e(
|
|
1634
1634
|
"div",
|
|
@@ -1644,7 +1644,7 @@ function Cn({
|
|
|
1644
1644
|
{
|
|
1645
1645
|
className: d(
|
|
1646
1646
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
1647
|
-
|
|
1647
|
+
N ? "text-primary" : "text-muted-foreground"
|
|
1648
1648
|
),
|
|
1649
1649
|
children: v
|
|
1650
1650
|
}
|
|
@@ -1655,14 +1655,14 @@ function Cn({
|
|
|
1655
1655
|
className: d(
|
|
1656
1656
|
"flex items-center justify-center rounded-full mt-0.5",
|
|
1657
1657
|
"size-10 text-xl font-normal",
|
|
1658
|
-
|
|
1658
|
+
N ? "bg-primary text-primary-foreground" : "text-foreground"
|
|
1659
1659
|
),
|
|
1660
|
-
children:
|
|
1660
|
+
children: z
|
|
1661
1661
|
}
|
|
1662
1662
|
)
|
|
1663
1663
|
] }),
|
|
1664
1664
|
/* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
|
|
1665
|
-
|
|
1665
|
+
M,
|
|
1666
1666
|
" ",
|
|
1667
1667
|
m.getFullYear()
|
|
1668
1668
|
] })
|
|
@@ -1670,10 +1670,10 @@ function Cn({
|
|
|
1670
1670
|
}
|
|
1671
1671
|
),
|
|
1672
1672
|
/* @__PURE__ */ e("div", { className: "px-4 py-3 space-y-2 border-b last:border-b-0", children: u.map(
|
|
1673
|
-
(
|
|
1673
|
+
(W) => s ? /* @__PURE__ */ e("div", { children: s({ event: W, variant: "full" }) }, W.id) : /* @__PURE__ */ e(
|
|
1674
1674
|
Se,
|
|
1675
1675
|
{
|
|
1676
|
-
event:
|
|
1676
|
+
event: W,
|
|
1677
1677
|
variant: "full",
|
|
1678
1678
|
badgeVariant: a,
|
|
1679
1679
|
onClick: i,
|
|
@@ -1684,7 +1684,7 @@ function Cn({
|
|
|
1684
1684
|
showParticipants: !0,
|
|
1685
1685
|
...l?.eventCard && { className: l.eventCard }
|
|
1686
1686
|
},
|
|
1687
|
-
|
|
1687
|
+
W.id
|
|
1688
1688
|
)
|
|
1689
1689
|
) })
|
|
1690
1690
|
] }, g);
|
|
@@ -1701,20 +1701,20 @@ function nn({
|
|
|
1701
1701
|
badgeVariant: p = "colored",
|
|
1702
1702
|
onEventClick: s,
|
|
1703
1703
|
renderEvent: y,
|
|
1704
|
-
renderPopover:
|
|
1704
|
+
renderPopover: D,
|
|
1705
1705
|
className: l
|
|
1706
1706
|
}) {
|
|
1707
|
-
const b = te(null),
|
|
1708
|
-
() => [...a].sort((
|
|
1707
|
+
const b = te(null), k = te(null), [m, g] = J("closed"), u = F(
|
|
1708
|
+
() => [...a].sort((_, E) => _.startDate.getTime() - E.startDate.getTime()),
|
|
1709
1709
|
[a]
|
|
1710
|
-
),
|
|
1710
|
+
), N = F(() => {
|
|
1711
1711
|
if (!i) return { top: 0, left: 0, width: be, maxHeight: we };
|
|
1712
|
-
const
|
|
1713
|
-
let
|
|
1714
|
-
|
|
1712
|
+
const _ = typeof window < "u" ? window.innerWidth : 1200, E = typeof window < "u" ? window.innerHeight : 800;
|
|
1713
|
+
let T = i.left + i.width / 2 - be / 2;
|
|
1714
|
+
T = Math.max(16, Math.min(T, _ - be - 16));
|
|
1715
1715
|
const I = Math.min(a.length * 68 + 80, we);
|
|
1716
1716
|
let S = i.top + i.height / 2 - I / 2;
|
|
1717
|
-
return S = Math.max(16, Math.min(S,
|
|
1717
|
+
return S = Math.max(16, Math.min(S, E - I - 16)), { top: S, left: T, width: be, maxHeight: we };
|
|
1718
1718
|
}, [i, a.length]);
|
|
1719
1719
|
Ie(() => {
|
|
1720
1720
|
if (t && i)
|
|
@@ -1725,28 +1725,28 @@ function nn({
|
|
|
1725
1725
|
});
|
|
1726
1726
|
else if (!t && m === "open") {
|
|
1727
1727
|
g("exiting");
|
|
1728
|
-
const
|
|
1728
|
+
const _ = setTimeout(() => {
|
|
1729
1729
|
g("closed");
|
|
1730
1730
|
}, Te);
|
|
1731
|
-
return () => clearTimeout(
|
|
1731
|
+
return () => clearTimeout(_);
|
|
1732
1732
|
}
|
|
1733
|
-
}, [t, i]),
|
|
1733
|
+
}, [t, i]), We(() => {
|
|
1734
1734
|
if (m === "closed") return;
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1735
|
+
const _ = (E) => {
|
|
1736
|
+
E.key === "Escape" && (E.stopPropagation(), n());
|
|
1737
1737
|
};
|
|
1738
|
-
return document.addEventListener("keydown",
|
|
1739
|
-
}, [m, n]),
|
|
1740
|
-
m === "open" &&
|
|
1738
|
+
return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
|
|
1739
|
+
}, [m, n]), We(() => {
|
|
1740
|
+
m === "open" && k.current && k.current.focus();
|
|
1741
1741
|
}, [m]);
|
|
1742
1742
|
const v = L(
|
|
1743
|
-
(
|
|
1744
|
-
|
|
1743
|
+
(_) => {
|
|
1744
|
+
_.target === b.current && n();
|
|
1745
1745
|
},
|
|
1746
1746
|
[n]
|
|
1747
1747
|
);
|
|
1748
1748
|
if (m === "closed") return null;
|
|
1749
|
-
const
|
|
1749
|
+
const z = m === "entering" || m === "exiting", M = z && i ? {
|
|
1750
1750
|
// Collapsed state: match the day cell exactly
|
|
1751
1751
|
position: "fixed",
|
|
1752
1752
|
top: i.top,
|
|
@@ -1760,14 +1760,14 @@ function nn({
|
|
|
1760
1760
|
} : {
|
|
1761
1761
|
// Expanded state: full panel
|
|
1762
1762
|
position: "fixed",
|
|
1763
|
-
top:
|
|
1764
|
-
left:
|
|
1765
|
-
width:
|
|
1766
|
-
maxHeight:
|
|
1763
|
+
top: N.top,
|
|
1764
|
+
left: N.left,
|
|
1765
|
+
width: N.width,
|
|
1766
|
+
maxHeight: N.maxHeight,
|
|
1767
1767
|
opacity: 1,
|
|
1768
1768
|
transform: "scale(1)",
|
|
1769
1769
|
borderRadius: "12px"
|
|
1770
|
-
},
|
|
1770
|
+
}, W = z ? 0 : 1, O = o.toLocaleDateString(void 0, {
|
|
1771
1771
|
weekday: "long",
|
|
1772
1772
|
month: "long",
|
|
1773
1773
|
day: "numeric"
|
|
@@ -1785,7 +1785,7 @@ function nn({
|
|
|
1785
1785
|
inset: 0,
|
|
1786
1786
|
zIndex: 50,
|
|
1787
1787
|
backgroundColor: "rgba(0, 0, 0, 0.2)",
|
|
1788
|
-
opacity:
|
|
1788
|
+
opacity: W,
|
|
1789
1789
|
transition: `opacity ${Te}ms cubic-bezier(0.32, 0.72, 0, 1)`
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
@@ -1793,10 +1793,10 @@ function nn({
|
|
|
1793
1793
|
/* @__PURE__ */ r(
|
|
1794
1794
|
"div",
|
|
1795
1795
|
{
|
|
1796
|
-
ref:
|
|
1796
|
+
ref: k,
|
|
1797
1797
|
role: "dialog",
|
|
1798
1798
|
"aria-modal": "true",
|
|
1799
|
-
"aria-label": `Events for ${
|
|
1799
|
+
"aria-label": `Events for ${O}`,
|
|
1800
1800
|
tabIndex: -1,
|
|
1801
1801
|
className: d(
|
|
1802
1802
|
"ic-expansion-panel",
|
|
@@ -1805,7 +1805,7 @@ function nn({
|
|
|
1805
1805
|
l
|
|
1806
1806
|
),
|
|
1807
1807
|
style: {
|
|
1808
|
-
...
|
|
1808
|
+
...M,
|
|
1809
1809
|
zIndex: 51,
|
|
1810
1810
|
transition: `all ${Te}ms cubic-bezier(0.32, 0.72, 0, 1)`,
|
|
1811
1811
|
willChange: "top, left, width, height, max-height, opacity, border-radius"
|
|
@@ -1813,7 +1813,7 @@ function nn({
|
|
|
1813
1813
|
children: [
|
|
1814
1814
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between px-4 py-3 border-b bg-muted/30", children: [
|
|
1815
1815
|
/* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
1816
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground", children:
|
|
1816
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground", children: O }),
|
|
1817
1817
|
/* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground", children: [
|
|
1818
1818
|
a.length,
|
|
1819
1819
|
" event",
|
|
@@ -1853,26 +1853,26 @@ function nn({
|
|
|
1853
1853
|
className: "overflow-y-auto px-3 py-2 space-y-1.5",
|
|
1854
1854
|
style: { maxHeight: `${we - 64}px` },
|
|
1855
1855
|
children: [
|
|
1856
|
-
u.map((
|
|
1856
|
+
u.map((_) => /* @__PURE__ */ e(
|
|
1857
1857
|
"div",
|
|
1858
1858
|
{
|
|
1859
|
-
onPointerDown: (
|
|
1860
|
-
children: y ? y({ event:
|
|
1859
|
+
onPointerDown: (E) => E.stopPropagation(),
|
|
1860
|
+
children: y ? y({ event: _, variant: "compact" }) : /* @__PURE__ */ e(
|
|
1861
1861
|
Se,
|
|
1862
1862
|
{
|
|
1863
|
-
event:
|
|
1863
|
+
event: _,
|
|
1864
1864
|
variant: "compact",
|
|
1865
1865
|
badgeVariant: p,
|
|
1866
|
-
onClick: (
|
|
1867
|
-
n(), s?.(
|
|
1866
|
+
onClick: (E) => {
|
|
1867
|
+
n(), s?.(E);
|
|
1868
1868
|
},
|
|
1869
|
-
disablePopover: !!s && !
|
|
1870
|
-
renderPopover:
|
|
1869
|
+
disablePopover: !!s && !D,
|
|
1870
|
+
renderPopover: D,
|
|
1871
1871
|
showTime: !0
|
|
1872
1872
|
}
|
|
1873
1873
|
)
|
|
1874
1874
|
},
|
|
1875
|
-
|
|
1875
|
+
_.id
|
|
1876
1876
|
)),
|
|
1877
1877
|
a.length === 0 && /* @__PURE__ */ e("div", { className: "py-6 text-center text-sm text-muted-foreground", children: "No events" })
|
|
1878
1878
|
]
|
|
@@ -1890,7 +1890,7 @@ function rn({
|
|
|
1890
1890
|
disablePopover: a,
|
|
1891
1891
|
renderPopover: i
|
|
1892
1892
|
}) {
|
|
1893
|
-
const [p, s] = J(!1), y = de(t.color),
|
|
1893
|
+
const [p, s] = J(!1), y = de(t.color), D = De(t), l = le(t.startDate, n), b = le(t.endDate, n), k = D && le(t.startDate, t.endDate), m = L(() => {
|
|
1894
1894
|
a && o ? o(t) : a || s(!0);
|
|
1895
1895
|
}, [a, o, t]), g = L(() => {
|
|
1896
1896
|
s(!1);
|
|
@@ -1908,20 +1908,20 @@ function rn({
|
|
|
1908
1908
|
t.isCanceled && "opacity-60 line-through"
|
|
1909
1909
|
),
|
|
1910
1910
|
children: [
|
|
1911
|
-
!
|
|
1912
|
-
!
|
|
1913
|
-
!
|
|
1911
|
+
!k && l && !b && "→ ",
|
|
1912
|
+
!k && !l && b && " ←",
|
|
1913
|
+
!k && !l && !b && "↔ ",
|
|
1914
1914
|
/* @__PURE__ */ e("span", { className: "truncate max-w-24 sm:max-w-32", children: t.title }),
|
|
1915
|
-
|
|
1915
|
+
k && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-70 sm:text-[10px]", children: "All day" })
|
|
1916
1916
|
]
|
|
1917
1917
|
}
|
|
1918
|
-
),
|
|
1918
|
+
), N = /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
1919
1919
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
1920
1920
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) })
|
|
1921
1921
|
] }) });
|
|
1922
1922
|
return a ? /* @__PURE__ */ r(ie, { children: [
|
|
1923
1923
|
/* @__PURE__ */ e(se, { asChild: !0, children: u }),
|
|
1924
|
-
|
|
1924
|
+
N
|
|
1925
1925
|
] }) : /* @__PURE__ */ r(re, { open: p, onOpenChange: s, children: [
|
|
1926
1926
|
/* @__PURE__ */ e(oe, { asChild: !0, children: u }),
|
|
1927
1927
|
/* @__PURE__ */ e(Q, { className: "w-80", children: i ? i({ event: t, onClose: g }) : /* @__PURE__ */ e(on, { event: t, onClose: g }) })
|
|
@@ -1967,9 +1967,9 @@ function an({
|
|
|
1967
1967
|
if (t.length === 0) return null;
|
|
1968
1968
|
const s = t.some((l) => De(l) && le(l.startDate, l.endDate)), y = t.some(
|
|
1969
1969
|
(l) => !le(l.startDate, l.endDate) || De(l) && !le(l.startDate, l.endDate)
|
|
1970
|
-
),
|
|
1970
|
+
), D = s && y ? "All day / Multi-day" : s ? "All day" : "Multi-day";
|
|
1971
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", p), children: [
|
|
1972
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children:
|
|
1972
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children: D }),
|
|
1973
1973
|
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.map((l) => /* @__PURE__ */ e(
|
|
1974
1974
|
rn,
|
|
1975
1975
|
{
|
|
@@ -1993,50 +1993,50 @@ function ut({
|
|
|
1993
1993
|
isSelecting: p = !1,
|
|
1994
1994
|
disabled: s = !1,
|
|
1995
1995
|
ariaLabel: y,
|
|
1996
|
-
children:
|
|
1996
|
+
children: D,
|
|
1997
1997
|
className: l,
|
|
1998
1998
|
height: b,
|
|
1999
|
-
style:
|
|
1999
|
+
style: k,
|
|
2000
2000
|
dataAttributes: m
|
|
2001
2001
|
}) {
|
|
2002
|
-
const g = te(null), u = te(!1),
|
|
2002
|
+
const g = te(null), u = te(!1), N = te(!1), v = te(null), [z, M] = J(!1), W = Re(), O = L(
|
|
2003
2003
|
(f) => {
|
|
2004
|
-
s || f.button !== 0 && f.pointerType === "mouse" || (f.preventDefault(), g.current = { x: f.clientX, y: f.clientY }, u.current = !1,
|
|
2004
|
+
s || f.button !== 0 && f.pointerType === "mouse" || (f.preventDefault(), g.current = { x: f.clientX, y: f.clientY }, u.current = !1, N.current = !0, n?.(t));
|
|
2005
2005
|
},
|
|
2006
2006
|
[s, t, n]
|
|
2007
|
-
),
|
|
2007
|
+
), _ = L(
|
|
2008
2008
|
(f) => {
|
|
2009
|
-
if (!(g.current &&
|
|
2009
|
+
if (!(g.current && N.current && !s)) return;
|
|
2010
2010
|
const x = f.clientX - g.current.x, B = f.clientY - g.current.y;
|
|
2011
2011
|
Math.sqrt(x * x + B * B) >= sn && (u.current = !0);
|
|
2012
2012
|
},
|
|
2013
2013
|
[s]
|
|
2014
|
-
),
|
|
2014
|
+
), E = L(
|
|
2015
2015
|
(f) => {
|
|
2016
2016
|
s || (f.buttons > 0 || p) && o?.(t);
|
|
2017
2017
|
},
|
|
2018
2018
|
[s, p, t, o]
|
|
2019
|
-
),
|
|
2020
|
-
s || (a?.(), g.current = null, u.current = !1,
|
|
2019
|
+
), T = L(() => {
|
|
2020
|
+
s || (a?.(), g.current = null, u.current = !1, N.current = !1);
|
|
2021
2021
|
}, [s, a]), I = L(
|
|
2022
2022
|
(f) => {
|
|
2023
|
-
if (!
|
|
2024
|
-
f.preventDefault(), f.dataTransfer.dropEffect = "move",
|
|
2023
|
+
if (!W?.isDragging || s) return;
|
|
2024
|
+
f.preventDefault(), f.dataTransfer.dropEffect = "move", M(!0);
|
|
2025
2025
|
const x = /* @__PURE__ */ new Date(), B = t.hour ?? x.getHours(), R = t.minute ?? (x.getMinutes() >= 30 ? 30 : 0);
|
|
2026
|
-
|
|
2026
|
+
W.updateDragPreview?.(t.date, B, R);
|
|
2027
2027
|
},
|
|
2028
|
-
[
|
|
2028
|
+
[W, s, t]
|
|
2029
2029
|
), S = L(() => {
|
|
2030
|
-
|
|
2030
|
+
M(!1);
|
|
2031
2031
|
}, []), $ = L(
|
|
2032
2032
|
(f) => {
|
|
2033
|
-
f.preventDefault(),
|
|
2033
|
+
f.preventDefault(), M(!1), !(!W?.isDragging || s) && W.endDrag?.();
|
|
2034
2034
|
},
|
|
2035
|
-
[
|
|
2035
|
+
[W, s]
|
|
2036
2036
|
);
|
|
2037
|
-
|
|
2037
|
+
We(() => {
|
|
2038
2038
|
const f = () => {
|
|
2039
|
-
|
|
2039
|
+
N.current && (N.current = !1, g.current = null, u.current = !1);
|
|
2040
2040
|
};
|
|
2041
2041
|
return window.addEventListener("pointerup", f), window.addEventListener("pointercancel", f), () => {
|
|
2042
2042
|
window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", f);
|
|
@@ -2057,10 +2057,10 @@ function ut({
|
|
|
2057
2057
|
"aria-disabled": s,
|
|
2058
2058
|
"aria-pressed": i,
|
|
2059
2059
|
disabled: s,
|
|
2060
|
-
onPointerDown:
|
|
2061
|
-
onPointerMove:
|
|
2062
|
-
onPointerUp:
|
|
2063
|
-
onPointerEnter:
|
|
2060
|
+
onPointerDown: O,
|
|
2061
|
+
onPointerMove: _,
|
|
2062
|
+
onPointerUp: T,
|
|
2063
|
+
onPointerEnter: E,
|
|
2064
2064
|
onKeyDown: q,
|
|
2065
2065
|
onDragOver: I,
|
|
2066
2066
|
onDragLeave: S,
|
|
@@ -2073,14 +2073,14 @@ function ut({
|
|
|
2073
2073
|
// Selection state — blue tint matching the primary color
|
|
2074
2074
|
i && "bg-blue-100/70",
|
|
2075
2075
|
// Drag over state - visual feedback when event is dragged over
|
|
2076
|
-
|
|
2076
|
+
z && "bg-primary/20 ring-2 ring-primary ring-inset",
|
|
2077
2077
|
// Disabled state
|
|
2078
2078
|
s && "cursor-not-allowed opacity-50",
|
|
2079
2079
|
l
|
|
2080
2080
|
),
|
|
2081
|
-
style: { height: b, ...
|
|
2081
|
+
style: { height: b, ...k },
|
|
2082
2082
|
...m,
|
|
2083
|
-
children:
|
|
2083
|
+
children: D
|
|
2084
2084
|
}
|
|
2085
2085
|
);
|
|
2086
2086
|
}
|
|
@@ -2099,7 +2099,7 @@ function ln({ slot: t, date: n, ariaLabel: o, ...a }) {
|
|
|
2099
2099
|
const i = t ?? { date: n }, p = o ?? `Select ${i.date.toLocaleDateString()}`;
|
|
2100
2100
|
return /* @__PURE__ */ e(ut, { slot: i, ariaLabel: p, ...a });
|
|
2101
2101
|
}
|
|
2102
|
-
const pe = 96, ze = 72,
|
|
2102
|
+
const pe = 96, ze = 72, Ae = 80;
|
|
2103
2103
|
function Sn({
|
|
2104
2104
|
events: t,
|
|
2105
2105
|
date: n,
|
|
@@ -2109,41 +2109,50 @@ function Sn({
|
|
|
2109
2109
|
badgeVariant: p = "colored",
|
|
2110
2110
|
onEventClick: s,
|
|
2111
2111
|
onSlotSelect: y,
|
|
2112
|
-
className:
|
|
2112
|
+
className: D,
|
|
2113
2113
|
renderEvent: l,
|
|
2114
2114
|
renderPopover: b,
|
|
2115
|
-
slots:
|
|
2115
|
+
slots: k,
|
|
2116
2116
|
classNames: m
|
|
2117
2117
|
}) {
|
|
2118
|
-
const g = 60 / i, u = 100 / g,
|
|
2119
|
-
const
|
|
2118
|
+
const g = 60 / i, u = 100 / g, N = F(() => {
|
|
2119
|
+
const w = [];
|
|
2120
2120
|
for (let c = 0; c < g; c++)
|
|
2121
|
-
|
|
2122
|
-
return
|
|
2123
|
-
}, [g, i]), v = F(() => He(t, n), [t, n]), { singleDay:
|
|
2124
|
-
|
|
2125
|
-
|
|
2121
|
+
w.push(c * i);
|
|
2122
|
+
return w;
|
|
2123
|
+
}, [g, i]), v = F(() => He(t, n), [t, n]), { singleDay: z, multiDay: M } = F(() => rt(v), [v]);
|
|
2124
|
+
console.log("[DayView Debug]", {
|
|
2125
|
+
totalEvents: t.length,
|
|
2126
|
+
dayEventsCount: v.length,
|
|
2127
|
+
multiDayCount: M.length,
|
|
2128
|
+
singleDayCount: z.length,
|
|
2129
|
+
date: n.toISOString(),
|
|
2130
|
+
allDayFlags: v.map((w) => ({ id: w.id, title: w.title, isAllDay: w.isAllDay, isMultiDay: w.isMultiDay, start: w.startDate.toISOString(), end: w.endDate.toISOString() }))
|
|
2131
|
+
});
|
|
2132
|
+
const W = F(() => {
|
|
2133
|
+
const w = ot(z, n, o, pe), c = /* @__PURE__ */ new Map();
|
|
2134
|
+
for (const h of w)
|
|
2126
2135
|
c.set(h.event.id, h.position);
|
|
2127
2136
|
return c;
|
|
2128
|
-
}, [
|
|
2129
|
-
if (!
|
|
2130
|
-
const
|
|
2131
|
-
return
|
|
2132
|
-
}, [
|
|
2137
|
+
}, [z, n, o]), O = F(() => at(o), [o]), _ = /* @__PURE__ */ new Date(), E = ce(n), T = F(() => {
|
|
2138
|
+
if (!E) return 0;
|
|
2139
|
+
const w = _.getHours() + _.getMinutes() / 60;
|
|
2140
|
+
return w < o.startHour || w > o.endHour ? -1 : (w - o.startHour) * pe;
|
|
2141
|
+
}, [E, o, _]), I = te(null);
|
|
2133
2142
|
Ie(() => {
|
|
2134
|
-
const
|
|
2135
|
-
if (!
|
|
2143
|
+
const w = I.current;
|
|
2144
|
+
if (!w) return;
|
|
2136
2145
|
const c = () => {
|
|
2137
2146
|
let h;
|
|
2138
|
-
if (
|
|
2147
|
+
if (E) {
|
|
2139
2148
|
const H = (/* @__PURE__ */ new Date()).getHours();
|
|
2140
2149
|
h = Math.max(H - 1, o.startHour);
|
|
2141
2150
|
} else {
|
|
2142
|
-
const H = n.getDay(),
|
|
2143
|
-
|
|
2151
|
+
const H = n.getDay(), A = a?.[H];
|
|
2152
|
+
A?.enabled && A.from > 0 ? h = Math.max(A.from - 1, o.startHour) : h = Math.max(7, o.startHour);
|
|
2144
2153
|
}
|
|
2145
2154
|
const C = (h - o.startHour) * pe;
|
|
2146
|
-
|
|
2155
|
+
w.scrollTo({
|
|
2147
2156
|
top: C,
|
|
2148
2157
|
behavior: "instant"
|
|
2149
2158
|
});
|
|
@@ -2151,26 +2160,26 @@ function Sn({
|
|
|
2151
2160
|
requestAnimationFrame(() => {
|
|
2152
2161
|
requestAnimationFrame(c);
|
|
2153
2162
|
});
|
|
2154
|
-
}, [n, a, o,
|
|
2155
|
-
const S =
|
|
2156
|
-
(
|
|
2157
|
-
S?.startSelection(
|
|
2163
|
+
}, [n, a, o, E]);
|
|
2164
|
+
const S = Oe(), $ = L(
|
|
2165
|
+
(w) => {
|
|
2166
|
+
S?.startSelection(w);
|
|
2158
2167
|
},
|
|
2159
2168
|
[S]
|
|
2160
2169
|
), q = L(
|
|
2161
|
-
(
|
|
2162
|
-
S?.updateSelection(
|
|
2170
|
+
(w) => {
|
|
2171
|
+
S?.updateSelection(w);
|
|
2163
2172
|
},
|
|
2164
2173
|
[S]
|
|
2165
2174
|
), f = L(() => {
|
|
2166
2175
|
S?.endSelection();
|
|
2167
2176
|
}, [S]), x = L(
|
|
2168
|
-
(
|
|
2169
|
-
s?.(
|
|
2177
|
+
(w) => {
|
|
2178
|
+
s?.(w);
|
|
2170
2179
|
},
|
|
2171
2180
|
[s]
|
|
2172
2181
|
), B = n.toLocaleDateString([], { weekday: "short" }), R = n.getDate(), P = ce(n);
|
|
2173
|
-
return /* @__PURE__ */ r("div", { className: d("flex flex-col h-full",
|
|
2182
|
+
return /* @__PURE__ */ r("div", { className: d("flex flex-col h-full", D), children: [
|
|
2174
2183
|
/* @__PURE__ */ e(
|
|
2175
2184
|
"div",
|
|
2176
2185
|
{
|
|
@@ -2204,10 +2213,10 @@ function Sn({
|
|
|
2204
2213
|
] })
|
|
2205
2214
|
}
|
|
2206
2215
|
),
|
|
2207
|
-
|
|
2216
|
+
M.length > 0 && /* @__PURE__ */ e(
|
|
2208
2217
|
an,
|
|
2209
2218
|
{
|
|
2210
|
-
events:
|
|
2219
|
+
events: M,
|
|
2211
2220
|
date: n,
|
|
2212
2221
|
onEventClick: x,
|
|
2213
2222
|
disablePopover: !!s && !b,
|
|
@@ -2219,10 +2228,10 @@ function Sn({
|
|
|
2219
2228
|
"div",
|
|
2220
2229
|
{
|
|
2221
2230
|
ref: I,
|
|
2222
|
-
className: d("flex-1
|
|
2231
|
+
className: d("flex-1", m?.scrollContainer),
|
|
2223
2232
|
children: /* @__PURE__ */ r("div", { className: "relative min-h-full", children: [
|
|
2224
|
-
|
|
2225
|
-
const C = !it(n,
|
|
2233
|
+
O.map((w, c) => {
|
|
2234
|
+
const C = !it(n, w, a);
|
|
2226
2235
|
return /* @__PURE__ */ r(
|
|
2227
2236
|
"div",
|
|
2228
2237
|
{
|
|
@@ -2249,15 +2258,15 @@ function Sn({
|
|
|
2249
2258
|
"text-[10px] sm:text-xs text-muted-foreground",
|
|
2250
2259
|
m?.timeGutterLabel
|
|
2251
2260
|
),
|
|
2252
|
-
children: Ce(
|
|
2261
|
+
children: Ce(w)
|
|
2253
2262
|
}
|
|
2254
2263
|
) })
|
|
2255
2264
|
}
|
|
2256
2265
|
),
|
|
2257
2266
|
/* @__PURE__ */ r("div", { className: "relative flex-1", children: [
|
|
2258
|
-
|
|
2267
|
+
E && !C && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-primary/5" }),
|
|
2259
2268
|
c !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
|
|
2260
|
-
|
|
2269
|
+
N.slice(1).map((H) => /* @__PURE__ */ e(
|
|
2261
2270
|
"div",
|
|
2262
2271
|
{
|
|
2263
2272
|
className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
|
|
@@ -2265,8 +2274,8 @@ function Sn({
|
|
|
2265
2274
|
},
|
|
2266
2275
|
H
|
|
2267
2276
|
)),
|
|
2268
|
-
|
|
2269
|
-
const Y = { date: n, hour:
|
|
2277
|
+
N.map((H, A) => {
|
|
2278
|
+
const Y = { date: n, hour: w, minute: H };
|
|
2270
2279
|
return /* @__PURE__ */ e(
|
|
2271
2280
|
mt,
|
|
2272
2281
|
{
|
|
@@ -2279,10 +2288,10 @@ function Sn({
|
|
|
2279
2288
|
disabled: C,
|
|
2280
2289
|
className: "absolute inset-x-0",
|
|
2281
2290
|
style: {
|
|
2282
|
-
top: `${
|
|
2291
|
+
top: `${A * u}%`,
|
|
2283
2292
|
height: `${u}%`
|
|
2284
2293
|
},
|
|
2285
|
-
ariaLabel: `Add event at ${Ce(
|
|
2294
|
+
ariaLabel: `Add event at ${Ce(w)}:${String(H).padStart(2, "0")}`
|
|
2286
2295
|
},
|
|
2287
2296
|
H
|
|
2288
2297
|
);
|
|
@@ -2290,7 +2299,7 @@ function Sn({
|
|
|
2290
2299
|
] })
|
|
2291
2300
|
]
|
|
2292
2301
|
},
|
|
2293
|
-
|
|
2302
|
+
w
|
|
2294
2303
|
);
|
|
2295
2304
|
}),
|
|
2296
2305
|
/* @__PURE__ */ e(
|
|
@@ -2298,10 +2307,10 @@ function Sn({
|
|
|
2298
2307
|
{
|
|
2299
2308
|
className: "absolute top-0 bottom-0 right-0 pointer-events-none",
|
|
2300
2309
|
style: { left: ze },
|
|
2301
|
-
children:
|
|
2302
|
-
const c =
|
|
2310
|
+
children: z.map((w) => {
|
|
2311
|
+
const c = W.get(w.id);
|
|
2303
2312
|
if (!c) return null;
|
|
2304
|
-
const h = `calc(${c.width}% - 2px)`, C = `max(${
|
|
2313
|
+
const h = `calc(${c.width}% - 2px)`, C = `max(${Ae}px, ${h})`;
|
|
2305
2314
|
return l ? /* @__PURE__ */ e(
|
|
2306
2315
|
"div",
|
|
2307
2316
|
{
|
|
@@ -2310,20 +2319,20 @@ function Sn({
|
|
|
2310
2319
|
top: `${c.top}px`,
|
|
2311
2320
|
left: `${c.left}%`,
|
|
2312
2321
|
width: C,
|
|
2313
|
-
minWidth: `${
|
|
2322
|
+
minWidth: `${Ae}px`
|
|
2314
2323
|
},
|
|
2315
|
-
children: l({ event:
|
|
2324
|
+
children: l({ event: w, position: c })
|
|
2316
2325
|
},
|
|
2317
|
-
|
|
2326
|
+
w.id
|
|
2318
2327
|
) : /* @__PURE__ */ e(
|
|
2319
2328
|
lt,
|
|
2320
2329
|
{
|
|
2321
|
-
event:
|
|
2330
|
+
event: w,
|
|
2322
2331
|
position: {
|
|
2323
2332
|
top: c.top,
|
|
2324
2333
|
left: c.left,
|
|
2325
2334
|
width: c.width,
|
|
2326
|
-
minWidth:
|
|
2335
|
+
minWidth: Ae
|
|
2327
2336
|
},
|
|
2328
2337
|
hourHeight: pe,
|
|
2329
2338
|
badgeVariant: p,
|
|
@@ -2332,12 +2341,12 @@ function Sn({
|
|
|
2332
2341
|
renderPopover: b,
|
|
2333
2342
|
className: d("pointer-events-auto", m?.eventCard)
|
|
2334
2343
|
},
|
|
2335
|
-
|
|
2344
|
+
w.id
|
|
2336
2345
|
);
|
|
2337
2346
|
})
|
|
2338
2347
|
}
|
|
2339
2348
|
),
|
|
2340
|
-
|
|
2349
|
+
E && T >= 0 && /* @__PURE__ */ r(
|
|
2341
2350
|
"div",
|
|
2342
2351
|
{
|
|
2343
2352
|
className: d(
|
|
@@ -2345,7 +2354,7 @@ function Sn({
|
|
|
2345
2354
|
m?.currentTimeIndicator
|
|
2346
2355
|
),
|
|
2347
2356
|
style: {
|
|
2348
|
-
top:
|
|
2357
|
+
top: T,
|
|
2349
2358
|
left: ze
|
|
2350
2359
|
},
|
|
2351
2360
|
children: [
|
|
@@ -2385,33 +2394,33 @@ function Mn({
|
|
|
2385
2394
|
onSlotSelect: p,
|
|
2386
2395
|
onDayClick: s,
|
|
2387
2396
|
className: y,
|
|
2388
|
-
renderEvent:
|
|
2397
|
+
renderEvent: D,
|
|
2389
2398
|
renderPopover: l,
|
|
2390
2399
|
showMoreMode: b,
|
|
2391
|
-
showMoreEventsInPopover:
|
|
2400
|
+
showMoreEventsInPopover: k = !1,
|
|
2392
2401
|
slots: m,
|
|
2393
2402
|
classNames: g
|
|
2394
2403
|
}) {
|
|
2395
|
-
const u = b ?? (
|
|
2404
|
+
const u = b ?? (k ? "popover" : "expand"), N = m?.dayCellHeader, v = m?.dayCellFooter, [z, M] = J(null), [W, O] = J(null), _ = F(() => bt(n, o), [n, o]), E = F(() => {
|
|
2396
2405
|
const x = /* @__PURE__ */ new Map();
|
|
2397
|
-
for (const B of
|
|
2406
|
+
for (const B of _) {
|
|
2398
2407
|
const R = B.date.toDateString(), P = He(t, B.date);
|
|
2399
|
-
P.sort((
|
|
2408
|
+
P.sort((w, c) => w.startDate.getTime() - c.startDate.getTime()), x.set(R, P);
|
|
2400
2409
|
}
|
|
2401
2410
|
return x;
|
|
2402
|
-
}, [
|
|
2411
|
+
}, [_, t]), T = Oe(), I = L(
|
|
2403
2412
|
(x) => {
|
|
2404
|
-
|
|
2413
|
+
T?.startSelection(x);
|
|
2405
2414
|
},
|
|
2406
|
-
[
|
|
2415
|
+
[T]
|
|
2407
2416
|
), S = L(
|
|
2408
2417
|
(x) => {
|
|
2409
|
-
|
|
2418
|
+
T?.updateSelection(x);
|
|
2410
2419
|
},
|
|
2411
|
-
[
|
|
2420
|
+
[T]
|
|
2412
2421
|
), $ = L(() => {
|
|
2413
|
-
|
|
2414
|
-
}, [
|
|
2422
|
+
T?.endSelection();
|
|
2423
|
+
}, [T]), q = L(
|
|
2415
2424
|
(x) => {
|
|
2416
2425
|
s?.(x);
|
|
2417
2426
|
},
|
|
@@ -2444,8 +2453,8 @@ function Mn({
|
|
|
2444
2453
|
))
|
|
2445
2454
|
}
|
|
2446
2455
|
),
|
|
2447
|
-
/* @__PURE__ */ e("div", { className: d("grid grid-cols-7 auto-rows-min", g?.monthGrid), children:
|
|
2448
|
-
const B = x.date.toDateString(), R =
|
|
2456
|
+
/* @__PURE__ */ e("div", { className: d("grid grid-cols-7 auto-rows-min", g?.monthGrid), children: _.map((x) => {
|
|
2457
|
+
const B = x.date.toDateString(), R = E.get(B) || [], P = ce(x.date), w = x.date.getDay() === 0 || x.date.getDay() === 6, c = R.length > fe;
|
|
2449
2458
|
return /* @__PURE__ */ r(
|
|
2450
2459
|
ln,
|
|
2451
2460
|
{
|
|
@@ -2454,17 +2463,17 @@ function Mn({
|
|
|
2454
2463
|
onSelectionStart: I,
|
|
2455
2464
|
onSelectionMove: S,
|
|
2456
2465
|
onSelectionEnd: $,
|
|
2457
|
-
isSelected:
|
|
2458
|
-
isSelecting:
|
|
2466
|
+
isSelected: T?.isSlotSelected({ date: x.date }) ?? !1,
|
|
2467
|
+
isSelecting: T?.isSelecting ?? !1,
|
|
2459
2468
|
className: d(
|
|
2460
2469
|
"relative flex flex-col border-r border-b text-left min-h-[80px] sm:min-h-[100px] overflow-hidden",
|
|
2461
2470
|
"[&:nth-child(7n)]:border-r-0",
|
|
2462
2471
|
!x.isCurrentMonth && "bg-muted/20",
|
|
2463
|
-
|
|
2472
|
+
w && x.isCurrentMonth && "bg-muted/10",
|
|
2464
2473
|
g?.dayCell,
|
|
2465
2474
|
P && g?.dayCellToday,
|
|
2466
2475
|
!x.isCurrentMonth && g?.dayCellOutside,
|
|
2467
|
-
|
|
2476
|
+
w && g?.dayCellWeekend
|
|
2468
2477
|
),
|
|
2469
2478
|
ariaLabel: `${x.date.toLocaleDateString()} - ${R.length} events. Click to create event, double-click to view day.`,
|
|
2470
2479
|
children: [
|
|
@@ -2493,14 +2502,14 @@ function Mn({
|
|
|
2493
2502
|
)
|
|
2494
2503
|
}
|
|
2495
2504
|
),
|
|
2496
|
-
|
|
2497
|
-
|
|
2505
|
+
N && /* @__PURE__ */ e(
|
|
2506
|
+
N,
|
|
2498
2507
|
{
|
|
2499
2508
|
date: x.date,
|
|
2500
2509
|
events: R,
|
|
2501
2510
|
isToday: P,
|
|
2502
2511
|
isCurrentMonth: x.isCurrentMonth,
|
|
2503
|
-
isWeekend:
|
|
2512
|
+
isWeekend: w,
|
|
2504
2513
|
view: "month"
|
|
2505
2514
|
}
|
|
2506
2515
|
),
|
|
@@ -2518,7 +2527,7 @@ function Mn({
|
|
|
2518
2527
|
onPointerDown: (C) => {
|
|
2519
2528
|
C.stopPropagation();
|
|
2520
2529
|
},
|
|
2521
|
-
children:
|
|
2530
|
+
children: D ? D({ event: h, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2522
2531
|
Se,
|
|
2523
2532
|
{
|
|
2524
2533
|
event: h,
|
|
@@ -2545,7 +2554,7 @@ function Mn({
|
|
|
2545
2554
|
onClick: (h) => {
|
|
2546
2555
|
h.stopPropagation();
|
|
2547
2556
|
const C = document.querySelector(`[data-day-key="${B}"]`);
|
|
2548
|
-
|
|
2557
|
+
O({
|
|
2549
2558
|
date: x.date,
|
|
2550
2559
|
events: R,
|
|
2551
2560
|
rect: C?.getBoundingClientRect() ?? new DOMRect(window.innerWidth / 2 - 180, window.innerHeight / 2 - 240, 0, 0)
|
|
@@ -2565,8 +2574,8 @@ function Mn({
|
|
|
2565
2574
|
c && u === "popover" && /* @__PURE__ */ r(
|
|
2566
2575
|
re,
|
|
2567
2576
|
{
|
|
2568
|
-
open:
|
|
2569
|
-
onOpenChange: (h) =>
|
|
2577
|
+
open: z === B,
|
|
2578
|
+
onOpenChange: (h) => M(h ? B : null),
|
|
2570
2579
|
children: [
|
|
2571
2580
|
/* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2572
2581
|
"button",
|
|
@@ -2574,7 +2583,7 @@ function Mn({
|
|
|
2574
2583
|
type: "button",
|
|
2575
2584
|
onPointerDown: (h) => h.stopPropagation(),
|
|
2576
2585
|
onClick: (h) => {
|
|
2577
|
-
h.stopPropagation(),
|
|
2586
|
+
h.stopPropagation(), M(B);
|
|
2578
2587
|
},
|
|
2579
2588
|
className: d(
|
|
2580
2589
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
@@ -2607,14 +2616,14 @@ function Mn({
|
|
|
2607
2616
|
" events"
|
|
2608
2617
|
] })
|
|
2609
2618
|
] }),
|
|
2610
|
-
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: R.map((h) => /* @__PURE__ */ e("div", { children:
|
|
2619
|
+
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: R.map((h) => /* @__PURE__ */ e("div", { children: D ? D({ event: h, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2611
2620
|
Se,
|
|
2612
2621
|
{
|
|
2613
2622
|
event: h,
|
|
2614
2623
|
variant: "compact",
|
|
2615
2624
|
badgeVariant: a,
|
|
2616
2625
|
onClick: (C) => {
|
|
2617
|
-
|
|
2626
|
+
M(null), i?.(C);
|
|
2618
2627
|
},
|
|
2619
2628
|
disablePopover: !!i && !l,
|
|
2620
2629
|
renderPopover: l,
|
|
@@ -2654,7 +2663,7 @@ function Mn({
|
|
|
2654
2663
|
events: R,
|
|
2655
2664
|
isToday: P,
|
|
2656
2665
|
isCurrentMonth: x.isCurrentMonth,
|
|
2657
|
-
isWeekend:
|
|
2666
|
+
isWeekend: w,
|
|
2658
2667
|
view: "month"
|
|
2659
2668
|
}
|
|
2660
2669
|
)
|
|
@@ -2667,14 +2676,14 @@ function Mn({
|
|
|
2667
2676
|
/* @__PURE__ */ e(
|
|
2668
2677
|
nn,
|
|
2669
2678
|
{
|
|
2670
|
-
isOpen:
|
|
2671
|
-
onClose: () =>
|
|
2672
|
-
date:
|
|
2673
|
-
events:
|
|
2674
|
-
anchorRect:
|
|
2679
|
+
isOpen: W !== null,
|
|
2680
|
+
onClose: () => O(null),
|
|
2681
|
+
date: W?.date ?? /* @__PURE__ */ new Date(),
|
|
2682
|
+
events: W?.events ?? [],
|
|
2683
|
+
anchorRect: W?.rect ?? null,
|
|
2675
2684
|
badgeVariant: a,
|
|
2676
2685
|
onEventClick: i,
|
|
2677
|
-
renderEvent:
|
|
2686
|
+
renderEvent: D,
|
|
2678
2687
|
renderPopover: l
|
|
2679
2688
|
}
|
|
2680
2689
|
)
|
|
@@ -2700,13 +2709,13 @@ function un(t) {
|
|
|
2700
2709
|
for (let s = 0; s < o.length; s++) {
|
|
2701
2710
|
const y = o[s];
|
|
2702
2711
|
if (!y) continue;
|
|
2703
|
-
let
|
|
2712
|
+
let D = !0;
|
|
2704
2713
|
for (let l = a.startCol; l <= a.endCol; l++)
|
|
2705
2714
|
if (y[l]) {
|
|
2706
|
-
|
|
2715
|
+
D = !1;
|
|
2707
2716
|
break;
|
|
2708
2717
|
}
|
|
2709
|
-
if (
|
|
2718
|
+
if (D) {
|
|
2710
2719
|
i = s;
|
|
2711
2720
|
break;
|
|
2712
2721
|
}
|
|
@@ -2727,7 +2736,7 @@ function mn({
|
|
|
2727
2736
|
}) {
|
|
2728
2737
|
const [i, p] = J(!1), s = de(t.event.color), y = L(() => {
|
|
2729
2738
|
o && n ? n(t.event) : o || p(!0);
|
|
2730
|
-
}, [o, n, t.event]),
|
|
2739
|
+
}, [o, n, t.event]), D = L(() => {
|
|
2731
2740
|
p(!1);
|
|
2732
2741
|
}, []), l = /* @__PURE__ */ r(
|
|
2733
2742
|
"button",
|
|
@@ -2759,16 +2768,16 @@ function mn({
|
|
|
2759
2768
|
), b = /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
2760
2769
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.event.title }),
|
|
2761
2770
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t.event) })
|
|
2762
|
-
] }) }),
|
|
2771
|
+
] }) }), k = {
|
|
2763
2772
|
gridColumn: `${t.startCol + 2} / ${t.endCol + 3}`,
|
|
2764
2773
|
gridRow: t.row + 1
|
|
2765
2774
|
};
|
|
2766
|
-
return o ? /* @__PURE__ */ e("div", { style:
|
|
2775
|
+
return o ? /* @__PURE__ */ e("div", { style: k, children: /* @__PURE__ */ r(ie, { children: [
|
|
2767
2776
|
/* @__PURE__ */ e(se, { asChild: !0, children: l }),
|
|
2768
2777
|
b
|
|
2769
|
-
] }) }) : /* @__PURE__ */ e("div", { style:
|
|
2778
|
+
] }) }) : /* @__PURE__ */ e("div", { style: k, children: /* @__PURE__ */ r(re, { open: i, onOpenChange: p, children: [
|
|
2770
2779
|
/* @__PURE__ */ e(oe, { asChild: !0, children: l }),
|
|
2771
|
-
/* @__PURE__ */ e(Q, { className: "w-80", children: a ? a({ event: t.event, onClose:
|
|
2780
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: a ? a({ event: t.event, onClose: D }) : /* @__PURE__ */ e(hn, { event: t.event, onClose: D }) })
|
|
2772
2781
|
] }) });
|
|
2773
2782
|
}
|
|
2774
2783
|
function hn({
|
|
@@ -2818,45 +2827,45 @@ function pn({
|
|
|
2818
2827
|
onEventClick: p,
|
|
2819
2828
|
disablePopover: s = !1,
|
|
2820
2829
|
renderPopover: y,
|
|
2821
|
-
className:
|
|
2830
|
+
className: D
|
|
2822
2831
|
}) {
|
|
2823
2832
|
const l = F(() => {
|
|
2824
2833
|
if (t.length === 0) return [];
|
|
2825
|
-
const v = t.map((
|
|
2826
|
-
const
|
|
2827
|
-
if (
|
|
2828
|
-
const
|
|
2834
|
+
const v = t.map((z) => {
|
|
2835
|
+
const M = tt(z.startDate, n), W = tt(z.endDate, n), O = Math.max(0, M), _ = Math.min(6, W);
|
|
2836
|
+
if (O > 6 || _ < 0) return null;
|
|
2837
|
+
const E = M < 0, T = W > 6, S = De(z) && le(z.startDate, z.endDate);
|
|
2829
2838
|
return {
|
|
2830
|
-
event:
|
|
2831
|
-
startCol:
|
|
2832
|
-
endCol:
|
|
2833
|
-
continuesBefore:
|
|
2834
|
-
continuesAfter:
|
|
2839
|
+
event: z,
|
|
2840
|
+
startCol: O,
|
|
2841
|
+
endCol: _,
|
|
2842
|
+
continuesBefore: E,
|
|
2843
|
+
continuesAfter: T,
|
|
2835
2844
|
isSingleDayAllDay: S
|
|
2836
2845
|
};
|
|
2837
2846
|
}).filter(Boolean);
|
|
2838
2847
|
return un(v);
|
|
2839
2848
|
}, [t, n]);
|
|
2840
2849
|
if (l.length === 0) return null;
|
|
2841
|
-
const b = Math.max(...l.map((v) => v.row)) + 1,
|
|
2850
|
+
const b = Math.max(...l.map((v) => v.row)) + 1, k = Math.min(b, ve), m = b > ve, g = m ? l.filter((v) => v.row >= ve).length : 0, u = [
|
|
2842
2851
|
`${o}px`,
|
|
2843
2852
|
...i.map((v) => v > a ? `${v}px` : `minmax(${a}px, 1fr)`)
|
|
2844
|
-
].join(" "),
|
|
2853
|
+
].join(" "), N = k * Me + (k - 1) * et + 8;
|
|
2845
2854
|
return /* @__PURE__ */ r(
|
|
2846
2855
|
"div",
|
|
2847
2856
|
{
|
|
2848
2857
|
className: d(
|
|
2849
2858
|
"ic-all-day-row border-b bg-muted/20 relative",
|
|
2850
|
-
|
|
2859
|
+
D
|
|
2851
2860
|
),
|
|
2852
2861
|
style: {
|
|
2853
2862
|
display: "grid",
|
|
2854
2863
|
gridTemplateColumns: u,
|
|
2855
|
-
gridTemplateRows: `repeat(${
|
|
2864
|
+
gridTemplateRows: `repeat(${k}, ${Me}px)`,
|
|
2856
2865
|
gap: `${et}px 0`,
|
|
2857
2866
|
paddingTop: 4,
|
|
2858
2867
|
paddingBottom: 4,
|
|
2859
|
-
minHeight:
|
|
2868
|
+
minHeight: N
|
|
2860
2869
|
},
|
|
2861
2870
|
children: [
|
|
2862
2871
|
/* @__PURE__ */ e(
|
|
@@ -2865,18 +2874,18 @@ function pn({
|
|
|
2865
2874
|
className: "flex items-start justify-center pt-1 text-[10px] font-medium text-muted-foreground",
|
|
2866
2875
|
style: {
|
|
2867
2876
|
gridColumn: 1,
|
|
2868
|
-
gridRow: `1 / span ${
|
|
2877
|
+
gridRow: `1 / span ${k}`
|
|
2869
2878
|
},
|
|
2870
2879
|
children: /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: "All day" })
|
|
2871
2880
|
}
|
|
2872
2881
|
),
|
|
2873
|
-
n.map((v,
|
|
2882
|
+
n.map((v, z) => /* @__PURE__ */ e(
|
|
2874
2883
|
"div",
|
|
2875
2884
|
{
|
|
2876
2885
|
className: "pointer-events-none border-r last:border-r-0",
|
|
2877
2886
|
style: {
|
|
2878
|
-
gridColumn:
|
|
2879
|
-
gridRow: `1 / span ${
|
|
2887
|
+
gridColumn: z + 2,
|
|
2888
|
+
gridRow: `1 / span ${k}`
|
|
2880
2889
|
}
|
|
2881
2890
|
},
|
|
2882
2891
|
v.toDateString()
|
|
@@ -2897,7 +2906,7 @@ function pn({
|
|
|
2897
2906
|
className: "text-[10px] text-muted-foreground font-medium px-2 flex items-center",
|
|
2898
2907
|
style: {
|
|
2899
2908
|
gridColumn: `2 / ${n.length + 2}`,
|
|
2900
|
-
gridRow:
|
|
2909
|
+
gridRow: k
|
|
2901
2910
|
},
|
|
2902
2911
|
children: [
|
|
2903
2912
|
"+",
|
|
@@ -2920,76 +2929,76 @@ function Tn({
|
|
|
2920
2929
|
slotDuration: p = 30,
|
|
2921
2930
|
badgeVariant: s = "colored",
|
|
2922
2931
|
onEventClick: y,
|
|
2923
|
-
onSlotSelect:
|
|
2932
|
+
onSlotSelect: D,
|
|
2924
2933
|
onDayClick: l,
|
|
2925
2934
|
className: b,
|
|
2926
|
-
renderEvent:
|
|
2935
|
+
renderEvent: k,
|
|
2927
2936
|
renderPopover: m,
|
|
2928
2937
|
slots: g,
|
|
2929
2938
|
classNames: u
|
|
2930
2939
|
}) {
|
|
2931
|
-
const
|
|
2940
|
+
const N = 60 / p, v = 100 / N, z = F(() => {
|
|
2932
2941
|
const c = [];
|
|
2933
|
-
for (let h = 0; h <
|
|
2942
|
+
for (let h = 0; h < N; h++)
|
|
2934
2943
|
c.push(h * p);
|
|
2935
2944
|
return c;
|
|
2936
|
-
}, [
|
|
2945
|
+
}, [N, p]), M = F(
|
|
2937
2946
|
() => wt(n, o),
|
|
2938
2947
|
[n, o]
|
|
2939
|
-
),
|
|
2948
|
+
), W = F(
|
|
2940
2949
|
() => at(a),
|
|
2941
2950
|
[a]
|
|
2942
|
-
),
|
|
2951
|
+
), O = F(() => {
|
|
2943
2952
|
const c = /* @__PURE__ */ new Map();
|
|
2944
|
-
for (const h of
|
|
2945
|
-
const C = h.toDateString(), H = He(t, h), { singleDay:
|
|
2946
|
-
|
|
2953
|
+
for (const h of M) {
|
|
2954
|
+
const C = h.toDateString(), H = He(t, h), { singleDay: A, multiDay: Y } = rt(H), j = ot(
|
|
2955
|
+
A,
|
|
2947
2956
|
h,
|
|
2948
2957
|
a,
|
|
2949
2958
|
ue
|
|
2950
2959
|
), G = /* @__PURE__ */ new Map();
|
|
2951
2960
|
let U = 1;
|
|
2952
|
-
for (const K of
|
|
2961
|
+
for (const K of j)
|
|
2953
2962
|
if (G.set(K.event.id, K.position), K.position.width > 0) {
|
|
2954
2963
|
const ae = Math.round(100 / K.position.width);
|
|
2955
2964
|
U = Math.max(U, ae);
|
|
2956
2965
|
}
|
|
2957
2966
|
c.set(C, {
|
|
2958
|
-
singleDay:
|
|
2967
|
+
singleDay: A,
|
|
2959
2968
|
multiDay: Y,
|
|
2960
2969
|
positions: G,
|
|
2961
2970
|
maxOverlapping: U
|
|
2962
2971
|
});
|
|
2963
2972
|
}
|
|
2964
2973
|
return c;
|
|
2965
|
-
}, [
|
|
2974
|
+
}, [M, t, a]), _ = F(() => {
|
|
2966
2975
|
const c = /* @__PURE__ */ new Map();
|
|
2967
|
-
for (const { multiDay: h } of
|
|
2976
|
+
for (const { multiDay: h } of O.values())
|
|
2968
2977
|
for (const C of h)
|
|
2969
2978
|
c.set(C.id, C);
|
|
2970
2979
|
return Array.from(c.values());
|
|
2971
|
-
}, [
|
|
2972
|
-
if (
|
|
2973
|
-
const c =
|
|
2980
|
+
}, [O]), E = /* @__PURE__ */ new Date(), T = M.findIndex((c) => ce(c)), I = F(() => {
|
|
2981
|
+
if (T < 0) return -1;
|
|
2982
|
+
const c = E.getHours() + E.getMinutes() / 60;
|
|
2974
2983
|
return c < a.startHour || c > a.endHour ? -1 : (c - a.startHour) * ue;
|
|
2975
|
-
}, [
|
|
2984
|
+
}, [T, a, E]), S = te(null);
|
|
2976
2985
|
Ie(() => {
|
|
2977
2986
|
const c = S.current;
|
|
2978
2987
|
if (!c) return;
|
|
2979
2988
|
const h = () => {
|
|
2980
2989
|
let C;
|
|
2981
|
-
if (
|
|
2982
|
-
const
|
|
2983
|
-
C = Math.max(
|
|
2990
|
+
if (T !== -1) {
|
|
2991
|
+
const A = (/* @__PURE__ */ new Date()).getHours();
|
|
2992
|
+
C = Math.max(A - 1, a.startHour);
|
|
2984
2993
|
} else {
|
|
2985
2994
|
const Y = (/* @__PURE__ */ new Date()).getDay();
|
|
2986
|
-
let
|
|
2987
|
-
if (!
|
|
2995
|
+
let j = i?.[Y];
|
|
2996
|
+
if (!j?.enabled || j.from === 0) {
|
|
2988
2997
|
const G = i?.[1];
|
|
2989
|
-
G?.enabled && (
|
|
2998
|
+
G?.enabled && (j = G);
|
|
2990
2999
|
}
|
|
2991
|
-
|
|
2992
|
-
|
|
3000
|
+
j?.enabled && j.from > 0 ? C = Math.max(
|
|
3001
|
+
j.from - 1,
|
|
2993
3002
|
a.startHour
|
|
2994
3003
|
) : C = Math.max(7, a.startHour);
|
|
2995
3004
|
}
|
|
@@ -3002,8 +3011,8 @@ function Tn({
|
|
|
3002
3011
|
requestAnimationFrame(() => {
|
|
3003
3012
|
requestAnimationFrame(h);
|
|
3004
3013
|
});
|
|
3005
|
-
}, [n, i, a,
|
|
3006
|
-
const $ =
|
|
3014
|
+
}, [n, i, a, T]);
|
|
3015
|
+
const $ = Oe(), q = L(
|
|
3007
3016
|
(c) => {
|
|
3008
3017
|
$?.startSelection(c);
|
|
3009
3018
|
},
|
|
@@ -3022,20 +3031,20 @@ function Tn({
|
|
|
3022
3031
|
[y]
|
|
3023
3032
|
), R = ge + 7 * Z, P = F(() => {
|
|
3024
3033
|
const c = [];
|
|
3025
|
-
for (const h of
|
|
3026
|
-
const C = h.toDateString(),
|
|
3027
|
-
|
|
3028
|
-
Math.max(Z,
|
|
3034
|
+
for (const h of M) {
|
|
3035
|
+
const C = h.toDateString(), A = O.get(C)?.maxOverlapping ?? 1;
|
|
3036
|
+
A > fn ? c.push(
|
|
3037
|
+
Math.max(Z, A * Ne)
|
|
3029
3038
|
) : c.push(Z);
|
|
3030
3039
|
}
|
|
3031
3040
|
return c;
|
|
3032
|
-
}, [
|
|
3041
|
+
}, [M, O]), w = ge + P.reduce((c, h) => c + h, 0);
|
|
3033
3042
|
return /* @__PURE__ */ r("div", { className: d("ic-week-view flex flex-col h-full", b), children: [
|
|
3034
|
-
|
|
3043
|
+
_.length > 0 && /* @__PURE__ */ e(
|
|
3035
3044
|
pn,
|
|
3036
3045
|
{
|
|
3037
|
-
events:
|
|
3038
|
-
weekDays:
|
|
3046
|
+
events: _,
|
|
3047
|
+
weekDays: M,
|
|
3039
3048
|
hourColumnWidth: ge,
|
|
3040
3049
|
minDayColumnWidth: Z,
|
|
3041
3050
|
dayColumnWidths: P,
|
|
@@ -3055,7 +3064,7 @@ function Tn({
|
|
|
3055
3064
|
"ic-week-scroll-container flex-1",
|
|
3056
3065
|
u?.scrollContainer
|
|
3057
3066
|
),
|
|
3058
|
-
children: /* @__PURE__ */ r("div", { style: { minWidth: Math.max(R,
|
|
3067
|
+
children: /* @__PURE__ */ r("div", { style: { minWidth: Math.max(R, w) }, children: [
|
|
3059
3068
|
/* @__PURE__ */ e("div", { className: "ic-week-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */ r("div", { className: "flex", children: [
|
|
3060
3069
|
/* @__PURE__ */ e(
|
|
3061
3070
|
"div",
|
|
@@ -3071,8 +3080,8 @@ function Tn({
|
|
|
3071
3080
|
] })
|
|
3072
3081
|
}
|
|
3073
3082
|
),
|
|
3074
|
-
|
|
3075
|
-
const C = ce(c), H = P[h] ?? Z,
|
|
3083
|
+
M.map((c, h) => {
|
|
3084
|
+
const C = ce(c), H = P[h] ?? Z, A = H > Z;
|
|
3076
3085
|
return /* @__PURE__ */ r(
|
|
3077
3086
|
"div",
|
|
3078
3087
|
{
|
|
@@ -3083,7 +3092,7 @@ function Tn({
|
|
|
3083
3092
|
),
|
|
3084
3093
|
style: {
|
|
3085
3094
|
height: nt,
|
|
3086
|
-
minWidth:
|
|
3095
|
+
minWidth: A ? H : Z
|
|
3087
3096
|
},
|
|
3088
3097
|
children: [
|
|
3089
3098
|
/* @__PURE__ */ e(
|
|
@@ -3124,7 +3133,7 @@ function Tn({
|
|
|
3124
3133
|
u?.timeGutter
|
|
3125
3134
|
),
|
|
3126
3135
|
style: { width: ge },
|
|
3127
|
-
children:
|
|
3136
|
+
children: W.map((c, h) => /* @__PURE__ */ e(
|
|
3128
3137
|
"div",
|
|
3129
3138
|
{
|
|
3130
3139
|
className: "relative",
|
|
@@ -3144,20 +3153,20 @@ function Tn({
|
|
|
3144
3153
|
))
|
|
3145
3154
|
}
|
|
3146
3155
|
),
|
|
3147
|
-
/* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children:
|
|
3148
|
-
const C = c.toDateString(), H =
|
|
3156
|
+
/* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children: M.map((c, h) => {
|
|
3157
|
+
const C = c.toDateString(), H = O.get(C), A = P[h] ?? Z, Y = A > Z;
|
|
3149
3158
|
return /* @__PURE__ */ r(
|
|
3150
3159
|
"div",
|
|
3151
3160
|
{
|
|
3152
3161
|
className: "ic-day-column relative flex-1",
|
|
3153
3162
|
style: {
|
|
3154
|
-
minWidth: Y ?
|
|
3163
|
+
minWidth: Y ? A : Z
|
|
3155
3164
|
},
|
|
3156
3165
|
children: [
|
|
3157
|
-
|
|
3166
|
+
W.map((j, G) => {
|
|
3158
3167
|
const K = !it(
|
|
3159
3168
|
c,
|
|
3160
|
-
|
|
3169
|
+
j,
|
|
3161
3170
|
i
|
|
3162
3171
|
);
|
|
3163
3172
|
return /* @__PURE__ */ r(
|
|
@@ -3173,7 +3182,7 @@ function Tn({
|
|
|
3173
3182
|
style: { height: ue },
|
|
3174
3183
|
children: [
|
|
3175
3184
|
G !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
|
|
3176
|
-
|
|
3185
|
+
z.slice(1).map((ae) => /* @__PURE__ */ e(
|
|
3177
3186
|
"div",
|
|
3178
3187
|
{
|
|
3179
3188
|
className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
|
|
@@ -3181,10 +3190,10 @@ function Tn({
|
|
|
3181
3190
|
},
|
|
3182
3191
|
ae
|
|
3183
3192
|
)),
|
|
3184
|
-
|
|
3193
|
+
z.map((ae, ht) => {
|
|
3185
3194
|
const Ve = {
|
|
3186
3195
|
date: c,
|
|
3187
|
-
hour:
|
|
3196
|
+
hour: j,
|
|
3188
3197
|
minute: ae
|
|
3189
3198
|
};
|
|
3190
3199
|
return /* @__PURE__ */ e(
|
|
@@ -3202,21 +3211,21 @@ function Tn({
|
|
|
3202
3211
|
top: `${ht * v}%`,
|
|
3203
3212
|
height: `${v}%`
|
|
3204
3213
|
},
|
|
3205
|
-
ariaLabel: `Add event on ${c.toLocaleDateString()} at ${Ce(
|
|
3214
|
+
ariaLabel: `Add event on ${c.toLocaleDateString()} at ${Ce(j)}:${String(ae).padStart(2, "0")}`
|
|
3206
3215
|
},
|
|
3207
3216
|
ae
|
|
3208
3217
|
);
|
|
3209
3218
|
})
|
|
3210
3219
|
]
|
|
3211
3220
|
},
|
|
3212
|
-
|
|
3221
|
+
j
|
|
3213
3222
|
);
|
|
3214
3223
|
}),
|
|
3215
|
-
H?.singleDay.map((
|
|
3216
|
-
const G = H.positions.get(
|
|
3224
|
+
H?.singleDay.map((j) => {
|
|
3225
|
+
const G = H.positions.get(j.id);
|
|
3217
3226
|
if (!G) return null;
|
|
3218
3227
|
const U = `calc(${G.width}% - 2px)`, K = `max(${Ne}px, ${U})`;
|
|
3219
|
-
return
|
|
3228
|
+
return k ? /* @__PURE__ */ e(
|
|
3220
3229
|
"div",
|
|
3221
3230
|
{
|
|
3222
3231
|
className: "absolute pointer-events-auto p-0.5",
|
|
@@ -3226,13 +3235,13 @@ function Tn({
|
|
|
3226
3235
|
width: K,
|
|
3227
3236
|
minWidth: `${Ne}px`
|
|
3228
3237
|
},
|
|
3229
|
-
children:
|
|
3238
|
+
children: k({ event: j, position: G })
|
|
3230
3239
|
},
|
|
3231
|
-
|
|
3240
|
+
j.id
|
|
3232
3241
|
) : /* @__PURE__ */ e(
|
|
3233
3242
|
lt,
|
|
3234
3243
|
{
|
|
3235
|
-
event:
|
|
3244
|
+
event: j,
|
|
3236
3245
|
position: {
|
|
3237
3246
|
top: G.top,
|
|
3238
3247
|
left: G.left,
|
|
@@ -3249,10 +3258,10 @@ function Tn({
|
|
|
3249
3258
|
u?.eventCard
|
|
3250
3259
|
)
|
|
3251
3260
|
},
|
|
3252
|
-
|
|
3261
|
+
j.id
|
|
3253
3262
|
);
|
|
3254
3263
|
}),
|
|
3255
|
-
h ===
|
|
3264
|
+
h === T && I >= 0 && /* @__PURE__ */ r(
|
|
3256
3265
|
"div",
|
|
3257
3266
|
{
|
|
3258
3267
|
className: d(
|
|
@@ -3305,8 +3314,8 @@ export {
|
|
|
3305
3314
|
de as p,
|
|
3306
3315
|
Xe as q,
|
|
3307
3316
|
Ye as r,
|
|
3308
|
-
|
|
3317
|
+
_e as s,
|
|
3309
3318
|
Be as t,
|
|
3310
3319
|
Pt as u
|
|
3311
3320
|
};
|
|
3312
|
-
//# sourceMappingURL=week-view-
|
|
3321
|
+
//# sourceMappingURL=week-view-BvwBOdd6.js.map
|