@innosolutions/inno-calendar 1.0.64 → 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/dist/{agenda-widget-duVkXi_m.js → agenda-widget-CD_UoYWC.js} +245 -245
- package/dist/{agenda-widget-duVkXi_m.js.map → agenda-widget-CD_UoYWC.js.map} +1 -1
- package/dist/{agenda-widget-A-xsyqRf.cjs → agenda-widget-COxgmpv4.cjs} +2 -2
- package/dist/{agenda-widget-A-xsyqRf.cjs.map → agenda-widget-COxgmpv4.cjs.map} +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- 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/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,7 +2267,7 @@ function En({
|
|
|
2267
2267
|
daysToShow: 1,
|
|
2268
2268
|
events: d,
|
|
2269
2269
|
users: X,
|
|
2270
|
-
...
|
|
2270
|
+
...s && { alwaysShowResources: s },
|
|
2271
2271
|
selectedDate: S,
|
|
2272
2272
|
visibleHours: {
|
|
2273
2273
|
from: T.startHour,
|
|
@@ -2275,7 +2275,7 @@ function En({
|
|
|
2275
2275
|
},
|
|
2276
2276
|
onEventClick: I,
|
|
2277
2277
|
onSlotSelect: re,
|
|
2278
|
-
onSlotClick:
|
|
2278
|
+
onSlotClick: se,
|
|
2279
2279
|
renderPopover: K,
|
|
2280
2280
|
...b && { slots: b },
|
|
2281
2281
|
...y && { classNames: y }
|
|
@@ -2288,7 +2288,7 @@ function En({
|
|
|
2288
2288
|
daysToShow: 3,
|
|
2289
2289
|
events: d,
|
|
2290
2290
|
users: X,
|
|
2291
|
-
...
|
|
2291
|
+
...s && { alwaysShowResources: s },
|
|
2292
2292
|
selectedDate: S,
|
|
2293
2293
|
visibleHours: {
|
|
2294
2294
|
from: T.startHour,
|
|
@@ -2296,7 +2296,7 @@ function En({
|
|
|
2296
2296
|
},
|
|
2297
2297
|
onEventClick: I,
|
|
2298
2298
|
onSlotSelect: re,
|
|
2299
|
-
onSlotClick:
|
|
2299
|
+
onSlotClick: se,
|
|
2300
2300
|
renderPopover: K,
|
|
2301
2301
|
...b && { slots: b },
|
|
2302
2302
|
...y && { classNames: y }
|
|
@@ -2309,7 +2309,7 @@ function En({
|
|
|
2309
2309
|
daysToShow: 7,
|
|
2310
2310
|
events: d,
|
|
2311
2311
|
users: X,
|
|
2312
|
-
...
|
|
2312
|
+
...s && { alwaysShowResources: s },
|
|
2313
2313
|
selectedDate: S,
|
|
2314
2314
|
visibleHours: {
|
|
2315
2315
|
from: T.startHour,
|
|
@@ -2317,7 +2317,7 @@ function En({
|
|
|
2317
2317
|
},
|
|
2318
2318
|
onEventClick: I,
|
|
2319
2319
|
onSlotSelect: re,
|
|
2320
|
-
onSlotClick:
|
|
2320
|
+
onSlotClick: se,
|
|
2321
2321
|
renderPopover: K,
|
|
2322
2322
|
...b && { slots: b },
|
|
2323
2323
|
...y && { classNames: y }
|
|
@@ -2347,7 +2347,7 @@ function En({
|
|
|
2347
2347
|
onSelect: re,
|
|
2348
2348
|
minDurationMinutes: h,
|
|
2349
2349
|
slotDurationMinutes: U,
|
|
2350
|
-
enabled: !!(
|
|
2350
|
+
enabled: !!(a || n),
|
|
2351
2351
|
children: /* @__PURE__ */ r(
|
|
2352
2352
|
"div",
|
|
2353
2353
|
{
|
|
@@ -2413,9 +2413,9 @@ function En({
|
|
|
2413
2413
|
function Ln({
|
|
2414
2414
|
events: t,
|
|
2415
2415
|
users: n = [],
|
|
2416
|
-
alwaysShowResources:
|
|
2416
|
+
alwaysShowResources: a,
|
|
2417
2417
|
scheduleTypes: o = [],
|
|
2418
|
-
initialView:
|
|
2418
|
+
initialView: s = "week",
|
|
2419
2419
|
initialDate: l,
|
|
2420
2420
|
initialSelectedUserId: x,
|
|
2421
2421
|
initialScheduleTypeIds: h,
|
|
@@ -2453,7 +2453,7 @@ function Ln({
|
|
|
2453
2453
|
initialEvents: t,
|
|
2454
2454
|
initialUsers: n,
|
|
2455
2455
|
initialScheduleTypes: o,
|
|
2456
|
-
initialView:
|
|
2456
|
+
initialView: s,
|
|
2457
2457
|
...l && { initialDate: l },
|
|
2458
2458
|
...x && { initialSelectedUserId: x },
|
|
2459
2459
|
...h && { initialScheduleTypeIds: h },
|
|
@@ -2471,7 +2471,7 @@ function Ln({
|
|
|
2471
2471
|
...B && { onSlotClick: B },
|
|
2472
2472
|
...A && { onSlotSelect: A },
|
|
2473
2473
|
...W && { onAddEvent: W },
|
|
2474
|
-
...
|
|
2474
|
+
...a && { alwaysShowResources: a },
|
|
2475
2475
|
...z && { renderPopover: z },
|
|
2476
2476
|
className: $,
|
|
2477
2477
|
showHeader: R,
|
|
@@ -2494,7 +2494,7 @@ function Ln({
|
|
|
2494
2494
|
) });
|
|
2495
2495
|
}
|
|
2496
2496
|
const Dr = Pe(Ln), ve = Pe(
|
|
2497
|
-
({ className: t, children: n, ...
|
|
2497
|
+
({ className: t, children: n, ...a }, o) => /* @__PURE__ */ e(
|
|
2498
2498
|
"select",
|
|
2499
2499
|
{
|
|
2500
2500
|
ref: o,
|
|
@@ -2506,16 +2506,16 @@ const Dr = Pe(Ln), ve = Pe(
|
|
|
2506
2506
|
"[&>option]:bg-background",
|
|
2507
2507
|
t
|
|
2508
2508
|
),
|
|
2509
|
-
...
|
|
2509
|
+
...a,
|
|
2510
2510
|
children: n
|
|
2511
2511
|
}
|
|
2512
2512
|
)
|
|
2513
2513
|
);
|
|
2514
2514
|
ve.displayName = "Select";
|
|
2515
|
-
const me = Pe(({ className: t, ...n },
|
|
2515
|
+
const me = Pe(({ className: t, ...n }, a) => /* @__PURE__ */ e(
|
|
2516
2516
|
"label",
|
|
2517
2517
|
{
|
|
2518
|
-
ref:
|
|
2518
|
+
ref: a,
|
|
2519
2519
|
className: g(
|
|
2520
2520
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2521
2521
|
t
|
|
@@ -2575,22 +2575,22 @@ const Hn = [
|
|
|
2575
2575
|
function Mr({
|
|
2576
2576
|
value: t,
|
|
2577
2577
|
onChange: n,
|
|
2578
|
-
isLocked:
|
|
2578
|
+
isLocked: a = !1,
|
|
2579
2579
|
className: o,
|
|
2580
|
-
labels:
|
|
2580
|
+
labels: s = {}
|
|
2581
2581
|
}) {
|
|
2582
2582
|
const l = {
|
|
2583
2583
|
title: "Slot duration",
|
|
2584
2584
|
lockedMessage: "This setting is locked by the administrator",
|
|
2585
2585
|
infoMessage: "Set the time slot duration for day and week calendar views.",
|
|
2586
|
-
...
|
|
2586
|
+
...s
|
|
2587
2587
|
}, x = (h) => {
|
|
2588
|
-
|
|
2588
|
+
a || n(Number(h.target.value));
|
|
2589
2589
|
};
|
|
2590
2590
|
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", o), children: [
|
|
2591
2591
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2592
2592
|
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: l.title }),
|
|
2593
|
-
|
|
2593
|
+
a ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2594
2594
|
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Tn, { className: "size-3 text-muted-foreground" }) }),
|
|
2595
2595
|
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2596
2596
|
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
@@ -2603,7 +2603,7 @@ function Mr({
|
|
|
2603
2603
|
{
|
|
2604
2604
|
value: t.toString(),
|
|
2605
2605
|
onChange: x,
|
|
2606
|
-
disabled:
|
|
2606
|
+
disabled: a,
|
|
2607
2607
|
className: "h-9 w-[128px] text-sm",
|
|
2608
2608
|
children: Hn.map((h) => /* @__PURE__ */ e("option", { value: h.value.toString(), children: h.label }, h.value))
|
|
2609
2609
|
}
|
|
@@ -2661,9 +2661,9 @@ const jn = [
|
|
|
2661
2661
|
function Er({
|
|
2662
2662
|
value: t,
|
|
2663
2663
|
onChange: n,
|
|
2664
|
-
isLocked:
|
|
2664
|
+
isLocked: a = !1,
|
|
2665
2665
|
className: o,
|
|
2666
|
-
labels:
|
|
2666
|
+
labels: s = {}
|
|
2667
2667
|
}) {
|
|
2668
2668
|
const l = {
|
|
2669
2669
|
title: "Event display",
|
|
@@ -2674,14 +2674,14 @@ function Er({
|
|
|
2674
2674
|
colored: "Full color",
|
|
2675
2675
|
mixed: "Mixed"
|
|
2676
2676
|
},
|
|
2677
|
-
...
|
|
2677
|
+
...s
|
|
2678
2678
|
}, x = (c) => l.options?.[c] ?? c, h = (c) => {
|
|
2679
|
-
|
|
2679
|
+
a || n(c.target.value);
|
|
2680
2680
|
};
|
|
2681
2681
|
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", o), children: [
|
|
2682
2682
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2683
2683
|
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: l.title }),
|
|
2684
|
-
|
|
2684
|
+
a ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2685
2685
|
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(zn, { className: "size-3 text-muted-foreground" }) }),
|
|
2686
2686
|
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2687
2687
|
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
@@ -2694,7 +2694,7 @@ function Er({
|
|
|
2694
2694
|
{
|
|
2695
2695
|
value: t,
|
|
2696
2696
|
onChange: h,
|
|
2697
|
-
disabled:
|
|
2697
|
+
disabled: a,
|
|
2698
2698
|
className: "h-9 w-[128px] text-sm",
|
|
2699
2699
|
children: jn.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: x(c.value) }, c.value))
|
|
2700
2700
|
}
|
|
@@ -2753,9 +2753,9 @@ function Wn() {
|
|
|
2753
2753
|
function Lr({
|
|
2754
2754
|
value: t,
|
|
2755
2755
|
onChange: n,
|
|
2756
|
-
isLocked:
|
|
2756
|
+
isLocked: a = !1,
|
|
2757
2757
|
className: o,
|
|
2758
|
-
labels:
|
|
2758
|
+
labels: s = {}
|
|
2759
2759
|
}) {
|
|
2760
2760
|
const l = {
|
|
2761
2761
|
title: "Visible hours",
|
|
@@ -2763,20 +2763,20 @@ function Lr({
|
|
|
2763
2763
|
to: "To",
|
|
2764
2764
|
lockedMessage: "This setting is locked by the administrator",
|
|
2765
2765
|
infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
|
|
2766
|
-
...
|
|
2766
|
+
...s
|
|
2767
2767
|
}, x = Wn(), h = (w) => {
|
|
2768
|
-
if (
|
|
2768
|
+
if (a) return;
|
|
2769
2769
|
const P = Number(w.target.value);
|
|
2770
2770
|
P < t.endHour && n({ ...t, startHour: P });
|
|
2771
2771
|
}, c = (w) => {
|
|
2772
|
-
if (
|
|
2772
|
+
if (a) return;
|
|
2773
2773
|
const P = Number(w.target.value);
|
|
2774
2774
|
P > t.startHour && n({ ...t, endHour: P });
|
|
2775
2775
|
};
|
|
2776
2776
|
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", o), children: [
|
|
2777
2777
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2778
2778
|
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: l.title }),
|
|
2779
|
-
|
|
2779
|
+
a ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2780
2780
|
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Pn, { className: "size-3 text-muted-foreground" }) }),
|
|
2781
2781
|
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2782
2782
|
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
@@ -2792,7 +2792,7 @@ function Lr({
|
|
|
2792
2792
|
{
|
|
2793
2793
|
value: t.startHour.toString(),
|
|
2794
2794
|
onChange: h,
|
|
2795
|
-
disabled:
|
|
2795
|
+
disabled: a,
|
|
2796
2796
|
className: "h-9 w-[88px] text-sm",
|
|
2797
2797
|
children: x.map((w) => /* @__PURE__ */ e(
|
|
2798
2798
|
"option",
|
|
@@ -2814,7 +2814,7 @@ function Lr({
|
|
|
2814
2814
|
{
|
|
2815
2815
|
value: t.endHour.toString(),
|
|
2816
2816
|
onChange: c,
|
|
2817
|
-
disabled:
|
|
2817
|
+
disabled: a,
|
|
2818
2818
|
className: "h-9 w-[88px] text-sm",
|
|
2819
2819
|
children: x.map((w) => /* @__PURE__ */ e(
|
|
2820
2820
|
"option",
|
|
@@ -2916,17 +2916,17 @@ const rt = {
|
|
|
2916
2916
|
friday: "Fri",
|
|
2917
2917
|
saturday: "Sat"
|
|
2918
2918
|
};
|
|
2919
|
-
function Rn({ dayLabel: t, config: n, onChange:
|
|
2919
|
+
function Rn({ dayLabel: t, config: n, onChange: a, disabled: o, hourOptions: s }) {
|
|
2920
2920
|
const l = () => {
|
|
2921
|
-
o ||
|
|
2921
|
+
o || a({ ...n, enabled: !n.enabled });
|
|
2922
2922
|
}, x = (c) => {
|
|
2923
2923
|
if (o) return;
|
|
2924
2924
|
const w = Number(c.target.value);
|
|
2925
|
-
w < n.to &&
|
|
2925
|
+
w < n.to && a({ ...n, from: w });
|
|
2926
2926
|
}, h = (c) => {
|
|
2927
2927
|
if (o) return;
|
|
2928
2928
|
const w = Number(c.target.value);
|
|
2929
|
-
w > n.from &&
|
|
2929
|
+
w > n.from && a({ ...n, to: w });
|
|
2930
2930
|
};
|
|
2931
2931
|
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2932
2932
|
/* @__PURE__ */ e(
|
|
@@ -2954,7 +2954,7 @@ function Rn({ dayLabel: t, config: n, onChange: s, disabled: o, hourOptions: a }
|
|
|
2954
2954
|
onChange: x,
|
|
2955
2955
|
disabled: o || !n.enabled,
|
|
2956
2956
|
className: "h-8 w-[76px] text-xs",
|
|
2957
|
-
children:
|
|
2957
|
+
children: s.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value >= n.to, children: c.label }, c.value))
|
|
2958
2958
|
}
|
|
2959
2959
|
),
|
|
2960
2960
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
|
|
@@ -2965,7 +2965,7 @@ function Rn({ dayLabel: t, config: n, onChange: s, disabled: o, hourOptions: a }
|
|
|
2965
2965
|
onChange: h,
|
|
2966
2966
|
disabled: o || !n.enabled,
|
|
2967
2967
|
className: "h-8 w-[76px] text-xs",
|
|
2968
|
-
children:
|
|
2968
|
+
children: s.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value <= n.from, children: c.label }, c.value))
|
|
2969
2969
|
}
|
|
2970
2970
|
)
|
|
2971
2971
|
] });
|
|
@@ -2973,23 +2973,23 @@ function Rn({ dayLabel: t, config: n, onChange: s, disabled: o, hourOptions: a }
|
|
|
2973
2973
|
function Sr({
|
|
2974
2974
|
value: t,
|
|
2975
2975
|
onChange: n,
|
|
2976
|
-
isLocked:
|
|
2976
|
+
isLocked: a = !1,
|
|
2977
2977
|
className: o,
|
|
2978
|
-
labels:
|
|
2978
|
+
labels: s = {}
|
|
2979
2979
|
}) {
|
|
2980
2980
|
const l = {
|
|
2981
2981
|
title: "Working hours",
|
|
2982
2982
|
lockedMessage: "This setting is locked by the administrator",
|
|
2983
2983
|
infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
|
|
2984
2984
|
days: rt,
|
|
2985
|
-
...
|
|
2985
|
+
...s
|
|
2986
2986
|
}, x = Bn(), h = (c, w) => {
|
|
2987
|
-
|
|
2987
|
+
a || n({ ...t, [c]: w });
|
|
2988
2988
|
};
|
|
2989
2989
|
return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", o), children: [
|
|
2990
2990
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2991
2991
|
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: l.title }),
|
|
2992
|
-
|
|
2992
|
+
a ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2993
2993
|
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e($n, { className: "size-3 text-muted-foreground" }) }),
|
|
2994
2994
|
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2995
2995
|
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
@@ -3003,7 +3003,7 @@ function Sr({
|
|
|
3003
3003
|
dayLabel: l.days?.[c] ?? rt[c],
|
|
3004
3004
|
config: t[c],
|
|
3005
3005
|
onChange: (w) => h(c, w),
|
|
3006
|
-
disabled:
|
|
3006
|
+
disabled: a,
|
|
3007
3007
|
hourOptions: x
|
|
3008
3008
|
},
|
|
3009
3009
|
c
|
|
@@ -3073,7 +3073,7 @@ function Vn({ className: t }) {
|
|
|
3073
3073
|
}
|
|
3074
3074
|
);
|
|
3075
3075
|
}
|
|
3076
|
-
function Be({ checked: t, onCheckedChange: n, className:
|
|
3076
|
+
function Be({ checked: t, onCheckedChange: n, className: a, children: o }) {
|
|
3077
3077
|
return /* @__PURE__ */ e(
|
|
3078
3078
|
"button",
|
|
3079
3079
|
{
|
|
@@ -3081,21 +3081,21 @@ function Be({ checked: t, onCheckedChange: n, className: s, children: o }) {
|
|
|
3081
3081
|
role: "checkbox",
|
|
3082
3082
|
"aria-checked": t,
|
|
3083
3083
|
onClick: () => n(!t),
|
|
3084
|
-
className:
|
|
3084
|
+
className: a,
|
|
3085
3085
|
children: o
|
|
3086
3086
|
}
|
|
3087
3087
|
);
|
|
3088
3088
|
}
|
|
3089
|
-
function Yn({ src: t, alt: n, fallback:
|
|
3090
|
-
const [
|
|
3091
|
-
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(
|
|
3092
3092
|
"div",
|
|
3093
3093
|
{
|
|
3094
3094
|
className: g(
|
|
3095
3095
|
"flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
|
|
3096
3096
|
o
|
|
3097
3097
|
),
|
|
3098
|
-
children:
|
|
3098
|
+
children: a || "?"
|
|
3099
3099
|
}
|
|
3100
3100
|
) : /* @__PURE__ */ e(
|
|
3101
3101
|
"img",
|
|
@@ -3107,7 +3107,7 @@ function Yn({ src: t, alt: n, fallback: s, className: o }) {
|
|
|
3107
3107
|
}
|
|
3108
3108
|
);
|
|
3109
3109
|
}
|
|
3110
|
-
function ot({ value: t, onChange: n, placeholder:
|
|
3110
|
+
function ot({ value: t, onChange: n, placeholder: a, className: o }) {
|
|
3111
3111
|
return /* @__PURE__ */ r("div", { className: g("relative", o), children: [
|
|
3112
3112
|
/* @__PURE__ */ e(Un, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3113
3113
|
/* @__PURE__ */ e(
|
|
@@ -3115,17 +3115,17 @@ function ot({ value: t, onChange: n, placeholder: s, className: o }) {
|
|
|
3115
3115
|
{
|
|
3116
3116
|
type: "text",
|
|
3117
3117
|
value: t,
|
|
3118
|
-
onChange: (
|
|
3119
|
-
placeholder:
|
|
3118
|
+
onChange: (s) => n(s.target.value),
|
|
3119
|
+
placeholder: a,
|
|
3120
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"
|
|
3121
3121
|
}
|
|
3122
3122
|
)
|
|
3123
3123
|
] });
|
|
3124
3124
|
}
|
|
3125
|
-
function
|
|
3125
|
+
function at(t, n, a, o = 0.3) {
|
|
3126
3126
|
if (!n.trim()) return t;
|
|
3127
|
-
const
|
|
3128
|
-
return t.filter((l) =>
|
|
3127
|
+
const s = n.toLowerCase();
|
|
3128
|
+
return t.filter((l) => a(l).some((h) => h ? h.toLowerCase().includes(s) : !1));
|
|
3129
3129
|
}
|
|
3130
3130
|
const Kn = {
|
|
3131
3131
|
title: "Filters",
|
|
@@ -3143,9 +3143,9 @@ const Kn = {
|
|
|
3143
3143
|
function Hr({
|
|
3144
3144
|
scheduleTypes: t,
|
|
3145
3145
|
users: n,
|
|
3146
|
-
selectedScheduleTypeIds:
|
|
3146
|
+
selectedScheduleTypeIds: a,
|
|
3147
3147
|
onScheduleTypeChange: o,
|
|
3148
|
-
selectedUserIds:
|
|
3148
|
+
selectedUserIds: s,
|
|
3149
3149
|
onUserChange: l,
|
|
3150
3150
|
onClearAll: x,
|
|
3151
3151
|
className: h,
|
|
@@ -3154,32 +3154,32 @@ function Hr({
|
|
|
3154
3154
|
labels: P,
|
|
3155
3155
|
getScheduleTypeName: b
|
|
3156
3156
|
}) {
|
|
3157
|
-
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) => [
|
|
3158
3158
|
m.name,
|
|
3159
3159
|
b?.(m) || m.name
|
|
3160
|
-
]) : t, [t, B, b]), k = ee(() => W.trim() ?
|
|
3161
|
-
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);
|
|
3162
3162
|
o(f);
|
|
3163
3163
|
}, V = () => {
|
|
3164
3164
|
if ($) {
|
|
3165
3165
|
const m = new Set(H.map((p) => p.id));
|
|
3166
|
-
o(
|
|
3166
|
+
o(a.filter((p) => !m.has(p)));
|
|
3167
3167
|
} else {
|
|
3168
3168
|
const m = /* @__PURE__ */ new Set([
|
|
3169
|
-
...
|
|
3169
|
+
...a,
|
|
3170
3170
|
...H.map((p) => p.id)
|
|
3171
3171
|
]);
|
|
3172
3172
|
o(Array.from(m));
|
|
3173
3173
|
}
|
|
3174
3174
|
}, S = (m, p) => {
|
|
3175
|
-
const f = p ? [...
|
|
3175
|
+
const f = p ? [...s, m] : s.filter((E) => E !== m);
|
|
3176
3176
|
l(f);
|
|
3177
3177
|
}, z = () => {
|
|
3178
3178
|
if (R) {
|
|
3179
3179
|
const m = new Set(k.map((p) => p.id));
|
|
3180
|
-
l(
|
|
3180
|
+
l(s.filter((p) => !m.has(p)));
|
|
3181
3181
|
} else {
|
|
3182
|
-
const m = /* @__PURE__ */ new Set([...
|
|
3182
|
+
const m = /* @__PURE__ */ new Set([...s, ...k.map((p) => p.id)]);
|
|
3183
3183
|
l(Array.from(m));
|
|
3184
3184
|
}
|
|
3185
3185
|
}, U = () => {
|
|
@@ -3248,7 +3248,7 @@ function Hr({
|
|
|
3248
3248
|
`skeleton-${p}`
|
|
3249
3249
|
))
|
|
3250
3250
|
) : H.map((m) => {
|
|
3251
|
-
const p =
|
|
3251
|
+
const p = a.includes(m.id), f = X(m);
|
|
3252
3252
|
return /* @__PURE__ */ r(
|
|
3253
3253
|
Be,
|
|
3254
3254
|
{
|
|
@@ -3334,7 +3334,7 @@ function Hr({
|
|
|
3334
3334
|
`p-skeleton-${p}`
|
|
3335
3335
|
))
|
|
3336
3336
|
) : k.map((m) => {
|
|
3337
|
-
const p =
|
|
3337
|
+
const p = s.includes(m.id);
|
|
3338
3338
|
return /* @__PURE__ */ r(
|
|
3339
3339
|
Be,
|
|
3340
3340
|
{
|
|
@@ -3413,15 +3413,15 @@ function Gn({ className: t }) {
|
|
|
3413
3413
|
function Ir({
|
|
3414
3414
|
scheduleTypes: t,
|
|
3415
3415
|
value: n,
|
|
3416
|
-
onChange:
|
|
3416
|
+
onChange: a,
|
|
3417
3417
|
allLabel: o = "All types",
|
|
3418
|
-
className:
|
|
3418
|
+
className: s,
|
|
3419
3419
|
label: l
|
|
3420
3420
|
}) {
|
|
3421
3421
|
const x = (c) => {
|
|
3422
|
-
|
|
3422
|
+
a(c.target.value);
|
|
3423
3423
|
}, h = t.find((c) => String(c.id) === n);
|
|
3424
|
-
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: [
|
|
3425
3425
|
l && /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: l }),
|
|
3426
3426
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
3427
3427
|
h ? /* @__PURE__ */ e(
|
|
@@ -3472,15 +3472,15 @@ function Jn({ className: t }) {
|
|
|
3472
3472
|
function zr({
|
|
3473
3473
|
users: t,
|
|
3474
3474
|
value: n,
|
|
3475
|
-
onChange:
|
|
3475
|
+
onChange: a,
|
|
3476
3476
|
allLabel: o = "All users",
|
|
3477
|
-
className:
|
|
3477
|
+
className: s,
|
|
3478
3478
|
label: l
|
|
3479
3479
|
}) {
|
|
3480
3480
|
const x = (h) => {
|
|
3481
|
-
|
|
3481
|
+
a(h.target.value);
|
|
3482
3482
|
};
|
|
3483
|
-
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: [
|
|
3484
3484
|
l && /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: l }),
|
|
3485
3485
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
3486
3486
|
/* @__PURE__ */ e(Jn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
@@ -3586,16 +3586,16 @@ function Zn({ className: t }) {
|
|
|
3586
3586
|
);
|
|
3587
3587
|
}
|
|
3588
3588
|
function er(t) {
|
|
3589
|
-
const n = t.getFullYear(),
|
|
3590
|
-
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}`;
|
|
3591
3591
|
}
|
|
3592
|
-
function
|
|
3593
|
-
const n = t.getHours(),
|
|
3594
|
-
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}`;
|
|
3595
3595
|
}
|
|
3596
3596
|
function tr(t) {
|
|
3597
|
-
const n =
|
|
3598
|
-
return `${n} - ${
|
|
3597
|
+
const n = st(t.startDate), a = st(t.endDate);
|
|
3598
|
+
return `${n} - ${a}`;
|
|
3599
3599
|
}
|
|
3600
3600
|
function nr(t) {
|
|
3601
3601
|
const n = mt(/* @__PURE__ */ new Date(), 1);
|
|
@@ -3604,7 +3604,7 @@ function nr(t) {
|
|
|
3604
3604
|
function rr(t) {
|
|
3605
3605
|
if (de(t)) return "Today";
|
|
3606
3606
|
if (nr(t)) return "Tomorrow";
|
|
3607
|
-
const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
3607
|
+
const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], a = [
|
|
3608
3608
|
"Jan",
|
|
3609
3609
|
"Feb",
|
|
3610
3610
|
"Mar",
|
|
@@ -3617,17 +3617,17 @@ function rr(t) {
|
|
|
3617
3617
|
"Oct",
|
|
3618
3618
|
"Nov",
|
|
3619
3619
|
"Dec"
|
|
3620
|
-
], o = n[t.getDay()],
|
|
3621
|
-
return `${o}, ${
|
|
3620
|
+
], o = n[t.getDay()], s = a[t.getMonth()], l = t.getDate();
|
|
3621
|
+
return `${o}, ${s} ${l}`;
|
|
3622
3622
|
}
|
|
3623
3623
|
function or(t, n) {
|
|
3624
|
-
const
|
|
3624
|
+
const a = /* @__PURE__ */ new Map();
|
|
3625
3625
|
for (const o of t) {
|
|
3626
|
-
const
|
|
3627
|
-
l.push(o),
|
|
3626
|
+
const s = er(o.startDate), l = a.get(s) ?? [];
|
|
3627
|
+
l.push(o), a.set(s, l);
|
|
3628
3628
|
}
|
|
3629
|
-
return Array.from(
|
|
3630
|
-
const l = [...
|
|
3629
|
+
return Array.from(a.entries()).map(([o, s]) => {
|
|
3630
|
+
const l = [...s].sort(
|
|
3631
3631
|
(h, c) => h.startDate.getTime() - c.startDate.getTime()
|
|
3632
3632
|
), x = n > 0 ? l.slice(0, n) : l;
|
|
3633
3633
|
return {
|
|
@@ -3636,16 +3636,16 @@ function or(t, n) {
|
|
|
3636
3636
|
events: x,
|
|
3637
3637
|
hasMore: n > 0 && l.length > n
|
|
3638
3638
|
};
|
|
3639
|
-
}).sort((o,
|
|
3639
|
+
}).sort((o, s) => o.date.getTime() - s.date.getTime());
|
|
3640
3640
|
}
|
|
3641
|
-
function
|
|
3642
|
-
const n = We(/* @__PURE__ */ new Date()),
|
|
3643
|
-
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;
|
|
3644
3644
|
}
|
|
3645
3645
|
function Re({ className: t }) {
|
|
3646
3646
|
return /* @__PURE__ */ e("div", { className: g("animate-pulse rounded-md bg-muted", t) });
|
|
3647
3647
|
}
|
|
3648
|
-
function
|
|
3648
|
+
function sr({ event: t, onClick: n }) {
|
|
3649
3649
|
return /* @__PURE__ */ r(
|
|
3650
3650
|
"button",
|
|
3651
3651
|
{
|
|
@@ -3683,15 +3683,15 @@ function ir({ group: t, onEventClick: n }) {
|
|
|
3683
3683
|
" more"
|
|
3684
3684
|
] })
|
|
3685
3685
|
] }),
|
|
3686
|
-
/* @__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)) })
|
|
3687
3687
|
] });
|
|
3688
3688
|
}
|
|
3689
3689
|
function jr({
|
|
3690
3690
|
events: t,
|
|
3691
3691
|
isLoading: n = !1,
|
|
3692
|
-
className:
|
|
3692
|
+
className: a,
|
|
3693
3693
|
daysAhead: o = 7,
|
|
3694
|
-
maxEventsPerDay:
|
|
3694
|
+
maxEventsPerDay: s = 3,
|
|
3695
3695
|
onEventClick: l,
|
|
3696
3696
|
onNavigateToAgenda: x
|
|
3697
3697
|
}) {
|
|
@@ -3699,9 +3699,9 @@ function jr({
|
|
|
3699
3699
|
const A = We(/* @__PURE__ */ new Date()), W = mt(A, o);
|
|
3700
3700
|
return t.filter((F) => F.endDate >= A && F.startDate < W);
|
|
3701
3701
|
}, [t, o]), P = ee(
|
|
3702
|
-
() => or(w,
|
|
3703
|
-
[w,
|
|
3704
|
-
), b = ee(() =>
|
|
3702
|
+
() => or(w, s),
|
|
3703
|
+
[w, s]
|
|
3704
|
+
), b = ee(() => ar(t), [t]), y = (A) => {
|
|
3705
3705
|
c(!1), l?.(A);
|
|
3706
3706
|
}, B = () => {
|
|
3707
3707
|
c(!1), x?.();
|
|
@@ -3712,7 +3712,7 @@ function jr({
|
|
|
3712
3712
|
{
|
|
3713
3713
|
className: g(
|
|
3714
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",
|
|
3715
|
-
|
|
3715
|
+
a
|
|
3716
3716
|
),
|
|
3717
3717
|
children: [
|
|
3718
3718
|
/* @__PURE__ */ e(qn, { className: "h-4 w-4" }),
|
|
@@ -3819,8 +3819,8 @@ function cr(t) {
|
|
|
3819
3819
|
return n.setDate(n.getDate() + 1), t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
|
|
3820
3820
|
}
|
|
3821
3821
|
function it(t) {
|
|
3822
|
-
const n = t.getHours(),
|
|
3823
|
-
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}`;
|
|
3824
3824
|
}
|
|
3825
3825
|
function dr(t) {
|
|
3826
3826
|
return new Intl.DateTimeFormat("en-US", {
|
|
@@ -3830,20 +3830,20 @@ function dr(t) {
|
|
|
3830
3830
|
}).format(t);
|
|
3831
3831
|
}
|
|
3832
3832
|
function ur(t) {
|
|
3833
|
-
const n = it(t.startDate),
|
|
3834
|
-
return `${n} - ${
|
|
3833
|
+
const n = it(t.startDate), a = it(t.endDate);
|
|
3834
|
+
return `${n} - ${a}`;
|
|
3835
3835
|
}
|
|
3836
3836
|
function hr(t) {
|
|
3837
3837
|
return de(t) ? "Today" : cr(t) ? "Tomorrow" : dr(t);
|
|
3838
3838
|
}
|
|
3839
3839
|
function mr(t, n) {
|
|
3840
|
-
const
|
|
3840
|
+
const a = /* @__PURE__ */ new Map();
|
|
3841
3841
|
for (const o of t) {
|
|
3842
|
-
const
|
|
3843
|
-
l.push(o),
|
|
3842
|
+
const s = Ft(o.startDate), l = a.get(s) ?? [];
|
|
3843
|
+
l.push(o), a.set(s, l);
|
|
3844
3844
|
}
|
|
3845
|
-
return Array.from(
|
|
3846
|
-
const l = [...
|
|
3845
|
+
return Array.from(a.entries()).map(([o, s]) => {
|
|
3846
|
+
const l = [...s].sort(
|
|
3847
3847
|
(h, c) => h.startDate.getTime() - c.startDate.getTime()
|
|
3848
3848
|
), x = n > 0 ? l.slice(0, n) : l;
|
|
3849
3849
|
return {
|
|
@@ -3852,9 +3852,9 @@ function mr(t, n) {
|
|
|
3852
3852
|
events: x,
|
|
3853
3853
|
hasMore: n > 0 && l.length > n
|
|
3854
3854
|
};
|
|
3855
|
-
}).sort((o,
|
|
3855
|
+
}).sort((o, s) => o.date.getTime() - s.date.getTime());
|
|
3856
3856
|
}
|
|
3857
|
-
function fr({ event: t, onClick: n, compact:
|
|
3857
|
+
function fr({ event: t, onClick: n, compact: a }) {
|
|
3858
3858
|
return /* @__PURE__ */ r(
|
|
3859
3859
|
"button",
|
|
3860
3860
|
{
|
|
@@ -3864,24 +3864,24 @@ function fr({ event: t, onClick: n, compact: s }) {
|
|
|
3864
3864
|
"w-full text-left rounded-lg transition-colors",
|
|
3865
3865
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3866
3866
|
"flex items-start gap-3",
|
|
3867
|
-
|
|
3867
|
+
a ? "p-2" : "p-3"
|
|
3868
3868
|
),
|
|
3869
3869
|
children: [
|
|
3870
3870
|
/* @__PURE__ */ e(
|
|
3871
3871
|
"div",
|
|
3872
3872
|
{
|
|
3873
|
-
className: g("shrink-0 rounded-full mt-1",
|
|
3873
|
+
className: g("shrink-0 rounded-full mt-1", a ? "size-2" : "size-2.5"),
|
|
3874
3874
|
style: { backgroundColor: t.color ?? "#3b82f6" }
|
|
3875
3875
|
}
|
|
3876
3876
|
),
|
|
3877
3877
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
3878
|
-
/* @__PURE__ */ e("p", { className: g("font-medium truncate",
|
|
3879
|
-
/* @__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) })
|
|
3880
3880
|
] }),
|
|
3881
3881
|
n && /* @__PURE__ */ e(
|
|
3882
3882
|
gt,
|
|
3883
3883
|
{
|
|
3884
|
-
className: g("shrink-0 text-muted-foreground/50",
|
|
3884
|
+
className: g("shrink-0 text-muted-foreground/50", a ? "size-3" : "size-4")
|
|
3885
3885
|
}
|
|
3886
3886
|
)
|
|
3887
3887
|
]
|
|
@@ -3891,7 +3891,7 @@ function fr({ event: t, onClick: n, compact: s }) {
|
|
|
3891
3891
|
function gr({
|
|
3892
3892
|
group: t,
|
|
3893
3893
|
onEventClick: n,
|
|
3894
|
-
onViewMore:
|
|
3894
|
+
onViewMore: a,
|
|
3895
3895
|
compact: o
|
|
3896
3896
|
}) {
|
|
3897
3897
|
return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
@@ -3907,25 +3907,25 @@ function gr({
|
|
|
3907
3907
|
children: hr(t.date)
|
|
3908
3908
|
}
|
|
3909
3909
|
),
|
|
3910
|
-
t.hasMore &&
|
|
3910
|
+
t.hasMore && a && /* @__PURE__ */ e(
|
|
3911
3911
|
"button",
|
|
3912
3912
|
{
|
|
3913
3913
|
type: "button",
|
|
3914
|
-
onClick: () =>
|
|
3914
|
+
onClick: () => a(t.date),
|
|
3915
3915
|
className: g("text-primary hover:underline", o ? "text-[10px]" : "text-xs"),
|
|
3916
3916
|
children: "+more"
|
|
3917
3917
|
}
|
|
3918
3918
|
)
|
|
3919
3919
|
] }),
|
|
3920
|
-
/* @__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)) })
|
|
3921
3921
|
] });
|
|
3922
3922
|
}
|
|
3923
3923
|
function Ar({
|
|
3924
3924
|
events: t,
|
|
3925
3925
|
daysAhead: n = 7,
|
|
3926
|
-
maxEventsPerDay:
|
|
3926
|
+
maxEventsPerDay: a = 3,
|
|
3927
3927
|
onEventClick: o,
|
|
3928
|
-
onViewAll:
|
|
3928
|
+
onViewAll: s,
|
|
3929
3929
|
className: l,
|
|
3930
3930
|
emptyState: x,
|
|
3931
3931
|
title: h = "Upcoming",
|
|
@@ -3936,8 +3936,8 @@ function Ar({
|
|
|
3936
3936
|
const H = We(y), k = new Date(H);
|
|
3937
3937
|
return k.setDate(k.getDate() + n), B.filter(($) => $.endDate >= H && $.startDate < k);
|
|
3938
3938
|
}, [B, n, y]), W = ee(
|
|
3939
|
-
() => mr(A,
|
|
3940
|
-
[A,
|
|
3939
|
+
() => mr(A, a),
|
|
3940
|
+
[A, a]
|
|
3941
3941
|
), F = A.length;
|
|
3942
3942
|
return W.length === 0 ? /* @__PURE__ */ r("div", { className: g("rounded-lg border bg-card", l), children: [
|
|
3943
3943
|
c && /* @__PURE__ */ e(
|
|
@@ -3990,11 +3990,11 @@ function Ar({
|
|
|
3990
3990
|
}
|
|
3991
3991
|
)
|
|
3992
3992
|
] }),
|
|
3993
|
-
|
|
3993
|
+
s && /* @__PURE__ */ r(
|
|
3994
3994
|
"button",
|
|
3995
3995
|
{
|
|
3996
3996
|
type: "button",
|
|
3997
|
-
onClick: () =>
|
|
3997
|
+
onClick: () => s(),
|
|
3998
3998
|
className: g(
|
|
3999
3999
|
"text-primary hover:underline flex items-center gap-0.5",
|
|
4000
4000
|
w ? "text-xs" : "text-sm"
|
|
@@ -4020,7 +4020,7 @@ function Ar({
|
|
|
4020
4020
|
{
|
|
4021
4021
|
group: H,
|
|
4022
4022
|
onEventClick: o,
|
|
4023
|
-
onViewMore:
|
|
4023
|
+
onViewMore: s ? (k) => s(k) : void 0,
|
|
4024
4024
|
compact: w
|
|
4025
4025
|
},
|
|
4026
4026
|
H.dateKey
|
|
@@ -4046,4 +4046,4 @@ export {
|
|
|
4046
4046
|
Hr as b,
|
|
4047
4047
|
Mr as c
|
|
4048
4048
|
};
|
|
4049
|
-
//# sourceMappingURL=agenda-widget-
|
|
4049
|
+
//# sourceMappingURL=agenda-widget-CD_UoYWC.js.map
|