unifyedx-storybook-new 0.2.75 → 0.2.76
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as n, jsx as e, Fragment as
|
|
2
|
-
import re, { useState as B, useMemo as ae, useId as He, Fragment as Q, useEffect as
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import re, { useState as B, useMemo as ae, useId as He, Fragment as Q, useEffect as Z, useCallback as ee, useRef as fe } from "react";
|
|
3
3
|
import { a as H, U as ct, X as ve, P as c, L as ja, C as xe, b as et, D as dt, f as St, d as Wt, F as _a, e as Ua, h as Ga, T as Le, u as qa, I as Jt, i as Xt, j as Ya, k as Wa, l as Ja, m as Ht, S as vt, n as Qt, M as Xa, o as Ha, p as Nt, q as Qa, A as Za, E as Zt, r as Ka, s as er, t as tr, v as ar, w as Kt, x as rr, y as ea, z as ta, B as nr, G as sr, H as lr, J as Qe, K as mt, N as ut, O as ir, Q as or, R as aa, V as cr, W as wt, Y as dr, Z as mr, _ as Be, $ as ur, a0 as hr, a1 as pr, a2 as gr, a3 as br, a4 as fr, a5 as Dt, a6 as yr, a7 as xr, a8 as vr, a9 as Nr, aa as wr, ab as kr, ac as Cr, ad as zr, ae as Sr, af as Ae, ag as ra, ah as Dr, ai as $r, aj as Tr, ak as Ar, al as Fr, am as na, an as Er, ao as Rr, ap as sa, aq as Ir, ar as ht, as as la, at as Or } from "./vendor-yf0QH1Io.js";
|
|
4
|
-
import { Popover as Pr, PopoverButton as Mr, PopoverPanel as Lr, Transition as he, Dialog as ye, TransitionChild as ke, DialogPanel as Fe, DialogTitle as tt, TabGroup as Br, TabList as Vr, Tab as se, TabPanels as jr, RadioGroup as Ue, Listbox as
|
|
4
|
+
import { Popover as Pr, PopoverButton as Mr, PopoverPanel as Lr, Transition as he, Dialog as ye, TransitionChild as ke, DialogPanel as Fe, DialogTitle as tt, TabGroup as Br, TabList as Vr, Tab as se, TabPanels as jr, RadioGroup as Ue, Listbox as K, ListboxButton as _r, ListboxOptions as Ur, ListboxOption as Gr, SwitchGroup as qr, Switch as lt, Menu as Yr, MenuButton as Wr, Portal as Jr, MenuItems as Xr, MenuItem as Hr, DialogBackdrop as Qr } from "@headlessui/react";
|
|
5
5
|
import { motion as ie, AnimatePresence as Se } from "framer-motion";
|
|
6
6
|
import { d as Zr } from "./vendor-lodash-Dkzj2D3U.js";
|
|
7
7
|
import { useFloating as ia, offset as oa, flip as ca, shift as da, autoUpdate as ma, useClick as Kr, useDismiss as en, useInteractions as tn, FloatingPortal as an } from "@floating-ui/react";
|
|
@@ -33,10 +33,10 @@ const wn = (t) => {
|
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
m
|
|
36
|
-
),
|
|
36
|
+
), p = y ? "transparent" : i || N.bg, z = l || N.text;
|
|
37
37
|
return /* @__PURE__ */ n("div", { className: d, style: {
|
|
38
|
-
backgroundColor:
|
|
39
|
-
color:
|
|
38
|
+
backgroundColor: p,
|
|
39
|
+
color: z
|
|
40
40
|
}, ...o, children: [
|
|
41
41
|
y && /* @__PURE__ */ e(
|
|
42
42
|
"img",
|
|
@@ -155,12 +155,12 @@ const Dn = {
|
|
|
155
155
|
// ✅ Add children to the props list
|
|
156
156
|
iconWidth: v,
|
|
157
157
|
iconHeight: d,
|
|
158
|
-
iconColor:
|
|
159
|
-
strokeWidth:
|
|
158
|
+
iconColor: p,
|
|
159
|
+
strokeWidth: z,
|
|
160
160
|
onClick: F,
|
|
161
161
|
...E
|
|
162
162
|
}) => {
|
|
163
|
-
const
|
|
163
|
+
const I = h || m, P = u && !y, j = H(
|
|
164
164
|
"btn-base",
|
|
165
165
|
Dn[N],
|
|
166
166
|
$n[o],
|
|
@@ -176,13 +176,13 @@ const Dn = {
|
|
|
176
176
|
"data-testid": t,
|
|
177
177
|
type: s,
|
|
178
178
|
className: j,
|
|
179
|
-
disabled:
|
|
179
|
+
disabled: I,
|
|
180
180
|
onClick: F,
|
|
181
181
|
title: a || P && i || (typeof y == "string" ? y : void 0),
|
|
182
182
|
"aria-label": i || P && a || (typeof y == "string" ? y : void 0),
|
|
183
183
|
...E,
|
|
184
|
-
children: m ? /* @__PURE__ */ e(ja, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(
|
|
185
|
-
u && /* @__PURE__ */ e(u, { size: N === "large" ? 20 : 16, width: v || 16, height: d || 16, color:
|
|
184
|
+
children: m ? /* @__PURE__ */ e(ja, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(te, { children: [
|
|
185
|
+
u && /* @__PURE__ */ e(u, { size: N === "large" ? 20 : 16, width: v || 16, height: d || 16, color: p || "#767676", strokeWidth: z || 2 }),
|
|
186
186
|
y,
|
|
187
187
|
r,
|
|
188
188
|
" "
|
|
@@ -293,7 +293,7 @@ const Dn = {
|
|
|
293
293
|
}) => {
|
|
294
294
|
const N = t?.from, y = t?.to, r = (d) => {
|
|
295
295
|
d.stopPropagation(), d.preventDefault(), s?.();
|
|
296
|
-
}, v = N && y ? /* @__PURE__ */ n(
|
|
296
|
+
}, v = N && y ? /* @__PURE__ */ n(te, { children: [
|
|
297
297
|
St(N, "MMM d, y"),
|
|
298
298
|
" - ",
|
|
299
299
|
St(y, "MMM d, y")
|
|
@@ -607,9 +607,9 @@ const Dn = {
|
|
|
607
607
|
formErrors: v,
|
|
608
608
|
// --- UI Text ---
|
|
609
609
|
title: d = "Upload Files",
|
|
610
|
-
subHeading:
|
|
610
|
+
subHeading: p = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
611
611
|
}) => {
|
|
612
|
-
const
|
|
612
|
+
const z = o.length > 0 || u.length > 0;
|
|
613
613
|
return /* @__PURE__ */ e(he, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ n(
|
|
614
614
|
ye,
|
|
615
615
|
{
|
|
@@ -669,7 +669,7 @@ const Dn = {
|
|
|
669
669
|
children: [
|
|
670
670
|
/* @__PURE__ */ e(Ga, { size: 48, className: "text-gray-400" }),
|
|
671
671
|
/* @__PURE__ */ e("p", { children: "Drag and drop files here" }),
|
|
672
|
-
/* @__PURE__ */ e("p", { className: "sub-heading", children:
|
|
672
|
+
/* @__PURE__ */ e("p", { className: "sub-heading", children: p }),
|
|
673
673
|
/* @__PURE__ */ e("hr", {}),
|
|
674
674
|
/* @__PURE__ */ e("p", { children: "OR" }),
|
|
675
675
|
/* @__PURE__ */ e(
|
|
@@ -685,7 +685,7 @@ const Dn = {
|
|
|
685
685
|
}
|
|
686
686
|
),
|
|
687
687
|
v.filesToUpload && /* @__PURE__ */ e("p", { className: "form-error-message", children: v.filesToUpload.message }),
|
|
688
|
-
|
|
688
|
+
z && /* @__PURE__ */ n("div", { className: "file-list-container", children: [
|
|
689
689
|
/* @__PURE__ */ e("h3", { children: "Upload Queue" }),
|
|
690
690
|
/* @__PURE__ */ n("ul", { className: "file-list", children: [
|
|
691
691
|
o.map((F, E) => /* @__PURE__ */ n(
|
|
@@ -718,7 +718,7 @@ const Dn = {
|
|
|
718
718
|
},
|
|
719
719
|
`${F.name}-${E}`
|
|
720
720
|
)),
|
|
721
|
-
u.map(({ file: F, message: E },
|
|
721
|
+
u.map(({ file: F, message: E }, I) => /* @__PURE__ */ n(
|
|
722
722
|
"li",
|
|
723
723
|
{
|
|
724
724
|
className: "file-item file-item--rejected",
|
|
@@ -740,14 +740,14 @@ const Dn = {
|
|
|
740
740
|
"button",
|
|
741
741
|
{
|
|
742
742
|
type: "button",
|
|
743
|
-
onClick: () => N(
|
|
743
|
+
onClick: () => N(I),
|
|
744
744
|
className: "remove-file-button",
|
|
745
745
|
children: /* @__PURE__ */ e(Le, { size: 16 })
|
|
746
746
|
}
|
|
747
747
|
)
|
|
748
748
|
]
|
|
749
749
|
},
|
|
750
|
-
`${F.name}-${
|
|
750
|
+
`${F.name}-${I}`
|
|
751
751
|
))
|
|
752
752
|
] })
|
|
753
753
|
] })
|
|
@@ -840,66 +840,66 @@ const Dn = {
|
|
|
840
840
|
updatedBy: !1
|
|
841
841
|
}), [v, d] = B({
|
|
842
842
|
startDate: null
|
|
843
|
-
}), [
|
|
843
|
+
}), [p, z] = B({
|
|
844
844
|
endDate: null
|
|
845
845
|
}), F = qa({
|
|
846
846
|
initialValues: JSON.parse(JSON.stringify(m)),
|
|
847
847
|
// Deep copy
|
|
848
848
|
onSubmit: ($) => {
|
|
849
849
|
const x = {};
|
|
850
|
-
Object.keys($).forEach((
|
|
851
|
-
x[
|
|
852
|
-
operator: $[
|
|
853
|
-
values: Array.isArray($[
|
|
854
|
-
range: $[
|
|
850
|
+
Object.keys($).forEach((b) => {
|
|
851
|
+
x[b] = {
|
|
852
|
+
operator: $[b].operator || "in",
|
|
853
|
+
values: Array.isArray($[b].values) ? $[b].values : [],
|
|
854
|
+
range: $[b].range || null
|
|
855
855
|
};
|
|
856
856
|
}), console.log("[storybook filter] Applied Filters:", x), typeof s == "function" && s({
|
|
857
857
|
filters: x,
|
|
858
|
-
activeCount:
|
|
858
|
+
activeCount: I
|
|
859
859
|
}), a();
|
|
860
860
|
},
|
|
861
861
|
enableReinitialize: !0
|
|
862
862
|
}), E = ae(() => l.reduce(($, x) => {
|
|
863
|
-
const
|
|
863
|
+
const b = x.key, S = F.values[b];
|
|
864
864
|
let O = !1;
|
|
865
|
-
if (
|
|
865
|
+
if (S)
|
|
866
866
|
switch (x.type) {
|
|
867
867
|
case "multiselect":
|
|
868
868
|
case "multiselect-users":
|
|
869
|
-
O = Array.isArray(
|
|
869
|
+
O = Array.isArray(S.values) && S.values.length > 0;
|
|
870
870
|
break;
|
|
871
871
|
case "date":
|
|
872
|
-
(
|
|
872
|
+
(S.range && S.range !== "" || Array.isArray(S.values) && S.values.length > 0) && (O = !0);
|
|
873
873
|
break;
|
|
874
874
|
}
|
|
875
|
-
return $[
|
|
876
|
-
}, {}), [l, F.values]),
|
|
875
|
+
return $[b] = O, $;
|
|
876
|
+
}, {}), [l, F.values]), I = Object.values(E).filter(Boolean).length, P = ae(() => l.some(($) => {
|
|
877
877
|
if ($.type !== "date") return !1;
|
|
878
878
|
const x = F.values?.[$.key]?.values;
|
|
879
879
|
if (!Array.isArray(x) || x.length < 2) return !1;
|
|
880
|
-
const [
|
|
881
|
-
if (!
|
|
882
|
-
const O =
|
|
883
|
-
return O >
|
|
880
|
+
const [b, S] = x;
|
|
881
|
+
if (!b || !S) return !1;
|
|
882
|
+
const O = b instanceof Date ? b : new Date(b), R = S instanceof Date ? S : new Date(S);
|
|
883
|
+
return O > R;
|
|
884
884
|
}), [l, F.values]), j = async ($, x) => {
|
|
885
885
|
try {
|
|
886
|
-
r((
|
|
887
|
-
const
|
|
888
|
-
N((
|
|
889
|
-
} catch (
|
|
890
|
-
console.error(`Error fetching ${$} users:`,
|
|
886
|
+
r((S) => ({ ...S, [$]: !0 }));
|
|
887
|
+
const b = await u($, x);
|
|
888
|
+
N((S) => ({ ...S, [$]: b }));
|
|
889
|
+
} catch (b) {
|
|
890
|
+
console.error(`Error fetching ${$} users:`, b);
|
|
891
891
|
} finally {
|
|
892
|
-
r((
|
|
892
|
+
r((b) => ({ ...b, [$]: !1 }));
|
|
893
893
|
}
|
|
894
894
|
}, U = ($) => {
|
|
895
|
-
const x = l[$].key,
|
|
896
|
-
l[$].type === "multiselect-users" && h[x].length === 0 && !y[x] && j(x,
|
|
895
|
+
const x = l[$].key, b = l[$].url;
|
|
896
|
+
l[$].type === "multiselect-users" && h[x].length === 0 && !y[x] && j(x, b);
|
|
897
897
|
}, Y = () => {
|
|
898
898
|
F.resetForm(), N({ createdBy: [], updatedBy: [] }), i();
|
|
899
899
|
}, q = ($) => {
|
|
900
900
|
const x = l.find((O) => O.key === $);
|
|
901
901
|
if (!x) return null;
|
|
902
|
-
const
|
|
902
|
+
const b = F.values[$] || m[$], S = Array.isArray(b.values) ? b.values : [];
|
|
903
903
|
switch (x.type) {
|
|
904
904
|
case "multiselect":
|
|
905
905
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
@@ -908,7 +908,7 @@ const Dn = {
|
|
|
908
908
|
/* @__PURE__ */ e(
|
|
909
909
|
"select",
|
|
910
910
|
{
|
|
911
|
-
value:
|
|
911
|
+
value: b.operator || "in",
|
|
912
912
|
onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
|
|
913
913
|
className: "filter-select",
|
|
914
914
|
children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Includes" : "Excludes" }, A))
|
|
@@ -923,7 +923,7 @@ const Dn = {
|
|
|
923
923
|
type: "checkbox",
|
|
924
924
|
id: `select-all-${$}`,
|
|
925
925
|
className: "filter-checkbox-input",
|
|
926
|
-
checked: x.options.length > 0 &&
|
|
926
|
+
checked: x.options.length > 0 && S.length === x.options.length,
|
|
927
927
|
onChange: (A) => {
|
|
928
928
|
const G = A.target.checked ? x.options.map((W) => W.value) : [];
|
|
929
929
|
F.setFieldValue(`${$}.values`, G);
|
|
@@ -946,9 +946,9 @@ const Dn = {
|
|
|
946
946
|
type: "checkbox",
|
|
947
947
|
id: `${$}-${A.value}`,
|
|
948
948
|
className: "filter-checkbox-input",
|
|
949
|
-
checked:
|
|
949
|
+
checked: S.includes(A.value),
|
|
950
950
|
onChange: (G) => {
|
|
951
|
-
const W = G.target.checked ? [...
|
|
951
|
+
const W = G.target.checked ? [...S, A.value] : S.filter((pe) => pe !== A.value);
|
|
952
952
|
F.setFieldValue(`${$}.values`, W);
|
|
953
953
|
}
|
|
954
954
|
}
|
|
@@ -965,21 +965,21 @@ const Dn = {
|
|
|
965
965
|
] })
|
|
966
966
|
] });
|
|
967
967
|
case "multiselect-users":
|
|
968
|
-
const O = h[$] || [],
|
|
968
|
+
const O = h[$] || [], R = y[$];
|
|
969
969
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
970
970
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
971
971
|
/* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
|
|
972
972
|
/* @__PURE__ */ e(
|
|
973
973
|
"select",
|
|
974
974
|
{
|
|
975
|
-
value:
|
|
975
|
+
value: b.operator || "in",
|
|
976
976
|
onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
|
|
977
977
|
className: "filter-select",
|
|
978
978
|
children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Includes" : "Excludes" }, A))
|
|
979
979
|
}
|
|
980
980
|
)
|
|
981
981
|
] }),
|
|
982
|
-
|
|
982
|
+
R ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: O.length > 0 ? /* @__PURE__ */ n(te, { children: [
|
|
983
983
|
/* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
|
|
984
984
|
/* @__PURE__ */ e(
|
|
985
985
|
"input",
|
|
@@ -987,7 +987,7 @@ const Dn = {
|
|
|
987
987
|
type: "checkbox",
|
|
988
988
|
id: `select-all-users-${$}`,
|
|
989
989
|
className: "filter-checkbox-input",
|
|
990
|
-
checked: O.length > 0 &&
|
|
990
|
+
checked: O.length > 0 && S.length === O.length,
|
|
991
991
|
onChange: (A) => {
|
|
992
992
|
const G = A.target.checked ? O.map((W) => W.email) : [];
|
|
993
993
|
F.setFieldValue(
|
|
@@ -1013,9 +1013,9 @@ const Dn = {
|
|
|
1013
1013
|
type: "checkbox",
|
|
1014
1014
|
id: `${$}-${A.email}`,
|
|
1015
1015
|
className: "filter-checkbox-input",
|
|
1016
|
-
checked:
|
|
1016
|
+
checked: S.includes(A.email),
|
|
1017
1017
|
onChange: (G) => {
|
|
1018
|
-
const W = G.target.checked ? [...
|
|
1018
|
+
const W = G.target.checked ? [...S, A.email] : S.filter((pe) => pe !== A.email);
|
|
1019
1019
|
F.setFieldValue(
|
|
1020
1020
|
`${$}.values`,
|
|
1021
1021
|
W
|
|
@@ -1038,7 +1038,7 @@ const Dn = {
|
|
|
1038
1038
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1039
1039
|
] });
|
|
1040
1040
|
case "date":
|
|
1041
|
-
const D =
|
|
1041
|
+
const D = b.values || [], [f, g] = D, w = f && g, k = D[0] || null, T = D[1] || null, L = {
|
|
1042
1042
|
startDate: k instanceof Date ? k.toISOString().slice(0, 10) : null,
|
|
1043
1043
|
endDate: k instanceof Date ? k.toISOString().slice(0, 10) : null
|
|
1044
1044
|
}, C = {
|
|
@@ -1070,7 +1070,7 @@ const Dn = {
|
|
|
1070
1070
|
/* @__PURE__ */ e(
|
|
1071
1071
|
"select",
|
|
1072
1072
|
{
|
|
1073
|
-
value:
|
|
1073
|
+
value: b.operator,
|
|
1074
1074
|
onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
|
|
1075
1075
|
className: "filter-select",
|
|
1076
1076
|
children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Is" : "Is not" }, A))
|
|
@@ -1092,7 +1092,7 @@ const Dn = {
|
|
|
1092
1092
|
)
|
|
1093
1093
|
] }),
|
|
1094
1094
|
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((A) => {
|
|
1095
|
-
const G =
|
|
1095
|
+
const G = b.range === A.key || A.key === "anytime" && (!Array.isArray(b.values) || b.values.length === 0);
|
|
1096
1096
|
return /* @__PURE__ */ n(
|
|
1097
1097
|
"label",
|
|
1098
1098
|
{
|
|
@@ -1272,7 +1272,7 @@ const Dn = {
|
|
|
1272
1272
|
children: [
|
|
1273
1273
|
"Apply Filters",
|
|
1274
1274
|
" ",
|
|
1275
|
-
|
|
1275
|
+
I > 0 ? `(${I})` : ""
|
|
1276
1276
|
]
|
|
1277
1277
|
}
|
|
1278
1278
|
)
|
|
@@ -1419,7 +1419,7 @@ const Dn = {
|
|
|
1419
1419
|
itemsPerPageOptions: m = [10, 15, 20]
|
|
1420
1420
|
}) => {
|
|
1421
1421
|
const o = Math.ceil(a / s), [u, h] = B(t);
|
|
1422
|
-
|
|
1422
|
+
Z(() => {
|
|
1423
1423
|
h(t);
|
|
1424
1424
|
}, [t]);
|
|
1425
1425
|
const N = Math.min((t - 1) * s + 1, a), y = Math.min(t * s, a), r = (v) => {
|
|
@@ -1532,7 +1532,7 @@ const Dn = {
|
|
|
1532
1532
|
"radiogroup-option--checked": h,
|
|
1533
1533
|
"radiogroup-option--error": !!l
|
|
1534
1534
|
}),
|
|
1535
|
-
children: ({ checked: u }) => /* @__PURE__ */ n(
|
|
1535
|
+
children: ({ checked: u }) => /* @__PURE__ */ n(te, { children: [
|
|
1536
1536
|
/* @__PURE__ */ n("div", { className: "radiogroup-option-content", children: [
|
|
1537
1537
|
/* @__PURE__ */ e(Ue.Label, { as: "p", className: "option-label", children: o.label }),
|
|
1538
1538
|
o.description && /* @__PURE__ */ e(
|
|
@@ -1567,20 +1567,20 @@ const Dn = {
|
|
|
1567
1567
|
...y
|
|
1568
1568
|
}) => {
|
|
1569
1569
|
const [r, v] = B(t);
|
|
1570
|
-
|
|
1570
|
+
Z(() => {
|
|
1571
1571
|
v(t);
|
|
1572
1572
|
}, [t]);
|
|
1573
|
-
const d =
|
|
1574
|
-
Zr((
|
|
1575
|
-
a?.(
|
|
1573
|
+
const d = ee(
|
|
1574
|
+
Zr((z) => {
|
|
1575
|
+
a?.(z);
|
|
1576
1576
|
}, s),
|
|
1577
1577
|
[s, a]
|
|
1578
1578
|
);
|
|
1579
|
-
|
|
1579
|
+
Z(() => (r !== t && d(r), () => {
|
|
1580
1580
|
d.cancel();
|
|
1581
1581
|
}), [r, d, t]);
|
|
1582
|
-
const
|
|
1583
|
-
v(
|
|
1582
|
+
const p = (z) => {
|
|
1583
|
+
v(z.target.value);
|
|
1584
1584
|
};
|
|
1585
1585
|
return /* @__PURE__ */ n("div", { className: `search-bar-wrapper ${m}`, children: [
|
|
1586
1586
|
l && /* @__PURE__ */ e("label", { htmlFor: "search-field", className: "sr-only", children: l }),
|
|
@@ -1594,7 +1594,7 @@ const Dn = {
|
|
|
1594
1594
|
type: "search",
|
|
1595
1595
|
name: "search",
|
|
1596
1596
|
value: r,
|
|
1597
|
-
onChange:
|
|
1597
|
+
onChange: p,
|
|
1598
1598
|
style: o,
|
|
1599
1599
|
...y
|
|
1600
1600
|
}
|
|
@@ -1627,7 +1627,7 @@ const Dn = {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
return d.id === a || d.value === a || d.label === a;
|
|
1629
1629
|
});
|
|
1630
|
-
return /* @__PURE__ */ e(
|
|
1630
|
+
return /* @__PURE__ */ e(K, { value: a, onChange: s, disabled: m, children: /* @__PURE__ */ n("div", { className: "select-wrapper", ref: u, children: [
|
|
1631
1631
|
t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
|
|
1632
1632
|
/* @__PURE__ */ n("div", { className: "select-button-container", children: [
|
|
1633
1633
|
/* @__PURE__ */ n(
|
|
@@ -1663,20 +1663,20 @@ const Dn = {
|
|
|
1663
1663
|
/* @__PURE__ */ e("div", { className: "select-options-list", children: r.length === 0 && N !== "" ? /* @__PURE__ */ e("div", { className: "no-results", children: "No results found." }) : r.map((d) => /* @__PURE__ */ e(
|
|
1664
1664
|
Gr,
|
|
1665
1665
|
{
|
|
1666
|
-
className: ({ active:
|
|
1666
|
+
className: ({ active: p }) => `select-option ${p ? "active" : ""}`,
|
|
1667
1667
|
value: d,
|
|
1668
|
-
children: ({ selected:
|
|
1668
|
+
children: ({ selected: p }) => /* @__PURE__ */ n(te, { children: [
|
|
1669
1669
|
/* @__PURE__ */ n("div", { className: "option-content", children: [
|
|
1670
1670
|
d.icon && /* @__PURE__ */ e(d.icon, { className: "option-icon" }),
|
|
1671
1671
|
/* @__PURE__ */ e(
|
|
1672
1672
|
"span",
|
|
1673
1673
|
{
|
|
1674
|
-
className: `option-label ${
|
|
1674
|
+
className: `option-label ${p ? "selected" : ""}`,
|
|
1675
1675
|
children: d.label
|
|
1676
1676
|
}
|
|
1677
1677
|
)
|
|
1678
1678
|
] }),
|
|
1679
|
-
|
|
1679
|
+
p ? /* @__PURE__ */ e(
|
|
1680
1680
|
et,
|
|
1681
1681
|
{
|
|
1682
1682
|
className: "option-check-icon",
|
|
@@ -1695,7 +1695,7 @@ const Dn = {
|
|
|
1695
1695
|
] }) });
|
|
1696
1696
|
}, Bn = () => {
|
|
1697
1697
|
const [t, a] = B(window.location.pathname);
|
|
1698
|
-
return
|
|
1698
|
+
return Z(() => {
|
|
1699
1699
|
const s = () => {
|
|
1700
1700
|
a(window.location.pathname);
|
|
1701
1701
|
};
|
|
@@ -1710,7 +1710,7 @@ const Dn = {
|
|
|
1710
1710
|
return null;
|
|
1711
1711
|
}, ga = ({ item: t, isCollapsed: a, level: s = 0 }) => {
|
|
1712
1712
|
const { pathname: i } = Bn(), l = t.href || t.url || t.path, [m, o] = B(!1), u = t.icon;
|
|
1713
|
-
|
|
1713
|
+
Z(() => {
|
|
1714
1714
|
yt([t], i) && o(!0);
|
|
1715
1715
|
}, [t, i]);
|
|
1716
1716
|
const h = i === l, N = !h && !!yt([t], i), y = (r) => {
|
|
@@ -1789,7 +1789,7 @@ const Dn = {
|
|
|
1789
1789
|
logoSmall: m,
|
|
1790
1790
|
logoLarge: o,
|
|
1791
1791
|
user: u = { name: "", email: "" }
|
|
1792
|
-
}) => /* @__PURE__ */ n(
|
|
1792
|
+
}) => /* @__PURE__ */ n(te, { children: [
|
|
1793
1793
|
i && /* @__PURE__ */ e(
|
|
1794
1794
|
"div",
|
|
1795
1795
|
{
|
|
@@ -1968,7 +1968,7 @@ const Dn = {
|
|
|
1968
1968
|
...o
|
|
1969
1969
|
}) => {
|
|
1970
1970
|
const u = re.useId();
|
|
1971
|
-
return /* @__PURE__ */ n(
|
|
1971
|
+
return /* @__PURE__ */ n(te, { children: [
|
|
1972
1972
|
re.cloneElement(t, { "data-tooltip-id": u }),
|
|
1973
1973
|
/* @__PURE__ */ e(
|
|
1974
1974
|
Qa,
|
|
@@ -2007,7 +2007,7 @@ const Dn = {
|
|
|
2007
2007
|
showProgress: h = !0,
|
|
2008
2008
|
closeOnOverlayClick: N = !0
|
|
2009
2009
|
}) => {
|
|
2010
|
-
const y = s[i], r = Object.keys(s), v = r.indexOf(i), d = (v + 1) / r.length * 100,
|
|
2010
|
+
const y = s[i], r = Object.keys(s), v = r.indexOf(i), d = (v + 1) / r.length * 100, p = v > 0 && m.onBack;
|
|
2011
2011
|
return /* @__PURE__ */ e(he, { show: t, as: Q, children: /* @__PURE__ */ n(
|
|
2012
2012
|
ye,
|
|
2013
2013
|
{
|
|
@@ -2042,7 +2042,7 @@ const Dn = {
|
|
|
2042
2042
|
children: /* @__PURE__ */ n(Fe, { className: "wizard-panel", children: [
|
|
2043
2043
|
/* @__PURE__ */ n("header", { className: "wizard-header", children: [
|
|
2044
2044
|
/* @__PURE__ */ n("div", { className: "wizard-header-content", children: [
|
|
2045
|
-
|
|
2045
|
+
p && /* @__PURE__ */ e(
|
|
2046
2046
|
"button",
|
|
2047
2047
|
{
|
|
2048
2048
|
onClick: m.onBack,
|
|
@@ -2131,7 +2131,7 @@ const Dn = {
|
|
|
2131
2131
|
onClick: r,
|
|
2132
2132
|
...v
|
|
2133
2133
|
}) => {
|
|
2134
|
-
const d = u,
|
|
2134
|
+
const d = u, p = H(
|
|
2135
2135
|
"btn-base-icon",
|
|
2136
2136
|
"btn-icon-only",
|
|
2137
2137
|
jn[h],
|
|
@@ -2143,7 +2143,7 @@ const Dn = {
|
|
|
2143
2143
|
{
|
|
2144
2144
|
"data-testid": t,
|
|
2145
2145
|
type: s,
|
|
2146
|
-
className:
|
|
2146
|
+
className: p,
|
|
2147
2147
|
disabled: d,
|
|
2148
2148
|
onClick: r,
|
|
2149
2149
|
title: i,
|
|
@@ -2595,7 +2595,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2595
2595
|
}
|
|
2596
2596
|
}, zt = (t, a) => {
|
|
2597
2597
|
const [s, i] = B(t);
|
|
2598
|
-
return
|
|
2598
|
+
return Z(
|
|
2599
2599
|
() => {
|
|
2600
2600
|
const l = rn(() => {
|
|
2601
2601
|
i(t);
|
|
@@ -2666,7 +2666,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2666
2666
|
},
|
|
2667
2667
|
isChanged: u = !1
|
|
2668
2668
|
}) => {
|
|
2669
|
-
const [h, N] = B(Mt[0]), [y, r] = B(""), v = zt(y, 400), [d,
|
|
2669
|
+
const [h, N] = B(Mt[0]), [y, r] = B(""), v = zt(y, 400), [d, p] = B([]), [z, F] = B(/* @__PURE__ */ new Set()), [E, I] = B(!1), [P, j] = B(Lt[0]), {
|
|
2670
2670
|
control: U,
|
|
2671
2671
|
handleSubmit: Y,
|
|
2672
2672
|
watch: q,
|
|
@@ -2674,27 +2674,27 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2674
2674
|
} = nr({
|
|
2675
2675
|
defaultValues: { pendingInvites: [] },
|
|
2676
2676
|
resolver: ir(rs)
|
|
2677
|
-
}), { fields:
|
|
2677
|
+
}), { fields: b, append: S, remove: O, update: R } = sr({
|
|
2678
2678
|
control: U,
|
|
2679
2679
|
name: "pendingInvites"
|
|
2680
2680
|
}), D = q("pendingInvites");
|
|
2681
|
-
|
|
2682
|
-
v.length > 1 ? (
|
|
2683
|
-
|
|
2684
|
-
}).catch((C) => console.error("Search failed:", C)).finally(() =>
|
|
2681
|
+
Z(() => {
|
|
2682
|
+
v.length > 1 ? (I(!0), es(h.name, v).then((C) => {
|
|
2683
|
+
p(C);
|
|
2684
|
+
}).catch((C) => console.error("Search failed:", C)).finally(() => I(!1))) : (p([]), F(/* @__PURE__ */ new Set()));
|
|
2685
2685
|
}, [v, h]);
|
|
2686
|
-
const
|
|
2686
|
+
const f = (C) => {
|
|
2687
2687
|
F((M) => {
|
|
2688
2688
|
const _ = new Set(M);
|
|
2689
2689
|
return _.has(C) ? _.delete(C) : _.add(C), _;
|
|
2690
2690
|
});
|
|
2691
|
-
},
|
|
2692
|
-
d.filter((C) =>
|
|
2693
|
-
|
|
2691
|
+
}, g = () => {
|
|
2692
|
+
d.filter((C) => z.has(C.id)).forEach((C) => {
|
|
2693
|
+
b.find((M) => M.id === C.id) || S({ ...C, permission: P.name });
|
|
2694
2694
|
}), F(/* @__PURE__ */ new Set()), r("");
|
|
2695
2695
|
}, w = (C) => {
|
|
2696
|
-
j(C),
|
|
2697
|
-
(M, _) =>
|
|
2696
|
+
j(C), b.forEach(
|
|
2697
|
+
(M, _) => R(_, { ...b[_], permission: C.name })
|
|
2698
2698
|
);
|
|
2699
2699
|
}, k = async (C) => {
|
|
2700
2700
|
try {
|
|
@@ -2755,7 +2755,9 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2755
2755
|
return "Add User, Groups or Roles test";
|
|
2756
2756
|
}
|
|
2757
2757
|
};
|
|
2758
|
-
return ae(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", D.length), D.length === 0 && !u), [D.length, u]),
|
|
2758
|
+
return ae(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", D.length), D.length === 0 && !u), [D.length, u]), Z(() => {
|
|
2759
|
+
typeof o == "function" && o({ pendingInvites: D }, i);
|
|
2760
|
+
}, [D]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2759
2761
|
/* @__PURE__ */ n("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2760
2762
|
/* @__PURE__ */ e(ye.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: L() }),
|
|
2761
2763
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
|
|
@@ -2784,8 +2786,8 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2784
2786
|
}
|
|
2785
2787
|
),
|
|
2786
2788
|
/* @__PURE__ */ n("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
|
|
2787
|
-
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(
|
|
2788
|
-
/* @__PURE__ */ n(
|
|
2789
|
+
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(K, { value: h, onChange: N, children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2790
|
+
/* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2789
2791
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
2790
2792
|
/* @__PURE__ */ e(h.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2791
2793
|
/* @__PURE__ */ e("span", { className: "truncate", children: h.name })
|
|
@@ -2799,12 +2801,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2799
2801
|
leave: "transition ease-in duration-100",
|
|
2800
2802
|
leaveFrom: "opacity-100",
|
|
2801
2803
|
leaveTo: "opacity-0",
|
|
2802
|
-
children: /* @__PURE__ */ e(
|
|
2803
|
-
|
|
2804
|
+
children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Mt.map((C) => /* @__PURE__ */ e(
|
|
2805
|
+
K.Option,
|
|
2804
2806
|
{
|
|
2805
2807
|
value: C,
|
|
2806
2808
|
className: ({ active: M }) => `${M ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2807
|
-
children: ({ selected: M }) => /* @__PURE__ */ n(
|
|
2809
|
+
children: ({ selected: M }) => /* @__PURE__ */ n(te, { children: [
|
|
2808
2810
|
/* @__PURE__ */ n(
|
|
2809
2811
|
"span",
|
|
2810
2812
|
{
|
|
@@ -2844,20 +2846,20 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2844
2846
|
exit: { opacity: 0, y: -10 },
|
|
2845
2847
|
transition: { duration: 0.2 },
|
|
2846
2848
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2847
|
-
children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(
|
|
2849
|
+
children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(te, { children: [
|
|
2848
2850
|
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((C) => {
|
|
2849
2851
|
const M = T(C);
|
|
2850
2852
|
return /* @__PURE__ */ n(
|
|
2851
2853
|
"div",
|
|
2852
2854
|
{
|
|
2853
|
-
onClick: () => M ? null :
|
|
2855
|
+
onClick: () => M ? null : f(C.id),
|
|
2854
2856
|
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${M ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2855
2857
|
children: [
|
|
2856
2858
|
/* @__PURE__ */ e(
|
|
2857
2859
|
"input",
|
|
2858
2860
|
{
|
|
2859
2861
|
type: "checkbox",
|
|
2860
|
-
checked:
|
|
2862
|
+
checked: z.has(C.id),
|
|
2861
2863
|
readOnly: !0,
|
|
2862
2864
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
|
|
2863
2865
|
disabled: !!M
|
|
@@ -2868,7 +2870,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2868
2870
|
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: C.name }),
|
|
2869
2871
|
h.name === De.USER && /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: C.id })
|
|
2870
2872
|
] }),
|
|
2871
|
-
M ? /* @__PURE__ */ n(
|
|
2873
|
+
M ? /* @__PURE__ */ n(te, { children: [
|
|
2872
2874
|
/* @__PURE__ */ e("span", { className: "text-sm px-3 py-0.5 border border-dashed rounded-xl bg-teal-100 text-teal-700", children: M }),
|
|
2873
2875
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
|
|
2874
2876
|
] }) : ""
|
|
@@ -2890,7 +2892,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2890
2892
|
/* @__PURE__ */ e(
|
|
2891
2893
|
le,
|
|
2892
2894
|
{
|
|
2893
|
-
onClick:
|
|
2895
|
+
onClick: g,
|
|
2894
2896
|
size: "small",
|
|
2895
2897
|
label: "Add"
|
|
2896
2898
|
}
|
|
@@ -2900,7 +2902,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2900
2902
|
}
|
|
2901
2903
|
) })
|
|
2902
2904
|
] }),
|
|
2903
|
-
/* @__PURE__ */ e(Se, { children:
|
|
2905
|
+
/* @__PURE__ */ e(Se, { children: b.length > 0 && /* @__PURE__ */ n(
|
|
2904
2906
|
ie.div,
|
|
2905
2907
|
{
|
|
2906
2908
|
initial: { opacity: 0, y: 20 },
|
|
@@ -2910,16 +2912,16 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2910
2912
|
/* @__PURE__ */ n("div", { className: "flex justify-between items-center", children: [
|
|
2911
2913
|
/* @__PURE__ */ n("div", { className: "font-semibold text-gray-800", children: [
|
|
2912
2914
|
"Pending Invites (",
|
|
2913
|
-
|
|
2915
|
+
b.length,
|
|
2914
2916
|
")"
|
|
2915
2917
|
] }),
|
|
2916
2918
|
l === ue.DRIVE && /* @__PURE__ */ e(
|
|
2917
|
-
|
|
2919
|
+
K,
|
|
2918
2920
|
{
|
|
2919
2921
|
value: P,
|
|
2920
2922
|
onChange: w,
|
|
2921
2923
|
children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2922
|
-
/* @__PURE__ */ n(
|
|
2924
|
+
/* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2923
2925
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
2924
2926
|
/* @__PURE__ */ e(P.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2925
2927
|
/* @__PURE__ */ n("span", { className: "truncate", children: [
|
|
@@ -2936,12 +2938,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2936
2938
|
leave: "transition ease-in duration-100",
|
|
2937
2939
|
leaveFrom: "opacity-100",
|
|
2938
2940
|
leaveTo: "opacity-0",
|
|
2939
|
-
children: /* @__PURE__ */ e(
|
|
2940
|
-
|
|
2941
|
+
children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Lt.map((C) => /* @__PURE__ */ e(
|
|
2942
|
+
K.Option,
|
|
2941
2943
|
{
|
|
2942
2944
|
value: C,
|
|
2943
2945
|
className: ({ active: M }) => `${M ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2944
|
-
children: ({ selected: M, active: _ }) => /* @__PURE__ */ n(
|
|
2946
|
+
children: ({ selected: M, active: _ }) => /* @__PURE__ */ n(te, { children: [
|
|
2945
2947
|
/* @__PURE__ */ n(
|
|
2946
2948
|
"span",
|
|
2947
2949
|
{
|
|
@@ -2975,7 +2977,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2975
2977
|
}
|
|
2976
2978
|
)
|
|
2977
2979
|
] }),
|
|
2978
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Se, { children:
|
|
2980
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Se, { children: b.map((C, M) => /* @__PURE__ */ n(
|
|
2979
2981
|
ie.div,
|
|
2980
2982
|
{
|
|
2981
2983
|
layout: !0,
|
|
@@ -3058,15 +3060,15 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3058
3060
|
}), h = Kr(u), N = en(u), { getReferenceProps: y, getFloatingProps: r } = tn([
|
|
3059
3061
|
h,
|
|
3060
3062
|
N
|
|
3061
|
-
]), v = ot.find((
|
|
3063
|
+
]), v = ot.find((p) => p.name === t.permission || p.value === t.permission) || ot[0];
|
|
3062
3064
|
return (
|
|
3063
3065
|
// FIX: The <Listbox> component now wraps both the button and the portal.
|
|
3064
3066
|
// This provides the necessary context for both children.
|
|
3065
|
-
/* @__PURE__ */ n(
|
|
3066
|
-
s(
|
|
3067
|
+
/* @__PURE__ */ n(K, { value: v, onChange: (p) => {
|
|
3068
|
+
s(p), l(!1);
|
|
3067
3069
|
}, children: [
|
|
3068
3070
|
/* @__PURE__ */ n(
|
|
3069
|
-
|
|
3071
|
+
K.Button,
|
|
3070
3072
|
{
|
|
3071
3073
|
ref: m.setReference,
|
|
3072
3074
|
...y(),
|
|
@@ -3089,38 +3091,38 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3089
3091
|
leaveFrom: "transform opacity-100 scale-100",
|
|
3090
3092
|
leaveTo: "transform opacity-0 scale-95",
|
|
3091
3093
|
children: /* @__PURE__ */ e(
|
|
3092
|
-
|
|
3094
|
+
K.Options,
|
|
3093
3095
|
{
|
|
3094
3096
|
ref: m.setFloating,
|
|
3095
3097
|
style: o,
|
|
3096
3098
|
...r(),
|
|
3097
3099
|
static: !0,
|
|
3098
3100
|
className: "z-50 w-48 bg-white shadow-lg rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",
|
|
3099
|
-
children: ot.filter((
|
|
3100
|
-
|
|
3101
|
+
children: ot.filter((p) => a.includes(p.value)).map((p) => /* @__PURE__ */ e(
|
|
3102
|
+
K.Option,
|
|
3101
3103
|
{
|
|
3102
3104
|
className: ({
|
|
3103
|
-
active:
|
|
3105
|
+
active: z
|
|
3104
3106
|
}) => `relative select-none py-2 pl-10 pr-4 hover:cursor-pointer
|
|
3105
|
-
${
|
|
3106
|
-
${
|
|
3107
|
-
${
|
|
3108
|
-
value:
|
|
3109
|
-
children: ({ selected:
|
|
3107
|
+
${z ? "bg-blue-100 text-blue-900" : "text-gray-900"}
|
|
3108
|
+
${p.isDestructive && z ? "bg-red-100 text-red-900" : ""}
|
|
3109
|
+
${p.isDestructive && !z ? "text-red-600" : ""}`,
|
|
3110
|
+
value: p,
|
|
3111
|
+
children: ({ selected: z }) => /* @__PURE__ */ n(te, { children: [
|
|
3110
3112
|
/* @__PURE__ */ n(
|
|
3111
3113
|
"span",
|
|
3112
3114
|
{
|
|
3113
|
-
className: `flex items-center gap-2 truncate ${
|
|
3115
|
+
className: `flex items-center gap-2 truncate ${z ? "font-medium" : "font-normal"}`,
|
|
3114
3116
|
children: [
|
|
3115
|
-
/* @__PURE__ */ e(
|
|
3116
|
-
|
|
3117
|
+
/* @__PURE__ */ e(p.icon, { className: "h-5 w-5", "aria-hidden": "true" }),
|
|
3118
|
+
p.name
|
|
3117
3119
|
]
|
|
3118
3120
|
}
|
|
3119
3121
|
),
|
|
3120
|
-
|
|
3122
|
+
z && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(ut, { className: "h-5 w-5", "aria-hidden": "true" }) })
|
|
3121
3123
|
] })
|
|
3122
3124
|
},
|
|
3123
|
-
|
|
3125
|
+
p.name
|
|
3124
3126
|
))
|
|
3125
3127
|
}
|
|
3126
3128
|
)
|
|
@@ -3139,29 +3141,29 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3139
3141
|
}) => {
|
|
3140
3142
|
const [o, u] = B(l), [h, N] = B(0), [y, r] = B(""), v = zt(y, 300), d = {
|
|
3141
3143
|
users: o.users.filter(
|
|
3142
|
-
(
|
|
3144
|
+
(I) => I.name.toLowerCase().includes(v.toLowerCase())
|
|
3143
3145
|
),
|
|
3144
3146
|
groups: o.groups.filter(
|
|
3145
|
-
(
|
|
3147
|
+
(I) => I.name.toLowerCase().includes(v.toLowerCase())
|
|
3146
3148
|
),
|
|
3147
3149
|
roles: o.roles.filter(
|
|
3148
|
-
(
|
|
3150
|
+
(I) => I.name.toLowerCase().includes(v.toLowerCase())
|
|
3149
3151
|
)
|
|
3150
|
-
},
|
|
3152
|
+
}, p = async (I, P, j, U) => {
|
|
3151
3153
|
const Y = P.value;
|
|
3152
3154
|
u((q) => ({
|
|
3153
3155
|
...q,
|
|
3154
3156
|
[j]: q[j].map(
|
|
3155
|
-
($) => $.id ===
|
|
3157
|
+
($) => $.id === I.id ? { ...$, permission: Y } : $
|
|
3156
3158
|
)
|
|
3157
3159
|
}));
|
|
3158
|
-
},
|
|
3159
|
-
const
|
|
3160
|
+
}, z = () => {
|
|
3161
|
+
const I = {
|
|
3160
3162
|
users: o.users.filter((P) => P.permission !== "remove"),
|
|
3161
3163
|
groups: o.groups.filter((P) => P.permission !== "remove"),
|
|
3162
3164
|
roles: o.roles.filter((P) => P.permission !== "remove")
|
|
3163
3165
|
};
|
|
3164
|
-
a(
|
|
3166
|
+
a(I);
|
|
3165
3167
|
}, F = ["users", "groups", "roles"], E = ["Users", "Groups", "Roles"];
|
|
3166
3168
|
return (
|
|
3167
3169
|
// The main structure remains the same...
|
|
@@ -3191,7 +3193,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3191
3193
|
/* @__PURE__ */ n("div", { className: "flex flex-col flex-grow", children: [
|
|
3192
3194
|
/* @__PURE__ */ n(se.Group, { selectedIndex: h, onChange: N, children: [
|
|
3193
3195
|
/* @__PURE__ */ n("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3194
|
-
/* @__PURE__ */ e(se.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: E.map((
|
|
3196
|
+
/* @__PURE__ */ e(se.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: E.map((I) => /* @__PURE__ */ e(
|
|
3195
3197
|
se,
|
|
3196
3198
|
{
|
|
3197
3199
|
className: ({
|
|
@@ -3199,9 +3201,9 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3199
3201
|
}) => `w-full py-2 text-sm font-medium leading-5 rounded-md
|
|
3200
3202
|
focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
|
|
3201
3203
|
${P ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
|
|
3202
|
-
children:
|
|
3204
|
+
children: I
|
|
3203
3205
|
},
|
|
3204
|
-
|
|
3206
|
+
I
|
|
3205
3207
|
)) }),
|
|
3206
3208
|
/* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
|
|
3207
3209
|
ge,
|
|
@@ -3219,11 +3221,11 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3219
3221
|
animate: { y: 0, opacity: 1 },
|
|
3220
3222
|
exit: { y: -10, opacity: 0 },
|
|
3221
3223
|
transition: { duration: 0.2 },
|
|
3222
|
-
children: /* @__PURE__ */ e(se.Panels, { as: Q, children: F.map((
|
|
3224
|
+
children: /* @__PURE__ */ e(se.Panels, { as: Q, children: F.map((I) => /* @__PURE__ */ e(
|
|
3223
3225
|
se.Panel,
|
|
3224
3226
|
{
|
|
3225
3227
|
className: "space-y-3 focus:outline-none",
|
|
3226
|
-
children: /* @__PURE__ */ e(Se, { children: d[
|
|
3228
|
+
children: /* @__PURE__ */ e(Se, { children: d[I].length > 0 ? d[I].map((P) => /* @__PURE__ */ n(
|
|
3227
3229
|
ie.div,
|
|
3228
3230
|
{
|
|
3229
3231
|
layout: !0,
|
|
@@ -3247,12 +3249,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3247
3249
|
),
|
|
3248
3250
|
/* @__PURE__ */ n("div", { className: "overflow-hidden", children: [
|
|
3249
3251
|
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: P.name }),
|
|
3250
|
-
|
|
3252
|
+
I !== "users" && /* @__PURE__ */ e(
|
|
3251
3253
|
"button",
|
|
3252
3254
|
{
|
|
3253
3255
|
onClick: () => i({
|
|
3254
3256
|
id: P.id,
|
|
3255
|
-
type:
|
|
3257
|
+
type: I,
|
|
3256
3258
|
name: P.name
|
|
3257
3259
|
}),
|
|
3258
3260
|
className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
|
|
@@ -3266,10 +3268,10 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3266
3268
|
{
|
|
3267
3269
|
item: P,
|
|
3268
3270
|
allowedPermissions: m,
|
|
3269
|
-
onPermissionChange: (j) =>
|
|
3271
|
+
onPermissionChange: (j) => p(
|
|
3270
3272
|
P,
|
|
3271
3273
|
j,
|
|
3272
|
-
|
|
3274
|
+
I
|
|
3273
3275
|
)
|
|
3274
3276
|
}
|
|
3275
3277
|
)
|
|
@@ -3297,7 +3299,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3297
3299
|
)
|
|
3298
3300
|
) })
|
|
3299
3301
|
},
|
|
3300
|
-
|
|
3302
|
+
I
|
|
3301
3303
|
)) })
|
|
3302
3304
|
},
|
|
3303
3305
|
h
|
|
@@ -3306,7 +3308,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3306
3308
|
/* @__PURE__ */ e("div", { className: "p-4 bg-white border-t border-gray-300 flex justify-end", children: /* @__PURE__ */ e(
|
|
3307
3309
|
"button",
|
|
3308
3310
|
{
|
|
3309
|
-
onClick:
|
|
3311
|
+
onClick: z,
|
|
3310
3312
|
className: "px-4 py-2 bg-blue-600 text-white rounded-md shadow hover:bg-blue-700",
|
|
3311
3313
|
children: "Update"
|
|
3312
3314
|
}
|
|
@@ -3343,7 +3345,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3343
3345
|
exit: { opacity: 0, x: -20 }
|
|
3344
3346
|
}, v = () => l ? (
|
|
3345
3347
|
// Show 5 skeleton items while loading
|
|
3346
|
-
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d,
|
|
3348
|
+
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d, p) => /* @__PURE__ */ e(is, {}, p)) })
|
|
3347
3349
|
) : N.length === 0 ? /* @__PURE__ */ n(
|
|
3348
3350
|
ie.div,
|
|
3349
3351
|
{
|
|
@@ -3448,26 +3450,26 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3448
3450
|
allowedPermissions: u = [],
|
|
3449
3451
|
...h
|
|
3450
3452
|
}) => {
|
|
3451
|
-
const [N, y] = B(be.INVITE), [r, v] = B(t), [d,
|
|
3452
|
-
y(be.INVITE),
|
|
3453
|
+
const [N, y] = B(be.INVITE), [r, v] = B(t), [d, p] = B(null), [z, F] = B(!1), [E, I] = B([]), [P, j] = B(be.MANAGE), U = () => {
|
|
3454
|
+
y(be.INVITE), p(null), m();
|
|
3453
3455
|
}, Y = () => {
|
|
3454
3456
|
y(be.MANAGE);
|
|
3455
|
-
}, q = async ({ id:
|
|
3457
|
+
}, q = async ({ id: b, name: S, type: O }) => {
|
|
3456
3458
|
if (O === "groups") {
|
|
3457
3459
|
try {
|
|
3458
|
-
const
|
|
3459
|
-
} catch (
|
|
3460
|
-
console.log("Error searching entities:",
|
|
3460
|
+
const R = await Ze(`${Je.getMembersForGroup(S)}`);
|
|
3461
|
+
} catch (R) {
|
|
3462
|
+
console.log("Error searching entities:", R);
|
|
3461
3463
|
}
|
|
3462
|
-
|
|
3464
|
+
I(resp);
|
|
3463
3465
|
}
|
|
3464
|
-
|
|
3465
|
-
}, $ = (
|
|
3466
|
-
console.log("changedExistingShares",
|
|
3467
|
-
const
|
|
3468
|
-
console.log("Existing data:",
|
|
3469
|
-
const
|
|
3470
|
-
console.log("hasPermissionChanged:",
|
|
3466
|
+
p({ id: b, type: O, name: S }), j(N), y(be.MEMBERS);
|
|
3467
|
+
}, $ = (b) => {
|
|
3468
|
+
console.log("changedExistingShares", b), v(b);
|
|
3469
|
+
const S = it.mapValues(t, (D) => D.map((f) => ({ id: f.id, permission: f.permission })).sort((f, g) => f.id - g.id)), O = it.mapValues(b, (D) => D.map((f) => ({ id: f.id, permission: f.permission })).sort((f, g) => f.id - g.id));
|
|
3470
|
+
console.log("Existing data:", S), console.log("Changed data:", O);
|
|
3471
|
+
const R = !it.isEqual(S, O);
|
|
3472
|
+
console.log("hasPermissionChanged:", R), F(R), y(N === be.MEMBERS ? P : be.INVITE);
|
|
3471
3473
|
};
|
|
3472
3474
|
return /* @__PURE__ */ e(he, { appear: !0, show: a, as: Q, children: /* @__PURE__ */ n(ye, { as: "div", className: "relative z-50", onClose: U, children: [
|
|
3473
3475
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
@@ -3538,10 +3540,10 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3538
3540
|
existingShares: r,
|
|
3539
3541
|
calledBy: l,
|
|
3540
3542
|
showExistingShares: o,
|
|
3541
|
-
onFinalSubmit: (
|
|
3542
|
-
s(
|
|
3543
|
+
onFinalSubmit: (b) => {
|
|
3544
|
+
s(b, r);
|
|
3543
3545
|
},
|
|
3544
|
-
isChanged:
|
|
3546
|
+
isChanged: z
|
|
3545
3547
|
}
|
|
3546
3548
|
)
|
|
3547
3549
|
},
|
|
@@ -3574,58 +3576,58 @@ function at({
|
|
|
3574
3576
|
serverLoading: r = !1,
|
|
3575
3577
|
minSearchChars: v = 2,
|
|
3576
3578
|
// NEW: mappers (id/label keys)
|
|
3577
|
-
getOptionId: d = (
|
|
3578
|
-
getOptionLabel:
|
|
3579
|
+
getOptionId: d = (z) => String(z.id),
|
|
3580
|
+
getOptionLabel: p = (z) => z.name
|
|
3579
3581
|
}) {
|
|
3580
|
-
const
|
|
3581
|
-
const
|
|
3582
|
-
for (const
|
|
3583
|
-
return
|
|
3584
|
-
}, [a, d]), U = ae(() => Array.isArray(s) ? s.map((
|
|
3582
|
+
const z = He(), F = He(), [E, I] = B(""), P = fe(""), j = ae(() => {
|
|
3583
|
+
const b = /* @__PURE__ */ new Map();
|
|
3584
|
+
for (const S of a) b.set(d(S), S);
|
|
3585
|
+
return b;
|
|
3586
|
+
}, [a, d]), U = ae(() => Array.isArray(s) ? s.map((b) => b && typeof b == "object" ? j.get(d(b)) || null : j.get(String(b))).filter(Boolean) : [], [s, j, d]), Y = ae(() => {
|
|
3585
3587
|
if (!E) return a;
|
|
3586
|
-
const
|
|
3587
|
-
return a.filter((
|
|
3588
|
-
}, [a, E,
|
|
3589
|
-
|
|
3588
|
+
const b = E.toLowerCase();
|
|
3589
|
+
return a.filter((S) => p(S).toLowerCase().includes(b));
|
|
3590
|
+
}, [a, E, p]);
|
|
3591
|
+
Z(() => {
|
|
3590
3592
|
N === "server" && E.length >= v && E !== P.current && (P.current = E, y && y(E));
|
|
3591
3593
|
}, [E, N, v, y]);
|
|
3592
3594
|
const q = N === "client" ? Y : a, $ = () => {
|
|
3593
3595
|
if (!U.length)
|
|
3594
3596
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
|
|
3595
|
-
const
|
|
3597
|
+
const b = U.slice(0, u), S = U.length - u;
|
|
3596
3598
|
return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2", children: [
|
|
3597
|
-
|
|
3599
|
+
b.map((O) => /* @__PURE__ */ e(
|
|
3598
3600
|
"span",
|
|
3599
3601
|
{
|
|
3600
3602
|
className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
|
|
3601
|
-
children:
|
|
3603
|
+
children: p(O)
|
|
3602
3604
|
},
|
|
3603
3605
|
d(O)
|
|
3604
3606
|
)),
|
|
3605
|
-
|
|
3607
|
+
S > 0 && /* @__PURE__ */ n("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
|
|
3606
3608
|
"+",
|
|
3607
|
-
|
|
3609
|
+
S,
|
|
3608
3610
|
" more"
|
|
3609
3611
|
] })
|
|
3610
3612
|
] });
|
|
3611
3613
|
};
|
|
3612
|
-
return /* @__PURE__ */ e(
|
|
3613
|
-
const
|
|
3614
|
-
h !== -1 &&
|
|
3615
|
-
}, multiple: !0, by: "id", children: ({ open:
|
|
3614
|
+
return /* @__PURE__ */ e(K, { value: U, onChange: (b) => {
|
|
3615
|
+
const S = Array.from(new Set(b.map((O) => d(O))));
|
|
3616
|
+
h !== -1 && S.length > h || i(S);
|
|
3617
|
+
}, multiple: !0, by: "id", children: ({ open: b }) => /* @__PURE__ */ n("div", { children: [
|
|
3616
3618
|
/* @__PURE__ */ e(
|
|
3617
|
-
|
|
3619
|
+
K.Label,
|
|
3618
3620
|
{
|
|
3619
|
-
id:
|
|
3621
|
+
id: z,
|
|
3620
3622
|
className: "block text-sm font-medium leading-6 text-gray-900",
|
|
3621
3623
|
children: t
|
|
3622
3624
|
}
|
|
3623
3625
|
),
|
|
3624
3626
|
/* @__PURE__ */ n("div", { className: "relative mt-2", children: [
|
|
3625
3627
|
/* @__PURE__ */ n(
|
|
3626
|
-
|
|
3628
|
+
K.Button,
|
|
3627
3629
|
{
|
|
3628
|
-
"aria-labelledby":
|
|
3630
|
+
"aria-labelledby": z,
|
|
3629
3631
|
"aria-invalid": !!o,
|
|
3630
3632
|
"aria-describedby": o ? F : void 0,
|
|
3631
3633
|
onBlur: l,
|
|
@@ -3643,43 +3645,43 @@ function at({
|
|
|
3643
3645
|
he,
|
|
3644
3646
|
{
|
|
3645
3647
|
as: Q,
|
|
3646
|
-
show:
|
|
3648
|
+
show: b,
|
|
3647
3649
|
leave: "transition ease-in duration-100",
|
|
3648
3650
|
leaveFrom: "opacity-100",
|
|
3649
3651
|
leaveTo: "opacity-0",
|
|
3650
|
-
children: /* @__PURE__ */ n(
|
|
3652
|
+
children: /* @__PURE__ */ n(K.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
|
|
3651
3653
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3652
3654
|
ge,
|
|
3653
3655
|
{
|
|
3654
3656
|
value: E,
|
|
3655
|
-
onDebouncedChange:
|
|
3657
|
+
onDebouncedChange: I,
|
|
3656
3658
|
placeholder: N === "server" ? `Search (min ${v})…` : "Search options…"
|
|
3657
3659
|
}
|
|
3658
3660
|
) }),
|
|
3659
3661
|
N === "server" && r && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3660
|
-
q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: N === "server" ? E.length < v ? `Type at least ${v} characters to search.` : "No results." : "No options found." }) : q.map((
|
|
3661
|
-
const O = d(
|
|
3662
|
+
q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: N === "server" ? E.length < v ? `Type at least ${v} characters to search.` : "No results." : "No options found." }) : q.map((S) => {
|
|
3663
|
+
const O = d(S), R = p(S), D = U.some((g) => d(g) === O), f = h !== -1 && U.length >= h && !D;
|
|
3662
3664
|
return /* @__PURE__ */ e(
|
|
3663
|
-
|
|
3665
|
+
K.Option,
|
|
3664
3666
|
{
|
|
3665
|
-
value:
|
|
3666
|
-
disabled:
|
|
3667
|
-
className: ({ active:
|
|
3668
|
-
|
|
3667
|
+
value: S,
|
|
3668
|
+
disabled: f,
|
|
3669
|
+
className: ({ active: g }) => Ge(
|
|
3670
|
+
f ? " text-gray-400 bg-white cursor-not-allowed" : g ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3669
3671
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3670
3672
|
),
|
|
3671
|
-
children: ({ selected:
|
|
3673
|
+
children: ({ selected: g, active: w }) => /* @__PURE__ */ n(te, { children: [
|
|
3672
3674
|
/* @__PURE__ */ e(
|
|
3673
3675
|
"span",
|
|
3674
3676
|
{
|
|
3675
3677
|
className: Ge(
|
|
3676
|
-
|
|
3678
|
+
g ? "font-semibold" : "font-normal",
|
|
3677
3679
|
"block truncate"
|
|
3678
3680
|
),
|
|
3679
|
-
children:
|
|
3681
|
+
children: R
|
|
3680
3682
|
}
|
|
3681
3683
|
),
|
|
3682
|
-
|
|
3684
|
+
g && /* @__PURE__ */ e(
|
|
3683
3685
|
"span",
|
|
3684
3686
|
{
|
|
3685
3687
|
className: Ge(
|
|
@@ -3855,9 +3857,9 @@ function ms({
|
|
|
3855
3857
|
dropId: y,
|
|
3856
3858
|
indent: r = 24
|
|
3857
3859
|
}) {
|
|
3858
|
-
const { setNodeRef: v, isOver: d } = dr({ id: y }), { attributes:
|
|
3859
|
-
const
|
|
3860
|
-
U(!1),
|
|
3860
|
+
const { setNodeRef: v, isOver: d } = dr({ id: y }), { attributes: p, listeners: z, setNodeRef: F, transform: E, isDragging: I } = mr({ id: N }), P = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [j, U] = B(!1), [Y, q] = B(t.name), $ = () => {
|
|
3861
|
+
const b = Y.trim();
|
|
3862
|
+
U(!1), b && b !== t.name ? o?.(t, b) : q(t.name);
|
|
3861
3863
|
}, x = ae(() => /* @__PURE__ */ e(
|
|
3862
3864
|
Gn,
|
|
3863
3865
|
{
|
|
@@ -3866,8 +3868,8 @@ function ms({
|
|
|
3866
3868
|
{ action: "rename", label: "Rename" },
|
|
3867
3869
|
{ action: "delete", label: "Delete" }
|
|
3868
3870
|
],
|
|
3869
|
-
onSelect: (
|
|
3870
|
-
|
|
3871
|
+
onSelect: (S) => {
|
|
3872
|
+
S.action === "create" ? m?.(t) : S.action === "rename" ? U(!0) : S.action === "delete" && u?.(t);
|
|
3871
3873
|
}
|
|
3872
3874
|
}
|
|
3873
3875
|
), [t, m, u]);
|
|
@@ -3875,10 +3877,10 @@ function ms({
|
|
|
3875
3877
|
"div",
|
|
3876
3878
|
{
|
|
3877
3879
|
ref: v,
|
|
3878
|
-
className: `tv-row ${d ? "tv-drop-over" : ""} ${
|
|
3880
|
+
className: `tv-row ${d ? "tv-drop-over" : ""} ${I ? "dragging" : ""}`,
|
|
3879
3881
|
style: { ...P, paddingLeft: 8 + a * r },
|
|
3880
|
-
onClick: (
|
|
3881
|
-
|
|
3882
|
+
onClick: (b) => {
|
|
3883
|
+
b.target.closest(".tv-toggle") || b.target.tagName === "INPUT" || l?.(t);
|
|
3882
3884
|
},
|
|
3883
3885
|
children: [
|
|
3884
3886
|
/* @__PURE__ */ e("button", { className: "tv-toggle", onClick: i, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(Nt, { size: 16 }) : /* @__PURE__ */ e(xe, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
|
|
@@ -3888,15 +3890,15 @@ function ms({
|
|
|
3888
3890
|
{
|
|
3889
3891
|
className: "tv-input",
|
|
3890
3892
|
value: Y,
|
|
3891
|
-
onChange: (
|
|
3893
|
+
onChange: (b) => q(b.target.value),
|
|
3892
3894
|
onBlur: $,
|
|
3893
|
-
onKeyDown: (
|
|
3894
|
-
|
|
3895
|
+
onKeyDown: (b) => {
|
|
3896
|
+
b.key === "Enter" && $(), b.key === "Escape" && (U(!1), q(t.name));
|
|
3895
3897
|
},
|
|
3896
3898
|
autoFocus: !0
|
|
3897
3899
|
}
|
|
3898
3900
|
) : /* @__PURE__ */ e("span", { onDoubleClick: () => U(!0), children: t.name }) }),
|
|
3899
|
-
/* @__PURE__ */ e(ds, { listeners:
|
|
3901
|
+
/* @__PURE__ */ e(ds, { listeners: z, attributes: p }),
|
|
3900
3902
|
/* @__PURE__ */ e("div", { className: "tv-actions", children: h ? h(t, {
|
|
3901
3903
|
onCreateChild: () => m?.(t),
|
|
3902
3904
|
onRename: () => U(!0),
|
|
@@ -3995,40 +3997,40 @@ function Hl({
|
|
|
3995
3997
|
renderActions: v,
|
|
3996
3998
|
disableMoveToRoot: d = !1,
|
|
3997
3999
|
// ← allow root moves by default now
|
|
3998
|
-
indentUnit:
|
|
4000
|
+
indentUnit: p = 24
|
|
3999
4001
|
}) {
|
|
4000
|
-
const { roots:
|
|
4001
|
-
t.map((
|
|
4002
|
+
const { roots: z } = ae(() => gs(t) ? fs(t, { rootId: a, getId: i, getName: m }) : bs(
|
|
4003
|
+
t.map((f) => ({ ...f })),
|
|
4002
4004
|
{ rootId: a, getId: i, getParent: l, getName: m }
|
|
4003
|
-
), [t, a, i, l, m]), [F, E] = B({}),
|
|
4004
|
-
const
|
|
4005
|
+
), [t, a, i, l, m]), [F, E] = B({}), I = ee((f) => {
|
|
4006
|
+
const g = {};
|
|
4005
4007
|
return (function w(k) {
|
|
4006
4008
|
k.forEach((T) => {
|
|
4007
|
-
|
|
4009
|
+
g[T.id] = !0, T.children?.length && w(T.children);
|
|
4008
4010
|
});
|
|
4009
|
-
})(
|
|
4011
|
+
})(f), g;
|
|
4010
4012
|
}, []);
|
|
4011
4013
|
re.useEffect(() => {
|
|
4012
|
-
E(
|
|
4013
|
-
}, [
|
|
4014
|
-
const P =
|
|
4015
|
-
(
|
|
4014
|
+
E(I(z));
|
|
4015
|
+
}, [z, I]);
|
|
4016
|
+
const P = ee(
|
|
4017
|
+
(f) => E((g) => ({ ...g, [f]: !g[f] })),
|
|
4016
4018
|
[]
|
|
4017
|
-
), [j, U] = B(() => Me(
|
|
4018
|
-
re.useEffect(() => U(Me(
|
|
4019
|
+
), [j, U] = B(() => Me(z));
|
|
4020
|
+
re.useEffect(() => U(Me(z)), [z]);
|
|
4019
4021
|
const Y = ur(
|
|
4020
4022
|
hr(fr, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
4021
|
-
), q = fe(null), [$, x] = B(null),
|
|
4022
|
-
}, O = ({ delta:
|
|
4023
|
-
|
|
4024
|
-
},
|
|
4025
|
-
({ active:
|
|
4026
|
-
const w =
|
|
4027
|
-
if (
|
|
4028
|
-
const k = String(
|
|
4023
|
+
), q = fe(null), [$, x] = B(null), b = fe(0), S = () => {
|
|
4024
|
+
}, O = ({ delta: f }) => {
|
|
4025
|
+
b.current = f?.x ?? 0;
|
|
4026
|
+
}, R = ee(
|
|
4027
|
+
({ active: f, over: g }) => {
|
|
4028
|
+
const w = b.current;
|
|
4029
|
+
if (b.current = 0, x(null), !f || !g) return;
|
|
4030
|
+
const k = String(f.id).replace(/^drag-/, ""), T = String(g.id).replace(/^drop-/, "");
|
|
4029
4031
|
if (!k || !T || k === T) return;
|
|
4030
4032
|
let L = T;
|
|
4031
|
-
const C = Math.max(0, Math.floor(-w /
|
|
4033
|
+
const C = Math.max(0, Math.floor(-w / p));
|
|
4032
4034
|
if (C > 0) {
|
|
4033
4035
|
let W = T;
|
|
4034
4036
|
for (let pe = 0; pe < C; pe++) {
|
|
@@ -4042,7 +4044,7 @@ function Hl({
|
|
|
4042
4044
|
}
|
|
4043
4045
|
}
|
|
4044
4046
|
if (d && L === a) {
|
|
4045
|
-
U(Me(
|
|
4047
|
+
U(Me(z));
|
|
4046
4048
|
return;
|
|
4047
4049
|
}
|
|
4048
4050
|
const M = Me(j), { newRoots: _, removed: A } = ys(M, k);
|
|
@@ -4050,14 +4052,14 @@ function Hl({
|
|
|
4050
4052
|
const G = xs(_, L, A);
|
|
4051
4053
|
U(G), r?.({ sourceId: k, destParentId: L, newTree: G });
|
|
4052
4054
|
},
|
|
4053
|
-
[j,
|
|
4054
|
-
), D =
|
|
4055
|
-
(
|
|
4055
|
+
[j, z, a, d, p, r]
|
|
4056
|
+
), D = ee(
|
|
4057
|
+
(f, g = 0) => f.map((w) => /* @__PURE__ */ n(re.Fragment, { children: [
|
|
4056
4058
|
/* @__PURE__ */ e(
|
|
4057
4059
|
ms,
|
|
4058
4060
|
{
|
|
4059
4061
|
node: w,
|
|
4060
|
-
depth:
|
|
4062
|
+
depth: g,
|
|
4061
4063
|
expanded: !!F[w.id],
|
|
4062
4064
|
onToggle: () => P(w.id),
|
|
4063
4065
|
onSelect: o,
|
|
@@ -4067,25 +4069,25 @@ function Hl({
|
|
|
4067
4069
|
renderActions: v,
|
|
4068
4070
|
dragId: `drag-${w.id}`,
|
|
4069
4071
|
dropId: `drop-${w.id}`,
|
|
4070
|
-
indent:
|
|
4072
|
+
indent: p
|
|
4071
4073
|
}
|
|
4072
4074
|
),
|
|
4073
|
-
F[w.id] && w.children?.length > 0 ? D(w.children,
|
|
4075
|
+
F[w.id] && w.children?.length > 0 ? D(w.children, g + 1) : null
|
|
4074
4076
|
] }, w.id)),
|
|
4075
|
-
[F,
|
|
4077
|
+
[F, p, h, y, N, o, v, P]
|
|
4076
4078
|
);
|
|
4077
4079
|
return re.useMemo(() => {
|
|
4078
4080
|
if (!$) return null;
|
|
4079
|
-
const
|
|
4080
|
-
function
|
|
4081
|
+
const f = String($).replace(/^drag-/, "");
|
|
4082
|
+
function g(w) {
|
|
4081
4083
|
for (const k of w) {
|
|
4082
|
-
if (k.id ===
|
|
4083
|
-
const T = k.children?.length ?
|
|
4084
|
+
if (k.id === f) return k;
|
|
4085
|
+
const T = k.children?.length ? g(k.children) : null;
|
|
4084
4086
|
if (T) return T;
|
|
4085
4087
|
}
|
|
4086
4088
|
return null;
|
|
4087
4089
|
}
|
|
4088
|
-
return
|
|
4090
|
+
return g(j);
|
|
4089
4091
|
}, [$, j]), /* @__PURE__ */ n("div", { className: "tv", children: [
|
|
4090
4092
|
s !== !1 && /* @__PURE__ */ n("div", { className: "tv-header", children: [
|
|
4091
4093
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
@@ -4101,9 +4103,9 @@ function Hl({
|
|
|
4101
4103
|
{
|
|
4102
4104
|
collisionDetection: br,
|
|
4103
4105
|
sensors: Y,
|
|
4104
|
-
onDragStart:
|
|
4106
|
+
onDragStart: S,
|
|
4105
4107
|
onDragMove: O,
|
|
4106
|
-
onDragEnd:
|
|
4108
|
+
onDragEnd: R,
|
|
4107
4109
|
modifiers: [gr],
|
|
4108
4110
|
children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: D(j, 0) })
|
|
4109
4111
|
}
|
|
@@ -4136,7 +4138,7 @@ const Ql = ({
|
|
|
4136
4138
|
/* @__PURE__ */ e(se.Panels, { unmount: !a, className: ze("flex-1", m), children: t.map((v) => /* @__PURE__ */ e(se.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: v.content }) }, v.key)) })
|
|
4137
4139
|
] }) : (
|
|
4138
4140
|
// mostly this part is used : horizontal
|
|
4139
|
-
/* @__PURE__ */ n(
|
|
4141
|
+
/* @__PURE__ */ n(te, { children: [
|
|
4140
4142
|
/* @__PURE__ */ e(se.List, { className: ze("flex gap-6 border rounded-t-2xl px-1.5 border-gray-300 mb-3 ", l), children: t.map((v) => /* @__PURE__ */ e(se, { className: r, children: v.label }, v.key)) }),
|
|
4141
4143
|
/* @__PURE__ */ e(se.Panels, { unmount: !a, className: ze("mt-2", m), children: t.map((v) => /* @__PURE__ */ e(se.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: v.content }) }, v.key)) })
|
|
4142
4144
|
] })
|
|
@@ -4152,7 +4154,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4152
4154
|
const r = a && a[t.key] || {};
|
|
4153
4155
|
return console.log("Initial Section data for", t.key, r), r;
|
|
4154
4156
|
}), h = fe(a);
|
|
4155
|
-
|
|
4157
|
+
Z(() => {
|
|
4156
4158
|
if (h.current !== a) {
|
|
4157
4159
|
h.current = a;
|
|
4158
4160
|
const r = a && a[t.key] || {};
|
|
@@ -4160,29 +4162,29 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4160
4162
|
}
|
|
4161
4163
|
}, [a, t.key]), console.log("Section data", o);
|
|
4162
4164
|
const N = fe(o);
|
|
4163
|
-
|
|
4165
|
+
Z(() => {
|
|
4164
4166
|
N.current !== o && s && typeof s == "function" && (N.current = o, s(l.key, o));
|
|
4165
4167
|
}, [l.key, o, s]);
|
|
4166
4168
|
const y = (r) => {
|
|
4167
4169
|
if (!r.dependsOn) return !0;
|
|
4168
|
-
const { field: v, value: d, operator:
|
|
4169
|
-
switch (
|
|
4170
|
+
const { field: v, value: d, operator: p = "equals" } = r.dependsOn, z = o[v];
|
|
4171
|
+
switch (p) {
|
|
4170
4172
|
case "equals":
|
|
4171
|
-
return
|
|
4173
|
+
return z === d;
|
|
4172
4174
|
case "notEquals":
|
|
4173
|
-
return
|
|
4175
|
+
return z !== d;
|
|
4174
4176
|
case "contains":
|
|
4175
|
-
return Array.isArray(
|
|
4177
|
+
return Array.isArray(z) && z.includes(d);
|
|
4176
4178
|
case "notContains":
|
|
4177
|
-
return !Array.isArray(
|
|
4179
|
+
return !Array.isArray(z) || !z.includes(d);
|
|
4178
4180
|
case "greaterThan":
|
|
4179
|
-
return Number(
|
|
4181
|
+
return Number(z) > Number(d);
|
|
4180
4182
|
case "lessThan":
|
|
4181
|
-
return Number(
|
|
4183
|
+
return Number(z) < Number(d);
|
|
4182
4184
|
case "isEmpty":
|
|
4183
|
-
return !
|
|
4185
|
+
return !z || Array.isArray(z) && z.length === 0;
|
|
4184
4186
|
case "isNotEmpty":
|
|
4185
|
-
return
|
|
4187
|
+
return z && (!Array.isArray(z) || z.length > 0);
|
|
4186
4188
|
default:
|
|
4187
4189
|
return !0;
|
|
4188
4190
|
}
|
|
@@ -4208,8 +4210,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4208
4210
|
name: r.key,
|
|
4209
4211
|
checked: !!(o[r.key] || r.default),
|
|
4210
4212
|
onChange: (d) => {
|
|
4211
|
-
const
|
|
4212
|
-
u(
|
|
4213
|
+
const p = d.target ? d.target.checked : d, z = { ...o, [r.key]: p };
|
|
4214
|
+
u(z), s && s(l.key, z);
|
|
4213
4215
|
},
|
|
4214
4216
|
label: r.label,
|
|
4215
4217
|
disabled: r.disabled ? r.disabled : !1
|
|
@@ -4263,8 +4265,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4263
4265
|
placeholder: r.placeholder,
|
|
4264
4266
|
value: o[r.key] || "",
|
|
4265
4267
|
onChange: (d) => {
|
|
4266
|
-
const
|
|
4267
|
-
u(
|
|
4268
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4269
|
+
u(p), s && s(l.key, p);
|
|
4268
4270
|
},
|
|
4269
4271
|
required: r.required,
|
|
4270
4272
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4283,8 +4285,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4283
4285
|
placeholder: r.placeholder,
|
|
4284
4286
|
value: o[r.key] || "",
|
|
4285
4287
|
onChange: (d) => {
|
|
4286
|
-
const
|
|
4287
|
-
u(
|
|
4288
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4289
|
+
u(p), s && s(l.key, p);
|
|
4288
4290
|
},
|
|
4289
4291
|
rows: 3,
|
|
4290
4292
|
required: r.required,
|
|
@@ -4308,14 +4310,14 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4308
4310
|
max: r.max,
|
|
4309
4311
|
step: r.step,
|
|
4310
4312
|
onChange: (d) => {
|
|
4311
|
-
const
|
|
4312
|
-
u(
|
|
4313
|
+
const p = d.target.value, z = { ...o, [r.key]: p };
|
|
4314
|
+
u(z), s && s(l.key, z);
|
|
4313
4315
|
},
|
|
4314
4316
|
onBlur: (d) => {
|
|
4315
|
-
const
|
|
4316
|
-
if (
|
|
4317
|
-
const
|
|
4318
|
-
isNaN(
|
|
4317
|
+
const p = d.target.value;
|
|
4318
|
+
if (p !== "" && p !== null && p !== void 0) {
|
|
4319
|
+
const z = Number(p);
|
|
4320
|
+
isNaN(z) || (r.min !== void 0 && z < r.min ? (d.target.setCustomValidity(`${r.label} must be at least ${r.min}`), d.target.reportValidity()) : r.max !== void 0 && z > r.max ? (d.target.setCustomValidity(`${r.label} must not exceed ${r.max}`), d.target.reportValidity()) : d.target.setCustomValidity(""));
|
|
4319
4321
|
}
|
|
4320
4322
|
},
|
|
4321
4323
|
required: r.required,
|
|
@@ -4340,8 +4342,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4340
4342
|
name: r.key,
|
|
4341
4343
|
checked: !!(o[r.key] || r.default),
|
|
4342
4344
|
onChange: (d) => {
|
|
4343
|
-
const
|
|
4344
|
-
u(
|
|
4345
|
+
const p = d.target ? d.target.checked : d, z = { ...o, [r.key]: p };
|
|
4346
|
+
u(z), s && s(l.key, z);
|
|
4345
4347
|
},
|
|
4346
4348
|
label: r.placeholder || r.label,
|
|
4347
4349
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4358,8 +4360,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4358
4360
|
defaultValue: r.default,
|
|
4359
4361
|
value: o[r.key] || "",
|
|
4360
4362
|
onChange: (d) => {
|
|
4361
|
-
const
|
|
4362
|
-
u(
|
|
4363
|
+
const p = { ...o, [r.key]: d };
|
|
4364
|
+
u(p);
|
|
4363
4365
|
},
|
|
4364
4366
|
options: r.options || [],
|
|
4365
4367
|
placeholder: r.placeholder || `Select ${r.label}`,
|
|
@@ -4380,8 +4382,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4380
4382
|
placeholder: r.placeholder || "Enter email address",
|
|
4381
4383
|
value: o[r.key] || "",
|
|
4382
4384
|
onChange: (d) => {
|
|
4383
|
-
const
|
|
4384
|
-
u(
|
|
4385
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4386
|
+
u(p), s && s(l.key, p);
|
|
4385
4387
|
},
|
|
4386
4388
|
required: r.required,
|
|
4387
4389
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4400,8 +4402,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4400
4402
|
placeholder: r.placeholder || "Enter URL",
|
|
4401
4403
|
value: o[r.key] || "",
|
|
4402
4404
|
onChange: (d) => {
|
|
4403
|
-
const
|
|
4404
|
-
u(
|
|
4405
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4406
|
+
u(p), s && s(l.key, p);
|
|
4405
4407
|
},
|
|
4406
4408
|
required: r.required,
|
|
4407
4409
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4420,8 +4422,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4420
4422
|
placeholder: r.placeholder || "Enter password",
|
|
4421
4423
|
value: o[r.key] || "",
|
|
4422
4424
|
onChange: (d) => {
|
|
4423
|
-
const
|
|
4424
|
-
u(
|
|
4425
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4426
|
+
u(p), s && s(l.key, p);
|
|
4425
4427
|
},
|
|
4426
4428
|
required: r.required,
|
|
4427
4429
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4436,8 +4438,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4436
4438
|
{
|
|
4437
4439
|
selectedItems: o[r.key] || [],
|
|
4438
4440
|
onSelectionChange: (d) => {
|
|
4439
|
-
const
|
|
4440
|
-
u(
|
|
4441
|
+
const p = { ...o, [r.key]: d };
|
|
4442
|
+
u(p), s && s(l.key, p);
|
|
4441
4443
|
},
|
|
4442
4444
|
options: r.options || [],
|
|
4443
4445
|
placeholder: r.placeholder || `Select ${r.label}`,
|
|
@@ -4454,8 +4456,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4454
4456
|
checked: typeof o[r.key] == "boolean" ? o[r.key] : r.default,
|
|
4455
4457
|
onChange: (d) => {
|
|
4456
4458
|
console.log("Toggle changed:", r.key, d);
|
|
4457
|
-
const
|
|
4458
|
-
u(
|
|
4459
|
+
const p = { ...o, [r.key]: d };
|
|
4460
|
+
u(p), s && s(l.key, p);
|
|
4459
4461
|
},
|
|
4460
4462
|
disabled: r.disabled ? r.disabled : !1
|
|
4461
4463
|
}
|
|
@@ -4468,8 +4470,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4468
4470
|
label: r.label,
|
|
4469
4471
|
value: o[r.key] ? new Date(o[r.key]) : null,
|
|
4470
4472
|
onChange: (d) => {
|
|
4471
|
-
const
|
|
4472
|
-
u(
|
|
4473
|
+
const p = { ...o, [r.key]: d ? d.toISOString().split("T")[0] : "" };
|
|
4474
|
+
u(p), s && s(l.key, p);
|
|
4473
4475
|
},
|
|
4474
4476
|
placeholder: r.placeholder || "Select date",
|
|
4475
4477
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4483,8 +4485,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4483
4485
|
label: r.label,
|
|
4484
4486
|
value: o[r.key] || { from: null, to: null },
|
|
4485
4487
|
onChange: (d) => {
|
|
4486
|
-
const
|
|
4487
|
-
u(
|
|
4488
|
+
const p = { ...o, [r.key]: d };
|
|
4489
|
+
u(p), s && s(l.key, p);
|
|
4488
4490
|
},
|
|
4489
4491
|
placeholder: r.placeholder || "Select date range",
|
|
4490
4492
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4498,8 +4500,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4498
4500
|
{
|
|
4499
4501
|
selectedValue: typeof o[r.key] < "u" ? o[r.key] : r.default || "",
|
|
4500
4502
|
onValueChange: (d) => {
|
|
4501
|
-
const
|
|
4502
|
-
u(
|
|
4503
|
+
const p = { ...o, [r.key]: d };
|
|
4504
|
+
u(p), s && s(l.key, p);
|
|
4503
4505
|
},
|
|
4504
4506
|
options: r.options || [],
|
|
4505
4507
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4518,9 +4520,9 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4518
4520
|
name: r.key,
|
|
4519
4521
|
value: d.value,
|
|
4520
4522
|
checked: o[r.key] === d.value,
|
|
4521
|
-
onChange: (
|
|
4522
|
-
const
|
|
4523
|
-
u(
|
|
4523
|
+
onChange: (p) => {
|
|
4524
|
+
const z = { ...o, [r.key]: p.target.value };
|
|
4525
|
+
u(z), s && s(l.key, z);
|
|
4524
4526
|
},
|
|
4525
4527
|
disabled: r.disabled
|
|
4526
4528
|
}
|
|
@@ -4538,8 +4540,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4538
4540
|
{
|
|
4539
4541
|
value: o[r.key] || "",
|
|
4540
4542
|
onChange: (d) => {
|
|
4541
|
-
const
|
|
4542
|
-
u(
|
|
4543
|
+
const p = { ...o, [r.key]: d };
|
|
4544
|
+
u(p), s && s(l.key, p);
|
|
4543
4545
|
},
|
|
4544
4546
|
placeholder: r.placeholder || `Search ${r.label}`,
|
|
4545
4547
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4557,8 +4559,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4557
4559
|
placeholder: r.placeholder || "Select date and time",
|
|
4558
4560
|
value: o[r.key] || "",
|
|
4559
4561
|
onChange: (d) => {
|
|
4560
|
-
const
|
|
4561
|
-
u(
|
|
4562
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4563
|
+
u(p), s && s(l.key, p);
|
|
4562
4564
|
},
|
|
4563
4565
|
required: r.required,
|
|
4564
4566
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4576,8 +4578,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4576
4578
|
placeholder: r.placeholder || "Select time",
|
|
4577
4579
|
value: o[r.key] || "",
|
|
4578
4580
|
onChange: (d) => {
|
|
4579
|
-
const
|
|
4580
|
-
u(
|
|
4581
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4582
|
+
u(p), s && s(l.key, p);
|
|
4581
4583
|
},
|
|
4582
4584
|
required: r.required,
|
|
4583
4585
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4594,8 +4596,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4594
4596
|
defaultValue: r.default || "#000000",
|
|
4595
4597
|
value: o[r.key] || "#000000",
|
|
4596
4598
|
onChange: (d) => {
|
|
4597
|
-
const
|
|
4598
|
-
u(
|
|
4599
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4600
|
+
u(p), s && s(l.key, p);
|
|
4599
4601
|
},
|
|
4600
4602
|
className: `w-full h-10 ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
4601
4603
|
}
|
|
@@ -4611,8 +4613,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4611
4613
|
defaultValue: r.default || r.min || 0,
|
|
4612
4614
|
value: o[r.key] || r.min || 0,
|
|
4613
4615
|
onChange: (d) => {
|
|
4614
|
-
const
|
|
4615
|
-
u(
|
|
4616
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4617
|
+
u(p), s && s(l.key, p);
|
|
4616
4618
|
},
|
|
4617
4619
|
min: r.min || 0,
|
|
4618
4620
|
max: r.max || 100,
|
|
@@ -4637,8 +4639,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4637
4639
|
type: "file",
|
|
4638
4640
|
name: r.key,
|
|
4639
4641
|
onChange: (d) => {
|
|
4640
|
-
const
|
|
4641
|
-
u(
|
|
4642
|
+
const p = d.target.files[0], z = { ...o, [r.key]: p ? p.name : "" };
|
|
4643
|
+
u(z), s && s(l.key, z);
|
|
4642
4644
|
},
|
|
4643
4645
|
accept: r.accept,
|
|
4644
4646
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4654,8 +4656,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4654
4656
|
initialData: o[r.key] || r.initialData || [],
|
|
4655
4657
|
className: r.className || "",
|
|
4656
4658
|
onCollectionChange: (d) => {
|
|
4657
|
-
const
|
|
4658
|
-
u(
|
|
4659
|
+
const p = { ...o, [r.key]: d };
|
|
4660
|
+
u(p), s && s(l.key, p);
|
|
4659
4661
|
},
|
|
4660
4662
|
showSearch: r.showSearch !== !1,
|
|
4661
4663
|
allowAdd: r.allowAdd !== !1,
|
|
@@ -4686,85 +4688,85 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4686
4688
|
const [l, m] = B(t), [o, u] = B(null), [h, N] = B(null);
|
|
4687
4689
|
console.log(`[DataTableRenderer] ${l.key} - Received props:`, { item: t, initialData: a });
|
|
4688
4690
|
const [y, r] = B(() => {
|
|
4689
|
-
const x = a && a[l.key] || [],
|
|
4690
|
-
return console.log(`[DataTableRenderer] ${l.key} - Initial data:`,
|
|
4691
|
+
const x = a && a[l.key] || [], b = x.length > 0 ? x : [{ id: 0 }];
|
|
4692
|
+
return console.log(`[DataTableRenderer] ${l.key} - Initial data:`, b), b;
|
|
4691
4693
|
}), v = fe(a);
|
|
4692
|
-
|
|
4694
|
+
Z(() => {
|
|
4693
4695
|
if (console.log(`[DataTableRenderer] ${l.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${l.key} - Previous:`, v.current), console.log(`[DataTableRenderer] ${l.key} - Current:`, a), v.current !== a) {
|
|
4694
4696
|
v.current = a;
|
|
4695
|
-
const x = a && a[l.key] || [],
|
|
4696
|
-
console.log(`[DataTableRenderer] ${l.key} - Setting new data:`,
|
|
4697
|
+
const x = a && a[l.key] || [], b = x.length > 0 ? x : [{ id: 0 }];
|
|
4698
|
+
console.log(`[DataTableRenderer] ${l.key} - Setting new data:`, b), r(b);
|
|
4697
4699
|
}
|
|
4698
4700
|
}, [a, l.key]);
|
|
4699
|
-
const d = fe(y),
|
|
4700
|
-
|
|
4701
|
-
d.current !== y && s && typeof s == "function" && (d.current = y,
|
|
4701
|
+
const d = fe(y), p = fe(null);
|
|
4702
|
+
Z(() => {
|
|
4703
|
+
d.current !== y && s && typeof s == "function" && (d.current = y, p.current && clearTimeout(p.current), p.current = setTimeout(() => {
|
|
4702
4704
|
s(l.key, y);
|
|
4703
4705
|
}, 300));
|
|
4704
|
-
}, [l.key, y, s]),
|
|
4705
|
-
|
|
4706
|
+
}, [l.key, y, s]), Z(() => () => {
|
|
4707
|
+
p.current && clearTimeout(p.current);
|
|
4706
4708
|
}, []);
|
|
4707
|
-
const
|
|
4708
|
-
const
|
|
4709
|
-
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex:
|
|
4710
|
-
const
|
|
4711
|
-
return
|
|
4709
|
+
const z = (x) => {
|
|
4710
|
+
const b = (R, D) => {
|
|
4711
|
+
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: R, value: D, type: typeof D }), r((f) => {
|
|
4712
|
+
const g = [...f];
|
|
4713
|
+
return g[R][x.key] = D, g;
|
|
4712
4714
|
});
|
|
4713
|
-
},
|
|
4714
|
-
const D =
|
|
4715
|
+
}, S = (R) => i[l.key]?.[R]?.[x.key], O = (R) => {
|
|
4716
|
+
const D = S(R);
|
|
4715
4717
|
return D ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: D }) : null;
|
|
4716
4718
|
};
|
|
4717
4719
|
switch (x.fieldtype) {
|
|
4718
4720
|
case "text":
|
|
4719
|
-
return (
|
|
4721
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4720
4722
|
/* @__PURE__ */ e(
|
|
4721
4723
|
X,
|
|
4722
4724
|
{
|
|
4723
|
-
value:
|
|
4724
|
-
onChange: (
|
|
4725
|
+
value: R[x.key] || "",
|
|
4726
|
+
onChange: (f) => b(D, f.target.value),
|
|
4725
4727
|
placeholder: x.placeholder || `Enter ${x.label}`,
|
|
4726
4728
|
required: x.required,
|
|
4727
|
-
className: `w-full ${
|
|
4729
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4728
4730
|
}
|
|
4729
4731
|
),
|
|
4730
4732
|
O(D)
|
|
4731
4733
|
] });
|
|
4732
4734
|
case "textarea":
|
|
4733
|
-
return (
|
|
4735
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4734
4736
|
/* @__PURE__ */ e(
|
|
4735
4737
|
fa,
|
|
4736
4738
|
{
|
|
4737
|
-
value:
|
|
4738
|
-
onChange: (
|
|
4739
|
+
value: R[x.key] || "",
|
|
4740
|
+
onChange: (f) => b(D, f.target.value),
|
|
4739
4741
|
placeholder: x.placeholder || `Enter ${x.label}`,
|
|
4740
4742
|
required: x.required,
|
|
4741
|
-
className: `w-full ${
|
|
4743
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`,
|
|
4742
4744
|
rows: 3
|
|
4743
4745
|
}
|
|
4744
4746
|
),
|
|
4745
4747
|
O(D)
|
|
4746
4748
|
] });
|
|
4747
4749
|
case "number":
|
|
4748
|
-
return (
|
|
4750
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4749
4751
|
/* @__PURE__ */ e(
|
|
4750
4752
|
X,
|
|
4751
4753
|
{
|
|
4752
4754
|
type: "number",
|
|
4753
|
-
value:
|
|
4755
|
+
value: R[x.key] || "",
|
|
4754
4756
|
min: x.min,
|
|
4755
4757
|
max: x.max,
|
|
4756
4758
|
step: x.step,
|
|
4757
|
-
onChange: (
|
|
4758
|
-
onBlur: (
|
|
4759
|
-
const
|
|
4760
|
-
if (
|
|
4761
|
-
const w = Number(
|
|
4762
|
-
isNaN(w) || (x.min !== void 0 && w < x.min ? (
|
|
4759
|
+
onChange: (f) => b(D, f.target.value),
|
|
4760
|
+
onBlur: (f) => {
|
|
4761
|
+
const g = f.target.value;
|
|
4762
|
+
if (g !== "" && g !== null && g !== void 0) {
|
|
4763
|
+
const w = Number(g);
|
|
4764
|
+
isNaN(w) || (x.min !== void 0 && w < x.min ? (f.target.setCustomValidity(`${x.label} must be at least ${x.min}`), f.target.reportValidity()) : x.max !== void 0 && w > x.max ? (f.target.setCustomValidity(`${x.label} must not exceed ${x.max}`), f.target.reportValidity()) : f.target.setCustomValidity(""));
|
|
4763
4765
|
}
|
|
4764
4766
|
},
|
|
4765
4767
|
placeholder: x.placeholder || `Enter ${x.label}`,
|
|
4766
4768
|
required: x.required,
|
|
4767
|
-
className: `w-full ${
|
|
4769
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4768
4770
|
}
|
|
4769
4771
|
),
|
|
4770
4772
|
x.min !== void 0 && /* @__PURE__ */ n("div", { style: { color: "#6b7280", fontSize: "11px", marginTop: "2px" }, children: [
|
|
@@ -4778,71 +4780,71 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4778
4780
|
O(D)
|
|
4779
4781
|
] });
|
|
4780
4782
|
case "email":
|
|
4781
|
-
return (
|
|
4783
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4782
4784
|
/* @__PURE__ */ e(
|
|
4783
4785
|
X,
|
|
4784
4786
|
{
|
|
4785
4787
|
type: "email",
|
|
4786
|
-
value:
|
|
4787
|
-
onChange: (
|
|
4788
|
+
value: R[x.key] || "",
|
|
4789
|
+
onChange: (f) => b(D, f.target.value),
|
|
4788
4790
|
placeholder: x.placeholder || "Enter email address",
|
|
4789
4791
|
required: x.required,
|
|
4790
|
-
className: `w-full ${
|
|
4792
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4791
4793
|
}
|
|
4792
4794
|
),
|
|
4793
4795
|
O(D)
|
|
4794
4796
|
] });
|
|
4795
4797
|
case "url":
|
|
4796
|
-
return (
|
|
4798
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4797
4799
|
/* @__PURE__ */ e(
|
|
4798
4800
|
X,
|
|
4799
4801
|
{
|
|
4800
4802
|
type: "url",
|
|
4801
|
-
value:
|
|
4802
|
-
onChange: (
|
|
4803
|
+
value: R[x.key] || "",
|
|
4804
|
+
onChange: (f) => b(D, f.target.value),
|
|
4803
4805
|
placeholder: x.placeholder || "Enter URL",
|
|
4804
4806
|
required: x.required,
|
|
4805
|
-
className: `w-full ${
|
|
4807
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4806
4808
|
}
|
|
4807
4809
|
),
|
|
4808
4810
|
O(D)
|
|
4809
4811
|
] });
|
|
4810
4812
|
case "password":
|
|
4811
|
-
return (
|
|
4813
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4812
4814
|
/* @__PURE__ */ e(
|
|
4813
4815
|
X,
|
|
4814
4816
|
{
|
|
4815
4817
|
type: "password",
|
|
4816
|
-
value:
|
|
4817
|
-
onChange: (
|
|
4818
|
+
value: R[x.key] || "",
|
|
4819
|
+
onChange: (f) => b(D, f.target.value),
|
|
4818
4820
|
placeholder: x.placeholder || "Enter password",
|
|
4819
4821
|
required: x.required,
|
|
4820
|
-
className: `w-full ${
|
|
4822
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4821
4823
|
}
|
|
4822
4824
|
),
|
|
4823
4825
|
O(D)
|
|
4824
4826
|
] });
|
|
4825
4827
|
case "select":
|
|
4826
4828
|
case "dropdown":
|
|
4827
|
-
return (
|
|
4829
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4828
4830
|
/* @__PURE__ */ e(
|
|
4829
4831
|
ft,
|
|
4830
4832
|
{
|
|
4831
|
-
value:
|
|
4832
|
-
onChange: (
|
|
4833
|
+
value: R[x.key] || "",
|
|
4834
|
+
onChange: (f) => b(D, f),
|
|
4833
4835
|
options: x.options || [],
|
|
4834
4836
|
placeholder: x.placeholder || `Select ${x.label}`,
|
|
4835
4837
|
required: x.required,
|
|
4836
|
-
className: `w-full ${
|
|
4838
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4837
4839
|
}
|
|
4838
4840
|
),
|
|
4839
4841
|
O(D)
|
|
4840
4842
|
] });
|
|
4841
4843
|
case "selectDynamic":
|
|
4842
|
-
return (
|
|
4843
|
-
const
|
|
4844
|
+
return (R, D) => {
|
|
4845
|
+
const f = () => {
|
|
4844
4846
|
if (x.optionsFrom && a) {
|
|
4845
|
-
const { config:
|
|
4847
|
+
const { config: g, valueField: w, labelField: k } = x.optionsFrom, T = a[g] || [];
|
|
4846
4848
|
if (Array.isArray(T))
|
|
4847
4849
|
return T.map((L) => ({
|
|
4848
4850
|
id: L[w] || "",
|
|
@@ -4857,12 +4859,12 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4857
4859
|
ft,
|
|
4858
4860
|
{
|
|
4859
4861
|
index: D,
|
|
4860
|
-
value:
|
|
4861
|
-
onChange: (
|
|
4862
|
-
options:
|
|
4862
|
+
value: R[x.key] || "",
|
|
4863
|
+
onChange: (g) => b(D, g),
|
|
4864
|
+
options: f(),
|
|
4863
4865
|
placeholder: x.placeholder || `Select ${x.label}`,
|
|
4864
4866
|
required: x.required,
|
|
4865
|
-
className: `w-full ${
|
|
4867
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4866
4868
|
},
|
|
4867
4869
|
Math.random()
|
|
4868
4870
|
),
|
|
@@ -4870,13 +4872,13 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4870
4872
|
] });
|
|
4871
4873
|
};
|
|
4872
4874
|
case "multiselect":
|
|
4873
|
-
return (
|
|
4874
|
-
const
|
|
4875
|
+
return (R, D) => {
|
|
4876
|
+
const f = R[x.key] || [];
|
|
4875
4877
|
return /* @__PURE__ */ e(
|
|
4876
4878
|
at,
|
|
4877
4879
|
{
|
|
4878
|
-
selectedItems:
|
|
4879
|
-
onSelectionChange: (
|
|
4880
|
+
selectedItems: f,
|
|
4881
|
+
onSelectionChange: (g) => b(D, g),
|
|
4880
4882
|
options: x.options || [],
|
|
4881
4883
|
placeholder: x.placeholder || `Select ${x.label}`,
|
|
4882
4884
|
className: "w-full"
|
|
@@ -4885,89 +4887,89 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4885
4887
|
};
|
|
4886
4888
|
case "checkbox":
|
|
4887
4889
|
case "boolean":
|
|
4888
|
-
return (
|
|
4890
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4889
4891
|
pt,
|
|
4890
4892
|
{
|
|
4891
|
-
checked: !!
|
|
4892
|
-
onChange: (
|
|
4893
|
+
checked: !!R[x.key],
|
|
4894
|
+
onChange: (f) => b(D, f),
|
|
4893
4895
|
label: x.placeholder || x.label,
|
|
4894
4896
|
className: "w-full"
|
|
4895
4897
|
}
|
|
4896
4898
|
);
|
|
4897
4899
|
case "toggle":
|
|
4898
4900
|
case "switch":
|
|
4899
|
-
return (
|
|
4901
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4900
4902
|
ya,
|
|
4901
4903
|
{
|
|
4902
|
-
isOn: !!
|
|
4903
|
-
onToggle: (
|
|
4904
|
+
isOn: !!R[x.key],
|
|
4905
|
+
onToggle: (f) => b(D, f),
|
|
4904
4906
|
label: x.placeholder || x.label,
|
|
4905
4907
|
className: "w-full"
|
|
4906
4908
|
}
|
|
4907
4909
|
);
|
|
4908
4910
|
case "date":
|
|
4909
|
-
return (
|
|
4911
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4910
4912
|
ha,
|
|
4911
4913
|
{
|
|
4912
|
-
selectedDate:
|
|
4913
|
-
onDateChange: (
|
|
4914
|
+
selectedDate: R[x.key] ? new Date(R[x.key]) : null,
|
|
4915
|
+
onDateChange: (f) => b(D, f ? f.toISOString().split("T")[0] : ""),
|
|
4914
4916
|
placeholder: x.placeholder || "Select date",
|
|
4915
4917
|
className: "w-full"
|
|
4916
4918
|
}
|
|
4917
4919
|
);
|
|
4918
4920
|
case "datetime":
|
|
4919
|
-
return (
|
|
4921
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4920
4922
|
X,
|
|
4921
4923
|
{
|
|
4922
4924
|
type: "datetime-local",
|
|
4923
|
-
value:
|
|
4924
|
-
onChange: (
|
|
4925
|
+
value: R[x.key] || "",
|
|
4926
|
+
onChange: (f) => b(D, f.target.value),
|
|
4925
4927
|
placeholder: x.placeholder || "Select date and time",
|
|
4926
4928
|
required: x.required,
|
|
4927
4929
|
className: "w-full"
|
|
4928
4930
|
}
|
|
4929
4931
|
);
|
|
4930
4932
|
case "time":
|
|
4931
|
-
return (
|
|
4933
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4932
4934
|
X,
|
|
4933
4935
|
{
|
|
4934
4936
|
type: "time",
|
|
4935
|
-
value:
|
|
4936
|
-
onChange: (
|
|
4937
|
+
value: R[x.key] || "",
|
|
4938
|
+
onChange: (f) => b(D, f.target.value),
|
|
4937
4939
|
placeholder: x.placeholder || "Select time",
|
|
4938
4940
|
required: x.required,
|
|
4939
4941
|
className: "w-full"
|
|
4940
4942
|
}
|
|
4941
4943
|
);
|
|
4942
4944
|
case "radio":
|
|
4943
|
-
return (
|
|
4945
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4944
4946
|
pa,
|
|
4945
4947
|
{
|
|
4946
|
-
selectedValue:
|
|
4947
|
-
onValueChange: (
|
|
4948
|
+
selectedValue: R[x.key] || "",
|
|
4949
|
+
onValueChange: (f) => b(D, f),
|
|
4948
4950
|
options: x.options || [],
|
|
4949
4951
|
className: "w-full"
|
|
4950
4952
|
}
|
|
4951
4953
|
);
|
|
4952
4954
|
case "search":
|
|
4953
|
-
return (
|
|
4955
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4954
4956
|
ge,
|
|
4955
4957
|
{
|
|
4956
|
-
value:
|
|
4957
|
-
onChange: (
|
|
4958
|
+
value: R[x.key] || "",
|
|
4959
|
+
onChange: (f) => b(D, f),
|
|
4958
4960
|
placeholder: x.placeholder || `Search ${x.label}`,
|
|
4959
4961
|
className: "w-full"
|
|
4960
4962
|
}
|
|
4961
4963
|
);
|
|
4962
4964
|
case "audience":
|
|
4963
|
-
return (
|
|
4964
|
-
const
|
|
4965
|
-
...
|
|
4966
|
-
...
|
|
4967
|
-
...
|
|
4965
|
+
return (R, D) => {
|
|
4966
|
+
const f = R[x.key] || { users: [], groups: [], roles: [] }, g = [
|
|
4967
|
+
...f.users || [],
|
|
4968
|
+
...f.groups || [],
|
|
4969
|
+
...f.roles || []
|
|
4968
4970
|
];
|
|
4969
4971
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
4970
|
-
/* @__PURE__ */ e(Ns, { children:
|
|
4972
|
+
/* @__PURE__ */ e(Ns, { children: g.length > 0 ? g.slice(0, 3).map((w, k) => /* @__PURE__ */ e(
|
|
4971
4973
|
we,
|
|
4972
4974
|
{
|
|
4973
4975
|
size: "small",
|
|
@@ -4983,119 +4985,127 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4983
4985
|
onClick: () => {
|
|
4984
4986
|
N(x.key), u(D);
|
|
4985
4987
|
},
|
|
4986
|
-
children:
|
|
4988
|
+
children: g.length > 0 ? "Edit" : "Assign"
|
|
4987
4989
|
}
|
|
4988
4990
|
)
|
|
4989
4991
|
] });
|
|
4990
4992
|
};
|
|
4991
4993
|
case "color":
|
|
4992
|
-
return (
|
|
4994
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4993
4995
|
X,
|
|
4994
4996
|
{
|
|
4995
4997
|
type: "color",
|
|
4996
|
-
value:
|
|
4997
|
-
onChange: (
|
|
4998
|
+
value: R[x.key] || "#000000",
|
|
4999
|
+
onChange: (f) => b(D, f.target.value),
|
|
4998
5000
|
className: "w-full h-10"
|
|
4999
5001
|
}
|
|
5000
5002
|
);
|
|
5001
5003
|
case "range":
|
|
5002
|
-
return (
|
|
5004
|
+
return (R, D) => /* @__PURE__ */ n("div", { className: "w-full", children: [
|
|
5003
5005
|
/* @__PURE__ */ e(
|
|
5004
5006
|
X,
|
|
5005
5007
|
{
|
|
5006
5008
|
type: "range",
|
|
5007
|
-
value:
|
|
5008
|
-
onChange: (
|
|
5009
|
+
value: R[x.key] || x.min || 0,
|
|
5010
|
+
onChange: (f) => b(D, f.target.value),
|
|
5009
5011
|
min: x.min || 0,
|
|
5010
5012
|
max: x.max || 100,
|
|
5011
5013
|
step: x.step || 1,
|
|
5012
5014
|
className: "w-full"
|
|
5013
5015
|
}
|
|
5014
5016
|
),
|
|
5015
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children:
|
|
5017
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: R[x.key] || x.min || 0 })
|
|
5016
5018
|
] });
|
|
5017
5019
|
case "file":
|
|
5018
|
-
return (
|
|
5020
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
5019
5021
|
X,
|
|
5020
5022
|
{
|
|
5021
5023
|
type: "file",
|
|
5022
|
-
onChange: (
|
|
5023
|
-
const
|
|
5024
|
-
|
|
5024
|
+
onChange: (f) => {
|
|
5025
|
+
const g = f.target.files[0];
|
|
5026
|
+
b(D, g ? g.name : "");
|
|
5025
5027
|
},
|
|
5026
5028
|
accept: x.accept,
|
|
5027
5029
|
className: "w-full"
|
|
5028
5030
|
}
|
|
5029
5031
|
);
|
|
5030
5032
|
case "hidden":
|
|
5031
|
-
return (
|
|
5033
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
5032
5034
|
X,
|
|
5033
5035
|
{
|
|
5034
5036
|
type: "hidden",
|
|
5035
|
-
value:
|
|
5036
|
-
onChange: (
|
|
5037
|
+
value: R[x.key] || "",
|
|
5038
|
+
onChange: (f) => b(D, f.target.value)
|
|
5037
5039
|
}
|
|
5038
5040
|
);
|
|
5039
5041
|
// Default fallback for unknown field types
|
|
5040
5042
|
default:
|
|
5041
|
-
return (
|
|
5043
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
5042
5044
|
/* @__PURE__ */ e(
|
|
5043
5045
|
X,
|
|
5044
5046
|
{
|
|
5045
|
-
value:
|
|
5046
|
-
onChange: (
|
|
5047
|
+
value: R[x.key] || "",
|
|
5048
|
+
onChange: (f) => b(D, f.target.value),
|
|
5047
5049
|
placeholder: x.placeholder || `Enter ${x.label}`,
|
|
5048
5050
|
required: x.required,
|
|
5049
|
-
className: `w-full ${
|
|
5051
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
5050
5052
|
}
|
|
5051
5053
|
),
|
|
5052
5054
|
O(D)
|
|
5053
5055
|
] });
|
|
5054
5056
|
}
|
|
5055
|
-
}, F =
|
|
5057
|
+
}, F = ee(() => {
|
|
5056
5058
|
console.log("[DataTableRenderer] Adding blank row"), r((x) => {
|
|
5057
5059
|
console.log("[DataTableRenderer] Current data before add:", x);
|
|
5058
|
-
const
|
|
5060
|
+
const b = {
|
|
5059
5061
|
id: x.length
|
|
5060
5062
|
// Assign next available ID
|
|
5061
5063
|
};
|
|
5062
5064
|
l.fields.forEach((O) => {
|
|
5063
|
-
O.fieldtype === "audience" ?
|
|
5064
|
-
}), console.log("[DataTableRenderer] New blank row:",
|
|
5065
|
-
const
|
|
5066
|
-
return console.log("[DataTableRenderer] Updated data:",
|
|
5065
|
+
O.fieldtype === "audience" ? b[O.key] = { users: [], groups: [], roles: [] } : b[O.key] = O.default || "";
|
|
5066
|
+
}), console.log("[DataTableRenderer] New blank row:", b);
|
|
5067
|
+
const S = [...x, b];
|
|
5068
|
+
return console.log("[DataTableRenderer] Updated data:", S), S;
|
|
5067
5069
|
});
|
|
5068
|
-
}, [l.fields]), E =
|
|
5069
|
-
r((
|
|
5070
|
-
if (
|
|
5071
|
-
return
|
|
5072
|
-
const
|
|
5073
|
-
return
|
|
5070
|
+
}, [l.fields]), E = ee((x) => {
|
|
5071
|
+
r((b) => {
|
|
5072
|
+
if (b.length <= 1)
|
|
5073
|
+
return b;
|
|
5074
|
+
const S = [...b];
|
|
5075
|
+
return S.splice(x, 1), S;
|
|
5074
5076
|
});
|
|
5075
|
-
}, []), [
|
|
5076
|
-
P(
|
|
5077
|
-
}, []), U =
|
|
5077
|
+
}, []), [I, P] = B(null), j = ee((x, b) => {
|
|
5078
|
+
P(b), x.dataTransfer.effectAllowed = "move", x.dataTransfer.setData("text/html", "");
|
|
5079
|
+
}, []), U = ee((x) => {
|
|
5078
5080
|
x.preventDefault(), x.dataTransfer.dropEffect = "move";
|
|
5079
|
-
}, []), Y =
|
|
5080
|
-
x.preventDefault(), !(
|
|
5081
|
-
const O = [...
|
|
5082
|
-
return O.splice(
|
|
5081
|
+
}, []), Y = ee((x, b) => {
|
|
5082
|
+
x.preventDefault(), !(I === null || I === b) && (r((S) => {
|
|
5083
|
+
const O = [...S], R = O[I];
|
|
5084
|
+
return O.splice(I, 1), O.splice(b, 0, R), O;
|
|
5083
5085
|
}), P(null));
|
|
5084
|
-
}, [
|
|
5086
|
+
}, [I]), q = ee(() => {
|
|
5085
5087
|
P(null);
|
|
5086
|
-
}, []), $ =
|
|
5087
|
-
console.log("[DataTableRenderer] handleAddAudience called with:", x), r((
|
|
5088
|
-
const
|
|
5089
|
-
if (o !== null && h &&
|
|
5090
|
-
const
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5088
|
+
}, []), $ = ee((x, b) => {
|
|
5089
|
+
console.log("[DataTableRenderer] handleAddAudience called with:", { selectedEntities: x, existingShares: b }), r((S) => {
|
|
5090
|
+
const O = [...S];
|
|
5091
|
+
if (o !== null && h && O[o]) {
|
|
5092
|
+
const R = x.pendingInvites || [];
|
|
5093
|
+
if (R.length > 0) {
|
|
5094
|
+
const D = R.filter((w) => w.type === "User"), f = R.filter((w) => w.type === "Group"), g = R.filter((w) => w.type === "Role");
|
|
5095
|
+
O[o][h] = {
|
|
5096
|
+
users: [...O[o][h]?.users || [], ...D],
|
|
5097
|
+
groups: [...O[o][h]?.groups || [], ...f],
|
|
5098
|
+
roles: [...O[o][h]?.roles || [], ...g]
|
|
5099
|
+
};
|
|
5100
|
+
} else b && (O[o][h] = {
|
|
5101
|
+
users: b.users || [],
|
|
5102
|
+
groups: b.groups || [],
|
|
5103
|
+
roles: b.roles || []
|
|
5104
|
+
});
|
|
5105
|
+
console.log("[DataTableRenderer] Updated audience data:", O[o][h]);
|
|
5096
5106
|
}
|
|
5097
|
-
return
|
|
5098
|
-
}), u(null), N(null);
|
|
5107
|
+
return O;
|
|
5108
|
+
}), console.log("[DataTableRenderer] Closing modal after update"), u(null), N(null);
|
|
5099
5109
|
}, [o, h]);
|
|
5100
5110
|
return /* @__PURE__ */ n("div", { children: [
|
|
5101
5111
|
/* @__PURE__ */ n("div", { style: { marginBottom: "20px" }, children: [
|
|
@@ -5115,32 +5125,32 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5115
5125
|
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ n("table", { className: "min-w-full bg-white border border-gray-300", style: { marginBottom: "20px" }, children: [
|
|
5116
5126
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "bg-gray-50", children: [
|
|
5117
5127
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-10" }),
|
|
5118
|
-
l.fields.map((x,
|
|
5128
|
+
l.fields.map((x, b) => /* @__PURE__ */ e(
|
|
5119
5129
|
"th",
|
|
5120
5130
|
{
|
|
5121
5131
|
className: "px-4 py-2 text-left text-sm font-medium text-gray-700",
|
|
5122
5132
|
children: x.label || x.key
|
|
5123
5133
|
},
|
|
5124
|
-
|
|
5134
|
+
b
|
|
5125
5135
|
)),
|
|
5126
5136
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-16" })
|
|
5127
5137
|
] }) }),
|
|
5128
|
-
/* @__PURE__ */ e("tbody", { children: y.map((x,
|
|
5138
|
+
/* @__PURE__ */ e("tbody", { children: y.map((x, b) => /* @__PURE__ */ n(
|
|
5129
5139
|
"tr",
|
|
5130
5140
|
{
|
|
5131
|
-
className: `hover:bg-gray-50 ${
|
|
5141
|
+
className: `hover:bg-gray-50 ${I === b ? "opacity-50" : ""}`,
|
|
5132
5142
|
draggable: !0,
|
|
5133
|
-
onDragStart: (
|
|
5143
|
+
onDragStart: (S) => j(S, b),
|
|
5134
5144
|
onDragOver: U,
|
|
5135
|
-
onDrop: (
|
|
5145
|
+
onDrop: (S) => Y(S, b),
|
|
5136
5146
|
onDragEnd: q,
|
|
5137
5147
|
children: [
|
|
5138
5148
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e("div", { className: "cursor-move text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ e(wt, { size: 16 }) }) }),
|
|
5139
|
-
l.fields.map((
|
|
5149
|
+
l.fields.map((S, O) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: z(S)(x, b) }, O)),
|
|
5140
5150
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
5141
5151
|
"button",
|
|
5142
5152
|
{
|
|
5143
|
-
onClick: () => E(
|
|
5153
|
+
onClick: () => E(b),
|
|
5144
5154
|
className: "text-red-500 hover:text-red-700",
|
|
5145
5155
|
title: "Delete row",
|
|
5146
5156
|
children: /* @__PURE__ */ e(yr, { size: 16 })
|
|
@@ -5148,7 +5158,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5148
5158
|
) })
|
|
5149
5159
|
]
|
|
5150
5160
|
},
|
|
5151
|
-
|
|
5161
|
+
b
|
|
5152
5162
|
)) })
|
|
5153
5163
|
] }) }),
|
|
5154
5164
|
o !== null && (() => {
|
|
@@ -5194,27 +5204,27 @@ function Ss({
|
|
|
5194
5204
|
onShowCancelModal: l,
|
|
5195
5205
|
onCancel: m
|
|
5196
5206
|
}) {
|
|
5197
|
-
const [o, u] = re.useState(a), [h, N] = re.useState(null), [y, r] = re.useState(null), [v, d] = B(!1), [
|
|
5207
|
+
const [o, u] = re.useState(a), [h, N] = re.useState(null), [y, r] = re.useState(null), [v, d] = B(!1), [p, z] = B(!1), [F, E] = B({}), I = `${$e()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, P = I, [j, U] = B(1), Y = () => {
|
|
5198
5208
|
if (!y || !h)
|
|
5199
5209
|
return console.log("[DynamicConfig] hasUnsavedChanges: false (no data)", { originalData: y, data: h }), !1;
|
|
5200
|
-
const
|
|
5210
|
+
const f = (T) => {
|
|
5201
5211
|
if (T == null || typeof T != "object") return T;
|
|
5202
|
-
if (Array.isArray(T)) return T.map(
|
|
5212
|
+
if (Array.isArray(T)) return T.map(f);
|
|
5203
5213
|
const L = {};
|
|
5204
5214
|
return Object.keys(T).sort().forEach((C) => {
|
|
5205
|
-
L[C] =
|
|
5215
|
+
L[C] = f(T[C]);
|
|
5206
5216
|
}), L;
|
|
5207
|
-
},
|
|
5217
|
+
}, g = f(y), w = f(h), k = JSON.stringify(g) !== JSON.stringify(w);
|
|
5208
5218
|
return console.log("[DynamicConfig] hasUnsavedChanges:", k, {
|
|
5209
|
-
originalData:
|
|
5219
|
+
originalData: g,
|
|
5210
5220
|
currentData: w,
|
|
5211
5221
|
originalRaw: y,
|
|
5212
5222
|
currentRaw: h
|
|
5213
5223
|
}), k;
|
|
5214
|
-
}, q = (
|
|
5224
|
+
}, q = (f) => {
|
|
5215
5225
|
if (!a || !a.configuration)
|
|
5216
|
-
return
|
|
5217
|
-
const
|
|
5226
|
+
return f;
|
|
5227
|
+
const g = {}, w = f?.configuration || {};
|
|
5218
5228
|
return a.configuration.forEach((k) => {
|
|
5219
5229
|
if (k.key && k.type === "datatable") {
|
|
5220
5230
|
const L = (w[k.key] || []).map((C, M) => {
|
|
@@ -5236,126 +5246,126 @@ function Ss({
|
|
|
5236
5246
|
M.fieldtype === "audience" ? C[M.key] = { users: [], groups: [], roles: [] } : C[M.key] = M.default || "";
|
|
5237
5247
|
}), L.push(C);
|
|
5238
5248
|
}
|
|
5239
|
-
|
|
5249
|
+
g[k.key] = L;
|
|
5240
5250
|
} else if (k.key) {
|
|
5241
5251
|
const T = w[k.key] || {};
|
|
5242
5252
|
k.type === "section" && k.fields && k.fields.forEach((L) => {
|
|
5243
5253
|
L.fieldtype === "managecollectionlist" && L.key && (!T[L.key] || !Array.isArray(T[L.key])) && (T[L.key] = L.initialData || []);
|
|
5244
|
-
}),
|
|
5254
|
+
}), g[k.key] = T;
|
|
5245
5255
|
}
|
|
5246
|
-
}),
|
|
5256
|
+
}), g;
|
|
5247
5257
|
}, $ = () => {
|
|
5248
5258
|
if (a && a.configuration) {
|
|
5249
|
-
const
|
|
5250
|
-
a.configuration.forEach((
|
|
5251
|
-
if (
|
|
5252
|
-
if (
|
|
5259
|
+
const f = {};
|
|
5260
|
+
a.configuration.forEach((g) => {
|
|
5261
|
+
if (g.key)
|
|
5262
|
+
if (g.type === "datatable") {
|
|
5253
5263
|
const w = { id: 0 };
|
|
5254
|
-
|
|
5264
|
+
g.fields && g.fields.forEach((k) => {
|
|
5255
5265
|
k.fieldtype === "audience" ? w[k.key] = { users: [], groups: [], roles: [] } : (k.fieldtype, w[k.key] = k.default || "");
|
|
5256
|
-
}),
|
|
5257
|
-
} else if (
|
|
5266
|
+
}), f[g.key] = [w];
|
|
5267
|
+
} else if (g.type === "section") {
|
|
5258
5268
|
const w = {};
|
|
5259
|
-
|
|
5269
|
+
g.fields && Array.isArray(g.fields) && g.fields.forEach((k) => {
|
|
5260
5270
|
k.key && (k.fieldtype === "managecollectionlist" ? w[k.key] = k.initialData || [] : w[k.key] = k.default || "");
|
|
5261
|
-
}),
|
|
5271
|
+
}), f[g.key] = w;
|
|
5262
5272
|
} else
|
|
5263
|
-
|
|
5264
|
-
}), N(
|
|
5273
|
+
f[g.key] = {};
|
|
5274
|
+
}), N(f), r(f);
|
|
5265
5275
|
}
|
|
5266
5276
|
};
|
|
5267
|
-
|
|
5277
|
+
Z(() => {
|
|
5268
5278
|
if (s) {
|
|
5269
5279
|
d(!1);
|
|
5270
5280
|
return;
|
|
5271
5281
|
}
|
|
5272
|
-
const
|
|
5282
|
+
const f = async () => {
|
|
5273
5283
|
try {
|
|
5274
5284
|
d(!0);
|
|
5275
|
-
let
|
|
5276
|
-
if (
|
|
5277
|
-
const w = q(
|
|
5285
|
+
let g = await Ze(I);
|
|
5286
|
+
if (g) {
|
|
5287
|
+
const w = q(g);
|
|
5278
5288
|
N(w), r(w);
|
|
5279
5289
|
} else
|
|
5280
5290
|
$();
|
|
5281
|
-
} catch (
|
|
5282
|
-
console.error("Error fetching configuration:",
|
|
5291
|
+
} catch (g) {
|
|
5292
|
+
console.error("Error fetching configuration:", g);
|
|
5283
5293
|
let w = "Failed to load configuration";
|
|
5284
|
-
if (
|
|
5285
|
-
const k =
|
|
5294
|
+
if (g.response) {
|
|
5295
|
+
const k = g.response.status, T = g.response.data?.message || g.response.data?.error;
|
|
5286
5296
|
k === 400 ? w = T || "Invalid request. Please check the application ID." : k === 401 ? w = "You are not authorized to access this configuration." : k === 403 ? w = "Access denied. You don't have permission to view this configuration." : k === 404 ? w = "Configuration not found. It may not exist yet or the application ID is incorrect." : k >= 500 ? w = T || "Server error. Please try again later." : w = T || `Failed to load configuration (Error ${k})`;
|
|
5287
|
-
} else
|
|
5297
|
+
} else g.request ? w = "Network error. Please check your connection and try again." : w = g.message || "An unexpected error occurred while loading configuration.";
|
|
5288
5298
|
qe.error(w), $();
|
|
5289
5299
|
} finally {
|
|
5290
5300
|
d(!1);
|
|
5291
5301
|
}
|
|
5292
5302
|
};
|
|
5293
|
-
a && (u(a), t ?
|
|
5303
|
+
a && (u(a), t ? f() : $());
|
|
5294
5304
|
}, [a, j, t, s]);
|
|
5295
|
-
const x = (
|
|
5296
|
-
console.log(`[DynamicConfig] handleSectionChange called for ${
|
|
5305
|
+
const x = (f, g) => {
|
|
5306
|
+
console.log(`[DynamicConfig] handleSectionChange called for ${f}:`, g), N((w) => {
|
|
5297
5307
|
const k = {
|
|
5298
5308
|
...w,
|
|
5299
|
-
[
|
|
5309
|
+
[f]: g
|
|
5300
5310
|
};
|
|
5301
5311
|
return console.log("[DynamicConfig] Updated data state:", k), k;
|
|
5302
5312
|
}), E((w) => {
|
|
5303
5313
|
const k = { ...w };
|
|
5304
|
-
return k[
|
|
5314
|
+
return k[f] && delete k[f], k;
|
|
5305
5315
|
});
|
|
5306
|
-
},
|
|
5307
|
-
const
|
|
5308
|
-
return !o || !h || o.configuration.forEach((
|
|
5309
|
-
if (
|
|
5310
|
-
|
|
5311
|
-
const k = h[
|
|
5316
|
+
}, b = () => {
|
|
5317
|
+
const f = {};
|
|
5318
|
+
return !o || !h || o.configuration.forEach((g) => {
|
|
5319
|
+
if (g.type === "section")
|
|
5320
|
+
g.fields.forEach((w) => {
|
|
5321
|
+
const k = h[g.key]?.[w.key];
|
|
5312
5322
|
if (w.required && (!k || typeof k == "string" && k.trim() === "")) {
|
|
5313
|
-
|
|
5323
|
+
f[g.key] || (f[g.key] = {}), f[g.key][w.key] = `${w.label} is required`;
|
|
5314
5324
|
return;
|
|
5315
5325
|
}
|
|
5316
5326
|
if (w.fieldtype === "number" && k !== "" && k !== null && k !== void 0) {
|
|
5317
5327
|
const T = Number(k);
|
|
5318
|
-
isNaN(T) ? (
|
|
5328
|
+
isNaN(T) ? (f[g.key] || (f[g.key] = {}), f[g.key][w.key] = `${w.label} must be a valid number`) : (w.min !== void 0 && T < w.min && (f[g.key] || (f[g.key] = {}), f[g.key][w.key] = `${w.label} must be at least ${w.min}`), w.max !== void 0 && T > w.max && (f[g.key] || (f[g.key] = {}), f[g.key][w.key] = `${w.label} must not exceed ${w.max}`));
|
|
5319
5329
|
}
|
|
5320
5330
|
});
|
|
5321
|
-
else if (
|
|
5322
|
-
const w = h[
|
|
5331
|
+
else if (g.type === "datatable") {
|
|
5332
|
+
const w = h[g.key];
|
|
5323
5333
|
Array.isArray(w) && w.forEach((k, T) => {
|
|
5324
|
-
|
|
5334
|
+
g.fields.forEach((L) => {
|
|
5325
5335
|
const C = k[L.key];
|
|
5326
5336
|
if (L.required && (!C || typeof C == "string" && C.trim() === "")) {
|
|
5327
|
-
|
|
5337
|
+
f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} is required`;
|
|
5328
5338
|
return;
|
|
5329
5339
|
}
|
|
5330
5340
|
if (L.fieldtype === "number" && C !== "" && C !== null && C !== void 0) {
|
|
5331
5341
|
const M = Number(C);
|
|
5332
|
-
isNaN(M) ? (
|
|
5342
|
+
isNaN(M) ? (f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} must be a valid number`) : (L.min !== void 0 && M < L.min && (f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} must be at least ${L.min}`), L.max !== void 0 && M > L.max && (f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} must not exceed ${L.max}`));
|
|
5333
5343
|
}
|
|
5334
5344
|
});
|
|
5335
5345
|
});
|
|
5336
5346
|
}
|
|
5337
|
-
}),
|
|
5338
|
-
},
|
|
5339
|
-
if (
|
|
5347
|
+
}), f;
|
|
5348
|
+
}, S = (f) => Object.keys(f).length > 0, O = () => {
|
|
5349
|
+
if (p) {
|
|
5340
5350
|
console.log("[handleSave] Already saving, ignoring duplicate call");
|
|
5341
5351
|
return;
|
|
5342
5352
|
}
|
|
5343
5353
|
console.log("[handleSave] Starting save process");
|
|
5344
|
-
const
|
|
5345
|
-
if (E(
|
|
5354
|
+
const f = b();
|
|
5355
|
+
if (E(f), S(f)) {
|
|
5346
5356
|
let w = [];
|
|
5347
|
-
Object.keys(
|
|
5348
|
-
typeof
|
|
5349
|
-
typeof
|
|
5350
|
-
w.push(`${k} row ${parseInt(T) + 1}: ${
|
|
5351
|
-
}) : w.push(`${k}: ${
|
|
5357
|
+
Object.keys(f).forEach((k) => {
|
|
5358
|
+
typeof f[k] == "object" && Object.keys(f[k]).forEach((T) => {
|
|
5359
|
+
typeof f[k][T] == "object" ? Object.keys(f[k][T]).forEach((L) => {
|
|
5360
|
+
w.push(`${k} row ${parseInt(T) + 1}: ${f[k][T][L]}`);
|
|
5361
|
+
}) : w.push(`${k}: ${f[k][T]}`);
|
|
5352
5362
|
});
|
|
5353
5363
|
});
|
|
5354
5364
|
return;
|
|
5355
5365
|
}
|
|
5356
5366
|
(async () => {
|
|
5357
5367
|
try {
|
|
5358
|
-
|
|
5368
|
+
z(!0);
|
|
5359
5369
|
const w = {};
|
|
5360
5370
|
h && Object.keys(h).forEach((T) => {
|
|
5361
5371
|
const L = a?.configuration?.find(
|
|
@@ -5386,16 +5396,16 @@ function Ss({
|
|
|
5386
5396
|
} catch (w) {
|
|
5387
5397
|
console.error("Error saving configuration:", w), qe.error(w?.message || "Failed to save configuration");
|
|
5388
5398
|
} finally {
|
|
5389
|
-
|
|
5399
|
+
z(!1);
|
|
5390
5400
|
}
|
|
5391
5401
|
})();
|
|
5392
|
-
},
|
|
5402
|
+
}, R = () => {
|
|
5393
5403
|
console.log("[DynamicConfig] handleCancel called"), Y() ? (console.log("[DynamicConfig] Unsaved changes detected - showing modal"), l ? l() : console.warn("[DynamicConfig] onShowCancelModal not provided, cannot show modal")) : (console.log("[DynamicConfig] No unsaved changes - going back directly"), m ? m() : (console.log("[DynamicConfig] Using fallback window.history.back()"), window.history.back()));
|
|
5394
5404
|
};
|
|
5395
5405
|
if (!o?.configuration && !a?.configuration)
|
|
5396
5406
|
return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-gray-500", children: "No configuration available" }) });
|
|
5397
5407
|
const D = a?.configuration || o?.configuration;
|
|
5398
|
-
return
|
|
5408
|
+
return Z(() => {
|
|
5399
5409
|
s && a ? (!h || Object.keys(h).length === 0) && $() : s && !a && $();
|
|
5400
5410
|
}, [s, a]), /* @__PURE__ */ n("div", { children: [
|
|
5401
5411
|
/* @__PURE__ */ n(
|
|
@@ -5405,18 +5415,18 @@ function Ss({
|
|
|
5405
5415
|
style: { padding: "0px 20px 0px 0px" },
|
|
5406
5416
|
children: [
|
|
5407
5417
|
v && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(ba, { size: "large" }) }),
|
|
5408
|
-
!v && D?.map((
|
|
5409
|
-
const w = zs(
|
|
5418
|
+
!v && D?.map((f, g) => {
|
|
5419
|
+
const w = zs(f.type);
|
|
5410
5420
|
if (w && w !== "UnknownType")
|
|
5411
5421
|
return /* @__PURE__ */ e(
|
|
5412
5422
|
w,
|
|
5413
5423
|
{
|
|
5414
|
-
item:
|
|
5424
|
+
item: f,
|
|
5415
5425
|
data: h,
|
|
5416
5426
|
updateHandler: x,
|
|
5417
5427
|
validationErrors: F
|
|
5418
5428
|
},
|
|
5419
|
-
|
|
5429
|
+
g
|
|
5420
5430
|
);
|
|
5421
5431
|
})
|
|
5422
5432
|
]
|
|
@@ -5427,9 +5437,9 @@ function Ss({
|
|
|
5427
5437
|
le,
|
|
5428
5438
|
{
|
|
5429
5439
|
category: "secondary",
|
|
5430
|
-
onClick:
|
|
5440
|
+
onClick: R,
|
|
5431
5441
|
label: "Cancel",
|
|
5432
|
-
disabled:
|
|
5442
|
+
disabled: p,
|
|
5433
5443
|
type: "button"
|
|
5434
5444
|
}
|
|
5435
5445
|
),
|
|
@@ -5438,8 +5448,8 @@ function Ss({
|
|
|
5438
5448
|
{
|
|
5439
5449
|
category: "primary",
|
|
5440
5450
|
onClick: O,
|
|
5441
|
-
disabled:
|
|
5442
|
-
label:
|
|
5451
|
+
disabled: p,
|
|
5452
|
+
label: p ? "Saving..." : "Save",
|
|
5443
5453
|
type: "submit"
|
|
5444
5454
|
}
|
|
5445
5455
|
)
|
|
@@ -5457,27 +5467,27 @@ const Kl = ({
|
|
|
5457
5467
|
breadcrumb: N = [],
|
|
5458
5468
|
overview: y = {},
|
|
5459
5469
|
configuration: r = []
|
|
5460
|
-
} = t, v = ae(() => r.map((
|
|
5461
|
-
if (
|
|
5462
|
-
const
|
|
5470
|
+
} = t, v = ae(() => r.map((b) => {
|
|
5471
|
+
if (b.type === "section" && b.fields) {
|
|
5472
|
+
const S = [...b.fields], O = S.findIndex((R) => R && R.key === "appkey");
|
|
5463
5473
|
if (O !== -1) {
|
|
5464
|
-
const
|
|
5465
|
-
if (
|
|
5466
|
-
...
|
|
5474
|
+
const R = S[O];
|
|
5475
|
+
if (S[O] = {
|
|
5476
|
+
...R,
|
|
5467
5477
|
default: a,
|
|
5468
5478
|
value: a,
|
|
5469
5479
|
readonly: !0,
|
|
5470
5480
|
placeholder: a,
|
|
5471
5481
|
disabled: !1
|
|
5472
|
-
},
|
|
5473
|
-
const
|
|
5474
|
-
|
|
5475
|
-
...
|
|
5476
|
-
default:
|
|
5477
|
-
placeholder:
|
|
5482
|
+
}, S.some((f) => f.key === "displayname")) {
|
|
5483
|
+
const f = S.findIndex((w) => w.key === "displayname"), g = S[f] || {};
|
|
5484
|
+
S[f] = {
|
|
5485
|
+
...g,
|
|
5486
|
+
default: g.default || g.value || a,
|
|
5487
|
+
placeholder: g.placeholder || "Enter display name"
|
|
5478
5488
|
};
|
|
5479
5489
|
} else {
|
|
5480
|
-
const
|
|
5490
|
+
const f = {
|
|
5481
5491
|
key: "displayname",
|
|
5482
5492
|
label: "Display Name",
|
|
5483
5493
|
fieldtype: "text",
|
|
@@ -5486,46 +5496,46 @@ const Kl = ({
|
|
|
5486
5496
|
placeholder: "Enter display name",
|
|
5487
5497
|
required: !1
|
|
5488
5498
|
};
|
|
5489
|
-
|
|
5499
|
+
S.splice(O + 1, 0, f);
|
|
5490
5500
|
}
|
|
5491
5501
|
}
|
|
5492
5502
|
return {
|
|
5493
|
-
...
|
|
5494
|
-
fields:
|
|
5503
|
+
...b,
|
|
5504
|
+
fields: S
|
|
5495
5505
|
};
|
|
5496
5506
|
}
|
|
5497
|
-
return
|
|
5507
|
+
return b;
|
|
5498
5508
|
}), [r, a]), d = {
|
|
5499
5509
|
heading: "App Details",
|
|
5500
5510
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
5501
5511
|
isLeftArrow: !0,
|
|
5502
5512
|
onBackClick: () => window.history.back(),
|
|
5503
5513
|
...u
|
|
5504
|
-
},
|
|
5505
|
-
label:
|
|
5506
|
-
href:
|
|
5507
|
-
})),
|
|
5514
|
+
}, p = N.map((b) => ({
|
|
5515
|
+
label: b.text,
|
|
5516
|
+
href: b.href || "#"
|
|
5517
|
+
})), z = ee(() => {
|
|
5508
5518
|
o(!0);
|
|
5509
|
-
}, []), F =
|
|
5510
|
-
o(!1),
|
|
5511
|
-
}, []), E =
|
|
5512
|
-
console.log("Configuration changed:",
|
|
5513
|
-
}, []),
|
|
5519
|
+
}, []), F = ee((b) => {
|
|
5520
|
+
o(!1), b.primary && window.history.back();
|
|
5521
|
+
}, []), E = ee((b) => {
|
|
5522
|
+
console.log("Configuration changed:", b);
|
|
5523
|
+
}, []), I = ee(() => {
|
|
5514
5524
|
window.history.back();
|
|
5515
5525
|
}, []), P = (() => {
|
|
5516
5526
|
if (h.headingKey && Array.isArray(r)) {
|
|
5517
|
-
const
|
|
5518
|
-
if (
|
|
5519
|
-
const D =
|
|
5527
|
+
const b = h.headingKey.split("."), S = b[0], O = b[1], R = r.find((D) => D && D.key === S);
|
|
5528
|
+
if (R && R.fields) {
|
|
5529
|
+
const D = R.fields.find((f) => f && f.key === O);
|
|
5520
5530
|
if (D)
|
|
5521
5531
|
return D.default ?? D.value ?? h.heading ?? a;
|
|
5522
5532
|
}
|
|
5523
5533
|
}
|
|
5524
5534
|
if (Array.isArray(r)) {
|
|
5525
|
-
for (const
|
|
5526
|
-
if (
|
|
5527
|
-
const
|
|
5528
|
-
if (
|
|
5535
|
+
for (const b of r)
|
|
5536
|
+
if (b && b.fields) {
|
|
5537
|
+
const S = b.fields.find((O) => O && O.key === "displayname");
|
|
5538
|
+
if (S) return S.default ?? S.value ?? a;
|
|
5529
5539
|
}
|
|
5530
5540
|
}
|
|
5531
5541
|
return h.heading || a;
|
|
@@ -5557,22 +5567,22 @@ const Kl = ({
|
|
|
5557
5567
|
configuration: v
|
|
5558
5568
|
}), [v]), q = ae(() => [
|
|
5559
5569
|
{ label: "Overview", content: x(U) },
|
|
5560
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: Y, disableApi: s, onSave: E, onShowCancelModal:
|
|
5561
|
-
], [a, Y, s, E,
|
|
5562
|
-
function $(
|
|
5563
|
-
return
|
|
5570
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: Y, disableApi: s, onSave: E, onShowCancelModal: z, onCancel: I }) }
|
|
5571
|
+
], [a, Y, s, E, z, I, U]);
|
|
5572
|
+
function $(b) {
|
|
5573
|
+
return b ? b.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: b } }) : b : "📱";
|
|
5564
5574
|
}
|
|
5565
|
-
function x(
|
|
5575
|
+
function x(b) {
|
|
5566
5576
|
return /* @__PURE__ */ n("div", { className: "bg-white rounded-2xl p-1", children: [
|
|
5567
5577
|
/* @__PURE__ */ n("section", { className: "mb-8", children: [
|
|
5568
5578
|
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
|
|
5569
|
-
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children:
|
|
5579
|
+
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children: b.about })
|
|
5570
5580
|
] }),
|
|
5571
5581
|
/* @__PURE__ */ n("section", { className: "flex flex-row gap-6 justify-center items-center mb-8", children: [
|
|
5572
5582
|
/* @__PURE__ */ e(
|
|
5573
5583
|
"img",
|
|
5574
5584
|
{
|
|
5575
|
-
src:
|
|
5585
|
+
src: b.images.desktop,
|
|
5576
5586
|
alt: "Desktop View",
|
|
5577
5587
|
className: "rounded-xl border border-gray-200 w-[340px] h-[220px] object-cover"
|
|
5578
5588
|
}
|
|
@@ -5580,7 +5590,7 @@ const Kl = ({
|
|
|
5580
5590
|
/* @__PURE__ */ e(
|
|
5581
5591
|
"img",
|
|
5582
5592
|
{
|
|
5583
|
-
src:
|
|
5593
|
+
src: b.images.mobile1,
|
|
5584
5594
|
alt: "Mobile View 1",
|
|
5585
5595
|
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
5586
5596
|
}
|
|
@@ -5588,10 +5598,10 @@ const Kl = ({
|
|
|
5588
5598
|
] }),
|
|
5589
5599
|
/* @__PURE__ */ n("section", { children: [
|
|
5590
5600
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
|
|
5591
|
-
/* @__PURE__ */ e("ul", { className: "space-y-3", children:
|
|
5592
|
-
/* @__PURE__ */ e("span", { className: "font-semibold", children:
|
|
5601
|
+
/* @__PURE__ */ e("ul", { className: "space-y-3", children: b.features.map((S, O) => /* @__PURE__ */ n("li", { children: [
|
|
5602
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: S.title }),
|
|
5593
5603
|
/* @__PURE__ */ e("br", {}),
|
|
5594
|
-
/* @__PURE__ */ e("span", { className: "text-gray-700", children:
|
|
5604
|
+
/* @__PURE__ */ e("span", { className: "text-gray-700", children: S.description })
|
|
5595
5605
|
] }, O)) })
|
|
5596
5606
|
] })
|
|
5597
5607
|
] });
|
|
@@ -5601,8 +5611,8 @@ const Kl = ({
|
|
|
5601
5611
|
Un,
|
|
5602
5612
|
{
|
|
5603
5613
|
heading: d.heading,
|
|
5604
|
-
subHeading:
|
|
5605
|
-
breadcrumbItems:
|
|
5614
|
+
subHeading: p.length > 0 ? void 0 : d.subHeading,
|
|
5615
|
+
breadcrumbItems: p,
|
|
5606
5616
|
isLeftArrow: d.isLeftArrow,
|
|
5607
5617
|
onBackClick: d.onBackClick
|
|
5608
5618
|
}
|
|
@@ -5612,25 +5622,25 @@ const Kl = ({
|
|
|
5612
5622
|
/* @__PURE__ */ n("div", { className: "flex flex-col min-w-0", children: [
|
|
5613
5623
|
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: j.heading }),
|
|
5614
5624
|
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: j.subHeading }),
|
|
5615
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: j.tags && j.tags.map((
|
|
5625
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: j.tags && j.tags.map((b, S) => /* @__PURE__ */ e(
|
|
5616
5626
|
"span",
|
|
5617
5627
|
{
|
|
5618
5628
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
5619
|
-
children:
|
|
5629
|
+
children: b
|
|
5620
5630
|
},
|
|
5621
|
-
|
|
5631
|
+
S
|
|
5622
5632
|
)) })
|
|
5623
5633
|
] })
|
|
5624
5634
|
] }),
|
|
5625
5635
|
/* @__PURE__ */ n("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
|
|
5626
|
-
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((
|
|
5636
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((b, S) => /* @__PURE__ */ e(
|
|
5627
5637
|
"button",
|
|
5628
5638
|
{
|
|
5629
|
-
onClick: () => l(
|
|
5630
|
-
className: `${i ===
|
|
5631
|
-
children:
|
|
5639
|
+
onClick: () => l(S),
|
|
5640
|
+
className: `${i === S ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
|
|
5641
|
+
children: b.label
|
|
5632
5642
|
},
|
|
5633
|
-
|
|
5643
|
+
S
|
|
5634
5644
|
)) }) }),
|
|
5635
5645
|
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: q[i].content })
|
|
5636
5646
|
] }),
|
|
@@ -5657,12 +5667,12 @@ const Kl = ({
|
|
|
5657
5667
|
allowReorder: o = !0,
|
|
5658
5668
|
initialData: u = null
|
|
5659
5669
|
}) => {
|
|
5660
|
-
const [h, N] = B(null), [y, r] = B(""), [v, d] = B(() => Array.isArray(u) ? u : []), [
|
|
5661
|
-
|
|
5670
|
+
const [h, N] = B(null), [y, r] = B(""), [v, d] = B(() => Array.isArray(u) ? u : []), [p, z] = B(null), [F, E] = B(null), [I, P] = B("");
|
|
5671
|
+
Z(() => {
|
|
5662
5672
|
Array.isArray(u) && d(u);
|
|
5663
5673
|
}, [u]);
|
|
5664
|
-
const j = (
|
|
5665
|
-
l && (N(
|
|
5674
|
+
const j = (g) => {
|
|
5675
|
+
l && (N(g._id), r(g.categoryName || ""));
|
|
5666
5676
|
}, U = () => {
|
|
5667
5677
|
if (!i || h !== null) return;
|
|
5668
5678
|
const w = (v.length > 0 ? Math.max(...v.map((k) => typeof k._id == "number" ? k._id : 0)) : 0) + 1;
|
|
@@ -5678,54 +5688,54 @@ const Kl = ({
|
|
|
5678
5688
|
}
|
|
5679
5689
|
]), N(w), r("");
|
|
5680
5690
|
}, Y = () => {
|
|
5681
|
-
h != null && (d((
|
|
5682
|
-
const k = !Array.isArray(u) || !u.some((T) => T._id === h) ?
|
|
5691
|
+
h != null && (d((g) => {
|
|
5692
|
+
const k = !Array.isArray(u) || !u.some((T) => T._id === h) ? g.filter((T) => T._id !== h) : g;
|
|
5683
5693
|
return a?.(k), k;
|
|
5684
5694
|
}), N(null), r(""));
|
|
5685
5695
|
}, q = () => {
|
|
5686
|
-
h == null || !y.trim() || (d((
|
|
5687
|
-
const w =
|
|
5696
|
+
h == null || !y.trim() || (d((g) => {
|
|
5697
|
+
const w = g.map((k) => k._id === h ? {
|
|
5688
5698
|
...k,
|
|
5689
5699
|
categoryName: y.trim()
|
|
5690
5700
|
} : k);
|
|
5691
5701
|
return a?.(w), w;
|
|
5692
5702
|
}), N(null), r(""));
|
|
5693
|
-
}, $ = (
|
|
5703
|
+
}, $ = (g) => {
|
|
5694
5704
|
m && d((w) => {
|
|
5695
|
-
const k = w.filter((T) => T._id !==
|
|
5705
|
+
const k = w.filter((T) => T._id !== g._id);
|
|
5696
5706
|
return a?.(k), k;
|
|
5697
5707
|
});
|
|
5698
|
-
}, x = (
|
|
5708
|
+
}, x = (g, w, k) => {
|
|
5699
5709
|
const T = Number(w), L = Number(k);
|
|
5700
|
-
if (!o || T === L) return
|
|
5701
|
-
const C =
|
|
5702
|
-
if (C === -1 || M === -1) return
|
|
5703
|
-
const _ = [...
|
|
5710
|
+
if (!o || T === L) return g;
|
|
5711
|
+
const C = g.findIndex((G) => Number(G._id) === T), M = g.findIndex((G) => Number(G._id) === L);
|
|
5712
|
+
if (C === -1 || M === -1) return g;
|
|
5713
|
+
const _ = [...g], [A] = _.splice(C, 1);
|
|
5704
5714
|
return _.splice(M, 0, A), _.map((G, W) => ({ ...G, order: W + 1 }));
|
|
5705
|
-
},
|
|
5706
|
-
o && (
|
|
5707
|
-
},
|
|
5708
|
-
|
|
5709
|
-
}, O = (
|
|
5710
|
-
|
|
5711
|
-
},
|
|
5712
|
-
|
|
5713
|
-
const k =
|
|
5715
|
+
}, b = (g, w) => {
|
|
5716
|
+
o && (g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/plain", String(w)), z(Number(w)));
|
|
5717
|
+
}, S = (g) => {
|
|
5718
|
+
p && g !== F && E(g);
|
|
5719
|
+
}, O = (g) => {
|
|
5720
|
+
g.preventDefault();
|
|
5721
|
+
}, R = (g, w) => {
|
|
5722
|
+
g.preventDefault();
|
|
5723
|
+
const k = g.dataTransfer.getData("text/plain"), T = k === "0" ? 0 : Number(k), L = w === "0" ? 0 : Number(w);
|
|
5714
5724
|
T === void 0 || L === void 0 || (d((C) => {
|
|
5715
5725
|
const M = x(C, T, L);
|
|
5716
5726
|
return a?.(M), M;
|
|
5717
|
-
}),
|
|
5727
|
+
}), z(null), E(null));
|
|
5718
5728
|
}, D = () => {
|
|
5719
|
-
|
|
5720
|
-
},
|
|
5721
|
-
(
|
|
5729
|
+
z(null), E(null);
|
|
5730
|
+
}, f = Array.isArray(v) ? v.filter(
|
|
5731
|
+
(g) => g.categoryName?.toLowerCase().includes(I.toLowerCase())
|
|
5722
5732
|
) : [];
|
|
5723
5733
|
return /* @__PURE__ */ n("div", { className: `manage-collection-list ${t}`, children: [
|
|
5724
5734
|
/* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ n("div", { className: "w-1/2 flex justify-end", children: [
|
|
5725
5735
|
s && /* @__PURE__ */ e(
|
|
5726
5736
|
ge,
|
|
5727
5737
|
{
|
|
5728
|
-
value:
|
|
5738
|
+
value: I,
|
|
5729
5739
|
onDebouncedChange: P,
|
|
5730
5740
|
placeholder: "Search Collection",
|
|
5731
5741
|
customClass: "mr-4 searchmanagecollection"
|
|
@@ -5744,14 +5754,14 @@ const Kl = ({
|
|
|
5744
5754
|
}
|
|
5745
5755
|
)
|
|
5746
5756
|
] }) }),
|
|
5747
|
-
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children:
|
|
5748
|
-
const w = h ===
|
|
5757
|
+
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: f.map((g) => {
|
|
5758
|
+
const w = h === g._id, k = g?.links?.length ?? 0, T = p === g._id, L = F === g._id && p !== g._id;
|
|
5749
5759
|
return /* @__PURE__ */ e(
|
|
5750
5760
|
"div",
|
|
5751
5761
|
{
|
|
5752
|
-
onDragEnter: () =>
|
|
5762
|
+
onDragEnter: () => S(g._id),
|
|
5753
5763
|
onDragOver: O,
|
|
5754
|
-
onDrop: (C) =>
|
|
5764
|
+
onDrop: (C) => R(C, g._id),
|
|
5755
5765
|
onDragEnd: D,
|
|
5756
5766
|
className: [
|
|
5757
5767
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
@@ -5759,14 +5769,14 @@ const Kl = ({
|
|
|
5759
5769
|
L ? "ring-2 ring-gray-800/20" : "",
|
|
5760
5770
|
T ? "opacity-60" : ""
|
|
5761
5771
|
].join(" "),
|
|
5762
|
-
children: w ? /* @__PURE__ */ n(
|
|
5772
|
+
children: w ? /* @__PURE__ */ n(te, { children: [
|
|
5763
5773
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
5764
5774
|
"input",
|
|
5765
5775
|
{
|
|
5766
5776
|
type: "text",
|
|
5767
5777
|
className: "flex-1 h-10 px-3 max-w-[200px] border border-gray-300 rounded-2xl outline-none focus:ring-2 focus:ring-gray-800/20",
|
|
5768
5778
|
value: y,
|
|
5769
|
-
placeholder: !Array.isArray(u) || !u.some((C) => C._id ===
|
|
5779
|
+
placeholder: !Array.isArray(u) || !u.some((C) => C._id === g._id) ? "New collection name" : "Edit collection name",
|
|
5770
5780
|
onChange: (C) => r(C.target.value),
|
|
5771
5781
|
onKeyDown: (C) => {
|
|
5772
5782
|
C.key === "Enter" && q(), C.key === "Escape" && Y();
|
|
@@ -5799,7 +5809,7 @@ const Kl = ({
|
|
|
5799
5809
|
}
|
|
5800
5810
|
)
|
|
5801
5811
|
] })
|
|
5802
|
-
] }) : /* @__PURE__ */ n(
|
|
5812
|
+
] }) : /* @__PURE__ */ n(te, { children: [
|
|
5803
5813
|
/* @__PURE__ */ n("div", { className: "flex gap-2 items-center", children: [
|
|
5804
5814
|
o && /* @__PURE__ */ e(
|
|
5805
5815
|
"span",
|
|
@@ -5808,42 +5818,42 @@ const Kl = ({
|
|
|
5808
5818
|
"aria-label": "Drag to reorder",
|
|
5809
5819
|
className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
|
|
5810
5820
|
draggable: !0,
|
|
5811
|
-
onDragStart: (C) =>
|
|
5821
|
+
onDragStart: (C) => b(C, g._id),
|
|
5812
5822
|
children: /* @__PURE__ */ e(wt, {})
|
|
5813
5823
|
}
|
|
5814
5824
|
),
|
|
5815
|
-
/* @__PURE__ */ e("span", { children:
|
|
5825
|
+
/* @__PURE__ */ e("span", { children: g.categoryName })
|
|
5816
5826
|
] }),
|
|
5817
5827
|
/* @__PURE__ */ n("div", { className: "flex gap-2 items-center", children: [
|
|
5818
|
-
|
|
5828
|
+
g.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: g.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${k} ${k === 1 ? "link" : "links"}` }),
|
|
5819
5829
|
l && /* @__PURE__ */ e(
|
|
5820
5830
|
"button",
|
|
5821
5831
|
{
|
|
5822
5832
|
className: "cursor-pointer",
|
|
5823
|
-
onClick: () => j(
|
|
5824
|
-
"aria-label": `Edit ${
|
|
5833
|
+
onClick: () => j(g),
|
|
5834
|
+
"aria-label": `Edit ${g.categoryName}`,
|
|
5825
5835
|
children: /* @__PURE__ */ e(xr, { color: "#767676" })
|
|
5826
5836
|
}
|
|
5827
5837
|
),
|
|
5828
5838
|
m && /* @__PURE__ */ e(
|
|
5829
5839
|
"span",
|
|
5830
5840
|
{
|
|
5831
|
-
className: k === 0 && !
|
|
5832
|
-
title: k === 0 && !
|
|
5833
|
-
onClick: k === 0 ? () => $(
|
|
5841
|
+
className: k === 0 && !g.protected ? "cursor-pointer" : "cursor-not-allowed",
|
|
5842
|
+
title: k === 0 && !g.protected ? "Delete" : "Cannot delete a collection with linked items",
|
|
5843
|
+
onClick: k === 0 ? () => $(g) : null,
|
|
5834
5844
|
children: /* @__PURE__ */ e(Le, { color: k === 0 ? "#767676" : "#C2C2C2" })
|
|
5835
5845
|
}
|
|
5836
5846
|
)
|
|
5837
5847
|
] })
|
|
5838
5848
|
] })
|
|
5839
5849
|
},
|
|
5840
|
-
|
|
5850
|
+
g._id
|
|
5841
5851
|
);
|
|
5842
5852
|
}) })
|
|
5843
5853
|
] });
|
|
5844
5854
|
};
|
|
5845
5855
|
function ei({ children: t }) {
|
|
5846
|
-
return /* @__PURE__ */ n(
|
|
5856
|
+
return /* @__PURE__ */ n(te, { children: [
|
|
5847
5857
|
t,
|
|
5848
5858
|
/* @__PURE__ */ e(
|
|
5849
5859
|
nn,
|
|
@@ -5930,12 +5940,12 @@ const Bt = () => {
|
|
|
5930
5940
|
showFilter: r = !1,
|
|
5931
5941
|
showPrint: v = !1,
|
|
5932
5942
|
showExcel: d = !1,
|
|
5933
|
-
showPdf:
|
|
5934
|
-
showRefresh:
|
|
5943
|
+
showPdf: p = !1,
|
|
5944
|
+
showRefresh: z = !1,
|
|
5935
5945
|
showAdd: F = !1,
|
|
5936
5946
|
iSelectedRecords: E = 0,
|
|
5937
5947
|
// Additional props
|
|
5938
|
-
searchPlaceholder:
|
|
5948
|
+
searchPlaceholder: I = "Search...",
|
|
5939
5949
|
handleRefreshClick: P = () => {
|
|
5940
5950
|
},
|
|
5941
5951
|
handleSearchChange: j = () => {
|
|
@@ -5947,11 +5957,11 @@ const Bt = () => {
|
|
|
5947
5957
|
pdfFileName: q,
|
|
5948
5958
|
searchIconSize: $,
|
|
5949
5959
|
searchIconClass: x,
|
|
5950
|
-
inputStyle:
|
|
5960
|
+
inputStyle: b
|
|
5951
5961
|
}) => {
|
|
5952
|
-
const
|
|
5962
|
+
const S = () => l?.current || i?.current, [O, R] = re.useState(""), D = (t || "export").toString().trim() || "export", f = `${Y || D}.xlsx`, g = `${q || D}.pdf`, w = (L, C, M) => Math.max(C, Math.min(L, M)), k = ee(
|
|
5953
5963
|
(L) => {
|
|
5954
|
-
const C =
|
|
5964
|
+
const C = S();
|
|
5955
5965
|
if (C?.openColumnChooser) {
|
|
5956
5966
|
if (typeof window > "u" || !L?.currentTarget) {
|
|
5957
5967
|
C.openColumnChooser();
|
|
@@ -5969,9 +5979,9 @@ const Bt = () => {
|
|
|
5969
5979
|
},
|
|
5970
5980
|
[]
|
|
5971
5981
|
// no external deps; reads ref at call time
|
|
5972
|
-
), T =
|
|
5982
|
+
), T = ee(
|
|
5973
5983
|
(L, C) => {
|
|
5974
|
-
const M =
|
|
5984
|
+
const M = S();
|
|
5975
5985
|
if (M)
|
|
5976
5986
|
switch (L) {
|
|
5977
5987
|
case "Delete": {
|
|
@@ -5988,17 +5998,17 @@ const Bt = () => {
|
|
|
5988
5998
|
v && M.print?.();
|
|
5989
5999
|
break;
|
|
5990
6000
|
case "Excel":
|
|
5991
|
-
d && M.excelExport?.({ fileName:
|
|
6001
|
+
d && M.excelExport?.({ fileName: f });
|
|
5992
6002
|
break;
|
|
5993
6003
|
case "Pdf":
|
|
5994
|
-
|
|
6004
|
+
p && M.pdfExport?.({ fileName: g });
|
|
5995
6005
|
break;
|
|
5996
6006
|
case "Refresh":
|
|
5997
|
-
|
|
6007
|
+
z && P();
|
|
5998
6008
|
break;
|
|
5999
6009
|
}
|
|
6000
6010
|
},
|
|
6001
|
-
[y, v, d,
|
|
6011
|
+
[y, v, d, p, z, f, g, P, k]
|
|
6002
6012
|
);
|
|
6003
6013
|
return /* @__PURE__ */ n("div", { className: "flex items-center flex-wrap justify-between w-full px-4 py-2 bg-white border border-gray-200 rounded-t-2xl mb-0", children: [
|
|
6004
6014
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
@@ -6013,14 +6023,14 @@ const Bt = () => {
|
|
|
6013
6023
|
h && /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
|
|
6014
6024
|
ge,
|
|
6015
6025
|
{
|
|
6016
|
-
placeholder:
|
|
6026
|
+
placeholder: I,
|
|
6017
6027
|
value: O,
|
|
6018
6028
|
onDebouncedChange: (L) => {
|
|
6019
|
-
|
|
6029
|
+
R(L), j(L);
|
|
6020
6030
|
},
|
|
6021
6031
|
searchIconSize: $ || 16,
|
|
6022
6032
|
searchIconClass: x || "",
|
|
6023
|
-
inputStyle:
|
|
6033
|
+
inputStyle: b || { paddingTop: "4px", paddingBottom: "4px" }
|
|
6024
6034
|
}
|
|
6025
6035
|
) }),
|
|
6026
6036
|
/* @__PURE__ */ n("div", { className: "flex gap-3", children: [
|
|
@@ -6066,7 +6076,7 @@ const Bt = () => {
|
|
|
6066
6076
|
ariaLabel: "Excel Download"
|
|
6067
6077
|
}
|
|
6068
6078
|
),
|
|
6069
|
-
|
|
6079
|
+
p && /* @__PURE__ */ e(
|
|
6070
6080
|
Ce,
|
|
6071
6081
|
{
|
|
6072
6082
|
icon: Cr,
|
|
@@ -6074,7 +6084,7 @@ const Bt = () => {
|
|
|
6074
6084
|
ariaLabel: "PDF Download"
|
|
6075
6085
|
}
|
|
6076
6086
|
),
|
|
6077
|
-
|
|
6087
|
+
z && /* @__PURE__ */ e(
|
|
6078
6088
|
Ce,
|
|
6079
6089
|
{
|
|
6080
6090
|
icon: zr,
|
|
@@ -6114,11 +6124,11 @@ function ai(t) {
|
|
|
6114
6124
|
allowResizing: r = !0,
|
|
6115
6125
|
allowExcelExport: v = !1,
|
|
6116
6126
|
allowPdfExport: d = !1,
|
|
6117
|
-
showColumnChooser:
|
|
6118
|
-
enableSearchApi:
|
|
6127
|
+
showColumnChooser: p = !1,
|
|
6128
|
+
enableSearchApi: z = !1,
|
|
6119
6129
|
height: F = "600",
|
|
6120
6130
|
selectionSettings: E,
|
|
6121
|
-
enableCheckbox:
|
|
6131
|
+
enableCheckbox: I = !1,
|
|
6122
6132
|
columns: P = [],
|
|
6123
6133
|
onGridStateChange: j,
|
|
6124
6134
|
onRowSelected: U,
|
|
@@ -6126,16 +6136,16 @@ function ai(t) {
|
|
|
6126
6136
|
onRowDoubleClick: q,
|
|
6127
6137
|
apiRef: $,
|
|
6128
6138
|
gridProps: x = {}
|
|
6129
|
-
} = t,
|
|
6130
|
-
pageSettings:
|
|
6139
|
+
} = t, b = fe(null), {
|
|
6140
|
+
pageSettings: S,
|
|
6131
6141
|
sortSettings: O,
|
|
6132
|
-
...
|
|
6133
|
-
} = x || {}, [D,
|
|
6142
|
+
...R
|
|
6143
|
+
} = x || {}, [D, f] = re.useState(S?.page || l), [g, w] = re.useState(S?.pageSize || m), [k, T] = re.useState(O?.sortKey || "updatedDate"), [L, C] = re.useState(O?.direction || "Descending"), M = ae(() => {
|
|
6134
6144
|
const V = E || {
|
|
6135
6145
|
type: "Multiple",
|
|
6136
6146
|
mode: "Row"
|
|
6137
6147
|
};
|
|
6138
|
-
return
|
|
6148
|
+
return I ? {
|
|
6139
6149
|
...V,
|
|
6140
6150
|
// These are important for checkbox selection
|
|
6141
6151
|
enableToggle: !0,
|
|
@@ -6144,23 +6154,23 @@ function ai(t) {
|
|
|
6144
6154
|
checkboxOnly: !1,
|
|
6145
6155
|
enableSimpleMultiRowSelection: !0
|
|
6146
6156
|
} : V;
|
|
6147
|
-
}, [E,
|
|
6157
|
+
}, [E, I]), _ = ae(() => {
|
|
6148
6158
|
const V = [ln];
|
|
6149
|
-
return (
|
|
6159
|
+
return (I || E) && V.push(on), u && V.push(cn), h && V.push(dn), N && V.push(mn), z && V.push(un), v && V.push(hn), d && V.push(pn), p && V.push(gn), r && V.push(bn), y && V.push(fn), V.push(yn), V;
|
|
6150
6160
|
}, [
|
|
6151
6161
|
u,
|
|
6152
6162
|
h,
|
|
6153
6163
|
N,
|
|
6154
|
-
|
|
6164
|
+
z,
|
|
6155
6165
|
v,
|
|
6156
6166
|
d,
|
|
6157
|
-
|
|
6167
|
+
p,
|
|
6158
6168
|
r,
|
|
6159
6169
|
y,
|
|
6160
|
-
|
|
6170
|
+
I,
|
|
6161
6171
|
E
|
|
6162
6172
|
]), A = ae(() => {
|
|
6163
|
-
const V = () =>
|
|
6173
|
+
const V = () => b.current, ne = (J, ce) => {
|
|
6164
6174
|
!ce && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${J} requested but related service/feature is disabled.`);
|
|
6165
6175
|
};
|
|
6166
6176
|
return {
|
|
@@ -6171,7 +6181,7 @@ function ai(t) {
|
|
|
6171
6181
|
selectRow: (J, ce = !1) => V()?.selectRow?.(J, ce),
|
|
6172
6182
|
selectRows: (J, ce = !1) => V()?.selectRows?.(J, ce),
|
|
6173
6183
|
search: (J) => {
|
|
6174
|
-
ne("search()",
|
|
6184
|
+
ne("search()", z), V()?.search?.(J);
|
|
6175
6185
|
},
|
|
6176
6186
|
print: () => V()?.print?.(),
|
|
6177
6187
|
excelExport: (J) => {
|
|
@@ -6181,24 +6191,24 @@ function ai(t) {
|
|
|
6181
6191
|
ne("pdfExport()", d), V()?.pdfExport?.(J);
|
|
6182
6192
|
},
|
|
6183
6193
|
openColumnChooser: (J, ce) => {
|
|
6184
|
-
ne("openColumnChooser()",
|
|
6194
|
+
ne("openColumnChooser()", p), V()?.columnChooserModule?.openColumnChooser?.(J, ce);
|
|
6185
6195
|
},
|
|
6186
6196
|
// Additional useful methods
|
|
6187
6197
|
getColumns: () => V()?.getColumns?.(),
|
|
6188
6198
|
getFilteredRecords: () => V()?.getFilteredRecords?.(),
|
|
6189
6199
|
autoFitColumns: (J) => V()?.autoFitColumns?.(J)
|
|
6190
6200
|
};
|
|
6191
|
-
}, [
|
|
6192
|
-
|
|
6201
|
+
}, [z, v, d, p]);
|
|
6202
|
+
Z(() => {
|
|
6193
6203
|
$ && ($.current = A);
|
|
6194
|
-
}, [$, A]),
|
|
6204
|
+
}, [$, A]), Z(() => () => {
|
|
6195
6205
|
$ && ($.current = null);
|
|
6196
6206
|
}, [$]);
|
|
6197
6207
|
const G = (V) => {
|
|
6198
6208
|
const ne = String(V || "");
|
|
6199
6209
|
return ne === "Ascending" || ne === "Descending" ? ne : ne.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
6200
6210
|
}, W = (V) => {
|
|
6201
|
-
const ne =
|
|
6211
|
+
const ne = b.current, J = V?.requestType, ce = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Re = V?.pageSize ?? ne?.pageSettings?.pageSize ?? g, _e = V?.currentPage ?? ne?.pageSettings?.currentPage ?? l, rt = V?.columnName && V?.direction ? [{ field: V.columnName, dir: G(V.direction) }] : (ne?.sortSettings?.columns || []).map((Ie) => ({
|
|
6202
6212
|
field: Ie.field,
|
|
6203
6213
|
dir: G(Ie.direction ?? Ie.dir)
|
|
6204
6214
|
})), nt = V?.searchString ?? "", st = V?.columns ?? ne?.filterSettings?.columns ?? [];
|
|
@@ -6217,13 +6227,13 @@ function ai(t) {
|
|
|
6217
6227
|
};
|
|
6218
6228
|
}, pe = (V) => {
|
|
6219
6229
|
setTimeout(() => {
|
|
6220
|
-
|
|
6221
|
-
}, 1e3), V.requestType === "paging" && (
|
|
6230
|
+
b?.current?.hideSpinner();
|
|
6231
|
+
}, 1e3), V.requestType === "paging" && (f(V.currentPage), w(V.pageSize)), V.requestType === "sorting" && (T(V.columnName || "updatedDate"), C(V.direction)), j?.(W(V), V);
|
|
6222
6232
|
}, Ne = (V) => {
|
|
6223
6233
|
q?.(V?.rowData, V);
|
|
6224
6234
|
}, Ta = () => {
|
|
6225
6235
|
const V = [];
|
|
6226
|
-
return
|
|
6236
|
+
return I && V.push(
|
|
6227
6237
|
/* @__PURE__ */ e(
|
|
6228
6238
|
$t,
|
|
6229
6239
|
{
|
|
@@ -6282,10 +6292,10 @@ function ai(t) {
|
|
|
6282
6292
|
}), V;
|
|
6283
6293
|
}, Aa = ae(() => ({
|
|
6284
6294
|
currentPage: D,
|
|
6285
|
-
pageSize:
|
|
6286
|
-
pageSizes:
|
|
6295
|
+
pageSize: g,
|
|
6296
|
+
pageSizes: S?.pageSizes ?? [10, 20, 40, 60, 80, 100],
|
|
6287
6297
|
totalCount: s
|
|
6288
|
-
}), [D,
|
|
6298
|
+
}), [D, g, S?.pageSizes, s]), Fa = ae(() => O ?? {
|
|
6289
6299
|
columns: [{ field: k, direction: G(L) }],
|
|
6290
6300
|
allowUnsort: !1
|
|
6291
6301
|
}, [O, k, L]);
|
|
@@ -6293,7 +6303,7 @@ function ai(t) {
|
|
|
6293
6303
|
xn,
|
|
6294
6304
|
{
|
|
6295
6305
|
id: i,
|
|
6296
|
-
ref:
|
|
6306
|
+
ref: b,
|
|
6297
6307
|
dataSource: {
|
|
6298
6308
|
result: a,
|
|
6299
6309
|
count: s
|
|
@@ -6305,7 +6315,7 @@ function ai(t) {
|
|
|
6305
6315
|
allowGrouping: N,
|
|
6306
6316
|
allowReordering: y,
|
|
6307
6317
|
allowResizing: r,
|
|
6308
|
-
showColumnChooser:
|
|
6318
|
+
showColumnChooser: p,
|
|
6309
6319
|
selectionSettings: M,
|
|
6310
6320
|
pageSettings: Aa,
|
|
6311
6321
|
sortSettings: Fa,
|
|
@@ -6314,7 +6324,7 @@ function ai(t) {
|
|
|
6314
6324
|
rowDeselected: Y,
|
|
6315
6325
|
recordDoubleClick: Ne,
|
|
6316
6326
|
cssClass: "custom-grid-padding",
|
|
6317
|
-
...
|
|
6327
|
+
...R,
|
|
6318
6328
|
children: [
|
|
6319
6329
|
/* @__PURE__ */ e(vn, { children: Ta() }),
|
|
6320
6330
|
/* @__PURE__ */ e(Nn, { services: _ })
|
|
@@ -6409,11 +6419,11 @@ function Ts({
|
|
|
6409
6419
|
// spread remaining props (_id, instanceId, etc.)
|
|
6410
6420
|
...v
|
|
6411
6421
|
}) {
|
|
6412
|
-
const d = de(t),
|
|
6422
|
+
const d = de(t), p = me[d];
|
|
6413
6423
|
return /* @__PURE__ */ n(
|
|
6414
6424
|
oe,
|
|
6415
6425
|
{
|
|
6416
|
-
className: `flex flex-col ${
|
|
6426
|
+
className: `flex flex-col ${p.card}`,
|
|
6417
6427
|
showCheckbox: a,
|
|
6418
6428
|
checkboxPosition: s,
|
|
6419
6429
|
onSelect: i,
|
|
@@ -6421,11 +6431,11 @@ function Ts({
|
|
|
6421
6431
|
details: { type: "activity", title: m, group: o, author: h },
|
|
6422
6432
|
...v,
|
|
6423
6433
|
children: [
|
|
6424
|
-
/* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
6425
|
-
/* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${
|
|
6434
|
+
/* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${p.title} ml-3`, children: m }) }),
|
|
6435
|
+
/* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${p.meta}`, children: [
|
|
6426
6436
|
"Posted in ",
|
|
6427
6437
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Global" }),
|
|
6428
|
-
u ? /* @__PURE__ */ n(
|
|
6438
|
+
u ? /* @__PURE__ */ n(te, { children: [
|
|
6429
6439
|
",",
|
|
6430
6440
|
" ",
|
|
6431
6441
|
/* @__PURE__ */ e(
|
|
@@ -6443,7 +6453,7 @@ function Ts({
|
|
|
6443
6453
|
/* @__PURE__ */ e(we, { name: "John", size: "medium" }),
|
|
6444
6454
|
/* @__PURE__ */ n("div", { className: "leading-tight", children: [
|
|
6445
6455
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-100", children: h }),
|
|
6446
|
-
/* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${
|
|
6456
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${p.meta}`, children: N })
|
|
6447
6457
|
] })
|
|
6448
6458
|
] }),
|
|
6449
6459
|
/* @__PURE__ */ n("p", { className: "mt-2 text-zinc-700 dark:text-zinc-300", children: [
|
|
@@ -6460,7 +6470,7 @@ function Ts({
|
|
|
6460
6470
|
/* @__PURE__ */ e(
|
|
6461
6471
|
"div",
|
|
6462
6472
|
{
|
|
6463
|
-
className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${
|
|
6473
|
+
className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${p.media}`,
|
|
6464
6474
|
children: /* @__PURE__ */ e("img", { src: y, alt: "", className: "h-full w-full object-cover" })
|
|
6465
6475
|
}
|
|
6466
6476
|
),
|
|
@@ -6834,18 +6844,18 @@ function _s({
|
|
|
6834
6844
|
// optional full embed URL override
|
|
6835
6845
|
...v
|
|
6836
6846
|
}) {
|
|
6837
|
-
const d = de(t),
|
|
6847
|
+
const d = de(t), p = me[d], z = Bs[d], F = r || js(N, y);
|
|
6838
6848
|
return /* @__PURE__ */ e(
|
|
6839
6849
|
oe,
|
|
6840
6850
|
{
|
|
6841
|
-
className: `flex flex-col ${
|
|
6851
|
+
className: `flex flex-col ${p.card} ${z.wrap}`,
|
|
6842
6852
|
showCheckbox: a,
|
|
6843
6853
|
checkboxPosition: s,
|
|
6844
6854
|
onSelect: i,
|
|
6845
6855
|
identity: l,
|
|
6846
6856
|
details: { type: "campus-map", title: m, campusName: o, activeFilter: h, mapQuery: N, zoom: y },
|
|
6847
6857
|
...v,
|
|
6848
|
-
children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${
|
|
6858
|
+
children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${z.mapH}`, children: [
|
|
6849
6859
|
/* @__PURE__ */ e(
|
|
6850
6860
|
"iframe",
|
|
6851
6861
|
{
|
|
@@ -6859,7 +6869,7 @@ function _s({
|
|
|
6859
6869
|
}
|
|
6860
6870
|
),
|
|
6861
6871
|
/* @__PURE__ */ n("div", { className: "absolute left-4 right-4 top-3 flex items-center justify-between pointer-events-none", children: [
|
|
6862
|
-
/* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${
|
|
6872
|
+
/* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${z.campusPill}`, children: [
|
|
6863
6873
|
/* @__PURE__ */ e("span", { className: "truncate max-w-[60vw]", children: o }),
|
|
6864
6874
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-400", children: "▾" })
|
|
6865
6875
|
] }),
|
|
@@ -6868,8 +6878,8 @@ function _s({
|
|
|
6868
6878
|
/* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-full bg-white/90 border border-zinc-300 flex items-center justify-center", children: "›" })
|
|
6869
6879
|
] })
|
|
6870
6880
|
] }),
|
|
6871
|
-
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-14 md:top-12 pointer-events-none mt-2", children: /* @__PURE__ */ e("div", { className: `flex ${
|
|
6872
|
-
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-28 md:top-24 pointer-events-none", children: /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 px-4 ${
|
|
6881
|
+
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-14 md:top-12 pointer-events-none mt-2", children: /* @__PURE__ */ e("div", { className: `flex ${z.chipGap} overflow-x-auto scrollbar-none`, children: u.map((E) => /* @__PURE__ */ e(Vs, { label: E, active: E === h, size: d }, E)) }) }),
|
|
6882
|
+
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-28 md:top-24 pointer-events-none", children: /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 px-4 ${z.searchH}`, children: [
|
|
6873
6883
|
/* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 24 24", "aria-hidden": "true", className: "opacity-60", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M15.5 14h-.79l-.28-.27a6.471 6.471 0 001.48-4.23C15.91 6.01 13.4 3.5 10.45 3.5S5 6.01 5 9.5 7.5 15.5 10.45 15.5c1.61 0 3.09-.59 4.23-1.48l.27.28v.79l4.25 4.25c.41.41 1.07.41 1.48 0s.41-1.07 0-1.48L15.5 14Zm-5.05 0C8.01 14 6 11.99 6 9.5S8.01 5 10.45 5s4.45 2.01 4.45 4.5-2.01 4.5-4.45 4.5Z" }) }),
|
|
6874
6884
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-500 dark:text-zinc-400", children: "Search places" })
|
|
6875
6885
|
] }) })
|
|
@@ -7040,8 +7050,8 @@ function Ws({
|
|
|
7040
7050
|
selectedIndex: u = 0,
|
|
7041
7051
|
...h
|
|
7042
7052
|
}) {
|
|
7043
|
-
const [N, y] = B(u), r = de(t), v = me[r], d = Gs[r],
|
|
7044
|
-
y(
|
|
7053
|
+
const [N, y] = B(u), r = de(t), v = me[r], d = Gs[r], p = o[N] || o[0], z = (E, I) => {
|
|
7054
|
+
y(I), i?.(E);
|
|
7045
7055
|
}, F = r === "lg";
|
|
7046
7056
|
return /* @__PURE__ */ n(
|
|
7047
7057
|
oe,
|
|
@@ -7061,29 +7071,29 @@ function Ws({
|
|
|
7061
7071
|
F ? (
|
|
7062
7072
|
// Large: Two-column layout
|
|
7063
7073
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
7064
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E,
|
|
7074
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7065
7075
|
_t,
|
|
7066
7076
|
{
|
|
7067
7077
|
ev: E,
|
|
7068
7078
|
sizeMeta: d,
|
|
7069
|
-
isSelected:
|
|
7070
|
-
onClick: (P) =>
|
|
7079
|
+
isSelected: I === N,
|
|
7080
|
+
onClick: (P) => z(P, I)
|
|
7071
7081
|
},
|
|
7072
|
-
E._id || E.id ||
|
|
7082
|
+
E._id || E.id || I
|
|
7073
7083
|
)) }),
|
|
7074
|
-
/* @__PURE__ */ e(Ys, { ev:
|
|
7084
|
+
/* @__PURE__ */ e(Ys, { ev: p, sizeMeta: d })
|
|
7075
7085
|
] })
|
|
7076
7086
|
) : (
|
|
7077
7087
|
// Small/Medium: Simple list only
|
|
7078
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E,
|
|
7088
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7079
7089
|
_t,
|
|
7080
7090
|
{
|
|
7081
7091
|
ev: E,
|
|
7082
7092
|
sizeMeta: d,
|
|
7083
|
-
isSelected:
|
|
7084
|
-
onClick: (P) =>
|
|
7093
|
+
isSelected: I === N,
|
|
7094
|
+
onClick: (P) => z(P, I)
|
|
7085
7095
|
},
|
|
7086
|
-
E._id || E.id ||
|
|
7096
|
+
E._id || E.id || I
|
|
7087
7097
|
)) })
|
|
7088
7098
|
),
|
|
7089
7099
|
!F && /* @__PURE__ */ e("div", { className: "mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-800", children: /* @__PURE__ */ e("button", { className: "w-full text-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200", children: "View All" }) })
|
|
@@ -7257,19 +7267,19 @@ function Qs({
|
|
|
7257
7267
|
onPin: N,
|
|
7258
7268
|
...y
|
|
7259
7269
|
}) {
|
|
7260
|
-
const [r, v] = B(u), d = de(t),
|
|
7270
|
+
const [r, v] = B(u), d = de(t), p = me[d], z = Xs[d], F = (P, j) => {
|
|
7261
7271
|
v(j), i?.(P);
|
|
7262
7272
|
}, E = (P) => {
|
|
7263
7273
|
const j = { ...P, starred: !P.starred };
|
|
7264
7274
|
h?.(j);
|
|
7265
|
-
},
|
|
7275
|
+
}, I = (P) => {
|
|
7266
7276
|
const j = { ...P, pinned: !P.pinned };
|
|
7267
7277
|
N?.(j);
|
|
7268
7278
|
};
|
|
7269
7279
|
return /* @__PURE__ */ n(
|
|
7270
7280
|
oe,
|
|
7271
7281
|
{
|
|
7272
|
-
className: `flex flex-col ${
|
|
7282
|
+
className: `flex flex-col ${p.card} ${z.wrap}`,
|
|
7273
7283
|
showCheckbox: a,
|
|
7274
7284
|
checkboxPosition: s,
|
|
7275
7285
|
onSelect: i,
|
|
@@ -7277,17 +7287,17 @@ function Qs({
|
|
|
7277
7287
|
details: { type: "emails", title: m, count: o?.length ?? 0 },
|
|
7278
7288
|
...y,
|
|
7279
7289
|
children: [
|
|
7280
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
7290
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${p.title}`, children: m }) }),
|
|
7281
7291
|
/* @__PURE__ */ e(ge, { placeholder: "Type to search..." }),
|
|
7282
7292
|
/* @__PURE__ */ e("div", { className: "space-y-0", children: o.map((P, j) => /* @__PURE__ */ e(
|
|
7283
7293
|
Hs,
|
|
7284
7294
|
{
|
|
7285
7295
|
email: P,
|
|
7286
|
-
sizeMeta:
|
|
7296
|
+
sizeMeta: z,
|
|
7287
7297
|
isSelected: j === r,
|
|
7288
7298
|
onClick: (U) => F(U, j),
|
|
7289
7299
|
onStar: E,
|
|
7290
|
-
onPin:
|
|
7300
|
+
onPin: I
|
|
7291
7301
|
},
|
|
7292
7302
|
P._id || P.id || j
|
|
7293
7303
|
)) }),
|
|
@@ -7509,9 +7519,9 @@ function al({
|
|
|
7509
7519
|
selectedIndex: u = 0,
|
|
7510
7520
|
...h
|
|
7511
7521
|
}) {
|
|
7512
|
-
const [N, y] = B(u), r = de(t), v = me[r], d = Ks[r],
|
|
7513
|
-
y(
|
|
7514
|
-
},
|
|
7522
|
+
const [N, y] = B(u), r = de(t), v = me[r], d = Ks[r], p = (E, I) => {
|
|
7523
|
+
y(I), i?.(E);
|
|
7524
|
+
}, z = o[N] || o[0], F = d.layout === "split";
|
|
7515
7525
|
return /* @__PURE__ */ n(
|
|
7516
7526
|
oe,
|
|
7517
7527
|
{
|
|
@@ -7526,34 +7536,34 @@ function al({
|
|
|
7526
7536
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between mb-4", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: m }) }),
|
|
7527
7537
|
/* @__PURE__ */ e(tl, { sizeMeta: d }),
|
|
7528
7538
|
F ? /* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0", children: [
|
|
7529
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E,
|
|
7539
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7530
7540
|
Ut,
|
|
7531
7541
|
{
|
|
7532
7542
|
contact: E,
|
|
7533
7543
|
sizeMeta: d,
|
|
7534
|
-
isSelected:
|
|
7535
|
-
onClick: (P) =>
|
|
7544
|
+
isSelected: I === N,
|
|
7545
|
+
onClick: (P) => p(P, I)
|
|
7536
7546
|
},
|
|
7537
|
-
E._id || E.id ||
|
|
7547
|
+
E._id || E.id || I
|
|
7538
7548
|
)) }),
|
|
7539
7549
|
/* @__PURE__ */ e(
|
|
7540
7550
|
el,
|
|
7541
7551
|
{
|
|
7542
|
-
contact:
|
|
7552
|
+
contact: z,
|
|
7543
7553
|
sizeMeta: d
|
|
7544
7554
|
}
|
|
7545
7555
|
)
|
|
7546
7556
|
] }) : (
|
|
7547
7557
|
// Single column layout for small screens
|
|
7548
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E,
|
|
7558
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7549
7559
|
Ut,
|
|
7550
7560
|
{
|
|
7551
7561
|
contact: E,
|
|
7552
7562
|
sizeMeta: d,
|
|
7553
|
-
isSelected:
|
|
7554
|
-
onClick: (P) =>
|
|
7563
|
+
isSelected: I === N,
|
|
7564
|
+
onClick: (P) => p(P, I)
|
|
7555
7565
|
},
|
|
7556
|
-
E._id || E.id ||
|
|
7566
|
+
E._id || E.id || I
|
|
7557
7567
|
)) })
|
|
7558
7568
|
),
|
|
7559
7569
|
/* @__PURE__ */ e("div", { className: "mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-800", children: /* @__PURE__ */ e("button", { className: "w-full text-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200", children: "View All" }) })
|
|
@@ -7661,11 +7671,11 @@ function sl({
|
|
|
7661
7671
|
],
|
|
7662
7672
|
...r
|
|
7663
7673
|
}) {
|
|
7664
|
-
const v = de(t), d = me[v],
|
|
7674
|
+
const v = de(t), d = me[v], p = nl[v];
|
|
7665
7675
|
return /* @__PURE__ */ n(
|
|
7666
7676
|
oe,
|
|
7667
7677
|
{
|
|
7668
|
-
className: `flex flex-col ${d.card} ${
|
|
7678
|
+
className: `flex flex-col ${d.card} ${p.wrap}`,
|
|
7669
7679
|
showCheckbox: a,
|
|
7670
7680
|
checkboxPosition: s,
|
|
7671
7681
|
onSelect: i,
|
|
@@ -7680,11 +7690,11 @@ function sl({
|
|
|
7680
7690
|
/* @__PURE__ */ e(Nt, { className: "h-4 w-4 opacity-70" })
|
|
7681
7691
|
] })
|
|
7682
7692
|
] }),
|
|
7683
|
-
/* @__PURE__ */ n("div", { className:
|
|
7693
|
+
/* @__PURE__ */ n("div", { className: p.topGrid || p.grid, children: [
|
|
7684
7694
|
/* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
7685
7695
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Account Balance" }),
|
|
7686
|
-
/* @__PURE__ */ e("div", { className:
|
|
7687
|
-
!
|
|
7696
|
+
/* @__PURE__ */ e("div", { className: p.balance, children: Te(u) }),
|
|
7697
|
+
!p.showTxns && /* @__PURE__ */ n("div", { className: p.totalsRow, children: [
|
|
7688
7698
|
/* @__PURE__ */ n("div", { children: [
|
|
7689
7699
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
|
|
7690
7700
|
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(h) })
|
|
@@ -7695,8 +7705,8 @@ function sl({
|
|
|
7695
7705
|
] })
|
|
7696
7706
|
] })
|
|
7697
7707
|
] }),
|
|
7698
|
-
|
|
7699
|
-
/* @__PURE__ */ n("div", { className:
|
|
7708
|
+
p.showTxns && /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
7709
|
+
/* @__PURE__ */ n("div", { className: p.totalsRow, children: [
|
|
7700
7710
|
/* @__PURE__ */ n("div", { children: [
|
|
7701
7711
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
|
|
7702
7712
|
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(h) })
|
|
@@ -7706,16 +7716,16 @@ function sl({
|
|
|
7706
7716
|
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: Te(N) })
|
|
7707
7717
|
] })
|
|
7708
7718
|
] }),
|
|
7709
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: y.slice(0, 2).map((
|
|
7719
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: y.slice(0, 2).map((z, F) => /* @__PURE__ */ e(
|
|
7710
7720
|
rl,
|
|
7711
7721
|
{
|
|
7712
7722
|
side: F === 0 ? "left" : "right",
|
|
7713
|
-
date:
|
|
7714
|
-
title:
|
|
7715
|
-
amount:
|
|
7716
|
-
kind:
|
|
7723
|
+
date: z.date,
|
|
7724
|
+
title: z.title,
|
|
7725
|
+
amount: z.amount,
|
|
7726
|
+
kind: z.kind
|
|
7717
7727
|
},
|
|
7718
|
-
|
|
7728
|
+
z.id || F
|
|
7719
7729
|
)) })
|
|
7720
7730
|
] })
|
|
7721
7731
|
] }),
|
|
@@ -7723,7 +7733,7 @@ function sl({
|
|
|
7723
7733
|
"button",
|
|
7724
7734
|
{
|
|
7725
7735
|
type: "button",
|
|
7726
|
-
className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${
|
|
7736
|
+
className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${p.buttonPad}
|
|
7727
7737
|
border-orange-400 text-zinc-900 dark:text-zinc-100 bg-white dark:bg-zinc-900`,
|
|
7728
7738
|
"aria-label": "View Transactions (mock)",
|
|
7729
7739
|
children: [
|
|
@@ -7834,11 +7844,11 @@ function il({
|
|
|
7834
7844
|
term: o = "Fall 2025",
|
|
7835
7845
|
...u
|
|
7836
7846
|
}) {
|
|
7837
|
-
const [h, N] = B("vacation"), [y, r] = B(!1), v = de(t), d = me[v],
|
|
7847
|
+
const [h, N] = B("vacation"), [y, r] = B(!1), v = de(t), d = me[v], p = ll[v], z = Ye.find((F) => F.id === h) || Ye[0];
|
|
7838
7848
|
return /* @__PURE__ */ n(
|
|
7839
7849
|
oe,
|
|
7840
7850
|
{
|
|
7841
|
-
className: `flex flex-col ${d.card} ${
|
|
7851
|
+
className: `flex flex-col ${d.card} ${p.wrap}`,
|
|
7842
7852
|
showCheckbox: a,
|
|
7843
7853
|
checkboxPosition: s,
|
|
7844
7854
|
onSelect: i,
|
|
@@ -7848,8 +7858,8 @@ function il({
|
|
|
7848
7858
|
children: [
|
|
7849
7859
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
7850
7860
|
/* @__PURE__ */ n("div", { children: [
|
|
7851
|
-
/* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${
|
|
7852
|
-
/* @__PURE__ */ n("div", { className: `text-zinc-600 dark:text-zinc-400 ${
|
|
7861
|
+
/* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${p.title} mb-1`, children: m }),
|
|
7862
|
+
/* @__PURE__ */ n("div", { className: `text-zinc-600 dark:text-zinc-400 ${p.term} flex items-center gap-2`, children: [
|
|
7853
7863
|
/* @__PURE__ */ e(Wt, { className: "h-4 w-4" }),
|
|
7854
7864
|
"Term - ",
|
|
7855
7865
|
o
|
|
@@ -7870,28 +7880,28 @@ function il({
|
|
|
7870
7880
|
] })
|
|
7871
7881
|
] })
|
|
7872
7882
|
] }),
|
|
7873
|
-
|
|
7883
|
+
p.showTabs && /* @__PURE__ */ e("div", { className: "flex border-b border-zinc-200 dark:border-zinc-800", children: Ye.map((F) => /* @__PURE__ */ e(
|
|
7874
7884
|
"button",
|
|
7875
7885
|
{
|
|
7876
|
-
className: `flex-1 py-2 px-4 text-center ${
|
|
7886
|
+
className: `flex-1 py-2 px-4 text-center ${p.tab} font-medium border-b-2 transition-colors duration-200 ${h === F.id ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100"}`,
|
|
7877
7887
|
onClick: () => N(F.id),
|
|
7878
7888
|
children: F.name.split(" ")[0]
|
|
7879
7889
|
},
|
|
7880
7890
|
F.id
|
|
7881
7891
|
)) }),
|
|
7882
|
-
/* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children:
|
|
7892
|
+
/* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children: p.showAllLeave ? (
|
|
7883
7893
|
// LG: Show all leave types
|
|
7884
|
-
Ye.map((F) => /* @__PURE__ */ e(Gt, { leave: F, sizeMeta:
|
|
7885
|
-
) :
|
|
7894
|
+
Ye.map((F) => /* @__PURE__ */ e(Gt, { leave: F, sizeMeta: p }, F.id))
|
|
7895
|
+
) : p.showSingleLeave ? (
|
|
7886
7896
|
// MD: Show active tab leave type
|
|
7887
|
-
/* @__PURE__ */ e(Gt, { leave:
|
|
7897
|
+
/* @__PURE__ */ e(Gt, { leave: z, sizeMeta: p })
|
|
7888
7898
|
) : (
|
|
7889
7899
|
// SM: Show only available hours
|
|
7890
7900
|
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-900 rounded-lg border border-zinc-200 dark:border-zinc-800 p-4", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-3 mb-3", children: [
|
|
7891
7901
|
/* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-blue-600 dark:text-blue-400" }),
|
|
7892
7902
|
/* @__PURE__ */ n("div", { children: [
|
|
7893
|
-
/* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${
|
|
7894
|
-
/* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${
|
|
7903
|
+
/* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${p.table}`, children: "Available Leave" }),
|
|
7904
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${p.table}`, children: z.available })
|
|
7895
7905
|
] })
|
|
7896
7906
|
] }) })
|
|
7897
7907
|
) }),
|
|
@@ -8271,9 +8281,9 @@ function fl({
|
|
|
8271
8281
|
showBanner: u = !0,
|
|
8272
8282
|
...h
|
|
8273
8283
|
}) {
|
|
8274
|
-
const [N, y] = B(o), r = de(t), v = me[r], d = hl[r],
|
|
8275
|
-
y((
|
|
8276
|
-
},
|
|
8284
|
+
const [N, y] = B(o), r = de(t), v = me[r], d = hl[r], p = (E) => {
|
|
8285
|
+
y((I) => I.filter((P) => P.id !== E.id));
|
|
8286
|
+
}, z = N.find((E) => E.type === "banner"), F = N.filter((E) => E.type !== "banner");
|
|
8277
8287
|
return /* @__PURE__ */ n(
|
|
8278
8288
|
oe,
|
|
8279
8289
|
{
|
|
@@ -8286,11 +8296,11 @@ function fl({
|
|
|
8286
8296
|
...h,
|
|
8287
8297
|
children: [
|
|
8288
8298
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between ", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: m }) }),
|
|
8289
|
-
u &&
|
|
8299
|
+
u && z && t !== "sm" && /* @__PURE__ */ e(
|
|
8290
8300
|
bl,
|
|
8291
8301
|
{
|
|
8292
|
-
alert:
|
|
8293
|
-
onDismiss:
|
|
8302
|
+
alert: z,
|
|
8303
|
+
onDismiss: p
|
|
8294
8304
|
}
|
|
8295
8305
|
),
|
|
8296
8306
|
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: F.slice(0, 3).map((E) => /* @__PURE__ */ e(
|
|
@@ -8298,7 +8308,7 @@ function fl({
|
|
|
8298
8308
|
{
|
|
8299
8309
|
alert: E,
|
|
8300
8310
|
sizeMeta: d,
|
|
8301
|
-
onDismiss:
|
|
8311
|
+
onDismiss: p
|
|
8302
8312
|
},
|
|
8303
8313
|
E.id
|
|
8304
8314
|
)) }),
|