@algorithm-shift/design-system 1.2.955 → 1.2.957
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 +616 -576
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +608 -568
- 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);
|
|
@@ -27842,8 +27853,14 @@ function useLazyDropdown(config) {
|
|
|
27842
27853
|
(0, import_react19.useEffect)(() => {
|
|
27843
27854
|
const cfg = configRef.current;
|
|
27844
27855
|
if (!cfg.enabled || !cfg.value || cfg.dataSource !== "api" || !cfg.apiUrl) return;
|
|
27845
|
-
|
|
27846
|
-
|
|
27856
|
+
if (!!cfg.isMultiSelect) {
|
|
27857
|
+
const values = String(cfg.value).split(",").map((v) => v.trim());
|
|
27858
|
+
const valueExists = values.every((val) => options.some((opt) => opt.value === val));
|
|
27859
|
+
if (valueExists) return;
|
|
27860
|
+
} else {
|
|
27861
|
+
const valueExists = options.some((opt) => opt.value === cfg.value);
|
|
27862
|
+
if (valueExists) return;
|
|
27863
|
+
}
|
|
27847
27864
|
fetchValueItem();
|
|
27848
27865
|
}, [config.value, config.dataKey, config.apiUrl, config.dataSource, transformToOptions]);
|
|
27849
27866
|
const loadMore = (0, import_react19.useCallback)(() => {
|
|
@@ -27926,7 +27943,7 @@ function LazySelectDropdown({
|
|
|
27926
27943
|
value,
|
|
27927
27944
|
axiosInstance
|
|
27928
27945
|
});
|
|
27929
|
-
const selectedOption = lazyOptions.find((opt) => opt.value === value);
|
|
27946
|
+
const selectedOption = (0, import_react20.useMemo)(() => lazyOptions.find((opt) => opt.value === value), [lazyOptions, value]);
|
|
27930
27947
|
(0, import_react20.useEffect)(() => {
|
|
27931
27948
|
const handleClickOutside = (e) => {
|
|
27932
27949
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
@@ -27961,7 +27978,16 @@ function LazySelectDropdown({
|
|
|
27961
27978
|
};
|
|
27962
27979
|
const handleFocus = () => {
|
|
27963
27980
|
if (!disabled) setIsOpen(true);
|
|
27964
|
-
|
|
27981
|
+
if (lazyOptions.length === 0)
|
|
27982
|
+
loadPage(1, "");
|
|
27983
|
+
};
|
|
27984
|
+
const handleRemoveSelection = (e) => {
|
|
27985
|
+
e.preventDefault();
|
|
27986
|
+
e.stopPropagation();
|
|
27987
|
+
onChange?.("", id || "");
|
|
27988
|
+
setSearchTerm("");
|
|
27989
|
+
reset();
|
|
27990
|
+
search("");
|
|
27965
27991
|
};
|
|
27966
27992
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { ref: dropdownRef, className: "relative w-full", children: [
|
|
27967
27993
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -27971,7 +27997,7 @@ function LazySelectDropdown({
|
|
|
27971
27997
|
id,
|
|
27972
27998
|
name: id,
|
|
27973
27999
|
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",
|
|
28000
|
+
"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
28001
|
disabled ? "bg-gray-100 cursor-not-allowed" : "bg-white cursor-pointer",
|
|
27976
28002
|
className,
|
|
27977
28003
|
errorMessage ? "border-red-500" : ""
|
|
@@ -27984,6 +28010,16 @@ function LazySelectDropdown({
|
|
|
27984
28010
|
disabled
|
|
27985
28011
|
}
|
|
27986
28012
|
),
|
|
28013
|
+
selectedOption && !disabled && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
28014
|
+
"button",
|
|
28015
|
+
{
|
|
28016
|
+
type: "button",
|
|
28017
|
+
"aria-label": "Clear selection",
|
|
28018
|
+
onClick: handleRemoveSelection,
|
|
28019
|
+
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",
|
|
28020
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SquareX, { className: "h-5 w-5 pointer-events-none" })
|
|
28021
|
+
}
|
|
28022
|
+
),
|
|
27987
28023
|
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
|
|
27988
28024
|
isOpen && !disabled && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
27989
28025
|
"div",
|
|
@@ -28706,343 +28742,231 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28706
28742
|
var TextInputGroup_default = TextInputGroup;
|
|
28707
28743
|
|
|
28708
28744
|
// 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"));
|
|
28745
|
+
var import_react29 = require("react");
|
|
28716
28746
|
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({
|
|
28747
|
+
function LazyMultiSelectDropdown({
|
|
28748
|
+
options = [],
|
|
28749
|
+
value = [],
|
|
28750
|
+
onChange,
|
|
28751
|
+
placeholder,
|
|
28728
28752
|
className,
|
|
28729
|
-
|
|
28753
|
+
id,
|
|
28754
|
+
disabled,
|
|
28755
|
+
readOnly,
|
|
28756
|
+
source,
|
|
28757
|
+
apiUrl,
|
|
28758
|
+
pageSize,
|
|
28759
|
+
dataKey = "id",
|
|
28760
|
+
dataLabel = "name",
|
|
28761
|
+
errorMessage,
|
|
28762
|
+
axiosInstance,
|
|
28763
|
+
outputFormat = "array"
|
|
28730
28764
|
}) {
|
|
28731
|
-
|
|
28732
|
-
|
|
28733
|
-
|
|
28734
|
-
|
|
28735
|
-
|
|
28736
|
-
|
|
28737
|
-
|
|
28738
|
-
|
|
28739
|
-
|
|
28765
|
+
const [isOpen, setIsOpen] = (0, import_react29.useState)(false);
|
|
28766
|
+
const [searchTerm, setSearchTerm] = (0, import_react29.useState)("");
|
|
28767
|
+
const dropdownRef = (0, import_react29.useRef)(null);
|
|
28768
|
+
const observerTarget = (0, import_react29.useRef)(null);
|
|
28769
|
+
const {
|
|
28770
|
+
options: lazyOptions,
|
|
28771
|
+
loading,
|
|
28772
|
+
hasMore,
|
|
28773
|
+
loadMore,
|
|
28774
|
+
search,
|
|
28775
|
+
reset,
|
|
28776
|
+
loadPage
|
|
28777
|
+
} = useLazyDropdown({
|
|
28778
|
+
enabled: true,
|
|
28779
|
+
dataSource: source || "",
|
|
28780
|
+
apiUrl,
|
|
28781
|
+
pageSize: pageSize || 10,
|
|
28782
|
+
dataKey,
|
|
28783
|
+
dataLabel,
|
|
28784
|
+
initialData: options || [],
|
|
28785
|
+
value,
|
|
28786
|
+
axiosInstance,
|
|
28787
|
+
isMultiSelect: true
|
|
28788
|
+
});
|
|
28789
|
+
const ensureUnique = (arr) => {
|
|
28790
|
+
return Array.from(new Set(arr));
|
|
28791
|
+
};
|
|
28792
|
+
const convertOutput = (values) => {
|
|
28793
|
+
const unique = ensureUnique(values);
|
|
28794
|
+
switch (outputFormat) {
|
|
28795
|
+
case "comma":
|
|
28796
|
+
return unique.join(",");
|
|
28797
|
+
case "semicolon":
|
|
28798
|
+
return unique.join(";");
|
|
28799
|
+
default:
|
|
28800
|
+
return unique;
|
|
28740
28801
|
}
|
|
28741
|
-
|
|
28742
|
-
|
|
28743
|
-
|
|
28744
|
-
|
|
28745
|
-
|
|
28746
|
-
|
|
28747
|
-
|
|
28748
|
-
|
|
28749
|
-
|
|
28750
|
-
|
|
28802
|
+
};
|
|
28803
|
+
const normalizeInput = (value2) => {
|
|
28804
|
+
let arr = [];
|
|
28805
|
+
if (Array.isArray(value2)) {
|
|
28806
|
+
arr = value2;
|
|
28807
|
+
} else if (typeof value2 === "string") {
|
|
28808
|
+
if (!value2.trim()) return [];
|
|
28809
|
+
if (value2.includes(";")) arr = value2.split(";").map((v) => v.trim());
|
|
28810
|
+
else if (value2.includes(",")) arr = value2.split(",").map((v) => v.trim());
|
|
28811
|
+
else arr = [value2.trim()];
|
|
28812
|
+
}
|
|
28813
|
+
return ensureUnique(arr);
|
|
28814
|
+
};
|
|
28815
|
+
const normalizedValue = normalizeInput(value);
|
|
28816
|
+
const selectedOptions = (0, import_react29.useMemo)(() => {
|
|
28817
|
+
return lazyOptions.filter((opt) => normalizedValue.includes(opt.value));
|
|
28818
|
+
}, [lazyOptions, normalizedValue]);
|
|
28819
|
+
(0, import_react29.useEffect)(() => {
|
|
28820
|
+
const handleClick = (e) => {
|
|
28821
|
+
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
28822
|
+
setIsOpen(false);
|
|
28823
|
+
}
|
|
28824
|
+
};
|
|
28825
|
+
document.addEventListener("mousedown", handleClick);
|
|
28826
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
28827
|
+
}, []);
|
|
28828
|
+
(0, import_react29.useEffect)(() => {
|
|
28829
|
+
if (!isOpen || !hasMore || loading) return;
|
|
28830
|
+
const obs = new IntersectionObserver(
|
|
28831
|
+
(entries) => {
|
|
28832
|
+
if (entries[0].isIntersecting) loadMore();
|
|
28833
|
+
},
|
|
28834
|
+
{ threshold: 0.1 }
|
|
28835
|
+
);
|
|
28836
|
+
if (observerTarget.current) obs.observe(observerTarget.current);
|
|
28837
|
+
return () => obs.disconnect();
|
|
28838
|
+
}, [isOpen, hasMore, loading, loadMore]);
|
|
28839
|
+
const handleSearch = (e) => {
|
|
28840
|
+
const term = e.target.value;
|
|
28841
|
+
setSearchTerm(term);
|
|
28842
|
+
search(term);
|
|
28843
|
+
};
|
|
28844
|
+
const toggleSelect = (val) => {
|
|
28845
|
+
let updated;
|
|
28846
|
+
if (normalizedValue.includes(val)) {
|
|
28847
|
+
updated = normalizedValue.filter((v) => v !== val);
|
|
28848
|
+
} else {
|
|
28849
|
+
updated = ensureUnique([...normalizedValue, val]);
|
|
28850
|
+
}
|
|
28851
|
+
onChange?.(convertOutput(updated), id);
|
|
28852
|
+
};
|
|
28853
|
+
const removeTag = (val) => {
|
|
28854
|
+
const updated = normalizedValue.filter((v) => v !== val);
|
|
28855
|
+
onChange?.(convertOutput(updated), id);
|
|
28856
|
+
};
|
|
28857
|
+
const handleFocus = () => {
|
|
28858
|
+
if (!disabled) setIsOpen(true);
|
|
28859
|
+
if (lazyOptions.length === 0) loadPage(1, "");
|
|
28860
|
+
};
|
|
28861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { ref: dropdownRef, className: "relative w-full", children: [
|
|
28751
28862
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
28752
|
-
|
|
28863
|
+
"div",
|
|
28753
28864
|
{
|
|
28754
|
-
|
|
28865
|
+
onClick: handleFocus,
|
|
28755
28866
|
className: cn(
|
|
28756
|
-
"
|
|
28867
|
+
"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",
|
|
28868
|
+
disabled && "bg-gray-100 cursor-not-allowed",
|
|
28869
|
+
errorMessage && "border-red-500",
|
|
28757
28870
|
className
|
|
28758
28871
|
),
|
|
28759
|
-
...props,
|
|
28760
28872
|
children: [
|
|
28761
|
-
|
|
28762
|
-
|
|
28763
|
-
DialogPrimitive.Close,
|
|
28873
|
+
selectedOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
28874
|
+
"span",
|
|
28764
28875
|
{
|
|
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",
|
|
28876
|
+
className: "bg-blue-100 text-blue-700 px-2 py-1 rounded-md text-xs flex items-center gap-1",
|
|
28767
28877
|
children: [
|
|
28768
|
-
|
|
28769
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28878
|
+
opt.label,
|
|
28879
|
+
!disabled && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28880
|
+
"button",
|
|
28881
|
+
{
|
|
28882
|
+
type: "button",
|
|
28883
|
+
onClick: (e) => {
|
|
28884
|
+
e.stopPropagation();
|
|
28885
|
+
removeTag(opt.value);
|
|
28886
|
+
},
|
|
28887
|
+
className: "hover:text-red-600",
|
|
28888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(X, { size: 12 })
|
|
28889
|
+
}
|
|
28890
|
+
)
|
|
28770
28891
|
]
|
|
28892
|
+
},
|
|
28893
|
+
opt.value
|
|
28894
|
+
)),
|
|
28895
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28896
|
+
"input",
|
|
28897
|
+
{
|
|
28898
|
+
type: "text",
|
|
28899
|
+
placeholder: selectedOptions.length ? "" : placeholder,
|
|
28900
|
+
className: "flex-1 min-w-[60px] p-1 outline-none",
|
|
28901
|
+
value: isOpen ? searchTerm : "",
|
|
28902
|
+
onChange: handleSearch,
|
|
28903
|
+
readOnly,
|
|
28904
|
+
disabled
|
|
28771
28905
|
}
|
|
28772
28906
|
)
|
|
28773
28907
|
]
|
|
28774
28908
|
}
|
|
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,
|
|
28909
|
+
),
|
|
28910
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
|
|
28911
|
+
isOpen && !disabled && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28912
|
+
"div",
|
|
28987
28913
|
{
|
|
28988
|
-
|
|
28989
|
-
className: "
|
|
28990
|
-
|
|
28991
|
-
|
|
28992
|
-
|
|
28914
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
28915
|
+
className: "absolute z-[999] mt-1 bg-white border rounded-lg shadow-lg max-h-60 overflow-y-auto",
|
|
28916
|
+
style: {
|
|
28917
|
+
zIndex: 900,
|
|
28918
|
+
width: dropdownRef.current?.offsetWidth,
|
|
28919
|
+
top: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().bottom + window.scrollY : 0,
|
|
28920
|
+
left: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().left + window.scrollX : 0
|
|
28993
28921
|
},
|
|
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
|
-
] })
|
|
28922
|
+
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: [
|
|
28923
|
+
lazyOptions.map((option) => {
|
|
28924
|
+
const isSelected = normalizedValue.includes(option.value);
|
|
28925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
28926
|
+
"div",
|
|
28927
|
+
{
|
|
28928
|
+
onClick: () => toggleSelect(option.value),
|
|
28929
|
+
className: cn(
|
|
28930
|
+
"px-3 py-2 text-sm cursor-pointer hover:bg-blue-50 flex justify-between",
|
|
28931
|
+
isSelected && "bg-blue-100"
|
|
28932
|
+
),
|
|
28933
|
+
children: [
|
|
28934
|
+
option.label,
|
|
28935
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SquareX, { size: 16 })
|
|
28936
|
+
]
|
|
28937
|
+
},
|
|
28938
|
+
option.value
|
|
28939
|
+
);
|
|
28940
|
+
}),
|
|
28941
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28942
|
+
"div",
|
|
28943
|
+
{
|
|
28944
|
+
ref: observerTarget,
|
|
28945
|
+
className: "px-3 py-3 text-center text-gray-400 text-sm",
|
|
28946
|
+
children: loading ? "Loading\u2026" : "Scroll for more\u2026"
|
|
28947
|
+
}
|
|
28948
|
+
)
|
|
28949
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "px-3 py-4 text-center text-gray-500", children: "No results" })
|
|
29024
28950
|
}
|
|
29025
|
-
)
|
|
29026
|
-
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
28951
|
+
) })
|
|
29027
28952
|
] });
|
|
29028
|
-
}
|
|
29029
|
-
var MultiSelect_default = MultiSelect;
|
|
28953
|
+
}
|
|
29030
28954
|
|
|
29031
28955
|
// src/components/ui/data-table.tsx
|
|
29032
|
-
var
|
|
28956
|
+
var React9 = __toESM(require("react"));
|
|
29033
28957
|
var import_free_solid_svg_icons2 = require("@fortawesome/free-solid-svg-icons");
|
|
29034
28958
|
var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
|
|
29035
28959
|
var import_react_table2 = require("@tanstack/react-table");
|
|
29036
28960
|
|
|
29037
28961
|
// src/components/ui/table.tsx
|
|
29038
|
-
var
|
|
28962
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
29039
28963
|
function Table3({ className, ...props }) {
|
|
29040
|
-
return /* @__PURE__ */ (0,
|
|
28964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29041
28965
|
"div",
|
|
29042
28966
|
{
|
|
29043
28967
|
"data-slot": "table-container",
|
|
29044
28968
|
className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
|
|
29045
|
-
children: /* @__PURE__ */ (0,
|
|
28969
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29046
28970
|
"table",
|
|
29047
28971
|
{
|
|
29048
28972
|
"data-slot": "table",
|
|
@@ -29054,7 +28978,7 @@ function Table3({ className, ...props }) {
|
|
|
29054
28978
|
);
|
|
29055
28979
|
}
|
|
29056
28980
|
function TableHeader({ className, ...props }) {
|
|
29057
|
-
return /* @__PURE__ */ (0,
|
|
28981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29058
28982
|
"thead",
|
|
29059
28983
|
{
|
|
29060
28984
|
"data-slot": "table-header",
|
|
@@ -29067,7 +28991,7 @@ function TableHeader({ className, ...props }) {
|
|
|
29067
28991
|
);
|
|
29068
28992
|
}
|
|
29069
28993
|
function TableBody({ className, ...props }) {
|
|
29070
|
-
return /* @__PURE__ */ (0,
|
|
28994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29071
28995
|
"tbody",
|
|
29072
28996
|
{
|
|
29073
28997
|
"data-slot": "table-body",
|
|
@@ -29080,7 +29004,7 @@ function TableBody({ className, ...props }) {
|
|
|
29080
29004
|
);
|
|
29081
29005
|
}
|
|
29082
29006
|
function TableRow({ className, ...props }) {
|
|
29083
|
-
return /* @__PURE__ */ (0,
|
|
29007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29084
29008
|
"tr",
|
|
29085
29009
|
{
|
|
29086
29010
|
"data-slot": "table-row",
|
|
@@ -29093,7 +29017,7 @@ function TableRow({ className, ...props }) {
|
|
|
29093
29017
|
);
|
|
29094
29018
|
}
|
|
29095
29019
|
function TableHead({ className, ...props }) {
|
|
29096
|
-
return /* @__PURE__ */ (0,
|
|
29020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29097
29021
|
"th",
|
|
29098
29022
|
{
|
|
29099
29023
|
"data-slot": "table-head",
|
|
@@ -29106,7 +29030,7 @@ function TableHead({ className, ...props }) {
|
|
|
29106
29030
|
);
|
|
29107
29031
|
}
|
|
29108
29032
|
function TableCell({ className, ...props }) {
|
|
29109
|
-
return /* @__PURE__ */ (0,
|
|
29033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29110
29034
|
"td",
|
|
29111
29035
|
{
|
|
29112
29036
|
"data-slot": "table-cell",
|
|
@@ -29123,7 +29047,7 @@ function TableCell({ className, ...props }) {
|
|
|
29123
29047
|
var import_react_table = require("@tanstack/react-table");
|
|
29124
29048
|
|
|
29125
29049
|
// src/lib/table/cellRendererFactory.tsx
|
|
29126
|
-
var
|
|
29050
|
+
var import_react30 = __toESM(require("react"));
|
|
29127
29051
|
var import_image3 = __toESM(require("next/image"));
|
|
29128
29052
|
|
|
29129
29053
|
// src/lib/dayjs-setup.ts
|
|
@@ -29172,7 +29096,7 @@ var valueFormatter = (value, format2, customFormatters = {}) => {
|
|
|
29172
29096
|
};
|
|
29173
29097
|
|
|
29174
29098
|
// src/lib/table/cellRendererFactory.tsx
|
|
29175
|
-
var
|
|
29099
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
29176
29100
|
var getContrastColor = (bg) => {
|
|
29177
29101
|
let c = bg.trim().toUpperCase();
|
|
29178
29102
|
if (/^#([a-fA-F0-9]{3})$/.test(c)) {
|
|
@@ -29206,9 +29130,9 @@ var getContrastColor = (bg) => {
|
|
|
29206
29130
|
};
|
|
29207
29131
|
var sanitizeValue = (val) => {
|
|
29208
29132
|
if (val == null) return null;
|
|
29209
|
-
if (
|
|
29133
|
+
if (import_react30.default.isValidElement(val)) return val;
|
|
29210
29134
|
if (typeof val === "string" || typeof val === "number") return val;
|
|
29211
|
-
if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ (0,
|
|
29135
|
+
if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react30.default.Fragment, { children: sanitizeValue(v) }, i));
|
|
29212
29136
|
if (typeof val === "object") {
|
|
29213
29137
|
if ("name" in val && typeof val.name === "string") return val.name;
|
|
29214
29138
|
if ("label" in val && typeof val.label === "string") return val.label;
|
|
@@ -29225,13 +29149,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29225
29149
|
switch (renderer) {
|
|
29226
29150
|
/* -------------------- BASIC -------------------- */
|
|
29227
29151
|
case "text":
|
|
29228
|
-
return /* @__PURE__ */ (0,
|
|
29152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: row?.[rendererProps?.rowField] || formattedValue });
|
|
29229
29153
|
case "number":
|
|
29230
|
-
return /* @__PURE__ */ (0,
|
|
29154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "tabular-nums text-right", children: valueFormatter(row?.[rendererProps?.rowField] || value, "number:2") });
|
|
29231
29155
|
case "date":
|
|
29232
|
-
return /* @__PURE__ */ (0,
|
|
29156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: valueFormatter(row?.[rendererProps?.rowField] || value, format2) });
|
|
29233
29157
|
case "link":
|
|
29234
|
-
return /* @__PURE__ */ (0,
|
|
29158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29235
29159
|
"a",
|
|
29236
29160
|
{
|
|
29237
29161
|
href: `${rendererProps?.prefix || ""}${row?.[rendererProps?.rowField] || formattedValue}`,
|
|
@@ -29243,7 +29167,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29243
29167
|
);
|
|
29244
29168
|
/* -------------------- VISUAL -------------------- */
|
|
29245
29169
|
case "image":
|
|
29246
|
-
return /* @__PURE__ */ (0,
|
|
29170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29247
29171
|
import_image3.default,
|
|
29248
29172
|
{
|
|
29249
29173
|
src: row?.[rendererProps?.rowField] || formattedValue || rendererProps?.fallback || "/placeholder.png",
|
|
@@ -29260,7 +29184,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29260
29184
|
case "icon":
|
|
29261
29185
|
const maybeIcon = lucide_react_exports[rendererProps?.icon];
|
|
29262
29186
|
const IconComponent = typeof maybeIcon === "function" ? maybeIcon : Star;
|
|
29263
|
-
return /* @__PURE__ */ (0,
|
|
29187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29264
29188
|
IconComponent,
|
|
29265
29189
|
{
|
|
29266
29190
|
size: rendererProps?.size || 16,
|
|
@@ -29272,7 +29196,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29272
29196
|
const color = rendererProps?.colorMap?.[formattedValue] || rendererProps?.color || "gray";
|
|
29273
29197
|
if (!formattedValue) return null;
|
|
29274
29198
|
const textColor = getContrastColor(color);
|
|
29275
|
-
return /* @__PURE__ */ (0,
|
|
29199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29276
29200
|
"span",
|
|
29277
29201
|
{
|
|
29278
29202
|
className: `inline-block px-2 py-1 text-xs rounded-full bg-${color}-100 text-${textColor}-700 ${rendererProps?.className || ""}`,
|
|
@@ -29287,13 +29211,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29287
29211
|
const IconComponent2 = typeof maybeIcon2 === "function" ? maybeIcon2 : Star;
|
|
29288
29212
|
if (!formattedValue) return null;
|
|
29289
29213
|
const textColor = getContrastColor(color);
|
|
29290
|
-
return /* @__PURE__ */ (0,
|
|
29214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
29291
29215
|
"span",
|
|
29292
29216
|
{
|
|
29293
29217
|
className: `inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-[${color}]-100 text-[${textColor}]-700`,
|
|
29294
29218
|
style: { backgroundColor: color, color: textColor },
|
|
29295
29219
|
children: [
|
|
29296
|
-
rendererProps?.icon && /* @__PURE__ */ (0,
|
|
29220
|
+
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
29221
|
formattedValue
|
|
29298
29222
|
]
|
|
29299
29223
|
}
|
|
@@ -29301,7 +29225,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29301
29225
|
}
|
|
29302
29226
|
/* -------------------- INTERACTIVE -------------------- */
|
|
29303
29227
|
case "button":
|
|
29304
|
-
return /* @__PURE__ */ (0,
|
|
29228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29305
29229
|
"button",
|
|
29306
29230
|
{
|
|
29307
29231
|
onClick: () => rendererProps?.onClick?.(row, formattedValue),
|
|
@@ -29310,8 +29234,8 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29310
29234
|
}
|
|
29311
29235
|
);
|
|
29312
29236
|
case "switch":
|
|
29313
|
-
return /* @__PURE__ */ (0,
|
|
29314
|
-
/* @__PURE__ */ (0,
|
|
29237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "inline-flex items-center cursor-pointer", children: [
|
|
29238
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29315
29239
|
"input",
|
|
29316
29240
|
{
|
|
29317
29241
|
type: "checkbox",
|
|
@@ -29320,10 +29244,10 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29320
29244
|
className: "sr-only peer"
|
|
29321
29245
|
}
|
|
29322
29246
|
),
|
|
29323
|
-
/* @__PURE__ */ (0,
|
|
29247
|
+
/* @__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
29248
|
] });
|
|
29325
29249
|
case "progress":
|
|
29326
|
-
return /* @__PURE__ */ (0,
|
|
29250
|
+
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
29251
|
"div",
|
|
29328
29252
|
{
|
|
29329
29253
|
className: "bg-blue-600 h-2 rounded-full transition-all",
|
|
@@ -29332,7 +29256,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29332
29256
|
) });
|
|
29333
29257
|
case "rating": {
|
|
29334
29258
|
const stars = Math.round(Number(row?.[rendererProps?.rowField] || formattedValue) || 0);
|
|
29335
|
-
return /* @__PURE__ */ (0,
|
|
29259
|
+
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
29260
|
Star,
|
|
29337
29261
|
{
|
|
29338
29262
|
size: 16,
|
|
@@ -29346,7 +29270,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29346
29270
|
case "custom": {
|
|
29347
29271
|
const CustomRenderer = customRenderers[rendererProps?.customRendererId] || customRenderers[rendererProps?.rendererId];
|
|
29348
29272
|
if (CustomRenderer)
|
|
29349
|
-
return /* @__PURE__ */ (0,
|
|
29273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29350
29274
|
CustomRenderer,
|
|
29351
29275
|
{
|
|
29352
29276
|
value: formattedValue,
|
|
@@ -29354,11 +29278,11 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29354
29278
|
...rendererProps
|
|
29355
29279
|
}
|
|
29356
29280
|
);
|
|
29357
|
-
return /* @__PURE__ */ (0,
|
|
29281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: "Missing custom renderer" });
|
|
29358
29282
|
}
|
|
29359
29283
|
/* -------------------- DEFAULT -------------------- */
|
|
29360
29284
|
default:
|
|
29361
|
-
return /* @__PURE__ */ (0,
|
|
29285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: formattedValue });
|
|
29362
29286
|
}
|
|
29363
29287
|
};
|
|
29364
29288
|
|
|
@@ -29407,7 +29331,7 @@ var useDynamicColumns = (config, customRenderers = {}, customFormatters = {}) =>
|
|
|
29407
29331
|
};
|
|
29408
29332
|
|
|
29409
29333
|
// src/components/ui/data-table.tsx
|
|
29410
|
-
var
|
|
29334
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
29411
29335
|
function DataTable({
|
|
29412
29336
|
columns,
|
|
29413
29337
|
data,
|
|
@@ -29426,10 +29350,10 @@ function DataTable({
|
|
|
29426
29350
|
onDeleteRow,
|
|
29427
29351
|
rowActions
|
|
29428
29352
|
}) {
|
|
29429
|
-
const [columnFilters, setColumnFilters] =
|
|
29430
|
-
const [columnVisibility, setColumnVisibility] =
|
|
29431
|
-
const [manualSort, setManualSort] =
|
|
29432
|
-
const [searchTerm, setSearchTerm] =
|
|
29353
|
+
const [columnFilters, setColumnFilters] = React9.useState([]);
|
|
29354
|
+
const [columnVisibility, setColumnVisibility] = React9.useState({});
|
|
29355
|
+
const [manualSort, setManualSort] = React9.useState(null);
|
|
29356
|
+
const [searchTerm, setSearchTerm] = React9.useState("");
|
|
29433
29357
|
const tableData = Array.isArray(data) ? data : [];
|
|
29434
29358
|
const dynamicCols = useDynamicColumns({ columns });
|
|
29435
29359
|
const table = (0, import_react_table2.useReactTable)({
|
|
@@ -29480,11 +29404,11 @@ function DataTable({
|
|
|
29480
29404
|
return [];
|
|
29481
29405
|
};
|
|
29482
29406
|
const pageCount = table.getPageCount() === 0 ? 1 : table.getPageCount();
|
|
29483
|
-
return /* @__PURE__ */ (0,
|
|
29484
|
-
/* @__PURE__ */ (0,
|
|
29485
|
-
globalSearch && /* @__PURE__ */ (0,
|
|
29486
|
-
/* @__PURE__ */ (0,
|
|
29487
|
-
/* @__PURE__ */ (0,
|
|
29407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "overflow-hidden rounded-md w-full", children: [
|
|
29408
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
|
|
29409
|
+
globalSearch && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
|
|
29410
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "relative w-full", children: [
|
|
29411
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29488
29412
|
"input",
|
|
29489
29413
|
{
|
|
29490
29414
|
type: "text",
|
|
@@ -29499,9 +29423,9 @@ function DataTable({
|
|
|
29499
29423
|
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]"
|
|
29500
29424
|
}
|
|
29501
29425
|
),
|
|
29502
|
-
/* @__PURE__ */ (0,
|
|
29426
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
|
|
29503
29427
|
] }),
|
|
29504
|
-
/* @__PURE__ */ (0,
|
|
29428
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29505
29429
|
Button,
|
|
29506
29430
|
{
|
|
29507
29431
|
size: "sm",
|
|
@@ -29511,8 +29435,8 @@ function DataTable({
|
|
|
29511
29435
|
}
|
|
29512
29436
|
)
|
|
29513
29437
|
] }),
|
|
29514
|
-
/* @__PURE__ */ (0,
|
|
29515
|
-
/* @__PURE__ */ (0,
|
|
29438
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Popover, { children: [
|
|
29439
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29516
29440
|
Button,
|
|
29517
29441
|
{
|
|
29518
29442
|
variant: "outline",
|
|
@@ -29521,10 +29445,10 @@ function DataTable({
|
|
|
29521
29445
|
children: "Manage Columns"
|
|
29522
29446
|
}
|
|
29523
29447
|
) }),
|
|
29524
|
-
/* @__PURE__ */ (0,
|
|
29525
|
-
/* @__PURE__ */ (0,
|
|
29526
|
-
/* @__PURE__ */ (0,
|
|
29527
|
-
/* @__PURE__ */ (0,
|
|
29448
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
|
|
29449
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
|
|
29450
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
|
|
29451
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29528
29452
|
"input",
|
|
29529
29453
|
{
|
|
29530
29454
|
type: "checkbox",
|
|
@@ -29543,8 +29467,8 @@ function DataTable({
|
|
|
29543
29467
|
),
|
|
29544
29468
|
"Toggle All"
|
|
29545
29469
|
] }),
|
|
29546
|
-
table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0,
|
|
29547
|
-
/* @__PURE__ */ (0,
|
|
29470
|
+
table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
29471
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29548
29472
|
"input",
|
|
29549
29473
|
{
|
|
29550
29474
|
type: "checkbox",
|
|
@@ -29557,12 +29481,12 @@ function DataTable({
|
|
|
29557
29481
|
] })
|
|
29558
29482
|
] })
|
|
29559
29483
|
] }),
|
|
29560
|
-
/* @__PURE__ */ (0,
|
|
29561
|
-
/* @__PURE__ */ (0,
|
|
29484
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Table3, { className: "table-fixed", children: [
|
|
29485
|
+
/* @__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) => {
|
|
29562
29486
|
const canSort = header.column.getCanSort();
|
|
29563
29487
|
const canFilter = header.column.getCanFilter();
|
|
29564
29488
|
const sortDir = manualSort?.key === header.column.id ? manualSort.dir : null;
|
|
29565
|
-
return /* @__PURE__ */ (0,
|
|
29489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29566
29490
|
TableHead,
|
|
29567
29491
|
{
|
|
29568
29492
|
className: "relative select-none",
|
|
@@ -29571,8 +29495,8 @@ function DataTable({
|
|
|
29571
29495
|
minWidth: header.column.columnDef.minSize,
|
|
29572
29496
|
maxWidth: header.column.columnDef.maxSize
|
|
29573
29497
|
},
|
|
29574
|
-
children: /* @__PURE__ */ (0,
|
|
29575
|
-
/* @__PURE__ */ (0,
|
|
29498
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
29499
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
29576
29500
|
"span",
|
|
29577
29501
|
{
|
|
29578
29502
|
className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
|
|
@@ -29584,32 +29508,32 @@ function DataTable({
|
|
|
29584
29508
|
},
|
|
29585
29509
|
children: [
|
|
29586
29510
|
(0, import_react_table2.flexRender)(header.column.columnDef.header, header.getContext()),
|
|
29587
|
-
canSort && /* @__PURE__ */ (0,
|
|
29588
|
-
sortDir === "asc" && /* @__PURE__ */ (0,
|
|
29589
|
-
sortDir === "desc" && /* @__PURE__ */ (0,
|
|
29590
|
-
!sortDir && /* @__PURE__ */ (0,
|
|
29511
|
+
canSort && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
29512
|
+
sortDir === "asc" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowUp, { size: 14, className: "text-gray-500" }),
|
|
29513
|
+
sortDir === "desc" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowDown, { size: 14, className: "text-gray-500" }),
|
|
29514
|
+
!sortDir && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowUpDown, { size: 14, className: "text-gray-400" })
|
|
29591
29515
|
] })
|
|
29592
29516
|
]
|
|
29593
29517
|
}
|
|
29594
29518
|
),
|
|
29595
|
-
canFilter && /* @__PURE__ */ (0,
|
|
29596
|
-
/* @__PURE__ */ (0,
|
|
29519
|
+
canFilter && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Popover, { children: [
|
|
29520
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29597
29521
|
"span",
|
|
29598
29522
|
{
|
|
29599
29523
|
role: "presentation",
|
|
29600
29524
|
className: "pl-5 cursor-pointer",
|
|
29601
29525
|
onClick: (e) => e.stopPropagation(),
|
|
29602
|
-
children: /* @__PURE__ */ (0,
|
|
29526
|
+
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" })
|
|
29603
29527
|
}
|
|
29604
29528
|
) }),
|
|
29605
|
-
/* @__PURE__ */ (0,
|
|
29529
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29606
29530
|
PopoverContent,
|
|
29607
29531
|
{
|
|
29608
29532
|
align: "center",
|
|
29609
29533
|
sideOffset: 14,
|
|
29610
29534
|
className: "w-50 p-3 z-[200] border-gray-300",
|
|
29611
29535
|
avoidCollisions: true,
|
|
29612
|
-
children: /* @__PURE__ */ (0,
|
|
29536
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
29613
29537
|
"form",
|
|
29614
29538
|
{
|
|
29615
29539
|
onSubmit: (e) => {
|
|
@@ -29622,8 +29546,8 @@ function DataTable({
|
|
|
29622
29546
|
},
|
|
29623
29547
|
className: "space-y-2",
|
|
29624
29548
|
children: [
|
|
29625
|
-
/* @__PURE__ */ (0,
|
|
29626
|
-
/* @__PURE__ */ (0,
|
|
29549
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
|
|
29550
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29627
29551
|
"input",
|
|
29628
29552
|
{
|
|
29629
29553
|
name: "filter",
|
|
@@ -29633,7 +29557,7 @@ function DataTable({
|
|
|
29633
29557
|
autoComplete: "off"
|
|
29634
29558
|
}
|
|
29635
29559
|
),
|
|
29636
|
-
/* @__PURE__ */ (0,
|
|
29560
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "justify-end flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29637
29561
|
Button,
|
|
29638
29562
|
{
|
|
29639
29563
|
type: "submit",
|
|
@@ -29652,11 +29576,11 @@ function DataTable({
|
|
|
29652
29576
|
`header-${header.id}-${index}`
|
|
29653
29577
|
);
|
|
29654
29578
|
}) }, `header-group-${hg.id}`)) }),
|
|
29655
|
-
/* @__PURE__ */ (0,
|
|
29579
|
+
/* @__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) => {
|
|
29656
29580
|
const meta = cell.column.columnDef.meta || {};
|
|
29657
29581
|
const isClickable = meta?.isClickable;
|
|
29658
29582
|
const isLastCell = cellIndex === arr.length - 1;
|
|
29659
|
-
return /* @__PURE__ */ (0,
|
|
29583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
29660
29584
|
TableCell,
|
|
29661
29585
|
{
|
|
29662
29586
|
className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative py-2`,
|
|
@@ -29673,9 +29597,9 @@ function DataTable({
|
|
|
29673
29597
|
},
|
|
29674
29598
|
children: [
|
|
29675
29599
|
(0, import_react_table2.flexRender)(cell.column.columnDef.cell, cell.getContext()),
|
|
29676
|
-
isLastCell && rowActions && rowActions.length > 0 && /* @__PURE__ */ (0,
|
|
29600
|
+
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) => {
|
|
29677
29601
|
const isDelete = action.id === "delete" || action.icon === "delete";
|
|
29678
|
-
return /* @__PURE__ */ (0,
|
|
29602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29679
29603
|
"button",
|
|
29680
29604
|
{
|
|
29681
29605
|
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"}`,
|
|
@@ -29697,17 +29621,17 @@ function DataTable({
|
|
|
29697
29621
|
},
|
|
29698
29622
|
`cell-${cell.id}-${cellIndex}`
|
|
29699
29623
|
);
|
|
29700
|
-
}) }, row.id)) : /* @__PURE__ */ (0,
|
|
29624
|
+
}) }, 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." }) }) }) })
|
|
29701
29625
|
] }),
|
|
29702
|
-
pagination && /* @__PURE__ */ (0,
|
|
29703
|
-
/* @__PURE__ */ (0,
|
|
29626
|
+
pagination && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
29627
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
29704
29628
|
"Page ",
|
|
29705
29629
|
table.getState().pagination.pageIndex + 1,
|
|
29706
29630
|
" of ",
|
|
29707
29631
|
pageCount
|
|
29708
29632
|
] }),
|
|
29709
|
-
/* @__PURE__ */ (0,
|
|
29710
|
-
/* @__PURE__ */ (0,
|
|
29633
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
29634
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29711
29635
|
"button",
|
|
29712
29636
|
{
|
|
29713
29637
|
onClick: () => table.previousPage(),
|
|
@@ -29720,7 +29644,7 @@ function DataTable({
|
|
|
29720
29644
|
table.getState().pagination.pageIndex + 1,
|
|
29721
29645
|
table.getPageCount(),
|
|
29722
29646
|
5
|
|
29723
|
-
).map((pageNum, index) => /* @__PURE__ */ (0,
|
|
29647
|
+
).map((pageNum, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29724
29648
|
"button",
|
|
29725
29649
|
{
|
|
29726
29650
|
disabled: pageNum === "...",
|
|
@@ -29730,7 +29654,7 @@ function DataTable({
|
|
|
29730
29654
|
},
|
|
29731
29655
|
index
|
|
29732
29656
|
)),
|
|
29733
|
-
/* @__PURE__ */ (0,
|
|
29657
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
29734
29658
|
"button",
|
|
29735
29659
|
{
|
|
29736
29660
|
onClick: () => table.nextPage(),
|
|
@@ -29745,7 +29669,7 @@ function DataTable({
|
|
|
29745
29669
|
}
|
|
29746
29670
|
|
|
29747
29671
|
// src/components/DataDisplay/Table/Table.tsx
|
|
29748
|
-
var
|
|
29672
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
29749
29673
|
var Table4 = ({
|
|
29750
29674
|
columns,
|
|
29751
29675
|
data,
|
|
@@ -29770,7 +29694,7 @@ var Table4 = ({
|
|
|
29770
29694
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
29771
29695
|
const rawData = Array.isArray(data) ? data : [];
|
|
29772
29696
|
const isControlled = typeof page === "number";
|
|
29773
|
-
return /* @__PURE__ */ (0,
|
|
29697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
29774
29698
|
DataTable,
|
|
29775
29699
|
{
|
|
29776
29700
|
...props,
|
|
@@ -29802,9 +29726,9 @@ var Table4 = ({
|
|
|
29802
29726
|
var Table_default = Table4;
|
|
29803
29727
|
|
|
29804
29728
|
// src/components/ui/pagination.tsx
|
|
29805
|
-
var
|
|
29729
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
29806
29730
|
function Pagination({ className, ...props }) {
|
|
29807
|
-
return /* @__PURE__ */ (0,
|
|
29731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
29808
29732
|
"nav",
|
|
29809
29733
|
{
|
|
29810
29734
|
role: "navigation",
|
|
@@ -29819,7 +29743,7 @@ function PaginationContent({
|
|
|
29819
29743
|
className,
|
|
29820
29744
|
...props
|
|
29821
29745
|
}) {
|
|
29822
|
-
return /* @__PURE__ */ (0,
|
|
29746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
29823
29747
|
"ul",
|
|
29824
29748
|
{
|
|
29825
29749
|
"data-slot": "pagination-content",
|
|
@@ -29829,7 +29753,7 @@ function PaginationContent({
|
|
|
29829
29753
|
);
|
|
29830
29754
|
}
|
|
29831
29755
|
function PaginationItem({ ...props }) {
|
|
29832
|
-
return /* @__PURE__ */ (0,
|
|
29756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { "data-slot": "pagination-item", ...props });
|
|
29833
29757
|
}
|
|
29834
29758
|
function PaginationLink({
|
|
29835
29759
|
className,
|
|
@@ -29837,7 +29761,7 @@ function PaginationLink({
|
|
|
29837
29761
|
size = "icon",
|
|
29838
29762
|
...props
|
|
29839
29763
|
}) {
|
|
29840
|
-
return /* @__PURE__ */ (0,
|
|
29764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
29841
29765
|
"a",
|
|
29842
29766
|
{
|
|
29843
29767
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -29858,7 +29782,7 @@ function PaginationPrevious({
|
|
|
29858
29782
|
className,
|
|
29859
29783
|
...props
|
|
29860
29784
|
}) {
|
|
29861
|
-
return /* @__PURE__ */ (0,
|
|
29785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
29862
29786
|
PaginationLink,
|
|
29863
29787
|
{
|
|
29864
29788
|
"aria-label": "Go to previous page",
|
|
@@ -29866,8 +29790,8 @@ function PaginationPrevious({
|
|
|
29866
29790
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
29867
29791
|
...props,
|
|
29868
29792
|
children: [
|
|
29869
|
-
/* @__PURE__ */ (0,
|
|
29870
|
-
/* @__PURE__ */ (0,
|
|
29793
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronLeft, {}),
|
|
29794
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "hidden sm:block", children: "Previous" })
|
|
29871
29795
|
]
|
|
29872
29796
|
}
|
|
29873
29797
|
);
|
|
@@ -29876,7 +29800,7 @@ function PaginationNext({
|
|
|
29876
29800
|
className,
|
|
29877
29801
|
...props
|
|
29878
29802
|
}) {
|
|
29879
|
-
return /* @__PURE__ */ (0,
|
|
29803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
29880
29804
|
PaginationLink,
|
|
29881
29805
|
{
|
|
29882
29806
|
"aria-label": "Go to next page",
|
|
@@ -29884,8 +29808,8 @@ function PaginationNext({
|
|
|
29884
29808
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
29885
29809
|
...props,
|
|
29886
29810
|
children: [
|
|
29887
|
-
/* @__PURE__ */ (0,
|
|
29888
|
-
/* @__PURE__ */ (0,
|
|
29811
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "hidden sm:block", children: "Next" }),
|
|
29812
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronRight, {})
|
|
29889
29813
|
]
|
|
29890
29814
|
}
|
|
29891
29815
|
);
|
|
@@ -29894,7 +29818,7 @@ function PaginationEllipsis({
|
|
|
29894
29818
|
className,
|
|
29895
29819
|
...props
|
|
29896
29820
|
}) {
|
|
29897
|
-
return /* @__PURE__ */ (0,
|
|
29821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
29898
29822
|
"span",
|
|
29899
29823
|
{
|
|
29900
29824
|
"aria-hidden": true,
|
|
@@ -29902,15 +29826,15 @@ function PaginationEllipsis({
|
|
|
29902
29826
|
className: cn("flex size-9 items-center justify-center", className),
|
|
29903
29827
|
...props,
|
|
29904
29828
|
children: [
|
|
29905
|
-
/* @__PURE__ */ (0,
|
|
29906
|
-
/* @__PURE__ */ (0,
|
|
29829
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Ellipsis, { className: "size-4" }),
|
|
29830
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
29907
29831
|
]
|
|
29908
29832
|
}
|
|
29909
29833
|
);
|
|
29910
29834
|
}
|
|
29911
29835
|
|
|
29912
29836
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
29913
|
-
var
|
|
29837
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
29914
29838
|
var CustomPagination = ({
|
|
29915
29839
|
totalPages,
|
|
29916
29840
|
currentPage,
|
|
@@ -29956,10 +29880,10 @@ var CustomPagination = ({
|
|
|
29956
29880
|
}
|
|
29957
29881
|
};
|
|
29958
29882
|
const pageNumbers = getPageNumbers();
|
|
29959
|
-
return /* @__PURE__ */ (0,
|
|
29960
|
-
/* @__PURE__ */ (0,
|
|
29961
|
-
/* @__PURE__ */ (0,
|
|
29962
|
-
/* @__PURE__ */ (0,
|
|
29883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
|
|
29884
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
29885
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
|
|
29886
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
29963
29887
|
Select,
|
|
29964
29888
|
{
|
|
29965
29889
|
defaultValue: String(perPage),
|
|
@@ -29967,26 +29891,26 @@ var CustomPagination = ({
|
|
|
29967
29891
|
onPageChange({ page: 1, itemsPerPage: Number(value) });
|
|
29968
29892
|
},
|
|
29969
29893
|
children: [
|
|
29970
|
-
/* @__PURE__ */ (0,
|
|
29971
|
-
/* @__PURE__ */ (0,
|
|
29972
|
-
/* @__PURE__ */ (0,
|
|
29973
|
-
/* @__PURE__ */ (0,
|
|
29974
|
-
/* @__PURE__ */ (0,
|
|
29975
|
-
/* @__PURE__ */ (0,
|
|
29894
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
29895
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(SelectContent, { children: [
|
|
29896
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "5", children: "5" }),
|
|
29897
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "10", children: "10" }),
|
|
29898
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "20", children: "20" }),
|
|
29899
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "50", children: "50" })
|
|
29976
29900
|
] })
|
|
29977
29901
|
]
|
|
29978
29902
|
}
|
|
29979
29903
|
)
|
|
29980
29904
|
] }),
|
|
29981
|
-
/* @__PURE__ */ (0,
|
|
29982
|
-
/* @__PURE__ */ (0,
|
|
29905
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(PaginationContent, { children: [
|
|
29906
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29983
29907
|
PaginationPrevious,
|
|
29984
29908
|
{
|
|
29985
29909
|
onClick: () => handlePageChange(currentPage - 1),
|
|
29986
29910
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
29987
29911
|
}
|
|
29988
29912
|
) }),
|
|
29989
|
-
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0,
|
|
29913
|
+
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)(
|
|
29990
29914
|
PaginationLink,
|
|
29991
29915
|
{
|
|
29992
29916
|
onClick: () => handlePageChange(pageNumber),
|
|
@@ -29995,7 +29919,7 @@ var CustomPagination = ({
|
|
|
29995
29919
|
children: pageNumber
|
|
29996
29920
|
}
|
|
29997
29921
|
) }, index)),
|
|
29998
|
-
/* @__PURE__ */ (0,
|
|
29922
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
29999
29923
|
PaginationNext,
|
|
30000
29924
|
{
|
|
30001
29925
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -30008,12 +29932,128 @@ var CustomPagination = ({
|
|
|
30008
29932
|
var Pagination_default = CustomPagination;
|
|
30009
29933
|
|
|
30010
29934
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30011
|
-
var
|
|
29935
|
+
var import_react31 = require("react");
|
|
30012
29936
|
var import_link5 = __toESM(require("next/link"));
|
|
30013
29937
|
var import_navigation3 = require("next/navigation");
|
|
30014
|
-
|
|
29938
|
+
|
|
29939
|
+
// src/components/ui/dialog.tsx
|
|
29940
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
29941
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
29942
|
+
function Dialog({
|
|
29943
|
+
...props
|
|
29944
|
+
}) {
|
|
29945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
29946
|
+
}
|
|
29947
|
+
function DialogPortal({
|
|
29948
|
+
...props
|
|
29949
|
+
}) {
|
|
29950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
29951
|
+
}
|
|
29952
|
+
function DialogOverlay({
|
|
29953
|
+
className,
|
|
29954
|
+
...props
|
|
29955
|
+
}) {
|
|
29956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
29957
|
+
DialogPrimitive.Overlay,
|
|
29958
|
+
{
|
|
29959
|
+
"data-slot": "dialog-overlay",
|
|
29960
|
+
className: cn(
|
|
29961
|
+
"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",
|
|
29962
|
+
className
|
|
29963
|
+
),
|
|
29964
|
+
...props
|
|
29965
|
+
}
|
|
29966
|
+
);
|
|
29967
|
+
}
|
|
29968
|
+
function DialogContent({
|
|
29969
|
+
className,
|
|
29970
|
+
children,
|
|
29971
|
+
showCloseButton = true,
|
|
29972
|
+
...props
|
|
29973
|
+
}) {
|
|
29974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
29975
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogOverlay, {}),
|
|
29976
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
29977
|
+
DialogPrimitive.Content,
|
|
29978
|
+
{
|
|
29979
|
+
"data-slot": "dialog-content",
|
|
29980
|
+
className: cn(
|
|
29981
|
+
"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",
|
|
29982
|
+
className
|
|
29983
|
+
),
|
|
29984
|
+
...props,
|
|
29985
|
+
children: [
|
|
29986
|
+
children,
|
|
29987
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
29988
|
+
DialogPrimitive.Close,
|
|
29989
|
+
{
|
|
29990
|
+
"data-slot": "dialog-close",
|
|
29991
|
+
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",
|
|
29992
|
+
children: [
|
|
29993
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(X, {}),
|
|
29994
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: "Close" })
|
|
29995
|
+
]
|
|
29996
|
+
}
|
|
29997
|
+
)
|
|
29998
|
+
]
|
|
29999
|
+
}
|
|
30000
|
+
)
|
|
30001
|
+
] });
|
|
30002
|
+
}
|
|
30003
|
+
function DialogHeader({ className, ...props }) {
|
|
30004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
30005
|
+
"div",
|
|
30006
|
+
{
|
|
30007
|
+
"data-slot": "dialog-header",
|
|
30008
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
30009
|
+
...props
|
|
30010
|
+
}
|
|
30011
|
+
);
|
|
30012
|
+
}
|
|
30013
|
+
function DialogFooter({ className, ...props }) {
|
|
30014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
30015
|
+
"div",
|
|
30016
|
+
{
|
|
30017
|
+
"data-slot": "dialog-footer",
|
|
30018
|
+
className: cn(
|
|
30019
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
30020
|
+
className
|
|
30021
|
+
),
|
|
30022
|
+
...props
|
|
30023
|
+
}
|
|
30024
|
+
);
|
|
30025
|
+
}
|
|
30026
|
+
function DialogTitle({
|
|
30027
|
+
className,
|
|
30028
|
+
...props
|
|
30029
|
+
}) {
|
|
30030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
30031
|
+
DialogPrimitive.Title,
|
|
30032
|
+
{
|
|
30033
|
+
"data-slot": "dialog-title",
|
|
30034
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
30035
|
+
...props
|
|
30036
|
+
}
|
|
30037
|
+
);
|
|
30038
|
+
}
|
|
30039
|
+
function DialogDescription({
|
|
30040
|
+
className,
|
|
30041
|
+
...props
|
|
30042
|
+
}) {
|
|
30043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
30044
|
+
DialogPrimitive.Description,
|
|
30045
|
+
{
|
|
30046
|
+
"data-slot": "dialog-description",
|
|
30047
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
30048
|
+
...props
|
|
30049
|
+
}
|
|
30050
|
+
);
|
|
30051
|
+
}
|
|
30052
|
+
|
|
30053
|
+
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30054
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
30015
30055
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
|
|
30016
|
-
const [openIndex, setOpenIndex] = (0,
|
|
30056
|
+
const [openIndex, setOpenIndex] = (0, import_react31.useState)(null);
|
|
30017
30057
|
function groupMenus(menus = []) {
|
|
30018
30058
|
const menuMap = /* @__PURE__ */ new Map();
|
|
30019
30059
|
menus.forEach((menu) => {
|
|
@@ -30046,7 +30086,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30046
30086
|
});
|
|
30047
30087
|
return sortMenus(rootMenus);
|
|
30048
30088
|
}
|
|
30049
|
-
const rawTabs = (0,
|
|
30089
|
+
const rawTabs = (0, import_react31.useMemo)(() => {
|
|
30050
30090
|
if (!Array.isArray(tabs)) return [];
|
|
30051
30091
|
if (source === "manual") return Array.isArray(tabs) ? tabs : [];
|
|
30052
30092
|
return groupMenus(tabs);
|
|
@@ -30059,9 +30099,9 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30059
30099
|
return pathname === path || path !== "/" && pathname?.startsWith(path);
|
|
30060
30100
|
};
|
|
30061
30101
|
const router = (0, import_navigation3.useRouter)();
|
|
30062
|
-
const [showExitDialog, setShowExitDialog] = (0,
|
|
30063
|
-
const [pendingUrl, setPendingUrl] = (0,
|
|
30064
|
-
const handleBuilderExit = (0,
|
|
30102
|
+
const [showExitDialog, setShowExitDialog] = (0, import_react31.useState)(false);
|
|
30103
|
+
const [pendingUrl, setPendingUrl] = (0, import_react31.useState)(null);
|
|
30104
|
+
const handleBuilderExit = (0, import_react31.useCallback)(
|
|
30065
30105
|
(e, url) => {
|
|
30066
30106
|
if (isBuilder) {
|
|
30067
30107
|
e.preventDefault();
|
|
@@ -30081,13 +30121,13 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30081
30121
|
const renderDesktopTab = (tab, index) => {
|
|
30082
30122
|
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
30083
30123
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
30084
|
-
return /* @__PURE__ */ (0,
|
|
30124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
30085
30125
|
DropdownMenu,
|
|
30086
30126
|
{
|
|
30087
30127
|
open: openIndex === index,
|
|
30088
30128
|
onOpenChange: (open) => setOpenIndex(open ? index : null),
|
|
30089
30129
|
children: [
|
|
30090
|
-
/* @__PURE__ */ (0,
|
|
30130
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
30091
30131
|
DropdownMenuTrigger,
|
|
30092
30132
|
{
|
|
30093
30133
|
className: `${finalClasses} inline-flex items-center gap-1`,
|
|
@@ -30100,11 +30140,11 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30100
30140
|
},
|
|
30101
30141
|
children: [
|
|
30102
30142
|
tab.header,
|
|
30103
|
-
/* @__PURE__ */ (0,
|
|
30143
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
30104
30144
|
]
|
|
30105
30145
|
}
|
|
30106
30146
|
),
|
|
30107
|
-
/* @__PURE__ */ (0,
|
|
30147
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30108
30148
|
DropdownMenuContent,
|
|
30109
30149
|
{
|
|
30110
30150
|
align: "start",
|
|
@@ -30117,12 +30157,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30117
30157
|
onMouseLeave: () => {
|
|
30118
30158
|
timeout = setTimeout(() => setOpenIndex(null), 150);
|
|
30119
30159
|
},
|
|
30120
|
-
children: tab.children.map((item, index2) => /* @__PURE__ */ (0,
|
|
30160
|
+
children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30121
30161
|
DropdownMenuItem,
|
|
30122
30162
|
{
|
|
30123
30163
|
asChild: true,
|
|
30124
30164
|
className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
30125
|
-
children: /* @__PURE__ */ (0,
|
|
30165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30126
30166
|
import_link5.default,
|
|
30127
30167
|
{
|
|
30128
30168
|
href: item.url || "#",
|
|
@@ -30141,7 +30181,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30141
30181
|
index
|
|
30142
30182
|
);
|
|
30143
30183
|
}
|
|
30144
|
-
return tab.url ? /* @__PURE__ */ (0,
|
|
30184
|
+
return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30145
30185
|
import_link5.default,
|
|
30146
30186
|
{
|
|
30147
30187
|
href: tab.url,
|
|
@@ -30152,14 +30192,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30152
30192
|
children: tab.header
|
|
30153
30193
|
},
|
|
30154
30194
|
index
|
|
30155
|
-
) : /* @__PURE__ */ (0,
|
|
30195
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
30156
30196
|
};
|
|
30157
|
-
const renderMobileMenu = () => /* @__PURE__ */ (0,
|
|
30158
|
-
/* @__PURE__ */ (0,
|
|
30159
|
-
/* @__PURE__ */ (0,
|
|
30197
|
+
const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenu, { children: [
|
|
30198
|
+
/* @__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: [
|
|
30199
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Menu, { className: "h-4 w-4" }),
|
|
30160
30200
|
"Menu"
|
|
30161
30201
|
] }),
|
|
30162
|
-
/* @__PURE__ */ (0,
|
|
30202
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30163
30203
|
DropdownMenuContent,
|
|
30164
30204
|
{
|
|
30165
30205
|
align: "start",
|
|
@@ -30168,25 +30208,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30168
30208
|
children: rawTabs.map((tab, i) => {
|
|
30169
30209
|
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
30170
30210
|
if (hasChildren) {
|
|
30171
|
-
return /* @__PURE__ */ (0,
|
|
30172
|
-
/* @__PURE__ */ (0,
|
|
30173
|
-
/* @__PURE__ */ (0,
|
|
30211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuSub, { children: [
|
|
30212
|
+
/* @__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 }),
|
|
30213
|
+
/* @__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)(
|
|
30174
30214
|
DropdownMenuItem,
|
|
30175
30215
|
{
|
|
30176
30216
|
asChild: true,
|
|
30177
30217
|
className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100",
|
|
30178
|
-
children: /* @__PURE__ */ (0,
|
|
30218
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
30179
30219
|
},
|
|
30180
30220
|
item.id || index
|
|
30181
30221
|
)) })
|
|
30182
30222
|
] }, i);
|
|
30183
30223
|
}
|
|
30184
|
-
return /* @__PURE__ */ (0,
|
|
30224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
30185
30225
|
DropdownMenuItem,
|
|
30186
30226
|
{
|
|
30187
30227
|
asChild: true,
|
|
30188
30228
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
|
|
30189
|
-
children: /* @__PURE__ */ (0,
|
|
30229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_link5.default, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
|
|
30190
30230
|
},
|
|
30191
30231
|
i
|
|
30192
30232
|
);
|
|
@@ -30196,19 +30236,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30196
30236
|
] });
|
|
30197
30237
|
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
30198
30238
|
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
30199
|
-
return /* @__PURE__ */ (0,
|
|
30200
|
-
/* @__PURE__ */ (0,
|
|
30201
|
-
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0,
|
|
30202
|
-
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0,
|
|
30239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
30240
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: cn("min-h-10", className), style, children: [
|
|
30241
|
+
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) }) }),
|
|
30242
|
+
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() })
|
|
30203
30243
|
] }),
|
|
30204
|
-
/* @__PURE__ */ (0,
|
|
30205
|
-
/* @__PURE__ */ (0,
|
|
30206
|
-
/* @__PURE__ */ (0,
|
|
30207
|
-
/* @__PURE__ */ (0,
|
|
30244
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
|
|
30245
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogHeader, { children: [
|
|
30246
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DialogTitle, { children: "Exit Builder?" }),
|
|
30247
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
30208
30248
|
] }),
|
|
30209
|
-
/* @__PURE__ */ (0,
|
|
30210
|
-
/* @__PURE__ */ (0,
|
|
30211
|
-
/* @__PURE__ */ (0,
|
|
30249
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogFooter, { children: [
|
|
30250
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
30251
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
30212
30252
|
] })
|
|
30213
30253
|
] }) })
|
|
30214
30254
|
] });
|
|
@@ -30216,10 +30256,10 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30216
30256
|
var Tabs_default = Tabs;
|
|
30217
30257
|
|
|
30218
30258
|
// src/components/Navigation/Stages/Stages.tsx
|
|
30219
|
-
var
|
|
30220
|
-
var
|
|
30259
|
+
var import_react32 = __toESM(require("react"));
|
|
30260
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
30221
30261
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey = "key", dataLabel = "header", loading }) => {
|
|
30222
|
-
const [activeStage, setActiveStage] = (0,
|
|
30262
|
+
const [activeStage, setActiveStage] = (0, import_react32.useState)(currentStage || (stages && stages.length > 0 ? stages[0].key : null));
|
|
30223
30263
|
const nextStage = () => {
|
|
30224
30264
|
if (!stages || stages.length === 0) return;
|
|
30225
30265
|
const currentIndex = stages.findIndex((stage) => stage[dataKey] === activeStage);
|
|
@@ -30236,9 +30276,9 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
30236
30276
|
onStageChange?.(stageKey);
|
|
30237
30277
|
};
|
|
30238
30278
|
const isAllStagesCompleted = activeStage === lastStage;
|
|
30239
|
-
return /* @__PURE__ */ (0,
|
|
30240
|
-
/* @__PURE__ */ (0,
|
|
30241
|
-
/* @__PURE__ */ (0,
|
|
30279
|
+
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: [
|
|
30280
|
+
/* @__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" }) }) }) }),
|
|
30281
|
+
/* @__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)(
|
|
30242
30282
|
"button",
|
|
30243
30283
|
{
|
|
30244
30284
|
className: `
|
|
@@ -30251,8 +30291,8 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
30251
30291
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
30252
30292
|
const isCompleted = isAllStagesCompleted || index < currentIndex;
|
|
30253
30293
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
30254
|
-
return /* @__PURE__ */ (0,
|
|
30255
|
-
/* @__PURE__ */ (0,
|
|
30294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react32.default.Fragment, { children: [
|
|
30295
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
30256
30296
|
"button",
|
|
30257
30297
|
{
|
|
30258
30298
|
className: `
|
|
@@ -30265,10 +30305,10 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
30265
30305
|
children: stage[dataLabel]
|
|
30266
30306
|
}
|
|
30267
30307
|
),
|
|
30268
|
-
index < stages.length - 1 && /* @__PURE__ */ (0,
|
|
30308
|
+
index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
|
|
30269
30309
|
] }, stage.id);
|
|
30270
30310
|
}) }),
|
|
30271
|
-
isShowBtn && /* @__PURE__ */ (0,
|
|
30311
|
+
isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
30272
30312
|
"button",
|
|
30273
30313
|
{
|
|
30274
30314
|
className: "bg-green-700 text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
|
|
@@ -30283,26 +30323,26 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
30283
30323
|
var Stages_default = StagesComponent;
|
|
30284
30324
|
|
|
30285
30325
|
// src/components/Navigation/Spacer/Spacer.tsx
|
|
30286
|
-
var
|
|
30326
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
30287
30327
|
var Spacer = ({ className, style }) => {
|
|
30288
|
-
return /* @__PURE__ */ (0,
|
|
30328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: `${className}`, style });
|
|
30289
30329
|
};
|
|
30290
30330
|
var Spacer_default = Spacer;
|
|
30291
30331
|
|
|
30292
30332
|
// src/components/Navigation/Profile/Profile.tsx
|
|
30293
|
-
var
|
|
30333
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
30294
30334
|
|
|
30295
30335
|
// src/components/Navigation/Notification/Notification.tsx
|
|
30296
|
-
var
|
|
30336
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
30297
30337
|
|
|
30298
30338
|
// src/components/Navigation/Logo/Logo.tsx
|
|
30299
|
-
var
|
|
30339
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
30300
30340
|
|
|
30301
30341
|
// src/components/ui/avatar.tsx
|
|
30302
|
-
var
|
|
30342
|
+
var React11 = __toESM(require("react"));
|
|
30303
30343
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
30304
|
-
var
|
|
30305
|
-
var Avatar =
|
|
30344
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
30345
|
+
var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
30306
30346
|
AvatarPrimitive.Root,
|
|
30307
30347
|
{
|
|
30308
30348
|
ref,
|
|
@@ -30314,7 +30354,7 @@ var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
30314
30354
|
}
|
|
30315
30355
|
));
|
|
30316
30356
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
30317
|
-
var AvatarImage =
|
|
30357
|
+
var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
30318
30358
|
AvatarPrimitive.Image,
|
|
30319
30359
|
{
|
|
30320
30360
|
ref,
|
|
@@ -30323,7 +30363,7 @@ var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
30323
30363
|
}
|
|
30324
30364
|
));
|
|
30325
30365
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
30326
|
-
var AvatarFallback =
|
|
30366
|
+
var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
30327
30367
|
AvatarPrimitive.Fallback,
|
|
30328
30368
|
{
|
|
30329
30369
|
ref,
|
|
@@ -30341,8 +30381,8 @@ var import_link6 = __toESM(require("next/link"));
|
|
|
30341
30381
|
var import_image4 = __toESM(require("next/image"));
|
|
30342
30382
|
var import_navigation4 = require("next/navigation");
|
|
30343
30383
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
30344
|
-
var
|
|
30345
|
-
var
|
|
30384
|
+
var import_react33 = require("react");
|
|
30385
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
30346
30386
|
function Navbar({
|
|
30347
30387
|
style,
|
|
30348
30388
|
badgeType,
|
|
@@ -30362,9 +30402,9 @@ function Navbar({
|
|
|
30362
30402
|
}) {
|
|
30363
30403
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
30364
30404
|
const router = (0, import_navigation4.useRouter)();
|
|
30365
|
-
const [showExitDialog, setShowExitDialog] = (0,
|
|
30366
|
-
const [pendingUrl, setPendingUrl] = (0,
|
|
30367
|
-
const handleBuilderExit = (0,
|
|
30405
|
+
const [showExitDialog, setShowExitDialog] = (0, import_react33.useState)(false);
|
|
30406
|
+
const [pendingUrl, setPendingUrl] = (0, import_react33.useState)(null);
|
|
30407
|
+
const handleBuilderExit = (0, import_react33.useCallback)(
|
|
30368
30408
|
(e, url) => {
|
|
30369
30409
|
if (isBuilder) {
|
|
30370
30410
|
e.preventDefault();
|
|
@@ -30380,29 +30420,29 @@ function Navbar({
|
|
|
30380
30420
|
router.push(pendingUrl);
|
|
30381
30421
|
}
|
|
30382
30422
|
};
|
|
30383
|
-
const formatedMenu = (0,
|
|
30423
|
+
const formatedMenu = (0, import_react33.useMemo)(() => {
|
|
30384
30424
|
if (source === "state" && navList && navList.length) {
|
|
30385
30425
|
return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
|
|
30386
30426
|
}
|
|
30387
30427
|
return list || [];
|
|
30388
30428
|
}, [source, navList]);
|
|
30389
|
-
return /* @__PURE__ */ (0,
|
|
30390
|
-
/* @__PURE__ */ (0,
|
|
30429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
30430
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30391
30431
|
"nav",
|
|
30392
30432
|
{
|
|
30393
30433
|
className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
30394
30434
|
style,
|
|
30395
|
-
children: /* @__PURE__ */ (0,
|
|
30396
|
-
/* @__PURE__ */ (0,
|
|
30435
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
30436
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30397
30437
|
import_link6.default,
|
|
30398
30438
|
{
|
|
30399
30439
|
href: "/",
|
|
30400
30440
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
30401
30441
|
className: "flex items-center space-x-2",
|
|
30402
|
-
children: imageUrl ? /* @__PURE__ */ (0,
|
|
30442
|
+
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" })
|
|
30403
30443
|
}
|
|
30404
30444
|
),
|
|
30405
|
-
!isMobileView && /* @__PURE__ */ (0,
|
|
30445
|
+
!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)(
|
|
30406
30446
|
import_link6.default,
|
|
30407
30447
|
{
|
|
30408
30448
|
href: item.url || "#",
|
|
@@ -30412,39 +30452,39 @@ function Navbar({
|
|
|
30412
30452
|
},
|
|
30413
30453
|
item.id
|
|
30414
30454
|
)) }),
|
|
30415
|
-
/* @__PURE__ */ (0,
|
|
30416
|
-
!isMobileView ? /* @__PURE__ */ (0,
|
|
30417
|
-
/* @__PURE__ */ (0,
|
|
30418
|
-
/* @__PURE__ */ (0,
|
|
30419
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
30420
|
-
/* @__PURE__ */ (0,
|
|
30421
|
-
/* @__PURE__ */ (0,
|
|
30422
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0,
|
|
30455
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
30456
|
+
!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: [
|
|
30457
|
+
/* @__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" }),
|
|
30458
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
30459
|
+
] }) }) : /* @__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" }) }),
|
|
30460
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
|
|
30461
|
+
/* @__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" }) }),
|
|
30462
|
+
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" })
|
|
30423
30463
|
] }),
|
|
30424
|
-
/* @__PURE__ */ (0,
|
|
30425
|
-
/* @__PURE__ */ (0,
|
|
30426
|
-
!isMobileView && showName && /* @__PURE__ */ (0,
|
|
30427
|
-
!isMobileView ? /* @__PURE__ */ (0,
|
|
30428
|
-
/* @__PURE__ */ (0,
|
|
30464
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DropdownMenu, { children: [
|
|
30465
|
+
/* @__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: [
|
|
30466
|
+
!isMobileView && showName && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
|
|
30467
|
+
!isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
30468
|
+
/* @__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)(
|
|
30429
30469
|
AvatarImage,
|
|
30430
30470
|
{
|
|
30431
30471
|
src: "/images/appbuilder/toolset/profile.svg",
|
|
30432
30472
|
alt: "Profile"
|
|
30433
30473
|
}
|
|
30434
|
-
) : /* @__PURE__ */ (0,
|
|
30435
|
-
/* @__PURE__ */ (0,
|
|
30474
|
+
) : /* @__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) }) }),
|
|
30475
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
30436
30476
|
Button,
|
|
30437
30477
|
{
|
|
30438
30478
|
variant: "ghost",
|
|
30439
30479
|
size: "icon",
|
|
30440
30480
|
className: "text-gray-900 md:hidden dark:invert",
|
|
30441
|
-
children: /* @__PURE__ */ (0,
|
|
30481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Menu, { className: "h-6 w-6" })
|
|
30442
30482
|
}
|
|
30443
30483
|
)
|
|
30444
|
-
] }) : /* @__PURE__ */ (0,
|
|
30484
|
+
] }) : /* @__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" }) })
|
|
30445
30485
|
] }) }),
|
|
30446
|
-
/* @__PURE__ */ (0,
|
|
30447
|
-
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0,
|
|
30486
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
30487
|
+
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)(
|
|
30448
30488
|
import_link6.default,
|
|
30449
30489
|
{
|
|
30450
30490
|
href: item.url || "#",
|
|
@@ -30452,9 +30492,9 @@ function Navbar({
|
|
|
30452
30492
|
children: item.header
|
|
30453
30493
|
}
|
|
30454
30494
|
) }, item.id)) }),
|
|
30455
|
-
/* @__PURE__ */ (0,
|
|
30456
|
-
/* @__PURE__ */ (0,
|
|
30457
|
-
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0,
|
|
30495
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "md:hidden", children: [
|
|
30496
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_dropdown_menu.DropdownMenuSeparator, {}),
|
|
30497
|
+
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)(
|
|
30458
30498
|
import_link6.default,
|
|
30459
30499
|
{
|
|
30460
30500
|
href: item.url || "#",
|
|
@@ -30469,51 +30509,51 @@ function Navbar({
|
|
|
30469
30509
|
] })
|
|
30470
30510
|
}
|
|
30471
30511
|
),
|
|
30472
|
-
/* @__PURE__ */ (0,
|
|
30473
|
-
/* @__PURE__ */ (0,
|
|
30474
|
-
/* @__PURE__ */ (0,
|
|
30475
|
-
/* @__PURE__ */ (0,
|
|
30512
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
|
|
30513
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogHeader, { children: [
|
|
30514
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogTitle, { children: "Exit Builder?" }),
|
|
30515
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
30476
30516
|
] }),
|
|
30477
|
-
/* @__PURE__ */ (0,
|
|
30478
|
-
/* @__PURE__ */ (0,
|
|
30479
|
-
/* @__PURE__ */ (0,
|
|
30517
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogFooter, { children: [
|
|
30518
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
30519
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
30480
30520
|
] })
|
|
30481
30521
|
] }) })
|
|
30482
30522
|
] });
|
|
30483
30523
|
}
|
|
30484
30524
|
|
|
30485
30525
|
// src/components/Chart/BarChart.tsx
|
|
30486
|
-
var
|
|
30526
|
+
var import_react34 = __toESM(require("react"));
|
|
30487
30527
|
var import_recharts = require("recharts");
|
|
30488
|
-
var
|
|
30528
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
30489
30529
|
var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
30490
30530
|
const data = Array.isArray(props.data) ? props.data : [];
|
|
30491
30531
|
const chartType = props.chartType || "bar";
|
|
30492
30532
|
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
30493
30533
|
if (loading || data.length === 0) {
|
|
30494
|
-
return /* @__PURE__ */ (0,
|
|
30534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
30495
30535
|
"div",
|
|
30496
30536
|
{
|
|
30497
30537
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
30498
30538
|
style,
|
|
30499
|
-
children: /* @__PURE__ */ (0,
|
|
30539
|
+
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." })
|
|
30500
30540
|
}
|
|
30501
30541
|
);
|
|
30502
30542
|
}
|
|
30503
|
-
return /* @__PURE__ */ (0,
|
|
30504
|
-
/* @__PURE__ */ (0,
|
|
30505
|
-
/* @__PURE__ */ (0,
|
|
30506
|
-
/* @__PURE__ */ (0,
|
|
30507
|
-
/* @__PURE__ */ (0,
|
|
30508
|
-
/* @__PURE__ */ (0,
|
|
30509
|
-
/* @__PURE__ */ (0,
|
|
30543
|
+
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: [
|
|
30544
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
|
|
30545
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.XAxis, { dataKey: "name" }),
|
|
30546
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.YAxis, {}),
|
|
30547
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
|
|
30548
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
30549
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
30510
30550
|
import_recharts.Bar,
|
|
30511
30551
|
{
|
|
30512
30552
|
dataKey: "value",
|
|
30513
30553
|
fill: "#00695C",
|
|
30514
30554
|
radius: [6, 6, 0, 0],
|
|
30515
30555
|
isAnimationActive: false,
|
|
30516
|
-
children: data.map((entry, index) => /* @__PURE__ */ (0,
|
|
30556
|
+
children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
30517
30557
|
"rect",
|
|
30518
30558
|
{
|
|
30519
30559
|
fill: entry.color || "#00695C"
|
|
@@ -30522,16 +30562,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
30522
30562
|
))
|
|
30523
30563
|
}
|
|
30524
30564
|
)
|
|
30525
|
-
] }) : /* @__PURE__ */ (0,
|
|
30526
|
-
/* @__PURE__ */ (0,
|
|
30527
|
-
/* @__PURE__ */ (0,
|
|
30528
|
-
/* @__PURE__ */ (0,
|
|
30565
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_recharts.AreaChart, { data, children: [
|
|
30566
|
+
/* @__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: [
|
|
30567
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
30568
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
30529
30569
|
] }) }),
|
|
30530
|
-
/* @__PURE__ */ (0,
|
|
30531
|
-
/* @__PURE__ */ (0,
|
|
30532
|
-
/* @__PURE__ */ (0,
|
|
30533
|
-
/* @__PURE__ */ (0,
|
|
30534
|
-
/* @__PURE__ */ (0,
|
|
30570
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
|
|
30571
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.XAxis, { dataKey: "name" }),
|
|
30572
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.YAxis, {}),
|
|
30573
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
|
|
30574
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
30535
30575
|
import_recharts.Area,
|
|
30536
30576
|
{
|
|
30537
30577
|
type: "monotone",
|
|
@@ -30544,12 +30584,12 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
30544
30584
|
)
|
|
30545
30585
|
] }) }) });
|
|
30546
30586
|
};
|
|
30547
|
-
var BarChart_default =
|
|
30587
|
+
var BarChart_default = import_react34.default.memo(ChartComponent);
|
|
30548
30588
|
|
|
30549
30589
|
// src/components/Chart/PieChart.tsx
|
|
30550
|
-
var
|
|
30590
|
+
var import_react35 = __toESM(require("react"));
|
|
30551
30591
|
var import_recharts2 = require("recharts");
|
|
30552
|
-
var
|
|
30592
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
30553
30593
|
var getRandomColor = () => {
|
|
30554
30594
|
const palette = [
|
|
30555
30595
|
"#2563eb",
|
|
@@ -30569,32 +30609,32 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30569
30609
|
const showLegends = props.showLegends ?? true;
|
|
30570
30610
|
const labelType = props.labelType || "inside";
|
|
30571
30611
|
const canvasMode = props.canvasMode;
|
|
30572
|
-
const data = (0,
|
|
30612
|
+
const data = (0, import_react35.useMemo)(() => {
|
|
30573
30613
|
if (!Array.isArray(props.data)) return [];
|
|
30574
30614
|
return props.data.map((item) => ({ ...item, color: getRandomColor() }));
|
|
30575
30615
|
}, [props.data]);
|
|
30576
|
-
const total = (0,
|
|
30616
|
+
const total = (0, import_react35.useMemo)(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
|
|
30577
30617
|
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
30578
|
-
const [mounted, setMounted] = (0,
|
|
30579
|
-
(0,
|
|
30618
|
+
const [mounted, setMounted] = (0, import_react35.useState)(false);
|
|
30619
|
+
(0, import_react35.useEffect)(() => {
|
|
30580
30620
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
30581
30621
|
return () => clearTimeout(timeout);
|
|
30582
30622
|
}, []);
|
|
30583
|
-
const renderLegends = (0,
|
|
30623
|
+
const renderLegends = (0, import_react35.useMemo)(() => {
|
|
30584
30624
|
if (!showLegends) return null;
|
|
30585
|
-
return /* @__PURE__ */ (0,
|
|
30625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_jsx_runtime65.Fragment, { children: data.map((d) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
30586
30626
|
"div",
|
|
30587
30627
|
{
|
|
30588
30628
|
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
30589
30629
|
children: [
|
|
30590
|
-
/* @__PURE__ */ (0,
|
|
30630
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
30591
30631
|
"span",
|
|
30592
30632
|
{
|
|
30593
30633
|
className: "inline-block w-[16px] h-[16px] rounded",
|
|
30594
30634
|
style: { backgroundColor: d.color }
|
|
30595
30635
|
}
|
|
30596
30636
|
),
|
|
30597
|
-
/* @__PURE__ */ (0,
|
|
30637
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
|
|
30598
30638
|
]
|
|
30599
30639
|
},
|
|
30600
30640
|
d.name
|
|
@@ -30602,24 +30642,24 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30602
30642
|
}, [data, showLegends]);
|
|
30603
30643
|
if (!mounted) return null;
|
|
30604
30644
|
if (loading || data.length === 0) {
|
|
30605
|
-
return /* @__PURE__ */ (0,
|
|
30645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
30606
30646
|
"div",
|
|
30607
30647
|
{
|
|
30608
30648
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
30609
30649
|
style,
|
|
30610
|
-
children: /* @__PURE__ */ (0,
|
|
30650
|
+
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." })
|
|
30611
30651
|
}
|
|
30612
30652
|
);
|
|
30613
30653
|
}
|
|
30614
|
-
return /* @__PURE__ */ (0,
|
|
30654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
30615
30655
|
"div",
|
|
30616
30656
|
{
|
|
30617
30657
|
className: `relative flex flex-col items-center ${className}`,
|
|
30618
30658
|
style,
|
|
30619
30659
|
children: [
|
|
30620
|
-
/* @__PURE__ */ (0,
|
|
30621
|
-
/* @__PURE__ */ (0,
|
|
30622
|
-
/* @__PURE__ */ (0,
|
|
30660
|
+
/* @__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: [
|
|
30661
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts2.ResponsiveContainer, { width: "99%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_recharts2.PieChart, { children: [
|
|
30662
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
30623
30663
|
import_recharts2.Pie,
|
|
30624
30664
|
{
|
|
30625
30665
|
data,
|
|
@@ -30631,8 +30671,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30631
30671
|
labelLine: false,
|
|
30632
30672
|
isAnimationActive: false,
|
|
30633
30673
|
children: [
|
|
30634
|
-
data.map((entry, index) => /* @__PURE__ */ (0,
|
|
30635
|
-
/* @__PURE__ */ (0,
|
|
30674
|
+
data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts2.Cell, { fill: entry.color }, `cell-${index}`)),
|
|
30675
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
30636
30676
|
import_recharts2.LabelList,
|
|
30637
30677
|
{
|
|
30638
30678
|
dataKey: "value",
|
|
@@ -30645,14 +30685,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30645
30685
|
]
|
|
30646
30686
|
}
|
|
30647
30687
|
),
|
|
30648
|
-
/* @__PURE__ */ (0,
|
|
30688
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
30649
30689
|
import_recharts2.Tooltip,
|
|
30650
30690
|
{
|
|
30651
30691
|
formatter: (value, name) => [`${value}k`, name]
|
|
30652
30692
|
}
|
|
30653
30693
|
)
|
|
30654
30694
|
] }) }),
|
|
30655
|
-
/* @__PURE__ */ (0,
|
|
30695
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
30656
30696
|
"div",
|
|
30657
30697
|
{
|
|
30658
30698
|
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]`,
|
|
@@ -30663,18 +30703,18 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30663
30703
|
}
|
|
30664
30704
|
)
|
|
30665
30705
|
] }),
|
|
30666
|
-
/* @__PURE__ */ (0,
|
|
30706
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
|
|
30667
30707
|
]
|
|
30668
30708
|
}
|
|
30669
30709
|
);
|
|
30670
30710
|
};
|
|
30671
|
-
var PieChart_default =
|
|
30711
|
+
var PieChart_default = import_react35.default.memo(DonutChart);
|
|
30672
30712
|
|
|
30673
30713
|
// src/components/Blocks/EmailComposer.tsx
|
|
30674
|
-
var
|
|
30714
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
30675
30715
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
30676
|
-
return /* @__PURE__ */ (0,
|
|
30677
|
-
/* @__PURE__ */ (0,
|
|
30716
|
+
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: [
|
|
30717
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30678
30718
|
"input",
|
|
30679
30719
|
{
|
|
30680
30720
|
type: "email",
|
|
@@ -30683,8 +30723,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30683
30723
|
required: true
|
|
30684
30724
|
}
|
|
30685
30725
|
) }),
|
|
30686
|
-
/* @__PURE__ */ (0,
|
|
30687
|
-
/* @__PURE__ */ (0,
|
|
30726
|
+
/* @__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: [
|
|
30727
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30688
30728
|
"input",
|
|
30689
30729
|
{
|
|
30690
30730
|
type: "email",
|
|
@@ -30695,7 +30735,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30695
30735
|
required: true
|
|
30696
30736
|
}
|
|
30697
30737
|
),
|
|
30698
|
-
!showCc && /* @__PURE__ */ (0,
|
|
30738
|
+
!showCc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30699
30739
|
"button",
|
|
30700
30740
|
{
|
|
30701
30741
|
onClick: () => setShowCc?.(true),
|
|
@@ -30703,7 +30743,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30703
30743
|
children: "Cc"
|
|
30704
30744
|
}
|
|
30705
30745
|
),
|
|
30706
|
-
!showBcc && /* @__PURE__ */ (0,
|
|
30746
|
+
!showBcc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30707
30747
|
"button",
|
|
30708
30748
|
{
|
|
30709
30749
|
onClick: () => setShowBcc?.(true),
|
|
@@ -30712,7 +30752,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30712
30752
|
}
|
|
30713
30753
|
)
|
|
30714
30754
|
] }) }),
|
|
30715
|
-
showCc && /* @__PURE__ */ (0,
|
|
30755
|
+
showCc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30716
30756
|
"input",
|
|
30717
30757
|
{
|
|
30718
30758
|
type: "text",
|
|
@@ -30722,7 +30762,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30722
30762
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
30723
30763
|
}
|
|
30724
30764
|
) }),
|
|
30725
|
-
showBcc && /* @__PURE__ */ (0,
|
|
30765
|
+
showBcc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30726
30766
|
"input",
|
|
30727
30767
|
{
|
|
30728
30768
|
type: "text",
|
|
@@ -30732,7 +30772,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30732
30772
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
30733
30773
|
}
|
|
30734
30774
|
) }),
|
|
30735
|
-
/* @__PURE__ */ (0,
|
|
30775
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
30736
30776
|
"input",
|
|
30737
30777
|
{
|
|
30738
30778
|
type: "text",
|
|
@@ -30742,11 +30782,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
30742
30782
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
30743
30783
|
}
|
|
30744
30784
|
) }),
|
|
30745
|
-
/* @__PURE__ */ (0,
|
|
30746
|
-
/* @__PURE__ */ (0,
|
|
30747
|
-
/* @__PURE__ */ (0,
|
|
30748
|
-
/* @__PURE__ */ (0,
|
|
30749
|
-
/* @__PURE__ */ (0,
|
|
30785
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(MyEditor, { value: body, onChange: setBody }) }),
|
|
30786
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
30787
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
30788
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
30789
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
30750
30790
|
] })
|
|
30751
30791
|
] }) });
|
|
30752
30792
|
}
|
|
@@ -30791,10 +30831,10 @@ function showSonnerToast({
|
|
|
30791
30831
|
// src/components/ui/sonner.tsx
|
|
30792
30832
|
var import_next_themes = require("next-themes");
|
|
30793
30833
|
var import_sonner2 = require("sonner");
|
|
30794
|
-
var
|
|
30834
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
30795
30835
|
var Toaster = ({ ...props }) => {
|
|
30796
30836
|
const { theme = "system" } = (0, import_next_themes.useTheme)();
|
|
30797
|
-
return /* @__PURE__ */ (0,
|
|
30837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
30798
30838
|
import_sonner2.Toaster,
|
|
30799
30839
|
{
|
|
30800
30840
|
theme,
|