@mlw-packages/react-components 1.9.16 → 1.10.1
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.css +657 -112
- package/dist/index.d.mts +36 -7
- package/dist/index.d.ts +36 -7
- package/dist/index.js +1225 -549
- package/dist/index.mjs +1224 -553
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
|
-
import { XIcon, CircleNotchIcon, MagnifyingGlassIcon, CaretUpIcon, CaretDownIcon, CheckIcon, CaretRightIcon, CircleIcon, CloudArrowUpIcon, MinusIcon, CaretUpDownIcon, PencilSimpleIcon, ArrowsLeftRightIcon, FloppyDiskIcon, PlusIcon, TrashIcon, SidebarSimpleIcon, FilePdfIcon, FileDocIcon, FileXlsIcon, FilePptIcon, FileCsvIcon, FileTextIcon, FileImageIcon, FileVideoIcon, FileAudioIcon, FileZipIcon, FileIcon, DotsSixVerticalIcon, InfoIcon, WarningIcon, XCircleIcon, CheckCircleIcon, SunIcon, MoonIcon, CaretLeftIcon, DownloadSimpleIcon, UploadSimpleIcon, CopyIcon, ArrowClockwiseIcon, ArrowLeftIcon, GearIcon, BellIcon, DotsThreeIcon, FunnelIcon, HeartIcon, StarIcon, EyeIcon, EyeSlashIcon, LockIcon, LockOpenIcon, FolderIcon, ArrowRightIcon as ArrowRightIcon$1, ArrowsOutIcon, DownloadIcon, CalendarBlankIcon, CalendarIcon, CaretLeft, CaretRight, ArrowDownIcon, ClockUserIcon, EyeSlash, Eye, ArrowRight, ArrowUpRightIcon, ArrowDownRightIcon, FunnelSimpleIcon, PencilIcon, FileArchiveIcon, TerminalIcon, CodeIcon, CalendarDotIcon as CalendarDotIcon$1, DesktopIcon } from '@phosphor-icons/react';
|
|
8
|
+
import { XIcon, CircleNotchIcon, MagnifyingGlassIcon, CaretUpIcon, CaretDownIcon, CheckIcon, CaretRightIcon, CircleIcon, CloudArrowUpIcon, MinusIcon, CaretUpDownIcon, PencilSimpleIcon, ArrowsLeftRightIcon, FloppyDiskIcon, PlusIcon, TrashIcon, SidebarSimpleIcon, FilePdfIcon, FileDocIcon, FileXlsIcon, FilePptIcon, FileCsvIcon, FileTextIcon, FileImageIcon, FileVideoIcon, FileAudioIcon, FileZipIcon, FileIcon, DotsSixVerticalIcon, InfoIcon, WarningIcon, XCircleIcon, CheckCircleIcon, SunIcon, MoonIcon, CaretLeftIcon, DownloadSimpleIcon, UploadSimpleIcon, CopyIcon, ArrowClockwiseIcon, ArrowLeftIcon, GearIcon, BellIcon, DotsThreeIcon, FunnelIcon, HeartIcon, StarIcon, EyeIcon, EyeSlashIcon, LockIcon, LockOpenIcon, FolderIcon, ArrowRightIcon as ArrowRightIcon$1, ArrowsOutIcon, DownloadIcon, CalendarBlankIcon, CalendarIcon, MapPinIcon, CalendarDotsIcon, ClockIcon, AlignLeftIcon, CaretLeft, CaretRight, ArrowDownIcon, ClockUserIcon, EyeSlash, Eye, ArrowRight, ArrowUpRightIcon, ArrowDownRightIcon, FunnelSimpleIcon, PencilIcon, FileArchiveIcon, TerminalIcon, CodeIcon, CalendarDotIcon as CalendarDotIcon$1, DesktopIcon } from '@phosphor-icons/react';
|
|
9
9
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -17,7 +17,7 @@ import 'react-router-dom';
|
|
|
17
17
|
import { Command } from 'cmdk';
|
|
18
18
|
import { AnimatePresence, motion, useMotionValue, useSpring, useTransform } from 'framer-motion';
|
|
19
19
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
20
|
-
import { XIcon as XIcon$1, CalendarDotIcon, DotsThreeIcon as DotsThreeIcon$1, Check, CheckIcon as CheckIcon$1 } from '@phosphor-icons/react/dist/ssr';
|
|
20
|
+
import { XIcon as XIcon$1, CalendarDotIcon, CaretLeftIcon as CaretLeftIcon$1, CaretRightIcon as CaretRightIcon$1, MapPinIcon as MapPinIcon$1, DotsThreeIcon as DotsThreeIcon$1, Check, CheckIcon as CheckIcon$1 } from '@phosphor-icons/react/dist/ssr';
|
|
21
21
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
22
22
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
23
23
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
@@ -35,7 +35,7 @@ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
|
35
35
|
import { Drawer } from 'vaul';
|
|
36
36
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
37
37
|
import { Prism } from 'react-syntax-highlighter';
|
|
38
|
-
import { format, startOfMonth, endOfMonth, eachDayOfInterval, isToday, isSameDay, differenceInMinutes, isPast, startOfDay, eachHourOfInterval, addHours, getHours, getMinutes, areIntervalsOverlapping, startOfWeek, endOfWeek, isSameMonth, addDays,
|
|
38
|
+
import { format, startOfMonth, endOfMonth, eachDayOfInterval, isToday, isSameDay, differenceInCalendarDays, differenceInMinutes, isPast, startOfDay, eachHourOfInterval, addHours, getHours, getMinutes, areIntervalsOverlapping, startOfWeek, endOfWeek, isSameMonth, addDays, differenceInDays, isBefore, addMinutes, subMonths, subWeeks, addMonths, addWeeks, isWithinInterval, add, max, min } from 'date-fns';
|
|
39
39
|
import { ptBR } from 'date-fns/locale';
|
|
40
40
|
import ptBR3 from 'date-fns/locale/pt-BR';
|
|
41
41
|
import { useSensors, useSensor, MouseSensor, TouchSensor, PointerSensor, DndContext, DragOverlay, useDroppable, useDraggable } from '@dnd-kit/core';
|
|
@@ -653,7 +653,7 @@ var DialogContentBase = React32.forwardRef(
|
|
|
653
653
|
onWheel: userOnWheel,
|
|
654
654
|
children: [
|
|
655
655
|
children,
|
|
656
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-3 top-3 sm:right-4 sm:top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-
|
|
656
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-3 top-3 sm:right-4 sm:top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-n\n 0 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground z-10 touch-manipulation", children: [
|
|
657
657
|
/* @__PURE__ */ jsx(XIcon, { className: "h-6 w-6 sm:h-4 sm:w-4 hover:text-red-500 font-extrabold" }),
|
|
658
658
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
659
659
|
] })
|
|
@@ -7448,15 +7448,15 @@ function isValid12Hour(value) {
|
|
|
7448
7448
|
function isValidMinuteOrSecond(value) {
|
|
7449
7449
|
return /^[0-5][0-9]$/.test(value);
|
|
7450
7450
|
}
|
|
7451
|
-
function getValidNumber(value, { max, min = 0, loop = false }) {
|
|
7451
|
+
function getValidNumber(value, { max: max2, min: min2 = 0, loop = false }) {
|
|
7452
7452
|
let numericValue = parseInt(value, 10);
|
|
7453
7453
|
if (!isNaN(numericValue)) {
|
|
7454
7454
|
if (!loop) {
|
|
7455
|
-
if (numericValue >
|
|
7456
|
-
if (numericValue <
|
|
7455
|
+
if (numericValue > max2) numericValue = max2;
|
|
7456
|
+
if (numericValue < min2) numericValue = min2;
|
|
7457
7457
|
} else {
|
|
7458
|
-
if (numericValue >
|
|
7459
|
-
if (numericValue <
|
|
7458
|
+
if (numericValue > max2) numericValue = min2;
|
|
7459
|
+
if (numericValue < min2) numericValue = max2;
|
|
7460
7460
|
}
|
|
7461
7461
|
return numericValue.toString().padStart(2, "0");
|
|
7462
7462
|
}
|
|
@@ -7474,11 +7474,11 @@ function getValidMinuteOrSecond(value) {
|
|
|
7474
7474
|
if (isValidMinuteOrSecond(value)) return value;
|
|
7475
7475
|
return getValidNumber(value, { max: 59 });
|
|
7476
7476
|
}
|
|
7477
|
-
function getValidArrowNumber(value, { min, max, step }) {
|
|
7477
|
+
function getValidArrowNumber(value, { min: min2, max: max2, step }) {
|
|
7478
7478
|
let numericValue = parseInt(value, 10);
|
|
7479
7479
|
if (!isNaN(numericValue)) {
|
|
7480
7480
|
numericValue += step;
|
|
7481
|
-
return getValidNumber(String(numericValue), { min, max, loop: true });
|
|
7481
|
+
return getValidNumber(String(numericValue), { min: min2, max: max2, loop: true });
|
|
7482
7482
|
}
|
|
7483
7483
|
return "00";
|
|
7484
7484
|
}
|
|
@@ -7589,19 +7589,19 @@ function visualForItem(item, value) {
|
|
|
7589
7589
|
var ITEM_HEIGHT = 38.5;
|
|
7590
7590
|
var VISIBLE_ITEMS = 5;
|
|
7591
7591
|
var CENTER_INDEX = Math.floor(VISIBLE_ITEMS / 2);
|
|
7592
|
-
function getItems(
|
|
7593
|
-
return Array.from({ length: Math.ceil(
|
|
7592
|
+
function getItems(max2, step = 1) {
|
|
7593
|
+
return Array.from({ length: Math.ceil(max2 / step) }, (_, i) => i * step);
|
|
7594
7594
|
}
|
|
7595
7595
|
|
|
7596
7596
|
// src/components/ui/picker/hooks/useScrollColumn.tsx
|
|
7597
7597
|
function useScrollColumn({
|
|
7598
7598
|
value,
|
|
7599
7599
|
onChange,
|
|
7600
|
-
max,
|
|
7600
|
+
max: max2,
|
|
7601
7601
|
step = 1
|
|
7602
7602
|
}) {
|
|
7603
7603
|
const containerRef = useRef(null);
|
|
7604
|
-
const items = getItems(
|
|
7604
|
+
const items = getItems(max2, step);
|
|
7605
7605
|
const scrollTimeoutRef = useRef(null);
|
|
7606
7606
|
const isScrollingRef = useRef(false);
|
|
7607
7607
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -7669,7 +7669,7 @@ function useScrollColumn({
|
|
|
7669
7669
|
function ScrollColumn({
|
|
7670
7670
|
value,
|
|
7671
7671
|
onChange,
|
|
7672
|
-
max,
|
|
7672
|
+
max: max2,
|
|
7673
7673
|
label,
|
|
7674
7674
|
step = 1
|
|
7675
7675
|
}) {
|
|
@@ -7684,7 +7684,7 @@ function ScrollColumn({
|
|
|
7684
7684
|
handleMouseMove,
|
|
7685
7685
|
handleMouseUp,
|
|
7686
7686
|
isDragging
|
|
7687
|
-
} = useScrollColumn({ value, onChange, max, step });
|
|
7687
|
+
} = useScrollColumn({ value, onChange, max: max2, step });
|
|
7688
7688
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
7689
7689
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground rounded-md font-semibold text-sm text-center pb-2 uppercase tracking-wider", children: label }),
|
|
7690
7690
|
/* @__PURE__ */ jsxs("div", { className: cn("relative w-20"), children: [
|
|
@@ -8696,7 +8696,7 @@ function Agenda({
|
|
|
8696
8696
|
"span",
|
|
8697
8697
|
{
|
|
8698
8698
|
className: twMerge(
|
|
8699
|
-
"-top-3 absolute left-0 flex h-6 items-center bg-background pe-
|
|
8699
|
+
"-top-3 absolute left-0 flex h-6 items-center bg-background pe-2 data-today:font-extrabold sm:pe-4 text-xs sm:text-sm md:text-base font-bold min-w-0",
|
|
8700
8700
|
isToday(day) ? "text-blue-500" : ""
|
|
8701
8701
|
),
|
|
8702
8702
|
"data-today": isToday(day) || void 0,
|
|
@@ -8979,23 +8979,75 @@ var StartHourAgenda = 0;
|
|
|
8979
8979
|
var EndHourAgenda = 24;
|
|
8980
8980
|
var DefaultStartHourAgenda = 9;
|
|
8981
8981
|
var DefaultEndHourAgenda = 10;
|
|
8982
|
-
function
|
|
8983
|
-
const
|
|
8982
|
+
function getAutoColorAgenda(id) {
|
|
8983
|
+
const colors2 = [
|
|
8984
|
+
"sky",
|
|
8985
|
+
"amber",
|
|
8986
|
+
"violet",
|
|
8987
|
+
"rose",
|
|
8988
|
+
"emerald",
|
|
8989
|
+
"orange",
|
|
8990
|
+
"green",
|
|
8991
|
+
"blue",
|
|
8992
|
+
"red",
|
|
8993
|
+
"purple",
|
|
8994
|
+
"indigo",
|
|
8995
|
+
"teal",
|
|
8996
|
+
"pink",
|
|
8997
|
+
"cyan",
|
|
8998
|
+
"lime",
|
|
8999
|
+
"fuchsia"
|
|
9000
|
+
];
|
|
9001
|
+
let hash = 0;
|
|
9002
|
+
for (let i = 0; i < id.length; i++) {
|
|
9003
|
+
hash = id.charCodeAt(i) + ((hash << 5) - hash);
|
|
9004
|
+
}
|
|
9005
|
+
const index = Math.abs(hash) % colors2.length;
|
|
9006
|
+
return colors2[index];
|
|
9007
|
+
}
|
|
9008
|
+
function getEventColorClassesAgenda(color, eventId) {
|
|
9009
|
+
let eventColor = color;
|
|
9010
|
+
if (!eventColor && eventId) {
|
|
9011
|
+
eventColor = getAutoColorAgenda(eventId);
|
|
9012
|
+
}
|
|
9013
|
+
if (!eventColor) {
|
|
9014
|
+
eventColor = "sky";
|
|
9015
|
+
}
|
|
8984
9016
|
switch (eventColor) {
|
|
8985
9017
|
case "sky":
|
|
8986
|
-
return "bg-sky-100 hover:bg-sky-200 text-sky-900 border dark:bg-sky-500/
|
|
9018
|
+
return "bg-sky-100 hover:bg-sky-200/80 text-sky-900 border border-sky-200/70 dark:bg-sky-500/25 dark:hover:bg-sky-500/35 dark:text-sky-50 dark:border-sky-400/30 transition-colors duration-150";
|
|
8987
9019
|
case "amber":
|
|
8988
|
-
return "bg-amber-100 hover:bg-amber-200 text-amber-900 border dark:bg-amber-500/
|
|
9020
|
+
return "bg-amber-100 hover:bg-amber-200/80 text-amber-900 border border-amber-200/70 dark:bg-amber-500/25 dark:hover:bg-amber-500/35 dark:text-amber-50 dark:border-amber-400/30 transition-colors duration-150";
|
|
8989
9021
|
case "violet":
|
|
8990
|
-
return "bg-violet-100 hover:bg-violet-200 text-violet-900 border dark:bg-violet-500/
|
|
9022
|
+
return "bg-violet-100 hover:bg-violet-200/80 text-violet-900 border border-violet-200/70 dark:bg-violet-500/25 dark:hover:bg-violet-500/35 dark:text-violet-50 dark:border-violet-400/30 transition-colors duration-150";
|
|
8991
9023
|
case "rose":
|
|
8992
|
-
return "bg-rose-100 hover:bg-rose-200 text-rose-900 border dark:bg-rose-500/
|
|
9024
|
+
return "bg-rose-100 hover:bg-rose-200/80 text-rose-900 border border-rose-200/70 dark:bg-rose-500/25 dark:hover:bg-rose-500/35 dark:text-rose-50 dark:border-rose-400/30 transition-colors duration-150";
|
|
8993
9025
|
case "emerald":
|
|
8994
|
-
return "bg-emerald-100 hover:bg-emerald-200 text-emerald-900 border dark:bg-emerald-500/
|
|
9026
|
+
return "bg-emerald-100 hover:bg-emerald-200/80 text-emerald-900 border border-emerald-200/70 dark:bg-emerald-500/25 dark:hover:bg-emerald-500/35 dark:text-emerald-50 dark:border-emerald-400/30 transition-colors duration-150";
|
|
8995
9027
|
case "orange":
|
|
8996
|
-
return "bg-orange-100 hover:bg-orange-200 text-orange-900 border dark:bg-orange-500/
|
|
9028
|
+
return "bg-orange-100 hover:bg-orange-200/80 text-orange-900 border border-orange-200/70 dark:bg-orange-500/25 dark:hover:bg-orange-500/35 dark:text-orange-50 dark:border-orange-400/30 transition-colors duration-150";
|
|
9029
|
+
case "green":
|
|
9030
|
+
return "bg-green-100 hover:bg-green-200/80 text-green-900 border border-green-200/70 dark:bg-green-500/25 dark:hover:bg-green-500/35 dark:text-green-50 dark:border-green-400/30 transition-colors duration-150";
|
|
9031
|
+
case "blue":
|
|
9032
|
+
return "bg-blue-100 hover:bg-blue-200/80 text-blue-900 border border-blue-200/70 dark:bg-blue-500/25 dark:hover:bg-blue-500/35 dark:text-blue-50 dark:border-blue-400/30 transition-colors duration-150";
|
|
9033
|
+
case "red":
|
|
9034
|
+
return "bg-red-100 hover:bg-red-200/80 text-red-900 border border-red-200/70 dark:bg-red-500/25 dark:hover:bg-red-500/35 dark:text-red-50 dark:border-red-400/30 transition-colors duration-150";
|
|
9035
|
+
case "purple":
|
|
9036
|
+
return "bg-purple-100 hover:bg-purple-200/80 text-purple-900 border border-purple-200/70 dark:bg-purple-500/25 dark:hover:bg-purple-500/35 dark:text-purple-50 dark:border-purple-400/30 transition-colors duration-150";
|
|
9037
|
+
case "indigo":
|
|
9038
|
+
return "bg-indigo-100 hover:bg-indigo-200/80 text-indigo-900 border border-indigo-200/70 dark:bg-indigo-500/25 dark:hover:bg-indigo-500/35 dark:text-indigo-50 dark:border-indigo-400/30 transition-colors duration-150";
|
|
9039
|
+
case "teal":
|
|
9040
|
+
return "bg-teal-100 hover:bg-teal-200/80 text-teal-900 border border-teal-200/70 dark:bg-teal-500/25 dark:hover:bg-teal-500/35 dark:text-teal-50 dark:border-teal-400/30 transition-colors duration-150";
|
|
9041
|
+
case "pink":
|
|
9042
|
+
return "bg-pink-100 hover:bg-pink-200/80 text-pink-900 border border-pink-200/70 dark:bg-pink-500/25 dark:hover:bg-pink-500/35 dark:text-pink-50 dark:border-pink-400/30 transition-colors duration-150";
|
|
9043
|
+
case "cyan":
|
|
9044
|
+
return "bg-cyan-100 hover:bg-cyan-200/80 text-cyan-900 border border-cyan-200/70 dark:bg-cyan-500/25 dark:hover:bg-cyan-500/35 dark:text-cyan-50 dark:border-cyan-400/30 transition-colors duration-150";
|
|
9045
|
+
case "lime":
|
|
9046
|
+
return "bg-lime-100 hover:bg-lime-200/80 text-lime-900 border border-lime-200/70 dark:bg-lime-500/25 dark:hover:bg-lime-500/35 dark:text-lime-50 dark:border-lime-400/30 transition-colors duration-150";
|
|
9047
|
+
case "fuchsia":
|
|
9048
|
+
return "bg-fuchsia-100 hover:bg-fuchsia-200/80 text-fuchsia-900 border border-fuchsia-200/70 dark:bg-fuchsia-500/25 dark:hover:bg-fuchsia-500/35 dark:text-fuchsia-50 dark:border-fuchsia-400/30 transition-colors duration-150";
|
|
8997
9049
|
default:
|
|
8998
|
-
return "bg-sky-100 hover:bg-sky-200 text-sky-900 border dark:bg-sky-500/
|
|
9050
|
+
return "bg-sky-100 hover:bg-sky-200/80 text-sky-900 border border-sky-200/70 dark:bg-sky-500/25 dark:hover:bg-sky-500/35 dark:text-sky-50 dark:border-sky-400/30 transition-colors duration-150";
|
|
8999
9051
|
}
|
|
9000
9052
|
}
|
|
9001
9053
|
function getBorderRadiusClassesAgenda(isFirstDay, isLastDay) {
|
|
@@ -9066,6 +9118,9 @@ function getEventEndDate(event) {
|
|
|
9066
9118
|
if (start && typeof event.duration === "number" && !isNaN(event.duration)) {
|
|
9067
9119
|
return addMinutesToDateAgenda(start, event.duration);
|
|
9068
9120
|
}
|
|
9121
|
+
if (start && !event.allDay) {
|
|
9122
|
+
return addMinutesToDateAgenda(start, 60);
|
|
9123
|
+
}
|
|
9069
9124
|
return void 0;
|
|
9070
9125
|
}
|
|
9071
9126
|
function isValidDate(d) {
|
|
@@ -9102,6 +9157,28 @@ function addMinutesToDateAgenda(date, minutes) {
|
|
|
9102
9157
|
function addHoursToDateAgenda(date, hours) {
|
|
9103
9158
|
return addMinutesToDateAgenda(date, Math.round(hours * 60));
|
|
9104
9159
|
}
|
|
9160
|
+
function formatDurationAgenda(event) {
|
|
9161
|
+
const start = getEventStartDate(event);
|
|
9162
|
+
const end = getEventEndDate(event);
|
|
9163
|
+
if (!start) return "";
|
|
9164
|
+
const fmt = (d) => format(d, "d 'de' MMM", { locale: ptBR });
|
|
9165
|
+
if (!end || isSameDay(start, end)) {
|
|
9166
|
+
return fmt(start) + (event.allDay ? " \xB7 Dia todo" : " \xB7 " + format(start, "HH:mm"));
|
|
9167
|
+
}
|
|
9168
|
+
const days = differenceInCalendarDays(end, start) + 1;
|
|
9169
|
+
return `${fmt(start)} \u2192 ${fmt(end)} \xB7 ${days} dias`;
|
|
9170
|
+
}
|
|
9171
|
+
function formatDurationAgendaDays(event) {
|
|
9172
|
+
const start = getEventStartDate(event);
|
|
9173
|
+
const end = getEventEndDate(event);
|
|
9174
|
+
if (!start) return "";
|
|
9175
|
+
const fmt = (d) => format(d, "d 'de' MMM", { locale: ptBR });
|
|
9176
|
+
if (!end || isSameDay(start, end)) {
|
|
9177
|
+
return fmt(start) + (event.allDay ? " \xB7 Dia todo" : " \xB7 " + format(start, "HH:mm"));
|
|
9178
|
+
}
|
|
9179
|
+
const days = differenceInCalendarDays(end, start) + 1;
|
|
9180
|
+
return `${days} dias`;
|
|
9181
|
+
}
|
|
9105
9182
|
function useCurrentTimeIndicatorAgenda(currentDate, view) {
|
|
9106
9183
|
const [currentTimePosition, setCurrentTimePosition] = useState(0);
|
|
9107
9184
|
const [currentTimeVisible, setCurrentTimeVisible] = useState(false);
|
|
@@ -9170,12 +9247,12 @@ function EventWrapper({
|
|
|
9170
9247
|
return void 0;
|
|
9171
9248
|
})();
|
|
9172
9249
|
const isEventInPast = displayEnd ? isPast(displayEnd) : false;
|
|
9173
|
-
const colorClasses = hasValidTimeForWrapper ? getEventColorClassesAgenda(event.color) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none ";
|
|
9250
|
+
const colorClasses = hasValidTimeForWrapper ? getEventColorClassesAgenda(event.color, event.id) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none ";
|
|
9174
9251
|
return /* @__PURE__ */ jsx(
|
|
9175
9252
|
"button",
|
|
9176
9253
|
{
|
|
9177
9254
|
className: cn(
|
|
9178
|
-
"flex w-full select-none
|
|
9255
|
+
"flex w-full select-none text-left font-medium outline-none transition-colors duration-150 ease-out backdrop-blur-sm focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-dragging:cursor-grabbing data-past-event:line-through data-dragging:shadow-lg rounded-lg border",
|
|
9179
9256
|
className?.includes("overflow-visible") ? "" : "overflow-hidden",
|
|
9180
9257
|
colorClasses,
|
|
9181
9258
|
getBorderRadiusClassesAgenda(isFirstDay, isLastDay),
|
|
@@ -9208,13 +9285,14 @@ function EventItemAgenda({
|
|
|
9208
9285
|
dndAttributes,
|
|
9209
9286
|
onMouseDown,
|
|
9210
9287
|
onTouchStart,
|
|
9211
|
-
agendaOnly = false
|
|
9288
|
+
agendaOnly = false,
|
|
9289
|
+
totalCols = 1
|
|
9212
9290
|
}) {
|
|
9213
9291
|
const eventColor = event.color;
|
|
9214
9292
|
const startDate = getEventStartDate(event);
|
|
9215
9293
|
const endDate = getEventEndDate(event);
|
|
9216
9294
|
const hasValidTime = !!startDate || !!endDate;
|
|
9217
|
-
const colorClasses = hasValidTime ? getEventColorClassesAgenda(eventColor) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none";
|
|
9295
|
+
const colorClasses = hasValidTime ? getEventColorClassesAgenda(eventColor, event.id) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none";
|
|
9218
9296
|
const displayStart = useMemo(() => {
|
|
9219
9297
|
if (!hasValidTime) return void 0;
|
|
9220
9298
|
if (startDate) return currentTime || startDate;
|
|
@@ -9266,7 +9344,7 @@ function EventItemAgenda({
|
|
|
9266
9344
|
EventWrapper,
|
|
9267
9345
|
{
|
|
9268
9346
|
className: cn(
|
|
9269
|
-
"mt-[var(--event-gap)] h-[var(--event-height)] items-center sm:text-xs",
|
|
9347
|
+
"mt-[var(--event-gap)] h-[var(--event-height)] items-center px-1.5 sm:px-3 py-1 sm:text-xs",
|
|
9270
9348
|
className
|
|
9271
9349
|
),
|
|
9272
9350
|
currentTime,
|
|
@@ -9294,13 +9372,58 @@ function EventItemAgenda({
|
|
|
9294
9372
|
);
|
|
9295
9373
|
}
|
|
9296
9374
|
if (view === "week" || view === "day") {
|
|
9375
|
+
const isCompact = durationMinutes < 45;
|
|
9376
|
+
const isDay = view === "day";
|
|
9377
|
+
const tier = isDay ? 1 : totalCols >= 5 ? 3 : totalCols >= 3 ? 2 : 1;
|
|
9378
|
+
if (tier === 3) {
|
|
9379
|
+
return /* @__PURE__ */ jsx(
|
|
9380
|
+
"button",
|
|
9381
|
+
{
|
|
9382
|
+
type: "button",
|
|
9383
|
+
className: cn(
|
|
9384
|
+
"h-full w-full rounded border overflow-hidden cursor-pointer",
|
|
9385
|
+
colorClasses,
|
|
9386
|
+
className
|
|
9387
|
+
),
|
|
9388
|
+
onClick,
|
|
9389
|
+
onMouseDown,
|
|
9390
|
+
onTouchStart,
|
|
9391
|
+
"aria-label": ariaLabel,
|
|
9392
|
+
...dndListeners,
|
|
9393
|
+
...dndAttributes
|
|
9394
|
+
}
|
|
9395
|
+
);
|
|
9396
|
+
}
|
|
9397
|
+
if (tier === 2) {
|
|
9398
|
+
return /* @__PURE__ */ jsx(
|
|
9399
|
+
EventWrapper,
|
|
9400
|
+
{
|
|
9401
|
+
className: cn(
|
|
9402
|
+
"h-full px-1 py-0.5 overflow-hidden text-[9px]",
|
|
9403
|
+
isCompact ? "flex-row items-center" : "flex-col items-start",
|
|
9404
|
+
className
|
|
9405
|
+
),
|
|
9406
|
+
currentTime,
|
|
9407
|
+
dndAttributes,
|
|
9408
|
+
dndListeners,
|
|
9409
|
+
event,
|
|
9410
|
+
ariaLabel,
|
|
9411
|
+
isFirstDay,
|
|
9412
|
+
isLastDay,
|
|
9413
|
+
onClick,
|
|
9414
|
+
onMouseDown,
|
|
9415
|
+
onTouchStart,
|
|
9416
|
+
children: /* @__PURE__ */ jsx("span", { className: "font-semibold leading-none truncate w-full block", children: event.title })
|
|
9417
|
+
}
|
|
9418
|
+
);
|
|
9419
|
+
}
|
|
9297
9420
|
return /* @__PURE__ */ jsx(
|
|
9298
9421
|
EventWrapper,
|
|
9299
9422
|
{
|
|
9300
9423
|
className: cn(
|
|
9301
|
-
"py-1",
|
|
9302
|
-
|
|
9303
|
-
|
|
9424
|
+
"h-full py-0.5 px-1.5 overflow-hidden",
|
|
9425
|
+
isCompact ? "items-center flex-row" : "flex-col items-start",
|
|
9426
|
+
isDay ? "text-xs" : "text-[10px]",
|
|
9304
9427
|
className
|
|
9305
9428
|
),
|
|
9306
9429
|
currentTime,
|
|
@@ -9311,26 +9434,14 @@ function EventItemAgenda({
|
|
|
9311
9434
|
isFirstDay,
|
|
9312
9435
|
isLastDay,
|
|
9313
9436
|
onClick,
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
)
|
|
9322
|
-
showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "ml-2 flex items-center gap-3 bg-white/10 py-0.5 rounded-full opacity-90 text-sm sm:text-base md:text-lg min-w-0", children: formatTimeWithOptionalMinutes(displayStart) })
|
|
9323
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9324
|
-
/* @__PURE__ */ jsx(
|
|
9325
|
-
"div",
|
|
9326
|
-
{
|
|
9327
|
-
className: cn(
|
|
9328
|
-
"truncate font-medium text-sm sm:text-base md:text-lg min-w-0"
|
|
9329
|
-
),
|
|
9330
|
-
children: event.title
|
|
9331
|
-
}
|
|
9332
|
-
),
|
|
9333
|
-
showTime && hasValidTime && /* @__PURE__ */ jsx("div", { className: "truncate font-normal opacity-70 text-sm sm:text-base", children: /* @__PURE__ */ jsx("span", { className: "inline-block bg-white/5 px-0.5 py-0.5 rounded-full", children: getEventTime() }) })
|
|
9437
|
+
onMouseDown,
|
|
9438
|
+
onTouchStart,
|
|
9439
|
+
children: isCompact ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 w-full min-w-0 overflow-hidden", children: [
|
|
9440
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-semibold leading-none min-w-0", children: event.title }),
|
|
9441
|
+
showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-75 leading-none", children: formatTimeWithOptionalMinutes(displayStart) })
|
|
9442
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 w-full min-w-0 overflow-hidden h-full", children: [
|
|
9443
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold leading-snug truncate", children: event.title }),
|
|
9444
|
+
showTime && hasValidTime && /* @__PURE__ */ jsx("span", { className: "opacity-75 leading-none truncate", children: getEventTime() })
|
|
9334
9445
|
] })
|
|
9335
9446
|
}
|
|
9336
9447
|
);
|
|
@@ -9341,7 +9452,7 @@ function EventItemAgenda({
|
|
|
9341
9452
|
{
|
|
9342
9453
|
className: cn(
|
|
9343
9454
|
"flex w-full flex-col gap-2 rounded-lg p-3 text-left outline-none transition-shadow duration-150 ease-out hover:bg-white/3 focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-past-event:line-through data-past-event:opacity-90 border-2 border-border",
|
|
9344
|
-
getEventColorClassesAgenda(eventColor),
|
|
9455
|
+
getEventColorClassesAgenda(eventColor, event.id),
|
|
9345
9456
|
className
|
|
9346
9457
|
),
|
|
9347
9458
|
"aria-label": ariaLabel,
|
|
@@ -9502,7 +9613,6 @@ function DayViewAgenda({
|
|
|
9502
9613
|
});
|
|
9503
9614
|
}, [dayEvents]);
|
|
9504
9615
|
const positionedEvents = useMemo(() => {
|
|
9505
|
-
const result = [];
|
|
9506
9616
|
const dayStart = startOfDay(currentDate);
|
|
9507
9617
|
const sortedEvents = [...timeEvents].sort((a, b) => {
|
|
9508
9618
|
const aStart = getEventStartDate(a) ?? getEventEndDate(a) ?? /* @__PURE__ */ new Date();
|
|
@@ -9516,57 +9626,69 @@ function DayViewAgenda({
|
|
|
9516
9626
|
return bDuration - aDuration;
|
|
9517
9627
|
});
|
|
9518
9628
|
const columns = [];
|
|
9629
|
+
const layouts = [];
|
|
9519
9630
|
for (const event of sortedEvents) {
|
|
9520
9631
|
const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
|
|
9521
|
-
const
|
|
9632
|
+
const rawEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
9633
|
+
const eventEnd = rawEnd <= eventStart ? new Date(eventStart.getTime() + 30 * 60 * 1e3) : rawEnd;
|
|
9522
9634
|
const adjustedStart = isSameDay(currentDate, eventStart) ? eventStart : dayStart;
|
|
9523
9635
|
const adjustedEnd = isSameDay(currentDate, eventEnd) ? eventEnd : addHours(dayStart, 24);
|
|
9524
9636
|
const startHour = getHours(adjustedStart) + getMinutes(adjustedStart) / 60;
|
|
9525
9637
|
const endHour = getHours(adjustedEnd) + getMinutes(adjustedEnd) / 60;
|
|
9526
9638
|
const top = (startHour - StartHourAgenda) * WeekCellsHeightAgenda;
|
|
9527
|
-
const height = (
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
});
|
|
9544
|
-
if (!overlaps) {
|
|
9545
|
-
placed = true;
|
|
9546
|
-
} else {
|
|
9547
|
-
columnIndex++;
|
|
9548
|
-
}
|
|
9549
|
-
}
|
|
9639
|
+
const height = Math.max(
|
|
9640
|
+
(endHour - startHour) * WeekCellsHeightAgenda,
|
|
9641
|
+
24
|
|
9642
|
+
);
|
|
9643
|
+
let col = 0;
|
|
9644
|
+
while (true) {
|
|
9645
|
+
const colSlots = columns[col] ?? [];
|
|
9646
|
+
const hasConflict = colSlots.some(
|
|
9647
|
+
(slot) => areIntervalsOverlapping(
|
|
9648
|
+
{ start: adjustedStart, end: adjustedEnd },
|
|
9649
|
+
{ start: slot.start, end: slot.end },
|
|
9650
|
+
{ inclusive: false }
|
|
9651
|
+
)
|
|
9652
|
+
);
|
|
9653
|
+
if (!hasConflict) break;
|
|
9654
|
+
col++;
|
|
9550
9655
|
}
|
|
9551
|
-
|
|
9552
|
-
columns[
|
|
9553
|
-
|
|
9554
|
-
end: adjustedEnd,
|
|
9555
|
-
event,
|
|
9556
|
-
start: adjustedStart
|
|
9557
|
-
});
|
|
9558
|
-
const width = columnIndex === 0 ? 1 : 0.9;
|
|
9559
|
-
const left = columnIndex === 0 ? 0 : columnIndex * 0.1;
|
|
9560
|
-
result.push({
|
|
9656
|
+
if (!columns[col]) columns[col] = [];
|
|
9657
|
+
columns[col].push({ start: adjustedStart, end: adjustedEnd });
|
|
9658
|
+
layouts.push({
|
|
9561
9659
|
event,
|
|
9562
|
-
|
|
9563
|
-
|
|
9660
|
+
adjustedStart,
|
|
9661
|
+
adjustedEnd,
|
|
9564
9662
|
top,
|
|
9565
|
-
|
|
9566
|
-
|
|
9663
|
+
height,
|
|
9664
|
+
col,
|
|
9665
|
+
totalCols: 0
|
|
9567
9666
|
});
|
|
9568
9667
|
}
|
|
9569
|
-
|
|
9668
|
+
for (const layout of layouts) {
|
|
9669
|
+
let maxCol = layout.col;
|
|
9670
|
+
for (const other of layouts) {
|
|
9671
|
+
if (other === layout) continue;
|
|
9672
|
+
if (areIntervalsOverlapping(
|
|
9673
|
+
{ start: layout.adjustedStart, end: layout.adjustedEnd },
|
|
9674
|
+
{ start: other.adjustedStart, end: other.adjustedEnd },
|
|
9675
|
+
{ inclusive: false }
|
|
9676
|
+
)) {
|
|
9677
|
+
maxCol = Math.max(maxCol, other.col);
|
|
9678
|
+
}
|
|
9679
|
+
}
|
|
9680
|
+
layout.totalCols = maxCol + 1;
|
|
9681
|
+
}
|
|
9682
|
+
return layouts.map(
|
|
9683
|
+
({ event, top, height, col, totalCols }) => ({
|
|
9684
|
+
event,
|
|
9685
|
+
top,
|
|
9686
|
+
height,
|
|
9687
|
+
left: col / totalCols,
|
|
9688
|
+
width: 1 / totalCols,
|
|
9689
|
+
zIndex: 10 + col
|
|
9690
|
+
})
|
|
9691
|
+
);
|
|
9570
9692
|
}, [currentDate, timeEvents]);
|
|
9571
9693
|
const handleEventClick = (event, e) => {
|
|
9572
9694
|
e.stopPropagation();
|
|
@@ -9583,14 +9705,31 @@ function DayViewAgenda({
|
|
|
9583
9705
|
const isFirstDay = eventStart ? isSameDay(currentDate, eventStart) : false;
|
|
9584
9706
|
const isLastDay = eventEnd ? isSameDay(currentDate, eventEnd) : false;
|
|
9585
9707
|
return /* @__PURE__ */ jsx(
|
|
9586
|
-
|
|
9708
|
+
TooltipProviderBase,
|
|
9587
9709
|
{
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9710
|
+
delayDuration: 400,
|
|
9711
|
+
children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
|
|
9712
|
+
/* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsx(
|
|
9713
|
+
EventItemAgenda,
|
|
9714
|
+
{
|
|
9715
|
+
event,
|
|
9716
|
+
isFirstDay,
|
|
9717
|
+
isLastDay,
|
|
9718
|
+
onClick: (e) => handleEventClick(event, e),
|
|
9719
|
+
view: "month",
|
|
9720
|
+
children: /* @__PURE__ */ jsx("div", { children: event.title })
|
|
9721
|
+
}
|
|
9722
|
+
) }) }),
|
|
9723
|
+
/* @__PURE__ */ jsxs(TooltipContentBase, { side: "top", children: [
|
|
9724
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
9725
|
+
/* @__PURE__ */ jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
9726
|
+
event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center gap-1", children: [
|
|
9727
|
+
/* @__PURE__ */ jsx(MapPinIcon, { size: 14 }),
|
|
9728
|
+
" ",
|
|
9729
|
+
event.location
|
|
9730
|
+
] })
|
|
9731
|
+
] })
|
|
9732
|
+
] })
|
|
9594
9733
|
},
|
|
9595
9734
|
`spanning-${event.id}`
|
|
9596
9735
|
);
|
|
@@ -9601,7 +9740,7 @@ function DayViewAgenda({
|
|
|
9601
9740
|
"div",
|
|
9602
9741
|
{
|
|
9603
9742
|
className: "relative h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
|
|
9604
|
-
children: index > 0 && /* @__PURE__ */ jsx("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-
|
|
9743
|
+
children: index > 0 && /* @__PURE__ */ jsx("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-1 sm:pe-4 text-[9px] sm:text-xs text-muted-foreground/70", children: format(hour, "HH:mm") })
|
|
9605
9744
|
},
|
|
9606
9745
|
hour.toString()
|
|
9607
9746
|
)) }),
|
|
@@ -9623,17 +9762,37 @@ function DayViewAgenda({
|
|
|
9623
9762
|
width: `${positionedEvent.width * 100}%`,
|
|
9624
9763
|
zIndex: positionedEvent.zIndex
|
|
9625
9764
|
},
|
|
9626
|
-
children: /* @__PURE__ */ jsx(
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9765
|
+
children: /* @__PURE__ */ jsx(TooltipProviderBase, { delayDuration: 400, children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
|
|
9766
|
+
/* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "size-full", children: /* @__PURE__ */ jsx(
|
|
9767
|
+
EventItemAgenda,
|
|
9768
|
+
{
|
|
9769
|
+
event: evt,
|
|
9770
|
+
view: "day",
|
|
9771
|
+
isFirstDay,
|
|
9772
|
+
isLastDay,
|
|
9773
|
+
onClick: (e) => handleEventClick(evt, e),
|
|
9774
|
+
showTime: true
|
|
9775
|
+
}
|
|
9776
|
+
) }) }),
|
|
9777
|
+
/* @__PURE__ */ jsxs(
|
|
9778
|
+
TooltipContentBase,
|
|
9779
|
+
{
|
|
9780
|
+
side: "top",
|
|
9781
|
+
sideOffset: 6,
|
|
9782
|
+
className: "max-w-[220px] space-y-0.5",
|
|
9783
|
+
children: [
|
|
9784
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-sm leading-snug", children: evt.title }),
|
|
9785
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs opacity-90", children: formatDurationAgenda(evt) }),
|
|
9786
|
+
evt.location && /* @__PURE__ */ jsxs("p", { className: "text-xs flex items-center gap-2", children: [
|
|
9787
|
+
/* @__PURE__ */ jsx(MapPinIcon, { size: 15 }),
|
|
9788
|
+
" ",
|
|
9789
|
+
evt.location
|
|
9790
|
+
] }),
|
|
9791
|
+
evt.description && /* @__PURE__ */ jsx("p", { className: "text-xs opacity-75 line-clamp-2", children: evt.description })
|
|
9792
|
+
]
|
|
9793
|
+
}
|
|
9794
|
+
)
|
|
9795
|
+
] }) })
|
|
9637
9796
|
},
|
|
9638
9797
|
positionedEvent.event.id
|
|
9639
9798
|
);
|
|
@@ -9990,25 +10149,25 @@ function EventAgenda({
|
|
|
9990
10149
|
return condensed ? entry.short : entry.full;
|
|
9991
10150
|
};
|
|
9992
10151
|
const viewTitle = useMemo(() => {
|
|
9993
|
-
const
|
|
10152
|
+
const capitalize2 = (s) => s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
9994
10153
|
if (view === "month")
|
|
9995
|
-
return
|
|
10154
|
+
return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
|
|
9996
10155
|
if (view === "week") {
|
|
9997
10156
|
const start = startOfWeek(currentDate, { weekStartsOn: 1 });
|
|
9998
10157
|
const end = endOfWeek(currentDate, { weekStartsOn: 1 });
|
|
9999
10158
|
if (isSameMonth(start, end))
|
|
10000
|
-
return
|
|
10001
|
-
const s1 =
|
|
10002
|
-
const s2 =
|
|
10159
|
+
return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
|
|
10160
|
+
const s1 = capitalize2(format(start, "MMM", { locale: ptBR }));
|
|
10161
|
+
const s2 = capitalize2(format(end, "MMM yyyy", { locale: ptBR }));
|
|
10003
10162
|
return `${s1} - ${s2}`;
|
|
10004
10163
|
}
|
|
10005
10164
|
if (view === "day")
|
|
10006
10165
|
return format(currentDate, "d 'de' MMMM 'de' yyyy", { locale: ptBR });
|
|
10007
10166
|
if (view === "agenda") {
|
|
10008
10167
|
const start = currentDate;
|
|
10009
|
-
return
|
|
10168
|
+
return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
|
|
10010
10169
|
}
|
|
10011
|
-
return
|
|
10170
|
+
return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
|
|
10012
10171
|
}, [currentDate, view]);
|
|
10013
10172
|
const selectItems = ["month", "week", "day", "agenda"].map((v) => ({
|
|
10014
10173
|
label: viewLabel(v),
|
|
@@ -10195,6 +10354,151 @@ function useEventVisibilityAgenda({
|
|
|
10195
10354
|
getVisibleEventCount
|
|
10196
10355
|
};
|
|
10197
10356
|
}
|
|
10357
|
+
function clampToWeek(date, weekStart, weekEnd) {
|
|
10358
|
+
return max([min([date, weekEnd]), weekStart]);
|
|
10359
|
+
}
|
|
10360
|
+
function dayCol(date, weekStart) {
|
|
10361
|
+
const diff = Math.round(
|
|
10362
|
+
(date.getTime() - weekStart.getTime()) / (1e3 * 60 * 60 * 24)
|
|
10363
|
+
);
|
|
10364
|
+
return Math.max(0, Math.min(6, diff));
|
|
10365
|
+
}
|
|
10366
|
+
function computeMultiDayBars(events, weekDays) {
|
|
10367
|
+
const weekStart = weekDays[0];
|
|
10368
|
+
const weekEnd = weekDays[6];
|
|
10369
|
+
const multiDayEvents = events.filter((ev) => {
|
|
10370
|
+
if (!isMultiDayEventAgenda(ev)) return false;
|
|
10371
|
+
const start = getEventStartDate(ev);
|
|
10372
|
+
const end = getEventEndDate(ev) ?? start;
|
|
10373
|
+
if (!start || !end) return false;
|
|
10374
|
+
return start <= weekEnd && end >= weekStart;
|
|
10375
|
+
});
|
|
10376
|
+
const sorted = [...multiDayEvents].sort((a, b) => {
|
|
10377
|
+
const aS = getEventStartDate(a) ?? /* @__PURE__ */ new Date(0);
|
|
10378
|
+
const bS = getEventStartDate(b) ?? /* @__PURE__ */ new Date(0);
|
|
10379
|
+
const aE = getEventEndDate(a) ?? aS;
|
|
10380
|
+
const bE = getEventEndDate(b) ?? bS;
|
|
10381
|
+
const diff = bE.getTime() - bS.getTime() - (aE.getTime() - aS.getTime());
|
|
10382
|
+
return diff !== 0 ? diff : aS.getTime() - bS.getTime();
|
|
10383
|
+
});
|
|
10384
|
+
const slotOccupancy = [];
|
|
10385
|
+
const bars = [];
|
|
10386
|
+
for (const event of sorted) {
|
|
10387
|
+
const evStart = getEventStartDate(event);
|
|
10388
|
+
const evEnd = getEventEndDate(event) ?? evStart;
|
|
10389
|
+
const cStart = clampToWeek(evStart, weekStart, weekEnd);
|
|
10390
|
+
const cEnd = clampToWeek(evEnd, weekStart, weekEnd);
|
|
10391
|
+
const sc = dayCol(cStart, weekStart);
|
|
10392
|
+
const ec = dayCol(cEnd, weekStart);
|
|
10393
|
+
let slot = 0;
|
|
10394
|
+
for (; ; ) {
|
|
10395
|
+
if (!slotOccupancy[slot]) slotOccupancy[slot] = Array(7).fill(false);
|
|
10396
|
+
let free = true;
|
|
10397
|
+
for (let c = sc; c <= ec; c++) {
|
|
10398
|
+
if (slotOccupancy[slot][c]) {
|
|
10399
|
+
free = false;
|
|
10400
|
+
break;
|
|
10401
|
+
}
|
|
10402
|
+
}
|
|
10403
|
+
if (free) {
|
|
10404
|
+
for (let c = sc; c <= ec; c++) slotOccupancy[slot][c] = true;
|
|
10405
|
+
break;
|
|
10406
|
+
}
|
|
10407
|
+
slot++;
|
|
10408
|
+
}
|
|
10409
|
+
bars.push({
|
|
10410
|
+
event,
|
|
10411
|
+
colStart: sc,
|
|
10412
|
+
colSpan: ec - sc + 1,
|
|
10413
|
+
isFirstDay: isSameDay(cStart, evStart),
|
|
10414
|
+
isLastDay: isSameDay(cEnd, evEnd),
|
|
10415
|
+
slot
|
|
10416
|
+
});
|
|
10417
|
+
}
|
|
10418
|
+
return bars;
|
|
10419
|
+
}
|
|
10420
|
+
function MultiDayOverlay({
|
|
10421
|
+
bars,
|
|
10422
|
+
weekIndex,
|
|
10423
|
+
hoveredEventId,
|
|
10424
|
+
onHover,
|
|
10425
|
+
onEventSelect
|
|
10426
|
+
}) {
|
|
10427
|
+
if (bars.length === 0) return null;
|
|
10428
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 pointer-events-none mt-1", children: bars.map((bar) => {
|
|
10429
|
+
const { event, colStart, colSpan, isFirstDay, isLastDay, slot } = bar;
|
|
10430
|
+
const isHovered = hoveredEventId === event.id;
|
|
10431
|
+
const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
|
|
10432
|
+
const continuesFromPrev = !isFirstDay;
|
|
10433
|
+
const continuesToNext = !isLastDay;
|
|
10434
|
+
return /* @__PURE__ */ jsx(
|
|
10435
|
+
TooltipProviderBase,
|
|
10436
|
+
{
|
|
10437
|
+
delayDuration: 400,
|
|
10438
|
+
children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
|
|
10439
|
+
/* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
10440
|
+
"div",
|
|
10441
|
+
{
|
|
10442
|
+
className: "absolute pointer-events-auto px-[5px]",
|
|
10443
|
+
style: {
|
|
10444
|
+
left: continuesFromPrev ? `${colStart / 7 * 100}%` : `calc(${colStart / 7 * 100}% + 3px)`,
|
|
10445
|
+
right: continuesToNext ? `${100 - (colStart + colSpan) / 7 * 100}%` : `calc(${100 - (colStart + colSpan) / 7 * 100}% + 3px)`,
|
|
10446
|
+
top: `calc(34px + ${slot} * (var(--event-height) + var(--event-gap)) + var(--event-gap))`,
|
|
10447
|
+
zIndex: isHovered ? 10 : 1
|
|
10448
|
+
},
|
|
10449
|
+
onMouseEnter: () => onHover(event.id),
|
|
10450
|
+
onMouseLeave: () => onHover(null),
|
|
10451
|
+
children: /* @__PURE__ */ jsx(
|
|
10452
|
+
EventItemAgenda,
|
|
10453
|
+
{
|
|
10454
|
+
event,
|
|
10455
|
+
isFirstDay,
|
|
10456
|
+
isLastDay,
|
|
10457
|
+
onClick: (e) => {
|
|
10458
|
+
e.stopPropagation();
|
|
10459
|
+
onEventSelect(event, e);
|
|
10460
|
+
},
|
|
10461
|
+
view: "month",
|
|
10462
|
+
className: cn(
|
|
10463
|
+
"w-full",
|
|
10464
|
+
isHovered && "[filter:brightness(0.92)]"
|
|
10465
|
+
),
|
|
10466
|
+
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5 w-full min-w-0", children: [
|
|
10467
|
+
continuesFromPrev && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-50 leading-none mr-0.5 flex items-center", children: /* @__PURE__ */ jsx(CaretLeftIcon, { size: 10, weight: "bold" }) }),
|
|
10468
|
+
!event.allDay && isFirstDay && /* @__PURE__ */ jsx("span", { className: "shrink-0 font-normal opacity-75 text-[10px] bg-white/15 px-1 py-0.5 rounded-full leading-none", children: format(eventStart, "HH:mm") }),
|
|
10469
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-[11px] sm:text-xs truncate min-w-0 leading-none flex-1", children: event.title }),
|
|
10470
|
+
isFirstDay && (() => {
|
|
10471
|
+
const evStart = getEventStartDate(event);
|
|
10472
|
+
const evEnd = getEventEndDate(event);
|
|
10473
|
+
if (!evStart || !evEnd) return null;
|
|
10474
|
+
const totalDays = differenceInCalendarDays(evEnd, evStart) + 1;
|
|
10475
|
+
if (totalDays < 2) return null;
|
|
10476
|
+
return /* @__PURE__ */ jsxs("span", { className: "shrink-0 font-bold leading-none text-[10px] opacity-55 ml-0.5", children: [
|
|
10477
|
+
totalDays,
|
|
10478
|
+
"d"
|
|
10479
|
+
] });
|
|
10480
|
+
})(),
|
|
10481
|
+
continuesToNext && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-50 leading-none ml-0.5 flex items-center", children: /* @__PURE__ */ jsx(CaretRightIcon, { size: 10, weight: "bold" }) })
|
|
10482
|
+
] })
|
|
10483
|
+
}
|
|
10484
|
+
)
|
|
10485
|
+
}
|
|
10486
|
+
) }),
|
|
10487
|
+
/* @__PURE__ */ jsxs(TooltipContentBase, { side: "top", children: [
|
|
10488
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
10489
|
+
/* @__PURE__ */ jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
10490
|
+
event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px]", children: [
|
|
10491
|
+
/* @__PURE__ */ jsx(MapPinIcon, { size: 15 }),
|
|
10492
|
+
" ",
|
|
10493
|
+
event.location
|
|
10494
|
+
] })
|
|
10495
|
+
] })
|
|
10496
|
+
] })
|
|
10497
|
+
},
|
|
10498
|
+
`bar-${event.id}-w${weekIndex}`
|
|
10499
|
+
);
|
|
10500
|
+
}) });
|
|
10501
|
+
}
|
|
10198
10502
|
function MonthViewAgenda({
|
|
10199
10503
|
currentDate,
|
|
10200
10504
|
events,
|
|
@@ -10208,13 +10512,14 @@ function MonthViewAgenda({
|
|
|
10208
10512
|
const calendarEnd = endOfWeek(monthEnd, { weekStartsOn: 0 });
|
|
10209
10513
|
return eachDayOfInterval({ end: calendarEnd, start: calendarStart });
|
|
10210
10514
|
}, [currentDate]);
|
|
10211
|
-
const weekdays = useMemo(
|
|
10212
|
-
|
|
10515
|
+
const weekdays = useMemo(
|
|
10516
|
+
() => Array.from({ length: 7 }).map((_, i) => {
|
|
10213
10517
|
const date = addDays(startOfWeek(/* @__PURE__ */ new Date(), { weekStartsOn: 0 }), i);
|
|
10214
10518
|
const short = format(date, "EEE", { locale: ptBR });
|
|
10215
10519
|
return short.charAt(0).toUpperCase() + short.slice(1);
|
|
10216
|
-
})
|
|
10217
|
-
|
|
10520
|
+
}),
|
|
10521
|
+
[]
|
|
10522
|
+
);
|
|
10218
10523
|
const weeks = useMemo(() => {
|
|
10219
10524
|
const result = [];
|
|
10220
10525
|
let week = [];
|
|
@@ -10227,11 +10532,24 @@ function MonthViewAgenda({
|
|
|
10227
10532
|
}
|
|
10228
10533
|
return result;
|
|
10229
10534
|
}, [days]);
|
|
10230
|
-
const
|
|
10231
|
-
e.stopPropagation();
|
|
10232
|
-
onEventSelect(event, e);
|
|
10233
|
-
};
|
|
10535
|
+
const todayColIndex = useMemo(() => (/* @__PURE__ */ new Date()).getDay(), []);
|
|
10234
10536
|
const [isMounted, setIsMounted] = useState(false);
|
|
10537
|
+
const [hoveredEventId, setHoveredEventId] = useState(null);
|
|
10538
|
+
const hoverLeaveTimerRef = useRef(null);
|
|
10539
|
+
const handleHover = useCallback((id) => {
|
|
10540
|
+
if (id !== null) {
|
|
10541
|
+
if (hoverLeaveTimerRef.current) {
|
|
10542
|
+
clearTimeout(hoverLeaveTimerRef.current);
|
|
10543
|
+
hoverLeaveTimerRef.current = null;
|
|
10544
|
+
}
|
|
10545
|
+
setHoveredEventId(id);
|
|
10546
|
+
} else {
|
|
10547
|
+
hoverLeaveTimerRef.current = setTimeout(() => {
|
|
10548
|
+
setHoveredEventId(null);
|
|
10549
|
+
hoverLeaveTimerRef.current = null;
|
|
10550
|
+
}, 150);
|
|
10551
|
+
}
|
|
10552
|
+
}, []);
|
|
10235
10553
|
const { contentRef, getVisibleEventCount } = useEventVisibilityAgenda({
|
|
10236
10554
|
eventGap: EventGapAgenda,
|
|
10237
10555
|
eventHeight: EventHeightAgenda
|
|
@@ -10239,202 +10557,232 @@ function MonthViewAgenda({
|
|
|
10239
10557
|
useEffect(() => {
|
|
10240
10558
|
setIsMounted(true);
|
|
10241
10559
|
}, []);
|
|
10560
|
+
const eventsWithStart = useMemo(
|
|
10561
|
+
() => events.filter((ev) => {
|
|
10562
|
+
try {
|
|
10563
|
+
if (ev.start == null) return false;
|
|
10564
|
+
const t = ev.start instanceof Date ? ev.start.getTime() : new Date(String(ev.start)).getTime();
|
|
10565
|
+
return !isNaN(t);
|
|
10566
|
+
} catch {
|
|
10567
|
+
return false;
|
|
10568
|
+
}
|
|
10569
|
+
}),
|
|
10570
|
+
[events]
|
|
10571
|
+
);
|
|
10572
|
+
const handleEventClick = (event, e) => {
|
|
10573
|
+
e.stopPropagation();
|
|
10574
|
+
onEventSelect(event, e);
|
|
10575
|
+
};
|
|
10242
10576
|
return /* @__PURE__ */ jsxs("div", { className: "contents", "data-slot": "month-view", children: [
|
|
10243
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 border-border/70 border-b", children: weekdays.map((day) =>
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10577
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 border-border/70 border-b", children: weekdays.map((day, i) => {
|
|
10578
|
+
const isTodayCol = i === todayColIndex;
|
|
10579
|
+
return /* @__PURE__ */ jsxs(
|
|
10580
|
+
"div",
|
|
10581
|
+
{
|
|
10582
|
+
className: cn(
|
|
10583
|
+
"py-1.5 px-1 text-center text-xs uppercase sm:tracking-wide leading-none transition-colors",
|
|
10584
|
+
isTodayCol ? "bg-blue-50 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400 font-bold" : "bg-muted/5 text-muted-foreground/70"
|
|
10585
|
+
),
|
|
10586
|
+
children: [
|
|
10587
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: day }),
|
|
10588
|
+
/* @__PURE__ */ jsx("span", { className: "inline sm:hidden", children: day.charAt(0) })
|
|
10589
|
+
]
|
|
10590
|
+
},
|
|
10591
|
+
day
|
|
10592
|
+
);
|
|
10593
|
+
}) }),
|
|
10594
|
+
/* @__PURE__ */ jsx("div", { className: "grid flex-1 auto-rows-fr", children: weeks.map((week, weekIndex) => {
|
|
10595
|
+
const multiDayBars = computeMultiDayBars(eventsWithStart, week);
|
|
10596
|
+
return /* @__PURE__ */ jsxs(
|
|
10597
|
+
"div",
|
|
10598
|
+
{
|
|
10599
|
+
className: "grid grid-cols-7 [&:last-child>*]:border-b-0 relative p-0",
|
|
10600
|
+
children: [
|
|
10601
|
+
week.map((day, dayIndex) => {
|
|
10602
|
+
if (!day) return null;
|
|
10603
|
+
const isTodayCell = isToday(day);
|
|
10604
|
+
const isTodayCol = dayIndex === todayColIndex;
|
|
10605
|
+
const isCurrentMonth = isSameMonth(day, currentDate);
|
|
10606
|
+
const cellId = `month-cell-${day.toISOString()}`;
|
|
10607
|
+
const dayEvents = getEventsForDayAgenda(eventsWithStart, day);
|
|
10608
|
+
const spanningEvents = getSpanningEventsForDayAgenda(
|
|
10609
|
+
eventsWithStart,
|
|
10610
|
+
day
|
|
10611
|
+
);
|
|
10612
|
+
const allDayEvents = [...spanningEvents, ...dayEvents];
|
|
10613
|
+
const allEvents = getAllEventsForDayAgenda(events, day);
|
|
10614
|
+
const isReferenceCell = weekIndex === 0 && dayIndex === 0;
|
|
10615
|
+
const dayBars = multiDayBars.filter(
|
|
10616
|
+
(b) => dayIndex >= b.colStart && dayIndex < b.colStart + b.colSpan
|
|
10617
|
+
);
|
|
10618
|
+
const dayMaxSlot = dayBars.length > 0 ? Math.max(...dayBars.map((b) => b.slot)) : -1;
|
|
10619
|
+
const dayMultiDayRowCount = dayMaxSlot + 1;
|
|
10620
|
+
const singleEvents = sortEventsAgenda(allDayEvents).filter(
|
|
10621
|
+
(e) => !isMultiDayEventAgenda(e)
|
|
10622
|
+
);
|
|
10623
|
+
const visibleCount = isMounted ? getVisibleEventCount(
|
|
10624
|
+
singleEvents.length + dayMultiDayRowCount
|
|
10625
|
+
) : void 0;
|
|
10626
|
+
const visibleAfterMultiday = visibleCount !== void 0 ? Math.max(0, visibleCount - dayMultiDayRowCount) : void 0;
|
|
10627
|
+
const hasMore = visibleAfterMultiday !== void 0 && singleEvents.length > visibleAfterMultiday;
|
|
10628
|
+
const remainingCount = hasMore ? singleEvents.length - (visibleAfterMultiday ?? 0) : 0;
|
|
10629
|
+
return /* @__PURE__ */ jsx(
|
|
10630
|
+
"div",
|
|
10631
|
+
{
|
|
10632
|
+
"data-outside-cell": !isCurrentMonth || void 0,
|
|
10633
|
+
"data-today": isTodayCell || void 0,
|
|
10634
|
+
className: cn(
|
|
10635
|
+
"group border-border/70 border-r border-b last:border-r-0 transition-colors py-0.5 relative",
|
|
10636
|
+
!isCurrentMonth && "bg-muted/20 text-muted-foreground/60",
|
|
10637
|
+
isTodayCol && isCurrentMonth && !isTodayCell && "bg-blue-50/20 dark:bg-blue-950/10",
|
|
10638
|
+
isTodayCell && "bg-blue-50/50 dark:bg-blue-950/20",
|
|
10639
|
+
"hover:bg-muted/5"
|
|
10640
|
+
),
|
|
10641
|
+
children: /* @__PURE__ */ jsxs(
|
|
10642
|
+
DroppableCellAgenda,
|
|
10643
|
+
{
|
|
10644
|
+
date: day,
|
|
10645
|
+
id: cellId,
|
|
10646
|
+
onClick: () => {
|
|
10647
|
+
const t = new Date(day);
|
|
10648
|
+
t.setHours(DefaultStartHourAgenda, 0, 0);
|
|
10649
|
+
},
|
|
10650
|
+
children: [
|
|
10651
|
+
/* @__PURE__ */ jsx(
|
|
10652
|
+
"div",
|
|
10653
|
+
{
|
|
10654
|
+
className: twMerge(
|
|
10655
|
+
"mt-1 inline-flex w-6 h-6 sm:w-7 sm:h-7 items-center justify-center rounded-lg text-xs sm:text-sm font-semibold border",
|
|
10656
|
+
isTodayCell ? "bg-blue-500 text-white border-blue-500 shadow-sm shadow-blue-400/40" : "text-muted-foreground border-transparent"
|
|
10657
|
+
),
|
|
10658
|
+
children: format(day, "d")
|
|
10659
|
+
}
|
|
10660
|
+
),
|
|
10661
|
+
/* @__PURE__ */ jsxs(
|
|
10662
|
+
"div",
|
|
10663
|
+
{
|
|
10664
|
+
ref: isReferenceCell ? contentRef : null,
|
|
10665
|
+
className: "min-h-[calc((var(--event-height)+var(--event-gap))*2)] sm:min-h-[calc((var(--event-height)+var(--event-gap))*3)] lg:min-h-[calc((var(--event-height)+var(--event-gap))*4)] px-1 py-0.5 sm:py-1",
|
|
10666
|
+
children: [
|
|
10667
|
+
Array.from({ length: dayMultiDayRowCount }).map(
|
|
10668
|
+
(_, si) => /* @__PURE__ */ jsx(
|
|
10669
|
+
"div",
|
|
10670
|
+
{
|
|
10671
|
+
"aria-hidden": "true",
|
|
10672
|
+
className: "mt-[var(--event-gap)] h-[var(--event-height)] w-full",
|
|
10673
|
+
style: { opacity: 0, pointerEvents: "none" }
|
|
10674
|
+
},
|
|
10675
|
+
`spacer-${si}`
|
|
10676
|
+
)
|
|
10677
|
+
),
|
|
10678
|
+
singleEvents.map((event, index) => {
|
|
10679
|
+
if (!isMounted) return null;
|
|
10680
|
+
const isHidden = visibleAfterMultiday !== void 0 && index >= visibleAfterMultiday;
|
|
10681
|
+
const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
|
|
10682
|
+
return /* @__PURE__ */ jsx(
|
|
10683
|
+
"div",
|
|
10684
|
+
{
|
|
10685
|
+
"aria-hidden": isHidden ? "true" : void 0,
|
|
10686
|
+
className: "aria-hidden:hidden",
|
|
10687
|
+
children: /* @__PURE__ */ jsx(TooltipProviderBase, { delayDuration: 400, children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
|
|
10688
|
+
/* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsx(
|
|
10689
|
+
EventItemAgenda,
|
|
10690
|
+
{
|
|
10691
|
+
event,
|
|
10692
|
+
isFirstDay: true,
|
|
10693
|
+
isLastDay: true,
|
|
10694
|
+
onClick: (e) => handleEventClick(event, e),
|
|
10695
|
+
view: "month",
|
|
10696
|
+
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 sm:gap-1.5 truncate text-[11px] relative z-10", children: [
|
|
10697
|
+
!event.allDay && /* @__PURE__ */ jsx("span", { className: "font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: format(eventStart, "HH:mm") }),
|
|
10698
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold truncate", children: event.title })
|
|
10699
|
+
] })
|
|
10700
|
+
}
|
|
10701
|
+
) }) }),
|
|
10702
|
+
/* @__PURE__ */ jsxs(TooltipContentBase, { side: "top", children: [
|
|
10703
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
10704
|
+
/* @__PURE__ */ jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
10705
|
+
event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center gap-1", children: [
|
|
10706
|
+
/* @__PURE__ */ jsx(MapPinIcon, { size: 14 }),
|
|
10707
|
+
" ",
|
|
10708
|
+
event.location
|
|
10709
|
+
] })
|
|
10710
|
+
] })
|
|
10711
|
+
] }) })
|
|
10712
|
+
},
|
|
10713
|
+
event.id
|
|
10714
|
+
);
|
|
10715
|
+
})
|
|
10716
|
+
]
|
|
10717
|
+
}
|
|
10718
|
+
),
|
|
10719
|
+
hasMore && /* @__PURE__ */ jsxs(PopoverBase, { modal: true, children: [
|
|
10720
|
+
/* @__PURE__ */ jsx(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
10721
|
+
"button",
|
|
10722
|
+
{
|
|
10723
|
+
type: "button",
|
|
10724
|
+
onClick: (e) => e.stopPropagation(),
|
|
10725
|
+
"aria-label": `Mostrar mais ${remainingCount} eventos`,
|
|
10726
|
+
className: "mt-[var(--event-gap)] flex h-[var(--event-height)] w-full select-none items-center overflow-hidden px-2 text-left text-[10px] text-muted-foreground outline-none rounded-md transition hover:bg-muted/60 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 sm:text-xs",
|
|
10727
|
+
children: /* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
|
|
10728
|
+
"+ ",
|
|
10729
|
+
remainingCount,
|
|
10730
|
+
" ",
|
|
10731
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: "mais" })
|
|
10732
|
+
] })
|
|
10733
|
+
}
|
|
10734
|
+
) }),
|
|
10735
|
+
/* @__PURE__ */ jsx(
|
|
10736
|
+
PopoverContentBase,
|
|
10737
|
+
{
|
|
10738
|
+
align: "center",
|
|
10739
|
+
className: "max-w-52 p-3",
|
|
10740
|
+
style: {
|
|
10741
|
+
"--event-height": `${EventHeightAgenda}px`
|
|
10742
|
+
},
|
|
10743
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
10744
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-sm", children: format(day, "EEE d", { locale: ptBR }) }),
|
|
10745
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: sortEventsAgenda(allEvents).map((event) => {
|
|
10746
|
+
const s = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
|
|
10747
|
+
const e2 = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
10748
|
+
return /* @__PURE__ */ jsx(
|
|
10328
10749
|
EventItemAgenda,
|
|
10329
10750
|
{
|
|
10330
10751
|
event,
|
|
10331
|
-
isFirstDay,
|
|
10332
|
-
isLastDay,
|
|
10752
|
+
isFirstDay: isSameDay(day, s),
|
|
10753
|
+
isLastDay: isSameDay(day, e2),
|
|
10333
10754
|
onClick: (e) => handleEventClick(event, e),
|
|
10334
|
-
view: "month"
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
)
|
|
10338
|
-
}
|
|
10339
|
-
|
|
10340
|
-
);
|
|
10755
|
+
view: "month"
|
|
10756
|
+
},
|
|
10757
|
+
event.id
|
|
10758
|
+
);
|
|
10759
|
+
}) })
|
|
10760
|
+
] })
|
|
10341
10761
|
}
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
] })
|
|
10367
|
-
}
|
|
10368
|
-
)
|
|
10369
|
-
},
|
|
10370
|
-
event.id
|
|
10371
|
-
);
|
|
10372
|
-
}),
|
|
10373
|
-
hasMore && /* @__PURE__ */ jsxs(PopoverBase, { modal: true, children: [
|
|
10374
|
-
/* @__PURE__ */ jsx(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
10375
|
-
"button",
|
|
10376
|
-
{
|
|
10377
|
-
className: "mt-[var(--event-gap)] flex h-[var(--event-height)] w-full select-none items-center overflow-hidden px-2 text-left text-[10px] text-muted-foreground outline-none backdrop-blur-md rounded-md transition hover:bg-muted/60 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 sm:text-xs",
|
|
10378
|
-
onClick: (e) => e.stopPropagation(),
|
|
10379
|
-
type: "button",
|
|
10380
|
-
"aria-label": `Show ${remainingCount} more events on ${format(
|
|
10381
|
-
day,
|
|
10382
|
-
"PPP",
|
|
10383
|
-
{ locale: ptBR }
|
|
10384
|
-
)}`,
|
|
10385
|
-
children: [
|
|
10386
|
-
/* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
|
|
10387
|
-
"+ ",
|
|
10388
|
-
remainingCount
|
|
10389
|
-
] }),
|
|
10390
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: " more" })
|
|
10391
|
-
]
|
|
10392
|
-
}
|
|
10393
|
-
) }),
|
|
10394
|
-
/* @__PURE__ */ jsx(
|
|
10395
|
-
PopoverContentBase,
|
|
10396
|
-
{
|
|
10397
|
-
align: "center",
|
|
10398
|
-
className: "max-w-52 p-3",
|
|
10399
|
-
style: {
|
|
10400
|
-
"--event-height": `${EventHeightAgenda}px`
|
|
10401
|
-
},
|
|
10402
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
10403
|
-
/* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children: format(day, "EEE d", { locale: ptBR }) }),
|
|
10404
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: sortEventsAgenda(allEvents).map((event) => {
|
|
10405
|
-
const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
|
|
10406
|
-
const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
10407
|
-
const isFirstDay = isSameDay(day, eventStart);
|
|
10408
|
-
const isLastDay = isSameDay(day, eventEnd);
|
|
10409
|
-
return /* @__PURE__ */ jsx(
|
|
10410
|
-
EventItemAgenda,
|
|
10411
|
-
{
|
|
10412
|
-
event,
|
|
10413
|
-
isFirstDay,
|
|
10414
|
-
isLastDay,
|
|
10415
|
-
onClick: (e) => handleEventClick(event, e),
|
|
10416
|
-
view: "month"
|
|
10417
|
-
},
|
|
10418
|
-
event.id
|
|
10419
|
-
);
|
|
10420
|
-
}) })
|
|
10421
|
-
] })
|
|
10422
|
-
}
|
|
10423
|
-
)
|
|
10424
|
-
] })
|
|
10425
|
-
]
|
|
10426
|
-
}
|
|
10427
|
-
)
|
|
10428
|
-
]
|
|
10429
|
-
}
|
|
10430
|
-
)
|
|
10431
|
-
},
|
|
10432
|
-
day.toString()
|
|
10433
|
-
);
|
|
10434
|
-
})
|
|
10435
|
-
},
|
|
10436
|
-
`week-${weekIndex}`
|
|
10437
|
-
)) }),
|
|
10762
|
+
)
|
|
10763
|
+
] })
|
|
10764
|
+
]
|
|
10765
|
+
}
|
|
10766
|
+
)
|
|
10767
|
+
},
|
|
10768
|
+
day.toString()
|
|
10769
|
+
);
|
|
10770
|
+
}),
|
|
10771
|
+
/* @__PURE__ */ jsx(
|
|
10772
|
+
MultiDayOverlay,
|
|
10773
|
+
{
|
|
10774
|
+
bars: multiDayBars,
|
|
10775
|
+
weekIndex,
|
|
10776
|
+
hoveredEventId,
|
|
10777
|
+
onHover: handleHover,
|
|
10778
|
+
onEventSelect
|
|
10779
|
+
}
|
|
10780
|
+
)
|
|
10781
|
+
]
|
|
10782
|
+
},
|
|
10783
|
+
`week-${weekIndex}`
|
|
10784
|
+
);
|
|
10785
|
+
}) }),
|
|
10438
10786
|
/* @__PURE__ */ jsx(
|
|
10439
10787
|
UndatedEvents,
|
|
10440
10788
|
{
|
|
@@ -10467,7 +10815,8 @@ function DraggableEvent({
|
|
|
10467
10815
|
isFirstDay = true,
|
|
10468
10816
|
isLastDay = true,
|
|
10469
10817
|
"aria-hidden": ariaHidden,
|
|
10470
|
-
draggable = true
|
|
10818
|
+
draggable = true,
|
|
10819
|
+
totalCols
|
|
10471
10820
|
}) {
|
|
10472
10821
|
const { activeId } = useCalendarDndAgenda();
|
|
10473
10822
|
const elementRef = useRef(null);
|
|
@@ -10552,7 +10901,8 @@ function DraggableEvent({
|
|
|
10552
10901
|
onMouseDown: handleMouseDown,
|
|
10553
10902
|
onTouchStart: handleTouchStart,
|
|
10554
10903
|
showTime,
|
|
10555
|
-
view
|
|
10904
|
+
view,
|
|
10905
|
+
totalCols
|
|
10556
10906
|
}
|
|
10557
10907
|
)
|
|
10558
10908
|
}
|
|
@@ -10566,14 +10916,10 @@ function WeekViewAgenda({
|
|
|
10566
10916
|
showUndatedEvents
|
|
10567
10917
|
}) {
|
|
10568
10918
|
const days = useMemo(() => {
|
|
10569
|
-
const
|
|
10919
|
+
const weekStart = startOfWeek(currentDate, { weekStartsOn: 0 });
|
|
10570
10920
|
const weekEnd = endOfWeek(currentDate, { weekStartsOn: 0 });
|
|
10571
|
-
return eachDayOfInterval({ end: weekEnd, start:
|
|
10921
|
+
return eachDayOfInterval({ end: weekEnd, start: weekStart });
|
|
10572
10922
|
}, [currentDate]);
|
|
10573
|
-
const weekStart = useMemo(
|
|
10574
|
-
() => startOfWeek(currentDate, { weekStartsOn: 0 }),
|
|
10575
|
-
[currentDate]
|
|
10576
|
-
);
|
|
10577
10923
|
const hours = useMemo(() => {
|
|
10578
10924
|
const dayStart = startOfDay(currentDate);
|
|
10579
10925
|
return eachHourOfInterval({
|
|
@@ -10606,6 +10952,25 @@ function WeekViewAgenda({
|
|
|
10606
10952
|
});
|
|
10607
10953
|
});
|
|
10608
10954
|
}, [events, days]);
|
|
10955
|
+
const trueAllDayEvents = useMemo(
|
|
10956
|
+
() => allDayEvents.filter((e) => e.allDay),
|
|
10957
|
+
[allDayEvents]
|
|
10958
|
+
);
|
|
10959
|
+
const multiDayTimedEvents = useMemo(
|
|
10960
|
+
() => allDayEvents.filter((e) => !e.allDay),
|
|
10961
|
+
[allDayEvents]
|
|
10962
|
+
);
|
|
10963
|
+
const rowH = EventHeightAgenda + EventGapAgenda;
|
|
10964
|
+
const allDayBarData = useMemo(() => {
|
|
10965
|
+
const bars = computeMultiDayBars(trueAllDayEvents, days);
|
|
10966
|
+
const maxSlot = bars.length > 0 ? Math.max(...bars.map((b) => b.slot)) : 0;
|
|
10967
|
+
return { bars, sectionH: (maxSlot + 1) * rowH + EventGapAgenda * 2 };
|
|
10968
|
+
}, [trueAllDayEvents, days, rowH]);
|
|
10969
|
+
const multiDayBarData = useMemo(() => {
|
|
10970
|
+
const bars = computeMultiDayBars(multiDayTimedEvents, days);
|
|
10971
|
+
const maxSlot = bars.length > 0 ? Math.max(...bars.map((b) => b.slot)) : 0;
|
|
10972
|
+
return { bars, sectionH: (maxSlot + 1) * rowH + EventGapAgenda * 2 };
|
|
10973
|
+
}, [multiDayTimedEvents, days, rowH]);
|
|
10609
10974
|
const processedDayEvents = useMemo(() => {
|
|
10610
10975
|
const result = days.map((day) => {
|
|
10611
10976
|
const dayEvents = events.filter((event) => {
|
|
@@ -10626,56 +10991,69 @@ function WeekViewAgenda({
|
|
|
10626
10991
|
const bDuration = differenceInMinutes(bEnd, bStart);
|
|
10627
10992
|
return bDuration - aDuration;
|
|
10628
10993
|
});
|
|
10629
|
-
const positionedEvents = [];
|
|
10630
10994
|
const dayStart = startOfDay(day);
|
|
10631
10995
|
const columns = [];
|
|
10996
|
+
const layouts = [];
|
|
10632
10997
|
for (const event of sortedEvents) {
|
|
10633
10998
|
const eventStart = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
|
|
10634
|
-
const
|
|
10999
|
+
const rawEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
11000
|
+
const eventEnd = rawEnd <= eventStart ? new Date(eventStart.getTime() + 30 * 60 * 1e3) : rawEnd;
|
|
10635
11001
|
const adjustedStart = isSameDay(day, eventStart) ? eventStart : dayStart;
|
|
10636
11002
|
const adjustedEnd = isSameDay(day, eventEnd) ? eventEnd : addHours(dayStart, 24);
|
|
10637
11003
|
const startHour = getHours(adjustedStart) + getMinutes(adjustedStart) / 60;
|
|
10638
11004
|
const endHour = getHours(adjustedEnd) + getMinutes(adjustedEnd) / 60;
|
|
10639
11005
|
const top = (startHour - StartHour) * WeekCellsHeightAgenda;
|
|
10640
|
-
const height = (
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
});
|
|
10657
|
-
if (!overlaps) {
|
|
10658
|
-
placed = true;
|
|
10659
|
-
} else {
|
|
10660
|
-
columnIndex++;
|
|
10661
|
-
}
|
|
10662
|
-
}
|
|
11006
|
+
const height = Math.max(
|
|
11007
|
+
(endHour - startHour) * WeekCellsHeightAgenda,
|
|
11008
|
+
24
|
|
11009
|
+
);
|
|
11010
|
+
let col = 0;
|
|
11011
|
+
while (true) {
|
|
11012
|
+
const colSlots = columns[col] ?? [];
|
|
11013
|
+
const hasConflict = colSlots.some(
|
|
11014
|
+
(slot) => areIntervalsOverlapping(
|
|
11015
|
+
{ start: adjustedStart, end: adjustedEnd },
|
|
11016
|
+
{ start: slot.start, end: slot.end },
|
|
11017
|
+
{ inclusive: false }
|
|
11018
|
+
)
|
|
11019
|
+
);
|
|
11020
|
+
if (!hasConflict) break;
|
|
11021
|
+
col++;
|
|
10663
11022
|
}
|
|
10664
|
-
|
|
10665
|
-
columns[
|
|
10666
|
-
|
|
10667
|
-
const width = columnIndex === 0 ? 1 : 0.9;
|
|
10668
|
-
const left = columnIndex === 0 ? 0 : columnIndex * 0.1;
|
|
10669
|
-
positionedEvents.push({
|
|
11023
|
+
if (!columns[col]) columns[col] = [];
|
|
11024
|
+
columns[col].push({ start: adjustedStart, end: adjustedEnd });
|
|
11025
|
+
layouts.push({
|
|
10670
11026
|
event,
|
|
10671
|
-
|
|
10672
|
-
|
|
11027
|
+
adjustedStart,
|
|
11028
|
+
adjustedEnd,
|
|
10673
11029
|
top,
|
|
10674
|
-
|
|
10675
|
-
|
|
11030
|
+
height,
|
|
11031
|
+
col,
|
|
11032
|
+
totalCols: 0
|
|
10676
11033
|
});
|
|
10677
11034
|
}
|
|
10678
|
-
|
|
11035
|
+
for (const layout of layouts) {
|
|
11036
|
+
let maxCol = layout.col;
|
|
11037
|
+
for (const other of layouts) {
|
|
11038
|
+
if (other === layout) continue;
|
|
11039
|
+
if (areIntervalsOverlapping(
|
|
11040
|
+
{ start: layout.adjustedStart, end: layout.adjustedEnd },
|
|
11041
|
+
{ start: other.adjustedStart, end: other.adjustedEnd },
|
|
11042
|
+
{ inclusive: false }
|
|
11043
|
+
)) {
|
|
11044
|
+
maxCol = Math.max(maxCol, other.col);
|
|
11045
|
+
}
|
|
11046
|
+
}
|
|
11047
|
+
layout.totalCols = maxCol + 1;
|
|
11048
|
+
}
|
|
11049
|
+
return layouts.map(({ event, top, height, col, totalCols }) => ({
|
|
11050
|
+
event,
|
|
11051
|
+
top,
|
|
11052
|
+
height,
|
|
11053
|
+
left: col / totalCols,
|
|
11054
|
+
width: 1 / totalCols,
|
|
11055
|
+
zIndex: 10 + col
|
|
11056
|
+
}));
|
|
10679
11057
|
});
|
|
10680
11058
|
return result;
|
|
10681
11059
|
}, [days, events]);
|
|
@@ -10685,178 +11063,471 @@ function WeekViewAgenda({
|
|
|
10685
11063
|
};
|
|
10686
11064
|
const showAllDaySection = allDayEvents.length > 0;
|
|
10687
11065
|
const { currentTimePosition, currentTimeVisible } = useCurrentTimeIndicatorAgenda(currentDate, "week");
|
|
10688
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", "data-slot": "week-view", children: [
|
|
10689
|
-
/* @__PURE__ */
|
|
10690
|
-
/* @__PURE__ */
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
{
|
|
10694
|
-
className: "py-2 text-center text-muted-foreground/70 text-sm data-today:font-medium data-today:text-foreground",
|
|
10695
|
-
"data-today": isToday(day) || void 0,
|
|
10696
|
-
children: [
|
|
10697
|
-
/* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "sm:hidden", children: [
|
|
10698
|
-
format(day, "EEE", { locale: ptBR })[0],
|
|
10699
|
-
" ",
|
|
10700
|
-
format(day, "d", { locale: ptBR })
|
|
10701
|
-
] }),
|
|
10702
|
-
/* @__PURE__ */ jsx("span", { className: "max-sm:hidden", children: format(day, "EEE dd", { locale: ptBR }) })
|
|
10703
|
-
]
|
|
10704
|
-
},
|
|
10705
|
-
day.toString()
|
|
10706
|
-
))
|
|
10707
|
-
] }),
|
|
10708
|
-
showAllDaySection && /* @__PURE__ */ jsx("div", { className: "border-border/70 border-b bg-muted/50", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-8", children: [
|
|
10709
|
-
/* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full pe-2 text-right text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: "Todo Dia" }) }),
|
|
10710
|
-
days.map((day, dayIndex) => {
|
|
10711
|
-
const dayAllDayEvents = allDayEvents.filter((event) => {
|
|
10712
|
-
const eventStart = getEventStartDate(event);
|
|
10713
|
-
const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
|
|
10714
|
-
if (!eventStart && !eventEnd) return false;
|
|
10715
|
-
return eventStart && isSameDay(day, eventStart) || eventStart && eventEnd && day > eventStart && day < eventEnd || eventEnd && isSameDay(day, eventEnd);
|
|
10716
|
-
});
|
|
10717
|
-
return /* @__PURE__ */ jsx(
|
|
11066
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", "data-slot": "week-view", children: [
|
|
11067
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxs("div", { className: "min-w-[600px] sm:min-w-full flex flex-col h-full", children: [
|
|
11068
|
+
/* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-30 grid grid-cols-8 border-border/70 border-b bg-background", children: [
|
|
11069
|
+
/* @__PURE__ */ jsx("div", { className: "py-2 text-center text-muted-foreground/70 text-[10px] sm:text-sm", children: /* @__PURE__ */ jsx("span", { className: "max-[479px]:sr-only", children: format(/* @__PURE__ */ new Date(), "O") }) }),
|
|
11070
|
+
days.map((day) => /* @__PURE__ */ jsxs(
|
|
10718
11071
|
"div",
|
|
10719
11072
|
{
|
|
10720
|
-
className: "
|
|
11073
|
+
className: "py-2 text-center text-muted-foreground/70 text-[10px] sm:text-sm data-today:font-medium data-today:text-foreground",
|
|
10721
11074
|
"data-today": isToday(day) || void 0,
|
|
10722
|
-
children:
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
{
|
|
10732
|
-
event,
|
|
10733
|
-
isFirstDay,
|
|
10734
|
-
isLastDay,
|
|
10735
|
-
onClick: (e) => handleEventClick(event, e),
|
|
10736
|
-
view: "month",
|
|
10737
|
-
children: /* @__PURE__ */ jsx(
|
|
10738
|
-
"div",
|
|
10739
|
-
{
|
|
10740
|
-
"aria-hidden": !shouldShowTitle,
|
|
10741
|
-
className: cn(
|
|
10742
|
-
"truncate",
|
|
10743
|
-
!shouldShowTitle && "invisible"
|
|
10744
|
-
),
|
|
10745
|
-
children: event.title
|
|
10746
|
-
}
|
|
10747
|
-
)
|
|
10748
|
-
},
|
|
10749
|
-
`spanning-${event.id}`
|
|
10750
|
-
);
|
|
10751
|
-
})
|
|
11075
|
+
children: [
|
|
11076
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "sm:hidden", children: [
|
|
11077
|
+
format(day, "EEE", { locale: ptBR })[0],
|
|
11078
|
+
" ",
|
|
11079
|
+
format(day, "d", { locale: ptBR })
|
|
11080
|
+
] }),
|
|
11081
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline md:hidden", children: format(day, "EEE d", { locale: ptBR }) }),
|
|
11082
|
+
/* @__PURE__ */ jsx("span", { className: "max-md:hidden", children: format(day, "EEE dd", { locale: ptBR }) })
|
|
11083
|
+
]
|
|
10752
11084
|
},
|
|
10753
11085
|
day.toString()
|
|
10754
|
-
)
|
|
10755
|
-
})
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10767
|
-
"div",
|
|
10768
|
-
{
|
|
10769
|
-
className: "relative grid auto-cols-fr border-border/70 border-r last:border-r-0",
|
|
10770
|
-
"data-today": isToday(day) || void 0,
|
|
10771
|
-
children: [
|
|
10772
|
-
(processedDayEvents[dayIndex] ?? []).map((positionedEvent) => /* @__PURE__ */ jsx(
|
|
10773
|
-
"div",
|
|
10774
|
-
{
|
|
10775
|
-
className: "absolute z-10 px-0.5",
|
|
10776
|
-
onClick: (e) => e.stopPropagation(),
|
|
10777
|
-
style: {
|
|
10778
|
-
height: `${positionedEvent.height}px`,
|
|
10779
|
-
left: `${positionedEvent.left * 100}%`,
|
|
10780
|
-
top: `${positionedEvent.top}px`,
|
|
10781
|
-
width: `${positionedEvent.width * 100}%`,
|
|
10782
|
-
zIndex: positionedEvent.zIndex
|
|
10783
|
-
},
|
|
10784
|
-
children: /* @__PURE__ */ jsx("div", { className: "size-full", children: /* @__PURE__ */ jsx(
|
|
10785
|
-
DraggableEvent,
|
|
11086
|
+
))
|
|
11087
|
+
] }),
|
|
11088
|
+
showAllDaySection && /* @__PURE__ */ jsxs("div", { className: "border-border/70 border-b bg-muted/50", children: [
|
|
11089
|
+
trueAllDayEvents.length > 0 && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-8", children: [
|
|
11090
|
+
/* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full pe-2 text-right text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: "Todo dia" }) }),
|
|
11091
|
+
/* @__PURE__ */ jsxs(
|
|
11092
|
+
"div",
|
|
11093
|
+
{
|
|
11094
|
+
className: "col-span-7 relative",
|
|
11095
|
+
style: { height: allDayBarData.sectionH },
|
|
11096
|
+
children: [
|
|
11097
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 grid grid-cols-7 pointer-events-none", children: days.map((day) => /* @__PURE__ */ jsx(
|
|
11098
|
+
"div",
|
|
10786
11099
|
{
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
11100
|
+
className: "border-r last:border-r-0 border-border/70",
|
|
11101
|
+
"data-today": isToday(day) || void 0
|
|
11102
|
+
},
|
|
11103
|
+
day.toString()
|
|
11104
|
+
)) }),
|
|
11105
|
+
allDayBarData.bars.map((bar) => {
|
|
11106
|
+
const {
|
|
11107
|
+
event,
|
|
11108
|
+
colStart,
|
|
11109
|
+
colSpan,
|
|
11110
|
+
isFirstDay,
|
|
11111
|
+
isLastDay,
|
|
11112
|
+
slot
|
|
11113
|
+
} = bar;
|
|
11114
|
+
const showTitle = isFirstDay || !isFirstDay && colStart === 0;
|
|
11115
|
+
return /* @__PURE__ */ jsx(TooltipProviderBase, { delayDuration: 400, children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
|
|
11116
|
+
/* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
11117
|
+
"div",
|
|
11118
|
+
{
|
|
11119
|
+
className: "absolute px-0.5",
|
|
11120
|
+
style: {
|
|
11121
|
+
left: `calc(${colStart / 7 * 100}% + 2px)`,
|
|
11122
|
+
width: `calc(${colSpan / 7 * 100}% - 4px)`,
|
|
11123
|
+
top: EventGapAgenda + slot * rowH,
|
|
11124
|
+
height: EventHeightAgenda
|
|
11125
|
+
},
|
|
11126
|
+
children: /* @__PURE__ */ jsx(
|
|
11127
|
+
EventItemAgenda,
|
|
11128
|
+
{
|
|
11129
|
+
event,
|
|
11130
|
+
isFirstDay,
|
|
11131
|
+
isLastDay,
|
|
11132
|
+
onClick: (e) => {
|
|
11133
|
+
e.stopPropagation();
|
|
11134
|
+
handleEventClick(event, e);
|
|
11135
|
+
},
|
|
11136
|
+
view: "month",
|
|
11137
|
+
className: "h-full",
|
|
11138
|
+
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 min-w-0 w-full", children: [
|
|
11139
|
+
!isFirstDay && colStart === 0 && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretLeftIcon$1, {}) }),
|
|
11140
|
+
showTitle && /* @__PURE__ */ jsx("span", { className: "truncate text-xs font-medium", children: event.title }),
|
|
11141
|
+
!isLastDay && colStart + colSpan === 7 && /* @__PURE__ */ jsx("span", { className: "shrink-0 ml-auto text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretRightIcon$1, {}) })
|
|
11142
|
+
] })
|
|
11143
|
+
}
|
|
11144
|
+
)
|
|
11145
|
+
}
|
|
11146
|
+
) }),
|
|
11147
|
+
/* @__PURE__ */ jsxs(TooltipContentBase, { side: "top", children: [
|
|
11148
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
11149
|
+
/* @__PURE__ */ jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
11150
|
+
event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center gap-1", children: [
|
|
11151
|
+
/* @__PURE__ */ jsx(MapPinIcon$1, { size: 14 }),
|
|
11152
|
+
" ",
|
|
11153
|
+
event.location
|
|
11154
|
+
] })
|
|
11155
|
+
] })
|
|
11156
|
+
] }) }, event.id);
|
|
11157
|
+
})
|
|
11158
|
+
]
|
|
11159
|
+
}
|
|
11160
|
+
)
|
|
11161
|
+
] }),
|
|
11162
|
+
multiDayTimedEvents.length > 0 && /* @__PURE__ */ jsxs(
|
|
11163
|
+
"div",
|
|
11164
|
+
{
|
|
11165
|
+
className: cn(
|
|
11166
|
+
"grid grid-cols-8",
|
|
11167
|
+
trueAllDayEvents.length > 0 && "border-t border-border/40"
|
|
10808
11168
|
),
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
11169
|
+
children: [
|
|
11170
|
+
/* @__PURE__ */ jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full px-1 text-muted-foreground/70 sm:text-xs", children: "Evento" }) }),
|
|
11171
|
+
/* @__PURE__ */ jsxs(
|
|
10812
11172
|
"div",
|
|
10813
11173
|
{
|
|
10814
|
-
className: "
|
|
10815
|
-
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
11174
|
+
className: "col-span-7 relative",
|
|
11175
|
+
style: { height: multiDayBarData.sectionH },
|
|
11176
|
+
children: [
|
|
11177
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 grid grid-cols-7 pointer-events-none", children: days.map((day) => /* @__PURE__ */ jsx(
|
|
11178
|
+
"div",
|
|
10819
11179
|
{
|
|
10820
|
-
className:
|
|
10821
|
-
|
|
10822
|
-
quarter === 0 && "top-0",
|
|
10823
|
-
quarter === 1 && "top-[calc(var(--week-cells-height)/4)]",
|
|
10824
|
-
quarter === 2 && "top-[calc(var(--week-cells-height)/4*2)]",
|
|
10825
|
-
quarter === 3 && "top-[calc(var(--week-cells-height)/4*)]"
|
|
10826
|
-
),
|
|
10827
|
-
date: day,
|
|
10828
|
-
id: `week-cell-${day.toISOString()}-${quarterHourTime}`,
|
|
10829
|
-
onClick: () => {
|
|
10830
|
-
const startTime = new Date(day);
|
|
10831
|
-
startTime.setHours(hourValue);
|
|
10832
|
-
startTime.setMinutes(quarter * 15);
|
|
10833
|
-
if (onEventCreate) onEventCreate(startTime);
|
|
10834
|
-
},
|
|
10835
|
-
time: quarterHourTime
|
|
11180
|
+
className: "border-r last:border-r-0 border-border/70",
|
|
11181
|
+
"data-today": isToday(day) || void 0
|
|
10836
11182
|
},
|
|
10837
|
-
|
|
10838
|
-
)
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
11183
|
+
day.toString()
|
|
11184
|
+
)) }),
|
|
11185
|
+
multiDayBarData.bars.map((bar) => {
|
|
11186
|
+
const {
|
|
11187
|
+
event,
|
|
11188
|
+
colStart,
|
|
11189
|
+
colSpan,
|
|
11190
|
+
isFirstDay,
|
|
11191
|
+
isLastDay,
|
|
11192
|
+
slot
|
|
11193
|
+
} = bar;
|
|
11194
|
+
const eventStart = getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
11195
|
+
const showTitle = isFirstDay || !isFirstDay && colStart === 0;
|
|
11196
|
+
return /* @__PURE__ */ jsx(TooltipProviderBase, { delayDuration: 400, children: /* @__PURE__ */ jsxs(TooltipBase, { children: [
|
|
11197
|
+
/* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
11198
|
+
"div",
|
|
11199
|
+
{
|
|
11200
|
+
className: "absolute px-0.5",
|
|
11201
|
+
style: {
|
|
11202
|
+
left: `calc(${colStart / 7 * 100}% + 2px)`,
|
|
11203
|
+
width: `calc(${colSpan / 7 * 100}% - 4px)`,
|
|
11204
|
+
top: EventGapAgenda + slot * rowH,
|
|
11205
|
+
height: EventHeightAgenda
|
|
11206
|
+
},
|
|
11207
|
+
children: /* @__PURE__ */ jsx(
|
|
11208
|
+
EventItemAgenda,
|
|
11209
|
+
{
|
|
11210
|
+
event,
|
|
11211
|
+
isFirstDay,
|
|
11212
|
+
isLastDay,
|
|
11213
|
+
onClick: (e) => {
|
|
11214
|
+
e.stopPropagation();
|
|
11215
|
+
handleEventClick(event, e);
|
|
11216
|
+
},
|
|
11217
|
+
view: "month",
|
|
11218
|
+
className: "h-full border-dashed",
|
|
11219
|
+
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 min-w-0 w-full", children: [
|
|
11220
|
+
!isFirstDay && colStart === 0 && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretLeftIcon$1, {}) }),
|
|
11221
|
+
showTitle && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11222
|
+
isFirstDay && /* @__PURE__ */ jsx("span", { className: "font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: format(eventStart, "HH:mm") }),
|
|
11223
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs font-medium", children: event.title }),
|
|
11224
|
+
isFirstDay && (() => {
|
|
11225
|
+
const evStart = getEventStartDate(event);
|
|
11226
|
+
const evEnd = getEventEndDate(event);
|
|
11227
|
+
if (!evStart || !evEnd) return null;
|
|
11228
|
+
const d = Math.round(
|
|
11229
|
+
(evEnd.getTime() - evStart.getTime()) / 864e5
|
|
11230
|
+
) + 1;
|
|
11231
|
+
if (d < 2) return null;
|
|
11232
|
+
return /* @__PURE__ */ jsxs("span", { className: "shrink-0 inline-flex items-end font-bold leading-none px-1 py-0.5 text-[10px]", children: [
|
|
11233
|
+
d,
|
|
11234
|
+
"d"
|
|
11235
|
+
] });
|
|
11236
|
+
})()
|
|
11237
|
+
] }),
|
|
11238
|
+
!isLastDay && colStart + colSpan === 7 && /* @__PURE__ */ jsx("span", { className: "shrink-0 ml-auto text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretRightIcon$1, {}) })
|
|
11239
|
+
] })
|
|
11240
|
+
}
|
|
11241
|
+
)
|
|
11242
|
+
}
|
|
11243
|
+
) }),
|
|
11244
|
+
/* @__PURE__ */ jsxs(TooltipContentBase, { side: "top", children: [
|
|
11245
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
11246
|
+
/* @__PURE__ */ jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
11247
|
+
event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center gap-1", children: [
|
|
11248
|
+
/* @__PURE__ */ jsx(MapPinIcon$1, { size: 14 }),
|
|
11249
|
+
" ",
|
|
11250
|
+
event.location
|
|
11251
|
+
] })
|
|
11252
|
+
] })
|
|
11253
|
+
] }) }, event.id);
|
|
11254
|
+
})
|
|
11255
|
+
]
|
|
11256
|
+
}
|
|
11257
|
+
)
|
|
11258
|
+
]
|
|
11259
|
+
}
|
|
11260
|
+
)
|
|
11261
|
+
] }),
|
|
11262
|
+
/* @__PURE__ */ jsxs("div", { className: "grid flex-1 grid-cols-8", children: [
|
|
11263
|
+
/* @__PURE__ */ jsx("div", { className: "grid auto-cols-fr border-border/70 border-r", children: hours.map((hour, index) => /* @__PURE__ */ jsx(
|
|
11264
|
+
"div",
|
|
11265
|
+
{
|
|
11266
|
+
className: "relative min-h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
|
|
11267
|
+
children: index > 0 && /* @__PURE__ */ jsx("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-1 sm:pe-4 text-[9px] sm:text-xs text-muted-foreground/70", children: format(hour, "HH:mm") })
|
|
11268
|
+
},
|
|
11269
|
+
hour.toString()
|
|
11270
|
+
)) }),
|
|
11271
|
+
days.map((day, dayIndex) => /* @__PURE__ */ jsxs(
|
|
11272
|
+
"div",
|
|
11273
|
+
{
|
|
11274
|
+
className: "relative grid auto-cols-fr border-border/70 border-r last:border-r-0",
|
|
11275
|
+
"data-today": isToday(day) || void 0,
|
|
11276
|
+
children: [
|
|
11277
|
+
(processedDayEvents[dayIndex] ?? []).map((positionedEvent) => {
|
|
11278
|
+
const timeLabel = formatDurationAgenda(positionedEvent.event);
|
|
11279
|
+
return /* @__PURE__ */ jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxs(TooltipBase, { delayDuration: 250, children: [
|
|
11280
|
+
/* @__PURE__ */ jsx(
|
|
11281
|
+
"div",
|
|
11282
|
+
{
|
|
11283
|
+
className: "absolute z-10 px-0.5",
|
|
11284
|
+
onClick: (e) => e.stopPropagation(),
|
|
11285
|
+
style: {
|
|
11286
|
+
height: `${positionedEvent.height}px`,
|
|
11287
|
+
left: `${positionedEvent.left * 100}%`,
|
|
11288
|
+
top: `${positionedEvent.top}px`,
|
|
11289
|
+
width: `${positionedEvent.width * 100}%`,
|
|
11290
|
+
zIndex: positionedEvent.zIndex
|
|
11291
|
+
},
|
|
11292
|
+
children: /* @__PURE__ */ jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "size-full", children: /* @__PURE__ */ jsx(
|
|
11293
|
+
DraggableEvent,
|
|
11294
|
+
{
|
|
11295
|
+
event: positionedEvent.event,
|
|
11296
|
+
height: positionedEvent.height,
|
|
11297
|
+
onClick: (e) => handleEventClick(positionedEvent.event, e),
|
|
11298
|
+
draggable: false,
|
|
11299
|
+
showTime: true,
|
|
11300
|
+
view: "week",
|
|
11301
|
+
totalCols: positionedEvent.totalCols
|
|
11302
|
+
}
|
|
11303
|
+
) }) })
|
|
11304
|
+
}
|
|
11305
|
+
),
|
|
11306
|
+
/* @__PURE__ */ jsxs(
|
|
11307
|
+
TooltipContentBase,
|
|
11308
|
+
{
|
|
11309
|
+
side: "right",
|
|
11310
|
+
sideOffset: 6,
|
|
11311
|
+
className: "max-w-[220px] space-y-0.5",
|
|
11312
|
+
children: [
|
|
11313
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-sm leading-snug", children: positionedEvent.event.title }),
|
|
11314
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs opacity-90", children: timeLabel }),
|
|
11315
|
+
positionedEvent.event.location && /* @__PURE__ */ jsxs("p", { className: "text-xs flex items-center gap-2", children: [
|
|
11316
|
+
/* @__PURE__ */ jsx(MapPinIcon$1, { size: 15 }),
|
|
11317
|
+
" ",
|
|
11318
|
+
positionedEvent.event.location
|
|
11319
|
+
] }),
|
|
11320
|
+
positionedEvent.event.description && /* @__PURE__ */ jsx("p", { className: "text-xs opacity-75 line-clamp-2", children: positionedEvent.event.description })
|
|
11321
|
+
]
|
|
11322
|
+
}
|
|
11323
|
+
)
|
|
11324
|
+
] }) }, positionedEvent.event.id);
|
|
11325
|
+
}),
|
|
11326
|
+
currentTimeVisible && isToday(day) && /* @__PURE__ */ jsx(
|
|
11327
|
+
"div",
|
|
11328
|
+
{
|
|
11329
|
+
className: "pointer-events-none absolute right-0 left-0 z-20",
|
|
11330
|
+
style: { top: `${currentTimePosition}%` },
|
|
11331
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
11332
|
+
/* @__PURE__ */ jsx("div", { className: "-left-1 absolute h-2 w-2 rounded-full bg-primary" }),
|
|
11333
|
+
/* @__PURE__ */ jsx("div", { className: "h-[2px] w-full bg-primary" })
|
|
11334
|
+
] })
|
|
11335
|
+
}
|
|
11336
|
+
),
|
|
11337
|
+
hours.map((hour) => {
|
|
11338
|
+
const hourValue = getHours(hour);
|
|
11339
|
+
return /* @__PURE__ */ jsx(
|
|
11340
|
+
"div",
|
|
11341
|
+
{
|
|
11342
|
+
className: "relative min-h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
|
|
11343
|
+
children: [0, 1, 2, 3].map((quarter) => {
|
|
11344
|
+
const quarterHourTime = hourValue + quarter * 0.25;
|
|
11345
|
+
return /* @__PURE__ */ jsx(
|
|
11346
|
+
DroppableCellAgenda,
|
|
11347
|
+
{
|
|
11348
|
+
className: cn(
|
|
11349
|
+
"absolute h-[calc(var(--week-cells-height)/4)] w-full",
|
|
11350
|
+
quarter === 0 && "top-0",
|
|
11351
|
+
quarter === 1 && "top-[calc(var(--week-cells-height)/4)]",
|
|
11352
|
+
quarter === 2 && "top-[calc(var(--week-cells-height)/4*2)]",
|
|
11353
|
+
quarter === 3 && "top-[calc(var(--week-cells-height)/4*3)]"
|
|
11354
|
+
),
|
|
11355
|
+
date: day,
|
|
11356
|
+
id: `week-cell-${day.toISOString()}-${quarterHourTime}`,
|
|
11357
|
+
onClick: () => {
|
|
11358
|
+
const startTime = new Date(day);
|
|
11359
|
+
startTime.setHours(hourValue);
|
|
11360
|
+
startTime.setMinutes(quarter * 15);
|
|
11361
|
+
if (onEventCreate) onEventCreate(startTime);
|
|
11362
|
+
},
|
|
11363
|
+
time: quarterHourTime
|
|
11364
|
+
},
|
|
11365
|
+
`${hour.toString()}-${quarter}`
|
|
11366
|
+
);
|
|
11367
|
+
})
|
|
11368
|
+
},
|
|
11369
|
+
hour.toString()
|
|
11370
|
+
);
|
|
11371
|
+
})
|
|
11372
|
+
]
|
|
11373
|
+
},
|
|
11374
|
+
day.toString()
|
|
11375
|
+
))
|
|
11376
|
+
] })
|
|
11377
|
+
] }) }),
|
|
10849
11378
|
/* @__PURE__ */ jsx(
|
|
10850
11379
|
UndatedEvents,
|
|
10851
11380
|
{
|
|
10852
11381
|
events,
|
|
10853
11382
|
onEventSelect,
|
|
10854
11383
|
show: showUndatedEvents,
|
|
10855
|
-
className: "my-"
|
|
11384
|
+
className: "my-4"
|
|
10856
11385
|
}
|
|
10857
11386
|
)
|
|
10858
11387
|
] });
|
|
10859
11388
|
}
|
|
11389
|
+
var colorBannerMap = {
|
|
11390
|
+
sky: "from-sky-400 via-sky-500 to-cyan-500",
|
|
11391
|
+
amber: "from-amber-400 via-amber-500 to-orange-400",
|
|
11392
|
+
violet: "from-violet-400 via-violet-500 to-purple-600",
|
|
11393
|
+
rose: "from-rose-400 via-rose-500 to-pink-500",
|
|
11394
|
+
emerald: "from-emerald-400 via-emerald-500 to-teal-500",
|
|
11395
|
+
orange: "from-orange-400 via-orange-500 to-amber-500",
|
|
11396
|
+
green: "from-green-400 via-green-500 to-emerald-500",
|
|
11397
|
+
blue: "from-blue-400 via-blue-500 to-indigo-500",
|
|
11398
|
+
red: "from-red-400 via-red-500 to-rose-500",
|
|
11399
|
+
purple: "from-purple-400 via-purple-500 to-violet-600",
|
|
11400
|
+
indigo: "from-indigo-400 via-indigo-500 to-blue-600",
|
|
11401
|
+
teal: "from-teal-400 via-teal-500 to-cyan-500",
|
|
11402
|
+
pink: "from-pink-400 via-pink-500 to-rose-400",
|
|
11403
|
+
cyan: "from-cyan-400 via-cyan-500 to-sky-500",
|
|
11404
|
+
lime: "from-lime-400 via-lime-500 to-green-500",
|
|
11405
|
+
fuchsia: "from-fuchsia-400 via-fuchsia-500 to-purple-500"
|
|
11406
|
+
};
|
|
11407
|
+
function formatDuration(minutes) {
|
|
11408
|
+
if (minutes <= 0) return "";
|
|
11409
|
+
const h = Math.floor(minutes / 60);
|
|
11410
|
+
const m = minutes % 60;
|
|
11411
|
+
if (h === 0) return `${m}min`;
|
|
11412
|
+
if (m === 0) return `${h}h`;
|
|
11413
|
+
return `${h}h ${m}min`;
|
|
11414
|
+
}
|
|
11415
|
+
function formatDateFull(date) {
|
|
11416
|
+
return format(date, "EEE',' d 'de' MMMM 'de' yyyy", { locale: ptBR });
|
|
11417
|
+
}
|
|
11418
|
+
function capitalize(s) {
|
|
11419
|
+
return s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
11420
|
+
}
|
|
11421
|
+
function EventDetailModalAgenda({
|
|
11422
|
+
event,
|
|
11423
|
+
onClose
|
|
11424
|
+
}) {
|
|
11425
|
+
const [open, setOpen] = useState(true);
|
|
11426
|
+
if (!event) return null;
|
|
11427
|
+
const color = event.color ?? getAutoColorAgenda(event.id);
|
|
11428
|
+
const bannerGradient = colorBannerMap[color] ?? colorBannerMap.sky;
|
|
11429
|
+
const startDate = getEventStartDate(event);
|
|
11430
|
+
const endDate = getEventEndDate(event);
|
|
11431
|
+
const isMultiDay = isMultiDayEventAgenda(event);
|
|
11432
|
+
const durationMinutes = startDate && endDate ? differenceInMinutes(endDate, startDate) : 0;
|
|
11433
|
+
const dateSection = (() => {
|
|
11434
|
+
if (!startDate) {
|
|
11435
|
+
return { primary: "Sem data definida", secondary: null, isAllDay: false };
|
|
11436
|
+
}
|
|
11437
|
+
if (event.allDay) {
|
|
11438
|
+
if (isMultiDay && endDate && !isSameDay(startDate, endDate)) {
|
|
11439
|
+
return {
|
|
11440
|
+
primary: `${capitalize(formatDateFull(startDate))}`,
|
|
11441
|
+
secondary: `${capitalize(formatDateFull(endDate))}`,
|
|
11442
|
+
isAllDay: true
|
|
11443
|
+
};
|
|
11444
|
+
}
|
|
11445
|
+
return {
|
|
11446
|
+
primary: capitalize(formatDateFull(startDate)),
|
|
11447
|
+
secondary: null,
|
|
11448
|
+
isAllDay: true
|
|
11449
|
+
};
|
|
11450
|
+
}
|
|
11451
|
+
if (isMultiDay && endDate) {
|
|
11452
|
+
const startStr = capitalize(
|
|
11453
|
+
format(startDate, "d MMM yyyy, HH:mm", { locale: ptBR })
|
|
11454
|
+
);
|
|
11455
|
+
const endStr = capitalize(
|
|
11456
|
+
format(endDate, "d MMM yyyy, HH:mm", { locale: ptBR })
|
|
11457
|
+
);
|
|
11458
|
+
return { primary: startStr, secondary: endStr, isAllDay: false };
|
|
11459
|
+
}
|
|
11460
|
+
const dateStr = capitalize(formatDateFull(startDate));
|
|
11461
|
+
const timeStr = endDate ? `${format(startDate, "HH:mm")} \u2013 ${format(endDate, "HH:mm")}` : format(startDate, "HH:mm");
|
|
11462
|
+
return { primary: dateStr, secondary: timeStr, isAllDay: false };
|
|
11463
|
+
})();
|
|
11464
|
+
return /* @__PURE__ */ jsx(
|
|
11465
|
+
DialogBase,
|
|
11466
|
+
{
|
|
11467
|
+
open,
|
|
11468
|
+
onOpenChange: (v) => {
|
|
11469
|
+
setOpen(v);
|
|
11470
|
+
if (!v) onClose?.();
|
|
11471
|
+
},
|
|
11472
|
+
children: /* @__PURE__ */ jsxs(DialogContentBase, { className: "p-0 overflow-hidden gap-0 border-none shadow-2xl sm:max-w-md rounded-2xl", children: [
|
|
11473
|
+
/* @__PURE__ */ jsxs(
|
|
11474
|
+
"div",
|
|
11475
|
+
{
|
|
11476
|
+
className: cn(
|
|
11477
|
+
"relative bg-gradient-to-br w-full flex flex-col justify-end px-7 pt-14 pb-7 select-none overflow-hidden",
|
|
11478
|
+
bannerGradient
|
|
11479
|
+
),
|
|
11480
|
+
children: [
|
|
11481
|
+
/* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-br from-white/20 via-transparent to-black/10" }),
|
|
11482
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-4 left-5 flex items-center gap-2 z-10", children: dateSection.isAllDay ? /* @__PURE__ */ jsxs(Badge, { className: "bg-black/20 text-white border border-white/20 backdrop-blur-sm shadow-none gap-1 text-[11px] font-medium", children: [
|
|
11483
|
+
/* @__PURE__ */ jsx(SunIcon, { size: 11, weight: "bold" }),
|
|
11484
|
+
"Dia todo"
|
|
11485
|
+
] }) : isMultiDay ? /* @__PURE__ */ jsxs(Badge, { className: "bg-black/20 text-white border border-white/20 backdrop-blur-sm shadow-none gap-1 text-[11px] font-medium", children: [
|
|
11486
|
+
/* @__PURE__ */ jsx(CalendarDotsIcon, { size: 11, weight: "bold" }),
|
|
11487
|
+
formatDurationAgendaDays(event)
|
|
11488
|
+
] }) : durationMinutes > 0 ? /* @__PURE__ */ jsxs(Badge, { className: "bg-black/20 text-white border border-white/20 backdrop-blur-sm shadow-none gap-1 text-[11px] font-medium", children: [
|
|
11489
|
+
/* @__PURE__ */ jsx(ClockIcon, { size: 11, weight: "bold" }),
|
|
11490
|
+
formatDuration(durationMinutes)
|
|
11491
|
+
] }) : null }),
|
|
11492
|
+
/* @__PURE__ */ jsx("h2", { className: "relative z-10 text-2xl sm:text-[1.75rem] font-bold text-white leading-tight tracking-tight drop-shadow-sm", children: event.title })
|
|
11493
|
+
]
|
|
11494
|
+
}
|
|
11495
|
+
),
|
|
11496
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col px-7 py-6 bg-background", children: [
|
|
11497
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 py-4", children: [
|
|
11498
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(CalendarDotsIcon, { size: 18, weight: "duotone", className: "text-primary" }) }),
|
|
11499
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
11500
|
+
/* @__PURE__ */ jsx("span", { className: "text-[13px] font-semibold text-foreground leading-snug", children: dateSection.primary }),
|
|
11501
|
+
dateSection.secondary && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 mt-0.5", children: isMultiDay && !event.allDay || isMultiDay && dateSection.isAllDay ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11502
|
+
/* @__PURE__ */ jsx(ArrowRightIcon$1, { size: 11, className: "shrink-0 text-muted-foreground/60" }),
|
|
11503
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] font-medium text-muted-foreground", children: dateSection.secondary })
|
|
11504
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "text-[12px] font-medium text-muted-foreground", children: dateSection.secondary }) })
|
|
11505
|
+
] })
|
|
11506
|
+
] }),
|
|
11507
|
+
(event.location || event.description) && /* @__PURE__ */ jsx(SeparatorBase, { className: "opacity-40" }),
|
|
11508
|
+
event.location && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11509
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 py-4", children: [
|
|
11510
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(MapPinIcon, { size: 18, weight: "duotone", className: "text-primary" }) }),
|
|
11511
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
11512
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium uppercase tracking-widest text-muted-foreground/60", children: "Localiza\xE7\xE3o" }),
|
|
11513
|
+
/* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium text-foreground leading-snug", children: event.location })
|
|
11514
|
+
] })
|
|
11515
|
+
] }),
|
|
11516
|
+
event.description && /* @__PURE__ */ jsx(SeparatorBase, { className: "opacity-40" })
|
|
11517
|
+
] }),
|
|
11518
|
+
event.description && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 py-4", children: [
|
|
11519
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(AlignLeftIcon, { size: 18, weight: "duotone", className: "text-primary" }) }),
|
|
11520
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
11521
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium uppercase tracking-widest text-muted-foreground/60", children: "Descri\xE7\xE3o" }),
|
|
11522
|
+
/* @__PURE__ */ jsx("p", { className: "text-[13px] text-muted-foreground leading-relaxed font-normal", children: event.description })
|
|
11523
|
+
] })
|
|
11524
|
+
] }),
|
|
11525
|
+
!event.location && !event.description && /* @__PURE__ */ jsx("p", { className: "py-4 text-[11px] text-muted-foreground/40 italic text-center", children: "Nenhum detalhe adicional dispon\xEDvel." })
|
|
11526
|
+
] })
|
|
11527
|
+
] })
|
|
11528
|
+
}
|
|
11529
|
+
);
|
|
11530
|
+
}
|
|
10860
11531
|
function AgendaView({
|
|
10861
11532
|
currentDate,
|
|
10862
11533
|
events,
|
|
@@ -11702,23 +12373,23 @@ function EventCalendar({
|
|
|
11702
12373
|
});
|
|
11703
12374
|
};
|
|
11704
12375
|
const viewTitle = useMemo(() => {
|
|
11705
|
-
const
|
|
12376
|
+
const capitalize2 = (s) => s && s.length > 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
11706
12377
|
if (view === "month") {
|
|
11707
|
-
return
|
|
12378
|
+
return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
|
|
11708
12379
|
}
|
|
11709
12380
|
if (view === "week") {
|
|
11710
12381
|
const start = startOfWeek(currentDate, { weekStartsOn: 1 });
|
|
11711
12382
|
const end = endOfWeek(currentDate, { weekStartsOn: 1 });
|
|
11712
12383
|
if (isSameMonth(start, end)) {
|
|
11713
|
-
return
|
|
12384
|
+
return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
|
|
11714
12385
|
}
|
|
11715
|
-
const s1 =
|
|
11716
|
-
const s2 =
|
|
12386
|
+
const s1 = capitalize2(format(start, "MMM", { locale: ptBR }));
|
|
12387
|
+
const s2 = capitalize2(format(end, "MMM yyyy", { locale: ptBR }));
|
|
11717
12388
|
return `${s1} - ${s2}`;
|
|
11718
12389
|
}
|
|
11719
12390
|
if (view === "day") {
|
|
11720
12391
|
const dayNum = format(currentDate, "d", { locale: ptBR });
|
|
11721
|
-
const month =
|
|
12392
|
+
const month = capitalize2(format(currentDate, "MMMM", { locale: ptBR }));
|
|
11722
12393
|
const year = format(currentDate, "yyyy", { locale: ptBR });
|
|
11723
12394
|
const short = `${dayNum} de ${month} de ${year}`;
|
|
11724
12395
|
const long = `${format(currentDate, "EEE", {
|
|
@@ -11734,13 +12405,13 @@ function EventCalendar({
|
|
|
11734
12405
|
const start = currentDate;
|
|
11735
12406
|
const end = addDays(currentDate, AgendaDaysToShow - 1);
|
|
11736
12407
|
if (isSameMonth(start, end)) {
|
|
11737
|
-
return
|
|
12408
|
+
return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
|
|
11738
12409
|
}
|
|
11739
|
-
const s1 =
|
|
11740
|
-
const s2 =
|
|
12410
|
+
const s1 = capitalize2(format(start, "MMM", { locale: ptBR }));
|
|
12411
|
+
const s2 = capitalize2(format(end, "MMM yyyy", { locale: ptBR }));
|
|
11741
12412
|
return `${s1} - ${s2}`;
|
|
11742
12413
|
}
|
|
11743
|
-
return
|
|
12414
|
+
return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
|
|
11744
12415
|
}, [currentDate, view]);
|
|
11745
12416
|
const calendarContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11746
12417
|
/* @__PURE__ */ jsxs(
|
|
@@ -13900,14 +14571,14 @@ var generateAdditionalColors = (baseColors, count) => {
|
|
|
13900
14571
|
r /= 255;
|
|
13901
14572
|
g /= 255;
|
|
13902
14573
|
b /= 255;
|
|
13903
|
-
const
|
|
14574
|
+
const max2 = Math.max(r, g, b), min2 = Math.min(r, g, b);
|
|
13904
14575
|
let h = 0;
|
|
13905
14576
|
let s = 0;
|
|
13906
|
-
const l = (
|
|
13907
|
-
if (
|
|
13908
|
-
const d =
|
|
13909
|
-
s = l > 0.5 ? d / (2 -
|
|
13910
|
-
switch (
|
|
14577
|
+
const l = (max2 + min2) / 2;
|
|
14578
|
+
if (max2 !== min2) {
|
|
14579
|
+
const d = max2 - min2;
|
|
14580
|
+
s = l > 0.5 ? d / (2 - max2 - min2) : d / (max2 + min2);
|
|
14581
|
+
switch (max2) {
|
|
13911
14582
|
case r:
|
|
13912
14583
|
h = (g - b) / d + (g < b ? 6 : 0);
|
|
13913
14584
|
break;
|
|
@@ -14024,25 +14695,25 @@ var computeNiceMax = (maxValue) => {
|
|
|
14024
14695
|
return niceCeil(padded);
|
|
14025
14696
|
};
|
|
14026
14697
|
var getMaxDataValue = (data, keys) => {
|
|
14027
|
-
let
|
|
14698
|
+
let max2 = 0;
|
|
14028
14699
|
for (const row of data) {
|
|
14029
14700
|
for (const key of keys) {
|
|
14030
14701
|
const v = row[key];
|
|
14031
|
-
if (typeof v === "number" && Number.isFinite(v) && v >
|
|
14702
|
+
if (typeof v === "number" && Number.isFinite(v) && v > max2) max2 = v;
|
|
14032
14703
|
}
|
|
14033
14704
|
}
|
|
14034
|
-
return
|
|
14705
|
+
return max2;
|
|
14035
14706
|
};
|
|
14036
14707
|
var getMinDataValue = (data, keys) => {
|
|
14037
|
-
let
|
|
14708
|
+
let min2 = 0;
|
|
14038
14709
|
for (const row of data) {
|
|
14039
14710
|
for (const key of keys) {
|
|
14040
14711
|
const v = row[key];
|
|
14041
|
-
if (typeof v === "number" && Number.isFinite(v) && v <
|
|
14042
|
-
|
|
14712
|
+
if (typeof v === "number" && Number.isFinite(v) && v < min2)
|
|
14713
|
+
min2 = v;
|
|
14043
14714
|
}
|
|
14044
14715
|
}
|
|
14045
|
-
return
|
|
14716
|
+
return min2;
|
|
14046
14717
|
};
|
|
14047
14718
|
var computeChartWidth = (width, dataLength, series, niceMaxLeft, niceMaxRight) => {
|
|
14048
14719
|
if (typeof width === "number") return width;
|
|
@@ -14088,8 +14759,8 @@ var createValueFormatter = (customFormatter, formatBR) => {
|
|
|
14088
14759
|
});
|
|
14089
14760
|
const prefixFormats = ["R$", "$", "\u20AC", "\xA3"];
|
|
14090
14761
|
const suffixFormats = ["%", "kg", "km", "m", "L", "un", "t", "h", "min", "s"];
|
|
14091
|
-
const getFormattedValue = (baseValue,
|
|
14092
|
-
const trimmedFormat =
|
|
14762
|
+
const getFormattedValue = (baseValue, format20) => {
|
|
14763
|
+
const trimmedFormat = format20.trim();
|
|
14093
14764
|
if (prefixFormats.includes(trimmedFormat)) {
|
|
14094
14765
|
return `${trimmedFormat} ${baseValue}`;
|
|
14095
14766
|
}
|
|
@@ -14114,8 +14785,8 @@ var createValueFormatter = (customFormatter, formatBR) => {
|
|
|
14114
14785
|
num = Number.isNaN(parsed) ? NaN : parsed;
|
|
14115
14786
|
}
|
|
14116
14787
|
const baseFormatted = formatBR && !Number.isNaN(num) ? nf.format(num) : String(formattedValue ?? value ?? "");
|
|
14117
|
-
const
|
|
14118
|
-
return
|
|
14788
|
+
const format20 = propsDataKey && formatterMap[propsDataKey] ? formatterMap[propsDataKey] : "";
|
|
14789
|
+
return format20 ? getFormattedValue(baseFormatted, format20) : baseFormatted;
|
|
14119
14790
|
};
|
|
14120
14791
|
}
|
|
14121
14792
|
if (typeof customFormatter === "function") {
|
|
@@ -18428,8 +19099,8 @@ var TimeSeries_default = TimeSeries;
|
|
|
18428
19099
|
function NumericInput({
|
|
18429
19100
|
value,
|
|
18430
19101
|
onChange,
|
|
18431
|
-
min,
|
|
18432
|
-
max,
|
|
19102
|
+
min: min2,
|
|
19103
|
+
max: max2,
|
|
18433
19104
|
label,
|
|
18434
19105
|
className,
|
|
18435
19106
|
error,
|
|
@@ -18446,21 +19117,21 @@ function NumericInput({
|
|
|
18446
19117
|
if (!hasChanged || isLoading || disabled) return;
|
|
18447
19118
|
onChange(internalValue);
|
|
18448
19119
|
};
|
|
18449
|
-
function handleNumberChange(value2, currentValue = 0,
|
|
19120
|
+
function handleNumberChange(value2, currentValue = 0, max3 = 9999999, min3 = 0) {
|
|
18450
19121
|
const numbersOnly = value2.replace(/\D/g, "");
|
|
18451
19122
|
if (numbersOnly === "") {
|
|
18452
19123
|
return 0;
|
|
18453
19124
|
}
|
|
18454
19125
|
const numValue = Number(numbersOnly);
|
|
18455
|
-
if (numValue <
|
|
19126
|
+
if (numValue < min3) {
|
|
18456
19127
|
if (tooltip_on_overflow) {
|
|
18457
|
-
toast$1.warning("O valor deve ser maior que " +
|
|
19128
|
+
toast$1.warning("O valor deve ser maior que " + min3.toString());
|
|
18458
19129
|
}
|
|
18459
|
-
return
|
|
19130
|
+
return min3;
|
|
18460
19131
|
}
|
|
18461
|
-
if (numValue >
|
|
19132
|
+
if (numValue > max3) {
|
|
18462
19133
|
if (tooltip_on_overflow) {
|
|
18463
|
-
toast$1.warning("O valor deve ser menor que " +
|
|
19134
|
+
toast$1.warning("O valor deve ser menor que " + max3.toString());
|
|
18464
19135
|
}
|
|
18465
19136
|
return currentValue;
|
|
18466
19137
|
}
|
|
@@ -18482,8 +19153,8 @@ function NumericInput({
|
|
|
18482
19153
|
const processedValue = handleNumberChange(
|
|
18483
19154
|
e.currentTarget.value,
|
|
18484
19155
|
internalValue,
|
|
18485
|
-
|
|
18486
|
-
|
|
19156
|
+
max2,
|
|
19157
|
+
min2
|
|
18487
19158
|
);
|
|
18488
19159
|
setInternalValue(processedValue);
|
|
18489
19160
|
},
|
|
@@ -19649,4 +20320,4 @@ function ControlledCombobox({
|
|
|
19649
20320
|
);
|
|
19650
20321
|
}
|
|
19651
20322
|
|
|
19652
|
-
export { AddButton, Agenda, AgendaDaysToShow, AgendaDaysToShowAgenda, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarCombobox, AvatarFallbackBase, AvatarImageBase, BackButton, Badge, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, Brush_default as Brush, ButtonBase, ButtonGroupBase, CENTER_INDEX, CalendarBase, CalendarDndProvider, CalendarDndProviderAgenda, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, CarouselBase, ChangeButton, Chart_default as Chart, ChartControls, ChartHeader, ChartTotalLegend_default as ChartTotalLegend, CheckButton, CheckboxBase, CheckboxTree, CloseAllButton_default as CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, CommandBase, CommandDebouncedInputBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, ControlledCombobox, CopyButton, DateTimePicker, DayView, DayViewAgenda, DebouncedInput, DefaultEndHour, DefaultEndHourAgenda, DefaultStartHour, DefaultStartHourAgenda, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent2 as DraggableEvent, DraggableTooltip_default as DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, DroppableCellAgenda, EditButton, EndHour, EndHourAgenda, ErrorMessage_default as ErrorMessage, EventAgenda, EventCalendar, EventDialog, EventGap, EventGapAgenda, EventHeight, EventHeightAgenda, EventItem, EventItemAgenda, EventsPopup, FavoriteButton, FileUploader, FilterButton, HideButton, Highlights_default as Highlights, HorizontalChart_default as HorizontalChart, HorizontalLegend_default as HorizontalLegend, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase_default as LabelBase, Leaderboard, LikeButton, LoadingBase, LockButton, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MonthViewAgenda, MoreButton, MultiCombobox, MultiSelect, MultiSelectBase, MultiSelectContentBase, MultiSelectGroupBase, MultiSelectItemBase, MultiSelectSeparatorBase, MultiSelectTriggerBase, MultiSelectValueBase, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NoData_default as NoData, NotificationButton, NumericInput, PeriodsDropdown_default as PeriodsDropdown, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, ProgressCirclesBase, ProgressPanelsBase, ProgressSegmentsBase, RadialMenu, RangePicker, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectEmpty, SelectGroupBase, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly_default as ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, StartHour, StartHourAgenda, StatusIndicator, SwitchBase, SystemTooltip_default as SystemTooltip, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, ThemeProviderBase, TimePicker, TimePickerInput, TimeSeries_default as TimeSeries, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple_default as TooltipSimple, TooltipTriggerBase, TooltipWithTotal_default as TooltipWithTotal, UndatedEvents, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, VISIBLE_ITEMS, ViewButton, VisibilityButton, WeekCellsHeight, WeekCellsHeightAgenda, WeekView, WeekViewAgenda, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, formatFieldName, formatLinePercentage, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, getBorderRadiusClasses, getBorderRadiusClassesAgenda, getDateByType, getEventColorClasses, getEventColorClassesAgenda, getEventEndDate, getEventStartDate, getEventsForDay, getEventsForDayAgenda, getItems, getMaxDataValue, getMinDataValue, getSpanningEventsForDay, getSpanningEventsForDayAgenda, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isMultiDayEventAgenda, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, normalizeAttendDate, processNeo4jData, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, toast, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useOpenTooltipForPeriod, useProcessedData, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };
|
|
20323
|
+
export { AddButton, Agenda, AgendaDaysToShow, AgendaDaysToShowAgenda, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarCombobox, AvatarFallbackBase, AvatarImageBase, BackButton, Badge, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, Brush_default as Brush, ButtonBase, ButtonGroupBase, CENTER_INDEX, CalendarBase, CalendarDndProvider, CalendarDndProviderAgenda, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, CarouselBase, ChangeButton, Chart_default as Chart, ChartControls, ChartHeader, ChartTotalLegend_default as ChartTotalLegend, CheckButton, CheckboxBase, CheckboxTree, CloseAllButton_default as CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, CommandBase, CommandDebouncedInputBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, ControlledCombobox, CopyButton, DateTimePicker, DayView, DayViewAgenda, DebouncedInput, DefaultEndHour, DefaultEndHourAgenda, DefaultStartHour, DefaultStartHourAgenda, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent2 as DraggableEvent, DraggableTooltip_default as DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, DroppableCellAgenda, EditButton, EndHour, EndHourAgenda, ErrorMessage_default as ErrorMessage, EventAgenda, EventCalendar, EventDetailModalAgenda, EventDialog, EventGap, EventGapAgenda, EventHeight, EventHeightAgenda, EventItem, EventItemAgenda, EventsPopup, FavoriteButton, FileUploader, FilterButton, HideButton, Highlights_default as Highlights, HorizontalChart_default as HorizontalChart, HorizontalLegend_default as HorizontalLegend, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase_default as LabelBase, Leaderboard, LikeButton, LoadingBase, LockButton, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MonthViewAgenda, MoreButton, MultiCombobox, MultiDayOverlay, MultiSelect, MultiSelectBase, MultiSelectContentBase, MultiSelectGroupBase, MultiSelectItemBase, MultiSelectSeparatorBase, MultiSelectTriggerBase, MultiSelectValueBase, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NoData_default as NoData, NotificationButton, NumericInput, PeriodsDropdown_default as PeriodsDropdown, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, ProgressCirclesBase, ProgressPanelsBase, ProgressSegmentsBase, RadialMenu, RangePicker, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectEmpty, SelectGroupBase, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly_default as ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, StartHour, StartHourAgenda, StatusIndicator, SwitchBase, SystemTooltip_default as SystemTooltip, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, ThemeProviderBase, TimePicker, TimePickerInput, TimeSeries_default as TimeSeries, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple_default as TooltipSimple, TooltipTriggerBase, TooltipWithTotal_default as TooltipWithTotal, UndatedEvents, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, VISIBLE_ITEMS, ViewButton, VisibilityButton, WeekCellsHeight, WeekCellsHeightAgenda, WeekView, WeekViewAgenda, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, formatDurationAgenda, formatDurationAgendaDays, formatFieldName, formatLinePercentage, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, getAutoColorAgenda, getBorderRadiusClasses, getBorderRadiusClassesAgenda, getDateByType, getEventColorClasses, getEventColorClassesAgenda, getEventEndDate, getEventStartDate, getEventsForDay, getEventsForDayAgenda, getItems, getMaxDataValue, getMinDataValue, getSpanningEventsForDay, getSpanningEventsForDayAgenda, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isMultiDayEventAgenda, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, normalizeAttendDate, processNeo4jData, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, toast, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useOpenTooltipForPeriod, useProcessedData, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };
|