@algorithm-shift/design-system 1.2.980 → 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 +290 -198
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +255 -163
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -382,7 +382,7 @@ var Typography = ({
|
|
|
382
382
|
React4.createElement("span", {
|
|
383
383
|
key: "html",
|
|
384
384
|
className: "pointer-events-none",
|
|
385
|
-
dangerouslySetInnerHTML: { __html: textContent }
|
|
385
|
+
dangerouslySetInnerHTML: { __html: textContent || "--" }
|
|
386
386
|
})
|
|
387
387
|
]
|
|
388
388
|
);
|
|
@@ -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
|
};
|
|
@@ -28059,10 +28137,11 @@ function LazySelectDropdown({
|
|
|
28059
28137
|
dataLabel = "name",
|
|
28060
28138
|
errorMessage,
|
|
28061
28139
|
axiosInstance,
|
|
28062
|
-
enableAddNewOption = false
|
|
28140
|
+
enableAddNewOption = false,
|
|
28141
|
+
enforceStrictQueryParams = false
|
|
28063
28142
|
}) {
|
|
28064
|
-
const [isOpen, setIsOpen] =
|
|
28065
|
-
const [searchTerm, setSearchTerm] =
|
|
28143
|
+
const [isOpen, setIsOpen] = useState6(false);
|
|
28144
|
+
const [searchTerm, setSearchTerm] = useState6("");
|
|
28066
28145
|
const dropdownRef = useRef4(null);
|
|
28067
28146
|
const observerTarget = useRef4(null);
|
|
28068
28147
|
const {
|
|
@@ -28083,10 +28162,11 @@ function LazySelectDropdown({
|
|
|
28083
28162
|
dataLabel,
|
|
28084
28163
|
initialData: options || [],
|
|
28085
28164
|
value,
|
|
28086
|
-
axiosInstance
|
|
28165
|
+
axiosInstance,
|
|
28166
|
+
enforceStrictQueryParams
|
|
28087
28167
|
});
|
|
28088
28168
|
const selectedOption = useMemo3(() => lazyOptions.find((opt) => opt.value === value), [lazyOptions, value]);
|
|
28089
|
-
|
|
28169
|
+
useEffect15(() => {
|
|
28090
28170
|
const handleClickOutside = (e) => {
|
|
28091
28171
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
28092
28172
|
setIsOpen(false);
|
|
@@ -28096,7 +28176,7 @@ function LazySelectDropdown({
|
|
|
28096
28176
|
document.addEventListener("mousedown", handleClickOutside);
|
|
28097
28177
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
28098
28178
|
}, []);
|
|
28099
|
-
|
|
28179
|
+
useEffect15(() => {
|
|
28100
28180
|
if (!isOpen || !hasMore || loading) return;
|
|
28101
28181
|
const observer = new IntersectionObserver(
|
|
28102
28182
|
(entries) => {
|
|
@@ -28236,7 +28316,7 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
28236
28316
|
const isEditable = props.isEditable ?? true;
|
|
28237
28317
|
const isDisabled = props.isDisabled ?? false;
|
|
28238
28318
|
const isReadonly = props.isReadonly ?? false;
|
|
28239
|
-
|
|
28319
|
+
useEffect16(() => {
|
|
28240
28320
|
if (props.value !== void 0) {
|
|
28241
28321
|
handleChange(props.value);
|
|
28242
28322
|
}
|
|
@@ -28295,7 +28375,7 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
28295
28375
|
var Dropdown_default = Dropdown;
|
|
28296
28376
|
|
|
28297
28377
|
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
28298
|
-
import { useEffect as
|
|
28378
|
+
import { useEffect as useEffect17 } from "react";
|
|
28299
28379
|
|
|
28300
28380
|
// src/components/ui/switch.tsx
|
|
28301
28381
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
@@ -28331,7 +28411,7 @@ import { Fragment as Fragment13, jsx as jsx39, jsxs as jsxs20 } from "react/jsx-
|
|
|
28331
28411
|
var SwitchToggle = ({ className, style, ...props }) => {
|
|
28332
28412
|
const isEditable = props.isEditable ?? true;
|
|
28333
28413
|
const isDisabled = props.isDisabled ?? false;
|
|
28334
|
-
|
|
28414
|
+
useEffect17(() => {
|
|
28335
28415
|
if (props.value !== void 0) {
|
|
28336
28416
|
handleChange?.(props.value);
|
|
28337
28417
|
}
|
|
@@ -28358,7 +28438,7 @@ var SwitchToggle = ({ className, style, ...props }) => {
|
|
|
28358
28438
|
var SwitchToggle_default = SwitchToggle;
|
|
28359
28439
|
|
|
28360
28440
|
// src/components/Inputs/PhoneInput/PhoneInput.tsx
|
|
28361
|
-
import { useEffect as
|
|
28441
|
+
import { useEffect as useEffect18 } from "react";
|
|
28362
28442
|
import { PhoneInput as PhoneInputField } from "react-international-phone";
|
|
28363
28443
|
import "react-international-phone/style.css";
|
|
28364
28444
|
import { Fragment as Fragment14, jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
@@ -28373,7 +28453,7 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
28373
28453
|
const placeholder = props.placeholder ?? "Enter phone number";
|
|
28374
28454
|
const isEditable = props.isEditable ?? true;
|
|
28375
28455
|
const isDisabled = props.isDisabled ?? false;
|
|
28376
|
-
|
|
28456
|
+
useEffect18(() => {
|
|
28377
28457
|
if (props.value !== void 0) {
|
|
28378
28458
|
const normalized = ensureIndiaCode(props.value);
|
|
28379
28459
|
handleChange?.(normalized);
|
|
@@ -28420,7 +28500,7 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
28420
28500
|
var PhoneInput_default = PhoneInput;
|
|
28421
28501
|
|
|
28422
28502
|
// src/components/Inputs/SearchInput/SearchInput.tsx
|
|
28423
|
-
import { useEffect as
|
|
28503
|
+
import { useEffect as useEffect19 } from "react";
|
|
28424
28504
|
import { Fragment as Fragment15, jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
28425
28505
|
var SearchInput = ({ className, style, ...props }) => {
|
|
28426
28506
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -28428,7 +28508,7 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
28428
28508
|
const isDisabled = props.isDisabled ?? false;
|
|
28429
28509
|
const isReadonly = props.isReadonly ?? false;
|
|
28430
28510
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
28431
|
-
|
|
28511
|
+
useEffect19(() => {
|
|
28432
28512
|
if (props.value !== void 0) {
|
|
28433
28513
|
const e = { target: { value: props.value } };
|
|
28434
28514
|
handleChange?.(e);
|
|
@@ -28470,11 +28550,11 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
28470
28550
|
var SearchInput_default = SearchInput;
|
|
28471
28551
|
|
|
28472
28552
|
// src/components/Inputs/FileInput/FileInput.tsx
|
|
28473
|
-
import { useEffect as
|
|
28553
|
+
import { useEffect as useEffect20 } from "react";
|
|
28474
28554
|
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
28475
28555
|
var FileInput2 = ({ className, style, ...props }) => {
|
|
28476
28556
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
28477
|
-
|
|
28557
|
+
useEffect20(() => {
|
|
28478
28558
|
if (props.value !== void 0) {
|
|
28479
28559
|
const e = { target: { value: props.value } };
|
|
28480
28560
|
handleChange?.(e);
|
|
@@ -28514,11 +28594,11 @@ var FileInput2 = ({ className, style, ...props }) => {
|
|
|
28514
28594
|
var FileInput_default = FileInput2;
|
|
28515
28595
|
|
|
28516
28596
|
// src/components/Inputs/DatePicker/DatePicker.tsx
|
|
28517
|
-
import * as
|
|
28597
|
+
import * as React7 from "react";
|
|
28518
28598
|
import { format } from "date-fns";
|
|
28519
28599
|
|
|
28520
28600
|
// src/components/ui/calendar.tsx
|
|
28521
|
-
import * as
|
|
28601
|
+
import * as React6 from "react";
|
|
28522
28602
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
28523
28603
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
28524
28604
|
function Calendar2({
|
|
@@ -28673,8 +28753,8 @@ function CalendarDayButton({
|
|
|
28673
28753
|
...props
|
|
28674
28754
|
}) {
|
|
28675
28755
|
const defaultClassNames = getDefaultClassNames();
|
|
28676
|
-
const ref =
|
|
28677
|
-
|
|
28756
|
+
const ref = React6.useRef(null);
|
|
28757
|
+
React6.useEffect(() => {
|
|
28678
28758
|
if (modifiers.focused) ref.current?.focus();
|
|
28679
28759
|
}, [modifiers.focused]);
|
|
28680
28760
|
return /* @__PURE__ */ jsx43(
|
|
@@ -28768,25 +28848,25 @@ function DateTimePicker({
|
|
|
28768
28848
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
28769
28849
|
const minDate = resolveDate(minimumDate, customMinimumDate);
|
|
28770
28850
|
const maxDate = resolveDate(maximumDate, customMaximumDate);
|
|
28771
|
-
const [date, setDate] =
|
|
28851
|
+
const [date, setDate] = React7.useState(() => {
|
|
28772
28852
|
if (!props.value) return void 0;
|
|
28773
28853
|
const d = new Date(props.value);
|
|
28774
28854
|
return isNaN(d.getTime()) ? void 0 : d;
|
|
28775
28855
|
});
|
|
28776
28856
|
const initialHours = date ? date.getHours() : 0;
|
|
28777
28857
|
const initialMinutes = date ? date.getMinutes() : 0;
|
|
28778
|
-
const [hours, setHours] =
|
|
28779
|
-
const [minutes, setMinutes] =
|
|
28780
|
-
const [amPm, setAmPm] =
|
|
28781
|
-
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(() => {
|
|
28782
28862
|
if (hours === 0) return 12;
|
|
28783
28863
|
if (hours > 12) return hours - 12;
|
|
28784
28864
|
return hours;
|
|
28785
28865
|
}, [hours]);
|
|
28786
|
-
|
|
28866
|
+
React7.useEffect(() => {
|
|
28787
28867
|
setAmPm(hours >= 12 ? "PM" : "AM");
|
|
28788
28868
|
}, [hours]);
|
|
28789
|
-
|
|
28869
|
+
React7.useEffect(() => {
|
|
28790
28870
|
if (!props.value) {
|
|
28791
28871
|
setDate(void 0);
|
|
28792
28872
|
return;
|
|
@@ -28798,8 +28878,8 @@ function DateTimePicker({
|
|
|
28798
28878
|
setMinutes(d.getMinutes());
|
|
28799
28879
|
}
|
|
28800
28880
|
}, [props.value]);
|
|
28801
|
-
const [year, setYear] =
|
|
28802
|
-
|
|
28881
|
+
const [year, setYear] = React7.useState(date ? date.getFullYear() : (/* @__PURE__ */ new Date()).getFullYear());
|
|
28882
|
+
React7.useEffect(() => {
|
|
28803
28883
|
if (!date) return;
|
|
28804
28884
|
const newDate = new Date(date);
|
|
28805
28885
|
newDate.setFullYear(year);
|
|
@@ -28902,7 +28982,7 @@ function DateTimePicker({
|
|
|
28902
28982
|
for (let y = currentYear - 50; y <= currentYear + 10; y++) {
|
|
28903
28983
|
yearOptions.push(y);
|
|
28904
28984
|
}
|
|
28905
|
-
const displayValue =
|
|
28985
|
+
const displayValue = React7.useMemo(() => {
|
|
28906
28986
|
if (!date) return "";
|
|
28907
28987
|
try {
|
|
28908
28988
|
if (mode === "date") return format(date, "dd-MM-yyyy");
|
|
@@ -28913,11 +28993,11 @@ function DateTimePicker({
|
|
|
28913
28993
|
}
|
|
28914
28994
|
}, [date, mode]);
|
|
28915
28995
|
const isInputDisabled = isDisabled || !isEditable;
|
|
28916
|
-
const [calendarMonthState, setCalendarMonthState] =
|
|
28996
|
+
const [calendarMonthState, setCalendarMonthState] = React7.useState(() => {
|
|
28917
28997
|
const currentMonth = (/* @__PURE__ */ new Date()).getMonth();
|
|
28918
28998
|
return date ? new Date(date.getFullYear(), date.getMonth()) : new Date(year, currentMonth);
|
|
28919
28999
|
});
|
|
28920
|
-
|
|
29000
|
+
React7.useEffect(() => {
|
|
28921
29001
|
setCalendarMonthState(new Date(year, calendarMonthState.getMonth()));
|
|
28922
29002
|
}, [year]);
|
|
28923
29003
|
const handleToday = () => {
|
|
@@ -29063,18 +29143,18 @@ function DateTimePicker({
|
|
|
29063
29143
|
}
|
|
29064
29144
|
|
|
29065
29145
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
29066
|
-
import
|
|
29146
|
+
import React8, { useEffect as useEffect23 } from "react";
|
|
29067
29147
|
import { addDays, format as format2 } from "date-fns";
|
|
29068
29148
|
import { Fragment as Fragment17, jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
29069
29149
|
var DateRange = ({ className, style, ...props }) => {
|
|
29070
29150
|
const isDateRange = (val) => !!val && val.from instanceof Date;
|
|
29071
|
-
const [date, setDate] =
|
|
29151
|
+
const [date, setDate] = React8.useState(
|
|
29072
29152
|
isDateRange(props.value) ? props.value : {
|
|
29073
29153
|
from: /* @__PURE__ */ new Date(),
|
|
29074
29154
|
to: addDays(/* @__PURE__ */ new Date(), 7)
|
|
29075
29155
|
}
|
|
29076
29156
|
);
|
|
29077
|
-
|
|
29157
|
+
useEffect23(() => {
|
|
29078
29158
|
if (props.value && isDateRange(props.value)) {
|
|
29079
29159
|
handleChange?.(props.value);
|
|
29080
29160
|
}
|
|
@@ -29121,7 +29201,7 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
29121
29201
|
var DateRange_default = DateRange;
|
|
29122
29202
|
|
|
29123
29203
|
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
29124
|
-
import { useEffect as
|
|
29204
|
+
import { useEffect as useEffect24 } from "react";
|
|
29125
29205
|
import { Fragment as Fragment18, jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
29126
29206
|
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
29127
29207
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -29129,7 +29209,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
29129
29209
|
const isDisabled = props.isDisabled ?? false;
|
|
29130
29210
|
const isReadonly = props.isReadonly ?? false;
|
|
29131
29211
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
29132
|
-
|
|
29212
|
+
useEffect24(() => {
|
|
29133
29213
|
if (props.value !== void 0) {
|
|
29134
29214
|
const e = { target: { value: props.value } };
|
|
29135
29215
|
handleChange?.(e);
|
|
@@ -29182,10 +29262,9 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
29182
29262
|
var TextInputGroup_default = TextInputGroup;
|
|
29183
29263
|
|
|
29184
29264
|
// src/components/Inputs/Multiselect/MultiSelect.tsx
|
|
29185
|
-
import { useState as
|
|
29265
|
+
import { useState as useState8, useRef as useRef6, useEffect as useEffect25, useMemo as useMemo5 } from "react";
|
|
29186
29266
|
import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
29187
29267
|
function LazyMultiSelectDropdown({
|
|
29188
|
-
options = [],
|
|
29189
29268
|
value = [],
|
|
29190
29269
|
onChange,
|
|
29191
29270
|
placeholder,
|
|
@@ -29200,10 +29279,11 @@ function LazyMultiSelectDropdown({
|
|
|
29200
29279
|
dataLabel = "name",
|
|
29201
29280
|
errorMessage,
|
|
29202
29281
|
axiosInstance,
|
|
29203
|
-
outputFormat = "array"
|
|
29282
|
+
outputFormat = "array",
|
|
29283
|
+
...props
|
|
29204
29284
|
}) {
|
|
29205
|
-
const [isOpen, setIsOpen] =
|
|
29206
|
-
const [searchTerm, setSearchTerm] =
|
|
29285
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
29286
|
+
const [searchTerm, setSearchTerm] = useState8("");
|
|
29207
29287
|
const dropdownRef = useRef6(null);
|
|
29208
29288
|
const observerTarget = useRef6(null);
|
|
29209
29289
|
const ensureUnique = (arr) => {
|
|
@@ -29222,26 +29302,27 @@ function LazyMultiSelectDropdown({
|
|
|
29222
29302
|
return ensureUnique(arr);
|
|
29223
29303
|
};
|
|
29224
29304
|
const normalizedValue = normalizeInput(value);
|
|
29305
|
+
const list = Array.isArray(props?.data) ? props.data : [];
|
|
29225
29306
|
const {
|
|
29226
29307
|
options: lazyOptions,
|
|
29227
29308
|
loading,
|
|
29228
29309
|
hasMore,
|
|
29229
29310
|
loadMore,
|
|
29230
29311
|
search,
|
|
29231
|
-
reset,
|
|
29232
29312
|
loadPage
|
|
29233
29313
|
} = useLazyDropdown({
|
|
29234
29314
|
enabled: true,
|
|
29235
29315
|
dataSource: source || "",
|
|
29236
29316
|
apiUrl,
|
|
29237
|
-
pageSize: pageSize
|
|
29317
|
+
pageSize: pageSize ?? 10,
|
|
29238
29318
|
dataKey,
|
|
29239
29319
|
dataLabel,
|
|
29240
|
-
initialData:
|
|
29320
|
+
initialData: list || [],
|
|
29241
29321
|
value: normalizedValue,
|
|
29242
29322
|
axiosInstance,
|
|
29243
29323
|
isMultiSelect: true
|
|
29244
29324
|
});
|
|
29325
|
+
const dataLoading = props.loading || loading;
|
|
29245
29326
|
const convertOutput = (values) => {
|
|
29246
29327
|
const unique = ensureUnique(values);
|
|
29247
29328
|
switch (outputFormat) {
|
|
@@ -29256,7 +29337,7 @@ function LazyMultiSelectDropdown({
|
|
|
29256
29337
|
const selectedOptions = useMemo5(() => {
|
|
29257
29338
|
return lazyOptions.filter((opt) => normalizedValue.includes(opt.value));
|
|
29258
29339
|
}, [lazyOptions, normalizedValue]);
|
|
29259
|
-
|
|
29340
|
+
useEffect25(() => {
|
|
29260
29341
|
const handleClick = (e) => {
|
|
29261
29342
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
29262
29343
|
setIsOpen(false);
|
|
@@ -29265,7 +29346,7 @@ function LazyMultiSelectDropdown({
|
|
|
29265
29346
|
document.addEventListener("mousedown", handleClick);
|
|
29266
29347
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
29267
29348
|
}, []);
|
|
29268
|
-
|
|
29349
|
+
useEffect25(() => {
|
|
29269
29350
|
if (!isOpen || !hasMore || loading) return;
|
|
29270
29351
|
const obs = new IntersectionObserver(
|
|
29271
29352
|
(entries) => {
|
|
@@ -29304,10 +29385,11 @@ function LazyMultiSelectDropdown({
|
|
|
29304
29385
|
{
|
|
29305
29386
|
onClick: handleFocus,
|
|
29306
29387
|
className: cn(
|
|
29307
|
-
"
|
|
29388
|
+
"w-full flex items-center flex-wrap gap-1 border border-[#BDBDBD] rounded-md bg-white cursor-pointer",
|
|
29308
29389
|
disabled && "bg-gray-100 cursor-not-allowed",
|
|
29309
29390
|
errorMessage && "border-red-500",
|
|
29310
|
-
className
|
|
29391
|
+
className,
|
|
29392
|
+
"px-2 py-2 min-h-[35px]"
|
|
29311
29393
|
),
|
|
29312
29394
|
children: [
|
|
29313
29395
|
selectedOptions.map((opt) => /* @__PURE__ */ jsxs27(
|
|
@@ -29337,7 +29419,7 @@ function LazyMultiSelectDropdown({
|
|
|
29337
29419
|
{
|
|
29338
29420
|
type: "text",
|
|
29339
29421
|
placeholder: selectedOptions.length ? "" : placeholder,
|
|
29340
|
-
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",
|
|
29341
29423
|
value: isOpen ? searchTerm : "",
|
|
29342
29424
|
onChange: handleSearch,
|
|
29343
29425
|
readOnly,
|
|
@@ -29359,7 +29441,7 @@ function LazyMultiSelectDropdown({
|
|
|
29359
29441
|
top: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().bottom + window.scrollY : 0,
|
|
29360
29442
|
left: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().left + window.scrollX : 0
|
|
29361
29443
|
},
|
|
29362
|
-
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: [
|
|
29363
29445
|
lazyOptions.map((option) => {
|
|
29364
29446
|
const isSelected = normalizedValue.includes(option.value);
|
|
29365
29447
|
return /* @__PURE__ */ jsxs27(
|
|
@@ -29386,14 +29468,14 @@ function LazyMultiSelectDropdown({
|
|
|
29386
29468
|
children: loading ? "Loading\u2026" : "Scroll for more\u2026"
|
|
29387
29469
|
}
|
|
29388
29470
|
)
|
|
29389
|
-
] }) : /* @__PURE__ */ jsx48("div", { className: "px-3 py-
|
|
29471
|
+
] }) : /* @__PURE__ */ jsx48("div", { className: "px-3 py-3 text-center text-gray-500", children: "No results" })
|
|
29390
29472
|
}
|
|
29391
29473
|
) })
|
|
29392
29474
|
] });
|
|
29393
29475
|
}
|
|
29394
29476
|
|
|
29395
29477
|
// src/components/ui/data-table.tsx
|
|
29396
|
-
import * as
|
|
29478
|
+
import * as React10 from "react";
|
|
29397
29479
|
import { faEllipsisH } from "@fortawesome/free-solid-svg-icons";
|
|
29398
29480
|
import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
|
|
29399
29481
|
import {
|
|
@@ -29493,7 +29575,7 @@ function TableCell({ className, ...props }) {
|
|
|
29493
29575
|
import { createColumnHelper } from "@tanstack/react-table";
|
|
29494
29576
|
|
|
29495
29577
|
// src/lib/table/cellRendererFactory.tsx
|
|
29496
|
-
import
|
|
29578
|
+
import React9 from "react";
|
|
29497
29579
|
import Image2 from "next/image";
|
|
29498
29580
|
|
|
29499
29581
|
// src/lib/dayjs-setup.ts
|
|
@@ -29579,9 +29661,9 @@ var getContrastColor = (bg) => {
|
|
|
29579
29661
|
};
|
|
29580
29662
|
var sanitizeValue = (val) => {
|
|
29581
29663
|
if (val == null) return null;
|
|
29582
|
-
if (
|
|
29664
|
+
if (React9.isValidElement(val)) return val;
|
|
29583
29665
|
if (typeof val === "string" || typeof val === "number") return val;
|
|
29584
|
-
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));
|
|
29585
29667
|
if (typeof val === "object") {
|
|
29586
29668
|
if ("name" in val && typeof val.name === "string") return val.name;
|
|
29587
29669
|
if ("label" in val && typeof val.label === "string") return val.label;
|
|
@@ -29726,6 +29808,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
|
|
|
29726
29808
|
onChange: info.row.getToggleSelectedHandler()
|
|
29727
29809
|
}
|
|
29728
29810
|
);
|
|
29811
|
+
case "html":
|
|
29812
|
+
return /* @__PURE__ */ jsx50(
|
|
29813
|
+
"span",
|
|
29814
|
+
{
|
|
29815
|
+
dangerouslySetInnerHTML: { __html: String(rowValue || formattedValue) }
|
|
29816
|
+
}
|
|
29817
|
+
);
|
|
29729
29818
|
/* -------------------- ADVANCED -------------------- */
|
|
29730
29819
|
case "custom": {
|
|
29731
29820
|
const CustomRenderer = customRenderers[rendererProps?.customRendererId] || customRenderers[rendererProps?.rendererId];
|
|
@@ -29827,10 +29916,10 @@ function DataTable({
|
|
|
29827
29916
|
enableRowSelection = false,
|
|
29828
29917
|
getRowSelection
|
|
29829
29918
|
}) {
|
|
29830
|
-
const [columnFilters, setColumnFilters] =
|
|
29831
|
-
const [columnVisibility, setColumnVisibility] =
|
|
29832
|
-
const [manualSort, setManualSort] =
|
|
29833
|
-
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("");
|
|
29834
29923
|
const tableData = Array.isArray(data) ? data : [];
|
|
29835
29924
|
const finalCols = [...columns];
|
|
29836
29925
|
if (enableRowSelection) {
|
|
@@ -29856,8 +29945,8 @@ function DataTable({
|
|
|
29856
29945
|
});
|
|
29857
29946
|
}
|
|
29858
29947
|
const dynamicCols = useDynamicColumns({ columns: finalCols, enableRowSelection });
|
|
29859
|
-
const [rowSelection, setRowSelection] =
|
|
29860
|
-
const [localPageSize, setLocalPageSize] =
|
|
29948
|
+
const [rowSelection, setRowSelection] = React10.useState({});
|
|
29949
|
+
const [localPageSize, setLocalPageSize] = React10.useState(pageSize);
|
|
29861
29950
|
const table = useReactTable({
|
|
29862
29951
|
data: tableData,
|
|
29863
29952
|
columns: dynamicCols,
|
|
@@ -29922,7 +30011,7 @@ function DataTable({
|
|
|
29922
30011
|
onPageChange?.(currentPageIndex, newSize);
|
|
29923
30012
|
setLocalPageSize(newSize);
|
|
29924
30013
|
};
|
|
29925
|
-
const pageSizeOptions =
|
|
30014
|
+
const pageSizeOptions = React10.useMemo(() => {
|
|
29926
30015
|
const options = [10, 20, 50, 100].filter((size) => size < totalRecords);
|
|
29927
30016
|
if (options.length === 0) {
|
|
29928
30017
|
options.push(10);
|
|
@@ -29998,17 +30087,20 @@ function DataTable({
|
|
|
29998
30087
|
),
|
|
29999
30088
|
"Toggle All"
|
|
30000
30089
|
] }),
|
|
30001
|
-
table.getAllLeafColumns().map((column) =>
|
|
30002
|
-
|
|
30003
|
-
|
|
30004
|
-
|
|
30005
|
-
|
|
30006
|
-
|
|
30007
|
-
|
|
30008
|
-
|
|
30009
|
-
|
|
30010
|
-
|
|
30011
|
-
|
|
30090
|
+
table.getAllLeafColumns().map((column) => {
|
|
30091
|
+
const header = column.columnDef.header;
|
|
30092
|
+
return /* @__PURE__ */ jsxs29("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
30093
|
+
/* @__PURE__ */ jsx51(
|
|
30094
|
+
"input",
|
|
30095
|
+
{
|
|
30096
|
+
type: "checkbox",
|
|
30097
|
+
checked: column.getIsVisible(),
|
|
30098
|
+
onChange: (e) => column.toggleVisibility(e.target.checked)
|
|
30099
|
+
}
|
|
30100
|
+
),
|
|
30101
|
+
typeof header === "function" ? header({ column, header, table }) : typeof header === "string" ? header : column.id
|
|
30102
|
+
] }, column.id);
|
|
30103
|
+
})
|
|
30012
30104
|
] })
|
|
30013
30105
|
] })
|
|
30014
30106
|
] }),
|
|
@@ -30678,7 +30770,7 @@ var HistoryTimeline = ({
|
|
|
30678
30770
|
var HistoryTimeline_default = HistoryTimeline;
|
|
30679
30771
|
|
|
30680
30772
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30681
|
-
import { useCallback as useCallback3, useMemo as useMemo8, useState as
|
|
30773
|
+
import { useCallback as useCallback3, useMemo as useMemo8, useState as useState10 } from "react";
|
|
30682
30774
|
import Link5 from "next/link";
|
|
30683
30775
|
import { usePathname, useRouter } from "next/navigation";
|
|
30684
30776
|
|
|
@@ -30836,7 +30928,7 @@ function showSonnerToast({
|
|
|
30836
30928
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
30837
30929
|
import { Fragment as Fragment22, jsx as jsx59, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
30838
30930
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading, bgActiveColor, textActiveColor }) => {
|
|
30839
|
-
const [openIndex, setOpenIndex] =
|
|
30931
|
+
const [openIndex, setOpenIndex] = useState10(null);
|
|
30840
30932
|
const currentPathname = usePathname();
|
|
30841
30933
|
function groupMenus(menus = []) {
|
|
30842
30934
|
const menuMap = /* @__PURE__ */ new Map();
|
|
@@ -30900,8 +30992,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30900
30992
|
return tab.children.some((child) => isActive(child.url));
|
|
30901
30993
|
};
|
|
30902
30994
|
const router = useRouter();
|
|
30903
|
-
const [showExitDialog, setShowExitDialog] =
|
|
30904
|
-
const [pendingUrl, setPendingUrl] =
|
|
30995
|
+
const [showExitDialog, setShowExitDialog] = useState10(false);
|
|
30996
|
+
const [pendingUrl, setPendingUrl] = useState10(null);
|
|
30905
30997
|
const handleBuilderExit = useCallback3(
|
|
30906
30998
|
(e, url) => {
|
|
30907
30999
|
if (isBuilder) {
|
|
@@ -31069,7 +31161,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
31069
31161
|
var Tabs_default = Tabs;
|
|
31070
31162
|
|
|
31071
31163
|
// src/components/Navigation/Stages/Stages.tsx
|
|
31072
|
-
import
|
|
31164
|
+
import React11, { useState as useState11 } from "react";
|
|
31073
31165
|
import { jsx as jsx60, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
31074
31166
|
var StagesComponent = ({
|
|
31075
31167
|
stages,
|
|
@@ -31086,8 +31178,8 @@ var StagesComponent = ({
|
|
|
31086
31178
|
triggerOnClick = false,
|
|
31087
31179
|
canvasMode = "desktop"
|
|
31088
31180
|
}) => {
|
|
31089
|
-
const [activeStage, setActiveStage] =
|
|
31090
|
-
const [isCompleted, setIsCompleted] =
|
|
31181
|
+
const [activeStage, setActiveStage] = useState11(currentStage || (stages && stages.length > 0 ? stages[0][dataKey] : null));
|
|
31182
|
+
const [isCompleted, setIsCompleted] = useState11(false);
|
|
31091
31183
|
const updateStage = (stageKey) => {
|
|
31092
31184
|
setActiveStage(stageKey);
|
|
31093
31185
|
onStageChange?.(stageKey);
|
|
@@ -31155,7 +31247,7 @@ var StagesComponent = ({
|
|
|
31155
31247
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
31156
31248
|
const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
|
|
31157
31249
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
31158
|
-
return /* @__PURE__ */ jsxs36(
|
|
31250
|
+
return /* @__PURE__ */ jsxs36(React11.Fragment, { children: [
|
|
31159
31251
|
/* @__PURE__ */ jsx60(
|
|
31160
31252
|
"button",
|
|
31161
31253
|
{
|
|
@@ -31223,10 +31315,10 @@ import { jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
|
31223
31315
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
31224
31316
|
|
|
31225
31317
|
// src/components/ui/avatar.tsx
|
|
31226
|
-
import * as
|
|
31318
|
+
import * as React12 from "react";
|
|
31227
31319
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
31228
31320
|
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
31229
|
-
var Avatar =
|
|
31321
|
+
var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
31230
31322
|
AvatarPrimitive.Root,
|
|
31231
31323
|
{
|
|
31232
31324
|
ref,
|
|
@@ -31238,7 +31330,7 @@ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
31238
31330
|
}
|
|
31239
31331
|
));
|
|
31240
31332
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
31241
|
-
var AvatarImage =
|
|
31333
|
+
var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
31242
31334
|
AvatarPrimitive.Image,
|
|
31243
31335
|
{
|
|
31244
31336
|
ref,
|
|
@@ -31247,7 +31339,7 @@ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
31247
31339
|
}
|
|
31248
31340
|
));
|
|
31249
31341
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
31250
|
-
var AvatarFallback =
|
|
31342
|
+
var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx65(
|
|
31251
31343
|
AvatarPrimitive.Fallback,
|
|
31252
31344
|
{
|
|
31253
31345
|
ref,
|
|
@@ -31265,7 +31357,7 @@ import Link6 from "next/link";
|
|
|
31265
31357
|
import Image4 from "next/image";
|
|
31266
31358
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
31267
31359
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
31268
|
-
import { useCallback as useCallback4, useMemo as useMemo9, useState as
|
|
31360
|
+
import { useCallback as useCallback4, useMemo as useMemo9, useState as useState12 } from "react";
|
|
31269
31361
|
import { Fragment as Fragment23, jsx as jsx66, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
31270
31362
|
function Navbar({
|
|
31271
31363
|
style,
|
|
@@ -31286,8 +31378,8 @@ function Navbar({
|
|
|
31286
31378
|
}) {
|
|
31287
31379
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
31288
31380
|
const router = useRouter2();
|
|
31289
|
-
const [showExitDialog, setShowExitDialog] =
|
|
31290
|
-
const [pendingUrl, setPendingUrl] =
|
|
31381
|
+
const [showExitDialog, setShowExitDialog] = useState12(false);
|
|
31382
|
+
const [pendingUrl, setPendingUrl] = useState12(null);
|
|
31291
31383
|
const handleBuilderExit = useCallback4(
|
|
31292
31384
|
(e, url) => {
|
|
31293
31385
|
if (isBuilder) {
|
|
@@ -31407,7 +31499,7 @@ function Navbar({
|
|
|
31407
31499
|
}
|
|
31408
31500
|
|
|
31409
31501
|
// src/components/Chart/BarChart.tsx
|
|
31410
|
-
import
|
|
31502
|
+
import React13, { useEffect as useEffect26, useMemo as useMemo10, useState as useState13, useCallback as useCallback5 } from "react";
|
|
31411
31503
|
import axios2 from "axios";
|
|
31412
31504
|
import {
|
|
31413
31505
|
BarChart,
|
|
@@ -31479,13 +31571,13 @@ var ChartComponent = ({
|
|
|
31479
31571
|
canvasMode,
|
|
31480
31572
|
...props
|
|
31481
31573
|
}) => {
|
|
31482
|
-
const [rawData, setRawData] =
|
|
31483
|
-
const [rawMeta, setRawMeta] =
|
|
31484
|
-
const [localLoading, setLocalLoading] =
|
|
31485
|
-
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);
|
|
31486
31578
|
const effectiveData = apiUrl ? rawData : props.data || [];
|
|
31487
31579
|
const effectiveLoading = apiUrl ? localLoading : externalLoading;
|
|
31488
|
-
|
|
31580
|
+
useEffect26(() => {
|
|
31489
31581
|
if (apiUrl) {
|
|
31490
31582
|
setCurrentPage(1);
|
|
31491
31583
|
}
|
|
@@ -31527,7 +31619,7 @@ var ChartComponent = ({
|
|
|
31527
31619
|
if (!cancelled) setLocalLoading(false);
|
|
31528
31620
|
}
|
|
31529
31621
|
}, [apiUrl, limit]);
|
|
31530
|
-
|
|
31622
|
+
useEffect26(() => {
|
|
31531
31623
|
if (!apiUrl) return;
|
|
31532
31624
|
fetchData(currentPage);
|
|
31533
31625
|
}, [apiUrl, currentPage, fetchData]);
|
|
@@ -31723,10 +31815,10 @@ var ChartComponent = ({
|
|
|
31723
31815
|
] }) })
|
|
31724
31816
|
] });
|
|
31725
31817
|
};
|
|
31726
|
-
var BarChart_default =
|
|
31818
|
+
var BarChart_default = React13.memo(ChartComponent);
|
|
31727
31819
|
|
|
31728
31820
|
// src/components/Chart/PieChart.tsx
|
|
31729
|
-
import
|
|
31821
|
+
import React14, { useEffect as useEffect27, useMemo as useMemo11, useState as useState14 } from "react";
|
|
31730
31822
|
import axios3 from "axios";
|
|
31731
31823
|
import {
|
|
31732
31824
|
PieChart,
|
|
@@ -31812,11 +31904,11 @@ var DonutChart = ({
|
|
|
31812
31904
|
}) => {
|
|
31813
31905
|
const showLegends = props.showLegends ?? true;
|
|
31814
31906
|
const canvasMode = props.canvasMode;
|
|
31815
|
-
const [rawData, setRawData] =
|
|
31816
|
-
const [localLoading, setLocalLoading] =
|
|
31907
|
+
const [rawData, setRawData] = useState14([]);
|
|
31908
|
+
const [localLoading, setLocalLoading] = useState14(false);
|
|
31817
31909
|
const effectiveData = apiUrl ? rawData : props.data || [];
|
|
31818
31910
|
const effectiveLoading = apiUrl ? localLoading : externalLoading;
|
|
31819
|
-
|
|
31911
|
+
useEffect27(() => {
|
|
31820
31912
|
if (!apiUrl) return;
|
|
31821
31913
|
let cancelled = false;
|
|
31822
31914
|
const fetchData = async () => {
|
|
@@ -31897,8 +31989,8 @@ var DonutChart = ({
|
|
|
31897
31989
|
if (chartData.length <= 6) return { inner: 85, outer: 150 };
|
|
31898
31990
|
return { inner: 70, outer: 130 };
|
|
31899
31991
|
};
|
|
31900
|
-
const [mounted, setMounted] =
|
|
31901
|
-
|
|
31992
|
+
const [mounted, setMounted] = useState14(false);
|
|
31993
|
+
useEffect27(() => {
|
|
31902
31994
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
31903
31995
|
return () => clearTimeout(timeout);
|
|
31904
31996
|
}, []);
|
|
@@ -32030,7 +32122,7 @@ var DonutChart = ({
|
|
|
32030
32122
|
renderLegends
|
|
32031
32123
|
] });
|
|
32032
32124
|
};
|
|
32033
|
-
var PieChart_default =
|
|
32125
|
+
var PieChart_default = React14.memo(DonutChart);
|
|
32034
32126
|
|
|
32035
32127
|
// src/components/Blocks/EmailComposer.tsx
|
|
32036
32128
|
import { jsx as jsx69, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
@@ -32151,7 +32243,7 @@ export {
|
|
|
32151
32243
|
Flex_default as FlexLayout,
|
|
32152
32244
|
Grid_default as GridLayout,
|
|
32153
32245
|
HistoryTimeline_default as HistoryTimeline,
|
|
32154
|
-
|
|
32246
|
+
Icon2 as Icon,
|
|
32155
32247
|
Image_default as Image,
|
|
32156
32248
|
Modal,
|
|
32157
32249
|
MultiCheckbox,
|