@algorithm-shift/design-system 1.2.954 → 1.2.956
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/client.d.mts +4 -4
- package/dist/client.d.ts +4 -4
- package/dist/index.css +24 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +26 -24
- package/dist/index.d.ts +26 -24
- package/dist/index.js +609 -574
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +601 -566
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ __export(src_exports, {
|
|
|
51
51
|
Image: () => Image_default,
|
|
52
52
|
Modal: () => Modal,
|
|
53
53
|
MultiCheckbox: () => MultiCheckbox_default,
|
|
54
|
-
MultiSelect: () =>
|
|
54
|
+
MultiSelect: () => LazyMultiSelectDropdown,
|
|
55
55
|
Navbar: () => Navbar,
|
|
56
56
|
NumberInput: () => NumberInput_default,
|
|
57
57
|
Pagination: () => Pagination_default,
|
|
@@ -27759,6 +27759,14 @@ function useLazyDropdown(config) {
|
|
|
27759
27759
|
const allDataRef = (0, import_react19.useRef)([]);
|
|
27760
27760
|
const configRef = (0, import_react19.useRef)(config);
|
|
27761
27761
|
const PAGE_SIZE = config.pageSize || 10;
|
|
27762
|
+
const uniqueOptions = (items) => {
|
|
27763
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27764
|
+
return items.filter((item) => {
|
|
27765
|
+
if (seen.has(item.value)) return false;
|
|
27766
|
+
seen.add(item.value);
|
|
27767
|
+
return true;
|
|
27768
|
+
});
|
|
27769
|
+
};
|
|
27762
27770
|
(0, import_react19.useEffect)(() => {
|
|
27763
27771
|
configRef.current = config;
|
|
27764
27772
|
}, [config]);
|
|
@@ -27811,7 +27819,10 @@ function useLazyDropdown(config) {
|
|
|
27811
27819
|
pageOptions = transformToOptions(filtered.slice(start, end));
|
|
27812
27820
|
setHasMore(end < filtered.length);
|
|
27813
27821
|
}
|
|
27814
|
-
setOptions((prev) =>
|
|
27822
|
+
setOptions((prev) => {
|
|
27823
|
+
const merged = pageNum === 1 ? pageOptions : [...prev, ...pageOptions];
|
|
27824
|
+
return uniqueOptions(merged);
|
|
27825
|
+
});
|
|
27815
27826
|
setPage(pageNum);
|
|
27816
27827
|
} catch (err) {
|
|
27817
27828
|
console.error("\u274C useLazyDropdown loadPage error:", err);
|
|
@@ -27831,7 +27842,7 @@ function useLazyDropdown(config) {
|
|
|
27831
27842
|
});
|
|
27832
27843
|
if (res.data?.success && Array.isArray(res.data.data) && res.data.data.length > 0) {
|
|
27833
27844
|
const fetched = transformToOptions(res.data.data);
|
|
27834
|
-
setOptions((prev) => [...fetched, ...prev]);
|
|
27845
|
+
setOptions((prev) => uniqueOptions([...fetched, ...prev]));
|
|
27835
27846
|
}
|
|
27836
27847
|
} catch (err) {
|
|
27837
27848
|
console.warn("\u26A0\uFE0F Failed to fetch default value for dropdown:", err);
|
|
@@ -27926,7 +27937,7 @@ function LazySelectDropdown({
|
|
|
27926
27937
|
value,
|
|
27927
27938
|
axiosInstance
|
|
27928
27939
|
});
|
|
27929
|
-
const selectedOption = lazyOptions.find((opt) => opt.value === value);
|
|
27940
|
+
const selectedOption = (0, import_react20.useMemo)(() => lazyOptions.find((opt) => opt.value === value), [lazyOptions, value]);
|
|
27930
27941
|
(0, import_react20.useEffect)(() => {
|
|
27931
27942
|
const handleClickOutside = (e) => {
|
|
27932
27943
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
@@ -27961,7 +27972,16 @@ function LazySelectDropdown({
|
|
|
27961
27972
|
};
|
|
27962
27973
|
const handleFocus = () => {
|
|
27963
27974
|
if (!disabled) setIsOpen(true);
|
|
27964
|
-
|
|
27975
|
+
if (lazyOptions.length === 0)
|
|
27976
|
+
loadPage(1, "");
|
|
27977
|
+
};
|
|
27978
|
+
const handleRemoveSelection = (e) => {
|
|
27979
|
+
e.preventDefault();
|
|
27980
|
+
e.stopPropagation();
|
|
27981
|
+
onChange?.("", id || "");
|
|
27982
|
+
setSearchTerm("");
|
|
27983
|
+
reset();
|
|
27984
|
+
search("");
|
|
27965
27985
|
};
|
|
27966
27986
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { ref: dropdownRef, className: "relative w-full", children: [
|
|
27967
27987
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -27971,7 +27991,7 @@ function LazySelectDropdown({
|
|
|
27971
27991
|
id,
|
|
27972
27992
|
name: id,
|
|
27973
27993
|
className: cn(
|
|
27974
|
-
"w-full px-3 py-2 border border-[#BDBDBD] rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
|
|
27994
|
+
"w-full px-3 py-2 border border-[#BDBDBD] rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 pr-7",
|
|
27975
27995
|
disabled ? "bg-gray-100 cursor-not-allowed" : "bg-white cursor-pointer",
|
|
27976
27996
|
className,
|
|
27977
27997
|
errorMessage ? "border-red-500" : ""
|
|
@@ -27984,6 +28004,16 @@ function LazySelectDropdown({
|
|
|
27984
28004
|
disabled
|
|
27985
28005
|
}
|
|
27986
28006
|
),
|
|
28007
|
+
selectedOption && !disabled && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
28008
|
+
"button",
|
|
28009
|
+
{
|
|
28010
|
+
type: "button",
|
|
28011
|
+
"aria-label": "Clear selection",
|
|
28012
|
+
onClick: handleRemoveSelection,
|
|
28013
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 h-5 w-5 flex items-center justify-center rounded hover:bg-gray-200 text-gray-500 focus:outline-none",
|
|
28014
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SquareX, { className: "h-5 w-5 pointer-events-none" })
|
|
28015
|
+
}
|
|
28016
|
+
),
|
|
27987
28017
|
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
|
|
27988
28018
|
isOpen && !disabled && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
27989
28019
|
"div",
|
|
@@ -28706,343 +28736,230 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28706
28736
|
var TextInputGroup_default = TextInputGroup;
|
|
28707
28737
|
|
|
28708
28738
|
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
28709
|
-
var
|
|
28710
|
-
|
|
28711
|
-
// src/components/ui/command.tsx
|
|
28712
|
-
var import_cmdk = require("cmdk");
|
|
28713
|
-
|
|
28714
|
-
// src/components/ui/dialog.tsx
|
|
28715
|
-
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
28739
|
+
var import_react29 = require("react");
|
|
28716
28740
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
28717
|
-
function
|
|
28718
|
-
|
|
28719
|
-
|
|
28720
|
-
|
|
28721
|
-
|
|
28722
|
-
function DialogPortal({
|
|
28723
|
-
...props
|
|
28724
|
-
}) {
|
|
28725
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
28726
|
-
}
|
|
28727
|
-
function DialogOverlay({
|
|
28741
|
+
function LazyMultiSelectDropdown({
|
|
28742
|
+
options = [],
|
|
28743
|
+
value = [],
|
|
28744
|
+
onChange,
|
|
28745
|
+
placeholder,
|
|
28728
28746
|
className,
|
|
28729
|
-
|
|
28747
|
+
id,
|
|
28748
|
+
disabled,
|
|
28749
|
+
readOnly,
|
|
28750
|
+
source,
|
|
28751
|
+
apiUrl,
|
|
28752
|
+
pageSize,
|
|
28753
|
+
dataKey = "id",
|
|
28754
|
+
dataLabel = "name",
|
|
28755
|
+
errorMessage,
|
|
28756
|
+
axiosInstance,
|
|
28757
|
+
outputFormat = "array"
|
|
28730
28758
|
}) {
|
|
28731
|
-
|
|
28732
|
-
|
|
28733
|
-
|
|
28734
|
-
|
|
28735
|
-
|
|
28736
|
-
|
|
28737
|
-
|
|
28738
|
-
|
|
28739
|
-
|
|
28759
|
+
const [isOpen, setIsOpen] = (0, import_react29.useState)(false);
|
|
28760
|
+
const [searchTerm, setSearchTerm] = (0, import_react29.useState)("");
|
|
28761
|
+
const dropdownRef = (0, import_react29.useRef)(null);
|
|
28762
|
+
const observerTarget = (0, import_react29.useRef)(null);
|
|
28763
|
+
const {
|
|
28764
|
+
options: lazyOptions,
|
|
28765
|
+
loading,
|
|
28766
|
+
hasMore,
|
|
28767
|
+
loadMore,
|
|
28768
|
+
search,
|
|
28769
|
+
reset,
|
|
28770
|
+
loadPage
|
|
28771
|
+
} = useLazyDropdown({
|
|
28772
|
+
enabled: true,
|
|
28773
|
+
dataSource: source || "",
|
|
28774
|
+
apiUrl,
|
|
28775
|
+
pageSize: pageSize || 10,
|
|
28776
|
+
dataKey,
|
|
28777
|
+
dataLabel,
|
|
28778
|
+
initialData: options || [],
|
|
28779
|
+
value,
|
|
28780
|
+
axiosInstance
|
|
28781
|
+
});
|
|
28782
|
+
const ensureUnique = (arr) => {
|
|
28783
|
+
return Array.from(new Set(arr));
|
|
28784
|
+
};
|
|
28785
|
+
const convertOutput = (values) => {
|
|
28786
|
+
const unique = ensureUnique(values);
|
|
28787
|
+
switch (outputFormat) {
|
|
28788
|
+
case "comma":
|
|
28789
|
+
return unique.join(",");
|
|
28790
|
+
case "semicolon":
|
|
28791
|
+
return unique.join(";");
|
|
28792
|
+
default:
|
|
28793
|
+
return unique;
|
|
28740
28794
|
}
|
|
28741
|
-
|
|
28742
|
-
|
|
28743
|
-
|
|
28744
|
-
|
|
28745
|
-
|
|
28746
|
-
|
|
28747
|
-
|
|
28748
|
-
|
|
28749
|
-
|
|
28750
|
-
|
|
28795
|
+
};
|
|
28796
|
+
const normalizeInput = (value2) => {
|
|
28797
|
+
let arr = [];
|
|
28798
|
+
if (Array.isArray(value2)) {
|
|
28799
|
+
arr = value2;
|
|
28800
|
+
} else if (typeof value2 === "string") {
|
|
28801
|
+
if (!value2.trim()) return [];
|
|
28802
|
+
if (value2.includes(";")) arr = value2.split(";").map((v) => v.trim());
|
|
28803
|
+
else if (value2.includes(",")) arr = value2.split(",").map((v) => v.trim());
|
|
28804
|
+
else arr = [value2.trim()];
|
|
28805
|
+
}
|
|
28806
|
+
return ensureUnique(arr);
|
|
28807
|
+
};
|
|
28808
|
+
const normalizedValue = normalizeInput(value);
|
|
28809
|
+
const selectedOptions = (0, import_react29.useMemo)(() => {
|
|
28810
|
+
return lazyOptions.filter((opt) => normalizedValue.includes(opt.value));
|
|
28811
|
+
}, [lazyOptions, normalizedValue]);
|
|
28812
|
+
(0, import_react29.useEffect)(() => {
|
|
28813
|
+
const handleClick = (e) => {
|
|
28814
|
+
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
28815
|
+
setIsOpen(false);
|
|
28816
|
+
}
|
|
28817
|
+
};
|
|
28818
|
+
document.addEventListener("mousedown", handleClick);
|
|
28819
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
28820
|
+
}, []);
|
|
28821
|
+
(0, import_react29.useEffect)(() => {
|
|
28822
|
+
if (!isOpen || !hasMore || loading) return;
|
|
28823
|
+
const obs = new IntersectionObserver(
|
|
28824
|
+
(entries) => {
|
|
28825
|
+
if (entries[0].isIntersecting) loadMore();
|
|
28826
|
+
},
|
|
28827
|
+
{ threshold: 0.1 }
|
|
28828
|
+
);
|
|
28829
|
+
if (observerTarget.current) obs.observe(observerTarget.current);
|
|
28830
|
+
return () => obs.disconnect();
|
|
28831
|
+
}, [isOpen, hasMore, loading, loadMore]);
|
|
28832
|
+
const handleSearch = (e) => {
|
|
28833
|
+
const term = e.target.value;
|
|
28834
|
+
setSearchTerm(term);
|
|
28835
|
+
search(term);
|
|
28836
|
+
};
|
|
28837
|
+
const toggleSelect = (val) => {
|
|
28838
|
+
let updated;
|
|
28839
|
+
if (normalizedValue.includes(val)) {
|
|
28840
|
+
updated = normalizedValue.filter((v) => v !== val);
|
|
28841
|
+
} else {
|
|
28842
|
+
updated = ensureUnique([...normalizedValue, val]);
|
|
28843
|
+
}
|
|
28844
|
+
onChange(convertOutput(updated), id);
|
|
28845
|
+
};
|
|
28846
|
+
const removeTag = (val) => {
|
|
28847
|
+
const updated = normalizedValue.filter((v) => v !== val);
|
|
28848
|
+
onChange(convertOutput(updated), id);
|
|
28849
|
+
};
|
|
28850
|
+
const handleFocus = () => {
|
|
28851
|
+
if (!disabled) setIsOpen(true);
|
|
28852
|
+
if (lazyOptions.length === 0) loadPage(1, "");
|
|
28853
|
+
};
|
|
28854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { ref: dropdownRef, className: "relative w-full", children: [
|
|
28751
28855
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
28752
|
-
|
|
28856
|
+
"div",
|
|
28753
28857
|
{
|
|
28754
|
-
|
|
28858
|
+
onClick: handleFocus,
|
|
28755
28859
|
className: cn(
|
|
28756
|
-
"
|
|
28860
|
+
"min-h-10 w-full flex items-center flex-wrap gap-1 px-2 py-1 border border-[#BDBDBD] rounded-md bg-white cursor-pointer",
|
|
28861
|
+
disabled && "bg-gray-100 cursor-not-allowed",
|
|
28862
|
+
errorMessage && "border-red-500",
|
|
28757
28863
|
className
|
|
28758
28864
|
),
|
|
28759
|
-
...props,
|
|
28760
28865
|
children: [
|
|
28761
|
-
|
|
28762
|
-
|
|
28763
|
-
DialogPrimitive.Close,
|
|
28866
|
+
selectedOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
28867
|
+
"span",
|
|
28764
28868
|
{
|
|
28765
|
-
|
|
28766
|
-
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
28869
|
+
className: "bg-blue-100 text-blue-700 px-2 py-1 rounded-md text-xs flex items-center gap-1",
|
|
28767
28870
|
children: [
|
|
28768
|
-
|
|
28769
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28871
|
+
opt.label,
|
|
28872
|
+
!disabled && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28873
|
+
"button",
|
|
28874
|
+
{
|
|
28875
|
+
type: "button",
|
|
28876
|
+
onClick: (e) => {
|
|
28877
|
+
e.stopPropagation();
|
|
28878
|
+
removeTag(opt.value);
|
|
28879
|
+
},
|
|
28880
|
+
className: "hover:text-red-600",
|
|
28881
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(X, { size: 12 })
|
|
28882
|
+
}
|
|
28883
|
+
)
|
|
28770
28884
|
]
|
|
28885
|
+
},
|
|
28886
|
+
opt.value
|
|
28887
|
+
)),
|
|
28888
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28889
|
+
"input",
|
|
28890
|
+
{
|
|
28891
|
+
type: "text",
|
|
28892
|
+
placeholder: selectedOptions.length ? "" : placeholder,
|
|
28893
|
+
className: "flex-1 min-w-[60px] p-1 outline-none",
|
|
28894
|
+
value: isOpen ? searchTerm : "",
|
|
28895
|
+
onChange: handleSearch,
|
|
28896
|
+
readOnly,
|
|
28897
|
+
disabled
|
|
28771
28898
|
}
|
|
28772
28899
|
)
|
|
28773
28900
|
]
|
|
28774
28901
|
}
|
|
28775
|
-
)
|
|
28776
|
-
|
|
28777
|
-
|
|
28778
|
-
|
|
28779
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28780
|
-
"div",
|
|
28781
|
-
{
|
|
28782
|
-
"data-slot": "dialog-header",
|
|
28783
|
-
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
28784
|
-
...props
|
|
28785
|
-
}
|
|
28786
|
-
);
|
|
28787
|
-
}
|
|
28788
|
-
function DialogFooter({ className, ...props }) {
|
|
28789
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28790
|
-
"div",
|
|
28791
|
-
{
|
|
28792
|
-
"data-slot": "dialog-footer",
|
|
28793
|
-
className: cn(
|
|
28794
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
28795
|
-
className
|
|
28796
|
-
),
|
|
28797
|
-
...props
|
|
28798
|
-
}
|
|
28799
|
-
);
|
|
28800
|
-
}
|
|
28801
|
-
function DialogTitle({
|
|
28802
|
-
className,
|
|
28803
|
-
...props
|
|
28804
|
-
}) {
|
|
28805
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28806
|
-
DialogPrimitive.Title,
|
|
28807
|
-
{
|
|
28808
|
-
"data-slot": "dialog-title",
|
|
28809
|
-
className: cn("text-lg leading-none font-semibold", className),
|
|
28810
|
-
...props
|
|
28811
|
-
}
|
|
28812
|
-
);
|
|
28813
|
-
}
|
|
28814
|
-
function DialogDescription({
|
|
28815
|
-
className,
|
|
28816
|
-
...props
|
|
28817
|
-
}) {
|
|
28818
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28819
|
-
DialogPrimitive.Description,
|
|
28820
|
-
{
|
|
28821
|
-
"data-slot": "dialog-description",
|
|
28822
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
28823
|
-
...props
|
|
28824
|
-
}
|
|
28825
|
-
);
|
|
28826
|
-
}
|
|
28827
|
-
|
|
28828
|
-
// src/components/ui/command.tsx
|
|
28829
|
-
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
28830
|
-
function Command2({
|
|
28831
|
-
className,
|
|
28832
|
-
...props
|
|
28833
|
-
}) {
|
|
28834
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28835
|
-
import_cmdk.Command,
|
|
28836
|
-
{
|
|
28837
|
-
"data-slot": "command",
|
|
28838
|
-
className: cn(
|
|
28839
|
-
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
28840
|
-
className
|
|
28841
|
-
),
|
|
28842
|
-
...props
|
|
28843
|
-
}
|
|
28844
|
-
);
|
|
28845
|
-
}
|
|
28846
|
-
function CommandInput({
|
|
28847
|
-
className,
|
|
28848
|
-
...props
|
|
28849
|
-
}) {
|
|
28850
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
28851
|
-
"div",
|
|
28852
|
-
{
|
|
28853
|
-
"data-slot": "command-input-wrapper",
|
|
28854
|
-
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
28855
|
-
children: [
|
|
28856
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Search, { className: "size-4 shrink-0 opacity-50" }),
|
|
28857
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28858
|
-
import_cmdk.Command.Input,
|
|
28859
|
-
{
|
|
28860
|
-
"data-slot": "command-input",
|
|
28861
|
-
className: cn(
|
|
28862
|
-
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
28863
|
-
className
|
|
28864
|
-
),
|
|
28865
|
-
...props
|
|
28866
|
-
}
|
|
28867
|
-
)
|
|
28868
|
-
]
|
|
28869
|
-
}
|
|
28870
|
-
);
|
|
28871
|
-
}
|
|
28872
|
-
function CommandList({
|
|
28873
|
-
className,
|
|
28874
|
-
...props
|
|
28875
|
-
}) {
|
|
28876
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28877
|
-
import_cmdk.Command.List,
|
|
28878
|
-
{
|
|
28879
|
-
"data-slot": "command-list",
|
|
28880
|
-
className: cn(
|
|
28881
|
-
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
28882
|
-
className
|
|
28883
|
-
),
|
|
28884
|
-
...props
|
|
28885
|
-
}
|
|
28886
|
-
);
|
|
28887
|
-
}
|
|
28888
|
-
function CommandEmpty({
|
|
28889
|
-
...props
|
|
28890
|
-
}) {
|
|
28891
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28892
|
-
import_cmdk.Command.Empty,
|
|
28893
|
-
{
|
|
28894
|
-
"data-slot": "command-empty",
|
|
28895
|
-
className: "py-6 text-center text-sm",
|
|
28896
|
-
...props
|
|
28897
|
-
}
|
|
28898
|
-
);
|
|
28899
|
-
}
|
|
28900
|
-
function CommandGroup({
|
|
28901
|
-
className,
|
|
28902
|
-
...props
|
|
28903
|
-
}) {
|
|
28904
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28905
|
-
import_cmdk.Command.Group,
|
|
28906
|
-
{
|
|
28907
|
-
"data-slot": "command-group",
|
|
28908
|
-
className: cn(
|
|
28909
|
-
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
28910
|
-
className
|
|
28911
|
-
),
|
|
28912
|
-
...props
|
|
28913
|
-
}
|
|
28914
|
-
);
|
|
28915
|
-
}
|
|
28916
|
-
function CommandItem({
|
|
28917
|
-
className,
|
|
28918
|
-
...props
|
|
28919
|
-
}) {
|
|
28920
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28921
|
-
import_cmdk.Command.Item,
|
|
28922
|
-
{
|
|
28923
|
-
"data-slot": "command-item",
|
|
28924
|
-
className: cn(
|
|
28925
|
-
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
28926
|
-
className
|
|
28927
|
-
),
|
|
28928
|
-
...props
|
|
28929
|
-
}
|
|
28930
|
-
);
|
|
28931
|
-
}
|
|
28932
|
-
|
|
28933
|
-
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
28934
|
-
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
28935
|
-
var MultiSelect = ({
|
|
28936
|
-
value = [],
|
|
28937
|
-
onChange,
|
|
28938
|
-
data = [],
|
|
28939
|
-
placeholder = "Select...",
|
|
28940
|
-
disabled,
|
|
28941
|
-
searchable = true,
|
|
28942
|
-
className = "",
|
|
28943
|
-
dataKey = "value",
|
|
28944
|
-
dataLabel = "label",
|
|
28945
|
-
...props
|
|
28946
|
-
}) => {
|
|
28947
|
-
const [open, setOpen] = React8.useState(false);
|
|
28948
|
-
React8.useEffect(() => {
|
|
28949
|
-
if (value) {
|
|
28950
|
-
onChange(value, props?.name || "");
|
|
28951
|
-
}
|
|
28952
|
-
}, []);
|
|
28953
|
-
const toggleOption = (val) => {
|
|
28954
|
-
onChange(
|
|
28955
|
-
value?.includes(val) ? value.filter((v) => v !== val) : [...value || [], val],
|
|
28956
|
-
props?.name || ""
|
|
28957
|
-
);
|
|
28958
|
-
};
|
|
28959
|
-
const selectedLabels = React8.useMemo(
|
|
28960
|
-
() => {
|
|
28961
|
-
if (!data || !value) return [];
|
|
28962
|
-
return data?.filter((opt) => value?.includes(opt.value)).map((opt) => opt.label);
|
|
28963
|
-
},
|
|
28964
|
-
[data, value]
|
|
28965
|
-
);
|
|
28966
|
-
const options = data && data?.map((item) => ({
|
|
28967
|
-
value: item[dataKey],
|
|
28968
|
-
label: item[dataLabel]
|
|
28969
|
-
}));
|
|
28970
|
-
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
28971
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
28972
|
-
Button,
|
|
28973
|
-
{
|
|
28974
|
-
variant: "outline",
|
|
28975
|
-
role: "combobox",
|
|
28976
|
-
className: `w-full justify-between ${className} ${props.errorMessage ? "border-red-500" : ""}`,
|
|
28977
|
-
disabled,
|
|
28978
|
-
type: "button",
|
|
28979
|
-
children: [
|
|
28980
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "truncate", children: selectedLabels.length > 0 ? selectedLabels.join(", ") : placeholder }),
|
|
28981
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
28982
|
-
]
|
|
28983
|
-
}
|
|
28984
|
-
) }),
|
|
28985
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28986
|
-
PopoverContent,
|
|
28902
|
+
),
|
|
28903
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
|
|
28904
|
+
isOpen && !disabled && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28905
|
+
"div",
|
|
28987
28906
|
{
|
|
28988
|
-
|
|
28989
|
-
className: "
|
|
28990
|
-
|
|
28991
|
-
|
|
28992
|
-
|
|
28907
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
28908
|
+
className: "absolute z-[999] mt-1 bg-white border rounded-lg shadow-lg max-h-60 overflow-y-auto",
|
|
28909
|
+
style: {
|
|
28910
|
+
zIndex: 900,
|
|
28911
|
+
width: dropdownRef.current?.offsetWidth,
|
|
28912
|
+
top: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().bottom + window.scrollY : 0,
|
|
28913
|
+
left: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().left + window.scrollX : 0
|
|
28993
28914
|
},
|
|
28994
|
-
children: /* @__PURE__ */ (0,
|
|
28995
|
-
|
|
28996
|
-
|
|
28997
|
-
/* @__PURE__ */ (0,
|
|
28998
|
-
|
|
28999
|
-
|
|
29000
|
-
|
|
29001
|
-
|
|
29002
|
-
|
|
29003
|
-
|
|
29004
|
-
|
|
29005
|
-
|
|
29006
|
-
|
|
29007
|
-
|
|
29008
|
-
|
|
29009
|
-
|
|
29010
|
-
|
|
29011
|
-
|
|
29012
|
-
|
|
29013
|
-
|
|
29014
|
-
|
|
29015
|
-
|
|
29016
|
-
|
|
29017
|
-
|
|
29018
|
-
|
|
29019
|
-
|
|
29020
|
-
|
|
29021
|
-
|
|
29022
|
-
] })
|
|
29023
|
-
] })
|
|
28915
|
+
children: loading && lazyOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "px-3 py-4 text-center text-gray-500", children: "Loading..." }) : lazyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
28916
|
+
lazyOptions.map((option) => {
|
|
28917
|
+
const isSelected = normalizedValue.includes(option.value);
|
|
28918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
28919
|
+
"div",
|
|
28920
|
+
{
|
|
28921
|
+
onClick: () => toggleSelect(option.value),
|
|
28922
|
+
className: cn(
|
|
28923
|
+
"px-3 py-2 text-sm cursor-pointer hover:bg-blue-50 flex justify-between",
|
|
28924
|
+
isSelected && "bg-blue-100"
|
|
28925
|
+
),
|
|
28926
|
+
children: [
|
|
28927
|
+
option.label,
|
|
28928
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SquareX, { size: 16 })
|
|
28929
|
+
]
|
|
28930
|
+
},
|
|
28931
|
+
option.value
|
|
28932
|
+
);
|
|
28933
|
+
}),
|
|
28934
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28935
|
+
"div",
|
|
28936
|
+
{
|
|
28937
|
+
ref: observerTarget,
|
|
28938
|
+
className: "px-3 py-3 text-center text-gray-400 text-sm",
|
|
28939
|
+
children: loading ? "Loading\u2026" : "Scroll for more\u2026"
|
|
28940
|
+
}
|
|
28941
|
+
)
|
|
28942
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "px-3 py-4 text-center text-gray-500", children: "No results" })
|
|
29024
28943
|
}
|
|
29025
|
-
)
|
|
29026
|
-
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
28944
|
+
) })
|
|
29027
28945
|
] });
|
|
29028
|
-
}
|
|
29029
|
-
var MultiSelect_default = MultiSelect;
|
|
28946
|
+
}
|
|
29030
28947
|
|
|
29031
28948
|
// src/components/ui/data-table.tsx
|
|
29032
|
-
var
|
|
28949
|
+
var React9 = __toESM(require("react"));
|
|
29033
28950
|
var import_free_solid_svg_icons2 = require("@fortawesome/free-solid-svg-icons");
|
|
29034
28951
|
var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
|
|
29035
28952
|
var import_react_table2 = require("@tanstack/react-table");
|
|
29036
28953
|
|
|
29037
28954
|
// src/components/ui/table.tsx
|
|
29038
|
-
var
|
|
28955
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
29039
28956
|
function Table3({ className, ...props }) {
|
|
29040
|
-
return /* @__PURE__ */ (0,
|
|
28957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29041
28958
|
"div",
|
|
29042
28959
|
{
|
|
29043
28960
|
"data-slot": "table-container",
|
|
29044
28961
|
className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
|
|
29045
|
-
children: /* @__PURE__ */ (0,
|
|
28962
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29046
28963
|
"table",
|
|
29047
28964
|
{
|
|
29048
28965
|
"data-slot": "table",
|
|
@@ -29054,7 +28971,7 @@ function Table3({ className, ...props }) {
|
|
|
29054
28971
|
);
|
|
29055
28972
|
}
|
|
29056
28973
|
function TableHeader({ className, ...props }) {
|
|
29057
|
-
return /* @__PURE__ */ (0,
|
|
28974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29058
28975
|
"thead",
|
|
29059
28976
|
{
|
|
29060
28977
|
"data-slot": "table-header",
|
|
@@ -29067,7 +28984,7 @@ function TableHeader({ className, ...props }) {
|
|
|
29067
28984
|
);
|
|
29068
28985
|
}
|
|
29069
28986
|
function TableBody({ className, ...props }) {
|
|
29070
|
-
return /* @__PURE__ */ (0,
|
|
28987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29071
28988
|
"tbody",
|
|
29072
28989
|
{
|
|
29073
28990
|
"data-slot": "table-body",
|
|
@@ -29080,7 +28997,7 @@ function TableBody({ className, ...props }) {
|
|
|
29080
28997
|
);
|
|
29081
28998
|
}
|
|
29082
28999
|
function TableRow({ className, ...props }) {
|
|
29083
|
-
return /* @__PURE__ */ (0,
|
|
29000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29084
29001
|
"tr",
|
|
29085
29002
|
{
|
|
29086
29003
|
"data-slot": "table-row",
|
|
@@ -29093,7 +29010,7 @@ function TableRow({ className, ...props }) {
|
|
|
29093
29010
|
);
|
|
29094
29011
|
}
|
|
29095
29012
|
function TableHead({ className, ...props }) {
|
|
29096
|
-
return /* @__PURE__ */ (0,
|
|
29013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29097
29014
|
"th",
|
|
29098
29015
|
{
|
|
29099
29016
|
"data-slot": "table-head",
|
|
@@ -29106,7 +29023,7 @@ function TableHead({ className, ...props }) {
|
|
|
29106
29023
|
);
|
|
29107
29024
|
}
|
|
29108
29025
|
function TableCell({ className, ...props }) {
|
|
29109
|
-
return /* @__PURE__ */ (0,
|
|
29026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29110
29027
|
"td",
|
|
29111
29028
|
{
|
|
29112
29029
|
"data-slot": "table-cell",
|
|
@@ -29123,7 +29040,7 @@ function TableCell({ className, ...props }) {
|
|
|
29123
29040
|
var import_react_table = require("@tanstack/react-table");
|
|
29124
29041
|
|
|
29125
29042
|
// src/lib/table/cellRendererFactory.tsx
|
|
29126
|
-
var
|
|
29043
|
+
var import_react30 = __toESM(require("react"));
|
|
29127
29044
|
var import_image3 = __toESM(require("next/image"));
|
|
29128
29045
|
|
|
29129
29046
|
// src/lib/dayjs-setup.ts
|
|
@@ -29172,7 +29089,7 @@ var valueFormatter = (value, format2, customFormatters = {}) => {
|
|
|
29172
29089
|
};
|
|
29173
29090
|
|
|
29174
29091
|
// src/lib/table/cellRendererFactory.tsx
|
|
29175
|
-
var
|
|
29092
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
29176
29093
|
var getContrastColor = (bg) => {
|
|
29177
29094
|
let c = bg.trim().toUpperCase();
|
|
29178
29095
|
if (/^#([a-fA-F0-9]{3})$/.test(c)) {
|
|
@@ -29206,9 +29123,9 @@ var getContrastColor = (bg) => {
|
|
|
29206
29123
|
};
|
|
29207
29124
|
var sanitizeValue = (val) => {
|
|
29208
29125
|
if (val == null) return null;
|
|
29209
|
-
if (
|
|
29126
|
+
if (import_react30.default.isValidElement(val)) return val;
|
|
29210
29127
|
if (typeof val === "string" || typeof val === "number") return val;
|
|
29211
|
-
if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ (0,
|
|
29128
|
+
if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react30.default.Fragment, { children: sanitizeValue(v) }, i));
|
|
29212
29129
|
if (typeof val === "object") {
|
|
29213
29130
|
if ("name" in val && typeof val.name === "string") return val.name;
|
|
29214
29131
|
if ("label" in val && typeof val.label === "string") return val.label;
|
|
@@ -29225,13 +29142,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29225
29142
|
switch (renderer) {
|
|
29226
29143
|
/* -------------------- BASIC -------------------- */
|
|
29227
29144
|
case "text":
|
|
29228
|
-
return /* @__PURE__ */ (0,
|
|
29145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: row?.[rendererProps?.rowField] || formattedValue });
|
|
29229
29146
|
case "number":
|
|
29230
|
-
return /* @__PURE__ */ (0,
|
|
29147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "tabular-nums text-right", children: valueFormatter(row?.[rendererProps?.rowField] || value, "number:2") });
|
|
29231
29148
|
case "date":
|
|
29232
|
-
return /* @__PURE__ */ (0,
|
|
29149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: valueFormatter(row?.[rendererProps?.rowField] || value, format2) });
|
|
29233
29150
|
case "link":
|
|
29234
|
-
return /* @__PURE__ */ (0,
|
|
29151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29235
29152
|
"a",
|
|
29236
29153
|
{
|
|
29237
29154
|
href: `${rendererProps?.prefix || ""}${row?.[rendererProps?.rowField] || formattedValue}`,
|
|
@@ -29243,7 +29160,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29243
29160
|
);
|
|
29244
29161
|
/* -------------------- VISUAL -------------------- */
|
|
29245
29162
|
case "image":
|
|
29246
|
-
return /* @__PURE__ */ (0,
|
|
29163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29247
29164
|
import_image3.default,
|
|
29248
29165
|
{
|
|
29249
29166
|
src: row?.[rendererProps?.rowField] || formattedValue || rendererProps?.fallback || "/placeholder.png",
|
|
@@ -29260,7 +29177,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29260
29177
|
case "icon":
|
|
29261
29178
|
const maybeIcon = lucide_react_exports[rendererProps?.icon];
|
|
29262
29179
|
const IconComponent = typeof maybeIcon === "function" ? maybeIcon : Star;
|
|
29263
|
-
return /* @__PURE__ */ (0,
|
|
29180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29264
29181
|
IconComponent,
|
|
29265
29182
|
{
|
|
29266
29183
|
size: rendererProps?.size || 16,
|
|
@@ -29272,7 +29189,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29272
29189
|
const color = rendererProps?.colorMap?.[formattedValue] || rendererProps?.color || "gray";
|
|
29273
29190
|
if (!formattedValue) return null;
|
|
29274
29191
|
const textColor = getContrastColor(color);
|
|
29275
|
-
return /* @__PURE__ */ (0,
|
|
29192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29276
29193
|
"span",
|
|
29277
29194
|
{
|
|
29278
29195
|
className: `inline-block px-2 py-1 text-xs rounded-full bg-${color}-100 text-${textColor}-700 ${rendererProps?.className || ""}`,
|
|
@@ -29287,13 +29204,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29287
29204
|
const IconComponent2 = typeof maybeIcon2 === "function" ? maybeIcon2 : Star;
|
|
29288
29205
|
if (!formattedValue) return null;
|
|
29289
29206
|
const textColor = getContrastColor(color);
|
|
29290
|
-
return /* @__PURE__ */ (0,
|
|
29207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
29291
29208
|
"span",
|
|
29292
29209
|
{
|
|
29293
29210
|
className: `inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-[${color}]-100 text-[${textColor}]-700`,
|
|
29294
29211
|
style: { backgroundColor: color, color: textColor },
|
|
29295
29212
|
children: [
|
|
29296
|
-
rendererProps?.icon && /* @__PURE__ */ (0,
|
|
29213
|
+
rendererProps?.icon && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: IconComponent2 ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(IconComponent2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Box, { className: "h-4 w-4" }) }),
|
|
29297
29214
|
formattedValue
|
|
29298
29215
|
]
|
|
29299
29216
|
}
|
|
@@ -29301,7 +29218,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29301
29218
|
}
|
|
29302
29219
|
/* -------------------- INTERACTIVE -------------------- */
|
|
29303
29220
|
case "button":
|
|
29304
|
-
return /* @__PURE__ */ (0,
|
|
29221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29305
29222
|
"button",
|
|
29306
29223
|
{
|
|
29307
29224
|
onClick: () => rendererProps?.onClick?.(row, formattedValue),
|
|
@@ -29310,8 +29227,8 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29310
29227
|
}
|
|
29311
29228
|
);
|
|
29312
29229
|
case "switch":
|
|
29313
|
-
return /* @__PURE__ */ (0,
|
|
29314
|
-
/* @__PURE__ */ (0,
|
|
29230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "inline-flex items-center cursor-pointer", children: [
|
|
29231
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29315
29232
|
"input",
|
|
29316
29233
|
{
|
|
29317
29234
|
type: "checkbox",
|
|
@@ -29320,10 +29237,10 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29320
29237
|
className: "sr-only peer"
|
|
29321
29238
|
}
|
|
29322
29239
|
),
|
|
29323
|
-
/* @__PURE__ */ (0,
|
|
29240
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative w-9 h-5 bg-gray-300 peer-checked:bg-blue-600 rounded-full transition-all", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "absolute top-[2px] left-[2px] w-4 h-4 bg-white rounded-full peer-checked:translate-x-4 transition-all" }) })
|
|
29324
29241
|
] });
|
|
29325
29242
|
case "progress":
|
|
29326
|
-
return /* @__PURE__ */ (0,
|
|
29243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "w-full bg-gray-100 rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29327
29244
|
"div",
|
|
29328
29245
|
{
|
|
29329
29246
|
className: "bg-blue-600 h-2 rounded-full transition-all",
|
|
@@ -29332,7 +29249,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29332
29249
|
) });
|
|
29333
29250
|
case "rating": {
|
|
29334
29251
|
const stars = Math.round(Number(row?.[rendererProps?.rowField] || formattedValue) || 0);
|
|
29335
|
-
return /* @__PURE__ */ (0,
|
|
29252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex items-center", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29336
29253
|
Star,
|
|
29337
29254
|
{
|
|
29338
29255
|
size: 16,
|
|
@@ -29346,7 +29263,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29346
29263
|
case "custom": {
|
|
29347
29264
|
const CustomRenderer = customRenderers[rendererProps?.customRendererId] || customRenderers[rendererProps?.rendererId];
|
|
29348
29265
|
if (CustomRenderer)
|
|
29349
|
-
return /* @__PURE__ */ (0,
|
|
29266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29350
29267
|
CustomRenderer,
|
|
29351
29268
|
{
|
|
29352
29269
|
value: formattedValue,
|
|
@@ -29354,11 +29271,11 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29354
29271
|
...rendererProps
|
|
29355
29272
|
}
|
|
29356
29273
|
);
|
|
29357
|
-
return /* @__PURE__ */ (0,
|
|
29274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: "Missing custom renderer" });
|
|
29358
29275
|
}
|
|
29359
29276
|
/* -------------------- DEFAULT -------------------- */
|
|
29360
29277
|
default:
|
|
29361
|
-
return /* @__PURE__ */ (0,
|
|
29278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: formattedValue });
|
|
29362
29279
|
}
|
|
29363
29280
|
};
|
|
29364
29281
|
|
|
@@ -29382,6 +29299,8 @@ var useDynamicColumns = (config, customRenderers = {}, customFormatters = {}) =>
|
|
|
29382
29299
|
return sanitizeValue(row[accessorKey]);
|
|
29383
29300
|
};
|
|
29384
29301
|
return columnHelper.accessor(accessorFn, {
|
|
29302
|
+
...col,
|
|
29303
|
+
size: col.size > 0 ? col.size : 180,
|
|
29385
29304
|
id: col.id ?? accessorKey,
|
|
29386
29305
|
header: col.header,
|
|
29387
29306
|
cell: (info) => {
|
|
@@ -29405,7 +29324,7 @@ var useDynamicColumns = (config, customRenderers = {}, customFormatters = {}) =>
|
|
|
29405
29324
|
};
|
|
29406
29325
|
|
|
29407
29326
|
// src/components/ui/data-table.tsx
|
|
29408
|
-
var
|
|
29327
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
29409
29328
|
function DataTable({
|
|
29410
29329
|
columns,
|
|
29411
29330
|
data,
|
|
@@ -29424,10 +29343,10 @@ function DataTable({
|
|
|
29424
29343
|
onDeleteRow,
|
|
29425
29344
|
rowActions
|
|
29426
29345
|
}) {
|
|
29427
|
-
const [columnFilters, setColumnFilters] =
|
|
29428
|
-
const [columnVisibility, setColumnVisibility] =
|
|
29429
|
-
const [manualSort, setManualSort] =
|
|
29430
|
-
const [searchTerm, setSearchTerm] =
|
|
29346
|
+
const [columnFilters, setColumnFilters] = React9.useState([]);
|
|
29347
|
+
const [columnVisibility, setColumnVisibility] = React9.useState({});
|
|
29348
|
+
const [manualSort, setManualSort] = React9.useState(null);
|
|
29349
|
+
const [searchTerm, setSearchTerm] = React9.useState("");
|
|
29431
29350
|
const tableData = Array.isArray(data) ? data : [];
|
|
29432
29351
|
const dynamicCols = useDynamicColumns({ columns });
|
|
29433
29352
|
const table = (0, import_react_table2.useReactTable)({
|
|
@@ -29478,11 +29397,11 @@ function DataTable({
|
|
|
29478
29397
|
return [];
|
|
29479
29398
|
};
|
|
29480
29399
|
const pageCount = table.getPageCount() === 0 ? 1 : table.getPageCount();
|
|
29481
|
-
return /* @__PURE__ */ (0,
|
|
29482
|
-
/* @__PURE__ */ (0,
|
|
29483
|
-
globalSearch && /* @__PURE__ */ (0,
|
|
29484
|
-
/* @__PURE__ */ (0,
|
|
29485
|
-
/* @__PURE__ */ (0,
|
|
29400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "overflow-hidden rounded-md w-full", children: [
|
|
29401
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
|
|
29402
|
+
globalSearch && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
|
|
29403
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "relative w-full", children: [
|
|
29404
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29486
29405
|
"input",
|
|
29487
29406
|
{
|
|
29488
29407
|
type: "text",
|
|
@@ -29497,9 +29416,9 @@ function DataTable({
|
|
|
29497
29416
|
className: "border border-gray-300 rounded-md text-sm px-3 py-2 pl-8 w-full focus:outline-none focus:ring-1 focus:ring-[#12715B]"
|
|
29498
29417
|
}
|
|
29499
29418
|
),
|
|
29500
|
-
/* @__PURE__ */ (0,
|
|
29419
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
|
|
29501
29420
|
] }),
|
|
29502
|
-
/* @__PURE__ */ (0,
|
|
29421
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29503
29422
|
Button,
|
|
29504
29423
|
{
|
|
29505
29424
|
size: "sm",
|
|
@@ -29509,8 +29428,8 @@ function DataTable({
|
|
|
29509
29428
|
}
|
|
29510
29429
|
)
|
|
29511
29430
|
] }),
|
|
29512
|
-
/* @__PURE__ */ (0,
|
|
29513
|
-
/* @__PURE__ */ (0,
|
|
29431
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Popover, { children: [
|
|
29432
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29514
29433
|
Button,
|
|
29515
29434
|
{
|
|
29516
29435
|
variant: "outline",
|
|
@@ -29519,10 +29438,10 @@ function DataTable({
|
|
|
29519
29438
|
children: "Manage Columns"
|
|
29520
29439
|
}
|
|
29521
29440
|
) }),
|
|
29522
|
-
/* @__PURE__ */ (0,
|
|
29523
|
-
/* @__PURE__ */ (0,
|
|
29524
|
-
/* @__PURE__ */ (0,
|
|
29525
|
-
/* @__PURE__ */ (0,
|
|
29441
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
|
|
29442
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
|
|
29443
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
|
|
29444
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29526
29445
|
"input",
|
|
29527
29446
|
{
|
|
29528
29447
|
type: "checkbox",
|
|
@@ -29541,8 +29460,8 @@ function DataTable({
|
|
|
29541
29460
|
),
|
|
29542
29461
|
"Toggle All"
|
|
29543
29462
|
] }),
|
|
29544
|
-
table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0,
|
|
29545
|
-
/* @__PURE__ */ (0,
|
|
29463
|
+
table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
29464
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29546
29465
|
"input",
|
|
29547
29466
|
{
|
|
29548
29467
|
type: "checkbox",
|
|
@@ -29555,12 +29474,12 @@ function DataTable({
|
|
|
29555
29474
|
] })
|
|
29556
29475
|
] })
|
|
29557
29476
|
] }),
|
|
29558
|
-
/* @__PURE__ */ (0,
|
|
29559
|
-
/* @__PURE__ */ (0,
|
|
29477
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Table3, { className: "table-fixed", children: [
|
|
29478
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: hg.headers.map((header, index) => {
|
|
29560
29479
|
const canSort = header.column.getCanSort();
|
|
29561
29480
|
const canFilter = header.column.getCanFilter();
|
|
29562
29481
|
const sortDir = manualSort?.key === header.column.id ? manualSort.dir : null;
|
|
29563
|
-
return /* @__PURE__ */ (0,
|
|
29482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29564
29483
|
TableHead,
|
|
29565
29484
|
{
|
|
29566
29485
|
className: "relative select-none",
|
|
@@ -29569,8 +29488,8 @@ function DataTable({
|
|
|
29569
29488
|
minWidth: header.column.columnDef.minSize,
|
|
29570
29489
|
maxWidth: header.column.columnDef.maxSize
|
|
29571
29490
|
},
|
|
29572
|
-
children: /* @__PURE__ */ (0,
|
|
29573
|
-
/* @__PURE__ */ (0,
|
|
29491
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
29492
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
29574
29493
|
"span",
|
|
29575
29494
|
{
|
|
29576
29495
|
className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
|
|
@@ -29582,32 +29501,32 @@ function DataTable({
|
|
|
29582
29501
|
},
|
|
29583
29502
|
children: [
|
|
29584
29503
|
(0, import_react_table2.flexRender)(header.column.columnDef.header, header.getContext()),
|
|
29585
|
-
canSort && /* @__PURE__ */ (0,
|
|
29586
|
-
sortDir === "asc" && /* @__PURE__ */ (0,
|
|
29587
|
-
sortDir === "desc" && /* @__PURE__ */ (0,
|
|
29588
|
-
!sortDir && /* @__PURE__ */ (0,
|
|
29504
|
+
canSort && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
29505
|
+
sortDir === "asc" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowUp, { size: 14, className: "text-gray-500" }),
|
|
29506
|
+
sortDir === "desc" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowDown, { size: 14, className: "text-gray-500" }),
|
|
29507
|
+
!sortDir && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowUpDown, { size: 14, className: "text-gray-400" })
|
|
29589
29508
|
] })
|
|
29590
29509
|
]
|
|
29591
29510
|
}
|
|
29592
29511
|
),
|
|
29593
|
-
canFilter && /* @__PURE__ */ (0,
|
|
29594
|
-
/* @__PURE__ */ (0,
|
|
29512
|
+
canFilter && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Popover, { children: [
|
|
29513
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29595
29514
|
"span",
|
|
29596
29515
|
{
|
|
29597
29516
|
role: "presentation",
|
|
29598
29517
|
className: "pl-5 cursor-pointer",
|
|
29599
29518
|
onClick: (e) => e.stopPropagation(),
|
|
29600
|
-
children: /* @__PURE__ */ (0,
|
|
29519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons2.faEllipsisH, className: "w-5 h-5 text-gray-500" })
|
|
29601
29520
|
}
|
|
29602
29521
|
) }),
|
|
29603
|
-
/* @__PURE__ */ (0,
|
|
29522
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29604
29523
|
PopoverContent,
|
|
29605
29524
|
{
|
|
29606
29525
|
align: "center",
|
|
29607
29526
|
sideOffset: 14,
|
|
29608
29527
|
className: "w-50 p-3 z-[200] border-gray-300",
|
|
29609
29528
|
avoidCollisions: true,
|
|
29610
|
-
children: /* @__PURE__ */ (0,
|
|
29529
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
29611
29530
|
"form",
|
|
29612
29531
|
{
|
|
29613
29532
|
onSubmit: (e) => {
|
|
@@ -29620,8 +29539,8 @@ function DataTable({
|
|
|
29620
29539
|
},
|
|
29621
29540
|
className: "space-y-2",
|
|
29622
29541
|
children: [
|
|
29623
|
-
/* @__PURE__ */ (0,
|
|
29624
|
-
/* @__PURE__ */ (0,
|
|
29542
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
|
|
29543
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29625
29544
|
"input",
|
|
29626
29545
|
{
|
|
29627
29546
|
name: "filter",
|
|
@@ -29631,7 +29550,7 @@ function DataTable({
|
|
|
29631
29550
|
autoComplete: "off"
|
|
29632
29551
|
}
|
|
29633
29552
|
),
|
|
29634
|
-
/* @__PURE__ */ (0,
|
|
29553
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "justify-end flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29635
29554
|
Button,
|
|
29636
29555
|
{
|
|
29637
29556
|
type: "submit",
|
|
@@ -29650,11 +29569,11 @@ function DataTable({
|
|
|
29650
29569
|
`header-${header.id}-${index}`
|
|
29651
29570
|
);
|
|
29652
29571
|
}) }, `header-group-${hg.id}`)) }),
|
|
29653
|
-
/* @__PURE__ */ (0,
|
|
29572
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: dynamicCols.map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableCell, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "h-4 bg-gray-200 rounded w-3/4 block animate-pulse" }) }, j)) }, i)) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: row.getVisibleCells().map((cell, cellIndex, arr) => {
|
|
29654
29573
|
const meta = cell.column.columnDef.meta || {};
|
|
29655
29574
|
const isClickable = meta?.isClickable;
|
|
29656
29575
|
const isLastCell = cellIndex === arr.length - 1;
|
|
29657
|
-
return /* @__PURE__ */ (0,
|
|
29576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
29658
29577
|
TableCell,
|
|
29659
29578
|
{
|
|
29660
29579
|
className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative py-2`,
|
|
@@ -29671,9 +29590,9 @@ function DataTable({
|
|
|
29671
29590
|
},
|
|
29672
29591
|
children: [
|
|
29673
29592
|
(0, import_react_table2.flexRender)(cell.column.columnDef.cell, cell.getContext()),
|
|
29674
|
-
isLastCell && rowActions && rowActions.length > 0 && /* @__PURE__ */ (0,
|
|
29593
|
+
isLastCell && rowActions && rowActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "absolute bg-[#fff] p-1 px-4 inset-y-0 right-0 flex items-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 shadow-lg rounded", children: rowActions.map((action) => {
|
|
29675
29594
|
const isDelete = action.id === "delete" || action.icon === "delete";
|
|
29676
|
-
return /* @__PURE__ */ (0,
|
|
29595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29677
29596
|
"button",
|
|
29678
29597
|
{
|
|
29679
29598
|
className: `ml-2 px-2 py-1 text-[12px] rounded cursor-pointer ${isDelete ? "bg-red-800 text-white hover:bg-neutral-600" : "bg-gray-300 hover:bg-gray-400"}`,
|
|
@@ -29695,17 +29614,17 @@ function DataTable({
|
|
|
29695
29614
|
},
|
|
29696
29615
|
`cell-${cell.id}-${cellIndex}`
|
|
29697
29616
|
);
|
|
29698
|
-
}) }, row.id)) : /* @__PURE__ */ (0,
|
|
29617
|
+
}) }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableCell, { colSpan: dynamicCols.length, className: "h-24 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "flex items-center justify-center py-10 w-full min-w-full text-gray-600 bg-gray-100", children: "No results." }) }) }) })
|
|
29699
29618
|
] }),
|
|
29700
|
-
pagination && /* @__PURE__ */ (0,
|
|
29701
|
-
/* @__PURE__ */ (0,
|
|
29619
|
+
pagination && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
29620
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
29702
29621
|
"Page ",
|
|
29703
29622
|
table.getState().pagination.pageIndex + 1,
|
|
29704
29623
|
" of ",
|
|
29705
29624
|
pageCount
|
|
29706
29625
|
] }),
|
|
29707
|
-
/* @__PURE__ */ (0,
|
|
29708
|
-
/* @__PURE__ */ (0,
|
|
29626
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
29627
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29709
29628
|
"button",
|
|
29710
29629
|
{
|
|
29711
29630
|
onClick: () => table.previousPage(),
|
|
@@ -29718,7 +29637,7 @@ function DataTable({
|
|
|
29718
29637
|
table.getState().pagination.pageIndex + 1,
|
|
29719
29638
|
table.getPageCount(),
|
|
29720
29639
|
5
|
|
29721
|
-
).map((pageNum, index) => /* @__PURE__ */ (0,
|
|
29640
|
+
).map((pageNum, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29722
29641
|
"button",
|
|
29723
29642
|
{
|
|
29724
29643
|
disabled: pageNum === "...",
|
|
@@ -29728,7 +29647,7 @@ function DataTable({
|
|
|
29728
29647
|
},
|
|
29729
29648
|
index
|
|
29730
29649
|
)),
|
|
29731
|
-
/* @__PURE__ */ (0,
|
|
29650
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29732
29651
|
"button",
|
|
29733
29652
|
{
|
|
29734
29653
|
onClick: () => table.nextPage(),
|
|
@@ -29743,7 +29662,7 @@ function DataTable({
|
|
|
29743
29662
|
}
|
|
29744
29663
|
|
|
29745
29664
|
// src/components/DataDisplay/Table/Table.tsx
|
|
29746
|
-
var
|
|
29665
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
29747
29666
|
var Table4 = ({
|
|
29748
29667
|
columns,
|
|
29749
29668
|
data,
|
|
@@ -29768,7 +29687,7 @@ var Table4 = ({
|
|
|
29768
29687
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
29769
29688
|
const rawData = Array.isArray(data) ? data : [];
|
|
29770
29689
|
const isControlled = typeof page === "number";
|
|
29771
|
-
return /* @__PURE__ */ (0,
|
|
29690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
29772
29691
|
DataTable,
|
|
29773
29692
|
{
|
|
29774
29693
|
...props,
|
|
@@ -29800,9 +29719,9 @@ var Table4 = ({
|
|
|
29800
29719
|
var Table_default = Table4;
|
|
29801
29720
|
|
|
29802
29721
|
// src/components/ui/pagination.tsx
|
|
29803
|
-
var
|
|
29722
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
29804
29723
|
function Pagination({ className, ...props }) {
|
|
29805
|
-
return /* @__PURE__ */ (0,
|
|
29724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
29806
29725
|
"nav",
|
|
29807
29726
|
{
|
|
29808
29727
|
role: "navigation",
|
|
@@ -29817,7 +29736,7 @@ function PaginationContent({
|
|
|
29817
29736
|
className,
|
|
29818
29737
|
...props
|
|
29819
29738
|
}) {
|
|
29820
|
-
return /* @__PURE__ */ (0,
|
|
29739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
29821
29740
|
"ul",
|
|
29822
29741
|
{
|
|
29823
29742
|
"data-slot": "pagination-content",
|
|
@@ -29827,7 +29746,7 @@ function PaginationContent({
|
|
|
29827
29746
|
);
|
|
29828
29747
|
}
|
|
29829
29748
|
function PaginationItem({ ...props }) {
|
|
29830
|
-
return /* @__PURE__ */ (0,
|
|
29749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { "data-slot": "pagination-item", ...props });
|
|
29831
29750
|
}
|
|
29832
29751
|
function PaginationLink({
|
|
29833
29752
|
className,
|
|
@@ -29835,7 +29754,7 @@ function PaginationLink({
|
|
|
29835
29754
|
size = "icon",
|
|
29836
29755
|
...props
|
|
29837
29756
|
}) {
|
|
29838
|
-
return /* @__PURE__ */ (0,
|
|
29757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
29839
29758
|
"a",
|
|
29840
29759
|
{
|
|
29841
29760
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -29856,7 +29775,7 @@ function PaginationPrevious({
|
|
|
29856
29775
|
className,
|
|
29857
29776
|
...props
|
|
29858
29777
|
}) {
|
|
29859
|
-
return /* @__PURE__ */ (0,
|
|
29778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
29860
29779
|
PaginationLink,
|
|
29861
29780
|
{
|
|
29862
29781
|
"aria-label": "Go to previous page",
|
|
@@ -29864,8 +29783,8 @@ function PaginationPrevious({
|
|
|
29864
29783
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
29865
29784
|
...props,
|
|
29866
29785
|
children: [
|
|
29867
|
-
/* @__PURE__ */ (0,
|
|
29868
|
-
/* @__PURE__ */ (0,
|
|
29786
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronLeft, {}),
|
|
29787
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "hidden sm:block", children: "Previous" })
|
|
29869
29788
|
]
|
|
29870
29789
|
}
|
|
29871
29790
|
);
|
|
@@ -29874,7 +29793,7 @@ function PaginationNext({
|
|
|
29874
29793
|
className,
|
|
29875
29794
|
...props
|
|
29876
29795
|
}) {
|
|
29877
|
-
return /* @__PURE__ */ (0,
|
|
29796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
29878
29797
|
PaginationLink,
|
|
29879
29798
|
{
|
|
29880
29799
|
"aria-label": "Go to next page",
|
|
@@ -29882,8 +29801,8 @@ function PaginationNext({
|
|
|
29882
29801
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
29883
29802
|
...props,
|
|
29884
29803
|
children: [
|
|
29885
|
-
/* @__PURE__ */ (0,
|
|
29886
|
-
/* @__PURE__ */ (0,
|
|
29804
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "hidden sm:block", children: "Next" }),
|
|
29805
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronRight, {})
|
|
29887
29806
|
]
|
|
29888
29807
|
}
|
|
29889
29808
|
);
|
|
@@ -29892,7 +29811,7 @@ function PaginationEllipsis({
|
|
|
29892
29811
|
className,
|
|
29893
29812
|
...props
|
|
29894
29813
|
}) {
|
|
29895
|
-
return /* @__PURE__ */ (0,
|
|
29814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
29896
29815
|
"span",
|
|
29897
29816
|
{
|
|
29898
29817
|
"aria-hidden": true,
|
|
@@ -29900,15 +29819,15 @@ function PaginationEllipsis({
|
|
|
29900
29819
|
className: cn("flex size-9 items-center justify-center", className),
|
|
29901
29820
|
...props,
|
|
29902
29821
|
children: [
|
|
29903
|
-
/* @__PURE__ */ (0,
|
|
29904
|
-
/* @__PURE__ */ (0,
|
|
29822
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Ellipsis, { className: "size-4" }),
|
|
29823
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
29905
29824
|
]
|
|
29906
29825
|
}
|
|
29907
29826
|
);
|
|
29908
29827
|
}
|
|
29909
29828
|
|
|
29910
29829
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
29911
|
-
var
|
|
29830
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
29912
29831
|
var CustomPagination = ({
|
|
29913
29832
|
totalPages,
|
|
29914
29833
|
currentPage,
|
|
@@ -29954,10 +29873,10 @@ var CustomPagination = ({
|
|
|
29954
29873
|
}
|
|
29955
29874
|
};
|
|
29956
29875
|
const pageNumbers = getPageNumbers();
|
|
29957
|
-
return /* @__PURE__ */ (0,
|
|
29958
|
-
/* @__PURE__ */ (0,
|
|
29959
|
-
/* @__PURE__ */ (0,
|
|
29960
|
-
/* @__PURE__ */ (0,
|
|
29876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
|
|
29877
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
29878
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
|
|
29879
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
29961
29880
|
Select,
|
|
29962
29881
|
{
|
|
29963
29882
|
defaultValue: String(perPage),
|
|
@@ -29965,26 +29884,26 @@ var CustomPagination = ({
|
|
|
29965
29884
|
onPageChange({ page: 1, itemsPerPage: Number(value) });
|
|
29966
29885
|
},
|
|
29967
29886
|
children: [
|
|
29968
|
-
/* @__PURE__ */ (0,
|
|
29969
|
-
/* @__PURE__ */ (0,
|
|
29970
|
-
/* @__PURE__ */ (0,
|
|
29971
|
-
/* @__PURE__ */ (0,
|
|
29972
|
-
/* @__PURE__ */ (0,
|
|
29973
|
-
/* @__PURE__ */ (0,
|
|
29887
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
29888
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(SelectContent, { children: [
|
|
29889
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "5", children: "5" }),
|
|
29890
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "10", children: "10" }),
|
|
29891
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "20", children: "20" }),
|
|
29892
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "50", children: "50" })
|
|
29974
29893
|
] })
|
|
29975
29894
|
]
|
|
29976
29895
|
}
|
|
29977
29896
|
)
|
|
29978
29897
|
] }),
|
|
29979
|
-
/* @__PURE__ */ (0,
|
|
29980
|
-
/* @__PURE__ */ (0,
|
|
29898
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(PaginationContent, { children: [
|
|
29899
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29981
29900
|
PaginationPrevious,
|
|
29982
29901
|
{
|
|
29983
29902
|
onClick: () => handlePageChange(currentPage - 1),
|
|
29984
29903
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
29985
29904
|
}
|
|
29986
29905
|
) }),
|
|
29987
|
-
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0,
|
|
29906
|
+
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29988
29907
|
PaginationLink,
|
|
29989
29908
|
{
|
|
29990
29909
|
onClick: () => handlePageChange(pageNumber),
|
|
@@ -29993,7 +29912,7 @@ var CustomPagination = ({
|
|
|
29993
29912
|
children: pageNumber
|
|
29994
29913
|
}
|
|
29995
29914
|
) }, index)),
|
|
29996
|
-
/* @__PURE__ */ (0,
|
|
29915
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29997
29916
|
PaginationNext,
|
|
29998
29917
|
{
|
|
29999
29918
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -30006,12 +29925,128 @@ var CustomPagination = ({
|
|
|
30006
29925
|
var Pagination_default = CustomPagination;
|
|
30007
29926
|
|
|
30008
29927
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30009
|
-
var
|
|
29928
|
+
var import_react31 = require("react");
|
|
30010
29929
|
var import_link5 = __toESM(require("next/link"));
|
|
30011
29930
|
var import_navigation3 = require("next/navigation");
|
|
30012
|
-
|
|
29931
|
+
|
|
29932
|
+
// src/components/ui/dialog.tsx
|
|
29933
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
29934
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
29935
|
+
function Dialog({
|
|
29936
|
+
...props
|
|
29937
|
+
}) {
|
|
29938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
29939
|
+
}
|
|
29940
|
+
function DialogPortal({
|
|
29941
|
+
...props
|
|
29942
|
+
}) {
|
|
29943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
29944
|
+
}
|
|
29945
|
+
function DialogOverlay({
|
|
29946
|
+
className,
|
|
29947
|
+
...props
|
|
29948
|
+
}) {
|
|
29949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
29950
|
+
DialogPrimitive.Overlay,
|
|
29951
|
+
{
|
|
29952
|
+
"data-slot": "dialog-overlay",
|
|
29953
|
+
className: cn(
|
|
29954
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-black/50",
|
|
29955
|
+
className
|
|
29956
|
+
),
|
|
29957
|
+
...props
|
|
29958
|
+
}
|
|
29959
|
+
);
|
|
29960
|
+
}
|
|
29961
|
+
function DialogContent({
|
|
29962
|
+
className,
|
|
29963
|
+
children,
|
|
29964
|
+
showCloseButton = true,
|
|
29965
|
+
...props
|
|
29966
|
+
}) {
|
|
29967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
29968
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogOverlay, {}),
|
|
29969
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
29970
|
+
DialogPrimitive.Content,
|
|
29971
|
+
{
|
|
29972
|
+
"data-slot": "dialog-content",
|
|
29973
|
+
className: cn(
|
|
29974
|
+
"bg-background 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 fixed top-[50%] left-[50%] z-[70] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
29975
|
+
className
|
|
29976
|
+
),
|
|
29977
|
+
...props,
|
|
29978
|
+
children: [
|
|
29979
|
+
children,
|
|
29980
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
29981
|
+
DialogPrimitive.Close,
|
|
29982
|
+
{
|
|
29983
|
+
"data-slot": "dialog-close",
|
|
29984
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
29985
|
+
children: [
|
|
29986
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(X, {}),
|
|
29987
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: "Close" })
|
|
29988
|
+
]
|
|
29989
|
+
}
|
|
29990
|
+
)
|
|
29991
|
+
]
|
|
29992
|
+
}
|
|
29993
|
+
)
|
|
29994
|
+
] });
|
|
29995
|
+
}
|
|
29996
|
+
function DialogHeader({ className, ...props }) {
|
|
29997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
29998
|
+
"div",
|
|
29999
|
+
{
|
|
30000
|
+
"data-slot": "dialog-header",
|
|
30001
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
30002
|
+
...props
|
|
30003
|
+
}
|
|
30004
|
+
);
|
|
30005
|
+
}
|
|
30006
|
+
function DialogFooter({ className, ...props }) {
|
|
30007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
30008
|
+
"div",
|
|
30009
|
+
{
|
|
30010
|
+
"data-slot": "dialog-footer",
|
|
30011
|
+
className: cn(
|
|
30012
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
30013
|
+
className
|
|
30014
|
+
),
|
|
30015
|
+
...props
|
|
30016
|
+
}
|
|
30017
|
+
);
|
|
30018
|
+
}
|
|
30019
|
+
function DialogTitle({
|
|
30020
|
+
className,
|
|
30021
|
+
...props
|
|
30022
|
+
}) {
|
|
30023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
30024
|
+
DialogPrimitive.Title,
|
|
30025
|
+
{
|
|
30026
|
+
"data-slot": "dialog-title",
|
|
30027
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
30028
|
+
...props
|
|
30029
|
+
}
|
|
30030
|
+
);
|
|
30031
|
+
}
|
|
30032
|
+
function DialogDescription({
|
|
30033
|
+
className,
|
|
30034
|
+
...props
|
|
30035
|
+
}) {
|
|
30036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
30037
|
+
DialogPrimitive.Description,
|
|
30038
|
+
{
|
|
30039
|
+
"data-slot": "dialog-description",
|
|
30040
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
30041
|
+
...props
|
|
30042
|
+
}
|
|
30043
|
+
);
|
|
30044
|
+
}
|
|
30045
|
+
|
|
30046
|
+
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30047
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
30013
30048
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
|
|
30014
|
-
const [openIndex, setOpenIndex] = (0,
|
|
30049
|
+
const [openIndex, setOpenIndex] = (0, import_react31.useState)(null);
|
|
30015
30050
|
function groupMenus(menus = []) {
|
|
30016
30051
|
const menuMap = /* @__PURE__ */ new Map();
|
|
30017
30052
|
menus.forEach((menu) => {
|
|
@@ -30044,7 +30079,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30044
30079
|
});
|
|
30045
30080
|
return sortMenus(rootMenus);
|
|
30046
30081
|
}
|
|
30047
|
-
const rawTabs = (0,
|
|
30082
|
+
const rawTabs = (0, import_react31.useMemo)(() => {
|
|
30048
30083
|
if (!Array.isArray(tabs)) return [];
|
|
30049
30084
|
if (source === "manual") return Array.isArray(tabs) ? tabs : [];
|
|
30050
30085
|
return groupMenus(tabs);
|
|
@@ -30057,9 +30092,9 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30057
30092
|
return pathname === path || path !== "/" && pathname?.startsWith(path);
|
|
30058
30093
|
};
|
|
30059
30094
|
const router = (0, import_navigation3.useRouter)();
|
|
30060
|
-
const [showExitDialog, setShowExitDialog] = (0,
|
|
30061
|
-
const [pendingUrl, setPendingUrl] = (0,
|
|
30062
|
-
const handleBuilderExit = (0,
|
|
30095
|
+
const [showExitDialog, setShowExitDialog] = (0, import_react31.useState)(false);
|
|
30096
|
+
const [pendingUrl, setPendingUrl] = (0, import_react31.useState)(null);
|
|
30097
|
+
const handleBuilderExit = (0, import_react31.useCallback)(
|
|
30063
30098
|
(e, url) => {
|
|
30064
30099
|
if (isBuilder) {
|
|
30065
30100
|
e.preventDefault();
|
|
@@ -30079,13 +30114,13 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30079
30114
|
const renderDesktopTab = (tab, index) => {
|
|
30080
30115
|
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
30081
30116
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
30082
|
-
return /* @__PURE__ */ (0,
|
|
30117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
30083
30118
|
DropdownMenu,
|
|
30084
30119
|
{
|
|
30085
30120
|
open: openIndex === index,
|
|
30086
30121
|
onOpenChange: (open) => setOpenIndex(open ? index : null),
|
|
30087
30122
|
children: [
|
|
30088
|
-
/* @__PURE__ */ (0,
|
|
30123
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
30089
30124
|
DropdownMenuTrigger,
|
|
30090
30125
|
{
|
|
30091
30126
|
className: `${finalClasses} inline-flex items-center gap-1`,
|
|
@@ -30098,11 +30133,11 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30098
30133
|
},
|
|
30099
30134
|
children: [
|
|
30100
30135
|
tab.header,
|
|
30101
|
-
/* @__PURE__ */ (0,
|
|
30136
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
30102
30137
|
]
|
|
30103
30138
|
}
|
|
30104
30139
|
),
|
|
30105
|
-
/* @__PURE__ */ (0,
|
|
30140
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30106
30141
|
DropdownMenuContent,
|
|
30107
30142
|
{
|
|
30108
30143
|
align: "start",
|
|
@@ -30115,12 +30150,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30115
30150
|
onMouseLeave: () => {
|
|
30116
30151
|
timeout = setTimeout(() => setOpenIndex(null), 150);
|
|
30117
30152
|
},
|
|
30118
|
-
children: tab.children.map((item, index2) => /* @__PURE__ */ (0,
|
|
30153
|
+
children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30119
30154
|
DropdownMenuItem,
|
|
30120
30155
|
{
|
|
30121
30156
|
asChild: true,
|
|
30122
30157
|
className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
30123
|
-
children: /* @__PURE__ */ (0,
|
|
30158
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30124
30159
|
import_link5.default,
|
|
30125
30160
|
{
|
|
30126
30161
|
href: item.url || "#",
|
|
@@ -30139,7 +30174,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30139
30174
|
index
|
|
30140
30175
|
);
|
|
30141
30176
|
}
|
|
30142
|
-
return tab.url ? /* @__PURE__ */ (0,
|
|
30177
|
+
return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30143
30178
|
import_link5.default,
|
|
30144
30179
|
{
|
|
30145
30180
|
href: tab.url,
|
|
@@ -30150,14 +30185,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30150
30185
|
children: tab.header
|
|
30151
30186
|
},
|
|
30152
30187
|
index
|
|
30153
|
-
) : /* @__PURE__ */ (0,
|
|
30188
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
30154
30189
|
};
|
|
30155
|
-
const renderMobileMenu = () => /* @__PURE__ */ (0,
|
|
30156
|
-
/* @__PURE__ */ (0,
|
|
30157
|
-
/* @__PURE__ */ (0,
|
|
30190
|
+
const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenu, { children: [
|
|
30191
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|
|
30192
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Menu, { className: "h-4 w-4" }),
|
|
30158
30193
|
"Menu"
|
|
30159
30194
|
] }),
|
|
30160
|
-
/* @__PURE__ */ (0,
|
|
30195
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30161
30196
|
DropdownMenuContent,
|
|
30162
30197
|
{
|
|
30163
30198
|
align: "start",
|
|
@@ -30166,25 +30201,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30166
30201
|
children: rawTabs.map((tab, i) => {
|
|
30167
30202
|
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
30168
30203
|
if (hasChildren) {
|
|
30169
|
-
return /* @__PURE__ */ (0,
|
|
30170
|
-
/* @__PURE__ */ (0,
|
|
30171
|
-
/* @__PURE__ */ (0,
|
|
30204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuSub, { children: [
|
|
30205
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
|
|
30206
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30172
30207
|
DropdownMenuItem,
|
|
30173
30208
|
{
|
|
30174
30209
|
asChild: true,
|
|
30175
30210
|
className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100",
|
|
30176
|
-
children: /* @__PURE__ */ (0,
|
|
30211
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
30177
30212
|
},
|
|
30178
30213
|
item.id || index
|
|
30179
30214
|
)) })
|
|
30180
30215
|
] }, i);
|
|
30181
30216
|
}
|
|
30182
|
-
return /* @__PURE__ */ (0,
|
|
30217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30183
30218
|
DropdownMenuItem,
|
|
30184
30219
|
{
|
|
30185
30220
|
asChild: true,
|
|
30186
30221
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
|
|
30187
|
-
children: /* @__PURE__ */ (0,
|
|
30222
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_link5.default, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
|
|
30188
30223
|
},
|
|
30189
30224
|
i
|
|
30190
30225
|
);
|
|
@@ -30194,19 +30229,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30194
30229
|
] });
|
|
30195
30230
|
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
30196
30231
|
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
30197
|
-
return /* @__PURE__ */ (0,
|
|
30198
|
-
/* @__PURE__ */ (0,
|
|
30199
|
-
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0,
|
|
30200
|
-
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0,
|
|
30232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
30233
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: cn("min-h-10", className), style, children: [
|
|
30234
|
+
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
30235
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
30201
30236
|
] }),
|
|
30202
|
-
/* @__PURE__ */ (0,
|
|
30203
|
-
/* @__PURE__ */ (0,
|
|
30204
|
-
/* @__PURE__ */ (0,
|
|
30205
|
-
/* @__PURE__ */ (0,
|
|
30237
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
|
|
30238
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogHeader, { children: [
|
|
30239
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DialogTitle, { children: "Exit Builder?" }),
|
|
30240
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
30206
30241
|
] }),
|
|
30207
|
-
/* @__PURE__ */ (0,
|
|
30208
|
-
/* @__PURE__ */ (0,
|
|
30209
|
-
/* @__PURE__ */ (0,
|
|
30242
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogFooter, { children: [
|
|
30243
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
30244
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
30210
30245
|
] })
|
|
30211
30246
|
] }) })
|
|
30212
30247
|
] });
|
|
@@ -30214,10 +30249,10 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30214
30249
|
var Tabs_default = Tabs;
|
|
30215
30250
|
|
|
30216
30251
|
// src/components/Navigation/Stages/Stages.tsx
|
|
30217
|
-
var
|
|
30218
|
-
var
|
|
30252
|
+
var import_react32 = __toESM(require("react"));
|
|
30253
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
30219
30254
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey = "key", dataLabel = "header", loading }) => {
|
|
30220
|
-
const [activeStage, setActiveStage] = (0,
|
|
30255
|
+
const [activeStage, setActiveStage] = (0, import_react32.useState)(currentStage || (stages && stages.length > 0 ? stages[0].key : null));
|
|
30221
30256
|
const nextStage = () => {
|
|
30222
30257
|
if (!stages || stages.length === 0) return;
|
|
30223
30258
|
const currentIndex = stages.findIndex((stage) => stage[dataKey] === activeStage);
|
|
@@ -30234,9 +30269,9 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
30234
30269
|
onStageChange?.(stageKey);
|
|
30235
30270
|
};
|
|
30236
30271
|
const isAllStagesCompleted = activeStage === lastStage;
|
|
30237
|
-
return /* @__PURE__ */ (0,
|
|
30238
|
-
/* @__PURE__ */ (0,
|
|
30239
|
-
/* @__PURE__ */ (0,
|
|
30272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
30273
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
30274
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
30240
30275
|
"button",
|
|
30241
30276
|
{
|
|
30242
30277
|
className: `
|
|
@@ -30249,8 +30284,8 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
30249
30284
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
30250
30285
|
const isCompleted = isAllStagesCompleted || index < currentIndex;
|
|
30251
30286
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
30252
|
-
return /* @__PURE__ */ (0,
|
|
30253
|
-
/* @__PURE__ */ (0,
|
|
30287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react32.default.Fragment, { children: [
|
|
30288
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
30254
30289
|
"button",
|
|
30255
30290
|
{
|
|
30256
30291
|
className: `
|
|
@@ -30263,10 +30298,10 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
30263
30298
|
children: stage[dataLabel]
|
|
30264
30299
|
}
|
|
30265
30300
|
),
|
|
30266
|
-
index < stages.length - 1 && /* @__PURE__ */ (0,
|
|
30301
|
+
index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
|
|
30267
30302
|
] }, stage.id);
|
|
30268
30303
|
}) }),
|
|
30269
|
-
isShowBtn && /* @__PURE__ */ (0,
|
|
30304
|
+
isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
30270
30305
|
"button",
|
|
30271
30306
|
{
|
|
30272
30307
|
className: "bg-green-700 text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
|
|
@@ -30281,26 +30316,26 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
30281
30316
|
var Stages_default = StagesComponent;
|
|
30282
30317
|
|
|
30283
30318
|
// src/components/Navigation/Spacer/Spacer.tsx
|
|
30284
|
-
var
|
|
30319
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
30285
30320
|
var Spacer = ({ className, style }) => {
|
|
30286
|
-
return /* @__PURE__ */ (0,
|
|
30321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: `${className}`, style });
|
|
30287
30322
|
};
|
|
30288
30323
|
var Spacer_default = Spacer;
|
|
30289
30324
|
|
|
30290
30325
|
// src/components/Navigation/Profile/Profile.tsx
|
|
30291
|
-
var
|
|
30326
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
30292
30327
|
|
|
30293
30328
|
// src/components/Navigation/Notification/Notification.tsx
|
|
30294
|
-
var
|
|
30329
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
30295
30330
|
|
|
30296
30331
|
// src/components/Navigation/Logo/Logo.tsx
|
|
30297
|
-
var
|
|
30332
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
30298
30333
|
|
|
30299
30334
|
// src/components/ui/avatar.tsx
|
|
30300
|
-
var
|
|
30335
|
+
var React11 = __toESM(require("react"));
|
|
30301
30336
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
30302
|
-
var
|
|
30303
|
-
var Avatar =
|
|
30337
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
30338
|
+
var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
30304
30339
|
AvatarPrimitive.Root,
|
|
30305
30340
|
{
|
|
30306
30341
|
ref,
|
|
@@ -30312,7 +30347,7 @@ var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
30312
30347
|
}
|
|
30313
30348
|
));
|
|
30314
30349
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
30315
|
-
var AvatarImage =
|
|
30350
|
+
var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
30316
30351
|
AvatarPrimitive.Image,
|
|
30317
30352
|
{
|
|
30318
30353
|
ref,
|
|
@@ -30321,7 +30356,7 @@ var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
30321
30356
|
}
|
|
30322
30357
|
));
|
|
30323
30358
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
30324
|
-
var AvatarFallback =
|
|
30359
|
+
var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
30325
30360
|
AvatarPrimitive.Fallback,
|
|
30326
30361
|
{
|
|
30327
30362
|
ref,
|
|
@@ -30339,8 +30374,8 @@ var import_link6 = __toESM(require("next/link"));
|
|
|
30339
30374
|
var import_image4 = __toESM(require("next/image"));
|
|
30340
30375
|
var import_navigation4 = require("next/navigation");
|
|
30341
30376
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
30342
|
-
var
|
|
30343
|
-
var
|
|
30377
|
+
var import_react33 = require("react");
|
|
30378
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
30344
30379
|
function Navbar({
|
|
30345
30380
|
style,
|
|
30346
30381
|
badgeType,
|
|
@@ -30360,9 +30395,9 @@ function Navbar({
|
|
|
30360
30395
|
}) {
|
|
30361
30396
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
30362
30397
|
const router = (0, import_navigation4.useRouter)();
|
|
30363
|
-
const [showExitDialog, setShowExitDialog] = (0,
|
|
30364
|
-
const [pendingUrl, setPendingUrl] = (0,
|
|
30365
|
-
const handleBuilderExit = (0,
|
|
30398
|
+
const [showExitDialog, setShowExitDialog] = (0, import_react33.useState)(false);
|
|
30399
|
+
const [pendingUrl, setPendingUrl] = (0, import_react33.useState)(null);
|
|
30400
|
+
const handleBuilderExit = (0, import_react33.useCallback)(
|
|
30366
30401
|
(e, url) => {
|
|
30367
30402
|
if (isBuilder) {
|
|
30368
30403
|
e.preventDefault();
|
|
@@ -30378,29 +30413,29 @@ function Navbar({
|
|
|
30378
30413
|
router.push(pendingUrl);
|
|
30379
30414
|
}
|
|
30380
30415
|
};
|
|
30381
|
-
const formatedMenu = (0,
|
|
30416
|
+
const formatedMenu = (0, import_react33.useMemo)(() => {
|
|
30382
30417
|
if (source === "state" && navList && navList.length) {
|
|
30383
30418
|
return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
|
|
30384
30419
|
}
|
|
30385
30420
|
return list || [];
|
|
30386
30421
|
}, [source, navList]);
|
|
30387
|
-
return /* @__PURE__ */ (0,
|
|
30388
|
-
/* @__PURE__ */ (0,
|
|
30422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
30423
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30389
30424
|
"nav",
|
|
30390
30425
|
{
|
|
30391
30426
|
className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
30392
30427
|
style,
|
|
30393
|
-
children: /* @__PURE__ */ (0,
|
|
30394
|
-
/* @__PURE__ */ (0,
|
|
30428
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
30429
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30395
30430
|
import_link6.default,
|
|
30396
30431
|
{
|
|
30397
30432
|
href: "/",
|
|
30398
30433
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
30399
30434
|
className: "flex items-center space-x-2",
|
|
30400
|
-
children: imageUrl ? /* @__PURE__ */ (0,
|
|
30435
|
+
children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_image4.default, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "font-semibold text-blue-700", children: "Logo" })
|
|
30401
30436
|
}
|
|
30402
30437
|
),
|
|
30403
|
-
!isMobileView && /* @__PURE__ */ (0,
|
|
30438
|
+
!isMobileView && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30404
30439
|
import_link6.default,
|
|
30405
30440
|
{
|
|
30406
30441
|
href: item.url || "#",
|
|
@@ -30410,39 +30445,39 @@ function Navbar({
|
|
|
30410
30445
|
},
|
|
30411
30446
|
item.id
|
|
30412
30447
|
)) }),
|
|
30413
|
-
/* @__PURE__ */ (0,
|
|
30414
|
-
!isMobileView ? /* @__PURE__ */ (0,
|
|
30415
|
-
/* @__PURE__ */ (0,
|
|
30416
|
-
/* @__PURE__ */ (0,
|
|
30417
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
30418
|
-
/* @__PURE__ */ (0,
|
|
30419
|
-
/* @__PURE__ */ (0,
|
|
30420
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0,
|
|
30448
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
30449
|
+
!isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex-1 px-6", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
30450
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
|
|
30451
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
30452
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Search, { className: "h-5 w-5 text-gray-400" }) }),
|
|
30453
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
|
|
30454
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
|
|
30455
|
+
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("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__ */ (0, import_jsx_runtime63.jsx)("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
|
|
30421
30456
|
] }),
|
|
30422
|
-
/* @__PURE__ */ (0,
|
|
30423
|
-
/* @__PURE__ */ (0,
|
|
30424
|
-
!isMobileView && showName && /* @__PURE__ */ (0,
|
|
30425
|
-
!isMobileView ? /* @__PURE__ */ (0,
|
|
30426
|
-
/* @__PURE__ */ (0,
|
|
30457
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DropdownMenu, { children: [
|
|
30458
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
30459
|
+
!isMobileView && showName && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
|
|
30460
|
+
!isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
30461
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30427
30462
|
AvatarImage,
|
|
30428
30463
|
{
|
|
30429
30464
|
src: "/images/appbuilder/toolset/profile.svg",
|
|
30430
30465
|
alt: "Profile"
|
|
30431
30466
|
}
|
|
30432
|
-
) : /* @__PURE__ */ (0,
|
|
30433
|
-
/* @__PURE__ */ (0,
|
|
30467
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("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) }) }),
|
|
30468
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30434
30469
|
Button,
|
|
30435
30470
|
{
|
|
30436
30471
|
variant: "ghost",
|
|
30437
30472
|
size: "icon",
|
|
30438
30473
|
className: "text-gray-900 md:hidden dark:invert",
|
|
30439
|
-
children: /* @__PURE__ */ (0,
|
|
30474
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Menu, { className: "h-6 w-6" })
|
|
30440
30475
|
}
|
|
30441
30476
|
)
|
|
30442
|
-
] }) : /* @__PURE__ */ (0,
|
|
30477
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Menu, { className: "h-6 w-6" }) })
|
|
30443
30478
|
] }) }),
|
|
30444
|
-
/* @__PURE__ */ (0,
|
|
30445
|
-
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0,
|
|
30479
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
30480
|
+
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: profileMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30446
30481
|
import_link6.default,
|
|
30447
30482
|
{
|
|
30448
30483
|
href: item.url || "#",
|
|
@@ -30450,9 +30485,9 @@ function Navbar({
|
|
|
30450
30485
|
children: item.header
|
|
30451
30486
|
}
|
|
30452
30487
|
) }, item.id)) }),
|
|
30453
|
-
/* @__PURE__ */ (0,
|
|
30454
|
-
/* @__PURE__ */ (0,
|
|
30455
|
-
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0,
|
|
30488
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "md:hidden", children: [
|
|
30489
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_dropdown_menu.DropdownMenuSeparator, {}),
|
|
30490
|
+
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30456
30491
|
import_link6.default,
|
|
30457
30492
|
{
|
|
30458
30493
|
href: item.url || "#",
|
|
@@ -30467,51 +30502,51 @@ function Navbar({
|
|
|
30467
30502
|
] })
|
|
30468
30503
|
}
|
|
30469
30504
|
),
|
|
30470
|
-
/* @__PURE__ */ (0,
|
|
30471
|
-
/* @__PURE__ */ (0,
|
|
30472
|
-
/* @__PURE__ */ (0,
|
|
30473
|
-
/* @__PURE__ */ (0,
|
|
30505
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
|
|
30506
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogHeader, { children: [
|
|
30507
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogTitle, { children: "Exit Builder?" }),
|
|
30508
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
30474
30509
|
] }),
|
|
30475
|
-
/* @__PURE__ */ (0,
|
|
30476
|
-
/* @__PURE__ */ (0,
|
|
30477
|
-
/* @__PURE__ */ (0,
|
|
30510
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogFooter, { children: [
|
|
30511
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
30512
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
30478
30513
|
] })
|
|
30479
30514
|
] }) })
|
|
30480
30515
|
] });
|
|
30481
30516
|
}
|
|
30482
30517
|
|
|
30483
30518
|
// src/components/Chart/BarChart.tsx
|
|
30484
|
-
var
|
|
30519
|
+
var import_react34 = __toESM(require("react"));
|
|
30485
30520
|
var import_recharts = require("recharts");
|
|
30486
|
-
var
|
|
30521
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
30487
30522
|
var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
30488
30523
|
const data = Array.isArray(props.data) ? props.data : [];
|
|
30489
30524
|
const chartType = props.chartType || "bar";
|
|
30490
30525
|
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
30491
30526
|
if (loading || data.length === 0) {
|
|
30492
|
-
return /* @__PURE__ */ (0,
|
|
30527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
30493
30528
|
"div",
|
|
30494
30529
|
{
|
|
30495
30530
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
30496
30531
|
style,
|
|
30497
|
-
children: /* @__PURE__ */ (0,
|
|
30532
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
|
|
30498
30533
|
}
|
|
30499
30534
|
);
|
|
30500
30535
|
}
|
|
30501
|
-
return /* @__PURE__ */ (0,
|
|
30502
|
-
/* @__PURE__ */ (0,
|
|
30503
|
-
/* @__PURE__ */ (0,
|
|
30504
|
-
/* @__PURE__ */ (0,
|
|
30505
|
-
/* @__PURE__ */ (0,
|
|
30506
|
-
/* @__PURE__ */ (0,
|
|
30507
|
-
/* @__PURE__ */ (0,
|
|
30536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_recharts.BarChart, { data, title: "Leads", desc: "content", children: [
|
|
30537
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
|
|
30538
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.XAxis, { dataKey: "name" }),
|
|
30539
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.YAxis, {}),
|
|
30540
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
|
|
30541
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
30542
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
30508
30543
|
import_recharts.Bar,
|
|
30509
30544
|
{
|
|
30510
30545
|
dataKey: "value",
|
|
30511
30546
|
fill: "#00695C",
|
|
30512
30547
|
radius: [6, 6, 0, 0],
|
|
30513
30548
|
isAnimationActive: false,
|
|
30514
|
-
children: data.map((entry, index) => /* @__PURE__ */ (0,
|
|
30549
|
+
children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
30515
30550
|
"rect",
|
|
30516
30551
|
{
|
|
30517
30552
|
fill: entry.color || "#00695C"
|
|
@@ -30520,16 +30555,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
30520
30555
|
))
|
|
30521
30556
|
}
|
|
30522
30557
|
)
|
|
30523
|
-
] }) : /* @__PURE__ */ (0,
|
|
30524
|
-
/* @__PURE__ */ (0,
|
|
30525
|
-
/* @__PURE__ */ (0,
|
|
30526
|
-
/* @__PURE__ */ (0,
|
|
30558
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_recharts.AreaChart, { data, children: [
|
|
30559
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
30560
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
30561
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
30527
30562
|
] }) }),
|
|
30528
|
-
/* @__PURE__ */ (0,
|
|
30529
|
-
/* @__PURE__ */ (0,
|
|
30530
|
-
/* @__PURE__ */ (0,
|
|
30531
|
-
/* @__PURE__ */ (0,
|
|
30532
|
-
/* @__PURE__ */ (0,
|
|
30563
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
|
|
30564
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.XAxis, { dataKey: "name" }),
|
|
30565
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.YAxis, {}),
|
|
30566
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
|
|
30567
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
30533
30568
|
import_recharts.Area,
|
|
30534
30569
|
{
|
|
30535
30570
|
type: "monotone",
|
|
@@ -30542,12 +30577,12 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
30542
30577
|
)
|
|
30543
30578
|
] }) }) });
|
|
30544
30579
|
};
|
|
30545
|
-
var BarChart_default =
|
|
30580
|
+
var BarChart_default = import_react34.default.memo(ChartComponent);
|
|
30546
30581
|
|
|
30547
30582
|
// src/components/Chart/PieChart.tsx
|
|
30548
|
-
var
|
|
30583
|
+
var import_react35 = __toESM(require("react"));
|
|
30549
30584
|
var import_recharts2 = require("recharts");
|
|
30550
|
-
var
|
|
30585
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
30551
30586
|
var getRandomColor = () => {
|
|
30552
30587
|
const palette = [
|
|
30553
30588
|
"#2563eb",
|
|
@@ -30567,32 +30602,32 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30567
30602
|
const showLegends = props.showLegends ?? true;
|
|
30568
30603
|
const labelType = props.labelType || "inside";
|
|
30569
30604
|
const canvasMode = props.canvasMode;
|
|
30570
|
-
const data = (0,
|
|
30605
|
+
const data = (0, import_react35.useMemo)(() => {
|
|
30571
30606
|
if (!Array.isArray(props.data)) return [];
|
|
30572
30607
|
return props.data.map((item) => ({ ...item, color: getRandomColor() }));
|
|
30573
30608
|
}, [props.data]);
|
|
30574
|
-
const total = (0,
|
|
30609
|
+
const total = (0, import_react35.useMemo)(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
|
|
30575
30610
|
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
30576
|
-
const [mounted, setMounted] = (0,
|
|
30577
|
-
(0,
|
|
30611
|
+
const [mounted, setMounted] = (0, import_react35.useState)(false);
|
|
30612
|
+
(0, import_react35.useEffect)(() => {
|
|
30578
30613
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
30579
30614
|
return () => clearTimeout(timeout);
|
|
30580
30615
|
}, []);
|
|
30581
|
-
const renderLegends = (0,
|
|
30616
|
+
const renderLegends = (0, import_react35.useMemo)(() => {
|
|
30582
30617
|
if (!showLegends) return null;
|
|
30583
|
-
return /* @__PURE__ */ (0,
|
|
30618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_jsx_runtime65.Fragment, { children: data.map((d) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
30584
30619
|
"div",
|
|
30585
30620
|
{
|
|
30586
30621
|
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
30587
30622
|
children: [
|
|
30588
|
-
/* @__PURE__ */ (0,
|
|
30623
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
30589
30624
|
"span",
|
|
30590
30625
|
{
|
|
30591
30626
|
className: "inline-block w-[16px] h-[16px] rounded",
|
|
30592
30627
|
style: { backgroundColor: d.color }
|
|
30593
30628
|
}
|
|
30594
30629
|
),
|
|
30595
|
-
/* @__PURE__ */ (0,
|
|
30630
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
|
|
30596
30631
|
]
|
|
30597
30632
|
},
|
|
30598
30633
|
d.name
|
|
@@ -30600,24 +30635,24 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30600
30635
|
}, [data, showLegends]);
|
|
30601
30636
|
if (!mounted) return null;
|
|
30602
30637
|
if (loading || data.length === 0) {
|
|
30603
|
-
return /* @__PURE__ */ (0,
|
|
30638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
30604
30639
|
"div",
|
|
30605
30640
|
{
|
|
30606
30641
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
30607
30642
|
style,
|
|
30608
|
-
children: /* @__PURE__ */ (0,
|
|
30643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
|
|
30609
30644
|
}
|
|
30610
30645
|
);
|
|
30611
30646
|
}
|
|
30612
|
-
return /* @__PURE__ */ (0,
|
|
30647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
30613
30648
|
"div",
|
|
30614
30649
|
{
|
|
30615
30650
|
className: `relative flex flex-col items-center ${className}`,
|
|
30616
30651
|
style,
|
|
30617
30652
|
children: [
|
|
30618
|
-
/* @__PURE__ */ (0,
|
|
30619
|
-
/* @__PURE__ */ (0,
|
|
30620
|
-
/* @__PURE__ */ (0,
|
|
30653
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
|
|
30654
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts2.ResponsiveContainer, { width: "99%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_recharts2.PieChart, { children: [
|
|
30655
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
30621
30656
|
import_recharts2.Pie,
|
|
30622
30657
|
{
|
|
30623
30658
|
data,
|
|
@@ -30629,8 +30664,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30629
30664
|
labelLine: false,
|
|
30630
30665
|
isAnimationActive: false,
|
|
30631
30666
|
children: [
|
|
30632
|
-
data.map((entry, index) => /* @__PURE__ */ (0,
|
|
30633
|
-
/* @__PURE__ */ (0,
|
|
30667
|
+
data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts2.Cell, { fill: entry.color }, `cell-${index}`)),
|
|
30668
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
30634
30669
|
import_recharts2.LabelList,
|
|
30635
30670
|
{
|
|
30636
30671
|
dataKey: "value",
|
|
@@ -30643,14 +30678,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30643
30678
|
]
|
|
30644
30679
|
}
|
|
30645
30680
|
),
|
|
30646
|
-
/* @__PURE__ */ (0,
|
|
30681
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
30647
30682
|
import_recharts2.Tooltip,
|
|
30648
30683
|
{
|
|
30649
30684
|
formatter: (value, name) => [`${value}k`, name]
|
|
30650
30685
|
}
|
|
30651
30686
|
)
|
|
30652
30687
|
] }) }),
|
|
30653
|
-
/* @__PURE__ */ (0,
|
|
30688
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
30654
30689
|
"div",
|
|
30655
30690
|
{
|
|
30656
30691
|
className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 ${forceMobile ? "text-2xl" : "text-4xl"} font-bold text-[#000]`,
|
|
@@ -30661,18 +30696,18 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30661
30696
|
}
|
|
30662
30697
|
)
|
|
30663
30698
|
] }),
|
|
30664
|
-
/* @__PURE__ */ (0,
|
|
30699
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
|
|
30665
30700
|
]
|
|
30666
30701
|
}
|
|
30667
30702
|
);
|
|
30668
30703
|
};
|
|
30669
|
-
var PieChart_default =
|
|
30704
|
+
var PieChart_default = import_react35.default.memo(DonutChart);
|
|
30670
30705
|
|
|
30671
30706
|
// src/components/Blocks/EmailComposer.tsx
|
|
30672
|
-
var
|
|
30707
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
30673
30708
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
30674
|
-
return /* @__PURE__ */ (0,
|
|
30675
|
-
/* @__PURE__ */ (0,
|
|
30709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
30710
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30676
30711
|
"input",
|
|
30677
30712
|
{
|
|
30678
30713
|
type: "email",
|
|
@@ -30681,8 +30716,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30681
30716
|
required: true
|
|
30682
30717
|
}
|
|
30683
30718
|
) }),
|
|
30684
|
-
/* @__PURE__ */ (0,
|
|
30685
|
-
/* @__PURE__ */ (0,
|
|
30719
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
30720
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30686
30721
|
"input",
|
|
30687
30722
|
{
|
|
30688
30723
|
type: "email",
|
|
@@ -30693,7 +30728,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30693
30728
|
required: true
|
|
30694
30729
|
}
|
|
30695
30730
|
),
|
|
30696
|
-
!showCc && /* @__PURE__ */ (0,
|
|
30731
|
+
!showCc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30697
30732
|
"button",
|
|
30698
30733
|
{
|
|
30699
30734
|
onClick: () => setShowCc?.(true),
|
|
@@ -30701,7 +30736,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30701
30736
|
children: "Cc"
|
|
30702
30737
|
}
|
|
30703
30738
|
),
|
|
30704
|
-
!showBcc && /* @__PURE__ */ (0,
|
|
30739
|
+
!showBcc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30705
30740
|
"button",
|
|
30706
30741
|
{
|
|
30707
30742
|
onClick: () => setShowBcc?.(true),
|
|
@@ -30710,7 +30745,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30710
30745
|
}
|
|
30711
30746
|
)
|
|
30712
30747
|
] }) }),
|
|
30713
|
-
showCc && /* @__PURE__ */ (0,
|
|
30748
|
+
showCc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30714
30749
|
"input",
|
|
30715
30750
|
{
|
|
30716
30751
|
type: "text",
|
|
@@ -30720,7 +30755,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30720
30755
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
30721
30756
|
}
|
|
30722
30757
|
) }),
|
|
30723
|
-
showBcc && /* @__PURE__ */ (0,
|
|
30758
|
+
showBcc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30724
30759
|
"input",
|
|
30725
30760
|
{
|
|
30726
30761
|
type: "text",
|
|
@@ -30730,7 +30765,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30730
30765
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
30731
30766
|
}
|
|
30732
30767
|
) }),
|
|
30733
|
-
/* @__PURE__ */ (0,
|
|
30768
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30734
30769
|
"input",
|
|
30735
30770
|
{
|
|
30736
30771
|
type: "text",
|
|
@@ -30740,11 +30775,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30740
30775
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
30741
30776
|
}
|
|
30742
30777
|
) }),
|
|
30743
|
-
/* @__PURE__ */ (0,
|
|
30744
|
-
/* @__PURE__ */ (0,
|
|
30745
|
-
/* @__PURE__ */ (0,
|
|
30746
|
-
/* @__PURE__ */ (0,
|
|
30747
|
-
/* @__PURE__ */ (0,
|
|
30778
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(MyEditor, { value: body, onChange: setBody }) }),
|
|
30779
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
30780
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
30781
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
30782
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
30748
30783
|
] })
|
|
30749
30784
|
] }) });
|
|
30750
30785
|
}
|
|
@@ -30789,10 +30824,10 @@ function showSonnerToast({
|
|
|
30789
30824
|
// src/components/ui/sonner.tsx
|
|
30790
30825
|
var import_next_themes = require("next-themes");
|
|
30791
30826
|
var import_sonner2 = require("sonner");
|
|
30792
|
-
var
|
|
30827
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
30793
30828
|
var Toaster = ({ ...props }) => {
|
|
30794
30829
|
const { theme = "system" } = (0, import_next_themes.useTheme)();
|
|
30795
|
-
return /* @__PURE__ */ (0,
|
|
30830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
30796
30831
|
import_sonner2.Toaster,
|
|
30797
30832
|
{
|
|
30798
30833
|
theme,
|