@innosolutions/inno-calendar 1.0.63 → 1.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/{agenda-widget-DbqQHhyM.js → agenda-widget-CD_UoYWC.js} +245 -242
- package/dist/agenda-widget-CD_UoYWC.js.map +1 -0
- package/dist/agenda-widget-COxgmpv4.cjs +2 -0
- package/dist/agenda-widget-COxgmpv4.cjs.map +1 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/inno-calendar.d.ts +9 -7
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +165 -154
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/core/utils/index.d.ts.map +1 -1
- package/dist/core/utils/view-storage.d.ts +64 -0
- package/dist/core/utils/view-storage.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +210 -199
- package/dist/position-utils-Do2ciBXl.cjs +2 -0
- package/dist/position-utils-Do2ciBXl.cjs.map +1 -0
- package/dist/{position-utils-DMVQFywD.js → position-utils-DpaKqYhO.js} +430 -346
- package/dist/position-utils-DpaKqYhO.js.map +1 -0
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/slot-selection-context-BlrL9b5P.cjs +2 -0
- package/dist/slot-selection-context-BlrL9b5P.cjs.map +1 -0
- package/dist/{slot-selection-context-CRstOosL.js → slot-selection-context-D3MW4WJ7.js} +159 -159
- package/dist/slot-selection-context-D3MW4WJ7.js.map +1 -0
- package/dist/{tailwind-calendar-CNhXkxzW.js → tailwind-calendar-CzbuXRmn.js} +65 -65
- package/dist/{tailwind-calendar-CNhXkxzW.js.map → tailwind-calendar-CzbuXRmn.js.map} +1 -1
- package/dist/{tailwind-calendar-VRvPJQwa.cjs → tailwind-calendar-smlkVdSq.cjs} +2 -2
- package/dist/{tailwind-calendar-VRvPJQwa.cjs.map → tailwind-calendar-smlkVdSq.cjs.map} +1 -1
- package/dist/{use-calendar-DkT1_V3j.cjs → use-calendar-Bd-d8oGj.cjs} +2 -2
- package/dist/{use-calendar-DkT1_V3j.cjs.map → use-calendar-Bd-d8oGj.cjs.map} +1 -1
- package/dist/{use-calendar-D8XaVe44.js → use-calendar-mU1joTwp.js} +53 -53
- package/dist/{use-calendar-D8XaVe44.js.map → use-calendar-mU1joTwp.js.map} +1 -1
- package/dist/{use-slot-selection-Dj_tWg1O.cjs → use-slot-selection-CCOSsRSh.cjs} +2 -2
- package/dist/{use-slot-selection-Dj_tWg1O.cjs.map → use-slot-selection-CCOSsRSh.cjs.map} +1 -1
- package/dist/{use-slot-selection-CWRk_17s.js → use-slot-selection-CauKdLYv.js} +3 -3
- package/dist/{use-slot-selection-CWRk_17s.js.map → use-slot-selection-CauKdLYv.js.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.mjs +120 -109
- package/dist/{week-view-DY167Wok.js → week-view-BQXIaSUZ.js} +3 -3
- package/dist/{week-view-DY167Wok.js.map → week-view-BQXIaSUZ.js.map} +1 -1
- package/dist/{week-view-C1Vu2ErD.cjs → week-view-xrKlAJos.cjs} +2 -2
- package/dist/{week-view-C1Vu2ErD.cjs.map → week-view-xrKlAJos.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/agenda-widget-BiZIpa3f.cjs +0 -2
- package/dist/agenda-widget-BiZIpa3f.cjs.map +0 -1
- package/dist/agenda-widget-DbqQHhyM.js.map +0 -1
- package/dist/position-utils-BQpbtF6N.cjs +0 -2
- package/dist/position-utils-BQpbtF6N.cjs.map +0 -1
- package/dist/position-utils-DMVQFywD.js.map +0 -1
- package/dist/slot-selection-context-CRstOosL.js.map +0 -1
- package/dist/slot-selection-context-DBCZI2Dn.cjs +0 -2
- package/dist/slot-selection-context-DBCZI2Dn.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as be } from "react/jsx-runtime";
|
|
2
|
-
import { g as lt, u as xt, C as vt } from "./use-calendar-
|
|
2
|
+
import { g as lt, u as xt, C as vt } from "./use-calendar-mU1joTwp.js";
|
|
3
3
|
import { useCallback as _, useState as le, useEffect as he, forwardRef as Pe, useRef as ie, useMemo as ee, useLayoutEffect as wt, useImperativeHandle as bt } from "react";
|
|
4
4
|
import { c as g } from "./index-DtaLkIY8.js";
|
|
5
|
-
import { P as ct, p as dt, o as ut, z as fe, I as yt, J as kt, B as De, K as Nt, L as Ve, x as ge, F as pe, y as xe, k as Ct, C as Dt, M as Ye, A as Mt, W as Et, c as Lt, N as St } from "./week-view-
|
|
6
|
-
import { j as Tt, D as Ht, I as It, e as zt, S as jt } from "./slot-selection-context-
|
|
7
|
-
import {
|
|
5
|
+
import { P as ct, p as dt, o as ut, z as fe, I as yt, J as kt, B as De, K as Nt, L as Ve, x as ge, F as pe, y as xe, k as Ct, C as Dt, M as Ye, A as Mt, W as Et, c as Lt, N as St } from "./week-view-BQXIaSUZ.js";
|
|
6
|
+
import { j as Tt, D as Ht, I as It, e as zt, S as jt } from "./slot-selection-context-D3MW4WJ7.js";
|
|
7
|
+
import { aF as de, a$ as We, L as ht, ar as At, a1 as Pt, ac as Wt, o as mt, X as Ft } from "./position-utils-DpaKqYhO.js";
|
|
8
8
|
function $t({ view: t, className: n = "" }) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
10
|
"div",
|
|
@@ -35,9 +35,9 @@ function Ke({ view: t, className: n }) {
|
|
|
35
35
|
function Nr(t) {
|
|
36
36
|
const {
|
|
37
37
|
events: n,
|
|
38
|
-
resources:
|
|
38
|
+
resources: a,
|
|
39
39
|
scheduleTypes: o,
|
|
40
|
-
initialView:
|
|
40
|
+
initialView: s = "week",
|
|
41
41
|
initialDate: l,
|
|
42
42
|
initialFilters: x,
|
|
43
43
|
preferences: h,
|
|
@@ -56,9 +56,9 @@ function Nr(t) {
|
|
|
56
56
|
return /* @__PURE__ */ e("div", { className: F, style: { position: "relative" }, children: H ?? /* @__PURE__ */ e(Ke, { view: k.view, className: F }) });
|
|
57
57
|
const $ = xt({
|
|
58
58
|
events: n,
|
|
59
|
-
resources:
|
|
59
|
+
resources: a,
|
|
60
60
|
scheduleTypes: o,
|
|
61
|
-
initialView:
|
|
61
|
+
initialView: s,
|
|
62
62
|
initialDate: l,
|
|
63
63
|
initialFilters: x,
|
|
64
64
|
preferences: h,
|
|
@@ -326,7 +326,7 @@ const Gt = {
|
|
|
326
326
|
deleteConfirmTitle: "Delete Event",
|
|
327
327
|
deleteConfirmDescription: "Are you sure you want to delete this event? This action cannot be undone."
|
|
328
328
|
}, Ie = Pe(
|
|
329
|
-
({ onClick: t, label: n, children:
|
|
329
|
+
({ onClick: t, label: n, children: a, className: o, variant: s = "ghost", ...l }, x) => /* @__PURE__ */ r(ge, { children: [
|
|
330
330
|
/* @__PURE__ */ e(pe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
331
331
|
"button",
|
|
332
332
|
{
|
|
@@ -335,20 +335,20 @@ const Gt = {
|
|
|
335
335
|
onClick: t,
|
|
336
336
|
className: g(
|
|
337
337
|
"h-8 w-8 rounded-full flex items-center justify-center transition-colors",
|
|
338
|
-
|
|
339
|
-
|
|
338
|
+
s === "ghost" && "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",
|
|
339
|
+
s === "destructive" && "hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",
|
|
340
340
|
o
|
|
341
341
|
),
|
|
342
342
|
"aria-label": n,
|
|
343
343
|
...l,
|
|
344
|
-
children:
|
|
344
|
+
children: a
|
|
345
345
|
}
|
|
346
346
|
) }),
|
|
347
347
|
/* @__PURE__ */ e(xe, { side: "bottom", className: "text-xs", children: n })
|
|
348
348
|
] })
|
|
349
349
|
);
|
|
350
350
|
Ie.displayName = "IconButton";
|
|
351
|
-
function Jt({ src: t, alt: n, initials:
|
|
351
|
+
function Jt({ src: t, alt: n, initials: a, className: o, isClient: s }) {
|
|
352
352
|
const [l, x] = le(!1);
|
|
353
353
|
return /* @__PURE__ */ e(
|
|
354
354
|
"div",
|
|
@@ -370,9 +370,9 @@ function Jt({ src: t, alt: n, initials: s, className: o, isClient: a }) {
|
|
|
370
370
|
{
|
|
371
371
|
className: g(
|
|
372
372
|
"h-full w-full flex items-center justify-center text-[10px] font-medium",
|
|
373
|
-
|
|
373
|
+
s ? "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300" : "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"
|
|
374
374
|
),
|
|
375
|
-
children:
|
|
375
|
+
children: a
|
|
376
376
|
}
|
|
377
377
|
)
|
|
378
378
|
}
|
|
@@ -381,9 +381,9 @@ function Jt({ src: t, alt: n, initials: s, className: o, isClient: a }) {
|
|
|
381
381
|
function Ge({
|
|
382
382
|
participant: t,
|
|
383
383
|
isEventCanceled: n = !1,
|
|
384
|
-
labels:
|
|
384
|
+
labels: a
|
|
385
385
|
}) {
|
|
386
|
-
const o = t.name || "Unknown",
|
|
386
|
+
const o = t.name || "Unknown", s = o.split(" ").map((y) => y[0]).join("").toUpperCase().slice(0, 2), l = t.isOrganizer ?? !1, x = t.isConfirmed, h = x === !0, c = x === !1, w = t.isClient ?? !1, P = t.profilePicture || t.avatar, b = n;
|
|
387
387
|
return /* @__PURE__ */ r(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
@@ -398,7 +398,7 @@ function Ge({
|
|
|
398
398
|
{
|
|
399
399
|
src: P,
|
|
400
400
|
alt: o,
|
|
401
|
-
initials:
|
|
401
|
+
initials: s,
|
|
402
402
|
isClient: w,
|
|
403
403
|
className: g(b && "grayscale")
|
|
404
404
|
}
|
|
@@ -416,8 +416,8 @@ function Ge({
|
|
|
416
416
|
children: o
|
|
417
417
|
}
|
|
418
418
|
) }),
|
|
419
|
-
w && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children:
|
|
420
|
-
l && !b && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children:
|
|
419
|
+
w && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: a.client }),
|
|
420
|
+
l && !b && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: a.organizer })
|
|
421
421
|
] })
|
|
422
422
|
]
|
|
423
423
|
}
|
|
@@ -426,15 +426,15 @@ function Ge({
|
|
|
426
426
|
function qt({
|
|
427
427
|
open: t,
|
|
428
428
|
onOpenChange: n,
|
|
429
|
-
title:
|
|
429
|
+
title: a,
|
|
430
430
|
children: o
|
|
431
431
|
}) {
|
|
432
432
|
return he(() => {
|
|
433
433
|
if (!t) return;
|
|
434
|
-
const
|
|
434
|
+
const s = (l) => {
|
|
435
435
|
l.key === "Escape" && n(!1);
|
|
436
436
|
};
|
|
437
|
-
return document.addEventListener("keydown",
|
|
437
|
+
return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
|
|
438
438
|
}, [t, n]), he(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
439
439
|
document.body.style.overflow = "";
|
|
440
440
|
}), [t]), t ? /* @__PURE__ */ r("div", { className: "fixed inset-0 z-50", children: [
|
|
@@ -443,13 +443,13 @@ function qt({
|
|
|
443
443
|
{
|
|
444
444
|
className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
|
|
445
445
|
onClick: () => n(!1),
|
|
446
|
-
onKeyDown: (
|
|
447
|
-
(
|
|
446
|
+
onKeyDown: (s) => {
|
|
447
|
+
(s.key === "Enter" || s.key === " ") && n(!1);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
),
|
|
451
451
|
/* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-2xl shadow-xl overflow-hidden", children: [
|
|
452
|
-
|
|
452
|
+
a && /* @__PURE__ */ e("div", { className: "sr-only", children: a }),
|
|
453
453
|
o
|
|
454
454
|
] }) })
|
|
455
455
|
] }) : null;
|
|
@@ -457,9 +457,9 @@ function qt({
|
|
|
457
457
|
function Xt({
|
|
458
458
|
open: t,
|
|
459
459
|
onOpenChange: n,
|
|
460
|
-
title:
|
|
460
|
+
title: a,
|
|
461
461
|
description: o,
|
|
462
|
-
cancelLabel:
|
|
462
|
+
cancelLabel: s,
|
|
463
463
|
confirmLabel: l,
|
|
464
464
|
onConfirm: x,
|
|
465
465
|
isLoading: h
|
|
@@ -476,7 +476,7 @@ function Xt({
|
|
|
476
476
|
}
|
|
477
477
|
),
|
|
478
478
|
/* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-lg shadow-xl p-6", children: [
|
|
479
|
-
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children:
|
|
479
|
+
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: a }),
|
|
480
480
|
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: o }),
|
|
481
481
|
/* @__PURE__ */ r("div", { className: "mt-4 flex justify-end gap-3", children: [
|
|
482
482
|
/* @__PURE__ */ e(
|
|
@@ -485,7 +485,7 @@ function Xt({
|
|
|
485
485
|
variant: "outline",
|
|
486
486
|
size: "sm",
|
|
487
487
|
onClick: () => n(!1),
|
|
488
|
-
children:
|
|
488
|
+
children: s
|
|
489
489
|
}
|
|
490
490
|
),
|
|
491
491
|
/* @__PURE__ */ r(
|
|
@@ -514,12 +514,12 @@ function Qt(t, n) {
|
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
function Zt(t, n) {
|
|
517
|
-
const
|
|
517
|
+
const a = {
|
|
518
518
|
hour: "2-digit",
|
|
519
519
|
minute: "2-digit",
|
|
520
520
|
hour12: !1
|
|
521
521
|
};
|
|
522
|
-
return `${t.toLocaleTimeString(void 0,
|
|
522
|
+
return `${t.toLocaleTimeString(void 0, a)} – ${n.toLocaleTimeString(void 0, a)}`;
|
|
523
523
|
}
|
|
524
524
|
function en(t) {
|
|
525
525
|
return t.toLocaleDateString(void 0, {
|
|
@@ -531,19 +531,19 @@ function en(t) {
|
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
533
|
function tn(t) {
|
|
534
|
-
const [n,
|
|
534
|
+
const [n, a] = le(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
|
|
535
535
|
return he(() => {
|
|
536
536
|
if (typeof window > "u") return;
|
|
537
|
-
const o = window.matchMedia(t),
|
|
538
|
-
return o.addEventListener("change",
|
|
537
|
+
const o = window.matchMedia(t), s = (l) => a(l.matches);
|
|
538
|
+
return o.addEventListener("change", s), () => o.removeEventListener("change", s);
|
|
539
539
|
}, [t]), n;
|
|
540
540
|
}
|
|
541
541
|
function Je({
|
|
542
542
|
event: t,
|
|
543
543
|
labels: n,
|
|
544
|
-
isLoading:
|
|
544
|
+
isLoading: a,
|
|
545
545
|
onClose: o,
|
|
546
|
-
onEdit:
|
|
546
|
+
onEdit: s,
|
|
547
547
|
onDelete: l,
|
|
548
548
|
onCancel: x,
|
|
549
549
|
onAccept: h,
|
|
@@ -566,20 +566,20 @@ function Je({
|
|
|
566
566
|
formatDate: S = Qt,
|
|
567
567
|
formatTimeRange: z = Zt
|
|
568
568
|
}) {
|
|
569
|
-
const [U, G] = le(!1), X = !(t.isCanceled || t.meetingTookPlace), m = t.isRecurring ?? !1, p = t.participantDetails, f = t.participantsNames || [], E = p && p.length > 0, D = W === !0, T = W === !1, te = B && !A && X, O = E ? p.filter((d) => d.isConfirmed).length : t.isAccepted ? f.length : 0, q = E ? p.length : f.length, re = t.scheduleTypeColor || t.hexColor || "#039BE5", Q = _(() => t.startDate ? S(t.startDate) : n.noDateProvided, [t.startDate, S, n.noDateProvided]), we = _(() => t.startDate && t.endDate ? z(t.startDate, t.endDate) : null, [t.startDate, t.endDate, z]),
|
|
570
|
-
o(),
|
|
571
|
-
},
|
|
569
|
+
const [U, G] = le(!1), X = !(t.isCanceled || t.meetingTookPlace), m = t.isRecurring ?? !1, p = t.participantDetails, f = t.participantsNames || [], E = p && p.length > 0, D = W === !0, T = W === !1, te = B && !A && X, O = E ? p.filter((d) => d.isConfirmed).length : t.isAccepted ? f.length : 0, q = E ? p.length : f.length, re = t.scheduleTypeColor || t.hexColor || "#039BE5", Q = _(() => t.startDate ? S(t.startDate) : n.noDateProvided, [t.startDate, S, n.noDateProvided]), we = _(() => t.startDate && t.endDate ? z(t.startDate, t.endDate) : null, [t.startDate, t.endDate, z]), ae = () => {
|
|
570
|
+
o(), s?.(t);
|
|
571
|
+
}, se = () => {
|
|
572
572
|
o(), x?.(t);
|
|
573
573
|
}, ye = () => {
|
|
574
574
|
G(!0);
|
|
575
575
|
}, ue = () => {
|
|
576
576
|
l?.(t), G(!1);
|
|
577
577
|
};
|
|
578
|
-
return
|
|
578
|
+
return a ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(Ee, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ r(fe, { delayDuration: 300, children: [
|
|
579
579
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5 p-3", children: [
|
|
580
580
|
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: Y ? Y({ onClose: o }) : /* @__PURE__ */ r(be, { children: [
|
|
581
|
-
X && P &&
|
|
582
|
-
X && y && x && /* @__PURE__ */ e(Ie, { onClick:
|
|
581
|
+
X && P && s && /* @__PURE__ */ e(Ie, { onClick: ae, label: n.edit, children: /* @__PURE__ */ e(Ot, { className: "h-[18px] w-[18px]" }) }),
|
|
582
|
+
X && y && x && /* @__PURE__ */ e(Ie, { onClick: se, label: n.cancel, children: /* @__PURE__ */ e(_t, { className: "h-[18px] w-[18px]" }) }),
|
|
583
583
|
b && l && /* @__PURE__ */ e(
|
|
584
584
|
Ie,
|
|
585
585
|
{
|
|
@@ -844,9 +844,9 @@ function Je({
|
|
|
844
844
|
function Cr({
|
|
845
845
|
event: t,
|
|
846
846
|
children: n,
|
|
847
|
-
open:
|
|
847
|
+
open: a,
|
|
848
848
|
onOpenChange: o,
|
|
849
|
-
isLoading:
|
|
849
|
+
isLoading: s,
|
|
850
850
|
labels: l,
|
|
851
851
|
onEdit: x,
|
|
852
852
|
onDelete: h,
|
|
@@ -878,7 +878,7 @@ function Cr({
|
|
|
878
878
|
}, [o]), D = {
|
|
879
879
|
event: t,
|
|
880
880
|
labels: f,
|
|
881
|
-
isLoading:
|
|
881
|
+
isLoading: s,
|
|
882
882
|
onClose: E,
|
|
883
883
|
onEdit: x,
|
|
884
884
|
onDelete: h,
|
|
@@ -903,7 +903,7 @@ function Cr({
|
|
|
903
903
|
formatDate: U,
|
|
904
904
|
formatTimeRange: G
|
|
905
905
|
};
|
|
906
|
-
return p ? /* @__PURE__ */ r(ct, { open:
|
|
906
|
+
return p ? /* @__PURE__ */ r(ct, { open: a ?? !1, onOpenChange: o ?? (() => {
|
|
907
907
|
}), children: [
|
|
908
908
|
/* @__PURE__ */ e(dt, { asChild: !0, children: n }),
|
|
909
909
|
/* @__PURE__ */ e(
|
|
@@ -925,7 +925,7 @@ function Cr({
|
|
|
925
925
|
/* @__PURE__ */ e(
|
|
926
926
|
qt,
|
|
927
927
|
{
|
|
928
|
-
open:
|
|
928
|
+
open: a ?? !1,
|
|
929
929
|
onOpenChange: o ?? (() => {
|
|
930
930
|
}),
|
|
931
931
|
title: t.title,
|
|
@@ -935,22 +935,22 @@ function Cr({
|
|
|
935
935
|
] });
|
|
936
936
|
}
|
|
937
937
|
const Fe = 44, qe = 4, nn = 56, Xe = 8, ze = 80, Se = 140, Qe = 100, Ze = 2, rn = 8, on = 18;
|
|
938
|
-
function
|
|
938
|
+
function an(t) {
|
|
939
939
|
return t.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
|
|
940
940
|
}
|
|
941
|
-
function
|
|
942
|
-
const
|
|
941
|
+
function sn(t, n) {
|
|
942
|
+
const a = [];
|
|
943
943
|
for (let o = 0; o < n; o++) {
|
|
944
|
-
const
|
|
945
|
-
|
|
944
|
+
const s = new Date(t);
|
|
945
|
+
s.setDate(s.getDate() + o), a.push(s);
|
|
946
946
|
}
|
|
947
|
-
return
|
|
947
|
+
return a;
|
|
948
948
|
}
|
|
949
|
-
function ln(t, n,
|
|
949
|
+
function ln(t, n, a) {
|
|
950
950
|
const o = [];
|
|
951
|
-
return t.forEach((
|
|
952
|
-
for (let x = n; x <
|
|
953
|
-
o.push({ hour: x, dayIndex: l, date:
|
|
951
|
+
return t.forEach((s, l) => {
|
|
952
|
+
for (let x = n; x < a; x++)
|
|
953
|
+
o.push({ hour: x, dayIndex: l, date: s });
|
|
954
954
|
}), o;
|
|
955
955
|
}
|
|
956
956
|
function $e(t) {
|
|
@@ -964,19 +964,19 @@ function cn(t) {
|
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
966
|
function et(t) {
|
|
967
|
-
const n = [...t].sort((
|
|
968
|
-
for (const
|
|
967
|
+
const n = [...t].sort((s, l) => s.startCol !== l.startCol ? s.startCol - l.startCol : l.spanCols - s.spanCols), a = [], o = [];
|
|
968
|
+
for (const s of n) {
|
|
969
969
|
let l = 0;
|
|
970
|
-
for (; o[l] !== void 0 && o[l] >
|
|
970
|
+
for (; o[l] !== void 0 && o[l] > s.startCol; )
|
|
971
971
|
l++;
|
|
972
|
-
o[l] =
|
|
973
|
-
...
|
|
972
|
+
o[l] = s.startCol + s.spanCols, a.push({
|
|
973
|
+
...s,
|
|
974
974
|
stackIndex: l
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
|
-
return
|
|
977
|
+
return a;
|
|
978
978
|
}
|
|
979
|
-
function dn({ src: t, alt: n, fallback:
|
|
979
|
+
function dn({ src: t, alt: n, fallback: a, className: o }) {
|
|
980
980
|
return /* @__PURE__ */ e(
|
|
981
981
|
"div",
|
|
982
982
|
{
|
|
@@ -991,7 +991,7 @@ function dn({ src: t, alt: n, fallback: s, className: o }) {
|
|
|
991
991
|
alt: n,
|
|
992
992
|
className: "aspect-square h-full w-full object-cover"
|
|
993
993
|
}
|
|
994
|
-
) : /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children:
|
|
994
|
+
) : /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children: a })
|
|
995
995
|
}
|
|
996
996
|
);
|
|
997
997
|
}
|
|
@@ -999,9 +999,9 @@ const un = 7;
|
|
|
999
999
|
function Te({
|
|
1000
1000
|
daysToShow: t = un,
|
|
1001
1001
|
events: n,
|
|
1002
|
-
users:
|
|
1002
|
+
users: a = [],
|
|
1003
1003
|
alwaysShowResources: o,
|
|
1004
|
-
selectedDate:
|
|
1004
|
+
selectedDate: s,
|
|
1005
1005
|
onDateChange: l,
|
|
1006
1006
|
onEventClick: x,
|
|
1007
1007
|
onSlotClick: h,
|
|
@@ -1014,14 +1014,14 @@ function Te({
|
|
|
1014
1014
|
classNames: A,
|
|
1015
1015
|
enableDrag: W = !0
|
|
1016
1016
|
}) {
|
|
1017
|
-
const F = ie(null), H = Tt(), [k, $] = le(null), R = ie(!1), [Y, M] = le(null), V =
|
|
1017
|
+
const F = ie(null), H = Tt(), [k, $] = le(null), R = ie(!1), [Y, M] = le(null), V = s ?? /* @__PURE__ */ new Date(), S = !0, z = w?.from ?? rn, U = w?.to ?? on, G = U - z, X = ee(() => {
|
|
1018
1018
|
const i = new Date(V);
|
|
1019
1019
|
if (t === 1 || t === 3)
|
|
1020
1020
|
return i.setHours(0, 0, 0, 0), i;
|
|
1021
1021
|
const u = i.getDay(), v = u === 0 ? -6 : 1 - u;
|
|
1022
1022
|
return i.setDate(i.getDate() + v), i.setHours(0, 0, 0, 0), i;
|
|
1023
1023
|
}, [V, t]), m = ee(
|
|
1024
|
-
() =>
|
|
1024
|
+
() => sn(X, t),
|
|
1025
1025
|
[X, t]
|
|
1026
1026
|
), p = ee(
|
|
1027
1027
|
() => ln(m, z, U),
|
|
@@ -1036,7 +1036,7 @@ function Te({
|
|
|
1036
1036
|
if (i.participants?.[0]?.id) return i.participants[0].id;
|
|
1037
1037
|
}), D = ee(() => {
|
|
1038
1038
|
const i = /* @__PURE__ */ new Map();
|
|
1039
|
-
for (const u of
|
|
1039
|
+
for (const u of a)
|
|
1040
1040
|
i.set(u.id, {
|
|
1041
1041
|
id: u.id,
|
|
1042
1042
|
name: u.name,
|
|
@@ -1065,7 +1065,7 @@ function Te({
|
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
return Array.from(i.values());
|
|
1068
|
-
}, [
|
|
1068
|
+
}, [a, n]), T = ee(() => {
|
|
1069
1069
|
const i = [], u = /* @__PURE__ */ new Map();
|
|
1070
1070
|
for (const C of D)
|
|
1071
1071
|
u.set(C.id, []);
|
|
@@ -1234,7 +1234,7 @@ function Te({
|
|
|
1234
1234
|
return null;
|
|
1235
1235
|
},
|
|
1236
1236
|
[Q]
|
|
1237
|
-
),
|
|
1237
|
+
), ae = _(
|
|
1238
1238
|
(i, u) => {
|
|
1239
1239
|
if (p[i]) {
|
|
1240
1240
|
const v = p[i], N = new Date(v.date);
|
|
@@ -1243,12 +1243,12 @@ function Te({
|
|
|
1243
1243
|
return { date: /* @__PURE__ */ new Date() };
|
|
1244
1244
|
},
|
|
1245
1245
|
[S, p, m]
|
|
1246
|
-
),
|
|
1246
|
+
), se = _(
|
|
1247
1247
|
(i, u) => {
|
|
1248
1248
|
if (i.preventDefault(), i.dataTransfer.dropEffect = "move", !H?.isDragging || !H.dragState) return;
|
|
1249
1249
|
const v = i.currentTarget, N = we(i.clientX, v);
|
|
1250
1250
|
if (!N) return;
|
|
1251
|
-
const { colIndex: C, minute: L } = N, { date: j, hour: Z } =
|
|
1251
|
+
const { colIndex: C, minute: L } = N, { date: j, hour: Z } = ae(C, L);
|
|
1252
1252
|
H.updateDragPreview(j, Z, L, u);
|
|
1253
1253
|
const { originalStartDate: ne, originalEndDate: J } = H.dragState, oe = J.getTime() - ne.getTime(), ke = p.length;
|
|
1254
1254
|
let Ne;
|
|
@@ -1258,7 +1258,7 @@ function Te({
|
|
|
1258
1258
|
}
|
|
1259
1259
|
Ne = Math.min(Ne, ke - C), M({ resourceId: u, colIndex: C, spanCols: Ne });
|
|
1260
1260
|
},
|
|
1261
|
-
[H, we,
|
|
1261
|
+
[H, we, ae, S, p.length, m.length]
|
|
1262
1262
|
), ye = _(
|
|
1263
1263
|
(i) => {
|
|
1264
1264
|
const u = i.relatedTarget;
|
|
@@ -1299,7 +1299,7 @@ function Te({
|
|
|
1299
1299
|
), Me = _(() => {
|
|
1300
1300
|
if (!R.current || !k) return;
|
|
1301
1301
|
R.current = !1;
|
|
1302
|
-
const i = Math.min(k.startCol, k.endCol), u = Math.max(k.startCol, k.endCol), v =
|
|
1302
|
+
const i = Math.min(k.startCol, k.endCol), u = Math.max(k.startCol, k.endCol), v = ae(i), N = ae(u), C = new Date(v.date), L = new Date(N.date);
|
|
1303
1303
|
N.hour !== void 0 && L.setHours(N.hour + 1, 0, 0, 0);
|
|
1304
1304
|
const j = {
|
|
1305
1305
|
startDate: C,
|
|
@@ -1307,7 +1307,7 @@ function Te({
|
|
|
1307
1307
|
resourceId: k.resourceId
|
|
1308
1308
|
};
|
|
1309
1309
|
i === u && h && h(v.date, v.hour, k.resourceId), c?.(j), $((Z) => Z ? { ...Z, isSelecting: !1 } : null), setTimeout(() => $(null), 150);
|
|
1310
|
-
}, [k,
|
|
1310
|
+
}, [k, ae, S, h, c]);
|
|
1311
1311
|
return he(() => {
|
|
1312
1312
|
const i = () => {
|
|
1313
1313
|
R.current && Me();
|
|
@@ -1423,7 +1423,7 @@ function Te({
|
|
|
1423
1423
|
className: "size-7",
|
|
1424
1424
|
src: i.user.avatar,
|
|
1425
1425
|
alt: i.user.name,
|
|
1426
|
-
fallback:
|
|
1426
|
+
fallback: an(i.user.name)
|
|
1427
1427
|
}
|
|
1428
1428
|
),
|
|
1429
1429
|
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: i.user.name })
|
|
@@ -1436,7 +1436,7 @@ function Te({
|
|
|
1436
1436
|
"div",
|
|
1437
1437
|
{
|
|
1438
1438
|
className: "ic-timeline-grid relative flex",
|
|
1439
|
-
onDragOver: (v) =>
|
|
1439
|
+
onDragOver: (v) => se(v, i.user.id),
|
|
1440
1440
|
onDragLeave: ye,
|
|
1441
1441
|
onDrop: (v) => ue(v, i.user.id),
|
|
1442
1442
|
children: [
|
|
@@ -1455,7 +1455,7 @@ function Te({
|
|
|
1455
1455
|
onKeyDown: (J) => {
|
|
1456
1456
|
if (ne && (J.key === "Enter" || J.key === " ")) {
|
|
1457
1457
|
J.preventDefault();
|
|
1458
|
-
const oe =
|
|
1458
|
+
const oe = ae(N);
|
|
1459
1459
|
h?.(oe.date, oe.hour, i.user.id), c?.({
|
|
1460
1460
|
startDate: oe.date,
|
|
1461
1461
|
endDate: (() => {
|
|
@@ -1551,13 +1551,13 @@ function tt(t) {
|
|
|
1551
1551
|
const n = t.hexColor;
|
|
1552
1552
|
return n ? { backgroundColor: n } : {};
|
|
1553
1553
|
}
|
|
1554
|
-
function fn({ day: t, date: n, events:
|
|
1555
|
-
const l = de(n), x = 3, h =
|
|
1554
|
+
function fn({ day: t, date: n, events: a, isCurrentMonth: o, onDayClick: s }) {
|
|
1555
|
+
const l = de(n), x = 3, h = a.length;
|
|
1556
1556
|
return /* @__PURE__ */ r(
|
|
1557
1557
|
"button",
|
|
1558
1558
|
{
|
|
1559
1559
|
type: "button",
|
|
1560
|
-
onClick: () =>
|
|
1560
|
+
onClick: () => s?.(n),
|
|
1561
1561
|
className: g(
|
|
1562
1562
|
"flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1",
|
|
1563
1563
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
@@ -1575,7 +1575,7 @@ function fn({ day: t, date: n, events: s, isCurrentMonth: o, onDayClick: a }) {
|
|
|
1575
1575
|
children: t
|
|
1576
1576
|
}
|
|
1577
1577
|
),
|
|
1578
|
-
h > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: h <= x ?
|
|
1578
|
+
h > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: h <= x ? a.map((c) => /* @__PURE__ */ e(
|
|
1579
1579
|
"div",
|
|
1580
1580
|
{
|
|
1581
1581
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
@@ -1583,7 +1583,7 @@ function fn({ day: t, date: n, events: s, isCurrentMonth: o, onDayClick: a }) {
|
|
|
1583
1583
|
},
|
|
1584
1584
|
c.id
|
|
1585
1585
|
)) : /* @__PURE__ */ r(be, { children: [
|
|
1586
|
-
|
|
1586
|
+
a.slice(0, x).map((c) => /* @__PURE__ */ e(
|
|
1587
1587
|
"div",
|
|
1588
1588
|
{
|
|
1589
1589
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
@@ -1603,16 +1603,16 @@ function fn({ day: t, date: n, events: s, isCurrentMonth: o, onDayClick: a }) {
|
|
|
1603
1603
|
function gn({
|
|
1604
1604
|
date: t,
|
|
1605
1605
|
events: n,
|
|
1606
|
-
onMonthClick:
|
|
1606
|
+
onMonthClick: a,
|
|
1607
1607
|
onDayClick: o
|
|
1608
1608
|
}) {
|
|
1609
|
-
const
|
|
1609
|
+
const s = ee(() => Pt(t, 0), [t]);
|
|
1610
1610
|
return /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
1611
1611
|
/* @__PURE__ */ e(
|
|
1612
1612
|
"button",
|
|
1613
1613
|
{
|
|
1614
1614
|
type: "button",
|
|
1615
|
-
onClick: () =>
|
|
1615
|
+
onClick: () => a?.(t),
|
|
1616
1616
|
className: g(
|
|
1617
1617
|
"w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
|
|
1618
1618
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
@@ -1626,7 +1626,7 @@ function gn({
|
|
|
1626
1626
|
/* @__PURE__ */ e("span", { className: "sm:hidden", children: l[0] }),
|
|
1627
1627
|
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: l })
|
|
1628
1628
|
] }, x)) }),
|
|
1629
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children:
|
|
1629
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: s.map((l, x) => {
|
|
1630
1630
|
const h = Wt(n, l.date);
|
|
1631
1631
|
return /* @__PURE__ */ e(
|
|
1632
1632
|
fn,
|
|
@@ -1646,21 +1646,21 @@ function gn({
|
|
|
1646
1646
|
function pn({
|
|
1647
1647
|
events: t,
|
|
1648
1648
|
year: n,
|
|
1649
|
-
onMonthClick:
|
|
1649
|
+
onMonthClick: a,
|
|
1650
1650
|
onDayClick: o,
|
|
1651
|
-
className:
|
|
1651
|
+
className: s,
|
|
1652
1652
|
slots: l,
|
|
1653
1653
|
classNames: x
|
|
1654
1654
|
}) {
|
|
1655
1655
|
const h = ee(() => At(n), [n]);
|
|
1656
|
-
return /* @__PURE__ */ r("div", { className: g("flex flex-col h-full",
|
|
1656
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col h-full", s), children: [
|
|
1657
1657
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-center border-b px-4 py-3", children: /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: n }) }),
|
|
1658
1658
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", children: h.map((c) => /* @__PURE__ */ e(
|
|
1659
1659
|
gn,
|
|
1660
1660
|
{
|
|
1661
1661
|
date: c,
|
|
1662
1662
|
events: t,
|
|
1663
|
-
onMonthClick:
|
|
1663
|
+
onMonthClick: a,
|
|
1664
1664
|
onDayClick: o
|
|
1665
1665
|
},
|
|
1666
1666
|
c.getMonth()
|
|
@@ -1739,9 +1739,9 @@ function Cn() {
|
|
|
1739
1739
|
function Dn({
|
|
1740
1740
|
containerRef: t,
|
|
1741
1741
|
currentDate: n,
|
|
1742
|
-
className:
|
|
1742
|
+
className: a
|
|
1743
1743
|
}) {
|
|
1744
|
-
const [o,
|
|
1744
|
+
const [o, s] = le({
|
|
1745
1745
|
canUp: !1,
|
|
1746
1746
|
canDown: !1,
|
|
1747
1747
|
canLeft: !1,
|
|
@@ -1750,7 +1750,7 @@ function Dn({
|
|
|
1750
1750
|
const f = t.current;
|
|
1751
1751
|
if (!f) return;
|
|
1752
1752
|
const E = 4;
|
|
1753
|
-
|
|
1753
|
+
s({
|
|
1754
1754
|
canUp: f.scrollTop > E,
|
|
1755
1755
|
canDown: f.scrollTop + f.clientHeight < f.scrollHeight - E,
|
|
1756
1756
|
canLeft: f.scrollLeft > E,
|
|
@@ -1816,7 +1816,7 @@ function Dn({
|
|
|
1816
1816
|
f.style.removeProperty("top"), f.style.removeProperty("bottom");
|
|
1817
1817
|
return;
|
|
1818
1818
|
}
|
|
1819
|
-
const
|
|
1819
|
+
const ae = Math.min(re.bottom, Q) - re.top, se = f.offsetHeight, ye = ae - se - 12, ue = 12, d = q.clientHeight - se - 12, I = Math.max(ue, Math.min(ye, d));
|
|
1820
1820
|
f.style.top = `${I}px`, f.style.bottom = "auto";
|
|
1821
1821
|
}, T = () => {
|
|
1822
1822
|
cancelAnimationFrame(E), E = requestAnimationFrame(D);
|
|
@@ -1898,7 +1898,7 @@ function Dn({
|
|
|
1898
1898
|
"div",
|
|
1899
1899
|
{
|
|
1900
1900
|
ref: H,
|
|
1901
|
-
className: `inno-scroll-nav-wrapper ${
|
|
1901
|
+
className: `inno-scroll-nav-wrapper ${a ?? ""}`,
|
|
1902
1902
|
role: "toolbar",
|
|
1903
1903
|
"aria-label": "Scroll navigation",
|
|
1904
1904
|
onKeyDown: m,
|
|
@@ -2001,9 +2001,9 @@ function Mn(t) {
|
|
|
2001
2001
|
function En({
|
|
2002
2002
|
onEventClick: t,
|
|
2003
2003
|
onSlotClick: n,
|
|
2004
|
-
onSlotSelect:
|
|
2004
|
+
onSlotSelect: a,
|
|
2005
2005
|
onAddEvent: o,
|
|
2006
|
-
alwaysShowResources:
|
|
2006
|
+
alwaysShowResources: s,
|
|
2007
2007
|
className: l,
|
|
2008
2008
|
showHeader: x = !0,
|
|
2009
2009
|
minSelectionMinutes: h = 30,
|
|
@@ -2112,8 +2112,8 @@ function En({
|
|
|
2112
2112
|
);
|
|
2113
2113
|
const q = ee(() => Mn(M), [M]), re = _(
|
|
2114
2114
|
(d) => {
|
|
2115
|
-
if (
|
|
2116
|
-
|
|
2115
|
+
if (a) {
|
|
2116
|
+
a(d);
|
|
2117
2117
|
return;
|
|
2118
2118
|
}
|
|
2119
2119
|
if (n) {
|
|
@@ -2121,7 +2121,7 @@ function En({
|
|
|
2121
2121
|
n(d.startDate, I);
|
|
2122
2122
|
}
|
|
2123
2123
|
},
|
|
2124
|
-
[
|
|
2124
|
+
[a, n]
|
|
2125
2125
|
), Q = _(
|
|
2126
2126
|
(d) => {
|
|
2127
2127
|
V("day"), z(d, "day");
|
|
@@ -2132,18 +2132,18 @@ function En({
|
|
|
2132
2132
|
V("month"), z(d, "month");
|
|
2133
2133
|
},
|
|
2134
2134
|
[z, V]
|
|
2135
|
-
),
|
|
2135
|
+
), ae = _(
|
|
2136
2136
|
(d) => {
|
|
2137
2137
|
t?.(d);
|
|
2138
2138
|
},
|
|
2139
2139
|
[t]
|
|
2140
|
-
),
|
|
2140
|
+
), se = _(
|
|
2141
2141
|
(d, I, K) => {
|
|
2142
2142
|
n?.(d, I);
|
|
2143
2143
|
},
|
|
2144
2144
|
[n]
|
|
2145
2145
|
), ye = () => {
|
|
2146
|
-
const d = G, I =
|
|
2146
|
+
const d = G, I = ae, K = F;
|
|
2147
2147
|
switch (M) {
|
|
2148
2148
|
case "day":
|
|
2149
2149
|
return /* @__PURE__ */ e(
|
|
@@ -2224,7 +2224,7 @@ function En({
|
|
|
2224
2224
|
daysToShow: 1,
|
|
2225
2225
|
events: d,
|
|
2226
2226
|
users: X,
|
|
2227
|
-
...
|
|
2227
|
+
...s && { alwaysShowResources: s },
|
|
2228
2228
|
selectedDate: S,
|
|
2229
2229
|
visibleHours: {
|
|
2230
2230
|
from: T.startHour,
|
|
@@ -2232,7 +2232,7 @@ function En({
|
|
|
2232
2232
|
},
|
|
2233
2233
|
onEventClick: I,
|
|
2234
2234
|
onSlotSelect: re,
|
|
2235
|
-
onSlotClick:
|
|
2235
|
+
onSlotClick: se,
|
|
2236
2236
|
renderPopover: K,
|
|
2237
2237
|
...b && { slots: b },
|
|
2238
2238
|
...y && { classNames: y }
|
|
@@ -2245,7 +2245,7 @@ function En({
|
|
|
2245
2245
|
daysToShow: 7,
|
|
2246
2246
|
events: d,
|
|
2247
2247
|
users: X,
|
|
2248
|
-
...
|
|
2248
|
+
...s && { alwaysShowResources: s },
|
|
2249
2249
|
selectedDate: S,
|
|
2250
2250
|
visibleHours: {
|
|
2251
2251
|
from: T.startHour,
|
|
@@ -2253,7 +2253,7 @@ function En({
|
|
|
2253
2253
|
},
|
|
2254
2254
|
onEventClick: I,
|
|
2255
2255
|
onSlotSelect: re,
|
|
2256
|
-
onSlotClick:
|
|
2256
|
+
onSlotClick: se,
|
|
2257
2257
|
renderPopover: K,
|
|
2258
2258
|
...b && { slots: b },
|
|
2259
2259
|
...y && { classNames: y }
|
|
@@ -2267,6 +2267,7 @@ function En({
|
|
|
2267
2267
|
daysToShow: 1,
|
|
2268
2268
|
events: d,
|
|
2269
2269
|
users: X,
|
|
2270
|
+
...s && { alwaysShowResources: s },
|
|
2270
2271
|
selectedDate: S,
|
|
2271
2272
|
visibleHours: {
|
|
2272
2273
|
from: T.startHour,
|
|
@@ -2274,7 +2275,7 @@ function En({
|
|
|
2274
2275
|
},
|
|
2275
2276
|
onEventClick: I,
|
|
2276
2277
|
onSlotSelect: re,
|
|
2277
|
-
onSlotClick:
|
|
2278
|
+
onSlotClick: se,
|
|
2278
2279
|
renderPopover: K,
|
|
2279
2280
|
...b && { slots: b },
|
|
2280
2281
|
...y && { classNames: y }
|
|
@@ -2287,6 +2288,7 @@ function En({
|
|
|
2287
2288
|
daysToShow: 3,
|
|
2288
2289
|
events: d,
|
|
2289
2290
|
users: X,
|
|
2291
|
+
...s && { alwaysShowResources: s },
|
|
2290
2292
|
selectedDate: S,
|
|
2291
2293
|
visibleHours: {
|
|
2292
2294
|
from: T.startHour,
|
|
@@ -2294,7 +2296,7 @@ function En({
|
|
|
2294
2296
|
},
|
|
2295
2297
|
onEventClick: I,
|
|
2296
2298
|
onSlotSelect: re,
|
|
2297
|
-
onSlotClick:
|
|
2299
|
+
onSlotClick: se,
|
|
2298
2300
|
renderPopover: K,
|
|
2299
2301
|
...b && { slots: b },
|
|
2300
2302
|
...y && { classNames: y }
|
|
@@ -2307,6 +2309,7 @@ function En({
|
|
|
2307
2309
|
daysToShow: 7,
|
|
2308
2310
|
events: d,
|
|
2309
2311
|
users: X,
|
|
2312
|
+
...s && { alwaysShowResources: s },
|
|
2310
2313
|
selectedDate: S,
|
|
2311
2314
|
visibleHours: {
|
|
2312
2315
|
from: T.startHour,
|
|
@@ -2314,7 +2317,7 @@ function En({
|
|
|
2314
2317
|
},
|
|
2315
2318
|
onEventClick: I,
|
|
2316
2319
|
onSlotSelect: re,
|
|
2317
|
-
onSlotClick:
|
|
2320
|
+
onSlotClick: se,
|
|
2318
2321
|
renderPopover: K,
|
|
2319
2322
|
...b && { slots: b },
|
|
2320
2323
|
...y && { classNames: y }
|
|
@@ -2344,7 +2347,7 @@ function En({
|
|
|
2344
2347
|
onSelect: re,
|
|
2345
2348
|
minDurationMinutes: h,
|
|
2346
2349
|
slotDurationMinutes: U,
|
|
2347
|
-
enabled: !!(
|
|
2350
|
+
enabled: !!(a || n),
|
|
2348
2351
|
children: /* @__PURE__ */ r(
|
|
2349
2352
|
"div",
|
|
2350
2353
|
{
|
|
@@ -2410,9 +2413,9 @@ function En({
|
|
|
2410
2413
|
function Ln({
|
|
2411
2414
|
events: t,
|
|
2412
2415
|
users: n = [],
|
|
2413
|
-
alwaysShowResources:
|
|
2416
|
+
alwaysShowResources: a,
|
|
2414
2417
|
scheduleTypes: o = [],
|
|
2415
|
-
initialView:
|
|
2418
|
+
initialView: s = "week",
|
|
2416
2419
|
initialDate: l,
|
|
2417
2420
|
initialSelectedUserId: x,
|
|
2418
2421
|
initialScheduleTypeIds: h,
|
|
@@ -2450,7 +2453,7 @@ function Ln({
|
|
|
2450
2453
|
initialEvents: t,
|
|
2451
2454
|
initialUsers: n,
|
|
2452
2455
|
initialScheduleTypes: o,
|
|
2453
|
-
initialView:
|
|
2456
|
+
initialView: s,
|
|
2454
2457
|
...l && { initialDate: l },
|
|
2455
2458
|
...x && { initialSelectedUserId: x },
|
|
2456
2459
|
...h && { initialScheduleTypeIds: h },
|
|
@@ -2468,7 +2471,7 @@ function Ln({
|
|
|
2468
2471
|
...B && { onSlotClick: B },
|
|
2469
2472
|
...A && { onSlotSelect: A },
|
|
2470
2473
|
...W && { onAddEvent: W },
|
|
2471
|
-
...
|
|
2474
|
+
...a && { alwaysShowResources: a },
|
|
2472
2475
|
...z && { renderPopover: z },
|
|
2473
2476
|
className: $,
|
|
2474
2477
|
showHeader: R,
|
|
@@ -2491,7 +2494,7 @@ function Ln({
|
|
|
2491
2494
|
) });
|
|
2492
2495
|
}
|
|
2493
2496
|
const Dr = Pe(Ln), ve = Pe(
|
|
2494
|
-
({ className: t, children: n, ...
|
|
2497
|
+
({ className: t, children: n, ...a }, o) => /* @__PURE__ */ e(
|
|
2495
2498
|
"select",
|
|
2496
2499
|
{
|
|
2497
2500
|
ref: o,
|
|
@@ -2503,16 +2506,16 @@ const Dr = Pe(Ln), ve = Pe(
|
|
|
2503
2506
|
"[&>option]:bg-background",
|
|
2504
2507
|
t
|
|
2505
2508
|
),
|
|
2506
|
-
...
|
|
2509
|
+
...a,
|
|
2507
2510
|
children: n
|
|
2508
2511
|
}
|
|
2509
2512
|
)
|
|
2510
2513
|
);
|
|
2511
2514
|
ve.displayName = "Select";
|
|
2512
|
-
const me = Pe(({ className: t, ...n },
|
|
2515
|
+
const me = Pe(({ className: t, ...n }, a) => /* @__PURE__ */ e(
|
|
2513
2516
|
"label",
|
|
2514
2517
|
{
|
|
2515
|
-
ref:
|
|
2518
|
+
ref: a,
|
|
2516
2519
|
className: g(
|
|
2517
2520
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2518
2521
|
t
|
|
@@ -2572,22 +2575,22 @@ const Hn = [
|
|
|
2572
2575
|
function Mr({
|
|
2573
2576
|
value: t,
|
|
2574
2577
|
onChange: n,
|
|
2575
|
-
isLocked:
|
|
2578
|
+
isLocked: a = !1,
|
|
2576
2579
|
className: o,
|
|
2577
|
-
labels:
|
|
2580
|
+
labels: s = {}
|
|
2578
2581
|
}) {
|
|
2579
2582
|
const l = {
|
|
2580
2583
|
title: "Slot duration",
|
|
2581
2584
|
lockedMessage: "This setting is locked by the administrator",
|
|
2582
2585
|
infoMessage: "Set the time slot duration for day and week calendar views.",
|
|
2583
|
-
...
|
|
2586
|
+
...s
|
|
2584
2587
|
}, x = (h) => {
|
|
2585
|
-
|
|
2588
|
+
a || n(Number(h.target.value));
|
|
2586
2589
|
};
|
|
2587
2590
|
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", o), children: [
|
|
2588
2591
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2589
2592
|
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: l.title }),
|
|
2590
|
-
|
|
2593
|
+
a ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2591
2594
|
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Tn, { className: "size-3 text-muted-foreground" }) }),
|
|
2592
2595
|
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2593
2596
|
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
@@ -2600,7 +2603,7 @@ function Mr({
|
|
|
2600
2603
|
{
|
|
2601
2604
|
value: t.toString(),
|
|
2602
2605
|
onChange: x,
|
|
2603
|
-
disabled:
|
|
2606
|
+
disabled: a,
|
|
2604
2607
|
className: "h-9 w-[128px] text-sm",
|
|
2605
2608
|
children: Hn.map((h) => /* @__PURE__ */ e("option", { value: h.value.toString(), children: h.label }, h.value))
|
|
2606
2609
|
}
|
|
@@ -2658,9 +2661,9 @@ const jn = [
|
|
|
2658
2661
|
function Er({
|
|
2659
2662
|
value: t,
|
|
2660
2663
|
onChange: n,
|
|
2661
|
-
isLocked:
|
|
2664
|
+
isLocked: a = !1,
|
|
2662
2665
|
className: o,
|
|
2663
|
-
labels:
|
|
2666
|
+
labels: s = {}
|
|
2664
2667
|
}) {
|
|
2665
2668
|
const l = {
|
|
2666
2669
|
title: "Event display",
|
|
@@ -2671,14 +2674,14 @@ function Er({
|
|
|
2671
2674
|
colored: "Full color",
|
|
2672
2675
|
mixed: "Mixed"
|
|
2673
2676
|
},
|
|
2674
|
-
...
|
|
2677
|
+
...s
|
|
2675
2678
|
}, x = (c) => l.options?.[c] ?? c, h = (c) => {
|
|
2676
|
-
|
|
2679
|
+
a || n(c.target.value);
|
|
2677
2680
|
};
|
|
2678
2681
|
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", o), children: [
|
|
2679
2682
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2680
2683
|
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: l.title }),
|
|
2681
|
-
|
|
2684
|
+
a ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2682
2685
|
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(zn, { className: "size-3 text-muted-foreground" }) }),
|
|
2683
2686
|
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2684
2687
|
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
@@ -2691,7 +2694,7 @@ function Er({
|
|
|
2691
2694
|
{
|
|
2692
2695
|
value: t,
|
|
2693
2696
|
onChange: h,
|
|
2694
|
-
disabled:
|
|
2697
|
+
disabled: a,
|
|
2695
2698
|
className: "h-9 w-[128px] text-sm",
|
|
2696
2699
|
children: jn.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: x(c.value) }, c.value))
|
|
2697
2700
|
}
|
|
@@ -2750,9 +2753,9 @@ function Wn() {
|
|
|
2750
2753
|
function Lr({
|
|
2751
2754
|
value: t,
|
|
2752
2755
|
onChange: n,
|
|
2753
|
-
isLocked:
|
|
2756
|
+
isLocked: a = !1,
|
|
2754
2757
|
className: o,
|
|
2755
|
-
labels:
|
|
2758
|
+
labels: s = {}
|
|
2756
2759
|
}) {
|
|
2757
2760
|
const l = {
|
|
2758
2761
|
title: "Visible hours",
|
|
@@ -2760,20 +2763,20 @@ function Lr({
|
|
|
2760
2763
|
to: "To",
|
|
2761
2764
|
lockedMessage: "This setting is locked by the administrator",
|
|
2762
2765
|
infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
|
|
2763
|
-
...
|
|
2766
|
+
...s
|
|
2764
2767
|
}, x = Wn(), h = (w) => {
|
|
2765
|
-
if (
|
|
2768
|
+
if (a) return;
|
|
2766
2769
|
const P = Number(w.target.value);
|
|
2767
2770
|
P < t.endHour && n({ ...t, startHour: P });
|
|
2768
2771
|
}, c = (w) => {
|
|
2769
|
-
if (
|
|
2772
|
+
if (a) return;
|
|
2770
2773
|
const P = Number(w.target.value);
|
|
2771
2774
|
P > t.startHour && n({ ...t, endHour: P });
|
|
2772
2775
|
};
|
|
2773
2776
|
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", o), children: [
|
|
2774
2777
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2775
2778
|
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: l.title }),
|
|
2776
|
-
|
|
2779
|
+
a ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2777
2780
|
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Pn, { className: "size-3 text-muted-foreground" }) }),
|
|
2778
2781
|
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2779
2782
|
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
@@ -2789,7 +2792,7 @@ function Lr({
|
|
|
2789
2792
|
{
|
|
2790
2793
|
value: t.startHour.toString(),
|
|
2791
2794
|
onChange: h,
|
|
2792
|
-
disabled:
|
|
2795
|
+
disabled: a,
|
|
2793
2796
|
className: "h-9 w-[88px] text-sm",
|
|
2794
2797
|
children: x.map((w) => /* @__PURE__ */ e(
|
|
2795
2798
|
"option",
|
|
@@ -2811,7 +2814,7 @@ function Lr({
|
|
|
2811
2814
|
{
|
|
2812
2815
|
value: t.endHour.toString(),
|
|
2813
2816
|
onChange: c,
|
|
2814
|
-
disabled:
|
|
2817
|
+
disabled: a,
|
|
2815
2818
|
className: "h-9 w-[88px] text-sm",
|
|
2816
2819
|
children: x.map((w) => /* @__PURE__ */ e(
|
|
2817
2820
|
"option",
|
|
@@ -2913,17 +2916,17 @@ const rt = {
|
|
|
2913
2916
|
friday: "Fri",
|
|
2914
2917
|
saturday: "Sat"
|
|
2915
2918
|
};
|
|
2916
|
-
function Rn({ dayLabel: t, config: n, onChange:
|
|
2919
|
+
function Rn({ dayLabel: t, config: n, onChange: a, disabled: o, hourOptions: s }) {
|
|
2917
2920
|
const l = () => {
|
|
2918
|
-
o ||
|
|
2921
|
+
o || a({ ...n, enabled: !n.enabled });
|
|
2919
2922
|
}, x = (c) => {
|
|
2920
2923
|
if (o) return;
|
|
2921
2924
|
const w = Number(c.target.value);
|
|
2922
|
-
w < n.to &&
|
|
2925
|
+
w < n.to && a({ ...n, from: w });
|
|
2923
2926
|
}, h = (c) => {
|
|
2924
2927
|
if (o) return;
|
|
2925
2928
|
const w = Number(c.target.value);
|
|
2926
|
-
w > n.from &&
|
|
2929
|
+
w > n.from && a({ ...n, to: w });
|
|
2927
2930
|
};
|
|
2928
2931
|
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2929
2932
|
/* @__PURE__ */ e(
|
|
@@ -2951,7 +2954,7 @@ function Rn({ dayLabel: t, config: n, onChange: s, disabled: o, hourOptions: a }
|
|
|
2951
2954
|
onChange: x,
|
|
2952
2955
|
disabled: o || !n.enabled,
|
|
2953
2956
|
className: "h-8 w-[76px] text-xs",
|
|
2954
|
-
children:
|
|
2957
|
+
children: s.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value >= n.to, children: c.label }, c.value))
|
|
2955
2958
|
}
|
|
2956
2959
|
),
|
|
2957
2960
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
|
|
@@ -2962,7 +2965,7 @@ function Rn({ dayLabel: t, config: n, onChange: s, disabled: o, hourOptions: a }
|
|
|
2962
2965
|
onChange: h,
|
|
2963
2966
|
disabled: o || !n.enabled,
|
|
2964
2967
|
className: "h-8 w-[76px] text-xs",
|
|
2965
|
-
children:
|
|
2968
|
+
children: s.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value <= n.from, children: c.label }, c.value))
|
|
2966
2969
|
}
|
|
2967
2970
|
)
|
|
2968
2971
|
] });
|
|
@@ -2970,23 +2973,23 @@ function Rn({ dayLabel: t, config: n, onChange: s, disabled: o, hourOptions: a }
|
|
|
2970
2973
|
function Sr({
|
|
2971
2974
|
value: t,
|
|
2972
2975
|
onChange: n,
|
|
2973
|
-
isLocked:
|
|
2976
|
+
isLocked: a = !1,
|
|
2974
2977
|
className: o,
|
|
2975
|
-
labels:
|
|
2978
|
+
labels: s = {}
|
|
2976
2979
|
}) {
|
|
2977
2980
|
const l = {
|
|
2978
2981
|
title: "Working hours",
|
|
2979
2982
|
lockedMessage: "This setting is locked by the administrator",
|
|
2980
2983
|
infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
|
|
2981
2984
|
days: rt,
|
|
2982
|
-
...
|
|
2985
|
+
...s
|
|
2983
2986
|
}, x = Bn(), h = (c, w) => {
|
|
2984
|
-
|
|
2987
|
+
a || n({ ...t, [c]: w });
|
|
2985
2988
|
};
|
|
2986
2989
|
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", o), children: [
|
|
2987
2990
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2988
2991
|
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: l.title }),
|
|
2989
|
-
|
|
2992
|
+
a ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2990
2993
|
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e($n, { className: "size-3 text-muted-foreground" }) }),
|
|
2991
2994
|
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2992
2995
|
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
@@ -3000,7 +3003,7 @@ function Sr({
|
|
|
3000
3003
|
dayLabel: l.days?.[c] ?? rt[c],
|
|
3001
3004
|
config: t[c],
|
|
3002
3005
|
onChange: (w) => h(c, w),
|
|
3003
|
-
disabled:
|
|
3006
|
+
disabled: a,
|
|
3004
3007
|
hourOptions: x
|
|
3005
3008
|
},
|
|
3006
3009
|
c
|
|
@@ -3070,7 +3073,7 @@ function Vn({ className: t }) {
|
|
|
3070
3073
|
}
|
|
3071
3074
|
);
|
|
3072
3075
|
}
|
|
3073
|
-
function Be({ checked: t, onCheckedChange: n, className:
|
|
3076
|
+
function Be({ checked: t, onCheckedChange: n, className: a, children: o }) {
|
|
3074
3077
|
return /* @__PURE__ */ e(
|
|
3075
3078
|
"button",
|
|
3076
3079
|
{
|
|
@@ -3078,21 +3081,21 @@ function Be({ checked: t, onCheckedChange: n, className: s, children: o }) {
|
|
|
3078
3081
|
role: "checkbox",
|
|
3079
3082
|
"aria-checked": t,
|
|
3080
3083
|
onClick: () => n(!t),
|
|
3081
|
-
className:
|
|
3084
|
+
className: a,
|
|
3082
3085
|
children: o
|
|
3083
3086
|
}
|
|
3084
3087
|
);
|
|
3085
3088
|
}
|
|
3086
|
-
function Yn({ src: t, alt: n, fallback:
|
|
3087
|
-
const [
|
|
3088
|
-
return !t ||
|
|
3089
|
+
function Yn({ src: t, alt: n, fallback: a, className: o }) {
|
|
3090
|
+
const [s, l] = le(!1);
|
|
3091
|
+
return !t || s ? /* @__PURE__ */ e(
|
|
3089
3092
|
"div",
|
|
3090
3093
|
{
|
|
3091
3094
|
className: g(
|
|
3092
3095
|
"flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
|
|
3093
3096
|
o
|
|
3094
3097
|
),
|
|
3095
|
-
children:
|
|
3098
|
+
children: a || "?"
|
|
3096
3099
|
}
|
|
3097
3100
|
) : /* @__PURE__ */ e(
|
|
3098
3101
|
"img",
|
|
@@ -3104,7 +3107,7 @@ function Yn({ src: t, alt: n, fallback: s, className: o }) {
|
|
|
3104
3107
|
}
|
|
3105
3108
|
);
|
|
3106
3109
|
}
|
|
3107
|
-
function ot({ value: t, onChange: n, placeholder:
|
|
3110
|
+
function ot({ value: t, onChange: n, placeholder: a, className: o }) {
|
|
3108
3111
|
return /* @__PURE__ */ r("div", { className: g("relative", o), children: [
|
|
3109
3112
|
/* @__PURE__ */ e(Un, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3110
3113
|
/* @__PURE__ */ e(
|
|
@@ -3112,17 +3115,17 @@ function ot({ value: t, onChange: n, placeholder: s, className: o }) {
|
|
|
3112
3115
|
{
|
|
3113
3116
|
type: "text",
|
|
3114
3117
|
value: t,
|
|
3115
|
-
onChange: (
|
|
3116
|
-
placeholder:
|
|
3118
|
+
onChange: (s) => n(s.target.value),
|
|
3119
|
+
placeholder: a,
|
|
3117
3120
|
className: "h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
|
|
3118
3121
|
}
|
|
3119
3122
|
)
|
|
3120
3123
|
] });
|
|
3121
3124
|
}
|
|
3122
|
-
function
|
|
3125
|
+
function at(t, n, a, o = 0.3) {
|
|
3123
3126
|
if (!n.trim()) return t;
|
|
3124
|
-
const
|
|
3125
|
-
return t.filter((l) =>
|
|
3127
|
+
const s = n.toLowerCase();
|
|
3128
|
+
return t.filter((l) => a(l).some((h) => h ? h.toLowerCase().includes(s) : !1));
|
|
3126
3129
|
}
|
|
3127
3130
|
const Kn = {
|
|
3128
3131
|
title: "Filters",
|
|
@@ -3140,9 +3143,9 @@ const Kn = {
|
|
|
3140
3143
|
function Hr({
|
|
3141
3144
|
scheduleTypes: t,
|
|
3142
3145
|
users: n,
|
|
3143
|
-
selectedScheduleTypeIds:
|
|
3146
|
+
selectedScheduleTypeIds: a,
|
|
3144
3147
|
onScheduleTypeChange: o,
|
|
3145
|
-
selectedUserIds:
|
|
3148
|
+
selectedUserIds: s,
|
|
3146
3149
|
onUserChange: l,
|
|
3147
3150
|
onClearAll: x,
|
|
3148
3151
|
className: h,
|
|
@@ -3151,32 +3154,32 @@ function Hr({
|
|
|
3151
3154
|
labels: P,
|
|
3152
3155
|
getScheduleTypeName: b
|
|
3153
3156
|
}) {
|
|
3154
|
-
const y = { ...Kn, ...P }, [B, A] = le(""), [W, F] = le(""), H = ee(() => B.trim() ?
|
|
3157
|
+
const y = { ...Kn, ...P }, [B, A] = le(""), [W, F] = le(""), H = ee(() => B.trim() ? at(t, B, (m) => [
|
|
3155
3158
|
m.name,
|
|
3156
3159
|
b?.(m) || m.name
|
|
3157
|
-
]) : t, [t, B, b]), k = ee(() => W.trim() ?
|
|
3158
|
-
const f = p ? [...
|
|
3160
|
+
]) : t, [t, B, b]), k = ee(() => W.trim() ? at(n, W, (m) => [m.name, m.email || ""]) : n, [n, W]), $ = H.length > 0 && H.every((m) => a.includes(m.id)), R = k.length > 0 && k.every((m) => s.includes(m.id)), Y = a.length + s.length, M = (m, p) => {
|
|
3161
|
+
const f = p ? [...a, m] : a.filter((E) => E !== m);
|
|
3159
3162
|
o(f);
|
|
3160
3163
|
}, V = () => {
|
|
3161
3164
|
if ($) {
|
|
3162
3165
|
const m = new Set(H.map((p) => p.id));
|
|
3163
|
-
o(
|
|
3166
|
+
o(a.filter((p) => !m.has(p)));
|
|
3164
3167
|
} else {
|
|
3165
3168
|
const m = /* @__PURE__ */ new Set([
|
|
3166
|
-
...
|
|
3169
|
+
...a,
|
|
3167
3170
|
...H.map((p) => p.id)
|
|
3168
3171
|
]);
|
|
3169
3172
|
o(Array.from(m));
|
|
3170
3173
|
}
|
|
3171
3174
|
}, S = (m, p) => {
|
|
3172
|
-
const f = p ? [...
|
|
3175
|
+
const f = p ? [...s, m] : s.filter((E) => E !== m);
|
|
3173
3176
|
l(f);
|
|
3174
3177
|
}, z = () => {
|
|
3175
3178
|
if (R) {
|
|
3176
3179
|
const m = new Set(k.map((p) => p.id));
|
|
3177
|
-
l(
|
|
3180
|
+
l(s.filter((p) => !m.has(p)));
|
|
3178
3181
|
} else {
|
|
3179
|
-
const m = /* @__PURE__ */ new Set([...
|
|
3182
|
+
const m = /* @__PURE__ */ new Set([...s, ...k.map((p) => p.id)]);
|
|
3180
3183
|
l(Array.from(m));
|
|
3181
3184
|
}
|
|
3182
3185
|
}, U = () => {
|
|
@@ -3245,7 +3248,7 @@ function Hr({
|
|
|
3245
3248
|
`skeleton-${p}`
|
|
3246
3249
|
))
|
|
3247
3250
|
) : H.map((m) => {
|
|
3248
|
-
const p =
|
|
3251
|
+
const p = a.includes(m.id), f = X(m);
|
|
3249
3252
|
return /* @__PURE__ */ r(
|
|
3250
3253
|
Be,
|
|
3251
3254
|
{
|
|
@@ -3331,7 +3334,7 @@ function Hr({
|
|
|
3331
3334
|
`p-skeleton-${p}`
|
|
3332
3335
|
))
|
|
3333
3336
|
) : k.map((m) => {
|
|
3334
|
-
const p =
|
|
3337
|
+
const p = s.includes(m.id);
|
|
3335
3338
|
return /* @__PURE__ */ r(
|
|
3336
3339
|
Be,
|
|
3337
3340
|
{
|
|
@@ -3410,15 +3413,15 @@ function Gn({ className: t }) {
|
|
|
3410
3413
|
function Ir({
|
|
3411
3414
|
scheduleTypes: t,
|
|
3412
3415
|
value: n,
|
|
3413
|
-
onChange:
|
|
3416
|
+
onChange: a,
|
|
3414
3417
|
allLabel: o = "All types",
|
|
3415
|
-
className:
|
|
3418
|
+
className: s,
|
|
3416
3419
|
label: l
|
|
3417
3420
|
}) {
|
|
3418
3421
|
const x = (c) => {
|
|
3419
|
-
|
|
3422
|
+
a(c.target.value);
|
|
3420
3423
|
}, h = t.find((c) => String(c.id) === n);
|
|
3421
|
-
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1",
|
|
3424
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1", s), children: [
|
|
3422
3425
|
l && /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: l }),
|
|
3423
3426
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
3424
3427
|
h ? /* @__PURE__ */ e(
|
|
@@ -3469,15 +3472,15 @@ function Jn({ className: t }) {
|
|
|
3469
3472
|
function zr({
|
|
3470
3473
|
users: t,
|
|
3471
3474
|
value: n,
|
|
3472
|
-
onChange:
|
|
3475
|
+
onChange: a,
|
|
3473
3476
|
allLabel: o = "All users",
|
|
3474
|
-
className:
|
|
3477
|
+
className: s,
|
|
3475
3478
|
label: l
|
|
3476
3479
|
}) {
|
|
3477
3480
|
const x = (h) => {
|
|
3478
|
-
|
|
3481
|
+
a(h.target.value);
|
|
3479
3482
|
};
|
|
3480
|
-
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1",
|
|
3483
|
+
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1", s), children: [
|
|
3481
3484
|
l && /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: l }),
|
|
3482
3485
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
3483
3486
|
/* @__PURE__ */ e(Jn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
@@ -3583,16 +3586,16 @@ function Zn({ className: t }) {
|
|
|
3583
3586
|
);
|
|
3584
3587
|
}
|
|
3585
3588
|
function er(t) {
|
|
3586
|
-
const n = t.getFullYear(),
|
|
3587
|
-
return `${n}-${
|
|
3589
|
+
const n = t.getFullYear(), a = String(t.getMonth() + 1).padStart(2, "0"), o = String(t.getDate()).padStart(2, "0");
|
|
3590
|
+
return `${n}-${a}-${o}`;
|
|
3588
3591
|
}
|
|
3589
|
-
function
|
|
3590
|
-
const n = t.getHours(),
|
|
3591
|
-
return `${
|
|
3592
|
+
function st(t) {
|
|
3593
|
+
const n = t.getHours(), a = t.getMinutes(), o = n >= 12 ? "PM" : "AM", s = n % 12 || 12, l = String(a).padStart(2, "0");
|
|
3594
|
+
return `${s}:${l} ${o}`;
|
|
3592
3595
|
}
|
|
3593
3596
|
function tr(t) {
|
|
3594
|
-
const n =
|
|
3595
|
-
return `${n} - ${
|
|
3597
|
+
const n = st(t.startDate), a = st(t.endDate);
|
|
3598
|
+
return `${n} - ${a}`;
|
|
3596
3599
|
}
|
|
3597
3600
|
function nr(t) {
|
|
3598
3601
|
const n = mt(/* @__PURE__ */ new Date(), 1);
|
|
@@ -3601,7 +3604,7 @@ function nr(t) {
|
|
|
3601
3604
|
function rr(t) {
|
|
3602
3605
|
if (de(t)) return "Today";
|
|
3603
3606
|
if (nr(t)) return "Tomorrow";
|
|
3604
|
-
const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
3607
|
+
const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], a = [
|
|
3605
3608
|
"Jan",
|
|
3606
3609
|
"Feb",
|
|
3607
3610
|
"Mar",
|
|
@@ -3614,17 +3617,17 @@ function rr(t) {
|
|
|
3614
3617
|
"Oct",
|
|
3615
3618
|
"Nov",
|
|
3616
3619
|
"Dec"
|
|
3617
|
-
], o = n[t.getDay()],
|
|
3618
|
-
return `${o}, ${
|
|
3620
|
+
], o = n[t.getDay()], s = a[t.getMonth()], l = t.getDate();
|
|
3621
|
+
return `${o}, ${s} ${l}`;
|
|
3619
3622
|
}
|
|
3620
3623
|
function or(t, n) {
|
|
3621
|
-
const
|
|
3624
|
+
const a = /* @__PURE__ */ new Map();
|
|
3622
3625
|
for (const o of t) {
|
|
3623
|
-
const
|
|
3624
|
-
l.push(o),
|
|
3626
|
+
const s = er(o.startDate), l = a.get(s) ?? [];
|
|
3627
|
+
l.push(o), a.set(s, l);
|
|
3625
3628
|
}
|
|
3626
|
-
return Array.from(
|
|
3627
|
-
const l = [...
|
|
3629
|
+
return Array.from(a.entries()).map(([o, s]) => {
|
|
3630
|
+
const l = [...s].sort(
|
|
3628
3631
|
(h, c) => h.startDate.getTime() - c.startDate.getTime()
|
|
3629
3632
|
), x = n > 0 ? l.slice(0, n) : l;
|
|
3630
3633
|
return {
|
|
@@ -3633,16 +3636,16 @@ function or(t, n) {
|
|
|
3633
3636
|
events: x,
|
|
3634
3637
|
hasMore: n > 0 && l.length > n
|
|
3635
3638
|
};
|
|
3636
|
-
}).sort((o,
|
|
3639
|
+
}).sort((o, s) => o.date.getTime() - s.date.getTime());
|
|
3637
3640
|
}
|
|
3638
|
-
function
|
|
3639
|
-
const n = We(/* @__PURE__ */ new Date()),
|
|
3640
|
-
return t.filter((o) => o.startDate >= n && o.startDate <=
|
|
3641
|
+
function ar(t) {
|
|
3642
|
+
const n = We(/* @__PURE__ */ new Date()), a = ht(/* @__PURE__ */ new Date());
|
|
3643
|
+
return t.filter((o) => o.startDate >= n && o.startDate <= a).length;
|
|
3641
3644
|
}
|
|
3642
3645
|
function Re({ className: t }) {
|
|
3643
3646
|
return /* @__PURE__ */ e("div", { className: g("animate-pulse rounded-md bg-muted", t) });
|
|
3644
3647
|
}
|
|
3645
|
-
function
|
|
3648
|
+
function sr({ event: t, onClick: n }) {
|
|
3646
3649
|
return /* @__PURE__ */ r(
|
|
3647
3650
|
"button",
|
|
3648
3651
|
{
|
|
@@ -3680,15 +3683,15 @@ function ir({ group: t, onEventClick: n }) {
|
|
|
3680
3683
|
" more"
|
|
3681
3684
|
] })
|
|
3682
3685
|
] }),
|
|
3683
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((
|
|
3686
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((a) => /* @__PURE__ */ e(sr, { event: a, onClick: n }, a.id)) })
|
|
3684
3687
|
] });
|
|
3685
3688
|
}
|
|
3686
3689
|
function jr({
|
|
3687
3690
|
events: t,
|
|
3688
3691
|
isLoading: n = !1,
|
|
3689
|
-
className:
|
|
3692
|
+
className: a,
|
|
3690
3693
|
daysAhead: o = 7,
|
|
3691
|
-
maxEventsPerDay:
|
|
3694
|
+
maxEventsPerDay: s = 3,
|
|
3692
3695
|
onEventClick: l,
|
|
3693
3696
|
onNavigateToAgenda: x
|
|
3694
3697
|
}) {
|
|
@@ -3696,9 +3699,9 @@ function jr({
|
|
|
3696
3699
|
const A = We(/* @__PURE__ */ new Date()), W = mt(A, o);
|
|
3697
3700
|
return t.filter((F) => F.endDate >= A && F.startDate < W);
|
|
3698
3701
|
}, [t, o]), P = ee(
|
|
3699
|
-
() => or(w,
|
|
3700
|
-
[w,
|
|
3701
|
-
), b = ee(() =>
|
|
3702
|
+
() => or(w, s),
|
|
3703
|
+
[w, s]
|
|
3704
|
+
), b = ee(() => ar(t), [t]), y = (A) => {
|
|
3702
3705
|
c(!1), l?.(A);
|
|
3703
3706
|
}, B = () => {
|
|
3704
3707
|
c(!1), x?.();
|
|
@@ -3709,7 +3712,7 @@ function jr({
|
|
|
3709
3712
|
{
|
|
3710
3713
|
className: g(
|
|
3711
3714
|
"relative rounded-xl hover:text-zinc-700 hover:!bg-zinc-300 !bg-zinc-200 text-zinc-600 shadow-none !px-2.5 p-2 max-h-10",
|
|
3712
|
-
|
|
3715
|
+
a
|
|
3713
3716
|
),
|
|
3714
3717
|
children: [
|
|
3715
3718
|
/* @__PURE__ */ e(qn, { className: "h-4 w-4" }),
|
|
@@ -3816,8 +3819,8 @@ function cr(t) {
|
|
|
3816
3819
|
return n.setDate(n.getDate() + 1), t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
|
|
3817
3820
|
}
|
|
3818
3821
|
function it(t) {
|
|
3819
|
-
const n = t.getHours(),
|
|
3820
|
-
return `${n % 12 || 12}:${
|
|
3822
|
+
const n = t.getHours(), a = t.getMinutes(), o = n >= 12 ? "PM" : "AM";
|
|
3823
|
+
return `${n % 12 || 12}:${a.toString().padStart(2, "0")} ${o}`;
|
|
3821
3824
|
}
|
|
3822
3825
|
function dr(t) {
|
|
3823
3826
|
return new Intl.DateTimeFormat("en-US", {
|
|
@@ -3827,20 +3830,20 @@ function dr(t) {
|
|
|
3827
3830
|
}).format(t);
|
|
3828
3831
|
}
|
|
3829
3832
|
function ur(t) {
|
|
3830
|
-
const n = it(t.startDate),
|
|
3831
|
-
return `${n} - ${
|
|
3833
|
+
const n = it(t.startDate), a = it(t.endDate);
|
|
3834
|
+
return `${n} - ${a}`;
|
|
3832
3835
|
}
|
|
3833
3836
|
function hr(t) {
|
|
3834
3837
|
return de(t) ? "Today" : cr(t) ? "Tomorrow" : dr(t);
|
|
3835
3838
|
}
|
|
3836
3839
|
function mr(t, n) {
|
|
3837
|
-
const
|
|
3840
|
+
const a = /* @__PURE__ */ new Map();
|
|
3838
3841
|
for (const o of t) {
|
|
3839
|
-
const
|
|
3840
|
-
l.push(o),
|
|
3842
|
+
const s = Ft(o.startDate), l = a.get(s) ?? [];
|
|
3843
|
+
l.push(o), a.set(s, l);
|
|
3841
3844
|
}
|
|
3842
|
-
return Array.from(
|
|
3843
|
-
const l = [...
|
|
3845
|
+
return Array.from(a.entries()).map(([o, s]) => {
|
|
3846
|
+
const l = [...s].sort(
|
|
3844
3847
|
(h, c) => h.startDate.getTime() - c.startDate.getTime()
|
|
3845
3848
|
), x = n > 0 ? l.slice(0, n) : l;
|
|
3846
3849
|
return {
|
|
@@ -3849,9 +3852,9 @@ function mr(t, n) {
|
|
|
3849
3852
|
events: x,
|
|
3850
3853
|
hasMore: n > 0 && l.length > n
|
|
3851
3854
|
};
|
|
3852
|
-
}).sort((o,
|
|
3855
|
+
}).sort((o, s) => o.date.getTime() - s.date.getTime());
|
|
3853
3856
|
}
|
|
3854
|
-
function fr({ event: t, onClick: n, compact:
|
|
3857
|
+
function fr({ event: t, onClick: n, compact: a }) {
|
|
3855
3858
|
return /* @__PURE__ */ r(
|
|
3856
3859
|
"button",
|
|
3857
3860
|
{
|
|
@@ -3861,24 +3864,24 @@ function fr({ event: t, onClick: n, compact: s }) {
|
|
|
3861
3864
|
"w-full text-left rounded-lg transition-colors",
|
|
3862
3865
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3863
3866
|
"flex items-start gap-3",
|
|
3864
|
-
|
|
3867
|
+
a ? "p-2" : "p-3"
|
|
3865
3868
|
),
|
|
3866
3869
|
children: [
|
|
3867
3870
|
/* @__PURE__ */ e(
|
|
3868
3871
|
"div",
|
|
3869
3872
|
{
|
|
3870
|
-
className: g("shrink-0 rounded-full mt-1",
|
|
3873
|
+
className: g("shrink-0 rounded-full mt-1", a ? "size-2" : "size-2.5"),
|
|
3871
3874
|
style: { backgroundColor: t.color ?? "#3b82f6" }
|
|
3872
3875
|
}
|
|
3873
3876
|
),
|
|
3874
3877
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
3875
|
-
/* @__PURE__ */ e("p", { className: g("font-medium truncate",
|
|
3876
|
-
/* @__PURE__ */ e("p", { className: g("text-muted-foreground truncate",
|
|
3878
|
+
/* @__PURE__ */ e("p", { className: g("font-medium truncate", a ? "text-xs" : "text-sm"), children: t.title }),
|
|
3879
|
+
/* @__PURE__ */ e("p", { className: g("text-muted-foreground truncate", a ? "text-[10px]" : "text-xs"), children: ur(t) })
|
|
3877
3880
|
] }),
|
|
3878
3881
|
n && /* @__PURE__ */ e(
|
|
3879
3882
|
gt,
|
|
3880
3883
|
{
|
|
3881
|
-
className: g("shrink-0 text-muted-foreground/50",
|
|
3884
|
+
className: g("shrink-0 text-muted-foreground/50", a ? "size-3" : "size-4")
|
|
3882
3885
|
}
|
|
3883
3886
|
)
|
|
3884
3887
|
]
|
|
@@ -3888,7 +3891,7 @@ function fr({ event: t, onClick: n, compact: s }) {
|
|
|
3888
3891
|
function gr({
|
|
3889
3892
|
group: t,
|
|
3890
3893
|
onEventClick: n,
|
|
3891
|
-
onViewMore:
|
|
3894
|
+
onViewMore: a,
|
|
3892
3895
|
compact: o
|
|
3893
3896
|
}) {
|
|
3894
3897
|
return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
@@ -3904,25 +3907,25 @@ function gr({
|
|
|
3904
3907
|
children: hr(t.date)
|
|
3905
3908
|
}
|
|
3906
3909
|
),
|
|
3907
|
-
t.hasMore &&
|
|
3910
|
+
t.hasMore && a && /* @__PURE__ */ e(
|
|
3908
3911
|
"button",
|
|
3909
3912
|
{
|
|
3910
3913
|
type: "button",
|
|
3911
|
-
onClick: () =>
|
|
3914
|
+
onClick: () => a(t.date),
|
|
3912
3915
|
className: g("text-primary hover:underline", o ? "text-[10px]" : "text-xs"),
|
|
3913
3916
|
children: "+more"
|
|
3914
3917
|
}
|
|
3915
3918
|
)
|
|
3916
3919
|
] }),
|
|
3917
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((
|
|
3920
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((s) => /* @__PURE__ */ e(fr, { event: s, onClick: n, compact: o }, s.id)) })
|
|
3918
3921
|
] });
|
|
3919
3922
|
}
|
|
3920
3923
|
function Ar({
|
|
3921
3924
|
events: t,
|
|
3922
3925
|
daysAhead: n = 7,
|
|
3923
|
-
maxEventsPerDay:
|
|
3926
|
+
maxEventsPerDay: a = 3,
|
|
3924
3927
|
onEventClick: o,
|
|
3925
|
-
onViewAll:
|
|
3928
|
+
onViewAll: s,
|
|
3926
3929
|
className: l,
|
|
3927
3930
|
emptyState: x,
|
|
3928
3931
|
title: h = "Upcoming",
|
|
@@ -3933,8 +3936,8 @@ function Ar({
|
|
|
3933
3936
|
const H = We(y), k = new Date(H);
|
|
3934
3937
|
return k.setDate(k.getDate() + n), B.filter(($) => $.endDate >= H && $.startDate < k);
|
|
3935
3938
|
}, [B, n, y]), W = ee(
|
|
3936
|
-
() => mr(A,
|
|
3937
|
-
[A,
|
|
3939
|
+
() => mr(A, a),
|
|
3940
|
+
[A, a]
|
|
3938
3941
|
), F = A.length;
|
|
3939
3942
|
return W.length === 0 ? /* @__PURE__ */ r("div", { className: g("rounded-lg border bg-card", l), children: [
|
|
3940
3943
|
c && /* @__PURE__ */ e(
|
|
@@ -3987,11 +3990,11 @@ function Ar({
|
|
|
3987
3990
|
}
|
|
3988
3991
|
)
|
|
3989
3992
|
] }),
|
|
3990
|
-
|
|
3993
|
+
s && /* @__PURE__ */ r(
|
|
3991
3994
|
"button",
|
|
3992
3995
|
{
|
|
3993
3996
|
type: "button",
|
|
3994
|
-
onClick: () =>
|
|
3997
|
+
onClick: () => s(),
|
|
3995
3998
|
className: g(
|
|
3996
3999
|
"text-primary hover:underline flex items-center gap-0.5",
|
|
3997
4000
|
w ? "text-xs" : "text-sm"
|
|
@@ -4017,7 +4020,7 @@ function Ar({
|
|
|
4017
4020
|
{
|
|
4018
4021
|
group: H,
|
|
4019
4022
|
onEventClick: o,
|
|
4020
|
-
onViewMore:
|
|
4023
|
+
onViewMore: s ? (k) => s(k) : void 0,
|
|
4021
4024
|
compact: w
|
|
4022
4025
|
},
|
|
4023
4026
|
H.dateKey
|
|
@@ -4043,4 +4046,4 @@ export {
|
|
|
4043
4046
|
Hr as b,
|
|
4044
4047
|
Mr as c
|
|
4045
4048
|
};
|
|
4046
|
-
//# sourceMappingURL=agenda-widget-
|
|
4049
|
+
//# sourceMappingURL=agenda-widget-CD_UoYWC.js.map
|