@mlw-packages/react-components 1.10.8 → 1.10.9
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 +53 -0
- package/dist/index.d.mts +22 -38
- package/dist/index.d.ts +22 -38
- package/dist/index.js +545 -328
- package/dist/index.mjs +545 -327
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -627,7 +627,7 @@ var DialogOverlayBase = React32.forwardRef(({ className, testid: dataTestId = "d
|
|
|
627
627
|
{
|
|
628
628
|
ref,
|
|
629
629
|
className: cn(
|
|
630
|
-
"fixed inset-0 z-
|
|
630
|
+
"fixed inset-0 z-[200] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ",
|
|
631
631
|
className
|
|
632
632
|
),
|
|
633
633
|
"data-testid": dataTestId,
|
|
@@ -645,7 +645,7 @@ var DialogContentBase = React32.forwardRef(
|
|
|
645
645
|
{
|
|
646
646
|
ref,
|
|
647
647
|
className: cn(
|
|
648
|
-
"fixed left-[50%] top-[50%] z-
|
|
648
|
+
"fixed left-[50%] top-[50%] z-[200] w-[90%] sm:w-lg grid translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg max-h-[100dvh] overflow-y-auto overflow-x-hidden rounded-md border-border",
|
|
649
649
|
className
|
|
650
650
|
),
|
|
651
651
|
"data-testid": dataTestId,
|
|
@@ -653,10 +653,16 @@ var DialogContentBase = React32.forwardRef(
|
|
|
653
653
|
onWheel: userOnWheel,
|
|
654
654
|
children: [
|
|
655
655
|
children,
|
|
656
|
-
/* @__PURE__ */ jsxs(
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
656
|
+
/* @__PURE__ */ jsxs(
|
|
657
|
+
DialogPrimitive.Close,
|
|
658
|
+
{
|
|
659
|
+
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",
|
|
660
|
+
children: [
|
|
661
|
+
/* @__PURE__ */ jsx(XIcon, { className: "h-6 w-6 sm:h-4 sm:w-4 hover:text-red-500 font-extrabold" }),
|
|
662
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
663
|
+
]
|
|
664
|
+
}
|
|
665
|
+
)
|
|
660
666
|
]
|
|
661
667
|
}
|
|
662
668
|
)
|
|
@@ -8596,7 +8602,8 @@ function Agenda({
|
|
|
8596
8602
|
currentDate,
|
|
8597
8603
|
events,
|
|
8598
8604
|
onEventSelect,
|
|
8599
|
-
showUndatedEvents = true
|
|
8605
|
+
showUndatedEvents = true,
|
|
8606
|
+
noTime = false
|
|
8600
8607
|
}) {
|
|
8601
8608
|
const isValidDate5 = (d) => {
|
|
8602
8609
|
try {
|
|
@@ -8665,6 +8672,7 @@ function Agenda({
|
|
|
8665
8672
|
event,
|
|
8666
8673
|
onClick: onEventSelect ? (e) => handleEventClick(event, e) : void 0,
|
|
8667
8674
|
view: "agenda",
|
|
8675
|
+
noTime,
|
|
8668
8676
|
className: onEventSelect ? void 0 : "hover:shadow-none hover:scale-100"
|
|
8669
8677
|
},
|
|
8670
8678
|
event.id
|
|
@@ -8929,6 +8937,9 @@ var StartHourAgenda = 0;
|
|
|
8929
8937
|
var EndHourAgenda = 24;
|
|
8930
8938
|
var DefaultStartHourAgenda = 9;
|
|
8931
8939
|
var DefaultEndHourAgenda = 10;
|
|
8940
|
+
function startOfLocalDay(d) {
|
|
8941
|
+
return new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
8942
|
+
}
|
|
8932
8943
|
function getAutoColorAgenda(id) {
|
|
8933
8944
|
const colors2 = [
|
|
8934
8945
|
"sky",
|
|
@@ -9039,7 +9050,9 @@ function getSpanningEventsForDayAgenda(events, day) {
|
|
|
9039
9050
|
const eventStart = getEventStartDate(event);
|
|
9040
9051
|
const eventEnd = getEventEndDate(event);
|
|
9041
9052
|
if (!eventStart || !eventEnd) return false;
|
|
9042
|
-
|
|
9053
|
+
const startDay = startOfLocalDay(eventStart);
|
|
9054
|
+
const endDay = startOfLocalDay(eventEnd);
|
|
9055
|
+
return !isSameDay(day, eventStart) && (isSameDay(day, eventEnd) || day > startDay && day < endDay);
|
|
9043
9056
|
});
|
|
9044
9057
|
}
|
|
9045
9058
|
function getAllEventsForDayAgenda(events, day) {
|
|
@@ -9047,7 +9060,9 @@ function getAllEventsForDayAgenda(events, day) {
|
|
|
9047
9060
|
const eventStart = getEventStartDate(event);
|
|
9048
9061
|
const eventEnd = getEventEndDate(event);
|
|
9049
9062
|
if (!eventStart) return false;
|
|
9050
|
-
|
|
9063
|
+
const startDay = startOfLocalDay(eventStart);
|
|
9064
|
+
const endDay = eventEnd ? startOfLocalDay(eventEnd) : null;
|
|
9065
|
+
return isSameDay(day, eventStart) || (endDay ? isSameDay(day, eventEnd) : false) || (endDay ? day > startDay && day < endDay : false);
|
|
9051
9066
|
});
|
|
9052
9067
|
}
|
|
9053
9068
|
function getAgendaEventsForDayAgenda(events, day) {
|
|
@@ -9055,7 +9070,9 @@ function getAgendaEventsForDayAgenda(events, day) {
|
|
|
9055
9070
|
const eventStart = getEventStartDate(event);
|
|
9056
9071
|
const eventEnd = getEventEndDate(event);
|
|
9057
9072
|
if (!eventStart) return false;
|
|
9058
|
-
|
|
9073
|
+
const startDay = startOfLocalDay(eventStart);
|
|
9074
|
+
const endDay = eventEnd ? startOfLocalDay(eventEnd) : null;
|
|
9075
|
+
return isSameDay(day, eventStart) || (eventEnd ? isSameDay(day, eventEnd) : false) || (endDay ? day > startDay && day < endDay : false);
|
|
9059
9076
|
}).sort((a, b) => getEventStartTimestamp(a) - getEventStartTimestamp(b));
|
|
9060
9077
|
}
|
|
9061
9078
|
function getEventStartDate(event) {
|
|
@@ -9226,6 +9243,7 @@ function EventItemAgenda({
|
|
|
9226
9243
|
view,
|
|
9227
9244
|
onClick,
|
|
9228
9245
|
showTime,
|
|
9246
|
+
noTime = false,
|
|
9229
9247
|
currentTime,
|
|
9230
9248
|
isFirstDay = true,
|
|
9231
9249
|
isLastDay = true,
|
|
@@ -9304,9 +9322,10 @@ function EventItemAgenda({
|
|
|
9304
9322
|
ariaLabel,
|
|
9305
9323
|
isFirstDay,
|
|
9306
9324
|
isLastDay,
|
|
9325
|
+
noTime,
|
|
9307
9326
|
onClick,
|
|
9308
9327
|
children: children || /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 truncate min-w-0", children: [
|
|
9309
|
-
!event.allDay && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "truncate text-sm sm:text-base md:text-lg lg:text-xl opacity-80 bg-white/10 px-2 rounded-full min-w-0", children: formatTimeWithOptionalMinutes(displayStart) }),
|
|
9328
|
+
!noTime && !event.allDay && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "truncate text-sm sm:text-base md:text-lg lg:text-xl opacity-80 bg-white/10 px-2 rounded-full min-w-0", children: formatTimeWithOptionalMinutes(displayStart) }),
|
|
9310
9329
|
/* @__PURE__ */ jsx(
|
|
9311
9330
|
"span",
|
|
9312
9331
|
{
|
|
@@ -9360,6 +9379,7 @@ function EventItemAgenda({
|
|
|
9360
9379
|
ariaLabel,
|
|
9361
9380
|
isFirstDay,
|
|
9362
9381
|
isLastDay,
|
|
9382
|
+
noTime,
|
|
9363
9383
|
onClick,
|
|
9364
9384
|
onMouseDown,
|
|
9365
9385
|
onTouchStart,
|
|
@@ -9383,15 +9403,16 @@ function EventItemAgenda({
|
|
|
9383
9403
|
ariaLabel,
|
|
9384
9404
|
isFirstDay,
|
|
9385
9405
|
isLastDay,
|
|
9406
|
+
noTime,
|
|
9386
9407
|
onClick,
|
|
9387
9408
|
onMouseDown,
|
|
9388
9409
|
onTouchStart,
|
|
9389
9410
|
children: isCompact ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 w-full min-w-0 overflow-hidden", children: [
|
|
9390
9411
|
/* @__PURE__ */ jsx("span", { className: "truncate font-semibold leading-none min-w-0", children: event.title }),
|
|
9391
|
-
showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-75 leading-none", children: formatTimeWithOptionalMinutes(displayStart) })
|
|
9412
|
+
!noTime && showTime && hasValidTime && displayStart && /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-75 leading-none", children: formatTimeWithOptionalMinutes(displayStart) })
|
|
9392
9413
|
] }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 w-full min-w-0 overflow-hidden h-full", children: [
|
|
9393
9414
|
/* @__PURE__ */ jsx("span", { className: "font-semibold leading-snug truncate", children: event.title }),
|
|
9394
|
-
showTime && hasValidTime && /* @__PURE__ */ jsx("span", { className: "opacity-75 leading-none truncate", children: getEventTime() })
|
|
9415
|
+
!noTime && showTime && hasValidTime && /* @__PURE__ */ jsx("span", { className: "opacity-75 leading-none truncate", children: getEventTime() })
|
|
9395
9416
|
] })
|
|
9396
9417
|
}
|
|
9397
9418
|
);
|
|
@@ -9470,7 +9491,7 @@ function EventItemAgenda({
|
|
|
9470
9491
|
children: event.title
|
|
9471
9492
|
}
|
|
9472
9493
|
),
|
|
9473
|
-
/* @__PURE__ */ jsx(
|
|
9494
|
+
!noTime && /* @__PURE__ */ jsx(
|
|
9474
9495
|
"div",
|
|
9475
9496
|
{
|
|
9476
9497
|
className: cn(
|
|
@@ -9533,7 +9554,8 @@ function DayViewAgenda({
|
|
|
9533
9554
|
currentDate,
|
|
9534
9555
|
events,
|
|
9535
9556
|
onEventSelect,
|
|
9536
|
-
showUndatedEvents
|
|
9557
|
+
showUndatedEvents,
|
|
9558
|
+
noTime = false
|
|
9537
9559
|
}) {
|
|
9538
9560
|
const hours = useMemo(() => {
|
|
9539
9561
|
const dayStart = startOfDay(currentDate);
|
|
@@ -9721,7 +9743,8 @@ function DayViewAgenda({
|
|
|
9721
9743
|
isFirstDay,
|
|
9722
9744
|
isLastDay,
|
|
9723
9745
|
onClick: (e) => handleEventClick(evt, e),
|
|
9724
|
-
showTime: true
|
|
9746
|
+
showTime: true,
|
|
9747
|
+
noTime
|
|
9725
9748
|
}
|
|
9726
9749
|
) }) }),
|
|
9727
9750
|
/* @__PURE__ */ jsxs(
|
|
@@ -10038,7 +10061,8 @@ function EventAgenda({
|
|
|
10038
10061
|
initialView = "month",
|
|
10039
10062
|
initialDate,
|
|
10040
10063
|
onClick,
|
|
10041
|
-
showYearView = false
|
|
10064
|
+
showYearView = false,
|
|
10065
|
+
noTime = false
|
|
10042
10066
|
}) {
|
|
10043
10067
|
const [currentDate, setCurrentDate] = useState(
|
|
10044
10068
|
initialDate && new Date(initialDate) || /* @__PURE__ */ new Date()
|
|
@@ -10194,7 +10218,8 @@ function EventAgenda({
|
|
|
10194
10218
|
{
|
|
10195
10219
|
currentDate,
|
|
10196
10220
|
events,
|
|
10197
|
-
onEventSelect: handleEventSelect
|
|
10221
|
+
onEventSelect: handleEventSelect,
|
|
10222
|
+
noTime
|
|
10198
10223
|
}
|
|
10199
10224
|
),
|
|
10200
10225
|
view === "week" && /* @__PURE__ */ jsx(
|
|
@@ -10202,7 +10227,8 @@ function EventAgenda({
|
|
|
10202
10227
|
{
|
|
10203
10228
|
currentDate,
|
|
10204
10229
|
events,
|
|
10205
|
-
onEventSelect: handleEventSelect
|
|
10230
|
+
onEventSelect: handleEventSelect,
|
|
10231
|
+
noTime
|
|
10206
10232
|
}
|
|
10207
10233
|
),
|
|
10208
10234
|
view === "day" && /* @__PURE__ */ jsx(
|
|
@@ -10210,7 +10236,8 @@ function EventAgenda({
|
|
|
10210
10236
|
{
|
|
10211
10237
|
currentDate,
|
|
10212
10238
|
events,
|
|
10213
|
-
onEventSelect: handleEventSelect
|
|
10239
|
+
onEventSelect: handleEventSelect,
|
|
10240
|
+
noTime
|
|
10214
10241
|
}
|
|
10215
10242
|
),
|
|
10216
10243
|
view === "agenda" && /* @__PURE__ */ jsx(
|
|
@@ -10218,7 +10245,8 @@ function EventAgenda({
|
|
|
10218
10245
|
{
|
|
10219
10246
|
currentDate,
|
|
10220
10247
|
events,
|
|
10221
|
-
onEventSelect: handleEventSelect
|
|
10248
|
+
onEventSelect: handleEventSelect,
|
|
10249
|
+
noTime
|
|
10222
10250
|
}
|
|
10223
10251
|
),
|
|
10224
10252
|
view === "year" && /* @__PURE__ */ jsx(
|
|
@@ -10236,7 +10264,8 @@ function EventAgenda({
|
|
|
10236
10264
|
] }),
|
|
10237
10265
|
selectedEvent && React32__default.isValidElement(onClick) ? React32__default.cloneElement(onClick, {
|
|
10238
10266
|
event: selectedEvent,
|
|
10239
|
-
onClose: () => setSelectedEvent(null)
|
|
10267
|
+
onClose: () => setSelectedEvent(null),
|
|
10268
|
+
noTime
|
|
10240
10269
|
}) : null
|
|
10241
10270
|
]
|
|
10242
10271
|
}
|
|
@@ -10322,12 +10351,17 @@ function useEventVisibilityAgenda({
|
|
|
10322
10351
|
getVisibleEventCount
|
|
10323
10352
|
};
|
|
10324
10353
|
}
|
|
10354
|
+
function startOfDay2(d) {
|
|
10355
|
+
return new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
10356
|
+
}
|
|
10325
10357
|
function clampToWeek(date, weekStart, weekEnd) {
|
|
10326
10358
|
return max([min([date, weekEnd]), weekStart]);
|
|
10327
10359
|
}
|
|
10328
10360
|
function dayCol(date, weekStart) {
|
|
10361
|
+
const dateDay = startOfDay2(date);
|
|
10362
|
+
const weekStartDay = startOfDay2(weekStart);
|
|
10329
10363
|
const diff = Math.round(
|
|
10330
|
-
(
|
|
10364
|
+
(dateDay.getTime() - weekStartDay.getTime()) / (1e3 * 60 * 60 * 24)
|
|
10331
10365
|
);
|
|
10332
10366
|
return Math.max(0, Math.min(6, diff));
|
|
10333
10367
|
}
|
|
@@ -10339,7 +10373,7 @@ function computeMultiDayBars(events, weekDays) {
|
|
|
10339
10373
|
const start = getEventStartDate(ev);
|
|
10340
10374
|
const end = getEventEndDate(ev) ?? start;
|
|
10341
10375
|
if (!start || !end) return false;
|
|
10342
|
-
return start <= weekEnd && end >= weekStart;
|
|
10376
|
+
return startOfDay2(start) <= startOfDay2(weekEnd) && startOfDay2(end) >= startOfDay2(weekStart);
|
|
10343
10377
|
});
|
|
10344
10378
|
const sorted = [...multiDayEvents].sort((a, b) => {
|
|
10345
10379
|
const aS = getEventStartDate(a) ?? /* @__PURE__ */ new Date(0);
|
|
@@ -10390,7 +10424,8 @@ function MultiDayOverlay({
|
|
|
10390
10424
|
weekIndex,
|
|
10391
10425
|
hoveredEventId,
|
|
10392
10426
|
onHover,
|
|
10393
|
-
onEventSelect
|
|
10427
|
+
onEventSelect,
|
|
10428
|
+
noTime = false
|
|
10394
10429
|
}) {
|
|
10395
10430
|
if (bars.length === 0) return null;
|
|
10396
10431
|
return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 pointer-events-none mt-1", children: bars.map((bar) => {
|
|
@@ -10433,7 +10468,7 @@ function MultiDayOverlay({
|
|
|
10433
10468
|
),
|
|
10434
10469
|
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5 w-full min-w-0", children: [
|
|
10435
10470
|
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" }) }),
|
|
10436
|
-
!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") }),
|
|
10471
|
+
!noTime && !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") }),
|
|
10437
10472
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-[11px] sm:text-xs truncate min-w-0 leading-none flex-1", children: event.title }),
|
|
10438
10473
|
isFirstDay && (() => {
|
|
10439
10474
|
const evStart = getEventStartDate(event);
|
|
@@ -10455,7 +10490,7 @@ function MultiDayOverlay({
|
|
|
10455
10490
|
/* @__PURE__ */ jsxs(TooltipContentBase, { side: "top", children: [
|
|
10456
10491
|
/* @__PURE__ */ jsx("p", { className: "font-semibold truncate max-w-[200px]", children: event.title }),
|
|
10457
10492
|
/* @__PURE__ */ jsx("p", { className: "opacity-80 mt-0.5 leading-snug", children: formatDurationAgenda(event) }),
|
|
10458
|
-
event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px]", children: [
|
|
10493
|
+
event.location && /* @__PURE__ */ jsxs("p", { className: "opacity-60 mt-0.5 truncate text-[11px] max-w-[200px] flex items-center", children: [
|
|
10459
10494
|
/* @__PURE__ */ jsx(MapPinIcon, { size: 15 }),
|
|
10460
10495
|
" ",
|
|
10461
10496
|
event.location
|
|
@@ -10471,7 +10506,8 @@ function MonthViewAgenda({
|
|
|
10471
10506
|
currentDate,
|
|
10472
10507
|
events,
|
|
10473
10508
|
onEventSelect,
|
|
10474
|
-
showUndatedEvents
|
|
10509
|
+
showUndatedEvents,
|
|
10510
|
+
noTime = false
|
|
10475
10511
|
}) {
|
|
10476
10512
|
const days = useMemo(() => {
|
|
10477
10513
|
const monthStart = startOfMonth(currentDate);
|
|
@@ -10661,8 +10697,9 @@ function MonthViewAgenda({
|
|
|
10661
10697
|
isLastDay: true,
|
|
10662
10698
|
onClick: (e) => handleEventClick(event, e),
|
|
10663
10699
|
view: "month",
|
|
10700
|
+
noTime,
|
|
10664
10701
|
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 sm:gap-1.5 truncate text-[11px] relative z-10", children: [
|
|
10665
|
-
!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") }),
|
|
10702
|
+
!noTime && !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") }),
|
|
10666
10703
|
/* @__PURE__ */ jsx("span", { className: "font-semibold truncate", children: event.title })
|
|
10667
10704
|
] })
|
|
10668
10705
|
}
|
|
@@ -10704,28 +10741,36 @@ function MonthViewAgenda({
|
|
|
10704
10741
|
PopoverContentBase,
|
|
10705
10742
|
{
|
|
10706
10743
|
align: "center",
|
|
10707
|
-
className: "max-w-52 p-3",
|
|
10744
|
+
className: "max-w-52 p-3 border-border",
|
|
10708
10745
|
style: {
|
|
10709
10746
|
"--event-height": `${EventHeightAgenda}px`
|
|
10710
10747
|
},
|
|
10711
|
-
children: /* @__PURE__ */ jsxs(
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
{
|
|
10719
|
-
event
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10748
|
+
children: /* @__PURE__ */ jsxs(
|
|
10749
|
+
"div",
|
|
10750
|
+
{
|
|
10751
|
+
className: "space-y-2 ",
|
|
10752
|
+
onClick: (e) => e.stopPropagation(),
|
|
10753
|
+
children: [
|
|
10754
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-sm", children: format(day, "EEE d", { locale: ptBR }) }),
|
|
10755
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: sortEventsAgenda(allEvents).map((event) => {
|
|
10756
|
+
const s = getEventStartDate(event) ?? getEventEndDate(event) ?? /* @__PURE__ */ new Date();
|
|
10757
|
+
const e2 = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
10758
|
+
return /* @__PURE__ */ jsx(
|
|
10759
|
+
EventItemAgenda,
|
|
10760
|
+
{
|
|
10761
|
+
noTime: true,
|
|
10762
|
+
event,
|
|
10763
|
+
isFirstDay: isSameDay(day, s),
|
|
10764
|
+
isLastDay: isSameDay(day, e2),
|
|
10765
|
+
onClick: (e) => handleEventClick(event, e),
|
|
10766
|
+
view: "month"
|
|
10767
|
+
},
|
|
10768
|
+
event.id
|
|
10769
|
+
);
|
|
10770
|
+
}) })
|
|
10771
|
+
]
|
|
10772
|
+
}
|
|
10773
|
+
)
|
|
10729
10774
|
}
|
|
10730
10775
|
)
|
|
10731
10776
|
] })
|
|
@@ -10743,7 +10788,8 @@ function MonthViewAgenda({
|
|
|
10743
10788
|
weekIndex,
|
|
10744
10789
|
hoveredEventId,
|
|
10745
10790
|
onHover: handleHover,
|
|
10746
|
-
onEventSelect
|
|
10791
|
+
onEventSelect,
|
|
10792
|
+
noTime
|
|
10747
10793
|
}
|
|
10748
10794
|
)
|
|
10749
10795
|
]
|
|
@@ -10776,6 +10822,7 @@ function DraggableEvent({
|
|
|
10776
10822
|
event,
|
|
10777
10823
|
view,
|
|
10778
10824
|
showTime,
|
|
10825
|
+
noTime,
|
|
10779
10826
|
onClick,
|
|
10780
10827
|
height,
|
|
10781
10828
|
isMultiDay,
|
|
@@ -10869,6 +10916,7 @@ function DraggableEvent({
|
|
|
10869
10916
|
onMouseDown: handleMouseDown,
|
|
10870
10917
|
onTouchStart: handleTouchStart,
|
|
10871
10918
|
showTime,
|
|
10919
|
+
noTime,
|
|
10872
10920
|
view,
|
|
10873
10921
|
totalCols
|
|
10874
10922
|
}
|
|
@@ -10881,7 +10929,8 @@ function WeekViewAgenda({
|
|
|
10881
10929
|
events,
|
|
10882
10930
|
onEventSelect,
|
|
10883
10931
|
onEventCreate,
|
|
10884
|
-
showUndatedEvents
|
|
10932
|
+
showUndatedEvents,
|
|
10933
|
+
noTime = false
|
|
10885
10934
|
}) {
|
|
10886
10935
|
const days = useMemo(() => {
|
|
10887
10936
|
const weekStart = startOfWeek(currentDate, { weekStartsOn: 0 });
|
|
@@ -10914,7 +10963,7 @@ function WeekViewAgenda({
|
|
|
10914
10963
|
return days.some((day) => {
|
|
10915
10964
|
if (eventStart && isSameDay(day, eventStart)) return true;
|
|
10916
10965
|
if (eventEnd && isSameDay(day, eventEnd)) return true;
|
|
10917
|
-
if (eventStart && eventEnd && day > eventStart && day < eventEnd)
|
|
10966
|
+
if (eventStart && eventEnd && day > startOfLocalDay(eventStart) && day < startOfLocalDay(eventEnd))
|
|
10918
10967
|
return true;
|
|
10919
10968
|
return false;
|
|
10920
10969
|
});
|
|
@@ -10946,7 +10995,7 @@ function WeekViewAgenda({
|
|
|
10946
10995
|
if (event.start == null) return false;
|
|
10947
10996
|
const eventStart = getEventStartDate(event);
|
|
10948
10997
|
const eventEnd = getEventEndDate(event) ?? getEventStartDate(event);
|
|
10949
|
-
return (eventStart ? isSameDay(day, eventStart) : false) || (eventEnd ? isSameDay(day, eventEnd) : false) || (eventStart && eventEnd ? eventStart
|
|
10998
|
+
return (eventStart ? isSameDay(day, eventStart) : false) || (eventEnd ? isSameDay(day, eventEnd) : false) || (eventStart && eventEnd ? day > startOfLocalDay(eventStart) && day < startOfLocalDay(eventEnd) : false);
|
|
10950
10999
|
});
|
|
10951
11000
|
const sortedEvents = [...dayEvents].sort((a, b) => {
|
|
10952
11001
|
const aStart = getEventStartDate(a) ?? getEventEndDate(a) ?? /* @__PURE__ */ new Date();
|
|
@@ -11187,7 +11236,7 @@ function WeekViewAgenda({
|
|
|
11187
11236
|
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 min-w-0 w-full", children: [
|
|
11188
11237
|
!isFirstDay && colStart === 0 && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] font-bold opacity-60", children: /* @__PURE__ */ jsx(CaretLeftIcon$1, {}) }),
|
|
11189
11238
|
showTitle && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11190
|
-
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") }),
|
|
11239
|
+
isFirstDay && !noTime && /* @__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") }),
|
|
11191
11240
|
/* @__PURE__ */ jsx("span", { className: "truncate text-xs font-medium", children: event.title }),
|
|
11192
11241
|
isFirstDay && (() => {
|
|
11193
11242
|
const evStart = getEventStartDate(event);
|
|
@@ -11265,6 +11314,7 @@ function WeekViewAgenda({
|
|
|
11265
11314
|
onClick: (e) => handleEventClick(positionedEvent.event, e),
|
|
11266
11315
|
draggable: false,
|
|
11267
11316
|
showTime: true,
|
|
11317
|
+
noTime,
|
|
11268
11318
|
view: "week",
|
|
11269
11319
|
totalCols: positionedEvent.totalCols
|
|
11270
11320
|
}
|
|
@@ -11468,7 +11518,8 @@ function capitalize(s) {
|
|
|
11468
11518
|
}
|
|
11469
11519
|
function EventDetailModalAgenda({
|
|
11470
11520
|
event,
|
|
11471
|
-
onClose
|
|
11521
|
+
onClose,
|
|
11522
|
+
noTime = false
|
|
11472
11523
|
}) {
|
|
11473
11524
|
const [open, setOpen] = useState(true);
|
|
11474
11525
|
if (!event) return null;
|
|
@@ -11533,7 +11584,7 @@ function EventDetailModalAgenda({
|
|
|
11533
11584
|
] }) : 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: [
|
|
11534
11585
|
/* @__PURE__ */ jsx(CalendarDotsIcon, { size: 11, weight: "bold" }),
|
|
11535
11586
|
formatDurationAgendaDays(event)
|
|
11536
|
-
] }) : 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: [
|
|
11587
|
+
] }) : !noTime && 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: [
|
|
11537
11588
|
/* @__PURE__ */ jsx(ClockIcon, { size: 11, weight: "bold" }),
|
|
11538
11589
|
formatDuration(durationMinutes)
|
|
11539
11590
|
] }) : null }),
|
|
@@ -11543,11 +11594,24 @@ function EventDetailModalAgenda({
|
|
|
11543
11594
|
),
|
|
11544
11595
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col px-7 py-6 bg-background", children: [
|
|
11545
11596
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 py-4", children: [
|
|
11546
|
-
/* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(
|
|
11597
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(
|
|
11598
|
+
CalendarDotsIcon,
|
|
11599
|
+
{
|
|
11600
|
+
size: 18,
|
|
11601
|
+
weight: "duotone",
|
|
11602
|
+
className: "text-primary"
|
|
11603
|
+
}
|
|
11604
|
+
) }),
|
|
11547
11605
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
11548
11606
|
/* @__PURE__ */ jsx("span", { className: "text-[13px] font-semibold text-foreground leading-snug", children: dateSection.primary }),
|
|
11549
|
-
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: [
|
|
11550
|
-
/* @__PURE__ */ jsx(
|
|
11607
|
+
!noTime && 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: [
|
|
11608
|
+
/* @__PURE__ */ jsx(
|
|
11609
|
+
ArrowRightIcon$1,
|
|
11610
|
+
{
|
|
11611
|
+
size: 11,
|
|
11612
|
+
className: "shrink-0 text-muted-foreground/60"
|
|
11613
|
+
}
|
|
11614
|
+
),
|
|
11551
11615
|
/* @__PURE__ */ jsx("span", { className: "text-[12px] font-medium text-muted-foreground", children: dateSection.secondary })
|
|
11552
11616
|
] }) : /* @__PURE__ */ jsx("span", { className: "text-[12px] font-medium text-muted-foreground", children: dateSection.secondary }) })
|
|
11553
11617
|
] })
|
|
@@ -11555,7 +11619,14 @@ function EventDetailModalAgenda({
|
|
|
11555
11619
|
(event.location || event.description) && /* @__PURE__ */ jsx(SeparatorBase, { className: "opacity-40" }),
|
|
11556
11620
|
event.location && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11557
11621
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 py-4", children: [
|
|
11558
|
-
/* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(
|
|
11622
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(
|
|
11623
|
+
MapPinIcon,
|
|
11624
|
+
{
|
|
11625
|
+
size: 18,
|
|
11626
|
+
weight: "duotone",
|
|
11627
|
+
className: "text-primary"
|
|
11628
|
+
}
|
|
11629
|
+
) }),
|
|
11559
11630
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
11560
11631
|
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium uppercase tracking-widest text-muted-foreground/60", children: "Localiza\xE7\xE3o" }),
|
|
11561
11632
|
/* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium text-foreground leading-snug", children: event.location })
|
|
@@ -11564,7 +11635,14 @@ function EventDetailModalAgenda({
|
|
|
11564
11635
|
event.description && /* @__PURE__ */ jsx(SeparatorBase, { className: "opacity-40" })
|
|
11565
11636
|
] }),
|
|
11566
11637
|
event.description && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 py-4", children: [
|
|
11567
|
-
/* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(
|
|
11638
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 p-2 rounded-xl bg-muted border border-border shrink-0", children: /* @__PURE__ */ jsx(
|
|
11639
|
+
AlignLeftIcon,
|
|
11640
|
+
{
|
|
11641
|
+
size: 18,
|
|
11642
|
+
weight: "duotone",
|
|
11643
|
+
className: "text-primary"
|
|
11644
|
+
}
|
|
11645
|
+
) }),
|
|
11568
11646
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
11569
11647
|
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium uppercase tracking-widest text-muted-foreground/60", children: "Descri\xE7\xE3o" }),
|
|
11570
11648
|
/* @__PURE__ */ jsx("p", { className: "text-[13px] text-muted-foreground leading-relaxed font-normal", children: event.description })
|
|
@@ -14608,7 +14686,7 @@ var detectXAxis = (data) => {
|
|
|
14608
14686
|
return stringFields[0] || Object.keys(firstItem)[0] || "name";
|
|
14609
14687
|
};
|
|
14610
14688
|
var generateAdditionalColors = (baseColors, count) => {
|
|
14611
|
-
const
|
|
14689
|
+
const hexToRgb2 = (hex) => {
|
|
14612
14690
|
const clean = hex.replace("#", "");
|
|
14613
14691
|
const bigint = parseInt(
|
|
14614
14692
|
clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean,
|
|
@@ -14657,7 +14735,7 @@ var generateAdditionalColors = (baseColors, count) => {
|
|
|
14657
14735
|
};
|
|
14658
14736
|
return `#${f(0)}${f(8)}${f(4)}`;
|
|
14659
14737
|
};
|
|
14660
|
-
const anchors = baseColors.map((c) => rgbToHsl(
|
|
14738
|
+
const anchors = baseColors.map((c) => rgbToHsl(hexToRgb2(c)));
|
|
14661
14739
|
const colors2 = [...baseColors];
|
|
14662
14740
|
let i = 0;
|
|
14663
14741
|
while (colors2.length < count) {
|
|
@@ -16670,7 +16748,7 @@ var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
|
|
|
16670
16748
|
"div",
|
|
16671
16749
|
{
|
|
16672
16750
|
ref: containerRef,
|
|
16673
|
-
className: "relative flex items-center justify-between py-1
|
|
16751
|
+
className: "relative flex items-center justify-between py-1",
|
|
16674
16752
|
children: [
|
|
16675
16753
|
/* @__PURE__ */ jsx(SystemNode, { ref: leftRef, label: isInput ? externalSystem : currentSystem }),
|
|
16676
16754
|
/* @__PURE__ */ jsx(SystemNode, { ref: rightRef, label: isInput ? currentSystem : externalSystem }),
|
|
@@ -16687,7 +16765,7 @@ var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
|
|
|
16687
16765
|
}
|
|
16688
16766
|
);
|
|
16689
16767
|
};
|
|
16690
|
-
var BodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxs("div", { className: "px-3 py-3 space-y-3 max-
|
|
16768
|
+
var BodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxs("div", { className: "px-3 py-3 space-y-3 max-h-[460px] overflow-y-auto [&::-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: [
|
|
16691
16769
|
isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
16692
16770
|
/* @__PURE__ */ jsx(SkeletonBase, { className: "h-6 w-3/4" }),
|
|
16693
16771
|
/* @__PURE__ */ jsx(SkeletonBase, { className: "h-3.5 w-1/2" })
|
|
@@ -16731,268 +16809,7 @@ var BodyComponent = ({ data, isLoading, connections, isInput, externalSystem })
|
|
|
16731
16809
|
)) })
|
|
16732
16810
|
] })
|
|
16733
16811
|
] });
|
|
16734
|
-
|
|
16735
|
-
var modalVariants = {
|
|
16736
|
-
hidden: {
|
|
16737
|
-
opacity: 0,
|
|
16738
|
-
scale: 0.96,
|
|
16739
|
-
transition: { type: "spring", stiffness: 400, damping: 28 }
|
|
16740
|
-
},
|
|
16741
|
-
visible: {
|
|
16742
|
-
opacity: 1,
|
|
16743
|
-
scale: 1,
|
|
16744
|
-
transition: { type: "spring", stiffness: 300, damping: 28 }
|
|
16745
|
-
},
|
|
16746
|
-
exit: {
|
|
16747
|
-
opacity: 0,
|
|
16748
|
-
scale: 0.96,
|
|
16749
|
-
transition: { type: "spring", stiffness: 400, damping: 28 }
|
|
16750
|
-
}
|
|
16751
|
-
};
|
|
16752
|
-
var IntegrationModal = ({
|
|
16753
|
-
id,
|
|
16754
|
-
data,
|
|
16755
|
-
position,
|
|
16756
|
-
title = "Conex\xF5es",
|
|
16757
|
-
isLoading = false,
|
|
16758
|
-
systemName,
|
|
16759
|
-
onMouseDown,
|
|
16760
|
-
onClose,
|
|
16761
|
-
onPositionChange
|
|
16762
|
-
}) => {
|
|
16763
|
-
const isMobile = useIsMobile();
|
|
16764
|
-
const [localPos, setLocalPos] = useState(position);
|
|
16765
|
-
const [dragging, setDragging] = useState(false);
|
|
16766
|
-
const offsetRef = useRef({ x: 0, y: 0 });
|
|
16767
|
-
const lastMouse = useRef({ x: 0, y: 0 });
|
|
16768
|
-
const tooltipRef = useRef(null);
|
|
16769
|
-
const currentPosRef = useRef(position);
|
|
16770
|
-
useEffect(() => {
|
|
16771
|
-
currentPosRef.current = position;
|
|
16772
|
-
setLocalPos(position);
|
|
16773
|
-
}, [position]);
|
|
16774
|
-
useEffect(() => {
|
|
16775
|
-
let rafId = null;
|
|
16776
|
-
const handleMouseMove = (e) => {
|
|
16777
|
-
if (!dragging) return;
|
|
16778
|
-
lastMouse.current = { x: e.clientX, y: e.clientY };
|
|
16779
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
16780
|
-
rafId = requestAnimationFrame(() => {
|
|
16781
|
-
const newLeft = lastMouse.current.x - offsetRef.current.x;
|
|
16782
|
-
const newTop = lastMouse.current.y - offsetRef.current.y;
|
|
16783
|
-
const p = {
|
|
16784
|
-
top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
|
|
16785
|
-
left: Math.max(0, Math.min(newLeft, window.innerWidth - 320))
|
|
16786
|
-
};
|
|
16787
|
-
currentPosRef.current = p;
|
|
16788
|
-
if (tooltipRef.current) {
|
|
16789
|
-
tooltipRef.current.style.top = `${p.top}px`;
|
|
16790
|
-
tooltipRef.current.style.left = `${p.left}px`;
|
|
16791
|
-
}
|
|
16792
|
-
onPositionChange?.(id, p);
|
|
16793
|
-
});
|
|
16794
|
-
};
|
|
16795
|
-
const handleMouseUp = () => {
|
|
16796
|
-
if (dragging) {
|
|
16797
|
-
setDragging(false);
|
|
16798
|
-
setLocalPos(currentPosRef.current);
|
|
16799
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
16800
|
-
}
|
|
16801
|
-
};
|
|
16802
|
-
if (dragging) {
|
|
16803
|
-
document.addEventListener("mousemove", handleMouseMove, { passive: true });
|
|
16804
|
-
document.addEventListener("mouseup", handleMouseUp);
|
|
16805
|
-
document.body.style.cursor = "grabbing";
|
|
16806
|
-
document.body.style.userSelect = "none";
|
|
16807
|
-
}
|
|
16808
|
-
return () => {
|
|
16809
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
16810
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
16811
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
16812
|
-
document.body.style.cursor = "";
|
|
16813
|
-
document.body.style.userSelect = "";
|
|
16814
|
-
};
|
|
16815
|
-
}, [dragging, id, onPositionChange]);
|
|
16816
|
-
const handleMouseDownLocal = useCallback(
|
|
16817
|
-
(e) => {
|
|
16818
|
-
e.preventDefault();
|
|
16819
|
-
e.stopPropagation();
|
|
16820
|
-
const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
|
|
16821
|
-
if (!rect) return;
|
|
16822
|
-
offsetRef.current = { x: e.clientX - rect.left, y: e.clientY - rect.top };
|
|
16823
|
-
setDragging(true);
|
|
16824
|
-
onMouseDown?.(id, e);
|
|
16825
|
-
},
|
|
16826
|
-
[id, onMouseDown]
|
|
16827
|
-
);
|
|
16828
|
-
const handleTouchStartLocal = useCallback(
|
|
16829
|
-
(e) => {
|
|
16830
|
-
e.stopPropagation();
|
|
16831
|
-
const touch = e.touches[0];
|
|
16832
|
-
if (!touch) return;
|
|
16833
|
-
const rect = e.currentTarget.closest(".fixed")?.getBoundingClientRect();
|
|
16834
|
-
if (!rect) return;
|
|
16835
|
-
offsetRef.current = {
|
|
16836
|
-
x: touch.clientX - rect.left,
|
|
16837
|
-
y: touch.clientY - rect.top
|
|
16838
|
-
};
|
|
16839
|
-
setDragging(true);
|
|
16840
|
-
onMouseDown?.(id, e);
|
|
16841
|
-
},
|
|
16842
|
-
[id, onMouseDown]
|
|
16843
|
-
);
|
|
16844
|
-
const inputConnections = useMemo(
|
|
16845
|
-
() => data.connections.filter((c) => c.type === "entrada"),
|
|
16846
|
-
[data.connections]
|
|
16847
|
-
);
|
|
16848
|
-
const outputConnections = useMemo(
|
|
16849
|
-
() => data.connections.filter((c) => c.type === "saida"),
|
|
16850
|
-
[data.connections]
|
|
16851
|
-
);
|
|
16852
|
-
const isInput = inputConnections.length > 0;
|
|
16853
|
-
const connections = isInput ? inputConnections : outputConnections;
|
|
16854
|
-
const externalSystem = systemName ?? connections[0]?.name ?? "Sistema";
|
|
16855
|
-
const header = /* @__PURE__ */ jsxs(
|
|
16856
|
-
"div",
|
|
16857
|
-
{
|
|
16858
|
-
className: "flex items-center justify-between py-1 border-b border-border/10 bg-muted/30 shrink-0 max-w-lg",
|
|
16859
|
-
onMouseDown: handleMouseDownLocal,
|
|
16860
|
-
onTouchStart: handleTouchStartLocal,
|
|
16861
|
-
style: {
|
|
16862
|
-
touchAction: "none",
|
|
16863
|
-
cursor: dragging ? "grabbing" : "grab"
|
|
16864
|
-
},
|
|
16865
|
-
children: [
|
|
16866
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3", children: [
|
|
16867
|
-
/* @__PURE__ */ jsx(DotsSixVerticalIcon, { size: 16, className: "text-primary" }),
|
|
16868
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: title })
|
|
16869
|
-
] }),
|
|
16870
|
-
/* @__PURE__ */ jsx(
|
|
16871
|
-
ButtonBase,
|
|
16872
|
-
{
|
|
16873
|
-
variant: "ghost",
|
|
16874
|
-
size: "icon",
|
|
16875
|
-
onClick: () => onClose(id),
|
|
16876
|
-
className: "text-muted-foreground hover:text-destructive transition-colors hover:bg-destructive/10 mr-1",
|
|
16877
|
-
style: { cursor: "pointer" },
|
|
16878
|
-
children: /* @__PURE__ */ jsx(XIcon, { size: 16 })
|
|
16879
|
-
}
|
|
16880
|
-
)
|
|
16881
|
-
]
|
|
16882
|
-
}
|
|
16883
|
-
);
|
|
16884
|
-
const bodyProps = { data, isLoading, connections, isInput, externalSystem };
|
|
16885
|
-
if (isMobile) {
|
|
16886
|
-
return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16887
|
-
/* @__PURE__ */ jsx(
|
|
16888
|
-
motion.div,
|
|
16889
|
-
{
|
|
16890
|
-
className: "fixed inset-0 z-[9999] bg-black/40 backdrop-blur-[2px]",
|
|
16891
|
-
initial: { opacity: 0 },
|
|
16892
|
-
animate: { opacity: 1 },
|
|
16893
|
-
exit: { opacity: 0 },
|
|
16894
|
-
onClick: () => onClose(id)
|
|
16895
|
-
},
|
|
16896
|
-
`overlay-${id}`
|
|
16897
|
-
),
|
|
16898
|
-
/* @__PURE__ */ jsxs(
|
|
16899
|
-
motion.div,
|
|
16900
|
-
{
|
|
16901
|
-
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 min-h-0",
|
|
16902
|
-
style: { maxHeight: "85dvh" },
|
|
16903
|
-
initial: { y: "100%" },
|
|
16904
|
-
animate: { y: 0 },
|
|
16905
|
-
exit: { y: "100%" },
|
|
16906
|
-
transition: { type: "spring", stiffness: 320, damping: 36 },
|
|
16907
|
-
onClick: (e) => e.stopPropagation(),
|
|
16908
|
-
children: [
|
|
16909
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-center pt-2.5 pb-1 shrink-0", children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-border" }) }),
|
|
16910
|
-
header,
|
|
16911
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-y-auto [&::-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: /* @__PURE__ */ jsx(Body, { ...bodyProps }) })
|
|
16912
|
-
]
|
|
16913
|
-
},
|
|
16914
|
-
`sheet-${id}`
|
|
16915
|
-
)
|
|
16916
|
-
] }) });
|
|
16917
|
-
}
|
|
16918
|
-
return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs(
|
|
16919
|
-
motion.div,
|
|
16920
|
-
{
|
|
16921
|
-
ref: tooltipRef,
|
|
16922
|
-
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",
|
|
16923
|
-
variants: modalVariants,
|
|
16924
|
-
initial: "hidden",
|
|
16925
|
-
animate: "visible",
|
|
16926
|
-
exit: "exit",
|
|
16927
|
-
style: { top: localPos.top, left: localPos.left },
|
|
16928
|
-
onClick: (e) => e.stopPropagation(),
|
|
16929
|
-
children: [
|
|
16930
|
-
header,
|
|
16931
|
-
/* @__PURE__ */ jsx(Body, { ...bodyProps })
|
|
16932
|
-
]
|
|
16933
|
-
},
|
|
16934
|
-
id
|
|
16935
|
-
) });
|
|
16936
|
-
};
|
|
16937
|
-
var IntegrationModal_default = IntegrationModal;
|
|
16938
|
-
|
|
16939
|
-
// src/components/ui/charts/components/tooltips/utils/integrationTooltipUtils.ts
|
|
16940
|
-
function processIntegrationData(integrations, targetSystemName) {
|
|
16941
|
-
const connections = [];
|
|
16942
|
-
integrations.forEach((integration) => {
|
|
16943
|
-
const origemNome = integration.origem.properties.nome;
|
|
16944
|
-
const destinoNome = integration.destino.properties.nome;
|
|
16945
|
-
if (origemNome === targetSystemName) {
|
|
16946
|
-
connections.push({
|
|
16947
|
-
id: integration.r.elementId,
|
|
16948
|
-
name: destinoNome,
|
|
16949
|
-
type: "saida",
|
|
16950
|
-
integration: integration.r.properties
|
|
16951
|
-
});
|
|
16952
|
-
}
|
|
16953
|
-
if (destinoNome === targetSystemName) {
|
|
16954
|
-
connections.push({
|
|
16955
|
-
id: integration.r.elementId,
|
|
16956
|
-
name: origemNome,
|
|
16957
|
-
type: "entrada",
|
|
16958
|
-
integration: integration.r.properties
|
|
16959
|
-
});
|
|
16960
|
-
}
|
|
16961
|
-
});
|
|
16962
|
-
return {
|
|
16963
|
-
name: targetSystemName,
|
|
16964
|
-
connections
|
|
16965
|
-
};
|
|
16966
|
-
}
|
|
16967
|
-
|
|
16968
|
-
// src/components/ui/charts/components/tooltips/utils/systemTooltipUtils.ts
|
|
16969
|
-
function processNeo4jData(integrations, targetSystemName) {
|
|
16970
|
-
const connections = [];
|
|
16971
|
-
integrations.forEach((integration) => {
|
|
16972
|
-
const origemNome = integration.origem.properties.nome;
|
|
16973
|
-
const destinoNome = integration.destino.properties.nome;
|
|
16974
|
-
if (origemNome === targetSystemName) {
|
|
16975
|
-
connections.push({
|
|
16976
|
-
id: integration.r.elementId,
|
|
16977
|
-
name: destinoNome,
|
|
16978
|
-
type: "saida",
|
|
16979
|
-
integration: integration.r.properties
|
|
16980
|
-
});
|
|
16981
|
-
}
|
|
16982
|
-
if (destinoNome === targetSystemName) {
|
|
16983
|
-
connections.push({
|
|
16984
|
-
id: integration.r.elementId,
|
|
16985
|
-
name: origemNome,
|
|
16986
|
-
type: "entrada",
|
|
16987
|
-
integration: integration.r.properties
|
|
16988
|
-
});
|
|
16989
|
-
}
|
|
16990
|
-
});
|
|
16991
|
-
return {
|
|
16992
|
-
name: targetSystemName,
|
|
16993
|
-
connections
|
|
16994
|
-
};
|
|
16995
|
-
}
|
|
16812
|
+
React32__default.memo(BodyComponent);
|
|
16996
16813
|
var Brush = ({
|
|
16997
16814
|
data,
|
|
16998
16815
|
legend,
|
|
@@ -19622,6 +19439,35 @@ var TimeSeries = ({
|
|
|
19622
19439
|
) });
|
|
19623
19440
|
};
|
|
19624
19441
|
var TimeSeries_default = TimeSeries;
|
|
19442
|
+
|
|
19443
|
+
// src/components/ui/charts/components/tooltips/utils/systemTooltipUtils.ts
|
|
19444
|
+
function processNeo4jData(integrations, targetSystemName) {
|
|
19445
|
+
const connections = [];
|
|
19446
|
+
integrations.forEach((integration) => {
|
|
19447
|
+
const origemNome = integration.origem.properties.nome;
|
|
19448
|
+
const destinoNome = integration.destino.properties.nome;
|
|
19449
|
+
if (origemNome === targetSystemName) {
|
|
19450
|
+
connections.push({
|
|
19451
|
+
id: integration.r.elementId,
|
|
19452
|
+
name: destinoNome,
|
|
19453
|
+
type: "saida",
|
|
19454
|
+
integration: integration.r.properties
|
|
19455
|
+
});
|
|
19456
|
+
}
|
|
19457
|
+
if (destinoNome === targetSystemName) {
|
|
19458
|
+
connections.push({
|
|
19459
|
+
id: integration.r.elementId,
|
|
19460
|
+
name: origemNome,
|
|
19461
|
+
type: "entrada",
|
|
19462
|
+
integration: integration.r.properties
|
|
19463
|
+
});
|
|
19464
|
+
}
|
|
19465
|
+
});
|
|
19466
|
+
return {
|
|
19467
|
+
name: targetSystemName,
|
|
19468
|
+
connections
|
|
19469
|
+
};
|
|
19470
|
+
}
|
|
19625
19471
|
function NumericInput({
|
|
19626
19472
|
value,
|
|
19627
19473
|
onChange,
|
|
@@ -19713,6 +19559,378 @@ function NumericInput({
|
|
|
19713
19559
|
] })
|
|
19714
19560
|
] });
|
|
19715
19561
|
}
|
|
19562
|
+
function hexToRgb(hex) {
|
|
19563
|
+
const clean = hex.replace("#", "");
|
|
19564
|
+
if (clean.length !== 6) return null;
|
|
19565
|
+
const num = parseInt(clean, 16);
|
|
19566
|
+
return { r: num >> 16 & 255, g: num >> 8 & 255, b: num & 255 };
|
|
19567
|
+
}
|
|
19568
|
+
function isValidHex(hex) {
|
|
19569
|
+
return /^#[0-9A-Fa-f]{6}$/.test(hex);
|
|
19570
|
+
}
|
|
19571
|
+
var DEFAULT_SWATCHES = [
|
|
19572
|
+
"#000000",
|
|
19573
|
+
"#ffffff",
|
|
19574
|
+
"#6B7280",
|
|
19575
|
+
"#EF4444",
|
|
19576
|
+
"#F97316",
|
|
19577
|
+
"#F59E0B",
|
|
19578
|
+
"#84CC16",
|
|
19579
|
+
"#22C55E",
|
|
19580
|
+
"#14B8A6",
|
|
19581
|
+
"#06B6D4",
|
|
19582
|
+
"#3B82F6",
|
|
19583
|
+
"#8B5CF6",
|
|
19584
|
+
"#EC4899",
|
|
19585
|
+
"#F43F5E",
|
|
19586
|
+
"#D97706",
|
|
19587
|
+
"#0EA5E9"
|
|
19588
|
+
];
|
|
19589
|
+
var ColorPickerBase = React32.forwardRef(
|
|
19590
|
+
({
|
|
19591
|
+
value = "#3B82F6",
|
|
19592
|
+
onChange,
|
|
19593
|
+
opacity = 1,
|
|
19594
|
+
onOpacityChange,
|
|
19595
|
+
swatches = DEFAULT_SWATCHES,
|
|
19596
|
+
label,
|
|
19597
|
+
error,
|
|
19598
|
+
disabled = false,
|
|
19599
|
+
className,
|
|
19600
|
+
"data-testid": dataTestId = "color-picker-base"
|
|
19601
|
+
}, ref) => {
|
|
19602
|
+
const [hexInput, setHexInput] = React32.useState(value.toUpperCase());
|
|
19603
|
+
React32.useEffect(() => {
|
|
19604
|
+
setHexInput(value.toUpperCase());
|
|
19605
|
+
}, [value]);
|
|
19606
|
+
const rgb = hexToRgb(value) ?? { r: 59, g: 130, b: 246 };
|
|
19607
|
+
const rgbString = `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;
|
|
19608
|
+
const opacityPercent = Math.round(opacity * 100);
|
|
19609
|
+
const handleNativeChange = (e) => {
|
|
19610
|
+
onChange?.(e.target.value.toUpperCase());
|
|
19611
|
+
};
|
|
19612
|
+
const handleHexInput = (e) => {
|
|
19613
|
+
const raw = e.target.value;
|
|
19614
|
+
setHexInput(raw.toUpperCase());
|
|
19615
|
+
const withHash = raw.startsWith("#") ? raw : `#${raw}`;
|
|
19616
|
+
if (isValidHex(withHash)) onChange?.(withHash.toUpperCase());
|
|
19617
|
+
};
|
|
19618
|
+
const handleHexBlur = () => {
|
|
19619
|
+
const withHash = hexInput.startsWith("#") ? hexInput : `#${hexInput}`;
|
|
19620
|
+
if (!isValidHex(withHash)) setHexInput(value.toUpperCase());
|
|
19621
|
+
};
|
|
19622
|
+
return /* @__PURE__ */ jsxs(
|
|
19623
|
+
"div",
|
|
19624
|
+
{
|
|
19625
|
+
ref,
|
|
19626
|
+
className: cn("flex flex-col w-full min-w-[150px]", className),
|
|
19627
|
+
"data-testid": dataTestId,
|
|
19628
|
+
children: [
|
|
19629
|
+
label && /* @__PURE__ */ jsx(LabelBase_default, { className: "mb-1", children: label }),
|
|
19630
|
+
/* @__PURE__ */ jsxs(PopoverBase, { children: [
|
|
19631
|
+
/* @__PURE__ */ jsx(PopoverTriggerBase, { asChild: true, disabled, children: /* @__PURE__ */ jsxs(
|
|
19632
|
+
ButtonBase,
|
|
19633
|
+
{
|
|
19634
|
+
variant: "outline",
|
|
19635
|
+
size: "select",
|
|
19636
|
+
disabled,
|
|
19637
|
+
"data-testid": `${dataTestId}-trigger`,
|
|
19638
|
+
className: cn(
|
|
19639
|
+
"w-full justify-start font-normal",
|
|
19640
|
+
error && "border-destructive"
|
|
19641
|
+
),
|
|
19642
|
+
children: [
|
|
19643
|
+
/* @__PURE__ */ jsx(
|
|
19644
|
+
"span",
|
|
19645
|
+
{
|
|
19646
|
+
className: "inline-block size-4 rounded-sm border border-border shrink-0",
|
|
19647
|
+
style: {
|
|
19648
|
+
backgroundColor: `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`
|
|
19649
|
+
}
|
|
19650
|
+
}
|
|
19651
|
+
),
|
|
19652
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs tracking-wide", children: value.toUpperCase() }),
|
|
19653
|
+
onOpacityChange && /* @__PURE__ */ jsxs("span", { className: "ml-auto text-muted-foreground text-xs", children: [
|
|
19654
|
+
opacityPercent,
|
|
19655
|
+
"%"
|
|
19656
|
+
] })
|
|
19657
|
+
]
|
|
19658
|
+
}
|
|
19659
|
+
) }),
|
|
19660
|
+
/* @__PURE__ */ jsxs(
|
|
19661
|
+
PopoverContentBase,
|
|
19662
|
+
{
|
|
19663
|
+
className: "w-64 p-3 flex flex-col gap-3",
|
|
19664
|
+
align: "start",
|
|
19665
|
+
children: [
|
|
19666
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-8 gap-1", children: swatches.map((swatch) => /* @__PURE__ */ jsx(
|
|
19667
|
+
"button",
|
|
19668
|
+
{
|
|
19669
|
+
type: "button",
|
|
19670
|
+
title: swatch,
|
|
19671
|
+
"data-testid": `${dataTestId}-swatch`,
|
|
19672
|
+
onClick: () => onChange?.(swatch),
|
|
19673
|
+
className: cn(
|
|
19674
|
+
"size-6 rounded-md border transition hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
19675
|
+
value.toUpperCase() === swatch.toUpperCase() ? "border-ring ring-2 ring-ring/50 scale-110" : "border-border"
|
|
19676
|
+
),
|
|
19677
|
+
style: { backgroundColor: swatch }
|
|
19678
|
+
},
|
|
19679
|
+
swatch
|
|
19680
|
+
)) }),
|
|
19681
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
19682
|
+
/* @__PURE__ */ jsxs("div", { className: "relative size-9 shrink-0 rounded-md border border-border overflow-hidden cursor-pointer", children: [
|
|
19683
|
+
/* @__PURE__ */ jsx(
|
|
19684
|
+
"input",
|
|
19685
|
+
{
|
|
19686
|
+
type: "color",
|
|
19687
|
+
value,
|
|
19688
|
+
onChange: handleNativeChange,
|
|
19689
|
+
"data-testid": `${dataTestId}-native`,
|
|
19690
|
+
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
|
19691
|
+
}
|
|
19692
|
+
),
|
|
19693
|
+
/* @__PURE__ */ jsx(
|
|
19694
|
+
"span",
|
|
19695
|
+
{
|
|
19696
|
+
className: "absolute inset-0 rounded-md pointer-events-none",
|
|
19697
|
+
style: { backgroundColor: rgbString }
|
|
19698
|
+
}
|
|
19699
|
+
)
|
|
19700
|
+
] }),
|
|
19701
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-1 rounded-md border border-input bg-background h-9 px-2", children: [
|
|
19702
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs font-mono", children: "#" }),
|
|
19703
|
+
/* @__PURE__ */ jsx(
|
|
19704
|
+
"input",
|
|
19705
|
+
{
|
|
19706
|
+
type: "text",
|
|
19707
|
+
maxLength: 6,
|
|
19708
|
+
value: hexInput.startsWith("#") ? hexInput.slice(1) : hexInput,
|
|
19709
|
+
onChange: handleHexInput,
|
|
19710
|
+
onBlur: handleHexBlur,
|
|
19711
|
+
"data-testid": `${dataTestId}-hex-input`,
|
|
19712
|
+
className: "flex-1 bg-transparent text-xs font-mono text-foreground focus:outline-none uppercase tracking-widest placeholder:text-muted-foreground",
|
|
19713
|
+
placeholder: "RRGGBB"
|
|
19714
|
+
}
|
|
19715
|
+
)
|
|
19716
|
+
] })
|
|
19717
|
+
] }),
|
|
19718
|
+
onOpacityChange && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
19719
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
19720
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Opacidade" }),
|
|
19721
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs font-mono text-foreground", children: [
|
|
19722
|
+
opacityPercent,
|
|
19723
|
+
"%"
|
|
19724
|
+
] })
|
|
19725
|
+
] }),
|
|
19726
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
19727
|
+
/* @__PURE__ */ jsx(
|
|
19728
|
+
"div",
|
|
19729
|
+
{
|
|
19730
|
+
className: "absolute inset-y-0 left-0 right-0 my-auto h-1.5 rounded-full pointer-events-none",
|
|
19731
|
+
style: {
|
|
19732
|
+
backgroundImage: "repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%)",
|
|
19733
|
+
backgroundSize: "8px 8px"
|
|
19734
|
+
}
|
|
19735
|
+
}
|
|
19736
|
+
),
|
|
19737
|
+
/* @__PURE__ */ jsx(
|
|
19738
|
+
"div",
|
|
19739
|
+
{
|
|
19740
|
+
className: "absolute inset-y-0 left-0 right-0 my-auto h-1.5 rounded-full pointer-events-none",
|
|
19741
|
+
style: {
|
|
19742
|
+
background: `linear-gradient(to right, transparent, ${rgbString})`
|
|
19743
|
+
}
|
|
19744
|
+
}
|
|
19745
|
+
),
|
|
19746
|
+
/* @__PURE__ */ jsx(
|
|
19747
|
+
SlideBase,
|
|
19748
|
+
{
|
|
19749
|
+
min: 0,
|
|
19750
|
+
max: 100,
|
|
19751
|
+
step: 1,
|
|
19752
|
+
value: [opacityPercent],
|
|
19753
|
+
onValueChange: ([val]) => onOpacityChange(val / 100),
|
|
19754
|
+
"data-testid": `${dataTestId}-opacity`,
|
|
19755
|
+
className: "relative"
|
|
19756
|
+
}
|
|
19757
|
+
)
|
|
19758
|
+
] })
|
|
19759
|
+
] })
|
|
19760
|
+
]
|
|
19761
|
+
}
|
|
19762
|
+
)
|
|
19763
|
+
] }),
|
|
19764
|
+
/* @__PURE__ */ jsx(ErrorMessage, { error })
|
|
19765
|
+
]
|
|
19766
|
+
}
|
|
19767
|
+
);
|
|
19768
|
+
}
|
|
19769
|
+
);
|
|
19770
|
+
ColorPickerBase.displayName = "ColorPickerBase";
|
|
19771
|
+
var TagChip = ({
|
|
19772
|
+
label,
|
|
19773
|
+
onRemove,
|
|
19774
|
+
disabled,
|
|
19775
|
+
testid
|
|
19776
|
+
}) => /* @__PURE__ */ jsxs(
|
|
19777
|
+
"span",
|
|
19778
|
+
{
|
|
19779
|
+
className: cn(
|
|
19780
|
+
"inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-xs font-medium",
|
|
19781
|
+
"bg-primary/10 text-primary border border-primary/20",
|
|
19782
|
+
"transition-colors"
|
|
19783
|
+
),
|
|
19784
|
+
"data-testid": testid,
|
|
19785
|
+
children: [
|
|
19786
|
+
label,
|
|
19787
|
+
!disabled && /* @__PURE__ */ jsx(
|
|
19788
|
+
"button",
|
|
19789
|
+
{
|
|
19790
|
+
type: "button",
|
|
19791
|
+
onClick: onRemove,
|
|
19792
|
+
"data-testid": `${testid}-remove`,
|
|
19793
|
+
"aria-label": `Remover ${label}`,
|
|
19794
|
+
className: cn(
|
|
19795
|
+
"inline-flex items-center justify-center rounded-full size-3.5",
|
|
19796
|
+
"hover:bg-primary/20 text-primary/70 hover:text-primary",
|
|
19797
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary",
|
|
19798
|
+
"transition-colors"
|
|
19799
|
+
),
|
|
19800
|
+
children: /* @__PURE__ */ jsx(XIcon, { weight: "bold", className: "size-2.5" })
|
|
19801
|
+
}
|
|
19802
|
+
)
|
|
19803
|
+
]
|
|
19804
|
+
}
|
|
19805
|
+
);
|
|
19806
|
+
var TagInput = React32.forwardRef(
|
|
19807
|
+
({
|
|
19808
|
+
tags = [],
|
|
19809
|
+
onTagsChange,
|
|
19810
|
+
maxTags,
|
|
19811
|
+
allowDuplicates = false,
|
|
19812
|
+
separators = [","],
|
|
19813
|
+
label,
|
|
19814
|
+
error,
|
|
19815
|
+
disabled = false,
|
|
19816
|
+
placeholder = "Digite e pressione Enter...",
|
|
19817
|
+
className,
|
|
19818
|
+
"data-testid": dataTestId = "tag-input",
|
|
19819
|
+
onKeyDown,
|
|
19820
|
+
onBlur,
|
|
19821
|
+
...props
|
|
19822
|
+
}, ref) => {
|
|
19823
|
+
const [inputValue, setInputValue] = React32.useState("");
|
|
19824
|
+
const isMaxReached = maxTags !== void 0 && tags.length >= maxTags;
|
|
19825
|
+
const addTag = (raw) => {
|
|
19826
|
+
const trimmed = raw.trim();
|
|
19827
|
+
if (!trimmed) return;
|
|
19828
|
+
if (!allowDuplicates && tags.includes(trimmed)) {
|
|
19829
|
+
setInputValue("");
|
|
19830
|
+
return;
|
|
19831
|
+
}
|
|
19832
|
+
if (isMaxReached) return;
|
|
19833
|
+
onTagsChange?.([...tags, trimmed]);
|
|
19834
|
+
setInputValue("");
|
|
19835
|
+
};
|
|
19836
|
+
const removeTag = (index) => {
|
|
19837
|
+
onTagsChange?.(tags.filter((_, i) => i !== index));
|
|
19838
|
+
};
|
|
19839
|
+
const handleKeyDown = (e) => {
|
|
19840
|
+
onKeyDown?.(e);
|
|
19841
|
+
if (e.key === "Enter") {
|
|
19842
|
+
e.preventDefault();
|
|
19843
|
+
addTag(inputValue);
|
|
19844
|
+
return;
|
|
19845
|
+
}
|
|
19846
|
+
if (e.key === "Backspace" && inputValue === "" && tags.length > 0) {
|
|
19847
|
+
removeTag(tags.length - 1);
|
|
19848
|
+
return;
|
|
19849
|
+
}
|
|
19850
|
+
if (separators.includes(e.key)) {
|
|
19851
|
+
e.preventDefault();
|
|
19852
|
+
addTag(inputValue);
|
|
19853
|
+
}
|
|
19854
|
+
};
|
|
19855
|
+
const handleBlur = (e) => {
|
|
19856
|
+
onBlur?.(e);
|
|
19857
|
+
if (inputValue.trim()) {
|
|
19858
|
+
addTag(inputValue);
|
|
19859
|
+
}
|
|
19860
|
+
};
|
|
19861
|
+
const handleChange = (e) => {
|
|
19862
|
+
const val = e.target.value;
|
|
19863
|
+
const hasSeparator = separators.some((sep) => val.includes(sep));
|
|
19864
|
+
if (hasSeparator) {
|
|
19865
|
+
const parts = val.split(new RegExp(`[${separators.join("")}]`));
|
|
19866
|
+
parts.slice(0, -1).forEach((part) => addTag(part));
|
|
19867
|
+
setInputValue(parts[parts.length - 1]);
|
|
19868
|
+
} else {
|
|
19869
|
+
setInputValue(val);
|
|
19870
|
+
}
|
|
19871
|
+
};
|
|
19872
|
+
return /* @__PURE__ */ jsxs(
|
|
19873
|
+
"div",
|
|
19874
|
+
{
|
|
19875
|
+
className: cn("flex flex-col w-full min-w-[150px]"),
|
|
19876
|
+
"data-testid": dataTestId,
|
|
19877
|
+
children: [
|
|
19878
|
+
label && /* @__PURE__ */ jsx(LabelBase_default, { className: "mb-1", children: label }),
|
|
19879
|
+
/* @__PURE__ */ jsxs(
|
|
19880
|
+
"div",
|
|
19881
|
+
{
|
|
19882
|
+
className: cn(
|
|
19883
|
+
"flex flex-wrap items-center gap-1.5 min-h-9 rounded-md border bg-background px-2 py-1.5 transition",
|
|
19884
|
+
error ? "border-destructive focus-within:ring-1 focus-within:ring-destructive" : "border-input focus-within:ring-2 focus-within:ring-ring/50 focus-within:border-ring",
|
|
19885
|
+
disabled && "opacity-50 pointer-events-none",
|
|
19886
|
+
className
|
|
19887
|
+
),
|
|
19888
|
+
children: [
|
|
19889
|
+
tags.map((tag, i) => /* @__PURE__ */ jsx(
|
|
19890
|
+
TagChip,
|
|
19891
|
+
{
|
|
19892
|
+
label: tag,
|
|
19893
|
+
disabled,
|
|
19894
|
+
onRemove: () => removeTag(i),
|
|
19895
|
+
testid: `${dataTestId}-tag-${i}`
|
|
19896
|
+
},
|
|
19897
|
+
`${tag}-${i}`
|
|
19898
|
+
)),
|
|
19899
|
+
!isMaxReached && /* @__PURE__ */ jsx(
|
|
19900
|
+
"input",
|
|
19901
|
+
{
|
|
19902
|
+
ref,
|
|
19903
|
+
type: "text",
|
|
19904
|
+
value: inputValue,
|
|
19905
|
+
onChange: handleChange,
|
|
19906
|
+
onKeyDown: handleKeyDown,
|
|
19907
|
+
onBlur: handleBlur,
|
|
19908
|
+
disabled,
|
|
19909
|
+
placeholder: tags.length === 0 ? placeholder : "",
|
|
19910
|
+
"data-testid": `${dataTestId}-input`,
|
|
19911
|
+
className: cn(
|
|
19912
|
+
"flex-1 min-w-[120px] bg-transparent text-sm text-foreground",
|
|
19913
|
+
"placeholder:text-muted-foreground focus:outline-none",
|
|
19914
|
+
"disabled:cursor-not-allowed"
|
|
19915
|
+
),
|
|
19916
|
+
...props
|
|
19917
|
+
}
|
|
19918
|
+
),
|
|
19919
|
+
isMaxReached && tags.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground ml-1", children: [
|
|
19920
|
+
"M\xE1x. ",
|
|
19921
|
+
maxTags,
|
|
19922
|
+
" tags"
|
|
19923
|
+
] })
|
|
19924
|
+
]
|
|
19925
|
+
}
|
|
19926
|
+
),
|
|
19927
|
+
/* @__PURE__ */ jsx(ErrorMessage, { error })
|
|
19928
|
+
]
|
|
19929
|
+
}
|
|
19930
|
+
);
|
|
19931
|
+
}
|
|
19932
|
+
);
|
|
19933
|
+
TagInput.displayName = "TagInput";
|
|
19716
19934
|
function Leaderboard({
|
|
19717
19935
|
items,
|
|
19718
19936
|
order: initialOrder = "desc",
|
|
@@ -20974,4 +21192,4 @@ function CircularProgress({
|
|
|
20974
21192
|
);
|
|
20975
21193
|
}
|
|
20976
21194
|
|
|
20977
|
-
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, CircularProgress, 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, FileAccept, 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,
|
|
21195
|
+
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, CircularProgress, 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, FileAccept, 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, YearViewAgenda, 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, startOfLocalDay, toast, useBiaxial, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartLayout, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useOpenTooltipForPeriod, useProcessedData, useSeriesOpacity, useTheme, useTimeSeriesRange, visualForItem };
|