@mlw-packages/react-components 1.9.1 → 1.9.3
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/README.md +0 -111
- package/dist/index.css +81 -21
- package/dist/index.d.mts +95 -60
- package/dist/index.d.ts +95 -60
- package/dist/index.js +700 -343
- package/dist/index.mjs +700 -345
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
|
-
import { XIcon, CircleNotchIcon, MagnifyingGlassIcon, CaretUpIcon, CaretDownIcon, CheckIcon, CaretRightIcon, CircleIcon, CloudArrowUpIcon, MinusIcon, CaretUpDownIcon, PencilSimpleIcon, ArrowsLeftRightIcon, FloppyDiskIcon, PlusIcon, TrashIcon, SidebarSimpleIcon, FilePdfIcon, FileDocIcon, FileXlsIcon, FilePptIcon, FileCsvIcon, FileTextIcon, FileImageIcon, FileVideoIcon, FileAudioIcon, FileZipIcon, FileIcon, DotsSixVerticalIcon, InfoIcon, WarningIcon, XCircleIcon, CheckCircleIcon, SunIcon, MoonIcon, CaretLeftIcon, DownloadSimpleIcon, UploadSimpleIcon, CopyIcon, ArrowClockwiseIcon, ArrowLeftIcon, GearIcon, BellIcon, DotsThreeIcon, FunnelIcon, HeartIcon, StarIcon, EyeIcon, EyeSlashIcon, LockIcon, LockOpenIcon, ArrowRightIcon as ArrowRightIcon$1, FolderIcon, ArrowsOutIcon, DownloadIcon, CalendarBlankIcon, CalendarIcon, CaretLeft, CaretRight, ArrowDownIcon, ClockUserIcon, EyeSlash, Eye, ArrowRight, ArrowUpRightIcon, ArrowDownRightIcon, FileArchiveIcon, TerminalIcon, CodeIcon, CalendarDotIcon as CalendarDotIcon$1, DesktopIcon } from '@phosphor-icons/react';
|
|
8
|
+
import { XIcon, CircleNotchIcon, MagnifyingGlassIcon, CaretUpIcon, CaretDownIcon, CheckIcon, CaretRightIcon, CircleIcon, CloudArrowUpIcon, MinusIcon, CaretUpDownIcon, PencilSimpleIcon, ArrowsLeftRightIcon, FloppyDiskIcon, PlusIcon, TrashIcon, SidebarSimpleIcon, FilePdfIcon, FileDocIcon, FileXlsIcon, FilePptIcon, FileCsvIcon, FileTextIcon, FileImageIcon, FileVideoIcon, FileAudioIcon, FileZipIcon, FileIcon, DotsSixVerticalIcon, InfoIcon, WarningIcon, XCircleIcon, CheckCircleIcon, SunIcon, MoonIcon, CaretLeftIcon, DownloadSimpleIcon, UploadSimpleIcon, CopyIcon, ArrowClockwiseIcon, ArrowLeftIcon, GearIcon, BellIcon, DotsThreeIcon, FunnelIcon, HeartIcon, StarIcon, EyeIcon, EyeSlashIcon, LockIcon, LockOpenIcon, ArrowRightIcon as ArrowRightIcon$1, FolderIcon, ArrowsOutIcon, DownloadIcon, CalendarBlankIcon, CalendarIcon, CaretLeft, CaretRight, ArrowDownIcon, ClockUserIcon, EyeSlash, Eye, ArrowRight, ArrowUpRightIcon, ArrowDownRightIcon, FunnelSimpleIcon, FileArchiveIcon, TerminalIcon, CodeIcon, CalendarDotIcon as CalendarDotIcon$1, DesktopIcon } from '@phosphor-icons/react';
|
|
9
9
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -627,7 +627,7 @@ var DialogOverlayBase = React33.forwardRef(({ className, testid: dataTestId = "d
|
|
|
627
627
|
{
|
|
628
628
|
ref,
|
|
629
629
|
className: cn(
|
|
630
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0
|
|
630
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ",
|
|
631
631
|
className
|
|
632
632
|
),
|
|
633
633
|
"data-testid": dataTestId,
|
|
@@ -645,7 +645,7 @@ var DialogContentBase = React33.forwardRef(
|
|
|
645
645
|
{
|
|
646
646
|
ref,
|
|
647
647
|
className: cn(
|
|
648
|
-
"fixed left-[50%] top-[50%] z-50 w-lg grid translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg max-h-[100dvh] overflow-auto rounded-md border-border",
|
|
648
|
+
"fixed left-[50%] top-[50%] z-50 w-[90%] sm:w-lg grid translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg max-h-[100dvh] overflow-y-auto overflow-x-hidden rounded-md border-border",
|
|
649
649
|
className
|
|
650
650
|
),
|
|
651
651
|
"data-testid": dataTestId,
|
|
@@ -1272,15 +1272,27 @@ var toast = {
|
|
|
1272
1272
|
};
|
|
1273
1273
|
var MOBILE_BREAKPOINT = 768;
|
|
1274
1274
|
function useIsMobile() {
|
|
1275
|
-
const [isMobile, setIsMobile] = React33.useState(
|
|
1275
|
+
const [isMobile, setIsMobile] = React33.useState(
|
|
1276
|
+
void 0
|
|
1277
|
+
);
|
|
1276
1278
|
React33.useEffect(() => {
|
|
1279
|
+
const checkIsMobile = () => {
|
|
1280
|
+
const isTouch = window.matchMedia("(pointer: coarse)").matches || navigator.maxTouchPoints > 0;
|
|
1281
|
+
const isSmallScreen = window.innerWidth < MOBILE_BREAKPOINT;
|
|
1282
|
+
return isTouch || isSmallScreen;
|
|
1283
|
+
};
|
|
1277
1284
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
1285
|
+
const touchMql = window.matchMedia("(pointer: coarse)");
|
|
1278
1286
|
const onChange = () => {
|
|
1279
|
-
setIsMobile(
|
|
1287
|
+
setIsMobile(checkIsMobile());
|
|
1280
1288
|
};
|
|
1281
1289
|
mql.addEventListener("change", onChange);
|
|
1282
|
-
|
|
1283
|
-
|
|
1290
|
+
touchMql.addEventListener("change", onChange);
|
|
1291
|
+
setIsMobile(checkIsMobile());
|
|
1292
|
+
return () => {
|
|
1293
|
+
mql.removeEventListener("change", onChange);
|
|
1294
|
+
touchMql.removeEventListener("change", onChange);
|
|
1295
|
+
};
|
|
1284
1296
|
}, []);
|
|
1285
1297
|
return !!isMobile;
|
|
1286
1298
|
}
|
|
@@ -1899,21 +1911,28 @@ var CommandDialogBase = ({ children, open, ...props }) => {
|
|
|
1899
1911
|
"command-dialog"
|
|
1900
1912
|
) }) }) });
|
|
1901
1913
|
};
|
|
1902
|
-
var CommandInputBase = React33.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
className:
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1914
|
+
var CommandInputBase = React33.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1915
|
+
"div",
|
|
1916
|
+
{
|
|
1917
|
+
className: "flex items-center border-b px-3 border-border",
|
|
1918
|
+
"cmdk-input-wrapper": "",
|
|
1919
|
+
children: [
|
|
1920
|
+
/* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 text-primary" }),
|
|
1921
|
+
/* @__PURE__ */ jsx(
|
|
1922
|
+
Command.Input,
|
|
1923
|
+
{
|
|
1924
|
+
ref,
|
|
1925
|
+
className: cn(
|
|
1926
|
+
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none text-primary placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
1927
|
+
className
|
|
1928
|
+
),
|
|
1929
|
+
"data-testid": dataTestId,
|
|
1930
|
+
...props
|
|
1931
|
+
}
|
|
1932
|
+
)
|
|
1933
|
+
]
|
|
1934
|
+
}
|
|
1935
|
+
));
|
|
1917
1936
|
CommandInputBase.displayName = Command.Input.displayName;
|
|
1918
1937
|
var CommandListBase = React33.forwardRef(({ className, testid: dataTestId = "command-list", ...props }, ref) => {
|
|
1919
1938
|
const listRef = React33.useRef(null);
|
|
@@ -1921,11 +1940,45 @@ var CommandListBase = React33.forwardRef(({ className, testid: dataTestId = "com
|
|
|
1921
1940
|
const element = listRef.current;
|
|
1922
1941
|
if (!element) return;
|
|
1923
1942
|
const handleWheel = (e) => {
|
|
1943
|
+
const target = e.currentTarget;
|
|
1944
|
+
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
1945
|
+
const isScrollingDown = e.deltaY > 0;
|
|
1946
|
+
const isScrollingUp = e.deltaY < 0;
|
|
1947
|
+
const isAtBottom = scrollTop + clientHeight >= scrollHeight - 1;
|
|
1948
|
+
const isAtTop = scrollTop <= 1;
|
|
1949
|
+
if (isScrollingDown && !isAtBottom || isScrollingUp && !isAtTop) {
|
|
1950
|
+
e.stopPropagation();
|
|
1951
|
+
}
|
|
1952
|
+
};
|
|
1953
|
+
let touchStartY = 0;
|
|
1954
|
+
const handleTouchStart = (e) => {
|
|
1955
|
+
touchStartY = e.touches[0].clientY;
|
|
1924
1956
|
e.stopPropagation();
|
|
1925
1957
|
};
|
|
1958
|
+
const handleTouchMove = (e) => {
|
|
1959
|
+
const target = e.currentTarget;
|
|
1960
|
+
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
1961
|
+
const touchCurrentY = e.touches[0].clientY;
|
|
1962
|
+
const touchDeltaY = touchStartY - touchCurrentY;
|
|
1963
|
+
const isScrollingDown = touchDeltaY > 0;
|
|
1964
|
+
const isScrollingUp = touchDeltaY < 0;
|
|
1965
|
+
const isAtBottom = scrollTop + clientHeight >= scrollHeight - 1;
|
|
1966
|
+
const isAtTop = scrollTop <= 1;
|
|
1967
|
+
if (isScrollingDown && !isAtBottom || isScrollingUp && !isAtTop) {
|
|
1968
|
+
e.stopPropagation();
|
|
1969
|
+
} else if (isScrollingDown && isAtBottom || isScrollingUp && isAtTop) {
|
|
1970
|
+
e.preventDefault();
|
|
1971
|
+
}
|
|
1972
|
+
};
|
|
1926
1973
|
element.addEventListener("wheel", handleWheel, { passive: false });
|
|
1974
|
+
element.addEventListener("touchstart", handleTouchStart, {
|
|
1975
|
+
passive: false
|
|
1976
|
+
});
|
|
1977
|
+
element.addEventListener("touchmove", handleTouchMove, { passive: false });
|
|
1927
1978
|
return () => {
|
|
1928
1979
|
element.removeEventListener("wheel", handleWheel);
|
|
1980
|
+
element.removeEventListener("touchmove", handleTouchMove);
|
|
1981
|
+
element.removeEventListener("touchstart", handleTouchStart);
|
|
1929
1982
|
};
|
|
1930
1983
|
}, []);
|
|
1931
1984
|
const combinedRef = React33.useCallback(
|
|
@@ -1950,7 +2003,13 @@ var CommandListBase = React33.forwardRef(({ className, testid: dataTestId = "com
|
|
|
1950
2003
|
"data-testid": dataTestId,
|
|
1951
2004
|
style: {
|
|
1952
2005
|
overscrollBehavior: "contain",
|
|
1953
|
-
WebkitOverflowScrolling: "touch"
|
|
2006
|
+
WebkitOverflowScrolling: "touch",
|
|
2007
|
+
touchAction: "pan-y",
|
|
2008
|
+
scrollbarWidth: "thin",
|
|
2009
|
+
scrollbarColor: "hsl(var(--muted)) transparent",
|
|
2010
|
+
overflowY: "auto",
|
|
2011
|
+
willChange: "scroll-position",
|
|
2012
|
+
transform: "translateZ(0)"
|
|
1954
2013
|
},
|
|
1955
2014
|
...props
|
|
1956
2015
|
}
|
|
@@ -2028,6 +2087,7 @@ var PopoverContentBase = React33.forwardRef(
|
|
|
2028
2087
|
align = "center",
|
|
2029
2088
|
sideOffset = 4,
|
|
2030
2089
|
testid: dataTestId = "popover-content",
|
|
2090
|
+
style,
|
|
2031
2091
|
...props
|
|
2032
2092
|
}, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
2033
2093
|
PopoverPrimitive.Content,
|
|
@@ -2036,10 +2096,20 @@ var PopoverContentBase = React33.forwardRef(
|
|
|
2036
2096
|
align,
|
|
2037
2097
|
sideOffset,
|
|
2038
2098
|
className: cn(
|
|
2039
|
-
"z-
|
|
2099
|
+
"z-[100] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2040
2100
|
className
|
|
2041
2101
|
),
|
|
2042
2102
|
"data-testid": dataTestId,
|
|
2103
|
+
style: {
|
|
2104
|
+
...style,
|
|
2105
|
+
WebkitOverflowScrolling: "touch",
|
|
2106
|
+
overscrollBehavior: "contain",
|
|
2107
|
+
pointerEvents: "auto"
|
|
2108
|
+
},
|
|
2109
|
+
onWheel: (e) => {
|
|
2110
|
+
e.stopPropagation();
|
|
2111
|
+
props.onWheel?.(e);
|
|
2112
|
+
},
|
|
2043
2113
|
onInteractOutside: (event) => {
|
|
2044
2114
|
props.onInteractOutside?.(event);
|
|
2045
2115
|
if (event.defaultPrevented) return;
|
|
@@ -2096,7 +2166,6 @@ function ComboboxBase({
|
|
|
2096
2166
|
hideClear = false
|
|
2097
2167
|
}) {
|
|
2098
2168
|
const [open, setOpen] = useState(false);
|
|
2099
|
-
const isMobile = useIsMobile();
|
|
2100
2169
|
return /* @__PURE__ */ jsxs(
|
|
2101
2170
|
"div",
|
|
2102
2171
|
{
|
|
@@ -2108,7 +2177,7 @@ function ComboboxBase({
|
|
|
2108
2177
|
{
|
|
2109
2178
|
open,
|
|
2110
2179
|
onOpenChange: (v) => !disabled && setOpen(v),
|
|
2111
|
-
modal:
|
|
2180
|
+
modal: false,
|
|
2112
2181
|
children: [
|
|
2113
2182
|
/* @__PURE__ */ jsx(
|
|
2114
2183
|
PopoverTriggerBase,
|
|
@@ -2840,7 +2909,7 @@ var SelectContentBase = React33.forwardRef(
|
|
|
2840
2909
|
{
|
|
2841
2910
|
ref,
|
|
2842
2911
|
className: cn(
|
|
2843
|
-
"relative z-50 max-h-96
|
|
2912
|
+
"relative z-50 max-h-96 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
2844
2913
|
className
|
|
2845
2914
|
),
|
|
2846
2915
|
position,
|
|
@@ -5381,14 +5450,29 @@ var TableCaptionBase = React33.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
5381
5450
|
}
|
|
5382
5451
|
));
|
|
5383
5452
|
TableCaptionBase.displayName = "TableCaptionBase";
|
|
5384
|
-
var TabsBase =
|
|
5453
|
+
var TabsBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5454
|
+
TabsPrimitive.Root,
|
|
5455
|
+
{
|
|
5456
|
+
ref,
|
|
5457
|
+
className: cn("w-full", className),
|
|
5458
|
+
...props
|
|
5459
|
+
}
|
|
5460
|
+
));
|
|
5461
|
+
TabsBase.displayName = TabsPrimitive.Root.displayName;
|
|
5385
5462
|
var TabsListBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5386
5463
|
TabsPrimitive.List,
|
|
5387
5464
|
{
|
|
5388
5465
|
ref,
|
|
5389
5466
|
className: cn(
|
|
5390
5467
|
"relative flex w-full items-center justify-start gap-2 border-b border-border",
|
|
5391
|
-
"bg-transparent",
|
|
5468
|
+
"bg-transparent overflow-x-auto",
|
|
5469
|
+
"scrollbar-thin scrollbar-thumb-muted-foreground/30 scrollbar-track-transparent",
|
|
5470
|
+
"hover:scrollbar-thumb-muted-foreground/50",
|
|
5471
|
+
"[&::-webkit-scrollbar]:h-1.5",
|
|
5472
|
+
"[&::-webkit-scrollbar-track]:bg-transparent",
|
|
5473
|
+
"[&::-webkit-scrollbar-thumb]:bg-muted-foreground/30",
|
|
5474
|
+
"[&::-webkit-scrollbar-thumb]:rounded-full",
|
|
5475
|
+
"hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50",
|
|
5392
5476
|
className
|
|
5393
5477
|
),
|
|
5394
5478
|
...props
|
|
@@ -7721,13 +7805,11 @@ function ScrollColumn({
|
|
|
7721
7805
|
} = useScrollColumn({ value, onChange, max, step });
|
|
7722
7806
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
7723
7807
|
/* @__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-
|
|
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" }),
|
|
7808
|
+
/* @__PURE__ */ jsxs("div", { className: cn("relative w-20"), children: [
|
|
7727
7809
|
/* @__PURE__ */ jsx(
|
|
7728
7810
|
"div",
|
|
7729
7811
|
{
|
|
7730
|
-
className: "absolute left-0 right-0 pointer-events-none bg-muted/50
|
|
7812
|
+
className: "absolute left-0 right-0 pointer-events-none bg-muted/50 rounded-md border border-border",
|
|
7731
7813
|
style: {
|
|
7732
7814
|
top: `${centerIndex * itemHeight}px`,
|
|
7733
7815
|
height: `${itemHeight}px`
|
|
@@ -8111,7 +8193,7 @@ function DateTimePicker({
|
|
|
8111
8193
|
}
|
|
8112
8194
|
),
|
|
8113
8195
|
/* @__PURE__ */ jsx(ErrorMessage_default, { error }),
|
|
8114
|
-
/* @__PURE__ */ jsx(DialogContentBase, { className: "p-0 max-h-[
|
|
8196
|
+
/* @__PURE__ */ jsx(DialogContentBase, { className: "p-0 max-h-[95vh] w-3/6 overflow-hidden flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "overflow-y-auto flex-1", children: renderPickerContent() }) })
|
|
8115
8197
|
] }) : /* @__PURE__ */ jsxs(PopoverBase, { open, onOpenChange: setOpen, children: [
|
|
8116
8198
|
/* @__PURE__ */ jsx(
|
|
8117
8199
|
PopoverTriggerBase,
|
|
@@ -10097,8 +10179,8 @@ function EventAgenda({
|
|
|
10097
10179
|
setView(v);
|
|
10098
10180
|
},
|
|
10099
10181
|
items: selectItems,
|
|
10100
|
-
className: "gap-2 px-3 py-1.5 max-[479px]:h-8",
|
|
10101
10182
|
placeholder: viewLabel(view),
|
|
10183
|
+
className: "min-w-24",
|
|
10102
10184
|
hideClear: true
|
|
10103
10185
|
}
|
|
10104
10186
|
) })
|
|
@@ -10106,8 +10188,7 @@ function EventAgenda({
|
|
|
10106
10188
|
/* @__PURE__ */ jsxs(
|
|
10107
10189
|
"div",
|
|
10108
10190
|
{
|
|
10109
|
-
className: "flex flex-
|
|
10110
|
-
"aria-live": "polite",
|
|
10191
|
+
className: "flex flex-col transition-all duration-200 ease-in-out",
|
|
10111
10192
|
children: [
|
|
10112
10193
|
view === "month" && /* @__PURE__ */ jsx(
|
|
10113
10194
|
MonthViewAgenda,
|
|
@@ -14115,29 +14196,62 @@ var adaptDataForTooltip = (data, xAxisKey) => {
|
|
|
14115
14196
|
};
|
|
14116
14197
|
var createValueFormatter = (customFormatter, formatBR) => {
|
|
14117
14198
|
const nf = new Intl.NumberFormat("pt-BR", {
|
|
14118
|
-
minimumFractionDigits:
|
|
14119
|
-
maximumFractionDigits:
|
|
14199
|
+
minimumFractionDigits: 0,
|
|
14200
|
+
maximumFractionDigits: 0
|
|
14120
14201
|
});
|
|
14202
|
+
const prefixFormats = ["R$", "$", "\u20AC", "\xA3"];
|
|
14203
|
+
const suffixFormats = ["%", "kg", "km", "m", "L", "un", "t", "h", "min", "s"];
|
|
14204
|
+
const getFormattedValue = (baseValue, format17) => {
|
|
14205
|
+
const trimmedFormat = format17.trim();
|
|
14206
|
+
if (prefixFormats.includes(trimmedFormat)) {
|
|
14207
|
+
return `${trimmedFormat} ${baseValue}`;
|
|
14208
|
+
}
|
|
14209
|
+
if (suffixFormats.includes(trimmedFormat)) {
|
|
14210
|
+
return `${baseValue}${trimmedFormat}`;
|
|
14211
|
+
}
|
|
14212
|
+
return `${baseValue} ${trimmedFormat}`;
|
|
14213
|
+
};
|
|
14121
14214
|
if (customFormatter) {
|
|
14122
|
-
if (
|
|
14123
|
-
const
|
|
14124
|
-
|
|
14215
|
+
if (typeof customFormatter === "object" && !Array.isArray(customFormatter)) {
|
|
14216
|
+
const formatterMap = customFormatter;
|
|
14217
|
+
return (props) => {
|
|
14218
|
+
const {
|
|
14219
|
+
value,
|
|
14220
|
+
formattedValue,
|
|
14221
|
+
dataKey: propsDataKey
|
|
14222
|
+
} = props;
|
|
14125
14223
|
let num = NaN;
|
|
14126
14224
|
if (typeof value === "number") num = value;
|
|
14127
14225
|
else if (typeof value === "string" && value.trim() !== "") {
|
|
14128
14226
|
const parsed = Number(value);
|
|
14129
14227
|
num = Number.isNaN(parsed) ? NaN : parsed;
|
|
14130
14228
|
}
|
|
14131
|
-
const
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
formattedValue: brFormatted,
|
|
14135
|
-
value: void 0
|
|
14136
|
-
});
|
|
14229
|
+
const baseFormatted = formatBR && !Number.isNaN(num) ? nf.format(num) : String(formattedValue ?? value ?? "");
|
|
14230
|
+
const format17 = propsDataKey && formatterMap[propsDataKey] ? formatterMap[propsDataKey] : "";
|
|
14231
|
+
return format17 ? getFormattedValue(baseFormatted, format17) : baseFormatted;
|
|
14137
14232
|
};
|
|
14138
|
-
return wrapped;
|
|
14139
14233
|
}
|
|
14140
|
-
|
|
14234
|
+
if (typeof customFormatter === "function") {
|
|
14235
|
+
if (formatBR) {
|
|
14236
|
+
const wrapped = (props) => {
|
|
14237
|
+
const { value, formattedValue } = props;
|
|
14238
|
+
let num = NaN;
|
|
14239
|
+
if (typeof value === "number") num = value;
|
|
14240
|
+
else if (typeof value === "string" && value.trim() !== "") {
|
|
14241
|
+
const parsed = Number(value);
|
|
14242
|
+
num = Number.isNaN(parsed) ? NaN : parsed;
|
|
14243
|
+
}
|
|
14244
|
+
const brFormatted = !Number.isNaN(num) ? nf.format(num) : String(formattedValue ?? value ?? "");
|
|
14245
|
+
return customFormatter({
|
|
14246
|
+
...props,
|
|
14247
|
+
formattedValue: brFormatted,
|
|
14248
|
+
value: void 0
|
|
14249
|
+
});
|
|
14250
|
+
};
|
|
14251
|
+
return wrapped;
|
|
14252
|
+
}
|
|
14253
|
+
return customFormatter;
|
|
14254
|
+
}
|
|
14141
14255
|
}
|
|
14142
14256
|
if (!formatBR) return void 0;
|
|
14143
14257
|
const builtIn = (props) => {
|
|
@@ -14155,8 +14269,8 @@ var createValueFormatter = (customFormatter, formatBR) => {
|
|
|
14155
14269
|
};
|
|
14156
14270
|
var createYTickFormatter = (finalValueFormatter) => {
|
|
14157
14271
|
const nf = new Intl.NumberFormat("pt-BR", {
|
|
14158
|
-
minimumFractionDigits:
|
|
14159
|
-
maximumFractionDigits:
|
|
14272
|
+
minimumFractionDigits: 0,
|
|
14273
|
+
maximumFractionDigits: 0
|
|
14160
14274
|
});
|
|
14161
14275
|
const stripCurrency = (s) => String(s).replace(/^\s*R\$\s?/, "");
|
|
14162
14276
|
if (finalValueFormatter) {
|
|
@@ -15666,7 +15780,7 @@ var Brush = ({
|
|
|
15666
15780
|
xAxisKey,
|
|
15667
15781
|
seriesOrder,
|
|
15668
15782
|
finalColors,
|
|
15669
|
-
brushHeight =
|
|
15783
|
+
brushHeight = 40,
|
|
15670
15784
|
brushColor,
|
|
15671
15785
|
miniChartOpacity = 0.3
|
|
15672
15786
|
}) => {
|
|
@@ -15890,16 +16004,76 @@ var ChartTotalLegend = ({ items }) => {
|
|
|
15890
16004
|
] }, index)) });
|
|
15891
16005
|
};
|
|
15892
16006
|
var ChartTotalLegend_default = ChartTotalLegend;
|
|
16007
|
+
var formatFieldName2 = (key) => {
|
|
16008
|
+
return key.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).trim();
|
|
16009
|
+
};
|
|
16010
|
+
var HorizontalLegend = ({
|
|
16011
|
+
allKeys,
|
|
16012
|
+
mapperConfig,
|
|
16013
|
+
finalColors,
|
|
16014
|
+
labelMap,
|
|
16015
|
+
legendUppercase = false,
|
|
16016
|
+
orderBy,
|
|
16017
|
+
maxPeriodLabel,
|
|
16018
|
+
minPeriodLabel,
|
|
16019
|
+
className
|
|
16020
|
+
}) => {
|
|
16021
|
+
const formatLegendLabel = (key) => {
|
|
16022
|
+
const label = mapperConfig[key]?.label ?? labelMap?.[key] ?? formatFieldName2(key);
|
|
16023
|
+
return legendUppercase ? label.toUpperCase() : label;
|
|
16024
|
+
};
|
|
16025
|
+
return /* @__PURE__ */ jsx("div", { className: cn(className), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 sm:gap-3 md:gap-4 flex-wrap", children: [
|
|
16026
|
+
allKeys.map((key) => {
|
|
16027
|
+
const displayLabel = formatLegendLabel(key);
|
|
16028
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 sm:gap-2", children: [
|
|
16029
|
+
/* @__PURE__ */ jsx(
|
|
16030
|
+
"div",
|
|
16031
|
+
{
|
|
16032
|
+
className: "w-2.5 h-2.5 sm:w-3 sm:h-3 rounded-sm flex-shrink-0",
|
|
16033
|
+
style: { backgroundColor: finalColors[key] }
|
|
16034
|
+
}
|
|
16035
|
+
),
|
|
16036
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs sm:text-sm tracking-[0] break-words", children: displayLabel })
|
|
16037
|
+
] }, key);
|
|
16038
|
+
}),
|
|
16039
|
+
orderBy && maxPeriodLabel && minPeriodLabel && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 sm:gap-3 md:gap-4 w-full sm:w-auto justify-center mt-2 sm:mt-0 sm:ml-3 sm:pl-3 md:ml-4 md:pl-4 sm:border-l border-border", children: [
|
|
16040
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 sm:gap-1.5", children: [
|
|
16041
|
+
/* @__PURE__ */ jsx(
|
|
16042
|
+
FunnelSimpleIcon,
|
|
16043
|
+
{
|
|
16044
|
+
className: "w-3 h-3 sm:w-4 sm:h-4 text-green-600 flex-shrink-0",
|
|
16045
|
+
weight: "bold"
|
|
16046
|
+
}
|
|
16047
|
+
),
|
|
16048
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs sm:text-sm tracking-[0] font-medium truncate max-w-[120px] sm:max-w-none", children: maxPeriodLabel })
|
|
16049
|
+
] }),
|
|
16050
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 sm:gap-1.5", children: [
|
|
16051
|
+
/* @__PURE__ */ jsx(
|
|
16052
|
+
FunnelSimpleIcon,
|
|
16053
|
+
{
|
|
16054
|
+
className: "w-3 h-3 sm:w-4 sm:h-4 text-red-600 rotate-180 flex-shrink-0",
|
|
16055
|
+
weight: "bold"
|
|
16056
|
+
}
|
|
16057
|
+
),
|
|
16058
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs sm:text-sm tracking-[0] font-medium truncate max-w-[120px] sm:max-w-none", children: minPeriodLabel })
|
|
16059
|
+
] })
|
|
16060
|
+
] })
|
|
16061
|
+
] }) });
|
|
16062
|
+
};
|
|
16063
|
+
var HorizontalLegend_default = HorizontalLegend;
|
|
15893
16064
|
var formatCompactNumber = (value) => {
|
|
15894
16065
|
const isNegative = value < 0;
|
|
15895
16066
|
const absValue = Math.abs(value);
|
|
15896
16067
|
let formatted;
|
|
15897
16068
|
if (absValue >= 1e9) {
|
|
15898
|
-
|
|
16069
|
+
const billions = absValue / 1e9;
|
|
16070
|
+
formatted = (billions % 1 === 0 ? billions.toFixed(0) : billions.toFixed(1)) + "B";
|
|
15899
16071
|
} else if (absValue >= 1e6) {
|
|
15900
|
-
|
|
16072
|
+
const millions = absValue / 1e6;
|
|
16073
|
+
formatted = (millions % 1 === 0 ? millions.toFixed(0) : millions.toFixed(1)) + "M";
|
|
15901
16074
|
} else if (absValue >= 1e3) {
|
|
15902
|
-
|
|
16075
|
+
const thousands = absValue / 1e3;
|
|
16076
|
+
formatted = (thousands % 1 === 0 ? thousands.toFixed(0) : thousands.toFixed(1)) + " mil";
|
|
15903
16077
|
} else {
|
|
15904
16078
|
try {
|
|
15905
16079
|
const nf = new Intl.NumberFormat("pt-BR", {
|
|
@@ -16626,6 +16800,42 @@ function useTimeSeriesRange({
|
|
|
16626
16800
|
handleMouseDown
|
|
16627
16801
|
};
|
|
16628
16802
|
}
|
|
16803
|
+
var useChartMinMax = ({
|
|
16804
|
+
processedData,
|
|
16805
|
+
orderBy,
|
|
16806
|
+
xAxisDataKey,
|
|
16807
|
+
categoryFormatter
|
|
16808
|
+
}) => {
|
|
16809
|
+
return useMemo(() => {
|
|
16810
|
+
if (!processedData || processedData.length === 0 || !orderBy) {
|
|
16811
|
+
return {
|
|
16812
|
+
maxPeriodLabel: "",
|
|
16813
|
+
minPeriodLabel: ""
|
|
16814
|
+
};
|
|
16815
|
+
}
|
|
16816
|
+
let maxValue = -Infinity;
|
|
16817
|
+
let minValue = Infinity;
|
|
16818
|
+
let maxPeriodLabel = "";
|
|
16819
|
+
let minPeriodLabel = "";
|
|
16820
|
+
processedData.forEach((item) => {
|
|
16821
|
+
const value = Number(item[orderBy]) || 0;
|
|
16822
|
+
const periodName = String(item[xAxisDataKey] || "N/A");
|
|
16823
|
+
const formattedPeriod = categoryFormatter ? categoryFormatter(periodName) : periodName;
|
|
16824
|
+
if (value > maxValue) {
|
|
16825
|
+
maxValue = value;
|
|
16826
|
+
maxPeriodLabel = formattedPeriod;
|
|
16827
|
+
}
|
|
16828
|
+
if (value < minValue) {
|
|
16829
|
+
minValue = value;
|
|
16830
|
+
minPeriodLabel = formattedPeriod;
|
|
16831
|
+
}
|
|
16832
|
+
});
|
|
16833
|
+
return {
|
|
16834
|
+
maxPeriodLabel,
|
|
16835
|
+
minPeriodLabel
|
|
16836
|
+
};
|
|
16837
|
+
}, [processedData, orderBy, xAxisDataKey, categoryFormatter]);
|
|
16838
|
+
};
|
|
16629
16839
|
var filtersOrder = (mapperConfig, series) => {
|
|
16630
16840
|
const seriesOrder = [];
|
|
16631
16841
|
if (series) {
|
|
@@ -16698,7 +16908,7 @@ var fnSmartConfig = ({ xAxis, data, labelMap }) => {
|
|
|
16698
16908
|
return { xAxisConfig, mapperConfig };
|
|
16699
16909
|
};
|
|
16700
16910
|
var fnConfigRightKeys = (biaxialConfigNormalized, yTickFormatter, finalColors) => {
|
|
16701
|
-
const decimals = typeof biaxialConfigNormalized?.decimals === "number" ? Math.max(0, Math.floor(biaxialConfigNormalized.decimals)) :
|
|
16911
|
+
const decimals = typeof biaxialConfigNormalized?.decimals === "number" ? Math.max(0, Math.floor(biaxialConfigNormalized.decimals)) : 1;
|
|
16702
16912
|
const rightTickFormatter = (v) => {
|
|
16703
16913
|
if (biaxialConfigNormalized?.percentage) {
|
|
16704
16914
|
const num = Number(String(v));
|
|
@@ -16748,6 +16958,11 @@ var fnContentLabelList = (p) => {
|
|
|
16748
16958
|
const needsOutside = barHeight > 0 && barHeight < smallThreshold || barWidth > 0 && barWidth < smallThreshold;
|
|
16749
16959
|
return needsOutside ? null : true;
|
|
16750
16960
|
};
|
|
16961
|
+
|
|
16962
|
+
// src/utils/calcDivision.ts
|
|
16963
|
+
var calcDivision = (dividend, divisor) => {
|
|
16964
|
+
return dividend / divisor;
|
|
16965
|
+
};
|
|
16751
16966
|
var DEFAULT_COLORS2 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
16752
16967
|
var Chart = ({
|
|
16753
16968
|
data,
|
|
@@ -16784,7 +16999,9 @@ var Chart = ({
|
|
|
16784
16999
|
isLoading = false,
|
|
16785
17000
|
timeSeries,
|
|
16786
17001
|
timeSeriesLegend,
|
|
16787
|
-
customLegend
|
|
17002
|
+
customLegend,
|
|
17003
|
+
horizontal = false,
|
|
17004
|
+
orderBy
|
|
16788
17005
|
}) => {
|
|
16789
17006
|
const { xAxisConfig, mapperConfig } = useMemo(() => {
|
|
16790
17007
|
return fnSmartConfig({ xAxis, data, labelMap });
|
|
@@ -16820,16 +17037,38 @@ var Chart = ({
|
|
|
16820
17037
|
defaultEndIndex: timeSeriesConfig?.end,
|
|
16821
17038
|
onRangeChange: timeSeriesConfig?.onRangeChange
|
|
16822
17039
|
});
|
|
17040
|
+
const { maxPeriodLabel, minPeriodLabel } = useChartMinMax({
|
|
17041
|
+
processedData: data,
|
|
17042
|
+
orderBy,
|
|
17043
|
+
xAxisDataKey: xAxisConfig.dataKey,
|
|
17044
|
+
categoryFormatter
|
|
17045
|
+
});
|
|
16823
17046
|
const processedData = useMemo(() => {
|
|
16824
17047
|
const mapped = data.map((item) => ({
|
|
16825
17048
|
...item,
|
|
16826
17049
|
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
16827
17050
|
}));
|
|
17051
|
+
let result = mapped;
|
|
16828
17052
|
if (timeSeriesConfig) {
|
|
16829
|
-
|
|
17053
|
+
result = mapped.slice(startIndex, endIndex + 1);
|
|
17054
|
+
}
|
|
17055
|
+
if (orderBy && horizontal) {
|
|
17056
|
+
result = [...result].sort((a, b) => {
|
|
17057
|
+
const valueA = Number(a[orderBy]) || 0;
|
|
17058
|
+
const valueB = Number(b[orderBy]) || 0;
|
|
17059
|
+
return valueB - valueA;
|
|
17060
|
+
});
|
|
16830
17061
|
}
|
|
16831
|
-
return
|
|
16832
|
-
}, [
|
|
17062
|
+
return result;
|
|
17063
|
+
}, [
|
|
17064
|
+
data,
|
|
17065
|
+
xAxisConfig.dataKey,
|
|
17066
|
+
timeSeriesConfig,
|
|
17067
|
+
startIndex,
|
|
17068
|
+
endIndex,
|
|
17069
|
+
orderBy,
|
|
17070
|
+
horizontal
|
|
17071
|
+
]);
|
|
16833
17072
|
const seriesOrder = filtersOrder(mapperConfig, series);
|
|
16834
17073
|
const allKeys = seriesOrder.map((s) => s.key).filter(Boolean);
|
|
16835
17074
|
const finalColors = useMemo(
|
|
@@ -16995,7 +17234,10 @@ var Chart = ({
|
|
|
16995
17234
|
"div",
|
|
16996
17235
|
{
|
|
16997
17236
|
ref: wrapperRef,
|
|
16998
|
-
className: cn(
|
|
17237
|
+
className: cn(
|
|
17238
|
+
"w-full overflow-hidden min-w-0 rounded-lg border-border",
|
|
17239
|
+
className
|
|
17240
|
+
),
|
|
16999
17241
|
children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-card relative w-full max-w-full min-w-0 py-1", children: [
|
|
17000
17242
|
title && /* @__PURE__ */ jsx(
|
|
17001
17243
|
"div",
|
|
@@ -17092,303 +17334,416 @@ var Chart = ({
|
|
|
17092
17334
|
)
|
|
17093
17335
|
}
|
|
17094
17336
|
),
|
|
17095
|
-
|
|
17096
|
-
|
|
17337
|
+
showLegend && horizontal && /* @__PURE__ */ jsx(
|
|
17338
|
+
HorizontalLegend_default,
|
|
17097
17339
|
{
|
|
17098
|
-
|
|
17099
|
-
|
|
17100
|
-
|
|
17101
|
-
|
|
17102
|
-
|
|
17103
|
-
|
|
17104
|
-
|
|
17340
|
+
allKeys,
|
|
17341
|
+
mapperConfig,
|
|
17342
|
+
finalColors,
|
|
17343
|
+
labelMap,
|
|
17344
|
+
legendUppercase,
|
|
17345
|
+
orderBy,
|
|
17346
|
+
maxPeriodLabel,
|
|
17347
|
+
minPeriodLabel,
|
|
17348
|
+
className: cn(HORIZONTAL_PADDING_CLASS)
|
|
17349
|
+
}
|
|
17350
|
+
),
|
|
17351
|
+
/* @__PURE__ */ jsx(
|
|
17352
|
+
"div",
|
|
17353
|
+
{
|
|
17354
|
+
className: cn(
|
|
17355
|
+
horizontal && "overflow-y-auto overflow-x-hidden px-6",
|
|
17356
|
+
horizontal && "scrollbar-thin scrollbar-thumb-muted scrollbar-track-transparent"
|
|
17357
|
+
),
|
|
17358
|
+
style: {
|
|
17359
|
+
maxHeight: horizontal ? height : void 0
|
|
17105
17360
|
},
|
|
17106
|
-
|
|
17107
|
-
|
|
17108
|
-
|
|
17109
|
-
|
|
17110
|
-
|
|
17111
|
-
|
|
17112
|
-
|
|
17361
|
+
children: /* @__PURE__ */ jsx(
|
|
17362
|
+
ResponsiveContainer,
|
|
17363
|
+
{
|
|
17364
|
+
width: "100%",
|
|
17365
|
+
height: horizontal ? Math.max(height, processedData.length * 50) : height,
|
|
17366
|
+
children: /* @__PURE__ */ jsxs(
|
|
17367
|
+
ComposedChart,
|
|
17113
17368
|
{
|
|
17114
|
-
|
|
17115
|
-
|
|
17116
|
-
|
|
17117
|
-
|
|
17118
|
-
|
|
17369
|
+
data: processedData,
|
|
17370
|
+
height: horizontal ? Math.max(height, processedData.length * 50) : height,
|
|
17371
|
+
layout: horizontal ? "vertical" : "horizontal",
|
|
17372
|
+
margin: {
|
|
17373
|
+
top: 10,
|
|
17374
|
+
right: finalChartRightMargin,
|
|
17375
|
+
left: finalChartLeftMargin,
|
|
17376
|
+
bottom: 10
|
|
17377
|
+
},
|
|
17378
|
+
onClick: handleChartClick,
|
|
17119
17379
|
children: [
|
|
17120
|
-
/* @__PURE__ */ jsx("
|
|
17121
|
-
|
|
17122
|
-
|
|
17123
|
-
|
|
17124
|
-
|
|
17125
|
-
|
|
17126
|
-
|
|
17127
|
-
|
|
17128
|
-
|
|
17129
|
-
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
|
|
17133
|
-
|
|
17134
|
-
|
|
17135
|
-
|
|
17136
|
-
|
|
17137
|
-
|
|
17138
|
-
|
|
17139
|
-
|
|
17140
|
-
|
|
17141
|
-
|
|
17142
|
-
|
|
17143
|
-
|
|
17144
|
-
|
|
17145
|
-
|
|
17146
|
-
|
|
17147
|
-
|
|
17148
|
-
return String(value ?? "");
|
|
17149
|
-
},
|
|
17150
|
-
label: xAxisLabel ? {
|
|
17151
|
-
value: xAxisLabel,
|
|
17152
|
-
position: "insideBottomRight",
|
|
17153
|
-
offset: -5,
|
|
17154
|
-
style: {
|
|
17155
|
-
fontSize: 12,
|
|
17156
|
-
fill: "hsl(var(--muted-foreground))",
|
|
17157
|
-
fontWeight: 500
|
|
17158
|
-
}
|
|
17159
|
-
} : void 0
|
|
17160
|
-
}
|
|
17161
|
-
),
|
|
17162
|
-
/* @__PURE__ */ jsx(
|
|
17163
|
-
YAxis,
|
|
17164
|
-
{
|
|
17165
|
-
yAxisId: "left",
|
|
17166
|
-
width: yAxisTickWidth,
|
|
17167
|
-
stroke: "hsl(var(--muted-foreground))",
|
|
17168
|
-
fontSize: 12,
|
|
17169
|
-
tickLine: false,
|
|
17170
|
-
axisLine: false,
|
|
17171
|
-
tickFormatter: yTickFormatter,
|
|
17172
|
-
domain: [Math.min(minLeftDataValue, 0), niceMaxLeft],
|
|
17173
|
-
tickCount: 6,
|
|
17174
|
-
label: yAxisLabel ? {
|
|
17175
|
-
value: yAxisLabel,
|
|
17176
|
-
angle: -90,
|
|
17177
|
-
position: "left",
|
|
17178
|
-
dx: leftYAxisLabelDx,
|
|
17179
|
-
style: {
|
|
17180
|
-
fontSize: 12,
|
|
17181
|
-
fill: "hsl(var(--muted-foreground))",
|
|
17182
|
-
fontWeight: 500,
|
|
17183
|
-
textAnchor: "middle"
|
|
17184
|
-
}
|
|
17185
|
-
} : void 0
|
|
17186
|
-
}
|
|
17187
|
-
),
|
|
17188
|
-
minLeftDataValue < 0 && /* @__PURE__ */ jsx(
|
|
17189
|
-
ReferenceLine,
|
|
17190
|
-
{
|
|
17191
|
-
y: 0,
|
|
17192
|
-
yAxisId: "left",
|
|
17193
|
-
stroke: "hsl(var(--muted-foreground))",
|
|
17194
|
-
strokeWidth: 1,
|
|
17195
|
-
strokeDasharray: "4 4"
|
|
17196
|
-
}
|
|
17197
|
-
),
|
|
17198
|
-
rightKeys.length > 0 && (() => {
|
|
17199
|
-
const { rightAxisColor, rightTickFormatter } = fnConfigRightKeys(biaxialConfigNormalized, yTickFormatter, finalColors);
|
|
17200
|
-
return /* @__PURE__ */ jsx(
|
|
17201
|
-
YAxis,
|
|
17202
|
-
{
|
|
17203
|
-
yAxisId: "right",
|
|
17204
|
-
width: finalChartRightMargin,
|
|
17205
|
-
orientation: "right",
|
|
17206
|
-
stroke: "hsl(var(--muted-foreground))",
|
|
17207
|
-
fontSize: 12,
|
|
17208
|
-
tickLine: false,
|
|
17209
|
-
axisLine: false,
|
|
17210
|
-
tick: { fill: rightAxisColor },
|
|
17211
|
-
tickFormatter: rightTickFormatter,
|
|
17212
|
-
domain: [Math.min(minRightDataValue, 0), niceMaxRight],
|
|
17213
|
-
tickCount: 6,
|
|
17214
|
-
label: biaxialConfigNormalized?.label ? {
|
|
17215
|
-
value: biaxialConfigNormalized.label,
|
|
17216
|
-
angle: -90,
|
|
17217
|
-
position: "right",
|
|
17218
|
-
dx: rightYAxisLabelDx,
|
|
17219
|
-
style: {
|
|
17220
|
-
fontSize: 12,
|
|
17221
|
-
fill: "hsl(var(--muted-foreground))",
|
|
17222
|
-
fontWeight: 500,
|
|
17223
|
-
textAnchor: "middle"
|
|
17224
|
-
}
|
|
17225
|
-
} : void 0
|
|
17226
|
-
}
|
|
17227
|
-
);
|
|
17228
|
-
})(),
|
|
17229
|
-
showTooltip && /* @__PURE__ */ jsx(
|
|
17230
|
-
Tooltip,
|
|
17231
|
-
{
|
|
17232
|
-
content: showTooltipTotal ? /* @__PURE__ */ jsx(
|
|
17233
|
-
TooltipWithTotal_default,
|
|
17234
|
-
{
|
|
17235
|
-
finalColors,
|
|
17236
|
-
valueFormatter: finalValueFormatter,
|
|
17237
|
-
categoryFormatter,
|
|
17238
|
-
periodLabel
|
|
17239
|
-
}
|
|
17240
|
-
) : /* @__PURE__ */ jsx(
|
|
17241
|
-
TooltipSimple_default,
|
|
17242
|
-
{
|
|
17243
|
-
finalColors,
|
|
17244
|
-
valueFormatter: finalValueFormatter,
|
|
17245
|
-
categoryFormatter,
|
|
17246
|
-
periodLabel
|
|
17247
|
-
}
|
|
17248
|
-
),
|
|
17249
|
-
cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
|
|
17250
|
-
}
|
|
17251
|
-
),
|
|
17252
|
-
showLegend && /* @__PURE__ */ jsx(
|
|
17253
|
-
Legend,
|
|
17254
|
-
{
|
|
17255
|
-
iconSize: 12,
|
|
17256
|
-
formatter: (value) => {
|
|
17257
|
-
return /* @__PURE__ */ jsx("span", { className: "tracking-[0]", children: fnFormatterValueLegend(
|
|
17258
|
-
value,
|
|
17259
|
-
mapperConfig,
|
|
17260
|
-
labelMap,
|
|
17261
|
-
legendUppercase
|
|
17262
|
-
) });
|
|
17263
|
-
}
|
|
17264
|
-
}
|
|
17265
|
-
),
|
|
17266
|
-
seriesOrder.map((s) => {
|
|
17267
|
-
if (showOnlyHighlighted && !highlightedSeries.has(s.key))
|
|
17268
|
-
return null;
|
|
17269
|
-
const { label, color, key } = fnBuildConfigData(
|
|
17270
|
-
s,
|
|
17271
|
-
mapperConfig,
|
|
17272
|
-
labelMap,
|
|
17273
|
-
finalColors,
|
|
17274
|
-
rightKeys,
|
|
17275
|
-
biaxialConfigNormalized
|
|
17276
|
-
);
|
|
17277
|
-
if (s.type === "bar") {
|
|
17278
|
-
return /* @__PURE__ */ jsx(
|
|
17279
|
-
Bar,
|
|
17280
|
-
{
|
|
17281
|
-
dataKey: key,
|
|
17282
|
-
yAxisId: rightKeys.includes(key) ? "right" : "left",
|
|
17283
|
-
name: label,
|
|
17284
|
-
fill: color,
|
|
17285
|
-
radius: [4, 4, 0, 0],
|
|
17286
|
-
onClick: handleBarClick,
|
|
17287
|
-
className: "cursor-pointer",
|
|
17288
|
-
style: { opacity: getSeriesOpacity(key) },
|
|
17289
|
-
activeBar: /* @__PURE__ */ jsx(
|
|
17290
|
-
Rectangle,
|
|
17380
|
+
/* @__PURE__ */ jsx("defs", { children: seriesOrder.filter((s) => s.type === "area").map((s) => {
|
|
17381
|
+
const key = s.key;
|
|
17382
|
+
const color = finalColors[key];
|
|
17383
|
+
return /* @__PURE__ */ jsxs(
|
|
17384
|
+
"linearGradient",
|
|
17385
|
+
{
|
|
17386
|
+
id: `gradient-${key}`,
|
|
17387
|
+
x1: "0",
|
|
17388
|
+
y1: "0",
|
|
17389
|
+
x2: "0",
|
|
17390
|
+
y2: "0.8",
|
|
17391
|
+
children: [
|
|
17392
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: color, stopOpacity: 0.8 }),
|
|
17393
|
+
/* @__PURE__ */ jsx(
|
|
17394
|
+
"stop",
|
|
17395
|
+
{
|
|
17396
|
+
offset: "90%",
|
|
17397
|
+
stopColor: color,
|
|
17398
|
+
stopOpacity: 0.1
|
|
17399
|
+
}
|
|
17400
|
+
)
|
|
17401
|
+
]
|
|
17402
|
+
},
|
|
17403
|
+
`gradient-${key}`
|
|
17404
|
+
);
|
|
17405
|
+
}) }),
|
|
17406
|
+
showGrid && /* @__PURE__ */ jsx(
|
|
17407
|
+
CartesianGrid,
|
|
17291
17408
|
{
|
|
17292
|
-
|
|
17293
|
-
stroke:
|
|
17294
|
-
|
|
17295
|
-
opacity: 0.8
|
|
17409
|
+
strokeDasharray: "3 3",
|
|
17410
|
+
stroke: gridColor || "hsl(var(--muted-foreground))",
|
|
17411
|
+
opacity: 0.5
|
|
17296
17412
|
}
|
|
17297
17413
|
),
|
|
17298
|
-
|
|
17299
|
-
|
|
17414
|
+
horizontal ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17415
|
+
/* @__PURE__ */ jsx(
|
|
17416
|
+
XAxis,
|
|
17417
|
+
{
|
|
17418
|
+
type: "number",
|
|
17419
|
+
orientation: "top",
|
|
17420
|
+
stroke: "hsl(var(--muted-foreground))",
|
|
17421
|
+
fontSize: 12,
|
|
17422
|
+
tickLine: false,
|
|
17423
|
+
axisLine: false,
|
|
17424
|
+
tickFormatter: yTickFormatter,
|
|
17425
|
+
domain: [Math.min(minLeftDataValue, 0), niceMaxLeft],
|
|
17426
|
+
tickCount: 6,
|
|
17427
|
+
label: yAxisLabel ? {
|
|
17428
|
+
value: yAxisLabel,
|
|
17429
|
+
position: "insideTopRight",
|
|
17430
|
+
offset: -5,
|
|
17431
|
+
style: {
|
|
17432
|
+
fontSize: 12,
|
|
17433
|
+
fill: "hsl(var(--muted-foreground))",
|
|
17434
|
+
fontWeight: 500
|
|
17435
|
+
}
|
|
17436
|
+
} : void 0
|
|
17437
|
+
}
|
|
17438
|
+
),
|
|
17439
|
+
/* @__PURE__ */ jsx(
|
|
17440
|
+
YAxis,
|
|
17441
|
+
{
|
|
17442
|
+
type: "category",
|
|
17443
|
+
dataKey: xAxisConfig.dataKey,
|
|
17444
|
+
yAxisId: "left",
|
|
17445
|
+
width: yAxisTickWidth,
|
|
17446
|
+
stroke: "hsl(var(--muted-foreground))",
|
|
17447
|
+
fontSize: 12,
|
|
17448
|
+
tickLine: false,
|
|
17449
|
+
axisLine: false,
|
|
17450
|
+
tickFormatter: (value) => {
|
|
17451
|
+
if (categoryFormatter)
|
|
17452
|
+
return categoryFormatter(value);
|
|
17453
|
+
if (xAxisConfig.valueFormatter)
|
|
17454
|
+
return xAxisConfig.valueFormatter(
|
|
17455
|
+
value
|
|
17456
|
+
);
|
|
17457
|
+
return String(value ?? "");
|
|
17458
|
+
},
|
|
17459
|
+
label: xAxisLabel ? {
|
|
17460
|
+
value: xAxisLabel,
|
|
17461
|
+
angle: -90,
|
|
17462
|
+
position: "insideTop",
|
|
17463
|
+
dx: leftYAxisLabelDx,
|
|
17464
|
+
style: {
|
|
17465
|
+
fontSize: 12,
|
|
17466
|
+
fill: "hsl(var(--muted-foreground))",
|
|
17467
|
+
fontWeight: 500,
|
|
17468
|
+
textAnchor: "middle"
|
|
17469
|
+
}
|
|
17470
|
+
} : void 0
|
|
17471
|
+
}
|
|
17472
|
+
)
|
|
17473
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17474
|
+
/* @__PURE__ */ jsx(
|
|
17475
|
+
XAxis,
|
|
17476
|
+
{
|
|
17477
|
+
dataKey: xAxisConfig.dataKey,
|
|
17478
|
+
stroke: "hsl(var(--muted-foreground))",
|
|
17479
|
+
fontSize: 12,
|
|
17480
|
+
tickLine: false,
|
|
17481
|
+
axisLine: false,
|
|
17482
|
+
tickFormatter: (value) => {
|
|
17483
|
+
if (categoryFormatter)
|
|
17484
|
+
return categoryFormatter(value);
|
|
17485
|
+
if (xAxisConfig.valueFormatter)
|
|
17486
|
+
return xAxisConfig.valueFormatter(
|
|
17487
|
+
value
|
|
17488
|
+
);
|
|
17489
|
+
return String(value ?? "");
|
|
17490
|
+
},
|
|
17491
|
+
label: xAxisLabel ? {
|
|
17492
|
+
value: xAxisLabel,
|
|
17493
|
+
position: "insideBottomRight",
|
|
17494
|
+
offset: -5,
|
|
17495
|
+
style: {
|
|
17496
|
+
fontSize: 12,
|
|
17497
|
+
fill: "hsl(var(--muted-foreground))",
|
|
17498
|
+
fontWeight: 500
|
|
17499
|
+
}
|
|
17500
|
+
} : void 0
|
|
17501
|
+
}
|
|
17502
|
+
),
|
|
17503
|
+
/* @__PURE__ */ jsx(
|
|
17504
|
+
YAxis,
|
|
17505
|
+
{
|
|
17506
|
+
yAxisId: "left",
|
|
17507
|
+
width: yAxisTickWidth,
|
|
17508
|
+
stroke: "hsl(var(--muted-foreground))",
|
|
17509
|
+
fontSize: 12,
|
|
17510
|
+
tickLine: false,
|
|
17511
|
+
axisLine: false,
|
|
17512
|
+
tickFormatter: yTickFormatter,
|
|
17513
|
+
domain: [Math.min(minLeftDataValue, 0), niceMaxLeft],
|
|
17514
|
+
tickCount: 6,
|
|
17515
|
+
label: yAxisLabel ? {
|
|
17516
|
+
value: yAxisLabel,
|
|
17517
|
+
angle: -90,
|
|
17518
|
+
position: "left",
|
|
17519
|
+
dx: leftYAxisLabelDx,
|
|
17520
|
+
style: {
|
|
17521
|
+
fontSize: 12,
|
|
17522
|
+
fill: "hsl(var(--muted-foreground))",
|
|
17523
|
+
fontWeight: 500,
|
|
17524
|
+
textAnchor: "middle"
|
|
17525
|
+
}
|
|
17526
|
+
} : void 0
|
|
17527
|
+
}
|
|
17528
|
+
)
|
|
17529
|
+
] }),
|
|
17530
|
+
minLeftDataValue < 0 && /* @__PURE__ */ jsx(
|
|
17531
|
+
ReferenceLine,
|
|
17300
17532
|
{
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
|
|
17305
|
-
|
|
17306
|
-
color,
|
|
17307
|
-
finalValueFormatter
|
|
17308
|
-
);
|
|
17309
|
-
return inside(props);
|
|
17310
|
-
},
|
|
17311
|
-
offset: 0
|
|
17533
|
+
y: 0,
|
|
17534
|
+
yAxisId: "left",
|
|
17535
|
+
stroke: "hsl(var(--muted-foreground))",
|
|
17536
|
+
strokeWidth: 1,
|
|
17537
|
+
strokeDasharray: "4 4"
|
|
17312
17538
|
}
|
|
17313
|
-
)
|
|
17314
|
-
|
|
17315
|
-
|
|
17316
|
-
|
|
17317
|
-
|
|
17318
|
-
|
|
17319
|
-
|
|
17320
|
-
|
|
17321
|
-
|
|
17322
|
-
|
|
17323
|
-
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
|
|
17327
|
-
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
|
|
17539
|
+
),
|
|
17540
|
+
rightKeys.length > 0 && (() => {
|
|
17541
|
+
const { rightAxisColor, rightTickFormatter } = fnConfigRightKeys(
|
|
17542
|
+
biaxialConfigNormalized,
|
|
17543
|
+
yTickFormatter,
|
|
17544
|
+
finalColors
|
|
17545
|
+
);
|
|
17546
|
+
return /* @__PURE__ */ jsx(
|
|
17547
|
+
YAxis,
|
|
17548
|
+
{
|
|
17549
|
+
yAxisId: "right",
|
|
17550
|
+
width: finalChartRightMargin,
|
|
17551
|
+
orientation: "right",
|
|
17552
|
+
stroke: "hsl(var(--muted-foreground))",
|
|
17553
|
+
fontSize: 12,
|
|
17554
|
+
tickLine: false,
|
|
17555
|
+
axisLine: false,
|
|
17556
|
+
tick: { fill: rightAxisColor },
|
|
17557
|
+
tickFormatter: rightTickFormatter,
|
|
17558
|
+
domain: [Math.min(minRightDataValue, 0), niceMaxRight],
|
|
17559
|
+
tickCount: 6,
|
|
17560
|
+
label: biaxialConfigNormalized?.label ? {
|
|
17561
|
+
value: biaxialConfigNormalized.label,
|
|
17562
|
+
angle: -90,
|
|
17563
|
+
position: "right",
|
|
17564
|
+
dx: rightYAxisLabelDx,
|
|
17565
|
+
style: {
|
|
17566
|
+
fontSize: 12,
|
|
17567
|
+
fill: "hsl(var(--muted-foreground))",
|
|
17568
|
+
fontWeight: 500,
|
|
17569
|
+
textAnchor: "middle"
|
|
17570
|
+
}
|
|
17571
|
+
} : void 0
|
|
17572
|
+
}
|
|
17573
|
+
);
|
|
17574
|
+
})(),
|
|
17575
|
+
showTooltip && /* @__PURE__ */ jsx(
|
|
17576
|
+
Tooltip,
|
|
17334
17577
|
{
|
|
17335
|
-
|
|
17336
|
-
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17578
|
+
content: showTooltipTotal ? /* @__PURE__ */ jsx(
|
|
17579
|
+
TooltipWithTotal_default,
|
|
17580
|
+
{
|
|
17581
|
+
finalColors,
|
|
17582
|
+
valueFormatter: finalValueFormatter,
|
|
17583
|
+
categoryFormatter,
|
|
17584
|
+
periodLabel
|
|
17585
|
+
}
|
|
17586
|
+
) : /* @__PURE__ */ jsx(
|
|
17587
|
+
TooltipSimple_default,
|
|
17588
|
+
{
|
|
17589
|
+
finalColors,
|
|
17590
|
+
valueFormatter: finalValueFormatter,
|
|
17591
|
+
categoryFormatter,
|
|
17592
|
+
periodLabel
|
|
17593
|
+
}
|
|
17341
17594
|
),
|
|
17342
|
-
|
|
17595
|
+
cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
|
|
17343
17596
|
}
|
|
17344
|
-
)
|
|
17345
|
-
|
|
17346
|
-
|
|
17347
|
-
);
|
|
17348
|
-
}
|
|
17349
|
-
if (s.type === "area") {
|
|
17350
|
-
return /* @__PURE__ */ jsx(
|
|
17351
|
-
Area,
|
|
17352
|
-
{
|
|
17353
|
-
type: "monotone",
|
|
17354
|
-
dataKey: key,
|
|
17355
|
-
yAxisId: rightKeys.includes(key) ? "right" : "left",
|
|
17356
|
-
name: label,
|
|
17357
|
-
stroke: color,
|
|
17358
|
-
fill: `url(#gradient-${key})`,
|
|
17359
|
-
fillOpacity: 1,
|
|
17360
|
-
strokeWidth: 2,
|
|
17361
|
-
onClick: handleSeriesClick,
|
|
17362
|
-
className: "cursor-pointer pointer-events-auto",
|
|
17363
|
-
style: { opacity: getSeriesOpacity(key) },
|
|
17364
|
-
activeDot: {
|
|
17365
|
-
r: 6,
|
|
17366
|
-
fill: color,
|
|
17367
|
-
stroke: "hsl(var(--background))",
|
|
17368
|
-
strokeWidth: 2
|
|
17369
|
-
},
|
|
17370
|
-
children: showLabels && labelsVisibility.area !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsx(
|
|
17371
|
-
LabelList,
|
|
17597
|
+
),
|
|
17598
|
+
showLegend && !horizontal && /* @__PURE__ */ jsx(
|
|
17599
|
+
Legend,
|
|
17372
17600
|
{
|
|
17373
|
-
|
|
17374
|
-
|
|
17375
|
-
|
|
17376
|
-
|
|
17377
|
-
|
|
17378
|
-
|
|
17379
|
-
|
|
17380
|
-
|
|
17601
|
+
iconSize: 12,
|
|
17602
|
+
formatter: (value) => {
|
|
17603
|
+
return /* @__PURE__ */ jsx("span", { className: "tracking-[0] rounded-sm", children: fnFormatterValueLegend(
|
|
17604
|
+
value,
|
|
17605
|
+
mapperConfig,
|
|
17606
|
+
labelMap,
|
|
17607
|
+
legendUppercase
|
|
17608
|
+
) });
|
|
17609
|
+
}
|
|
17381
17610
|
}
|
|
17382
|
-
)
|
|
17383
|
-
|
|
17384
|
-
|
|
17385
|
-
|
|
17386
|
-
|
|
17387
|
-
|
|
17388
|
-
|
|
17389
|
-
|
|
17611
|
+
),
|
|
17612
|
+
seriesOrder.map((s) => {
|
|
17613
|
+
if (showOnlyHighlighted && !highlightedSeries.has(s.key))
|
|
17614
|
+
return null;
|
|
17615
|
+
const { label, color, key } = fnBuildConfigData(
|
|
17616
|
+
s,
|
|
17617
|
+
mapperConfig,
|
|
17618
|
+
labelMap,
|
|
17619
|
+
finalColors,
|
|
17620
|
+
rightKeys,
|
|
17621
|
+
biaxialConfigNormalized
|
|
17622
|
+
);
|
|
17623
|
+
if (s.type === "bar") {
|
|
17624
|
+
return /* @__PURE__ */ jsx(
|
|
17625
|
+
Bar,
|
|
17626
|
+
{
|
|
17627
|
+
dataKey: key,
|
|
17628
|
+
yAxisId: rightKeys.includes(key) ? "right" : "left",
|
|
17629
|
+
name: label,
|
|
17630
|
+
fill: color,
|
|
17631
|
+
radius: horizontal ? [0, 4, 4, 0] : [4, 4, 0, 0],
|
|
17632
|
+
onClick: handleBarClick,
|
|
17633
|
+
className: "cursor-pointer",
|
|
17634
|
+
style: { opacity: getSeriesOpacity(key) },
|
|
17635
|
+
activeBar: /* @__PURE__ */ jsx(
|
|
17636
|
+
Rectangle,
|
|
17637
|
+
{
|
|
17638
|
+
fill: color,
|
|
17639
|
+
stroke: color,
|
|
17640
|
+
strokeWidth: 2,
|
|
17641
|
+
opacity: 0.8
|
|
17642
|
+
}
|
|
17643
|
+
),
|
|
17644
|
+
children: showLabels && labelsVisibility.bar !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsx(
|
|
17645
|
+
LabelList,
|
|
17646
|
+
{
|
|
17647
|
+
dataKey: key,
|
|
17648
|
+
content: (props) => {
|
|
17649
|
+
if (!fnContentLabelList(props)) return null;
|
|
17650
|
+
const inside = renderInsideBarLabel(
|
|
17651
|
+
color,
|
|
17652
|
+
finalValueFormatter
|
|
17653
|
+
);
|
|
17654
|
+
return inside(props);
|
|
17655
|
+
},
|
|
17656
|
+
offset: 0
|
|
17657
|
+
}
|
|
17658
|
+
) : null
|
|
17659
|
+
},
|
|
17660
|
+
`bar-${key}`
|
|
17661
|
+
);
|
|
17662
|
+
}
|
|
17663
|
+
if (s.type === "line") {
|
|
17664
|
+
const lineFormatter = (props) => {
|
|
17665
|
+
const numValue = typeof props.value === "number" ? props.value : typeof props.value === "string" ? parseFloat(props.value) : 0;
|
|
17666
|
+
const percentage = calcDivision(numValue, 100);
|
|
17667
|
+
const formattedPercentage = typeof percentage === "number" ? percentage.toFixed(1).replace(".", ",") : String(percentage).replace(".", ",");
|
|
17668
|
+
return `${formattedPercentage}%`;
|
|
17669
|
+
};
|
|
17670
|
+
return /* @__PURE__ */ jsx(
|
|
17671
|
+
Line,
|
|
17672
|
+
{
|
|
17673
|
+
dataKey: key,
|
|
17674
|
+
yAxisId: rightKeys.includes(key) ? "right" : "left",
|
|
17675
|
+
name: label,
|
|
17676
|
+
stroke: color,
|
|
17677
|
+
strokeWidth: 2,
|
|
17678
|
+
dot: { r: 3 },
|
|
17679
|
+
activeDot: { r: 6 },
|
|
17680
|
+
onClick: handleSeriesClick,
|
|
17681
|
+
className: "cursor-pointer pointer-events-auto",
|
|
17682
|
+
style: { opacity: getSeriesOpacity(key) },
|
|
17683
|
+
children: showLabels && labelsVisibility.line !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsx(
|
|
17684
|
+
LabelList,
|
|
17685
|
+
{
|
|
17686
|
+
dataKey: key,
|
|
17687
|
+
position: "top",
|
|
17688
|
+
content: pillLabelRenderer_default(
|
|
17689
|
+
color,
|
|
17690
|
+
"filled",
|
|
17691
|
+
lineFormatter
|
|
17692
|
+
),
|
|
17693
|
+
offset: 14
|
|
17694
|
+
}
|
|
17695
|
+
) : null
|
|
17696
|
+
},
|
|
17697
|
+
`line-${key}`
|
|
17698
|
+
);
|
|
17699
|
+
}
|
|
17700
|
+
if (s.type === "area") {
|
|
17701
|
+
return /* @__PURE__ */ jsx(
|
|
17702
|
+
Area,
|
|
17703
|
+
{
|
|
17704
|
+
type: "monotone",
|
|
17705
|
+
dataKey: key,
|
|
17706
|
+
yAxisId: rightKeys.includes(key) ? "right" : "left",
|
|
17707
|
+
name: label,
|
|
17708
|
+
stroke: color,
|
|
17709
|
+
fill: `url(#gradient-${key})`,
|
|
17710
|
+
fillOpacity: 1,
|
|
17711
|
+
strokeWidth: 2,
|
|
17712
|
+
onClick: handleSeriesClick,
|
|
17713
|
+
className: "cursor-pointer pointer-events-auto",
|
|
17714
|
+
style: { opacity: getSeriesOpacity(key) },
|
|
17715
|
+
activeDot: {
|
|
17716
|
+
r: 6,
|
|
17717
|
+
fill: color,
|
|
17718
|
+
stroke: "hsl(var(--background))",
|
|
17719
|
+
strokeWidth: 2
|
|
17720
|
+
},
|
|
17721
|
+
children: showLabels && labelsVisibility.area !== false && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsx(
|
|
17722
|
+
LabelList,
|
|
17723
|
+
{
|
|
17724
|
+
dataKey: key,
|
|
17725
|
+
position: "top",
|
|
17726
|
+
content: pillLabelRenderer_default(
|
|
17727
|
+
color,
|
|
17728
|
+
"soft",
|
|
17729
|
+
finalValueFormatter
|
|
17730
|
+
),
|
|
17731
|
+
offset: 12
|
|
17732
|
+
}
|
|
17733
|
+
) : null
|
|
17734
|
+
},
|
|
17735
|
+
`area-${key}`
|
|
17736
|
+
);
|
|
17737
|
+
}
|
|
17738
|
+
return null;
|
|
17739
|
+
})
|
|
17740
|
+
]
|
|
17741
|
+
}
|
|
17742
|
+
)
|
|
17743
|
+
}
|
|
17744
|
+
)
|
|
17390
17745
|
}
|
|
17391
|
-
)
|
|
17746
|
+
),
|
|
17392
17747
|
enableDraggableTooltips && activeTooltips.map((tooltip) => /* @__PURE__ */ jsx(
|
|
17393
17748
|
DraggableTooltip_default,
|
|
17394
17749
|
{
|
|
@@ -17813,4 +18168,4 @@ function Leaderboard({
|
|
|
17813
18168
|
);
|
|
17814
18169
|
}
|
|
17815
18170
|
|
|
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 };
|
|
18171
|
+
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, HorizontalLegend_default as HorizontalLegend, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase_default as LabelBase, Leaderboard, LikeButton, LoadingBase, LockButton, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MonthViewAgenda, MoreButton, MultiCombobox, MultiSelect, MultiSelectBase, MultiSelectContentBase, MultiSelectGroupBase, MultiSelectItemBase, MultiSelectSeparatorBase, MultiSelectTriggerBase, MultiSelectValueBase, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NoData_default as NoData, NotificationButton, NumericInput, PeriodsDropdown_default as PeriodsDropdown, 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, useChartMinMax, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useTheme, useTimeSeriesRange, visualForItem };
|