unifyedx-storybook-new 0.1.84 → 0.1.86
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,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as
|
|
2
|
-
import re, { useState as M, useMemo as ne, useId as Qe, Fragment as
|
|
3
|
-
import { a as
|
|
4
|
-
import { Popover as ar, PopoverButton as tr, PopoverPanel as rr, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import re, { useState as M, useMemo as ne, useId as Qe, Fragment as J, useEffect as Q, useCallback as ae, useRef as ue } from "react";
|
|
3
|
+
import { a as W, U as lt, X as ge, P as _, L as ot, C as Oe, b as Me, f as Be, d as pa, D as ga, F as it, e as ct, h as dt, T as Pe, u as ut, i as mt, I as ht, j as pt, k as gt, l as yt, m as ft, n as bt, S as ya, o as fa, M as vt, p as xt, q as ba, r as Nt, A as kt, s as wt, E as Ct, t as St, v as Dt, w as Ft, x as $t, y as va, z as Tt, B as xa, G as Na, H as At, J as Et, K as Rt, N as Le, O as Xe, Q as Ze, R as It, V as zt, W as ka, Y as Bt, Z as ea, _ as Pt, $ as Lt, a0 as wa, a1 as Ot, a2 as Mt, a3 as Vt, a4 as Ut, a5 as qt, a6 as jt, a7 as Gt, a8 as le, a9 as _t, aa as Yt, ab as Wt, ac as Jt, ad as Qt, ae as Xt, af as Zt, ag as Ht, ah as Kt, ai as er } from "./vendor-CugE0rJ9.js";
|
|
4
|
+
import { Popover as ar, PopoverButton as tr, PopoverPanel as rr, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as ke, DialogTitle as Ve, TabGroup as nr, TabList as sr, Tab as ee, TabPanels as lr, RadioGroup as Te, Listbox as X, ListboxButton as or, ListboxOptions as ir, ListboxOption as cr, SwitchGroup as dr, Switch as Ye, Menu as ur, MenuButton as mr, Portal as hr, MenuItems as pr, MenuItem as gr, DialogBackdrop as yr } from "@headlessui/react";
|
|
5
5
|
import { motion as te, AnimatePresence as fe } from "framer-motion";
|
|
6
|
-
import { d as fr, l as br, _ as We } from "./vendor-lodash-
|
|
6
|
+
import { d as fr, l as br, _ as We } from "./vendor-lodash-BvgZjhaA.js";
|
|
7
7
|
import { useFloating as Ca, offset as Sa, flip as Da, shift as Fa, autoUpdate as $a, useClick as vr, useDismiss as xr, useInteractions as Nr, FloatingPortal as kr } from "@floating-ui/react";
|
|
8
8
|
import { P as wr, S as Cr, F as Sr, G as Dr, a as Fr, E as $r, b as Tr, C as Ar, R as Er, c as Rr, d as Ir, e as zr, f as Br, I as Pr, g as ra } from "./vendor-syncfusion-DGcZfoFG.js";
|
|
9
9
|
const Lr = (t) => {
|
|
@@ -26,7 +26,7 @@ const Lr = (t) => {
|
|
|
26
26
|
className: m,
|
|
27
27
|
...i
|
|
28
28
|
}) => {
|
|
29
|
-
const [u, y] = M(!1), f = ne(() => Or(r), []), v = t && !u, a = !v && r,
|
|
29
|
+
const [u, y] = M(!1), f = ne(() => Or(r), []), v = t && !u, a = !v && r, N = !v && !r, d = W(
|
|
30
30
|
"avatar-container",
|
|
31
31
|
`avatar--size-${s}`,
|
|
32
32
|
m
|
|
@@ -45,7 +45,7 @@ const Lr = (t) => {
|
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
47
|
a && /* @__PURE__ */ e("span", { className: "avatar-initials", "aria-label": r, children: Mr(r) }),
|
|
48
|
-
|
|
48
|
+
N && /* @__PURE__ */ e("span", { className: "avatar-icon", children: /* @__PURE__ */ e(lt, {}) })
|
|
49
49
|
] });
|
|
50
50
|
}, Gn = ({ children: t, max: r = 4, truncatedMessage: s = "Members", ...o }) => {
|
|
51
51
|
const n = re.Children.toArray(t), m = n.slice(0, r), i = n.length - r;
|
|
@@ -71,7 +71,7 @@ const Lr = (t) => {
|
|
|
71
71
|
className: u,
|
|
72
72
|
...y
|
|
73
73
|
}) => {
|
|
74
|
-
const f =
|
|
74
|
+
const f = W(
|
|
75
75
|
"badge",
|
|
76
76
|
`badge--variant-${r}`,
|
|
77
77
|
`badge--size-${s}`,
|
|
@@ -134,7 +134,7 @@ const Ur = {
|
|
|
134
134
|
}, qr = {
|
|
135
135
|
primary: "btn-primary",
|
|
136
136
|
secondary: "btn-secondary"
|
|
137
|
-
},
|
|
137
|
+
}, Z = ({
|
|
138
138
|
dataTestId: t,
|
|
139
139
|
title: r,
|
|
140
140
|
type: s = "button",
|
|
@@ -150,10 +150,10 @@ const Ur = {
|
|
|
150
150
|
label: v,
|
|
151
151
|
children: a,
|
|
152
152
|
// ✅ Add children to the props list
|
|
153
|
-
onClick:
|
|
153
|
+
onClick: N,
|
|
154
154
|
...d
|
|
155
155
|
}) => {
|
|
156
|
-
const p = y || m, T = u && !v, L =
|
|
156
|
+
const p = y || m, T = u && !v, L = W(
|
|
157
157
|
"btn-base",
|
|
158
158
|
Ur[f],
|
|
159
159
|
qr[i],
|
|
@@ -170,11 +170,11 @@ const Ur = {
|
|
|
170
170
|
type: s,
|
|
171
171
|
className: L,
|
|
172
172
|
disabled: p,
|
|
173
|
-
onClick:
|
|
173
|
+
onClick: N,
|
|
174
174
|
title: r || T && o || (typeof v == "string" ? v : void 0),
|
|
175
175
|
"aria-label": o || T && r || (typeof v == "string" ? v : void 0),
|
|
176
176
|
...d,
|
|
177
|
-
children: m ? /* @__PURE__ */ e(ot, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ l(
|
|
177
|
+
children: m ? /* @__PURE__ */ e(ot, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ l(K, { children: [
|
|
178
178
|
u && /* @__PURE__ */ e(u, { size: f === "large" ? 20 : 16 }),
|
|
179
179
|
v,
|
|
180
180
|
a,
|
|
@@ -233,7 +233,7 @@ const Ur = {
|
|
|
233
233
|
/* @__PURE__ */ e(
|
|
234
234
|
"div",
|
|
235
235
|
{
|
|
236
|
-
className:
|
|
236
|
+
className: W("checkbox-box", {
|
|
237
237
|
"checkbox-box--checked": m,
|
|
238
238
|
"checkbox-box--error": !!s
|
|
239
239
|
}),
|
|
@@ -259,7 +259,7 @@ const Ur = {
|
|
|
259
259
|
const f = (v) => {
|
|
260
260
|
v.stopPropagation(), v.preventDefault(), s?.();
|
|
261
261
|
};
|
|
262
|
-
return /* @__PURE__ */ l("div", { className:
|
|
262
|
+
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", u), children: [
|
|
263
263
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: n }),
|
|
264
264
|
/* @__PURE__ */ l(Ea, { children: [
|
|
265
265
|
/* @__PURE__ */ e(Ra, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -268,7 +268,7 @@ const Ur = {
|
|
|
268
268
|
{
|
|
269
269
|
id: "datepicker-input",
|
|
270
270
|
type: "button",
|
|
271
|
-
className:
|
|
271
|
+
className: W("datepicker-trigger", {
|
|
272
272
|
"datepicker-trigger--error": !!m,
|
|
273
273
|
"datepicker-trigger--disabled": i
|
|
274
274
|
}),
|
|
@@ -318,12 +318,12 @@ const Ur = {
|
|
|
318
318
|
}) => {
|
|
319
319
|
const f = t?.from, v = t?.to, a = (d) => {
|
|
320
320
|
d.stopPropagation(), d.preventDefault(), s?.();
|
|
321
|
-
},
|
|
321
|
+
}, N = f && v ? /* @__PURE__ */ l(K, { children: [
|
|
322
322
|
Be(f, "MMM d, y"),
|
|
323
323
|
" - ",
|
|
324
324
|
Be(v, "MMM d, y")
|
|
325
325
|
] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
|
|
326
|
-
return /* @__PURE__ */ l("div", { className:
|
|
326
|
+
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", u), children: [
|
|
327
327
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: n }),
|
|
328
328
|
/* @__PURE__ */ l(Ea, { children: [
|
|
329
329
|
/* @__PURE__ */ e(Ra, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -332,15 +332,15 @@ const Ur = {
|
|
|
332
332
|
{
|
|
333
333
|
id: "daterangepicker-input",
|
|
334
334
|
type: "button",
|
|
335
|
-
className:
|
|
335
|
+
className: W("datepicker-trigger", {
|
|
336
336
|
"datepicker-trigger--error": !!m,
|
|
337
337
|
"datepicker-trigger--disabled": i
|
|
338
338
|
}),
|
|
339
339
|
disabled: i,
|
|
340
|
-
"aria-label": f && v ? `Selected range is ${
|
|
340
|
+
"aria-label": f && v ? `Selected range is ${N}` : o,
|
|
341
341
|
children: [
|
|
342
342
|
/* @__PURE__ */ e(pa, { className: "datepicker-icon" }),
|
|
343
|
-
/* @__PURE__ */ e("span", { className: "datepicker-value", children:
|
|
343
|
+
/* @__PURE__ */ e("span", { className: "datepicker-value", children: N })
|
|
344
344
|
]
|
|
345
345
|
}
|
|
346
346
|
),
|
|
@@ -572,7 +572,7 @@ const Ur = {
|
|
|
572
572
|
labelColor: "#FFEDD5",
|
|
573
573
|
labelTextColor: "#7C2D12"
|
|
574
574
|
}
|
|
575
|
-
},
|
|
575
|
+
}, xe = {
|
|
576
576
|
USER: "User",
|
|
577
577
|
GROUP: "Group",
|
|
578
578
|
ROLE: "Role"
|
|
@@ -627,13 +627,13 @@ const Ur = {
|
|
|
627
627
|
handleRemoveRejectedFile: f,
|
|
628
628
|
handleSubmit: v,
|
|
629
629
|
isSubmitting: a,
|
|
630
|
-
formErrors:
|
|
630
|
+
formErrors: N,
|
|
631
631
|
// --- UI Text ---
|
|
632
632
|
title: d = "Upload Files",
|
|
633
633
|
subHeading: p = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
634
634
|
}) => {
|
|
635
635
|
const T = i.length > 0 || u.length > 0;
|
|
636
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as:
|
|
636
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(
|
|
637
637
|
me,
|
|
638
638
|
{
|
|
639
639
|
as: "div",
|
|
@@ -644,7 +644,7 @@ const Ur = {
|
|
|
644
644
|
/* @__PURE__ */ e(
|
|
645
645
|
pe,
|
|
646
646
|
{
|
|
647
|
-
as:
|
|
647
|
+
as: J,
|
|
648
648
|
enter: "ease-out duration-300",
|
|
649
649
|
enterFrom: "opacity-0",
|
|
650
650
|
enterTo: "opacity-100",
|
|
@@ -657,7 +657,7 @@ const Ur = {
|
|
|
657
657
|
/* @__PURE__ */ e("div", { className: "dialog-positioner", children: /* @__PURE__ */ e(
|
|
658
658
|
pe,
|
|
659
659
|
{
|
|
660
|
-
as:
|
|
660
|
+
as: J,
|
|
661
661
|
enter: "ease-out duration-300",
|
|
662
662
|
enterFrom: "opacity-0 scale-95",
|
|
663
663
|
enterTo: "opacity-100 scale-100",
|
|
@@ -665,7 +665,7 @@ const Ur = {
|
|
|
665
665
|
leaveFrom: "opacity-100 scale-100",
|
|
666
666
|
leaveTo: "opacity-0 scale-95",
|
|
667
667
|
children: /* @__PURE__ */ l(
|
|
668
|
-
|
|
668
|
+
ke,
|
|
669
669
|
{
|
|
670
670
|
className: "dialog-panel",
|
|
671
671
|
onClick: (L) => L.stopPropagation(),
|
|
@@ -707,7 +707,7 @@ const Ur = {
|
|
|
707
707
|
]
|
|
708
708
|
}
|
|
709
709
|
),
|
|
710
|
-
|
|
710
|
+
N.filesToUpload && /* @__PURE__ */ e("p", { className: "form-error-message", children: N.filesToUpload.message }),
|
|
711
711
|
T && /* @__PURE__ */ l("div", { className: "file-list-container", children: [
|
|
712
712
|
/* @__PURE__ */ e("h3", { children: "Upload Queue" }),
|
|
713
713
|
/* @__PURE__ */ l("ul", { className: "file-list", children: [
|
|
@@ -777,7 +777,7 @@ const Ur = {
|
|
|
777
777
|
] }),
|
|
778
778
|
/* @__PURE__ */ l("div", { className: "dialog-footer", children: [
|
|
779
779
|
/* @__PURE__ */ e(
|
|
780
|
-
|
|
780
|
+
Z,
|
|
781
781
|
{
|
|
782
782
|
type: "button",
|
|
783
783
|
category: "secondary",
|
|
@@ -786,7 +786,7 @@ const Ur = {
|
|
|
786
786
|
}
|
|
787
787
|
),
|
|
788
788
|
/* @__PURE__ */ e(
|
|
789
|
-
|
|
789
|
+
Z,
|
|
790
790
|
{
|
|
791
791
|
type: "submit",
|
|
792
792
|
label: a ? "Uploading..." : "Upload Files",
|
|
@@ -837,7 +837,7 @@ const Ur = {
|
|
|
837
837
|
}), r();
|
|
838
838
|
},
|
|
839
839
|
enableReinitialize: !0
|
|
840
|
-
}),
|
|
840
|
+
}), N = ne(() => n.reduce((S, A) => {
|
|
841
841
|
const B = A.key, I = a.values[B];
|
|
842
842
|
let V = !1;
|
|
843
843
|
if (I)
|
|
@@ -851,7 +851,7 @@ const Ur = {
|
|
|
851
851
|
break;
|
|
852
852
|
}
|
|
853
853
|
return S[B] = V, S;
|
|
854
|
-
}, {}), [n, a.values]), d = Object.values(
|
|
854
|
+
}, {}), [n, a.values]), d = Object.values(N).filter(Boolean).length, p = async (S, A) => {
|
|
855
855
|
try {
|
|
856
856
|
v((I) => ({ ...I, [S]: !0 }));
|
|
857
857
|
const B = await i(S, A);
|
|
@@ -895,7 +895,7 @@ const Ur = {
|
|
|
895
895
|
className: "filter-checkbox-input",
|
|
896
896
|
checked: A.options.length > 0 && I.length === A.options.length,
|
|
897
897
|
onChange: (c) => {
|
|
898
|
-
const b = c.target.checked ? A.options.map((
|
|
898
|
+
const b = c.target.checked ? A.options.map((k) => k.value) : [];
|
|
899
899
|
a.setFieldValue(`${S}.values`, b);
|
|
900
900
|
}
|
|
901
901
|
}
|
|
@@ -918,8 +918,8 @@ const Ur = {
|
|
|
918
918
|
className: "filter-checkbox-input",
|
|
919
919
|
checked: I.includes(c.value),
|
|
920
920
|
onChange: (b) => {
|
|
921
|
-
const
|
|
922
|
-
a.setFieldValue(`${S}.values`,
|
|
921
|
+
const k = b.target.checked ? [...I, c.value] : I.filter((D) => D !== c.value);
|
|
922
|
+
a.setFieldValue(`${S}.values`, k);
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
925
|
),
|
|
@@ -949,7 +949,7 @@ const Ur = {
|
|
|
949
949
|
}
|
|
950
950
|
)
|
|
951
951
|
] }),
|
|
952
|
-
z ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: V.length > 0 ? /* @__PURE__ */ l(
|
|
952
|
+
z ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: V.length > 0 ? /* @__PURE__ */ l(K, { children: [
|
|
953
953
|
/* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
|
|
954
954
|
/* @__PURE__ */ e(
|
|
955
955
|
"input",
|
|
@@ -959,7 +959,7 @@ const Ur = {
|
|
|
959
959
|
className: "filter-checkbox-input",
|
|
960
960
|
checked: V.length > 0 && I.length === V.length,
|
|
961
961
|
onChange: (c) => {
|
|
962
|
-
const b = c.target.checked ? V.map((
|
|
962
|
+
const b = c.target.checked ? V.map((k) => k.email) : [];
|
|
963
963
|
a.setFieldValue(
|
|
964
964
|
`${S}.values`,
|
|
965
965
|
b
|
|
@@ -985,10 +985,10 @@ const Ur = {
|
|
|
985
985
|
className: "filter-checkbox-input",
|
|
986
986
|
checked: I.includes(c.email),
|
|
987
987
|
onChange: (b) => {
|
|
988
|
-
const
|
|
988
|
+
const k = b.target.checked ? [...I, c.email] : I.filter((D) => D !== c.email);
|
|
989
989
|
a.setFieldValue(
|
|
990
990
|
`${S}.values`,
|
|
991
|
-
|
|
991
|
+
k
|
|
992
992
|
);
|
|
993
993
|
}
|
|
994
994
|
}
|
|
@@ -1008,7 +1008,7 @@ const Ur = {
|
|
|
1008
1008
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1009
1009
|
] });
|
|
1010
1010
|
case "date":
|
|
1011
|
-
const P = B.values || [], [g, h] = P,
|
|
1011
|
+
const P = B.values || [], [g, h] = P, x = g && h, w = {
|
|
1012
1012
|
startDate: g instanceof Date ? g : /* @__PURE__ */ new Date(),
|
|
1013
1013
|
// Fallback to today
|
|
1014
1014
|
endDate: h instanceof Date ? h : /* @__PURE__ */ new Date(),
|
|
@@ -1027,7 +1027,7 @@ const Ur = {
|
|
|
1027
1027
|
children: A.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Is" : "Is not" }, c))
|
|
1028
1028
|
}
|
|
1029
1029
|
),
|
|
1030
|
-
|
|
1030
|
+
x && /* @__PURE__ */ e(
|
|
1031
1031
|
"button",
|
|
1032
1032
|
{
|
|
1033
1033
|
type: "button",
|
|
@@ -1047,10 +1047,10 @@ const Ur = {
|
|
|
1047
1047
|
{
|
|
1048
1048
|
ranges: [w],
|
|
1049
1049
|
onChange: (c) => {
|
|
1050
|
-
const { startDate: b, endDate:
|
|
1050
|
+
const { startDate: b, endDate: k } = c.selection;
|
|
1051
1051
|
a.setFieldValue(`${S}.values`, [
|
|
1052
1052
|
b,
|
|
1053
|
-
|
|
1053
|
+
k
|
|
1054
1054
|
]);
|
|
1055
1055
|
},
|
|
1056
1056
|
showSelectionPreview: !0,
|
|
@@ -1065,11 +1065,11 @@ const Ur = {
|
|
|
1065
1065
|
return null;
|
|
1066
1066
|
}
|
|
1067
1067
|
};
|
|
1068
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as:
|
|
1068
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: r, children: [
|
|
1069
1069
|
/* @__PURE__ */ e(
|
|
1070
1070
|
pe,
|
|
1071
1071
|
{
|
|
1072
|
-
as:
|
|
1072
|
+
as: J,
|
|
1073
1073
|
enter: "ease-out duration-300",
|
|
1074
1074
|
enterFrom: "opacity-0",
|
|
1075
1075
|
enterTo: "opacity-100",
|
|
@@ -1082,14 +1082,14 @@ const Ur = {
|
|
|
1082
1082
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(
|
|
1083
1083
|
pe,
|
|
1084
1084
|
{
|
|
1085
|
-
as:
|
|
1085
|
+
as: J,
|
|
1086
1086
|
enter: "ease-out duration-300",
|
|
1087
1087
|
enterFrom: "opacity-0 translate-x-full",
|
|
1088
1088
|
enterTo: "opacity-100 translate-x-0",
|
|
1089
1089
|
leave: "ease-in duration-200",
|
|
1090
1090
|
leaveFrom: "opacity-100 translate-x-0",
|
|
1091
1091
|
leaveTo: "opacity-0 translate-x-full",
|
|
1092
|
-
children: /* @__PURE__ */ l(
|
|
1092
|
+
children: /* @__PURE__ */ l(ke, { className: "filter-modal-panel", children: [
|
|
1093
1093
|
/* @__PURE__ */ l("div", { className: "filter-header", children: [
|
|
1094
1094
|
/* @__PURE__ */ e(Ve, { as: "h3", className: "filter-title", children: "Filters" }),
|
|
1095
1095
|
/* @__PURE__ */ e(
|
|
@@ -1115,7 +1115,7 @@ const Ur = {
|
|
|
1115
1115
|
children: [
|
|
1116
1116
|
/* @__PURE__ */ e(sr, { className: "filter-tabs-list", children: n.map((S) => /* @__PURE__ */ l(ee, { className: "filter-tab-item", children: [
|
|
1117
1117
|
S.label,
|
|
1118
|
-
|
|
1118
|
+
N[S.key] && /* @__PURE__ */ e(
|
|
1119
1119
|
"span",
|
|
1120
1120
|
{
|
|
1121
1121
|
className: "filter-active-indicator",
|
|
@@ -1146,32 +1146,25 @@ const Ur = {
|
|
|
1146
1146
|
) }),
|
|
1147
1147
|
/* @__PURE__ */ l("div", { className: "filter-footer", children: [
|
|
1148
1148
|
/* @__PURE__ */ e(
|
|
1149
|
-
|
|
1149
|
+
"button",
|
|
1150
1150
|
{
|
|
1151
|
-
|
|
1152
|
-
label: "Cancel",
|
|
1153
|
-
loader: !1,
|
|
1154
|
-
ariaLabel: "Cancel Button",
|
|
1151
|
+
type: "button",
|
|
1155
1152
|
onClick: r,
|
|
1156
|
-
|
|
1153
|
+
className: "filter-button cancel",
|
|
1154
|
+
children: "Cancel"
|
|
1157
1155
|
}
|
|
1158
1156
|
),
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
|
|
1157
|
+
/* @__PURE__ */ l(
|
|
1158
|
+
"button",
|
|
1161
1159
|
{
|
|
1162
|
-
|
|
1160
|
+
type: "submit",
|
|
1161
|
+
disabled: !a.dirty,
|
|
1162
|
+
className: "filter-button apply",
|
|
1163
|
+
children: [
|
|
1163
1164
|
"Apply Filters",
|
|
1164
1165
|
" ",
|
|
1165
1166
|
d > 0 ? `(${d})` : ""
|
|
1166
|
-
]
|
|
1167
|
-
loader: !1,
|
|
1168
|
-
type: "submit",
|
|
1169
|
-
ariaLabel: "Apply Filter",
|
|
1170
|
-
className: "p-3 primaryButton !w-[70px]",
|
|
1171
|
-
"data-testid": "apply-filter",
|
|
1172
|
-
onClick: () => primaryAction?.onSubmit(),
|
|
1173
|
-
category: "primary",
|
|
1174
|
-
disabled: !a.dirty
|
|
1167
|
+
]
|
|
1175
1168
|
}
|
|
1176
1169
|
)
|
|
1177
1170
|
] })
|
|
@@ -1202,7 +1195,7 @@ const Ur = {
|
|
|
1202
1195
|
id: y,
|
|
1203
1196
|
type: s,
|
|
1204
1197
|
ref: i,
|
|
1205
|
-
className:
|
|
1198
|
+
className: W("input-field", {
|
|
1206
1199
|
"input-field--error": !!n,
|
|
1207
1200
|
"input-field--with-icon": !!o
|
|
1208
1201
|
}),
|
|
@@ -1245,14 +1238,14 @@ const Ur = {
|
|
|
1245
1238
|
}) => {
|
|
1246
1239
|
const f = oa[i] || oa.info, v = f.icon, a = () => {
|
|
1247
1240
|
r({ primary: !0, secondary: !1 });
|
|
1248
|
-
},
|
|
1241
|
+
}, N = () => {
|
|
1249
1242
|
r({ primary: !1, secondary: !0 });
|
|
1250
1243
|
};
|
|
1251
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as:
|
|
1244
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "modal-dialog", onClose: () => r({}), children: [
|
|
1252
1245
|
/* @__PURE__ */ e(
|
|
1253
1246
|
pe,
|
|
1254
1247
|
{
|
|
1255
|
-
as:
|
|
1248
|
+
as: J,
|
|
1256
1249
|
enter: "ease-out duration-300",
|
|
1257
1250
|
enterFrom: "opacity-0",
|
|
1258
1251
|
enterTo: "opacity-100",
|
|
@@ -1265,14 +1258,14 @@ const Ur = {
|
|
|
1265
1258
|
/* @__PURE__ */ e("div", { className: "modal-positioner", children: /* @__PURE__ */ e(
|
|
1266
1259
|
pe,
|
|
1267
1260
|
{
|
|
1268
|
-
as:
|
|
1261
|
+
as: J,
|
|
1269
1262
|
enter: "ease-out duration-300",
|
|
1270
1263
|
enterFrom: "opacity-0 scale-95",
|
|
1271
1264
|
enterTo: "opacity-100 scale-100",
|
|
1272
1265
|
leave: "ease-in duration-200",
|
|
1273
1266
|
leaveFrom: "opacity-100 scale-100",
|
|
1274
1267
|
leaveTo: "opacity-0 scale-95",
|
|
1275
|
-
children: /* @__PURE__ */ l(
|
|
1268
|
+
children: /* @__PURE__ */ l(ke, { className: "modal-panel", children: [
|
|
1276
1269
|
/* @__PURE__ */ l("div", { className: "modal-content-wrapper", children: [
|
|
1277
1270
|
/* @__PURE__ */ e("div", { className: `modal-icon-container ${f.iconClass}`, children: /* @__PURE__ */ e(v, { size: 24, "aria-hidden": "true" }) }),
|
|
1278
1271
|
/* @__PURE__ */ l("div", { className: "modal-text-content", children: [
|
|
@@ -1282,15 +1275,15 @@ const Ur = {
|
|
|
1282
1275
|
] }),
|
|
1283
1276
|
/* @__PURE__ */ l("div", { className: "modal-footer", children: [
|
|
1284
1277
|
/* @__PURE__ */ e(
|
|
1285
|
-
|
|
1278
|
+
Z,
|
|
1286
1279
|
{
|
|
1287
|
-
onClick:
|
|
1280
|
+
onClick: N,
|
|
1288
1281
|
label: m,
|
|
1289
1282
|
category: "secondary"
|
|
1290
1283
|
}
|
|
1291
1284
|
),
|
|
1292
1285
|
/* @__PURE__ */ e(
|
|
1293
|
-
|
|
1286
|
+
Z,
|
|
1294
1287
|
{
|
|
1295
1288
|
onClick: a,
|
|
1296
1289
|
label: n,
|
|
@@ -1311,11 +1304,11 @@ const Ur = {
|
|
|
1311
1304
|
itemsPerPageOptions: m = [10, 15, 20]
|
|
1312
1305
|
}) => {
|
|
1313
1306
|
const i = Math.ceil(r / s), [u, y] = M(t);
|
|
1314
|
-
|
|
1307
|
+
Q(() => {
|
|
1315
1308
|
y(t);
|
|
1316
1309
|
}, [t]);
|
|
1317
|
-
const f = Math.min((t - 1) * s + 1, r), v = Math.min(t * s, r), a = (
|
|
1318
|
-
|
|
1310
|
+
const f = Math.min((t - 1) * s + 1, r), v = Math.min(t * s, r), a = (N) => {
|
|
1311
|
+
N.preventDefault();
|
|
1319
1312
|
let d = parseInt(u, 10);
|
|
1320
1313
|
isNaN(d) || d < 1 ? d = 1 : d > i && (d = i), y(d), d !== t && o(d);
|
|
1321
1314
|
};
|
|
@@ -1328,8 +1321,8 @@ const Ur = {
|
|
|
1328
1321
|
id: "items-per-page",
|
|
1329
1322
|
className: "pagination-select",
|
|
1330
1323
|
value: s,
|
|
1331
|
-
onChange: (
|
|
1332
|
-
children: m.map((
|
|
1324
|
+
onChange: (N) => n(Number(N.target.value)),
|
|
1325
|
+
children: m.map((N) => /* @__PURE__ */ e("option", { value: N, children: N }, N))
|
|
1333
1326
|
}
|
|
1334
1327
|
),
|
|
1335
1328
|
/* @__PURE__ */ l("span", { className: "pagination-info", children: [
|
|
@@ -1368,7 +1361,7 @@ const Ur = {
|
|
|
1368
1361
|
type: "number",
|
|
1369
1362
|
className: "page-input",
|
|
1370
1363
|
value: u,
|
|
1371
|
-
onChange: (
|
|
1364
|
+
onChange: (N) => y(N.target.value),
|
|
1372
1365
|
onBlur: a,
|
|
1373
1366
|
"aria-label": `Current page, Page ${t}`
|
|
1374
1367
|
}
|
|
@@ -1419,12 +1412,12 @@ const Ur = {
|
|
|
1419
1412
|
Te.Option,
|
|
1420
1413
|
{
|
|
1421
1414
|
value: i.value,
|
|
1422
|
-
className: ({ active: u, checked: y }) =>
|
|
1415
|
+
className: ({ active: u, checked: y }) => W("radiogroup-option", {
|
|
1423
1416
|
"radiogroup-option--active": u,
|
|
1424
1417
|
"radiogroup-option--checked": y,
|
|
1425
1418
|
"radiogroup-option--error": !!n
|
|
1426
1419
|
}),
|
|
1427
|
-
children: ({ checked: u }) => /* @__PURE__ */ l(
|
|
1420
|
+
children: ({ checked: u }) => /* @__PURE__ */ l(K, { children: [
|
|
1428
1421
|
/* @__PURE__ */ l("div", { className: "radiogroup-option-content", children: [
|
|
1429
1422
|
/* @__PURE__ */ e(Te.Label, { as: "p", className: "option-label", children: i.label }),
|
|
1430
1423
|
i.description && /* @__PURE__ */ e(
|
|
@@ -1455,7 +1448,7 @@ const Ur = {
|
|
|
1455
1448
|
...i
|
|
1456
1449
|
}) => {
|
|
1457
1450
|
const [u, y] = M(t);
|
|
1458
|
-
|
|
1451
|
+
Q(() => {
|
|
1459
1452
|
y(t);
|
|
1460
1453
|
}, [t]);
|
|
1461
1454
|
const f = ae(
|
|
@@ -1464,7 +1457,7 @@ const Ur = {
|
|
|
1464
1457
|
}, s),
|
|
1465
1458
|
[s, r]
|
|
1466
1459
|
);
|
|
1467
|
-
|
|
1460
|
+
Q(() => (u !== t && f(u), () => {
|
|
1468
1461
|
f.cancel();
|
|
1469
1462
|
}), [u, f, t]);
|
|
1470
1463
|
const v = (a) => {
|
|
@@ -1503,18 +1496,18 @@ const Ur = {
|
|
|
1503
1496
|
}) => {
|
|
1504
1497
|
const [f, v] = M(""), a = f === "" ? o : o.filter(
|
|
1505
1498
|
(d) => d.label.toLowerCase().includes(f.toLowerCase())
|
|
1506
|
-
),
|
|
1507
|
-
return /* @__PURE__ */ e(
|
|
1499
|
+
), N = o.find((d) => r?.id ? d.id === r.id : d.id === r || d.value === r);
|
|
1500
|
+
return /* @__PURE__ */ e(X, { value: r, onChange: s, disabled: m, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: u, children: [
|
|
1508
1501
|
t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
|
|
1509
1502
|
/* @__PURE__ */ l("div", { className: "select-button-container", children: [
|
|
1510
1503
|
/* @__PURE__ */ l(
|
|
1511
1504
|
or,
|
|
1512
1505
|
{
|
|
1513
|
-
className:
|
|
1506
|
+
className: W("select-button", {
|
|
1514
1507
|
"select-button--error": !!i
|
|
1515
1508
|
}),
|
|
1516
1509
|
children: [
|
|
1517
|
-
/* @__PURE__ */ e("span", { className: "select-value-display", children:
|
|
1510
|
+
/* @__PURE__ */ e("span", { className: "select-value-display", children: N ? N.label : /* @__PURE__ */ e("span", { className: "placeholder", children: n }) }),
|
|
1518
1511
|
/* @__PURE__ */ e(fa, { className: "select-chevron", "aria-hidden": "true" })
|
|
1519
1512
|
]
|
|
1520
1513
|
}
|
|
@@ -1539,7 +1532,7 @@ const Ur = {
|
|
|
1539
1532
|
{
|
|
1540
1533
|
className: ({ active: p }) => `select-option ${p ? "active" : ""}`,
|
|
1541
1534
|
value: d,
|
|
1542
|
-
children: ({ selected: p }) => /* @__PURE__ */ l(
|
|
1535
|
+
children: ({ selected: p }) => /* @__PURE__ */ l(K, { children: [
|
|
1543
1536
|
/* @__PURE__ */ l("div", { className: "option-content", children: [
|
|
1544
1537
|
d.icon && /* @__PURE__ */ e(d.icon, { className: "option-icon" }),
|
|
1545
1538
|
/* @__PURE__ */ e(
|
|
@@ -1569,7 +1562,7 @@ const Ur = {
|
|
|
1569
1562
|
] }) });
|
|
1570
1563
|
}, Wr = () => {
|
|
1571
1564
|
const [t, r] = M(window.location.pathname);
|
|
1572
|
-
return
|
|
1565
|
+
return Q(() => {
|
|
1573
1566
|
const s = () => {
|
|
1574
1567
|
r(window.location.pathname);
|
|
1575
1568
|
};
|
|
@@ -1584,7 +1577,7 @@ const Ur = {
|
|
|
1584
1577
|
return null;
|
|
1585
1578
|
}, Pa = ({ item: t, isCollapsed: r, level: s = 0 }) => {
|
|
1586
1579
|
const { pathname: o } = Wr(), n = t.href || t.url || t.path, [m, i] = M(!1), u = t.icon;
|
|
1587
|
-
|
|
1580
|
+
Q(() => {
|
|
1588
1581
|
Ke([t], o) && i(!0);
|
|
1589
1582
|
}, [t, o]);
|
|
1590
1583
|
const y = o === n, f = !y && !!Ke([t], o), v = (a) => {
|
|
@@ -1593,7 +1586,7 @@ const Ur = {
|
|
|
1593
1586
|
return /* @__PURE__ */ l(
|
|
1594
1587
|
"div",
|
|
1595
1588
|
{
|
|
1596
|
-
className:
|
|
1589
|
+
className: W("nav-item-container", {
|
|
1597
1590
|
"nav-item-container--parent-active": f,
|
|
1598
1591
|
[`nav-item-container--level-${s}`]: s > 0
|
|
1599
1592
|
}),
|
|
@@ -1604,7 +1597,7 @@ const Ur = {
|
|
|
1604
1597
|
href: n,
|
|
1605
1598
|
target: t.target,
|
|
1606
1599
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
1607
|
-
className:
|
|
1600
|
+
className: W("nav-item", {
|
|
1608
1601
|
"nav-item--active": y,
|
|
1609
1602
|
"nav-item--collapsed": r
|
|
1610
1603
|
}),
|
|
@@ -1622,7 +1615,7 @@ const Ur = {
|
|
|
1622
1615
|
children: /* @__PURE__ */ e(
|
|
1623
1616
|
ba,
|
|
1624
1617
|
{
|
|
1625
|
-
className:
|
|
1618
|
+
className: W("nav-chevron", {
|
|
1626
1619
|
"nav-chevron--open": m
|
|
1627
1620
|
})
|
|
1628
1621
|
}
|
|
@@ -1635,7 +1628,7 @@ const Ur = {
|
|
|
1635
1628
|
t.children && /* @__PURE__ */ e(
|
|
1636
1629
|
"div",
|
|
1637
1630
|
{
|
|
1638
|
-
className:
|
|
1631
|
+
className: W("sub-menu", {
|
|
1639
1632
|
"sub-menu--open": m,
|
|
1640
1633
|
"sub-menu--collapsed": r
|
|
1641
1634
|
}),
|
|
@@ -1663,7 +1656,7 @@ const Ur = {
|
|
|
1663
1656
|
logoSmall: m,
|
|
1664
1657
|
logoLarge: i,
|
|
1665
1658
|
user: u = { name: "", email: "" }
|
|
1666
|
-
}) => /* @__PURE__ */ l(
|
|
1659
|
+
}) => /* @__PURE__ */ l(K, { children: [
|
|
1667
1660
|
o && /* @__PURE__ */ e(
|
|
1668
1661
|
"div",
|
|
1669
1662
|
{
|
|
@@ -1675,7 +1668,7 @@ const Ur = {
|
|
|
1675
1668
|
/* @__PURE__ */ l(
|
|
1676
1669
|
"aside",
|
|
1677
1670
|
{
|
|
1678
|
-
className:
|
|
1671
|
+
className: W("sidebar", {
|
|
1679
1672
|
"sidebar--collapsed": r,
|
|
1680
1673
|
"sidebar--mobile-open": o
|
|
1681
1674
|
}),
|
|
@@ -1733,7 +1726,7 @@ const Ur = {
|
|
|
1733
1726
|
className: s,
|
|
1734
1727
|
...o
|
|
1735
1728
|
}) => {
|
|
1736
|
-
const n =
|
|
1729
|
+
const n = W(
|
|
1737
1730
|
"spinner",
|
|
1738
1731
|
`spinner--size-${t}`,
|
|
1739
1732
|
`spinner--color-${r}`,
|
|
@@ -1777,12 +1770,12 @@ const Ur = {
|
|
|
1777
1770
|
u.value?.length || u.defaultValue?.length || 0
|
|
1778
1771
|
), a = (d) => {
|
|
1779
1772
|
v(d.target.value.length), u.onChange && u.onChange(d);
|
|
1780
|
-
},
|
|
1773
|
+
}, N = m - f;
|
|
1781
1774
|
return /* @__PURE__ */ l("div", { className: `textarea-wrapper ${o || ""}`, children: [
|
|
1782
1775
|
/* @__PURE__ */ l("div", { className: "textarea-header", children: [
|
|
1783
1776
|
t && /* @__PURE__ */ e("label", { htmlFor: y, className: "textarea-label", children: t }),
|
|
1784
1777
|
i && m && /* @__PURE__ */ l("span", { className: "char-counter", children: [
|
|
1785
|
-
|
|
1778
|
+
N,
|
|
1786
1779
|
" characters remaining"
|
|
1787
1780
|
] })
|
|
1788
1781
|
] }),
|
|
@@ -1791,7 +1784,7 @@ const Ur = {
|
|
|
1791
1784
|
{
|
|
1792
1785
|
id: y,
|
|
1793
1786
|
ref: n,
|
|
1794
|
-
className:
|
|
1787
|
+
className: W("textarea-field", {
|
|
1795
1788
|
"textarea-field--error": !!s
|
|
1796
1789
|
}),
|
|
1797
1790
|
maxLength: m,
|
|
@@ -1816,7 +1809,7 @@ const Ur = {
|
|
|
1816
1809
|
{
|
|
1817
1810
|
checked: r,
|
|
1818
1811
|
onChange: s,
|
|
1819
|
-
className:
|
|
1812
|
+
className: W("switch-element", {
|
|
1820
1813
|
// Renamed from switch-wrapper
|
|
1821
1814
|
"switch-element--error": !!n
|
|
1822
1815
|
}),
|
|
@@ -1841,7 +1834,7 @@ const Ur = {
|
|
|
1841
1834
|
...i
|
|
1842
1835
|
}) => {
|
|
1843
1836
|
const u = re.useId();
|
|
1844
|
-
return /* @__PURE__ */ l(
|
|
1837
|
+
return /* @__PURE__ */ l(K, { children: [
|
|
1845
1838
|
re.cloneElement(t, { "data-tooltip-id": u }),
|
|
1846
1839
|
/* @__PURE__ */ e(
|
|
1847
1840
|
Nt,
|
|
@@ -1880,8 +1873,8 @@ const Ur = {
|
|
|
1880
1873
|
showProgress: y = !0,
|
|
1881
1874
|
closeOnOverlayClick: f = !0
|
|
1882
1875
|
}) => {
|
|
1883
|
-
const v = s[o], a = Object.keys(s),
|
|
1884
|
-
return /* @__PURE__ */ e(oe, { show: t, as:
|
|
1876
|
+
const v = s[o], a = Object.keys(s), N = a.indexOf(o), d = (N + 1) / a.length * 100, p = N > 0 && m.onBack;
|
|
1877
|
+
return /* @__PURE__ */ e(oe, { show: t, as: J, children: /* @__PURE__ */ l(
|
|
1885
1878
|
me,
|
|
1886
1879
|
{
|
|
1887
1880
|
as: "div",
|
|
@@ -1892,7 +1885,7 @@ const Ur = {
|
|
|
1892
1885
|
/* @__PURE__ */ e(
|
|
1893
1886
|
pe,
|
|
1894
1887
|
{
|
|
1895
|
-
as:
|
|
1888
|
+
as: J,
|
|
1896
1889
|
enter: "ease-out duration-300",
|
|
1897
1890
|
enterFrom: "opacity-0",
|
|
1898
1891
|
enterTo: "opacity-100",
|
|
@@ -1905,14 +1898,14 @@ const Ur = {
|
|
|
1905
1898
|
/* @__PURE__ */ e("div", { className: "wizard-container", children: /* @__PURE__ */ e("div", { className: "wizard-positioner", children: /* @__PURE__ */ e(
|
|
1906
1899
|
pe,
|
|
1907
1900
|
{
|
|
1908
|
-
as:
|
|
1901
|
+
as: J,
|
|
1909
1902
|
enter: "transform transition ease-in-out duration-500",
|
|
1910
1903
|
enterFrom: "translate-x-full",
|
|
1911
1904
|
enterTo: "translate-x-0",
|
|
1912
1905
|
leave: "transform transition ease-in-out duration-500",
|
|
1913
1906
|
leaveFrom: "translate-x-0",
|
|
1914
1907
|
leaveTo: "translate-x-full",
|
|
1915
|
-
children: /* @__PURE__ */ l(
|
|
1908
|
+
children: /* @__PURE__ */ l(ke, { className: "wizard-panel", children: [
|
|
1916
1909
|
/* @__PURE__ */ l("header", { className: "wizard-header", children: [
|
|
1917
1910
|
/* @__PURE__ */ l("div", { className: "wizard-header-content", children: [
|
|
1918
1911
|
p && /* @__PURE__ */ e(
|
|
@@ -1990,7 +1983,7 @@ const Ur = {
|
|
|
1990
1983
|
// A clearer prop name
|
|
1991
1984
|
...u
|
|
1992
1985
|
}) => {
|
|
1993
|
-
const y =
|
|
1986
|
+
const y = W(
|
|
1994
1987
|
"page-layout",
|
|
1995
1988
|
{
|
|
1996
1989
|
"page-layout--with-footer": r,
|
|
@@ -2002,7 +1995,7 @@ const Ur = {
|
|
|
2002
1995
|
/* @__PURE__ */ e("div", { className: "page-layout-content", children: t }),
|
|
2003
1996
|
r && /* @__PURE__ */ e("footer", { className: "page-layout-footer", children: s || /* @__PURE__ */ l("div", { className: "footer-actions", children: [
|
|
2004
1997
|
m?.show && /* @__PURE__ */ e(
|
|
2005
|
-
|
|
1998
|
+
Z,
|
|
2006
1999
|
{
|
|
2007
2000
|
category: "secondary",
|
|
2008
2001
|
label: m.label || "Tertiary",
|
|
@@ -2010,7 +2003,7 @@ const Ur = {
|
|
|
2010
2003
|
}
|
|
2011
2004
|
),
|
|
2012
2005
|
n?.show && /* @__PURE__ */ e(
|
|
2013
|
-
|
|
2006
|
+
Z,
|
|
2014
2007
|
{
|
|
2015
2008
|
category: "secondary",
|
|
2016
2009
|
label: n.label || "Cancel",
|
|
@@ -2018,7 +2011,7 @@ const Ur = {
|
|
|
2018
2011
|
}
|
|
2019
2012
|
),
|
|
2020
2013
|
o?.show && /* @__PURE__ */ e(
|
|
2021
|
-
|
|
2014
|
+
Z,
|
|
2022
2015
|
{
|
|
2023
2016
|
category: "primary",
|
|
2024
2017
|
label: o.label || "Save",
|
|
@@ -2064,7 +2057,7 @@ const Ur = {
|
|
|
2064
2057
|
/* @__PURE__ */ e(hr, { children: /* @__PURE__ */ e(
|
|
2065
2058
|
oe,
|
|
2066
2059
|
{
|
|
2067
|
-
as:
|
|
2060
|
+
as: J,
|
|
2068
2061
|
enter: "transition ease-out duration-100",
|
|
2069
2062
|
enterFrom: "transform opacity-0 scale-95",
|
|
2070
2063
|
enterTo: "transform opacity-100 scale-100",
|
|
@@ -2300,31 +2293,31 @@ function nn({
|
|
|
2300
2293
|
);
|
|
2301
2294
|
function o({ open: f = !1, customHeader: v = {} } = {}) {
|
|
2302
2295
|
if (f) {
|
|
2303
|
-
const { Authorization: a, ...
|
|
2296
|
+
const { Authorization: a, ...N } = ia();
|
|
2304
2297
|
return {
|
|
2305
|
-
headers: { ...
|
|
2298
|
+
headers: { ...N, ...r, ...v }
|
|
2306
2299
|
};
|
|
2307
2300
|
}
|
|
2308
2301
|
return { headers: { ...ia(), ...v } };
|
|
2309
2302
|
}
|
|
2310
|
-
async function n(f, v, a = !1,
|
|
2303
|
+
async function n(f, v, a = !1, N = {}) {
|
|
2311
2304
|
return s.get(f, {
|
|
2312
2305
|
params: v,
|
|
2313
|
-
...o({ open: a, customHeader:
|
|
2306
|
+
...o({ open: a, customHeader: N })
|
|
2314
2307
|
});
|
|
2315
2308
|
}
|
|
2316
|
-
async function m(f, v, a = !1,
|
|
2317
|
-
const d = { ...o({ open: a, customHeader:
|
|
2309
|
+
async function m(f, v, a = !1, N = {}) {
|
|
2310
|
+
const d = { ...o({ open: a, customHeader: N }) };
|
|
2318
2311
|
return v !== void 0 && (d.data = v), s.delete(f, d);
|
|
2319
2312
|
}
|
|
2320
|
-
async function i(f, v = {}, a = !1,
|
|
2321
|
-
return s.post(f, v, o({ open: a, customHeader:
|
|
2313
|
+
async function i(f, v = {}, a = !1, N = {}) {
|
|
2314
|
+
return s.post(f, v, o({ open: a, customHeader: N }));
|
|
2322
2315
|
}
|
|
2323
|
-
async function u(f, v = {}, a = !1,
|
|
2324
|
-
return s.put(f, v, o({ open: a, customHeader:
|
|
2316
|
+
async function u(f, v = {}, a = !1, N = {}) {
|
|
2317
|
+
return s.put(f, v, o({ open: a, customHeader: N }));
|
|
2325
2318
|
}
|
|
2326
|
-
async function y(f, v = {}, a = !1,
|
|
2327
|
-
return s.patch(f, v, o({ open: a, customHeader:
|
|
2319
|
+
async function y(f, v = {}, a = !1, N = {}) {
|
|
2320
|
+
return s.patch(f, v, o({ open: a, customHeader: N }));
|
|
2328
2321
|
}
|
|
2329
2322
|
return {
|
|
2330
2323
|
instance: s,
|
|
@@ -2336,18 +2329,18 @@ function nn({
|
|
|
2336
2329
|
axiosPatch: y
|
|
2337
2330
|
};
|
|
2338
2331
|
}
|
|
2339
|
-
const
|
|
2332
|
+
const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln = we.axiosPut, rs = we.axiosPatch, ns = we.instance, on = async (t, r) => {
|
|
2340
2333
|
try {
|
|
2341
2334
|
switch (t) {
|
|
2342
|
-
case
|
|
2335
|
+
case xe.USER: {
|
|
2343
2336
|
const s = {
|
|
2344
2337
|
q: r
|
|
2345
2338
|
};
|
|
2346
2339
|
return Ie.userSearch(s);
|
|
2347
2340
|
}
|
|
2348
|
-
case
|
|
2341
|
+
case xe.GROUP:
|
|
2349
2342
|
return Ie.getAdGroups(r);
|
|
2350
|
-
case
|
|
2343
|
+
case xe.ROLE:
|
|
2351
2344
|
return Ie.searchRoles(r);
|
|
2352
2345
|
default:
|
|
2353
2346
|
break;
|
|
@@ -2423,7 +2416,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2423
2416
|
}
|
|
2424
2417
|
}, ta = (t, r) => {
|
|
2425
2418
|
const [s, o] = M(t);
|
|
2426
|
-
return
|
|
2419
|
+
return Q(
|
|
2427
2420
|
() => {
|
|
2428
2421
|
const n = br.debounce(() => {
|
|
2429
2422
|
o(t);
|
|
@@ -2475,9 +2468,9 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2475
2468
|
}
|
|
2476
2469
|
);
|
|
2477
2470
|
}, da = [
|
|
2478
|
-
{ id: 1, name:
|
|
2479
|
-
{ id: 2, name:
|
|
2480
|
-
{ id: 3, name:
|
|
2471
|
+
{ id: 1, name: xe.USER, icon: $t, code: "users" },
|
|
2472
|
+
{ id: 2, name: xe.GROUP, icon: va, code: "groups" },
|
|
2473
|
+
{ id: 3, name: xe.ROLE, icon: Tt, code: "roles" }
|
|
2481
2474
|
], ua = [
|
|
2482
2475
|
{ id: 1, name: na.View, icon: xa },
|
|
2483
2476
|
{ id: 2, name: na.Manage, icon: Na }
|
|
@@ -2494,7 +2487,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2494
2487
|
},
|
|
2495
2488
|
isChanged: u = !1
|
|
2496
2489
|
}) => {
|
|
2497
|
-
const [y, f] = M(da[0]), [v, a] = M(""),
|
|
2490
|
+
const [y, f] = M(da[0]), [v, a] = M(""), N = ta(v, 400), [d, p] = M([]), [T, L] = M(/* @__PURE__ */ new Set()), [R, S] = M(!1), [A, B] = M(ua[0]), {
|
|
2498
2491
|
control: I,
|
|
2499
2492
|
handleSubmit: V,
|
|
2500
2493
|
watch: z,
|
|
@@ -2502,23 +2495,23 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2502
2495
|
} = At({
|
|
2503
2496
|
defaultValues: { pendingInvites: [] },
|
|
2504
2497
|
resolver: It(un)
|
|
2505
|
-
}), { fields: h, append:
|
|
2498
|
+
}), { fields: h, append: x, remove: w, update: c } = Et({
|
|
2506
2499
|
control: I,
|
|
2507
2500
|
name: "pendingInvites"
|
|
2508
2501
|
}), b = z("pendingInvites");
|
|
2509
|
-
|
|
2510
|
-
|
|
2502
|
+
Q(() => {
|
|
2503
|
+
N.length > 1 ? (S(!0), on(y.name, N).then((F) => {
|
|
2511
2504
|
p(F);
|
|
2512
2505
|
}).catch((F) => console.error("Search failed:", F)).finally(() => S(!1))) : (p([]), L(/* @__PURE__ */ new Set()));
|
|
2513
|
-
}, [
|
|
2514
|
-
const
|
|
2506
|
+
}, [N, y]);
|
|
2507
|
+
const k = (F) => {
|
|
2515
2508
|
L((C) => {
|
|
2516
2509
|
const E = new Set(C);
|
|
2517
2510
|
return E.has(F) ? E.delete(F) : E.add(F), E;
|
|
2518
2511
|
});
|
|
2519
2512
|
}, D = () => {
|
|
2520
2513
|
d.filter((F) => T.has(F.id)).forEach((F) => {
|
|
2521
|
-
h.find((C) => C.id === F.id) ||
|
|
2514
|
+
h.find((C) => C.id === F.id) || x({ ...F, permission: A.name });
|
|
2522
2515
|
}), L(/* @__PURE__ */ new Set()), a("");
|
|
2523
2516
|
}, q = (F) => {
|
|
2524
2517
|
B(F), h.forEach(
|
|
@@ -2609,8 +2602,8 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2609
2602
|
}
|
|
2610
2603
|
),
|
|
2611
2604
|
/* @__PURE__ */ l("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
|
|
2612
|
-
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(
|
|
2613
|
-
/* @__PURE__ */ l(
|
|
2605
|
+
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(X, { value: y, onChange: f, children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2606
|
+
/* @__PURE__ */ l(X.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: [
|
|
2614
2607
|
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
2615
2608
|
/* @__PURE__ */ e(y.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2616
2609
|
/* @__PURE__ */ e("span", { className: "truncate", children: y.name })
|
|
@@ -2620,16 +2613,16 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2620
2613
|
/* @__PURE__ */ e(
|
|
2621
2614
|
oe,
|
|
2622
2615
|
{
|
|
2623
|
-
as:
|
|
2616
|
+
as: J,
|
|
2624
2617
|
leave: "transition ease-in duration-100",
|
|
2625
2618
|
leaveFrom: "opacity-100",
|
|
2626
2619
|
leaveTo: "opacity-0",
|
|
2627
|
-
children: /* @__PURE__ */ e(
|
|
2628
|
-
|
|
2620
|
+
children: /* @__PURE__ */ e(X.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: da.map((F) => /* @__PURE__ */ e(
|
|
2621
|
+
X.Option,
|
|
2629
2622
|
{
|
|
2630
2623
|
value: F,
|
|
2631
2624
|
className: ({ active: C }) => `${C ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2632
|
-
children: ({ selected: C }) => /* @__PURE__ */ l(
|
|
2625
|
+
children: ({ selected: C }) => /* @__PURE__ */ l(K, { children: [
|
|
2633
2626
|
/* @__PURE__ */ l(
|
|
2634
2627
|
"span",
|
|
2635
2628
|
{
|
|
@@ -2669,13 +2662,13 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2669
2662
|
exit: { opacity: 0, y: -10 },
|
|
2670
2663
|
transition: { duration: 0.2 },
|
|
2671
2664
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2672
|
-
children: R ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(
|
|
2665
|
+
children: R ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(K, { children: [
|
|
2673
2666
|
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((F) => {
|
|
2674
2667
|
const C = $(F);
|
|
2675
2668
|
return /* @__PURE__ */ l(
|
|
2676
2669
|
"div",
|
|
2677
2670
|
{
|
|
2678
|
-
onClick: () => C ? null :
|
|
2671
|
+
onClick: () => C ? null : k(F.id),
|
|
2679
2672
|
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${C ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2680
2673
|
children: [
|
|
2681
2674
|
/* @__PURE__ */ e(
|
|
@@ -2697,7 +2690,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2697
2690
|
}
|
|
2698
2691
|
),
|
|
2699
2692
|
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: F.name }),
|
|
2700
|
-
C ? /* @__PURE__ */ l(
|
|
2693
|
+
C ? /* @__PURE__ */ l(K, { children: [
|
|
2701
2694
|
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children: C }),
|
|
2702
2695
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
|
|
2703
2696
|
] }) : ""
|
|
@@ -2743,12 +2736,12 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2743
2736
|
")"
|
|
2744
2737
|
] }),
|
|
2745
2738
|
n === se.DRIVE && /* @__PURE__ */ e(
|
|
2746
|
-
|
|
2739
|
+
X,
|
|
2747
2740
|
{
|
|
2748
2741
|
value: A,
|
|
2749
2742
|
onChange: q,
|
|
2750
2743
|
children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2751
|
-
/* @__PURE__ */ l(
|
|
2744
|
+
/* @__PURE__ */ l(X.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: [
|
|
2752
2745
|
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
2753
2746
|
/* @__PURE__ */ e(A.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2754
2747
|
/* @__PURE__ */ l("span", { className: "truncate", children: [
|
|
@@ -2761,16 +2754,16 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2761
2754
|
/* @__PURE__ */ e(
|
|
2762
2755
|
oe,
|
|
2763
2756
|
{
|
|
2764
|
-
as:
|
|
2757
|
+
as: J,
|
|
2765
2758
|
leave: "transition ease-in duration-100",
|
|
2766
2759
|
leaveFrom: "opacity-100",
|
|
2767
2760
|
leaveTo: "opacity-0",
|
|
2768
|
-
children: /* @__PURE__ */ e(
|
|
2769
|
-
|
|
2761
|
+
children: /* @__PURE__ */ e(X.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: ua.map((F) => /* @__PURE__ */ e(
|
|
2762
|
+
X.Option,
|
|
2770
2763
|
{
|
|
2771
2764
|
value: F,
|
|
2772
2765
|
className: ({ active: C }) => `${C ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2773
|
-
children: ({ selected: C, active: E }) => /* @__PURE__ */ l(
|
|
2766
|
+
children: ({ selected: C, active: E }) => /* @__PURE__ */ l(K, { children: [
|
|
2774
2767
|
/* @__PURE__ */ l(
|
|
2775
2768
|
"span",
|
|
2776
2769
|
{
|
|
@@ -2888,15 +2881,15 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2888
2881
|
}), y = vr(u), f = xr(u), { getReferenceProps: v, getFloatingProps: a } = Nr([
|
|
2889
2882
|
y,
|
|
2890
2883
|
f
|
|
2891
|
-
]),
|
|
2884
|
+
]), N = Je.find((p) => p.name === t.permission || p.value === t.permission) || Je[0];
|
|
2892
2885
|
return (
|
|
2893
2886
|
// FIX: The <Listbox> component now wraps both the button and the portal.
|
|
2894
2887
|
// This provides the necessary context for both children.
|
|
2895
|
-
/* @__PURE__ */ l(
|
|
2888
|
+
/* @__PURE__ */ l(X, { value: N, onChange: (p) => {
|
|
2896
2889
|
s(p), n(!1);
|
|
2897
2890
|
}, children: [
|
|
2898
2891
|
/* @__PURE__ */ l(
|
|
2899
|
-
|
|
2892
|
+
X.Button,
|
|
2900
2893
|
{
|
|
2901
2894
|
ref: m.setReference,
|
|
2902
2895
|
...v(),
|
|
@@ -2910,7 +2903,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2910
2903
|
/* @__PURE__ */ e(kr, { children: /* @__PURE__ */ e(
|
|
2911
2904
|
oe,
|
|
2912
2905
|
{
|
|
2913
|
-
as:
|
|
2906
|
+
as: J,
|
|
2914
2907
|
show: o,
|
|
2915
2908
|
enter: "transition ease-out duration-100",
|
|
2916
2909
|
enterFrom: "transform opacity-0 scale-95",
|
|
@@ -2919,7 +2912,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2919
2912
|
leaveFrom: "transform opacity-100 scale-100",
|
|
2920
2913
|
leaveTo: "transform opacity-0 scale-95",
|
|
2921
2914
|
children: /* @__PURE__ */ e(
|
|
2922
|
-
|
|
2915
|
+
X.Options,
|
|
2923
2916
|
{
|
|
2924
2917
|
ref: m.setFloating,
|
|
2925
2918
|
style: i,
|
|
@@ -2927,7 +2920,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2927
2920
|
static: !0,
|
|
2928
2921
|
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",
|
|
2929
2922
|
children: Je.filter((p) => r.includes(p.value)).map((p) => /* @__PURE__ */ e(
|
|
2930
|
-
|
|
2923
|
+
X.Option,
|
|
2931
2924
|
{
|
|
2932
2925
|
className: ({
|
|
2933
2926
|
active: T
|
|
@@ -2936,7 +2929,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2936
2929
|
${p.isDestructive && T ? "bg-red-100 text-red-900" : ""}
|
|
2937
2930
|
${p.isDestructive && !T ? "text-red-600" : ""}`,
|
|
2938
2931
|
value: p,
|
|
2939
|
-
children: ({ selected: T }) => /* @__PURE__ */ l(
|
|
2932
|
+
children: ({ selected: T }) => /* @__PURE__ */ l(K, { children: [
|
|
2940
2933
|
/* @__PURE__ */ l(
|
|
2941
2934
|
"span",
|
|
2942
2935
|
{
|
|
@@ -2967,15 +2960,15 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
2967
2960
|
existingShares: n,
|
|
2968
2961
|
allowedPermissions: m
|
|
2969
2962
|
}) => {
|
|
2970
|
-
const [i, u] = M(n), [y, f] = M(0), [v, a] = M(""),
|
|
2963
|
+
const [i, u] = M(n), [y, f] = M(0), [v, a] = M(""), N = ta(v, 300), d = {
|
|
2971
2964
|
users: i.users.filter(
|
|
2972
|
-
(R) => R.name.toLowerCase().includes(
|
|
2965
|
+
(R) => R.name.toLowerCase().includes(N.toLowerCase())
|
|
2973
2966
|
),
|
|
2974
2967
|
groups: i.groups.filter(
|
|
2975
|
-
(R) => R.name.toLowerCase().includes(
|
|
2968
|
+
(R) => R.name.toLowerCase().includes(N.toLowerCase())
|
|
2976
2969
|
),
|
|
2977
2970
|
roles: i.roles.filter(
|
|
2978
|
-
(R) => R.name.toLowerCase().includes(
|
|
2971
|
+
(R) => R.name.toLowerCase().includes(N.toLowerCase())
|
|
2979
2972
|
)
|
|
2980
2973
|
}, p = async (R, S, A, B) => {
|
|
2981
2974
|
const I = S.value;
|
|
@@ -3044,7 +3037,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
3044
3037
|
animate: { y: 0, opacity: 1 },
|
|
3045
3038
|
exit: { y: -10, opacity: 0 },
|
|
3046
3039
|
transition: { duration: 0.2 },
|
|
3047
|
-
children: /* @__PURE__ */ e(ee.Panels, { as:
|
|
3040
|
+
children: /* @__PURE__ */ e(ee.Panels, { as: J, children: T.map((R) => /* @__PURE__ */ e(
|
|
3048
3041
|
ee.Panel,
|
|
3049
3042
|
{
|
|
3050
3043
|
className: "space-y-3 focus:outline-none",
|
|
@@ -3157,7 +3150,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
3157
3150
|
hidden: { y: 20, opacity: 0 },
|
|
3158
3151
|
visible: { y: 0, opacity: 1 },
|
|
3159
3152
|
exit: { opacity: 0, x: -20 }
|
|
3160
|
-
},
|
|
3153
|
+
}, N = () => n ? (
|
|
3161
3154
|
// Show 5 skeleton items while loading
|
|
3162
3155
|
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d, p) => /* @__PURE__ */ e(gn, {}, p)) })
|
|
3163
3156
|
) : f.length === 0 ? /* @__PURE__ */ l(
|
|
@@ -3241,7 +3234,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
3241
3234
|
placeholder: "Search members..."
|
|
3242
3235
|
}
|
|
3243
3236
|
) }),
|
|
3244
|
-
/* @__PURE__ */ e("div", { className: "flex-grow overflow-y-auto", children:
|
|
3237
|
+
/* @__PURE__ */ e("div", { className: "flex-grow overflow-y-auto", children: N() })
|
|
3245
3238
|
] });
|
|
3246
3239
|
}, de = {
|
|
3247
3240
|
INVITE: "invite",
|
|
@@ -3264,31 +3257,31 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
|
|
|
3264
3257
|
allowedPermissions: u = [],
|
|
3265
3258
|
...y
|
|
3266
3259
|
}) => {
|
|
3267
|
-
const [f, v] = M(de.INVITE), [a,
|
|
3260
|
+
const [f, v] = M(de.INVITE), [a, N] = M(t), [d, p] = M(null), [T, L] = M(!1), [R, S] = M([]), [A, B] = M(de.MANAGE), I = () => {
|
|
3268
3261
|
v(de.INVITE), p(null), m();
|
|
3269
3262
|
}, V = () => {
|
|
3270
3263
|
v(de.MANAGE);
|
|
3271
|
-
}, z = async ({ id: h, name:
|
|
3272
|
-
if (console.log("handleToMembers", { id: h, name:
|
|
3264
|
+
}, z = async ({ id: h, name: x, type: w }) => {
|
|
3265
|
+
if (console.log("handleToMembers", { id: h, name: x, type: w }), w === "groups") {
|
|
3273
3266
|
try {
|
|
3274
|
-
const c = await Fe(`${Ie.getMembersForGroup(
|
|
3267
|
+
const c = await Fe(`${Ie.getMembersForGroup(x)}`);
|
|
3275
3268
|
} catch (c) {
|
|
3276
3269
|
console.log("Error searching entities:", c);
|
|
3277
3270
|
}
|
|
3278
3271
|
S(resp);
|
|
3279
3272
|
}
|
|
3280
|
-
p({ id: h, type: w, name:
|
|
3273
|
+
p({ id: h, type: w, name: x }), B(f), v(de.MEMBERS);
|
|
3281
3274
|
}, P = (h) => {
|
|
3282
|
-
console.log("changedExistingShares", h),
|
|
3283
|
-
const
|
|
3275
|
+
console.log("changedExistingShares", h), N(h);
|
|
3276
|
+
const x = !We.isEqual(
|
|
3284
3277
|
We.mapValues(t, (w) => w.map((c) => ({ id: c.id, permission: c.permission }))),
|
|
3285
3278
|
We.mapValues(h, (w) => w.map((c) => ({ id: c.id, permission: c.permission })))
|
|
3286
3279
|
);
|
|
3287
|
-
L(
|
|
3280
|
+
L(x), v(f === de.MEMBERS ? A : de.INVITE);
|
|
3288
3281
|
};
|
|
3289
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as:
|
|
3282
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: I, children: [
|
|
3290
3283
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
3291
|
-
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(
|
|
3284
|
+
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(ke, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
|
|
3292
3285
|
switch (f) {
|
|
3293
3286
|
case de.MANAGE:
|
|
3294
3287
|
return /* @__PURE__ */ e(
|
|
@@ -3389,27 +3382,27 @@ function qe({
|
|
|
3389
3382
|
onSearch: v,
|
|
3390
3383
|
// (query: string) => void (required if searchMode==="server")
|
|
3391
3384
|
serverLoading: a = !1,
|
|
3392
|
-
minSearchChars:
|
|
3385
|
+
minSearchChars: N = 2,
|
|
3393
3386
|
// NEW: mappers (id/label keys)
|
|
3394
3387
|
getOptionId: d = (T) => String(T.id),
|
|
3395
3388
|
getOptionLabel: p = (T) => T.name
|
|
3396
3389
|
}) {
|
|
3397
3390
|
const T = Qe(), L = Qe(), [R, S] = M(""), A = ue(""), B = ne(() => {
|
|
3398
3391
|
const h = /* @__PURE__ */ new Map();
|
|
3399
|
-
for (const
|
|
3392
|
+
for (const x of r) h.set(d(x), x);
|
|
3400
3393
|
return h;
|
|
3401
3394
|
}, [r, d]), I = ne(() => Array.isArray(s) ? s.map((h) => h && typeof h == "object" ? B.get(d(h)) || null : B.get(String(h))).filter(Boolean) : [], [s, B, d]), V = ne(() => {
|
|
3402
3395
|
if (!R) return r;
|
|
3403
3396
|
const h = R.toLowerCase();
|
|
3404
|
-
return r.filter((
|
|
3397
|
+
return r.filter((x) => p(x).toLowerCase().includes(h));
|
|
3405
3398
|
}, [r, R, p]);
|
|
3406
|
-
|
|
3407
|
-
f === "server" && R.length >=
|
|
3408
|
-
}, [R, f,
|
|
3399
|
+
Q(() => {
|
|
3400
|
+
f === "server" && R.length >= N && R !== A.current && (A.current = R, v && v(R));
|
|
3401
|
+
}, [R, f, N, v]);
|
|
3409
3402
|
const z = f === "client" ? V : r, P = () => {
|
|
3410
3403
|
if (!I.length)
|
|
3411
3404
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
|
|
3412
|
-
const h = I.slice(0, u),
|
|
3405
|
+
const h = I.slice(0, u), x = I.length - u;
|
|
3413
3406
|
return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
|
|
3414
3407
|
h.map((w) => /* @__PURE__ */ e(
|
|
3415
3408
|
"span",
|
|
@@ -3419,19 +3412,19 @@ function qe({
|
|
|
3419
3412
|
},
|
|
3420
3413
|
d(w)
|
|
3421
3414
|
)),
|
|
3422
|
-
|
|
3415
|
+
x > 0 && /* @__PURE__ */ l("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
|
|
3423
3416
|
"+",
|
|
3424
|
-
|
|
3417
|
+
x,
|
|
3425
3418
|
" more"
|
|
3426
3419
|
] })
|
|
3427
3420
|
] });
|
|
3428
3421
|
};
|
|
3429
|
-
return /* @__PURE__ */ e(
|
|
3430
|
-
const
|
|
3431
|
-
y !== -1 &&
|
|
3422
|
+
return /* @__PURE__ */ e(X, { value: I, onChange: (h) => {
|
|
3423
|
+
const x = Array.from(new Set(h.map((w) => d(w))));
|
|
3424
|
+
y !== -1 && x.length > y || o(x);
|
|
3432
3425
|
}, multiple: !0, by: "id", children: ({ open: h }) => /* @__PURE__ */ l("div", { children: [
|
|
3433
3426
|
/* @__PURE__ */ e(
|
|
3434
|
-
|
|
3427
|
+
X.Label,
|
|
3435
3428
|
{
|
|
3436
3429
|
id: T,
|
|
3437
3430
|
className: "block text-sm font-medium leading-6 text-gray-900",
|
|
@@ -3440,7 +3433,7 @@ function qe({
|
|
|
3440
3433
|
),
|
|
3441
3434
|
/* @__PURE__ */ l("div", { className: "relative mt-2", children: [
|
|
3442
3435
|
/* @__PURE__ */ l(
|
|
3443
|
-
|
|
3436
|
+
X.Button,
|
|
3444
3437
|
{
|
|
3445
3438
|
"aria-labelledby": T,
|
|
3446
3439
|
"aria-invalid": !!i,
|
|
@@ -3459,33 +3452,33 @@ function qe({
|
|
|
3459
3452
|
/* @__PURE__ */ e(
|
|
3460
3453
|
oe,
|
|
3461
3454
|
{
|
|
3462
|
-
as:
|
|
3455
|
+
as: J,
|
|
3463
3456
|
show: h,
|
|
3464
3457
|
leave: "transition ease-in duration-100",
|
|
3465
3458
|
leaveFrom: "opacity-100",
|
|
3466
3459
|
leaveTo: "opacity-0",
|
|
3467
|
-
children: /* @__PURE__ */ l(
|
|
3460
|
+
children: /* @__PURE__ */ l(X.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: [
|
|
3468
3461
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3469
3462
|
he,
|
|
3470
3463
|
{
|
|
3471
3464
|
value: R,
|
|
3472
3465
|
onDebouncedChange: S,
|
|
3473
|
-
placeholder: f === "server" ? `Search (min ${
|
|
3466
|
+
placeholder: f === "server" ? `Search (min ${N})…` : "Search options…"
|
|
3474
3467
|
}
|
|
3475
3468
|
) }),
|
|
3476
3469
|
f === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3477
|
-
z.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: f === "server" ? R.length <
|
|
3478
|
-
const w = d(
|
|
3470
|
+
z.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: f === "server" ? R.length < N ? `Type at least ${N} characters to search.` : "No results." : "No options found." }) : z.map((x) => {
|
|
3471
|
+
const w = d(x), c = p(x), b = I.some((D) => d(D) === w), k = y !== -1 && I.length >= y && !b;
|
|
3479
3472
|
return /* @__PURE__ */ e(
|
|
3480
|
-
|
|
3473
|
+
X.Option,
|
|
3481
3474
|
{
|
|
3482
|
-
value:
|
|
3483
|
-
disabled:
|
|
3475
|
+
value: x,
|
|
3476
|
+
disabled: k,
|
|
3484
3477
|
className: ({ active: D }) => Ae(
|
|
3485
|
-
|
|
3478
|
+
k ? " text-gray-400 bg-white cursor-not-allowed" : D ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3486
3479
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3487
3480
|
),
|
|
3488
|
-
children: ({ selected: D, active: q }) => /* @__PURE__ */ l(
|
|
3481
|
+
children: ({ selected: D, active: q }) => /* @__PURE__ */ l(K, { children: [
|
|
3489
3482
|
/* @__PURE__ */ e(
|
|
3490
3483
|
"span",
|
|
3491
3484
|
{
|
|
@@ -3590,7 +3583,7 @@ const ss = ({
|
|
|
3590
3583
|
}
|
|
3591
3584
|
),
|
|
3592
3585
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "flex min-h-full items-center justify-center p-4", children: /* @__PURE__ */ l(
|
|
3593
|
-
|
|
3586
|
+
ke,
|
|
3594
3587
|
{
|
|
3595
3588
|
className: `${u} relative bg-white align-middle w-full lg:w-[36rem] mx-5 lg:mx-0 transform overflow-hidden rounded-2xl text-left shadow-xl lg:min-w-[36rem] md:min-w-96 transition-all`,
|
|
3596
3589
|
onClick: f,
|
|
@@ -3610,7 +3603,7 @@ const ss = ({
|
|
|
3610
3603
|
),
|
|
3611
3604
|
n?.show && !n?.customFooter && /* @__PURE__ */ l("div", { className: "border-t flex justify-end border-gray-200 p-6 flex-shrink-0", children: [
|
|
3612
3605
|
i?.onCancel && /* @__PURE__ */ e(
|
|
3613
|
-
|
|
3606
|
+
Z,
|
|
3614
3607
|
{
|
|
3615
3608
|
"data-testid": "cancel-button",
|
|
3616
3609
|
label: i?.label,
|
|
@@ -3622,7 +3615,7 @@ const ss = ({
|
|
|
3622
3615
|
}
|
|
3623
3616
|
),
|
|
3624
3617
|
m?.onSubmit && /* @__PURE__ */ e(
|
|
3625
|
-
|
|
3618
|
+
Z,
|
|
3626
3619
|
{
|
|
3627
3620
|
label: m?.label,
|
|
3628
3621
|
loader: m?.loader,
|
|
@@ -3672,7 +3665,7 @@ function vn({
|
|
|
3672
3665
|
dropId: v,
|
|
3673
3666
|
indent: a = 24
|
|
3674
3667
|
}) {
|
|
3675
|
-
const { setNodeRef:
|
|
3668
|
+
const { setNodeRef: N, isOver: d } = Pt({ id: v }), { attributes: p, listeners: T, setNodeRef: L, transform: R, isDragging: S } = Lt({ id: f }), A = R ? { transform: `translate3d(${Math.round(R.x)}px, ${Math.round(R.y)}px, 0)` } : void 0, [B, I] = M(!1), [V, z] = M(t.name), P = () => {
|
|
3676
3669
|
const h = V.trim();
|
|
3677
3670
|
I(!1), h && h !== t.name ? i?.(t, h) : z(t.name);
|
|
3678
3671
|
}, g = ne(() => /* @__PURE__ */ e(
|
|
@@ -3683,15 +3676,15 @@ function vn({
|
|
|
3683
3676
|
{ action: "rename", label: "Rename" },
|
|
3684
3677
|
{ action: "delete", label: "Delete" }
|
|
3685
3678
|
],
|
|
3686
|
-
onSelect: (
|
|
3687
|
-
|
|
3679
|
+
onSelect: (x) => {
|
|
3680
|
+
x.action === "create" ? m?.(t) : x.action === "rename" ? I(!0) : x.action === "delete" && u?.(t);
|
|
3688
3681
|
}
|
|
3689
3682
|
}
|
|
3690
3683
|
), [t, m, u]);
|
|
3691
3684
|
return /* @__PURE__ */ l(
|
|
3692
3685
|
"div",
|
|
3693
3686
|
{
|
|
3694
|
-
ref:
|
|
3687
|
+
ref: N,
|
|
3695
3688
|
className: `tv-row ${d ? "tv-drop-over" : ""} ${S ? "dragging" : ""}`,
|
|
3696
3689
|
style: { ...A, paddingLeft: 8 + r * a },
|
|
3697
3690
|
onClick: (h) => {
|
|
@@ -3756,7 +3749,7 @@ function Sn(t, { rootId: r, getId: s, getName: o }) {
|
|
|
3756
3749
|
}
|
|
3757
3750
|
return { roots: t.map((u) => m(u, null)), byId: n };
|
|
3758
3751
|
}
|
|
3759
|
-
const
|
|
3752
|
+
const De = (t) => t.map((r) => ({ ...r, children: De(r.children || []) }));
|
|
3760
3753
|
function Dn(t, r) {
|
|
3761
3754
|
let s = null;
|
|
3762
3755
|
function o(m) {
|
|
@@ -3809,67 +3802,67 @@ function ls({
|
|
|
3809
3802
|
onRename: f,
|
|
3810
3803
|
onDelete: v,
|
|
3811
3804
|
onMove: a,
|
|
3812
|
-
renderActions:
|
|
3805
|
+
renderActions: N,
|
|
3813
3806
|
disableMoveToRoot: d = !1,
|
|
3814
3807
|
// ← allow root moves by default now
|
|
3815
3808
|
indentUnit: p = 24
|
|
3816
3809
|
}) {
|
|
3817
3810
|
const { roots: T } = ne(() => wn(t) ? Sn(t, { rootId: r, getId: o, getName: m }) : Cn(
|
|
3818
|
-
t.map((
|
|
3811
|
+
t.map((k) => ({ ...k })),
|
|
3819
3812
|
{ rootId: r, getId: o, getParent: n, getName: m }
|
|
3820
|
-
), [t, r, o, n, m]), [L, R] = M({}), S = ae((
|
|
3813
|
+
), [t, r, o, n, m]), [L, R] = M({}), S = ae((k) => {
|
|
3821
3814
|
const D = {};
|
|
3822
3815
|
return (function q(G) {
|
|
3823
3816
|
G.forEach(($) => {
|
|
3824
3817
|
D[$.id] = !0, $.children?.length && q($.children);
|
|
3825
3818
|
});
|
|
3826
|
-
})(
|
|
3819
|
+
})(k), D;
|
|
3827
3820
|
}, []);
|
|
3828
3821
|
re.useEffect(() => {
|
|
3829
3822
|
R(S(T));
|
|
3830
3823
|
}, [T, S]);
|
|
3831
3824
|
const A = ae(
|
|
3832
|
-
(
|
|
3825
|
+
(k) => R((D) => ({ ...D, [k]: !D[k] })),
|
|
3833
3826
|
[]
|
|
3834
|
-
), [B, I] = M(() =>
|
|
3835
|
-
re.useEffect(() => I(
|
|
3827
|
+
), [B, I] = M(() => De(T));
|
|
3828
|
+
re.useEffect(() => I(De(T)), [T]);
|
|
3836
3829
|
const V = Ot(
|
|
3837
3830
|
Mt(jt, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
3838
|
-
), z = ue(null), [P, g] = M(null), h = ue(0),
|
|
3839
|
-
}, w = ({ delta:
|
|
3840
|
-
h.current =
|
|
3831
|
+
), z = ue(null), [P, g] = M(null), h = ue(0), x = () => {
|
|
3832
|
+
}, w = ({ delta: k }) => {
|
|
3833
|
+
h.current = k?.x ?? 0;
|
|
3841
3834
|
}, c = ae(
|
|
3842
|
-
({ active:
|
|
3835
|
+
({ active: k, over: D }) => {
|
|
3843
3836
|
const q = h.current;
|
|
3844
|
-
if (h.current = 0, g(null), !
|
|
3845
|
-
const G = String(
|
|
3837
|
+
if (h.current = 0, g(null), !k || !D) return;
|
|
3838
|
+
const G = String(k.id).replace(/^drag-/, ""), $ = String(D.id).replace(/^drop-/, "");
|
|
3846
3839
|
if (!G || !$ || G === $) return;
|
|
3847
3840
|
let O = $;
|
|
3848
3841
|
const U = Math.max(0, Math.floor(-q / p));
|
|
3849
3842
|
if (U > 0) {
|
|
3850
|
-
let
|
|
3843
|
+
let H = $;
|
|
3851
3844
|
for (let ie = 0; ie < U; ie++) {
|
|
3852
|
-
const ce = Ja(B,
|
|
3845
|
+
const ce = Ja(B, H, null);
|
|
3853
3846
|
if (!ce) break;
|
|
3854
3847
|
if (!ce.parentId) {
|
|
3855
3848
|
O = r;
|
|
3856
3849
|
break;
|
|
3857
3850
|
}
|
|
3858
|
-
O = ce.parentId,
|
|
3851
|
+
O = ce.parentId, H = ce.parentId;
|
|
3859
3852
|
}
|
|
3860
3853
|
}
|
|
3861
3854
|
if (d && O === r) {
|
|
3862
|
-
I(
|
|
3855
|
+
I(De(T));
|
|
3863
3856
|
return;
|
|
3864
3857
|
}
|
|
3865
|
-
const F =
|
|
3858
|
+
const F = De(B), { newRoots: C, removed: E } = Dn(F, G);
|
|
3866
3859
|
if (!E) return;
|
|
3867
3860
|
const j = Fn(C, O, E);
|
|
3868
3861
|
I(j), a?.({ sourceId: G, destParentId: O, newTree: j });
|
|
3869
3862
|
},
|
|
3870
3863
|
[B, T, r, d, p, a]
|
|
3871
3864
|
), b = ae(
|
|
3872
|
-
(
|
|
3865
|
+
(k, D = 0) => k.map((q) => /* @__PURE__ */ l(re.Fragment, { children: [
|
|
3873
3866
|
/* @__PURE__ */ e(
|
|
3874
3867
|
vn,
|
|
3875
3868
|
{
|
|
@@ -3881,7 +3874,7 @@ function ls({
|
|
|
3881
3874
|
onCreateChild: y,
|
|
3882
3875
|
onRename: f,
|
|
3883
3876
|
onDelete: v,
|
|
3884
|
-
renderActions:
|
|
3877
|
+
renderActions: N,
|
|
3885
3878
|
dragId: `drag-${q.id}`,
|
|
3886
3879
|
dropId: `drop-${q.id}`,
|
|
3887
3880
|
indent: p
|
|
@@ -3889,14 +3882,14 @@ function ls({
|
|
|
3889
3882
|
),
|
|
3890
3883
|
L[q.id] && q.children?.length > 0 ? b(q.children, D + 1) : null
|
|
3891
3884
|
] }, q.id)),
|
|
3892
|
-
[L, p, y, v, f, i,
|
|
3885
|
+
[L, p, y, v, f, i, N, A]
|
|
3893
3886
|
);
|
|
3894
3887
|
return re.useMemo(() => {
|
|
3895
3888
|
if (!P) return null;
|
|
3896
|
-
const
|
|
3889
|
+
const k = String(P).replace(/^drag-/, "");
|
|
3897
3890
|
function D(q) {
|
|
3898
3891
|
for (const G of q) {
|
|
3899
|
-
if (G.id ===
|
|
3892
|
+
if (G.id === k) return G;
|
|
3900
3893
|
const $ = G.children?.length ? D(G.children) : null;
|
|
3901
3894
|
if ($) return $;
|
|
3902
3895
|
}
|
|
@@ -3918,7 +3911,7 @@ function ls({
|
|
|
3918
3911
|
{
|
|
3919
3912
|
collisionDetection: qt,
|
|
3920
3913
|
sensors: V,
|
|
3921
|
-
onDragStart:
|
|
3914
|
+
onDragStart: x,
|
|
3922
3915
|
onDragMove: w,
|
|
3923
3916
|
onDragEnd: c,
|
|
3924
3917
|
modifiers: [Ut],
|
|
@@ -3941,19 +3934,19 @@ const os = ({
|
|
|
3941
3934
|
...u
|
|
3942
3935
|
// Pass remaining props to Tab.Group
|
|
3943
3936
|
}) => {
|
|
3944
|
-
const y = s === "vertical", f = (
|
|
3937
|
+
const y = s === "vertical", f = (N) => ye(
|
|
3945
3938
|
"text-left text-sm rounded-md px-2 py-1.5 focus:outline-none",
|
|
3946
|
-
|
|
3947
|
-
), v = (
|
|
3939
|
+
N ? "bg-indigo-50 text-indigo-700" : "text-slate-600 hover:bg-slate-50 hover:text-indigo-700"
|
|
3940
|
+
), v = (N) => ye(
|
|
3948
3941
|
"py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
|
|
3949
|
-
|
|
3950
|
-
), a = ({ selected:
|
|
3942
|
+
N ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
|
|
3943
|
+
), a = ({ selected: N }) => i ? typeof i == "function" ? i(N) : i : y ? f(N) : v(N);
|
|
3951
3944
|
return /* @__PURE__ */ e(ee.Group, { vertical: y, ...u, children: y ? /* @__PURE__ */ l("div", { className: ye("flex gap-4", o), children: [
|
|
3952
|
-
/* @__PURE__ */ e(ee.List, { className: ye("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((
|
|
3953
|
-
/* @__PURE__ */ e(ee.Panels, { unmount: !r, className: ye("flex-1", m), children: t.map((
|
|
3954
|
-
] }) : /* @__PURE__ */ l(
|
|
3955
|
-
/* @__PURE__ */ e(ee.List, { className: ye("flex gap-6 border-b border-gray-300 mb-3", n), children: t.map((
|
|
3956
|
-
/* @__PURE__ */ e(ee.Panels, { unmount: !r, className: ye("mt-2", m), children: t.map((
|
|
3945
|
+
/* @__PURE__ */ e(ee.List, { className: ye("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((N) => /* @__PURE__ */ e(ee, { className: a, children: N.label }, N.key)) }),
|
|
3946
|
+
/* @__PURE__ */ e(ee.Panels, { unmount: !r, className: ye("flex-1", m), children: t.map((N) => /* @__PURE__ */ e(ee.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: N.content }) }, N.key)) })
|
|
3947
|
+
] }) : /* @__PURE__ */ l(K, { children: [
|
|
3948
|
+
/* @__PURE__ */ e(ee.List, { className: ye("flex gap-6 border-b border-gray-300 mb-3", n), children: t.map((N) => /* @__PURE__ */ e(ee, { className: a, children: N.label }, N.key)) }),
|
|
3949
|
+
/* @__PURE__ */ e(ee.Panels, { unmount: !r, className: ye("mt-2", m), children: t.map((N) => /* @__PURE__ */ e(ee.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: N.content }) }, N.key)) })
|
|
3957
3950
|
] }) });
|
|
3958
3951
|
};
|
|
3959
3952
|
function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
@@ -3962,7 +3955,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
3962
3955
|
const a = r && r[t.key] || {};
|
|
3963
3956
|
return console.log("Initial Section data for", t.key, a), a;
|
|
3964
3957
|
}), y = ue(r);
|
|
3965
|
-
|
|
3958
|
+
Q(() => {
|
|
3966
3959
|
if (y.current !== r) {
|
|
3967
3960
|
y.current = r;
|
|
3968
3961
|
const a = r && r[t.key] || {};
|
|
@@ -3970,12 +3963,12 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
3970
3963
|
}
|
|
3971
3964
|
}, [r, t.key]), console.log("Section data", i);
|
|
3972
3965
|
const f = ue(i);
|
|
3973
|
-
|
|
3966
|
+
Q(() => {
|
|
3974
3967
|
f.current !== i && s && typeof s == "function" && (f.current = i, s(n.key, i));
|
|
3975
3968
|
}, [n.key, i, s]);
|
|
3976
3969
|
const v = (a) => {
|
|
3977
3970
|
if (!a.dependsOn) return !0;
|
|
3978
|
-
const { field:
|
|
3971
|
+
const { field: N, value: d, operator: p = "equals" } = a.dependsOn, T = i[N];
|
|
3979
3972
|
switch (p) {
|
|
3980
3973
|
case "equals":
|
|
3981
3974
|
return T === d;
|
|
@@ -4010,7 +4003,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4010
4003
|
}
|
|
4011
4004
|
),
|
|
4012
4005
|
/* @__PURE__ */ e("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: n.description }),
|
|
4013
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: n.fields.map((a,
|
|
4006
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: n.fields.map((a, N) => v(a) && /* @__PURE__ */ l("div", { style: { marginBottom: "10px" }, children: [
|
|
4014
4007
|
/* @__PURE__ */ l(
|
|
4015
4008
|
"label",
|
|
4016
4009
|
{
|
|
@@ -4431,7 +4424,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4431
4424
|
children: a.info
|
|
4432
4425
|
}
|
|
4433
4426
|
)
|
|
4434
|
-
] },
|
|
4427
|
+
] }, N)) })
|
|
4435
4428
|
] }) });
|
|
4436
4429
|
}
|
|
4437
4430
|
const Tn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
@@ -4442,30 +4435,30 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4442
4435
|
const [v, a] = M(() => {
|
|
4443
4436
|
const g = r && r[n.key] || [], h = g.length > 0 ? g : [{ id: 0 }];
|
|
4444
4437
|
return console.log(`[DataTableRenderer] ${n.key} - Initial data:`, h), h;
|
|
4445
|
-
}),
|
|
4446
|
-
|
|
4447
|
-
if (console.log(`[DataTableRenderer] ${n.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${n.key} - Previous:`,
|
|
4448
|
-
|
|
4438
|
+
}), N = ue(r);
|
|
4439
|
+
Q(() => {
|
|
4440
|
+
if (console.log(`[DataTableRenderer] ${n.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${n.key} - Previous:`, N.current), console.log(`[DataTableRenderer] ${n.key} - Current:`, r), N.current !== r) {
|
|
4441
|
+
N.current = r;
|
|
4449
4442
|
const g = r && r[n.key] || [], h = g.length > 0 ? g : [{ id: 0 }];
|
|
4450
4443
|
console.log(`[DataTableRenderer] ${n.key} - Setting new data:`, h), a(h);
|
|
4451
4444
|
}
|
|
4452
4445
|
}, [r, n.key]);
|
|
4453
4446
|
const d = ue(v), p = ue(null);
|
|
4454
|
-
|
|
4447
|
+
Q(() => {
|
|
4455
4448
|
d.current !== v && s && typeof s == "function" && (d.current = v, p.current && clearTimeout(p.current), p.current = setTimeout(() => {
|
|
4456
4449
|
s(n.key, v);
|
|
4457
4450
|
}, 300));
|
|
4458
|
-
}, [n.key, v, s]),
|
|
4451
|
+
}, [n.key, v, s]), Q(() => () => {
|
|
4459
4452
|
p.current && clearTimeout(p.current);
|
|
4460
4453
|
}, []);
|
|
4461
4454
|
const T = (g) => {
|
|
4462
4455
|
const h = (c, b) => {
|
|
4463
|
-
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: c, value: b, type: typeof b }), a((
|
|
4464
|
-
const D = [...
|
|
4456
|
+
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: c, value: b, type: typeof b }), a((k) => {
|
|
4457
|
+
const D = [...k];
|
|
4465
4458
|
return D[c][g.key] = b, D;
|
|
4466
4459
|
});
|
|
4467
|
-
},
|
|
4468
|
-
const b =
|
|
4460
|
+
}, x = (c) => o[n.key]?.[c]?.[g.key], w = (c) => {
|
|
4461
|
+
const b = x(c);
|
|
4469
4462
|
return b ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: b }) : null;
|
|
4470
4463
|
};
|
|
4471
4464
|
switch (g.fieldtype) {
|
|
@@ -4475,10 +4468,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4475
4468
|
Y,
|
|
4476
4469
|
{
|
|
4477
4470
|
value: c[g.key] || "",
|
|
4478
|
-
onChange: (
|
|
4471
|
+
onChange: (k) => h(b, k.target.value),
|
|
4479
4472
|
placeholder: g.placeholder || `Enter ${g.label}`,
|
|
4480
4473
|
required: g.required,
|
|
4481
|
-
className: `w-full ${
|
|
4474
|
+
className: `w-full ${x(b) ? "border-red-500" : ""}`
|
|
4482
4475
|
}
|
|
4483
4476
|
),
|
|
4484
4477
|
w(b)
|
|
@@ -4489,10 +4482,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4489
4482
|
Oa,
|
|
4490
4483
|
{
|
|
4491
4484
|
value: c[g.key] || "",
|
|
4492
|
-
onChange: (
|
|
4485
|
+
onChange: (k) => h(b, k.target.value),
|
|
4493
4486
|
placeholder: g.placeholder || `Enter ${g.label}`,
|
|
4494
4487
|
required: g.required,
|
|
4495
|
-
className: `w-full ${
|
|
4488
|
+
className: `w-full ${x(b) ? "border-red-500" : ""}`,
|
|
4496
4489
|
rows: 3
|
|
4497
4490
|
}
|
|
4498
4491
|
),
|
|
@@ -4505,10 +4498,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4505
4498
|
{
|
|
4506
4499
|
type: "number",
|
|
4507
4500
|
value: c[g.key] || "",
|
|
4508
|
-
onChange: (
|
|
4501
|
+
onChange: (k) => h(b, k.target.value),
|
|
4509
4502
|
placeholder: g.placeholder || `Enter ${g.label}`,
|
|
4510
4503
|
required: g.required,
|
|
4511
|
-
className: `w-full ${
|
|
4504
|
+
className: `w-full ${x(b) ? "border-red-500" : ""}`
|
|
4512
4505
|
}
|
|
4513
4506
|
),
|
|
4514
4507
|
w(b)
|
|
@@ -4520,10 +4513,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4520
4513
|
{
|
|
4521
4514
|
type: "email",
|
|
4522
4515
|
value: c[g.key] || "",
|
|
4523
|
-
onChange: (
|
|
4516
|
+
onChange: (k) => h(b, k.target.value),
|
|
4524
4517
|
placeholder: g.placeholder || "Enter email address",
|
|
4525
4518
|
required: g.required,
|
|
4526
|
-
className: `w-full ${
|
|
4519
|
+
className: `w-full ${x(b) ? "border-red-500" : ""}`
|
|
4527
4520
|
}
|
|
4528
4521
|
),
|
|
4529
4522
|
w(b)
|
|
@@ -4535,10 +4528,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4535
4528
|
{
|
|
4536
4529
|
type: "url",
|
|
4537
4530
|
value: c[g.key] || "",
|
|
4538
|
-
onChange: (
|
|
4531
|
+
onChange: (k) => h(b, k.target.value),
|
|
4539
4532
|
placeholder: g.placeholder || "Enter URL",
|
|
4540
4533
|
required: g.required,
|
|
4541
|
-
className: `w-full ${
|
|
4534
|
+
className: `w-full ${x(b) ? "border-red-500" : ""}`
|
|
4542
4535
|
}
|
|
4543
4536
|
),
|
|
4544
4537
|
w(b)
|
|
@@ -4550,10 +4543,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4550
4543
|
{
|
|
4551
4544
|
type: "password",
|
|
4552
4545
|
value: c[g.key] || "",
|
|
4553
|
-
onChange: (
|
|
4546
|
+
onChange: (k) => h(b, k.target.value),
|
|
4554
4547
|
placeholder: g.placeholder || "Enter password",
|
|
4555
4548
|
required: g.required,
|
|
4556
|
-
className: `w-full ${
|
|
4549
|
+
className: `w-full ${x(b) ? "border-red-500" : ""}`
|
|
4557
4550
|
}
|
|
4558
4551
|
),
|
|
4559
4552
|
w(b)
|
|
@@ -4565,18 +4558,18 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4565
4558
|
He,
|
|
4566
4559
|
{
|
|
4567
4560
|
value: c[g.key] || "",
|
|
4568
|
-
onChange: (
|
|
4561
|
+
onChange: (k) => h(b, k),
|
|
4569
4562
|
options: g.options || [],
|
|
4570
4563
|
placeholder: g.placeholder || `Select ${g.label}`,
|
|
4571
4564
|
required: g.required,
|
|
4572
|
-
className: `w-full ${
|
|
4565
|
+
className: `w-full ${x(b) ? "border-red-500" : ""}`
|
|
4573
4566
|
}
|
|
4574
4567
|
),
|
|
4575
4568
|
w(b)
|
|
4576
4569
|
] });
|
|
4577
4570
|
case "selectDynamic":
|
|
4578
4571
|
return (c, b) => {
|
|
4579
|
-
const
|
|
4572
|
+
const k = () => {
|
|
4580
4573
|
if (g.optionsFrom && r) {
|
|
4581
4574
|
const { config: D, valueField: q, labelField: G } = g.optionsFrom, $ = r[D] || [];
|
|
4582
4575
|
if (Array.isArray($))
|
|
@@ -4595,10 +4588,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4595
4588
|
index: b,
|
|
4596
4589
|
value: c[g.key] || "",
|
|
4597
4590
|
onChange: (D) => h(b, D),
|
|
4598
|
-
options:
|
|
4591
|
+
options: k(),
|
|
4599
4592
|
placeholder: g.placeholder || `Select ${g.label}`,
|
|
4600
4593
|
required: g.required,
|
|
4601
|
-
className: `w-full ${
|
|
4594
|
+
className: `w-full ${x(b) ? "border-red-500" : ""}`
|
|
4602
4595
|
},
|
|
4603
4596
|
Math.random()
|
|
4604
4597
|
),
|
|
@@ -4607,11 +4600,11 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4607
4600
|
};
|
|
4608
4601
|
case "multiselect":
|
|
4609
4602
|
return (c, b) => {
|
|
4610
|
-
const
|
|
4603
|
+
const k = c[g.key] || [];
|
|
4611
4604
|
return /* @__PURE__ */ e(
|
|
4612
4605
|
qe,
|
|
4613
4606
|
{
|
|
4614
|
-
selectedItems:
|
|
4607
|
+
selectedItems: k,
|
|
4615
4608
|
onSelectionChange: (D) => h(b, D),
|
|
4616
4609
|
options: g.options || [],
|
|
4617
4610
|
placeholder: g.placeholder || `Select ${g.label}`,
|
|
@@ -4625,7 +4618,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4625
4618
|
Aa,
|
|
4626
4619
|
{
|
|
4627
4620
|
checked: !!c[g.key],
|
|
4628
|
-
onChange: (
|
|
4621
|
+
onChange: (k) => h(b, k),
|
|
4629
4622
|
label: g.placeholder || g.label,
|
|
4630
4623
|
className: "w-full"
|
|
4631
4624
|
}
|
|
@@ -4636,7 +4629,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4636
4629
|
Ma,
|
|
4637
4630
|
{
|
|
4638
4631
|
isOn: !!c[g.key],
|
|
4639
|
-
onToggle: (
|
|
4632
|
+
onToggle: (k) => h(b, k),
|
|
4640
4633
|
label: g.placeholder || g.label,
|
|
4641
4634
|
className: "w-full"
|
|
4642
4635
|
}
|
|
@@ -4646,7 +4639,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4646
4639
|
za,
|
|
4647
4640
|
{
|
|
4648
4641
|
selectedDate: c[g.key] ? new Date(c[g.key]) : null,
|
|
4649
|
-
onDateChange: (
|
|
4642
|
+
onDateChange: (k) => h(b, k ? k.toISOString().split("T")[0] : ""),
|
|
4650
4643
|
placeholder: g.placeholder || "Select date",
|
|
4651
4644
|
className: "w-full"
|
|
4652
4645
|
}
|
|
@@ -4657,7 +4650,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4657
4650
|
{
|
|
4658
4651
|
type: "datetime-local",
|
|
4659
4652
|
value: c[g.key] || "",
|
|
4660
|
-
onChange: (
|
|
4653
|
+
onChange: (k) => h(b, k.target.value),
|
|
4661
4654
|
placeholder: g.placeholder || "Select date and time",
|
|
4662
4655
|
required: g.required,
|
|
4663
4656
|
className: "w-full"
|
|
@@ -4669,7 +4662,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4669
4662
|
{
|
|
4670
4663
|
type: "time",
|
|
4671
4664
|
value: c[g.key] || "",
|
|
4672
|
-
onChange: (
|
|
4665
|
+
onChange: (k) => h(b, k.target.value),
|
|
4673
4666
|
placeholder: g.placeholder || "Select time",
|
|
4674
4667
|
required: g.required,
|
|
4675
4668
|
className: "w-full"
|
|
@@ -4680,7 +4673,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4680
4673
|
Ba,
|
|
4681
4674
|
{
|
|
4682
4675
|
selectedValue: c[g.key] || "",
|
|
4683
|
-
onValueChange: (
|
|
4676
|
+
onValueChange: (k) => h(b, k),
|
|
4684
4677
|
options: g.options || [],
|
|
4685
4678
|
className: "w-full"
|
|
4686
4679
|
}
|
|
@@ -4690,17 +4683,17 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4690
4683
|
he,
|
|
4691
4684
|
{
|
|
4692
4685
|
value: c[g.key] || "",
|
|
4693
|
-
onChange: (
|
|
4686
|
+
onChange: (k) => h(b, k),
|
|
4694
4687
|
placeholder: g.placeholder || `Search ${g.label}`,
|
|
4695
4688
|
className: "w-full"
|
|
4696
4689
|
}
|
|
4697
4690
|
);
|
|
4698
4691
|
case "audience":
|
|
4699
4692
|
return (c, b) => {
|
|
4700
|
-
const
|
|
4701
|
-
...
|
|
4702
|
-
...
|
|
4703
|
-
...
|
|
4693
|
+
const k = c[g.key] || { users: [], groups: [], roles: [] }, D = [
|
|
4694
|
+
...k.users || [],
|
|
4695
|
+
...k.groups || [],
|
|
4696
|
+
...k.roles || []
|
|
4704
4697
|
];
|
|
4705
4698
|
return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
4706
4699
|
/* @__PURE__ */ e(Tn, { children: D.length > 0 ? D.slice(0, 3).map((q, G) => /* @__PURE__ */ e(
|
|
@@ -4730,7 +4723,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4730
4723
|
{
|
|
4731
4724
|
type: "color",
|
|
4732
4725
|
value: c[g.key] || "#000000",
|
|
4733
|
-
onChange: (
|
|
4726
|
+
onChange: (k) => h(b, k.target.value),
|
|
4734
4727
|
className: "w-full h-10"
|
|
4735
4728
|
}
|
|
4736
4729
|
);
|
|
@@ -4741,7 +4734,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4741
4734
|
{
|
|
4742
4735
|
type: "range",
|
|
4743
4736
|
value: c[g.key] || g.min || 0,
|
|
4744
|
-
onChange: (
|
|
4737
|
+
onChange: (k) => h(b, k.target.value),
|
|
4745
4738
|
min: g.min || 0,
|
|
4746
4739
|
max: g.max || 100,
|
|
4747
4740
|
step: g.step || 1,
|
|
@@ -4755,8 +4748,8 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4755
4748
|
Y,
|
|
4756
4749
|
{
|
|
4757
4750
|
type: "file",
|
|
4758
|
-
onChange: (
|
|
4759
|
-
const D =
|
|
4751
|
+
onChange: (k) => {
|
|
4752
|
+
const D = k.target.files[0];
|
|
4760
4753
|
h(b, D ? D.name : "");
|
|
4761
4754
|
},
|
|
4762
4755
|
accept: g.accept,
|
|
@@ -4769,7 +4762,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4769
4762
|
{
|
|
4770
4763
|
type: "hidden",
|
|
4771
4764
|
value: c[g.key] || "",
|
|
4772
|
-
onChange: (
|
|
4765
|
+
onChange: (k) => h(b, k.target.value)
|
|
4773
4766
|
}
|
|
4774
4767
|
);
|
|
4775
4768
|
// Default fallback for unknown field types
|
|
@@ -4779,10 +4772,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4779
4772
|
Y,
|
|
4780
4773
|
{
|
|
4781
4774
|
value: c[g.key] || "",
|
|
4782
|
-
onChange: (
|
|
4775
|
+
onChange: (k) => h(b, k.target.value),
|
|
4783
4776
|
placeholder: g.placeholder || `Enter ${g.label}`,
|
|
4784
4777
|
required: g.required,
|
|
4785
|
-
className: `w-full ${
|
|
4778
|
+
className: `w-full ${x(b) ? "border-red-500" : ""}`
|
|
4786
4779
|
}
|
|
4787
4780
|
),
|
|
4788
4781
|
w(b)
|
|
@@ -4798,39 +4791,39 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4798
4791
|
n.fields.forEach((w) => {
|
|
4799
4792
|
w.fieldtype === "audience" ? h[w.key] = { users: [], groups: [], roles: [] } : h[w.key] = w.default || "";
|
|
4800
4793
|
}), console.log("[DataTableRenderer] New blank row:", h);
|
|
4801
|
-
const
|
|
4802
|
-
return console.log("[DataTableRenderer] Updated data:",
|
|
4794
|
+
const x = [...g, h];
|
|
4795
|
+
return console.log("[DataTableRenderer] Updated data:", x), x;
|
|
4803
4796
|
});
|
|
4804
4797
|
}, [n.fields]), R = ae((g) => {
|
|
4805
4798
|
a((h) => {
|
|
4806
4799
|
if (h.length <= 1)
|
|
4807
4800
|
return h;
|
|
4808
|
-
const
|
|
4809
|
-
return
|
|
4801
|
+
const x = [...h];
|
|
4802
|
+
return x.splice(g, 1), x;
|
|
4810
4803
|
});
|
|
4811
4804
|
}, []), [S, A] = M(null), B = ae((g, h) => {
|
|
4812
4805
|
A(h), g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/html", "");
|
|
4813
4806
|
}, []), I = ae((g) => {
|
|
4814
4807
|
g.preventDefault(), g.dataTransfer.dropEffect = "move";
|
|
4815
4808
|
}, []), V = ae((g, h) => {
|
|
4816
|
-
g.preventDefault(), !(S === null || S === h) && (a((
|
|
4817
|
-
const w = [...
|
|
4809
|
+
g.preventDefault(), !(S === null || S === h) && (a((x) => {
|
|
4810
|
+
const w = [...x], c = w[S];
|
|
4818
4811
|
return w.splice(S, 1), w.splice(h, 0, c), w;
|
|
4819
4812
|
}), A(null));
|
|
4820
4813
|
}, [S]), z = ae(() => {
|
|
4821
4814
|
A(null);
|
|
4822
4815
|
}, []), P = ae((g) => {
|
|
4823
4816
|
console.log("[DataTableRenderer] handleAddAudience called with:", g), a((h) => {
|
|
4824
|
-
const
|
|
4825
|
-
if (i !== null && y &&
|
|
4826
|
-
const w = g.pendingInvites || [], c = w.filter((D) => D.type === "User"), b = w.filter((D) => D.type === "Group"),
|
|
4827
|
-
|
|
4828
|
-
users: [...
|
|
4829
|
-
groups: [...
|
|
4830
|
-
roles: [...
|
|
4831
|
-
}, console.log("[DataTableRenderer] Updated audience data:",
|
|
4817
|
+
const x = [...h];
|
|
4818
|
+
if (i !== null && y && x[i]) {
|
|
4819
|
+
const w = g.pendingInvites || [], c = w.filter((D) => D.type === "User"), b = w.filter((D) => D.type === "Group"), k = w.filter((D) => D.type === "Role");
|
|
4820
|
+
x[i][y] = {
|
|
4821
|
+
users: [...x[i][y]?.users || [], ...c],
|
|
4822
|
+
groups: [...x[i][y]?.groups || [], ...b],
|
|
4823
|
+
roles: [...x[i][y]?.roles || [], ...k]
|
|
4824
|
+
}, console.log("[DataTableRenderer] Updated audience data:", x[i][y]);
|
|
4832
4825
|
}
|
|
4833
|
-
return
|
|
4826
|
+
return x;
|
|
4834
4827
|
}), u(null), f(null);
|
|
4835
4828
|
}, [i, y]);
|
|
4836
4829
|
return /* @__PURE__ */ l("div", { children: [
|
|
@@ -4866,13 +4859,13 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4866
4859
|
{
|
|
4867
4860
|
className: `hover:bg-gray-50 ${S === h ? "opacity-50" : ""}`,
|
|
4868
4861
|
draggable: !0,
|
|
4869
|
-
onDragStart: (
|
|
4862
|
+
onDragStart: (x) => B(x, h),
|
|
4870
4863
|
onDragOver: I,
|
|
4871
|
-
onDrop: (
|
|
4864
|
+
onDrop: (x) => V(x, h),
|
|
4872
4865
|
onDragEnd: z,
|
|
4873
4866
|
children: [
|
|
4874
4867
|
/* @__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(ea, { size: 16 }) }) }),
|
|
4875
|
-
n.fields.map((
|
|
4868
|
+
n.fields.map((x, w) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: T(x)(g, h) }, w)),
|
|
4876
4869
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
4877
4870
|
"button",
|
|
4878
4871
|
{
|
|
@@ -4908,7 +4901,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4908
4901
|
})()
|
|
4909
4902
|
] });
|
|
4910
4903
|
}
|
|
4911
|
-
const
|
|
4904
|
+
const Se = {
|
|
4912
4905
|
containerId: "ui-toast",
|
|
4913
4906
|
position: "bottom-right",
|
|
4914
4907
|
autoClose: 3500,
|
|
@@ -4921,13 +4914,13 @@ const ma = () => {
|
|
|
4921
4914
|
typeof document > "u" || (ze += 1, document.body.classList.add("toast-backdrop"));
|
|
4922
4915
|
}, ha = () => {
|
|
4923
4916
|
typeof document > "u" || (ze = Math.max(0, ze - 1), ze === 0 && document.body.classList.remove("toast-backdrop"));
|
|
4924
|
-
},
|
|
4925
|
-
success: (t, r) => le.success(t, { ...
|
|
4926
|
-
info: (t, r) => le.info(t, { ...
|
|
4927
|
-
warn: (t, r) => le.warn(t, { ...
|
|
4917
|
+
}, ve = {
|
|
4918
|
+
success: (t, r) => le.success(t, { ...Se, ...r }),
|
|
4919
|
+
info: (t, r) => le.info(t, { ...Se, ...r }),
|
|
4920
|
+
warn: (t, r) => le.warn(t, { ...Se, ...r }),
|
|
4928
4921
|
// Error: no autoClose + modal-like behavior via backdrop
|
|
4929
4922
|
error: (t, r) => le.error(t, {
|
|
4930
|
-
...
|
|
4923
|
+
...Se,
|
|
4931
4924
|
autoClose: !1,
|
|
4932
4925
|
closeOnClick: !1,
|
|
4933
4926
|
draggable: !1,
|
|
@@ -4950,7 +4943,7 @@ const ma = () => {
|
|
|
4950
4943
|
onClose: ha
|
|
4951
4944
|
}
|
|
4952
4945
|
},
|
|
4953
|
-
{ ...
|
|
4946
|
+
{ ...Se, ...s }
|
|
4954
4947
|
)
|
|
4955
4948
|
}, Ee = (t) => {
|
|
4956
4949
|
try {
|
|
@@ -4975,7 +4968,7 @@ const ma = () => {
|
|
|
4975
4968
|
initialData: y = null
|
|
4976
4969
|
// Add prop for initial demo data
|
|
4977
4970
|
}) => {
|
|
4978
|
-
const [f, v] = M(null), [a,
|
|
4971
|
+
const [f, v] = M(null), [a, N] = M(""), [d, p] = M(() => Array.isArray(y) ? y : []), [T, L] = M(null), [R, S] = M(null), [A, B] = M(""), I = async () => {
|
|
4979
4972
|
try {
|
|
4980
4973
|
const $ = await Fe(t.collectionList);
|
|
4981
4974
|
if ($) {
|
|
@@ -4989,13 +4982,13 @@ const ma = () => {
|
|
|
4989
4982
|
console.log("Error loading collections:", $), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
|
|
4990
4983
|
}
|
|
4991
4984
|
};
|
|
4992
|
-
|
|
4985
|
+
Q(() => {
|
|
4993
4986
|
(!y || y.length === 0) && I();
|
|
4994
|
-
}, [y]),
|
|
4987
|
+
}, [y]), Q(() => {
|
|
4995
4988
|
Array.isArray(y) && p(y);
|
|
4996
4989
|
}, [y]);
|
|
4997
4990
|
const V = ($) => {
|
|
4998
|
-
m && (v($.id),
|
|
4991
|
+
m && (v($.id), N($.categoryName || ""));
|
|
4999
4992
|
}, z = () => {
|
|
5000
4993
|
if (!n || f !== null) return;
|
|
5001
4994
|
const $ = `temp-${Date.now()}`;
|
|
@@ -5008,12 +5001,12 @@ const ma = () => {
|
|
|
5008
5001
|
order: (O.at(-1)?.order ?? 0) + 1,
|
|
5009
5002
|
_temp: !0
|
|
5010
5003
|
}
|
|
5011
|
-
]), v($),
|
|
5004
|
+
]), v($), N("");
|
|
5012
5005
|
}, P = () => {
|
|
5013
5006
|
f != null && (p(($) => {
|
|
5014
5007
|
const O = $.find((F) => F.id === f), U = O && O._temp ? $.filter((F) => F.id !== f) : $;
|
|
5015
5008
|
return s?.(U), U;
|
|
5016
|
-
}), v(null),
|
|
5009
|
+
}), v(null), N(""));
|
|
5017
5010
|
}, g = async () => {
|
|
5018
5011
|
if (f == null || !a.trim()) return;
|
|
5019
5012
|
const $ = typeof f == "string" && f.startsWith("temp-");
|
|
@@ -5026,7 +5019,7 @@ const ma = () => {
|
|
|
5026
5019
|
O && (p((U) => {
|
|
5027
5020
|
const F = U.map((C) => C.id === f ? O : C);
|
|
5028
5021
|
return s?.(F), F;
|
|
5029
|
-
}),
|
|
5022
|
+
}), ve.success("Collection created successfully"));
|
|
5030
5023
|
} else {
|
|
5031
5024
|
const O = await ln(
|
|
5032
5025
|
`${t.collectionUpdate}/${f}?newName=${a.trim()}`
|
|
@@ -5038,7 +5031,7 @@ const ma = () => {
|
|
|
5038
5031
|
return s?.(F), F;
|
|
5039
5032
|
}), le.success("Collection updated successfully");
|
|
5040
5033
|
}
|
|
5041
|
-
v(null),
|
|
5034
|
+
v(null), N("");
|
|
5042
5035
|
} catch (O) {
|
|
5043
5036
|
console.log(O), le.error("Failed to save collection");
|
|
5044
5037
|
}
|
|
@@ -5049,12 +5042,12 @@ const ma = () => {
|
|
|
5049
5042
|
} catch (O) {
|
|
5050
5043
|
console.log(O), le.error("Failed to delete collection");
|
|
5051
5044
|
}
|
|
5052
|
-
},
|
|
5045
|
+
}, x = ($, O, U) => {
|
|
5053
5046
|
if (!u || !O || !U || O === U) return $;
|
|
5054
|
-
const F = $.findIndex((
|
|
5047
|
+
const F = $.findIndex((H) => H.id === O), C = $.findIndex((H) => H.id === U);
|
|
5055
5048
|
if (F === -1 || C === -1) return $;
|
|
5056
5049
|
const E = [...$], [j] = E.splice(F, 1);
|
|
5057
|
-
return E.splice(C, 0, j), E.map((
|
|
5050
|
+
return E.splice(C, 0, j), E.map((H, ie) => ({ ...H, order: ie + 1 }));
|
|
5058
5051
|
}, w = async ($) => {
|
|
5059
5052
|
const O = $.map((U) => ({
|
|
5060
5053
|
id: U.id,
|
|
@@ -5070,13 +5063,13 @@ const ma = () => {
|
|
|
5070
5063
|
u && ($.dataTransfer.effectAllowed = "move", $.dataTransfer.setData("text/plain", String(O)), L(O));
|
|
5071
5064
|
}, b = ($) => {
|
|
5072
5065
|
T && $ !== R && S($);
|
|
5073
|
-
},
|
|
5066
|
+
}, k = ($) => {
|
|
5074
5067
|
$.preventDefault();
|
|
5075
5068
|
}, D = async ($, O) => {
|
|
5076
5069
|
$.preventDefault();
|
|
5077
5070
|
const U = $.dataTransfer.getData("text/plain");
|
|
5078
5071
|
U && (p((F) => {
|
|
5079
|
-
const C =
|
|
5072
|
+
const C = x(F, U, O);
|
|
5080
5073
|
return console.log("Reordered", C), w(C), s?.(C), C;
|
|
5081
5074
|
}), L(null), S(null));
|
|
5082
5075
|
}, q = () => {
|
|
@@ -5114,7 +5107,7 @@ const ma = () => {
|
|
|
5114
5107
|
"div",
|
|
5115
5108
|
{
|
|
5116
5109
|
onDragEnter: () => b($.id),
|
|
5117
|
-
onDragOver:
|
|
5110
|
+
onDragOver: k,
|
|
5118
5111
|
onDrop: (E) => D(E, $.id),
|
|
5119
5112
|
onDragEnd: q,
|
|
5120
5113
|
className: [
|
|
@@ -5123,7 +5116,7 @@ const ma = () => {
|
|
|
5123
5116
|
C ? "ring-2 ring-gray-800/20" : "",
|
|
5124
5117
|
F ? "opacity-60" : ""
|
|
5125
5118
|
].join(" "),
|
|
5126
|
-
children: O ? /* @__PURE__ */ l(
|
|
5119
|
+
children: O ? /* @__PURE__ */ l(K, { children: [
|
|
5127
5120
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
5128
5121
|
"input",
|
|
5129
5122
|
{
|
|
@@ -5131,7 +5124,7 @@ const ma = () => {
|
|
|
5131
5124
|
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",
|
|
5132
5125
|
value: a,
|
|
5133
5126
|
placeholder: $._temp ? "New collection name" : "Edit collection name",
|
|
5134
|
-
onChange: (E) =>
|
|
5127
|
+
onChange: (E) => N(E.target.value),
|
|
5135
5128
|
onKeyDown: (E) => {
|
|
5136
5129
|
E.key === "Enter" && g(), E.key === "Escape" && P();
|
|
5137
5130
|
},
|
|
@@ -5163,7 +5156,7 @@ const ma = () => {
|
|
|
5163
5156
|
}
|
|
5164
5157
|
)
|
|
5165
5158
|
] })
|
|
5166
|
-
] }) : /* @__PURE__ */ l(
|
|
5159
|
+
] }) : /* @__PURE__ */ l(K, { children: [
|
|
5167
5160
|
/* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
|
|
5168
5161
|
u && /* @__PURE__ */ e(
|
|
5169
5162
|
"span",
|
|
@@ -5216,7 +5209,7 @@ const ma = () => {
|
|
|
5216
5209
|
allowEdit: f = !0,
|
|
5217
5210
|
allowDelete: v = !0,
|
|
5218
5211
|
allowReorder: a = !0,
|
|
5219
|
-
className:
|
|
5212
|
+
className: N = ""
|
|
5220
5213
|
} = t, d = r?.[t.key] || i || [], p = Array.isArray(d) ? d : [];
|
|
5221
5214
|
return /* @__PURE__ */ l("div", { className: "dynamic-config-manage-collection-list", children: [
|
|
5222
5215
|
(o || n) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
@@ -5228,7 +5221,7 @@ const ma = () => {
|
|
|
5228
5221
|
{
|
|
5229
5222
|
endpoints: m,
|
|
5230
5223
|
initialData: p,
|
|
5231
|
-
className:
|
|
5224
|
+
className: N,
|
|
5232
5225
|
onCollectionChange: (L) => {
|
|
5233
5226
|
s && s(t.key, L);
|
|
5234
5227
|
},
|
|
@@ -5244,17 +5237,17 @@ const ma = () => {
|
|
|
5244
5237
|
"Unknown type:",
|
|
5245
5238
|
" ",
|
|
5246
5239
|
/* @__PURE__ */ e("span", { className: "font-mono", children: String(t?.type ?? "N/A") })
|
|
5247
|
-
] }),
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5240
|
+
] }), Ne = /* @__PURE__ */ Object.create(null);
|
|
5241
|
+
Ne.section = $n;
|
|
5242
|
+
Ne.datatable = An;
|
|
5243
|
+
Ne.managecollectionlist = Xa;
|
|
5244
|
+
Ne["manage-collection-list"] = Xa;
|
|
5252
5245
|
function In(t) {
|
|
5253
5246
|
return typeof t == "string" ? t.trim() : t && typeof t == "object" ? String(t.type || "").trim() : "";
|
|
5254
5247
|
}
|
|
5255
5248
|
function zn(t) {
|
|
5256
5249
|
const r = In(t);
|
|
5257
|
-
return
|
|
5250
|
+
return Ne[r] || Ne[r.toLowerCase?.()] || Rn;
|
|
5258
5251
|
}
|
|
5259
5252
|
function Bn({
|
|
5260
5253
|
appid: t,
|
|
@@ -5262,13 +5255,13 @@ function Bn({
|
|
|
5262
5255
|
disableApi: s = !1,
|
|
5263
5256
|
onCancel: o
|
|
5264
5257
|
}) {
|
|
5265
|
-
const [n, m] = re.useState(r), [i, u] = re.useState(null), [y, f] = M(!1), [v, a] = M(!1), [
|
|
5258
|
+
const [n, m] = re.useState(r), [i, u] = re.useState(null), [y, f] = M(!1), [v, a] = M(!1), [N, d] = M({}), p = `${be()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, T = p, [L, R] = M(1), S = (h) => {
|
|
5266
5259
|
if (!r || !r.configuration)
|
|
5267
5260
|
return h;
|
|
5268
|
-
const
|
|
5261
|
+
const x = {}, w = h?.configuration || {};
|
|
5269
5262
|
return r.configuration.forEach((c) => {
|
|
5270
5263
|
if (c.key && c.type === "datatable" && c.key === "newsFeeds") {
|
|
5271
|
-
const
|
|
5264
|
+
const k = (w.newsFeeds || []).map((D, q) => {
|
|
5272
5265
|
let G = { users: [], groups: [], roles: [] };
|
|
5273
5266
|
return D.audience && (Array.isArray(D.audience) ? G = { users: [], groups: [], roles: [] } : typeof D.audience == "object" && (G = {
|
|
5274
5267
|
users: D.audience.users || [],
|
|
@@ -5282,36 +5275,36 @@ function Bn({
|
|
|
5282
5275
|
audience: G
|
|
5283
5276
|
};
|
|
5284
5277
|
});
|
|
5285
|
-
if (
|
|
5278
|
+
if (k.length === 0) {
|
|
5286
5279
|
const D = { id: 0 };
|
|
5287
5280
|
c.fields && c.fields.forEach((q) => {
|
|
5288
5281
|
q.fieldtype === "audience" ? D[q.key] = { users: [], groups: [], roles: [] } : D[q.key] = q.default || "";
|
|
5289
|
-
}),
|
|
5282
|
+
}), k.push(D);
|
|
5290
5283
|
}
|
|
5291
|
-
|
|
5292
|
-
} else c.key && (
|
|
5293
|
-
}),
|
|
5284
|
+
x[c.key] = k;
|
|
5285
|
+
} else c.key && (x[c.key] = w[c.key] || {});
|
|
5286
|
+
}), x;
|
|
5294
5287
|
}, A = () => {
|
|
5295
5288
|
if (r && r.configuration) {
|
|
5296
5289
|
const h = {};
|
|
5297
|
-
r.configuration.forEach((
|
|
5298
|
-
if (
|
|
5299
|
-
if (
|
|
5290
|
+
r.configuration.forEach((x) => {
|
|
5291
|
+
if (x.key)
|
|
5292
|
+
if (x.type === "datatable") {
|
|
5300
5293
|
const w = { id: 0 };
|
|
5301
|
-
|
|
5294
|
+
x.fields && x.fields.forEach((c) => {
|
|
5302
5295
|
c.fieldtype === "audience" ? w[c.key] = { users: [], groups: [], roles: [] } : w[c.key] = c.default || "";
|
|
5303
|
-
}), h[
|
|
5304
|
-
} else if (
|
|
5296
|
+
}), h[x.key] = [w];
|
|
5297
|
+
} else if (x.type === "section") {
|
|
5305
5298
|
const w = {};
|
|
5306
|
-
|
|
5299
|
+
x.fields && Array.isArray(x.fields) && x.fields.forEach((c) => {
|
|
5307
5300
|
c.key && (w[c.key] = c.default || "");
|
|
5308
|
-
}), h[
|
|
5301
|
+
}), h[x.key] = w;
|
|
5309
5302
|
} else
|
|
5310
|
-
h[
|
|
5303
|
+
h[x.key] = {};
|
|
5311
5304
|
}), u(h);
|
|
5312
5305
|
}
|
|
5313
5306
|
};
|
|
5314
|
-
|
|
5307
|
+
Q(() => {
|
|
5315
5308
|
if (s) {
|
|
5316
5309
|
f(!1);
|
|
5317
5310
|
return;
|
|
@@ -5319,51 +5312,51 @@ function Bn({
|
|
|
5319
5312
|
const h = async () => {
|
|
5320
5313
|
try {
|
|
5321
5314
|
f(!0);
|
|
5322
|
-
let
|
|
5323
|
-
if (
|
|
5324
|
-
const w = S(
|
|
5315
|
+
let x = await Fe(p);
|
|
5316
|
+
if (x) {
|
|
5317
|
+
const w = S(x);
|
|
5325
5318
|
u(w);
|
|
5326
5319
|
} else
|
|
5327
5320
|
A();
|
|
5328
|
-
} catch (
|
|
5329
|
-
console.error("Error fetching configuration:",
|
|
5321
|
+
} catch (x) {
|
|
5322
|
+
console.error("Error fetching configuration:", x);
|
|
5330
5323
|
let w = "Failed to load configuration";
|
|
5331
|
-
if (
|
|
5332
|
-
const c =
|
|
5324
|
+
if (x.response) {
|
|
5325
|
+
const c = x.response.status, b = x.response.data?.message || x.response.data?.error;
|
|
5333
5326
|
c === 400 ? w = b || "Invalid request. Please check the application ID." : c === 401 ? w = "You are not authorized to access this configuration." : c === 403 ? w = "Access denied. You don't have permission to view this configuration." : c === 404 ? w = "Configuration not found. It may not exist yet or the application ID is incorrect." : c >= 500 ? w = b || "Server error. Please try again later." : w = b || `Failed to load configuration (Error ${c})`;
|
|
5334
|
-
} else
|
|
5335
|
-
|
|
5327
|
+
} else x.request ? w = "Network error. Please check your connection and try again." : w = x.message || "An unexpected error occurred while loading configuration.";
|
|
5328
|
+
ve.error(w), A();
|
|
5336
5329
|
} finally {
|
|
5337
5330
|
f(!1);
|
|
5338
5331
|
}
|
|
5339
5332
|
};
|
|
5340
5333
|
r && (m(r), t ? h() : A());
|
|
5341
5334
|
}, [r, L, t, s]);
|
|
5342
|
-
const B = (h,
|
|
5335
|
+
const B = (h, x) => {
|
|
5343
5336
|
u((w) => ({
|
|
5344
5337
|
...w,
|
|
5345
|
-
[h]:
|
|
5338
|
+
[h]: x
|
|
5346
5339
|
})), d((w) => {
|
|
5347
5340
|
const c = { ...w };
|
|
5348
5341
|
return c[h] && delete c[h], c;
|
|
5349
5342
|
});
|
|
5350
5343
|
}, I = () => {
|
|
5351
5344
|
const h = {};
|
|
5352
|
-
return !n || !i || n.configuration.forEach((
|
|
5353
|
-
if (
|
|
5354
|
-
|
|
5345
|
+
return !n || !i || n.configuration.forEach((x) => {
|
|
5346
|
+
if (x.type === "section")
|
|
5347
|
+
x.fields.forEach((w) => {
|
|
5355
5348
|
if (w.required) {
|
|
5356
|
-
const c = i[
|
|
5357
|
-
(!c || typeof c == "string" && c.trim() === "") && (h[
|
|
5349
|
+
const c = i[x.key]?.[w.key];
|
|
5350
|
+
(!c || typeof c == "string" && c.trim() === "") && (h[x.key] || (h[x.key] = {}), h[x.key][w.key] = `${w.label} is required`);
|
|
5358
5351
|
}
|
|
5359
5352
|
});
|
|
5360
|
-
else if (
|
|
5361
|
-
const w = i[
|
|
5353
|
+
else if (x.type === "datatable") {
|
|
5354
|
+
const w = i[x.key];
|
|
5362
5355
|
Array.isArray(w) && w.forEach((c, b) => {
|
|
5363
|
-
|
|
5364
|
-
if (
|
|
5365
|
-
const D = c[
|
|
5366
|
-
(!D || typeof D == "string" && D.trim() === "") && (h[
|
|
5356
|
+
x.fields.forEach((k) => {
|
|
5357
|
+
if (k.required) {
|
|
5358
|
+
const D = c[k.key];
|
|
5359
|
+
(!D || typeof D == "string" && D.trim() === "") && (h[x.key] || (h[x.key] = {}), h[x.key][b] || (h[x.key][b] = {}), h[x.key][b][k.key] = `${k.label} is required`);
|
|
5367
5360
|
}
|
|
5368
5361
|
});
|
|
5369
5362
|
});
|
|
@@ -5375,8 +5368,8 @@ function Bn({
|
|
|
5375
5368
|
let w = [];
|
|
5376
5369
|
Object.keys(h).forEach((c) => {
|
|
5377
5370
|
typeof h[c] == "object" && Object.keys(h[c]).forEach((b) => {
|
|
5378
|
-
typeof h[c][b] == "object" ? Object.keys(h[c][b]).forEach((
|
|
5379
|
-
w.push(`${c} row ${parseInt(b) + 1}: ${h[c][b][
|
|
5371
|
+
typeof h[c][b] == "object" ? Object.keys(h[c][b]).forEach((k) => {
|
|
5372
|
+
w.push(`${c} row ${parseInt(b) + 1}: ${h[c][b][k]}`);
|
|
5380
5373
|
}) : w.push(`${c}: ${h[c][b]}`);
|
|
5381
5374
|
});
|
|
5382
5375
|
});
|
|
@@ -5387,35 +5380,30 @@ function Bn({
|
|
|
5387
5380
|
a(!0);
|
|
5388
5381
|
const w = {};
|
|
5389
5382
|
i && Object.keys(i).forEach((b) => {
|
|
5390
|
-
b === "newsFeeds" && Array.isArray(i[b]) ? w[b] = i[b].map((
|
|
5383
|
+
b === "newsFeeds" && Array.isArray(i[b]) ? w[b] = i[b].map((k) => {
|
|
5391
5384
|
let D = { users: [], groups: [], roles: [] };
|
|
5392
|
-
return
|
|
5393
|
-
users:
|
|
5394
|
-
groups:
|
|
5395
|
-
roles:
|
|
5385
|
+
return k.audience && typeof k.audience == "object" && !Array.isArray(k.audience) && (D = {
|
|
5386
|
+
users: k.audience.users || [],
|
|
5387
|
+
groups: k.audience.groups || [],
|
|
5388
|
+
roles: k.audience.roles || []
|
|
5396
5389
|
}), {
|
|
5397
|
-
id:
|
|
5398
|
-
category:
|
|
5399
|
-
url:
|
|
5390
|
+
id: k.id || 0,
|
|
5391
|
+
category: k.category || "",
|
|
5392
|
+
url: k.url || "",
|
|
5400
5393
|
// Keep as 'url' to match API and config
|
|
5401
5394
|
audience: D
|
|
5402
5395
|
};
|
|
5403
5396
|
}) : w[b] = i[b];
|
|
5404
5397
|
});
|
|
5405
5398
|
let c = await $e(T, w);
|
|
5406
|
-
if (c && c.
|
|
5399
|
+
if (console.log(), c && c.status != "fail") {
|
|
5407
5400
|
d({});
|
|
5408
5401
|
const b = c.message || "Configuration has been saved successfully";
|
|
5409
|
-
|
|
5402
|
+
ve.success(b);
|
|
5410
5403
|
} else
|
|
5411
|
-
throw new Error("No response received from server");
|
|
5404
|
+
throw ve.error(c?.message || "Failed to save configuration"), new Error("No response received from server");
|
|
5412
5405
|
} catch (w) {
|
|
5413
|
-
|
|
5414
|
-
if (w.response) {
|
|
5415
|
-
const b = w.response.status, x = w.response.data?.message || w.response.data?.error;
|
|
5416
|
-
b === 400 ? c = x || "Invalid configuration data. Please check your inputs." : b === 401 ? c = "You are not authorized to save this configuration." : b === 403 ? c = "Access denied. You don't have permission to save this configuration." : b === 404 ? c = "Configuration endpoint not found. Please contact support." : b >= 500 ? c = x || "Server error. Please try again later." : c = x || `Failed to save configuration (Error ${b})`;
|
|
5417
|
-
} else w.request ? c = "Network error. Please check your connection and try again." : c = w.message || "An unexpected error occurred while saving.";
|
|
5418
|
-
De.error(c);
|
|
5406
|
+
console.error("Error saving configuration:", w), ve.error(w?.message || "Failed to save configuration");
|
|
5419
5407
|
} finally {
|
|
5420
5408
|
a(!1);
|
|
5421
5409
|
}
|
|
@@ -5425,14 +5413,14 @@ function Bn({
|
|
|
5425
5413
|
o();
|
|
5426
5414
|
return;
|
|
5427
5415
|
}
|
|
5428
|
-
|
|
5416
|
+
N && Object.keys(N).length > 0 && !window.confirm(
|
|
5429
5417
|
"You have validation errors that will be lost. Are you sure you want to cancel?"
|
|
5430
|
-
) || (d({}), u(null), R((
|
|
5418
|
+
) || (d({}), u(null), R((x) => x + 1), ve.info("Configuration changes cancelled"));
|
|
5431
5419
|
};
|
|
5432
5420
|
if (!n?.configuration && !r?.configuration)
|
|
5433
5421
|
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" }) });
|
|
5434
5422
|
const g = r?.configuration || n?.configuration;
|
|
5435
|
-
return
|
|
5423
|
+
return Q(() => {
|
|
5436
5424
|
s && r ? (!i || Object.keys(i).length === 0) && A() : s && !r && A();
|
|
5437
5425
|
}, [s, r]), /* @__PURE__ */ l("div", { children: [
|
|
5438
5426
|
/* @__PURE__ */ l(
|
|
@@ -5442,7 +5430,7 @@ function Bn({
|
|
|
5442
5430
|
style: { padding: "0px 20px 0px 0px" },
|
|
5443
5431
|
children: [
|
|
5444
5432
|
y && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(La, { size: "large" }) }),
|
|
5445
|
-
!y && g?.map((h,
|
|
5433
|
+
!y && g?.map((h, x) => {
|
|
5446
5434
|
const w = zn(h.type);
|
|
5447
5435
|
if (w && w !== "UnknownType")
|
|
5448
5436
|
return /* @__PURE__ */ e(
|
|
@@ -5451,9 +5439,9 @@ function Bn({
|
|
|
5451
5439
|
item: h,
|
|
5452
5440
|
data: i,
|
|
5453
5441
|
updateHandler: B,
|
|
5454
|
-
validationErrors:
|
|
5442
|
+
validationErrors: N
|
|
5455
5443
|
},
|
|
5456
|
-
|
|
5444
|
+
x
|
|
5457
5445
|
);
|
|
5458
5446
|
})
|
|
5459
5447
|
]
|
|
@@ -5461,7 +5449,7 @@ function Bn({
|
|
|
5461
5449
|
),
|
|
5462
5450
|
/* @__PURE__ */ l("div", { className: "w-full gap-5 bg-white flex justify-end py-3 px-7 rounded-t-md rounded-b-2xl border border-gray-300", style: { boxShadow: "0 -2px 10px 0 rgba(0, 0, 0, 0.20)", marginTop: "20px" }, children: [
|
|
5463
5451
|
/* @__PURE__ */ e(
|
|
5464
|
-
|
|
5452
|
+
Z,
|
|
5465
5453
|
{
|
|
5466
5454
|
category: "secondary",
|
|
5467
5455
|
onClick: P,
|
|
@@ -5470,7 +5458,7 @@ function Bn({
|
|
|
5470
5458
|
}
|
|
5471
5459
|
),
|
|
5472
5460
|
/* @__PURE__ */ e(
|
|
5473
|
-
|
|
5461
|
+
Z,
|
|
5474
5462
|
{
|
|
5475
5463
|
category: "primary",
|
|
5476
5464
|
onClick: z,
|
|
@@ -5493,7 +5481,7 @@ const is = ({
|
|
|
5493
5481
|
breadcrumb: f = [],
|
|
5494
5482
|
overview: v = {},
|
|
5495
5483
|
configuration: a = []
|
|
5496
|
-
} = t,
|
|
5484
|
+
} = t, N = a.map((z) => {
|
|
5497
5485
|
if (z.type === "section" && z.fields) {
|
|
5498
5486
|
const P = [...z.fields], g = P.findIndex((h) => h.key === "appkey");
|
|
5499
5487
|
if (g !== -1) {
|
|
@@ -5545,7 +5533,7 @@ const is = ({
|
|
|
5545
5533
|
i(!1), z.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
|
|
5546
5534
|
}, []), S = {
|
|
5547
5535
|
heading: (() => {
|
|
5548
|
-
for (const z of
|
|
5536
|
+
for (const z of N)
|
|
5549
5537
|
if (z.type === "section" && z.fields) {
|
|
5550
5538
|
const P = z.fields.find((g) => g.key === "displayname");
|
|
5551
5539
|
if (P)
|
|
@@ -5576,7 +5564,7 @@ const is = ({
|
|
|
5576
5564
|
...v
|
|
5577
5565
|
}, B = [
|
|
5578
5566
|
{ label: "Overview", content: V(A) },
|
|
5579
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Bn, { appid: r, configdata: { configuration:
|
|
5567
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Bn, { appid: r, configdata: { configuration: N }, disableApi: s, onCancel: T }) }
|
|
5580
5568
|
];
|
|
5581
5569
|
function I(z) {
|
|
5582
5570
|
return z ? z.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: z } }) : z : "📱";
|
|
@@ -5676,7 +5664,7 @@ const is = ({
|
|
|
5676
5664
|
] });
|
|
5677
5665
|
};
|
|
5678
5666
|
function cs({ children: t }) {
|
|
5679
|
-
return /* @__PURE__ */ l(
|
|
5667
|
+
return /* @__PURE__ */ l(K, { children: [
|
|
5680
5668
|
t,
|
|
5681
5669
|
/* @__PURE__ */ e(
|
|
5682
5670
|
Yt,
|
|
@@ -5717,7 +5705,7 @@ const ds = ({
|
|
|
5717
5705
|
showColumnChooser: f = !0,
|
|
5718
5706
|
showFilter: v = !1,
|
|
5719
5707
|
showPrint: a = !1,
|
|
5720
|
-
showExcel:
|
|
5708
|
+
showExcel: N = !1,
|
|
5721
5709
|
showPdf: d = !1,
|
|
5722
5710
|
showRefresh: p = !1,
|
|
5723
5711
|
showAdd: T = !1,
|
|
@@ -5731,19 +5719,19 @@ const ds = ({
|
|
|
5731
5719
|
excelFileName: A,
|
|
5732
5720
|
pdfFileName: B
|
|
5733
5721
|
}) => {
|
|
5734
|
-
const I = () => n?.current || o?.current, [V, z] = re.useState(""), P = (t || "export").toString().trim() || "export", g = `${A || P}.xlsx`, h = `${B || P}.pdf`,
|
|
5722
|
+
const I = () => n?.current || o?.current, [V, z] = re.useState(""), P = (t || "export").toString().trim() || "export", g = `${A || P}.xlsx`, h = `${B || P}.pdf`, x = (b, k, D) => Math.max(k, Math.min(b, D)), w = ae(
|
|
5735
5723
|
(b) => {
|
|
5736
|
-
const
|
|
5737
|
-
if (console.log("openColumnChooserNear",
|
|
5724
|
+
const k = I();
|
|
5725
|
+
if (console.log("openColumnChooserNear", k), !!k?.openColumnChooser) {
|
|
5738
5726
|
if (typeof window > "u" || !b?.currentTarget) {
|
|
5739
|
-
|
|
5727
|
+
k.openColumnChooser();
|
|
5740
5728
|
return;
|
|
5741
5729
|
}
|
|
5742
5730
|
try {
|
|
5743
5731
|
const D = b.currentTarget.getBoundingClientRect(), q = D.left + window.scrollX, G = D.bottom + window.scrollY;
|
|
5744
5732
|
let $ = q - 120, O = G - 120;
|
|
5745
5733
|
const U = window.innerWidth, F = window.innerHeight;
|
|
5746
|
-
$ =
|
|
5734
|
+
$ = x($, window.scrollX + 8, window.scrollX + U - 340), O = x(O, window.scrollY, window.scrollY + F - 120), console.log("openColumnChooserNear", $, O), k.openColumnChooser($, O);
|
|
5747
5735
|
} catch (D) {
|
|
5748
5736
|
console.log("coloumn choose error", D);
|
|
5749
5737
|
}
|
|
@@ -5752,18 +5740,18 @@ const ds = ({
|
|
|
5752
5740
|
[]
|
|
5753
5741
|
// no external deps; reads ref at call time
|
|
5754
5742
|
), c = ae(
|
|
5755
|
-
(b,
|
|
5743
|
+
(b, k) => {
|
|
5756
5744
|
const D = I();
|
|
5757
5745
|
if (D)
|
|
5758
5746
|
switch (b) {
|
|
5759
5747
|
case "ColumnChooser":
|
|
5760
|
-
f && (console.log("openColumnChooser",
|
|
5748
|
+
f && (console.log("openColumnChooser", k), k ? w(k) : D.openColumnChooser?.()), console.log("openColumnChooser out", k);
|
|
5761
5749
|
break;
|
|
5762
5750
|
case "Print":
|
|
5763
5751
|
a && D.print?.();
|
|
5764
5752
|
break;
|
|
5765
5753
|
case "Excel":
|
|
5766
|
-
|
|
5754
|
+
N && D.excelExport?.({ fileName: g });
|
|
5767
5755
|
break;
|
|
5768
5756
|
case "Pdf":
|
|
5769
5757
|
d && D.pdfExport?.({ fileName: h });
|
|
@@ -5773,7 +5761,7 @@ const ds = ({
|
|
|
5773
5761
|
break;
|
|
5774
5762
|
}
|
|
5775
5763
|
},
|
|
5776
|
-
[f, a,
|
|
5764
|
+
[f, a, N, d, p, g, h, R, w]
|
|
5777
5765
|
);
|
|
5778
5766
|
return /* @__PURE__ */ l("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: [
|
|
5779
5767
|
/* @__PURE__ */ l("div", { className: "flex flex-col", children: [
|
|
@@ -5798,7 +5786,7 @@ const ds = ({
|
|
|
5798
5786
|
/* @__PURE__ */ l("div", { className: "flex gap-3", children: [
|
|
5799
5787
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
5800
5788
|
f && /* @__PURE__ */ e(
|
|
5801
|
-
|
|
5789
|
+
Z,
|
|
5802
5790
|
{
|
|
5803
5791
|
icon: Jt,
|
|
5804
5792
|
onClick: (b) => c("ColumnChooser", b),
|
|
@@ -5809,7 +5797,7 @@ const ds = ({
|
|
|
5809
5797
|
}
|
|
5810
5798
|
),
|
|
5811
5799
|
v && /* @__PURE__ */ e(
|
|
5812
|
-
|
|
5800
|
+
Z,
|
|
5813
5801
|
{
|
|
5814
5802
|
icon: Qt,
|
|
5815
5803
|
onClick: i,
|
|
@@ -5820,7 +5808,7 @@ const ds = ({
|
|
|
5820
5808
|
}
|
|
5821
5809
|
),
|
|
5822
5810
|
a && /* @__PURE__ */ e(
|
|
5823
|
-
|
|
5811
|
+
Z,
|
|
5824
5812
|
{
|
|
5825
5813
|
icon: Xt,
|
|
5826
5814
|
onClick: () => c("Print"),
|
|
@@ -5830,8 +5818,8 @@ const ds = ({
|
|
|
5830
5818
|
title: "Print Grid"
|
|
5831
5819
|
}
|
|
5832
5820
|
),
|
|
5833
|
-
|
|
5834
|
-
|
|
5821
|
+
N && /* @__PURE__ */ e(
|
|
5822
|
+
Z,
|
|
5835
5823
|
{
|
|
5836
5824
|
icon: Zt,
|
|
5837
5825
|
onClick: () => c("Excel"),
|
|
@@ -5842,7 +5830,7 @@ const ds = ({
|
|
|
5842
5830
|
}
|
|
5843
5831
|
),
|
|
5844
5832
|
d && /* @__PURE__ */ e(
|
|
5845
|
-
|
|
5833
|
+
Z,
|
|
5846
5834
|
{
|
|
5847
5835
|
icon: Ht,
|
|
5848
5836
|
onClick: () => c("Pdf"),
|
|
@@ -5853,7 +5841,7 @@ const ds = ({
|
|
|
5853
5841
|
}
|
|
5854
5842
|
),
|
|
5855
5843
|
p && /* @__PURE__ */ e(
|
|
5856
|
-
|
|
5844
|
+
Z,
|
|
5857
5845
|
{
|
|
5858
5846
|
icon: Kt,
|
|
5859
5847
|
onClick: () => c("Refresh"),
|
|
@@ -5865,7 +5853,7 @@ const ds = ({
|
|
|
5865
5853
|
)
|
|
5866
5854
|
] }),
|
|
5867
5855
|
T && m && /* @__PURE__ */ e(
|
|
5868
|
-
|
|
5856
|
+
Z,
|
|
5869
5857
|
{
|
|
5870
5858
|
label: u,
|
|
5871
5859
|
icon: er,
|
|
@@ -5893,7 +5881,7 @@ function us(t) {
|
|
|
5893
5881
|
allowGrouping: f = !1,
|
|
5894
5882
|
allowReordering: v = !0,
|
|
5895
5883
|
allowResizing: a = !0,
|
|
5896
|
-
allowExcelExport:
|
|
5884
|
+
allowExcelExport: N = !1,
|
|
5897
5885
|
allowPdfExport: d = !1,
|
|
5898
5886
|
showColumnChooser: p = !1,
|
|
5899
5887
|
enableSearchApi: T = !1,
|
|
@@ -5908,15 +5896,15 @@ function us(t) {
|
|
|
5908
5896
|
apiRef: P,
|
|
5909
5897
|
gridProps: g = {}
|
|
5910
5898
|
} = t, h = ue(null), {
|
|
5911
|
-
pageSettings:
|
|
5899
|
+
pageSettings: x,
|
|
5912
5900
|
sortSettings: w,
|
|
5913
5901
|
...c
|
|
5914
5902
|
} = g || {}, b = ne(() => {
|
|
5915
5903
|
const C = [wr];
|
|
5916
|
-
return u && C.push(Cr), y && C.push(Sr), f && C.push(Dr), T && C.push(Fr),
|
|
5917
|
-
}, [u, y, f, T,
|
|
5918
|
-
const C = () => h.current, E = (j,
|
|
5919
|
-
!
|
|
5904
|
+
return u && C.push(Cr), y && C.push(Sr), f && C.push(Dr), T && C.push(Fr), N && C.push($r), d && C.push(Tr), p && C.push(Ar), a && C.push(Er), v && C.push(Rr), C.push(Ir), C;
|
|
5905
|
+
}, [u, y, f, T, N, d, p, a, v]), k = ne(() => {
|
|
5906
|
+
const C = () => h.current, E = (j, H) => {
|
|
5907
|
+
!H && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${j} requested but related service/feature is disabled.`);
|
|
5920
5908
|
};
|
|
5921
5909
|
return {
|
|
5922
5910
|
getInstance: () => C(),
|
|
@@ -5930,19 +5918,19 @@ function us(t) {
|
|
|
5930
5918
|
},
|
|
5931
5919
|
print: () => C()?.print?.(),
|
|
5932
5920
|
excelExport: (j) => {
|
|
5933
|
-
E("excelExport()",
|
|
5921
|
+
E("excelExport()", N), C()?.excelExport?.(j);
|
|
5934
5922
|
},
|
|
5935
5923
|
pdfExport: (j) => {
|
|
5936
5924
|
E("pdfExport()", d), C()?.pdfExport?.(j);
|
|
5937
5925
|
},
|
|
5938
|
-
openColumnChooser: (j,
|
|
5939
|
-
E("openColumnChooser()", p), C()?.columnChooserModule?.openColumnChooser?.(j,
|
|
5926
|
+
openColumnChooser: (j, H) => {
|
|
5927
|
+
E("openColumnChooser()", p), C()?.columnChooserModule?.openColumnChooser?.(j, H);
|
|
5940
5928
|
}
|
|
5941
5929
|
};
|
|
5942
5930
|
}, []);
|
|
5943
|
-
|
|
5944
|
-
P && (P.current =
|
|
5945
|
-
}, [P,
|
|
5931
|
+
Q(() => {
|
|
5932
|
+
P && (P.current = k);
|
|
5933
|
+
}, [P, k]), Q(() => () => {
|
|
5946
5934
|
P && (P.current = null);
|
|
5947
5935
|
}, []);
|
|
5948
5936
|
const D = (C) => {
|
|
@@ -5953,8 +5941,8 @@ function us(t) {
|
|
|
5953
5941
|
currentPage: n,
|
|
5954
5942
|
totalRecordsCount: s,
|
|
5955
5943
|
pageSizes: !0,
|
|
5956
|
-
...
|
|
5957
|
-
}), [n, m, s,
|
|
5944
|
+
...x || {}
|
|
5945
|
+
}), [n, m, s, x]), G = ne(() => {
|
|
5958
5946
|
if (!u || !w) return;
|
|
5959
5947
|
const C = (w.columns || []).map((E) => ({
|
|
5960
5948
|
...E,
|
|
@@ -5962,12 +5950,12 @@ function us(t) {
|
|
|
5962
5950
|
}));
|
|
5963
5951
|
return { allowUnsort: !0, ...w, columns: C };
|
|
5964
5952
|
}, [w, u]), $ = (C) => {
|
|
5965
|
-
const E = h.current, j = C?.requestType,
|
|
5966
|
-
field:
|
|
5967
|
-
dir: D(
|
|
5953
|
+
const E = h.current, j = C?.requestType, H = j === "paging" ? "paging" : j === "sorting" ? "sorting" : j === "searching" ? "searching" : j === "filtering" ? "filtering" : j === "grouping" ? "grouping" : j === "reorder" ? "reorder" : j === "columnstate" ? "columnstate" : "other", ie = C?.pageSize ?? E?.pageSettings?.pageSize ?? m, ce = C?.currentPage ?? E?.pageSettings?.currentPage ?? n, je = C?.columnName && C?.direction ? [{ field: C.columnName, dir: D(C.direction) }] : (E?.sortSettings?.columns || []).map((Ce) => ({
|
|
5954
|
+
field: Ce.field,
|
|
5955
|
+
dir: D(Ce.direction ?? Ce.dir)
|
|
5968
5956
|
})), Ge = C?.searchString ?? "", _e = C?.columns ?? E?.filterSettings?.columns ?? [];
|
|
5969
5957
|
return {
|
|
5970
|
-
reason:
|
|
5958
|
+
reason: H,
|
|
5971
5959
|
page: { index: ce, size: ie, skip: (ce - 1) * ie, take: ie },
|
|
5972
5960
|
sort: je,
|
|
5973
5961
|
// [{ field, dir: 'Ascending'|'Descending' }]
|
|
@@ -6010,13 +5998,13 @@ function us(t) {
|
|
|
6010
5998
|
const C = [];
|
|
6011
5999
|
return S && C.push(/* @__PURE__ */ e(ra, { type: "checkbox", width: "50" }, "__checkbox__")), A.forEach((E, j) => {
|
|
6012
6000
|
const {
|
|
6013
|
-
field:
|
|
6001
|
+
field: H,
|
|
6014
6002
|
headerText: ie,
|
|
6015
6003
|
width: ce,
|
|
6016
6004
|
textAlign: je = "Left",
|
|
6017
6005
|
template: Ge,
|
|
6018
6006
|
isPrimaryKey: _e,
|
|
6019
|
-
showInColumnChooser:
|
|
6007
|
+
showInColumnChooser: Ce = !0,
|
|
6020
6008
|
allowFiltering: Za = !0,
|
|
6021
6009
|
allowSorting: Ha = !0,
|
|
6022
6010
|
type: Ka,
|
|
@@ -6031,13 +6019,13 @@ function us(t) {
|
|
|
6031
6019
|
/* @__PURE__ */ e(
|
|
6032
6020
|
ra,
|
|
6033
6021
|
{
|
|
6034
|
-
field:
|
|
6022
|
+
field: H,
|
|
6035
6023
|
headerText: ie,
|
|
6036
6024
|
width: ce,
|
|
6037
6025
|
textAlign: je,
|
|
6038
6026
|
template: Ge,
|
|
6039
6027
|
isPrimaryKey: _e,
|
|
6040
|
-
showInColumnChooser:
|
|
6028
|
+
showInColumnChooser: Ce,
|
|
6041
6029
|
allowFiltering: Za,
|
|
6042
6030
|
allowSorting: Ha,
|
|
6043
6031
|
type: Ka,
|
|
@@ -6048,7 +6036,7 @@ function us(t) {
|
|
|
6048
6036
|
customAttributes: nt,
|
|
6049
6037
|
...st
|
|
6050
6038
|
},
|
|
6051
|
-
|
|
6039
|
+
H || `col-${j}`
|
|
6052
6040
|
)
|
|
6053
6041
|
);
|
|
6054
6042
|
}), C;
|
|
@@ -6095,7 +6083,7 @@ export {
|
|
|
6095
6083
|
Ma as ToggleSwitch,
|
|
6096
6084
|
Zn as Tooltip,
|
|
6097
6085
|
ls as TreeView,
|
|
6098
|
-
|
|
6086
|
+
Z as UnifyedCoreButton,
|
|
6099
6087
|
Hn as WizardModal,
|
|
6100
6088
|
Ga as adGroupsListSearchApi,
|
|
6101
6089
|
sn as axiosDelete,
|
|
@@ -6114,7 +6102,7 @@ export {
|
|
|
6114
6102
|
ns as http,
|
|
6115
6103
|
Kr as localStore,
|
|
6116
6104
|
aa as myDriveGatewayBaseV2,
|
|
6117
|
-
|
|
6105
|
+
ve as notify,
|
|
6118
6106
|
_a as provisioningBase,
|
|
6119
6107
|
Ya as rbacBase,
|
|
6120
6108
|
Wa as searchRolesApi,
|