@mlw-packages/react-components 1.10.0 → 1.10.2
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 +258 -41
- package/dist/index.d.mts +151 -31
- package/dist/index.d.ts +151 -31
- package/dist/index.js +1043 -273
- package/dist/index.mjs +1032 -276
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9022,8 +9022,40 @@ var StartHourAgenda = 0;
|
|
|
9022
9022
|
var EndHourAgenda = 24;
|
|
9023
9023
|
var DefaultStartHourAgenda = 9;
|
|
9024
9024
|
var DefaultEndHourAgenda = 10;
|
|
9025
|
-
function
|
|
9026
|
-
const
|
|
9025
|
+
function getAutoColorAgenda(id) {
|
|
9026
|
+
const colors2 = [
|
|
9027
|
+
"sky",
|
|
9028
|
+
"amber",
|
|
9029
|
+
"violet",
|
|
9030
|
+
"rose",
|
|
9031
|
+
"emerald",
|
|
9032
|
+
"orange",
|
|
9033
|
+
"green",
|
|
9034
|
+
"blue",
|
|
9035
|
+
"red",
|
|
9036
|
+
"purple",
|
|
9037
|
+
"indigo",
|
|
9038
|
+
"teal",
|
|
9039
|
+
"pink",
|
|
9040
|
+
"cyan",
|
|
9041
|
+
"lime",
|
|
9042
|
+
"fuchsia"
|
|
9043
|
+
];
|
|
9044
|
+
let hash = 0;
|
|
9045
|
+
for (let i = 0; i < id.length; i++) {
|
|
9046
|
+
hash = id.charCodeAt(i) + ((hash << 5) - hash);
|
|
9047
|
+
}
|
|
9048
|
+
const index = Math.abs(hash) % colors2.length;
|
|
9049
|
+
return colors2[index];
|
|
9050
|
+
}
|
|
9051
|
+
function getEventColorClassesAgenda(color, eventId) {
|
|
9052
|
+
let eventColor = color;
|
|
9053
|
+
if (!eventColor && eventId) {
|
|
9054
|
+
eventColor = getAutoColorAgenda(eventId);
|
|
9055
|
+
}
|
|
9056
|
+
if (!eventColor) {
|
|
9057
|
+
eventColor = "sky";
|
|
9058
|
+
}
|
|
9027
9059
|
switch (eventColor) {
|
|
9028
9060
|
case "sky":
|
|
9029
9061
|
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";
|
|
@@ -9168,6 +9200,28 @@ function addMinutesToDateAgenda(date, minutes) {
|
|
|
9168
9200
|
function addHoursToDateAgenda(date, hours) {
|
|
9169
9201
|
return addMinutesToDateAgenda(date, Math.round(hours * 60));
|
|
9170
9202
|
}
|
|
9203
|
+
function formatDurationAgenda(event) {
|
|
9204
|
+
const start = getEventStartDate(event);
|
|
9205
|
+
const end = getEventEndDate(event);
|
|
9206
|
+
if (!start) return "";
|
|
9207
|
+
const fmt = (d) => dateFns.format(d, "d 'de' MMM", { locale: locale.ptBR });
|
|
9208
|
+
if (!end || dateFns.isSameDay(start, end)) {
|
|
9209
|
+
return fmt(start) + (event.allDay ? " \xB7 Dia todo" : " \xB7 " + dateFns.format(start, "HH:mm"));
|
|
9210
|
+
}
|
|
9211
|
+
const days = dateFns.differenceInCalendarDays(end, start) + 1;
|
|
9212
|
+
return `${fmt(start)} \u2192 ${fmt(end)} \xB7 ${days} dias`;
|
|
9213
|
+
}
|
|
9214
|
+
function formatDurationAgendaDays(event) {
|
|
9215
|
+
const start = getEventStartDate(event);
|
|
9216
|
+
const end = getEventEndDate(event);
|
|
9217
|
+
if (!start) return "";
|
|
9218
|
+
const fmt = (d) => dateFns.format(d, "d 'de' MMM", { locale: locale.ptBR });
|
|
9219
|
+
if (!end || dateFns.isSameDay(start, end)) {
|
|
9220
|
+
return fmt(start) + (event.allDay ? " \xB7 Dia todo" : " \xB7 " + dateFns.format(start, "HH:mm"));
|
|
9221
|
+
}
|
|
9222
|
+
const days = dateFns.differenceInCalendarDays(end, start) + 1;
|
|
9223
|
+
return `${days} dias`;
|
|
9224
|
+
}
|
|
9171
9225
|
function useCurrentTimeIndicatorAgenda(currentDate, view) {
|
|
9172
9226
|
const [currentTimePosition, setCurrentTimePosition] = React32.useState(0);
|
|
9173
9227
|
const [currentTimeVisible, setCurrentTimeVisible] = React32.useState(false);
|
|
@@ -9236,7 +9290,7 @@ function EventWrapper({
|
|
|
9236
9290
|
return void 0;
|
|
9237
9291
|
})();
|
|
9238
9292
|
const isEventInPast = displayEnd ? dateFns.isPast(displayEnd) : false;
|
|
9239
|
-
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 ";
|
|
9293
|
+
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 ";
|
|
9240
9294
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9241
9295
|
"button",
|
|
9242
9296
|
{
|
|
@@ -9281,7 +9335,7 @@ function EventItemAgenda({
|
|
|
9281
9335
|
const startDate = getEventStartDate(event);
|
|
9282
9336
|
const endDate = getEventEndDate(event);
|
|
9283
9337
|
const hasValidTime = !!startDate || !!endDate;
|
|
9284
|
-
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";
|
|
9338
|
+
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";
|
|
9285
9339
|
const displayStart = React32.useMemo(() => {
|
|
9286
9340
|
if (!hasValidTime) return void 0;
|
|
9287
9341
|
if (startDate) return currentTime || startDate;
|
|
@@ -9441,7 +9495,7 @@ function EventItemAgenda({
|
|
|
9441
9495
|
{
|
|
9442
9496
|
className: cn(
|
|
9443
9497
|
"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",
|
|
9444
|
-
getEventColorClassesAgenda(eventColor),
|
|
9498
|
+
getEventColorClassesAgenda(eventColor, event.id),
|
|
9445
9499
|
className
|
|
9446
9500
|
),
|
|
9447
9501
|
"aria-label": ariaLabel,
|
|
@@ -9687,21 +9741,38 @@ function DayViewAgenda({
|
|
|
9687
9741
|
const { currentTimePosition, currentTimeVisible } = useCurrentTimeIndicatorAgenda(currentDate, "day");
|
|
9688
9742
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "contents", "data-slot": "day-view", children: [
|
|
9689
9743
|
showAllDaySection && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-border/70 border-t bg-muted/50", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[3rem_1fr] sm:grid-cols-[4rem_1fr]", children: [
|
|
9690
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
9744
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative border-border/70 border-r flex items-center justify-center p-1", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-center text-[10px] text-muted-foreground/70 sm:text-xs", children: "Todo Dia" }) }),
|
|
9691
9745
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative border-border/70 border-r p-1 last:border-r-0", children: allDayEvents.map((event) => {
|
|
9692
9746
|
const eventStart = getEventStartDate(event);
|
|
9693
9747
|
const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
|
|
9694
9748
|
const isFirstDay = eventStart ? dateFns.isSameDay(currentDate, eventStart) : false;
|
|
9695
9749
|
const isLastDay = eventEnd ? dateFns.isSameDay(currentDate, eventEnd) : false;
|
|
9696
9750
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9697
|
-
|
|
9751
|
+
TooltipProviderBase,
|
|
9698
9752
|
{
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9753
|
+
delayDuration: 400,
|
|
9754
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
9755
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9756
|
+
EventItemAgenda,
|
|
9757
|
+
{
|
|
9758
|
+
event,
|
|
9759
|
+
isFirstDay,
|
|
9760
|
+
isLastDay,
|
|
9761
|
+
onClick: (e) => handleEventClick(event, e),
|
|
9762
|
+
view: "month",
|
|
9763
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: event.title })
|
|
9764
|
+
}
|
|
9765
|
+
) }) }),
|
|
9766
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TooltipContentBase, { side: "top", children: [
|
|
9767
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
9768
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
9769
|
+
event.location && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center gap-1", children: [
|
|
9770
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.MapPinIcon, { size: 14 }),
|
|
9771
|
+
" ",
|
|
9772
|
+
event.location
|
|
9773
|
+
] })
|
|
9774
|
+
] })
|
|
9775
|
+
] })
|
|
9705
9776
|
},
|
|
9706
9777
|
`spanning-${event.id}`
|
|
9707
9778
|
);
|
|
@@ -9734,17 +9805,37 @@ function DayViewAgenda({
|
|
|
9734
9805
|
width: `${positionedEvent.width * 100}%`,
|
|
9735
9806
|
zIndex: positionedEvent.zIndex
|
|
9736
9807
|
},
|
|
9737
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9808
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { delayDuration: 400, children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
9809
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9810
|
+
EventItemAgenda,
|
|
9811
|
+
{
|
|
9812
|
+
event: evt,
|
|
9813
|
+
view: "day",
|
|
9814
|
+
isFirstDay,
|
|
9815
|
+
isLastDay,
|
|
9816
|
+
onClick: (e) => handleEventClick(evt, e),
|
|
9817
|
+
showTime: true
|
|
9818
|
+
}
|
|
9819
|
+
) }) }),
|
|
9820
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9821
|
+
TooltipContentBase,
|
|
9822
|
+
{
|
|
9823
|
+
side: "top",
|
|
9824
|
+
sideOffset: 6,
|
|
9825
|
+
className: "max-w-[220px] space-y-0.5",
|
|
9826
|
+
children: [
|
|
9827
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold text-sm leading-snug", children: evt.title }),
|
|
9828
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs opacity-90", children: formatDurationAgenda(evt) }),
|
|
9829
|
+
evt.location && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs flex items-center gap-2", children: [
|
|
9830
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.MapPinIcon, { size: 15 }),
|
|
9831
|
+
" ",
|
|
9832
|
+
evt.location
|
|
9833
|
+
] }),
|
|
9834
|
+
evt.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs opacity-75 line-clamp-2", children: evt.description })
|
|
9835
|
+
]
|
|
9836
|
+
}
|
|
9837
|
+
)
|
|
9838
|
+
] }) })
|
|
9748
9839
|
},
|
|
9749
9840
|
positionedEvent.event.id
|
|
9750
9841
|
);
|
|
@@ -10038,7 +10129,8 @@ function EventAgenda({
|
|
|
10038
10129
|
className,
|
|
10039
10130
|
initialView = "month",
|
|
10040
10131
|
initialDate,
|
|
10041
|
-
onClick
|
|
10132
|
+
onClick,
|
|
10133
|
+
showYearView = false
|
|
10042
10134
|
}) {
|
|
10043
10135
|
const [currentDate, setCurrentDate] = React32.useState(
|
|
10044
10136
|
initialDate && new Date(initialDate) || /* @__PURE__ */ new Date()
|
|
@@ -10051,6 +10143,7 @@ function EventAgenda({
|
|
|
10051
10143
|
else if (view === "day") setCurrentDate((d) => dateFns.addDays(d, -1));
|
|
10052
10144
|
else if (view === "agenda")
|
|
10053
10145
|
setCurrentDate((d) => dateFns.addDays(d, -AgendaDaysToShowAgenda));
|
|
10146
|
+
else if (view === "year") setCurrentDate((d) => dateFns.subYears(d, 1));
|
|
10054
10147
|
};
|
|
10055
10148
|
const goNext = () => {
|
|
10056
10149
|
if (view === "month") setCurrentDate((d) => dateFns.addMonths(d, 1));
|
|
@@ -10058,6 +10151,7 @@ function EventAgenda({
|
|
|
10058
10151
|
else if (view === "day") setCurrentDate((d) => dateFns.addDays(d, 1));
|
|
10059
10152
|
else if (view === "agenda")
|
|
10060
10153
|
setCurrentDate((d) => dateFns.addDays(d, AgendaDaysToShowAgenda));
|
|
10154
|
+
else if (view === "year") setCurrentDate((d) => dateFns.addYears(d, 1));
|
|
10061
10155
|
};
|
|
10062
10156
|
const handleEventSelect = (event, e) => {
|
|
10063
10157
|
try {
|
|
@@ -10095,7 +10189,8 @@ function EventAgenda({
|
|
|
10095
10189
|
month: { full: "M\xEAs", short: "M" },
|
|
10096
10190
|
week: { full: "Semana", short: "S" },
|
|
10097
10191
|
day: { full: "Dia", short: "D" },
|
|
10098
|
-
agenda: { full: "Agenda", short: "A" }
|
|
10192
|
+
agenda: { full: "Agenda", short: "A" },
|
|
10193
|
+
year: { full: "Ano", short: "An" }
|
|
10099
10194
|
};
|
|
10100
10195
|
const entry = labels[v] || { full: v, short: v };
|
|
10101
10196
|
return condensed ? entry.short : entry.full;
|
|
@@ -10119,12 +10214,18 @@ function EventAgenda({
|
|
|
10119
10214
|
const start = currentDate;
|
|
10120
10215
|
return capitalize2(dateFns.format(start, "MMMM yyyy", { locale: locale.ptBR }));
|
|
10121
10216
|
}
|
|
10217
|
+
if (view === "year") {
|
|
10218
|
+
return dateFns.format(currentDate, "yyyy");
|
|
10219
|
+
}
|
|
10122
10220
|
return capitalize2(dateFns.format(currentDate, "MMMM yyyy", { locale: locale.ptBR }));
|
|
10123
10221
|
}, [currentDate, view]);
|
|
10124
|
-
const
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10222
|
+
const availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
|
|
10223
|
+
const selectItems = availableViews.map(
|
|
10224
|
+
(v) => ({
|
|
10225
|
+
label: viewLabel(v),
|
|
10226
|
+
value: v
|
|
10227
|
+
})
|
|
10228
|
+
);
|
|
10128
10229
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10129
10230
|
"div",
|
|
10130
10231
|
{
|
|
@@ -10179,46 +10280,51 @@ function EventAgenda({
|
|
|
10179
10280
|
}
|
|
10180
10281
|
) })
|
|
10181
10282
|
] }),
|
|
10182
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10183
|
-
"
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10283
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col transition-all duration-200 ease-in-out", children: [
|
|
10284
|
+
view === "month" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10285
|
+
MonthViewAgenda,
|
|
10286
|
+
{
|
|
10287
|
+
currentDate,
|
|
10288
|
+
events,
|
|
10289
|
+
onEventSelect: handleEventSelect
|
|
10290
|
+
}
|
|
10291
|
+
),
|
|
10292
|
+
view === "week" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10293
|
+
WeekViewAgenda,
|
|
10294
|
+
{
|
|
10295
|
+
currentDate,
|
|
10296
|
+
events,
|
|
10297
|
+
onEventSelect: handleEventSelect
|
|
10298
|
+
}
|
|
10299
|
+
),
|
|
10300
|
+
view === "day" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10301
|
+
DayViewAgenda,
|
|
10302
|
+
{
|
|
10303
|
+
currentDate,
|
|
10304
|
+
events,
|
|
10305
|
+
onEventSelect: handleEventSelect
|
|
10306
|
+
}
|
|
10307
|
+
),
|
|
10308
|
+
view === "agenda" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10309
|
+
Agenda,
|
|
10310
|
+
{
|
|
10311
|
+
currentDate,
|
|
10312
|
+
events,
|
|
10313
|
+
onEventSelect: handleEventSelect
|
|
10314
|
+
}
|
|
10315
|
+
),
|
|
10316
|
+
view === "year" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10317
|
+
YearViewAgenda,
|
|
10318
|
+
{
|
|
10319
|
+
currentDate,
|
|
10320
|
+
events,
|
|
10321
|
+
onMonthSelect: (monthDate) => {
|
|
10322
|
+
setCurrentDate(monthDate);
|
|
10323
|
+
setView("month");
|
|
10324
|
+
}
|
|
10325
|
+
}
|
|
10326
|
+
)
|
|
10327
|
+
] })
|
|
10222
10328
|
] }),
|
|
10223
10329
|
selectedEvent && React32__namespace.default.isValidElement(onClick) ? React32__namespace.default.cloneElement(onClick, {
|
|
10224
10330
|
event: selectedEvent,
|
|
@@ -10293,11 +10399,13 @@ function useEventVisibilityAgenda({
|
|
|
10293
10399
|
const getVisibleEventCount = React32.useMemo(() => {
|
|
10294
10400
|
return (totalEvents) => {
|
|
10295
10401
|
if (!contentHeight) return totalEvents;
|
|
10296
|
-
const
|
|
10297
|
-
|
|
10402
|
+
const availableHeight = contentHeight + eventGap + 4;
|
|
10403
|
+
const slotHeight = eventHeight + eventGap;
|
|
10404
|
+
const maxSlots = Math.floor(availableHeight / slotHeight);
|
|
10405
|
+
if (totalEvents <= maxSlots) {
|
|
10298
10406
|
return totalEvents;
|
|
10299
10407
|
}
|
|
10300
|
-
return
|
|
10408
|
+
return maxSlots > 0 ? maxSlots - 1 : 0;
|
|
10301
10409
|
};
|
|
10302
10410
|
}, [contentHeight, eventHeight, eventGap]);
|
|
10303
10411
|
return {
|
|
@@ -10369,17 +10477,6 @@ function computeMultiDayBars(events, weekDays) {
|
|
|
10369
10477
|
}
|
|
10370
10478
|
return bars;
|
|
10371
10479
|
}
|
|
10372
|
-
function formatDuration(event) {
|
|
10373
|
-
const start = getEventStartDate(event);
|
|
10374
|
-
const end = getEventEndDate(event);
|
|
10375
|
-
if (!start) return "";
|
|
10376
|
-
const fmt = (d) => dateFns.format(d, "d 'de' MMM", { locale: locale.ptBR });
|
|
10377
|
-
if (!end || dateFns.isSameDay(start, end)) {
|
|
10378
|
-
return fmt(start) + (event.allDay ? " \xB7 Dia todo" : " \xB7 " + dateFns.format(start, "HH:mm"));
|
|
10379
|
-
}
|
|
10380
|
-
const days = dateFns.differenceInCalendarDays(end, start) + 1;
|
|
10381
|
-
return `${fmt(start)} \u2192 ${fmt(end)} \xB7 ${days} dias`;
|
|
10382
|
-
}
|
|
10383
10480
|
function MultiDayOverlay({
|
|
10384
10481
|
bars,
|
|
10385
10482
|
weekIndex,
|
|
@@ -10402,7 +10499,7 @@ function MultiDayOverlay({
|
|
|
10402
10499
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10403
10500
|
"div",
|
|
10404
10501
|
{
|
|
10405
|
-
className: "absolute pointer-events-auto px-
|
|
10502
|
+
className: "absolute pointer-events-auto px-[5px]",
|
|
10406
10503
|
style: {
|
|
10407
10504
|
left: continuesFromPrev ? `${colStart / 7 * 100}%` : `calc(${colStart / 7 * 100}% + 3px)`,
|
|
10408
10505
|
right: continuesToNext ? `${100 - (colStart + colSpan) / 7 * 100}%` : `calc(${100 - (colStart + colSpan) / 7 * 100}% + 3px)`,
|
|
@@ -10422,7 +10519,10 @@ function MultiDayOverlay({
|
|
|
10422
10519
|
onEventSelect(event, e);
|
|
10423
10520
|
},
|
|
10424
10521
|
view: "month",
|
|
10425
|
-
className: cn(
|
|
10522
|
+
className: cn(
|
|
10523
|
+
"w-full",
|
|
10524
|
+
isHovered && "[filter:brightness(0.92)]"
|
|
10525
|
+
),
|
|
10426
10526
|
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-0.5 w-full min-w-0", children: [
|
|
10427
10527
|
continuesFromPrev && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 opacity-50 leading-none mr-0.5 flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(react.CaretLeftIcon, { size: 10, weight: "bold" }) }),
|
|
10428
10528
|
!event.allDay && isFirstDay && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-normal opacity-75 text-[10px] bg-white/15 px-1 py-0.5 rounded-full leading-none", children: dateFns.format(eventStart, "HH:mm") }),
|
|
@@ -10446,7 +10546,7 @@ function MultiDayOverlay({
|
|
|
10446
10546
|
) }),
|
|
10447
10547
|
/* @__PURE__ */ jsxRuntime.jsxs(TooltipContentBase, { side: "top", children: [
|
|
10448
10548
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
10449
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children:
|
|
10549
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
10450
10550
|
event.location && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px]", children: [
|
|
10451
10551
|
/* @__PURE__ */ jsxRuntime.jsx(react.MapPinIcon, { size: 15 }),
|
|
10452
10552
|
" ",
|
|
@@ -10622,7 +10722,7 @@ function MonthViewAgenda({
|
|
|
10622
10722
|
"div",
|
|
10623
10723
|
{
|
|
10624
10724
|
ref: isReferenceCell ? contentRef : null,
|
|
10625
|
-
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-
|
|
10725
|
+
className: "flex-1 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-1",
|
|
10626
10726
|
children: [
|
|
10627
10727
|
Array.from({ length: dayMultiDayRowCount }).map(
|
|
10628
10728
|
(_, si) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10644,20 +10744,31 @@ function MonthViewAgenda({
|
|
|
10644
10744
|
{
|
|
10645
10745
|
"aria-hidden": isHidden ? "true" : void 0,
|
|
10646
10746
|
className: "aria-hidden:hidden",
|
|
10647
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10747
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { delayDuration: 400, children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
10748
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10749
|
+
EventItemAgenda,
|
|
10750
|
+
{
|
|
10751
|
+
event,
|
|
10752
|
+
isFirstDay: true,
|
|
10753
|
+
isLastDay: true,
|
|
10754
|
+
onClick: (e) => handleEventClick(event, e),
|
|
10755
|
+
view: "month",
|
|
10756
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1 sm:gap-1.5 truncate text-[11px] relative z-10", children: [
|
|
10757
|
+
!event.allDay && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: dateFns.format(eventStart, "HH:mm") }),
|
|
10758
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold truncate", children: event.title })
|
|
10759
|
+
] })
|
|
10760
|
+
}
|
|
10761
|
+
) }) }),
|
|
10762
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TooltipContentBase, { side: "top", children: [
|
|
10763
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
10764
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
10765
|
+
event.location && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center gap-1", children: [
|
|
10766
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.MapPinIcon, { size: 14 }),
|
|
10767
|
+
" ",
|
|
10768
|
+
event.location
|
|
10658
10769
|
] })
|
|
10659
|
-
}
|
|
10660
|
-
)
|
|
10770
|
+
] })
|
|
10771
|
+
] }) })
|
|
10661
10772
|
},
|
|
10662
10773
|
event.id
|
|
10663
10774
|
);
|
|
@@ -10672,7 +10783,7 @@ function MonthViewAgenda({
|
|
|
10672
10783
|
type: "button",
|
|
10673
10784
|
onClick: (e) => e.stopPropagation(),
|
|
10674
10785
|
"aria-label": `Mostrar mais ${remainingCount} eventos`,
|
|
10675
|
-
className: "mt-
|
|
10786
|
+
className: "mt-auto 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",
|
|
10676
10787
|
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-semibold", children: [
|
|
10677
10788
|
"+ ",
|
|
10678
10789
|
remainingCount,
|
|
@@ -11015,7 +11126,7 @@ function WeekViewAgenda({
|
|
|
11015
11126
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col overflow-hidden", "data-slot": "week-view", children: [
|
|
11016
11127
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-[600px] sm:min-w-full flex flex-col h-full", children: [
|
|
11017
11128
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sticky top-0 z-30 grid grid-cols-8 border-border/70 border-b bg-background", children: [
|
|
11018
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2 text-center text-muted-foreground/70 text-[10px] sm:text-sm", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
11129
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2 text-center text-muted-foreground/70 text-[10px] sm:text-sm", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "", children: "Hor\xE1rios" }) }),
|
|
11019
11130
|
days.map((day) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11020
11131
|
"div",
|
|
11021
11132
|
{
|
|
@@ -11028,7 +11139,7 @@ function WeekViewAgenda({
|
|
|
11028
11139
|
dateFns.format(day, "d", { locale: locale.ptBR })
|
|
11029
11140
|
] }),
|
|
11030
11141
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline md:hidden", children: dateFns.format(day, "EEE d", { locale: locale.ptBR }) }),
|
|
11031
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
11142
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden md:inline", children: dateFns.format(day, "EEE dd", { locale: locale.ptBR }) })
|
|
11032
11143
|
]
|
|
11033
11144
|
},
|
|
11034
11145
|
day.toString()
|
|
@@ -11036,7 +11147,7 @@ function WeekViewAgenda({
|
|
|
11036
11147
|
] }),
|
|
11037
11148
|
showAllDaySection && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-border/70 border-b bg-muted/50", children: [
|
|
11038
11149
|
trueAllDayEvents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-8", children: [
|
|
11039
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
11150
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative border-border/70 border-r flex items-center justify-center p-1", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-center text-[10px] text-muted-foreground/70 sm:text-xs", children: "Todo dia" }) }),
|
|
11040
11151
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11041
11152
|
"div",
|
|
11042
11153
|
{
|
|
@@ -11061,38 +11172,48 @@ function WeekViewAgenda({
|
|
|
11061
11172
|
slot
|
|
11062
11173
|
} = bar;
|
|
11063
11174
|
const showTitle = isFirstDay || !isFirstDay && colStart === 0;
|
|
11064
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
e
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11175
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { delayDuration: 400, children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
11176
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11177
|
+
"div",
|
|
11178
|
+
{
|
|
11179
|
+
className: "absolute px-0.5",
|
|
11180
|
+
style: {
|
|
11181
|
+
left: `calc(${colStart / 7 * 100}% + 2px)`,
|
|
11182
|
+
width: `calc(${colSpan / 7 * 100}% - 4px)`,
|
|
11183
|
+
top: EventGapAgenda + slot * rowH,
|
|
11184
|
+
height: EventHeightAgenda
|
|
11185
|
+
},
|
|
11186
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11187
|
+
EventItemAgenda,
|
|
11188
|
+
{
|
|
11189
|
+
event,
|
|
11190
|
+
isFirstDay,
|
|
11191
|
+
isLastDay,
|
|
11192
|
+
onClick: (e) => {
|
|
11193
|
+
e.stopPropagation();
|
|
11194
|
+
handleEventClick(event, e);
|
|
11195
|
+
},
|
|
11196
|
+
view: "month",
|
|
11197
|
+
className: "h-full",
|
|
11198
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1 min-w-0 w-full", children: [
|
|
11199
|
+
!isFirstDay && colStart === 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsxRuntime.jsx(ssr.CaretLeftIcon, {}) }),
|
|
11200
|
+
showTitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs font-medium", children: event.title }),
|
|
11201
|
+
!isLastDay && colStart + colSpan === 7 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 ml-auto text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsxRuntime.jsx(ssr.CaretRightIcon, {}) })
|
|
11202
|
+
] })
|
|
11203
|
+
}
|
|
11204
|
+
)
|
|
11205
|
+
}
|
|
11206
|
+
) }),
|
|
11207
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TooltipContentBase, { side: "top", children: [
|
|
11208
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
11209
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
11210
|
+
event.location && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center gap-1", children: [
|
|
11211
|
+
/* @__PURE__ */ jsxRuntime.jsx(ssr.MapPinIcon, { size: 14 }),
|
|
11212
|
+
" ",
|
|
11213
|
+
event.location
|
|
11214
|
+
] })
|
|
11215
|
+
] })
|
|
11216
|
+
] }) }, event.id);
|
|
11096
11217
|
})
|
|
11097
11218
|
]
|
|
11098
11219
|
}
|
|
@@ -11106,7 +11227,7 @@ function WeekViewAgenda({
|
|
|
11106
11227
|
trueAllDayEvents.length > 0 && "border-t border-border/40"
|
|
11107
11228
|
),
|
|
11108
11229
|
children: [
|
|
11109
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
11230
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative border-border/70 border-r flex items-center justify-center p-1", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-center text-[10px] text-muted-foreground/70 sm:text-xs", children: "Evento" }) }),
|
|
11110
11231
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11111
11232
|
"div",
|
|
11112
11233
|
{
|
|
@@ -11132,54 +11253,64 @@ function WeekViewAgenda({
|
|
|
11132
11253
|
} = bar;
|
|
11133
11254
|
const eventStart = getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
11134
11255
|
const showTitle = isFirstDay || !isFirstDay && colStart === 0;
|
|
11135
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
e
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11256
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { delayDuration: 400, children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
11257
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11258
|
+
"div",
|
|
11259
|
+
{
|
|
11260
|
+
className: "absolute px-0.5",
|
|
11261
|
+
style: {
|
|
11262
|
+
left: `calc(${colStart / 7 * 100}% + 2px)`,
|
|
11263
|
+
width: `calc(${colSpan / 7 * 100}% - 4px)`,
|
|
11264
|
+
top: EventGapAgenda + slot * rowH,
|
|
11265
|
+
height: EventHeightAgenda
|
|
11266
|
+
},
|
|
11267
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11268
|
+
EventItemAgenda,
|
|
11269
|
+
{
|
|
11270
|
+
event,
|
|
11271
|
+
isFirstDay,
|
|
11272
|
+
isLastDay,
|
|
11273
|
+
onClick: (e) => {
|
|
11274
|
+
e.stopPropagation();
|
|
11275
|
+
handleEventClick(event, e);
|
|
11276
|
+
},
|
|
11277
|
+
view: "month",
|
|
11278
|
+
className: "h-full border-dashed",
|
|
11279
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1 min-w-0 w-full", children: [
|
|
11280
|
+
!isFirstDay && colStart === 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsxRuntime.jsx(ssr.CaretLeftIcon, {}) }),
|
|
11281
|
+
showTitle && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11282
|
+
isFirstDay && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: dateFns.format(eventStart, "HH:mm") }),
|
|
11283
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs font-medium", children: event.title }),
|
|
11284
|
+
isFirstDay && (() => {
|
|
11285
|
+
const evStart = getEventStartDate(event);
|
|
11286
|
+
const evEnd = getEventEndDate(event);
|
|
11287
|
+
if (!evStart || !evEnd) return null;
|
|
11288
|
+
const d = Math.round(
|
|
11289
|
+
(evEnd.getTime() - evStart.getTime()) / 864e5
|
|
11290
|
+
) + 1;
|
|
11291
|
+
if (d < 2) return null;
|
|
11292
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "shrink-0 inline-flex items-end font-bold leading-none px-1 py-0.5 text-[10px]", children: [
|
|
11293
|
+
d,
|
|
11294
|
+
"d"
|
|
11295
|
+
] });
|
|
11296
|
+
})()
|
|
11297
|
+
] }),
|
|
11298
|
+
!isLastDay && colStart + colSpan === 7 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 ml-auto text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsxRuntime.jsx(ssr.CaretRightIcon, {}) })
|
|
11299
|
+
] })
|
|
11300
|
+
}
|
|
11301
|
+
)
|
|
11302
|
+
}
|
|
11303
|
+
) }),
|
|
11304
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TooltipContentBase, { side: "top", children: [
|
|
11305
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
11306
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
11307
|
+
event.location && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center gap-1", children: [
|
|
11308
|
+
/* @__PURE__ */ jsxRuntime.jsx(ssr.MapPinIcon, { size: 14 }),
|
|
11309
|
+
" ",
|
|
11310
|
+
event.location
|
|
11311
|
+
] })
|
|
11312
|
+
] })
|
|
11313
|
+
] }) }, event.id);
|
|
11183
11314
|
})
|
|
11184
11315
|
]
|
|
11185
11316
|
}
|
|
@@ -11204,9 +11335,7 @@ function WeekViewAgenda({
|
|
|
11204
11335
|
"data-today": dateFns.isToday(day) || void 0,
|
|
11205
11336
|
children: [
|
|
11206
11337
|
(processedDayEvents[dayIndex] ?? []).map((positionedEvent) => {
|
|
11207
|
-
const
|
|
11208
|
-
const evEnd = getEventEndDate(positionedEvent.event);
|
|
11209
|
-
const timeLabel = evStart ? evEnd ? `${dateFns.format(evStart, "HH:mm")} \u2013 ${dateFns.format(evEnd, "HH:mm")}` : dateFns.format(evStart, "HH:mm") : void 0;
|
|
11338
|
+
const timeLabel = formatDurationAgenda(positionedEvent.event);
|
|
11210
11339
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { delayDuration: 250, children: [
|
|
11211
11340
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11212
11341
|
"div",
|
|
@@ -11242,7 +11371,7 @@ function WeekViewAgenda({
|
|
|
11242
11371
|
className: "max-w-[220px] space-y-0.5",
|
|
11243
11372
|
children: [
|
|
11244
11373
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold text-sm leading-snug", children: positionedEvent.event.title }),
|
|
11245
|
-
|
|
11374
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs opacity-90", children: timeLabel }),
|
|
11246
11375
|
positionedEvent.event.location && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs flex items-center gap-2", children: [
|
|
11247
11376
|
/* @__PURE__ */ jsxRuntime.jsx(ssr.MapPinIcon, { size: 15 }),
|
|
11248
11377
|
" ",
|
|
@@ -11317,25 +11446,105 @@ function WeekViewAgenda({
|
|
|
11317
11446
|
)
|
|
11318
11447
|
] });
|
|
11319
11448
|
}
|
|
11449
|
+
function YearViewAgenda({
|
|
11450
|
+
currentDate,
|
|
11451
|
+
events,
|
|
11452
|
+
onMonthSelect
|
|
11453
|
+
}) {
|
|
11454
|
+
const start = dateFns.startOfYear(currentDate);
|
|
11455
|
+
const end = dateFns.endOfYear(currentDate);
|
|
11456
|
+
const months = React32.useMemo(() => {
|
|
11457
|
+
return dateFns.eachMonthOfInterval({ start, end });
|
|
11458
|
+
}, [start, end]);
|
|
11459
|
+
const eventDates = React32.useMemo(() => {
|
|
11460
|
+
return new Set(
|
|
11461
|
+
events.map((e) => getEventStartDate(e)).filter((d) => !!d).map((d) => dateFns.format(d, "yyyy-MM-dd"))
|
|
11462
|
+
);
|
|
11463
|
+
}, [events]);
|
|
11464
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-1 overflow-y-auto max-h-[calc(100vh-200px)] lg:max-h-[750px] scrollbar-thin scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent", children: months.map((month) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11465
|
+
"div",
|
|
11466
|
+
{
|
|
11467
|
+
className: "flex flex-col p-4 rounded-lg border border-border/70 bg-card hover:bg-muted/5 transition-colors cursor-pointer group",
|
|
11468
|
+
onClick: () => onMonthSelect(month),
|
|
11469
|
+
children: [
|
|
11470
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
11471
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-sm capitalize text-foreground group-hover:text-primary transition-colors", children: dateFns.format(month, "MMMM", { locale: locale.ptBR }) }),
|
|
11472
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground/50 uppercase tracking-wider opacity-0 group-hover:opacity-100 transition-opacity", children: "Detalhes" })
|
|
11473
|
+
] }),
|
|
11474
|
+
/* @__PURE__ */ jsxRuntime.jsx(MonthMiniGrid, { month, eventDates })
|
|
11475
|
+
]
|
|
11476
|
+
},
|
|
11477
|
+
month.toString()
|
|
11478
|
+
)) });
|
|
11479
|
+
}
|
|
11480
|
+
function MonthMiniGrid({
|
|
11481
|
+
month,
|
|
11482
|
+
eventDates
|
|
11483
|
+
}) {
|
|
11484
|
+
const days = React32.useMemo(() => {
|
|
11485
|
+
const monthStart = dateFns.startOfMonth(month);
|
|
11486
|
+
const calendarStart = dateFns.startOfWeek(monthStart, { weekStartsOn: 0 });
|
|
11487
|
+
const daysArr = [];
|
|
11488
|
+
const curr = new Date(calendarStart);
|
|
11489
|
+
for (let i = 0; i < 42; i++) {
|
|
11490
|
+
daysArr.push(new Date(curr));
|
|
11491
|
+
curr.setDate(curr.getDate() + 1);
|
|
11492
|
+
}
|
|
11493
|
+
return daysArr;
|
|
11494
|
+
}, [month]);
|
|
11495
|
+
const weekdays = ["D", "S", "T", "Q", "Q", "S", "S"];
|
|
11496
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-7 gap-y-1 text-[11px]", children: [
|
|
11497
|
+
weekdays.map((wd, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11498
|
+
"div",
|
|
11499
|
+
{
|
|
11500
|
+
className: "text-center font-medium text-muted-foreground/70 py-1",
|
|
11501
|
+
children: wd
|
|
11502
|
+
},
|
|
11503
|
+
`${wd}-${i}`
|
|
11504
|
+
)),
|
|
11505
|
+
days.map((day) => {
|
|
11506
|
+
const isCurrentMonth = day.getMonth() === month.getMonth();
|
|
11507
|
+
const dateStr = dateFns.format(day, "yyyy-MM-dd");
|
|
11508
|
+
const hasEvent = eventDates.has(dateStr);
|
|
11509
|
+
const isDayToday = dateFns.isToday(day);
|
|
11510
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11511
|
+
"div",
|
|
11512
|
+
{
|
|
11513
|
+
className: cn(
|
|
11514
|
+
"relative flex items-center justify-center p-1 rounded-sm aspect-square transition-colors",
|
|
11515
|
+
!isCurrentMonth && "opacity-0 pointer-events-none",
|
|
11516
|
+
isDayToday && "bg-blue-500 text-white font-semibold rounded-lg",
|
|
11517
|
+
isCurrentMonth && !isDayToday && "hover:bg-muted/50 text-foreground"
|
|
11518
|
+
),
|
|
11519
|
+
children: [
|
|
11520
|
+
isCurrentMonth && dateFns.format(day, "d"),
|
|
11521
|
+
isCurrentMonth && hasEvent && !isDayToday && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-0.5 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-blue-500" })
|
|
11522
|
+
]
|
|
11523
|
+
},
|
|
11524
|
+
day.toString()
|
|
11525
|
+
);
|
|
11526
|
+
})
|
|
11527
|
+
] });
|
|
11528
|
+
}
|
|
11320
11529
|
var colorBannerMap = {
|
|
11321
|
-
sky: "from-sky-400
|
|
11322
|
-
amber: "from-amber-400
|
|
11323
|
-
violet: "from-violet-400
|
|
11324
|
-
rose: "from-rose-400
|
|
11325
|
-
emerald: "from-emerald-400
|
|
11326
|
-
orange: "from-orange-400
|
|
11327
|
-
green: "from-green-400
|
|
11328
|
-
blue: "from-blue-400
|
|
11329
|
-
red: "from-red-400
|
|
11330
|
-
purple: "from-purple-400
|
|
11331
|
-
indigo: "from-indigo-400
|
|
11332
|
-
teal: "from-teal-400
|
|
11333
|
-
pink: "from-pink-400
|
|
11334
|
-
cyan: "from-cyan-400
|
|
11335
|
-
lime: "from-lime-400
|
|
11336
|
-
fuchsia: "from-fuchsia-400
|
|
11530
|
+
sky: "from-sky-400 via-sky-500 to-cyan-500",
|
|
11531
|
+
amber: "from-amber-400 via-amber-500 to-orange-400",
|
|
11532
|
+
violet: "from-violet-400 via-violet-500 to-purple-600",
|
|
11533
|
+
rose: "from-rose-400 via-rose-500 to-pink-500",
|
|
11534
|
+
emerald: "from-emerald-400 via-emerald-500 to-teal-500",
|
|
11535
|
+
orange: "from-orange-400 via-orange-500 to-amber-500",
|
|
11536
|
+
green: "from-green-400 via-green-500 to-emerald-500",
|
|
11537
|
+
blue: "from-blue-400 via-blue-500 to-indigo-500",
|
|
11538
|
+
red: "from-red-400 via-red-500 to-rose-500",
|
|
11539
|
+
purple: "from-purple-400 via-purple-500 to-violet-600",
|
|
11540
|
+
indigo: "from-indigo-400 via-indigo-500 to-blue-600",
|
|
11541
|
+
teal: "from-teal-400 via-teal-500 to-cyan-500",
|
|
11542
|
+
pink: "from-pink-400 via-pink-500 to-rose-400",
|
|
11543
|
+
cyan: "from-cyan-400 via-cyan-500 to-sky-500",
|
|
11544
|
+
lime: "from-lime-400 via-lime-500 to-green-500",
|
|
11545
|
+
fuchsia: "from-fuchsia-400 via-fuchsia-500 to-purple-500"
|
|
11337
11546
|
};
|
|
11338
|
-
function
|
|
11547
|
+
function formatDuration(minutes) {
|
|
11339
11548
|
if (minutes <= 0) return "";
|
|
11340
11549
|
const h = Math.floor(minutes / 60);
|
|
11341
11550
|
const m = minutes % 60;
|
|
@@ -11355,7 +11564,7 @@ function EventDetailModalAgenda({
|
|
|
11355
11564
|
}) {
|
|
11356
11565
|
const [open, setOpen] = React32.useState(true);
|
|
11357
11566
|
if (!event) return null;
|
|
11358
|
-
const color = event.color ??
|
|
11567
|
+
const color = event.color ?? getAutoColorAgenda(event.id);
|
|
11359
11568
|
const bannerGradient = colorBannerMap[color] ?? colorBannerMap.sky;
|
|
11360
11569
|
const startDate = getEventStartDate(event);
|
|
11361
11570
|
const endDate = getEventEndDate(event);
|
|
@@ -11400,83 +11609,60 @@ function EventDetailModalAgenda({
|
|
|
11400
11609
|
setOpen(v);
|
|
11401
11610
|
if (!v) onClose?.();
|
|
11402
11611
|
},
|
|
11403
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContentBase, { className: "p-0 overflow-hidden gap-0 border-none shadow-
|
|
11612
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContentBase, { className: "p-0 overflow-hidden gap-0 border-none shadow-2xl sm:max-w-md rounded-2xl", children: [
|
|
11404
11613
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11405
11614
|
"div",
|
|
11406
11615
|
{
|
|
11407
11616
|
className: cn(
|
|
11408
|
-
"relative bg-gradient-to-
|
|
11617
|
+
"relative bg-gradient-to-br w-full flex flex-col justify-end px-7 pt-14 pb-7 select-none overflow-hidden",
|
|
11409
11618
|
bannerGradient
|
|
11410
11619
|
),
|
|
11411
11620
|
children: [
|
|
11412
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
11413
|
-
|
|
11621
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-br from-white/20 via-transparent to-black/10" }),
|
|
11622
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-4 left-5 flex items-center gap-2 z-10", children: dateSection.isAllDay ? /* @__PURE__ */ jsxRuntime.jsxs(Badge, { className: "bg-black/20 text-white border border-white/20 backdrop-blur-sm shadow-none gap-1 text-[11px] font-medium", children: [
|
|
11623
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.SunIcon, { size: 11, weight: "bold" }),
|
|
11414
11624
|
"Dia todo"
|
|
11415
|
-
] }) : isMultiDay ? /* @__PURE__ */ jsxRuntime.jsxs(Badge, { className: "bg-
|
|
11416
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.CalendarDotsIcon, { size:
|
|
11417
|
-
|
|
11418
|
-
] }) : durationMinutes > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(Badge, { className: "bg-
|
|
11419
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.ClockIcon, { size:
|
|
11420
|
-
|
|
11625
|
+
] }) : isMultiDay ? /* @__PURE__ */ jsxRuntime.jsxs(Badge, { className: "bg-black/20 text-white border border-white/20 backdrop-blur-sm shadow-none gap-1 text-[11px] font-medium", children: [
|
|
11626
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.CalendarDotsIcon, { size: 11, weight: "bold" }),
|
|
11627
|
+
formatDurationAgendaDays(event)
|
|
11628
|
+
] }) : durationMinutes > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(Badge, { className: "bg-black/20 text-white border border-white/20 backdrop-blur-sm shadow-none gap-1 text-[11px] font-medium", children: [
|
|
11629
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.ClockIcon, { size: 11, weight: "bold" }),
|
|
11630
|
+
formatDuration(durationMinutes)
|
|
11421
11631
|
] }) : null }),
|
|
11422
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl sm:text-
|
|
11632
|
+
/* @__PURE__ */ jsxRuntime.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 })
|
|
11423
11633
|
]
|
|
11424
11634
|
}
|
|
11425
11635
|
),
|
|
11426
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col
|
|
11427
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-4", children: [
|
|
11428
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 rounded-
|
|
11429
|
-
|
|
11430
|
-
{
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
className: "text-
|
|
11434
|
-
}
|
|
11435
|
-
) }),
|
|
11436
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
11437
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-foreground leading-none", children: dateSection.primary }),
|
|
11438
|
-
dateSection.secondary && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 text-sm text-muted-foreground mt-0.5", children: isMultiDay && !event.allDay || isMultiDay && dateSection.isAllDay ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11439
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11440
|
-
react.ArrowRightIcon,
|
|
11441
|
-
{
|
|
11442
|
-
size: 12,
|
|
11443
|
-
className: "shrink-0 opacity-70"
|
|
11444
|
-
}
|
|
11445
|
-
),
|
|
11446
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: dateSection.secondary })
|
|
11447
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground/70", children: dateSection.secondary }) })
|
|
11636
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col px-7 py-6 bg-background", children: [
|
|
11637
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-4 py-4", children: [
|
|
11638
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(react.CalendarDotsIcon, { size: 18, weight: "duotone", className: "text-primary" }) }),
|
|
11639
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
11640
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground leading-snug", children: dateSection.primary }),
|
|
11641
|
+
dateSection.secondary && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 mt-0.5", children: isMultiDay && !event.allDay || isMultiDay && dateSection.isAllDay ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11642
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.ArrowRightIcon, { size: 11, className: "shrink-0 text-muted-foreground/60" }),
|
|
11643
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12px] font-medium text-muted-foreground", children: dateSection.secondary })
|
|
11644
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12px] font-medium text-muted-foreground", children: dateSection.secondary }) })
|
|
11448
11645
|
] })
|
|
11449
11646
|
] }),
|
|
11450
|
-
/* @__PURE__ */ jsxRuntime.jsx(SeparatorBase, { className: "opacity-
|
|
11451
|
-
event.location && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11452
|
-
/* @__PURE__ */ jsxRuntime.
|
|
11453
|
-
react.MapPinIcon,
|
|
11454
|
-
{
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
11461
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Localiza\xE7\xE3o" }),
|
|
11462
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-foreground font-medium", children: event.location })
|
|
11463
|
-
] })
|
|
11647
|
+
(event.location || event.description) && /* @__PURE__ */ jsxRuntime.jsx(SeparatorBase, { className: "opacity-40" }),
|
|
11648
|
+
event.location && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11649
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-4 py-4", children: [
|
|
11650
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(react.MapPinIcon, { size: 18, weight: "duotone", className: "text-primary" }) }),
|
|
11651
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
11652
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium uppercase tracking-widest text-muted-foreground/60", children: "Localiza\xE7\xE3o" }),
|
|
11653
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-medium text-foreground leading-snug", children: event.location })
|
|
11654
|
+
] })
|
|
11655
|
+
] }),
|
|
11656
|
+
event.description && /* @__PURE__ */ jsxRuntime.jsx(SeparatorBase, { className: "opacity-40" })
|
|
11464
11657
|
] }),
|
|
11465
|
-
event.description && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-4", children: [
|
|
11466
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 rounded-
|
|
11467
|
-
|
|
11468
|
-
{
|
|
11469
|
-
|
|
11470
|
-
weight: "duotone",
|
|
11471
|
-
className: "text-primary"
|
|
11472
|
-
}
|
|
11473
|
-
) }),
|
|
11474
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
11475
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Descri\xE7\xE3o" }),
|
|
11476
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground leading-relaxed font-normal", children: event.description })
|
|
11658
|
+
event.description && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-4 py-4", children: [
|
|
11659
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(react.AlignLeftIcon, { size: 18, weight: "duotone", className: "text-primary" }) }),
|
|
11660
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
11661
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium uppercase tracking-widest text-muted-foreground/60", children: "Descri\xE7\xE3o" }),
|
|
11662
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[13px] text-muted-foreground leading-relaxed font-normal", children: event.description })
|
|
11477
11663
|
] })
|
|
11478
11664
|
] }),
|
|
11479
|
-
!event.location && !event.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-
|
|
11665
|
+
!event.location && !event.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-4 text-[11px] text-muted-foreground/40 italic text-center", children: "Nenhum detalhe adicional dispon\xEDvel." })
|
|
11480
11666
|
] })
|
|
11481
11667
|
] })
|
|
11482
11668
|
}
|
|
@@ -14713,8 +14899,8 @@ var createValueFormatter = (customFormatter, formatBR) => {
|
|
|
14713
14899
|
});
|
|
14714
14900
|
const prefixFormats = ["R$", "$", "\u20AC", "\xA3"];
|
|
14715
14901
|
const suffixFormats = ["%", "kg", "km", "m", "L", "un", "t", "h", "min", "s"];
|
|
14716
|
-
const getFormattedValue = (baseValue,
|
|
14717
|
-
const trimmedFormat =
|
|
14902
|
+
const getFormattedValue = (baseValue, format21) => {
|
|
14903
|
+
const trimmedFormat = format21.trim();
|
|
14718
14904
|
if (prefixFormats.includes(trimmedFormat)) {
|
|
14719
14905
|
return `${trimmedFormat} ${baseValue}`;
|
|
14720
14906
|
}
|
|
@@ -14739,8 +14925,8 @@ var createValueFormatter = (customFormatter, formatBR) => {
|
|
|
14739
14925
|
num = Number.isNaN(parsed) ? NaN : parsed;
|
|
14740
14926
|
}
|
|
14741
14927
|
const baseFormatted = formatBR && !Number.isNaN(num) ? nf.format(num) : String(formattedValue ?? value ?? "");
|
|
14742
|
-
const
|
|
14743
|
-
return
|
|
14928
|
+
const format21 = propsDataKey && formatterMap[propsDataKey] ? formatterMap[propsDataKey] : "";
|
|
14929
|
+
return format21 ? getFormattedValue(baseFormatted, format21) : baseFormatted;
|
|
14744
14930
|
};
|
|
14745
14931
|
}
|
|
14746
14932
|
if (typeof customFormatter === "function") {
|
|
@@ -16392,8 +16578,578 @@ var SystemTooltip = ({
|
|
|
16392
16578
|
) });
|
|
16393
16579
|
};
|
|
16394
16580
|
var SystemTooltip_default = SystemTooltip;
|
|
16581
|
+
var useIsTruncated = (ref) => {
|
|
16582
|
+
const [truncated, setTruncated] = React32.useState(false);
|
|
16583
|
+
React32.useEffect(() => {
|
|
16584
|
+
const el = ref.current;
|
|
16585
|
+
if (!el) return;
|
|
16586
|
+
const check = () => setTruncated(el.scrollWidth > el.offsetWidth);
|
|
16587
|
+
check();
|
|
16588
|
+
const ro = new ResizeObserver(check);
|
|
16589
|
+
ro.observe(el);
|
|
16590
|
+
return () => ro.disconnect();
|
|
16591
|
+
}, [ref]);
|
|
16592
|
+
return truncated;
|
|
16593
|
+
};
|
|
16594
|
+
var NameTooltip = ({
|
|
16595
|
+
name,
|
|
16596
|
+
description
|
|
16597
|
+
}) => {
|
|
16598
|
+
const nameRef = React32.useRef(null);
|
|
16599
|
+
const descRef = React32.useRef(null);
|
|
16600
|
+
const isNameTruncated = useIsTruncated(nameRef);
|
|
16601
|
+
const isDescTruncated = useIsTruncated(descRef);
|
|
16602
|
+
const showTooltip = isNameTruncated || isDescTruncated;
|
|
16603
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16604
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cursor-default", children: [
|
|
16605
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16606
|
+
"h3",
|
|
16607
|
+
{
|
|
16608
|
+
ref: nameRef,
|
|
16609
|
+
className: "text-xl font-bold text-foreground tracking-tight truncate",
|
|
16610
|
+
children: name
|
|
16611
|
+
}
|
|
16612
|
+
),
|
|
16613
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16614
|
+
"p",
|
|
16615
|
+
{
|
|
16616
|
+
ref: descRef,
|
|
16617
|
+
className: "text-xs text-foreground/70 truncate mt-0.5",
|
|
16618
|
+
children: description
|
|
16619
|
+
}
|
|
16620
|
+
)
|
|
16621
|
+
] }) }),
|
|
16622
|
+
showTooltip && /* @__PURE__ */ jsxRuntime.jsxs(TooltipContentBase, { sideOffset: 8, className: "z-[10001]", children: [
|
|
16623
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold", children: name }),
|
|
16624
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-foreground/70 mt-0.5", children: description })
|
|
16625
|
+
] })
|
|
16626
|
+
] }) });
|
|
16627
|
+
};
|
|
16628
|
+
var SystemNode = ({ label }) => {
|
|
16629
|
+
const truncated = label.length > 9 ? label.substring(0, 9) + "\u2026" : label;
|
|
16630
|
+
const needsTooltip = label.length > 9;
|
|
16631
|
+
const circle = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[76px] h-[76px] rounded-full bg-primary flex items-center justify-center shrink-0 z-10 cursor-default", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-primary-foreground text-center px-2 leading-tight select-none", children: truncated }) });
|
|
16632
|
+
if (!needsTooltip) return circle;
|
|
16633
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16634
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: circle }),
|
|
16635
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContentBase, { sideOffset: 8, className: "z-[10001]", children: label })
|
|
16636
|
+
] }) });
|
|
16637
|
+
};
|
|
16638
|
+
var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
|
|
16639
|
+
const gradientId = React32.useId();
|
|
16640
|
+
const [pathD, setPathD] = React32.useState("");
|
|
16641
|
+
const [svgSize, setSvgSize] = React32.useState({ w: 0, h: 0 });
|
|
16642
|
+
React32.useEffect(() => {
|
|
16643
|
+
let rafId;
|
|
16644
|
+
const update = () => {
|
|
16645
|
+
const container = containerRef.current;
|
|
16646
|
+
const left = leftRef.current;
|
|
16647
|
+
const right = rightRef.current;
|
|
16648
|
+
if (!container || !left || !right) return;
|
|
16649
|
+
const cr = container.getBoundingClientRect();
|
|
16650
|
+
const lr = left.getBoundingClientRect();
|
|
16651
|
+
const rr = right.getBoundingClientRect();
|
|
16652
|
+
const cx1 = lr.left - cr.left + lr.width / 2;
|
|
16653
|
+
const cy1 = lr.top - cr.top + lr.height / 2;
|
|
16654
|
+
const cx2 = rr.left - cr.left + rr.width / 2;
|
|
16655
|
+
const cy2 = rr.top - cr.top + rr.height / 2;
|
|
16656
|
+
const dx = cx2 - cx1, dy = cy2 - cy1;
|
|
16657
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
16658
|
+
if (dist === 0) return;
|
|
16659
|
+
const ux = dx / dist, uy = dy / dist;
|
|
16660
|
+
const r1 = lr.width / 2;
|
|
16661
|
+
const r2 = rr.width / 2;
|
|
16662
|
+
setSvgSize({ w: cr.width, h: cr.height });
|
|
16663
|
+
setPathD(
|
|
16664
|
+
`M ${cx1 + ux * r1},${cy1 + uy * r1} L ${cx2 - ux * r2},${cy2 - uy * r2}`
|
|
16665
|
+
);
|
|
16666
|
+
};
|
|
16667
|
+
const schedule = () => {
|
|
16668
|
+
cancelAnimationFrame(rafId);
|
|
16669
|
+
rafId = requestAnimationFrame(update);
|
|
16670
|
+
};
|
|
16671
|
+
requestAnimationFrame(() => requestAnimationFrame(update));
|
|
16672
|
+
schedule();
|
|
16673
|
+
const ro = new ResizeObserver(schedule);
|
|
16674
|
+
if (containerRef.current) ro.observe(containerRef.current);
|
|
16675
|
+
if (leftRef.current) ro.observe(leftRef.current);
|
|
16676
|
+
if (rightRef.current) ro.observe(rightRef.current);
|
|
16677
|
+
const mo = new MutationObserver(schedule);
|
|
16678
|
+
mo.observe(document.documentElement, {
|
|
16679
|
+
attributes: true,
|
|
16680
|
+
attributeFilter: ["class", "style"]
|
|
16681
|
+
});
|
|
16682
|
+
mo.observe(document.body, {
|
|
16683
|
+
attributes: true,
|
|
16684
|
+
attributeFilter: ["class", "style"]
|
|
16685
|
+
});
|
|
16686
|
+
return () => {
|
|
16687
|
+
cancelAnimationFrame(rafId);
|
|
16688
|
+
ro.disconnect();
|
|
16689
|
+
mo.disconnect();
|
|
16690
|
+
};
|
|
16691
|
+
}, [containerRef, leftRef, rightRef]);
|
|
16692
|
+
const animX1 = isInput ? ["90%", "-10%"] : ["10%", "110%"];
|
|
16693
|
+
const animX2 = isInput ? ["100%", "0%"] : ["0%", "100%"];
|
|
16694
|
+
if (!pathD) return null;
|
|
16695
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16696
|
+
"svg",
|
|
16697
|
+
{
|
|
16698
|
+
className: "pointer-events-none absolute left-0 top-0",
|
|
16699
|
+
width: svgSize.w,
|
|
16700
|
+
height: svgSize.h,
|
|
16701
|
+
fill: "none",
|
|
16702
|
+
children: [
|
|
16703
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16704
|
+
"path",
|
|
16705
|
+
{
|
|
16706
|
+
d: pathD,
|
|
16707
|
+
className: "stroke-primary",
|
|
16708
|
+
strokeWidth: 2,
|
|
16709
|
+
strokeOpacity: 0.2,
|
|
16710
|
+
strokeLinecap: "round"
|
|
16711
|
+
}
|
|
16712
|
+
),
|
|
16713
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16714
|
+
framerMotion.motion.path,
|
|
16715
|
+
{
|
|
16716
|
+
d: pathD,
|
|
16717
|
+
stroke: `url(#${gradientId})`,
|
|
16718
|
+
strokeWidth: 2,
|
|
16719
|
+
strokeLinecap: "round",
|
|
16720
|
+
initial: { strokeOpacity: 0 },
|
|
16721
|
+
animate: { strokeOpacity: 1 },
|
|
16722
|
+
transition: { duration: 1 }
|
|
16723
|
+
}
|
|
16724
|
+
),
|
|
16725
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16726
|
+
framerMotion.motion.linearGradient,
|
|
16727
|
+
{
|
|
16728
|
+
id: gradientId,
|
|
16729
|
+
gradientUnits: "userSpaceOnUse",
|
|
16730
|
+
initial: { x1: "0%", x2: "0%", y1: "0%", y2: "0%" },
|
|
16731
|
+
animate: {
|
|
16732
|
+
x1: animX1,
|
|
16733
|
+
x2: animX2,
|
|
16734
|
+
y1: ["0%", "0%"],
|
|
16735
|
+
y2: ["0%", "0%"]
|
|
16736
|
+
},
|
|
16737
|
+
transition: {
|
|
16738
|
+
duration: 4,
|
|
16739
|
+
ease: [0.16, 1, 0.3, 1],
|
|
16740
|
+
repeat: Infinity,
|
|
16741
|
+
repeatDelay: 0
|
|
16742
|
+
},
|
|
16743
|
+
children: [
|
|
16744
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "hsl(var(--primary))", stopOpacity: "0" }),
|
|
16745
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { stopColor: "hsl(var(--primary))" }),
|
|
16746
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "32.5%", stopColor: "hsl(var(--primary))" }),
|
|
16747
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: "hsl(var(--primary))", stopOpacity: "0" })
|
|
16748
|
+
]
|
|
16749
|
+
}
|
|
16750
|
+
) })
|
|
16751
|
+
]
|
|
16752
|
+
}
|
|
16753
|
+
);
|
|
16754
|
+
};
|
|
16755
|
+
var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
|
|
16756
|
+
const containerRef = React32.useRef(null);
|
|
16757
|
+
const leftRef = React32.useRef(null);
|
|
16758
|
+
const rightRef = React32.useRef(null);
|
|
16759
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16760
|
+
"div",
|
|
16761
|
+
{
|
|
16762
|
+
ref: containerRef,
|
|
16763
|
+
className: "relative flex items-center justify-between py-1 px-3",
|
|
16764
|
+
children: [
|
|
16765
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: leftRef, children: /* @__PURE__ */ jsxRuntime.jsx(SystemNode, { label: isInput ? externalSystem : currentSystem }) }),
|
|
16766
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: rightRef, children: /* @__PURE__ */ jsxRuntime.jsx(SystemNode, { label: isInput ? currentSystem : externalSystem }) }),
|
|
16767
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16768
|
+
Beam,
|
|
16769
|
+
{
|
|
16770
|
+
isInput,
|
|
16771
|
+
containerRef,
|
|
16772
|
+
leftRef,
|
|
16773
|
+
rightRef
|
|
16774
|
+
}
|
|
16775
|
+
)
|
|
16776
|
+
]
|
|
16777
|
+
}
|
|
16778
|
+
);
|
|
16779
|
+
};
|
|
16780
|
+
var CopyData = ({ value }) => {
|
|
16781
|
+
const [copied, setCopied] = React32.useState(false);
|
|
16782
|
+
const handleCopy = React32.useCallback(() => {
|
|
16783
|
+
navigator.clipboard.writeText(value).then(() => {
|
|
16784
|
+
setCopied(true);
|
|
16785
|
+
setTimeout(() => setCopied(false), 1500);
|
|
16786
|
+
});
|
|
16787
|
+
}, [value]);
|
|
16788
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16789
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16790
|
+
"button",
|
|
16791
|
+
{
|
|
16792
|
+
onClick: handleCopy,
|
|
16793
|
+
className: "shrink-0 p-0.5 rounded transition-colors text-muted-foreground/40 hover:text-foreground hover:bg-muted",
|
|
16794
|
+
style: { cursor: "pointer" },
|
|
16795
|
+
children: copied ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16796
|
+
"path",
|
|
16797
|
+
{
|
|
16798
|
+
d: "M3 8l3.5 3.5L13 4.5",
|
|
16799
|
+
stroke: "currentColor",
|
|
16800
|
+
strokeWidth: "2",
|
|
16801
|
+
strokeLinecap: "round",
|
|
16802
|
+
strokeLinejoin: "round"
|
|
16803
|
+
}
|
|
16804
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", children: [
|
|
16805
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16806
|
+
"rect",
|
|
16807
|
+
{
|
|
16808
|
+
x: "5",
|
|
16809
|
+
y: "5",
|
|
16810
|
+
width: "8",
|
|
16811
|
+
height: "9",
|
|
16812
|
+
rx: "1.5",
|
|
16813
|
+
stroke: "currentColor",
|
|
16814
|
+
strokeWidth: "1.5"
|
|
16815
|
+
}
|
|
16816
|
+
),
|
|
16817
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16818
|
+
"path",
|
|
16819
|
+
{
|
|
16820
|
+
d: "M3 11V3.5A1.5 1.5 0 0 1 4.5 2H11",
|
|
16821
|
+
stroke: "currentColor",
|
|
16822
|
+
strokeWidth: "1.5",
|
|
16823
|
+
strokeLinecap: "round"
|
|
16824
|
+
}
|
|
16825
|
+
)
|
|
16826
|
+
] })
|
|
16827
|
+
}
|
|
16828
|
+
) }),
|
|
16829
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: copied ? "Copiado!" : "Copiar" })
|
|
16830
|
+
] }) });
|
|
16831
|
+
};
|
|
16832
|
+
var propertyLabels = {
|
|
16833
|
+
Nome: "Nome",
|
|
16834
|
+
tipo: "Tipo",
|
|
16835
|
+
Tipo: "Tipo",
|
|
16836
|
+
Protocolos: "Protocolos",
|
|
16837
|
+
Ambiente: "Ambiente",
|
|
16838
|
+
Setor: "Setor",
|
|
16839
|
+
Contato: "Contato",
|
|
16840
|
+
Sustentacao: "Sustenta\xE7\xE3o",
|
|
16841
|
+
Destino: "Destino",
|
|
16842
|
+
Origem: "Origem"
|
|
16843
|
+
};
|
|
16844
|
+
var IntegrationCard = ({ title, details }) => {
|
|
16845
|
+
const titleRef = React32.useRef(null);
|
|
16846
|
+
const isTitleTruncated = useIsTruncated(titleRef);
|
|
16847
|
+
const blackList = ["id", "elementId", "identity"];
|
|
16848
|
+
const entries = details ? Object.entries(details).filter(
|
|
16849
|
+
([key, value]) => value !== void 0 && value !== null && value !== "" && !blackList.includes(key)
|
|
16850
|
+
) : [];
|
|
16851
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-sm border border-border/40 bg-muted/20 overflow-hidden", children: [
|
|
16852
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3 py-2 border-b border-border/30", children: [
|
|
16853
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16854
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16855
|
+
"span",
|
|
16856
|
+
{
|
|
16857
|
+
ref: titleRef,
|
|
16858
|
+
className: "text-sm font-bold text-foreground truncate flex-1 cursor-default",
|
|
16859
|
+
children: title
|
|
16860
|
+
}
|
|
16861
|
+
) }),
|
|
16862
|
+
isTitleTruncated && /* @__PURE__ */ jsxRuntime.jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: title })
|
|
16863
|
+
] }) }),
|
|
16864
|
+
entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16865
|
+
CopyData,
|
|
16866
|
+
{
|
|
16867
|
+
value: entries.map(([k, v]) => `${propertyLabels[k] || k}: ${String(v)}`).join("\n")
|
|
16868
|
+
}
|
|
16869
|
+
)
|
|
16870
|
+
] }),
|
|
16871
|
+
entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-border/20", children: entries.map(([key, value]) => {
|
|
16872
|
+
const label = propertyLabels[key] || key;
|
|
16873
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
|
|
16874
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs font-semibold text-muted-foreground shrink-0 w-[40%] sm:w-[38%]", children: [
|
|
16875
|
+
label,
|
|
16876
|
+
":"
|
|
16877
|
+
] }),
|
|
16878
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-foreground break-all flex-1", children: String(value) })
|
|
16879
|
+
] }, key);
|
|
16880
|
+
}) })
|
|
16881
|
+
] });
|
|
16882
|
+
};
|
|
16883
|
+
var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-3 space-y-3 overflow-y-auto flex-1 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40 transition-colors", children: [
|
|
16884
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
16885
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-6 w-3/4" }),
|
|
16886
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-3.5 w-1/2" })
|
|
16887
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(NameTooltip, { name: data.name, description: data.description }),
|
|
16888
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/20" }),
|
|
16889
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
16890
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between py-1", children: [
|
|
16891
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "w-[76px] h-[76px] rounded-full" }),
|
|
16892
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "w-[76px] h-[76px] rounded-full" })
|
|
16893
|
+
] }),
|
|
16894
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/20" }),
|
|
16895
|
+
[1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16896
|
+
"div",
|
|
16897
|
+
{
|
|
16898
|
+
className: "rounded-lg border border-border/20 overflow-hidden",
|
|
16899
|
+
children: [
|
|
16900
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-8 w-full" }),
|
|
16901
|
+
[1, 2, 3].map((j) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-7 w-full mt-px" }, j))
|
|
16902
|
+
]
|
|
16903
|
+
},
|
|
16904
|
+
i
|
|
16905
|
+
))
|
|
16906
|
+
] }) : connections.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground text-center py-4", children: "Nenhuma conex\xE3o encontrada" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16907
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16908
|
+
SystemsDiagram,
|
|
16909
|
+
{
|
|
16910
|
+
isInput,
|
|
16911
|
+
currentSystem: data.name,
|
|
16912
|
+
externalSystem
|
|
16913
|
+
}
|
|
16914
|
+
),
|
|
16915
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/20" }),
|
|
16916
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-muted-foreground uppercase", children: isInput ? "Informa\xE7\xF5es de Entrada" : "Informa\xE7\xF5es de Sa\xEDda" }) }),
|
|
16917
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: connections.map((conn) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
16918
|
+
IntegrationCard,
|
|
16919
|
+
{
|
|
16920
|
+
title: conn.name,
|
|
16921
|
+
details: conn.integration
|
|
16922
|
+
},
|
|
16923
|
+
conn.id
|
|
16924
|
+
)) })
|
|
16925
|
+
] })
|
|
16926
|
+
] });
|
|
16927
|
+
var TooltipBody = React32__namespace.default.memo(TooltipBodyComponent);
|
|
16928
|
+
var tooltipVariants3 = {
|
|
16929
|
+
hidden: {
|
|
16930
|
+
opacity: 0,
|
|
16931
|
+
scale: 0.96,
|
|
16932
|
+
transition: { type: "spring", stiffness: 400, damping: 28 }
|
|
16933
|
+
},
|
|
16934
|
+
visible: {
|
|
16935
|
+
opacity: 1,
|
|
16936
|
+
scale: 1,
|
|
16937
|
+
transition: { type: "spring", stiffness: 300, damping: 28 }
|
|
16938
|
+
},
|
|
16939
|
+
exit: {
|
|
16940
|
+
opacity: 0,
|
|
16941
|
+
scale: 0.96,
|
|
16942
|
+
transition: { type: "spring", stiffness: 400, damping: 28 }
|
|
16943
|
+
}
|
|
16944
|
+
};
|
|
16945
|
+
var IntegrationTooltip = ({
|
|
16946
|
+
id,
|
|
16947
|
+
data,
|
|
16948
|
+
position,
|
|
16949
|
+
title = "Conex\xF5es",
|
|
16950
|
+
isLoading = false,
|
|
16951
|
+
systemName,
|
|
16952
|
+
onMouseDown,
|
|
16953
|
+
onClose,
|
|
16954
|
+
onPositionChange
|
|
16955
|
+
}) => {
|
|
16956
|
+
const isMobile = useIsMobile();
|
|
16957
|
+
const [localPos, setLocalPos] = React32.useState(position);
|
|
16958
|
+
const [dragging, setDragging] = React32.useState(false);
|
|
16959
|
+
const offsetRef = React32.useRef({ x: 0, y: 0 });
|
|
16960
|
+
const lastMouse = React32.useRef({ x: 0, y: 0 });
|
|
16961
|
+
React32.useEffect(() => setLocalPos(position), [position]);
|
|
16962
|
+
React32.useEffect(() => {
|
|
16963
|
+
let rafId = null;
|
|
16964
|
+
const handleMouseMove = (e) => {
|
|
16965
|
+
if (!dragging) return;
|
|
16966
|
+
lastMouse.current = { x: e.clientX, y: e.clientY };
|
|
16967
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
16968
|
+
rafId = requestAnimationFrame(() => {
|
|
16969
|
+
const newLeft = lastMouse.current.x - offsetRef.current.x;
|
|
16970
|
+
const newTop = lastMouse.current.y - offsetRef.current.y;
|
|
16971
|
+
const p = {
|
|
16972
|
+
top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
|
|
16973
|
+
left: Math.max(0, Math.min(newLeft, window.innerWidth - 320))
|
|
16974
|
+
};
|
|
16975
|
+
setLocalPos(p);
|
|
16976
|
+
onPositionChange?.(id, p);
|
|
16977
|
+
});
|
|
16978
|
+
};
|
|
16979
|
+
const handleMouseUp = () => {
|
|
16980
|
+
if (dragging) {
|
|
16981
|
+
setDragging(false);
|
|
16982
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
16983
|
+
}
|
|
16984
|
+
};
|
|
16985
|
+
if (dragging) {
|
|
16986
|
+
document.addEventListener("mousemove", handleMouseMove, {
|
|
16987
|
+
passive: true
|
|
16988
|
+
});
|
|
16989
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
16990
|
+
document.body.style.cursor = "grabbing";
|
|
16991
|
+
document.body.style.userSelect = "none";
|
|
16992
|
+
}
|
|
16993
|
+
return () => {
|
|
16994
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
16995
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
16996
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
16997
|
+
document.body.style.cursor = "";
|
|
16998
|
+
document.body.style.userSelect = "";
|
|
16999
|
+
};
|
|
17000
|
+
}, [dragging, id, onPositionChange]);
|
|
17001
|
+
const handleMouseDownLocal = React32.useCallback(
|
|
17002
|
+
(e) => {
|
|
17003
|
+
e.preventDefault();
|
|
17004
|
+
e.stopPropagation();
|
|
17005
|
+
const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
|
|
17006
|
+
if (!rect) return;
|
|
17007
|
+
offsetRef.current = { x: e.clientX - rect.left, y: e.clientY - rect.top };
|
|
17008
|
+
setDragging(true);
|
|
17009
|
+
onMouseDown?.(id, e);
|
|
17010
|
+
},
|
|
17011
|
+
[id, onMouseDown]
|
|
17012
|
+
);
|
|
17013
|
+
const handleTouchStartLocal = React32.useCallback(
|
|
17014
|
+
(e) => {
|
|
17015
|
+
e.stopPropagation();
|
|
17016
|
+
const touch = e.touches[0];
|
|
17017
|
+
if (!touch) return;
|
|
17018
|
+
const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
|
|
17019
|
+
if (!rect) return;
|
|
17020
|
+
offsetRef.current = {
|
|
17021
|
+
x: touch.clientX - rect.left,
|
|
17022
|
+
y: touch.clientY - rect.top
|
|
17023
|
+
};
|
|
17024
|
+
setDragging(true);
|
|
17025
|
+
onMouseDown?.(id, e);
|
|
17026
|
+
},
|
|
17027
|
+
[id, onMouseDown]
|
|
17028
|
+
);
|
|
17029
|
+
const inputConnections = React32.useMemo(
|
|
17030
|
+
() => data.connections.filter((c) => c.type === "entrada"),
|
|
17031
|
+
[data.connections]
|
|
17032
|
+
);
|
|
17033
|
+
const outputConnections = React32.useMemo(
|
|
17034
|
+
() => data.connections.filter((c) => c.type === "saida"),
|
|
17035
|
+
[data.connections]
|
|
17036
|
+
);
|
|
17037
|
+
const isInput = inputConnections.length > 0;
|
|
17038
|
+
const connections = isInput ? inputConnections : outputConnections;
|
|
17039
|
+
const externalSystem = systemName ?? connections[0]?.name ?? "Sistema";
|
|
17040
|
+
const header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17041
|
+
"div",
|
|
17042
|
+
{
|
|
17043
|
+
className: "flex items-center justify-between py-1 border-b border-border/10 bg-muted/30 shrink-0",
|
|
17044
|
+
onMouseDown: handleMouseDownLocal,
|
|
17045
|
+
onTouchStart: handleTouchStartLocal,
|
|
17046
|
+
style: {
|
|
17047
|
+
touchAction: "none",
|
|
17048
|
+
cursor: dragging ? "grabbing" : "grab"
|
|
17049
|
+
},
|
|
17050
|
+
children: [
|
|
17051
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3", children: [
|
|
17052
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.DotsSixVerticalIcon, { size: 16, className: "text-primary" }),
|
|
17053
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: title })
|
|
17054
|
+
] }),
|
|
17055
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17056
|
+
ButtonBase,
|
|
17057
|
+
{
|
|
17058
|
+
variant: "ghost",
|
|
17059
|
+
size: "icon",
|
|
17060
|
+
onClick: () => onClose(id),
|
|
17061
|
+
className: "text-muted-foreground hover:text-destructive transition-colors hover:bg-destructive/10 mr-1",
|
|
17062
|
+
style: { cursor: "pointer" },
|
|
17063
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.XIcon, { size: 16 })
|
|
17064
|
+
}
|
|
17065
|
+
)
|
|
17066
|
+
]
|
|
17067
|
+
}
|
|
17068
|
+
);
|
|
17069
|
+
const bodyProps = { data, isLoading, connections, isInput, externalSystem };
|
|
17070
|
+
if (isMobile) {
|
|
17071
|
+
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
17072
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17073
|
+
framerMotion.motion.div,
|
|
17074
|
+
{
|
|
17075
|
+
className: "fixed inset-0 z-[9999] bg-black/40 backdrop-blur-[2px]",
|
|
17076
|
+
initial: { opacity: 0 },
|
|
17077
|
+
animate: { opacity: 1 },
|
|
17078
|
+
exit: { opacity: 0 },
|
|
17079
|
+
onClick: () => onClose(id)
|
|
17080
|
+
},
|
|
17081
|
+
`overlay-${id}`
|
|
17082
|
+
),
|
|
17083
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
17084
|
+
framerMotion.motion.div,
|
|
17085
|
+
{
|
|
17086
|
+
className: "fixed bottom-0 left-0 right-0 z-[10000] bg-card border-t border-border/50 rounded-t-2xl shadow-2xl flex flex-col",
|
|
17087
|
+
style: { maxHeight: "85dvh" },
|
|
17088
|
+
initial: { y: "100%" },
|
|
17089
|
+
animate: { y: 0 },
|
|
17090
|
+
exit: { y: "100%" },
|
|
17091
|
+
transition: { type: "spring", stiffness: 320, damping: 36 },
|
|
17092
|
+
onClick: (e) => e.stopPropagation(),
|
|
17093
|
+
children: [
|
|
17094
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center pt-2.5 pb-1 shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-1 rounded-full bg-border" }) }),
|
|
17095
|
+
header,
|
|
17096
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto flex-1 pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ jsxRuntime.jsx(TooltipBody, { ...bodyProps }) })
|
|
17097
|
+
]
|
|
17098
|
+
},
|
|
17099
|
+
`sheet-${id}`
|
|
17100
|
+
)
|
|
17101
|
+
] }) });
|
|
17102
|
+
}
|
|
17103
|
+
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17104
|
+
framerMotion.motion.div,
|
|
17105
|
+
{
|
|
17106
|
+
className: "fixed bg-card/95 backdrop-blur-md border border-border/50 rounded-lg shadow-2xl z-[10000] w-[calc(100vw-32px)] max-w-sm sm:w-80 overflow-hidden flex flex-col",
|
|
17107
|
+
variants: tooltipVariants3,
|
|
17108
|
+
initial: "hidden",
|
|
17109
|
+
animate: "visible",
|
|
17110
|
+
exit: "exit",
|
|
17111
|
+
style: { top: localPos.top, left: localPos.left },
|
|
17112
|
+
onClick: (e) => e.stopPropagation(),
|
|
17113
|
+
children: [
|
|
17114
|
+
header,
|
|
17115
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-[60vh] sm:max-h-[520px] overflow-hidden flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx(TooltipBody, { ...bodyProps }) })
|
|
17116
|
+
]
|
|
17117
|
+
},
|
|
17118
|
+
id
|
|
17119
|
+
) });
|
|
17120
|
+
};
|
|
17121
|
+
var IntegrationTooltip_default = IntegrationTooltip;
|
|
17122
|
+
|
|
17123
|
+
// src/components/ui/charts/components/tooltips/utils/integrationTooltipUtils.ts
|
|
17124
|
+
function processIntegrationData(integrations, targetSystemName) {
|
|
17125
|
+
const connections = [];
|
|
17126
|
+
integrations.forEach((integration) => {
|
|
17127
|
+
const origemNome = integration.origem.properties.nome;
|
|
17128
|
+
const destinoNome = integration.destino.properties.nome;
|
|
17129
|
+
if (origemNome === targetSystemName) {
|
|
17130
|
+
connections.push({
|
|
17131
|
+
id: integration.r.elementId,
|
|
17132
|
+
name: destinoNome,
|
|
17133
|
+
type: "saida",
|
|
17134
|
+
integration: integration.r.properties
|
|
17135
|
+
});
|
|
17136
|
+
}
|
|
17137
|
+
if (destinoNome === targetSystemName) {
|
|
17138
|
+
connections.push({
|
|
17139
|
+
id: integration.r.elementId,
|
|
17140
|
+
name: origemNome,
|
|
17141
|
+
type: "entrada",
|
|
17142
|
+
integration: integration.r.properties
|
|
17143
|
+
});
|
|
17144
|
+
}
|
|
17145
|
+
});
|
|
17146
|
+
return {
|
|
17147
|
+
name: targetSystemName,
|
|
17148
|
+
connections
|
|
17149
|
+
};
|
|
17150
|
+
}
|
|
16395
17151
|
|
|
16396
|
-
// src/components/ui/charts/components/tooltips/systemTooltipUtils.ts
|
|
17152
|
+
// src/components/ui/charts/components/tooltips/utils/systemTooltipUtils.ts
|
|
16397
17153
|
function processNeo4jData(integrations, targetSystemName) {
|
|
16398
17154
|
const connections = [];
|
|
16399
17155
|
integrations.forEach((integration) => {
|
|
@@ -20296,6 +21052,7 @@ exports.AvatarFallbackBase = AvatarFallbackBase;
|
|
|
20296
21052
|
exports.AvatarImageBase = AvatarImageBase;
|
|
20297
21053
|
exports.BackButton = BackButton;
|
|
20298
21054
|
exports.Badge = Badge;
|
|
21055
|
+
exports.Beam = Beam;
|
|
20299
21056
|
exports.BreadcrumbBase = BreadcrumbBase;
|
|
20300
21057
|
exports.BreadcrumbEllipsisBase = BreadcrumbEllipsisBase;
|
|
20301
21058
|
exports.BreadcrumbItemBase = BreadcrumbItemBase;
|
|
@@ -20359,6 +21116,7 @@ exports.ContextMenuSubTriggerBase = ContextMenuSubTriggerBase;
|
|
|
20359
21116
|
exports.ContextMenuTriggerBase = ContextMenuTriggerBase;
|
|
20360
21117
|
exports.ControlledCombobox = ControlledCombobox;
|
|
20361
21118
|
exports.CopyButton = CopyButton;
|
|
21119
|
+
exports.CopyData = CopyData;
|
|
20362
21120
|
exports.DateTimePicker = DateTimePicker;
|
|
20363
21121
|
exports.DayView = DayView;
|
|
20364
21122
|
exports.DayViewAgenda = DayViewAgenda;
|
|
@@ -20439,6 +21197,8 @@ exports.InputOTPBase = InputOTPBase;
|
|
|
20439
21197
|
exports.InputOTPGroupBase = InputOTPGroupBase;
|
|
20440
21198
|
exports.InputOTPSeparatorBase = InputOTPSeparatorBase;
|
|
20441
21199
|
exports.InputOTPSlotBase = InputOTPSlotBase;
|
|
21200
|
+
exports.IntegrationCard = IntegrationCard;
|
|
21201
|
+
exports.IntegrationTooltip = IntegrationTooltip_default;
|
|
20442
21202
|
exports.LabelBase = LabelBase_default;
|
|
20443
21203
|
exports.Leaderboard = Leaderboard;
|
|
20444
21204
|
exports.LikeButton = LikeButton;
|
|
@@ -20468,6 +21228,7 @@ exports.MultiSelectItemBase = MultiSelectItemBase;
|
|
|
20468
21228
|
exports.MultiSelectSeparatorBase = MultiSelectSeparatorBase;
|
|
20469
21229
|
exports.MultiSelectTriggerBase = MultiSelectTriggerBase;
|
|
20470
21230
|
exports.MultiSelectValueBase = MultiSelectValueBase;
|
|
21231
|
+
exports.NameTooltip = NameTooltip;
|
|
20471
21232
|
exports.NavigationMenuBase = NavigationMenuBase;
|
|
20472
21233
|
exports.NavigationMenuContentBase = NavigationMenuContentBase;
|
|
20473
21234
|
exports.NavigationMenuIndicatorBase = NavigationMenuIndicatorBase;
|
|
@@ -20549,7 +21310,9 @@ exports.StartHour = StartHour;
|
|
|
20549
21310
|
exports.StartHourAgenda = StartHourAgenda;
|
|
20550
21311
|
exports.StatusIndicator = StatusIndicator;
|
|
20551
21312
|
exports.SwitchBase = SwitchBase;
|
|
21313
|
+
exports.SystemNode = SystemNode;
|
|
20552
21314
|
exports.SystemTooltip = SystemTooltip_default;
|
|
21315
|
+
exports.SystemsDiagram = SystemsDiagram;
|
|
20553
21316
|
exports.TableBase = TableBase;
|
|
20554
21317
|
exports.TableBodyBase = TableBodyBase;
|
|
20555
21318
|
exports.TableCaptionBase = TableCaptionBase;
|
|
@@ -20569,6 +21332,7 @@ exports.TimePickerInput = TimePickerInput;
|
|
|
20569
21332
|
exports.TimeSeries = TimeSeries_default;
|
|
20570
21333
|
exports.Toaster = Toaster;
|
|
20571
21334
|
exports.TooltipBase = TooltipBase;
|
|
21335
|
+
exports.TooltipBody = TooltipBody;
|
|
20572
21336
|
exports.TooltipContentBase = TooltipContentBase;
|
|
20573
21337
|
exports.TooltipProviderBase = TooltipProviderBase;
|
|
20574
21338
|
exports.TooltipSimple = TooltipSimple_default;
|
|
@@ -20586,6 +21350,7 @@ exports.WeekCellsHeight = WeekCellsHeight;
|
|
|
20586
21350
|
exports.WeekCellsHeightAgenda = WeekCellsHeightAgenda;
|
|
20587
21351
|
exports.WeekView = WeekView;
|
|
20588
21352
|
exports.WeekViewAgenda = WeekViewAgenda;
|
|
21353
|
+
exports.YearViewAgenda = YearViewAgenda;
|
|
20589
21354
|
exports.adaptDataForTooltip = adaptDataForTooltip;
|
|
20590
21355
|
exports.addHoursToDate = addHoursToDate;
|
|
20591
21356
|
exports.addHoursToDateAgenda = addHoursToDateAgenda;
|
|
@@ -20602,6 +21367,8 @@ exports.createYTickFormatter = createYTickFormatter;
|
|
|
20602
21367
|
exports.detectDataFields = detectDataFields;
|
|
20603
21368
|
exports.detectXAxis = detectXAxis;
|
|
20604
21369
|
exports.display12HourValue = display12HourValue;
|
|
21370
|
+
exports.formatDurationAgenda = formatDurationAgenda;
|
|
21371
|
+
exports.formatDurationAgendaDays = formatDurationAgendaDays;
|
|
20605
21372
|
exports.formatFieldName = formatFieldName;
|
|
20606
21373
|
exports.formatLinePercentage = formatLinePercentage;
|
|
20607
21374
|
exports.generateAdditionalColors = generateAdditionalColors;
|
|
@@ -20611,6 +21378,7 @@ exports.getAgendaEventsForDayAgenda = getAgendaEventsForDayAgenda;
|
|
|
20611
21378
|
exports.getAllEventsForDay = getAllEventsForDay;
|
|
20612
21379
|
exports.getAllEventsForDayAgenda = getAllEventsForDayAgenda;
|
|
20613
21380
|
exports.getArrowByType = getArrowByType;
|
|
21381
|
+
exports.getAutoColorAgenda = getAutoColorAgenda;
|
|
20614
21382
|
exports.getBorderRadiusClasses = getBorderRadiusClasses;
|
|
20615
21383
|
exports.getBorderRadiusClassesAgenda = getBorderRadiusClassesAgenda;
|
|
20616
21384
|
exports.getDateByType = getDateByType;
|
|
@@ -20640,6 +21408,7 @@ exports.isValidHour = isValidHour;
|
|
|
20640
21408
|
exports.isValidMinuteOrSecond = isValidMinuteOrSecond;
|
|
20641
21409
|
exports.niceCeil = niceCeil;
|
|
20642
21410
|
exports.normalizeAttendDate = normalizeAttendDate;
|
|
21411
|
+
exports.processIntegrationData = processIntegrationData;
|
|
20643
21412
|
exports.processNeo4jData = processNeo4jData;
|
|
20644
21413
|
exports.renderInsideBarLabel = renderInsideBarLabel;
|
|
20645
21414
|
exports.renderPillLabel = pillLabelRenderer_default;
|
|
@@ -20668,6 +21437,7 @@ exports.useDrag = useDrag;
|
|
|
20668
21437
|
exports.useEventVisibility = useEventVisibility;
|
|
20669
21438
|
exports.useEventVisibilityAgenda = useEventVisibilityAgenda;
|
|
20670
21439
|
exports.useIsMobile = useIsMobile;
|
|
21440
|
+
exports.useIsTruncated = useIsTruncated;
|
|
20671
21441
|
exports.useOpenTooltipForPeriod = useOpenTooltipForPeriod;
|
|
20672
21442
|
exports.useProcessedData = useProcessedData;
|
|
20673
21443
|
exports.useSeriesOpacity = useSeriesOpacity;
|