@algorithm-shift/design-system 1.2.981 → 1.2.982
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 +6 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +30 -9
- package/dist/index.d.ts +30 -9
- package/dist/index.js +264 -184
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +229 -149
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -26856,39 +26856,117 @@ function SplitButton({ style, textContent, className, list = [] }) {
|
|
|
26856
26856
|
}
|
|
26857
26857
|
|
|
26858
26858
|
// src/components/Basic/Icon/Icon.tsx
|
|
26859
|
-
import
|
|
26859
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
26860
26860
|
import { FontAwesomeIcon as FontAwesomeIcon2 } from "@fortawesome/react-fontawesome";
|
|
26861
26861
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
26862
|
-
|
|
26863
|
-
|
|
26864
|
-
|
|
26865
|
-
|
|
26866
|
-
|
|
26867
|
-
|
|
26862
|
+
async function loadFAIcon(iconName, prefix = "fas") {
|
|
26863
|
+
const pkgMap = {
|
|
26864
|
+
fas: "@fortawesome/free-solid-svg-icons",
|
|
26865
|
+
// Solid
|
|
26866
|
+
far: "@fortawesome/free-regular-svg-icons",
|
|
26867
|
+
// Regular
|
|
26868
|
+
fab: "@fortawesome/free-brands-svg-icons"
|
|
26869
|
+
// Brands
|
|
26870
|
+
};
|
|
26871
|
+
const basePackage = pkgMap[prefix] || pkgMap["fas"];
|
|
26872
|
+
const modulePath = `${basePackage}`;
|
|
26873
|
+
try {
|
|
26874
|
+
const mod = await import(modulePath);
|
|
26875
|
+
return mod[iconName] || Object.values(mod)[0];
|
|
26876
|
+
} catch {
|
|
26877
|
+
console.warn(`FA icon not found in ${modulePath}`);
|
|
26878
|
+
return null;
|
|
26879
|
+
}
|
|
26880
|
+
}
|
|
26881
|
+
function Icon2(props) {
|
|
26882
|
+
const {
|
|
26883
|
+
iconSet = "fontawesome",
|
|
26884
|
+
icon,
|
|
26885
|
+
prefix = "fas",
|
|
26886
|
+
iconSize = 16,
|
|
26887
|
+
className = "",
|
|
26888
|
+
style = {},
|
|
26889
|
+
title = "",
|
|
26890
|
+
spin = false,
|
|
26891
|
+
fixedWidth = false,
|
|
26892
|
+
pulse = false,
|
|
26893
|
+
...rest
|
|
26894
|
+
} = props;
|
|
26895
|
+
const [dynamicIcon, setDynamicIcon] = useState3(icon || null);
|
|
26896
|
+
useEffect3(() => {
|
|
26897
|
+
if (icon && iconSet === "fontawesome") {
|
|
26898
|
+
loadFAIcon(icon, prefix).then((ico) => setDynamicIcon(ico));
|
|
26899
|
+
}
|
|
26900
|
+
}, [iconSet, icon, prefix]);
|
|
26901
|
+
if (iconSet === "lucide") {
|
|
26902
|
+
const Comp = lucide_react_exports[icon];
|
|
26903
|
+
if (!Comp) {
|
|
26904
|
+
console.warn(`Lucide icon not found: ${icon}`);
|
|
26868
26905
|
return null;
|
|
26869
26906
|
}
|
|
26870
|
-
|
|
26907
|
+
const numericSize = typeof iconSize === "number" ? iconSize : parseInt(iconSize, 10) || 16;
|
|
26908
|
+
return /* @__PURE__ */ jsx18(
|
|
26909
|
+
Comp,
|
|
26910
|
+
{
|
|
26911
|
+
size: numericSize,
|
|
26912
|
+
className,
|
|
26913
|
+
title,
|
|
26914
|
+
style,
|
|
26915
|
+
"aria-hidden": title ? void 0 : true,
|
|
26916
|
+
onClick: () => props.onClick?.(),
|
|
26917
|
+
...rest
|
|
26918
|
+
}
|
|
26919
|
+
);
|
|
26920
|
+
}
|
|
26921
|
+
if (iconSet === "fontawesome") {
|
|
26922
|
+
if (!dynamicIcon) return null;
|
|
26923
|
+
const tempStyle = { ...style };
|
|
26924
|
+
delete tempStyle.height;
|
|
26925
|
+
delete tempStyle.width;
|
|
26926
|
+
return /* @__PURE__ */ jsx18(
|
|
26871
26927
|
FontAwesomeIcon2,
|
|
26872
26928
|
{
|
|
26873
|
-
icon:
|
|
26874
|
-
|
|
26875
|
-
|
|
26929
|
+
icon: dynamicIcon,
|
|
26930
|
+
size: typeof iconSize === "string" ? iconSize : void 0,
|
|
26931
|
+
spin,
|
|
26932
|
+
spinPulse: pulse,
|
|
26933
|
+
widthAuto: fixedWidth,
|
|
26934
|
+
className: cn(className),
|
|
26935
|
+
title,
|
|
26936
|
+
style: {
|
|
26937
|
+
...tempStyle
|
|
26938
|
+
},
|
|
26939
|
+
onClick: () => props.onClick?.()
|
|
26876
26940
|
}
|
|
26877
26941
|
);
|
|
26878
26942
|
}
|
|
26879
|
-
if (
|
|
26880
|
-
const
|
|
26881
|
-
|
|
26882
|
-
|
|
26883
|
-
|
|
26884
|
-
|
|
26943
|
+
if (iconSet === "fa" || iconSet === "fa-css") {
|
|
26944
|
+
const sizeStyle = typeof iconSize === "number" ? { fontSize: iconSize } : {};
|
|
26945
|
+
const cls = [
|
|
26946
|
+
`${prefix} fa-${icon}`,
|
|
26947
|
+
spin ? "fa-spin" : "",
|
|
26948
|
+
pulse ? "fa-pulse" : "",
|
|
26949
|
+
fixedWidth ? "fa-fw" : "",
|
|
26950
|
+
className
|
|
26951
|
+
].filter(Boolean).join(" ");
|
|
26952
|
+
return /* @__PURE__ */ jsx18(
|
|
26953
|
+
"i",
|
|
26954
|
+
{
|
|
26955
|
+
className: cls,
|
|
26956
|
+
style: { ...sizeStyle, ...style },
|
|
26957
|
+
title,
|
|
26958
|
+
"aria-hidden": title ? void 0 : true,
|
|
26959
|
+
onClick: () => props.onClick?.(),
|
|
26960
|
+
...rest
|
|
26961
|
+
}
|
|
26962
|
+
);
|
|
26885
26963
|
}
|
|
26886
|
-
|
|
26887
|
-
|
|
26888
|
-
|
|
26964
|
+
console.warn("Unknown icon set:", iconSet);
|
|
26965
|
+
return null;
|
|
26966
|
+
}
|
|
26889
26967
|
|
|
26890
26968
|
// src/components/Inputs/TextInput/TextInput.tsx
|
|
26891
|
-
import { useEffect as
|
|
26969
|
+
import { useEffect as useEffect4 } from "react";
|
|
26892
26970
|
|
|
26893
26971
|
// src/components/ui/input.tsx
|
|
26894
26972
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
@@ -26917,7 +26995,7 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
26917
26995
|
const isDisabled = props.isDisabled ?? false;
|
|
26918
26996
|
const isReadonly = props.isReadonly ?? false;
|
|
26919
26997
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
26920
|
-
|
|
26998
|
+
useEffect4(() => {
|
|
26921
26999
|
if (props.value !== void 0) {
|
|
26922
27000
|
const e = { target: { value: props.value } };
|
|
26923
27001
|
handleChange?.(e);
|
|
@@ -26959,7 +27037,7 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
26959
27037
|
var TextInput_default = TextInput;
|
|
26960
27038
|
|
|
26961
27039
|
// src/components/Inputs/NumberInput/NumberInput.tsx
|
|
26962
|
-
import { useEffect as
|
|
27040
|
+
import { useEffect as useEffect5 } from "react";
|
|
26963
27041
|
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
26964
27042
|
var NumberInput = ({ className, style, ...props }) => {
|
|
26965
27043
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -26967,7 +27045,7 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
26967
27045
|
const isDisabled = props.isDisabled ?? false;
|
|
26968
27046
|
const isReadonly = props.isReadonly ?? false;
|
|
26969
27047
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
26970
|
-
|
|
27048
|
+
useEffect5(() => {
|
|
26971
27049
|
if (props.value !== void 0) {
|
|
26972
27050
|
const e = { target: { value: props.value } };
|
|
26973
27051
|
handleChange?.(e);
|
|
@@ -27009,7 +27087,7 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
27009
27087
|
var NumberInput_default = NumberInput;
|
|
27010
27088
|
|
|
27011
27089
|
// src/components/Inputs/EmailInput/EmailInput.tsx
|
|
27012
|
-
import { useEffect as
|
|
27090
|
+
import { useEffect as useEffect6 } from "react";
|
|
27013
27091
|
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
27014
27092
|
var EmailInput = ({ className, style, ...props }) => {
|
|
27015
27093
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27017,7 +27095,7 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
27017
27095
|
const isDisabled = props.isDisabled ?? false;
|
|
27018
27096
|
const isReadonly = props.isReadonly ?? false;
|
|
27019
27097
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27020
|
-
|
|
27098
|
+
useEffect6(() => {
|
|
27021
27099
|
if (props.value !== void 0) {
|
|
27022
27100
|
const e = { target: { value: props.value } };
|
|
27023
27101
|
handleChange?.(e);
|
|
@@ -27059,7 +27137,7 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
27059
27137
|
var EmailInput_default = EmailInput;
|
|
27060
27138
|
|
|
27061
27139
|
// src/components/Inputs/PasswordInput/PasswordInput.tsx
|
|
27062
|
-
import { useEffect as
|
|
27140
|
+
import { useEffect as useEffect7 } from "react";
|
|
27063
27141
|
import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
27064
27142
|
var PasswordInput = ({ className, style, ...props }) => {
|
|
27065
27143
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27067,7 +27145,7 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
27067
27145
|
const isDisabled = props.isDisabled ?? false;
|
|
27068
27146
|
const isReadonly = props.isReadonly ?? false;
|
|
27069
27147
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27070
|
-
|
|
27148
|
+
useEffect7(() => {
|
|
27071
27149
|
if (props.value !== void 0) {
|
|
27072
27150
|
const e = { target: { value: props.value } };
|
|
27073
27151
|
handleChange?.(e);
|
|
@@ -27109,7 +27187,7 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
27109
27187
|
var PasswordInput_default = PasswordInput;
|
|
27110
27188
|
|
|
27111
27189
|
// src/components/Inputs/Textarea/Textarea.tsx
|
|
27112
|
-
import { useEffect as
|
|
27190
|
+
import { useEffect as useEffect8 } from "react";
|
|
27113
27191
|
|
|
27114
27192
|
// src/components/ui/textarea.tsx
|
|
27115
27193
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
@@ -27135,7 +27213,7 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
27135
27213
|
const isDisabled = props.isDisabled ?? false;
|
|
27136
27214
|
const isReadonly = props.isReadonly ?? false;
|
|
27137
27215
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27138
|
-
|
|
27216
|
+
useEffect8(() => {
|
|
27139
27217
|
if (props.value !== void 0) {
|
|
27140
27218
|
const e = { target: { value: props.value } };
|
|
27141
27219
|
handleChange?.(e);
|
|
@@ -27169,7 +27247,7 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
27169
27247
|
var Textarea_default = Textarea2;
|
|
27170
27248
|
|
|
27171
27249
|
// src/components/Inputs/UrlInput/UrlInput.tsx
|
|
27172
|
-
import { useEffect as
|
|
27250
|
+
import { useEffect as useEffect9 } from "react";
|
|
27173
27251
|
import { Fragment as Fragment8, jsx as jsx26, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
27174
27252
|
var UrlInput = ({ className, style, ...props }) => {
|
|
27175
27253
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27177,7 +27255,7 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
27177
27255
|
const isDisabled = props.isDisabled ?? false;
|
|
27178
27256
|
const isReadonly = props.isReadonly ?? false;
|
|
27179
27257
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27180
|
-
|
|
27258
|
+
useEffect9(() => {
|
|
27181
27259
|
if (props.value !== void 0) {
|
|
27182
27260
|
const e = { target: { value: props.value } };
|
|
27183
27261
|
handleChange?.(e);
|
|
@@ -27222,7 +27300,7 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
27222
27300
|
var UrlInput_default = UrlInput;
|
|
27223
27301
|
|
|
27224
27302
|
// src/components/Inputs/Checkbox/Checkbox.tsx
|
|
27225
|
-
import { useEffect as
|
|
27303
|
+
import { useEffect as useEffect10 } from "react";
|
|
27226
27304
|
|
|
27227
27305
|
// src/components/ui/checkbox.tsx
|
|
27228
27306
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
@@ -27287,7 +27365,7 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
27287
27365
|
}
|
|
27288
27366
|
return false;
|
|
27289
27367
|
};
|
|
27290
|
-
|
|
27368
|
+
useEffect10(() => {
|
|
27291
27369
|
if (props.value) {
|
|
27292
27370
|
handleChange(formatValue(props.value));
|
|
27293
27371
|
}
|
|
@@ -27314,7 +27392,7 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
27314
27392
|
var Checkbox_default = CheckboxInput;
|
|
27315
27393
|
|
|
27316
27394
|
// src/components/Inputs/RadioInput/RadioInput.tsx
|
|
27317
|
-
import { useEffect as
|
|
27395
|
+
import { useEffect as useEffect11 } from "react";
|
|
27318
27396
|
|
|
27319
27397
|
// src/components/ui/radio-group.tsx
|
|
27320
27398
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
@@ -27374,7 +27452,7 @@ var RadioInput = ({
|
|
|
27374
27452
|
value: item[dataKey || "value"],
|
|
27375
27453
|
label: item[dataLabel || "label"]
|
|
27376
27454
|
}));
|
|
27377
|
-
|
|
27455
|
+
useEffect11(() => {
|
|
27378
27456
|
if (props.value !== void 0) {
|
|
27379
27457
|
handleChange?.(props.value);
|
|
27380
27458
|
}
|
|
@@ -27404,7 +27482,7 @@ var RadioInput = ({
|
|
|
27404
27482
|
var RadioInput_default = RadioInput;
|
|
27405
27483
|
|
|
27406
27484
|
// src/components/Inputs/MultiCheckbox/MultiCheckbox.tsx
|
|
27407
|
-
import { useEffect as
|
|
27485
|
+
import { useEffect as useEffect12, useState as useState4, useRef, useCallback } from "react";
|
|
27408
27486
|
import { jsx as jsx32, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
27409
27487
|
function MultiCheckbox({
|
|
27410
27488
|
apiUrl,
|
|
@@ -27423,10 +27501,10 @@ function MultiCheckbox({
|
|
|
27423
27501
|
onUncheckItems,
|
|
27424
27502
|
...props
|
|
27425
27503
|
}) {
|
|
27426
|
-
const [options, setOptions] =
|
|
27427
|
-
const [page, setPage] =
|
|
27428
|
-
const [hasMore, setHasMore] =
|
|
27429
|
-
const [pageLoading, setPageLoading] =
|
|
27504
|
+
const [options, setOptions] = useState4([]);
|
|
27505
|
+
const [page, setPage] = useState4(1);
|
|
27506
|
+
const [hasMore, setHasMore] = useState4(true);
|
|
27507
|
+
const [pageLoading, setPageLoading] = useState4(false);
|
|
27430
27508
|
const loadMoreRef = useRef(null);
|
|
27431
27509
|
const normalizeInput = (val) => {
|
|
27432
27510
|
if (!val) return [];
|
|
@@ -27486,7 +27564,7 @@ function MultiCheckbox({
|
|
|
27486
27564
|
setPageLoading(false);
|
|
27487
27565
|
}
|
|
27488
27566
|
}, [source, pageLoading, fetchApiPage, mapData, pageSize]);
|
|
27489
|
-
|
|
27567
|
+
useEffect12(() => {
|
|
27490
27568
|
if (source === "api") {
|
|
27491
27569
|
setOptions([]);
|
|
27492
27570
|
setPage(1);
|
|
@@ -27496,10 +27574,10 @@ function MultiCheckbox({
|
|
|
27496
27574
|
setHasMore(false);
|
|
27497
27575
|
}
|
|
27498
27576
|
}, [source, JSON.stringify(data)]);
|
|
27499
|
-
|
|
27577
|
+
useEffect12(() => {
|
|
27500
27578
|
if (source === "api") loadPage();
|
|
27501
27579
|
}, [page, source]);
|
|
27502
|
-
|
|
27580
|
+
useEffect12(() => {
|
|
27503
27581
|
if (source !== "api") return;
|
|
27504
27582
|
if (!hasMore || pageLoading) return;
|
|
27505
27583
|
const observer = new IntersectionObserver((entries) => {
|
|
@@ -27562,7 +27640,7 @@ function MultiCheckbox({
|
|
|
27562
27640
|
}
|
|
27563
27641
|
|
|
27564
27642
|
// src/components/Inputs/RichText/RichText.tsx
|
|
27565
|
-
import { useEffect as
|
|
27643
|
+
import { useEffect as useEffect13 } from "react";
|
|
27566
27644
|
|
|
27567
27645
|
// src/components/Global/TinyMceEditor.tsx
|
|
27568
27646
|
import { useMemo as useMemo2, useRef as useRef2 } from "react";
|
|
@@ -27638,7 +27716,7 @@ function MyEditor({
|
|
|
27638
27716
|
// src/components/Inputs/RichText/RichText.tsx
|
|
27639
27717
|
import { jsx as jsx34, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
27640
27718
|
function RichText({ className, style, ...props }) {
|
|
27641
|
-
|
|
27719
|
+
useEffect13(() => {
|
|
27642
27720
|
if (props.value !== void 0) {
|
|
27643
27721
|
handleChange?.(props.value);
|
|
27644
27722
|
}
|
|
@@ -27663,7 +27741,7 @@ function RichText({ className, style, ...props }) {
|
|
|
27663
27741
|
}
|
|
27664
27742
|
|
|
27665
27743
|
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
27666
|
-
import { useEffect as
|
|
27744
|
+
import { useEffect as useEffect16 } from "react";
|
|
27667
27745
|
|
|
27668
27746
|
// src/components/ui/select.tsx
|
|
27669
27747
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
@@ -27792,17 +27870,17 @@ function SelectScrollDownButton({
|
|
|
27792
27870
|
}
|
|
27793
27871
|
|
|
27794
27872
|
// src/components/Inputs/Dropdown/LazyDropdown.tsx
|
|
27795
|
-
import { useState as
|
|
27873
|
+
import { useState as useState6, useRef as useRef4, useEffect as useEffect15, useMemo as useMemo3 } from "react";
|
|
27796
27874
|
|
|
27797
27875
|
// src/hooks/useLazyDropdown.ts
|
|
27798
|
-
import { useState as
|
|
27876
|
+
import { useState as useState5, useEffect as useEffect14, useRef as useRef3, useCallback as useCallback2 } from "react";
|
|
27799
27877
|
import axios from "axios";
|
|
27800
27878
|
function useLazyDropdown(config) {
|
|
27801
|
-
const [options, setOptions] =
|
|
27802
|
-
const [page, setPage] =
|
|
27803
|
-
const [hasMore, setHasMore] =
|
|
27804
|
-
const [loading, setLoading] =
|
|
27805
|
-
const [searchTerm, setSearchTerm] =
|
|
27879
|
+
const [options, setOptions] = useState5([]);
|
|
27880
|
+
const [page, setPage] = useState5(1);
|
|
27881
|
+
const [hasMore, setHasMore] = useState5(true);
|
|
27882
|
+
const [loading, setLoading] = useState5(false);
|
|
27883
|
+
const [searchTerm, setSearchTerm] = useState5("");
|
|
27806
27884
|
const debounceTimer = useRef3(null);
|
|
27807
27885
|
const allDataRef = useRef3([]);
|
|
27808
27886
|
const configRef = useRef3(config);
|
|
@@ -27815,7 +27893,7 @@ function useLazyDropdown(config) {
|
|
|
27815
27893
|
return true;
|
|
27816
27894
|
});
|
|
27817
27895
|
};
|
|
27818
|
-
|
|
27896
|
+
useEffect14(() => {
|
|
27819
27897
|
configRef.current = config;
|
|
27820
27898
|
}, [config]);
|
|
27821
27899
|
function getValueByPath2(obj, path) {
|
|
@@ -27963,7 +28041,7 @@ function useLazyDropdown(config) {
|
|
|
27963
28041
|
setLoading(false);
|
|
27964
28042
|
}
|
|
27965
28043
|
};
|
|
27966
|
-
|
|
28044
|
+
useEffect14(() => {
|
|
27967
28045
|
const cfg = configRef.current;
|
|
27968
28046
|
if (!cfg.enabled || !cfg.value || cfg.dataSource !== "api" || !cfg.apiUrl) return;
|
|
27969
28047
|
if (cfg.isMultiSelect) {
|
|
@@ -27992,13 +28070,13 @@ function useLazyDropdown(config) {
|
|
|
27992
28070
|
setSearchTerm("");
|
|
27993
28071
|
setPage(1);
|
|
27994
28072
|
}, []);
|
|
27995
|
-
|
|
28073
|
+
useEffect14(() => {
|
|
27996
28074
|
if (config.initialData?.length) {
|
|
27997
28075
|
allDataRef.current = config.initialData;
|
|
27998
28076
|
loadPage(1, "");
|
|
27999
28077
|
}
|
|
28000
28078
|
}, [config.initialData]);
|
|
28001
|
-
|
|
28079
|
+
useEffect14(() => {
|
|
28002
28080
|
return () => {
|
|
28003
28081
|
if (debounceTimer.current) clearTimeout(debounceTimer.current);
|
|
28004
28082
|
};
|
|
@@ -28062,8 +28140,8 @@ function LazySelectDropdown({
|
|
|
28062
28140
|
enableAddNewOption = false,
|
|
28063
28141
|
enforceStrictQueryParams = false
|
|
28064
28142
|
}) {
|
|
28065
|
-
const [isOpen, setIsOpen] =
|
|
28066
|
-
const [searchTerm, setSearchTerm] =
|
|
28143
|
+
const [isOpen, setIsOpen] = useState6(false);
|
|
28144
|
+
const [searchTerm, setSearchTerm] = useState6("");
|
|
28067
28145
|
const dropdownRef = useRef4(null);
|
|
28068
28146
|
const observerTarget = useRef4(null);
|
|
28069
28147
|
const {
|
|
@@ -28088,7 +28166,7 @@ function LazySelectDropdown({
|
|
|
28088
28166
|
enforceStrictQueryParams
|
|
28089
28167
|
});
|
|
28090
28168
|
const selectedOption = useMemo3(() => lazyOptions.find((opt) => opt.value === value), [lazyOptions, value]);
|
|
28091
|
-
|
|
28169
|
+
useEffect15(() => {
|
|
28092
28170
|
const handleClickOutside = (e) => {
|
|
28093
28171
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
28094
28172
|
setIsOpen(false);
|
|
@@ -28098,7 +28176,7 @@ function LazySelectDropdown({
|
|
|
28098
28176
|
document.addEventListener("mousedown", handleClickOutside);
|
|
28099
28177
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
28100
28178
|
}, []);
|
|
28101
|
-
|
|
28179
|
+
useEffect15(() => {
|
|
28102
28180
|
if (!isOpen || !hasMore || loading) return;
|
|
28103
28181
|
const observer = new IntersectionObserver(
|
|
28104
28182
|
(entries) => {
|
|
@@ -28238,7 +28316,7 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
28238
28316
|
const isEditable = props.isEditable ?? true;
|
|
28239
28317
|
const isDisabled = props.isDisabled ?? false;
|
|
28240
28318
|
const isReadonly = props.isReadonly ?? false;
|
|
28241
|
-
|
|
28319
|
+
useEffect16(() => {
|
|
28242
28320
|
if (props.value !== void 0) {
|
|
28243
28321
|
handleChange(props.value);
|
|
28244
28322
|
}
|
|
@@ -28297,7 +28375,7 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
28297
28375
|
var Dropdown_default = Dropdown;
|
|
28298
28376
|
|
|
28299
28377
|
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
28300
|
-
import { useEffect as
|
|
28378
|
+
import { useEffect as useEffect17 } from "react";
|
|
28301
28379
|
|
|
28302
28380
|
// src/components/ui/switch.tsx
|
|
28303
28381
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
@@ -28333,7 +28411,7 @@ import { Fragment as Fragment13, jsx as jsx39, jsxs as jsxs20 } from "react/jsx-
|
|
|
28333
28411
|
var SwitchToggle = ({ className, style, ...props }) => {
|
|
28334
28412
|
const isEditable = props.isEditable ?? true;
|
|
28335
28413
|
const isDisabled = props.isDisabled ?? false;
|
|
28336
|
-
|
|
28414
|
+
useEffect17(() => {
|
|
28337
28415
|
if (props.value !== void 0) {
|
|
28338
28416
|
handleChange?.(props.value);
|
|
28339
28417
|
}
|
|
@@ -28360,7 +28438,7 @@ var SwitchToggle = ({ className, style, ...props }) => {
|
|
|
28360
28438
|
var SwitchToggle_default = SwitchToggle;
|
|
28361
28439
|
|
|
28362
28440
|
// src/components/Inputs/PhoneInput/PhoneInput.tsx
|
|
28363
|
-
import { useEffect as
|
|
28441
|
+
import { useEffect as useEffect18 } from "react";
|
|
28364
28442
|
import { PhoneInput as PhoneInputField } from "react-international-phone";
|
|
28365
28443
|
import "react-international-phone/style.css";
|
|
28366
28444
|
import { Fragment as Fragment14, jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
@@ -28375,7 +28453,7 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
28375
28453
|
const placeholder = props.placeholder ?? "Enter phone number";
|
|
28376
28454
|
const isEditable = props.isEditable ?? true;
|
|
28377
28455
|
const isDisabled = props.isDisabled ?? false;
|
|
28378
|
-
|
|
28456
|
+
useEffect18(() => {
|
|
28379
28457
|
if (props.value !== void 0) {
|
|
28380
28458
|
const normalized = ensureIndiaCode(props.value);
|
|
28381
28459
|
handleChange?.(normalized);
|
|
@@ -28422,7 +28500,7 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
28422
28500
|
var PhoneInput_default = PhoneInput;
|
|
28423
28501
|
|
|
28424
28502
|
// src/components/Inputs/SearchInput/SearchInput.tsx
|
|
28425
|
-
import { useEffect as
|
|
28503
|
+
import { useEffect as useEffect19 } from "react";
|
|
28426
28504
|
import { Fragment as Fragment15, jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
28427
28505
|
var SearchInput = ({ className, style, ...props }) => {
|
|
28428
28506
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -28430,7 +28508,7 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
28430
28508
|
const isDisabled = props.isDisabled ?? false;
|
|
28431
28509
|
const isReadonly = props.isReadonly ?? false;
|
|
28432
28510
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
28433
|
-
|
|
28511
|
+
useEffect19(() => {
|
|
28434
28512
|
if (props.value !== void 0) {
|
|
28435
28513
|
const e = { target: { value: props.value } };
|
|
28436
28514
|
handleChange?.(e);
|
|
@@ -28472,11 +28550,11 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
28472
28550
|
var SearchInput_default = SearchInput;
|
|
28473
28551
|
|
|
28474
28552
|
// src/components/Inputs/FileInput/FileInput.tsx
|
|
28475
|
-
import { useEffect as
|
|
28553
|
+
import { useEffect as useEffect20 } from "react";
|
|
28476
28554
|
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
28477
28555
|
var FileInput2 = ({ className, style, ...props }) => {
|
|
28478
28556
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
28479
|
-
|
|
28557
|
+
useEffect20(() => {
|
|
28480
28558
|
if (props.value !== void 0) {
|
|
28481
28559
|
const e = { target: { value: props.value } };
|
|
28482
28560
|
handleChange?.(e);
|
|
@@ -28516,11 +28594,11 @@ var FileInput2 = ({ className, style, ...props }) => {
|
|
|
28516
28594
|
var FileInput_default = FileInput2;
|
|
28517
28595
|
|
|
28518
28596
|
// src/components/Inputs/DatePicker/DatePicker.tsx
|
|
28519
|
-
import * as
|
|
28597
|
+
import * as React7 from "react";
|
|
28520
28598
|
import { format } from "date-fns";
|
|
28521
28599
|
|
|
28522
28600
|
// src/components/ui/calendar.tsx
|
|
28523
|
-
import * as
|
|
28601
|
+
import * as React6 from "react";
|
|
28524
28602
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
28525
28603
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
28526
28604
|
function Calendar2({
|
|
@@ -28675,8 +28753,8 @@ function CalendarDayButton({
|
|
|
28675
28753
|
...props
|
|
28676
28754
|
}) {
|
|
28677
28755
|
const defaultClassNames = getDefaultClassNames();
|
|
28678
|
-
const ref =
|
|
28679
|
-
|
|
28756
|
+
const ref = React6.useRef(null);
|
|
28757
|
+
React6.useEffect(() => {
|
|
28680
28758
|
if (modifiers.focused) ref.current?.focus();
|
|
28681
28759
|
}, [modifiers.focused]);
|
|
28682
28760
|
return /* @__PURE__ */ jsx43(
|
|
@@ -28770,25 +28848,25 @@ function DateTimePicker({
|
|
|
28770
28848
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
28771
28849
|
const minDate = resolveDate(minimumDate, customMinimumDate);
|
|
28772
28850
|
const maxDate = resolveDate(maximumDate, customMaximumDate);
|
|
28773
|
-
const [date, setDate] =
|
|
28851
|
+
const [date, setDate] = React7.useState(() => {
|
|
28774
28852
|
if (!props.value) return void 0;
|
|
28775
28853
|
const d = new Date(props.value);
|
|
28776
28854
|
return isNaN(d.getTime()) ? void 0 : d;
|
|
28777
28855
|
});
|
|
28778
28856
|
const initialHours = date ? date.getHours() : 0;
|
|
28779
28857
|
const initialMinutes = date ? date.getMinutes() : 0;
|
|
28780
|
-
const [hours, setHours] =
|
|
28781
|
-
const [minutes, setMinutes] =
|
|
28782
|
-
const [amPm, setAmPm] =
|
|
28783
|
-
const displayHours =
|
|
28858
|
+
const [hours, setHours] = React7.useState(initialHours);
|
|
28859
|
+
const [minutes, setMinutes] = React7.useState(initialMinutes);
|
|
28860
|
+
const [amPm, setAmPm] = React7.useState("AM");
|
|
28861
|
+
const displayHours = React7.useMemo(() => {
|
|
28784
28862
|
if (hours === 0) return 12;
|
|
28785
28863
|
if (hours > 12) return hours - 12;
|
|
28786
28864
|
return hours;
|
|
28787
28865
|
}, [hours]);
|
|
28788
|
-
|
|
28866
|
+
React7.useEffect(() => {
|
|
28789
28867
|
setAmPm(hours >= 12 ? "PM" : "AM");
|
|
28790
28868
|
}, [hours]);
|
|
28791
|
-
|
|
28869
|
+
React7.useEffect(() => {
|
|
28792
28870
|
if (!props.value) {
|
|
28793
28871
|
setDate(void 0);
|
|
28794
28872
|
return;
|
|
@@ -28800,8 +28878,8 @@ function DateTimePicker({
|
|
|
28800
28878
|
setMinutes(d.getMinutes());
|
|
28801
28879
|
}
|
|
28802
28880
|
}, [props.value]);
|
|
28803
|
-
const [year, setYear] =
|
|
28804
|
-
|
|
28881
|
+
const [year, setYear] = React7.useState(date ? date.getFullYear() : (/* @__PURE__ */ new Date()).getFullYear());
|
|
28882
|
+
React7.useEffect(() => {
|
|
28805
28883
|
if (!date) return;
|
|
28806
28884
|
const newDate = new Date(date);
|
|
28807
28885
|
newDate.setFullYear(year);
|
|
@@ -28904,7 +28982,7 @@ function DateTimePicker({
|
|
|
28904
28982
|
for (let y = currentYear - 50; y <= currentYear + 10; y++) {
|
|
28905
28983
|
yearOptions.push(y);
|
|
28906
28984
|
}
|
|
28907
|
-
const displayValue =
|
|
28985
|
+
const displayValue = React7.useMemo(() => {
|
|
28908
28986
|
if (!date) return "";
|
|
28909
28987
|
try {
|
|
28910
28988
|
if (mode === "date") return format(date, "dd-MM-yyyy");
|
|
@@ -28915,11 +28993,11 @@ function DateTimePicker({
|
|
|
28915
28993
|
}
|
|
28916
28994
|
}, [date, mode]);
|
|
28917
28995
|
const isInputDisabled = isDisabled || !isEditable;
|
|
28918
|
-
const [calendarMonthState, setCalendarMonthState] =
|
|
28996
|
+
const [calendarMonthState, setCalendarMonthState] = React7.useState(() => {
|
|
28919
28997
|
const currentMonth = (/* @__PURE__ */ new Date()).getMonth();
|
|
28920
28998
|
return date ? new Date(date.getFullYear(), date.getMonth()) : new Date(year, currentMonth);
|
|
28921
28999
|
});
|
|
28922
|
-
|
|
29000
|
+
React7.useEffect(() => {
|
|
28923
29001
|
setCalendarMonthState(new Date(year, calendarMonthState.getMonth()));
|
|
28924
29002
|
}, [year]);
|
|
28925
29003
|
const handleToday = () => {
|
|
@@ -29065,18 +29143,18 @@ function DateTimePicker({
|
|
|
29065
29143
|
}
|
|
29066
29144
|
|
|
29067
29145
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
29068
|
-
import
|
|
29146
|
+
import React8, { useEffect as useEffect23 } from "react";
|
|
29069
29147
|
import { addDays, format as format2 } from "date-fns";
|
|
29070
29148
|
import { Fragment as Fragment17, jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
29071
29149
|
var DateRange = ({ className, style, ...props }) => {
|
|
29072
29150
|
const isDateRange = (val) => !!val && val.from instanceof Date;
|
|
29073
|
-
const [date, setDate] =
|
|
29151
|
+
const [date, setDate] = React8.useState(
|
|
29074
29152
|
isDateRange(props.value) ? props.value : {
|
|
29075
29153
|
from: /* @__PURE__ */ new Date(),
|
|
29076
29154
|
to: addDays(/* @__PURE__ */ new Date(), 7)
|
|
29077
29155
|
}
|
|
29078
29156
|
);
|
|
29079
|
-
|
|
29157
|
+
useEffect23(() => {
|
|
29080
29158
|
if (props.value && isDateRange(props.value)) {
|
|
29081
29159
|
handleChange?.(props.value);
|
|
29082
29160
|
}
|
|
@@ -29123,7 +29201,7 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
29123
29201
|
var DateRange_default = DateRange;
|
|
29124
29202
|
|
|
29125
29203
|
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
29126
|
-
import { useEffect as
|
|
29204
|
+
import { useEffect as useEffect24 } from "react";
|
|
29127
29205
|
import { Fragment as Fragment18, jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
29128
29206
|
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
29129
29207
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -29131,7 +29209,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
29131
29209
|
const isDisabled = props.isDisabled ?? false;
|
|
29132
29210
|
const isReadonly = props.isReadonly ?? false;
|
|
29133
29211
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
29134
|
-
|
|
29212
|
+
useEffect24(() => {
|
|
29135
29213
|
if (props.value !== void 0) {
|
|
29136
29214
|
const e = { target: { value: props.value } };
|
|
29137
29215
|
handleChange?.(e);
|
|
@@ -29184,10 +29262,9 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
29184
29262
|
var TextInputGroup_default = TextInputGroup;
|
|
29185
29263
|
|
|
29186
29264
|
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
29187
|
-
import { useState as
|
|
29265
|
+
import { useState as useState8, useRef as useRef6, useEffect as useEffect25, useMemo as useMemo5 } from "react";
|
|
29188
29266
|
import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
29189
29267
|
function LazyMultiSelectDropdown({
|
|
29190
|
-
options = [],
|
|
29191
29268
|
value = [],
|
|
29192
29269
|
onChange,
|
|
29193
29270
|
placeholder,
|
|
@@ -29202,10 +29279,11 @@ function LazyMultiSelectDropdown({
|
|
|
29202
29279
|
dataLabel = "name",
|
|
29203
29280
|
errorMessage,
|
|
29204
29281
|
axiosInstance,
|
|
29205
|
-
outputFormat = "array"
|
|
29282
|
+
outputFormat = "array",
|
|
29283
|
+
...props
|
|
29206
29284
|
}) {
|
|
29207
|
-
const [isOpen, setIsOpen] =
|
|
29208
|
-
const [searchTerm, setSearchTerm] =
|
|
29285
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
29286
|
+
const [searchTerm, setSearchTerm] = useState8("");
|
|
29209
29287
|
const dropdownRef = useRef6(null);
|
|
29210
29288
|
const observerTarget = useRef6(null);
|
|
29211
29289
|
const ensureUnique = (arr) => {
|
|
@@ -29224,26 +29302,27 @@ function LazyMultiSelectDropdown({
|
|
|
29224
29302
|
return ensureUnique(arr);
|
|
29225
29303
|
};
|
|
29226
29304
|
const normalizedValue = normalizeInput(value);
|
|
29305
|
+
const list = Array.isArray(props?.data) ? props.data : [];
|
|
29227
29306
|
const {
|
|
29228
29307
|
options: lazyOptions,
|
|
29229
29308
|
loading,
|
|
29230
29309
|
hasMore,
|
|
29231
29310
|
loadMore,
|
|
29232
29311
|
search,
|
|
29233
|
-
reset,
|
|
29234
29312
|
loadPage
|
|
29235
29313
|
} = useLazyDropdown({
|
|
29236
29314
|
enabled: true,
|
|
29237
29315
|
dataSource: source || "",
|
|
29238
29316
|
apiUrl,
|
|
29239
|
-
pageSize: pageSize
|
|
29317
|
+
pageSize: pageSize ?? 10,
|
|
29240
29318
|
dataKey,
|
|
29241
29319
|
dataLabel,
|
|
29242
|
-
initialData:
|
|
29320
|
+
initialData: list || [],
|
|
29243
29321
|
value: normalizedValue,
|
|
29244
29322
|
axiosInstance,
|
|
29245
29323
|
isMultiSelect: true
|
|
29246
29324
|
});
|
|
29325
|
+
const dataLoading = props.loading || loading;
|
|
29247
29326
|
const convertOutput = (values) => {
|
|
29248
29327
|
const unique = ensureUnique(values);
|
|
29249
29328
|
switch (outputFormat) {
|
|
@@ -29258,7 +29337,7 @@ function LazyMultiSelectDropdown({
|
|
|
29258
29337
|
const selectedOptions = useMemo5(() => {
|
|
29259
29338
|
return lazyOptions.filter((opt) => normalizedValue.includes(opt.value));
|
|
29260
29339
|
}, [lazyOptions, normalizedValue]);
|
|
29261
|
-
|
|
29340
|
+
useEffect25(() => {
|
|
29262
29341
|
const handleClick = (e) => {
|
|
29263
29342
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
29264
29343
|
setIsOpen(false);
|
|
@@ -29267,7 +29346,7 @@ function LazyMultiSelectDropdown({
|
|
|
29267
29346
|
document.addEventListener("mousedown", handleClick);
|
|
29268
29347
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
29269
29348
|
}, []);
|
|
29270
|
-
|
|
29349
|
+
useEffect25(() => {
|
|
29271
29350
|
if (!isOpen || !hasMore || loading) return;
|
|
29272
29351
|
const obs = new IntersectionObserver(
|
|
29273
29352
|
(entries) => {
|
|
@@ -29306,10 +29385,11 @@ function LazyMultiSelectDropdown({
|
|
|
29306
29385
|
{
|
|
29307
29386
|
onClick: handleFocus,
|
|
29308
29387
|
className: cn(
|
|
29309
|
-
"
|
|
29388
|
+
"w-full flex items-center flex-wrap gap-1 border border-[#BDBDBD] rounded-md bg-white cursor-pointer",
|
|
29310
29389
|
disabled && "bg-gray-100 cursor-not-allowed",
|
|
29311
29390
|
errorMessage && "border-red-500",
|
|
29312
|
-
className
|
|
29391
|
+
className,
|
|
29392
|
+
"px-2 py-2 min-h-[35px]"
|
|
29313
29393
|
),
|
|
29314
29394
|
children: [
|
|
29315
29395
|
selectedOptions.map((opt) => /* @__PURE__ */ jsxs27(
|
|
@@ -29339,7 +29419,7 @@ function LazyMultiSelectDropdown({
|
|
|
29339
29419
|
{
|
|
29340
29420
|
type: "text",
|
|
29341
29421
|
placeholder: selectedOptions.length ? "" : placeholder,
|
|
29342
|
-
className: "flex-1 min-w-[60px]
|
|
29422
|
+
className: "flex-1 min-w-[60px] px-2 py-0 outline-none text-xs disabled:cursor-not-allowed",
|
|
29343
29423
|
value: isOpen ? searchTerm : "",
|
|
29344
29424
|
onChange: handleSearch,
|
|
29345
29425
|
readOnly,
|
|
@@ -29361,7 +29441,7 @@ function LazyMultiSelectDropdown({
|
|
|
29361
29441
|
top: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().bottom + window.scrollY : 0,
|
|
29362
29442
|
left: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().left + window.scrollX : 0
|
|
29363
29443
|
},
|
|
29364
|
-
children:
|
|
29444
|
+
children: dataLoading && lazyOptions.length === 0 ? /* @__PURE__ */ jsx48("div", { className: "px-3 py-3 text-center text-gray-500", children: "Loading..." }) : lazyOptions.length > 0 ? /* @__PURE__ */ jsxs27(Fragment19, { children: [
|
|
29365
29445
|
lazyOptions.map((option) => {
|
|
29366
29446
|
const isSelected = normalizedValue.includes(option.value);
|
|
29367
29447
|
return /* @__PURE__ */ jsxs27(
|
|
@@ -29388,14 +29468,14 @@ function LazyMultiSelectDropdown({
|
|
|
29388
29468
|
children: loading ? "Loading\u2026" : "Scroll for more\u2026"
|
|
29389
29469
|
}
|
|
29390
29470
|
)
|
|
29391
|
-
] }) : /* @__PURE__ */ jsx48("div", { className: "px-3 py-
|
|
29471
|
+
] }) : /* @__PURE__ */ jsx48("div", { className: "px-3 py-3 text-center text-gray-500", children: "No results" })
|
|
29392
29472
|
}
|
|
29393
29473
|
) })
|
|
29394
29474
|
] });
|
|
29395
29475
|
}
|
|
29396
29476
|
|
|
29397
29477
|
// src/components/ui/data-table.tsx
|
|
29398
|
-
import * as
|
|
29478
|
+
import * as React10 from "react";
|
|
29399
29479
|
import { faEllipsisH } from "@fortawesome/free-solid-svg-icons";
|
|
29400
29480
|
import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
|
|
29401
29481
|
import {
|
|
@@ -29495,7 +29575,7 @@ function TableCell({ className, ...props }) {
|
|
|
29495
29575
|
import { createColumnHelper } from "@tanstack/react-table";
|
|
29496
29576
|
|
|
29497
29577
|
// src/lib/table/cellRendererFactory.tsx
|
|
29498
|
-
import
|
|
29578
|
+
import React9 from "react";
|
|
29499
29579
|
import Image2 from "next/image";
|
|
29500
29580
|
|
|
29501
29581
|
// src/lib/dayjs-setup.ts
|
|
@@ -29581,9 +29661,9 @@ var getContrastColor = (bg) => {
|
|
|
29581
29661
|
};
|
|
29582
29662
|
var sanitizeValue = (val) => {
|
|
29583
29663
|
if (val == null) return null;
|
|
29584
|
-
if (
|
|
29664
|
+
if (React9.isValidElement(val)) return val;
|
|
29585
29665
|
if (typeof val === "string" || typeof val === "number") return val;
|
|
29586
|
-
if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ jsx50(
|
|
29666
|
+
if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ jsx50(React9.Fragment, { children: sanitizeValue(v) }, i));
|
|
29587
29667
|
if (typeof val === "object") {
|
|
29588
29668
|
if ("name" in val && typeof val.name === "string") return val.name;
|
|
29589
29669
|
if ("label" in val && typeof val.label === "string") return val.label;
|
|
@@ -29836,10 +29916,10 @@ function DataTable({
|
|
|
29836
29916
|
enableRowSelection = false,
|
|
29837
29917
|
getRowSelection
|
|
29838
29918
|
}) {
|
|
29839
|
-
const [columnFilters, setColumnFilters] =
|
|
29840
|
-
const [columnVisibility, setColumnVisibility] =
|
|
29841
|
-
const [manualSort, setManualSort] =
|
|
29842
|
-
const [searchTerm, setSearchTerm] =
|
|
29919
|
+
const [columnFilters, setColumnFilters] = React10.useState([]);
|
|
29920
|
+
const [columnVisibility, setColumnVisibility] = React10.useState({});
|
|
29921
|
+
const [manualSort, setManualSort] = React10.useState(null);
|
|
29922
|
+
const [searchTerm, setSearchTerm] = React10.useState("");
|
|
29843
29923
|
const tableData = Array.isArray(data) ? data : [];
|
|
29844
29924
|
const finalCols = [...columns];
|
|
29845
29925
|
if (enableRowSelection) {
|
|
@@ -29865,8 +29945,8 @@ function DataTable({
|
|
|
29865
29945
|
});
|
|
29866
29946
|
}
|
|
29867
29947
|
const dynamicCols = useDynamicColumns({ columns: finalCols, enableRowSelection });
|
|
29868
|
-
const [rowSelection, setRowSelection] =
|
|
29869
|
-
const [localPageSize, setLocalPageSize] =
|
|
29948
|
+
const [rowSelection, setRowSelection] = React10.useState({});
|
|
29949
|
+
const [localPageSize, setLocalPageSize] = React10.useState(pageSize);
|
|
29870
29950
|
const table = useReactTable({
|
|
29871
29951
|
data: tableData,
|
|
29872
29952
|
columns: dynamicCols,
|
|
@@ -29931,7 +30011,7 @@ function DataTable({
|
|
|
29931
30011
|
onPageChange?.(currentPageIndex, newSize);
|
|
29932
30012
|
setLocalPageSize(newSize);
|
|
29933
30013
|
};
|
|
29934
|
-
const pageSizeOptions =
|
|
30014
|
+
const pageSizeOptions = React10.useMemo(() => {
|
|
29935
30015
|
const options = [10, 20, 50, 100].filter((size) => size < totalRecords);
|
|
29936
30016
|
if (options.length === 0) {
|
|
29937
30017
|
options.push(10);
|
|
@@ -30690,7 +30770,7 @@ var HistoryTimeline = ({
|
|
|
30690
30770
|
var HistoryTimeline_default = HistoryTimeline;
|
|
30691
30771
|
|
|
30692
30772
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30693
|
-
import { useCallback as useCallback3, useMemo as useMemo8, useState as
|
|
30773
|
+
import { useCallback as useCallback3, useMemo as useMemo8, useState as useState10 } from "react";
|
|
30694
30774
|
import Link5 from "next/link";
|
|
30695
30775
|
import { usePathname, useRouter } from "next/navigation";
|
|
30696
30776
|
|
|
@@ -30848,7 +30928,7 @@ function showSonnerToast({
|
|
|
30848
30928
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30849
30929
|
import { Fragment as Fragment22, jsx as jsx59, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
30850
30930
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading, bgActiveColor, textActiveColor }) => {
|
|
30851
|
-
const [openIndex, setOpenIndex] =
|
|
30931
|
+
const [openIndex, setOpenIndex] = useState10(null);
|
|
30852
30932
|
const currentPathname = usePathname();
|
|
30853
30933
|
function groupMenus(menus = []) {
|
|
30854
30934
|
const menuMap = /* @__PURE__ */ new Map();
|
|
@@ -30912,8 +30992,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30912
30992
|
return tab.children.some((child) => isActive(child.url));
|
|
30913
30993
|
};
|
|
30914
30994
|
const router = useRouter();
|
|
30915
|
-
const [showExitDialog, setShowExitDialog] =
|
|
30916
|
-
const [pendingUrl, setPendingUrl] =
|
|
30995
|
+
const [showExitDialog, setShowExitDialog] = useState10(false);
|
|
30996
|
+
const [pendingUrl, setPendingUrl] = useState10(null);
|
|
30917
30997
|
const handleBuilderExit = useCallback3(
|
|
30918
30998
|
(e, url) => {
|
|
30919
30999
|
if (isBuilder) {
|
|
@@ -31081,7 +31161,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
31081
31161
|
var Tabs_default = Tabs;
|
|
31082
31162
|
|
|
31083
31163
|
// src/components/Navigation/Stages/Stages.tsx
|
|
31084
|
-
import
|
|
31164
|
+
import React11, { useState as useState11 } from "react";
|
|
31085
31165
|
import { jsx as jsx60, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
31086
31166
|
var StagesComponent = ({
|
|
31087
31167
|
stages,
|
|
@@ -31098,8 +31178,8 @@ var StagesComponent = ({
|
|
|
31098
31178
|
triggerOnClick = false,
|
|
31099
31179
|
canvasMode = "desktop"
|
|
31100
31180
|
}) => {
|
|
31101
|
-
const [activeStage, setActiveStage] =
|
|
31102
|
-
const [isCompleted, setIsCompleted] =
|
|
31181
|
+
const [activeStage, setActiveStage] = useState11(currentStage || (stages && stages.length > 0 ? stages[0][dataKey] : null));
|
|
31182
|
+
const [isCompleted, setIsCompleted] = useState11(false);
|
|
31103
31183
|
const updateStage = (stageKey) => {
|
|
31104
31184
|
setActiveStage(stageKey);
|
|
31105
31185
|
onStageChange?.(stageKey);
|
|
@@ -31167,7 +31247,7 @@ var StagesComponent = ({
|
|
|
31167
31247
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
31168
31248
|
const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
|
|
31169
31249
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
31170
|
-
return /* @__PURE__ */ jsxs36(
|
|
31250
|
+
return /* @__PURE__ */ jsxs36(React11.Fragment, { children: [
|
|
31171
31251
|
/* @__PURE__ */ jsx60(
|
|
31172
31252
|
"button",
|
|
31173
31253
|
{
|
|
@@ -31235,10 +31315,10 @@ import { jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
|
31235
31315
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
31236
31316
|
|
|
31237
31317
|
// src/components/ui/avatar.tsx
|
|
31238
|
-
import * as
|
|
31318
|
+
import * as React12 from "react";
|
|
31239
31319
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
31240
31320
|
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
31241
|
-
var Avatar =
|
|
31321
|
+
var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
31242
31322
|
AvatarPrimitive.Root,
|
|
31243
31323
|
{
|
|
31244
31324
|
ref,
|
|
@@ -31250,7 +31330,7 @@ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
31250
31330
|
}
|
|
31251
31331
|
));
|
|
31252
31332
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
31253
|
-
var AvatarImage =
|
|
31333
|
+
var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
31254
31334
|
AvatarPrimitive.Image,
|
|
31255
31335
|
{
|
|
31256
31336
|
ref,
|
|
@@ -31259,7 +31339,7 @@ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
31259
31339
|
}
|
|
31260
31340
|
));
|
|
31261
31341
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
31262
|
-
var AvatarFallback =
|
|
31342
|
+
var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
31263
31343
|
AvatarPrimitive.Fallback,
|
|
31264
31344
|
{
|
|
31265
31345
|
ref,
|
|
@@ -31277,7 +31357,7 @@ import Link6 from "next/link";
|
|
|
31277
31357
|
import Image4 from "next/image";
|
|
31278
31358
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
31279
31359
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
31280
|
-
import { useCallback as useCallback4, useMemo as useMemo9, useState as
|
|
31360
|
+
import { useCallback as useCallback4, useMemo as useMemo9, useState as useState12 } from "react";
|
|
31281
31361
|
import { Fragment as Fragment23, jsx as jsx66, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
31282
31362
|
function Navbar({
|
|
31283
31363
|
style,
|
|
@@ -31298,8 +31378,8 @@ function Navbar({
|
|
|
31298
31378
|
}) {
|
|
31299
31379
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
31300
31380
|
const router = useRouter2();
|
|
31301
|
-
const [showExitDialog, setShowExitDialog] =
|
|
31302
|
-
const [pendingUrl, setPendingUrl] =
|
|
31381
|
+
const [showExitDialog, setShowExitDialog] = useState12(false);
|
|
31382
|
+
const [pendingUrl, setPendingUrl] = useState12(null);
|
|
31303
31383
|
const handleBuilderExit = useCallback4(
|
|
31304
31384
|
(e, url) => {
|
|
31305
31385
|
if (isBuilder) {
|
|
@@ -31419,7 +31499,7 @@ function Navbar({
|
|
|
31419
31499
|
}
|
|
31420
31500
|
|
|
31421
31501
|
// src/components/Chart/BarChart.tsx
|
|
31422
|
-
import
|
|
31502
|
+
import React13, { useEffect as useEffect26, useMemo as useMemo10, useState as useState13, useCallback as useCallback5 } from "react";
|
|
31423
31503
|
import axios2 from "axios";
|
|
31424
31504
|
import {
|
|
31425
31505
|
BarChart,
|
|
@@ -31491,13 +31571,13 @@ var ChartComponent = ({
|
|
|
31491
31571
|
canvasMode,
|
|
31492
31572
|
...props
|
|
31493
31573
|
}) => {
|
|
31494
|
-
const [rawData, setRawData] =
|
|
31495
|
-
const [rawMeta, setRawMeta] =
|
|
31496
|
-
const [localLoading, setLocalLoading] =
|
|
31497
|
-
const [currentPage, setCurrentPage] =
|
|
31574
|
+
const [rawData, setRawData] = useState13([]);
|
|
31575
|
+
const [rawMeta, setRawMeta] = useState13(null);
|
|
31576
|
+
const [localLoading, setLocalLoading] = useState13(false);
|
|
31577
|
+
const [currentPage, setCurrentPage] = useState13(1);
|
|
31498
31578
|
const effectiveData = apiUrl ? rawData : props.data || [];
|
|
31499
31579
|
const effectiveLoading = apiUrl ? localLoading : externalLoading;
|
|
31500
|
-
|
|
31580
|
+
useEffect26(() => {
|
|
31501
31581
|
if (apiUrl) {
|
|
31502
31582
|
setCurrentPage(1);
|
|
31503
31583
|
}
|
|
@@ -31539,7 +31619,7 @@ var ChartComponent = ({
|
|
|
31539
31619
|
if (!cancelled) setLocalLoading(false);
|
|
31540
31620
|
}
|
|
31541
31621
|
}, [apiUrl, limit]);
|
|
31542
|
-
|
|
31622
|
+
useEffect26(() => {
|
|
31543
31623
|
if (!apiUrl) return;
|
|
31544
31624
|
fetchData(currentPage);
|
|
31545
31625
|
}, [apiUrl, currentPage, fetchData]);
|
|
@@ -31735,10 +31815,10 @@ var ChartComponent = ({
|
|
|
31735
31815
|
] }) })
|
|
31736
31816
|
] });
|
|
31737
31817
|
};
|
|
31738
|
-
var BarChart_default =
|
|
31818
|
+
var BarChart_default = React13.memo(ChartComponent);
|
|
31739
31819
|
|
|
31740
31820
|
// src/components/Chart/PieChart.tsx
|
|
31741
|
-
import
|
|
31821
|
+
import React14, { useEffect as useEffect27, useMemo as useMemo11, useState as useState14 } from "react";
|
|
31742
31822
|
import axios3 from "axios";
|
|
31743
31823
|
import {
|
|
31744
31824
|
PieChart,
|
|
@@ -31824,11 +31904,11 @@ var DonutChart = ({
|
|
|
31824
31904
|
}) => {
|
|
31825
31905
|
const showLegends = props.showLegends ?? true;
|
|
31826
31906
|
const canvasMode = props.canvasMode;
|
|
31827
|
-
const [rawData, setRawData] =
|
|
31828
|
-
const [localLoading, setLocalLoading] =
|
|
31907
|
+
const [rawData, setRawData] = useState14([]);
|
|
31908
|
+
const [localLoading, setLocalLoading] = useState14(false);
|
|
31829
31909
|
const effectiveData = apiUrl ? rawData : props.data || [];
|
|
31830
31910
|
const effectiveLoading = apiUrl ? localLoading : externalLoading;
|
|
31831
|
-
|
|
31911
|
+
useEffect27(() => {
|
|
31832
31912
|
if (!apiUrl) return;
|
|
31833
31913
|
let cancelled = false;
|
|
31834
31914
|
const fetchData = async () => {
|
|
@@ -31909,8 +31989,8 @@ var DonutChart = ({
|
|
|
31909
31989
|
if (chartData.length <= 6) return { inner: 85, outer: 150 };
|
|
31910
31990
|
return { inner: 70, outer: 130 };
|
|
31911
31991
|
};
|
|
31912
|
-
const [mounted, setMounted] =
|
|
31913
|
-
|
|
31992
|
+
const [mounted, setMounted] = useState14(false);
|
|
31993
|
+
useEffect27(() => {
|
|
31914
31994
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
31915
31995
|
return () => clearTimeout(timeout);
|
|
31916
31996
|
}, []);
|
|
@@ -32042,7 +32122,7 @@ var DonutChart = ({
|
|
|
32042
32122
|
renderLegends
|
|
32043
32123
|
] });
|
|
32044
32124
|
};
|
|
32045
|
-
var PieChart_default =
|
|
32125
|
+
var PieChart_default = React14.memo(DonutChart);
|
|
32046
32126
|
|
|
32047
32127
|
// src/components/Blocks/EmailComposer.tsx
|
|
32048
32128
|
import { jsx as jsx69, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
@@ -32163,7 +32243,7 @@ export {
|
|
|
32163
32243
|
Flex_default as FlexLayout,
|
|
32164
32244
|
Grid_default as GridLayout,
|
|
32165
32245
|
HistoryTimeline_default as HistoryTimeline,
|
|
32166
|
-
|
|
32246
|
+
Icon2 as Icon,
|
|
32167
32247
|
Image_default as Image,
|
|
32168
32248
|
Modal,
|
|
32169
32249
|
MultiCheckbox,
|