unifyedx-storybook-new 0.2.13 → 0.2.14
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.
|
@@ -828,11 +828,11 @@ const _r = {
|
|
|
828
828
|
// Deep copy
|
|
829
829
|
onSubmit: (C) => {
|
|
830
830
|
const T = {};
|
|
831
|
-
Object.keys(C).forEach((
|
|
832
|
-
T[
|
|
833
|
-
operator: C[
|
|
834
|
-
values: Array.isArray(C[
|
|
835
|
-
range: C[
|
|
831
|
+
Object.keys(C).forEach((E) => {
|
|
832
|
+
T[E] = {
|
|
833
|
+
operator: C[E].operator || "in",
|
|
834
|
+
values: Array.isArray(C[E].values) ? C[E].values : [],
|
|
835
|
+
range: C[E].range || null
|
|
836
836
|
};
|
|
837
837
|
}), console.log("[storybook filter] Applied Filters:", T), typeof s == "function" && s({
|
|
838
838
|
filters: T,
|
|
@@ -841,38 +841,38 @@ const _r = {
|
|
|
841
841
|
},
|
|
842
842
|
enableReinitialize: !0
|
|
843
843
|
}), k = ce(() => n.reduce((C, T) => {
|
|
844
|
-
const
|
|
844
|
+
const E = T.key, R = a.values[E];
|
|
845
845
|
let V = !1;
|
|
846
|
-
if (
|
|
846
|
+
if (R)
|
|
847
847
|
switch (T.type) {
|
|
848
848
|
case "multiselect":
|
|
849
849
|
case "multiselect-users":
|
|
850
|
-
V = Array.isArray(
|
|
850
|
+
V = Array.isArray(R.values) && R.values.length > 0;
|
|
851
851
|
break;
|
|
852
852
|
case "date":
|
|
853
|
-
(
|
|
853
|
+
(R.range && R.range !== "" || Array.isArray(R.values) && R.values.length > 0) && (V = !0);
|
|
854
854
|
break;
|
|
855
855
|
}
|
|
856
|
-
return C[
|
|
856
|
+
return C[E] = V, C;
|
|
857
857
|
}, {}), [n, a.values]), m = Object.values(k).filter(Boolean).length, g = async (C, T) => {
|
|
858
858
|
try {
|
|
859
|
-
N((
|
|
860
|
-
const
|
|
861
|
-
y((
|
|
862
|
-
} catch (
|
|
863
|
-
console.error(`Error fetching ${C} users:`,
|
|
859
|
+
N((R) => ({ ...R, [C]: !0 }));
|
|
860
|
+
const E = await i(C, T);
|
|
861
|
+
y((R) => ({ ...R, [C]: E }));
|
|
862
|
+
} catch (E) {
|
|
863
|
+
console.error(`Error fetching ${C} users:`, E);
|
|
864
864
|
} finally {
|
|
865
|
-
N((
|
|
865
|
+
N((E) => ({ ...E, [C]: !1 }));
|
|
866
866
|
}
|
|
867
867
|
}, $ = (C) => {
|
|
868
|
-
const T = n[C].key,
|
|
869
|
-
n[C].type === "multiselect-users" && d[T].length === 0 && !b[T] && g(T,
|
|
868
|
+
const T = n[C].key, E = n[C].url;
|
|
869
|
+
n[C].type === "multiselect-users" && d[T].length === 0 && !b[T] && g(T, E);
|
|
870
870
|
}, L = () => {
|
|
871
871
|
a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
|
|
872
872
|
}, O = (C) => {
|
|
873
873
|
const T = n.find((V) => V.key === C);
|
|
874
874
|
if (!T) return null;
|
|
875
|
-
const
|
|
875
|
+
const E = a.values[C] || u[C], R = Array.isArray(E.values) ? E.values : [];
|
|
876
876
|
switch (T.type) {
|
|
877
877
|
case "multiselect":
|
|
878
878
|
return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
|
|
@@ -881,7 +881,7 @@ const _r = {
|
|
|
881
881
|
/* @__PURE__ */ e(
|
|
882
882
|
"select",
|
|
883
883
|
{
|
|
884
|
-
value:
|
|
884
|
+
value: E.operator || "in",
|
|
885
885
|
onChange: (c) => a.setFieldValue(`${C}.operator`, c.target.value),
|
|
886
886
|
className: "filter-select",
|
|
887
887
|
children: T.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
|
|
@@ -896,7 +896,7 @@ const _r = {
|
|
|
896
896
|
type: "checkbox",
|
|
897
897
|
id: `select-all-${C}`,
|
|
898
898
|
className: "filter-checkbox-input",
|
|
899
|
-
checked: T.options.length > 0 &&
|
|
899
|
+
checked: T.options.length > 0 && R.length === T.options.length,
|
|
900
900
|
onChange: (c) => {
|
|
901
901
|
const h = c.target.checked ? T.options.map((x) => x.value) : [];
|
|
902
902
|
a.setFieldValue(`${C}.values`, h);
|
|
@@ -919,9 +919,9 @@ const _r = {
|
|
|
919
919
|
type: "checkbox",
|
|
920
920
|
id: `${C}-${c.value}`,
|
|
921
921
|
className: "filter-checkbox-input",
|
|
922
|
-
checked:
|
|
922
|
+
checked: R.includes(c.value),
|
|
923
923
|
onChange: (h) => {
|
|
924
|
-
const x = h.target.checked ? [...
|
|
924
|
+
const x = h.target.checked ? [...R, c.value] : R.filter((F) => F !== c.value);
|
|
925
925
|
a.setFieldValue(`${C}.values`, x);
|
|
926
926
|
}
|
|
927
927
|
}
|
|
@@ -945,7 +945,7 @@ const _r = {
|
|
|
945
945
|
/* @__PURE__ */ e(
|
|
946
946
|
"select",
|
|
947
947
|
{
|
|
948
|
-
value:
|
|
948
|
+
value: E.operator || "in",
|
|
949
949
|
onChange: (c) => a.setFieldValue(`${C}.operator`, c.target.value),
|
|
950
950
|
className: "filter-select",
|
|
951
951
|
children: T.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
|
|
@@ -960,7 +960,7 @@ const _r = {
|
|
|
960
960
|
type: "checkbox",
|
|
961
961
|
id: `select-all-users-${C}`,
|
|
962
962
|
className: "filter-checkbox-input",
|
|
963
|
-
checked: V.length > 0 &&
|
|
963
|
+
checked: V.length > 0 && R.length === V.length,
|
|
964
964
|
onChange: (c) => {
|
|
965
965
|
const h = c.target.checked ? V.map((x) => x.email) : [];
|
|
966
966
|
a.setFieldValue(
|
|
@@ -986,9 +986,9 @@ const _r = {
|
|
|
986
986
|
type: "checkbox",
|
|
987
987
|
id: `${C}-${c.email}`,
|
|
988
988
|
className: "filter-checkbox-input",
|
|
989
|
-
checked:
|
|
989
|
+
checked: R.includes(c.email),
|
|
990
990
|
onChange: (h) => {
|
|
991
|
-
const x = h.target.checked ? [...
|
|
991
|
+
const x = h.target.checked ? [...R, c.email] : R.filter((F) => F !== c.email);
|
|
992
992
|
a.setFieldValue(
|
|
993
993
|
`${C}.values`,
|
|
994
994
|
x
|
|
@@ -1011,7 +1011,7 @@ const _r = {
|
|
|
1011
1011
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1012
1012
|
] });
|
|
1013
1013
|
case "date":
|
|
1014
|
-
const G =
|
|
1014
|
+
const G = E.values || [], [v, p] = G, f = v && p, w = {
|
|
1015
1015
|
startDate: v instanceof Date ? v : /* @__PURE__ */ new Date(),
|
|
1016
1016
|
// Fallback to today
|
|
1017
1017
|
endDate: p instanceof Date ? p : /* @__PURE__ */ new Date(),
|
|
@@ -1024,7 +1024,7 @@ const _r = {
|
|
|
1024
1024
|
/* @__PURE__ */ e(
|
|
1025
1025
|
"select",
|
|
1026
1026
|
{
|
|
1027
|
-
value:
|
|
1027
|
+
value: E.operator,
|
|
1028
1028
|
onChange: (c) => a.setFieldValue(`${C}.operator`, c.target.value),
|
|
1029
1029
|
className: "filter-select",
|
|
1030
1030
|
children: T.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Is" : "Is not" }, c))
|
|
@@ -2497,8 +2497,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2497
2497
|
},
|
|
2498
2498
|
isChanged: d = !1
|
|
2499
2499
|
}) => {
|
|
2500
|
-
const [y, b] = B(ga[0]), [N, a] = B(""), k = oa(N, 400), [m, g] = B([]), [$, L] = B(/* @__PURE__ */ new Set()), [O, C] = B(!1), [T,
|
|
2501
|
-
control:
|
|
2500
|
+
const [y, b] = B(ga[0]), [N, a] = B(""), k = oa(N, 400), [m, g] = B([]), [$, L] = B(/* @__PURE__ */ new Set()), [O, C] = B(!1), [T, E] = B(ya[0]), {
|
|
2501
|
+
control: R,
|
|
2502
2502
|
handleSubmit: V,
|
|
2503
2503
|
watch: q,
|
|
2504
2504
|
formState: { errors: G, isSubmitting: v }
|
|
@@ -2506,7 +2506,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2506
2506
|
defaultValues: { pendingInvites: [] },
|
|
2507
2507
|
resolver: Lt(yn)
|
|
2508
2508
|
}), { fields: p, append: f, remove: w, update: c } = Pt({
|
|
2509
|
-
control:
|
|
2509
|
+
control: R,
|
|
2510
2510
|
name: "pendingInvites"
|
|
2511
2511
|
}), h = q("pendingInvites");
|
|
2512
2512
|
X(() => {
|
|
@@ -2523,8 +2523,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2523
2523
|
m.filter((D) => $.has(D.id)).forEach((D) => {
|
|
2524
2524
|
p.find((z) => z.id === D.id) || f({ ...D, permission: T.name });
|
|
2525
2525
|
}), L(/* @__PURE__ */ new Set()), a("");
|
|
2526
|
-
},
|
|
2527
|
-
|
|
2526
|
+
}, I = (D) => {
|
|
2527
|
+
E(D), p.forEach(
|
|
2528
2528
|
(z, U) => c(U, { ...p[U], permission: D.name })
|
|
2529
2529
|
);
|
|
2530
2530
|
}, j = async (D) => {
|
|
@@ -2749,7 +2749,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2749
2749
|
Z,
|
|
2750
2750
|
{
|
|
2751
2751
|
value: T,
|
|
2752
|
-
onChange:
|
|
2752
|
+
onChange: I,
|
|
2753
2753
|
children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2754
2754
|
/* @__PURE__ */ l(Z.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: [
|
|
2755
2755
|
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
@@ -2980,20 +2980,23 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2980
2980
|
roles: i.roles.filter(
|
|
2981
2981
|
(C) => C.name.toLowerCase().includes(k.toLowerCase())
|
|
2982
2982
|
)
|
|
2983
|
-
}, g = async (C, T,
|
|
2983
|
+
}, g = async (C, T, E, R) => {
|
|
2984
2984
|
const V = T.value;
|
|
2985
2985
|
d((q) => ({
|
|
2986
2986
|
...q,
|
|
2987
|
-
[
|
|
2987
|
+
[E]: q[E].map(
|
|
2988
2988
|
(G) => G.id === C.id ? { ...G, permission: V } : G
|
|
2989
2989
|
)
|
|
2990
2990
|
}));
|
|
2991
2991
|
}, $ = () => {
|
|
2992
|
-
d((C) =>
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2992
|
+
d((C) => {
|
|
2993
|
+
const T = {
|
|
2994
|
+
users: C.users.filter((E) => E.permission !== "remove"),
|
|
2995
|
+
groups: C.groups.filter((E) => E.permission !== "remove"),
|
|
2996
|
+
roles: C.roles.filter((E) => E.permission !== "remove")
|
|
2997
|
+
};
|
|
2998
|
+
return r(T), T;
|
|
2999
|
+
});
|
|
2997
3000
|
}, L = ["users", "groups", "roles"], O = ["Users", "Groups", "Roles"];
|
|
2998
3001
|
return (
|
|
2999
3002
|
// The main structure remains the same...
|
|
@@ -3098,9 +3101,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3098
3101
|
{
|
|
3099
3102
|
item: T,
|
|
3100
3103
|
allowedPermissions: u,
|
|
3101
|
-
onPermissionChange: (
|
|
3104
|
+
onPermissionChange: (E) => g(
|
|
3102
3105
|
T,
|
|
3103
|
-
|
|
3106
|
+
E,
|
|
3104
3107
|
C
|
|
3105
3108
|
)
|
|
3106
3109
|
}
|
|
@@ -3280,7 +3283,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3280
3283
|
allowedPermissions: d = [],
|
|
3281
3284
|
...y
|
|
3282
3285
|
}) => {
|
|
3283
|
-
const [b, N] = B(de.INVITE), [a, k] = B(t), [m, g] = B(null), [$, L] = B(!1), [O, C] = B([]), [T,
|
|
3286
|
+
const [b, N] = B(de.INVITE), [a, k] = B(t), [m, g] = B(null), [$, L] = B(!1), [O, C] = B([]), [T, E] = B(de.MANAGE), R = () => {
|
|
3284
3287
|
N(de.INVITE), g(null), u();
|
|
3285
3288
|
}, V = () => {
|
|
3286
3289
|
N(de.MANAGE);
|
|
@@ -3293,7 +3296,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3293
3296
|
}
|
|
3294
3297
|
C(resp);
|
|
3295
3298
|
}
|
|
3296
|
-
g({ id: p, type: w, name: f }),
|
|
3299
|
+
g({ id: p, type: w, name: f }), E(b), N(de.MEMBERS);
|
|
3297
3300
|
}, G = (p) => {
|
|
3298
3301
|
k(p);
|
|
3299
3302
|
const f = !He.isEqual(
|
|
@@ -3302,7 +3305,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3302
3305
|
);
|
|
3303
3306
|
L(f), N(b === de.MEMBERS ? T : de.INVITE);
|
|
3304
3307
|
};
|
|
3305
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose:
|
|
3308
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: R, children: [
|
|
3306
3309
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
3307
3310
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(Se, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
|
|
3308
3311
|
switch (b) {
|
|
@@ -3320,7 +3323,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3320
3323
|
{
|
|
3321
3324
|
entity: o,
|
|
3322
3325
|
onBack: G,
|
|
3323
|
-
onClose:
|
|
3326
|
+
onClose: R,
|
|
3324
3327
|
onOpenMembers: q,
|
|
3325
3328
|
existingShares: a,
|
|
3326
3329
|
calledBy: n,
|
|
@@ -3344,7 +3347,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3344
3347
|
{
|
|
3345
3348
|
entity: m,
|
|
3346
3349
|
onBack: G,
|
|
3347
|
-
onClose:
|
|
3350
|
+
onClose: R,
|
|
3348
3351
|
calledBy: n,
|
|
3349
3352
|
existingShares: a,
|
|
3350
3353
|
members: O
|
|
@@ -3367,7 +3370,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3367
3370
|
{
|
|
3368
3371
|
entity: o,
|
|
3369
3372
|
onManage: V,
|
|
3370
|
-
onClose:
|
|
3373
|
+
onClose: R,
|
|
3371
3374
|
existingShares: a,
|
|
3372
3375
|
calledBy: n,
|
|
3373
3376
|
showExistingShares: i,
|
|
@@ -3410,11 +3413,11 @@ function Ye({
|
|
|
3410
3413
|
getOptionId: m = ($) => String($.id),
|
|
3411
3414
|
getOptionLabel: g = ($) => $.name
|
|
3412
3415
|
}) {
|
|
3413
|
-
const $ = ea(), L = ea(), [O, C] = B(""), T = ue(""),
|
|
3416
|
+
const $ = ea(), L = ea(), [O, C] = B(""), T = ue(""), E = ce(() => {
|
|
3414
3417
|
const p = /* @__PURE__ */ new Map();
|
|
3415
3418
|
for (const f of r) p.set(m(f), f);
|
|
3416
3419
|
return p;
|
|
3417
|
-
}, [r, m]),
|
|
3420
|
+
}, [r, m]), R = ce(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? E.get(m(p)) || null : E.get(String(p))).filter(Boolean) : [], [s, E, m]), V = ce(() => {
|
|
3418
3421
|
if (!O) return r;
|
|
3419
3422
|
const p = O.toLowerCase();
|
|
3420
3423
|
return r.filter((f) => g(f).toLowerCase().includes(p));
|
|
@@ -3423,9 +3426,9 @@ function Ye({
|
|
|
3423
3426
|
b === "server" && O.length >= k && O !== T.current && (T.current = O, N && N(O));
|
|
3424
3427
|
}, [O, b, k, N]);
|
|
3425
3428
|
const q = b === "client" ? V : r, G = () => {
|
|
3426
|
-
if (!
|
|
3429
|
+
if (!R.length)
|
|
3427
3430
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
|
|
3428
|
-
const p =
|
|
3431
|
+
const p = R.slice(0, d), f = R.length - d;
|
|
3429
3432
|
return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
|
|
3430
3433
|
p.map((w) => /* @__PURE__ */ e(
|
|
3431
3434
|
"span",
|
|
@@ -3442,7 +3445,7 @@ function Ye({
|
|
|
3442
3445
|
] })
|
|
3443
3446
|
] });
|
|
3444
3447
|
};
|
|
3445
|
-
return /* @__PURE__ */ e(Z, { value:
|
|
3448
|
+
return /* @__PURE__ */ e(Z, { value: R, onChange: (p) => {
|
|
3446
3449
|
const f = Array.from(new Set(p.map((w) => m(w))));
|
|
3447
3450
|
y !== -1 && f.length > y || o(f);
|
|
3448
3451
|
}, multiple: !0, by: "id", children: ({ open: p }) => /* @__PURE__ */ l("div", { children: [
|
|
@@ -3491,7 +3494,7 @@ function Ye({
|
|
|
3491
3494
|
) }),
|
|
3492
3495
|
b === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3493
3496
|
q.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? O.length < k ? `Type at least ${k} characters to search.` : "No results." : "No options found." }) : q.map((f) => {
|
|
3494
|
-
const w = m(f), c = g(f), h =
|
|
3497
|
+
const w = m(f), c = g(f), h = R.some((F) => m(F) === w), x = y !== -1 && R.length >= y && !h;
|
|
3495
3498
|
return /* @__PURE__ */ e(
|
|
3496
3499
|
Z.Option,
|
|
3497
3500
|
{
|
|
@@ -3501,7 +3504,7 @@ function Ye({
|
|
|
3501
3504
|
x ? " text-gray-400 bg-white cursor-not-allowed" : F ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3502
3505
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3503
3506
|
),
|
|
3504
|
-
children: ({ selected: F, active:
|
|
3507
|
+
children: ({ selected: F, active: I }) => /* @__PURE__ */ l(ee, { children: [
|
|
3505
3508
|
/* @__PURE__ */ e(
|
|
3506
3509
|
"span",
|
|
3507
3510
|
{
|
|
@@ -3516,7 +3519,7 @@ function Ye({
|
|
|
3516
3519
|
"span",
|
|
3517
3520
|
{
|
|
3518
3521
|
className: Pe(
|
|
3519
|
-
|
|
3522
|
+
I ? " text-gray-900" : " text-gray-600",
|
|
3520
3523
|
" absolute inset-y-0 right-0 flex items-center pr-4"
|
|
3521
3524
|
),
|
|
3522
3525
|
children: /* @__PURE__ */ e(Ge, { className: "w-5 h-5", "aria-hidden": "true" })
|
|
@@ -3688,9 +3691,9 @@ function Cn({
|
|
|
3688
3691
|
dropId: N,
|
|
3689
3692
|
indent: a = 24
|
|
3690
3693
|
}) {
|
|
3691
|
-
const { setNodeRef: k, isOver: m } = Ut({ id: N }), { attributes: g, listeners: $, setNodeRef: L, transform: O, isDragging: C } = Vt({ id: b }), T = O ? { transform: `translate3d(${Math.round(O.x)}px, ${Math.round(O.y)}px, 0)` } : void 0, [
|
|
3694
|
+
const { setNodeRef: k, isOver: m } = Ut({ id: N }), { attributes: g, listeners: $, setNodeRef: L, transform: O, isDragging: C } = Vt({ id: b }), T = O ? { transform: `translate3d(${Math.round(O.x)}px, ${Math.round(O.y)}px, 0)` } : void 0, [E, R] = B(!1), [V, q] = B(t.name), G = () => {
|
|
3692
3695
|
const p = V.trim();
|
|
3693
|
-
|
|
3696
|
+
R(!1), p && p !== t.name ? i?.(t, p) : q(t.name);
|
|
3694
3697
|
}, v = ce(() => /* @__PURE__ */ e(
|
|
3695
3698
|
an,
|
|
3696
3699
|
{
|
|
@@ -3700,7 +3703,7 @@ function Cn({
|
|
|
3700
3703
|
{ action: "delete", label: "Delete" }
|
|
3701
3704
|
],
|
|
3702
3705
|
onSelect: (f) => {
|
|
3703
|
-
f.action === "create" ? u?.(t) : f.action === "rename" ?
|
|
3706
|
+
f.action === "create" ? u?.(t) : f.action === "rename" ? R(!0) : f.action === "delete" && d?.(t);
|
|
3704
3707
|
}
|
|
3705
3708
|
}
|
|
3706
3709
|
), [t, u, d]);
|
|
@@ -3716,7 +3719,7 @@ function Cn({
|
|
|
3716
3719
|
children: [
|
|
3717
3720
|
/* @__PURE__ */ e("button", { className: "tv-toggle", onClick: o, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(wa, { size: 16 }) : /* @__PURE__ */ e(je, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
|
|
3718
3721
|
/* @__PURE__ */ e(Fa, { size: 16, className: "tv-folder-ic" }),
|
|
3719
|
-
/* @__PURE__ */ e("div", { className: "tv-name", ref: L, children:
|
|
3722
|
+
/* @__PURE__ */ e("div", { className: "tv-name", ref: L, children: E ? /* @__PURE__ */ e(
|
|
3720
3723
|
"input",
|
|
3721
3724
|
{
|
|
3722
3725
|
className: "tv-input",
|
|
@@ -3724,15 +3727,15 @@ function Cn({
|
|
|
3724
3727
|
onChange: (p) => q(p.target.value),
|
|
3725
3728
|
onBlur: G,
|
|
3726
3729
|
onKeyDown: (p) => {
|
|
3727
|
-
p.key === "Enter" && G(), p.key === "Escape" && (
|
|
3730
|
+
p.key === "Enter" && G(), p.key === "Escape" && (R(!1), q(t.name));
|
|
3728
3731
|
},
|
|
3729
3732
|
autoFocus: !0
|
|
3730
3733
|
}
|
|
3731
|
-
) : /* @__PURE__ */ e("span", { onDoubleClick: () =>
|
|
3734
|
+
) : /* @__PURE__ */ e("span", { onDoubleClick: () => R(!0), children: t.name }) }),
|
|
3732
3735
|
/* @__PURE__ */ e(wn, { listeners: $, attributes: g }),
|
|
3733
3736
|
/* @__PURE__ */ e("div", { className: "tv-actions", children: y ? y(t, {
|
|
3734
3737
|
onCreateChild: () => u?.(t),
|
|
3735
|
-
onRename: () =>
|
|
3738
|
+
onRename: () => R(!0),
|
|
3736
3739
|
onDelete: () => d?.(t)
|
|
3737
3740
|
}) : v })
|
|
3738
3741
|
]
|
|
@@ -3835,9 +3838,9 @@ function ps({
|
|
|
3835
3838
|
{ rootId: r, getId: o, getParent: n, getName: u }
|
|
3836
3839
|
), [t, r, o, n, u]), [L, O] = B({}), C = K((x) => {
|
|
3837
3840
|
const F = {};
|
|
3838
|
-
return (function
|
|
3841
|
+
return (function I(j) {
|
|
3839
3842
|
j.forEach((S) => {
|
|
3840
|
-
F[S.id] = !0, S.children?.length &&
|
|
3843
|
+
F[S.id] = !0, S.children?.length && I(S.children);
|
|
3841
3844
|
});
|
|
3842
3845
|
})(x), F;
|
|
3843
3846
|
}, []);
|
|
@@ -3847,8 +3850,8 @@ function ps({
|
|
|
3847
3850
|
const T = K(
|
|
3848
3851
|
(x) => O((F) => ({ ...F, [x]: !F[x] })),
|
|
3849
3852
|
[]
|
|
3850
|
-
), [
|
|
3851
|
-
ae.useEffect(() =>
|
|
3853
|
+
), [E, R] = B(() => Ae($));
|
|
3854
|
+
ae.useEffect(() => R(Ae($)), [$]);
|
|
3852
3855
|
const V = qt(
|
|
3853
3856
|
jt(Yt, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
3854
3857
|
), q = ue(null), [G, v] = B(null), p = ue(0), f = () => {
|
|
@@ -3856,16 +3859,16 @@ function ps({
|
|
|
3856
3859
|
p.current = x?.x ?? 0;
|
|
3857
3860
|
}, c = K(
|
|
3858
3861
|
({ active: x, over: F }) => {
|
|
3859
|
-
const
|
|
3862
|
+
const I = p.current;
|
|
3860
3863
|
if (p.current = 0, v(null), !x || !F) return;
|
|
3861
3864
|
const j = String(x.id).replace(/^drag-/, ""), S = String(F.id).replace(/^drop-/, "");
|
|
3862
3865
|
if (!j || !S || j === S) return;
|
|
3863
3866
|
let A = S;
|
|
3864
|
-
const M = Math.max(0, Math.floor(-
|
|
3867
|
+
const M = Math.max(0, Math.floor(-I / g));
|
|
3865
3868
|
if (M > 0) {
|
|
3866
3869
|
let ie = S;
|
|
3867
3870
|
for (let xe = 0; xe < M; xe++) {
|
|
3868
|
-
const P = Ka(
|
|
3871
|
+
const P = Ka(E, ie, null);
|
|
3869
3872
|
if (!P) break;
|
|
3870
3873
|
if (!P.parentId) {
|
|
3871
3874
|
A = r;
|
|
@@ -3875,51 +3878,51 @@ function ps({
|
|
|
3875
3878
|
}
|
|
3876
3879
|
}
|
|
3877
3880
|
if (m && A === r) {
|
|
3878
|
-
|
|
3881
|
+
R(Ae($));
|
|
3879
3882
|
return;
|
|
3880
3883
|
}
|
|
3881
|
-
const D = Ae(
|
|
3884
|
+
const D = Ae(E), { newRoots: z, removed: U } = En(D, j);
|
|
3882
3885
|
if (!U) return;
|
|
3883
3886
|
const Ne = Rn(z, A, U);
|
|
3884
|
-
|
|
3887
|
+
R(Ne), a?.({ sourceId: j, destParentId: A, newTree: Ne });
|
|
3885
3888
|
},
|
|
3886
|
-
[
|
|
3889
|
+
[E, $, r, m, g, a]
|
|
3887
3890
|
), h = K(
|
|
3888
|
-
(x, F = 0) => x.map((
|
|
3891
|
+
(x, F = 0) => x.map((I) => /* @__PURE__ */ l(ae.Fragment, { children: [
|
|
3889
3892
|
/* @__PURE__ */ e(
|
|
3890
3893
|
Cn,
|
|
3891
3894
|
{
|
|
3892
|
-
node:
|
|
3895
|
+
node: I,
|
|
3893
3896
|
depth: F,
|
|
3894
|
-
expanded: !!L[
|
|
3895
|
-
onToggle: () => T(
|
|
3897
|
+
expanded: !!L[I.id],
|
|
3898
|
+
onToggle: () => T(I.id),
|
|
3896
3899
|
onSelect: i,
|
|
3897
3900
|
onCreateChild: y,
|
|
3898
3901
|
onRename: b,
|
|
3899
3902
|
onDelete: N,
|
|
3900
3903
|
renderActions: k,
|
|
3901
|
-
dragId: `drag-${
|
|
3902
|
-
dropId: `drop-${
|
|
3904
|
+
dragId: `drag-${I.id}`,
|
|
3905
|
+
dropId: `drop-${I.id}`,
|
|
3903
3906
|
indent: g
|
|
3904
3907
|
}
|
|
3905
3908
|
),
|
|
3906
|
-
L[
|
|
3907
|
-
] },
|
|
3909
|
+
L[I.id] && I.children?.length > 0 ? h(I.children, F + 1) : null
|
|
3910
|
+
] }, I.id)),
|
|
3908
3911
|
[L, g, y, N, b, i, k, T]
|
|
3909
3912
|
);
|
|
3910
3913
|
return ae.useMemo(() => {
|
|
3911
3914
|
if (!G) return null;
|
|
3912
3915
|
const x = String(G).replace(/^drag-/, "");
|
|
3913
|
-
function F(
|
|
3914
|
-
for (const j of
|
|
3916
|
+
function F(I) {
|
|
3917
|
+
for (const j of I) {
|
|
3915
3918
|
if (j.id === x) return j;
|
|
3916
3919
|
const S = j.children?.length ? F(j.children) : null;
|
|
3917
3920
|
if (S) return S;
|
|
3918
3921
|
}
|
|
3919
3922
|
return null;
|
|
3920
3923
|
}
|
|
3921
|
-
return F(
|
|
3922
|
-
}, [G,
|
|
3924
|
+
return F(E);
|
|
3925
|
+
}, [G, E]), /* @__PURE__ */ l("div", { className: "tv", children: [
|
|
3923
3926
|
s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
|
|
3924
3927
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
3925
3928
|
/* @__PURE__ */ e("button", { className: "tv-btn", onClick: d, children: "+ New folder" })
|
|
@@ -3938,7 +3941,7 @@ function ps({
|
|
|
3938
3941
|
onDragMove: w,
|
|
3939
3942
|
onDragEnd: c,
|
|
3940
3943
|
modifiers: [_t],
|
|
3941
|
-
children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: h(
|
|
3944
|
+
children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: h(E, 0) })
|
|
3942
3945
|
}
|
|
3943
3946
|
)
|
|
3944
3947
|
] });
|
|
@@ -4594,11 +4597,11 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4594
4597
|
return (c, h) => {
|
|
4595
4598
|
const x = () => {
|
|
4596
4599
|
if (v.optionsFrom && r) {
|
|
4597
|
-
const { config: F, valueField:
|
|
4600
|
+
const { config: F, valueField: I, labelField: j } = v.optionsFrom, S = r[F] || [];
|
|
4598
4601
|
if (Array.isArray(S))
|
|
4599
4602
|
return S.map((A) => ({
|
|
4600
|
-
id: A[
|
|
4601
|
-
value: A[
|
|
4603
|
+
id: A[I] || "",
|
|
4604
|
+
value: A[I] || "",
|
|
4602
4605
|
label: A[j] || ""
|
|
4603
4606
|
}));
|
|
4604
4607
|
}
|
|
@@ -4719,12 +4722,12 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4719
4722
|
...x.roles || []
|
|
4720
4723
|
];
|
|
4721
4724
|
return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
4722
|
-
/* @__PURE__ */ e(zn, { children: F.length > 0 ? F.slice(0, 3).map((
|
|
4725
|
+
/* @__PURE__ */ e(zn, { children: F.length > 0 ? F.slice(0, 3).map((I, j) => /* @__PURE__ */ e(
|
|
4723
4726
|
za,
|
|
4724
4727
|
{
|
|
4725
4728
|
size: "small",
|
|
4726
|
-
name:
|
|
4727
|
-
src:
|
|
4729
|
+
name: I.name || I.displayName || I.id,
|
|
4730
|
+
src: I.avatarUrl
|
|
4728
4731
|
},
|
|
4729
4732
|
j
|
|
4730
4733
|
)) : null }),
|
|
@@ -4824,9 +4827,9 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4824
4827
|
const f = [...p];
|
|
4825
4828
|
return f.splice(v, 1), f;
|
|
4826
4829
|
});
|
|
4827
|
-
}, []), [C, T] = B(null),
|
|
4830
|
+
}, []), [C, T] = B(null), E = K((v, p) => {
|
|
4828
4831
|
T(p), v.dataTransfer.effectAllowed = "move", v.dataTransfer.setData("text/html", "");
|
|
4829
|
-
}, []),
|
|
4832
|
+
}, []), R = K((v) => {
|
|
4830
4833
|
v.preventDefault(), v.dataTransfer.dropEffect = "move";
|
|
4831
4834
|
}, []), V = K((v, p) => {
|
|
4832
4835
|
v.preventDefault(), !(C === null || C === p) && (a((f) => {
|
|
@@ -4882,8 +4885,8 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4882
4885
|
{
|
|
4883
4886
|
className: `hover:bg-gray-50 ${C === p ? "opacity-50" : ""}`,
|
|
4884
4887
|
draggable: !0,
|
|
4885
|
-
onDragStart: (f) =>
|
|
4886
|
-
onDragOver:
|
|
4888
|
+
onDragStart: (f) => E(f, p),
|
|
4889
|
+
onDragOver: R,
|
|
4887
4890
|
onDrop: (f) => V(f, p),
|
|
4888
4891
|
onDragEnd: q,
|
|
4889
4892
|
children: [
|
|
@@ -4991,7 +4994,7 @@ const fa = () => {
|
|
|
4991
4994
|
initialData: y = null
|
|
4992
4995
|
// Add prop for initial demo data
|
|
4993
4996
|
}) => {
|
|
4994
|
-
const [b, N] = B(null), [a, k] = B(""), [m, g] = B(() => Array.isArray(y) ? y : []), [$, L] = B(null), [O, C] = B(null), [T,
|
|
4997
|
+
const [b, N] = B(null), [a, k] = B(""), [m, g] = B(() => Array.isArray(y) ? y : []), [$, L] = B(null), [O, C] = B(null), [T, E] = B(""), R = async () => {
|
|
4995
4998
|
try {
|
|
4996
4999
|
const S = await Ee(t.collectionList);
|
|
4997
5000
|
if (S) {
|
|
@@ -5006,7 +5009,7 @@ const fa = () => {
|
|
|
5006
5009
|
}
|
|
5007
5010
|
};
|
|
5008
5011
|
X(() => {
|
|
5009
|
-
(!y || y.length === 0) &&
|
|
5012
|
+
(!y || y.length === 0) && R();
|
|
5010
5013
|
}, [y]), X(() => {
|
|
5011
5014
|
Array.isArray(y) && g(y);
|
|
5012
5015
|
}, [y]);
|
|
@@ -5061,7 +5064,7 @@ const fa = () => {
|
|
|
5061
5064
|
}, p = async (S) => {
|
|
5062
5065
|
if (i)
|
|
5063
5066
|
try {
|
|
5064
|
-
await un(`${t.collectionUpdate}/${S.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }),
|
|
5067
|
+
await un(`${t.collectionUpdate}/${S.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), R());
|
|
5065
5068
|
} catch (A) {
|
|
5066
5069
|
console.log(A), le.error("Failed to delete collection");
|
|
5067
5070
|
}
|
|
@@ -5095,7 +5098,7 @@ const fa = () => {
|
|
|
5095
5098
|
const z = f(D, M, A);
|
|
5096
5099
|
return console.log("Reordered", z), w(z), s?.(z), z;
|
|
5097
5100
|
}), L(null), C(null));
|
|
5098
|
-
},
|
|
5101
|
+
}, I = () => {
|
|
5099
5102
|
L(null), C(null);
|
|
5100
5103
|
}, j = Array.isArray(m) ? m.filter(
|
|
5101
5104
|
(S) => S.categoryName?.toLowerCase().includes(T.toLowerCase())
|
|
@@ -5106,7 +5109,7 @@ const fa = () => {
|
|
|
5106
5109
|
he,
|
|
5107
5110
|
{
|
|
5108
5111
|
value: T,
|
|
5109
|
-
onDebouncedChange:
|
|
5112
|
+
onDebouncedChange: E,
|
|
5110
5113
|
placeholder: "Search Collection",
|
|
5111
5114
|
customClass: "mr-4 searchmanagecollection"
|
|
5112
5115
|
}
|
|
@@ -5132,7 +5135,7 @@ const fa = () => {
|
|
|
5132
5135
|
onDragEnter: () => h(S.id),
|
|
5133
5136
|
onDragOver: x,
|
|
5134
5137
|
onDrop: (U) => F(U, S.id),
|
|
5135
|
-
onDragEnd:
|
|
5138
|
+
onDragEnd: I,
|
|
5136
5139
|
className: [
|
|
5137
5140
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5138
5141
|
"border-gray-300",
|
|
@@ -5285,30 +5288,30 @@ function Un({
|
|
|
5285
5288
|
const w = {}, c = f?.configuration || {};
|
|
5286
5289
|
return r.configuration.forEach((h) => {
|
|
5287
5290
|
if (h.key && h.type === "datatable") {
|
|
5288
|
-
const F = (c[h.key] || []).map((
|
|
5289
|
-
const S = { id:
|
|
5291
|
+
const F = (c[h.key] || []).map((I, j) => {
|
|
5292
|
+
const S = { id: I.id || 0 };
|
|
5290
5293
|
return h.fields && h.fields.forEach((A) => {
|
|
5291
5294
|
if (A.fieldtype === "audience") {
|
|
5292
5295
|
let M = { users: [], groups: [], roles: [] };
|
|
5293
|
-
|
|
5294
|
-
users:
|
|
5295
|
-
groups:
|
|
5296
|
-
roles:
|
|
5296
|
+
I[A.key] && (Array.isArray(I[A.key]) ? M = { users: [], groups: [], roles: [] } : typeof I[A.key] == "object" && (M = {
|
|
5297
|
+
users: I[A.key].users || [],
|
|
5298
|
+
groups: I[A.key].groups || [],
|
|
5299
|
+
roles: I[A.key].roles || []
|
|
5297
5300
|
})), S[A.key] = M;
|
|
5298
5301
|
} else
|
|
5299
|
-
S[A.key] =
|
|
5302
|
+
S[A.key] = I[A.key] || A.default || "";
|
|
5300
5303
|
}), S;
|
|
5301
5304
|
});
|
|
5302
5305
|
if (F.length === 0) {
|
|
5303
|
-
const
|
|
5306
|
+
const I = { id: 0 };
|
|
5304
5307
|
h.fields && h.fields.forEach((j) => {
|
|
5305
|
-
j.fieldtype === "audience" ?
|
|
5306
|
-
}), F.push(
|
|
5308
|
+
j.fieldtype === "audience" ? I[j.key] = { users: [], groups: [], roles: [] } : I[j.key] = j.default || "";
|
|
5309
|
+
}), F.push(I);
|
|
5307
5310
|
}
|
|
5308
5311
|
w[h.key] = F;
|
|
5309
5312
|
} else h.key && (w[h.key] = c[h.key] || {});
|
|
5310
5313
|
}), w;
|
|
5311
|
-
},
|
|
5314
|
+
}, E = () => {
|
|
5312
5315
|
if (r && r.configuration) {
|
|
5313
5316
|
const f = {};
|
|
5314
5317
|
r.configuration.forEach((w) => {
|
|
@@ -5341,7 +5344,7 @@ function Un({
|
|
|
5341
5344
|
const c = T(w);
|
|
5342
5345
|
y(c);
|
|
5343
5346
|
} else
|
|
5344
|
-
|
|
5347
|
+
E();
|
|
5345
5348
|
} catch (w) {
|
|
5346
5349
|
console.error("Error fetching configuration:", w);
|
|
5347
5350
|
let c = "Failed to load configuration";
|
|
@@ -5349,14 +5352,14 @@ function Un({
|
|
|
5349
5352
|
const h = w.response.status, x = w.response.data?.message || w.response.data?.error;
|
|
5350
5353
|
h === 400 ? c = x || "Invalid request. Please check the application ID." : h === 401 ? c = "You are not authorized to access this configuration." : h === 403 ? c = "Access denied. You don't have permission to view this configuration." : h === 404 ? c = "Configuration not found. It may not exist yet or the application ID is incorrect." : h >= 500 ? c = x || "Server error. Please try again later." : c = x || `Failed to load configuration (Error ${h})`;
|
|
5351
5354
|
} else w.request ? c = "Network error. Please check your connection and try again." : c = w.message || "An unexpected error occurred while loading configuration.";
|
|
5352
|
-
ke.error(c),
|
|
5355
|
+
ke.error(c), E();
|
|
5353
5356
|
} finally {
|
|
5354
5357
|
N(!1);
|
|
5355
5358
|
}
|
|
5356
5359
|
};
|
|
5357
|
-
r && (i(r), t ? f() :
|
|
5360
|
+
r && (i(r), t ? f() : E());
|
|
5358
5361
|
}, [r, O, t, s]);
|
|
5359
|
-
const
|
|
5362
|
+
const R = (f, w) => {
|
|
5360
5363
|
y((c) => ({
|
|
5361
5364
|
...c,
|
|
5362
5365
|
[f]: w
|
|
@@ -5379,8 +5382,8 @@ function Un({
|
|
|
5379
5382
|
Array.isArray(c) && c.forEach((h, x) => {
|
|
5380
5383
|
w.fields.forEach((F) => {
|
|
5381
5384
|
if (F.required) {
|
|
5382
|
-
const
|
|
5383
|
-
(!
|
|
5385
|
+
const I = h[F.key];
|
|
5386
|
+
(!I || typeof I == "string" && I.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][x] || (f[w.key][x] = {}), f[w.key][x][F.key] = `${F.label} is required`);
|
|
5384
5387
|
}
|
|
5385
5388
|
});
|
|
5386
5389
|
});
|
|
@@ -5405,20 +5408,20 @@ function Un({
|
|
|
5405
5408
|
const c = {};
|
|
5406
5409
|
d && Object.keys(d).forEach((x) => {
|
|
5407
5410
|
const F = r?.configuration?.find(
|
|
5408
|
-
(
|
|
5411
|
+
(I) => I.key === x && I.type === "datatable"
|
|
5409
5412
|
);
|
|
5410
|
-
F && Array.isArray(d[x]) ? c[x] = d[x].map((
|
|
5411
|
-
const j = { id:
|
|
5413
|
+
F && Array.isArray(d[x]) ? c[x] = d[x].map((I) => {
|
|
5414
|
+
const j = { id: I.id || 0 };
|
|
5412
5415
|
return F.fields && F.fields.forEach((S) => {
|
|
5413
5416
|
if (S.fieldtype === "audience") {
|
|
5414
5417
|
let A = { users: [], groups: [], roles: [] };
|
|
5415
|
-
|
|
5416
|
-
users:
|
|
5417
|
-
groups:
|
|
5418
|
-
roles:
|
|
5418
|
+
I[S.key] && typeof I[S.key] == "object" && !Array.isArray(I[S.key]) && (A = {
|
|
5419
|
+
users: I[S.key].users || [],
|
|
5420
|
+
groups: I[S.key].groups || [],
|
|
5421
|
+
roles: I[S.key].roles || []
|
|
5419
5422
|
}), j[S.key] = A;
|
|
5420
5423
|
} else
|
|
5421
|
-
j[S.key] =
|
|
5424
|
+
j[S.key] = I[S.key] || "";
|
|
5422
5425
|
}), j;
|
|
5423
5426
|
}) : c[x] = d[x];
|
|
5424
5427
|
});
|
|
@@ -5448,7 +5451,7 @@ function Un({
|
|
|
5448
5451
|
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" }) });
|
|
5449
5452
|
const p = r?.configuration || u?.configuration;
|
|
5450
5453
|
return X(() => {
|
|
5451
|
-
s && r ? (!d || Object.keys(d).length === 0) &&
|
|
5454
|
+
s && r ? (!d || Object.keys(d).length === 0) && E() : s && !r && E();
|
|
5452
5455
|
}, [s, r]), /* @__PURE__ */ l("div", { children: [
|
|
5453
5456
|
/* @__PURE__ */ l(
|
|
5454
5457
|
"div",
|
|
@@ -5465,7 +5468,7 @@ function Un({
|
|
|
5465
5468
|
{
|
|
5466
5469
|
item: f,
|
|
5467
5470
|
data: d,
|
|
5468
|
-
updateHandler:
|
|
5471
|
+
updateHandler: R,
|
|
5469
5472
|
validationErrors: m
|
|
5470
5473
|
},
|
|
5471
5474
|
w
|
|
@@ -5570,12 +5573,12 @@ const ys = ({
|
|
|
5570
5573
|
ae.useEffect(() => {
|
|
5571
5574
|
y(T());
|
|
5572
5575
|
}, [g]);
|
|
5573
|
-
const
|
|
5576
|
+
const E = K((p) => {
|
|
5574
5577
|
console.log("Config saved with data:", p), Object.keys(p).forEach((f) => {
|
|
5575
5578
|
const w = p[f];
|
|
5576
5579
|
console.log(`Checking section ${f}:`, w), w && w.displayname && (console.log("Found displayname:", w.displayname), y(w.displayname));
|
|
5577
5580
|
});
|
|
5578
|
-
}, []),
|
|
5581
|
+
}, []), R = {
|
|
5579
5582
|
subHeading: "Application configuration and details",
|
|
5580
5583
|
tags: [],
|
|
5581
5584
|
...N,
|
|
@@ -5601,7 +5604,7 @@ const ys = ({
|
|
|
5601
5604
|
...k
|
|
5602
5605
|
}, q = [
|
|
5603
5606
|
{ label: "Overview", content: v(V) },
|
|
5604
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: O, onSave:
|
|
5607
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: O, onSave: E }) }
|
|
5605
5608
|
];
|
|
5606
5609
|
function G(p) {
|
|
5607
5610
|
return p ? p.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: p } }) : p : "📱";
|
|
@@ -5660,11 +5663,11 @@ const ys = ({
|
|
|
5660
5663
|
}
|
|
5661
5664
|
),
|
|
5662
5665
|
/* @__PURE__ */ l("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
|
|
5663
|
-
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: G(
|
|
5666
|
+
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: G(R.icon) }),
|
|
5664
5667
|
/* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
|
|
5665
|
-
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children:
|
|
5666
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children:
|
|
5667
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children:
|
|
5668
|
+
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: R.heading }),
|
|
5669
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: R.subHeading }),
|
|
5670
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: R.tags && R.tags.map((p, f) => /* @__PURE__ */ e(
|
|
5668
5671
|
"span",
|
|
5669
5672
|
{
|
|
5670
5673
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
@@ -5754,19 +5757,19 @@ const bs = ({
|
|
|
5754
5757
|
},
|
|
5755
5758
|
// Optional: override export file names
|
|
5756
5759
|
excelFileName: T,
|
|
5757
|
-
pdfFileName:
|
|
5760
|
+
pdfFileName: E
|
|
5758
5761
|
}) => {
|
|
5759
|
-
const
|
|
5762
|
+
const R = () => n?.current || o?.current, [V, q] = ae.useState(""), G = (t || "export").toString().trim() || "export", v = `${T || G}.xlsx`, p = `${E || G}.pdf`, f = (h, x, F) => Math.max(x, Math.min(h, F)), w = K(
|
|
5760
5763
|
(h) => {
|
|
5761
|
-
const x =
|
|
5764
|
+
const x = R();
|
|
5762
5765
|
if (console.log("openColumnChooserNear", x), !!x?.openColumnChooser) {
|
|
5763
5766
|
if (typeof window > "u" || !h?.currentTarget) {
|
|
5764
5767
|
x.openColumnChooser();
|
|
5765
5768
|
return;
|
|
5766
5769
|
}
|
|
5767
5770
|
try {
|
|
5768
|
-
const F = h.currentTarget.getBoundingClientRect(),
|
|
5769
|
-
let S =
|
|
5771
|
+
const F = h.currentTarget.getBoundingClientRect(), I = F.left + window.scrollX, j = F.bottom + window.scrollY;
|
|
5772
|
+
let S = I - 120, A = j - 120;
|
|
5770
5773
|
const M = window.innerWidth, D = window.innerHeight;
|
|
5771
5774
|
S = f(S, window.scrollX + 8, window.scrollX + M - 340), A = f(A, window.scrollY, window.scrollY + D - 120), console.log("openColumnChooserNear", S, A), x.openColumnChooser(S, A);
|
|
5772
5775
|
} catch (F) {
|
|
@@ -5778,7 +5781,7 @@ const bs = ({
|
|
|
5778
5781
|
// no external deps; reads ref at call time
|
|
5779
5782
|
), c = K(
|
|
5780
5783
|
(h, x) => {
|
|
5781
|
-
const F =
|
|
5784
|
+
const F = R();
|
|
5782
5785
|
if (F)
|
|
5783
5786
|
switch (h) {
|
|
5784
5787
|
case "ColumnChooser":
|
|
@@ -5927,8 +5930,8 @@ function vs(t) {
|
|
|
5927
5930
|
enableCheckbox: O = !1,
|
|
5928
5931
|
columns: C = [],
|
|
5929
5932
|
onGridStateChange: T,
|
|
5930
|
-
onRowSelected:
|
|
5931
|
-
onRowDeselected:
|
|
5933
|
+
onRowSelected: E,
|
|
5934
|
+
onRowDeselected: R,
|
|
5932
5935
|
onRowDoubleClick: V,
|
|
5933
5936
|
apiRef: q,
|
|
5934
5937
|
gridProps: G = {}
|
|
@@ -5936,7 +5939,7 @@ function vs(t) {
|
|
|
5936
5939
|
pageSettings: p,
|
|
5937
5940
|
sortSettings: f,
|
|
5938
5941
|
...w
|
|
5939
|
-
} = G || {}, [c, h] = ae.useState(p?.page || 1), [x, F] = ae.useState(f?.pageSize || 20), [
|
|
5942
|
+
} = G || {}, [c, h] = ae.useState(p?.page || 1), [x, F] = ae.useState(f?.pageSize || 20), [I, j] = ae.useState(f?.sortKey || "updatedDate"), [S, A] = ae.useState(f?.direction || "Descending"), M = ce(() => {
|
|
5940
5943
|
const P = [$r];
|
|
5941
5944
|
return i && P.push(Fr), d && P.push(Tr), y && P.push(Ar), g && P.push(Er), a && P.push(Rr), k && P.push(Ir), m && P.push(zr), N && P.push(Pr), b && P.push(Br), P.push(Lr), P;
|
|
5942
5945
|
}, [i, d, y, g, a, k, m, N, b]), D = ce(() => {
|
|
@@ -6060,12 +6063,12 @@ function vs(t) {
|
|
|
6060
6063
|
selectionSettings: L,
|
|
6061
6064
|
pageSettings: { pageSize: 10, pageSizes: p?.pageSizes ?? [20, 40, 60, 80, 100] },
|
|
6062
6065
|
sortSettings: f ?? {
|
|
6063
|
-
columns: [{ field:
|
|
6066
|
+
columns: [{ field: I, direction: z(S) }],
|
|
6064
6067
|
allowUnsort: !1
|
|
6065
6068
|
},
|
|
6066
6069
|
actionBegin: Ne,
|
|
6067
|
-
rowSelected:
|
|
6068
|
-
rowDeselected:
|
|
6070
|
+
rowSelected: E,
|
|
6071
|
+
rowDeselected: R,
|
|
6069
6072
|
recordDoubleClick: ie,
|
|
6070
6073
|
...w,
|
|
6071
6074
|
children: [
|
|
Binary file
|
|
Binary file
|