@algorithm-shift/design-system 1.2.984 → 1.2.986
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 +16 -28
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +121 -91
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +126 -96
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -22,6 +22,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
22
22
|
function Modal({
|
|
23
23
|
isOpen,
|
|
24
24
|
onModalClose,
|
|
25
|
+
onModalOpen,
|
|
25
26
|
title,
|
|
26
27
|
children,
|
|
27
28
|
size = "md",
|
|
@@ -29,6 +30,11 @@ function Modal({
|
|
|
29
30
|
className = "",
|
|
30
31
|
style = {}
|
|
31
32
|
}) {
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (isOpen && onModalOpen) {
|
|
35
|
+
onModalOpen();
|
|
36
|
+
}
|
|
37
|
+
}, [isOpen]);
|
|
32
38
|
useEffect(() => {
|
|
33
39
|
const handleEscape = (e) => {
|
|
34
40
|
if (e.key === "Escape") {
|
|
@@ -550,6 +556,7 @@ var Breadcrumb_default = Breadcrumb;
|
|
|
550
556
|
|
|
551
557
|
// src/components/Basic/ButtonGroup/ButtonGroup.tsx
|
|
552
558
|
import { ChevronDown } from "lucide-react";
|
|
559
|
+
import Link2 from "next/link";
|
|
553
560
|
|
|
554
561
|
// src/components/ui/dropdown-menu.tsx
|
|
555
562
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
@@ -609,6 +616,19 @@ function DropdownMenuItem({
|
|
|
609
616
|
}
|
|
610
617
|
);
|
|
611
618
|
}
|
|
619
|
+
function DropdownMenuSeparator({
|
|
620
|
+
className,
|
|
621
|
+
...props
|
|
622
|
+
}) {
|
|
623
|
+
return /* @__PURE__ */ jsx16(
|
|
624
|
+
DropdownMenuPrimitive.Separator,
|
|
625
|
+
{
|
|
626
|
+
"data-slot": "dropdown-menu-separator",
|
|
627
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
628
|
+
...props
|
|
629
|
+
}
|
|
630
|
+
);
|
|
631
|
+
}
|
|
612
632
|
function DropdownMenuSub({
|
|
613
633
|
...props
|
|
614
634
|
}) {
|
|
@@ -655,9 +675,9 @@ function DropdownMenuSubContent({
|
|
|
655
675
|
}
|
|
656
676
|
|
|
657
677
|
// src/components/Basic/ButtonGroup/ButtonGroup.tsx
|
|
658
|
-
import Link2 from "next/link";
|
|
659
678
|
import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
660
|
-
function
|
|
679
|
+
function ButtonGroup({ style, textContent, className, list = [], onGroupItemClick, onClick }) {
|
|
680
|
+
const data = Array.isArray(list) ? list : [];
|
|
661
681
|
const bgColor = style?.backgroundColor || "";
|
|
662
682
|
return /* @__PURE__ */ jsxs7("div", { className: "inline-flex rounded-md overflow-hidden border border-teal-200 bg-teal-700 items-center focus:ring-0", style: { backgroundColor: bgColor }, children: [
|
|
663
683
|
/* @__PURE__ */ jsx17(
|
|
@@ -665,6 +685,7 @@ function SplitButton({ style, textContent, className, list = [] }) {
|
|
|
665
685
|
{
|
|
666
686
|
className: `rounded-none border-r px-4 py-2 text-whit focus:ring-0 ${className || ""}`,
|
|
667
687
|
style: { backgroundColor: bgColor },
|
|
688
|
+
onClick: (e) => onClick?.(e),
|
|
668
689
|
children: textContent || "Button"
|
|
669
690
|
}
|
|
670
691
|
),
|
|
@@ -678,7 +699,24 @@ function SplitButton({ style, textContent, className, list = [] }) {
|
|
|
678
699
|
children: /* @__PURE__ */ jsx17(ChevronDown, { className: "w-4 h-4" })
|
|
679
700
|
}
|
|
680
701
|
) }),
|
|
681
|
-
/* @__PURE__ */ jsx17(
|
|
702
|
+
/* @__PURE__ */ jsx17(
|
|
703
|
+
DropdownMenuContent,
|
|
704
|
+
{
|
|
705
|
+
align: "end",
|
|
706
|
+
className: "bg-white min-w-[120px]",
|
|
707
|
+
children: data.map((item) => /* @__PURE__ */ jsx17(
|
|
708
|
+
DropdownMenuItem,
|
|
709
|
+
{
|
|
710
|
+
className: "text-black",
|
|
711
|
+
onSelect: () => onGroupItemClick?.({
|
|
712
|
+
item
|
|
713
|
+
}),
|
|
714
|
+
children: /* @__PURE__ */ jsx17(Link2, { href: item.url || "#", children: item.header })
|
|
715
|
+
},
|
|
716
|
+
item.id
|
|
717
|
+
))
|
|
718
|
+
}
|
|
719
|
+
)
|
|
682
720
|
] })
|
|
683
721
|
] });
|
|
684
722
|
}
|
|
@@ -1455,6 +1493,7 @@ function MultiCheckbox({
|
|
|
1455
1493
|
{
|
|
1456
1494
|
id: props.name ? `${props.name}-${opt.value}` : opt.value,
|
|
1457
1495
|
className: cn(hasError && "text-red-600"),
|
|
1496
|
+
htmlFor: props.name ? `${props.name}-${opt.value}` : opt.value,
|
|
1458
1497
|
children: opt.label
|
|
1459
1498
|
}
|
|
1460
1499
|
)
|
|
@@ -2070,7 +2109,8 @@ function LazySelectDropdown({
|
|
|
2070
2109
|
onFocus: handleFocus,
|
|
2071
2110
|
onChange: handleSearchChange,
|
|
2072
2111
|
readOnly: !isOpen || readOnly,
|
|
2073
|
-
disabled
|
|
2112
|
+
disabled,
|
|
2113
|
+
autoComplete: "off"
|
|
2074
2114
|
}
|
|
2075
2115
|
),
|
|
2076
2116
|
selectedOption && !disabled && !readOnly && /* @__PURE__ */ jsx36(
|
|
@@ -3262,7 +3302,8 @@ function LazyMultiSelectDropdown({
|
|
|
3262
3302
|
value: isOpen ? searchTerm : "",
|
|
3263
3303
|
onChange: handleSearch,
|
|
3264
3304
|
readOnly,
|
|
3265
|
-
disabled
|
|
3305
|
+
disabled,
|
|
3306
|
+
autoComplete: "off"
|
|
3266
3307
|
}
|
|
3267
3308
|
)
|
|
3268
3309
|
]
|
|
@@ -3836,13 +3877,13 @@ function DataTable({
|
|
|
3836
3877
|
const shouldShowLeftDots = leftSiblingIndex > 2;
|
|
3837
3878
|
const shouldShowRightDots = rightSiblingIndex < totalPages - 1;
|
|
3838
3879
|
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
3839
|
-
return [1, 2, 3, "..."
|
|
3880
|
+
return [1, 2, 3, "..."];
|
|
3840
3881
|
}
|
|
3841
3882
|
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
3842
3883
|
return [1, "...", totalPages - 2, totalPages - 1, totalPages];
|
|
3843
3884
|
}
|
|
3844
3885
|
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
3845
|
-
return [1, "...", currentPage - 1, currentPage, currentPage + 1, "..."
|
|
3886
|
+
return [1, "...", currentPage - 1, currentPage, currentPage + 1, "..."];
|
|
3846
3887
|
}
|
|
3847
3888
|
return [];
|
|
3848
3889
|
};
|
|
@@ -4048,7 +4089,7 @@ function DataTable({
|
|
|
4048
4089
|
return /* @__PURE__ */ jsxs30(
|
|
4049
4090
|
TableCell,
|
|
4050
4091
|
{
|
|
4051
|
-
className:
|
|
4092
|
+
className: `break-words whitespace-normal align-top ${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative py-2`,
|
|
4052
4093
|
style: {
|
|
4053
4094
|
width: cell.column.getSize(),
|
|
4054
4095
|
minWidth: cell.column.columnDef.minSize,
|
|
@@ -5166,7 +5207,11 @@ import { jsx as jsx63, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
|
5166
5207
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
5167
5208
|
|
|
5168
5209
|
// src/components/Navigation/Navbar/Navbar.tsx
|
|
5210
|
+
import { useCallback as useCallback4, useMemo as useMemo9, useState as useState14, useEffect as useEffect26 } from "react";
|
|
5169
5211
|
import { Bell, Search as Search2, Menu as Menu2 } from "lucide-react";
|
|
5212
|
+
import Image3 from "next/image";
|
|
5213
|
+
import Link4 from "next/link";
|
|
5214
|
+
import { useRouter as useRouter2 } from "next/navigation";
|
|
5170
5215
|
|
|
5171
5216
|
// src/components/ui/avatar.tsx
|
|
5172
5217
|
import * as React12 from "react";
|
|
@@ -5207,11 +5252,6 @@ var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5207
5252
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
5208
5253
|
|
|
5209
5254
|
// src/components/Navigation/Navbar/Navbar.tsx
|
|
5210
|
-
import Link4 from "next/link";
|
|
5211
|
-
import Image3 from "next/image";
|
|
5212
|
-
import { useRouter as useRouter2 } from "next/navigation";
|
|
5213
|
-
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
5214
|
-
import { useCallback as useCallback4, useMemo as useMemo9, useState as useState14 } from "react";
|
|
5215
5255
|
import { Fragment as Fragment23, jsx as jsx66, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5216
5256
|
function Navbar({
|
|
5217
5257
|
style,
|
|
@@ -5223,44 +5263,76 @@ function Navbar({
|
|
|
5223
5263
|
imageUrl,
|
|
5224
5264
|
altText = "Logo",
|
|
5225
5265
|
canvasMode = "desktop",
|
|
5266
|
+
// desktop | mobile | tablet
|
|
5226
5267
|
list = [],
|
|
5227
5268
|
profileMenu = [],
|
|
5228
5269
|
userName = "Guest User",
|
|
5229
5270
|
isBuilder = false,
|
|
5230
5271
|
source,
|
|
5231
|
-
navList
|
|
5272
|
+
navList,
|
|
5273
|
+
onSearch
|
|
5232
5274
|
}) {
|
|
5233
|
-
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
5234
5275
|
const router = useRouter2();
|
|
5235
|
-
const [
|
|
5236
|
-
|
|
5276
|
+
const [screenMode, setScreenMode] = useState14(
|
|
5277
|
+
canvasMode
|
|
5278
|
+
);
|
|
5279
|
+
useEffect26(() => {
|
|
5280
|
+
const detectMode = () => {
|
|
5281
|
+
if (window.innerWidth < 640) setScreenMode("mobile");
|
|
5282
|
+
else if (window.innerWidth < 1024) setScreenMode("tablet");
|
|
5283
|
+
else setScreenMode("desktop");
|
|
5284
|
+
};
|
|
5285
|
+
detectMode();
|
|
5286
|
+
window.addEventListener("resize", detectMode);
|
|
5287
|
+
return () => window.removeEventListener("resize", detectMode);
|
|
5288
|
+
}, []);
|
|
5289
|
+
const mode = canvasMode || screenMode;
|
|
5290
|
+
const isMobile = mode === "mobile";
|
|
5291
|
+
const isTablet = mode === "tablet";
|
|
5292
|
+
const isDesktop = mode === "desktop";
|
|
5237
5293
|
const handleBuilderExit = useCallback4(
|
|
5238
5294
|
(e, url) => {
|
|
5239
5295
|
if (isBuilder) {
|
|
5240
5296
|
e.preventDefault();
|
|
5241
|
-
|
|
5242
|
-
|
|
5297
|
+
showSonnerToast({ variant: "info", title: `You will be redirected to ${url} in the real app.`, duration: 3e3 });
|
|
5298
|
+
} else {
|
|
5299
|
+
router.push(url);
|
|
5243
5300
|
}
|
|
5244
5301
|
},
|
|
5245
5302
|
[isBuilder]
|
|
5246
5303
|
);
|
|
5247
|
-
const
|
|
5248
|
-
if (
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
const formatedMenu = useMemo9(() => {
|
|
5254
|
-
if (source === "state" && navList && navList.length) {
|
|
5255
|
-
return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
|
|
5304
|
+
const formattedMenu = useMemo9(() => {
|
|
5305
|
+
if (source === "state" && navList?.length) {
|
|
5306
|
+
return navList.map((i) => ({
|
|
5307
|
+
...i,
|
|
5308
|
+
header: i.name || "Menu"
|
|
5309
|
+
}));
|
|
5256
5310
|
}
|
|
5257
|
-
return list
|
|
5258
|
-
}, [source, navList]);
|
|
5311
|
+
return list;
|
|
5312
|
+
}, [source, navList, list]);
|
|
5313
|
+
const RenderSearchInput = () => /* @__PURE__ */ jsx66("div", { className: "flex-1 px-2", children: /* @__PURE__ */ jsxs40("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
5314
|
+
/* @__PURE__ */ jsx66(Search2, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
|
|
5315
|
+
/* @__PURE__ */ jsx66(
|
|
5316
|
+
Input,
|
|
5317
|
+
{
|
|
5318
|
+
placeholder: "Search",
|
|
5319
|
+
className: "pl-9 text-gray-500",
|
|
5320
|
+
onKeyDown: (event) => {
|
|
5321
|
+
if (event.key === "Enter") {
|
|
5322
|
+
const query = event.target.value;
|
|
5323
|
+
onSearch?.({
|
|
5324
|
+
searchTerm: query
|
|
5325
|
+
});
|
|
5326
|
+
}
|
|
5327
|
+
}
|
|
5328
|
+
}
|
|
5329
|
+
)
|
|
5330
|
+
] }) });
|
|
5259
5331
|
return /* @__PURE__ */ jsxs40(Fragment23, { children: [
|
|
5260
5332
|
/* @__PURE__ */ jsx66(
|
|
5261
5333
|
"nav",
|
|
5262
5334
|
{
|
|
5263
|
-
className: "w-full h-[75px] border-b border-
|
|
5335
|
+
className: "w-full min-h-[75px] border-b border-gray-200 dark:border-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
5264
5336
|
style,
|
|
5265
5337
|
children: /* @__PURE__ */ jsxs40("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
5266
5338
|
/* @__PURE__ */ jsx66(
|
|
@@ -5269,69 +5341,36 @@ function Navbar({
|
|
|
5269
5341
|
href: "/",
|
|
5270
5342
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
5271
5343
|
className: "flex items-center space-x-2",
|
|
5272
|
-
children: imageUrl ? /* @__PURE__ */ jsx66(Image3, { src: imageUrl, alt: altText, width:
|
|
5344
|
+
children: imageUrl ? /* @__PURE__ */ jsx66(Image3, { src: imageUrl, alt: altText, width: 180, height: 40 }) : /* @__PURE__ */ jsx66("span", { className: "font-semibold text-blue-700", children: "Logo" })
|
|
5273
5345
|
}
|
|
5274
5346
|
),
|
|
5275
|
-
|
|
5347
|
+
isDesktop && /* @__PURE__ */ jsx66("div", { className: "hidden md:flex items-center space-x-6", children: formattedMenu.map((item) => /* @__PURE__ */ jsx66(
|
|
5276
5348
|
Link4,
|
|
5277
5349
|
{
|
|
5278
|
-
href: item.url
|
|
5350
|
+
href: item.url,
|
|
5279
5351
|
onClick: (e) => handleBuilderExit(e, item.url),
|
|
5280
|
-
className: "text-sm font-medium dark:text-white
|
|
5352
|
+
className: "text-sm font-medium text-gray-600 dark:text-white hover:text-gray-900",
|
|
5281
5353
|
children: item.header
|
|
5282
5354
|
},
|
|
5283
5355
|
item.id
|
|
5284
5356
|
)) }),
|
|
5285
5357
|
/* @__PURE__ */ jsxs40("div", { className: "flex items-center space-x-3", children: [
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
/* @__PURE__ */ jsx66(
|
|
5289
|
-
|
|
5290
|
-
/* @__PURE__ */ jsxs40("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
|
|
5291
|
-
/* @__PURE__ */ jsx66(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx66(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
|
|
5292
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx66("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ jsx66("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
|
|
5358
|
+
(isDesktop || isTablet) && /* @__PURE__ */ jsx66(RenderSearchInput, {}),
|
|
5359
|
+
/* @__PURE__ */ jsxs40("div", { className: "relative bg-gray-200 dark:bg-gray-700 rounded-md", children: [
|
|
5360
|
+
/* @__PURE__ */ jsx66(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx66(Bell, { className: "h-5 w-5 text-gray-700 dark:text-gray-300" }) }),
|
|
5361
|
+
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx66("span", { className: "absolute -top-1 -right-1 h-4 w-4 flex items-center justify-center bg-red-500 rounded-full text-white text-[10px]", children: badgeCount }) : !hideBadgeWhenZero && /* @__PURE__ */ jsx66("span", { className: "absolute -top-1 -right-1 h-2 w-2 bg-red-500 rounded-full" })
|
|
5293
5362
|
] }),
|
|
5294
5363
|
/* @__PURE__ */ jsxs40(DropdownMenu, { children: [
|
|
5295
|
-
/* @__PURE__ */ jsx66(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs40("div", { className: "flex items-center space-x-2", children: [
|
|
5296
|
-
!
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
AvatarImage,
|
|
5300
|
-
{
|
|
5301
|
-
src: "/images/appbuilder/toolset/profile.svg",
|
|
5302
|
-
alt: "Profile"
|
|
5303
|
-
}
|
|
5304
|
-
) : /* @__PURE__ */ jsx66("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
|
|
5305
|
-
/* @__PURE__ */ jsx66(
|
|
5306
|
-
Button,
|
|
5307
|
-
{
|
|
5308
|
-
variant: "ghost",
|
|
5309
|
-
size: "icon",
|
|
5310
|
-
className: "text-gray-900 md:hidden dark:invert",
|
|
5311
|
-
children: /* @__PURE__ */ jsx66(Menu2, { className: "h-6 w-6" })
|
|
5312
|
-
}
|
|
5313
|
-
)
|
|
5314
|
-
] }) : /* @__PURE__ */ jsx66(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ jsx66(Menu2, { className: "h-6 w-6" }) })
|
|
5364
|
+
/* @__PURE__ */ jsx66(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs40("div", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
5365
|
+
!isMobile && showName && /* @__PURE__ */ jsx66("h4", { className: "text-gray-900 dark:text-gray-300 text-sm", children: userName }),
|
|
5366
|
+
/* @__PURE__ */ jsx66(Avatar, { className: "h-8 w-8", children: profileType === "avatar" ? /* @__PURE__ */ jsx66(AvatarImage, { src: "/images/appbuilder/toolset/profile.svg", alt: "profile" }) : /* @__PURE__ */ jsx66("div", { className: "bg-green-700 text-white h-full w-full rounded-full flex items-center justify-center text-xs", children: getInitials(userName) }) }),
|
|
5367
|
+
(isMobile || isTablet) && /* @__PURE__ */ jsx66(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx66(Menu2, { className: "h-6 w-6" }) })
|
|
5315
5368
|
] }) }),
|
|
5316
5369
|
/* @__PURE__ */ jsxs40(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
5317
|
-
profileMenu
|
|
5318
|
-
|
|
5319
|
-
{
|
|
5320
|
-
href: item.url || "#",
|
|
5321
|
-
onClick: (e) => handleBuilderExit(e, item.url),
|
|
5322
|
-
children: item.header
|
|
5323
|
-
}
|
|
5324
|
-
) }, item.id)) }),
|
|
5325
|
-
/* @__PURE__ */ jsxs40("div", { className: "md:hidden", children: [
|
|
5370
|
+
profileMenu.map((item) => /* @__PURE__ */ jsx66(DropdownMenuItem, { children: /* @__PURE__ */ jsx66(Link4, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id)),
|
|
5371
|
+
(isMobile || isTablet) && /* @__PURE__ */ jsxs40(Fragment23, { children: [
|
|
5326
5372
|
/* @__PURE__ */ jsx66(DropdownMenuSeparator, {}),
|
|
5327
|
-
|
|
5328
|
-
Link4,
|
|
5329
|
-
{
|
|
5330
|
-
href: item.url || "#",
|
|
5331
|
-
onClick: (e) => handleBuilderExit(e, item.url),
|
|
5332
|
-
children: item.header
|
|
5333
|
-
}
|
|
5334
|
-
) }, item.id)) })
|
|
5373
|
+
formattedMenu.map((item) => /* @__PURE__ */ jsx66(DropdownMenuItem, { children: /* @__PURE__ */ jsx66(Link4, { href: item.url, onClick: (e) => handleBuilderExit(e, item.url), children: item.header }) }, item.id))
|
|
5335
5374
|
] })
|
|
5336
5375
|
] })
|
|
5337
5376
|
] })
|
|
@@ -5339,21 +5378,12 @@ function Navbar({
|
|
|
5339
5378
|
] })
|
|
5340
5379
|
}
|
|
5341
5380
|
),
|
|
5342
|
-
/* @__PURE__ */ jsx66(
|
|
5343
|
-
/* @__PURE__ */ jsxs40(DialogHeader, { children: [
|
|
5344
|
-
/* @__PURE__ */ jsx66(DialogTitle, { children: "Exit Builder?" }),
|
|
5345
|
-
/* @__PURE__ */ jsx66(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
5346
|
-
] }),
|
|
5347
|
-
/* @__PURE__ */ jsxs40(DialogFooter, { children: [
|
|
5348
|
-
/* @__PURE__ */ jsx66(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
5349
|
-
/* @__PURE__ */ jsx66(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
5350
|
-
] })
|
|
5351
|
-
] }) })
|
|
5381
|
+
isMobile && /* @__PURE__ */ jsx66("div", { className: "p-3", children: /* @__PURE__ */ jsx66(RenderSearchInput, {}) })
|
|
5352
5382
|
] });
|
|
5353
5383
|
}
|
|
5354
5384
|
|
|
5355
5385
|
// src/components/Chart/BarChart.tsx
|
|
5356
|
-
import React13, { useEffect as
|
|
5386
|
+
import React13, { useEffect as useEffect27, useMemo as useMemo10, useState as useState15, useCallback as useCallback5 } from "react";
|
|
5357
5387
|
import axios3 from "axios";
|
|
5358
5388
|
import {
|
|
5359
5389
|
BarChart,
|
|
@@ -5431,7 +5461,7 @@ var ChartComponent = ({
|
|
|
5431
5461
|
const [currentPage, setCurrentPage] = useState15(1);
|
|
5432
5462
|
const effectiveData = apiUrl ? rawData : props.data || [];
|
|
5433
5463
|
const effectiveLoading = apiUrl ? localLoading : externalLoading;
|
|
5434
|
-
|
|
5464
|
+
useEffect27(() => {
|
|
5435
5465
|
if (apiUrl) {
|
|
5436
5466
|
setCurrentPage(1);
|
|
5437
5467
|
}
|
|
@@ -5473,7 +5503,7 @@ var ChartComponent = ({
|
|
|
5473
5503
|
if (!cancelled) setLocalLoading(false);
|
|
5474
5504
|
}
|
|
5475
5505
|
}, [apiUrl, limit]);
|
|
5476
|
-
|
|
5506
|
+
useEffect27(() => {
|
|
5477
5507
|
if (!apiUrl) return;
|
|
5478
5508
|
fetchData(currentPage);
|
|
5479
5509
|
}, [apiUrl, currentPage, fetchData]);
|
|
@@ -5672,7 +5702,7 @@ var ChartComponent = ({
|
|
|
5672
5702
|
var BarChart_default = React13.memo(ChartComponent);
|
|
5673
5703
|
|
|
5674
5704
|
// src/components/Chart/PieChart.tsx
|
|
5675
|
-
import React14, { useEffect as
|
|
5705
|
+
import React14, { useEffect as useEffect28, useMemo as useMemo11, useState as useState16 } from "react";
|
|
5676
5706
|
import axios4 from "axios";
|
|
5677
5707
|
import {
|
|
5678
5708
|
PieChart,
|
|
@@ -5762,7 +5792,7 @@ var DonutChart = ({
|
|
|
5762
5792
|
const [localLoading, setLocalLoading] = useState16(false);
|
|
5763
5793
|
const effectiveData = apiUrl ? rawData : props.data || [];
|
|
5764
5794
|
const effectiveLoading = apiUrl ? localLoading : externalLoading;
|
|
5765
|
-
|
|
5795
|
+
useEffect28(() => {
|
|
5766
5796
|
if (!apiUrl) return;
|
|
5767
5797
|
let cancelled = false;
|
|
5768
5798
|
const fetchData = async () => {
|
|
@@ -5844,7 +5874,7 @@ var DonutChart = ({
|
|
|
5844
5874
|
return { inner: 70, outer: 130 };
|
|
5845
5875
|
};
|
|
5846
5876
|
const [mounted, setMounted] = useState16(false);
|
|
5847
|
-
|
|
5877
|
+
useEffect28(() => {
|
|
5848
5878
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
5849
5879
|
return () => clearTimeout(timeout);
|
|
5850
5880
|
}, []);
|
|
@@ -6085,7 +6115,7 @@ export {
|
|
|
6085
6115
|
BarChart_default as BarChart,
|
|
6086
6116
|
Breadcrumb_default as Breadcrumb,
|
|
6087
6117
|
Button_default as Button,
|
|
6088
|
-
|
|
6118
|
+
ButtonGroup,
|
|
6089
6119
|
Checkbox_default as Checkbox,
|
|
6090
6120
|
Container_default as Container,
|
|
6091
6121
|
DateTimePicker as DatePicker,
|