calendarkit-pro 1.1.0 → 1.2.0
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/index.d.mts +75 -44
- package/dist/index.d.ts +75 -44
- package/dist/index.js +231 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +231 -72
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -15,6 +15,8 @@ import { RRule } from 'rrule';
|
|
|
15
15
|
function cn(...inputs) {
|
|
16
16
|
return twMerge(clsx(inputs));
|
|
17
17
|
}
|
|
18
|
+
var isEventDragDisabled = (event) => event?.draggable === false;
|
|
19
|
+
var isEventResizeDisabled = (event) => event?.resizable === false || event?.resizable === void 0 && isEventDragDisabled(event);
|
|
18
20
|
|
|
19
21
|
// src/components/ui/button.tsx
|
|
20
22
|
var buttonVariants = cva(
|
|
@@ -157,18 +159,30 @@ var getMonthGrid = (date, weekStartOn = 0) => {
|
|
|
157
159
|
end: endDate
|
|
158
160
|
});
|
|
159
161
|
};
|
|
162
|
+
var uses24HourClock = (locale) => {
|
|
163
|
+
if (!locale) return false;
|
|
164
|
+
return !/[ap]\.?m/i.test(format(new Date(2e3, 0, 1, 13, 0), "p", { locale }));
|
|
165
|
+
};
|
|
160
166
|
var MiniCalendar = ({
|
|
161
167
|
currentDate,
|
|
162
168
|
onDateChange,
|
|
163
169
|
onViewChange,
|
|
164
|
-
className
|
|
170
|
+
className,
|
|
171
|
+
locale
|
|
165
172
|
}) => {
|
|
166
173
|
const [viewDate, setViewDate] = React15__default.useState(currentDate);
|
|
167
174
|
React15__default.useEffect(() => {
|
|
168
175
|
setViewDate(currentDate);
|
|
169
176
|
}, [currentDate]);
|
|
170
|
-
const
|
|
171
|
-
const
|
|
177
|
+
const weekStartsOn = locale?.options?.weekStartsOn ?? 0;
|
|
178
|
+
const days = React15__default.useMemo(
|
|
179
|
+
() => getMonthGrid(viewDate, weekStartsOn),
|
|
180
|
+
[viewDate, weekStartsOn]
|
|
181
|
+
);
|
|
182
|
+
const weekDays = locale?.localize ? [0, 1, 2, 3, 4, 5, 6].map((d) => {
|
|
183
|
+
const dayIndex = (d + weekStartsOn) % 7;
|
|
184
|
+
return locale.localize.day(dayIndex, { width: "narrow" });
|
|
185
|
+
}) : ["S", "M", "T", "W", "T", "F", "S"];
|
|
172
186
|
const handlePrev = () => {
|
|
173
187
|
const newDate = subMonths(viewDate, 1);
|
|
174
188
|
setViewDate(newDate);
|
|
@@ -185,7 +199,7 @@ var MiniCalendar = ({
|
|
|
185
199
|
onDateChange(day);
|
|
186
200
|
if (onViewChange) onViewChange("day");
|
|
187
201
|
};
|
|
188
|
-
return /* @__PURE__ */ React15__default.createElement("div", { className: cn("px-4 w-[260px]", className) }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-semibold text-foreground capitalize" }, format(viewDate, "MMMM yyyy")), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center bg-muted/40 rounded-lg p-0.5" }, /* @__PURE__ */ React15__default.createElement(
|
|
202
|
+
return /* @__PURE__ */ React15__default.createElement("div", { className: cn("px-4 w-[260px]", className) }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-semibold text-foreground capitalize" }, format(viewDate, "MMMM yyyy", { locale })), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center bg-muted/40 rounded-lg p-0.5" }, /* @__PURE__ */ React15__default.createElement(
|
|
189
203
|
Button,
|
|
190
204
|
{
|
|
191
205
|
variant: "ghost",
|
|
@@ -237,7 +251,8 @@ var Sidebar = ({
|
|
|
237
251
|
readOnly,
|
|
238
252
|
calendars,
|
|
239
253
|
onCalendarToggle,
|
|
240
|
-
translations
|
|
254
|
+
translations,
|
|
255
|
+
locale
|
|
241
256
|
}) => {
|
|
242
257
|
const [calendarsOpen, setCalendarsOpen] = useState(true);
|
|
243
258
|
const [timezoneOpen, setTimezoneOpen] = useState(false);
|
|
@@ -264,7 +279,7 @@ var Sidebar = ({
|
|
|
264
279
|
}
|
|
265
280
|
};
|
|
266
281
|
const timezones = [
|
|
267
|
-
{ value: "", label: "Local Time", acronym: "LOC" },
|
|
282
|
+
{ value: "", label: translations?.localTime || "Local Time", acronym: "LOC" },
|
|
268
283
|
{ value: "UTC", label: "UTC", acronym: "UTC" },
|
|
269
284
|
{ value: "America/New_York", label: "New York", acronym: "EST" },
|
|
270
285
|
{ value: "America/Chicago", label: "Chicago", acronym: "CST" },
|
|
@@ -314,7 +329,7 @@ var Sidebar = ({
|
|
|
314
329
|
},
|
|
315
330
|
/* @__PURE__ */ React15__default.createElement(Plus, { className: "w-5 h-5" }),
|
|
316
331
|
/* @__PURE__ */ React15__default.createElement("span", { className: "text-sm" }, translations?.create || "Create")
|
|
317
|
-
)), /* @__PURE__ */ React15__default.createElement(MiniCalendar, { currentDate, onDateChange, onViewChange }), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 px-4 space-y-5 mt-5" }, /* @__PURE__ */ React15__default.createElement("div", { className: "bg-muted/20 rounded-2xl p-3 border-[0px] border-border/30" }, /* @__PURE__ */ React15__default.createElement(
|
|
332
|
+
)), /* @__PURE__ */ React15__default.createElement(MiniCalendar, { currentDate, onDateChange, onViewChange, locale }), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 px-4 space-y-5 mt-5" }, /* @__PURE__ */ React15__default.createElement("div", { className: "bg-muted/20 rounded-2xl p-3 border-[0px] border-border/30" }, /* @__PURE__ */ React15__default.createElement(
|
|
318
333
|
"div",
|
|
319
334
|
{
|
|
320
335
|
className: "flex items-center justify-between cursor-pointer hover:bg-accent/50 p-2 -m-1 rounded-xl mb-2 transition-all duration-200",
|
|
@@ -384,9 +399,11 @@ var Sidebar = ({
|
|
|
384
399
|
))))))));
|
|
385
400
|
};
|
|
386
401
|
var DraggableEvent = ({ event, children, className, style: propStyle, ...props }) => {
|
|
402
|
+
const dragDisabled = isEventDragDisabled(event);
|
|
387
403
|
const { attributes, listeners, setNodeRef, transform, isDragging } = useDraggable({
|
|
388
404
|
id: event.id,
|
|
389
|
-
data: { event }
|
|
405
|
+
data: { event },
|
|
406
|
+
disabled: dragDisabled
|
|
390
407
|
});
|
|
391
408
|
const style = {
|
|
392
409
|
...propStyle,
|
|
@@ -408,7 +425,7 @@ var DraggableEvent = ({ event, children, className, style: propStyle, ...props }
|
|
|
408
425
|
...listeners,
|
|
409
426
|
...attributes,
|
|
410
427
|
...props,
|
|
411
|
-
className: cn("touch-none", className)
|
|
428
|
+
className: cn(!dragDisabled && "touch-none", className)
|
|
412
429
|
},
|
|
413
430
|
children
|
|
414
431
|
);
|
|
@@ -467,12 +484,16 @@ var MonthView = ({
|
|
|
467
484
|
timezone,
|
|
468
485
|
locale
|
|
469
486
|
}) => {
|
|
470
|
-
const
|
|
487
|
+
const weekStartsOn = locale?.options?.weekStartsOn ?? 1;
|
|
488
|
+
const days = useMemo(
|
|
489
|
+
() => getMonthGrid(currentDate, weekStartsOn),
|
|
490
|
+
[currentDate, weekStartsOn]
|
|
491
|
+
);
|
|
471
492
|
const weekDays = useMemo(() => {
|
|
472
|
-
const start = startOfWeek(currentDate, { weekStartsOn
|
|
473
|
-
const end = endOfWeek(currentDate, { weekStartsOn
|
|
493
|
+
const start = startOfWeek(currentDate, { weekStartsOn });
|
|
494
|
+
const end = endOfWeek(currentDate, { weekStartsOn });
|
|
474
495
|
return eachDayOfInterval({ start, end });
|
|
475
|
-
}, [currentDate]);
|
|
496
|
+
}, [currentDate, weekStartsOn]);
|
|
476
497
|
const getZonedDate = useCallback((date) => {
|
|
477
498
|
return timezone ? toZonedTime(date, timezone) : date;
|
|
478
499
|
}, [timezone]);
|
|
@@ -531,11 +552,13 @@ var ResizableEvent = ({
|
|
|
531
552
|
style,
|
|
532
553
|
readonly
|
|
533
554
|
}) => {
|
|
555
|
+
const resizeLocked = readonly || isEventResizeDisabled(event);
|
|
534
556
|
const [isResizing, setIsResizing] = useState(false);
|
|
535
557
|
const [resizeHeight, setResizeHeight] = useState(null);
|
|
536
558
|
const containerRef = useRef(null);
|
|
537
559
|
const startYRef = useRef(0);
|
|
538
560
|
const startHeightRef = useRef(0);
|
|
561
|
+
const resizeHeightRef = useRef(null);
|
|
539
562
|
const handleResizeStart = useCallback((e) => {
|
|
540
563
|
e.preventDefault();
|
|
541
564
|
e.stopPropagation();
|
|
@@ -553,13 +576,15 @@ var ResizableEvent = ({
|
|
|
553
576
|
// Minimum height based on minDuration
|
|
554
577
|
startHeightRef.current + snappedDelta
|
|
555
578
|
);
|
|
579
|
+
resizeHeightRef.current = newHeight;
|
|
556
580
|
setResizeHeight(newHeight);
|
|
557
581
|
};
|
|
558
582
|
const handleEnd = () => {
|
|
559
583
|
setIsResizing(false);
|
|
560
|
-
|
|
584
|
+
const finalHeight = resizeHeightRef.current;
|
|
585
|
+
if (finalHeight !== null && containerRef.current && onResize) {
|
|
561
586
|
const originalHeight = startHeightRef.current;
|
|
562
|
-
const heightDiff =
|
|
587
|
+
const heightDiff = finalHeight - originalHeight;
|
|
563
588
|
const minutesDiff = heightDiff / hourHeight * 60;
|
|
564
589
|
const newEnd = new Date(event.end);
|
|
565
590
|
newEnd.setMinutes(newEnd.getMinutes() + minutesDiff);
|
|
@@ -567,6 +592,7 @@ var ResizableEvent = ({
|
|
|
567
592
|
onResize(event, newEnd);
|
|
568
593
|
}
|
|
569
594
|
}
|
|
595
|
+
resizeHeightRef.current = null;
|
|
570
596
|
setResizeHeight(null);
|
|
571
597
|
document.removeEventListener("mousemove", handleMove);
|
|
572
598
|
document.removeEventListener("mouseup", handleEnd);
|
|
@@ -577,7 +603,10 @@ var ResizableEvent = ({
|
|
|
577
603
|
document.addEventListener("mouseup", handleEnd);
|
|
578
604
|
document.addEventListener("touchmove", handleMove, { passive: false });
|
|
579
605
|
document.addEventListener("touchend", handleEnd);
|
|
580
|
-
}, [event, hourHeight, minDuration, onResize
|
|
606
|
+
}, [event, hourHeight, minDuration, onResize]);
|
|
607
|
+
const handlePointerDown = useCallback((e) => {
|
|
608
|
+
e.stopPropagation();
|
|
609
|
+
}, []);
|
|
581
610
|
return /* @__PURE__ */ React15__default.createElement(
|
|
582
611
|
"div",
|
|
583
612
|
{
|
|
@@ -593,13 +622,14 @@ var ResizableEvent = ({
|
|
|
593
622
|
"div",
|
|
594
623
|
{
|
|
595
624
|
className: cn(
|
|
596
|
-
|
|
625
|
+
resizeLocked ? "cursor-default" : "cursor-ns-resize group-hover:opacity-100",
|
|
597
626
|
"absolute bottom-0 left-0 right-0 h-3 z-20 flex items-center justify-center",
|
|
598
627
|
"opacity-0 transition-opacity",
|
|
599
628
|
isResizing && "opacity-100"
|
|
600
629
|
),
|
|
601
|
-
|
|
602
|
-
|
|
630
|
+
onPointerDown: resizeLocked ? void 0 : handlePointerDown,
|
|
631
|
+
onMouseDown: resizeLocked ? void 0 : handleResizeStart,
|
|
632
|
+
onTouchStart: resizeLocked ? void 0 : handleResizeStart
|
|
603
633
|
},
|
|
604
634
|
/* @__PURE__ */ React15__default.createElement("div", { className: cn(
|
|
605
635
|
"w-8 h-1 rounded-full transition-all",
|
|
@@ -621,8 +651,9 @@ var WeekView = ({
|
|
|
621
651
|
locale,
|
|
622
652
|
readonly
|
|
623
653
|
}) => {
|
|
624
|
-
const
|
|
625
|
-
const
|
|
654
|
+
const weekStartsOn = locale?.options?.weekStartsOn ?? 1;
|
|
655
|
+
const start = startOfWeek(currentDate, { weekStartsOn });
|
|
656
|
+
const end = endOfWeek(currentDate, { weekStartsOn });
|
|
626
657
|
const weekDays = eachDayOfInterval({ start, end });
|
|
627
658
|
const hours = Array.from({ length: 24 }, (_, i) => i);
|
|
628
659
|
const hourHeight = 60;
|
|
@@ -669,15 +700,15 @@ var WeekView = ({
|
|
|
669
700
|
}
|
|
670
701
|
return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center justify-center leading-tight" }, /* @__PURE__ */ React15__default.createElement("span", null, displayTime), /* @__PURE__ */ React15__default.createElement("span", { className: "text-[10px] opacity-75" }, "(", acronym, ")"));
|
|
671
702
|
};
|
|
672
|
-
const
|
|
673
|
-
const
|
|
674
|
-
const
|
|
703
|
+
const is24h = uses24HourClock(locale);
|
|
704
|
+
const timeFormat = is24h ? "H:mm" : "h a";
|
|
705
|
+
const eventTimeFormat = is24h ? "H:mm" : "h:mm a";
|
|
706
|
+
const nowFormat = is24h ? "H:mm" : "h:mm";
|
|
675
707
|
return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full bg-background border-[0.5px] border-border/50 rounded-2xl overflow-hidden min-w-[800px] md:min-w-0 shadow-sm" }, /* @__PURE__ */ React15__default.createElement(
|
|
676
708
|
"div",
|
|
677
709
|
{
|
|
678
710
|
ref: scrollContainerRef,
|
|
679
|
-
className: "flex-1 overflow-y-auto scrollbar-hide relative bg-background scroll-smooth"
|
|
680
|
-
style: { scrollbarGutter: "stable" }
|
|
711
|
+
className: "flex-1 overflow-y-auto scrollbar-hide relative bg-background scroll-smooth"
|
|
681
712
|
},
|
|
682
713
|
/* @__PURE__ */ React15__default.createElement("div", { className: "flex border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/20 via-background to-muted/20 z-20 sticky top-0 backdrop-blur-sm" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex-none p-3 text-center text-xs font-semibold text-muted-foreground w-16 flex items-center justify-center border-r-[0.5px] border-border/30 bg-muted/10" }, getTimezoneDisplay(timezone)), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 grid grid-cols-7" }, weekDays.map((day, index) => /* @__PURE__ */ React15__default.createElement("div", { key: day.toISOString(), className: cn("py-3 px-2 text-center", index > 0 && "border-l-[0.5px] border-border/30") }, /* @__PURE__ */ React15__default.createElement("div", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5" }, format(day, "EEE", { locale })), /* @__PURE__ */ React15__default.createElement("div", { className: cn(
|
|
683
714
|
"w-9 h-9 flex items-center justify-center rounded-xl mx-auto text-sm font-semibold transition-all duration-200",
|
|
@@ -792,7 +823,7 @@ var WeekView = ({
|
|
|
792
823
|
className: cn(
|
|
793
824
|
"rounded-md border shadow-sm transition-all hover:shadow-md group overflow-hidden relative",
|
|
794
825
|
"glass",
|
|
795
|
-
readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
826
|
+
readonly || isEventDragDisabled(event) ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
796
827
|
!event.color && "border-primary/20 bg-primary/10",
|
|
797
828
|
isShortEvent ? "px-1 flex items-center justify-center" : "p-2",
|
|
798
829
|
// Add active border for overlapped events to distinguish them
|
|
@@ -879,9 +910,10 @@ var DayView = ({
|
|
|
879
910
|
const zonedStart = getZonedDate(e.start);
|
|
880
911
|
return isSameDay(zonedStart, currentDate);
|
|
881
912
|
});
|
|
882
|
-
const
|
|
883
|
-
const
|
|
884
|
-
const
|
|
913
|
+
const is24h = uses24HourClock(locale);
|
|
914
|
+
const timeFormat = is24h ? "H:mm" : "h a";
|
|
915
|
+
const eventTimeFormat = is24h ? "H:mm" : "h:mm a";
|
|
916
|
+
const nowFormat = is24h ? "H:mm" : "h:mm a";
|
|
885
917
|
return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full bg-background border-[0.5px] border-border/50 rounded-2xl overflow-hidden shadow-sm" }, /* @__PURE__ */ React15__default.createElement("div", { className: "px-6 py-4 border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/20 via-background to-muted/20 text-center shrink-0" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-center gap-3" }, /* @__PURE__ */ React15__default.createElement("h2", { className: "text-xl font-semibold capitalize text-foreground" }, format(currentDate, "EEEE, MMMM d, yyyy", { locale })), isToday(currentDate) && /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-semibold bg-primary text-primary-foreground px-3 py-1 rounded-full shadow-md shadow-primary/20" }, "Today"))), /* @__PURE__ */ React15__default.createElement("div", { ref: scrollContainerRef, className: "flex-1 overflow-y-auto relative" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex relative", style: { height: hours.length * hourHeight } }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-20 bg-muted/5 border-r-[0.5px] border-border/30 relative" }, hours.map((hour) => /* @__PURE__ */ React15__default.createElement(
|
|
886
918
|
"div",
|
|
887
919
|
{
|
|
@@ -986,7 +1018,7 @@ var DayView = ({
|
|
|
986
1018
|
className: cn(
|
|
987
1019
|
"h-full rounded-lg border-[0.5px] shadow-sm overflow-hidden transition-all hover:shadow-lg hover:z-20 group",
|
|
988
1020
|
"glass backdrop-blur-sm",
|
|
989
|
-
readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
1021
|
+
readonly || isEventDragDisabled(event) ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
990
1022
|
!event.color && "bg-primary/10 border-primary/20",
|
|
991
1023
|
isShortEvent ? "px-2 flex items-center" : "px-3 py-2",
|
|
992
1024
|
count > 1 && "border-l-4"
|
|
@@ -1023,7 +1055,7 @@ var DayView = ({
|
|
|
1023
1055
|
/* @__PURE__ */ React15__default.createElement("div", { className: "absolute -left-1.5 w-3 h-3 bg-primary rounded-full shadow-lg shadow-primary/40 ring-2 ring-background animate-pulse" })
|
|
1024
1056
|
)))));
|
|
1025
1057
|
};
|
|
1026
|
-
var AgendaEmptyState = ({ onCreateEvent, translations }) => /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center justify-center h-full min-h-[400px] py-12" }, /* @__PURE__ */ React15__default.createElement("div", { className: "relative mb-8" }, /* @__PURE__ */ React15__default.createElement("div", { className: "p-8 bg-gradient-to-br from-green-50 to-blue-50 dark:from-green-900/10 dark:to-blue-900/10 rounded-3xl border border-border/30" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-12 h-12 rounded-2xl bg-green-100 dark:bg-green-900/30 flex items-center justify-center" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-6 h-6 text-green-600 dark:text-green-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2 }, /* @__PURE__ */ React15__default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))), /* @__PURE__ */ React15__default.createElement("div", { className: "text-left" }, /* @__PURE__ */ React15__default.createElement("div", { className: "font-medium text-foreground" }, "All caught up!"), /* @__PURE__ */ React15__default.createElement("div", { className: "text-sm text-muted-foreground" }, "No events scheduled"))))), /* @__PURE__ */ React15__default.createElement("div", { className: "text-center max-w-sm" }, /* @__PURE__ */ React15__default.createElement("h3", { className: "text-lg font-semibold text-foreground mb-2" }, translations?.noUpcoming || "Your schedule is clear"), /* @__PURE__ */ React15__default.createElement("p", { className: "text-sm text-muted-foreground mb-6" }, "No upcoming events to show. Create a new event to start planning."), onCreateEvent && /* @__PURE__ */ React15__default.createElement(
|
|
1058
|
+
var AgendaEmptyState = ({ onCreateEvent, translations }) => /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center justify-center h-full min-h-[400px] py-12" }, /* @__PURE__ */ React15__default.createElement("div", { className: "relative mb-8" }, /* @__PURE__ */ React15__default.createElement("div", { className: "p-8 bg-gradient-to-br from-green-50 to-blue-50 dark:from-green-900/10 dark:to-blue-900/10 rounded-3xl border border-border/30" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-12 h-12 rounded-2xl bg-green-100 dark:bg-green-900/30 flex items-center justify-center" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-6 h-6 text-green-600 dark:text-green-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2 }, /* @__PURE__ */ React15__default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))), /* @__PURE__ */ React15__default.createElement("div", { className: "text-left" }, /* @__PURE__ */ React15__default.createElement("div", { className: "font-medium text-foreground" }, translations?.allCaughtUp || "All caught up!"), /* @__PURE__ */ React15__default.createElement("div", { className: "text-sm text-muted-foreground" }, translations?.noEventsScheduled || "No events scheduled"))))), /* @__PURE__ */ React15__default.createElement("div", { className: "text-center max-w-sm" }, /* @__PURE__ */ React15__default.createElement("h3", { className: "text-lg font-semibold text-foreground mb-2" }, translations?.noUpcoming || "Your schedule is clear"), /* @__PURE__ */ React15__default.createElement("p", { className: "text-sm text-muted-foreground mb-6" }, translations?.noUpcomingHint || "No upcoming events to show. Create a new event to start planning."), onCreateEvent && /* @__PURE__ */ React15__default.createElement(
|
|
1027
1059
|
"button",
|
|
1028
1060
|
{
|
|
1029
1061
|
onClick: onCreateEvent,
|
|
@@ -1040,17 +1072,22 @@ var formatDuration = (start, end) => {
|
|
|
1040
1072
|
if (remainingMinutes === 0) return `${hours}h`;
|
|
1041
1073
|
return `${hours}h ${remainingMinutes}m`;
|
|
1042
1074
|
};
|
|
1043
|
-
var getDateLabel = (date) => {
|
|
1044
|
-
if (isToday(date)) return "Today";
|
|
1045
|
-
if (isTomorrow(date)) return "Tomorrow";
|
|
1046
|
-
return format(date, "EEEE");
|
|
1075
|
+
var getDateLabel = (date, locale, translations) => {
|
|
1076
|
+
if (isToday(date)) return translations?.today || "Today";
|
|
1077
|
+
if (isTomorrow(date)) return translations?.tomorrow || "Tomorrow";
|
|
1078
|
+
return format(date, "EEEE", { locale });
|
|
1047
1079
|
};
|
|
1048
1080
|
var AgendaView = ({
|
|
1049
1081
|
currentDate,
|
|
1050
1082
|
events,
|
|
1051
1083
|
onEventClick,
|
|
1052
|
-
onCreateEvent
|
|
1084
|
+
onCreateEvent,
|
|
1085
|
+
locale,
|
|
1086
|
+
translations
|
|
1053
1087
|
}) => {
|
|
1088
|
+
const is24h = uses24HourClock(locale);
|
|
1089
|
+
const timePattern = is24h ? "H:mm" : "h:mm a";
|
|
1090
|
+
const compactTimePattern = is24h ? "H:mm" : "h:mm";
|
|
1054
1091
|
const groupedEvents = useMemo(() => {
|
|
1055
1092
|
const startDate = startOfDay(currentDate);
|
|
1056
1093
|
const groups = [];
|
|
@@ -1077,7 +1114,7 @@ var AgendaView = ({
|
|
|
1077
1114
|
hidden: { opacity: 0, x: -20 },
|
|
1078
1115
|
show: { opacity: 1, x: 0 }
|
|
1079
1116
|
};
|
|
1080
|
-
return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full bg-background overflow-y-auto" }, groupedEvents.length === 0 ? /* @__PURE__ */ React15__default.createElement(AgendaEmptyState, { onCreateEvent }) : /* @__PURE__ */ React15__default.createElement(
|
|
1117
|
+
return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full bg-background overflow-y-auto" }, groupedEvents.length === 0 ? /* @__PURE__ */ React15__default.createElement(AgendaEmptyState, { onCreateEvent, translations }) : /* @__PURE__ */ React15__default.createElement(
|
|
1081
1118
|
motion.div,
|
|
1082
1119
|
{
|
|
1083
1120
|
className: "max-w-3xl mx-auto w-full pb-10 px-4 md:px-6",
|
|
@@ -1095,10 +1132,10 @@ var AgendaView = ({
|
|
|
1095
1132
|
/* @__PURE__ */ React15__default.createElement("div", { className: "sticky top-0 bg-background/95 backdrop-blur-md py-4 z-10 border-b border-border/50" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React15__default.createElement("div", { className: cn(
|
|
1096
1133
|
"flex flex-col items-center justify-center w-16 h-16 rounded-2xl transition-all",
|
|
1097
1134
|
isToday(group.date) ? "bg-primary text-primary-foreground shadow-lg shadow-primary/30" : "bg-muted/50 text-foreground"
|
|
1098
|
-
) }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-2xl font-bold leading-none" }, format(group.date, "d")), /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-medium uppercase tracking-wide opacity-80" }, format(group.date, "MMM"))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React15__default.createElement("span", { className: cn(
|
|
1135
|
+
) }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-2xl font-bold leading-none" }, format(group.date, "d")), /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-medium uppercase tracking-wide opacity-80" }, format(group.date, "MMM", { locale }))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React15__default.createElement("span", { className: cn(
|
|
1099
1136
|
"text-lg font-semibold",
|
|
1100
1137
|
isToday(group.date) && "text-primary"
|
|
1101
|
-
) }, getDateLabel(group.date)), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm text-muted-foreground" }, group.events.length, "
|
|
1138
|
+
) }, getDateLabel(group.date, locale, translations)), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm text-muted-foreground" }, group.events.length, " ", group.events.length !== 1 ? translations?.eventPlural || "events" : translations?.eventSingular || "event")))),
|
|
1102
1139
|
/* @__PURE__ */ React15__default.createElement("div", { className: "py-4 space-y-3" }, group.events.map((event, eventIndex) => /* @__PURE__ */ React15__default.createElement(
|
|
1103
1140
|
motion.div,
|
|
1104
1141
|
{
|
|
@@ -1120,14 +1157,14 @@ var AgendaView = ({
|
|
|
1120
1157
|
style: { backgroundColor: event.color || "var(--primary)" }
|
|
1121
1158
|
}
|
|
1122
1159
|
),
|
|
1123
|
-
/* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center min-w-[70px] pl-2" }, event.allDay ? /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-semibold text-muted-foreground bg-muted/80 px-2.5 py-1 rounded-full" }, "All Day")) : /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-base font-semibold text-foreground" }, format(event.start,
|
|
1160
|
+
/* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center min-w-[70px] pl-2" }, event.allDay ? /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-semibold text-muted-foreground bg-muted/80 px-2.5 py-1 rounded-full" }, translations?.allDay || "All Day")) : /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-base font-semibold text-foreground" }, format(event.start, compactTimePattern, { locale })), !is24h && /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs text-muted-foreground uppercase" }, format(event.start, "a")), /* @__PURE__ */ React15__default.createElement("div", { className: "w-px h-3 bg-border my-1" }), /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs text-muted-foreground/70 font-medium" }, formatDuration(event.start, event.end)))),
|
|
1124
1161
|
/* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 min-w-0 space-y-2" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-start justify-between gap-2" }, /* @__PURE__ */ React15__default.createElement("h4", { className: "text-base font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-1" }, event.title), /* @__PURE__ */ React15__default.createElement(
|
|
1125
1162
|
"div",
|
|
1126
1163
|
{
|
|
1127
1164
|
className: "w-3 h-3 rounded-full shrink-0 mt-1.5",
|
|
1128
1165
|
style: { backgroundColor: event.color || "var(--primary)" }
|
|
1129
1166
|
}
|
|
1130
|
-
)), event.description && /* @__PURE__ */ React15__default.createElement("p", { className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed" }, event.description), /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-wrap items-center gap-3 pt-1" }, !event.allDay && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React15__default.createElement(Clock, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React15__default.createElement("span", null, format(event.start,
|
|
1167
|
+
)), event.description && /* @__PURE__ */ React15__default.createElement("p", { className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed" }, event.description), /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-wrap items-center gap-3 pt-1" }, !event.allDay && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React15__default.createElement(Clock, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React15__default.createElement("span", null, format(event.start, timePattern, { locale }), " - ", format(event.end, timePattern, { locale }))), event.guests && event.guests.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React15__default.createElement(Users, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React15__default.createElement("span", null, event.guests.length, " ", event.guests.length !== 1 ? translations?.guestsCount || "guests" : translations?.guestCount || "guest")), event.attachments && event.attachments.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React15__default.createElement(Paperclip, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React15__default.createElement("span", null, event.attachments.length)), event.reminders && event.reminders.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React15__default.createElement(Bell, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React15__default.createElement("span", null, event.reminders.length)))),
|
|
1131
1168
|
/* @__PURE__ */ React15__default.createElement("div", { className: "absolute right-4 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-5 h-5 text-muted-foreground", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ React15__default.createElement("path", { d: "M9 18l6-6-6-6" })))
|
|
1132
1169
|
)))
|
|
1133
1170
|
))
|
|
@@ -1144,7 +1181,7 @@ var ResourceView = ({
|
|
|
1144
1181
|
const containerRef = useRef(null);
|
|
1145
1182
|
const hours = Array.from({ length: 24 }, (_, i) => i);
|
|
1146
1183
|
const hourWidth = 100;
|
|
1147
|
-
const timeFormat = locale
|
|
1184
|
+
const timeFormat = uses24HourClock(locale) ? "H:mm" : "h a";
|
|
1148
1185
|
const getEventStyle = (event) => {
|
|
1149
1186
|
const start = new Date(event.start);
|
|
1150
1187
|
const end = new Date(event.end);
|
|
@@ -2023,6 +2060,146 @@ var useEventContextMenu = () => {
|
|
|
2023
2060
|
};
|
|
2024
2061
|
};
|
|
2025
2062
|
|
|
2063
|
+
// src/locales/index.ts
|
|
2064
|
+
var en = {
|
|
2065
|
+
today: "Today",
|
|
2066
|
+
month: "Month",
|
|
2067
|
+
week: "Week",
|
|
2068
|
+
day: "Day",
|
|
2069
|
+
agenda: "Agenda",
|
|
2070
|
+
resource: "Resources",
|
|
2071
|
+
createEvent: "Create Event",
|
|
2072
|
+
editEvent: "Edit Event",
|
|
2073
|
+
delete: "Delete",
|
|
2074
|
+
save: "Save",
|
|
2075
|
+
cancel: "Cancel",
|
|
2076
|
+
title: "Add title",
|
|
2077
|
+
start: "Start",
|
|
2078
|
+
end: "End",
|
|
2079
|
+
allDay: "All Day",
|
|
2080
|
+
description: "Description",
|
|
2081
|
+
repeat: "Repeat",
|
|
2082
|
+
noRepeat: "Does not repeat",
|
|
2083
|
+
selectCalendar: "Select Calendar",
|
|
2084
|
+
selectType: "Select Type",
|
|
2085
|
+
daily: "Daily",
|
|
2086
|
+
weekly: "Weekly",
|
|
2087
|
+
monthly: "Monthly",
|
|
2088
|
+
yearly: "Yearly",
|
|
2089
|
+
search: "Search events...",
|
|
2090
|
+
allTypes: "All Types",
|
|
2091
|
+
timezone: "Time zone",
|
|
2092
|
+
localTime: "Local Time",
|
|
2093
|
+
create: "Create",
|
|
2094
|
+
calendars: "Calendars",
|
|
2095
|
+
event: "Event",
|
|
2096
|
+
task: "Task",
|
|
2097
|
+
appointmentSchedule: "Appointment schedule",
|
|
2098
|
+
new: "New",
|
|
2099
|
+
dateAndTime: "Date & Time",
|
|
2100
|
+
whosJoining: "Who's joining?",
|
|
2101
|
+
suggestedTimes: "Suggested times for guests",
|
|
2102
|
+
viewSuggestions: "View suggestions",
|
|
2103
|
+
whereWillItBe: "Where will it be?",
|
|
2104
|
+
location: "Enter address",
|
|
2105
|
+
descriptionAndAttachments: "Description",
|
|
2106
|
+
dragAndDrop: "Drag & drop files or",
|
|
2107
|
+
guests: "Guests",
|
|
2108
|
+
addGuests: "Add guests",
|
|
2109
|
+
addAttachment: "Upload files",
|
|
2110
|
+
moreOptions: "More options",
|
|
2111
|
+
doesNotRepeat: "Does not repeat",
|
|
2112
|
+
locationHelpText: 'Enter a physical address (e.g. "123 Main St") to generate the map.',
|
|
2113
|
+
notes: "Notes...",
|
|
2114
|
+
guestCount: "guest",
|
|
2115
|
+
guestsCount: "guests",
|
|
2116
|
+
repeatFor: "Repeat for",
|
|
2117
|
+
times: "times",
|
|
2118
|
+
until: "Until",
|
|
2119
|
+
endRepeat: "End repeat",
|
|
2120
|
+
never: "Never",
|
|
2121
|
+
afterOccurrences: "After occurrences",
|
|
2122
|
+
onDate: "On date",
|
|
2123
|
+
tomorrow: "Tomorrow",
|
|
2124
|
+
edit: "Edit",
|
|
2125
|
+
duplicate: "Duplicate",
|
|
2126
|
+
eventSingular: "event",
|
|
2127
|
+
eventPlural: "events",
|
|
2128
|
+
allCaughtUp: "All caught up!",
|
|
2129
|
+
noEventsScheduled: "No events scheduled",
|
|
2130
|
+
noUpcoming: "Your schedule is clear",
|
|
2131
|
+
noUpcomingHint: "No upcoming events to show. Create a new event to start planning."
|
|
2132
|
+
};
|
|
2133
|
+
var fr = {
|
|
2134
|
+
today: "Aujourd'hui",
|
|
2135
|
+
month: "Mois",
|
|
2136
|
+
week: "Semaine",
|
|
2137
|
+
day: "Jour",
|
|
2138
|
+
agenda: "Agenda",
|
|
2139
|
+
resource: "Ressources",
|
|
2140
|
+
createEvent: "Cr\xE9er un \xE9v\xE9nement",
|
|
2141
|
+
editEvent: "Modifier l'\xE9v\xE9nement",
|
|
2142
|
+
delete: "Supprimer",
|
|
2143
|
+
save: "Enregistrer",
|
|
2144
|
+
cancel: "Annuler",
|
|
2145
|
+
title: "Ajouter un titre",
|
|
2146
|
+
start: "D\xE9but",
|
|
2147
|
+
end: "Fin",
|
|
2148
|
+
allDay: "Toute la journ\xE9e",
|
|
2149
|
+
description: "Description",
|
|
2150
|
+
repeat: "R\xE9p\xE9ter",
|
|
2151
|
+
noRepeat: "Ne se r\xE9p\xE8te pas",
|
|
2152
|
+
selectCalendar: "S\xE9lectionner un calendrier",
|
|
2153
|
+
selectType: "S\xE9lectionner un type",
|
|
2154
|
+
daily: "Quotidien",
|
|
2155
|
+
weekly: "Hebdomadaire",
|
|
2156
|
+
monthly: "Mensuel",
|
|
2157
|
+
yearly: "Annuel",
|
|
2158
|
+
search: "Rechercher...",
|
|
2159
|
+
allTypes: "Tous les types",
|
|
2160
|
+
timezone: "Fuseau horaire",
|
|
2161
|
+
localTime: "Heure locale",
|
|
2162
|
+
create: "Cr\xE9er",
|
|
2163
|
+
calendars: "Calendriers",
|
|
2164
|
+
event: "\xC9v\xE9nement",
|
|
2165
|
+
task: "T\xE2che",
|
|
2166
|
+
appointmentSchedule: "Planning de rendez-vous",
|
|
2167
|
+
new: "Nouveau",
|
|
2168
|
+
dateAndTime: "Date et heure",
|
|
2169
|
+
whosJoining: "Qui participe ?",
|
|
2170
|
+
suggestedTimes: "Horaires sugg\xE9r\xE9s",
|
|
2171
|
+
viewSuggestions: "Voir les suggestions",
|
|
2172
|
+
whereWillItBe: "O\xF9 aura lieu ?",
|
|
2173
|
+
location: "Entrer une adresse",
|
|
2174
|
+
descriptionAndAttachments: "Description",
|
|
2175
|
+
dragAndDrop: "Glisser-d\xE9poser des fichiers ou",
|
|
2176
|
+
guests: "Invit\xE9s",
|
|
2177
|
+
addGuests: "Ajouter des invit\xE9s",
|
|
2178
|
+
addAttachment: "T\xE9l\xE9charger des fichiers",
|
|
2179
|
+
moreOptions: "Plus d'options",
|
|
2180
|
+
doesNotRepeat: "Ne se r\xE9p\xE8te pas",
|
|
2181
|
+
locationHelpText: 'Entrez une adresse physique (ex: "123 Rue Principale") pour g\xE9n\xE9rer la carte.',
|
|
2182
|
+
notes: "Notes...",
|
|
2183
|
+
guestCount: "invit\xE9",
|
|
2184
|
+
guestsCount: "invit\xE9s",
|
|
2185
|
+
repeatFor: "R\xE9p\xE9ter pendant",
|
|
2186
|
+
times: "fois",
|
|
2187
|
+
until: "Jusqu'au",
|
|
2188
|
+
endRepeat: "Fin de r\xE9p\xE9tition",
|
|
2189
|
+
never: "Jamais",
|
|
2190
|
+
afterOccurrences: "Apr\xE8s occurrences",
|
|
2191
|
+
onDate: "\xC0 la date",
|
|
2192
|
+
tomorrow: "Demain",
|
|
2193
|
+
edit: "Modifier",
|
|
2194
|
+
duplicate: "Dupliquer",
|
|
2195
|
+
eventSingular: "\xE9v\xE9nement",
|
|
2196
|
+
eventPlural: "\xE9v\xE9nements",
|
|
2197
|
+
allCaughtUp: "Tout est \xE0 jour !",
|
|
2198
|
+
noEventsScheduled: "Aucun \xE9v\xE9nement pr\xE9vu",
|
|
2199
|
+
noUpcoming: "Votre planning est libre",
|
|
2200
|
+
noUpcomingHint: "Aucun \xE9v\xE9nement \xE0 venir. Cr\xE9ez un nouvel \xE9v\xE9nement pour commencer \xE0 planifier."
|
|
2201
|
+
};
|
|
2202
|
+
|
|
2026
2203
|
// src/lib/theme.ts
|
|
2027
2204
|
function colorToHsl(color) {
|
|
2028
2205
|
let r = 0, g = 0, b = 0;
|
|
@@ -2509,33 +2686,12 @@ var Scheduler = ({
|
|
|
2509
2686
|
};
|
|
2510
2687
|
const id = useId();
|
|
2511
2688
|
const swipeRef = useViewSwipe(handlePrev, handleNext, true);
|
|
2689
|
+
const languagePack = language === "fr" ? fr : en;
|
|
2512
2690
|
const t = {
|
|
2513
|
-
|
|
2514
|
-
month: "Month",
|
|
2515
|
-
week: "Week",
|
|
2516
|
-
day: "Day",
|
|
2517
|
-
agenda: "Agenda",
|
|
2518
|
-
resource: "Resource",
|
|
2519
|
-
createEvent: "Create Event",
|
|
2520
|
-
editEvent: "Edit Event",
|
|
2521
|
-
delete: "Delete",
|
|
2522
|
-
save: "Save",
|
|
2523
|
-
cancel: "Cancel",
|
|
2524
|
-
title: "Title",
|
|
2525
|
-
start: "Start",
|
|
2526
|
-
end: "End",
|
|
2527
|
-
allDay: "All Day",
|
|
2528
|
-
description: "Description",
|
|
2529
|
-
repeat: "Repeat",
|
|
2530
|
-
noRepeat: "Does not repeat",
|
|
2531
|
-
selectCalendar: "Select Calendar",
|
|
2532
|
-
selectType: "Select Type",
|
|
2533
|
-
daily: "Daily",
|
|
2534
|
-
weekly: "Weekly",
|
|
2535
|
-
monthly: "Monthly",
|
|
2536
|
-
yearly: "Yearly",
|
|
2691
|
+
...languagePack,
|
|
2537
2692
|
...translations
|
|
2538
2693
|
};
|
|
2694
|
+
const overlayTimeFormat = uses24HourClock(locale) ? "H:mm" : "h:mm a";
|
|
2539
2695
|
const handleDragStart = (event) => {
|
|
2540
2696
|
const { active } = event;
|
|
2541
2697
|
const draggedEvent = expandedEvents.find((e) => e.id === active.id);
|
|
@@ -2637,7 +2793,8 @@ var Scheduler = ({
|
|
|
2637
2793
|
readOnly,
|
|
2638
2794
|
calendars,
|
|
2639
2795
|
onCalendarToggle,
|
|
2640
|
-
translations: t
|
|
2796
|
+
translations: t,
|
|
2797
|
+
locale
|
|
2641
2798
|
}
|
|
2642
2799
|
)
|
|
2643
2800
|
), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 flex flex-col overflow-hidden relative" }, isLoading ? /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 overflow-auto p-0 md:p-4" }, /* @__PURE__ */ React15__default.createElement("div", { className: "h-full min-w-full" }, view === "month" && /* @__PURE__ */ React15__default.createElement(MonthViewSkeleton, null), view === "week" && /* @__PURE__ */ React15__default.createElement(WeekViewSkeleton, null), view === "day" && /* @__PURE__ */ React15__default.createElement(DayViewSkeleton, null), view === "agenda" && /* @__PURE__ */ React15__default.createElement(AgendaViewSkeleton, null), view === "resource" && /* @__PURE__ */ React15__default.createElement(WeekViewSkeleton, null))) : /* @__PURE__ */ React15__default.createElement("div", { ref: swipeRef, className: "flex-1 overflow-auto p-0 md:p-4 touch-pan-y" }, /* @__PURE__ */ React15__default.createElement("div", { className: "h-full min-w-full" }, /* @__PURE__ */ React15__default.createElement(AnimatePresence, { mode: "wait", initial: false }, /* @__PURE__ */ React15__default.createElement(
|
|
@@ -2708,7 +2865,9 @@ var Scheduler = ({
|
|
|
2708
2865
|
currentDate,
|
|
2709
2866
|
events: filteredEvents,
|
|
2710
2867
|
onEventClick: handleEventClickInternal,
|
|
2711
|
-
onCreateEvent: handleCreateEvent
|
|
2868
|
+
onCreateEvent: handleCreateEvent,
|
|
2869
|
+
locale,
|
|
2870
|
+
translations: t
|
|
2712
2871
|
}
|
|
2713
2872
|
),
|
|
2714
2873
|
view === "resource" && resources && /* @__PURE__ */ React15__default.createElement(
|
|
@@ -2781,9 +2940,9 @@ var Scheduler = ({
|
|
|
2781
2940
|
closeContextMenu();
|
|
2782
2941
|
},
|
|
2783
2942
|
translations: {
|
|
2784
|
-
edit: t.editEvent || "Edit",
|
|
2943
|
+
edit: t.edit || t.editEvent || "Edit",
|
|
2785
2944
|
delete: t.delete || "Delete",
|
|
2786
|
-
duplicate: "Duplicate"
|
|
2945
|
+
duplicate: t.duplicate || "Duplicate"
|
|
2787
2946
|
}
|
|
2788
2947
|
}
|
|
2789
2948
|
),
|
|
@@ -2811,7 +2970,7 @@ var Scheduler = ({
|
|
|
2811
2970
|
className: "absolute left-0 top-0 bottom-0 w-1 rounded-l-lg",
|
|
2812
2971
|
style: { backgroundColor: activeDragEvent.color || "var(--primary)" }
|
|
2813
2972
|
}
|
|
2814
|
-
), /* @__PURE__ */ React15__default.createElement("div", { className: "pl-2" }, /* @__PURE__ */ React15__default.createElement("div", { className: "font-semibold truncate text-sm" }, activeDragEvent.title), (view === "week" || view === "day") && getDragHeight() && getDragHeight() > 40 && /* @__PURE__ */ React15__default.createElement("div", { className: "text-xs opacity-80 mt-0.5 flex items-center gap-1" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-3 h-3", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ React15__default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React15__default.createElement("path", { d: "M12 6v6l4 2" })), format(activeDragEvent.start,
|
|
2973
|
+
), /* @__PURE__ */ React15__default.createElement("div", { className: "pl-2" }, /* @__PURE__ */ React15__default.createElement("div", { className: "font-semibold truncate text-sm" }, activeDragEvent.title), (view === "week" || view === "day") && getDragHeight() && getDragHeight() > 40 && /* @__PURE__ */ React15__default.createElement("div", { className: "text-xs opacity-80 mt-0.5 flex items-center gap-1" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-3 h-3", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ React15__default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React15__default.createElement("path", { d: "M12 6v6l4 2" })), format(activeDragEvent.start, overlayTimeFormat, { locale }), " - ", format(activeDragEvent.end, overlayTimeFormat, { locale }))), /* @__PURE__ */ React15__default.createElement("div", { className: "absolute bottom-1.5 right-1.5 opacity-60" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React15__default.createElement("circle", { cx: "9", cy: "5", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "15", cy: "5", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "9", cy: "12", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "15", cy: "12", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "9", cy: "19", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "15", cy: "19", r: "1.5" }))))
|
|
2815
2974
|
) : null)
|
|
2816
2975
|
)
|
|
2817
2976
|
);
|