@innosolutions/inno-calendar 1.0.35 → 1.0.37
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-CyRPG-1p.js → agenda-widget-BKIaXFpN.js} +723 -745
- package/dist/agenda-widget-BKIaXFpN.js.map +1 -0
- package/dist/agenda-widget-BtTvMs9i.cjs +2 -0
- package/dist/agenda-widget-BtTvMs9i.cjs.map +1 -0
- package/dist/components/event/event-card.d.ts +1 -0
- package/dist/components/event/event-card.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/components/views/timeline-view.d.ts.map +1 -1
- package/dist/core/utils/position-utils.d.ts +5 -1
- package/dist/core/utils/position-utils.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-BaJAw6io.cjs → tailwind-calendar-3IAm_TdP.cjs} +2 -2
- package/dist/{tailwind-calendar-BaJAw6io.cjs.map → tailwind-calendar-3IAm_TdP.cjs.map} +1 -1
- package/dist/{tailwind-calendar-D-8ALvNh.js → tailwind-calendar-B3HuJrjX.js} +2 -2
- package/dist/{tailwind-calendar-D-8ALvNh.js.map → tailwind-calendar-B3HuJrjX.js.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.mjs +334 -326
- package/dist/utils.mjs.map +1 -1
- package/dist/{week-view-5nw-Hvod.js → week-view-1EUqFIRS.js} +433 -417
- package/dist/week-view-1EUqFIRS.js.map +1 -0
- package/dist/{week-view-C0iWG7_6.cjs → week-view-DXilsY50.cjs} +3 -3
- package/dist/week-view-DXilsY50.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/agenda-widget-CuQxfYVI.cjs +0 -2
- package/dist/agenda-widget-CuQxfYVI.cjs.map +0 -1
- package/dist/agenda-widget-CyRPG-1p.js.map +0 -1
- package/dist/week-view-5nw-Hvod.js.map +0 -1
- package/dist/week-view-C0iWG7_6.cjs.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import * as Y from "react";
|
|
3
3
|
import { useState as oe, useCallback as M, forwardRef as ze, createElement as De, useMemo as V, useRef as se, useEffect as it, useLayoutEffect as qe } from "react";
|
|
4
4
|
import { c as l, a as st } from "./index-DtaLkIY8.js";
|
|
5
5
|
import * as H from "@radix-ui/react-dropdown-menu";
|
|
6
|
-
import { getEventsCountInView as lt, getRangeText as dt, groupEventsByDate as ct, isToday as te, isSameDay as
|
|
7
|
-
import { a as We, b as
|
|
6
|
+
import { getEventsCountInView as lt, getRangeText as dt, groupEventsByDate as ct, isToday as te, isSameDay as Ae, getEventsForDay as Le, separateEventsByDuration as Ke, calculateOverlappingPositions as Ye, getVisibleHoursArray as Xe, isWorkingHour as Je, formatHourLabel as we, generateMonthGrid as ut, getWeekDays as mt, startOfWeek as ht } from "./utils.mjs";
|
|
7
|
+
import { a as We, b as _e } from "./slot-selection-context-D2eu2o-7.js";
|
|
8
8
|
import * as ue from "@radix-ui/react-popover";
|
|
9
9
|
import * as pe from "@radix-ui/react-tooltip";
|
|
10
|
-
const
|
|
10
|
+
const re = ue.Root, ne = ue.Trigger, ar = ue.Anchor, Q = Y.forwardRef(({ className: t, align: r = "center", sideOffset: o = 4, ...a }, d) => /* @__PURE__ */ e(ue.Portal, { children: /* @__PURE__ */ e(
|
|
11
11
|
ue.Content,
|
|
12
12
|
{
|
|
13
13
|
ref: d,
|
|
14
|
-
align:
|
|
14
|
+
align: r,
|
|
15
15
|
sideOffset: o,
|
|
16
16
|
className: l(
|
|
17
17
|
"z-50 w-72 rounded-xl border bg-white text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
@@ -21,11 +21,11 @@ const ne = ue.Root, re = ue.Trigger, an = ue.Anchor, Q = Y.forwardRef(({ classNa
|
|
|
21
21
|
}
|
|
22
22
|
) }));
|
|
23
23
|
Q.displayName = ue.Content.displayName;
|
|
24
|
-
const
|
|
24
|
+
const ir = pe.Provider, le = pe.Root, de = pe.Trigger, ee = Y.forwardRef(({ className: t, sideOffset: r = 4, ...o }, a) => /* @__PURE__ */ e(
|
|
25
25
|
pe.Content,
|
|
26
26
|
{
|
|
27
27
|
ref: a,
|
|
28
|
-
sideOffset:
|
|
28
|
+
sideOffset: r,
|
|
29
29
|
className: l(
|
|
30
30
|
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
31
31
|
t
|
|
@@ -41,70 +41,80 @@ function fe(t) {
|
|
|
41
41
|
text: "text-blue-700 dark:text-blue-300",
|
|
42
42
|
dot: "bg-blue-500",
|
|
43
43
|
dotFill: "fill-blue-600 dark:fill-blue-500",
|
|
44
|
-
border: "border-blue-400 dark:border-blue-600"
|
|
44
|
+
border: "border-blue-400 dark:border-blue-600",
|
|
45
|
+
accentBorder: "border-l-blue-500 dark:border-l-blue-400"
|
|
45
46
|
},
|
|
46
47
|
green: {
|
|
47
48
|
bg: "bg-green-50 dark:bg-green-950/30",
|
|
48
49
|
text: "text-green-700 dark:text-green-300",
|
|
49
50
|
dot: "bg-green-500",
|
|
50
51
|
dotFill: "fill-green-600 dark:fill-green-500",
|
|
51
|
-
border: "border-green-400 dark:border-green-600"
|
|
52
|
+
border: "border-green-400 dark:border-green-600",
|
|
53
|
+
accentBorder: "border-l-green-500 dark:border-l-green-400"
|
|
52
54
|
},
|
|
53
55
|
red: {
|
|
54
56
|
bg: "bg-red-50 dark:bg-red-950/30",
|
|
55
57
|
text: "text-red-700 dark:text-red-300",
|
|
56
58
|
dot: "bg-red-500",
|
|
57
59
|
dotFill: "fill-red-600 dark:fill-red-500",
|
|
58
|
-
border: "border-red-400 dark:border-red-600"
|
|
60
|
+
border: "border-red-400 dark:border-red-600",
|
|
61
|
+
accentBorder: "border-l-red-500 dark:border-l-red-400"
|
|
59
62
|
},
|
|
60
63
|
yellow: {
|
|
61
64
|
bg: "bg-yellow-50 dark:bg-yellow-950/30",
|
|
62
65
|
text: "text-yellow-700 dark:text-yellow-300",
|
|
63
66
|
dot: "bg-yellow-500",
|
|
64
67
|
dotFill: "fill-yellow-600 dark:fill-yellow-500",
|
|
65
|
-
border: "border-yellow-400 dark:border-yellow-600"
|
|
68
|
+
border: "border-yellow-400 dark:border-yellow-600",
|
|
69
|
+
accentBorder: "border-l-yellow-500 dark:border-l-yellow-400"
|
|
66
70
|
},
|
|
67
71
|
purple: {
|
|
68
72
|
bg: "bg-purple-50 dark:bg-purple-950/30",
|
|
69
73
|
text: "text-purple-700 dark:text-purple-300",
|
|
70
74
|
dot: "bg-purple-500",
|
|
71
75
|
dotFill: "fill-purple-600 dark:fill-purple-500",
|
|
72
|
-
border: "border-purple-400 dark:border-purple-600"
|
|
76
|
+
border: "border-purple-400 dark:border-purple-600",
|
|
77
|
+
accentBorder: "border-l-purple-500 dark:border-l-purple-400"
|
|
73
78
|
},
|
|
74
79
|
orange: {
|
|
75
80
|
bg: "bg-orange-50 dark:bg-orange-950/30",
|
|
76
81
|
text: "text-orange-700 dark:text-orange-300",
|
|
77
82
|
dot: "bg-orange-500",
|
|
78
83
|
dotFill: "fill-orange-600 dark:fill-orange-500",
|
|
79
|
-
border: "border-orange-400 dark:border-orange-600"
|
|
84
|
+
border: "border-orange-400 dark:border-orange-600",
|
|
85
|
+
accentBorder: "border-l-orange-500 dark:border-l-orange-400"
|
|
80
86
|
},
|
|
81
87
|
pink: {
|
|
82
88
|
bg: "bg-pink-50 dark:bg-pink-950/30",
|
|
83
89
|
text: "text-pink-700 dark:text-pink-300",
|
|
84
90
|
dot: "bg-pink-500",
|
|
85
91
|
dotFill: "fill-pink-600 dark:fill-pink-500",
|
|
86
|
-
border: "border-pink-400 dark:border-pink-600"
|
|
92
|
+
border: "border-pink-400 dark:border-pink-600",
|
|
93
|
+
accentBorder: "border-l-pink-500 dark:border-l-pink-400"
|
|
87
94
|
},
|
|
88
95
|
teal: {
|
|
89
96
|
bg: "bg-teal-50 dark:bg-teal-950/30",
|
|
90
97
|
text: "text-teal-700 dark:text-teal-300",
|
|
91
98
|
dot: "bg-teal-500",
|
|
92
99
|
dotFill: "fill-teal-600 dark:fill-teal-500",
|
|
93
|
-
border: "border-teal-400 dark:border-teal-600"
|
|
100
|
+
border: "border-teal-400 dark:border-teal-600",
|
|
101
|
+
accentBorder: "border-l-teal-500 dark:border-l-teal-400"
|
|
94
102
|
},
|
|
95
103
|
gray: {
|
|
96
104
|
bg: "bg-gray-50 dark:bg-gray-950/30",
|
|
97
105
|
text: "text-gray-700 dark:text-gray-300",
|
|
98
106
|
dot: "bg-gray-500",
|
|
99
107
|
dotFill: "fill-gray-600 dark:fill-gray-500",
|
|
100
|
-
border: "border-gray-400 dark:border-gray-600"
|
|
108
|
+
border: "border-gray-400 dark:border-gray-600",
|
|
109
|
+
accentBorder: "border-l-gray-500 dark:border-l-gray-400"
|
|
101
110
|
},
|
|
102
111
|
indigo: {
|
|
103
112
|
bg: "bg-indigo-50 dark:bg-indigo-950/30",
|
|
104
113
|
text: "text-indigo-700 dark:text-indigo-300",
|
|
105
114
|
dot: "bg-indigo-500",
|
|
106
115
|
dotFill: "fill-indigo-600 dark:fill-indigo-500",
|
|
107
|
-
border: "border-indigo-400 dark:border-indigo-600"
|
|
116
|
+
border: "border-indigo-400 dark:border-indigo-600",
|
|
117
|
+
accentBorder: "border-l-indigo-500 dark:border-l-indigo-400"
|
|
108
118
|
}
|
|
109
119
|
}[t ?? "blue"];
|
|
110
120
|
}
|
|
@@ -115,16 +125,16 @@ function ve(t) {
|
|
|
115
125
|
hour12: !1
|
|
116
126
|
});
|
|
117
127
|
}
|
|
118
|
-
function Z(t,
|
|
119
|
-
return `${ve(t)} - ${ve(
|
|
128
|
+
function Z(t, r) {
|
|
129
|
+
return `${ve(t)} - ${ve(r)}`;
|
|
120
130
|
}
|
|
121
|
-
function
|
|
122
|
-
const
|
|
123
|
-
return
|
|
131
|
+
function Ee(t) {
|
|
132
|
+
const r = new Date(t);
|
|
133
|
+
return r.setHours(0, 0, 0, 0), r;
|
|
124
134
|
}
|
|
125
135
|
function Ce({
|
|
126
136
|
event: t,
|
|
127
|
-
variant:
|
|
137
|
+
variant: r = "full",
|
|
128
138
|
badgeVariant: o = "colored",
|
|
129
139
|
onClick: a,
|
|
130
140
|
className: d,
|
|
@@ -136,24 +146,24 @@ function Ce({
|
|
|
136
146
|
renderPopover: y,
|
|
137
147
|
enableDrag: L = !1
|
|
138
148
|
}) {
|
|
139
|
-
const i = fe(t.color), [v, h] = oe(!1), [w,
|
|
149
|
+
const i = fe(t.color), [v, h] = oe(!1), [w, E] = oe(!1), W = We(), D = t.endDate < Ee(/* @__PURE__ */ new Date()), x = t.isCanceled ?? !1, O = L && W && !x && !D, P = t.data, j = P?.meetingTookPlace ?? t.meetingTookPlace ?? !1, B = x ? /* @__PURE__ */ e(ft, { className: "h-3 w-3 text-zinc-800 dark:text-zinc-200" }) : j ? /* @__PURE__ */ e(pt, { className: l("h-3 w-3", i.text) }) : null, F = t.scheduleTypeName || P?.scheduleTypeName || P?.typeName, u = P?.productName, k = P?.nrParticipant, I = P?.siteName, m = P?.siteCity, _ = [I, m].filter(Boolean).join(", "), $ = M(() => {
|
|
140
150
|
w || (p && a ? a(t) : p || h(!0));
|
|
141
151
|
}, [w, p, a, t]), N = M(() => {
|
|
142
152
|
h(!1);
|
|
143
153
|
}, []), G = M(
|
|
144
154
|
(f) => {
|
|
145
|
-
O && (f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/plain", t.id),
|
|
155
|
+
O && (f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/plain", t.id), E(!0), W?.startDrag?.(t));
|
|
146
156
|
},
|
|
147
157
|
[O, t, W]
|
|
148
158
|
), C = M(() => {
|
|
149
|
-
|
|
159
|
+
E(!1), W?.isDragging && W.endDrag?.();
|
|
150
160
|
}, [W]);
|
|
151
|
-
if (
|
|
161
|
+
if (r === "dot") {
|
|
152
162
|
const f = /* @__PURE__ */ e(
|
|
153
163
|
"button",
|
|
154
164
|
{
|
|
155
165
|
type: "button",
|
|
156
|
-
onClick:
|
|
166
|
+
onClick: $,
|
|
157
167
|
className: l(
|
|
158
168
|
"size-2 rounded-full cursor-pointer transition-opacity",
|
|
159
169
|
D ? "bg-gray-400" : i.dot,
|
|
@@ -164,22 +174,22 @@ function Ce({
|
|
|
164
174
|
"aria-label": t.title
|
|
165
175
|
}
|
|
166
176
|
);
|
|
167
|
-
return p ? /* @__PURE__ */
|
|
177
|
+
return p ? /* @__PURE__ */ n(le, { children: [
|
|
168
178
|
/* @__PURE__ */ e(de, { asChild: !0, children: f }),
|
|
169
|
-
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
170
180
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
171
181
|
/* @__PURE__ */ e("div", { className: "text-xs opacity-80", children: Z(t.startDate, t.endDate) })
|
|
172
182
|
] }) })
|
|
173
|
-
] }) : /* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */ e(
|
|
183
|
+
] }) : /* @__PURE__ */ n(re, { open: v, onOpenChange: h, children: [
|
|
184
|
+
/* @__PURE__ */ e(ne, { asChild: !0, children: /* @__PURE__ */ n(le, { children: [
|
|
175
185
|
/* @__PURE__ */ e(de, { asChild: !0, children: f }),
|
|
176
186
|
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e("div", { className: "font-medium", children: t.title }) })
|
|
177
187
|
] }) }),
|
|
178
188
|
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: N }) : /* @__PURE__ */ e(he, { event: t, onClose: N }) })
|
|
179
189
|
] });
|
|
180
190
|
}
|
|
181
|
-
if (
|
|
182
|
-
const f = /* @__PURE__ */
|
|
191
|
+
if (r === "compact") {
|
|
192
|
+
const f = /* @__PURE__ */ n(
|
|
183
193
|
"div",
|
|
184
194
|
{
|
|
185
195
|
role: "button",
|
|
@@ -187,9 +197,9 @@ function Ce({
|
|
|
187
197
|
draggable: !!O,
|
|
188
198
|
onDragStart: G,
|
|
189
199
|
onDragEnd: C,
|
|
190
|
-
onClick: p ?
|
|
200
|
+
onClick: p ? $ : void 0,
|
|
191
201
|
onKeyDown: (S) => {
|
|
192
|
-
(S.key === "Enter" || S.key === " ") && (S.preventDefault(),
|
|
202
|
+
(S.key === "Enter" || S.key === " ") && (S.preventDefault(), $());
|
|
193
203
|
},
|
|
194
204
|
className: l(
|
|
195
205
|
"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",
|
|
@@ -218,7 +228,7 @@ function Ce({
|
|
|
218
228
|
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: i.dotFill })
|
|
219
229
|
}
|
|
220
230
|
),
|
|
221
|
-
/* @__PURE__ */ e("span", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ e("span", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ n("span", { className: "", children: [
|
|
222
232
|
/* @__PURE__ */ e(
|
|
223
233
|
"span",
|
|
224
234
|
{
|
|
@@ -227,7 +237,7 @@ function Ce({
|
|
|
227
237
|
maskImage: "linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)",
|
|
228
238
|
WebkitMaskImage: "linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)"
|
|
229
239
|
},
|
|
230
|
-
children: /* @__PURE__ */
|
|
240
|
+
children: /* @__PURE__ */ n("span", { className: "inline-flex event-marquee", children: [
|
|
231
241
|
/* @__PURE__ */ e("span", { className: "shrink-0 px-1", children: t.title }),
|
|
232
242
|
/* @__PURE__ */ e("span", { className: "shrink-0 px-1", children: "•" }),
|
|
233
243
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", className: "shrink-0 px-1", children: t.title }),
|
|
@@ -246,50 +256,51 @@ function Ce({
|
|
|
246
256
|
}
|
|
247
257
|
)
|
|
248
258
|
] }) }),
|
|
249
|
-
/* @__PURE__ */ e("div", { className: "flex gap-0.5", children:
|
|
259
|
+
/* @__PURE__ */ e("div", { className: "flex gap-0.5", children: B })
|
|
250
260
|
]
|
|
251
261
|
}
|
|
252
262
|
);
|
|
253
|
-
return p ? /* @__PURE__ */
|
|
263
|
+
return p ? /* @__PURE__ */ n(le, { children: [
|
|
254
264
|
/* @__PURE__ */ e(de, { asChild: !0, children: f }),
|
|
255
|
-
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
256
266
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
257
267
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: Z(t.startDate, t.endDate) })
|
|
258
268
|
] }) })
|
|
259
|
-
] }) : /* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */ e(
|
|
269
|
+
] }) : /* @__PURE__ */ n(re, { open: v, onOpenChange: h, children: [
|
|
270
|
+
/* @__PURE__ */ e(ne, { asChild: !0, children: f }),
|
|
261
271
|
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: N }) : /* @__PURE__ */ e(he, { event: t, onClose: N }) })
|
|
262
272
|
] });
|
|
263
273
|
}
|
|
264
|
-
const s = /* @__PURE__ */
|
|
274
|
+
const s = /* @__PURE__ */ n(
|
|
265
275
|
"button",
|
|
266
276
|
{
|
|
267
277
|
type: "button",
|
|
268
|
-
onClick:
|
|
278
|
+
onClick: $,
|
|
269
279
|
className: l(
|
|
270
|
-
"group relative flex w-full flex-col gap-1 rounded-md border px-2 py-1.5 text-left transition-all
|
|
280
|
+
"group relative flex w-full flex-col gap-1 rounded-md border-l-[3px] px-2 py-1.5 text-left transition-all",
|
|
281
|
+
"shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]",
|
|
271
282
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
272
283
|
// Cancelled events get gray background with strikethrough
|
|
273
284
|
x || // Past events get neutral zinc styling with strikethrough
|
|
274
|
-
D ? "bg-zinc-100 dark:bg-zinc-800 border-zinc-
|
|
285
|
+
D ? "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" : [
|
|
275
286
|
o === "colored" && [
|
|
276
287
|
i.bg,
|
|
277
|
-
i.
|
|
288
|
+
i.accentBorder,
|
|
278
289
|
i.text
|
|
279
290
|
],
|
|
280
291
|
o === "mixed" && [
|
|
281
292
|
i.bg,
|
|
282
|
-
i.
|
|
293
|
+
i.accentBorder,
|
|
283
294
|
i.text
|
|
284
295
|
],
|
|
285
|
-
o === "dot" && "bg-muted/50 border-border"
|
|
296
|
+
o === "dot" && "bg-muted/50 border-l-neutral-400 dark:border-l-neutral-600"
|
|
286
297
|
],
|
|
287
298
|
d
|
|
288
299
|
),
|
|
289
300
|
style: z,
|
|
290
301
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-1", children: [
|
|
303
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
293
304
|
["dot", "mixed"].includes(o) && !D && !x && /* @__PURE__ */ e(
|
|
294
305
|
"svg",
|
|
295
306
|
{
|
|
@@ -302,7 +313,7 @@ function Ce({
|
|
|
302
313
|
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: i.dotFill })
|
|
303
314
|
}
|
|
304
315
|
),
|
|
305
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ n(
|
|
306
317
|
"span",
|
|
307
318
|
{
|
|
308
319
|
className: l(
|
|
@@ -312,7 +323,7 @@ function Ce({
|
|
|
312
323
|
),
|
|
313
324
|
children: [
|
|
314
325
|
t.title,
|
|
315
|
-
F && /* @__PURE__ */
|
|
326
|
+
F && /* @__PURE__ */ n("span", { className: "font-normal opacity-75", children: [
|
|
316
327
|
" ",
|
|
317
328
|
"- ",
|
|
318
329
|
F
|
|
@@ -321,46 +332,46 @@ function Ce({
|
|
|
321
332
|
}
|
|
322
333
|
)
|
|
323
334
|
] }),
|
|
324
|
-
|
|
335
|
+
B
|
|
325
336
|
] }),
|
|
326
337
|
u && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: u }),
|
|
327
|
-
k != null && /* @__PURE__ */
|
|
338
|
+
k != null && /* @__PURE__ */ n("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
328
339
|
/* @__PURE__ */ e(Se, { className: "h-3 w-3 shrink-0" }),
|
|
329
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ n("span", { children: [
|
|
330
341
|
k,
|
|
331
342
|
" participant",
|
|
332
343
|
k !== 1 ? "s" : ""
|
|
333
344
|
] })
|
|
334
345
|
] }),
|
|
335
|
-
g && /* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */ e(
|
|
346
|
+
g && /* @__PURE__ */ n("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
347
|
+
/* @__PURE__ */ e(Be, { className: "h-3 w-3 shrink-0" }),
|
|
337
348
|
/* @__PURE__ */ e("span", { children: Z(t.startDate, t.endDate) })
|
|
338
349
|
] }),
|
|
339
|
-
|
|
350
|
+
_ && /* @__PURE__ */ n("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
340
351
|
/* @__PURE__ */ e(Ze, { className: "h-3 w-3 shrink-0" }),
|
|
341
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
352
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: _ })
|
|
342
353
|
] }),
|
|
343
354
|
c && t.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: t.description }),
|
|
344
|
-
b && t.participants && t.participants.length > 0 && /* @__PURE__ */
|
|
355
|
+
b && t.participants && t.participants.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
345
356
|
/* @__PURE__ */ e(Se, { className: "h-3 w-3 shrink-0" }),
|
|
346
357
|
/* @__PURE__ */ e("span", { className: "truncate", children: t.participants.map((f) => f.name).join(", ") })
|
|
347
358
|
] })
|
|
348
359
|
]
|
|
349
360
|
}
|
|
350
361
|
);
|
|
351
|
-
return p ? /* @__PURE__ */
|
|
362
|
+
return p ? /* @__PURE__ */ n(le, { children: [
|
|
352
363
|
/* @__PURE__ */ e(de, { asChild: !0, children: s }),
|
|
353
|
-
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
354
365
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
355
366
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: Z(t.startDate, t.endDate) })
|
|
356
367
|
] }) })
|
|
357
|
-
] }) : /* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */ e(
|
|
368
|
+
] }) : /* @__PURE__ */ n(re, { open: v, onOpenChange: h, children: [
|
|
369
|
+
/* @__PURE__ */ e(ne, { asChild: !0, children: s }),
|
|
359
370
|
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: N }) : /* @__PURE__ */ e(he, { event: t, onClose: N }) })
|
|
360
371
|
] });
|
|
361
372
|
}
|
|
362
|
-
function
|
|
363
|
-
return /* @__PURE__ */
|
|
373
|
+
function Be({ className: t }) {
|
|
374
|
+
return /* @__PURE__ */ n(
|
|
364
375
|
"svg",
|
|
365
376
|
{
|
|
366
377
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -395,7 +406,7 @@ function pt({ className: t }) {
|
|
|
395
406
|
);
|
|
396
407
|
}
|
|
397
408
|
function ft({ className: t }) {
|
|
398
|
-
return /* @__PURE__ */
|
|
409
|
+
return /* @__PURE__ */ n(
|
|
399
410
|
"svg",
|
|
400
411
|
{
|
|
401
412
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -414,7 +425,7 @@ function ft({ className: t }) {
|
|
|
414
425
|
);
|
|
415
426
|
}
|
|
416
427
|
function Se({ className: t }) {
|
|
417
|
-
return /* @__PURE__ */
|
|
428
|
+
return /* @__PURE__ */ n(
|
|
418
429
|
"svg",
|
|
419
430
|
{
|
|
420
431
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -435,7 +446,7 @@ function Se({ className: t }) {
|
|
|
435
446
|
);
|
|
436
447
|
}
|
|
437
448
|
function Ze({ className: t }) {
|
|
438
|
-
return /* @__PURE__ */
|
|
449
|
+
return /* @__PURE__ */ n(
|
|
439
450
|
"svg",
|
|
440
451
|
{
|
|
441
452
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -455,13 +466,13 @@ function Ze({ className: t }) {
|
|
|
455
466
|
}
|
|
456
467
|
function he({
|
|
457
468
|
event: t,
|
|
458
|
-
onClose:
|
|
469
|
+
onClose: r
|
|
459
470
|
}) {
|
|
460
471
|
const o = fe(t.color), a = t.isCanceled ?? !1;
|
|
461
|
-
return /* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */
|
|
472
|
+
return /* @__PURE__ */ n("div", { className: "space-y-3", children: [
|
|
473
|
+
/* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
|
|
463
474
|
/* @__PURE__ */ e("div", { className: l("size-4 rounded shrink-0 mt-0.5", o.dot) }),
|
|
464
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
|
|
465
476
|
/* @__PURE__ */ e(
|
|
466
477
|
"h3",
|
|
467
478
|
{
|
|
@@ -472,14 +483,14 @@ function he({
|
|
|
472
483
|
children: t.title
|
|
473
484
|
}
|
|
474
485
|
),
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */ e(
|
|
486
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1", children: [
|
|
487
|
+
/* @__PURE__ */ e(Be, { className: "h-4 w-4 shrink-0" }),
|
|
477
488
|
/* @__PURE__ */ e("span", { className: "tabular-nums", children: Z(t.startDate, t.endDate) })
|
|
478
489
|
] })
|
|
479
490
|
] })
|
|
480
491
|
] }),
|
|
481
492
|
t.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t.description }),
|
|
482
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
483
494
|
t.isAllDay && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "All day" }),
|
|
484
495
|
t.isRecurring && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "Recurring" }),
|
|
485
496
|
a && /* @__PURE__ */ e("span", { className: "text-xs bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-300 px-2 py-0.5 rounded-full font-medium", children: "Canceled" })
|
|
@@ -488,7 +499,7 @@ function he({
|
|
|
488
499
|
"button",
|
|
489
500
|
{
|
|
490
501
|
type: "button",
|
|
491
|
-
onClick:
|
|
502
|
+
onClick: r,
|
|
492
503
|
className: "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-muted transition-colors",
|
|
493
504
|
children: "Close"
|
|
494
505
|
}
|
|
@@ -497,7 +508,7 @@ function he({
|
|
|
497
508
|
}
|
|
498
509
|
function Qe({
|
|
499
510
|
event: t,
|
|
500
|
-
position:
|
|
511
|
+
position: r,
|
|
501
512
|
hourHeight: o = 96,
|
|
502
513
|
badgeVariant: a = "colored",
|
|
503
514
|
onClick: d,
|
|
@@ -506,7 +517,7 @@ function Qe({
|
|
|
506
517
|
renderPopover: b,
|
|
507
518
|
enableDrag: z = !0
|
|
508
519
|
}) {
|
|
509
|
-
const p = fe(t.color), [y, L] = oe(!1), [i, v] = oe(!1), h = We(), w = (t.endDate.getTime() - t.startDate.getTime()) / (1e3 * 60),
|
|
520
|
+
const p = fe(t.color), [y, L] = oe(!1), [i, v] = oe(!1), h = We(), w = (t.endDate.getTime() - t.startDate.getTime()) / (1e3 * 60), E = w / 60 * o - 8, W = t.endDate < Ee(/* @__PURE__ */ new Date()), D = t.isCanceled ?? !1, x = z && h && !D && !W, O = w < 35, P = w > 25, j = w >= 45, B = t.data, F = t.scheduleTypeName || B?.scheduleTypeName || B?.typeName, u = B?.productName, k = B?.nrParticipant, I = B?.siteName, m = B?.siteCity, _ = [I, m].filter(Boolean).join(", "), $ = a === "dot", N = M(() => {
|
|
510
521
|
i || (c && d ? d(t) : c || L(!0));
|
|
511
522
|
}, [i, c, d, t]), G = M(() => {
|
|
512
523
|
L(!1);
|
|
@@ -529,7 +540,7 @@ function Qe({
|
|
|
529
540
|
(T.key === "Enter" || T.key === " ") && (T.preventDefault(), N());
|
|
530
541
|
},
|
|
531
542
|
[N]
|
|
532
|
-
), S = /* @__PURE__ */
|
|
543
|
+
), S = /* @__PURE__ */ n(
|
|
533
544
|
"div",
|
|
534
545
|
{
|
|
535
546
|
role: "button",
|
|
@@ -540,26 +551,31 @@ function Qe({
|
|
|
540
551
|
onKeyDown: f,
|
|
541
552
|
onClick: i ? void 0 : N,
|
|
542
553
|
className: l(
|
|
543
|
-
"group flex w-full select-none flex-col gap-0.5 overflow-hidden rounded-md border px-2 py-1.5 text-xs text-left",
|
|
554
|
+
"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",
|
|
555
|
+
"shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]",
|
|
544
556
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
545
|
-
"transition-
|
|
557
|
+
"transition-all",
|
|
546
558
|
x ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
|
|
547
559
|
i && "opacity-50",
|
|
548
560
|
// Cancelled events get gray background with strikethrough
|
|
549
561
|
D || // Past events get neutral zinc styling with strikethrough
|
|
550
|
-
W ? "bg-zinc-100 dark:bg-zinc-800 border-zinc-
|
|
562
|
+
W ? "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" : [
|
|
551
563
|
// Colored/mixed variants
|
|
552
|
-
|
|
564
|
+
!$ && [
|
|
565
|
+
p.bg,
|
|
566
|
+
p.accentBorder,
|
|
567
|
+
p.text
|
|
568
|
+
],
|
|
553
569
|
// Dot variant - neutral background
|
|
554
|
-
|
|
570
|
+
$ && "bg-neutral-50 dark:bg-neutral-900 border-l-neutral-400 dark:border-l-neutral-600"
|
|
555
571
|
],
|
|
556
572
|
// Short events center content
|
|
557
573
|
O && "py-0 justify-center",
|
|
558
574
|
g
|
|
559
575
|
),
|
|
560
|
-
style: { height: `${Math.max(
|
|
576
|
+
style: { height: `${Math.max(E, 20)}px` },
|
|
561
577
|
children: [
|
|
562
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ n("div", { className: "flex items-start gap-1.5 min-w-0", children: [
|
|
563
579
|
["mixed", "dot"].includes(a) && !W && !D && /* @__PURE__ */ e(
|
|
564
580
|
"svg",
|
|
565
581
|
{
|
|
@@ -572,16 +588,16 @@ function Qe({
|
|
|
572
588
|
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: p.dotFill })
|
|
573
589
|
}
|
|
574
590
|
),
|
|
575
|
-
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ n(
|
|
576
592
|
"p",
|
|
577
593
|
{
|
|
578
594
|
className: l(
|
|
579
595
|
"font-semibold truncate leading-tight",
|
|
580
|
-
!W && !D &&
|
|
596
|
+
!W && !D && $ && "text-foreground"
|
|
581
597
|
),
|
|
582
598
|
children: [
|
|
583
599
|
t.title,
|
|
584
|
-
F && /* @__PURE__ */
|
|
600
|
+
F && /* @__PURE__ */ n("span", { className: "font-normal opacity-75", children: [
|
|
585
601
|
" ",
|
|
586
602
|
"- ",
|
|
587
603
|
F
|
|
@@ -590,26 +606,26 @@ function Qe({
|
|
|
590
606
|
}
|
|
591
607
|
) })
|
|
592
608
|
] }),
|
|
593
|
-
|
|
609
|
+
j && u && /* @__PURE__ */ e(
|
|
594
610
|
"p",
|
|
595
611
|
{
|
|
596
612
|
className: l(
|
|
597
613
|
"text-[11px] truncate leading-tight",
|
|
598
|
-
|
|
614
|
+
$ ? "text-muted-foreground" : "opacity-80"
|
|
599
615
|
),
|
|
600
616
|
children: u
|
|
601
617
|
}
|
|
602
618
|
),
|
|
603
|
-
|
|
619
|
+
j && k != null && /* @__PURE__ */ n(
|
|
604
620
|
"div",
|
|
605
621
|
{
|
|
606
622
|
className: l(
|
|
607
623
|
"flex items-center gap-1 text-[11px] leading-tight",
|
|
608
|
-
|
|
624
|
+
$ ? "text-muted-foreground" : "opacity-80"
|
|
609
625
|
),
|
|
610
626
|
children: [
|
|
611
627
|
/* @__PURE__ */ e(Se, { className: "h-3 w-3 shrink-0" }),
|
|
612
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ n("span", { children: [
|
|
613
629
|
k,
|
|
614
630
|
" participant",
|
|
615
631
|
k !== 1 ? "s" : ""
|
|
@@ -617,16 +633,16 @@ function Qe({
|
|
|
617
633
|
]
|
|
618
634
|
}
|
|
619
635
|
),
|
|
620
|
-
|
|
636
|
+
P && /* @__PURE__ */ n(
|
|
621
637
|
"div",
|
|
622
638
|
{
|
|
623
639
|
className: l(
|
|
624
640
|
"flex items-center gap-1 text-[11px] tabular-nums leading-tight",
|
|
625
|
-
|
|
641
|
+
$ ? "text-muted-foreground" : "opacity-90"
|
|
626
642
|
),
|
|
627
643
|
children: [
|
|
628
|
-
/* @__PURE__ */ e(
|
|
629
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ e(Be, { className: "h-3 w-3 shrink-0" }),
|
|
645
|
+
/* @__PURE__ */ n("span", { children: [
|
|
630
646
|
ve(t.startDate),
|
|
631
647
|
" - ",
|
|
632
648
|
ve(t.endDate)
|
|
@@ -634,52 +650,52 @@ function Qe({
|
|
|
634
650
|
]
|
|
635
651
|
}
|
|
636
652
|
),
|
|
637
|
-
|
|
653
|
+
j && _ && /* @__PURE__ */ n(
|
|
638
654
|
"div",
|
|
639
655
|
{
|
|
640
656
|
className: l(
|
|
641
657
|
"flex items-center gap-1 text-[11px] truncate leading-tight",
|
|
642
|
-
|
|
658
|
+
$ ? "text-muted-foreground" : "opacity-80"
|
|
643
659
|
),
|
|
644
660
|
children: [
|
|
645
661
|
/* @__PURE__ */ e(Ze, { className: "h-3 w-3 shrink-0" }),
|
|
646
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
662
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: _ })
|
|
647
663
|
]
|
|
648
664
|
}
|
|
649
665
|
)
|
|
650
666
|
]
|
|
651
667
|
}
|
|
652
|
-
),
|
|
653
|
-
/* @__PURE__ */
|
|
668
|
+
), A = /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
669
|
+
/* @__PURE__ */ n("div", { className: "font-medium", children: [
|
|
654
670
|
t.title,
|
|
655
|
-
F && /* @__PURE__ */
|
|
671
|
+
F && /* @__PURE__ */ n("span", { className: "font-normal opacity-75", children: [
|
|
656
672
|
" ",
|
|
657
673
|
"- ",
|
|
658
674
|
F
|
|
659
675
|
] })
|
|
660
676
|
] }),
|
|
661
677
|
u && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: u }),
|
|
662
|
-
k != null && /* @__PURE__ */
|
|
678
|
+
k != null && /* @__PURE__ */ n("div", { className: "text-xs text-muted-foreground", children: [
|
|
663
679
|
k,
|
|
664
680
|
" participant",
|
|
665
681
|
k !== 1 ? "s" : ""
|
|
666
682
|
] }),
|
|
667
683
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: Z(t.startDate, t.endDate) }),
|
|
668
|
-
|
|
684
|
+
_ && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: _ })
|
|
669
685
|
] }) });
|
|
670
686
|
return c ? /* @__PURE__ */ e(
|
|
671
687
|
"div",
|
|
672
688
|
{
|
|
673
689
|
className: "absolute p-0.5",
|
|
674
690
|
style: {
|
|
675
|
-
top: `${
|
|
676
|
-
left: `${
|
|
677
|
-
width:
|
|
678
|
-
minWidth:
|
|
691
|
+
top: `${r.top}px`,
|
|
692
|
+
left: `${r.left}%`,
|
|
693
|
+
width: r.minWidth ? `max(${r.minWidth}px, ${r.width}%)` : `${r.width}%`,
|
|
694
|
+
minWidth: r.minWidth ? `${r.minWidth}px` : void 0
|
|
679
695
|
},
|
|
680
|
-
children: /* @__PURE__ */
|
|
696
|
+
children: /* @__PURE__ */ n(le, { children: [
|
|
681
697
|
/* @__PURE__ */ e(de, { asChild: !0, children: S }),
|
|
682
|
-
|
|
698
|
+
A
|
|
683
699
|
] })
|
|
684
700
|
}
|
|
685
701
|
) : /* @__PURE__ */ e(
|
|
@@ -687,21 +703,21 @@ function Qe({
|
|
|
687
703
|
{
|
|
688
704
|
className: "absolute p-0.5",
|
|
689
705
|
style: {
|
|
690
|
-
top: `${
|
|
691
|
-
left: `${
|
|
692
|
-
width:
|
|
693
|
-
minWidth:
|
|
706
|
+
top: `${r.top}px`,
|
|
707
|
+
left: `${r.left}%`,
|
|
708
|
+
width: r.minWidth ? `max(${r.minWidth}px, ${r.width}%)` : `${r.width}%`,
|
|
709
|
+
minWidth: r.minWidth ? `${r.minWidth}px` : void 0
|
|
694
710
|
},
|
|
695
|
-
children: /* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */ e(
|
|
711
|
+
children: /* @__PURE__ */ n(re, { open: y, onOpenChange: L, children: [
|
|
712
|
+
/* @__PURE__ */ e(ne, { asChild: !0, children: S }),
|
|
697
713
|
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose: G }) : /* @__PURE__ */ e(he, { event: t, onClose: G }) })
|
|
698
714
|
] })
|
|
699
715
|
}
|
|
700
716
|
);
|
|
701
717
|
}
|
|
702
|
-
function
|
|
718
|
+
function sr({
|
|
703
719
|
event: t,
|
|
704
|
-
spanDays:
|
|
720
|
+
spanDays: r,
|
|
705
721
|
isStart: o,
|
|
706
722
|
isEnd: a,
|
|
707
723
|
onClick: d,
|
|
@@ -709,7 +725,7 @@ function ln({
|
|
|
709
725
|
disablePopover: c = !1,
|
|
710
726
|
renderPopover: b
|
|
711
727
|
}) {
|
|
712
|
-
const z = fe(t.color), [p, y] = oe(!1), L = t.endDate <
|
|
728
|
+
const z = fe(t.color), [p, y] = oe(!1), L = t.endDate < Ee(/* @__PURE__ */ new Date()), i = t.isCanceled ?? !1, v = M(() => {
|
|
713
729
|
c && d ? d(t) : c || y(!0);
|
|
714
730
|
}, [c, d, t]), h = M(() => {
|
|
715
731
|
y(!1);
|
|
@@ -729,18 +745,18 @@ function ln({
|
|
|
729
745
|
!a && "border-r-0",
|
|
730
746
|
g
|
|
731
747
|
),
|
|
732
|
-
style: { width: `${
|
|
748
|
+
style: { width: `${r * 100}%` },
|
|
733
749
|
children: o && /* @__PURE__ */ e("span", { className: "truncate", children: t.title })
|
|
734
750
|
}
|
|
735
|
-
),
|
|
751
|
+
), E = /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
736
752
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
737
753
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: Z(t.startDate, t.endDate) })
|
|
738
754
|
] }) });
|
|
739
|
-
return c ? /* @__PURE__ */
|
|
755
|
+
return c ? /* @__PURE__ */ n(le, { children: [
|
|
740
756
|
/* @__PURE__ */ e(de, { asChild: !0, children: w }),
|
|
741
|
-
|
|
742
|
-
] }) : /* @__PURE__ */
|
|
743
|
-
/* @__PURE__ */ e(
|
|
757
|
+
E
|
|
758
|
+
] }) : /* @__PURE__ */ n(re, { open: p, onOpenChange: y, children: [
|
|
759
|
+
/* @__PURE__ */ e(ne, { asChild: !0, children: w }),
|
|
744
760
|
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose: h }) : /* @__PURE__ */ e(he, { event: t, onClose: h }) })
|
|
745
761
|
] });
|
|
746
762
|
}
|
|
@@ -757,35 +773,35 @@ if (typeof window < "u" && !document.getElementById("inno-calendar-event-marquee
|
|
|
757
773
|
}
|
|
758
774
|
`, document.head.appendChild(t);
|
|
759
775
|
}
|
|
760
|
-
const
|
|
776
|
+
const Pe = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, je = st, et = (t, r) => (o) => {
|
|
761
777
|
var a;
|
|
762
|
-
if (
|
|
763
|
-
const { variants: d, defaultVariants: g } =
|
|
778
|
+
if (r?.variants == null) return je(t, o?.class, o?.className);
|
|
779
|
+
const { variants: d, defaultVariants: g } = r, c = Object.keys(d).map((p) => {
|
|
764
780
|
const y = o?.[p], L = g?.[p];
|
|
765
781
|
if (y === null) return null;
|
|
766
|
-
const i =
|
|
782
|
+
const i = Pe(y) || Pe(L);
|
|
767
783
|
return d[p][i];
|
|
768
784
|
}), b = o && Object.entries(o).reduce((p, y) => {
|
|
769
785
|
let [L, i] = y;
|
|
770
786
|
return i === void 0 || (p[L] = i), p;
|
|
771
|
-
}, {}), z =
|
|
787
|
+
}, {}), z = r == null || (a = r.compoundVariants) === null || a === void 0 ? void 0 : a.reduce((p, y) => {
|
|
772
788
|
let { class: L, className: i, ...v } = y;
|
|
773
789
|
return Object.entries(v).every((h) => {
|
|
774
|
-
let [w,
|
|
775
|
-
return Array.isArray(
|
|
790
|
+
let [w, E] = h;
|
|
791
|
+
return Array.isArray(E) ? E.includes({
|
|
776
792
|
...g,
|
|
777
793
|
...b
|
|
778
794
|
}[w]) : {
|
|
779
795
|
...g,
|
|
780
796
|
...b
|
|
781
|
-
}[w] ===
|
|
797
|
+
}[w] === E;
|
|
782
798
|
}) ? [
|
|
783
799
|
...p,
|
|
784
800
|
L,
|
|
785
801
|
i
|
|
786
802
|
] : p;
|
|
787
803
|
}, []);
|
|
788
|
-
return
|
|
804
|
+
return je(t, c, z, o?.class, o?.className);
|
|
789
805
|
}, gt = et(
|
|
790
806
|
"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",
|
|
791
807
|
{
|
|
@@ -811,15 +827,15 @@ const je = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Be = st, e
|
|
|
811
827
|
}
|
|
812
828
|
}
|
|
813
829
|
), ce = ze(
|
|
814
|
-
({ className: t, variant:
|
|
830
|
+
({ className: t, variant: r, size: o, loading: a, disabled: d, children: g, ...c }, b) => /* @__PURE__ */ n(
|
|
815
831
|
"button",
|
|
816
832
|
{
|
|
817
|
-
className: l(gt({ variant:
|
|
833
|
+
className: l(gt({ variant: r, size: o, className: t })),
|
|
818
834
|
ref: b,
|
|
819
835
|
disabled: d || a,
|
|
820
836
|
...c,
|
|
821
837
|
children: [
|
|
822
|
-
a && /* @__PURE__ */
|
|
838
|
+
a && /* @__PURE__ */ n(
|
|
823
839
|
"svg",
|
|
824
840
|
{
|
|
825
841
|
className: "animate-spin -ml-1 mr-2 size-4",
|
|
@@ -855,15 +871,15 @@ const je = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Be = st, e
|
|
|
855
871
|
)
|
|
856
872
|
);
|
|
857
873
|
ce.displayName = "Button";
|
|
858
|
-
const tt = (...t) => t.filter((
|
|
874
|
+
const tt = (...t) => t.filter((r, o, a) => !!r && r.trim() !== "" && a.indexOf(r) === o).join(" ").trim();
|
|
859
875
|
const xt = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
860
876
|
const bt = (t) => t.replace(
|
|
861
877
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
862
|
-
(
|
|
878
|
+
(r, o, a) => a ? a.toUpperCase() : o.toLowerCase()
|
|
863
879
|
);
|
|
864
880
|
const Re = (t) => {
|
|
865
|
-
const
|
|
866
|
-
return
|
|
881
|
+
const r = bt(t);
|
|
882
|
+
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
867
883
|
};
|
|
868
884
|
var yt = {
|
|
869
885
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -877,15 +893,15 @@ var yt = {
|
|
|
877
893
|
strokeLinejoin: "round"
|
|
878
894
|
};
|
|
879
895
|
const wt = (t) => {
|
|
880
|
-
for (const
|
|
881
|
-
if (
|
|
896
|
+
for (const r in t)
|
|
897
|
+
if (r.startsWith("aria-") || r === "role" || r === "title")
|
|
882
898
|
return !0;
|
|
883
899
|
return !1;
|
|
884
900
|
};
|
|
885
901
|
const vt = ze(
|
|
886
902
|
({
|
|
887
903
|
color: t = "currentColor",
|
|
888
|
-
size:
|
|
904
|
+
size: r = 24,
|
|
889
905
|
strokeWidth: o = 2,
|
|
890
906
|
absoluteStrokeWidth: a,
|
|
891
907
|
className: d = "",
|
|
@@ -897,10 +913,10 @@ const vt = ze(
|
|
|
897
913
|
{
|
|
898
914
|
ref: z,
|
|
899
915
|
...yt,
|
|
900
|
-
width:
|
|
901
|
-
height:
|
|
916
|
+
width: r,
|
|
917
|
+
height: r,
|
|
902
918
|
stroke: t,
|
|
903
|
-
strokeWidth: a ? Number(o) * 24 / Number(
|
|
919
|
+
strokeWidth: a ? Number(o) * 24 / Number(r) : o,
|
|
904
920
|
className: tt("lucide", d),
|
|
905
921
|
...!g && !wt(b) && { "aria-hidden": "true" },
|
|
906
922
|
...b
|
|
@@ -911,11 +927,11 @@ const vt = ze(
|
|
|
911
927
|
]
|
|
912
928
|
)
|
|
913
929
|
);
|
|
914
|
-
const
|
|
930
|
+
const $e = (t, r) => {
|
|
915
931
|
const o = ze(
|
|
916
932
|
({ className: a, ...d }, g) => De(vt, {
|
|
917
933
|
ref: g,
|
|
918
|
-
iconNode:
|
|
934
|
+
iconNode: r,
|
|
919
935
|
className: tt(
|
|
920
936
|
`lucide-${xt(Re(t))}`,
|
|
921
937
|
`lucide-${t}`,
|
|
@@ -926,15 +942,15 @@ const Ie = (t, n) => {
|
|
|
926
942
|
);
|
|
927
943
|
return o.displayName = Re(t), o;
|
|
928
944
|
};
|
|
929
|
-
const Nt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], kt =
|
|
930
|
-
const Dt = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ct =
|
|
931
|
-
const St = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Mt =
|
|
945
|
+
const Nt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], kt = $e("check", Nt);
|
|
946
|
+
const Dt = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ct = $e("chevron-right", Dt);
|
|
947
|
+
const St = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Mt = $e("circle", St), He = H.Root, Oe = H.Trigger, Tt = Y.forwardRef(({ className: t, inset: r, children: o, ...a }, d) => /* @__PURE__ */ n(
|
|
932
948
|
H.SubTrigger,
|
|
933
949
|
{
|
|
934
950
|
ref: d,
|
|
935
951
|
className: l(
|
|
936
952
|
"flex cursor-default select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
937
|
-
|
|
953
|
+
r && "pl-8",
|
|
938
954
|
t
|
|
939
955
|
),
|
|
940
956
|
...a,
|
|
@@ -945,7 +961,7 @@ const St = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Mt = Ie
|
|
|
945
961
|
}
|
|
946
962
|
));
|
|
947
963
|
Tt.displayName = H.SubTrigger.displayName;
|
|
948
|
-
const zt = Y.forwardRef(({ className: t, ...
|
|
964
|
+
const zt = Y.forwardRef(({ className: t, ...r }, o) => /* @__PURE__ */ e(
|
|
949
965
|
H.SubContent,
|
|
950
966
|
{
|
|
951
967
|
ref: o,
|
|
@@ -953,15 +969,15 @@ const zt = Y.forwardRef(({ className: t, ...n }, o) => /* @__PURE__ */ e(
|
|
|
953
969
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
954
970
|
t
|
|
955
971
|
),
|
|
956
|
-
...
|
|
972
|
+
...r
|
|
957
973
|
}
|
|
958
974
|
));
|
|
959
975
|
zt.displayName = H.SubContent.displayName;
|
|
960
|
-
const Me = Y.forwardRef(({ className: t, sideOffset:
|
|
976
|
+
const Me = Y.forwardRef(({ className: t, sideOffset: r = 4, ...o }, a) => /* @__PURE__ */ e(H.Portal, { children: /* @__PURE__ */ e(
|
|
961
977
|
H.Content,
|
|
962
978
|
{
|
|
963
979
|
ref: a,
|
|
964
|
-
sideOffset:
|
|
980
|
+
sideOffset: r,
|
|
965
981
|
className: l(
|
|
966
982
|
"z-50 rounded-xl border bg-popover p-1 text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
967
983
|
t
|
|
@@ -970,20 +986,20 @@ const Me = Y.forwardRef(({ className: t, sideOffset: n = 4, ...o }, a) => /* @__
|
|
|
970
986
|
}
|
|
971
987
|
) }));
|
|
972
988
|
Me.displayName = H.Content.displayName;
|
|
973
|
-
const Te = Y.forwardRef(({ className: t, inset:
|
|
989
|
+
const Te = Y.forwardRef(({ className: t, inset: r, ...o }, a) => /* @__PURE__ */ e(
|
|
974
990
|
H.Item,
|
|
975
991
|
{
|
|
976
992
|
ref: a,
|
|
977
993
|
className: l(
|
|
978
994
|
"relative flex cursor-pointer select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
979
|
-
|
|
995
|
+
r && "pl-8",
|
|
980
996
|
t
|
|
981
997
|
),
|
|
982
998
|
...o
|
|
983
999
|
}
|
|
984
1000
|
));
|
|
985
1001
|
Te.displayName = H.Item.displayName;
|
|
986
|
-
const Lt = Y.forwardRef(({ className: t, children:
|
|
1002
|
+
const Lt = Y.forwardRef(({ className: t, children: r, checked: o = !1, ...a }, d) => /* @__PURE__ */ n(
|
|
987
1003
|
H.CheckboxItem,
|
|
988
1004
|
{
|
|
989
1005
|
ref: d,
|
|
@@ -995,12 +1011,12 @@ const Lt = Y.forwardRef(({ className: t, children: n, checked: o = !1, ...a }, d
|
|
|
995
1011
|
...a,
|
|
996
1012
|
children: [
|
|
997
1013
|
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(H.ItemIndicator, { children: /* @__PURE__ */ e(kt, { className: "h-4 w-4" }) }) }),
|
|
998
|
-
|
|
1014
|
+
r
|
|
999
1015
|
]
|
|
1000
1016
|
}
|
|
1001
1017
|
));
|
|
1002
1018
|
Lt.displayName = H.CheckboxItem.displayName;
|
|
1003
|
-
const Wt = Y.forwardRef(({ className: t, children:
|
|
1019
|
+
const Wt = Y.forwardRef(({ className: t, children: r, ...o }, a) => /* @__PURE__ */ n(
|
|
1004
1020
|
H.RadioItem,
|
|
1005
1021
|
{
|
|
1006
1022
|
ref: a,
|
|
@@ -1011,30 +1027,30 @@ const Wt = Y.forwardRef(({ className: t, children: n, ...o }, a) => /* @__PURE__
|
|
|
1011
1027
|
...o,
|
|
1012
1028
|
children: [
|
|
1013
1029
|
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(H.ItemIndicator, { children: /* @__PURE__ */ e(Mt, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1014
|
-
|
|
1030
|
+
r
|
|
1015
1031
|
]
|
|
1016
1032
|
}
|
|
1017
1033
|
));
|
|
1018
1034
|
Wt.displayName = H.RadioItem.displayName;
|
|
1019
|
-
const
|
|
1035
|
+
const _t = Y.forwardRef(({ className: t, inset: r, ...o }, a) => /* @__PURE__ */ e(
|
|
1020
1036
|
H.Label,
|
|
1021
1037
|
{
|
|
1022
1038
|
ref: a,
|
|
1023
|
-
className: l("px-2 py-1.5 text-sm font-semibold",
|
|
1039
|
+
className: l("px-2 py-1.5 text-sm font-semibold", r && "pl-8", t),
|
|
1024
1040
|
...o
|
|
1025
1041
|
}
|
|
1026
1042
|
));
|
|
1027
|
-
|
|
1028
|
-
const
|
|
1043
|
+
_t.displayName = H.Label.displayName;
|
|
1044
|
+
const Et = Y.forwardRef(({ className: t, ...r }, o) => /* @__PURE__ */ e(
|
|
1029
1045
|
H.Separator,
|
|
1030
1046
|
{
|
|
1031
1047
|
ref: o,
|
|
1032
1048
|
className: l("-mx-1 my-1 h-px bg-muted", t),
|
|
1033
|
-
...
|
|
1049
|
+
...r
|
|
1034
1050
|
}
|
|
1035
1051
|
));
|
|
1036
|
-
|
|
1037
|
-
const
|
|
1052
|
+
Et.displayName = H.Separator.displayName;
|
|
1053
|
+
const Bt = et(
|
|
1038
1054
|
"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",
|
|
1039
1055
|
{
|
|
1040
1056
|
variants: {
|
|
@@ -1048,10 +1064,10 @@ const $t = et(
|
|
|
1048
1064
|
defaultVariants: { variant: "default" }
|
|
1049
1065
|
}
|
|
1050
1066
|
);
|
|
1051
|
-
function
|
|
1052
|
-
return /* @__PURE__ */ e("div", { className: l(
|
|
1067
|
+
function $t({ className: t, variant: r, ...o }) {
|
|
1068
|
+
return /* @__PURE__ */ e("div", { className: l(Bt({ variant: r }), t), ...o });
|
|
1053
1069
|
}
|
|
1054
|
-
function
|
|
1070
|
+
function It({ className: t }) {
|
|
1055
1071
|
return /* @__PURE__ */ e(
|
|
1056
1072
|
"svg",
|
|
1057
1073
|
{
|
|
@@ -1069,7 +1085,7 @@ function At({ className: t }) {
|
|
|
1069
1085
|
}
|
|
1070
1086
|
);
|
|
1071
1087
|
}
|
|
1072
|
-
function
|
|
1088
|
+
function At({ className: t }) {
|
|
1073
1089
|
return /* @__PURE__ */ e(
|
|
1074
1090
|
"svg",
|
|
1075
1091
|
{
|
|
@@ -1087,7 +1103,7 @@ function Pt({ className: t }) {
|
|
|
1087
1103
|
}
|
|
1088
1104
|
);
|
|
1089
1105
|
}
|
|
1090
|
-
const
|
|
1106
|
+
const Pt = [
|
|
1091
1107
|
"January",
|
|
1092
1108
|
"February",
|
|
1093
1109
|
"March",
|
|
@@ -1101,9 +1117,9 @@ const jt = [
|
|
|
1101
1117
|
"November",
|
|
1102
1118
|
"December"
|
|
1103
1119
|
];
|
|
1104
|
-
function
|
|
1120
|
+
function jt({
|
|
1105
1121
|
date: t,
|
|
1106
|
-
view:
|
|
1122
|
+
view: r,
|
|
1107
1123
|
events: o = [],
|
|
1108
1124
|
onNavigatePrev: a,
|
|
1109
1125
|
onNavigateNext: d,
|
|
@@ -1111,17 +1127,17 @@ function Bt({
|
|
|
1111
1127
|
showEventCount: c = !0,
|
|
1112
1128
|
className: b
|
|
1113
1129
|
}) {
|
|
1114
|
-
const z =
|
|
1115
|
-
return /* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */
|
|
1130
|
+
const z = Pt[t.getMonth()], p = t.getFullYear(), y = c ? lt(o, t, r, g) : 0, L = dt(t, r);
|
|
1131
|
+
return /* @__PURE__ */ n("div", { className: l("min-w-0 flex-1", b), children: [
|
|
1132
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 sm:gap-2 flex-wrap", children: [
|
|
1133
|
+
/* @__PURE__ */ n("span", { className: "text-base sm:text-lg font-semibold truncate", children: [
|
|
1118
1134
|
z,
|
|
1119
1135
|
" ",
|
|
1120
1136
|
p
|
|
1121
1137
|
] }),
|
|
1122
|
-
c && /* @__PURE__ */ e(
|
|
1138
|
+
c && /* @__PURE__ */ e($t, { variant: "outline", className: "px-1 sm:px-1.5 text-[10px] sm:text-xs shrink-0", children: y })
|
|
1123
1139
|
] }),
|
|
1124
|
-
/* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 sm:gap-2", children: [
|
|
1125
1141
|
/* @__PURE__ */ e(
|
|
1126
1142
|
ce,
|
|
1127
1143
|
{
|
|
@@ -1129,7 +1145,7 @@ function Bt({
|
|
|
1129
1145
|
size: "icon",
|
|
1130
1146
|
className: "size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",
|
|
1131
1147
|
onClick: a,
|
|
1132
|
-
children: /* @__PURE__ */ e(
|
|
1148
|
+
children: /* @__PURE__ */ e(It, {})
|
|
1133
1149
|
}
|
|
1134
1150
|
),
|
|
1135
1151
|
/* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children: L }),
|
|
@@ -1140,7 +1156,7 @@ function Bt({
|
|
|
1140
1156
|
size: "icon",
|
|
1141
1157
|
className: "size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",
|
|
1142
1158
|
onClick: d,
|
|
1143
|
-
children: /* @__PURE__ */ e(
|
|
1159
|
+
children: /* @__PURE__ */ e(At, {})
|
|
1144
1160
|
}
|
|
1145
1161
|
)
|
|
1146
1162
|
] })
|
|
@@ -1160,9 +1176,9 @@ const Rt = [
|
|
|
1160
1176
|
"NOV",
|
|
1161
1177
|
"DEC"
|
|
1162
1178
|
];
|
|
1163
|
-
function Ht({ onClick: t, className:
|
|
1179
|
+
function Ht({ onClick: t, className: r }) {
|
|
1164
1180
|
const o = /* @__PURE__ */ new Date();
|
|
1165
|
-
return /* @__PURE__ */
|
|
1181
|
+
return /* @__PURE__ */ n(
|
|
1166
1182
|
"button",
|
|
1167
1183
|
{
|
|
1168
1184
|
type: "button",
|
|
@@ -1170,7 +1186,7 @@ function Ht({ onClick: t, className: n }) {
|
|
|
1170
1186
|
"flex size-11 sm:size-14 flex-col items-start overflow-hidden rounded-lg border shrink-0",
|
|
1171
1187
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1172
1188
|
"hover:bg-accent/50 transition-colors",
|
|
1173
|
-
|
|
1189
|
+
r
|
|
1174
1190
|
),
|
|
1175
1191
|
onClick: t,
|
|
1176
1192
|
children: [
|
|
@@ -1181,7 +1197,7 @@ function Ht({ onClick: t, className: n }) {
|
|
|
1181
1197
|
);
|
|
1182
1198
|
}
|
|
1183
1199
|
function Ot({ className: t }) {
|
|
1184
|
-
return /* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ n(
|
|
1185
1201
|
"svg",
|
|
1186
1202
|
{
|
|
1187
1203
|
className: t,
|
|
@@ -1210,7 +1226,7 @@ function Ot({ className: t }) {
|
|
|
1210
1226
|
);
|
|
1211
1227
|
}
|
|
1212
1228
|
function ye({ className: t }) {
|
|
1213
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ n(
|
|
1214
1230
|
"svg",
|
|
1215
1231
|
{
|
|
1216
1232
|
className: t,
|
|
@@ -1251,7 +1267,7 @@ function Fe({ className: t }) {
|
|
|
1251
1267
|
);
|
|
1252
1268
|
}
|
|
1253
1269
|
function Ft({ className: t }) {
|
|
1254
|
-
return /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ n(
|
|
1255
1271
|
"svg",
|
|
1256
1272
|
{
|
|
1257
1273
|
className: t,
|
|
@@ -1272,7 +1288,7 @@ function Ft({ className: t }) {
|
|
|
1272
1288
|
);
|
|
1273
1289
|
}
|
|
1274
1290
|
function Ve({ className: t }) {
|
|
1275
|
-
return /* @__PURE__ */
|
|
1291
|
+
return /* @__PURE__ */ n(
|
|
1276
1292
|
"svg",
|
|
1277
1293
|
{
|
|
1278
1294
|
className: t,
|
|
@@ -1293,7 +1309,7 @@ function Ve({ className: t }) {
|
|
|
1293
1309
|
);
|
|
1294
1310
|
}
|
|
1295
1311
|
function Vt({ className: t }) {
|
|
1296
|
-
return /* @__PURE__ */
|
|
1312
|
+
return /* @__PURE__ */ n(
|
|
1297
1313
|
"svg",
|
|
1298
1314
|
{
|
|
1299
1315
|
className: t,
|
|
@@ -1318,7 +1334,7 @@ function Vt({ className: t }) {
|
|
|
1318
1334
|
);
|
|
1319
1335
|
}
|
|
1320
1336
|
function Gt({ className: t }) {
|
|
1321
|
-
return /* @__PURE__ */
|
|
1337
|
+
return /* @__PURE__ */ n(
|
|
1322
1338
|
"svg",
|
|
1323
1339
|
{
|
|
1324
1340
|
className: t,
|
|
@@ -1339,7 +1355,7 @@ function Gt({ className: t }) {
|
|
|
1339
1355
|
);
|
|
1340
1356
|
}
|
|
1341
1357
|
function Ut({ className: t }) {
|
|
1342
|
-
return /* @__PURE__ */
|
|
1358
|
+
return /* @__PURE__ */ n(
|
|
1343
1359
|
"svg",
|
|
1344
1360
|
{
|
|
1345
1361
|
className: t,
|
|
@@ -1361,7 +1377,7 @@ function Ut({ className: t }) {
|
|
|
1361
1377
|
);
|
|
1362
1378
|
}
|
|
1363
1379
|
function qt({ className: t }) {
|
|
1364
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ n(
|
|
1365
1381
|
"svg",
|
|
1366
1382
|
{
|
|
1367
1383
|
className: t,
|
|
@@ -1395,9 +1411,9 @@ const Kt = [
|
|
|
1395
1411
|
{ value: "timeline-3day", label: "3 Days", icon: ye },
|
|
1396
1412
|
{ value: "timeline-week", label: "7 Days", icon: ye }
|
|
1397
1413
|
];
|
|
1398
|
-
function
|
|
1414
|
+
function lr({
|
|
1399
1415
|
currentDate: t,
|
|
1400
|
-
view:
|
|
1416
|
+
view: r,
|
|
1401
1417
|
events: o = [],
|
|
1402
1418
|
onNavigateToday: a,
|
|
1403
1419
|
onNavigatePrev: d,
|
|
@@ -1412,7 +1428,7 @@ function dn({
|
|
|
1412
1428
|
showSettings: v = !1,
|
|
1413
1429
|
filterContent: h,
|
|
1414
1430
|
actions: w,
|
|
1415
|
-
className:
|
|
1431
|
+
className: E,
|
|
1416
1432
|
weekStartsOn: W = 1,
|
|
1417
1433
|
labels: D = {}
|
|
1418
1434
|
}) {
|
|
@@ -1427,28 +1443,28 @@ function dn({
|
|
|
1427
1443
|
[D]
|
|
1428
1444
|
), O = () => {
|
|
1429
1445
|
a?.(), c?.("today");
|
|
1430
|
-
},
|
|
1446
|
+
}, P = () => {
|
|
1431
1447
|
d?.(), c?.("prev");
|
|
1432
|
-
},
|
|
1448
|
+
}, j = () => {
|
|
1433
1449
|
g?.(), c?.("next");
|
|
1434
|
-
},
|
|
1435
|
-
|
|
1436
|
-
), F =
|
|
1450
|
+
}, B = ["day", "week", "month", "year", "agenda"].includes(
|
|
1451
|
+
r
|
|
1452
|
+
), F = r.startsWith("timeline-") || r.startsWith("resource-"), u = Kt.filter(
|
|
1437
1453
|
(m) => p.includes(m.value)
|
|
1438
|
-
), k =
|
|
1439
|
-
return /* @__PURE__ */
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1442
|
-
/* @__PURE__ */
|
|
1454
|
+
), k = B ? u.find((m) => m.value === r) : null, I = F ? Ge.find((m) => m.value === r) : null;
|
|
1455
|
+
return /* @__PURE__ */ n("div", { className: l("flex flex-col w-full gap-3 mb-2", E), children: [
|
|
1456
|
+
/* @__PURE__ */ n("div", { className: "flex lg:flex-row flex-col w-full justify-between gap-3", children: [
|
|
1457
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1458
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [
|
|
1443
1459
|
/* @__PURE__ */ e(Ht, { onClick: O }),
|
|
1444
1460
|
/* @__PURE__ */ e(
|
|
1445
|
-
|
|
1461
|
+
jt,
|
|
1446
1462
|
{
|
|
1447
1463
|
date: t,
|
|
1448
|
-
view:
|
|
1464
|
+
view: r,
|
|
1449
1465
|
events: o,
|
|
1450
|
-
onNavigatePrev:
|
|
1451
|
-
onNavigateNext:
|
|
1466
|
+
onNavigatePrev: P,
|
|
1467
|
+
onNavigateNext: j,
|
|
1452
1468
|
weekStartsOn: W
|
|
1453
1469
|
}
|
|
1454
1470
|
)
|
|
@@ -1463,15 +1479,15 @@ function dn({
|
|
|
1463
1479
|
}
|
|
1464
1480
|
)
|
|
1465
1481
|
] }),
|
|
1466
|
-
/* @__PURE__ */
|
|
1467
|
-
b && u.length > 0 && /* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1482
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 sm:gap-2 overflow-x-auto pb-1 -mb-1 scrollbar-none", children: [
|
|
1483
|
+
b && u.length > 0 && /* @__PURE__ */ n(He, { children: [
|
|
1484
|
+
/* @__PURE__ */ n(
|
|
1469
1485
|
Oe,
|
|
1470
1486
|
{
|
|
1471
1487
|
className: l(
|
|
1472
1488
|
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
1473
1489
|
"h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",
|
|
1474
|
-
|
|
1490
|
+
B ? "bg-primary text-primary-foreground hover:bg-primary/90" : "border border-input bg-background hover:bg-accent hover:text-accent-foreground"
|
|
1475
1491
|
),
|
|
1476
1492
|
children: [
|
|
1477
1493
|
/* @__PURE__ */ e(Ot, { className: "size-4" }),
|
|
@@ -1481,17 +1497,17 @@ function dn({
|
|
|
1481
1497
|
}
|
|
1482
1498
|
),
|
|
1483
1499
|
/* @__PURE__ */ e(Me, { align: "start", className: "min-w-[120px]", children: u.map((m) => {
|
|
1484
|
-
const
|
|
1485
|
-
return /* @__PURE__ */
|
|
1500
|
+
const _ = m.icon;
|
|
1501
|
+
return /* @__PURE__ */ n(
|
|
1486
1502
|
Te,
|
|
1487
1503
|
{
|
|
1488
1504
|
onClick: () => b(m.value),
|
|
1489
1505
|
className: l(
|
|
1490
1506
|
"gap-2",
|
|
1491
|
-
|
|
1507
|
+
r === m.value && "bg-accent"
|
|
1492
1508
|
),
|
|
1493
1509
|
children: [
|
|
1494
|
-
/* @__PURE__ */ e(
|
|
1510
|
+
/* @__PURE__ */ e(_, { className: "size-4" }),
|
|
1495
1511
|
/* @__PURE__ */ e("span", { children: m.label })
|
|
1496
1512
|
]
|
|
1497
1513
|
},
|
|
@@ -1499,8 +1515,8 @@ function dn({
|
|
|
1499
1515
|
);
|
|
1500
1516
|
}) })
|
|
1501
1517
|
] }),
|
|
1502
|
-
y && b && /* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1518
|
+
y && b && /* @__PURE__ */ n(He, { children: [
|
|
1519
|
+
/* @__PURE__ */ n(
|
|
1504
1520
|
Oe,
|
|
1505
1521
|
{
|
|
1506
1522
|
className: l(
|
|
@@ -1510,23 +1526,23 @@ function dn({
|
|
|
1510
1526
|
),
|
|
1511
1527
|
children: [
|
|
1512
1528
|
/* @__PURE__ */ e(ye, { className: "size-4" }),
|
|
1513
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children:
|
|
1529
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: I?.label ?? x.resourceView }),
|
|
1514
1530
|
/* @__PURE__ */ e(Fe, { className: "size-3 opacity-60" })
|
|
1515
1531
|
]
|
|
1516
1532
|
}
|
|
1517
1533
|
),
|
|
1518
1534
|
/* @__PURE__ */ e(Me, { align: "start", className: "min-w-[120px]", children: Ge.map((m) => {
|
|
1519
|
-
const
|
|
1520
|
-
return /* @__PURE__ */
|
|
1535
|
+
const _ = m.icon;
|
|
1536
|
+
return /* @__PURE__ */ n(
|
|
1521
1537
|
Te,
|
|
1522
1538
|
{
|
|
1523
1539
|
onClick: () => b(m.value),
|
|
1524
1540
|
className: l(
|
|
1525
1541
|
"gap-2",
|
|
1526
|
-
|
|
1542
|
+
r === m.value && "bg-accent"
|
|
1527
1543
|
),
|
|
1528
1544
|
children: [
|
|
1529
|
-
/* @__PURE__ */ e(
|
|
1545
|
+
/* @__PURE__ */ e(_, { className: "size-4" }),
|
|
1530
1546
|
/* @__PURE__ */ e("span", { children: m.label })
|
|
1531
1547
|
]
|
|
1532
1548
|
},
|
|
@@ -1534,8 +1550,8 @@ function dn({
|
|
|
1534
1550
|
);
|
|
1535
1551
|
}) })
|
|
1536
1552
|
] }),
|
|
1537
|
-
v && i && /* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */ e(
|
|
1553
|
+
v && i && /* @__PURE__ */ n(re, { children: [
|
|
1554
|
+
/* @__PURE__ */ e(ne, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1539
1555
|
ce,
|
|
1540
1556
|
{
|
|
1541
1557
|
variant: "outline",
|
|
@@ -1555,7 +1571,7 @@ function dn({
|
|
|
1555
1571
|
)
|
|
1556
1572
|
] }),
|
|
1557
1573
|
w,
|
|
1558
|
-
z && /* @__PURE__ */
|
|
1574
|
+
z && /* @__PURE__ */ n(
|
|
1559
1575
|
ce,
|
|
1560
1576
|
{
|
|
1561
1577
|
className: "hidden lg:flex shrink-0 max-h-10",
|
|
@@ -1571,9 +1587,9 @@ function dn({
|
|
|
1571
1587
|
h && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 pb-1 -mb-1 scrollbar-none", children: h })
|
|
1572
1588
|
] });
|
|
1573
1589
|
}
|
|
1574
|
-
function
|
|
1590
|
+
function dr({
|
|
1575
1591
|
events: t,
|
|
1576
|
-
date:
|
|
1592
|
+
date: r,
|
|
1577
1593
|
daysAhead: o = 60,
|
|
1578
1594
|
badgeVariant: a = "colored",
|
|
1579
1595
|
onEventClick: d,
|
|
@@ -1584,11 +1600,11 @@ function cn({
|
|
|
1584
1600
|
classNames: p
|
|
1585
1601
|
}) {
|
|
1586
1602
|
const y = V(() => {
|
|
1587
|
-
const i = new Date(
|
|
1603
|
+
const i = new Date(r);
|
|
1588
1604
|
i.setHours(0, 0, 0, 0);
|
|
1589
1605
|
const v = new Date(i);
|
|
1590
1606
|
return v.setDate(v.getDate() + o), t.filter((h) => h.endDate >= i && h.startDate <= v);
|
|
1591
|
-
}, [t, o,
|
|
1607
|
+
}, [t, o, r]), L = V(() => {
|
|
1592
1608
|
const i = ct(y), v = [];
|
|
1593
1609
|
for (const [h, w] of i)
|
|
1594
1610
|
v.push({
|
|
@@ -1598,21 +1614,21 @@ function cn({
|
|
|
1598
1614
|
});
|
|
1599
1615
|
return v.sort((h, w) => h.date.getTime() - w.date.getTime()), v;
|
|
1600
1616
|
}, [y]);
|
|
1601
|
-
return L.length === 0 ? /* @__PURE__ */ e("div", { className: l("flex flex-col items-center justify-center h-full py-12", g), children: /* @__PURE__ */
|
|
1617
|
+
return L.length === 0 ? /* @__PURE__ */ e("div", { className: l("flex flex-col items-center justify-center h-full py-12", g), children: /* @__PURE__ */ n("div", { className: "text-center", children: [
|
|
1602
1618
|
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "No events found" }),
|
|
1603
1619
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground/70", children: "No events scheduled for this period" })
|
|
1604
|
-
] }) }) : /* @__PURE__ */
|
|
1605
|
-
/* @__PURE__ */ e("div", { className: "sticky top-0 z-10 bg-background border-b px-4 py-3", children: /* @__PURE__ */
|
|
1620
|
+
] }) }) : /* @__PURE__ */ n("div", { className: l("flex flex-col h-full overflow-auto", p?.agendaList, g), children: [
|
|
1621
|
+
/* @__PURE__ */ e("div", { className: "sticky top-0 z-10 bg-background border-b px-4 py-3", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
1606
1622
|
/* @__PURE__ */ e("h2", { className: "text-lg font-medium", children: "Schedule" }),
|
|
1607
|
-
/* @__PURE__ */
|
|
1623
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
|
|
1608
1624
|
y.length,
|
|
1609
1625
|
" event",
|
|
1610
1626
|
y.length !== 1 ? "s" : ""
|
|
1611
1627
|
] })
|
|
1612
1628
|
] }) }),
|
|
1613
1629
|
/* @__PURE__ */ e("div", { className: "flex-1", children: L.map(({ date: i, dateKey: v, events: h }) => {
|
|
1614
|
-
const w = te(i),
|
|
1615
|
-
return /* @__PURE__ */
|
|
1630
|
+
const w = te(i), E = i.toLocaleDateString([], { weekday: "short" }), W = i.getDate(), D = i.toLocaleDateString([], { month: "short" });
|
|
1631
|
+
return /* @__PURE__ */ n("div", { className: l("", p?.agendaDayGroup), children: [
|
|
1616
1632
|
/* @__PURE__ */ e(
|
|
1617
1633
|
"div",
|
|
1618
1634
|
{
|
|
@@ -1620,8 +1636,8 @@ function cn({
|
|
|
1620
1636
|
"sticky top-[52px] z-10 bg-background px-4 py-3 border-b",
|
|
1621
1637
|
p?.agendaDayHeader
|
|
1622
1638
|
),
|
|
1623
|
-
children: /* @__PURE__ */
|
|
1624
|
-
/* @__PURE__ */
|
|
1639
|
+
children: /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
1640
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col items-center min-w-[40px]", children: [
|
|
1625
1641
|
/* @__PURE__ */ e(
|
|
1626
1642
|
"span",
|
|
1627
1643
|
{
|
|
@@ -1629,7 +1645,7 @@ function cn({
|
|
|
1629
1645
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
1630
1646
|
w ? "text-primary" : "text-muted-foreground"
|
|
1631
1647
|
),
|
|
1632
|
-
children:
|
|
1648
|
+
children: E
|
|
1633
1649
|
}
|
|
1634
1650
|
),
|
|
1635
1651
|
/* @__PURE__ */ e(
|
|
@@ -1644,7 +1660,7 @@ function cn({
|
|
|
1644
1660
|
}
|
|
1645
1661
|
)
|
|
1646
1662
|
] }),
|
|
1647
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
|
|
1648
1664
|
D,
|
|
1649
1665
|
" ",
|
|
1650
1666
|
i.getFullYear()
|
|
@@ -1674,17 +1690,17 @@ function cn({
|
|
|
1674
1690
|
}) })
|
|
1675
1691
|
] });
|
|
1676
1692
|
}
|
|
1677
|
-
function
|
|
1693
|
+
function rt({
|
|
1678
1694
|
events: t,
|
|
1679
|
-
date:
|
|
1695
|
+
date: r,
|
|
1680
1696
|
onEventClick: o,
|
|
1681
1697
|
className: a
|
|
1682
1698
|
}) {
|
|
1683
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
|
1699
|
+
return t.length === 0 ? null : /* @__PURE__ */ n("div", { className: l("border-b bg-muted/20 px-2 py-1.5 space-y-1", "sm:px-4 sm:py-2", a), children: [
|
|
1684
1700
|
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children: "All day / Multi-day" }),
|
|
1685
1701
|
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.map((d) => {
|
|
1686
|
-
const g = fe(d.color), c =
|
|
1687
|
-
return /* @__PURE__ */
|
|
1702
|
+
const g = fe(d.color), c = Ae(d.startDate, r), b = Ae(d.endDate, r);
|
|
1703
|
+
return /* @__PURE__ */ n(
|
|
1688
1704
|
"button",
|
|
1689
1705
|
{
|
|
1690
1706
|
type: "button",
|
|
@@ -1708,9 +1724,9 @@ function nt({
|
|
|
1708
1724
|
] });
|
|
1709
1725
|
}
|
|
1710
1726
|
const Yt = 5;
|
|
1711
|
-
function
|
|
1727
|
+
function nt({
|
|
1712
1728
|
slot: t,
|
|
1713
|
-
onSelectionStart:
|
|
1729
|
+
onSelectionStart: r,
|
|
1714
1730
|
onSelectionMove: o,
|
|
1715
1731
|
onSelectionEnd: a,
|
|
1716
1732
|
isSelected: d = !1,
|
|
@@ -1723,31 +1739,31 @@ function rt({
|
|
|
1723
1739
|
style: L,
|
|
1724
1740
|
dataAttributes: i
|
|
1725
1741
|
}) {
|
|
1726
|
-
const v = se(null), h = se(!1), w = se(!1),
|
|
1742
|
+
const v = se(null), h = se(!1), w = se(!1), E = se(null), [W, D] = oe(!1), x = We(), O = M(
|
|
1727
1743
|
(m) => {
|
|
1728
|
-
c || m.button !== 0 && m.pointerType === "mouse" || (m.preventDefault(), v.current = { x: m.clientX, y: m.clientY }, h.current = !1, w.current = !0,
|
|
1744
|
+
c || m.button !== 0 && m.pointerType === "mouse" || (m.preventDefault(), v.current = { x: m.clientX, y: m.clientY }, h.current = !1, w.current = !0, r?.(t));
|
|
1729
1745
|
},
|
|
1730
|
-
[c, t,
|
|
1731
|
-
),
|
|
1746
|
+
[c, t, r]
|
|
1747
|
+
), P = M(
|
|
1732
1748
|
(m) => {
|
|
1733
1749
|
if (!(v.current && w.current && !c)) return;
|
|
1734
|
-
const
|
|
1735
|
-
Math.sqrt(
|
|
1750
|
+
const _ = m.clientX - v.current.x, $ = m.clientY - v.current.y;
|
|
1751
|
+
Math.sqrt(_ * _ + $ * $) >= Yt && (h.current = !0);
|
|
1736
1752
|
},
|
|
1737
1753
|
[c]
|
|
1738
|
-
),
|
|
1754
|
+
), j = M(
|
|
1739
1755
|
(m) => {
|
|
1740
1756
|
c || (m.buttons > 0 || g) && o?.(t);
|
|
1741
1757
|
},
|
|
1742
1758
|
[c, g, t, o]
|
|
1743
|
-
),
|
|
1759
|
+
), B = M(() => {
|
|
1744
1760
|
c || (a?.(), v.current = null, h.current = !1, w.current = !1);
|
|
1745
1761
|
}, [c, a]), F = M(
|
|
1746
1762
|
(m) => {
|
|
1747
1763
|
if (!x?.isDragging || c) return;
|
|
1748
1764
|
m.preventDefault(), m.dataTransfer.dropEffect = "move", D(!0);
|
|
1749
|
-
const
|
|
1750
|
-
x.updateDragPreview?.(t.date,
|
|
1765
|
+
const _ = /* @__PURE__ */ new Date(), $ = t.hour ?? _.getHours(), N = t.minute ?? (_.getMinutes() >= 30 ? 30 : 0);
|
|
1766
|
+
x.updateDragPreview?.(t.date, $, N);
|
|
1751
1767
|
},
|
|
1752
1768
|
[x, c, t]
|
|
1753
1769
|
), u = M(() => {
|
|
@@ -1766,26 +1782,26 @@ function rt({
|
|
|
1766
1782
|
window.removeEventListener("pointerup", m), window.removeEventListener("pointercancel", m);
|
|
1767
1783
|
};
|
|
1768
1784
|
}, []);
|
|
1769
|
-
const
|
|
1785
|
+
const I = M(
|
|
1770
1786
|
(m) => {
|
|
1771
|
-
c || (m.key === "Enter" || m.key === " ") && (m.preventDefault(),
|
|
1787
|
+
c || (m.key === "Enter" || m.key === " ") && (m.preventDefault(), r?.(t), a?.());
|
|
1772
1788
|
},
|
|
1773
|
-
[c, t,
|
|
1789
|
+
[c, t, r, a]
|
|
1774
1790
|
);
|
|
1775
1791
|
return /* @__PURE__ */ e(
|
|
1776
1792
|
"button",
|
|
1777
1793
|
{
|
|
1778
|
-
ref:
|
|
1794
|
+
ref: E,
|
|
1779
1795
|
type: "button",
|
|
1780
1796
|
"aria-label": b,
|
|
1781
1797
|
"aria-disabled": c,
|
|
1782
1798
|
"aria-pressed": d,
|
|
1783
1799
|
disabled: c,
|
|
1784
1800
|
onPointerDown: O,
|
|
1785
|
-
onPointerMove:
|
|
1786
|
-
onPointerUp:
|
|
1787
|
-
onPointerEnter:
|
|
1788
|
-
onKeyDown:
|
|
1801
|
+
onPointerMove: P,
|
|
1802
|
+
onPointerUp: B,
|
|
1803
|
+
onPointerEnter: j,
|
|
1804
|
+
onKeyDown: I,
|
|
1789
1805
|
onDragOver: F,
|
|
1790
1806
|
onDragLeave: u,
|
|
1791
1807
|
onDrop: k,
|
|
@@ -1810,23 +1826,23 @@ function rt({
|
|
|
1810
1826
|
}
|
|
1811
1827
|
function ot({
|
|
1812
1828
|
slot: t,
|
|
1813
|
-
date:
|
|
1829
|
+
date: r,
|
|
1814
1830
|
hour: o,
|
|
1815
1831
|
minute: a,
|
|
1816
1832
|
ariaLabel: d,
|
|
1817
1833
|
...g
|
|
1818
1834
|
}) {
|
|
1819
|
-
const c = t ?? { date:
|
|
1820
|
-
return /* @__PURE__ */ e(
|
|
1835
|
+
const c = t ?? { date: r, hour: o ?? 0, minute: a ?? 0 }, b = d ?? `Add event at ${(c.hour ?? 0).toString().padStart(2, "0")}:${(c.minute ?? 0).toString().padStart(2, "0")} on ${c.date.toLocaleDateString()}`;
|
|
1836
|
+
return /* @__PURE__ */ e(nt, { slot: c, ariaLabel: b, ...g });
|
|
1821
1837
|
}
|
|
1822
|
-
function Xt({ slot: t, date:
|
|
1823
|
-
const d = t ?? { date:
|
|
1824
|
-
return /* @__PURE__ */ e(
|
|
1838
|
+
function Xt({ slot: t, date: r, ariaLabel: o, ...a }) {
|
|
1839
|
+
const d = t ?? { date: r }, g = o ?? `Select ${d.date.toLocaleDateString()}`;
|
|
1840
|
+
return /* @__PURE__ */ e(nt, { slot: d, ariaLabel: g, ...a });
|
|
1825
1841
|
}
|
|
1826
1842
|
const me = 96, Ne = 72, ke = 80;
|
|
1827
|
-
function
|
|
1843
|
+
function cr({
|
|
1828
1844
|
events: t,
|
|
1829
|
-
date:
|
|
1845
|
+
date: r,
|
|
1830
1846
|
visibleHours: o = { startHour: 0, endHour: 24 },
|
|
1831
1847
|
workingHours: a,
|
|
1832
1848
|
slotDuration: d = 30,
|
|
@@ -1844,26 +1860,26 @@ function un({
|
|
|
1844
1860
|
for (let s = 0; s < v; s++)
|
|
1845
1861
|
C.push(s * d);
|
|
1846
1862
|
return C;
|
|
1847
|
-
}, [v, d]),
|
|
1848
|
-
const C = Ye(W,
|
|
1863
|
+
}, [v, d]), E = V(() => Le(t, r), [t, r]), { singleDay: W, multiDay: D } = V(() => Ke(E), [E]), x = V(() => {
|
|
1864
|
+
const C = Ye(W, r, o, me), s = /* @__PURE__ */ new Map();
|
|
1849
1865
|
for (const f of C)
|
|
1850
1866
|
s.set(f.event.id, f.position);
|
|
1851
1867
|
return s;
|
|
1852
|
-
}, [W,
|
|
1853
|
-
if (!
|
|
1854
|
-
const C =
|
|
1868
|
+
}, [W, r, o]), O = V(() => Xe(o), [o]), P = /* @__PURE__ */ new Date(), j = te(r), B = V(() => {
|
|
1869
|
+
if (!j) return 0;
|
|
1870
|
+
const C = P.getHours() + P.getMinutes() / 60;
|
|
1855
1871
|
return C < o.startHour || C > o.endHour ? -1 : (C - o.startHour) * me;
|
|
1856
|
-
}, [
|
|
1872
|
+
}, [j, o, P]), F = se(null);
|
|
1857
1873
|
qe(() => {
|
|
1858
1874
|
const C = F.current;
|
|
1859
1875
|
if (!C) return;
|
|
1860
1876
|
const s = () => {
|
|
1861
1877
|
let f;
|
|
1862
|
-
if (
|
|
1863
|
-
const
|
|
1864
|
-
f = Math.max(
|
|
1878
|
+
if (j) {
|
|
1879
|
+
const A = (/* @__PURE__ */ new Date()).getHours();
|
|
1880
|
+
f = Math.max(A - 1, o.startHour);
|
|
1865
1881
|
} else {
|
|
1866
|
-
const
|
|
1882
|
+
const A = r.getDay(), T = a?.[A];
|
|
1867
1883
|
T?.enabled && T.from > 0 ? f = Math.max(T.from - 1, o.startHour) : f = Math.max(7, o.startHour);
|
|
1868
1884
|
}
|
|
1869
1885
|
const S = (f - o.startHour) * me;
|
|
@@ -1875,26 +1891,26 @@ function un({
|
|
|
1875
1891
|
requestAnimationFrame(() => {
|
|
1876
1892
|
requestAnimationFrame(s);
|
|
1877
1893
|
});
|
|
1878
|
-
}, [
|
|
1879
|
-
const u =
|
|
1894
|
+
}, [r, a, o, j]);
|
|
1895
|
+
const u = _e(), k = M(
|
|
1880
1896
|
(C) => {
|
|
1881
1897
|
u?.startSelection(C);
|
|
1882
1898
|
},
|
|
1883
1899
|
[u]
|
|
1884
|
-
),
|
|
1900
|
+
), I = M(
|
|
1885
1901
|
(C) => {
|
|
1886
1902
|
u?.updateSelection(C);
|
|
1887
1903
|
},
|
|
1888
1904
|
[u]
|
|
1889
1905
|
), m = M(() => {
|
|
1890
1906
|
u?.endSelection();
|
|
1891
|
-
}, [u]),
|
|
1907
|
+
}, [u]), _ = M(
|
|
1892
1908
|
(C) => {
|
|
1893
1909
|
c?.(C);
|
|
1894
1910
|
},
|
|
1895
1911
|
[c]
|
|
1896
|
-
),
|
|
1897
|
-
return /* @__PURE__ */
|
|
1912
|
+
), $ = r.toLocaleDateString([], { weekday: "short" }), N = r.getDate(), G = te(r);
|
|
1913
|
+
return /* @__PURE__ */ n("div", { className: l("flex flex-col h-full", z), children: [
|
|
1898
1914
|
/* @__PURE__ */ e(
|
|
1899
1915
|
"div",
|
|
1900
1916
|
{
|
|
@@ -1903,7 +1919,7 @@ function un({
|
|
|
1903
1919
|
i?.columnHeader,
|
|
1904
1920
|
G && i?.columnHeaderToday
|
|
1905
1921
|
),
|
|
1906
|
-
children: /* @__PURE__ */
|
|
1922
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col items-center", children: [
|
|
1907
1923
|
/* @__PURE__ */ e(
|
|
1908
1924
|
"span",
|
|
1909
1925
|
{
|
|
@@ -1911,7 +1927,7 @@ function un({
|
|
|
1911
1927
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
1912
1928
|
G ? "text-primary" : "text-muted-foreground"
|
|
1913
1929
|
),
|
|
1914
|
-
children:
|
|
1930
|
+
children: $
|
|
1915
1931
|
}
|
|
1916
1932
|
),
|
|
1917
1933
|
/* @__PURE__ */ e(
|
|
@@ -1929,11 +1945,11 @@ function un({
|
|
|
1929
1945
|
}
|
|
1930
1946
|
),
|
|
1931
1947
|
D.length > 0 && /* @__PURE__ */ e(
|
|
1932
|
-
|
|
1948
|
+
rt,
|
|
1933
1949
|
{
|
|
1934
1950
|
events: D,
|
|
1935
|
-
date:
|
|
1936
|
-
onEventClick:
|
|
1951
|
+
date: r,
|
|
1952
|
+
onEventClick: _,
|
|
1937
1953
|
...i?.multiDayBanner && { className: i.multiDayBanner }
|
|
1938
1954
|
}
|
|
1939
1955
|
),
|
|
@@ -1942,10 +1958,10 @@ function un({
|
|
|
1942
1958
|
{
|
|
1943
1959
|
ref: F,
|
|
1944
1960
|
className: l("flex-1 overflow-auto", i?.scrollContainer),
|
|
1945
|
-
children: /* @__PURE__ */
|
|
1961
|
+
children: /* @__PURE__ */ n("div", { className: "relative min-h-full", children: [
|
|
1946
1962
|
O.map((C, s) => {
|
|
1947
|
-
const S = !Je(
|
|
1948
|
-
return /* @__PURE__ */
|
|
1963
|
+
const S = !Je(r, C, a);
|
|
1964
|
+
return /* @__PURE__ */ n(
|
|
1949
1965
|
"div",
|
|
1950
1966
|
{
|
|
1951
1967
|
className: l(
|
|
@@ -1976,25 +1992,25 @@ function un({
|
|
|
1976
1992
|
) })
|
|
1977
1993
|
}
|
|
1978
1994
|
),
|
|
1979
|
-
/* @__PURE__ */
|
|
1980
|
-
|
|
1995
|
+
/* @__PURE__ */ n("div", { className: "relative flex-1", children: [
|
|
1996
|
+
j && !S && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-primary/5" }),
|
|
1981
1997
|
s !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
|
|
1982
|
-
w.slice(1).map((
|
|
1998
|
+
w.slice(1).map((A) => /* @__PURE__ */ e(
|
|
1983
1999
|
"div",
|
|
1984
2000
|
{
|
|
1985
2001
|
className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
|
|
1986
|
-
style: { top: `${
|
|
2002
|
+
style: { top: `${A / 60 * 100}%` }
|
|
1987
2003
|
},
|
|
1988
|
-
|
|
2004
|
+
A
|
|
1989
2005
|
)),
|
|
1990
|
-
w.map((
|
|
1991
|
-
const q = { date:
|
|
2006
|
+
w.map((A, T) => {
|
|
2007
|
+
const q = { date: r, hour: C, minute: A };
|
|
1992
2008
|
return /* @__PURE__ */ e(
|
|
1993
2009
|
ot,
|
|
1994
2010
|
{
|
|
1995
2011
|
slot: q,
|
|
1996
2012
|
onSelectionStart: k,
|
|
1997
|
-
onSelectionMove:
|
|
2013
|
+
onSelectionMove: I,
|
|
1998
2014
|
onSelectionEnd: m,
|
|
1999
2015
|
isSelected: u?.isSlotSelected(q) ?? !1,
|
|
2000
2016
|
isSelecting: u?.isSelecting ?? !1,
|
|
@@ -2004,9 +2020,9 @@ function un({
|
|
|
2004
2020
|
top: `${T * h}%`,
|
|
2005
2021
|
height: `${h}%`
|
|
2006
2022
|
},
|
|
2007
|
-
ariaLabel: `Add event at ${we(C)}:${String(
|
|
2023
|
+
ariaLabel: `Add event at ${we(C)}:${String(A).padStart(2, "0")}`
|
|
2008
2024
|
},
|
|
2009
|
-
|
|
2025
|
+
A
|
|
2010
2026
|
);
|
|
2011
2027
|
})
|
|
2012
2028
|
] })
|
|
@@ -2059,7 +2075,7 @@ function un({
|
|
|
2059
2075
|
})
|
|
2060
2076
|
}
|
|
2061
2077
|
),
|
|
2062
|
-
|
|
2078
|
+
j && B >= 0 && /* @__PURE__ */ n(
|
|
2063
2079
|
"div",
|
|
2064
2080
|
{
|
|
2065
2081
|
className: l(
|
|
@@ -2067,7 +2083,7 @@ function un({
|
|
|
2067
2083
|
i?.currentTimeIndicator
|
|
2068
2084
|
),
|
|
2069
2085
|
style: {
|
|
2070
|
-
top:
|
|
2086
|
+
top: B,
|
|
2071
2087
|
left: Ne
|
|
2072
2088
|
},
|
|
2073
2089
|
children: [
|
|
@@ -2098,9 +2114,9 @@ const Jt = [
|
|
|
2098
2114
|
{ full: "Friday", short: "Fri", tiny: "F" },
|
|
2099
2115
|
{ full: "Saturday", short: "Sat", tiny: "S" }
|
|
2100
2116
|
], ge = 3;
|
|
2101
|
-
function
|
|
2117
|
+
function ur({
|
|
2102
2118
|
events: t,
|
|
2103
|
-
date:
|
|
2119
|
+
date: r,
|
|
2104
2120
|
weekStartsOn: o = 1,
|
|
2105
2121
|
badgeVariant: a = "colored",
|
|
2106
2122
|
onEventClick: d,
|
|
@@ -2113,32 +2129,32 @@ function mn({
|
|
|
2113
2129
|
slots: L,
|
|
2114
2130
|
classNames: i
|
|
2115
2131
|
}) {
|
|
2116
|
-
const v = L?.dayCellHeader, h = L?.dayCellFooter, [w,
|
|
2132
|
+
const v = L?.dayCellHeader, h = L?.dayCellFooter, [w, E] = oe(null), W = V(() => ut(r, o), [r, o]), D = V(() => {
|
|
2117
2133
|
const u = /* @__PURE__ */ new Map();
|
|
2118
2134
|
for (const k of W) {
|
|
2119
|
-
const
|
|
2120
|
-
m.sort((
|
|
2135
|
+
const I = k.date.toDateString(), m = Le(t, k.date);
|
|
2136
|
+
m.sort((_, $) => _.startDate.getTime() - $.startDate.getTime()), u.set(I, m);
|
|
2121
2137
|
}
|
|
2122
2138
|
return u;
|
|
2123
|
-
}, [W, t]), x =
|
|
2139
|
+
}, [W, t]), x = _e(), O = M(
|
|
2124
2140
|
(u) => {
|
|
2125
2141
|
x?.startSelection(u);
|
|
2126
2142
|
},
|
|
2127
2143
|
[x]
|
|
2128
|
-
),
|
|
2144
|
+
), P = M(
|
|
2129
2145
|
(u) => {
|
|
2130
2146
|
x?.updateSelection(u);
|
|
2131
2147
|
},
|
|
2132
2148
|
[x]
|
|
2133
|
-
),
|
|
2149
|
+
), j = M(() => {
|
|
2134
2150
|
x?.endSelection();
|
|
2135
|
-
}, [x]),
|
|
2151
|
+
}, [x]), B = M(
|
|
2136
2152
|
(u) => {
|
|
2137
2153
|
c?.(u);
|
|
2138
2154
|
},
|
|
2139
2155
|
[c]
|
|
2140
2156
|
), F = o === 0 ? Zt : Jt;
|
|
2141
|
-
return /* @__PURE__ */ e("div", { className: l("flex flex-col h-full overflow-hidden", b), children: /* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-auto", children: /* @__PURE__ */
|
|
2157
|
+
return /* @__PURE__ */ e("div", { className: l("flex flex-col h-full overflow-hidden", b), children: /* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col flex-1 min-w-[560px] sm:min-w-0", children: [
|
|
2142
2158
|
/* @__PURE__ */ e(
|
|
2143
2159
|
"div",
|
|
2144
2160
|
{
|
|
@@ -2146,7 +2162,7 @@ function mn({
|
|
|
2146
2162
|
"grid grid-cols-7 border-b !sticky !top-0 bg-background z-10",
|
|
2147
2163
|
i?.weekdayHeader
|
|
2148
2164
|
),
|
|
2149
|
-
children: F.map((u, k) => /* @__PURE__ */
|
|
2165
|
+
children: F.map((u, k) => /* @__PURE__ */ n(
|
|
2150
2166
|
"div",
|
|
2151
2167
|
{
|
|
2152
2168
|
className: l(
|
|
@@ -2165,27 +2181,27 @@ function mn({
|
|
|
2165
2181
|
}
|
|
2166
2182
|
),
|
|
2167
2183
|
/* @__PURE__ */ e("div", { className: l("grid grid-cols-7 auto-rows-min", i?.monthGrid), children: W.map((u) => {
|
|
2168
|
-
const k = u.date.toDateString(),
|
|
2169
|
-
return /* @__PURE__ */
|
|
2184
|
+
const k = u.date.toDateString(), I = D.get(k) || [], m = te(u.date), _ = u.date.getDay() === 0 || u.date.getDay() === 6, $ = I.length > ge;
|
|
2185
|
+
return /* @__PURE__ */ n(
|
|
2170
2186
|
Xt,
|
|
2171
2187
|
{
|
|
2172
2188
|
date: u.date,
|
|
2173
2189
|
onSelectionStart: O,
|
|
2174
|
-
onSelectionMove:
|
|
2175
|
-
onSelectionEnd:
|
|
2190
|
+
onSelectionMove: P,
|
|
2191
|
+
onSelectionEnd: j,
|
|
2176
2192
|
isSelected: x?.isSlotSelected({ date: u.date }) ?? !1,
|
|
2177
2193
|
isSelecting: x?.isSelecting ?? !1,
|
|
2178
2194
|
className: l(
|
|
2179
2195
|
"relative flex flex-col border-r border-b text-left min-h-[80px] sm:min-h-[100px] overflow-hidden",
|
|
2180
2196
|
"[&:nth-child(7n)]:border-r-0",
|
|
2181
2197
|
!u.isCurrentMonth && "bg-muted/20",
|
|
2182
|
-
|
|
2198
|
+
_ && u.isCurrentMonth && "bg-muted/10",
|
|
2183
2199
|
i?.dayCell,
|
|
2184
2200
|
m && i?.dayCellToday,
|
|
2185
2201
|
!u.isCurrentMonth && i?.dayCellOutside,
|
|
2186
|
-
|
|
2202
|
+
_ && i?.dayCellWeekend
|
|
2187
2203
|
),
|
|
2188
|
-
ariaLabel: `${u.date.toLocaleDateString()} - ${
|
|
2204
|
+
ariaLabel: `${u.date.toLocaleDateString()} - ${I.length} events. Click to create event, double-click to view day.`,
|
|
2189
2205
|
children: [
|
|
2190
2206
|
/* @__PURE__ */ e(
|
|
2191
2207
|
"div",
|
|
@@ -2200,7 +2216,7 @@ function mn({
|
|
|
2200
2216
|
{
|
|
2201
2217
|
type: "button",
|
|
2202
2218
|
onClick: (N) => {
|
|
2203
|
-
N.stopPropagation(),
|
|
2219
|
+
N.stopPropagation(), B(u.date);
|
|
2204
2220
|
},
|
|
2205
2221
|
className: l(
|
|
2206
2222
|
"flex items-center justify-center rounded-full transition-colors",
|
|
@@ -2216,14 +2232,14 @@ function mn({
|
|
|
2216
2232
|
v,
|
|
2217
2233
|
{
|
|
2218
2234
|
date: u.date,
|
|
2219
|
-
events:
|
|
2235
|
+
events: I,
|
|
2220
2236
|
isToday: m,
|
|
2221
2237
|
isCurrentMonth: u.isCurrentMonth,
|
|
2222
|
-
isWeekend:
|
|
2238
|
+
isWeekend: _,
|
|
2223
2239
|
view: "month"
|
|
2224
2240
|
}
|
|
2225
2241
|
),
|
|
2226
|
-
/* @__PURE__ */
|
|
2242
|
+
/* @__PURE__ */ n(
|
|
2227
2243
|
"div",
|
|
2228
2244
|
{
|
|
2229
2245
|
className: l(
|
|
@@ -2231,7 +2247,7 @@ function mn({
|
|
|
2231
2247
|
i?.dayCellContent
|
|
2232
2248
|
),
|
|
2233
2249
|
children: [
|
|
2234
|
-
|
|
2250
|
+
I.slice(0, ge).map((N) => /* @__PURE__ */ e(
|
|
2235
2251
|
"div",
|
|
2236
2252
|
{
|
|
2237
2253
|
onPointerDown: (G) => {
|
|
@@ -2256,19 +2272,19 @@ function mn({
|
|
|
2256
2272
|
},
|
|
2257
2273
|
N.id
|
|
2258
2274
|
)),
|
|
2259
|
-
|
|
2260
|
-
|
|
2275
|
+
$ && (y ? /* @__PURE__ */ n(
|
|
2276
|
+
re,
|
|
2261
2277
|
{
|
|
2262
2278
|
open: w === k,
|
|
2263
|
-
onOpenChange: (N) =>
|
|
2279
|
+
onOpenChange: (N) => E(N ? k : null),
|
|
2264
2280
|
children: [
|
|
2265
|
-
/* @__PURE__ */ e(
|
|
2281
|
+
/* @__PURE__ */ e(ne, { asChild: !0, children: /* @__PURE__ */ n(
|
|
2266
2282
|
"button",
|
|
2267
2283
|
{
|
|
2268
2284
|
type: "button",
|
|
2269
2285
|
onPointerDown: (N) => N.stopPropagation(),
|
|
2270
2286
|
onClick: (N) => {
|
|
2271
|
-
N.stopPropagation(),
|
|
2287
|
+
N.stopPropagation(), E(k);
|
|
2272
2288
|
},
|
|
2273
2289
|
className: l(
|
|
2274
2290
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
@@ -2276,12 +2292,12 @@ function mn({
|
|
|
2276
2292
|
),
|
|
2277
2293
|
children: [
|
|
2278
2294
|
"+",
|
|
2279
|
-
|
|
2295
|
+
I.length - ge,
|
|
2280
2296
|
" more"
|
|
2281
2297
|
]
|
|
2282
2298
|
}
|
|
2283
2299
|
) }),
|
|
2284
|
-
/* @__PURE__ */
|
|
2300
|
+
/* @__PURE__ */ n(
|
|
2285
2301
|
Q,
|
|
2286
2302
|
{
|
|
2287
2303
|
align: "start",
|
|
@@ -2290,25 +2306,25 @@ function mn({
|
|
|
2290
2306
|
className: "w-72 max-h-80 overflow-y-auto p-2",
|
|
2291
2307
|
onPointerDown: (N) => N.stopPropagation(),
|
|
2292
2308
|
children: [
|
|
2293
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between mb-2 pb-2 border-b", children: [
|
|
2294
2310
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: u.date.toLocaleDateString(void 0, {
|
|
2295
2311
|
weekday: "short",
|
|
2296
2312
|
month: "short",
|
|
2297
2313
|
day: "numeric"
|
|
2298
2314
|
}) }),
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
|
|
2315
|
+
/* @__PURE__ */ n("span", { className: "text-xs text-muted-foreground", children: [
|
|
2316
|
+
I.length,
|
|
2301
2317
|
" events"
|
|
2302
2318
|
] })
|
|
2303
2319
|
] }),
|
|
2304
|
-
/* @__PURE__ */ e("div", { className: "space-y-1.5", children:
|
|
2320
|
+
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: I.map((N) => /* @__PURE__ */ e("div", { children: z ? z({ event: N, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2305
2321
|
Ce,
|
|
2306
2322
|
{
|
|
2307
2323
|
event: N,
|
|
2308
2324
|
variant: "compact",
|
|
2309
2325
|
badgeVariant: a,
|
|
2310
2326
|
onClick: (G) => {
|
|
2311
|
-
|
|
2327
|
+
E(null), d?.(G);
|
|
2312
2328
|
},
|
|
2313
2329
|
disablePopover: !!d && !p,
|
|
2314
2330
|
renderPopover: p,
|
|
@@ -2320,11 +2336,11 @@ function mn({
|
|
|
2320
2336
|
)
|
|
2321
2337
|
]
|
|
2322
2338
|
}
|
|
2323
|
-
) : /* @__PURE__ */
|
|
2339
|
+
) : /* @__PURE__ */ n(
|
|
2324
2340
|
"div",
|
|
2325
2341
|
{
|
|
2326
2342
|
onPointerDown: (N) => {
|
|
2327
|
-
N.stopPropagation(),
|
|
2343
|
+
N.stopPropagation(), B(u.date);
|
|
2328
2344
|
},
|
|
2329
2345
|
className: l(
|
|
2330
2346
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
@@ -2332,7 +2348,7 @@ function mn({
|
|
|
2332
2348
|
),
|
|
2333
2349
|
children: [
|
|
2334
2350
|
"+",
|
|
2335
|
-
|
|
2351
|
+
I.length - ge,
|
|
2336
2352
|
" more"
|
|
2337
2353
|
]
|
|
2338
2354
|
}
|
|
@@ -2344,10 +2360,10 @@ function mn({
|
|
|
2344
2360
|
h,
|
|
2345
2361
|
{
|
|
2346
2362
|
date: u.date,
|
|
2347
|
-
events:
|
|
2363
|
+
events: I,
|
|
2348
2364
|
isToday: m,
|
|
2349
2365
|
isCurrentMonth: u.isCurrentMonth,
|
|
2350
|
-
isWeekend:
|
|
2366
|
+
isWeekend: _,
|
|
2351
2367
|
view: "month"
|
|
2352
2368
|
}
|
|
2353
2369
|
)
|
|
@@ -2359,9 +2375,9 @@ function mn({
|
|
|
2359
2375
|
] }) }) });
|
|
2360
2376
|
}
|
|
2361
2377
|
const ie = 96, xe = 56, Ue = 72, X = 120, be = 100, Qt = 3;
|
|
2362
|
-
function
|
|
2378
|
+
function mr({
|
|
2363
2379
|
events: t,
|
|
2364
|
-
date:
|
|
2380
|
+
date: r,
|
|
2365
2381
|
weekStartsOn: o = 1,
|
|
2366
2382
|
visibleHours: a = { startHour: 0, endHour: 24 },
|
|
2367
2383
|
workingHours: d,
|
|
@@ -2376,21 +2392,21 @@ function hn({
|
|
|
2376
2392
|
slots: v,
|
|
2377
2393
|
classNames: h
|
|
2378
2394
|
}) {
|
|
2379
|
-
const w = 60 / g,
|
|
2395
|
+
const w = 60 / g, E = 100 / w, W = V(() => {
|
|
2380
2396
|
const s = [];
|
|
2381
2397
|
for (let f = 0; f < w; f++)
|
|
2382
2398
|
s.push(f * g);
|
|
2383
2399
|
return s;
|
|
2384
2400
|
}, [w, g]), D = V(
|
|
2385
|
-
() => mt(
|
|
2386
|
-
[
|
|
2401
|
+
() => mt(r, o),
|
|
2402
|
+
[r, o]
|
|
2387
2403
|
), x = V(
|
|
2388
2404
|
() => Xe(a),
|
|
2389
2405
|
[a]
|
|
2390
2406
|
), O = V(() => {
|
|
2391
2407
|
const s = /* @__PURE__ */ new Map();
|
|
2392
2408
|
for (const f of D) {
|
|
2393
|
-
const S = f.toDateString(),
|
|
2409
|
+
const S = f.toDateString(), A = Le(t, f), { singleDay: T, multiDay: q } = Ke(A), R = Ye(
|
|
2394
2410
|
T,
|
|
2395
2411
|
f,
|
|
2396
2412
|
a,
|
|
@@ -2410,23 +2426,23 @@ function hn({
|
|
|
2410
2426
|
});
|
|
2411
2427
|
}
|
|
2412
2428
|
return s;
|
|
2413
|
-
}, [D, t, a]),
|
|
2429
|
+
}, [D, t, a]), P = V(() => {
|
|
2414
2430
|
const s = /* @__PURE__ */ new Map();
|
|
2415
2431
|
for (const { multiDay: f } of O.values())
|
|
2416
2432
|
for (const S of f)
|
|
2417
2433
|
s.set(S.id, S);
|
|
2418
2434
|
return Array.from(s.values());
|
|
2419
|
-
}, [O]),
|
|
2420
|
-
if (
|
|
2421
|
-
const s =
|
|
2435
|
+
}, [O]), j = /* @__PURE__ */ new Date(), B = D.findIndex((s) => te(s)), F = V(() => {
|
|
2436
|
+
if (B < 0) return -1;
|
|
2437
|
+
const s = j.getHours() + j.getMinutes() / 60;
|
|
2422
2438
|
return s < a.startHour || s > a.endHour ? -1 : (s - a.startHour) * ie;
|
|
2423
|
-
}, [
|
|
2439
|
+
}, [B, a, j]), u = se(null);
|
|
2424
2440
|
qe(() => {
|
|
2425
2441
|
const s = u.current;
|
|
2426
2442
|
if (!s) return;
|
|
2427
2443
|
const f = () => {
|
|
2428
2444
|
let S;
|
|
2429
|
-
if (
|
|
2445
|
+
if (B !== -1) {
|
|
2430
2446
|
const T = (/* @__PURE__ */ new Date()).getHours();
|
|
2431
2447
|
S = Math.max(T - 1, a.startHour);
|
|
2432
2448
|
} else {
|
|
@@ -2441,17 +2457,17 @@ function hn({
|
|
|
2441
2457
|
a.startHour
|
|
2442
2458
|
) : S = Math.max(7, a.startHour);
|
|
2443
2459
|
}
|
|
2444
|
-
const
|
|
2460
|
+
const A = (S - a.startHour) * ie;
|
|
2445
2461
|
s.scrollTo({
|
|
2446
|
-
top:
|
|
2462
|
+
top: A,
|
|
2447
2463
|
behavior: "instant"
|
|
2448
2464
|
});
|
|
2449
2465
|
};
|
|
2450
2466
|
requestAnimationFrame(() => {
|
|
2451
2467
|
requestAnimationFrame(f);
|
|
2452
2468
|
});
|
|
2453
|
-
}, [
|
|
2454
|
-
const k =
|
|
2469
|
+
}, [r, d, a, B]);
|
|
2470
|
+
const k = _e(), I = M(
|
|
2455
2471
|
(s) => {
|
|
2456
2472
|
k?.startSelection(s);
|
|
2457
2473
|
},
|
|
@@ -2461,9 +2477,9 @@ function hn({
|
|
|
2461
2477
|
k?.updateSelection(s);
|
|
2462
2478
|
},
|
|
2463
2479
|
[k]
|
|
2464
|
-
),
|
|
2480
|
+
), _ = M(() => {
|
|
2465
2481
|
k?.endSelection();
|
|
2466
|
-
}, [k]),
|
|
2482
|
+
}, [k]), $ = M(
|
|
2467
2483
|
(s) => {
|
|
2468
2484
|
b?.(s);
|
|
2469
2485
|
},
|
|
@@ -2478,13 +2494,13 @@ function hn({
|
|
|
2478
2494
|
}
|
|
2479
2495
|
return s;
|
|
2480
2496
|
}, [D, O]), C = xe + G.reduce((s, f) => s + f, 0);
|
|
2481
|
-
return /* @__PURE__ */
|
|
2482
|
-
|
|
2483
|
-
|
|
2497
|
+
return /* @__PURE__ */ n("div", { className: l("ic-week-view flex flex-col h-full", y), children: [
|
|
2498
|
+
P.length > 0 && /* @__PURE__ */ e(
|
|
2499
|
+
rt,
|
|
2484
2500
|
{
|
|
2485
|
-
events:
|
|
2486
|
-
date: ht(
|
|
2487
|
-
onEventClick:
|
|
2501
|
+
events: P,
|
|
2502
|
+
date: ht(r, o),
|
|
2503
|
+
onEventClick: $,
|
|
2488
2504
|
...h?.multiDayBanner && {
|
|
2489
2505
|
className: h.multiDayBanner
|
|
2490
2506
|
}
|
|
@@ -2498,14 +2514,14 @@ function hn({
|
|
|
2498
2514
|
"ic-week-scroll-container flex-1",
|
|
2499
2515
|
h?.scrollContainer
|
|
2500
2516
|
),
|
|
2501
|
-
children: /* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */ e("div", { className: "ic-week-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */
|
|
2517
|
+
children: /* @__PURE__ */ n("div", { style: { minWidth: Math.max(N, C) }, children: [
|
|
2518
|
+
/* @__PURE__ */ e("div", { className: "ic-week-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */ n("div", { className: "flex", children: [
|
|
2503
2519
|
/* @__PURE__ */ e(
|
|
2504
2520
|
"div",
|
|
2505
2521
|
{
|
|
2506
2522
|
className: "flex-shrink-0 flex items-end justify-center pb-2 text-[10px] text-muted-foreground/70",
|
|
2507
2523
|
style: { width: xe, height: Ue },
|
|
2508
|
-
children: /* @__PURE__ */
|
|
2524
|
+
children: /* @__PURE__ */ n("span", { className: "hidden sm:inline", children: [
|
|
2509
2525
|
"GMT",
|
|
2510
2526
|
(() => {
|
|
2511
2527
|
const s = (/* @__PURE__ */ new Date()).getTimezoneOffset(), f = Math.abs(Math.floor(s / 60)), S = s <= 0 ? "+" : "-";
|
|
@@ -2515,8 +2531,8 @@ function hn({
|
|
|
2515
2531
|
}
|
|
2516
2532
|
),
|
|
2517
2533
|
D.map((s, f) => {
|
|
2518
|
-
const S = te(s),
|
|
2519
|
-
return /* @__PURE__ */
|
|
2534
|
+
const S = te(s), A = G[f] ?? X, T = A > X;
|
|
2535
|
+
return /* @__PURE__ */ n(
|
|
2520
2536
|
"div",
|
|
2521
2537
|
{
|
|
2522
2538
|
className: l(
|
|
@@ -2526,7 +2542,7 @@ function hn({
|
|
|
2526
2542
|
),
|
|
2527
2543
|
style: {
|
|
2528
2544
|
height: Ue,
|
|
2529
|
-
minWidth: T ?
|
|
2545
|
+
minWidth: T ? A : X
|
|
2530
2546
|
},
|
|
2531
2547
|
children: [
|
|
2532
2548
|
/* @__PURE__ */ e(
|
|
@@ -2558,7 +2574,7 @@ function hn({
|
|
|
2558
2574
|
);
|
|
2559
2575
|
})
|
|
2560
2576
|
] }) }),
|
|
2561
|
-
/* @__PURE__ */
|
|
2577
|
+
/* @__PURE__ */ n("div", { className: "relative flex", children: [
|
|
2562
2578
|
/* @__PURE__ */ e(
|
|
2563
2579
|
"div",
|
|
2564
2580
|
{
|
|
@@ -2588,8 +2604,8 @@ function hn({
|
|
|
2588
2604
|
}
|
|
2589
2605
|
),
|
|
2590
2606
|
/* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children: D.map((s, f) => {
|
|
2591
|
-
const S = s.toDateString(),
|
|
2592
|
-
return /* @__PURE__ */
|
|
2607
|
+
const S = s.toDateString(), A = O.get(S), T = G[f] ?? X, q = T > X;
|
|
2608
|
+
return /* @__PURE__ */ n(
|
|
2593
2609
|
"div",
|
|
2594
2610
|
{
|
|
2595
2611
|
className: "ic-day-column relative flex-1",
|
|
@@ -2603,7 +2619,7 @@ function hn({
|
|
|
2603
2619
|
R,
|
|
2604
2620
|
d
|
|
2605
2621
|
);
|
|
2606
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ n(
|
|
2607
2623
|
"div",
|
|
2608
2624
|
{
|
|
2609
2625
|
className: l(
|
|
@@ -2625,7 +2641,7 @@ function hn({
|
|
|
2625
2641
|
J
|
|
2626
2642
|
)),
|
|
2627
2643
|
W.map((J, at) => {
|
|
2628
|
-
const
|
|
2644
|
+
const Ie = {
|
|
2629
2645
|
date: s,
|
|
2630
2646
|
hour: R,
|
|
2631
2647
|
minute: J
|
|
@@ -2633,17 +2649,17 @@ function hn({
|
|
|
2633
2649
|
return /* @__PURE__ */ e(
|
|
2634
2650
|
ot,
|
|
2635
2651
|
{
|
|
2636
|
-
slot:
|
|
2637
|
-
onSelectionStart:
|
|
2652
|
+
slot: Ie,
|
|
2653
|
+
onSelectionStart: I,
|
|
2638
2654
|
onSelectionMove: m,
|
|
2639
|
-
onSelectionEnd:
|
|
2640
|
-
isSelected: k?.isSlotSelected(
|
|
2655
|
+
onSelectionEnd: _,
|
|
2656
|
+
isSelected: k?.isSlotSelected(Ie) ?? !1,
|
|
2641
2657
|
isSelecting: k?.isSelecting ?? !1,
|
|
2642
2658
|
disabled: K,
|
|
2643
2659
|
className: "absolute inset-x-0",
|
|
2644
2660
|
style: {
|
|
2645
|
-
top: `${at *
|
|
2646
|
-
height: `${
|
|
2661
|
+
top: `${at * E}%`,
|
|
2662
|
+
height: `${E}%`
|
|
2647
2663
|
},
|
|
2648
2664
|
ariaLabel: `Add event on ${s.toLocaleDateString()} at ${we(R)}:${String(J).padStart(2, "0")}`
|
|
2649
2665
|
},
|
|
@@ -2655,8 +2671,8 @@ function hn({
|
|
|
2655
2671
|
R
|
|
2656
2672
|
);
|
|
2657
2673
|
}),
|
|
2658
|
-
|
|
2659
|
-
const U =
|
|
2674
|
+
A?.singleDay.map((R) => {
|
|
2675
|
+
const U = A.positions.get(R.id);
|
|
2660
2676
|
if (!U) return null;
|
|
2661
2677
|
const ae = `calc(${U.width}% - 2px)`, K = `max(${be}px, ${ae})`;
|
|
2662
2678
|
return L ? /* @__PURE__ */ e(
|
|
@@ -2695,7 +2711,7 @@ function hn({
|
|
|
2695
2711
|
R.id
|
|
2696
2712
|
);
|
|
2697
2713
|
}),
|
|
2698
|
-
f ===
|
|
2714
|
+
f === B && F >= 0 && /* @__PURE__ */ n(
|
|
2699
2715
|
"div",
|
|
2700
2716
|
{
|
|
2701
2717
|
className: l(
|
|
@@ -2721,27 +2737,27 @@ function hn({
|
|
|
2721
2737
|
] });
|
|
2722
2738
|
}
|
|
2723
2739
|
export {
|
|
2724
|
-
|
|
2740
|
+
dr as A,
|
|
2725
2741
|
ce as B,
|
|
2726
|
-
|
|
2727
|
-
|
|
2742
|
+
lr as C,
|
|
2743
|
+
jt as D,
|
|
2728
2744
|
Qe as E,
|
|
2729
|
-
|
|
2730
|
-
|
|
2745
|
+
ur as M,
|
|
2746
|
+
re as P,
|
|
2731
2747
|
ot as T,
|
|
2732
|
-
|
|
2748
|
+
mr as W,
|
|
2733
2749
|
Xt as a,
|
|
2734
|
-
|
|
2750
|
+
cr as b,
|
|
2735
2751
|
Ce as c,
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2752
|
+
rt as d,
|
|
2753
|
+
sr as e,
|
|
2754
|
+
ar as f,
|
|
2739
2755
|
Q as g,
|
|
2740
|
-
|
|
2756
|
+
ne as h,
|
|
2741
2757
|
Ht as i,
|
|
2742
2758
|
le as j,
|
|
2743
2759
|
ee as k,
|
|
2744
|
-
|
|
2760
|
+
ir as l,
|
|
2745
2761
|
de as m,
|
|
2746
2762
|
gt as n,
|
|
2747
2763
|
fe as o,
|
|
@@ -2749,6 +2765,6 @@ export {
|
|
|
2749
2765
|
Oe as q,
|
|
2750
2766
|
Me as r,
|
|
2751
2767
|
Te as s,
|
|
2752
|
-
|
|
2768
|
+
$t as t
|
|
2753
2769
|
};
|
|
2754
|
-
//# sourceMappingURL=week-view-
|
|
2770
|
+
//# sourceMappingURL=week-view-1EUqFIRS.js.map
|