@algorithm-shift/design-system 1.2.79 → 1.2.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +142 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +910 -373
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +893 -356
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -1
package/dist/index.mjs
CHANGED
|
@@ -233,7 +233,7 @@ function Repeater({
|
|
|
233
233
|
[items, count]
|
|
234
234
|
);
|
|
235
235
|
if (!list.length) {
|
|
236
|
-
return emptyFallback ? /* @__PURE__ */ jsx10(Fragment2, { children: emptyFallback }) :
|
|
236
|
+
return emptyFallback ? /* @__PURE__ */ jsx10(Fragment2, { children: emptyFallback }) : /* @__PURE__ */ jsx10("div", { className, children: "No items to display." });
|
|
237
237
|
}
|
|
238
238
|
const content = list.map((item, i) => /* @__PURE__ */ jsx10(React3.Fragment, { children: render(item, i, list) }, i));
|
|
239
239
|
return wrapper ? /* @__PURE__ */ jsx10(Fragment2, { children: wrapper(content) }) : /* @__PURE__ */ jsx10("div", { className, children: content });
|
|
@@ -27505,7 +27505,7 @@ function RichText({ className, style, ...props }) {
|
|
|
27505
27505
|
}
|
|
27506
27506
|
|
|
27507
27507
|
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
27508
|
-
import { useEffect as
|
|
27508
|
+
import { useEffect as useEffect15 } from "react";
|
|
27509
27509
|
|
|
27510
27510
|
// src/components/ui/select.tsx
|
|
27511
27511
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
@@ -27633,15 +27633,272 @@ function SelectScrollDownButton({
|
|
|
27633
27633
|
);
|
|
27634
27634
|
}
|
|
27635
27635
|
|
|
27636
|
-
// src/components/Inputs/Dropdown/
|
|
27636
|
+
// src/components/Inputs/Dropdown/LazyDropdown.tsx
|
|
27637
|
+
import { useState as useState5, useRef as useRef3, useEffect as useEffect14 } from "react";
|
|
27638
|
+
|
|
27639
|
+
// src/components/Wrappers/Portal.tsx
|
|
27640
|
+
import ReactDOM from "react-dom";
|
|
27641
|
+
var Portal3 = ({ children, container }) => {
|
|
27642
|
+
const target = container || document.body;
|
|
27643
|
+
return ReactDOM.createPortal(children, target);
|
|
27644
|
+
};
|
|
27645
|
+
var Portal_default = Portal3;
|
|
27646
|
+
|
|
27647
|
+
// src/hooks/useLazyDropdown.ts
|
|
27648
|
+
import { useState as useState4, useEffect as useEffect13, useRef as useRef2, useCallback as useCallback2 } from "react";
|
|
27649
|
+
import axios from "axios";
|
|
27650
|
+
function useLazyDropdown(config) {
|
|
27651
|
+
const [options, setOptions] = useState4([]);
|
|
27652
|
+
const [page, setPage] = useState4(1);
|
|
27653
|
+
const [hasMore, setHasMore] = useState4(true);
|
|
27654
|
+
const [loading, setLoading] = useState4(false);
|
|
27655
|
+
const [searchTerm, setSearchTerm] = useState4("");
|
|
27656
|
+
const debounceTimer = useRef2(null);
|
|
27657
|
+
const allDataRef = useRef2([]);
|
|
27658
|
+
const configRef = useRef2(config);
|
|
27659
|
+
const PAGE_SIZE = config.pageSize || 10;
|
|
27660
|
+
useEffect13(() => {
|
|
27661
|
+
configRef.current = config;
|
|
27662
|
+
}, [config]);
|
|
27663
|
+
const transformToOptions = useCallback2((data) => {
|
|
27664
|
+
if (!data || !Array.isArray(data)) return [];
|
|
27665
|
+
const cfg = configRef.current;
|
|
27666
|
+
return data.map((item) => ({
|
|
27667
|
+
value: item[cfg.dataKey] ?? item.id ?? "",
|
|
27668
|
+
label: item[cfg.dataLabel] ?? item.name ?? item.label ?? ""
|
|
27669
|
+
}));
|
|
27670
|
+
}, []);
|
|
27671
|
+
const fetchApiData = useCallback2(async (pageNum, term) => {
|
|
27672
|
+
if (!configRef.current.apiUrl) return [];
|
|
27673
|
+
const limit = PAGE_SIZE;
|
|
27674
|
+
const params = { page: pageNum, limit };
|
|
27675
|
+
if (term) params[configRef.current.dataLabel ?? "search"] = term;
|
|
27676
|
+
const res = await axios.get(configRef.current.apiUrl, {
|
|
27677
|
+
params,
|
|
27678
|
+
withCredentials: true
|
|
27679
|
+
});
|
|
27680
|
+
if (res.data?.success && Array.isArray(res.data.data)) {
|
|
27681
|
+
const data = res.data.data;
|
|
27682
|
+
return transformToOptions(data);
|
|
27683
|
+
}
|
|
27684
|
+
return [];
|
|
27685
|
+
}, [PAGE_SIZE, transformToOptions]);
|
|
27686
|
+
const loadPage = useCallback2(async (pageNum, term) => {
|
|
27687
|
+
const cfg = configRef.current;
|
|
27688
|
+
if (!cfg.enabled) return;
|
|
27689
|
+
setLoading(true);
|
|
27690
|
+
try {
|
|
27691
|
+
let pageOptions = [];
|
|
27692
|
+
if (cfg.dataSource === "api") {
|
|
27693
|
+
pageOptions = await fetchApiData(pageNum, term);
|
|
27694
|
+
setHasMore(pageOptions.length === PAGE_SIZE);
|
|
27695
|
+
} else {
|
|
27696
|
+
const allData = allDataRef.current || [];
|
|
27697
|
+
let filtered = allData;
|
|
27698
|
+
if (term) {
|
|
27699
|
+
const termLower = term.toLowerCase();
|
|
27700
|
+
filtered = allData.filter((item) => {
|
|
27701
|
+
const label = String(item[cfg.dataLabel] ?? item.name ?? item.label ?? "").toLowerCase();
|
|
27702
|
+
const value = String(item[cfg.dataKey] ?? item.id ?? "").toLowerCase();
|
|
27703
|
+
return label.includes(termLower) || value.includes(termLower);
|
|
27704
|
+
});
|
|
27705
|
+
}
|
|
27706
|
+
const start = (pageNum - 1) * PAGE_SIZE;
|
|
27707
|
+
const end = start + PAGE_SIZE;
|
|
27708
|
+
pageOptions = transformToOptions(filtered.slice(start, end));
|
|
27709
|
+
setHasMore(end < filtered.length);
|
|
27710
|
+
}
|
|
27711
|
+
setOptions((prev) => pageNum === 1 ? pageOptions : [...prev, ...pageOptions]);
|
|
27712
|
+
setPage(pageNum);
|
|
27713
|
+
} catch (err) {
|
|
27714
|
+
console.error("\u274C useLazyDropdown loadPage error:", err);
|
|
27715
|
+
setHasMore(false);
|
|
27716
|
+
} finally {
|
|
27717
|
+
setLoading(false);
|
|
27718
|
+
}
|
|
27719
|
+
}, [fetchApiData, transformToOptions]);
|
|
27720
|
+
const loadMore = useCallback2(() => {
|
|
27721
|
+
if (!loading && hasMore) {
|
|
27722
|
+
loadPage(page + 1, searchTerm);
|
|
27723
|
+
}
|
|
27724
|
+
}, [loading, hasMore, page, searchTerm, loadPage]);
|
|
27725
|
+
const search = useCallback2((term) => {
|
|
27726
|
+
setSearchTerm(term);
|
|
27727
|
+
if (debounceTimer.current) clearTimeout(debounceTimer.current);
|
|
27728
|
+
debounceTimer.current = setTimeout(() => {
|
|
27729
|
+
loadPage(1, term);
|
|
27730
|
+
}, 300);
|
|
27731
|
+
}, [loadPage]);
|
|
27732
|
+
const reset = useCallback2(() => {
|
|
27733
|
+
setSearchTerm("");
|
|
27734
|
+
setPage(1);
|
|
27735
|
+
loadPage(1, "");
|
|
27736
|
+
}, [loadPage]);
|
|
27737
|
+
useEffect13(() => {
|
|
27738
|
+
if (config.initialData?.length) {
|
|
27739
|
+
allDataRef.current = config.initialData;
|
|
27740
|
+
loadPage(1, "");
|
|
27741
|
+
}
|
|
27742
|
+
}, [config.initialData, loadPage]);
|
|
27743
|
+
useEffect13(() => {
|
|
27744
|
+
return () => {
|
|
27745
|
+
if (debounceTimer.current) clearTimeout(debounceTimer.current);
|
|
27746
|
+
};
|
|
27747
|
+
}, []);
|
|
27748
|
+
return {
|
|
27749
|
+
options,
|
|
27750
|
+
loading,
|
|
27751
|
+
hasMore,
|
|
27752
|
+
loadMore,
|
|
27753
|
+
search,
|
|
27754
|
+
reset,
|
|
27755
|
+
loadPage
|
|
27756
|
+
};
|
|
27757
|
+
}
|
|
27758
|
+
|
|
27759
|
+
// src/components/Inputs/Dropdown/LazyDropdown.tsx
|
|
27637
27760
|
import { Fragment as Fragment11, jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
27761
|
+
function LazySelectDropdown({
|
|
27762
|
+
options = [],
|
|
27763
|
+
value,
|
|
27764
|
+
onChange,
|
|
27765
|
+
placeholder,
|
|
27766
|
+
className,
|
|
27767
|
+
id,
|
|
27768
|
+
disabled,
|
|
27769
|
+
readOnly,
|
|
27770
|
+
source,
|
|
27771
|
+
apiUrl,
|
|
27772
|
+
pageSize,
|
|
27773
|
+
dataKey = "id",
|
|
27774
|
+
dataLabel = "name",
|
|
27775
|
+
errorMessage
|
|
27776
|
+
}) {
|
|
27777
|
+
const [isOpen, setIsOpen] = useState5(false);
|
|
27778
|
+
const [searchTerm, setSearchTerm] = useState5("");
|
|
27779
|
+
const dropdownRef = useRef3(null);
|
|
27780
|
+
const observerTarget = useRef3(null);
|
|
27781
|
+
const {
|
|
27782
|
+
options: lazyOptions,
|
|
27783
|
+
loading,
|
|
27784
|
+
hasMore,
|
|
27785
|
+
loadMore,
|
|
27786
|
+
search,
|
|
27787
|
+
reset,
|
|
27788
|
+
loadPage
|
|
27789
|
+
} = useLazyDropdown({
|
|
27790
|
+
enabled: true,
|
|
27791
|
+
dataSource: source || "",
|
|
27792
|
+
apiUrl,
|
|
27793
|
+
pageSize: pageSize || 10,
|
|
27794
|
+
dataKey,
|
|
27795
|
+
dataLabel,
|
|
27796
|
+
initialData: options || []
|
|
27797
|
+
});
|
|
27798
|
+
const selectedOption = lazyOptions.find((opt) => opt.value === value);
|
|
27799
|
+
useEffect14(() => {
|
|
27800
|
+
const handleClickOutside = (e) => {
|
|
27801
|
+
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
27802
|
+
setIsOpen(false);
|
|
27803
|
+
setSearchTerm("");
|
|
27804
|
+
}
|
|
27805
|
+
};
|
|
27806
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
27807
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
27808
|
+
}, []);
|
|
27809
|
+
useEffect14(() => {
|
|
27810
|
+
if (!isOpen || !hasMore || loading) return;
|
|
27811
|
+
const observer = new IntersectionObserver(
|
|
27812
|
+
(entries) => {
|
|
27813
|
+
if (entries[0].isIntersecting) loadMore();
|
|
27814
|
+
},
|
|
27815
|
+
{ threshold: 0.1 }
|
|
27816
|
+
);
|
|
27817
|
+
if (observerTarget.current) observer.observe(observerTarget.current);
|
|
27818
|
+
return () => observer.disconnect();
|
|
27819
|
+
}, [isOpen, hasMore, loading, loadMore]);
|
|
27820
|
+
const handleSearchChange = (e) => {
|
|
27821
|
+
const term = e.target.value;
|
|
27822
|
+
setSearchTerm(term);
|
|
27823
|
+
search(term);
|
|
27824
|
+
};
|
|
27825
|
+
const handleSelect = (optValue) => {
|
|
27826
|
+
onChange?.(optValue);
|
|
27827
|
+
setIsOpen(false);
|
|
27828
|
+
setSearchTerm("");
|
|
27829
|
+
reset();
|
|
27830
|
+
};
|
|
27831
|
+
const handleFocus = () => {
|
|
27832
|
+
if (!disabled) setIsOpen(true);
|
|
27833
|
+
loadPage(1, "");
|
|
27834
|
+
};
|
|
27835
|
+
return /* @__PURE__ */ jsxs18("div", { ref: dropdownRef, className: "relative w-full", children: [
|
|
27836
|
+
/* @__PURE__ */ jsx36(
|
|
27837
|
+
"input",
|
|
27838
|
+
{
|
|
27839
|
+
type: "text",
|
|
27840
|
+
id,
|
|
27841
|
+
name: id,
|
|
27842
|
+
className: cn(
|
|
27843
|
+
"w-full px-3 py-2 border border-[#BDBDBD] rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
|
|
27844
|
+
disabled ? "bg-gray-100 cursor-not-allowed" : "bg-white cursor-pointer",
|
|
27845
|
+
className,
|
|
27846
|
+
errorMessage ? "border-red-500" : ""
|
|
27847
|
+
),
|
|
27848
|
+
placeholder: selectedOption?.label || placeholder,
|
|
27849
|
+
value: isOpen ? searchTerm : selectedOption?.label || "",
|
|
27850
|
+
onFocus: handleFocus,
|
|
27851
|
+
onChange: handleSearchChange,
|
|
27852
|
+
readOnly: !isOpen || readOnly,
|
|
27853
|
+
disabled
|
|
27854
|
+
}
|
|
27855
|
+
),
|
|
27856
|
+
errorMessage && /* @__PURE__ */ jsx36("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
|
|
27857
|
+
isOpen && !disabled && /* @__PURE__ */ jsx36(Portal_default, { container: dropdownRef.current, children: /* @__PURE__ */ jsx36(
|
|
27858
|
+
"div",
|
|
27859
|
+
{
|
|
27860
|
+
className: "fixed z-[9999] w-fit mt-1 bg-white border border-gray-300 rounded-lg shadow-lg max-h-60 overflow-y-auto",
|
|
27861
|
+
style: { width: dropdownRef.current?.offsetWidth },
|
|
27862
|
+
children: loading && lazyOptions.length === 0 ? /* @__PURE__ */ jsxs18("div", { className: "px-3 py-4 text-center text-gray-500 flex items-center justify-center gap-2 text-sm", children: [
|
|
27863
|
+
/* @__PURE__ */ jsx36("div", { className: "animate-spin w-4 h-4 border-2 border-gray-300 border-t-blue-500 rounded-full" }),
|
|
27864
|
+
"Loading..."
|
|
27865
|
+
] }) : lazyOptions.length > 0 ? /* @__PURE__ */ jsxs18(Fragment11, { children: [
|
|
27866
|
+
lazyOptions.map((option, index) => /* @__PURE__ */ jsx36(
|
|
27867
|
+
"div",
|
|
27868
|
+
{
|
|
27869
|
+
onClick: () => handleSelect(option.value),
|
|
27870
|
+
className: `px-3 py-2 hover:bg-blue-50 cursor-pointer text-sm ${option.value === value ? "bg-blue-100" : ""}`,
|
|
27871
|
+
children: option.label
|
|
27872
|
+
},
|
|
27873
|
+
`${option.value}-${index}`
|
|
27874
|
+
)),
|
|
27875
|
+
hasMore && /* @__PURE__ */ jsx36(
|
|
27876
|
+
"div",
|
|
27877
|
+
{
|
|
27878
|
+
ref: observerTarget,
|
|
27879
|
+
className: "px-3 py-2 text-center text-gray-400 text-sm border-t",
|
|
27880
|
+
children: loading ? /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-center gap-2 text-sm", children: [
|
|
27881
|
+
/* @__PURE__ */ jsx36("div", { className: "animate-spin w-3 h-3 border-2 border-gray-300 border-t-blue-500 rounded-full" }),
|
|
27882
|
+
"Loading more..."
|
|
27883
|
+
] }) : "Scroll for more..."
|
|
27884
|
+
}
|
|
27885
|
+
)
|
|
27886
|
+
] }) : /* @__PURE__ */ jsx36("div", { className: "px-3 py-4 text-sm text-center text-gray-500", children: searchTerm ? `No results for "${searchTerm}"` : "No options available" })
|
|
27887
|
+
}
|
|
27888
|
+
) })
|
|
27889
|
+
] });
|
|
27890
|
+
}
|
|
27891
|
+
var LazyDropdown_default = LazySelectDropdown;
|
|
27892
|
+
|
|
27893
|
+
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
27894
|
+
import { Fragment as Fragment12, jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
27638
27895
|
var Dropdown = ({ className, style, ...props }) => {
|
|
27639
27896
|
const list = Array.isArray(props?.data) ? props.data : [];
|
|
27640
|
-
const placeholder = props.placeholder ? props.placeholder : "
|
|
27897
|
+
const placeholder = props.placeholder ? props.placeholder : "Select an option";
|
|
27641
27898
|
const isEditable = props.isEditable ?? true;
|
|
27642
27899
|
const isDisabled = props.isDisabled ?? false;
|
|
27643
27900
|
const isReadonly = props.isReadonly ?? false;
|
|
27644
|
-
|
|
27901
|
+
useEffect15(() => {
|
|
27645
27902
|
if (props.value !== void 0) {
|
|
27646
27903
|
handleChange(props.value);
|
|
27647
27904
|
}
|
|
@@ -27655,9 +27912,25 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
27655
27912
|
value: item[dataKey],
|
|
27656
27913
|
label: item[dataLabel]
|
|
27657
27914
|
}));
|
|
27658
|
-
|
|
27659
|
-
/* @__PURE__ */
|
|
27660
|
-
|
|
27915
|
+
if (props.lazyLoad) {
|
|
27916
|
+
return /* @__PURE__ */ jsx37(
|
|
27917
|
+
LazyDropdown_default,
|
|
27918
|
+
{
|
|
27919
|
+
...props,
|
|
27920
|
+
id: props.name || "lazy-select-field",
|
|
27921
|
+
options: list,
|
|
27922
|
+
onChange: handleChange,
|
|
27923
|
+
placeholder,
|
|
27924
|
+
className,
|
|
27925
|
+
style,
|
|
27926
|
+
disabled: isDisabled || !isEditable,
|
|
27927
|
+
readOnly: isReadonly
|
|
27928
|
+
}
|
|
27929
|
+
);
|
|
27930
|
+
}
|
|
27931
|
+
return /* @__PURE__ */ jsxs19(Fragment12, { children: [
|
|
27932
|
+
/* @__PURE__ */ jsxs19(Select, { name: props.name, value: props.value || "", onValueChange: handleChange, disabled: isDisabled || !isEditable, children: [
|
|
27933
|
+
/* @__PURE__ */ jsx37(
|
|
27661
27934
|
SelectTrigger,
|
|
27662
27935
|
{
|
|
27663
27936
|
id: props.name || "select-field",
|
|
@@ -27667,31 +27940,31 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
27667
27940
|
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
27668
27941
|
},
|
|
27669
27942
|
"aria-readonly": isReadonly,
|
|
27670
|
-
children: /* @__PURE__ */
|
|
27943
|
+
children: /* @__PURE__ */ jsx37(SelectValue, { placeholder })
|
|
27671
27944
|
}
|
|
27672
27945
|
),
|
|
27673
|
-
/* @__PURE__ */
|
|
27674
|
-
props.dataLoading && /* @__PURE__ */
|
|
27675
|
-
!props.dataLoading && options.length === 0 && /* @__PURE__ */
|
|
27676
|
-
options.map((opt) => /* @__PURE__ */
|
|
27946
|
+
/* @__PURE__ */ jsxs19(SelectContent, { children: [
|
|
27947
|
+
props.dataLoading && /* @__PURE__ */ jsx37(SelectItem, { value: "none", disabled: true, children: "Loading..." }),
|
|
27948
|
+
!props.dataLoading && options.length === 0 && /* @__PURE__ */ jsx37(SelectItem, { value: "none", disabled: true, children: "No options" }),
|
|
27949
|
+
options.map((opt) => /* @__PURE__ */ jsx37(SelectItem, { value: opt.value, children: opt.label }, opt.value))
|
|
27677
27950
|
] })
|
|
27678
27951
|
] }),
|
|
27679
|
-
props.errorMessage && /* @__PURE__ */
|
|
27952
|
+
props.errorMessage && /* @__PURE__ */ jsx37("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
27680
27953
|
] });
|
|
27681
27954
|
};
|
|
27682
27955
|
var Dropdown_default = Dropdown;
|
|
27683
27956
|
|
|
27684
27957
|
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
27685
|
-
import { useEffect as
|
|
27958
|
+
import { useEffect as useEffect16 } from "react";
|
|
27686
27959
|
|
|
27687
27960
|
// src/components/ui/switch.tsx
|
|
27688
27961
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
27689
|
-
import { jsx as
|
|
27962
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
27690
27963
|
function Switch({
|
|
27691
27964
|
className,
|
|
27692
27965
|
...props
|
|
27693
27966
|
}) {
|
|
27694
|
-
return /* @__PURE__ */
|
|
27967
|
+
return /* @__PURE__ */ jsx38(
|
|
27695
27968
|
SwitchPrimitive.Root,
|
|
27696
27969
|
{
|
|
27697
27970
|
"data-slot": "switch",
|
|
@@ -27700,7 +27973,7 @@ function Switch({
|
|
|
27700
27973
|
className
|
|
27701
27974
|
),
|
|
27702
27975
|
...props,
|
|
27703
|
-
children: /* @__PURE__ */
|
|
27976
|
+
children: /* @__PURE__ */ jsx38(
|
|
27704
27977
|
SwitchPrimitive.Thumb,
|
|
27705
27978
|
{
|
|
27706
27979
|
"data-slot": "switch-thumb",
|
|
@@ -27714,11 +27987,11 @@ function Switch({
|
|
|
27714
27987
|
}
|
|
27715
27988
|
|
|
27716
27989
|
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
27717
|
-
import { Fragment as
|
|
27990
|
+
import { Fragment as Fragment13, jsx as jsx39, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
27718
27991
|
var SwitchToggle = ({ className, style, ...props }) => {
|
|
27719
27992
|
const isEditable = props.isEditable ?? true;
|
|
27720
27993
|
const isDisabled = props.isDisabled ?? false;
|
|
27721
|
-
|
|
27994
|
+
useEffect16(() => {
|
|
27722
27995
|
if (props.value !== void 0) {
|
|
27723
27996
|
handleChange?.(props.value);
|
|
27724
27997
|
}
|
|
@@ -27726,9 +27999,9 @@ var SwitchToggle = ({ className, style, ...props }) => {
|
|
|
27726
27999
|
const handleChange = (value) => {
|
|
27727
28000
|
props.onChange?.(value);
|
|
27728
28001
|
};
|
|
27729
|
-
return /* @__PURE__ */
|
|
27730
|
-
/* @__PURE__ */
|
|
27731
|
-
/* @__PURE__ */
|
|
28002
|
+
return /* @__PURE__ */ jsxs20(Fragment13, { children: [
|
|
28003
|
+
/* @__PURE__ */ jsx39("div", { className, style, children: /* @__PURE__ */ jsxs20("div", { className: "flex items-center space-x-2 mb-2", children: [
|
|
28004
|
+
/* @__PURE__ */ jsx39(
|
|
27732
28005
|
Switch,
|
|
27733
28006
|
{
|
|
27734
28007
|
id: props.name || "switch",
|
|
@@ -27737,23 +28010,23 @@ var SwitchToggle = ({ className, style, ...props }) => {
|
|
|
27737
28010
|
disabled: isDisabled || !isEditable
|
|
27738
28011
|
}
|
|
27739
28012
|
),
|
|
27740
|
-
/* @__PURE__ */
|
|
28013
|
+
/* @__PURE__ */ jsx39(Label2, { htmlFor: props.name || "switch", children: props.text })
|
|
27741
28014
|
] }) }),
|
|
27742
|
-
props.errorMessage && /* @__PURE__ */
|
|
28015
|
+
props.errorMessage && /* @__PURE__ */ jsx39("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
27743
28016
|
] });
|
|
27744
28017
|
};
|
|
27745
28018
|
var SwitchToggle_default = SwitchToggle;
|
|
27746
28019
|
|
|
27747
28020
|
// src/components/Inputs/PhoneInput/PhoneInput.tsx
|
|
27748
|
-
import { useEffect as
|
|
28021
|
+
import { useEffect as useEffect17 } from "react";
|
|
27749
28022
|
import { PhoneInput as PhoneInputField } from "react-international-phone";
|
|
27750
28023
|
import "react-international-phone/style.css";
|
|
27751
|
-
import { Fragment as
|
|
28024
|
+
import { Fragment as Fragment14, jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
27752
28025
|
var PhoneInput = ({ className, style, ...props }) => {
|
|
27753
28026
|
const placeholder = props.placeholder ?? "Enter phone number";
|
|
27754
28027
|
const isEditable = props.isEditable ?? true;
|
|
27755
28028
|
const isDisabled = props.isDisabled ?? false;
|
|
27756
|
-
|
|
28029
|
+
useEffect17(() => {
|
|
27757
28030
|
if (props.value !== void 0) {
|
|
27758
28031
|
handleChange?.(props.value);
|
|
27759
28032
|
}
|
|
@@ -27761,8 +28034,8 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
27761
28034
|
const handleChange = (val) => {
|
|
27762
28035
|
props.onChange?.(val);
|
|
27763
28036
|
};
|
|
27764
|
-
return /* @__PURE__ */
|
|
27765
|
-
/* @__PURE__ */
|
|
28037
|
+
return /* @__PURE__ */ jsxs21(Fragment14, { children: [
|
|
28038
|
+
/* @__PURE__ */ jsx40(
|
|
27766
28039
|
PhoneInputField,
|
|
27767
28040
|
{
|
|
27768
28041
|
defaultCountry: "in",
|
|
@@ -27786,21 +28059,21 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
27786
28059
|
disabled: isDisabled || !isEditable
|
|
27787
28060
|
}
|
|
27788
28061
|
),
|
|
27789
|
-
props.errorMessage && /* @__PURE__ */
|
|
28062
|
+
props.errorMessage && /* @__PURE__ */ jsx40("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
27790
28063
|
] });
|
|
27791
28064
|
};
|
|
27792
28065
|
var PhoneInput_default = PhoneInput;
|
|
27793
28066
|
|
|
27794
28067
|
// src/components/Inputs/SearchInput/SearchInput.tsx
|
|
27795
|
-
import { useEffect as
|
|
27796
|
-
import { Fragment as
|
|
28068
|
+
import { useEffect as useEffect18 } from "react";
|
|
28069
|
+
import { Fragment as Fragment15, jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
27797
28070
|
var SearchInput = ({ className, style, ...props }) => {
|
|
27798
28071
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
27799
28072
|
const isEditable = props.isEditable ?? true;
|
|
27800
28073
|
const isDisabled = props.isDisabled ?? false;
|
|
27801
28074
|
const isReadonly = props.isReadonly ?? false;
|
|
27802
28075
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27803
|
-
|
|
28076
|
+
useEffect18(() => {
|
|
27804
28077
|
if (props.value !== void 0) {
|
|
27805
28078
|
const e = { target: { value: props.value } };
|
|
27806
28079
|
handleChange?.(e);
|
|
@@ -27809,8 +28082,8 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
27809
28082
|
const handleChange = (e) => {
|
|
27810
28083
|
props.onChange?.(e);
|
|
27811
28084
|
};
|
|
27812
|
-
return /* @__PURE__ */
|
|
27813
|
-
/* @__PURE__ */
|
|
28085
|
+
return /* @__PURE__ */ jsxs22(Fragment15, { children: [
|
|
28086
|
+
/* @__PURE__ */ jsx41("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ jsx41(
|
|
27814
28087
|
Input,
|
|
27815
28088
|
{
|
|
27816
28089
|
type: "text",
|
|
@@ -27829,17 +28102,17 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
27829
28102
|
readOnly: isReadonly
|
|
27830
28103
|
}
|
|
27831
28104
|
) }),
|
|
27832
|
-
props.errorMessage && /* @__PURE__ */
|
|
28105
|
+
props.errorMessage && /* @__PURE__ */ jsx41("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
27833
28106
|
] });
|
|
27834
28107
|
};
|
|
27835
28108
|
var SearchInput_default = SearchInput;
|
|
27836
28109
|
|
|
27837
28110
|
// src/components/Inputs/FileInput/FileInput.tsx
|
|
27838
|
-
import { useEffect as
|
|
27839
|
-
import { jsx as
|
|
28111
|
+
import { useEffect as useEffect19 } from "react";
|
|
28112
|
+
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
27840
28113
|
var FileInput2 = ({ className, style, ...props }) => {
|
|
27841
28114
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
27842
|
-
|
|
28115
|
+
useEffect19(() => {
|
|
27843
28116
|
if (props.value !== void 0) {
|
|
27844
28117
|
const e = { target: { value: props.value } };
|
|
27845
28118
|
handleChange?.(e);
|
|
@@ -27848,8 +28121,8 @@ var FileInput2 = ({ className, style, ...props }) => {
|
|
|
27848
28121
|
const handleChange = (e) => {
|
|
27849
28122
|
props.onChange?.(e);
|
|
27850
28123
|
};
|
|
27851
|
-
return /* @__PURE__ */
|
|
27852
|
-
/* @__PURE__ */
|
|
28124
|
+
return /* @__PURE__ */ jsxs23("div", { className: "d-flex items-center relative align-middle", children: [
|
|
28125
|
+
/* @__PURE__ */ jsx42(
|
|
27853
28126
|
Input,
|
|
27854
28127
|
{
|
|
27855
28128
|
type: "file",
|
|
@@ -27866,14 +28139,14 @@ var FileInput2 = ({ className, style, ...props }) => {
|
|
|
27866
28139
|
onChange: handleChange
|
|
27867
28140
|
}
|
|
27868
28141
|
),
|
|
27869
|
-
props.errorMessage && /* @__PURE__ */
|
|
28142
|
+
props.errorMessage && /* @__PURE__ */ jsx42("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
27870
28143
|
] });
|
|
27871
28144
|
};
|
|
27872
28145
|
var FileInput_default = FileInput2;
|
|
27873
28146
|
|
|
27874
28147
|
// src/components/Inputs/DatePicker/DatePicker.tsx
|
|
27875
|
-
import { useEffect as
|
|
27876
|
-
import { Fragment as
|
|
28148
|
+
import { useEffect as useEffect20 } from "react";
|
|
28149
|
+
import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
27877
28150
|
function DatePicker({ className, style, ...props }) {
|
|
27878
28151
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
27879
28152
|
const minimumDate = props.minimumDate ?? "none";
|
|
@@ -27898,7 +28171,7 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27898
28171
|
};
|
|
27899
28172
|
const minDate = resolveDate(minimumDate, customMinimumDate);
|
|
27900
28173
|
const maxDate = resolveDate(maximumDate, customMaximumDate);
|
|
27901
|
-
|
|
28174
|
+
useEffect20(() => {
|
|
27902
28175
|
if (props.value !== void 0) {
|
|
27903
28176
|
handleChange(props.value);
|
|
27904
28177
|
}
|
|
@@ -27910,8 +28183,8 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27910
28183
|
if (!value) return "";
|
|
27911
28184
|
return new Date(value).toISOString().split("T")[0];
|
|
27912
28185
|
};
|
|
27913
|
-
return /* @__PURE__ */
|
|
27914
|
-
/* @__PURE__ */
|
|
28186
|
+
return /* @__PURE__ */ jsxs24(Fragment16, { children: [
|
|
28187
|
+
/* @__PURE__ */ jsx43("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ jsx43(
|
|
27915
28188
|
Input,
|
|
27916
28189
|
{
|
|
27917
28190
|
type: "date",
|
|
@@ -27936,18 +28209,18 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27936
28209
|
max: maxDate
|
|
27937
28210
|
}
|
|
27938
28211
|
) }),
|
|
27939
|
-
props.errorMessage && /* @__PURE__ */
|
|
28212
|
+
props.errorMessage && /* @__PURE__ */ jsx43("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
27940
28213
|
] });
|
|
27941
28214
|
}
|
|
27942
28215
|
|
|
27943
28216
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
27944
|
-
import React7, { useEffect as
|
|
28217
|
+
import React7, { useEffect as useEffect22 } from "react";
|
|
27945
28218
|
import { addDays, format } from "date-fns";
|
|
27946
28219
|
|
|
27947
28220
|
// src/components/ui/calendar.tsx
|
|
27948
28221
|
import * as React6 from "react";
|
|
27949
28222
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
27950
|
-
import { jsx as
|
|
28223
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
27951
28224
|
function Calendar2({
|
|
27952
28225
|
className,
|
|
27953
28226
|
classNames,
|
|
@@ -27959,7 +28232,7 @@ function Calendar2({
|
|
|
27959
28232
|
...props
|
|
27960
28233
|
}) {
|
|
27961
28234
|
const defaultClassNames = getDefaultClassNames();
|
|
27962
|
-
return /* @__PURE__ */
|
|
28235
|
+
return /* @__PURE__ */ jsx44(
|
|
27963
28236
|
DayPicker,
|
|
27964
28237
|
{
|
|
27965
28238
|
showOutsideDays,
|
|
@@ -28058,7 +28331,7 @@ function Calendar2({
|
|
|
28058
28331
|
},
|
|
28059
28332
|
components: {
|
|
28060
28333
|
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
28061
|
-
return /* @__PURE__ */
|
|
28334
|
+
return /* @__PURE__ */ jsx44(
|
|
28062
28335
|
"div",
|
|
28063
28336
|
{
|
|
28064
28337
|
"data-slot": "calendar",
|
|
@@ -28070,10 +28343,10 @@ function Calendar2({
|
|
|
28070
28343
|
},
|
|
28071
28344
|
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
28072
28345
|
if (orientation === "left") {
|
|
28073
|
-
return /* @__PURE__ */
|
|
28346
|
+
return /* @__PURE__ */ jsx44(ChevronLeft, { className: cn("size-4", className2), ...props2 });
|
|
28074
28347
|
}
|
|
28075
28348
|
if (orientation === "right") {
|
|
28076
|
-
return /* @__PURE__ */
|
|
28349
|
+
return /* @__PURE__ */ jsx44(
|
|
28077
28350
|
ChevronRight,
|
|
28078
28351
|
{
|
|
28079
28352
|
className: cn("size-4", className2),
|
|
@@ -28081,11 +28354,11 @@ function Calendar2({
|
|
|
28081
28354
|
}
|
|
28082
28355
|
);
|
|
28083
28356
|
}
|
|
28084
|
-
return /* @__PURE__ */
|
|
28357
|
+
return /* @__PURE__ */ jsx44(ChevronDown, { className: cn("size-4", className2), ...props2 });
|
|
28085
28358
|
},
|
|
28086
28359
|
DayButton: CalendarDayButton,
|
|
28087
28360
|
WeekNumber: ({ children, ...props2 }) => {
|
|
28088
|
-
return /* @__PURE__ */
|
|
28361
|
+
return /* @__PURE__ */ jsx44("td", { ...props2, children: /* @__PURE__ */ jsx44("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
|
|
28089
28362
|
},
|
|
28090
28363
|
...components
|
|
28091
28364
|
},
|
|
@@ -28104,7 +28377,7 @@ function CalendarDayButton({
|
|
|
28104
28377
|
React6.useEffect(() => {
|
|
28105
28378
|
if (modifiers.focused) ref.current?.focus();
|
|
28106
28379
|
}, [modifiers.focused]);
|
|
28107
|
-
return /* @__PURE__ */
|
|
28380
|
+
return /* @__PURE__ */ jsx44(
|
|
28108
28381
|
Button,
|
|
28109
28382
|
{
|
|
28110
28383
|
ref,
|
|
@@ -28127,16 +28400,16 @@ function CalendarDayButton({
|
|
|
28127
28400
|
|
|
28128
28401
|
// src/components/ui/popover.tsx
|
|
28129
28402
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
28130
|
-
import { jsx as
|
|
28403
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
28131
28404
|
function Popover({
|
|
28132
28405
|
...props
|
|
28133
28406
|
}) {
|
|
28134
|
-
return /* @__PURE__ */
|
|
28407
|
+
return /* @__PURE__ */ jsx45(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
28135
28408
|
}
|
|
28136
28409
|
function PopoverTrigger({
|
|
28137
28410
|
...props
|
|
28138
28411
|
}) {
|
|
28139
|
-
return /* @__PURE__ */
|
|
28412
|
+
return /* @__PURE__ */ jsx45(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
28140
28413
|
}
|
|
28141
28414
|
function PopoverContent({
|
|
28142
28415
|
className,
|
|
@@ -28144,7 +28417,7 @@ function PopoverContent({
|
|
|
28144
28417
|
sideOffset = 4,
|
|
28145
28418
|
...props
|
|
28146
28419
|
}) {
|
|
28147
|
-
return /* @__PURE__ */
|
|
28420
|
+
return /* @__PURE__ */ jsx45(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx45(
|
|
28148
28421
|
PopoverPrimitive.Content,
|
|
28149
28422
|
{
|
|
28150
28423
|
"data-slot": "popover-content",
|
|
@@ -28160,7 +28433,7 @@ function PopoverContent({
|
|
|
28160
28433
|
}
|
|
28161
28434
|
|
|
28162
28435
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
28163
|
-
import { Fragment as
|
|
28436
|
+
import { Fragment as Fragment17, jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
28164
28437
|
var DateRange = ({ className, style, ...props }) => {
|
|
28165
28438
|
const isDateRange = (val) => !!val && val.from instanceof Date;
|
|
28166
28439
|
const [date, setDate] = React7.useState(
|
|
@@ -28169,7 +28442,7 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
28169
28442
|
to: addDays(/* @__PURE__ */ new Date(), 7)
|
|
28170
28443
|
}
|
|
28171
28444
|
);
|
|
28172
|
-
|
|
28445
|
+
useEffect22(() => {
|
|
28173
28446
|
if (props.value && isDateRange(props.value)) {
|
|
28174
28447
|
handleChange?.(props.value);
|
|
28175
28448
|
}
|
|
@@ -28180,9 +28453,9 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
28180
28453
|
props.onChange?.(value);
|
|
28181
28454
|
}
|
|
28182
28455
|
};
|
|
28183
|
-
return /* @__PURE__ */
|
|
28184
|
-
/* @__PURE__ */
|
|
28185
|
-
/* @__PURE__ */
|
|
28456
|
+
return /* @__PURE__ */ jsxs25(Fragment17, { children: [
|
|
28457
|
+
/* @__PURE__ */ jsx46("div", { className, style, children: /* @__PURE__ */ jsxs25(Popover, { children: [
|
|
28458
|
+
/* @__PURE__ */ jsx46(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx46(
|
|
28186
28459
|
Button,
|
|
28187
28460
|
{
|
|
28188
28461
|
id: "date",
|
|
@@ -28191,15 +28464,15 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
28191
28464
|
"w-full justify-start text-left font-normal text-[11px] border-[#BDBDBD]",
|
|
28192
28465
|
!date && "text-muted-foreground"
|
|
28193
28466
|
),
|
|
28194
|
-
children: date?.from ? date.to ? /* @__PURE__ */
|
|
28467
|
+
children: date?.from ? date.to ? /* @__PURE__ */ jsxs25(Fragment17, { children: [
|
|
28195
28468
|
format(date.from, "LLL dd, y"),
|
|
28196
28469
|
" -",
|
|
28197
28470
|
" ",
|
|
28198
28471
|
format(date.to, "LLL dd, y")
|
|
28199
|
-
] }) : format(date.from, "LLL dd, y") : /* @__PURE__ */
|
|
28472
|
+
] }) : format(date.from, "LLL dd, y") : /* @__PURE__ */ jsx46("span", { children: "Pick a date range" })
|
|
28200
28473
|
}
|
|
28201
28474
|
) }),
|
|
28202
|
-
/* @__PURE__ */
|
|
28475
|
+
/* @__PURE__ */ jsx46(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx46(
|
|
28203
28476
|
Calendar2,
|
|
28204
28477
|
{
|
|
28205
28478
|
mode: "range",
|
|
@@ -28210,21 +28483,21 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
28210
28483
|
}
|
|
28211
28484
|
) })
|
|
28212
28485
|
] }) }),
|
|
28213
|
-
props.errorMessage && /* @__PURE__ */
|
|
28486
|
+
props.errorMessage && /* @__PURE__ */ jsx46("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
28214
28487
|
] });
|
|
28215
28488
|
};
|
|
28216
28489
|
var DateRange_default = DateRange;
|
|
28217
28490
|
|
|
28218
28491
|
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
28219
|
-
import { useEffect as
|
|
28220
|
-
import { Fragment as
|
|
28492
|
+
import { useEffect as useEffect23 } from "react";
|
|
28493
|
+
import { Fragment as Fragment18, jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
28221
28494
|
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
28222
28495
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
28223
28496
|
const isEditable = props.isEditable ?? true;
|
|
28224
28497
|
const isDisabled = props.isDisabled ?? false;
|
|
28225
28498
|
const isReadonly = props.isReadonly ?? false;
|
|
28226
28499
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
28227
|
-
|
|
28500
|
+
useEffect23(() => {
|
|
28228
28501
|
if (props.value !== void 0) {
|
|
28229
28502
|
const e = { target: { value: props.value } };
|
|
28230
28503
|
handleChange?.(e);
|
|
@@ -28233,8 +28506,8 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28233
28506
|
const handleChange = (e) => {
|
|
28234
28507
|
props.onChange?.(e);
|
|
28235
28508
|
};
|
|
28236
|
-
return /* @__PURE__ */
|
|
28237
|
-
/* @__PURE__ */
|
|
28509
|
+
return /* @__PURE__ */ jsxs26(Fragment18, { children: [
|
|
28510
|
+
/* @__PURE__ */ jsxs26(
|
|
28238
28511
|
"div",
|
|
28239
28512
|
{
|
|
28240
28513
|
className: cn(
|
|
@@ -28244,8 +28517,8 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28244
28517
|
props.errorMessage ? "border-red-500" : ""
|
|
28245
28518
|
),
|
|
28246
28519
|
children: [
|
|
28247
|
-
prepend && /* @__PURE__ */
|
|
28248
|
-
/* @__PURE__ */
|
|
28520
|
+
prepend && /* @__PURE__ */ jsx47("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-l-md", children: prepend }),
|
|
28521
|
+
/* @__PURE__ */ jsx47(
|
|
28249
28522
|
Input,
|
|
28250
28523
|
{
|
|
28251
28524
|
id: props.name || "prepend-input",
|
|
@@ -28267,11 +28540,11 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28267
28540
|
readOnly: isReadonly
|
|
28268
28541
|
}
|
|
28269
28542
|
),
|
|
28270
|
-
append && /* @__PURE__ */
|
|
28543
|
+
append && /* @__PURE__ */ jsx47("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-r-md", children: append })
|
|
28271
28544
|
]
|
|
28272
28545
|
}
|
|
28273
28546
|
),
|
|
28274
|
-
props.errorMessage && /* @__PURE__ */
|
|
28547
|
+
props.errorMessage && /* @__PURE__ */ jsx47("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
28275
28548
|
] });
|
|
28276
28549
|
};
|
|
28277
28550
|
var TextInputGroup_default = TextInputGroup;
|
|
@@ -28284,22 +28557,22 @@ import { Command as CommandPrimitive } from "cmdk";
|
|
|
28284
28557
|
|
|
28285
28558
|
// src/components/ui/dialog.tsx
|
|
28286
28559
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
28287
|
-
import { jsx as
|
|
28560
|
+
import { jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
28288
28561
|
function Dialog({
|
|
28289
28562
|
...props
|
|
28290
28563
|
}) {
|
|
28291
|
-
return /* @__PURE__ */
|
|
28564
|
+
return /* @__PURE__ */ jsx48(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
28292
28565
|
}
|
|
28293
28566
|
function DialogPortal({
|
|
28294
28567
|
...props
|
|
28295
28568
|
}) {
|
|
28296
|
-
return /* @__PURE__ */
|
|
28569
|
+
return /* @__PURE__ */ jsx48(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
28297
28570
|
}
|
|
28298
28571
|
function DialogOverlay({
|
|
28299
28572
|
className,
|
|
28300
28573
|
...props
|
|
28301
28574
|
}) {
|
|
28302
|
-
return /* @__PURE__ */
|
|
28575
|
+
return /* @__PURE__ */ jsx48(
|
|
28303
28576
|
DialogPrimitive.Overlay,
|
|
28304
28577
|
{
|
|
28305
28578
|
"data-slot": "dialog-overlay",
|
|
@@ -28317,9 +28590,9 @@ function DialogContent({
|
|
|
28317
28590
|
showCloseButton = true,
|
|
28318
28591
|
...props
|
|
28319
28592
|
}) {
|
|
28320
|
-
return /* @__PURE__ */
|
|
28321
|
-
/* @__PURE__ */
|
|
28322
|
-
/* @__PURE__ */
|
|
28593
|
+
return /* @__PURE__ */ jsxs27(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
28594
|
+
/* @__PURE__ */ jsx48(DialogOverlay, {}),
|
|
28595
|
+
/* @__PURE__ */ jsxs27(
|
|
28323
28596
|
DialogPrimitive.Content,
|
|
28324
28597
|
{
|
|
28325
28598
|
"data-slot": "dialog-content",
|
|
@@ -28330,14 +28603,14 @@ function DialogContent({
|
|
|
28330
28603
|
...props,
|
|
28331
28604
|
children: [
|
|
28332
28605
|
children,
|
|
28333
|
-
showCloseButton && /* @__PURE__ */
|
|
28606
|
+
showCloseButton && /* @__PURE__ */ jsxs27(
|
|
28334
28607
|
DialogPrimitive.Close,
|
|
28335
28608
|
{
|
|
28336
28609
|
"data-slot": "dialog-close",
|
|
28337
28610
|
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",
|
|
28338
28611
|
children: [
|
|
28339
|
-
/* @__PURE__ */
|
|
28340
|
-
/* @__PURE__ */
|
|
28612
|
+
/* @__PURE__ */ jsx48(X, {}),
|
|
28613
|
+
/* @__PURE__ */ jsx48("span", { className: "sr-only", children: "Close" })
|
|
28341
28614
|
]
|
|
28342
28615
|
}
|
|
28343
28616
|
)
|
|
@@ -28347,7 +28620,7 @@ function DialogContent({
|
|
|
28347
28620
|
] });
|
|
28348
28621
|
}
|
|
28349
28622
|
function DialogHeader({ className, ...props }) {
|
|
28350
|
-
return /* @__PURE__ */
|
|
28623
|
+
return /* @__PURE__ */ jsx48(
|
|
28351
28624
|
"div",
|
|
28352
28625
|
{
|
|
28353
28626
|
"data-slot": "dialog-header",
|
|
@@ -28357,7 +28630,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
28357
28630
|
);
|
|
28358
28631
|
}
|
|
28359
28632
|
function DialogFooter({ className, ...props }) {
|
|
28360
|
-
return /* @__PURE__ */
|
|
28633
|
+
return /* @__PURE__ */ jsx48(
|
|
28361
28634
|
"div",
|
|
28362
28635
|
{
|
|
28363
28636
|
"data-slot": "dialog-footer",
|
|
@@ -28373,7 +28646,7 @@ function DialogTitle({
|
|
|
28373
28646
|
className,
|
|
28374
28647
|
...props
|
|
28375
28648
|
}) {
|
|
28376
|
-
return /* @__PURE__ */
|
|
28649
|
+
return /* @__PURE__ */ jsx48(
|
|
28377
28650
|
DialogPrimitive.Title,
|
|
28378
28651
|
{
|
|
28379
28652
|
"data-slot": "dialog-title",
|
|
@@ -28386,7 +28659,7 @@ function DialogDescription({
|
|
|
28386
28659
|
className,
|
|
28387
28660
|
...props
|
|
28388
28661
|
}) {
|
|
28389
|
-
return /* @__PURE__ */
|
|
28662
|
+
return /* @__PURE__ */ jsx48(
|
|
28390
28663
|
DialogPrimitive.Description,
|
|
28391
28664
|
{
|
|
28392
28665
|
"data-slot": "dialog-description",
|
|
@@ -28397,12 +28670,12 @@ function DialogDescription({
|
|
|
28397
28670
|
}
|
|
28398
28671
|
|
|
28399
28672
|
// src/components/ui/command.tsx
|
|
28400
|
-
import { jsx as
|
|
28673
|
+
import { jsx as jsx49, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
28401
28674
|
function Command2({
|
|
28402
28675
|
className,
|
|
28403
28676
|
...props
|
|
28404
28677
|
}) {
|
|
28405
|
-
return /* @__PURE__ */
|
|
28678
|
+
return /* @__PURE__ */ jsx49(
|
|
28406
28679
|
CommandPrimitive,
|
|
28407
28680
|
{
|
|
28408
28681
|
"data-slot": "command",
|
|
@@ -28418,14 +28691,14 @@ function CommandInput({
|
|
|
28418
28691
|
className,
|
|
28419
28692
|
...props
|
|
28420
28693
|
}) {
|
|
28421
|
-
return /* @__PURE__ */
|
|
28694
|
+
return /* @__PURE__ */ jsxs28(
|
|
28422
28695
|
"div",
|
|
28423
28696
|
{
|
|
28424
28697
|
"data-slot": "command-input-wrapper",
|
|
28425
28698
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
28426
28699
|
children: [
|
|
28427
|
-
/* @__PURE__ */
|
|
28428
|
-
/* @__PURE__ */
|
|
28700
|
+
/* @__PURE__ */ jsx49(Search, { className: "size-4 shrink-0 opacity-50" }),
|
|
28701
|
+
/* @__PURE__ */ jsx49(
|
|
28429
28702
|
CommandPrimitive.Input,
|
|
28430
28703
|
{
|
|
28431
28704
|
"data-slot": "command-input",
|
|
@@ -28444,7 +28717,7 @@ function CommandList({
|
|
|
28444
28717
|
className,
|
|
28445
28718
|
...props
|
|
28446
28719
|
}) {
|
|
28447
|
-
return /* @__PURE__ */
|
|
28720
|
+
return /* @__PURE__ */ jsx49(
|
|
28448
28721
|
CommandPrimitive.List,
|
|
28449
28722
|
{
|
|
28450
28723
|
"data-slot": "command-list",
|
|
@@ -28459,7 +28732,7 @@ function CommandList({
|
|
|
28459
28732
|
function CommandEmpty({
|
|
28460
28733
|
...props
|
|
28461
28734
|
}) {
|
|
28462
|
-
return /* @__PURE__ */
|
|
28735
|
+
return /* @__PURE__ */ jsx49(
|
|
28463
28736
|
CommandPrimitive.Empty,
|
|
28464
28737
|
{
|
|
28465
28738
|
"data-slot": "command-empty",
|
|
@@ -28472,7 +28745,7 @@ function CommandGroup({
|
|
|
28472
28745
|
className,
|
|
28473
28746
|
...props
|
|
28474
28747
|
}) {
|
|
28475
|
-
return /* @__PURE__ */
|
|
28748
|
+
return /* @__PURE__ */ jsx49(
|
|
28476
28749
|
CommandPrimitive.Group,
|
|
28477
28750
|
{
|
|
28478
28751
|
"data-slot": "command-group",
|
|
@@ -28488,7 +28761,7 @@ function CommandItem({
|
|
|
28488
28761
|
className,
|
|
28489
28762
|
...props
|
|
28490
28763
|
}) {
|
|
28491
|
-
return /* @__PURE__ */
|
|
28764
|
+
return /* @__PURE__ */ jsx49(
|
|
28492
28765
|
CommandPrimitive.Item,
|
|
28493
28766
|
{
|
|
28494
28767
|
"data-slot": "command-item",
|
|
@@ -28502,7 +28775,7 @@ function CommandItem({
|
|
|
28502
28775
|
}
|
|
28503
28776
|
|
|
28504
28777
|
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
28505
|
-
import { jsx as
|
|
28778
|
+
import { jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
28506
28779
|
var MultiSelect = ({
|
|
28507
28780
|
value = [],
|
|
28508
28781
|
onChange,
|
|
@@ -28527,15 +28800,18 @@ var MultiSelect = ({
|
|
|
28527
28800
|
);
|
|
28528
28801
|
};
|
|
28529
28802
|
const selectedLabels = React8.useMemo(
|
|
28530
|
-
() =>
|
|
28803
|
+
() => {
|
|
28804
|
+
if (!data || !value) return [];
|
|
28805
|
+
return data?.filter((opt) => value.includes(opt.value)).map((opt) => opt.label);
|
|
28806
|
+
},
|
|
28531
28807
|
[data, value]
|
|
28532
28808
|
);
|
|
28533
|
-
const options = data
|
|
28809
|
+
const options = data && data?.map((item) => ({
|
|
28534
28810
|
value: item[dataKey],
|
|
28535
28811
|
label: item[dataLabel]
|
|
28536
28812
|
}));
|
|
28537
|
-
return /* @__PURE__ */
|
|
28538
|
-
/* @__PURE__ */
|
|
28813
|
+
return /* @__PURE__ */ jsxs29(Popover, { open, onOpenChange: setOpen, children: [
|
|
28814
|
+
/* @__PURE__ */ jsx50(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs29(
|
|
28539
28815
|
Button,
|
|
28540
28816
|
{
|
|
28541
28817
|
variant: "outline",
|
|
@@ -28544,12 +28820,12 @@ var MultiSelect = ({
|
|
|
28544
28820
|
disabled,
|
|
28545
28821
|
type: "button",
|
|
28546
28822
|
children: [
|
|
28547
|
-
/* @__PURE__ */
|
|
28548
|
-
/* @__PURE__ */
|
|
28823
|
+
/* @__PURE__ */ jsx50("span", { className: "truncate", children: selectedLabels.length > 0 ? selectedLabels.join(", ") : placeholder }),
|
|
28824
|
+
/* @__PURE__ */ jsx50(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
28549
28825
|
]
|
|
28550
28826
|
}
|
|
28551
28827
|
) }),
|
|
28552
|
-
/* @__PURE__ */
|
|
28828
|
+
/* @__PURE__ */ jsx50(
|
|
28553
28829
|
PopoverContent,
|
|
28554
28830
|
{
|
|
28555
28831
|
align: "start",
|
|
@@ -28558,26 +28834,26 @@ var MultiSelect = ({
|
|
|
28558
28834
|
onInteractOutside: (e) => {
|
|
28559
28835
|
if (e.target.closest(".keep-open")) e.preventDefault();
|
|
28560
28836
|
},
|
|
28561
|
-
children: /* @__PURE__ */
|
|
28562
|
-
searchable && /* @__PURE__ */
|
|
28563
|
-
/* @__PURE__ */
|
|
28564
|
-
/* @__PURE__ */
|
|
28565
|
-
/* @__PURE__ */
|
|
28837
|
+
children: /* @__PURE__ */ jsxs29(Command2, { shouldFilter: searchable, children: [
|
|
28838
|
+
searchable && /* @__PURE__ */ jsx50(CommandInput, { placeholder: "Search..." }),
|
|
28839
|
+
/* @__PURE__ */ jsxs29(CommandList, { children: [
|
|
28840
|
+
/* @__PURE__ */ jsx50(CommandEmpty, { children: "No options found." }),
|
|
28841
|
+
/* @__PURE__ */ jsx50(CommandGroup, { children: options.map((opt) => {
|
|
28566
28842
|
const isSelected = value.includes(opt.value);
|
|
28567
|
-
return /* @__PURE__ */
|
|
28843
|
+
return /* @__PURE__ */ jsx50(
|
|
28568
28844
|
"div",
|
|
28569
28845
|
{
|
|
28570
28846
|
className: "keep-open",
|
|
28571
|
-
children: /* @__PURE__ */
|
|
28847
|
+
children: /* @__PURE__ */ jsx50(
|
|
28572
28848
|
CommandItem,
|
|
28573
28849
|
{
|
|
28574
28850
|
onMouseDown: (e) => {
|
|
28575
28851
|
e.preventDefault();
|
|
28576
28852
|
toggleOption(opt.value);
|
|
28577
28853
|
},
|
|
28578
|
-
children: /* @__PURE__ */
|
|
28579
|
-
/* @__PURE__ */
|
|
28580
|
-
/* @__PURE__ */
|
|
28854
|
+
children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
|
|
28855
|
+
/* @__PURE__ */ jsx50(Checkbox, { checked: isSelected }),
|
|
28856
|
+
/* @__PURE__ */ jsx50("span", { children: opt.label })
|
|
28581
28857
|
] })
|
|
28582
28858
|
},
|
|
28583
28859
|
opt.value
|
|
@@ -28590,7 +28866,7 @@ var MultiSelect = ({
|
|
|
28590
28866
|
] })
|
|
28591
28867
|
}
|
|
28592
28868
|
),
|
|
28593
|
-
props.errorMessage && /* @__PURE__ */
|
|
28869
|
+
props.errorMessage && /* @__PURE__ */ jsx50("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
28594
28870
|
] });
|
|
28595
28871
|
};
|
|
28596
28872
|
var MultiSelect_default = MultiSelect;
|
|
@@ -28608,14 +28884,14 @@ import {
|
|
|
28608
28884
|
} from "@tanstack/react-table";
|
|
28609
28885
|
|
|
28610
28886
|
// src/components/ui/table.tsx
|
|
28611
|
-
import { jsx as
|
|
28887
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
28612
28888
|
function Table3({ className, ...props }) {
|
|
28613
|
-
return /* @__PURE__ */
|
|
28889
|
+
return /* @__PURE__ */ jsx51(
|
|
28614
28890
|
"div",
|
|
28615
28891
|
{
|
|
28616
28892
|
"data-slot": "table-container",
|
|
28617
28893
|
className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
|
|
28618
|
-
children: /* @__PURE__ */
|
|
28894
|
+
children: /* @__PURE__ */ jsx51(
|
|
28619
28895
|
"table",
|
|
28620
28896
|
{
|
|
28621
28897
|
"data-slot": "table",
|
|
@@ -28627,7 +28903,7 @@ function Table3({ className, ...props }) {
|
|
|
28627
28903
|
);
|
|
28628
28904
|
}
|
|
28629
28905
|
function TableHeader({ className, ...props }) {
|
|
28630
|
-
return /* @__PURE__ */
|
|
28906
|
+
return /* @__PURE__ */ jsx51(
|
|
28631
28907
|
"thead",
|
|
28632
28908
|
{
|
|
28633
28909
|
"data-slot": "table-header",
|
|
@@ -28640,7 +28916,7 @@ function TableHeader({ className, ...props }) {
|
|
|
28640
28916
|
);
|
|
28641
28917
|
}
|
|
28642
28918
|
function TableBody({ className, ...props }) {
|
|
28643
|
-
return /* @__PURE__ */
|
|
28919
|
+
return /* @__PURE__ */ jsx51(
|
|
28644
28920
|
"tbody",
|
|
28645
28921
|
{
|
|
28646
28922
|
"data-slot": "table-body",
|
|
@@ -28653,7 +28929,7 @@ function TableBody({ className, ...props }) {
|
|
|
28653
28929
|
);
|
|
28654
28930
|
}
|
|
28655
28931
|
function TableRow({ className, ...props }) {
|
|
28656
|
-
return /* @__PURE__ */
|
|
28932
|
+
return /* @__PURE__ */ jsx51(
|
|
28657
28933
|
"tr",
|
|
28658
28934
|
{
|
|
28659
28935
|
"data-slot": "table-row",
|
|
@@ -28666,7 +28942,7 @@ function TableRow({ className, ...props }) {
|
|
|
28666
28942
|
);
|
|
28667
28943
|
}
|
|
28668
28944
|
function TableHead({ className, ...props }) {
|
|
28669
|
-
return /* @__PURE__ */
|
|
28945
|
+
return /* @__PURE__ */ jsx51(
|
|
28670
28946
|
"th",
|
|
28671
28947
|
{
|
|
28672
28948
|
"data-slot": "table-head",
|
|
@@ -28679,7 +28955,7 @@ function TableHead({ className, ...props }) {
|
|
|
28679
28955
|
);
|
|
28680
28956
|
}
|
|
28681
28957
|
function TableCell({ className, ...props }) {
|
|
28682
|
-
return /* @__PURE__ */
|
|
28958
|
+
return /* @__PURE__ */ jsx51(
|
|
28683
28959
|
"td",
|
|
28684
28960
|
{
|
|
28685
28961
|
"data-slot": "table-cell",
|
|
@@ -28692,8 +28968,271 @@ function TableCell({ className, ...props }) {
|
|
|
28692
28968
|
);
|
|
28693
28969
|
}
|
|
28694
28970
|
|
|
28971
|
+
// src/lib/table/useDynamicColumns.ts
|
|
28972
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
28973
|
+
|
|
28974
|
+
// src/lib/table/cellRendererFactory.tsx
|
|
28975
|
+
import Image2 from "next/image";
|
|
28976
|
+
|
|
28977
|
+
// src/lib/dayjs-setup.ts
|
|
28978
|
+
import dayjs from "dayjs";
|
|
28979
|
+
import utc from "dayjs/plugin/utc";
|
|
28980
|
+
dayjs.extend(utc);
|
|
28981
|
+
var dayjs_setup_default = dayjs;
|
|
28982
|
+
|
|
28983
|
+
// src/lib/table/valueFormatter.ts
|
|
28984
|
+
var valueFormatter = (value, format2, customFormatters = {}) => {
|
|
28985
|
+
if (!format2) return value;
|
|
28986
|
+
if (value == null) return "";
|
|
28987
|
+
if (format2.startsWith("custom:")) {
|
|
28988
|
+
const key = format2.replace("custom:", "");
|
|
28989
|
+
return customFormatters[key] ? customFormatters[key](value) : value;
|
|
28990
|
+
}
|
|
28991
|
+
const [type, arg] = format2.split(":");
|
|
28992
|
+
switch (type) {
|
|
28993
|
+
case "date":
|
|
28994
|
+
return dayjs_setup_default(value).format(arg || "YYYY-MM-DD");
|
|
28995
|
+
case "datetime":
|
|
28996
|
+
const parsed = dayjs_setup_default(value).isValid() ? dayjs_setup_default(value).utc() : dayjs_setup_default(value);
|
|
28997
|
+
return parsed.format("YYYY-MM-DD hh:mm");
|
|
28998
|
+
case "days":
|
|
28999
|
+
return dayjs_setup_default().diff(dayjs_setup_default(value), "day");
|
|
29000
|
+
case "months":
|
|
29001
|
+
return dayjs_setup_default().diff(dayjs_setup_default(value), "month");
|
|
29002
|
+
case "years":
|
|
29003
|
+
return dayjs_setup_default().diff(dayjs_setup_default(value), "year");
|
|
29004
|
+
case "time":
|
|
29005
|
+
return dayjs_setup_default(value).format("HH:mm");
|
|
29006
|
+
case "number":
|
|
29007
|
+
return Number(value).toFixed(parseInt(arg || "2"));
|
|
29008
|
+
case "currency":
|
|
29009
|
+
return new Intl.NumberFormat("en-IN", {
|
|
29010
|
+
style: "currency",
|
|
29011
|
+
currency: arg || "INR"
|
|
29012
|
+
}).format(Number(value));
|
|
29013
|
+
case "uppercase":
|
|
29014
|
+
return String(value).toUpperCase();
|
|
29015
|
+
case "lowercase":
|
|
29016
|
+
return String(value).toLowerCase();
|
|
29017
|
+
default:
|
|
29018
|
+
return value;
|
|
29019
|
+
}
|
|
29020
|
+
};
|
|
29021
|
+
|
|
29022
|
+
// src/lib/table/cellRendererFactory.tsx
|
|
29023
|
+
import { Fragment as Fragment19, jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
29024
|
+
var getContrastColor = (bg) => {
|
|
29025
|
+
let c = bg.trim().toUpperCase();
|
|
29026
|
+
if (/^#([a-fA-F0-9]{3})$/.test(c)) {
|
|
29027
|
+
c = "#" + c.slice(1).split("").map((x) => x + x).join("");
|
|
29028
|
+
}
|
|
29029
|
+
const named = {
|
|
29030
|
+
white: "#FFFFFF",
|
|
29031
|
+
black: "#000000",
|
|
29032
|
+
red: "#FF0000",
|
|
29033
|
+
green: "#008000",
|
|
29034
|
+
blue: "#0000FF",
|
|
29035
|
+
gray: "#808080",
|
|
29036
|
+
grey: "#808080",
|
|
29037
|
+
orange: "#FFA500",
|
|
29038
|
+
yellow: "#FFFF00",
|
|
29039
|
+
purple: "#800080",
|
|
29040
|
+
pink: "#FFC0CB",
|
|
29041
|
+
teal: "#008080"
|
|
29042
|
+
};
|
|
29043
|
+
if (!c.startsWith("#")) {
|
|
29044
|
+
const lower = c.toLowerCase();
|
|
29045
|
+
if (named[lower]) c = named[lower];
|
|
29046
|
+
else return "#FFFFFF";
|
|
29047
|
+
}
|
|
29048
|
+
if (!/^#([a-fA-F0-9]{6})$/.test(c)) return "#FFFFFF";
|
|
29049
|
+
const r = parseInt(c.slice(1, 3), 16);
|
|
29050
|
+
const g = parseInt(c.slice(3, 5), 16);
|
|
29051
|
+
const b = parseInt(c.slice(5, 7), 16);
|
|
29052
|
+
const brightness = (r * 299 + g * 587 + b * 114) / 1e3;
|
|
29053
|
+
return brightness > 160 ? "#000000" : "#FFFFFF";
|
|
29054
|
+
};
|
|
29055
|
+
var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers = {}, format2, customFormatters = {}) => {
|
|
29056
|
+
const formattedValue = valueFormatter(value, format2, customFormatters);
|
|
29057
|
+
switch (renderer) {
|
|
29058
|
+
/* -------------------- BASIC -------------------- */
|
|
29059
|
+
case "text":
|
|
29060
|
+
return /* @__PURE__ */ jsx52("span", { children: row?.[rendererProps?.rowField] || formattedValue });
|
|
29061
|
+
case "number":
|
|
29062
|
+
return /* @__PURE__ */ jsx52("span", { className: "tabular-nums text-right", children: valueFormatter(row?.[rendererProps?.rowField] || value, "number:2") });
|
|
29063
|
+
case "date":
|
|
29064
|
+
return /* @__PURE__ */ jsx52("span", { children: valueFormatter(row?.[rendererProps?.rowField] || value, format2) });
|
|
29065
|
+
case "link":
|
|
29066
|
+
return /* @__PURE__ */ jsx52(
|
|
29067
|
+
"a",
|
|
29068
|
+
{
|
|
29069
|
+
href: `${rendererProps?.prefix || ""}${row?.[rendererProps?.rowField] || formattedValue}`,
|
|
29070
|
+
target: "_blank",
|
|
29071
|
+
rel: "noreferrer",
|
|
29072
|
+
className: `text-blue-500 underline ${rendererProps?.className || ""}`,
|
|
29073
|
+
children: rendererProps?.label || formattedValue
|
|
29074
|
+
}
|
|
29075
|
+
);
|
|
29076
|
+
/* -------------------- VISUAL -------------------- */
|
|
29077
|
+
case "image":
|
|
29078
|
+
return /* @__PURE__ */ jsx52("div", { className: "relative", children: /* @__PURE__ */ jsx52(
|
|
29079
|
+
Image2,
|
|
29080
|
+
{
|
|
29081
|
+
src: row?.[rendererProps?.rowField] || formattedValue || rendererProps?.fallback || "/placeholder.png",
|
|
29082
|
+
alt: rendererProps?.alt || "",
|
|
29083
|
+
width: rendererProps?.width || 40,
|
|
29084
|
+
height: rendererProps?.height || 40,
|
|
29085
|
+
className: `object-cover ${rendererProps?.rounded ? "rounded-full" : ""} ${rendererProps?.className || ""}`,
|
|
29086
|
+
style: {
|
|
29087
|
+
borderRadius: rendererProps?.rounded ? "50%" : 0,
|
|
29088
|
+
objectFit: "cover"
|
|
29089
|
+
}
|
|
29090
|
+
}
|
|
29091
|
+
) });
|
|
29092
|
+
case "icon":
|
|
29093
|
+
const maybeIcon = lucide_react_exports[rendererProps?.icon];
|
|
29094
|
+
const IconComponent = typeof maybeIcon === "function" ? maybeIcon : Star;
|
|
29095
|
+
return /* @__PURE__ */ jsx52(
|
|
29096
|
+
IconComponent,
|
|
29097
|
+
{
|
|
29098
|
+
size: rendererProps?.size || 16,
|
|
29099
|
+
color: rendererProps?.color || "#555",
|
|
29100
|
+
className: rendererProps?.className || ""
|
|
29101
|
+
}
|
|
29102
|
+
);
|
|
29103
|
+
case "badge": {
|
|
29104
|
+
const color = rendererProps?.colorMap?.[formattedValue] || rendererProps?.color || "gray";
|
|
29105
|
+
if (!formattedValue) return null;
|
|
29106
|
+
const textColor = getContrastColor(color);
|
|
29107
|
+
return /* @__PURE__ */ jsx52(
|
|
29108
|
+
"span",
|
|
29109
|
+
{
|
|
29110
|
+
className: `inline-block px-2 py-1 text-xs rounded-full bg-${color}-100 text-${textColor}-700 ${rendererProps?.className || ""}`,
|
|
29111
|
+
style: { backgroundColor: color, color: textColor },
|
|
29112
|
+
children: formattedValue
|
|
29113
|
+
}
|
|
29114
|
+
);
|
|
29115
|
+
}
|
|
29116
|
+
case "chip": {
|
|
29117
|
+
const color = rendererProps?.color || "gray";
|
|
29118
|
+
const maybeIcon2 = lucide_react_exports[rendererProps?.icon];
|
|
29119
|
+
const IconComponent2 = typeof maybeIcon2 === "function" ? maybeIcon2 : Star;
|
|
29120
|
+
if (!formattedValue) return null;
|
|
29121
|
+
const textColor = getContrastColor(color);
|
|
29122
|
+
return /* @__PURE__ */ jsxs30(
|
|
29123
|
+
"span",
|
|
29124
|
+
{
|
|
29125
|
+
className: `inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-[${color}]-100 text-[${textColor}]-700`,
|
|
29126
|
+
style: { backgroundColor: color, color: textColor },
|
|
29127
|
+
children: [
|
|
29128
|
+
rendererProps?.icon && /* @__PURE__ */ jsx52(Fragment19, { children: IconComponent2 ? /* @__PURE__ */ jsx52(IconComponent2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx52(Box, { className: "h-4 w-4" }) }),
|
|
29129
|
+
formattedValue
|
|
29130
|
+
]
|
|
29131
|
+
}
|
|
29132
|
+
);
|
|
29133
|
+
}
|
|
29134
|
+
/* -------------------- INTERACTIVE -------------------- */
|
|
29135
|
+
case "button":
|
|
29136
|
+
return /* @__PURE__ */ jsx52(
|
|
29137
|
+
"button",
|
|
29138
|
+
{
|
|
29139
|
+
onClick: () => rendererProps?.onClick?.(row, formattedValue),
|
|
29140
|
+
className: `px-2 py-1 rounded text-white bg-blue-600 hover:bg-blue-700 ${rendererProps?.className || ""}`,
|
|
29141
|
+
children: row?.[rendererProps?.rowField] || rendererProps.value || formattedValue
|
|
29142
|
+
}
|
|
29143
|
+
);
|
|
29144
|
+
case "switch":
|
|
29145
|
+
return /* @__PURE__ */ jsxs30("label", { className: "inline-flex items-center cursor-pointer", children: [
|
|
29146
|
+
/* @__PURE__ */ jsx52(
|
|
29147
|
+
"input",
|
|
29148
|
+
{
|
|
29149
|
+
type: "checkbox",
|
|
29150
|
+
checked: !!value,
|
|
29151
|
+
onChange: (e) => rendererProps?.onChange?.(row, e.target.checked),
|
|
29152
|
+
className: "sr-only peer"
|
|
29153
|
+
}
|
|
29154
|
+
),
|
|
29155
|
+
/* @__PURE__ */ jsx52("div", { className: "relative w-9 h-5 bg-gray-300 peer-checked:bg-blue-600 rounded-full transition-all", children: /* @__PURE__ */ jsx52("div", { className: "absolute top-[2px] left-[2px] w-4 h-4 bg-white rounded-full peer-checked:translate-x-4 transition-all" }) })
|
|
29156
|
+
] });
|
|
29157
|
+
case "progress":
|
|
29158
|
+
return /* @__PURE__ */ jsx52("div", { className: "w-full bg-gray-100 rounded-full h-2", children: /* @__PURE__ */ jsx52(
|
|
29159
|
+
"div",
|
|
29160
|
+
{
|
|
29161
|
+
className: "bg-blue-600 h-2 rounded-full transition-all",
|
|
29162
|
+
style: { width: `${row?.[rendererProps?.rowField] || formattedValue || 0}%` }
|
|
29163
|
+
}
|
|
29164
|
+
) });
|
|
29165
|
+
case "rating": {
|
|
29166
|
+
const stars = Math.round(Number(row?.[rendererProps?.rowField] || formattedValue) || 0);
|
|
29167
|
+
return /* @__PURE__ */ jsx52("div", { className: "flex items-center", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx52(
|
|
29168
|
+
Star,
|
|
29169
|
+
{
|
|
29170
|
+
size: 16,
|
|
29171
|
+
className: i < stars ? "text-yellow-400" : "text-gray-300",
|
|
29172
|
+
fill: i < stars ? "#facc15" : "none"
|
|
29173
|
+
},
|
|
29174
|
+
i
|
|
29175
|
+
)) });
|
|
29176
|
+
}
|
|
29177
|
+
/* -------------------- ADVANCED -------------------- */
|
|
29178
|
+
case "custom": {
|
|
29179
|
+
const CustomRenderer = customRenderers[rendererProps?.customRendererId] || customRenderers[rendererProps?.rendererId];
|
|
29180
|
+
if (CustomRenderer)
|
|
29181
|
+
return /* @__PURE__ */ jsx52(
|
|
29182
|
+
CustomRenderer,
|
|
29183
|
+
{
|
|
29184
|
+
value: formattedValue,
|
|
29185
|
+
row,
|
|
29186
|
+
...rendererProps
|
|
29187
|
+
}
|
|
29188
|
+
);
|
|
29189
|
+
return /* @__PURE__ */ jsx52("span", { children: "Missing custom renderer" });
|
|
29190
|
+
}
|
|
29191
|
+
/* -------------------- DEFAULT -------------------- */
|
|
29192
|
+
default:
|
|
29193
|
+
return /* @__PURE__ */ jsx52("span", { children: formattedValue });
|
|
29194
|
+
}
|
|
29195
|
+
};
|
|
29196
|
+
|
|
29197
|
+
// src/lib/table/useDynamicColumns.ts
|
|
29198
|
+
var columnHelper = createColumnHelper();
|
|
29199
|
+
function getValueByPath(obj, path) {
|
|
29200
|
+
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
29201
|
+
}
|
|
29202
|
+
var useDynamicColumns = (config, customRenderers = {}, customFormatters = {}) => {
|
|
29203
|
+
return config.columns.map((col) => {
|
|
29204
|
+
const accessorKey = col.accessorKey ?? col.id;
|
|
29205
|
+
const accessorFn = (row) => {
|
|
29206
|
+
if (Object.prototype.hasOwnProperty.call(row, accessorKey)) {
|
|
29207
|
+
return row[accessorKey];
|
|
29208
|
+
}
|
|
29209
|
+
if (accessorKey.includes(".")) {
|
|
29210
|
+
return getValueByPath(row, accessorKey);
|
|
29211
|
+
}
|
|
29212
|
+
return row[accessorKey];
|
|
29213
|
+
};
|
|
29214
|
+
return columnHelper.accessor(accessorFn, {
|
|
29215
|
+
id: accessorKey,
|
|
29216
|
+
header: col.header,
|
|
29217
|
+
cell: (info) => {
|
|
29218
|
+
const value = info.getValue();
|
|
29219
|
+
const row = info.row.original;
|
|
29220
|
+
return cellRendererFactory(
|
|
29221
|
+
col.renderer,
|
|
29222
|
+
col.rendererProps,
|
|
29223
|
+
value,
|
|
29224
|
+
row,
|
|
29225
|
+
customRenderers,
|
|
29226
|
+
col.format,
|
|
29227
|
+
customFormatters
|
|
29228
|
+
);
|
|
29229
|
+
}
|
|
29230
|
+
});
|
|
29231
|
+
});
|
|
29232
|
+
};
|
|
29233
|
+
|
|
28695
29234
|
// src/components/ui/data-table.tsx
|
|
28696
|
-
import { Fragment as
|
|
29235
|
+
import { Fragment as Fragment20, jsx as jsx53, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
28697
29236
|
function DataTable({
|
|
28698
29237
|
columns,
|
|
28699
29238
|
data,
|
|
@@ -28719,7 +29258,7 @@ function DataTable({
|
|
|
28719
29258
|
const deleteColumn = React9.useMemo(() => ({
|
|
28720
29259
|
id: "delete",
|
|
28721
29260
|
header: "Actions",
|
|
28722
|
-
cell: ({ row }) => /* @__PURE__ */
|
|
29261
|
+
cell: ({ row }) => /* @__PURE__ */ jsx53(
|
|
28723
29262
|
"button",
|
|
28724
29263
|
{
|
|
28725
29264
|
className: "px-3 py-1 text-[12px] bg-red-800 text-white rounded hover:bg-neutral-600 cursor-pointer",
|
|
@@ -28740,9 +29279,10 @@ function DataTable({
|
|
|
28740
29279
|
}
|
|
28741
29280
|
return columns;
|
|
28742
29281
|
}, [columns, enableDelete, deleteColumn]);
|
|
29282
|
+
const dynamicCols = useDynamicColumns({ columns: combinedColumns });
|
|
28743
29283
|
const table = useReactTable({
|
|
28744
29284
|
data,
|
|
28745
|
-
columns:
|
|
29285
|
+
columns: dynamicCols,
|
|
28746
29286
|
state: {
|
|
28747
29287
|
columnFilters,
|
|
28748
29288
|
columnVisibility,
|
|
@@ -28787,11 +29327,11 @@ function DataTable({
|
|
|
28787
29327
|
}
|
|
28788
29328
|
return [];
|
|
28789
29329
|
};
|
|
28790
|
-
return /* @__PURE__ */
|
|
28791
|
-
/* @__PURE__ */
|
|
28792
|
-
globalSearch && /* @__PURE__ */
|
|
28793
|
-
/* @__PURE__ */
|
|
28794
|
-
/* @__PURE__ */
|
|
29330
|
+
return /* @__PURE__ */ jsxs31("div", { className: "overflow-hidden rounded-md w-full", children: [
|
|
29331
|
+
/* @__PURE__ */ jsxs31("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
|
|
29332
|
+
globalSearch && /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
|
|
29333
|
+
/* @__PURE__ */ jsxs31("div", { className: "relative w-full", children: [
|
|
29334
|
+
/* @__PURE__ */ jsx53(
|
|
28795
29335
|
"input",
|
|
28796
29336
|
{
|
|
28797
29337
|
type: "text",
|
|
@@ -28806,9 +29346,9 @@ function DataTable({
|
|
|
28806
29346
|
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]"
|
|
28807
29347
|
}
|
|
28808
29348
|
),
|
|
28809
|
-
/* @__PURE__ */
|
|
29349
|
+
/* @__PURE__ */ jsx53(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
|
|
28810
29350
|
] }),
|
|
28811
|
-
/* @__PURE__ */
|
|
29351
|
+
/* @__PURE__ */ jsx53(
|
|
28812
29352
|
Button,
|
|
28813
29353
|
{
|
|
28814
29354
|
size: "sm",
|
|
@@ -28818,8 +29358,8 @@ function DataTable({
|
|
|
28818
29358
|
}
|
|
28819
29359
|
)
|
|
28820
29360
|
] }),
|
|
28821
|
-
/* @__PURE__ */
|
|
28822
|
-
/* @__PURE__ */
|
|
29361
|
+
/* @__PURE__ */ jsxs31(Popover, { children: [
|
|
29362
|
+
/* @__PURE__ */ jsx53(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx53(
|
|
28823
29363
|
Button,
|
|
28824
29364
|
{
|
|
28825
29365
|
variant: "outline",
|
|
@@ -28828,10 +29368,10 @@ function DataTable({
|
|
|
28828
29368
|
children: "Manage Columns"
|
|
28829
29369
|
}
|
|
28830
29370
|
) }),
|
|
28831
|
-
/* @__PURE__ */
|
|
28832
|
-
/* @__PURE__ */
|
|
28833
|
-
/* @__PURE__ */
|
|
28834
|
-
/* @__PURE__ */
|
|
29371
|
+
/* @__PURE__ */ jsxs31(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
|
|
29372
|
+
/* @__PURE__ */ jsx53("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
|
|
29373
|
+
/* @__PURE__ */ jsxs31("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
|
|
29374
|
+
/* @__PURE__ */ jsx53(
|
|
28835
29375
|
"input",
|
|
28836
29376
|
{
|
|
28837
29377
|
type: "checkbox",
|
|
@@ -28850,8 +29390,8 @@ function DataTable({
|
|
|
28850
29390
|
),
|
|
28851
29391
|
"Toggle All"
|
|
28852
29392
|
] }),
|
|
28853
|
-
table.getAllLeafColumns().map((column) => /* @__PURE__ */
|
|
28854
|
-
/* @__PURE__ */
|
|
29393
|
+
table.getAllLeafColumns().map((column) => /* @__PURE__ */ jsxs31("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
29394
|
+
/* @__PURE__ */ jsx53(
|
|
28855
29395
|
"input",
|
|
28856
29396
|
{
|
|
28857
29397
|
type: "checkbox",
|
|
@@ -28864,13 +29404,13 @@ function DataTable({
|
|
|
28864
29404
|
] })
|
|
28865
29405
|
] })
|
|
28866
29406
|
] }),
|
|
28867
|
-
/* @__PURE__ */
|
|
28868
|
-
/* @__PURE__ */
|
|
29407
|
+
/* @__PURE__ */ jsxs31(Table3, { children: [
|
|
29408
|
+
/* @__PURE__ */ jsx53(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx53(TableRow, { children: hg.headers.map((header) => {
|
|
28869
29409
|
const canSort = header.column.getCanSort();
|
|
28870
29410
|
const canFilter = header.column.getCanFilter();
|
|
28871
29411
|
const sortDir = manualSort?.key === header.column.id ? manualSort.dir : null;
|
|
28872
|
-
return /* @__PURE__ */
|
|
28873
|
-
/* @__PURE__ */
|
|
29412
|
+
return /* @__PURE__ */ jsx53(TableHead, { className: "relative select-none", children: /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between", children: [
|
|
29413
|
+
/* @__PURE__ */ jsxs31(
|
|
28874
29414
|
"span",
|
|
28875
29415
|
{
|
|
28876
29416
|
className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
|
|
@@ -28882,32 +29422,32 @@ function DataTable({
|
|
|
28882
29422
|
},
|
|
28883
29423
|
children: [
|
|
28884
29424
|
flexRender(header.column.columnDef.header, header.getContext()),
|
|
28885
|
-
canSort && /* @__PURE__ */
|
|
28886
|
-
sortDir === "asc" && /* @__PURE__ */
|
|
28887
|
-
sortDir === "desc" && /* @__PURE__ */
|
|
28888
|
-
!sortDir && /* @__PURE__ */
|
|
29425
|
+
canSort && /* @__PURE__ */ jsxs31(Fragment20, { children: [
|
|
29426
|
+
sortDir === "asc" && /* @__PURE__ */ jsx53(ArrowUp, { size: 14, className: "text-gray-500" }),
|
|
29427
|
+
sortDir === "desc" && /* @__PURE__ */ jsx53(ArrowDown, { size: 14, className: "text-gray-500" }),
|
|
29428
|
+
!sortDir && /* @__PURE__ */ jsx53(ArrowUpDown, { size: 14, className: "text-gray-400" })
|
|
28889
29429
|
] })
|
|
28890
29430
|
]
|
|
28891
29431
|
}
|
|
28892
29432
|
),
|
|
28893
|
-
canFilter && /* @__PURE__ */
|
|
28894
|
-
/* @__PURE__ */
|
|
29433
|
+
canFilter && /* @__PURE__ */ jsxs31(Popover, { children: [
|
|
29434
|
+
/* @__PURE__ */ jsx53(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx53(
|
|
28895
29435
|
"span",
|
|
28896
29436
|
{
|
|
28897
29437
|
role: "presentation",
|
|
28898
29438
|
className: "pl-5 cursor-pointer",
|
|
28899
29439
|
onClick: (e) => e.stopPropagation(),
|
|
28900
|
-
children: /* @__PURE__ */
|
|
29440
|
+
children: /* @__PURE__ */ jsx53(FontAwesomeIcon3, { icon: faEllipsisH, className: "w-5 h-5 text-gray-500" })
|
|
28901
29441
|
}
|
|
28902
29442
|
) }),
|
|
28903
|
-
/* @__PURE__ */
|
|
29443
|
+
/* @__PURE__ */ jsx53(
|
|
28904
29444
|
PopoverContent,
|
|
28905
29445
|
{
|
|
28906
29446
|
align: "center",
|
|
28907
29447
|
sideOffset: 14,
|
|
28908
29448
|
className: "w-50 p-3 z-[200] border-gray-300",
|
|
28909
29449
|
avoidCollisions: true,
|
|
28910
|
-
children: /* @__PURE__ */
|
|
29450
|
+
children: /* @__PURE__ */ jsxs31(
|
|
28911
29451
|
"form",
|
|
28912
29452
|
{
|
|
28913
29453
|
onSubmit: (e) => {
|
|
@@ -28920,8 +29460,8 @@ function DataTable({
|
|
|
28920
29460
|
},
|
|
28921
29461
|
className: "space-y-2",
|
|
28922
29462
|
children: [
|
|
28923
|
-
/* @__PURE__ */
|
|
28924
|
-
/* @__PURE__ */
|
|
29463
|
+
/* @__PURE__ */ jsx53("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
|
|
29464
|
+
/* @__PURE__ */ jsx53(
|
|
28925
29465
|
"input",
|
|
28926
29466
|
{
|
|
28927
29467
|
name: "filter",
|
|
@@ -28931,7 +29471,7 @@ function DataTable({
|
|
|
28931
29471
|
autoComplete: "off"
|
|
28932
29472
|
}
|
|
28933
29473
|
),
|
|
28934
|
-
/* @__PURE__ */
|
|
29474
|
+
/* @__PURE__ */ jsx53("div", { className: "justify-end flex", children: /* @__PURE__ */ jsx53(
|
|
28935
29475
|
Button,
|
|
28936
29476
|
{
|
|
28937
29477
|
type: "submit",
|
|
@@ -28947,10 +29487,10 @@ function DataTable({
|
|
|
28947
29487
|
] })
|
|
28948
29488
|
] }) }, header.id);
|
|
28949
29489
|
}) }, hg.id)) }),
|
|
28950
|
-
/* @__PURE__ */
|
|
29490
|
+
/* @__PURE__ */ jsx53(TableBody, { children: loading ? /* @__PURE__ */ jsx53(Fragment20, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx53(TableRow, { children: combinedColumns.map((_2, j) => /* @__PURE__ */ jsx53(TableCell, { className: "p-3", children: /* @__PURE__ */ jsx53("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__ */ jsx53(TableRow, { children: row.getVisibleCells().map((cell) => {
|
|
28951
29491
|
const meta = cell.column.columnDef.meta || {};
|
|
28952
29492
|
const isClickable = meta?.isClickable;
|
|
28953
|
-
return /* @__PURE__ */
|
|
29493
|
+
return /* @__PURE__ */ jsx53(
|
|
28954
29494
|
TableCell,
|
|
28955
29495
|
{
|
|
28956
29496
|
className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100" : ""}`,
|
|
@@ -28964,17 +29504,17 @@ function DataTable({
|
|
|
28964
29504
|
},
|
|
28965
29505
|
cell.id
|
|
28966
29506
|
);
|
|
28967
|
-
}) }, row.id)) : /* @__PURE__ */
|
|
29507
|
+
}) }, row.id)) : /* @__PURE__ */ jsx53(TableRow, { children: /* @__PURE__ */ jsx53(TableCell, { colSpan: combinedColumns.length, className: "h-24 text-center", children: /* @__PURE__ */ jsx53("span", { className: "flex items-center justify-center py-10 w-full min-w-full text-gray-600 bg-gray-100", children: "No results." }) }) }) })
|
|
28968
29508
|
] }),
|
|
28969
|
-
pagination && /* @__PURE__ */
|
|
28970
|
-
/* @__PURE__ */
|
|
29509
|
+
pagination && /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
29510
|
+
/* @__PURE__ */ jsxs31("div", { children: [
|
|
28971
29511
|
"Page ",
|
|
28972
29512
|
table.getState().pagination.pageIndex + 1,
|
|
28973
29513
|
" of ",
|
|
28974
29514
|
table.getPageCount()
|
|
28975
29515
|
] }),
|
|
28976
|
-
/* @__PURE__ */
|
|
28977
|
-
/* @__PURE__ */
|
|
29516
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
29517
|
+
/* @__PURE__ */ jsx53(
|
|
28978
29518
|
"button",
|
|
28979
29519
|
{
|
|
28980
29520
|
onClick: () => table.previousPage(),
|
|
@@ -28987,7 +29527,7 @@ function DataTable({
|
|
|
28987
29527
|
table.getState().pagination.pageIndex + 1,
|
|
28988
29528
|
table.getPageCount(),
|
|
28989
29529
|
5
|
|
28990
|
-
).map((pageNum, index) => /* @__PURE__ */
|
|
29530
|
+
).map((pageNum, index) => /* @__PURE__ */ jsx53(
|
|
28991
29531
|
"button",
|
|
28992
29532
|
{
|
|
28993
29533
|
disabled: pageNum === "...",
|
|
@@ -28997,7 +29537,7 @@ function DataTable({
|
|
|
28997
29537
|
},
|
|
28998
29538
|
index
|
|
28999
29539
|
)),
|
|
29000
|
-
/* @__PURE__ */
|
|
29540
|
+
/* @__PURE__ */ jsx53(
|
|
29001
29541
|
"button",
|
|
29002
29542
|
{
|
|
29003
29543
|
onClick: () => table.nextPage(),
|
|
@@ -29012,7 +29552,7 @@ function DataTable({
|
|
|
29012
29552
|
}
|
|
29013
29553
|
|
|
29014
29554
|
// src/components/DataDisplay/Table/Table.tsx
|
|
29015
|
-
import { jsx as
|
|
29555
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
29016
29556
|
var Table4 = ({
|
|
29017
29557
|
columns,
|
|
29018
29558
|
data,
|
|
@@ -29038,7 +29578,7 @@ var Table4 = ({
|
|
|
29038
29578
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
29039
29579
|
const rawData = Array.isArray(data) ? data : [];
|
|
29040
29580
|
const isControlled = typeof page === "number";
|
|
29041
|
-
return /* @__PURE__ */
|
|
29581
|
+
return /* @__PURE__ */ jsx54("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ jsx54(
|
|
29042
29582
|
DataTable,
|
|
29043
29583
|
{
|
|
29044
29584
|
...props,
|
|
@@ -29071,9 +29611,9 @@ var Table4 = ({
|
|
|
29071
29611
|
var Table_default = Table4;
|
|
29072
29612
|
|
|
29073
29613
|
// src/components/ui/pagination.tsx
|
|
29074
|
-
import { jsx as
|
|
29614
|
+
import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
29075
29615
|
function Pagination({ className, ...props }) {
|
|
29076
|
-
return /* @__PURE__ */
|
|
29616
|
+
return /* @__PURE__ */ jsx55(
|
|
29077
29617
|
"nav",
|
|
29078
29618
|
{
|
|
29079
29619
|
role: "navigation",
|
|
@@ -29088,7 +29628,7 @@ function PaginationContent({
|
|
|
29088
29628
|
className,
|
|
29089
29629
|
...props
|
|
29090
29630
|
}) {
|
|
29091
|
-
return /* @__PURE__ */
|
|
29631
|
+
return /* @__PURE__ */ jsx55(
|
|
29092
29632
|
"ul",
|
|
29093
29633
|
{
|
|
29094
29634
|
"data-slot": "pagination-content",
|
|
@@ -29098,7 +29638,7 @@ function PaginationContent({
|
|
|
29098
29638
|
);
|
|
29099
29639
|
}
|
|
29100
29640
|
function PaginationItem({ ...props }) {
|
|
29101
|
-
return /* @__PURE__ */
|
|
29641
|
+
return /* @__PURE__ */ jsx55("li", { "data-slot": "pagination-item", ...props });
|
|
29102
29642
|
}
|
|
29103
29643
|
function PaginationLink({
|
|
29104
29644
|
className,
|
|
@@ -29106,7 +29646,7 @@ function PaginationLink({
|
|
|
29106
29646
|
size = "icon",
|
|
29107
29647
|
...props
|
|
29108
29648
|
}) {
|
|
29109
|
-
return /* @__PURE__ */
|
|
29649
|
+
return /* @__PURE__ */ jsx55(
|
|
29110
29650
|
"a",
|
|
29111
29651
|
{
|
|
29112
29652
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -29127,7 +29667,7 @@ function PaginationPrevious({
|
|
|
29127
29667
|
className,
|
|
29128
29668
|
...props
|
|
29129
29669
|
}) {
|
|
29130
|
-
return /* @__PURE__ */
|
|
29670
|
+
return /* @__PURE__ */ jsxs32(
|
|
29131
29671
|
PaginationLink,
|
|
29132
29672
|
{
|
|
29133
29673
|
"aria-label": "Go to previous page",
|
|
@@ -29135,8 +29675,8 @@ function PaginationPrevious({
|
|
|
29135
29675
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
29136
29676
|
...props,
|
|
29137
29677
|
children: [
|
|
29138
|
-
/* @__PURE__ */
|
|
29139
|
-
/* @__PURE__ */
|
|
29678
|
+
/* @__PURE__ */ jsx55(ChevronLeft, {}),
|
|
29679
|
+
/* @__PURE__ */ jsx55("span", { className: "hidden sm:block", children: "Previous" })
|
|
29140
29680
|
]
|
|
29141
29681
|
}
|
|
29142
29682
|
);
|
|
@@ -29145,7 +29685,7 @@ function PaginationNext({
|
|
|
29145
29685
|
className,
|
|
29146
29686
|
...props
|
|
29147
29687
|
}) {
|
|
29148
|
-
return /* @__PURE__ */
|
|
29688
|
+
return /* @__PURE__ */ jsxs32(
|
|
29149
29689
|
PaginationLink,
|
|
29150
29690
|
{
|
|
29151
29691
|
"aria-label": "Go to next page",
|
|
@@ -29153,8 +29693,8 @@ function PaginationNext({
|
|
|
29153
29693
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
29154
29694
|
...props,
|
|
29155
29695
|
children: [
|
|
29156
|
-
/* @__PURE__ */
|
|
29157
|
-
/* @__PURE__ */
|
|
29696
|
+
/* @__PURE__ */ jsx55("span", { className: "hidden sm:block", children: "Next" }),
|
|
29697
|
+
/* @__PURE__ */ jsx55(ChevronRight, {})
|
|
29158
29698
|
]
|
|
29159
29699
|
}
|
|
29160
29700
|
);
|
|
@@ -29163,7 +29703,7 @@ function PaginationEllipsis({
|
|
|
29163
29703
|
className,
|
|
29164
29704
|
...props
|
|
29165
29705
|
}) {
|
|
29166
|
-
return /* @__PURE__ */
|
|
29706
|
+
return /* @__PURE__ */ jsxs32(
|
|
29167
29707
|
"span",
|
|
29168
29708
|
{
|
|
29169
29709
|
"aria-hidden": true,
|
|
@@ -29171,15 +29711,15 @@ function PaginationEllipsis({
|
|
|
29171
29711
|
className: cn("flex size-9 items-center justify-center", className),
|
|
29172
29712
|
...props,
|
|
29173
29713
|
children: [
|
|
29174
|
-
/* @__PURE__ */
|
|
29175
|
-
/* @__PURE__ */
|
|
29714
|
+
/* @__PURE__ */ jsx55(Ellipsis, { className: "size-4" }),
|
|
29715
|
+
/* @__PURE__ */ jsx55("span", { className: "sr-only", children: "More pages" })
|
|
29176
29716
|
]
|
|
29177
29717
|
}
|
|
29178
29718
|
);
|
|
29179
29719
|
}
|
|
29180
29720
|
|
|
29181
29721
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
29182
|
-
import { jsx as
|
|
29722
|
+
import { jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
29183
29723
|
var CustomPagination = ({
|
|
29184
29724
|
totalPages,
|
|
29185
29725
|
currentPage,
|
|
@@ -29225,10 +29765,10 @@ var CustomPagination = ({
|
|
|
29225
29765
|
}
|
|
29226
29766
|
};
|
|
29227
29767
|
const pageNumbers = getPageNumbers();
|
|
29228
|
-
return /* @__PURE__ */
|
|
29229
|
-
/* @__PURE__ */
|
|
29230
|
-
/* @__PURE__ */
|
|
29231
|
-
/* @__PURE__ */
|
|
29768
|
+
return /* @__PURE__ */ jsxs33("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
|
|
29769
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
|
|
29770
|
+
/* @__PURE__ */ jsx56("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
|
|
29771
|
+
/* @__PURE__ */ jsxs33(
|
|
29232
29772
|
Select,
|
|
29233
29773
|
{
|
|
29234
29774
|
defaultValue: String(perPage),
|
|
@@ -29236,26 +29776,26 @@ var CustomPagination = ({
|
|
|
29236
29776
|
onPageChange({ page: 1, itemsPerPage: Number(value) });
|
|
29237
29777
|
},
|
|
29238
29778
|
children: [
|
|
29239
|
-
/* @__PURE__ */
|
|
29240
|
-
/* @__PURE__ */
|
|
29241
|
-
/* @__PURE__ */
|
|
29242
|
-
/* @__PURE__ */
|
|
29243
|
-
/* @__PURE__ */
|
|
29244
|
-
/* @__PURE__ */
|
|
29779
|
+
/* @__PURE__ */ jsx56(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ jsx56(SelectValue, { placeholder: "Select" }) }),
|
|
29780
|
+
/* @__PURE__ */ jsxs33(SelectContent, { children: [
|
|
29781
|
+
/* @__PURE__ */ jsx56(SelectItem, { value: "5", children: "5" }),
|
|
29782
|
+
/* @__PURE__ */ jsx56(SelectItem, { value: "10", children: "10" }),
|
|
29783
|
+
/* @__PURE__ */ jsx56(SelectItem, { value: "20", children: "20" }),
|
|
29784
|
+
/* @__PURE__ */ jsx56(SelectItem, { value: "50", children: "50" })
|
|
29245
29785
|
] })
|
|
29246
29786
|
]
|
|
29247
29787
|
}
|
|
29248
29788
|
)
|
|
29249
29789
|
] }),
|
|
29250
|
-
/* @__PURE__ */
|
|
29251
|
-
/* @__PURE__ */
|
|
29790
|
+
/* @__PURE__ */ jsx56(Pagination, { className: "justify-end", children: /* @__PURE__ */ jsxs33(PaginationContent, { children: [
|
|
29791
|
+
/* @__PURE__ */ jsx56(PaginationItem, { children: /* @__PURE__ */ jsx56(
|
|
29252
29792
|
PaginationPrevious,
|
|
29253
29793
|
{
|
|
29254
29794
|
onClick: () => handlePageChange(currentPage - 1),
|
|
29255
29795
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
29256
29796
|
}
|
|
29257
29797
|
) }),
|
|
29258
|
-
pageNumbers.map((pageNumber, index) => /* @__PURE__ */
|
|
29798
|
+
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ jsx56(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ jsx56(PaginationEllipsis, {}) : /* @__PURE__ */ jsx56(
|
|
29259
29799
|
PaginationLink,
|
|
29260
29800
|
{
|
|
29261
29801
|
onClick: () => handlePageChange(pageNumber),
|
|
@@ -29264,7 +29804,7 @@ var CustomPagination = ({
|
|
|
29264
29804
|
children: pageNumber
|
|
29265
29805
|
}
|
|
29266
29806
|
) }, index)),
|
|
29267
|
-
/* @__PURE__ */
|
|
29807
|
+
/* @__PURE__ */ jsx56(PaginationItem, { children: /* @__PURE__ */ jsx56(
|
|
29268
29808
|
PaginationNext,
|
|
29269
29809
|
{
|
|
29270
29810
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -29277,11 +29817,11 @@ var CustomPagination = ({
|
|
|
29277
29817
|
var Pagination_default = CustomPagination;
|
|
29278
29818
|
|
|
29279
29819
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
29280
|
-
import { useCallback as
|
|
29820
|
+
import { useCallback as useCallback3, useMemo as useMemo5, useState as useState8 } from "react";
|
|
29281
29821
|
import Link5 from "next/link";
|
|
29282
29822
|
import { useRouter } from "next/navigation";
|
|
29283
|
-
import { Fragment as
|
|
29284
|
-
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder =
|
|
29823
|
+
import { Fragment as Fragment21, jsx as jsx57, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
29824
|
+
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
|
|
29285
29825
|
function groupMenus(menus = []) {
|
|
29286
29826
|
const menuMap = /* @__PURE__ */ new Map();
|
|
29287
29827
|
menus.forEach((menu) => {
|
|
@@ -29327,9 +29867,9 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29327
29867
|
return pathname === path || path !== "/" && pathname?.startsWith(path);
|
|
29328
29868
|
};
|
|
29329
29869
|
const router = useRouter();
|
|
29330
|
-
const [showExitDialog, setShowExitDialog] =
|
|
29331
|
-
const [pendingUrl, setPendingUrl] =
|
|
29332
|
-
const handleBuilderExit =
|
|
29870
|
+
const [showExitDialog, setShowExitDialog] = useState8(false);
|
|
29871
|
+
const [pendingUrl, setPendingUrl] = useState8(null);
|
|
29872
|
+
const handleBuilderExit = useCallback3(
|
|
29333
29873
|
(e, url) => {
|
|
29334
29874
|
if (isBuilder) {
|
|
29335
29875
|
e.preventDefault();
|
|
@@ -29348,23 +29888,23 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29348
29888
|
const renderDesktopTab = (tab, index) => {
|
|
29349
29889
|
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
29350
29890
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
29351
|
-
return /* @__PURE__ */
|
|
29352
|
-
/* @__PURE__ */
|
|
29891
|
+
return /* @__PURE__ */ jsxs34(DropdownMenu, { children: [
|
|
29892
|
+
/* @__PURE__ */ jsxs34(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
|
|
29353
29893
|
tab.header,
|
|
29354
|
-
/* @__PURE__ */
|
|
29894
|
+
/* @__PURE__ */ jsx57(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
29355
29895
|
] }),
|
|
29356
|
-
/* @__PURE__ */
|
|
29896
|
+
/* @__PURE__ */ jsx57(
|
|
29357
29897
|
DropdownMenuContent,
|
|
29358
29898
|
{
|
|
29359
29899
|
align: "start",
|
|
29360
29900
|
sideOffset: 6,
|
|
29361
29901
|
className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
|
|
29362
|
-
children: tab.children.map((item, index2) => /* @__PURE__ */
|
|
29902
|
+
children: tab.children.map((item, index2) => /* @__PURE__ */ jsx57(
|
|
29363
29903
|
DropdownMenuItem,
|
|
29364
29904
|
{
|
|
29365
29905
|
asChild: true,
|
|
29366
29906
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
29367
|
-
children: /* @__PURE__ */
|
|
29907
|
+
children: /* @__PURE__ */ jsx57(
|
|
29368
29908
|
Link5,
|
|
29369
29909
|
{
|
|
29370
29910
|
href: item.url || "#",
|
|
@@ -29380,7 +29920,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29380
29920
|
)
|
|
29381
29921
|
] }, index);
|
|
29382
29922
|
}
|
|
29383
|
-
return tab.url ? /* @__PURE__ */
|
|
29923
|
+
return tab.url ? /* @__PURE__ */ jsx57(
|
|
29384
29924
|
Link5,
|
|
29385
29925
|
{
|
|
29386
29926
|
href: tab.url,
|
|
@@ -29391,14 +29931,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29391
29931
|
children: tab.header
|
|
29392
29932
|
},
|
|
29393
29933
|
index
|
|
29394
|
-
) : /* @__PURE__ */
|
|
29934
|
+
) : /* @__PURE__ */ jsx57("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
29395
29935
|
};
|
|
29396
|
-
const renderMobileMenu = () => /* @__PURE__ */
|
|
29397
|
-
/* @__PURE__ */
|
|
29398
|
-
/* @__PURE__ */
|
|
29936
|
+
const renderMobileMenu = () => /* @__PURE__ */ jsxs34(DropdownMenu, { children: [
|
|
29937
|
+
/* @__PURE__ */ jsxs34(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|
|
29938
|
+
/* @__PURE__ */ jsx57(Menu, { className: "h-4 w-4" }),
|
|
29399
29939
|
"Menu"
|
|
29400
29940
|
] }),
|
|
29401
|
-
/* @__PURE__ */
|
|
29941
|
+
/* @__PURE__ */ jsx57(
|
|
29402
29942
|
DropdownMenuContent,
|
|
29403
29943
|
{
|
|
29404
29944
|
align: "start",
|
|
@@ -29407,25 +29947,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29407
29947
|
children: rawTabs.map((tab, i) => {
|
|
29408
29948
|
const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
29409
29949
|
if (hasChildren) {
|
|
29410
|
-
return /* @__PURE__ */
|
|
29411
|
-
/* @__PURE__ */
|
|
29412
|
-
/* @__PURE__ */
|
|
29950
|
+
return /* @__PURE__ */ jsxs34(DropdownMenuSub, { children: [
|
|
29951
|
+
/* @__PURE__ */ jsx57(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 }),
|
|
29952
|
+
/* @__PURE__ */ jsx57(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ jsx57(
|
|
29413
29953
|
DropdownMenuItem,
|
|
29414
29954
|
{
|
|
29415
29955
|
asChild: true,
|
|
29416
29956
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
|
|
29417
|
-
children: /* @__PURE__ */
|
|
29957
|
+
children: /* @__PURE__ */ jsx57(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
29418
29958
|
},
|
|
29419
29959
|
item.id || index
|
|
29420
29960
|
)) })
|
|
29421
29961
|
] }, i);
|
|
29422
29962
|
}
|
|
29423
|
-
return /* @__PURE__ */
|
|
29963
|
+
return /* @__PURE__ */ jsx57(
|
|
29424
29964
|
DropdownMenuItem,
|
|
29425
29965
|
{
|
|
29426
29966
|
asChild: true,
|
|
29427
29967
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
|
|
29428
|
-
children: /* @__PURE__ */
|
|
29968
|
+
children: /* @__PURE__ */ jsx57(Link5, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
|
|
29429
29969
|
},
|
|
29430
29970
|
i
|
|
29431
29971
|
);
|
|
@@ -29435,19 +29975,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29435
29975
|
] });
|
|
29436
29976
|
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
29437
29977
|
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
29438
|
-
return /* @__PURE__ */
|
|
29439
|
-
/* @__PURE__ */
|
|
29440
|
-
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */
|
|
29441
|
-
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */
|
|
29978
|
+
return /* @__PURE__ */ jsxs34(Fragment21, { children: [
|
|
29979
|
+
/* @__PURE__ */ jsxs34("div", { className, style, children: [
|
|
29980
|
+
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx57("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx57("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx57("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx57("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
29981
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx57("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx57("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
29442
29982
|
] }),
|
|
29443
|
-
/* @__PURE__ */
|
|
29444
|
-
/* @__PURE__ */
|
|
29445
|
-
/* @__PURE__ */
|
|
29446
|
-
/* @__PURE__ */
|
|
29983
|
+
/* @__PURE__ */ jsx57(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs34(DialogContent, { className: "bg-[#fff]", children: [
|
|
29984
|
+
/* @__PURE__ */ jsxs34(DialogHeader, { children: [
|
|
29985
|
+
/* @__PURE__ */ jsx57(DialogTitle, { children: "Exit Builder?" }),
|
|
29986
|
+
/* @__PURE__ */ jsx57(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
29447
29987
|
] }),
|
|
29448
|
-
/* @__PURE__ */
|
|
29449
|
-
/* @__PURE__ */
|
|
29450
|
-
/* @__PURE__ */
|
|
29988
|
+
/* @__PURE__ */ jsxs34(DialogFooter, { children: [
|
|
29989
|
+
/* @__PURE__ */ jsx57(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
29990
|
+
/* @__PURE__ */ jsx57(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
29451
29991
|
] })
|
|
29452
29992
|
] }) })
|
|
29453
29993
|
] });
|
|
@@ -29456,17 +29996,17 @@ var Tabs_default = Tabs;
|
|
|
29456
29996
|
|
|
29457
29997
|
// src/components/Navigation/Stages/Stages.tsx
|
|
29458
29998
|
import React10 from "react";
|
|
29459
|
-
import { jsx as
|
|
29999
|
+
import { jsx as jsx58, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
29460
30000
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage }) => {
|
|
29461
|
-
return /* @__PURE__ */
|
|
29462
|
-
/* @__PURE__ */
|
|
29463
|
-
/* @__PURE__ */
|
|
30001
|
+
return /* @__PURE__ */ jsx58("div", { className, style, children: /* @__PURE__ */ jsxs35("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
30002
|
+
/* @__PURE__ */ jsx58("div", { className: "flex items-center", children: /* @__PURE__ */ jsx58("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx58("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx58("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
30003
|
+
/* @__PURE__ */ jsx58("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => {
|
|
29464
30004
|
const currentIndex = stages.findIndex((s) => s.key === currentStage);
|
|
29465
30005
|
const isAllCompleted = currentStage === "completed";
|
|
29466
30006
|
const isCompleted = isAllCompleted || index < currentIndex;
|
|
29467
30007
|
const isActive = !isAllCompleted && index === currentIndex;
|
|
29468
|
-
return /* @__PURE__ */
|
|
29469
|
-
/* @__PURE__ */
|
|
30008
|
+
return /* @__PURE__ */ jsxs35(React10.Fragment, { children: [
|
|
30009
|
+
/* @__PURE__ */ jsx58(
|
|
29470
30010
|
"button",
|
|
29471
30011
|
{
|
|
29472
30012
|
className: `
|
|
@@ -29480,18 +30020,15 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
29480
30020
|
children: stage.header
|
|
29481
30021
|
}
|
|
29482
30022
|
),
|
|
29483
|
-
index < stages.length - 1 && /* @__PURE__ */
|
|
30023
|
+
index < stages.length - 1 && /* @__PURE__ */ jsx58("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
|
|
29484
30024
|
] }, stage.id);
|
|
29485
30025
|
}) }),
|
|
29486
|
-
isShowBtn && /* @__PURE__ */
|
|
30026
|
+
isShowBtn && /* @__PURE__ */ jsx58("div", { className: "flex items-center", children: /* @__PURE__ */ jsx58(
|
|
29487
30027
|
"button",
|
|
29488
30028
|
{
|
|
29489
30029
|
className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
|
|
29490
30030
|
onClick: () => {
|
|
29491
|
-
|
|
29492
|
-
if (activeStage && onStageChange) {
|
|
29493
|
-
onStageChange("completed");
|
|
29494
|
-
}
|
|
30031
|
+
onStageChange?.("completed");
|
|
29495
30032
|
},
|
|
29496
30033
|
children: buttonText
|
|
29497
30034
|
}
|
|
@@ -29501,26 +30038,26 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
29501
30038
|
var Stages_default = StagesComponent;
|
|
29502
30039
|
|
|
29503
30040
|
// src/components/Navigation/Spacer/Spacer.tsx
|
|
29504
|
-
import { jsx as
|
|
30041
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
29505
30042
|
var Spacer = ({ className, style }) => {
|
|
29506
|
-
return /* @__PURE__ */
|
|
30043
|
+
return /* @__PURE__ */ jsx59("div", { className: `${className}`, style });
|
|
29507
30044
|
};
|
|
29508
30045
|
var Spacer_default = Spacer;
|
|
29509
30046
|
|
|
29510
30047
|
// src/components/Navigation/Profile/Profile.tsx
|
|
29511
|
-
import { jsx as
|
|
30048
|
+
import { jsx as jsx60, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
29512
30049
|
|
|
29513
30050
|
// src/components/Navigation/Notification/Notification.tsx
|
|
29514
|
-
import { jsx as
|
|
30051
|
+
import { jsx as jsx61, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
29515
30052
|
|
|
29516
30053
|
// src/components/Navigation/Logo/Logo.tsx
|
|
29517
|
-
import { jsx as
|
|
30054
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
29518
30055
|
|
|
29519
30056
|
// src/components/ui/avatar.tsx
|
|
29520
30057
|
import * as React11 from "react";
|
|
29521
30058
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
29522
|
-
import { jsx as
|
|
29523
|
-
var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
30059
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
30060
|
+
var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63(
|
|
29524
30061
|
AvatarPrimitive.Root,
|
|
29525
30062
|
{
|
|
29526
30063
|
ref,
|
|
@@ -29532,7 +30069,7 @@ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
29532
30069
|
}
|
|
29533
30070
|
));
|
|
29534
30071
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
29535
|
-
var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
30072
|
+
var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63(
|
|
29536
30073
|
AvatarPrimitive.Image,
|
|
29537
30074
|
{
|
|
29538
30075
|
ref,
|
|
@@ -29541,7 +30078,7 @@ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
29541
30078
|
}
|
|
29542
30079
|
));
|
|
29543
30080
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
29544
|
-
var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
30081
|
+
var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63(
|
|
29545
30082
|
AvatarPrimitive.Fallback,
|
|
29546
30083
|
{
|
|
29547
30084
|
ref,
|
|
@@ -29556,11 +30093,11 @@ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
|
29556
30093
|
|
|
29557
30094
|
// src/components/Navigation/Navbar/Navbar.tsx
|
|
29558
30095
|
import Link6 from "next/link";
|
|
29559
|
-
import
|
|
30096
|
+
import Image4 from "next/image";
|
|
29560
30097
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
29561
30098
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
29562
|
-
import { useCallback as
|
|
29563
|
-
import { Fragment as
|
|
30099
|
+
import { useCallback as useCallback4, useMemo as useMemo6, useState as useState9 } from "react";
|
|
30100
|
+
import { Fragment as Fragment22, jsx as jsx64, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
29564
30101
|
function Navbar({
|
|
29565
30102
|
style,
|
|
29566
30103
|
badgeType,
|
|
@@ -29580,9 +30117,9 @@ function Navbar({
|
|
|
29580
30117
|
}) {
|
|
29581
30118
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
29582
30119
|
const router = useRouter2();
|
|
29583
|
-
const [showExitDialog, setShowExitDialog] =
|
|
29584
|
-
const [pendingUrl, setPendingUrl] =
|
|
29585
|
-
const handleBuilderExit =
|
|
30120
|
+
const [showExitDialog, setShowExitDialog] = useState9(false);
|
|
30121
|
+
const [pendingUrl, setPendingUrl] = useState9(null);
|
|
30122
|
+
const handleBuilderExit = useCallback4(
|
|
29586
30123
|
(e, url) => {
|
|
29587
30124
|
if (isBuilder) {
|
|
29588
30125
|
e.preventDefault();
|
|
@@ -29604,23 +30141,23 @@ function Navbar({
|
|
|
29604
30141
|
}
|
|
29605
30142
|
return list || [];
|
|
29606
30143
|
}, [source, navList]);
|
|
29607
|
-
return /* @__PURE__ */
|
|
29608
|
-
/* @__PURE__ */
|
|
30144
|
+
return /* @__PURE__ */ jsxs38(Fragment22, { children: [
|
|
30145
|
+
/* @__PURE__ */ jsx64(
|
|
29609
30146
|
"nav",
|
|
29610
30147
|
{
|
|
29611
30148
|
className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
|
|
29612
30149
|
style,
|
|
29613
|
-
children: /* @__PURE__ */
|
|
29614
|
-
/* @__PURE__ */
|
|
30150
|
+
children: /* @__PURE__ */ jsxs38("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
|
|
30151
|
+
/* @__PURE__ */ jsx64(
|
|
29615
30152
|
Link6,
|
|
29616
30153
|
{
|
|
29617
30154
|
href: "/",
|
|
29618
30155
|
onClick: (e) => handleBuilderExit(e, "/"),
|
|
29619
30156
|
className: "flex items-center space-x-2",
|
|
29620
|
-
children: imageUrl ? /* @__PURE__ */
|
|
30157
|
+
children: imageUrl ? /* @__PURE__ */ jsx64(Image4, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx64("span", { className: "font-semibold text-blue-700", children: "Logo" })
|
|
29621
30158
|
}
|
|
29622
30159
|
),
|
|
29623
|
-
!isMobileView && /* @__PURE__ */
|
|
30160
|
+
!isMobileView && /* @__PURE__ */ jsx64("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ jsx64(
|
|
29624
30161
|
Link6,
|
|
29625
30162
|
{
|
|
29626
30163
|
href: item.url || "#",
|
|
@@ -29630,39 +30167,39 @@ function Navbar({
|
|
|
29630
30167
|
},
|
|
29631
30168
|
item.id
|
|
29632
30169
|
)) }),
|
|
29633
|
-
/* @__PURE__ */
|
|
29634
|
-
!isMobileView ? /* @__PURE__ */
|
|
29635
|
-
/* @__PURE__ */
|
|
29636
|
-
/* @__PURE__ */
|
|
29637
|
-
] }) }) : /* @__PURE__ */
|
|
29638
|
-
/* @__PURE__ */
|
|
29639
|
-
/* @__PURE__ */
|
|
29640
|
-
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */
|
|
30170
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center space-x-3", children: [
|
|
30171
|
+
!isMobileView ? /* @__PURE__ */ jsx64("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs38("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
30172
|
+
/* @__PURE__ */ jsx64(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
|
|
30173
|
+
/* @__PURE__ */ jsx64(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
30174
|
+
] }) }) : /* @__PURE__ */ jsx64(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ jsx64(Search, { className: "h-5 w-5 text-gray-400" }) }),
|
|
30175
|
+
/* @__PURE__ */ jsxs38("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
|
|
30176
|
+
/* @__PURE__ */ jsx64(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx64(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
|
|
30177
|
+
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx64("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__ */ jsx64("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
|
|
29641
30178
|
] }),
|
|
29642
|
-
/* @__PURE__ */
|
|
29643
|
-
/* @__PURE__ */
|
|
29644
|
-
!isMobileView && showName && /* @__PURE__ */
|
|
29645
|
-
!isMobileView ? /* @__PURE__ */
|
|
29646
|
-
/* @__PURE__ */
|
|
30179
|
+
/* @__PURE__ */ jsxs38(DropdownMenu, { children: [
|
|
30180
|
+
/* @__PURE__ */ jsx64(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs38("div", { className: "flex items-center space-x-2", children: [
|
|
30181
|
+
!isMobileView && showName && /* @__PURE__ */ jsx64("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
|
|
30182
|
+
!isMobileView ? /* @__PURE__ */ jsxs38(Fragment22, { children: [
|
|
30183
|
+
/* @__PURE__ */ jsx64(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx64(
|
|
29647
30184
|
AvatarImage,
|
|
29648
30185
|
{
|
|
29649
30186
|
src: "/images/appbuilder/toolset/profile.svg",
|
|
29650
30187
|
alt: "Profile"
|
|
29651
30188
|
}
|
|
29652
|
-
) : /* @__PURE__ */
|
|
29653
|
-
/* @__PURE__ */
|
|
30189
|
+
) : /* @__PURE__ */ jsx64("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) }) }),
|
|
30190
|
+
/* @__PURE__ */ jsx64(
|
|
29654
30191
|
Button,
|
|
29655
30192
|
{
|
|
29656
30193
|
variant: "ghost",
|
|
29657
30194
|
size: "icon",
|
|
29658
30195
|
className: "text-gray-900 md:hidden dark:invert",
|
|
29659
|
-
children: /* @__PURE__ */
|
|
30196
|
+
children: /* @__PURE__ */ jsx64(Menu, { className: "h-6 w-6" })
|
|
29660
30197
|
}
|
|
29661
30198
|
)
|
|
29662
|
-
] }) : /* @__PURE__ */
|
|
30199
|
+
] }) : /* @__PURE__ */ jsx64(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ jsx64(Menu, { className: "h-6 w-6" }) })
|
|
29663
30200
|
] }) }),
|
|
29664
|
-
/* @__PURE__ */
|
|
29665
|
-
profileMenu && profileMenu.length > 0 && /* @__PURE__ */
|
|
30201
|
+
/* @__PURE__ */ jsxs38(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
|
|
30202
|
+
profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx64(Fragment22, { children: profileMenu.map((item) => /* @__PURE__ */ jsx64(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx64(
|
|
29666
30203
|
Link6,
|
|
29667
30204
|
{
|
|
29668
30205
|
href: item.url || "#",
|
|
@@ -29670,9 +30207,9 @@ function Navbar({
|
|
|
29670
30207
|
children: item.header
|
|
29671
30208
|
}
|
|
29672
30209
|
) }, item.id)) }),
|
|
29673
|
-
/* @__PURE__ */
|
|
29674
|
-
/* @__PURE__ */
|
|
29675
|
-
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */
|
|
30210
|
+
/* @__PURE__ */ jsxs38("div", { className: "md:hidden", children: [
|
|
30211
|
+
/* @__PURE__ */ jsx64(DropdownMenuSeparator, {}),
|
|
30212
|
+
formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ jsx64(Fragment22, { children: formatedMenu.map((item) => /* @__PURE__ */ jsx64(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx64(
|
|
29676
30213
|
Link6,
|
|
29677
30214
|
{
|
|
29678
30215
|
href: item.url || "#",
|
|
@@ -29687,14 +30224,14 @@ function Navbar({
|
|
|
29687
30224
|
] })
|
|
29688
30225
|
}
|
|
29689
30226
|
),
|
|
29690
|
-
/* @__PURE__ */
|
|
29691
|
-
/* @__PURE__ */
|
|
29692
|
-
/* @__PURE__ */
|
|
29693
|
-
/* @__PURE__ */
|
|
30227
|
+
/* @__PURE__ */ jsx64(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs38(DialogContent, { className: "bg-[#fff]", children: [
|
|
30228
|
+
/* @__PURE__ */ jsxs38(DialogHeader, { children: [
|
|
30229
|
+
/* @__PURE__ */ jsx64(DialogTitle, { children: "Exit Builder?" }),
|
|
30230
|
+
/* @__PURE__ */ jsx64(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
|
|
29694
30231
|
] }),
|
|
29695
|
-
/* @__PURE__ */
|
|
29696
|
-
/* @__PURE__ */
|
|
29697
|
-
/* @__PURE__ */
|
|
30232
|
+
/* @__PURE__ */ jsxs38(DialogFooter, { children: [
|
|
30233
|
+
/* @__PURE__ */ jsx64(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
|
|
30234
|
+
/* @__PURE__ */ jsx64(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
|
|
29698
30235
|
] })
|
|
29699
30236
|
] }) })
|
|
29700
30237
|
] });
|
|
@@ -29714,35 +30251,35 @@ import {
|
|
|
29714
30251
|
ResponsiveContainer,
|
|
29715
30252
|
Legend
|
|
29716
30253
|
} from "recharts";
|
|
29717
|
-
import { jsx as
|
|
30254
|
+
import { jsx as jsx65, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
29718
30255
|
var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
29719
30256
|
const data = Array.isArray(props.data) ? props.data : [];
|
|
29720
30257
|
const chartType = props.chartType || "bar";
|
|
29721
30258
|
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
29722
30259
|
if (loading || data.length === 0) {
|
|
29723
|
-
return /* @__PURE__ */
|
|
30260
|
+
return /* @__PURE__ */ jsx65(
|
|
29724
30261
|
"div",
|
|
29725
30262
|
{
|
|
29726
30263
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
29727
30264
|
style,
|
|
29728
|
-
children: /* @__PURE__ */
|
|
30265
|
+
children: /* @__PURE__ */ jsx65("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
|
|
29729
30266
|
}
|
|
29730
30267
|
);
|
|
29731
30268
|
}
|
|
29732
|
-
return /* @__PURE__ */
|
|
29733
|
-
/* @__PURE__ */
|
|
29734
|
-
/* @__PURE__ */
|
|
29735
|
-
/* @__PURE__ */
|
|
29736
|
-
/* @__PURE__ */
|
|
29737
|
-
/* @__PURE__ */
|
|
29738
|
-
/* @__PURE__ */
|
|
30269
|
+
return /* @__PURE__ */ jsx65("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ jsx65(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs39(BarChart, { data, title: "Leads", desc: "content", children: [
|
|
30270
|
+
/* @__PURE__ */ jsx65(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
30271
|
+
/* @__PURE__ */ jsx65(XAxis, { dataKey: "name" }),
|
|
30272
|
+
/* @__PURE__ */ jsx65(YAxis, {}),
|
|
30273
|
+
/* @__PURE__ */ jsx65(Tooltip, { formatter: (value) => `${value}k` }),
|
|
30274
|
+
/* @__PURE__ */ jsx65(Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
30275
|
+
/* @__PURE__ */ jsx65(
|
|
29739
30276
|
Bar,
|
|
29740
30277
|
{
|
|
29741
30278
|
dataKey: "value",
|
|
29742
30279
|
fill: "#00695C",
|
|
29743
30280
|
radius: [6, 6, 0, 0],
|
|
29744
30281
|
isAnimationActive: false,
|
|
29745
|
-
children: data.map((entry, index) => /* @__PURE__ */
|
|
30282
|
+
children: data.map((entry, index) => /* @__PURE__ */ jsx65(
|
|
29746
30283
|
"rect",
|
|
29747
30284
|
{
|
|
29748
30285
|
fill: entry.color || "#00695C"
|
|
@@ -29751,16 +30288,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
29751
30288
|
))
|
|
29752
30289
|
}
|
|
29753
30290
|
)
|
|
29754
|
-
] }) : /* @__PURE__ */
|
|
29755
|
-
/* @__PURE__ */
|
|
29756
|
-
/* @__PURE__ */
|
|
29757
|
-
/* @__PURE__ */
|
|
30291
|
+
] }) : /* @__PURE__ */ jsxs39(AreaChart, { data, children: [
|
|
30292
|
+
/* @__PURE__ */ jsx65("defs", { children: /* @__PURE__ */ jsxs39("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
30293
|
+
/* @__PURE__ */ jsx65("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
30294
|
+
/* @__PURE__ */ jsx65("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
29758
30295
|
] }) }),
|
|
29759
|
-
/* @__PURE__ */
|
|
29760
|
-
/* @__PURE__ */
|
|
29761
|
-
/* @__PURE__ */
|
|
29762
|
-
/* @__PURE__ */
|
|
29763
|
-
/* @__PURE__ */
|
|
30296
|
+
/* @__PURE__ */ jsx65(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
30297
|
+
/* @__PURE__ */ jsx65(XAxis, { dataKey: "name" }),
|
|
30298
|
+
/* @__PURE__ */ jsx65(YAxis, {}),
|
|
30299
|
+
/* @__PURE__ */ jsx65(Tooltip, { formatter: (value) => `${value}k` }),
|
|
30300
|
+
/* @__PURE__ */ jsx65(
|
|
29764
30301
|
Area,
|
|
29765
30302
|
{
|
|
29766
30303
|
type: "monotone",
|
|
@@ -29776,7 +30313,7 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
29776
30313
|
var BarChart_default = React12.memo(ChartComponent);
|
|
29777
30314
|
|
|
29778
30315
|
// src/components/Chart/PieChart.tsx
|
|
29779
|
-
import React13, { useEffect as
|
|
30316
|
+
import React13, { useEffect as useEffect25, useMemo as useMemo7, useState as useState10 } from "react";
|
|
29780
30317
|
import {
|
|
29781
30318
|
PieChart,
|
|
29782
30319
|
Pie,
|
|
@@ -29785,7 +30322,7 @@ import {
|
|
|
29785
30322
|
Tooltip as Tooltip2,
|
|
29786
30323
|
LabelList
|
|
29787
30324
|
} from "recharts";
|
|
29788
|
-
import { Fragment as
|
|
30325
|
+
import { Fragment as Fragment23, jsx as jsx66, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
29789
30326
|
var getRandomColor = () => {
|
|
29790
30327
|
const palette = [
|
|
29791
30328
|
"#2563eb",
|
|
@@ -29811,26 +30348,26 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29811
30348
|
}, [props.data]);
|
|
29812
30349
|
const total = useMemo7(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
|
|
29813
30350
|
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
29814
|
-
const [mounted, setMounted] =
|
|
29815
|
-
|
|
30351
|
+
const [mounted, setMounted] = useState10(false);
|
|
30352
|
+
useEffect25(() => {
|
|
29816
30353
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
29817
30354
|
return () => clearTimeout(timeout);
|
|
29818
30355
|
}, []);
|
|
29819
30356
|
const renderLegends = useMemo7(() => {
|
|
29820
30357
|
if (!showLegends) return null;
|
|
29821
|
-
return /* @__PURE__ */
|
|
30358
|
+
return /* @__PURE__ */ jsx66(Fragment23, { children: data.map((d) => /* @__PURE__ */ jsxs40(
|
|
29822
30359
|
"div",
|
|
29823
30360
|
{
|
|
29824
30361
|
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
29825
30362
|
children: [
|
|
29826
|
-
/* @__PURE__ */
|
|
30363
|
+
/* @__PURE__ */ jsx66(
|
|
29827
30364
|
"span",
|
|
29828
30365
|
{
|
|
29829
30366
|
className: "inline-block w-[16px] h-[16px] rounded",
|
|
29830
30367
|
style: { backgroundColor: d.color }
|
|
29831
30368
|
}
|
|
29832
30369
|
),
|
|
29833
|
-
/* @__PURE__ */
|
|
30370
|
+
/* @__PURE__ */ jsx66("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
|
|
29834
30371
|
]
|
|
29835
30372
|
},
|
|
29836
30373
|
d.name
|
|
@@ -29838,24 +30375,24 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29838
30375
|
}, [data, showLegends]);
|
|
29839
30376
|
if (!mounted) return null;
|
|
29840
30377
|
if (loading || data.length === 0) {
|
|
29841
|
-
return /* @__PURE__ */
|
|
30378
|
+
return /* @__PURE__ */ jsx66(
|
|
29842
30379
|
"div",
|
|
29843
30380
|
{
|
|
29844
30381
|
className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
|
|
29845
30382
|
style,
|
|
29846
|
-
children: /* @__PURE__ */
|
|
30383
|
+
children: /* @__PURE__ */ jsx66("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
|
|
29847
30384
|
}
|
|
29848
30385
|
);
|
|
29849
30386
|
}
|
|
29850
|
-
return /* @__PURE__ */
|
|
30387
|
+
return /* @__PURE__ */ jsxs40(
|
|
29851
30388
|
"div",
|
|
29852
30389
|
{
|
|
29853
30390
|
className: `relative flex flex-col items-center ${className}`,
|
|
29854
30391
|
style,
|
|
29855
30392
|
children: [
|
|
29856
|
-
/* @__PURE__ */
|
|
29857
|
-
/* @__PURE__ */
|
|
29858
|
-
/* @__PURE__ */
|
|
30393
|
+
/* @__PURE__ */ jsxs40("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
|
|
30394
|
+
/* @__PURE__ */ jsx66(ResponsiveContainer2, { width: "99%", height: "100%", children: /* @__PURE__ */ jsxs40(PieChart, { children: [
|
|
30395
|
+
/* @__PURE__ */ jsxs40(
|
|
29859
30396
|
Pie,
|
|
29860
30397
|
{
|
|
29861
30398
|
data,
|
|
@@ -29867,8 +30404,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29867
30404
|
labelLine: false,
|
|
29868
30405
|
isAnimationActive: false,
|
|
29869
30406
|
children: [
|
|
29870
|
-
data.map((entry, index) => /* @__PURE__ */
|
|
29871
|
-
/* @__PURE__ */
|
|
30407
|
+
data.map((entry, index) => /* @__PURE__ */ jsx66(Cell, { fill: entry.color }, `cell-${index}`)),
|
|
30408
|
+
/* @__PURE__ */ jsx66(
|
|
29872
30409
|
LabelList,
|
|
29873
30410
|
{
|
|
29874
30411
|
dataKey: "value",
|
|
@@ -29881,14 +30418,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29881
30418
|
]
|
|
29882
30419
|
}
|
|
29883
30420
|
),
|
|
29884
|
-
/* @__PURE__ */
|
|
30421
|
+
/* @__PURE__ */ jsx66(
|
|
29885
30422
|
Tooltip2,
|
|
29886
30423
|
{
|
|
29887
30424
|
formatter: (value, name) => [`${value}k`, name]
|
|
29888
30425
|
}
|
|
29889
30426
|
)
|
|
29890
30427
|
] }) }),
|
|
29891
|
-
/* @__PURE__ */
|
|
30428
|
+
/* @__PURE__ */ jsxs40(
|
|
29892
30429
|
"div",
|
|
29893
30430
|
{
|
|
29894
30431
|
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]`,
|
|
@@ -29899,7 +30436,7 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29899
30436
|
}
|
|
29900
30437
|
)
|
|
29901
30438
|
] }),
|
|
29902
|
-
/* @__PURE__ */
|
|
30439
|
+
/* @__PURE__ */ jsx66("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
|
|
29903
30440
|
]
|
|
29904
30441
|
}
|
|
29905
30442
|
);
|
|
@@ -29907,10 +30444,10 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29907
30444
|
var PieChart_default = React13.memo(DonutChart);
|
|
29908
30445
|
|
|
29909
30446
|
// src/components/Blocks/EmailComposer.tsx
|
|
29910
|
-
import { jsx as
|
|
30447
|
+
import { jsx as jsx67, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
29911
30448
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
29912
|
-
return /* @__PURE__ */
|
|
29913
|
-
/* @__PURE__ */
|
|
30449
|
+
return /* @__PURE__ */ jsx67("div", { className, style, children: /* @__PURE__ */ jsxs41("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
30450
|
+
/* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsx67(
|
|
29914
30451
|
"input",
|
|
29915
30452
|
{
|
|
29916
30453
|
type: "email",
|
|
@@ -29919,8 +30456,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29919
30456
|
required: true
|
|
29920
30457
|
}
|
|
29921
30458
|
) }),
|
|
29922
|
-
/* @__PURE__ */
|
|
29923
|
-
/* @__PURE__ */
|
|
30459
|
+
/* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
30460
|
+
/* @__PURE__ */ jsx67(
|
|
29924
30461
|
"input",
|
|
29925
30462
|
{
|
|
29926
30463
|
type: "email",
|
|
@@ -29931,7 +30468,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29931
30468
|
required: true
|
|
29932
30469
|
}
|
|
29933
30470
|
),
|
|
29934
|
-
!showCc && /* @__PURE__ */
|
|
30471
|
+
!showCc && /* @__PURE__ */ jsx67(
|
|
29935
30472
|
"button",
|
|
29936
30473
|
{
|
|
29937
30474
|
onClick: () => setShowCc?.(true),
|
|
@@ -29939,7 +30476,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29939
30476
|
children: "Cc"
|
|
29940
30477
|
}
|
|
29941
30478
|
),
|
|
29942
|
-
!showBcc && /* @__PURE__ */
|
|
30479
|
+
!showBcc && /* @__PURE__ */ jsx67(
|
|
29943
30480
|
"button",
|
|
29944
30481
|
{
|
|
29945
30482
|
onClick: () => setShowBcc?.(true),
|
|
@@ -29948,7 +30485,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29948
30485
|
}
|
|
29949
30486
|
)
|
|
29950
30487
|
] }) }),
|
|
29951
|
-
showCc && /* @__PURE__ */
|
|
30488
|
+
showCc && /* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsx67(
|
|
29952
30489
|
"input",
|
|
29953
30490
|
{
|
|
29954
30491
|
type: "text",
|
|
@@ -29958,7 +30495,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29958
30495
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29959
30496
|
}
|
|
29960
30497
|
) }),
|
|
29961
|
-
showBcc && /* @__PURE__ */
|
|
30498
|
+
showBcc && /* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsx67(
|
|
29962
30499
|
"input",
|
|
29963
30500
|
{
|
|
29964
30501
|
type: "text",
|
|
@@ -29968,7 +30505,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29968
30505
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29969
30506
|
}
|
|
29970
30507
|
) }),
|
|
29971
|
-
/* @__PURE__ */
|
|
30508
|
+
/* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsx67(
|
|
29972
30509
|
"input",
|
|
29973
30510
|
{
|
|
29974
30511
|
type: "text",
|
|
@@ -29978,11 +30515,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
29978
30515
|
className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
|
|
29979
30516
|
}
|
|
29980
30517
|
) }),
|
|
29981
|
-
/* @__PURE__ */
|
|
29982
|
-
/* @__PURE__ */
|
|
29983
|
-
/* @__PURE__ */
|
|
29984
|
-
/* @__PURE__ */
|
|
29985
|
-
/* @__PURE__ */
|
|
30518
|
+
/* @__PURE__ */ jsx67("div", { className: "mb-4", children: /* @__PURE__ */ jsx67(MyEditor, { value: body, onChange: setBody }) }),
|
|
30519
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex justify-end gap-2", children: [
|
|
30520
|
+
/* @__PURE__ */ jsx67("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
30521
|
+
/* @__PURE__ */ jsx67("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
30522
|
+
/* @__PURE__ */ jsx67("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
29986
30523
|
] })
|
|
29987
30524
|
] }) });
|
|
29988
30525
|
}
|
|
@@ -30027,10 +30564,10 @@ function showSonnerToast({
|
|
|
30027
30564
|
// src/components/ui/sonner.tsx
|
|
30028
30565
|
import { useTheme } from "next-themes";
|
|
30029
30566
|
import { Toaster as Sonner } from "sonner";
|
|
30030
|
-
import { jsx as
|
|
30567
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
30031
30568
|
var Toaster = ({ ...props }) => {
|
|
30032
30569
|
const { theme = "system" } = useTheme();
|
|
30033
|
-
return /* @__PURE__ */
|
|
30570
|
+
return /* @__PURE__ */ jsx68(
|
|
30034
30571
|
Sonner,
|
|
30035
30572
|
{
|
|
30036
30573
|
theme,
|