@mlw-packages/react-components 1.8.14 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +64 -5
- package/dist/index.d.mts +7 -75
- package/dist/index.d.ts +7 -75
- package/dist/index.js +266 -1477
- package/dist/index.mjs +267 -1477
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -42,7 +42,7 @@ import ptBR3 from 'date-fns/locale/pt-BR';
|
|
|
42
42
|
import { useSensors, useSensor, MouseSensor, TouchSensor, PointerSensor, DndContext, DragOverlay, useDroppable, useDraggable } from '@dnd-kit/core';
|
|
43
43
|
import { CSS } from '@dnd-kit/utilities';
|
|
44
44
|
import { RadioGroup, RadioGroupItem } from '@radix-ui/react-radio-group';
|
|
45
|
-
import { ResponsiveContainer, ComposedChart, XAxis, YAxis, Bar, Line, Area, CartesianGrid, ReferenceLine, Tooltip, Legend, LabelList, Rectangle,
|
|
45
|
+
import { ResponsiveContainer, ComposedChart, XAxis, YAxis, Bar, Line, Area, CartesianGrid, ReferenceLine, Tooltip, Legend, LabelList, Rectangle, PieChart, Pie, Cell } from 'recharts';
|
|
46
46
|
|
|
47
47
|
var __create = Object.create;
|
|
48
48
|
var __defProp = Object.defineProperty;
|
|
@@ -541,7 +541,7 @@ var AlertDialogContentBase = React33.forwardRef(({ className, testid = "alertdia
|
|
|
541
541
|
{
|
|
542
542
|
ref,
|
|
543
543
|
className: cn(
|
|
544
|
-
"fixed left-[50%] top-[50%] z-50 grid w-
|
|
544
|
+
"fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-3 sm:gap-4 border bg-background p-4 sm: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%] rounded-md sm:rounded-lg max-h-[calc(100dvh-2rem)] sm:max-h-[90dvh] overflow-auto border-border",
|
|
545
545
|
className
|
|
546
546
|
),
|
|
547
547
|
"data-testid": testid,
|
|
@@ -557,7 +557,7 @@ var AlertDialogHeaderBase = ({
|
|
|
557
557
|
"div",
|
|
558
558
|
{
|
|
559
559
|
className: cn(
|
|
560
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
560
|
+
"flex flex-col space-y-1 sm:space-y-2 text-center sm:text-left",
|
|
561
561
|
className
|
|
562
562
|
),
|
|
563
563
|
...props
|
|
@@ -571,7 +571,7 @@ var AlertDialogFooterBase = ({
|
|
|
571
571
|
"div",
|
|
572
572
|
{
|
|
573
573
|
className: cn(
|
|
574
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end",
|
|
574
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:space-x-2 sm:gap-0",
|
|
575
575
|
className
|
|
576
576
|
),
|
|
577
577
|
...props
|
|
@@ -1284,19 +1284,21 @@ function useIsMobile() {
|
|
|
1284
1284
|
}, []);
|
|
1285
1285
|
return !!isMobile;
|
|
1286
1286
|
}
|
|
1287
|
+
var isTouchDevice = () => {
|
|
1288
|
+
return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints !== void 0;
|
|
1289
|
+
};
|
|
1287
1290
|
var useDrag = (options = {}) => {
|
|
1288
1291
|
const [isDragging, setIsDragging] = useState(null);
|
|
1289
1292
|
const [positions, setPositions] = useState({});
|
|
1290
1293
|
const dragStartPos = useRef(null);
|
|
1291
1294
|
const dragId = useRef(null);
|
|
1295
|
+
const isTouch = useRef(isTouchDevice());
|
|
1292
1296
|
const handleDragStart = useCallback(
|
|
1293
1297
|
(id, e) => {
|
|
1294
1298
|
const isTouchEvent = "touches" in e;
|
|
1295
1299
|
const clientX = isTouchEvent ? e.touches[0].clientX : e.clientX;
|
|
1296
1300
|
const clientY = isTouchEvent ? e.touches[0].clientY : e.clientY;
|
|
1297
|
-
|
|
1298
|
-
e.preventDefault();
|
|
1299
|
-
}
|
|
1301
|
+
e.preventDefault();
|
|
1300
1302
|
const currentPosition = positions[id] || { top: 0, left: 0 };
|
|
1301
1303
|
dragStartPos.current = {
|
|
1302
1304
|
x: clientX,
|
|
@@ -1314,6 +1316,9 @@ var useDrag = (options = {}) => {
|
|
|
1314
1316
|
(e) => {
|
|
1315
1317
|
if (!isDragging || !dragStartPos.current || !dragId.current) return;
|
|
1316
1318
|
const isTouchEvent = "touches" in e;
|
|
1319
|
+
if (isTouchEvent) {
|
|
1320
|
+
e.preventDefault();
|
|
1321
|
+
}
|
|
1317
1322
|
const clientX = isTouchEvent ? e.touches[0].clientX : e.clientX;
|
|
1318
1323
|
const clientY = isTouchEvent ? e.touches[0].clientY : e.clientY;
|
|
1319
1324
|
const deltaX = clientX - dragStartPos.current.x;
|
|
@@ -1348,18 +1353,25 @@ var useDrag = (options = {}) => {
|
|
|
1348
1353
|
}, [options]);
|
|
1349
1354
|
useEffect(() => {
|
|
1350
1355
|
if (isDragging) {
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1356
|
+
const isTouchDev = isTouch.current;
|
|
1357
|
+
if (isTouchDev) {
|
|
1358
|
+
document.addEventListener("touchmove", handleMouseMove, {
|
|
1359
|
+
passive: false
|
|
1360
|
+
});
|
|
1361
|
+
document.addEventListener("touchend", handleMouseUp);
|
|
1362
|
+
} else {
|
|
1363
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
1364
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
1365
|
+
}
|
|
1357
1366
|
document.body.style.userSelect = "none";
|
|
1358
1367
|
return () => {
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1368
|
+
if (isTouchDev) {
|
|
1369
|
+
document.removeEventListener("touchmove", handleMouseMove);
|
|
1370
|
+
document.removeEventListener("touchend", handleMouseUp);
|
|
1371
|
+
} else {
|
|
1372
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
1373
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
1374
|
+
}
|
|
1363
1375
|
document.body.style.userSelect = "";
|
|
1364
1376
|
};
|
|
1365
1377
|
}
|
|
@@ -1619,7 +1631,7 @@ var ModalContentBase = React33.forwardRef(
|
|
|
1619
1631
|
{
|
|
1620
1632
|
ref,
|
|
1621
1633
|
className: cn(
|
|
1622
|
-
"fixed z-50 grid w-
|
|
1634
|
+
"fixed z-50 grid w-[calc(100%-2rem)] gap-3 sm:gap-4 border bg-background p-4 sm:p-6 shadow-lg rounded-md sm:rounded-lg max-h-[calc(100dvh-2rem)] sm:max-h-[90dvh] overflow-auto",
|
|
1623
1635
|
"data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out border-border",
|
|
1624
1636
|
positionClass,
|
|
1625
1637
|
sizeClass,
|
|
@@ -1629,7 +1641,7 @@ var ModalContentBase = React33.forwardRef(
|
|
|
1629
1641
|
...props,
|
|
1630
1642
|
children: [
|
|
1631
1643
|
children,
|
|
1632
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-
|
|
1644
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-2 top-2 sm:right-4 sm:top-4 rounded-md bg-muted/10 p-1.5 sm:p-1.5 opacity-80 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none z-10 hover:bg-muted/20 transition-colors", children: [
|
|
1633
1645
|
/* @__PURE__ */ jsx(XIcon, { className: "h-5 w-5 sm:h-4 sm:w-4 text-foreground" }),
|
|
1634
1646
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1635
1647
|
] })
|
|
@@ -1645,7 +1657,7 @@ var ModalHeaderBase = React33.forwardRef(({ className, testid: dataTestId = "mod
|
|
|
1645
1657
|
{
|
|
1646
1658
|
ref,
|
|
1647
1659
|
className: cn(
|
|
1648
|
-
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
1660
|
+
"flex flex-col space-y-1 sm:space-y-1.5 text-center sm:text-left pr-8 sm:pr-0",
|
|
1649
1661
|
className
|
|
1650
1662
|
),
|
|
1651
1663
|
"data-testid": dataTestId,
|
|
@@ -1658,7 +1670,7 @@ var ModalFooterBase = React33.forwardRef(({ className, testid: dataTestId = "mod
|
|
|
1658
1670
|
{
|
|
1659
1671
|
ref,
|
|
1660
1672
|
className: cn(
|
|
1661
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
1673
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:space-x-2 sm:gap-0",
|
|
1662
1674
|
className
|
|
1663
1675
|
),
|
|
1664
1676
|
"data-testid": dataTestId,
|
|
@@ -2084,6 +2096,7 @@ function ComboboxBase({
|
|
|
2084
2096
|
hideClear = false
|
|
2085
2097
|
}) {
|
|
2086
2098
|
const [open, setOpen] = useState(false);
|
|
2099
|
+
const isMobile = useIsMobile();
|
|
2087
2100
|
return /* @__PURE__ */ jsxs(
|
|
2088
2101
|
"div",
|
|
2089
2102
|
{
|
|
@@ -2095,7 +2108,7 @@ function ComboboxBase({
|
|
|
2095
2108
|
{
|
|
2096
2109
|
open,
|
|
2097
2110
|
onOpenChange: (v) => !disabled && setOpen(v),
|
|
2098
|
-
modal:
|
|
2111
|
+
modal: isMobile,
|
|
2099
2112
|
children: [
|
|
2100
2113
|
/* @__PURE__ */ jsx(
|
|
2101
2114
|
PopoverTriggerBase,
|
|
@@ -2545,7 +2558,7 @@ function MultiSelectValueBase({
|
|
|
2545
2558
|
{
|
|
2546
2559
|
"data-selected-item": true,
|
|
2547
2560
|
size: "sm",
|
|
2548
|
-
className: "group flex items-center gap-1",
|
|
2561
|
+
className: "group flex items-center gap-1 border-border",
|
|
2549
2562
|
onClick: clickToRemove ? (e) => {
|
|
2550
2563
|
e.stopPropagation();
|
|
2551
2564
|
toggleValue(value);
|
|
@@ -2610,7 +2623,7 @@ function MultiSelectContentBase({
|
|
|
2610
2623
|
{
|
|
2611
2624
|
placeholder: typeof search === "object" ? search.placeholder : void 0
|
|
2612
2625
|
}
|
|
2613
|
-
) : /* @__PURE__ */ jsx("button", { autoFocus: true, className: "sr-only" }),
|
|
2626
|
+
) : /* @__PURE__ */ jsx("button", { autoFocus: true, className: "sr-only " }),
|
|
2614
2627
|
/* @__PURE__ */ jsxs(CommandListBase, { className: "border-border", children: [
|
|
2615
2628
|
canSearch && /* @__PURE__ */ jsx(CommandEmptyBase, { children: typeof search === "object" ? search.emptyMessage ?? emptyMessage : emptyMessage }),
|
|
2616
2629
|
children
|
|
@@ -2668,7 +2681,7 @@ function useMultiSelectContext() {
|
|
|
2668
2681
|
const context = useContext(MultiSelectContext);
|
|
2669
2682
|
if (context == null) {
|
|
2670
2683
|
throw new Error(
|
|
2671
|
-
"useMultiSelectContext must be used within a MultiSelectContext"
|
|
2684
|
+
"useMultiSelectContext must be used within a MultiSelectContext "
|
|
2672
2685
|
);
|
|
2673
2686
|
}
|
|
2674
2687
|
return context;
|
|
@@ -2853,7 +2866,7 @@ var SelectContentBase = React33.forwardRef(
|
|
|
2853
2866
|
{
|
|
2854
2867
|
className: cn(
|
|
2855
2868
|
"p-1",
|
|
2856
|
-
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
2869
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-trigger-width)]"
|
|
2857
2870
|
),
|
|
2858
2871
|
children
|
|
2859
2872
|
}
|
|
@@ -2917,6 +2930,20 @@ var SelectSeparatorBase = React33.forwardRef(({ className, ...props }, ref) => /
|
|
|
2917
2930
|
}
|
|
2918
2931
|
));
|
|
2919
2932
|
SelectSeparatorBase.displayName = SelectPrimitive.Separator.displayName;
|
|
2933
|
+
var SelectEmpty = React33.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2934
|
+
"div",
|
|
2935
|
+
{
|
|
2936
|
+
ref,
|
|
2937
|
+
className: cn(
|
|
2938
|
+
"w-full min-h-[3rem] flex items-center justify-center px-4 py-3 text-sm text-center",
|
|
2939
|
+
className
|
|
2940
|
+
),
|
|
2941
|
+
...props,
|
|
2942
|
+
children: /* @__PURE__ */ jsx("span", { className: "block w-full break-words hyphens-auto", children })
|
|
2943
|
+
}
|
|
2944
|
+
));
|
|
2945
|
+
SelectEmpty.displayName = "SelectEmpty";
|
|
2946
|
+
SelectItemBase.displayName = SelectPrimitive.Item.displayName;
|
|
2920
2947
|
var DropDownMenuBase = DropdownMenuPrimitive.Root;
|
|
2921
2948
|
var DropDownMenuTriggerBase = DropdownMenuPrimitive.Trigger;
|
|
2922
2949
|
var DropDownMenuGroupBase = DropdownMenuPrimitive.Group;
|
|
@@ -3177,36 +3204,45 @@ function ModeToggleBase({
|
|
|
3177
3204
|
}, []);
|
|
3178
3205
|
const isDark = mounted && (currentTheme?.includes("dark") || currentTheme === "system" && typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
3179
3206
|
const toggleTheme = async (newTheme) => {
|
|
3180
|
-
if (!buttonRef.current
|
|
3207
|
+
if (!buttonRef.current) {
|
|
3181
3208
|
setTheme(newTheme);
|
|
3182
3209
|
return;
|
|
3183
3210
|
}
|
|
3184
|
-
const
|
|
3185
|
-
|
|
3186
|
-
const y = rect.top + rect.height / 2;
|
|
3187
|
-
const endRadius = Math.hypot(
|
|
3188
|
-
Math.max(x, window.innerWidth - x),
|
|
3189
|
-
Math.max(y, window.innerHeight - y)
|
|
3190
|
-
);
|
|
3191
|
-
const transition = document.startViewTransition(async () => {
|
|
3211
|
+
const supportsViewTransition = typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function";
|
|
3212
|
+
if (!supportsViewTransition) {
|
|
3192
3213
|
setTheme(newTheme);
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3214
|
+
return;
|
|
3215
|
+
}
|
|
3216
|
+
try {
|
|
3217
|
+
const rect = buttonRef.current.getBoundingClientRect();
|
|
3218
|
+
const x = rect.left + rect.width / 2;
|
|
3219
|
+
const y = rect.top + rect.height / 2;
|
|
3220
|
+
const endRadius = Math.hypot(
|
|
3221
|
+
Math.max(x, window.innerWidth - x),
|
|
3222
|
+
Math.max(y, window.innerHeight - y)
|
|
3223
|
+
);
|
|
3224
|
+
const transition = document.startViewTransition(async () => {
|
|
3225
|
+
setTheme(newTheme);
|
|
3226
|
+
});
|
|
3227
|
+
await transition.ready;
|
|
3228
|
+
document.documentElement.animate(
|
|
3229
|
+
[
|
|
3230
|
+
{
|
|
3231
|
+
clipPath: `circle(0px at ${x}px ${y}px)`
|
|
3232
|
+
},
|
|
3233
|
+
{
|
|
3234
|
+
clipPath: `circle(${Math.ceil(endRadius)}px at ${x}px ${y}px)`
|
|
3235
|
+
}
|
|
3236
|
+
],
|
|
3200
3237
|
{
|
|
3201
|
-
|
|
3238
|
+
duration: 400,
|
|
3239
|
+
easing: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
3240
|
+
pseudoElement: "::view-transition-new(root)"
|
|
3202
3241
|
}
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
pseudoElement: "::view-transition-new(root)"
|
|
3208
|
-
}
|
|
3209
|
-
);
|
|
3242
|
+
);
|
|
3243
|
+
} catch {
|
|
3244
|
+
setTheme(newTheme);
|
|
3245
|
+
}
|
|
3210
3246
|
};
|
|
3211
3247
|
return /* @__PURE__ */ jsxs(DropDownMenuBase, { children: [
|
|
3212
3248
|
/* @__PURE__ */ jsx(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
@@ -3215,10 +3251,7 @@ function ModeToggleBase({
|
|
|
3215
3251
|
ref: buttonRef,
|
|
3216
3252
|
variant,
|
|
3217
3253
|
size: "icon",
|
|
3218
|
-
className: cn(
|
|
3219
|
-
"relative overflow-hidden group",
|
|
3220
|
-
className
|
|
3221
|
-
),
|
|
3254
|
+
className: cn("relative overflow-hidden group", className),
|
|
3222
3255
|
children: [
|
|
3223
3256
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3224
3257
|
/* @__PURE__ */ jsx(
|
|
@@ -7603,117 +7636,68 @@ function useScrollColumn({
|
|
|
7603
7636
|
}) {
|
|
7604
7637
|
const containerRef = useRef(null);
|
|
7605
7638
|
const items = getItems(max, step);
|
|
7606
|
-
const [isDragging, setIsDragging] = useState(false);
|
|
7607
|
-
const [startY, setStartY] = useState(0);
|
|
7608
|
-
const [scrollTop, setScrollTop] = useState(0);
|
|
7609
7639
|
const scrollTimeoutRef = useRef(null);
|
|
7610
|
-
const
|
|
7640
|
+
const isScrollingRef = useRef(false);
|
|
7641
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
7642
|
+
const startYRef = useRef(0);
|
|
7643
|
+
const startScrollRef = useRef(0);
|
|
7611
7644
|
const itemHeight = ITEM_HEIGHT;
|
|
7612
7645
|
const centerIndex = CENTER_INDEX;
|
|
7613
7646
|
const visibleItems = VISIBLE_ITEMS;
|
|
7614
7647
|
const containerHeight = visibleItems * itemHeight;
|
|
7615
7648
|
useEffect(() => {
|
|
7616
|
-
if (containerRef.current && !
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
const scrollPosition = clampedIndex * itemHeight;
|
|
7622
|
-
containerRef.current.scrollTop = scrollPosition;
|
|
7623
|
-
}
|
|
7624
|
-
});
|
|
7649
|
+
if (containerRef.current && !isScrollingRef.current) {
|
|
7650
|
+
const index = Math.round(value / step);
|
|
7651
|
+
const clampedIndex = Math.max(0, Math.min(items.length - 1, index));
|
|
7652
|
+
const scrollPosition = clampedIndex * itemHeight;
|
|
7653
|
+
containerRef.current.scrollTop = scrollPosition;
|
|
7625
7654
|
}
|
|
7626
|
-
}, [value,
|
|
7655
|
+
}, [value, itemHeight, step, items.length]);
|
|
7627
7656
|
useEffect(() => {
|
|
7628
7657
|
return () => {
|
|
7629
7658
|
if (scrollTimeoutRef.current) clearTimeout(scrollTimeoutRef.current);
|
|
7630
7659
|
};
|
|
7631
7660
|
}, []);
|
|
7632
|
-
const handleScroll = (
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
if (!containerRef.current || isDragging) return;
|
|
7661
|
+
const handleScroll = () => {
|
|
7662
|
+
if (!containerRef.current) return;
|
|
7663
|
+
isScrollingRef.current = true;
|
|
7636
7664
|
if (scrollTimeoutRef.current) clearTimeout(scrollTimeoutRef.current);
|
|
7637
7665
|
scrollTimeoutRef.current = setTimeout(() => {
|
|
7638
7666
|
if (!containerRef.current) return;
|
|
7639
7667
|
const newIndex = Math.round(containerRef.current.scrollTop / itemHeight);
|
|
7640
7668
|
const newValue = items[newIndex];
|
|
7641
|
-
if (newValue !== void 0) {
|
|
7642
|
-
|
|
7643
|
-
if (newValue !== value) onChange(newValue);
|
|
7669
|
+
if (newValue !== void 0 && newValue !== value) {
|
|
7670
|
+
onChange(newValue);
|
|
7644
7671
|
}
|
|
7645
|
-
|
|
7672
|
+
isScrollingRef.current = false;
|
|
7673
|
+
}, 150);
|
|
7646
7674
|
};
|
|
7647
|
-
const
|
|
7675
|
+
const handleMouseDown = (e) => {
|
|
7648
7676
|
if (!containerRef.current) return;
|
|
7649
7677
|
setIsDragging(true);
|
|
7650
|
-
|
|
7651
|
-
|
|
7678
|
+
startYRef.current = e.clientY;
|
|
7679
|
+
startScrollRef.current = containerRef.current.scrollTop;
|
|
7680
|
+
e.preventDefault();
|
|
7652
7681
|
};
|
|
7653
|
-
const
|
|
7682
|
+
const handleMouseMove = (e) => {
|
|
7654
7683
|
if (!isDragging || !containerRef.current) return;
|
|
7655
|
-
const
|
|
7656
|
-
containerRef.current.scrollTop =
|
|
7684
|
+
const deltaY = startYRef.current - e.clientY;
|
|
7685
|
+
containerRef.current.scrollTop = startScrollRef.current + deltaY;
|
|
7657
7686
|
};
|
|
7658
|
-
const
|
|
7659
|
-
if (!containerRef.current) return;
|
|
7687
|
+
const handleMouseUp = () => {
|
|
7660
7688
|
setIsDragging(false);
|
|
7661
|
-
requestAnimationFrame(() => {
|
|
7662
|
-
if (!containerRef.current) return;
|
|
7663
|
-
const newIndex = Math.round(containerRef.current.scrollTop / itemHeight);
|
|
7664
|
-
const newValue = items[newIndex];
|
|
7665
|
-
if (newValue !== void 0) {
|
|
7666
|
-
containerRef.current.scrollTop = newIndex * itemHeight;
|
|
7667
|
-
onChange(newValue);
|
|
7668
|
-
}
|
|
7669
|
-
});
|
|
7670
|
-
};
|
|
7671
|
-
const handlers = {
|
|
7672
|
-
onScroll: handleScroll,
|
|
7673
|
-
onWheel: (e) => e.stopPropagation(),
|
|
7674
|
-
onMouseDown: (e) => {
|
|
7675
|
-
isTouchRef.current = false;
|
|
7676
|
-
handleStart(e.pageY);
|
|
7677
|
-
},
|
|
7678
|
-
onMouseMove: (e) => {
|
|
7679
|
-
if (isDragging) {
|
|
7680
|
-
e.preventDefault();
|
|
7681
|
-
handleMove(e.pageY);
|
|
7682
|
-
}
|
|
7683
|
-
},
|
|
7684
|
-
onMouseUp: () => handleEnd(),
|
|
7685
|
-
onMouseLeave: () => {
|
|
7686
|
-
if (isDragging) handleEnd();
|
|
7687
|
-
},
|
|
7688
|
-
onTouchStart: (e) => {
|
|
7689
|
-
isTouchRef.current = true;
|
|
7690
|
-
handleStart(e.touches[0].pageY);
|
|
7691
|
-
},
|
|
7692
|
-
onTouchMove: (e) => {
|
|
7693
|
-
if (isDragging) {
|
|
7694
|
-
if (e.cancelable) e.preventDefault();
|
|
7695
|
-
handleMove(e.touches[0].pageY);
|
|
7696
|
-
}
|
|
7697
|
-
},
|
|
7698
|
-
onTouchEnd: () => {
|
|
7699
|
-
isTouchRef.current = false;
|
|
7700
|
-
handleEnd();
|
|
7701
|
-
}
|
|
7702
|
-
};
|
|
7703
|
-
const scrollToIndex = (index) => {
|
|
7704
|
-
if (!containerRef.current) return;
|
|
7705
|
-
const clamped = Math.max(0, Math.min(items.length - 1, index));
|
|
7706
|
-
containerRef.current.scrollTop = clamped * itemHeight;
|
|
7707
7689
|
};
|
|
7708
7690
|
return {
|
|
7709
7691
|
items,
|
|
7710
7692
|
containerRef,
|
|
7711
|
-
isDragging,
|
|
7712
7693
|
itemHeight,
|
|
7713
7694
|
containerHeight,
|
|
7714
7695
|
centerIndex,
|
|
7715
|
-
|
|
7716
|
-
|
|
7696
|
+
handleScroll,
|
|
7697
|
+
handleMouseDown,
|
|
7698
|
+
handleMouseMove,
|
|
7699
|
+
handleMouseUp,
|
|
7700
|
+
isDragging
|
|
7717
7701
|
};
|
|
7718
7702
|
}
|
|
7719
7703
|
function ScrollColumn({
|
|
@@ -7726,57 +7710,68 @@ function ScrollColumn({
|
|
|
7726
7710
|
const {
|
|
7727
7711
|
items,
|
|
7728
7712
|
containerRef,
|
|
7729
|
-
isDragging,
|
|
7730
7713
|
itemHeight,
|
|
7731
7714
|
containerHeight,
|
|
7732
7715
|
centerIndex,
|
|
7733
|
-
|
|
7716
|
+
handleScroll,
|
|
7717
|
+
handleMouseDown,
|
|
7718
|
+
handleMouseMove,
|
|
7719
|
+
handleMouseUp,
|
|
7720
|
+
isDragging
|
|
7734
7721
|
} = useScrollColumn({ value, onChange, max, step });
|
|
7735
7722
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
7736
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground rounded-md font-semibold text-sm
|
|
7737
|
-
/* @__PURE__ */
|
|
7738
|
-
"div",
|
|
7739
|
-
{
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
"
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7723
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground rounded-md font-semibold text-sm text-center pb-2 uppercase tracking-wider", children: label }),
|
|
7724
|
+
/* @__PURE__ */ jsxs("div", { className: cn("relative w-24 sm:w-20"), children: [
|
|
7725
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 right-0 h-16 bg-gradient-to-b from-background via-background/80 to-transparent pointer-events-none z-20" }),
|
|
7726
|
+
/* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 h-16 bg-gradient-to-t from-background via-background/80 to-transparent pointer-events-none z-20" }),
|
|
7727
|
+
/* @__PURE__ */ jsx(
|
|
7728
|
+
"div",
|
|
7729
|
+
{
|
|
7730
|
+
className: "absolute left-0 right-0 pointer-events-none bg-muted/50 backdrop-blur-sm rounded-md border border-border",
|
|
7731
|
+
style: {
|
|
7732
|
+
top: `${centerIndex * itemHeight}px`,
|
|
7733
|
+
height: `${itemHeight}px`
|
|
7734
|
+
}
|
|
7735
|
+
}
|
|
7736
|
+
),
|
|
7737
|
+
/* @__PURE__ */ jsx(
|
|
7738
|
+
"div",
|
|
7739
|
+
{
|
|
7740
|
+
ref: containerRef,
|
|
7741
|
+
onScroll: handleScroll,
|
|
7742
|
+
onMouseDown: handleMouseDown,
|
|
7743
|
+
onMouseMove: handleMouseMove,
|
|
7744
|
+
onMouseUp: handleMouseUp,
|
|
7745
|
+
onMouseLeave: handleMouseUp,
|
|
7746
|
+
className: cn(
|
|
7747
|
+
"overflow-y-scroll snap-y snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none] overscroll-contain",
|
|
7748
|
+
isDragging && "cursor-grabbing"
|
|
7749
|
+
),
|
|
7750
|
+
style: {
|
|
7751
|
+
height: `${containerHeight}px`,
|
|
7752
|
+
paddingTop: `${centerIndex * itemHeight}px`,
|
|
7753
|
+
paddingBottom: `${centerIndex * itemHeight}px`,
|
|
7754
|
+
cursor: isDragging ? "grabbing" : "grab"
|
|
7755
|
+
},
|
|
7756
|
+
children: items.map((item, idx) => {
|
|
7757
|
+
const itemIndex = items.indexOf(value);
|
|
7758
|
+
const isCentered = idx === itemIndex;
|
|
7759
|
+
return /* @__PURE__ */ jsx(
|
|
7760
|
+
"div",
|
|
7761
|
+
{
|
|
7762
|
+
className: cn(
|
|
7763
|
+
"snap-center flex items-center justify-center select-none font-bold tabular-nums transition-all duration-200",
|
|
7764
|
+
isCentered ? "text-2xl sm:text-xl text-foreground scale-110" : "text-base sm:text-sm text-muted-foreground/60"
|
|
7765
|
+
),
|
|
7766
|
+
style: { height: `${itemHeight}px` },
|
|
7767
|
+
children: item.toString().padStart(2, "0")
|
|
7772
7768
|
},
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
) })
|
|
7769
|
+
item
|
|
7770
|
+
);
|
|
7771
|
+
})
|
|
7772
|
+
}
|
|
7773
|
+
)
|
|
7774
|
+
] })
|
|
7780
7775
|
] });
|
|
7781
7776
|
}
|
|
7782
7777
|
function TimeScrollPicker({
|
|
@@ -7785,8 +7780,6 @@ function TimeScrollPicker({
|
|
|
7785
7780
|
hideSeconds = false
|
|
7786
7781
|
}) {
|
|
7787
7782
|
const currentDate = date || /* @__PURE__ */ new Date();
|
|
7788
|
-
const itemHeight = ITEM_HEIGHT;
|
|
7789
|
-
const centerIndex = CENTER_INDEX;
|
|
7790
7783
|
const handleTimeChange = (type, value) => {
|
|
7791
7784
|
const newDate = new Date(currentDate);
|
|
7792
7785
|
if (type === "hours") newDate.setHours(value);
|
|
@@ -7794,17 +7787,7 @@ function TimeScrollPicker({
|
|
|
7794
7787
|
else newDate.setSeconds(value);
|
|
7795
7788
|
setDate(newDate);
|
|
7796
7789
|
};
|
|
7797
|
-
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center gap-2 p-1.5 sm:p-4", children: /* @__PURE__ */ jsxs("div", { className:
|
|
7798
|
-
/* @__PURE__ */ jsx(
|
|
7799
|
-
"div",
|
|
7800
|
-
{
|
|
7801
|
-
className: "absolute left-0 right-0 pointer-events-none z-10 rounded-lg bg-primary/10 border border-primary/20",
|
|
7802
|
-
style: {
|
|
7803
|
-
top: `calc(1.85rem + ${centerIndex * itemHeight}px)`,
|
|
7804
|
-
height: `${itemHeight}px`
|
|
7805
|
-
}
|
|
7806
|
-
}
|
|
7807
|
-
),
|
|
7790
|
+
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center gap-2 p-1.5 sm:p-4", children: /* @__PURE__ */ jsxs("div", { className: "relative flex gap-2 sm:gap-3", children: [
|
|
7808
7791
|
/* @__PURE__ */ jsx(
|
|
7809
7792
|
ScrollColumn,
|
|
7810
7793
|
{
|
|
@@ -7812,7 +7795,7 @@ function TimeScrollPicker({
|
|
|
7812
7795
|
onChange: (v) => handleTimeChange("hours", v),
|
|
7813
7796
|
max: 24,
|
|
7814
7797
|
label: "Hora",
|
|
7815
|
-
|
|
7798
|
+
step: 1
|
|
7816
7799
|
}
|
|
7817
7800
|
),
|
|
7818
7801
|
/* @__PURE__ */ jsx(
|
|
@@ -7822,8 +7805,7 @@ function TimeScrollPicker({
|
|
|
7822
7805
|
onChange: (v) => handleTimeChange("minutes", v),
|
|
7823
7806
|
max: 60,
|
|
7824
7807
|
step: 5,
|
|
7825
|
-
label: "Min"
|
|
7826
|
-
hideSeconds
|
|
7808
|
+
label: "Min"
|
|
7827
7809
|
}
|
|
7828
7810
|
),
|
|
7829
7811
|
!hideSeconds && /* @__PURE__ */ jsx(
|
|
@@ -7833,7 +7815,7 @@ function TimeScrollPicker({
|
|
|
7833
7815
|
onChange: (v) => handleTimeChange("seconds", v),
|
|
7834
7816
|
max: 60,
|
|
7835
7817
|
label: "Seg",
|
|
7836
|
-
|
|
7818
|
+
step: 1
|
|
7837
7819
|
}
|
|
7838
7820
|
)
|
|
7839
7821
|
] }) });
|
|
@@ -9854,7 +9836,7 @@ function Select({
|
|
|
9854
9836
|
]
|
|
9855
9837
|
}
|
|
9856
9838
|
),
|
|
9857
|
-
/* @__PURE__ */ jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children:
|
|
9839
|
+
/* @__PURE__ */ jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: pagination && pagination > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9858
9840
|
/* @__PURE__ */ jsx(
|
|
9859
9841
|
"div",
|
|
9860
9842
|
{
|
|
@@ -9929,7 +9911,7 @@ function Select({
|
|
|
9929
9911
|
}
|
|
9930
9912
|
)
|
|
9931
9913
|
] })
|
|
9932
|
-
] }) : /* @__PURE__ */ jsx(Fragment, { children: groupItems ? /* @__PURE__ */ jsx(Fragment, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ jsxs(
|
|
9914
|
+
] }) : /* @__PURE__ */ jsx(Fragment, { children: groupItems ? Object.keys(groupItems).length > 0 ? /* @__PURE__ */ jsx(Fragment, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ jsxs(
|
|
9933
9915
|
SelectGroupBase,
|
|
9934
9916
|
{
|
|
9935
9917
|
"data-testid": testIds.group ?? "select-group",
|
|
@@ -9953,7 +9935,7 @@ function Select({
|
|
|
9953
9935
|
]
|
|
9954
9936
|
},
|
|
9955
9937
|
key
|
|
9956
|
-
)) }) : /* @__PURE__ */ jsx(
|
|
9938
|
+
)) }) : /* @__PURE__ */ jsx(SelectEmpty, { "data-testid": testIds.empty ?? "select-empty", children: empty ?? "Nenhum item dispon\xEDvel" }) : items && items.length > 0 ? /* @__PURE__ */ jsx(
|
|
9957
9939
|
SelectGroupBase,
|
|
9958
9940
|
{
|
|
9959
9941
|
"data-testid": testIds.group ?? "select-group",
|
|
@@ -9967,7 +9949,7 @@ function Select({
|
|
|
9967
9949
|
item.value
|
|
9968
9950
|
))
|
|
9969
9951
|
}
|
|
9970
|
-
) }) }) }) })
|
|
9952
|
+
) : /* @__PURE__ */ jsx(SelectEmpty, { "data-testid": testIds.empty ?? "select-empty", children: empty ?? "Nenhum item dispon\xEDvel" }) }) }) })
|
|
9971
9953
|
]
|
|
9972
9954
|
}
|
|
9973
9955
|
),
|
|
@@ -14805,6 +14787,24 @@ var DraggableTooltipComponent = ({
|
|
|
14805
14787
|
if (onPositionChange) onPositionChange(id, snapped);
|
|
14806
14788
|
});
|
|
14807
14789
|
};
|
|
14790
|
+
const handleTouchMove = (e) => {
|
|
14791
|
+
if (!dragging || !e.touches[0]) return;
|
|
14792
|
+
e.preventDefault();
|
|
14793
|
+
lastMouse.current = { x: e.touches[0].clientX, y: e.touches[0].clientY };
|
|
14794
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
14795
|
+
rafId = requestAnimationFrame(() => {
|
|
14796
|
+
const newLeft = lastMouse.current.x - offsetRef.current.x;
|
|
14797
|
+
const newTop = lastMouse.current.y - offsetRef.current.y;
|
|
14798
|
+
const rawPosition = {
|
|
14799
|
+
top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
|
|
14800
|
+
left: Math.max(0, Math.min(newLeft, window.innerWidth - 250))
|
|
14801
|
+
};
|
|
14802
|
+
updateAlignmentGuides(rawPosition);
|
|
14803
|
+
const snapped = snapToGuides(rawPosition);
|
|
14804
|
+
setLocalPos(snapped);
|
|
14805
|
+
if (onPositionChange) onPositionChange(id, snapped);
|
|
14806
|
+
});
|
|
14807
|
+
};
|
|
14808
14808
|
const handleMouseUp = () => {
|
|
14809
14809
|
if (dragging) {
|
|
14810
14810
|
setDragging(false);
|
|
@@ -14812,11 +14812,23 @@ var DraggableTooltipComponent = ({
|
|
|
14812
14812
|
if (rafId) cancelAnimationFrame(rafId);
|
|
14813
14813
|
}
|
|
14814
14814
|
};
|
|
14815
|
+
const handleTouchEnd = () => {
|
|
14816
|
+
if (dragging) {
|
|
14817
|
+
setDragging(false);
|
|
14818
|
+
setAlignmentGuides([]);
|
|
14819
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
14820
|
+
}
|
|
14821
|
+
};
|
|
14815
14822
|
if (dragging) {
|
|
14816
14823
|
document.addEventListener("mousemove", handleMouseMove, {
|
|
14817
14824
|
passive: true
|
|
14818
14825
|
});
|
|
14819
14826
|
document.addEventListener("mouseup", handleMouseUp);
|
|
14827
|
+
document.addEventListener("touchmove", handleTouchMove, {
|
|
14828
|
+
passive: false
|
|
14829
|
+
// Permite preventDefault para evitar scroll
|
|
14830
|
+
});
|
|
14831
|
+
document.addEventListener("touchend", handleTouchEnd);
|
|
14820
14832
|
document.body.style.cursor = "grabbing";
|
|
14821
14833
|
document.body.style.userSelect = "none";
|
|
14822
14834
|
}
|
|
@@ -14824,6 +14836,8 @@ var DraggableTooltipComponent = ({
|
|
|
14824
14836
|
if (rafId) cancelAnimationFrame(rafId);
|
|
14825
14837
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
14826
14838
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
14839
|
+
document.removeEventListener("touchmove", handleTouchMove);
|
|
14840
|
+
document.removeEventListener("touchend", handleTouchEnd);
|
|
14827
14841
|
document.body.style.cursor = "";
|
|
14828
14842
|
document.body.style.userSelect = "";
|
|
14829
14843
|
};
|
|
@@ -14908,6 +14922,7 @@ var DraggableTooltipComponent = ({
|
|
|
14908
14922
|
);
|
|
14909
14923
|
const handleTouchStartLocal = useCallback(
|
|
14910
14924
|
(e) => {
|
|
14925
|
+
e.preventDefault();
|
|
14911
14926
|
e.stopPropagation();
|
|
14912
14927
|
const touch = e.touches[0];
|
|
14913
14928
|
if (!touch) return;
|
|
@@ -16980,13 +16995,13 @@ var Chart = ({
|
|
|
16980
16995
|
"div",
|
|
16981
16996
|
{
|
|
16982
16997
|
ref: wrapperRef,
|
|
16983
|
-
className: cn("w-full overflow-hidden min-w-0 rounded-lg", className),
|
|
16984
|
-
children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-card relative w-full max-w-full min-w-0", children: [
|
|
16998
|
+
className: cn("w-full overflow-hidden min-w-0 rounded-lg border-border", className),
|
|
16999
|
+
children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-card relative w-full max-w-full min-w-0 py-1", children: [
|
|
16985
17000
|
title && /* @__PURE__ */ jsx(
|
|
16986
17001
|
"div",
|
|
16987
17002
|
{
|
|
16988
17003
|
className: cn(
|
|
16989
|
-
"w-full flex items-center mt-
|
|
17004
|
+
"w-full flex items-center mt-3 mb-2",
|
|
16990
17005
|
HORIZONTAL_PADDING_CLASS,
|
|
16991
17006
|
titlePosition === "center" && "justify-center",
|
|
16992
17007
|
titlePosition === "right" && "justify-end",
|
|
@@ -17436,1284 +17451,59 @@ var Chart = ({
|
|
|
17436
17451
|
);
|
|
17437
17452
|
};
|
|
17438
17453
|
var Chart_default = Chart;
|
|
17439
|
-
var
|
|
17440
|
-
|
|
17441
|
-
|
|
17442
|
-
|
|
17443
|
-
|
|
17444
|
-
|
|
17445
|
-
|
|
17446
|
-
|
|
17447
|
-
|
|
17448
|
-
|
|
17449
|
-
|
|
17450
|
-
|
|
17451
|
-
|
|
17452
|
-
|
|
17453
|
-
|
|
17454
|
-
|
|
17455
|
-
|
|
17456
|
-
|
|
17457
|
-
|
|
17458
|
-
|
|
17459
|
-
|
|
17460
|
-
|
|
17461
|
-
|
|
17454
|
+
var defaultData = [
|
|
17455
|
+
{ name: "Vendas", value: 4e3 },
|
|
17456
|
+
{ name: "Marketing", value: 3e3 },
|
|
17457
|
+
{ name: "Desenvolvimento", value: 2e3 },
|
|
17458
|
+
{ name: "Suporte", value: 1e3 },
|
|
17459
|
+
{ name: "Outros", value: 800 }
|
|
17460
|
+
];
|
|
17461
|
+
var DEFAULT_COLORS3 = [
|
|
17462
|
+
"#55af7d",
|
|
17463
|
+
// verde do projeto
|
|
17464
|
+
"#8e68ff",
|
|
17465
|
+
// roxo do projeto
|
|
17466
|
+
"#2273e1",
|
|
17467
|
+
// azul do projeto
|
|
17468
|
+
"#f59e0b",
|
|
17469
|
+
// amarelo complementar
|
|
17470
|
+
"#ef4444",
|
|
17471
|
+
// vermelho complementar
|
|
17472
|
+
"#8b5cf6",
|
|
17473
|
+
// roxo claro
|
|
17474
|
+
"#06b6d4",
|
|
17475
|
+
// ciano
|
|
17476
|
+
"#84cc16"
|
|
17477
|
+
// verde lima
|
|
17478
|
+
];
|
|
17479
|
+
var RADIAN = Math.PI / 180;
|
|
17480
|
+
var renderCustomizedLabel = ({
|
|
17481
|
+
cx = 0,
|
|
17482
|
+
cy = 0,
|
|
17483
|
+
midAngle = 0,
|
|
17484
|
+
innerRadius = 0,
|
|
17485
|
+
outerRadius = 0,
|
|
17486
|
+
percent = 0
|
|
17462
17487
|
}) => {
|
|
17463
|
-
const
|
|
17464
|
-
|
|
17465
|
-
|
|
17466
|
-
|
|
17467
|
-
|
|
17468
|
-
|
|
17469
|
-
|
|
17470
|
-
|
|
17471
|
-
|
|
17472
|
-
|
|
17473
|
-
|
|
17474
|
-
|
|
17475
|
-
|
|
17476
|
-
|
|
17477
|
-
autoLabel: true
|
|
17478
|
-
},
|
|
17479
|
-
mapperConfig: detectedFields.reduce((acc, field) => {
|
|
17480
|
-
acc[field] = {
|
|
17481
|
-
label: labelMap?.[field] ?? formatFieldName(field),
|
|
17482
|
-
type: "number",
|
|
17483
|
-
visible: true
|
|
17484
|
-
};
|
|
17485
|
-
return acc;
|
|
17486
|
-
}, {})
|
|
17487
|
-
};
|
|
17488
|
-
}
|
|
17489
|
-
const xAxisConfig2 = typeof xAxis === "string" ? { dataKey: xAxis, label: formatFieldName(xAxis), autoLabel: true } : xAxis;
|
|
17490
|
-
let mapperConfig2;
|
|
17491
|
-
if (Array.isArray(providedMapper)) {
|
|
17492
|
-
mapperConfig2 = providedMapper.reduce((acc, field) => {
|
|
17493
|
-
acc[field] = {
|
|
17494
|
-
label: labelMap?.[field] ?? formatFieldName(field),
|
|
17495
|
-
type: "auto",
|
|
17496
|
-
visible: true
|
|
17497
|
-
};
|
|
17498
|
-
return acc;
|
|
17499
|
-
}, {});
|
|
17500
|
-
} else {
|
|
17501
|
-
mapperConfig2 = Object.keys(providedMapper).reduce(
|
|
17502
|
-
(acc, key) => {
|
|
17503
|
-
acc[key] = {
|
|
17504
|
-
label: providedMapper[key]?.label ?? labelMap?.[key] ?? formatFieldName(key),
|
|
17505
|
-
type: "auto",
|
|
17506
|
-
visible: true,
|
|
17507
|
-
...providedMapper[key]
|
|
17508
|
-
// Sobrescreve com configurações do usuário
|
|
17509
|
-
};
|
|
17510
|
-
return acc;
|
|
17511
|
-
},
|
|
17512
|
-
{}
|
|
17513
|
-
);
|
|
17514
|
-
}
|
|
17515
|
-
return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
|
|
17516
|
-
}, [data, xAxis, mapper, yAxis, autoDetect, labelMap]);
|
|
17517
|
-
const { xAxisConfig, mapperConfig } = smartConfig;
|
|
17518
|
-
const [activeTooltips, setActiveTooltips] = useState([]);
|
|
17519
|
-
const [isDragging, setIsDragging] = useState(null);
|
|
17520
|
-
const [dragOffset, setDragOffset] = useState({
|
|
17521
|
-
x: 0,
|
|
17522
|
-
y: 0
|
|
17523
|
-
});
|
|
17524
|
-
const [globalTooltipCount, setGlobalTooltipCount] = useState(0);
|
|
17525
|
-
const [alignmentGuides, setAlignmentGuides] = useState([]);
|
|
17526
|
-
const processedData = data.map((item) => ({
|
|
17527
|
-
...item,
|
|
17528
|
-
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
17529
|
-
// Garantir propriedade 'name' para tooltip
|
|
17530
|
-
}));
|
|
17531
|
-
const generateColors = (dataKeys2) => {
|
|
17532
|
-
const colorMap = {};
|
|
17533
|
-
const allColors = generateAdditionalColors(colors2, dataKeys2.length);
|
|
17534
|
-
dataKeys2.forEach((key, index) => {
|
|
17535
|
-
colorMap[key] = allColors[index] || colors2[index % colors2.length];
|
|
17536
|
-
});
|
|
17537
|
-
return colorMap;
|
|
17538
|
-
};
|
|
17539
|
-
const dataKeys = Object.keys(mapperConfig);
|
|
17540
|
-
const finalColors = generateColors(dataKeys);
|
|
17541
|
-
const adaptDataForTooltip2 = (universalData) => {
|
|
17542
|
-
return {
|
|
17543
|
-
...universalData,
|
|
17544
|
-
name: String(universalData[xAxisConfig.dataKey] || "N/A")
|
|
17545
|
-
// Garantir que tem a propriedade 'name'
|
|
17546
|
-
};
|
|
17547
|
-
};
|
|
17548
|
-
const maxDataValue = useMemo(() => {
|
|
17549
|
-
let max = 0;
|
|
17550
|
-
const keys = Object.keys(mapperConfig);
|
|
17551
|
-
for (const row of processedData) {
|
|
17552
|
-
const r = row;
|
|
17553
|
-
for (const key of keys) {
|
|
17554
|
-
const v = r[key];
|
|
17555
|
-
if (typeof v === "number" && Number.isFinite(v) && v > max)
|
|
17556
|
-
max = v;
|
|
17557
|
-
}
|
|
17558
|
-
}
|
|
17559
|
-
return max;
|
|
17560
|
-
}, [processedData, mapperConfig]);
|
|
17561
|
-
const niceMax = useMemo(() => {
|
|
17562
|
-
let padding2 = 0.08;
|
|
17563
|
-
if (maxDataValue > 1e6) padding2 = 0.05;
|
|
17564
|
-
if (maxDataValue > 1e7) padding2 = 0.03;
|
|
17565
|
-
if (maxDataValue === 0) padding2 = 0.12;
|
|
17566
|
-
const padded = maxDataValue * (1 + padding2);
|
|
17567
|
-
return niceCeil(padded);
|
|
17568
|
-
}, [maxDataValue]);
|
|
17569
|
-
const handleBarClick = (data2, index, event) => {
|
|
17570
|
-
event.stopPropagation();
|
|
17571
|
-
const xAxisValue = data2[xAxisConfig.dataKey] || "N/A";
|
|
17572
|
-
const tooltipId = `${xAxisValue}`;
|
|
17573
|
-
const rect = event.target.getBoundingClientRect();
|
|
17574
|
-
const existingIndex = activeTooltips.findIndex(
|
|
17575
|
-
(tooltip) => tooltip.id === tooltipId
|
|
17576
|
-
);
|
|
17577
|
-
if (existingIndex !== -1) {
|
|
17578
|
-
setActiveTooltips(
|
|
17579
|
-
(prev) => prev.filter((tooltip) => tooltip.id !== tooltipId)
|
|
17580
|
-
);
|
|
17581
|
-
} else {
|
|
17582
|
-
const newTooltip = {
|
|
17583
|
-
id: tooltipId,
|
|
17584
|
-
data: data2,
|
|
17585
|
-
position: {
|
|
17586
|
-
top: rect.top - 10,
|
|
17587
|
-
// Posição fixa da viewport
|
|
17588
|
-
left: rect.right + 10
|
|
17589
|
-
// À direita da barra clicada
|
|
17590
|
-
}
|
|
17591
|
-
};
|
|
17592
|
-
setActiveTooltips((prev) => [...prev, newTooltip]);
|
|
17593
|
-
}
|
|
17594
|
-
};
|
|
17595
|
-
const handleChartClick = () => {
|
|
17596
|
-
setActiveTooltips([]);
|
|
17597
|
-
};
|
|
17598
|
-
const ALIGNMENT_THRESHOLD2 = 25;
|
|
17599
|
-
const GUIDE_THRESHOLD2 = 60;
|
|
17600
|
-
const STRONG_SNAP_THRESHOLD2 = 35;
|
|
17601
|
-
const PRECISION_SNAP_THRESHOLD2 = 8;
|
|
17602
|
-
const updateAlignmentGuides = useCallback(
|
|
17603
|
-
(draggedTooltipId, currentPosition) => {
|
|
17604
|
-
if (!isDragging) return;
|
|
17605
|
-
const getAllTooltips = () => {
|
|
17606
|
-
const allTooltips2 = [];
|
|
17607
|
-
allTooltips2.push(...activeTooltips);
|
|
17608
|
-
const globalEvent = new CustomEvent("requestGlobalTooltips", {
|
|
17609
|
-
detail: { requesterId: draggedTooltipId, response: allTooltips2 }
|
|
17610
|
-
});
|
|
17611
|
-
window.dispatchEvent(globalEvent);
|
|
17612
|
-
return allTooltips2;
|
|
17613
|
-
};
|
|
17614
|
-
const allTooltips = getAllTooltips();
|
|
17615
|
-
const otherTooltips = allTooltips.filter(
|
|
17616
|
-
(t) => t.id !== draggedTooltipId
|
|
17617
|
-
);
|
|
17618
|
-
const guides = [];
|
|
17619
|
-
const tooltipDimensions = { width: 224, height: 120 };
|
|
17620
|
-
otherTooltips.forEach((tooltip) => {
|
|
17621
|
-
const topDiff = Math.abs(currentPosition.top - tooltip.position.top);
|
|
17622
|
-
if (topDiff <= GUIDE_THRESHOLD2) {
|
|
17623
|
-
guides.push({
|
|
17624
|
-
type: "horizontal",
|
|
17625
|
-
position: tooltip.position.top,
|
|
17626
|
-
visible: true,
|
|
17627
|
-
sourceTooltip: {
|
|
17628
|
-
top: currentPosition.top,
|
|
17629
|
-
left: currentPosition.left,
|
|
17630
|
-
width: tooltipDimensions.width,
|
|
17631
|
-
height: tooltipDimensions.height
|
|
17632
|
-
},
|
|
17633
|
-
targetTooltip: {
|
|
17634
|
-
top: tooltip.position.top,
|
|
17635
|
-
left: tooltip.position.left,
|
|
17636
|
-
width: tooltipDimensions.width,
|
|
17637
|
-
height: tooltipDimensions.height
|
|
17638
|
-
}
|
|
17639
|
-
});
|
|
17640
|
-
}
|
|
17641
|
-
const leftDiff = Math.abs(currentPosition.left - tooltip.position.left);
|
|
17642
|
-
if (leftDiff <= GUIDE_THRESHOLD2) {
|
|
17643
|
-
guides.push({
|
|
17644
|
-
type: "vertical",
|
|
17645
|
-
position: tooltip.position.left,
|
|
17646
|
-
visible: true,
|
|
17647
|
-
sourceTooltip: {
|
|
17648
|
-
top: currentPosition.top,
|
|
17649
|
-
left: currentPosition.left,
|
|
17650
|
-
width: tooltipDimensions.width,
|
|
17651
|
-
height: tooltipDimensions.height
|
|
17652
|
-
},
|
|
17653
|
-
targetTooltip: {
|
|
17654
|
-
top: tooltip.position.top,
|
|
17655
|
-
left: tooltip.position.left,
|
|
17656
|
-
width: tooltipDimensions.width,
|
|
17657
|
-
height: tooltipDimensions.height
|
|
17658
|
-
}
|
|
17659
|
-
});
|
|
17660
|
-
}
|
|
17661
|
-
});
|
|
17662
|
-
setAlignmentGuides(guides);
|
|
17663
|
-
},
|
|
17664
|
-
[isDragging, activeTooltips]
|
|
17665
|
-
);
|
|
17666
|
-
const snapToGuides = useCallback(
|
|
17667
|
-
(position) => {
|
|
17668
|
-
const snappedPosition = { ...position };
|
|
17669
|
-
let hasSnapped = false;
|
|
17670
|
-
alignmentGuides.forEach((guide) => {
|
|
17671
|
-
if (guide.type === "horizontal") {
|
|
17672
|
-
const diff = Math.abs(position.top - guide.position);
|
|
17673
|
-
if (diff <= PRECISION_SNAP_THRESHOLD2) {
|
|
17674
|
-
snappedPosition.top = guide.position;
|
|
17675
|
-
hasSnapped = true;
|
|
17676
|
-
}
|
|
17677
|
-
} else if (guide.type === "vertical") {
|
|
17678
|
-
const diff = Math.abs(position.left - guide.position);
|
|
17679
|
-
if (diff <= PRECISION_SNAP_THRESHOLD2) {
|
|
17680
|
-
snappedPosition.left = guide.position;
|
|
17681
|
-
hasSnapped = true;
|
|
17682
|
-
}
|
|
17683
|
-
}
|
|
17684
|
-
});
|
|
17685
|
-
if (!hasSnapped) {
|
|
17686
|
-
alignmentGuides.forEach((guide) => {
|
|
17687
|
-
if (guide.type === "horizontal") {
|
|
17688
|
-
const diff = Math.abs(position.top - guide.position);
|
|
17689
|
-
if (diff <= STRONG_SNAP_THRESHOLD2) {
|
|
17690
|
-
snappedPosition.top = guide.position;
|
|
17691
|
-
}
|
|
17692
|
-
} else if (guide.type === "vertical") {
|
|
17693
|
-
const diff = Math.abs(position.left - guide.position);
|
|
17694
|
-
if (diff <= STRONG_SNAP_THRESHOLD2) {
|
|
17695
|
-
snappedPosition.left = guide.position;
|
|
17696
|
-
}
|
|
17697
|
-
}
|
|
17698
|
-
});
|
|
17699
|
-
}
|
|
17700
|
-
alignmentGuides.forEach((guide) => {
|
|
17701
|
-
if (guide.type === "horizontal") {
|
|
17702
|
-
const diff = Math.abs(position.top - guide.position);
|
|
17703
|
-
if (diff <= ALIGNMENT_THRESHOLD2 && snappedPosition.top === position.top) {
|
|
17704
|
-
snappedPosition.top = guide.position;
|
|
17705
|
-
}
|
|
17706
|
-
} else if (guide.type === "vertical") {
|
|
17707
|
-
const diff = Math.abs(position.left - guide.position);
|
|
17708
|
-
if (diff <= ALIGNMENT_THRESHOLD2 && snappedPosition.left === position.left) {
|
|
17709
|
-
snappedPosition.left = guide.position;
|
|
17710
|
-
}
|
|
17711
|
-
}
|
|
17712
|
-
});
|
|
17713
|
-
return snappedPosition;
|
|
17714
|
-
},
|
|
17715
|
-
[alignmentGuides]
|
|
17716
|
-
);
|
|
17717
|
-
const handleMouseDown = (e, tooltipId) => {
|
|
17718
|
-
e.preventDefault();
|
|
17719
|
-
e.stopPropagation();
|
|
17720
|
-
const tooltip = activeTooltips.find((t) => t.id === tooltipId);
|
|
17721
|
-
if (!tooltip) return;
|
|
17722
|
-
const rect = e.currentTarget.getBoundingClientRect();
|
|
17723
|
-
const offsetX = e.clientX - rect.left;
|
|
17724
|
-
const offsetY = e.clientY - rect.top;
|
|
17725
|
-
setIsDragging(tooltipId);
|
|
17726
|
-
setDragOffset({ x: offsetX, y: offsetY });
|
|
17727
|
-
};
|
|
17728
|
-
useEffect(() => {
|
|
17729
|
-
let rafId;
|
|
17730
|
-
let lastMousePosition = { x: 0, y: 0 };
|
|
17731
|
-
const handleGlobalMouseMove = (e) => {
|
|
17732
|
-
if (!isDragging) return;
|
|
17733
|
-
lastMousePosition = { x: e.clientX, y: e.clientY };
|
|
17734
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
17735
|
-
rafId = requestAnimationFrame(() => {
|
|
17736
|
-
const newLeft = lastMousePosition.x - dragOffset.x;
|
|
17737
|
-
const newTop = lastMousePosition.y - dragOffset.y;
|
|
17738
|
-
const rawPosition = {
|
|
17739
|
-
top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
|
|
17740
|
-
left: Math.max(0, Math.min(newLeft, window.innerWidth - 250))
|
|
17741
|
-
};
|
|
17742
|
-
updateAlignmentGuides(isDragging, rawPosition);
|
|
17743
|
-
const snappedPosition = snapToGuides(rawPosition);
|
|
17744
|
-
setActiveTooltips(
|
|
17745
|
-
(prev) => prev.map((tooltip) => {
|
|
17746
|
-
if (tooltip.id === isDragging) {
|
|
17747
|
-
return {
|
|
17748
|
-
...tooltip,
|
|
17749
|
-
position: snappedPosition
|
|
17750
|
-
};
|
|
17751
|
-
}
|
|
17752
|
-
return tooltip;
|
|
17753
|
-
})
|
|
17754
|
-
);
|
|
17755
|
-
});
|
|
17756
|
-
};
|
|
17757
|
-
const handleGlobalMouseUp = () => {
|
|
17758
|
-
if (isDragging) {
|
|
17759
|
-
setIsDragging(null);
|
|
17760
|
-
setAlignmentGuides([]);
|
|
17761
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
17762
|
-
}
|
|
17763
|
-
};
|
|
17764
|
-
if (isDragging) {
|
|
17765
|
-
document.addEventListener("mousemove", handleGlobalMouseMove, {
|
|
17766
|
-
passive: true
|
|
17767
|
-
});
|
|
17768
|
-
document.addEventListener("mouseup", handleGlobalMouseUp);
|
|
17769
|
-
document.body.style.cursor = "grabbing";
|
|
17770
|
-
document.body.style.userSelect = "none";
|
|
17771
|
-
}
|
|
17772
|
-
return () => {
|
|
17773
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
17774
|
-
document.removeEventListener("mousemove", handleGlobalMouseMove);
|
|
17775
|
-
document.removeEventListener("mouseup", handleGlobalMouseUp);
|
|
17776
|
-
document.body.style.cursor = "";
|
|
17777
|
-
document.body.style.userSelect = "";
|
|
17778
|
-
};
|
|
17779
|
-
}, [
|
|
17780
|
-
isDragging,
|
|
17781
|
-
dragOffset,
|
|
17782
|
-
alignmentGuides,
|
|
17783
|
-
updateAlignmentGuides,
|
|
17784
|
-
snapToGuides
|
|
17785
|
-
]);
|
|
17786
|
-
useEffect(() => {
|
|
17787
|
-
const handleCloseAllTooltips = () => {
|
|
17788
|
-
setActiveTooltips([]);
|
|
17789
|
-
setGlobalTooltipCount(0);
|
|
17790
|
-
};
|
|
17791
|
-
window.addEventListener("closeAllTooltips", handleCloseAllTooltips);
|
|
17792
|
-
return () => {
|
|
17793
|
-
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips);
|
|
17794
|
-
};
|
|
17795
|
-
}, []);
|
|
17796
|
-
useEffect(() => {
|
|
17797
|
-
const handleTooltipCountRequest = () => {
|
|
17798
|
-
window.dispatchEvent(
|
|
17799
|
-
new CustomEvent("tooltipCountResponse", {
|
|
17800
|
-
detail: { count: activeTooltips.length }
|
|
17801
|
-
})
|
|
17802
|
-
);
|
|
17803
|
-
};
|
|
17804
|
-
const handleGlobalTooltipsRequest = (event) => {
|
|
17805
|
-
const { detail } = event;
|
|
17806
|
-
if (detail && detail.response && detail.requesterId) {
|
|
17807
|
-
activeTooltips.forEach((tooltip) => {
|
|
17808
|
-
if (!detail.response.find(
|
|
17809
|
-
(t) => t.id === tooltip.id
|
|
17810
|
-
)) {
|
|
17811
|
-
detail.response.push({
|
|
17812
|
-
id: tooltip.id,
|
|
17813
|
-
position: tooltip.position
|
|
17814
|
-
});
|
|
17815
|
-
}
|
|
17816
|
-
});
|
|
17817
|
-
}
|
|
17818
|
-
};
|
|
17819
|
-
window.addEventListener("requestTooltipCount", handleTooltipCountRequest);
|
|
17820
|
-
window.addEventListener(
|
|
17821
|
-
"requestGlobalTooltips",
|
|
17822
|
-
handleGlobalTooltipsRequest
|
|
17823
|
-
);
|
|
17824
|
-
return () => {
|
|
17825
|
-
window.removeEventListener(
|
|
17826
|
-
"requestTooltipCount",
|
|
17827
|
-
handleTooltipCountRequest
|
|
17828
|
-
);
|
|
17829
|
-
window.removeEventListener(
|
|
17830
|
-
"requestGlobalTooltips",
|
|
17831
|
-
handleGlobalTooltipsRequest
|
|
17832
|
-
);
|
|
17833
|
-
};
|
|
17834
|
-
}, [activeTooltips]);
|
|
17835
|
-
useEffect(() => {
|
|
17836
|
-
if (isDragging) return;
|
|
17837
|
-
let totalCount = 0;
|
|
17838
|
-
const handleCountResponse = (event) => {
|
|
17839
|
-
const customEvent = event;
|
|
17840
|
-
totalCount += customEvent.detail.count;
|
|
17841
|
-
};
|
|
17842
|
-
window.addEventListener("tooltipCountResponse", handleCountResponse);
|
|
17843
|
-
window.dispatchEvent(new CustomEvent("requestTooltipCount"));
|
|
17844
|
-
const timeoutId = setTimeout(() => {
|
|
17845
|
-
window.removeEventListener("tooltipCountResponse", handleCountResponse);
|
|
17846
|
-
setGlobalTooltipCount(totalCount);
|
|
17847
|
-
}, 5);
|
|
17848
|
-
return () => {
|
|
17849
|
-
clearTimeout(timeoutId);
|
|
17850
|
-
window.removeEventListener("tooltipCountResponse", handleCountResponse);
|
|
17851
|
-
};
|
|
17852
|
-
}, [activeTooltips.length, isDragging]);
|
|
17853
|
-
const CustomTooltip = ({
|
|
17854
|
-
active,
|
|
17855
|
-
payload,
|
|
17856
|
-
label
|
|
17857
|
-
}) => {
|
|
17858
|
-
if (!active || !payload) return null;
|
|
17859
|
-
return /* @__PURE__ */ jsxs("div", { className: "bg-card border border-border rounded-lg p-3 shadow-lg", children: [
|
|
17860
|
-
/* @__PURE__ */ jsx("p", { className: "font-medium text-foreground mb-2", children: label }),
|
|
17861
|
-
payload.map(
|
|
17862
|
-
(entry, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
17863
|
-
/* @__PURE__ */ jsx(
|
|
17864
|
-
"div",
|
|
17865
|
-
{
|
|
17866
|
-
className: "w-3 h-3 rounded-sm",
|
|
17867
|
-
style: { backgroundColor: entry.color }
|
|
17868
|
-
}
|
|
17869
|
-
),
|
|
17870
|
-
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
17871
|
-
entry.name,
|
|
17872
|
-
":"
|
|
17873
|
-
] }),
|
|
17874
|
-
/* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: entry.value?.toLocaleString("pt-BR") })
|
|
17875
|
-
] }, index)
|
|
17876
|
-
),
|
|
17877
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Clique para fixar este tooltip" })
|
|
17878
|
-
] });
|
|
17879
|
-
};
|
|
17880
|
-
const getTitleClassName = (position) => {
|
|
17881
|
-
const baseClasses = "text-xl font-semibold text-foreground mb-3";
|
|
17882
|
-
switch (position) {
|
|
17883
|
-
case "center":
|
|
17884
|
-
return `${baseClasses} text-center`;
|
|
17885
|
-
case "right":
|
|
17886
|
-
return `${baseClasses} text-right`;
|
|
17887
|
-
default:
|
|
17888
|
-
return `${baseClasses} text-left`;
|
|
17889
|
-
}
|
|
17890
|
-
};
|
|
17891
|
-
return /* @__PURE__ */ jsxs(
|
|
17892
|
-
"div",
|
|
17893
|
-
{
|
|
17894
|
-
className: cn("rounded-lg bg-card p-4 relative", className),
|
|
17895
|
-
style: {
|
|
17896
|
-
width: typeof width === "number" ? `${width + 32}px` : "fit-content",
|
|
17897
|
-
maxWidth: "100%"
|
|
17898
|
-
},
|
|
17899
|
-
children: [
|
|
17900
|
-
title && /* @__PURE__ */ jsx("div", { style: { paddingLeft: `${resolvedContainerPaddingLeft}px` }, children: /* @__PURE__ */ jsx("h3", { className: getTitleClassName(titlePosition), children: title }) }),
|
|
17901
|
-
/* @__PURE__ */ jsxs(
|
|
17902
|
-
BarChart$1,
|
|
17903
|
-
{
|
|
17904
|
-
data: processedData,
|
|
17905
|
-
width: typeof width === "number" ? width : 900,
|
|
17906
|
-
height,
|
|
17907
|
-
margin: resolveChartMargins(margins, chartMargins, showLabels),
|
|
17908
|
-
onClick: handleChartClick,
|
|
17909
|
-
children: [
|
|
17910
|
-
showGrid && /* @__PURE__ */ jsx(
|
|
17911
|
-
CartesianGrid,
|
|
17912
|
-
{
|
|
17913
|
-
strokeDasharray: "3 3",
|
|
17914
|
-
stroke: gridColor || "hsl(var(--muted-foreground))",
|
|
17915
|
-
opacity: 0.5
|
|
17916
|
-
}
|
|
17917
|
-
),
|
|
17918
|
-
/* @__PURE__ */ jsx(
|
|
17919
|
-
XAxis,
|
|
17920
|
-
{
|
|
17921
|
-
dataKey: xAxisConfig.dataKey,
|
|
17922
|
-
stroke: "hsl(var(--muted-foreground))",
|
|
17923
|
-
fontSize: 12,
|
|
17924
|
-
tickLine: false,
|
|
17925
|
-
axisLine: false,
|
|
17926
|
-
tickFormatter: xAxisConfig.valueFormatter
|
|
17927
|
-
}
|
|
17928
|
-
),
|
|
17929
|
-
/* @__PURE__ */ jsx(
|
|
17930
|
-
YAxis,
|
|
17931
|
-
{
|
|
17932
|
-
stroke: "hsl(var(--muted-foreground))",
|
|
17933
|
-
fontSize: 12,
|
|
17934
|
-
tickLine: false,
|
|
17935
|
-
axisLine: false,
|
|
17936
|
-
tickFormatter: (value) => value.toLocaleString("pt-BR"),
|
|
17937
|
-
domain: [0, niceMax],
|
|
17938
|
-
tickCount: 6
|
|
17939
|
-
}
|
|
17940
|
-
),
|
|
17941
|
-
showTooltip && /* @__PURE__ */ jsx(
|
|
17942
|
-
Tooltip,
|
|
17943
|
-
{
|
|
17944
|
-
content: /* @__PURE__ */ jsx(CustomTooltip, {}),
|
|
17945
|
-
cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
|
|
17946
|
-
}
|
|
17947
|
-
),
|
|
17948
|
-
showLegend && /* @__PURE__ */ jsx(
|
|
17949
|
-
Legend,
|
|
17950
|
-
{
|
|
17951
|
-
wrapperStyle: {
|
|
17952
|
-
color: "hsl(var(--foreground))",
|
|
17953
|
-
fontSize: "14px"
|
|
17954
|
-
}
|
|
17955
|
-
}
|
|
17956
|
-
),
|
|
17957
|
-
dataKeys.map((key) => {
|
|
17958
|
-
const fieldConfig = mapperConfig[key];
|
|
17959
|
-
return /* @__PURE__ */ jsx(
|
|
17960
|
-
Bar,
|
|
17961
|
-
{
|
|
17962
|
-
dataKey: key,
|
|
17963
|
-
name: fieldConfig?.label || key,
|
|
17964
|
-
fill: fieldConfig?.color || finalColors[key],
|
|
17965
|
-
radius: [4, 4, 0, 0],
|
|
17966
|
-
onClick: handleBarClick,
|
|
17967
|
-
style: { cursor: "pointer" },
|
|
17968
|
-
activeBar: /* @__PURE__ */ jsx(
|
|
17969
|
-
Rectangle,
|
|
17970
|
-
{
|
|
17971
|
-
fill: finalColors[key],
|
|
17972
|
-
stroke: finalColors[key],
|
|
17973
|
-
strokeWidth: 2,
|
|
17974
|
-
opacity: 0.8
|
|
17975
|
-
}
|
|
17976
|
-
),
|
|
17977
|
-
children: showLabels && /* @__PURE__ */ jsx(
|
|
17978
|
-
LabelList,
|
|
17979
|
-
{
|
|
17980
|
-
dataKey: key,
|
|
17981
|
-
position: "top",
|
|
17982
|
-
content: pillLabelRenderer_default(
|
|
17983
|
-
finalColors[key] || "#000",
|
|
17984
|
-
"filled"
|
|
17985
|
-
)
|
|
17986
|
-
}
|
|
17987
|
-
)
|
|
17988
|
-
},
|
|
17989
|
-
key
|
|
17990
|
-
);
|
|
17991
|
-
})
|
|
17992
|
-
]
|
|
17993
|
-
}
|
|
17994
|
-
),
|
|
17995
|
-
alignmentGuides.map((guide, index) => {
|
|
17996
|
-
const isHorizontal = guide.type === "horizontal";
|
|
17997
|
-
const color = isHorizontal ? "#3b82f6" : "#ef4444";
|
|
17998
|
-
const startX = isHorizontal ? Math.min(
|
|
17999
|
-
guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
|
|
18000
|
-
guide.targetTooltip.left + guide.targetTooltip.width / 2
|
|
18001
|
-
) : guide.sourceTooltip.left + (isHorizontal ? 0 : guide.sourceTooltip.width / 2);
|
|
18002
|
-
const endX = isHorizontal ? Math.max(
|
|
18003
|
-
guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
|
|
18004
|
-
guide.targetTooltip.left + guide.targetTooltip.width / 2
|
|
18005
|
-
) : guide.targetTooltip.left + (isHorizontal ? 0 : guide.targetTooltip.width / 2);
|
|
18006
|
-
const startY = isHorizontal ? guide.sourceTooltip.top + (isHorizontal ? guide.sourceTooltip.height / 2 : 0) : Math.min(
|
|
18007
|
-
guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
|
|
18008
|
-
guide.targetTooltip.top + guide.targetTooltip.height / 2
|
|
18009
|
-
);
|
|
18010
|
-
const endY = isHorizontal ? guide.targetTooltip.top + (isHorizontal ? guide.targetTooltip.height / 2 : 0) : Math.max(
|
|
18011
|
-
guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
|
|
18012
|
-
guide.targetTooltip.top + guide.targetTooltip.height / 2
|
|
18013
|
-
);
|
|
18014
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
18015
|
-
/* @__PURE__ */ jsx(
|
|
18016
|
-
"div",
|
|
18017
|
-
{
|
|
18018
|
-
className: "fixed pointer-events-none z-30",
|
|
18019
|
-
style: {
|
|
18020
|
-
left: startX,
|
|
18021
|
-
top: startY,
|
|
18022
|
-
width: isHorizontal ? endX - startX : "2px",
|
|
18023
|
-
height: isHorizontal ? "2px" : endY - startY,
|
|
18024
|
-
backgroundColor: color,
|
|
18025
|
-
boxShadow: `0 0 8px ${color}60`,
|
|
18026
|
-
opacity: 0.9,
|
|
18027
|
-
borderStyle: "dashed",
|
|
18028
|
-
borderWidth: "1px",
|
|
18029
|
-
borderColor: color,
|
|
18030
|
-
transform: "translateZ(0)"
|
|
18031
|
-
}
|
|
18032
|
-
}
|
|
18033
|
-
),
|
|
18034
|
-
/* @__PURE__ */ jsx(
|
|
18035
|
-
"div",
|
|
18036
|
-
{
|
|
18037
|
-
className: "fixed pointer-events-none z-31",
|
|
18038
|
-
style: {
|
|
18039
|
-
left: guide.sourceTooltip.left + guide.sourceTooltip.width / 2 - 4,
|
|
18040
|
-
top: guide.sourceTooltip.top + guide.sourceTooltip.height / 2 - 4,
|
|
18041
|
-
width: "8px",
|
|
18042
|
-
height: "8px",
|
|
18043
|
-
backgroundColor: color,
|
|
18044
|
-
borderRadius: "50%",
|
|
18045
|
-
boxShadow: `0 0 4px ${color}80`,
|
|
18046
|
-
opacity: 0.8
|
|
18047
|
-
}
|
|
18048
|
-
}
|
|
18049
|
-
),
|
|
18050
|
-
/* @__PURE__ */ jsx(
|
|
18051
|
-
"div",
|
|
18052
|
-
{
|
|
18053
|
-
className: "fixed pointer-events-none z-31",
|
|
18054
|
-
style: {
|
|
18055
|
-
left: guide.targetTooltip.left + guide.targetTooltip.width / 2 - 4,
|
|
18056
|
-
top: guide.targetTooltip.top + guide.targetTooltip.height / 2 - 4,
|
|
18057
|
-
width: "8px",
|
|
18058
|
-
height: "8px",
|
|
18059
|
-
backgroundColor: color,
|
|
18060
|
-
borderRadius: "50%",
|
|
18061
|
-
boxShadow: `0 0 4px ${color}80`,
|
|
18062
|
-
opacity: 0.8
|
|
18063
|
-
}
|
|
18064
|
-
}
|
|
18065
|
-
)
|
|
18066
|
-
] }, index);
|
|
18067
|
-
}),
|
|
18068
|
-
activeTooltips.map((tooltip, index) => /* @__PURE__ */ jsx(
|
|
18069
|
-
DraggableTooltip_default,
|
|
18070
|
-
{
|
|
18071
|
-
id: tooltip.id,
|
|
18072
|
-
data: adaptDataForTooltip2(tooltip.data),
|
|
18073
|
-
position: tooltip.position,
|
|
18074
|
-
isDragging: isDragging === tooltip.id,
|
|
18075
|
-
title,
|
|
18076
|
-
dataKeys,
|
|
18077
|
-
finalColors,
|
|
18078
|
-
onMouseDown: (id, e) => handleMouseDown(e, id),
|
|
18079
|
-
onClose: (id) => {
|
|
18080
|
-
setActiveTooltips((prev) => prev.filter((t) => t.id !== id));
|
|
18081
|
-
},
|
|
18082
|
-
periodLabel: "Per\xEDodo Selecionado",
|
|
18083
|
-
dataLabel: "Dados do Per\xEDodo",
|
|
18084
|
-
showCloseAllButton: index === 0,
|
|
18085
|
-
globalTooltipCount,
|
|
18086
|
-
onCloseAll: () => {
|
|
18087
|
-
window.dispatchEvent(new Event("closeAllTooltips"));
|
|
18088
|
-
},
|
|
18089
|
-
closeAllButtonPosition: "top-center",
|
|
18090
|
-
closeAllButtonVariant: "floating"
|
|
18091
|
-
},
|
|
18092
|
-
tooltip.id
|
|
18093
|
-
))
|
|
18094
|
-
]
|
|
18095
|
-
}
|
|
18096
|
-
);
|
|
18097
|
-
};
|
|
18098
|
-
var BarChart_default = BarChart;
|
|
18099
|
-
var defaultData = [
|
|
18100
|
-
{ name: "A", value: 100 },
|
|
18101
|
-
{ name: "B", value: 200 },
|
|
18102
|
-
{ name: "C", value: 150 }
|
|
18103
|
-
];
|
|
18104
|
-
var DEFAULT_COLORS4 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
18105
|
-
var CustomLineChart = ({
|
|
18106
|
-
data = defaultData,
|
|
18107
|
-
className,
|
|
18108
|
-
height = 300,
|
|
18109
|
-
width = "100%",
|
|
18110
|
-
colors: colors2 = DEFAULT_COLORS4,
|
|
18111
|
-
gridColor,
|
|
18112
|
-
showGrid = true,
|
|
18113
|
-
showTooltip = true,
|
|
18114
|
-
showLegend = true,
|
|
18115
|
-
title,
|
|
18116
|
-
titlePosition = "left",
|
|
18117
|
-
strokeWidth = 2,
|
|
18118
|
-
showDots = true,
|
|
18119
|
-
showLabels = false,
|
|
18120
|
-
padding,
|
|
18121
|
-
margins,
|
|
18122
|
-
containerPaddingLeft,
|
|
18123
|
-
chartMargins
|
|
18124
|
-
}) => {
|
|
18125
|
-
const resolvedContainerPaddingLeft = resolveContainerPaddingLeft(
|
|
18126
|
-
padding,
|
|
18127
|
-
containerPaddingLeft,
|
|
18128
|
-
16
|
|
18129
|
-
);
|
|
18130
|
-
const [activeTooltips, setActiveTooltips] = useState([]);
|
|
18131
|
-
const [isDragging, setIsDragging] = useState(null);
|
|
18132
|
-
const [dragOffset, setDragOffset] = useState({
|
|
18133
|
-
x: 0,
|
|
18134
|
-
y: 0
|
|
18135
|
-
});
|
|
18136
|
-
const [globalTooltipCount, setGlobalTooltipCount] = useState(0);
|
|
18137
|
-
const [alignmentGuides, setAlignmentGuides] = useState([]);
|
|
18138
|
-
const generateColors = (dataKeys2) => {
|
|
18139
|
-
const colorMap = {};
|
|
18140
|
-
const allColors = generateAdditionalColors(colors2, dataKeys2.length);
|
|
18141
|
-
dataKeys2.forEach((key, index) => {
|
|
18142
|
-
colorMap[key] = allColors[index] || colors2[index % colors2.length];
|
|
18143
|
-
});
|
|
18144
|
-
return colorMap;
|
|
18145
|
-
};
|
|
18146
|
-
const dataKeys = useMemo(
|
|
18147
|
-
() => data.length > 0 ? Object.keys(data[0]).filter((key) => key !== "name") : [],
|
|
18148
|
-
[data]
|
|
18149
|
-
);
|
|
18150
|
-
const finalColors = generateColors(dataKeys);
|
|
18151
|
-
const maxDataValue = useMemo(() => {
|
|
18152
|
-
let max = 0;
|
|
18153
|
-
for (const row of data) {
|
|
18154
|
-
const r = row;
|
|
18155
|
-
for (const key of dataKeys) {
|
|
18156
|
-
const v = r[key];
|
|
18157
|
-
if (typeof v === "number" && Number.isFinite(v) && v > max)
|
|
18158
|
-
max = v;
|
|
18159
|
-
}
|
|
18160
|
-
}
|
|
18161
|
-
return max;
|
|
18162
|
-
}, [data, dataKeys]);
|
|
18163
|
-
const niceMax = useMemo(() => {
|
|
18164
|
-
let padding2 = 0.08;
|
|
18165
|
-
if (maxDataValue > 1e6) padding2 = 0.05;
|
|
18166
|
-
if (maxDataValue > 1e7) padding2 = 0.03;
|
|
18167
|
-
if (maxDataValue === 0) padding2 = 0.12;
|
|
18168
|
-
const padded = maxDataValue * (1 + padding2);
|
|
18169
|
-
return niceCeil(padded);
|
|
18170
|
-
}, [maxDataValue]);
|
|
18171
|
-
const ClickableDot = (props) => {
|
|
18172
|
-
const { cx, cy, payload, dataKey } = props;
|
|
18173
|
-
const handleDotClick = (e) => {
|
|
18174
|
-
e.stopPropagation();
|
|
18175
|
-
if (!payload || !cx || !cy) return;
|
|
18176
|
-
const tooltipId = `${payload.name}`;
|
|
18177
|
-
const existingIndex = activeTooltips.findIndex(
|
|
18178
|
-
(tooltip) => tooltip.id === tooltipId
|
|
18179
|
-
);
|
|
18180
|
-
if (existingIndex !== -1) {
|
|
18181
|
-
setActiveTooltips(
|
|
18182
|
-
(prev) => prev.filter((tooltip) => tooltip.id !== tooltipId)
|
|
18183
|
-
);
|
|
18184
|
-
} else {
|
|
18185
|
-
const newTooltip = {
|
|
18186
|
-
id: tooltipId,
|
|
18187
|
-
data: payload,
|
|
18188
|
-
position: {
|
|
18189
|
-
top: cy - 50,
|
|
18190
|
-
// Posição relativa ao SVG
|
|
18191
|
-
left: cx - 100
|
|
18192
|
-
}
|
|
18193
|
-
};
|
|
18194
|
-
setActiveTooltips((prev) => [...prev, newTooltip]);
|
|
18195
|
-
}
|
|
18196
|
-
};
|
|
18197
|
-
return /* @__PURE__ */ jsx(
|
|
18198
|
-
"circle",
|
|
18199
|
-
{
|
|
18200
|
-
cx,
|
|
18201
|
-
cy,
|
|
18202
|
-
r: 6,
|
|
18203
|
-
fill: finalColors[dataKey || ""] || colors2[0],
|
|
18204
|
-
stroke: finalColors[dataKey || ""] || colors2[0],
|
|
18205
|
-
strokeWidth: 2,
|
|
18206
|
-
style: { cursor: "pointer" },
|
|
18207
|
-
onClick: handleDotClick
|
|
18208
|
-
}
|
|
18209
|
-
);
|
|
18210
|
-
};
|
|
18211
|
-
const handleChartClick = (e) => {
|
|
18212
|
-
if (e && e.activePayload && e.activePayload.length > 0) {
|
|
18213
|
-
const clickedData = e.activePayload[0].payload;
|
|
18214
|
-
const tooltipId = `${clickedData.name}`;
|
|
18215
|
-
const existingIndex = activeTooltips.findIndex(
|
|
18216
|
-
(tooltip) => tooltip.id === tooltipId
|
|
18217
|
-
);
|
|
18218
|
-
if (existingIndex !== -1) {
|
|
18219
|
-
setActiveTooltips(
|
|
18220
|
-
(prev) => prev.filter((tooltip) => tooltip.id !== tooltipId)
|
|
18221
|
-
);
|
|
18222
|
-
} else {
|
|
18223
|
-
const newTooltip = {
|
|
18224
|
-
id: tooltipId,
|
|
18225
|
-
data: clickedData,
|
|
18226
|
-
position: {
|
|
18227
|
-
top: (e.chartY || 100) - 10,
|
|
18228
|
-
left: (e.chartX || 100) - 100
|
|
18229
|
-
}
|
|
18230
|
-
};
|
|
18231
|
-
setActiveTooltips((prev) => [...prev, newTooltip]);
|
|
18232
|
-
}
|
|
18233
|
-
}
|
|
18234
|
-
};
|
|
18235
|
-
const handleChartBackgroundClick = () => {
|
|
18236
|
-
setActiveTooltips([]);
|
|
18237
|
-
};
|
|
18238
|
-
const handleCloseAllTooltips = useCallback(() => {
|
|
18239
|
-
window.dispatchEvent(new CustomEvent("closeAllTooltips"));
|
|
18240
|
-
}, []);
|
|
18241
|
-
const updateAlignmentGuides = useCallback(
|
|
18242
|
-
(draggedTooltipId, draggedPosition) => {
|
|
18243
|
-
const SNAP_THRESHOLD = 15;
|
|
18244
|
-
const draggedTooltip = activeTooltips.find(
|
|
18245
|
-
(t) => t.id === draggedTooltipId
|
|
18246
|
-
);
|
|
18247
|
-
if (!draggedTooltip) return;
|
|
18248
|
-
const tooltipWidth = 200;
|
|
18249
|
-
const tooltipHeight = 80;
|
|
18250
|
-
const globalTooltips = [];
|
|
18251
|
-
window.dispatchEvent(
|
|
18252
|
-
new CustomEvent("requestGlobalTooltips", {
|
|
18253
|
-
detail: { requesterId: draggedTooltipId }
|
|
18254
|
-
})
|
|
18255
|
-
);
|
|
18256
|
-
activeTooltips.forEach((tooltip) => {
|
|
18257
|
-
if (tooltip.id !== draggedTooltipId) {
|
|
18258
|
-
globalTooltips.push({
|
|
18259
|
-
top: tooltip.position.top,
|
|
18260
|
-
left: tooltip.position.left,
|
|
18261
|
-
width: tooltipWidth,
|
|
18262
|
-
height: tooltipHeight,
|
|
18263
|
-
id: tooltip.id
|
|
18264
|
-
});
|
|
18265
|
-
}
|
|
18266
|
-
});
|
|
18267
|
-
const newGuides = [];
|
|
18268
|
-
globalTooltips.forEach((otherTooltip) => {
|
|
18269
|
-
const draggedCenter = {
|
|
18270
|
-
x: draggedPosition.left + tooltipWidth / 2,
|
|
18271
|
-
y: draggedPosition.top + tooltipHeight / 2
|
|
18272
|
-
};
|
|
18273
|
-
const otherCenter = {
|
|
18274
|
-
x: otherTooltip.left + otherTooltip.width / 2,
|
|
18275
|
-
y: otherTooltip.top + otherTooltip.height / 2
|
|
18276
|
-
};
|
|
18277
|
-
const horizontalDistance = Math.abs(draggedCenter.y - otherCenter.y);
|
|
18278
|
-
if (horizontalDistance <= SNAP_THRESHOLD) {
|
|
18279
|
-
newGuides.push({
|
|
18280
|
-
type: "horizontal",
|
|
18281
|
-
position: otherCenter.y,
|
|
18282
|
-
visible: true,
|
|
18283
|
-
sourceTooltip: {
|
|
18284
|
-
top: draggedPosition.top,
|
|
18285
|
-
left: draggedPosition.left,
|
|
18286
|
-
width: tooltipWidth,
|
|
18287
|
-
height: tooltipHeight
|
|
18288
|
-
},
|
|
18289
|
-
targetTooltip: {
|
|
18290
|
-
top: otherTooltip.top,
|
|
18291
|
-
left: otherTooltip.left,
|
|
18292
|
-
width: otherTooltip.width,
|
|
18293
|
-
height: otherTooltip.height
|
|
18294
|
-
}
|
|
18295
|
-
});
|
|
18296
|
-
}
|
|
18297
|
-
const verticalDistance = Math.abs(draggedCenter.x - otherCenter.x);
|
|
18298
|
-
if (verticalDistance <= SNAP_THRESHOLD) {
|
|
18299
|
-
newGuides.push({
|
|
18300
|
-
type: "vertical",
|
|
18301
|
-
position: otherCenter.x,
|
|
18302
|
-
visible: true,
|
|
18303
|
-
sourceTooltip: {
|
|
18304
|
-
top: draggedPosition.top,
|
|
18305
|
-
left: draggedPosition.left,
|
|
18306
|
-
width: tooltipWidth,
|
|
18307
|
-
height: tooltipHeight
|
|
18308
|
-
},
|
|
18309
|
-
targetTooltip: {
|
|
18310
|
-
top: otherTooltip.top,
|
|
18311
|
-
left: otherTooltip.left,
|
|
18312
|
-
width: otherTooltip.width,
|
|
18313
|
-
height: otherTooltip.height
|
|
18314
|
-
}
|
|
18315
|
-
});
|
|
18316
|
-
}
|
|
18317
|
-
});
|
|
18318
|
-
setAlignmentGuides(newGuides);
|
|
18319
|
-
},
|
|
18320
|
-
[activeTooltips]
|
|
18321
|
-
);
|
|
18322
|
-
const snapToGuides = useCallback(
|
|
18323
|
-
(position) => {
|
|
18324
|
-
const SNAP_DISTANCE = 10;
|
|
18325
|
-
const snappedPosition = { ...position };
|
|
18326
|
-
alignmentGuides.forEach((guide) => {
|
|
18327
|
-
if (guide.type === "horizontal") {
|
|
18328
|
-
const tooltipCenter = position.top + 40;
|
|
18329
|
-
if (Math.abs(tooltipCenter - guide.position) <= SNAP_DISTANCE) {
|
|
18330
|
-
snappedPosition.top = guide.position - 40;
|
|
18331
|
-
}
|
|
18332
|
-
} else if (guide.type === "vertical") {
|
|
18333
|
-
const tooltipCenter = position.left + 100;
|
|
18334
|
-
if (Math.abs(tooltipCenter - guide.position) <= SNAP_DISTANCE) {
|
|
18335
|
-
snappedPosition.left = guide.position - 100;
|
|
18336
|
-
}
|
|
18337
|
-
}
|
|
18338
|
-
});
|
|
18339
|
-
return snappedPosition;
|
|
18340
|
-
},
|
|
18341
|
-
[alignmentGuides]
|
|
18342
|
-
);
|
|
18343
|
-
const handleMouseDown = (tooltipId, e) => {
|
|
18344
|
-
const rect = e.target.getBoundingClientRect();
|
|
18345
|
-
const offsetX = e.clientX - rect.left;
|
|
18346
|
-
const offsetY = e.clientY - rect.top;
|
|
18347
|
-
setIsDragging(tooltipId);
|
|
18348
|
-
setDragOffset({ x: offsetX, y: offsetY });
|
|
18349
|
-
};
|
|
18350
|
-
useEffect(() => {
|
|
18351
|
-
let rafId;
|
|
18352
|
-
let lastMousePosition = { x: 0, y: 0 };
|
|
18353
|
-
const handleGlobalMouseMove = (e) => {
|
|
18354
|
-
if (!isDragging) return;
|
|
18355
|
-
lastMousePosition = { x: e.clientX, y: e.clientY };
|
|
18356
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
18357
|
-
rafId = requestAnimationFrame(() => {
|
|
18358
|
-
const newLeft = lastMousePosition.x - dragOffset.x;
|
|
18359
|
-
const newTop = lastMousePosition.y - dragOffset.y;
|
|
18360
|
-
let finalPosition = { top: newTop, left: newLeft };
|
|
18361
|
-
finalPosition = snapToGuides(finalPosition);
|
|
18362
|
-
setActiveTooltips(
|
|
18363
|
-
(prev) => prev.map(
|
|
18364
|
-
(tooltip) => tooltip.id === isDragging ? { ...tooltip, position: finalPosition } : tooltip
|
|
18365
|
-
)
|
|
18366
|
-
);
|
|
18367
|
-
updateAlignmentGuides(isDragging, finalPosition);
|
|
18368
|
-
});
|
|
18369
|
-
};
|
|
18370
|
-
const handleGlobalMouseUp = () => {
|
|
18371
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
18372
|
-
setIsDragging(null);
|
|
18373
|
-
setAlignmentGuides([]);
|
|
18374
|
-
document.body.style.cursor = "";
|
|
18375
|
-
document.body.style.userSelect = "";
|
|
18376
|
-
};
|
|
18377
|
-
if (isDragging) {
|
|
18378
|
-
document.body.style.cursor = "grabbing";
|
|
18379
|
-
document.body.style.userSelect = "none";
|
|
18380
|
-
window.addEventListener("mousemove", handleGlobalMouseMove);
|
|
18381
|
-
window.addEventListener("mouseup", handleGlobalMouseUp);
|
|
18382
|
-
}
|
|
18383
|
-
return () => {
|
|
18384
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
18385
|
-
window.removeEventListener("mousemove", handleGlobalMouseMove);
|
|
18386
|
-
window.removeEventListener("mouseup", handleGlobalMouseUp);
|
|
18387
|
-
document.body.style.cursor = "";
|
|
18388
|
-
document.body.style.userSelect = "";
|
|
18389
|
-
};
|
|
18390
|
-
}, [
|
|
18391
|
-
isDragging,
|
|
18392
|
-
dragOffset,
|
|
18393
|
-
alignmentGuides,
|
|
18394
|
-
updateAlignmentGuides,
|
|
18395
|
-
snapToGuides
|
|
18396
|
-
]);
|
|
18397
|
-
useEffect(() => {
|
|
18398
|
-
const handleCloseAllTooltips2 = () => {
|
|
18399
|
-
setActiveTooltips([]);
|
|
18400
|
-
setGlobalTooltipCount(0);
|
|
18401
|
-
};
|
|
18402
|
-
window.addEventListener("closeAllTooltips", handleCloseAllTooltips2);
|
|
18403
|
-
return () => {
|
|
18404
|
-
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips2);
|
|
18405
|
-
};
|
|
18406
|
-
}, []);
|
|
18407
|
-
useEffect(() => {
|
|
18408
|
-
const handleTooltipCountRequest = () => {
|
|
18409
|
-
window.dispatchEvent(
|
|
18410
|
-
new CustomEvent("tooltipCountResponse", {
|
|
18411
|
-
detail: { count: activeTooltips.length }
|
|
18412
|
-
})
|
|
18413
|
-
);
|
|
18414
|
-
};
|
|
18415
|
-
const handleGlobalTooltipsRequest = (event) => {
|
|
18416
|
-
const requesterId = event.detail?.requesterId;
|
|
18417
|
-
activeTooltips.forEach((tooltip) => {
|
|
18418
|
-
if (tooltip.id !== requesterId) {
|
|
18419
|
-
window.dispatchEvent(
|
|
18420
|
-
new CustomEvent("globalTooltipResponse", {
|
|
18421
|
-
detail: {
|
|
18422
|
-
tooltip: {
|
|
18423
|
-
top: tooltip.position.top,
|
|
18424
|
-
left: tooltip.position.left,
|
|
18425
|
-
width: 200,
|
|
18426
|
-
height: 80,
|
|
18427
|
-
id: tooltip.id
|
|
18428
|
-
}
|
|
18429
|
-
}
|
|
18430
|
-
})
|
|
18431
|
-
);
|
|
18432
|
-
}
|
|
18433
|
-
});
|
|
18434
|
-
};
|
|
18435
|
-
window.addEventListener("requestTooltipCount", handleTooltipCountRequest);
|
|
18436
|
-
window.addEventListener(
|
|
18437
|
-
"requestGlobalTooltips",
|
|
18438
|
-
handleGlobalTooltipsRequest
|
|
18439
|
-
);
|
|
18440
|
-
return () => {
|
|
18441
|
-
window.removeEventListener(
|
|
18442
|
-
"requestTooltipCount",
|
|
18443
|
-
handleTooltipCountRequest
|
|
18444
|
-
);
|
|
18445
|
-
window.removeEventListener(
|
|
18446
|
-
"requestGlobalTooltips",
|
|
18447
|
-
handleGlobalTooltipsRequest
|
|
18448
|
-
);
|
|
18449
|
-
};
|
|
18450
|
-
}, [activeTooltips]);
|
|
18451
|
-
useEffect(() => {
|
|
18452
|
-
if (isDragging) return;
|
|
18453
|
-
let totalCount = 0;
|
|
18454
|
-
const handleCountResponse = (event) => {
|
|
18455
|
-
const customEvent = event;
|
|
18456
|
-
totalCount += customEvent.detail.count;
|
|
18457
|
-
};
|
|
18458
|
-
window.addEventListener("tooltipCountResponse", handleCountResponse);
|
|
18459
|
-
window.dispatchEvent(new CustomEvent("requestTooltipCount"));
|
|
18460
|
-
const timeoutId = setTimeout(() => {
|
|
18461
|
-
window.removeEventListener("tooltipCountResponse", handleCountResponse);
|
|
18462
|
-
setGlobalTooltipCount(totalCount);
|
|
18463
|
-
}, 5);
|
|
18464
|
-
return () => {
|
|
18465
|
-
clearTimeout(timeoutId);
|
|
18466
|
-
window.removeEventListener("tooltipCountResponse", handleCountResponse);
|
|
18467
|
-
};
|
|
18468
|
-
}, [activeTooltips.length, isDragging]);
|
|
18469
|
-
const getTitleClass = () => {
|
|
18470
|
-
switch (titlePosition) {
|
|
18471
|
-
case "center":
|
|
18472
|
-
return "text-center";
|
|
18473
|
-
case "right":
|
|
18474
|
-
return "text-right";
|
|
18475
|
-
default:
|
|
18476
|
-
return "text-left";
|
|
18477
|
-
}
|
|
18478
|
-
};
|
|
18479
|
-
return /* @__PURE__ */ jsx("div", { className: cn("relative", className), children: /* @__PURE__ */ jsxs(
|
|
18480
|
-
"div",
|
|
18481
|
-
{
|
|
18482
|
-
className: "rounded-lg bg-card p-4 relative border border-border",
|
|
18483
|
-
style: {
|
|
18484
|
-
width: typeof width === "number" ? `${width + 32}px` : "fit-content",
|
|
18485
|
-
maxWidth: "100%"
|
|
18486
|
-
},
|
|
18487
|
-
onClick: handleChartBackgroundClick,
|
|
18488
|
-
children: [
|
|
18489
|
-
title && /* @__PURE__ */ jsx("div", { style: { paddingLeft: `${resolvedContainerPaddingLeft}px` }, children: /* @__PURE__ */ jsx("div", { className: cn("mb-4", getTitleClass()), children: /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }) }) }),
|
|
18490
|
-
/* @__PURE__ */ jsxs(
|
|
18491
|
-
LineChart,
|
|
18492
|
-
{
|
|
18493
|
-
data,
|
|
18494
|
-
width: typeof width === "number" ? width : 900,
|
|
18495
|
-
height,
|
|
18496
|
-
margin: resolveChartMargins(margins, chartMargins, showLabels),
|
|
18497
|
-
onClick: handleChartClick,
|
|
18498
|
-
children: [
|
|
18499
|
-
showGrid && /* @__PURE__ */ jsx(
|
|
18500
|
-
CartesianGrid,
|
|
18501
|
-
{
|
|
18502
|
-
strokeDasharray: "3 3",
|
|
18503
|
-
stroke: gridColor || "hsl(var(--muted-foreground))",
|
|
18504
|
-
opacity: 0.3
|
|
18505
|
-
}
|
|
18506
|
-
),
|
|
18507
|
-
/* @__PURE__ */ jsx(
|
|
18508
|
-
XAxis,
|
|
18509
|
-
{
|
|
18510
|
-
dataKey: "name",
|
|
18511
|
-
className: "fill-muted-foreground text-xs",
|
|
18512
|
-
fontSize: 12
|
|
18513
|
-
}
|
|
18514
|
-
),
|
|
18515
|
-
/* @__PURE__ */ jsx(
|
|
18516
|
-
YAxis,
|
|
18517
|
-
{
|
|
18518
|
-
className: "fill-muted-foreground text-xs",
|
|
18519
|
-
fontSize: 12,
|
|
18520
|
-
tickFormatter: (value) => compactTick(Number(value)),
|
|
18521
|
-
domain: [0, niceMax],
|
|
18522
|
-
tickCount: 6
|
|
18523
|
-
}
|
|
18524
|
-
),
|
|
18525
|
-
showTooltip && /* @__PURE__ */ jsx(Tooltip, { content: () => null }),
|
|
18526
|
-
showLegend && /* @__PURE__ */ jsx(
|
|
18527
|
-
Legend,
|
|
18528
|
-
{
|
|
18529
|
-
wrapperStyle: {
|
|
18530
|
-
fontSize: "12px",
|
|
18531
|
-
color: "hsl(var(--muted-foreground))"
|
|
18532
|
-
}
|
|
18533
|
-
}
|
|
18534
|
-
),
|
|
18535
|
-
dataKeys.map((key) => /* @__PURE__ */ jsx(
|
|
18536
|
-
Line,
|
|
18537
|
-
{
|
|
18538
|
-
type: "monotone",
|
|
18539
|
-
dataKey: key,
|
|
18540
|
-
stroke: finalColors[key],
|
|
18541
|
-
strokeWidth,
|
|
18542
|
-
dot: showDots ? { r: 4, cursor: "pointer" } : false,
|
|
18543
|
-
activeDot: (props) => /* @__PURE__ */ jsx(ClickableDot, { ...props, dataKey: key }),
|
|
18544
|
-
children: showLabels && /* @__PURE__ */ jsx(
|
|
18545
|
-
LabelList,
|
|
18546
|
-
{
|
|
18547
|
-
dataKey: key,
|
|
18548
|
-
position: "top",
|
|
18549
|
-
content: pillLabelRenderer_default(
|
|
18550
|
-
finalColors[key] || "#000",
|
|
18551
|
-
"filled"
|
|
18552
|
-
),
|
|
18553
|
-
offset: 14
|
|
18554
|
-
}
|
|
18555
|
-
)
|
|
18556
|
-
},
|
|
18557
|
-
key
|
|
18558
|
-
))
|
|
18559
|
-
]
|
|
18560
|
-
}
|
|
18561
|
-
),
|
|
18562
|
-
alignmentGuides.map((guide, index) => {
|
|
18563
|
-
const isHorizontal = guide.type === "horizontal";
|
|
18564
|
-
const color = isHorizontal ? "#3b82f6" : "#ef4444";
|
|
18565
|
-
const startX = isHorizontal ? Math.min(
|
|
18566
|
-
guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
|
|
18567
|
-
guide.targetTooltip.left + guide.targetTooltip.width / 2
|
|
18568
|
-
) : guide.sourceTooltip.left + (isHorizontal ? 0 : guide.sourceTooltip.width / 2);
|
|
18569
|
-
const endX = isHorizontal ? Math.max(
|
|
18570
|
-
guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
|
|
18571
|
-
guide.targetTooltip.left + guide.targetTooltip.width / 2
|
|
18572
|
-
) : guide.targetTooltip.left + (isHorizontal ? 0 : guide.targetTooltip.width / 2);
|
|
18573
|
-
const startY = isHorizontal ? guide.sourceTooltip.top + (isHorizontal ? guide.sourceTooltip.height / 2 : 0) : Math.min(
|
|
18574
|
-
guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
|
|
18575
|
-
guide.targetTooltip.top + guide.targetTooltip.height / 2
|
|
18576
|
-
);
|
|
18577
|
-
const endY = isHorizontal ? guide.targetTooltip.top + (isHorizontal ? guide.targetTooltip.height / 2 : 0) : Math.max(
|
|
18578
|
-
guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
|
|
18579
|
-
guide.targetTooltip.top + guide.targetTooltip.height / 2
|
|
18580
|
-
);
|
|
18581
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
18582
|
-
/* @__PURE__ */ jsx(
|
|
18583
|
-
"div",
|
|
18584
|
-
{
|
|
18585
|
-
className: "fixed pointer-events-none z-30",
|
|
18586
|
-
style: {
|
|
18587
|
-
left: startX,
|
|
18588
|
-
top: startY,
|
|
18589
|
-
width: isHorizontal ? endX - startX : "2px",
|
|
18590
|
-
height: isHorizontal ? "2px" : endY - startY,
|
|
18591
|
-
backgroundColor: color,
|
|
18592
|
-
boxShadow: `0 0 8px ${color}60`,
|
|
18593
|
-
opacity: 0.9,
|
|
18594
|
-
borderStyle: "dashed",
|
|
18595
|
-
borderWidth: "1px",
|
|
18596
|
-
borderColor: color,
|
|
18597
|
-
transform: "translateZ(0)"
|
|
18598
|
-
}
|
|
18599
|
-
}
|
|
18600
|
-
),
|
|
18601
|
-
/* @__PURE__ */ jsx(
|
|
18602
|
-
"div",
|
|
18603
|
-
{
|
|
18604
|
-
className: "fixed pointer-events-none z-31",
|
|
18605
|
-
style: {
|
|
18606
|
-
left: guide.sourceTooltip.left + guide.sourceTooltip.width / 2 - 4,
|
|
18607
|
-
top: guide.sourceTooltip.top + guide.sourceTooltip.height / 2 - 4,
|
|
18608
|
-
width: "8px",
|
|
18609
|
-
height: "8px",
|
|
18610
|
-
backgroundColor: color,
|
|
18611
|
-
borderRadius: "50%",
|
|
18612
|
-
boxShadow: `0 0 4px ${color}80`,
|
|
18613
|
-
opacity: 0.8
|
|
18614
|
-
}
|
|
18615
|
-
}
|
|
18616
|
-
),
|
|
18617
|
-
/* @__PURE__ */ jsx(
|
|
18618
|
-
"div",
|
|
18619
|
-
{
|
|
18620
|
-
className: "fixed pointer-events-none z-31",
|
|
18621
|
-
style: {
|
|
18622
|
-
left: guide.targetTooltip.left + guide.targetTooltip.width / 2 - 4,
|
|
18623
|
-
top: guide.targetTooltip.top + guide.targetTooltip.height / 2 - 4,
|
|
18624
|
-
width: "8px",
|
|
18625
|
-
height: "8px",
|
|
18626
|
-
backgroundColor: color,
|
|
18627
|
-
borderRadius: "50%",
|
|
18628
|
-
boxShadow: `0 0 4px ${color}80`,
|
|
18629
|
-
opacity: 0.8
|
|
18630
|
-
}
|
|
18631
|
-
}
|
|
18632
|
-
)
|
|
18633
|
-
] }, index);
|
|
18634
|
-
}),
|
|
18635
|
-
activeTooltips.map((tooltip, index) => /* @__PURE__ */ jsx(
|
|
18636
|
-
DraggableTooltip_default,
|
|
18637
|
-
{
|
|
18638
|
-
id: tooltip.id,
|
|
18639
|
-
data: tooltip.data,
|
|
18640
|
-
position: tooltip.position,
|
|
18641
|
-
isDragging: isDragging === tooltip.id,
|
|
18642
|
-
title,
|
|
18643
|
-
dataKeys,
|
|
18644
|
-
finalColors,
|
|
18645
|
-
onMouseDown: (id, e) => handleMouseDown(id, e),
|
|
18646
|
-
onClose: (id) => {
|
|
18647
|
-
setActiveTooltips((prev) => prev.filter((t) => t.id !== id));
|
|
18648
|
-
},
|
|
18649
|
-
periodLabel: "Ponto Selecionado",
|
|
18650
|
-
dataLabel: "Dados do Ponto",
|
|
18651
|
-
showCloseAllButton: index === 0,
|
|
18652
|
-
globalTooltipCount,
|
|
18653
|
-
onCloseAll: handleCloseAllTooltips,
|
|
18654
|
-
closeAllButtonPosition: "top-center",
|
|
18655
|
-
closeAllButtonVariant: "floating"
|
|
18656
|
-
},
|
|
18657
|
-
tooltip.id
|
|
18658
|
-
))
|
|
18659
|
-
]
|
|
18660
|
-
}
|
|
18661
|
-
) });
|
|
18662
|
-
};
|
|
18663
|
-
var LineChart_default = CustomLineChart;
|
|
18664
|
-
var defaultData2 = [
|
|
18665
|
-
{ name: "Vendas", value: 4e3 },
|
|
18666
|
-
{ name: "Marketing", value: 3e3 },
|
|
18667
|
-
{ name: "Desenvolvimento", value: 2e3 },
|
|
18668
|
-
{ name: "Suporte", value: 1e3 },
|
|
18669
|
-
{ name: "Outros", value: 800 }
|
|
18670
|
-
];
|
|
18671
|
-
var DEFAULT_COLORS5 = [
|
|
18672
|
-
"#55af7d",
|
|
18673
|
-
// verde do projeto
|
|
18674
|
-
"#8e68ff",
|
|
18675
|
-
// roxo do projeto
|
|
18676
|
-
"#2273e1",
|
|
18677
|
-
// azul do projeto
|
|
18678
|
-
"#f59e0b",
|
|
18679
|
-
// amarelo complementar
|
|
18680
|
-
"#ef4444",
|
|
18681
|
-
// vermelho complementar
|
|
18682
|
-
"#8b5cf6",
|
|
18683
|
-
// roxo claro
|
|
18684
|
-
"#06b6d4",
|
|
18685
|
-
// ciano
|
|
18686
|
-
"#84cc16"
|
|
18687
|
-
// verde lima
|
|
18688
|
-
];
|
|
18689
|
-
var RADIAN = Math.PI / 180;
|
|
18690
|
-
var renderCustomizedLabel = ({
|
|
18691
|
-
cx = 0,
|
|
18692
|
-
cy = 0,
|
|
18693
|
-
midAngle = 0,
|
|
18694
|
-
innerRadius = 0,
|
|
18695
|
-
outerRadius = 0,
|
|
18696
|
-
percent = 0
|
|
18697
|
-
}) => {
|
|
18698
|
-
const radius = innerRadius + (outerRadius - innerRadius) * 0.5;
|
|
18699
|
-
const x = cx + radius * Math.cos(-midAngle * RADIAN);
|
|
18700
|
-
const y = cy + radius * Math.sin(-midAngle * RADIAN);
|
|
18701
|
-
return /* @__PURE__ */ jsx(
|
|
18702
|
-
"text",
|
|
18703
|
-
{
|
|
18704
|
-
x,
|
|
18705
|
-
y,
|
|
18706
|
-
fill: "white",
|
|
18707
|
-
textAnchor: x > cx ? "start" : "end",
|
|
18708
|
-
dominantBaseline: "central",
|
|
18709
|
-
fontSize: 12,
|
|
18710
|
-
fontWeight: "600",
|
|
18711
|
-
children: `${(percent * 100).toFixed(0)}%`
|
|
17488
|
+
const radius = innerRadius + (outerRadius - innerRadius) * 0.5;
|
|
17489
|
+
const x = cx + radius * Math.cos(-midAngle * RADIAN);
|
|
17490
|
+
const y = cy + radius * Math.sin(-midAngle * RADIAN);
|
|
17491
|
+
return /* @__PURE__ */ jsx(
|
|
17492
|
+
"text",
|
|
17493
|
+
{
|
|
17494
|
+
x,
|
|
17495
|
+
y,
|
|
17496
|
+
fill: "white",
|
|
17497
|
+
textAnchor: x > cx ? "start" : "end",
|
|
17498
|
+
dominantBaseline: "central",
|
|
17499
|
+
fontSize: 12,
|
|
17500
|
+
fontWeight: "600",
|
|
17501
|
+
children: `${(percent * 100).toFixed(0)}%`
|
|
18712
17502
|
}
|
|
18713
17503
|
);
|
|
18714
17504
|
};
|
|
18715
17505
|
var CustomPieChart = ({
|
|
18716
|
-
data =
|
|
17506
|
+
data = defaultData,
|
|
18717
17507
|
className,
|
|
18718
17508
|
height = 400,
|
|
18719
17509
|
width = "100%",
|
|
@@ -18726,7 +17516,7 @@ var CustomPieChart = ({
|
|
|
18726
17516
|
centerX = "50%",
|
|
18727
17517
|
centerY = "50%"
|
|
18728
17518
|
}) => {
|
|
18729
|
-
const finalColors = colors2 ||
|
|
17519
|
+
const finalColors = colors2 || DEFAULT_COLORS3;
|
|
18730
17520
|
return /* @__PURE__ */ jsx("div", { className: cn("w-full rounded-lg bg-card p-4", className), children: /* @__PURE__ */ jsx(ResponsiveContainer, { width, height, children: /* @__PURE__ */ jsxs(PieChart, { children: [
|
|
18731
17521
|
/* @__PURE__ */ jsx(
|
|
18732
17522
|
Pie,
|
|
@@ -19023,4 +17813,4 @@ function Leaderboard({
|
|
|
19023
17813
|
);
|
|
19024
17814
|
}
|
|
19025
17815
|
|
|
19026
|
-
export { AddButton, Agenda, AgendaDaysToShow, AgendaDaysToShowAgenda, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarCombobox, AvatarFallbackBase, AvatarImageBase, BackButton, Badge,
|
|
17816
|
+
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, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPreviousBase, ChangeButton, Chart_default as Chart, ChartTotalLegend_default as ChartTotalLegend, CheckButton, CheckboxBase, CheckboxTree, CloseAllButton_default as CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, CopyButton, DateTimePicker, DayView, DayViewAgenda, DebouncedInput, DefaultEndHour, DefaultEndHourAgenda, DefaultStartHour, DefaultStartHourAgenda, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent2 as DraggableEvent, DraggableTooltip_default as DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, DroppableCellAgenda, EditButton, EndHour, EndHourAgenda, ErrorMessage_default as ErrorMessage, EventAgenda, EventCalendar, EventDialog, EventGap, EventGapAgenda, EventHeight, EventHeightAgenda, EventItem, EventItemAgenda, EventsPopup, FavoriteButton, FileUploader, FilterButton, HideButton, Highlights_default as Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase_default as LabelBase, Leaderboard, LikeButton, LoadingBase, LockButton, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MonthViewAgenda, MoreButton, MultiCombobox, MultiSelect, MultiSelectBase, MultiSelectContentBase, MultiSelectGroupBase, MultiSelectItemBase, MultiSelectSeparatorBase, MultiSelectTriggerBase, MultiSelectValueBase, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NoData_default as NoData, NotificationButton, NumericInput, PeriodsDropdown_default as PeriodsDropdown, PieChart_default as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, ProgressCirclesBase, ProgressPanelsBase, ProgressSegmentsBase, RangePicker, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectEmpty, SelectGroupBase, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly_default as ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, StartHour, StartHourAgenda, StatusIndicator, SwitchBase, SystemTooltip_default as SystemTooltip, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, ThemeProviderBase, TimePicker, TimePickerInput, TimeSeries_default as TimeSeries, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple_default as TooltipSimple, TooltipTriggerBase, TooltipWithTotal_default as TooltipWithTotal, UndatedEvents, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, VISIBLE_ITEMS, ViewButton, VisibilityButton, WeekCellsHeight, WeekCellsHeightAgenda, WeekView, WeekViewAgenda, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, getBorderRadiusClasses, getBorderRadiusClassesAgenda, getDateByType, getEventColorClasses, getEventColorClassesAgenda, getEventEndDate, getEventStartDate, getEventsForDay, getEventsForDayAgenda, getItems, getMaxDataValue, getMinDataValue, getSpanningEventsForDay, getSpanningEventsForDayAgenda, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isMultiDayEventAgenda, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, normalizeAttendDate, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, toast, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useTheme, useTimeSeriesRange, visualForItem };
|