unifyedx-storybook-new 0.2.14 → 0.2.16
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,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e, Fragment as ee } from "react/jsx-runtime";
|
|
2
2
|
import ae, { useState as B, useMemo as ce, useId as ea, Fragment as Q, useEffect as X, useCallback as K, useRef as ue } from "react";
|
|
3
|
-
import { a as J, U as ut, X as ye, P as _, L as mt, C as je, b as Ge, f as Ue, d as va, D as Na, F as ht, e as pt, h as gt, T as Ve, u as yt, i as ft, I as bt, j as vt, k as Nt, l as xt, m as kt, n as wt, S as xa, o as ka, M as Ct, p as St, q as wa, r as Dt, A as
|
|
3
|
+
import { a as J, U as ut, X as ye, P as _, L as mt, C as je, b as Ge, f as Ue, d as va, D as Na, F as ht, e as pt, h as gt, T as Ve, u as yt, i as ft, I as bt, j as vt, k as Nt, l as xt, m as kt, n as wt, S as xa, o as ka, M as Ct, p as St, q as wa, r as Dt, A as Ft, E as $t, s as Tt, t as At, v as Et, w as Rt, x as Ca, y as It, z as Sa, B as Da, G as zt, H as Pt, J as Bt, K as qe, N as aa, O as ta, Q as Lt, R as Ot, V as Fa, W as Mt, Y as sa, Z as Ut, _ as Vt, $ as $a, a0 as qt, a1 as jt, a2 as Gt, a3 as _t, a4 as Wt, a5 as Yt, a6 as Jt, a7 as Qt, a8 as Xt, a9 as Zt, aa as Ht, ab as Kt, ac as er, ad as ar, ae as tr } from "./vendor-zgKTz69B.js";
|
|
4
4
|
import { Popover as rr, PopoverButton as nr, PopoverPanel as sr, Transition as oe, Dialog as me, TransitionChild as ge, DialogPanel as Se, DialogTitle as _e, TabGroup as lr, TabList as or, Tab as re, TabPanels as ir, RadioGroup as ze, Listbox as Z, ListboxButton as cr, ListboxOptions as dr, ListboxOption as ur, SwitchGroup as mr, Switch as Ze, Menu as hr, MenuButton as pr, Portal as gr, MenuItems as yr, MenuItem as fr, DialogBackdrop as br } from "@headlessui/react";
|
|
5
5
|
import { motion as ne, AnimatePresence as be } from "framer-motion";
|
|
6
6
|
import { d as vr } from "./vendor-lodash-BD0xlZyL.js";
|
|
@@ -8,15 +8,15 @@ import { useFloating as Ta, offset as Aa, flip as Ea, shift as Ra, autoUpdate as
|
|
|
8
8
|
import He, { debounce as Cr } from "lodash";
|
|
9
9
|
import { toast as le, ToastContainer as Sr, Slide as Dr } from "react-toastify";
|
|
10
10
|
import "react-toastify/dist/ReactToastify.css";
|
|
11
|
-
import { P as
|
|
11
|
+
import { P as Fr, S as $r, F as Tr, G as Ar, a as Er, E as Rr, b as Ir, C as zr, R as Pr, c as Br, d as Lr, e as Or, f as Mr, I as Ur, g as ia } from "./vendor-syncfusion-DGcZfoFG.js";
|
|
12
12
|
const Vr = (t) => {
|
|
13
13
|
let r = 2166136261;
|
|
14
14
|
for (let s = 0; s < t.length; s++)
|
|
15
15
|
r ^= t.charCodeAt(s), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
|
|
16
16
|
return r >>> 0;
|
|
17
17
|
}, qr = (t) => {
|
|
18
|
-
const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Vr(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, i = 30 + (o >>> 16) % 10,
|
|
19
|
-
return { bg: y, text:
|
|
18
|
+
const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Vr(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, i = 30 + (o >>> 16) % 10, c = 86 + (o >>> 24) % 8, y = `hsl(${n}, ${u}%, ${c}%)`, v = `hsl(${n}, ${u}%, ${i}%)`;
|
|
19
|
+
return { bg: y, text: v };
|
|
20
20
|
}, jr = (t = "") => t.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase(), za = ({
|
|
21
21
|
src: t,
|
|
22
22
|
name: r,
|
|
@@ -29,16 +29,16 @@ const Vr = (t) => {
|
|
|
29
29
|
className: u,
|
|
30
30
|
...i
|
|
31
31
|
}) => {
|
|
32
|
-
const [
|
|
32
|
+
const [c, y] = B(!1), v = ce(() => qr(r), []), x = t && !c, a = !x && r, k = !x && !r, h = J(
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
u
|
|
36
|
-
), g =
|
|
37
|
-
return /* @__PURE__ */ l("div", { className:
|
|
36
|
+
), g = x ? "transparent" : o || v.bg, $ = n || v.text;
|
|
37
|
+
return /* @__PURE__ */ l("div", { className: h, style: {
|
|
38
38
|
backgroundColor: g,
|
|
39
39
|
color: $
|
|
40
40
|
}, ...i, children: [
|
|
41
|
-
|
|
41
|
+
x && /* @__PURE__ */ e(
|
|
42
42
|
"img",
|
|
43
43
|
{
|
|
44
44
|
src: t,
|
|
@@ -71,17 +71,17 @@ const Vr = (t) => {
|
|
|
71
71
|
onRemove: n,
|
|
72
72
|
bgColor: u,
|
|
73
73
|
textColor: i,
|
|
74
|
-
className:
|
|
74
|
+
className: c,
|
|
75
75
|
...y
|
|
76
76
|
}) => {
|
|
77
|
-
const
|
|
77
|
+
const v = J(
|
|
78
78
|
"badge",
|
|
79
79
|
`badge--variant-${r}`,
|
|
80
80
|
`badge--size-${s}`,
|
|
81
81
|
{ "badge--with-remove": !!n },
|
|
82
|
-
|
|
82
|
+
c
|
|
83
83
|
);
|
|
84
|
-
return /* @__PURE__ */ l("span", { className:
|
|
84
|
+
return /* @__PURE__ */ l("span", { className: v, style: u && i ? {
|
|
85
85
|
backgroundColor: u,
|
|
86
86
|
color: i,
|
|
87
87
|
borderColor: "#ff0000"
|
|
@@ -146,19 +146,19 @@ const _r = {
|
|
|
146
146
|
// ✅ Default is now empty
|
|
147
147
|
loader: u = !1,
|
|
148
148
|
category: i = "primary",
|
|
149
|
-
icon:
|
|
149
|
+
icon: c,
|
|
150
150
|
// Renamed for clarity, expecting a component type e.g., CheckCircle
|
|
151
151
|
disabled: y = !1,
|
|
152
|
-
size:
|
|
153
|
-
label:
|
|
152
|
+
size: v = "medium",
|
|
153
|
+
label: x,
|
|
154
154
|
children: a,
|
|
155
155
|
// ✅ Add children to the props list
|
|
156
156
|
onClick: k,
|
|
157
|
-
...
|
|
157
|
+
...h
|
|
158
158
|
}) => {
|
|
159
|
-
const g = y || u, $ =
|
|
159
|
+
const g = y || u, $ = c && !x, L = J(
|
|
160
160
|
"btn-base",
|
|
161
|
-
_r[
|
|
161
|
+
_r[v],
|
|
162
162
|
Wr[i],
|
|
163
163
|
{
|
|
164
164
|
"is-loading": u,
|
|
@@ -174,12 +174,12 @@ const _r = {
|
|
|
174
174
|
className: L,
|
|
175
175
|
disabled: g,
|
|
176
176
|
onClick: k,
|
|
177
|
-
title: r || $ && o || (typeof
|
|
178
|
-
"aria-label": o || $ && r || (typeof
|
|
179
|
-
...
|
|
177
|
+
title: r || $ && o || (typeof x == "string" ? x : void 0),
|
|
178
|
+
"aria-label": o || $ && r || (typeof x == "string" ? x : void 0),
|
|
179
|
+
...h,
|
|
180
180
|
children: u ? /* @__PURE__ */ e(mt, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ l(ee, { children: [
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
c && /* @__PURE__ */ e(c, { size: v === "large" ? 20 : 16 }),
|
|
182
|
+
x,
|
|
183
183
|
a,
|
|
184
184
|
" "
|
|
185
185
|
] })
|
|
@@ -216,21 +216,21 @@ const _r = {
|
|
|
216
216
|
ref: n,
|
|
217
217
|
checked: u,
|
|
218
218
|
onChange: i,
|
|
219
|
-
...
|
|
219
|
+
...c
|
|
220
220
|
}) => {
|
|
221
|
-
const y = ea(),
|
|
221
|
+
const y = ea(), v = r || y;
|
|
222
222
|
return /* @__PURE__ */ l("div", { className: `checkbox-container ${o || ""}`, children: [
|
|
223
|
-
/* @__PURE__ */ l("label", { htmlFor:
|
|
223
|
+
/* @__PURE__ */ l("label", { htmlFor: v, className: "checkbox-wrapper", children: [
|
|
224
224
|
/* @__PURE__ */ e(
|
|
225
225
|
"input",
|
|
226
226
|
{
|
|
227
|
-
id:
|
|
227
|
+
id: v,
|
|
228
228
|
type: "checkbox",
|
|
229
229
|
ref: n,
|
|
230
230
|
className: "checkbox-input",
|
|
231
231
|
checked: u,
|
|
232
232
|
onChange: i,
|
|
233
|
-
...
|
|
233
|
+
...c
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
/* @__PURE__ */ e(
|
|
@@ -256,13 +256,13 @@ const _r = {
|
|
|
256
256
|
label: n,
|
|
257
257
|
error: u,
|
|
258
258
|
disabled: i = !1,
|
|
259
|
-
className:
|
|
259
|
+
className: c,
|
|
260
260
|
...y
|
|
261
261
|
}) => {
|
|
262
|
-
const
|
|
263
|
-
|
|
262
|
+
const v = (x) => {
|
|
263
|
+
x.stopPropagation(), x.preventDefault(), s?.();
|
|
264
264
|
};
|
|
265
|
-
return /* @__PURE__ */ l("div", { className: J("datepicker-wrapper",
|
|
265
|
+
return /* @__PURE__ */ l("div", { className: J("datepicker-wrapper", c), children: [
|
|
266
266
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: n }),
|
|
267
267
|
/* @__PURE__ */ l(Ba, { children: [
|
|
268
268
|
/* @__PURE__ */ e(La, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -287,7 +287,7 @@ const _r = {
|
|
|
287
287
|
"button",
|
|
288
288
|
{
|
|
289
289
|
type: "button",
|
|
290
|
-
onClick:
|
|
290
|
+
onClick: v,
|
|
291
291
|
className: "datepicker-clear-button",
|
|
292
292
|
"aria-label": "Clear selected date",
|
|
293
293
|
children: /* @__PURE__ */ e(ye, { size: 16 })
|
|
@@ -316,17 +316,17 @@ const _r = {
|
|
|
316
316
|
label: n,
|
|
317
317
|
error: u,
|
|
318
318
|
disabled: i = !1,
|
|
319
|
-
className:
|
|
319
|
+
className: c,
|
|
320
320
|
...y
|
|
321
321
|
}) => {
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
}, k =
|
|
325
|
-
Ue(
|
|
322
|
+
const v = t?.from, x = t?.to, a = (h) => {
|
|
323
|
+
h.stopPropagation(), h.preventDefault(), s?.();
|
|
324
|
+
}, k = v && x ? /* @__PURE__ */ l(ee, { children: [
|
|
325
|
+
Ue(v, "MMM d, y"),
|
|
326
326
|
" - ",
|
|
327
|
-
Ue(
|
|
327
|
+
Ue(x, "MMM d, y")
|
|
328
328
|
] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
|
|
329
|
-
return /* @__PURE__ */ l("div", { className: J("datepicker-wrapper",
|
|
329
|
+
return /* @__PURE__ */ l("div", { className: J("datepicker-wrapper", c), children: [
|
|
330
330
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: n }),
|
|
331
331
|
/* @__PURE__ */ l(Ba, { children: [
|
|
332
332
|
/* @__PURE__ */ e(La, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -340,14 +340,14 @@ const _r = {
|
|
|
340
340
|
"datepicker-trigger--disabled": i
|
|
341
341
|
}),
|
|
342
342
|
disabled: i,
|
|
343
|
-
"aria-label":
|
|
343
|
+
"aria-label": v && x ? `Selected range is ${k}` : o,
|
|
344
344
|
children: [
|
|
345
345
|
/* @__PURE__ */ e(va, { className: "datepicker-icon" }),
|
|
346
346
|
/* @__PURE__ */ e("span", { className: "datepicker-value", children: k })
|
|
347
347
|
]
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
|
-
|
|
350
|
+
v && s && !i && /* @__PURE__ */ e(
|
|
351
351
|
"button",
|
|
352
352
|
{
|
|
353
353
|
type: "button",
|
|
@@ -625,17 +625,17 @@ const _r = {
|
|
|
625
625
|
open: u,
|
|
626
626
|
// --- Form and File State ---
|
|
627
627
|
validFiles: i = [],
|
|
628
|
-
rejectedFiles:
|
|
628
|
+
rejectedFiles: c = [],
|
|
629
629
|
handleRemoveValidFile: y,
|
|
630
|
-
handleRemoveRejectedFile:
|
|
631
|
-
handleSubmit:
|
|
630
|
+
handleRemoveRejectedFile: v,
|
|
631
|
+
handleSubmit: x,
|
|
632
632
|
isSubmitting: a,
|
|
633
633
|
formErrors: k,
|
|
634
634
|
// --- UI Text ---
|
|
635
|
-
title:
|
|
635
|
+
title: h = "Upload Files",
|
|
636
636
|
subHeading: g = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
637
637
|
}) => {
|
|
638
|
-
const $ = i.length > 0 ||
|
|
638
|
+
const $ = i.length > 0 || c.length > 0;
|
|
639
639
|
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ l(
|
|
640
640
|
me,
|
|
641
641
|
{
|
|
@@ -674,9 +674,9 @@ const _r = {
|
|
|
674
674
|
onClick: (L) => L.stopPropagation(),
|
|
675
675
|
children: [
|
|
676
676
|
/* @__PURE__ */ e("input", { ...o() }),
|
|
677
|
-
/* @__PURE__ */ l("form", { onSubmit:
|
|
677
|
+
/* @__PURE__ */ l("form", { onSubmit: x, className: "form-wrapper", children: [
|
|
678
678
|
/* @__PURE__ */ l("div", { className: "dialog-header", children: [
|
|
679
|
-
/* @__PURE__ */ e(_e, { as: "h3", className: "dialog-title-text", children:
|
|
679
|
+
/* @__PURE__ */ e(_e, { as: "h3", className: "dialog-title-text", children: h }),
|
|
680
680
|
/* @__PURE__ */ e(
|
|
681
681
|
"button",
|
|
682
682
|
{
|
|
@@ -744,7 +744,7 @@ const _r = {
|
|
|
744
744
|
},
|
|
745
745
|
`${L.name}-${O}`
|
|
746
746
|
)),
|
|
747
|
-
|
|
747
|
+
c.map(({ file: L, message: O }, C) => /* @__PURE__ */ l(
|
|
748
748
|
"li",
|
|
749
749
|
{
|
|
750
750
|
className: "file-item file-item--rejected",
|
|
@@ -766,7 +766,7 @@ const _r = {
|
|
|
766
766
|
"button",
|
|
767
767
|
{
|
|
768
768
|
type: "button",
|
|
769
|
-
onClick: () =>
|
|
769
|
+
onClick: () => v(C),
|
|
770
770
|
className: "remove-file-button",
|
|
771
771
|
children: /* @__PURE__ */ e(Ve, { size: 16 })
|
|
772
772
|
}
|
|
@@ -817,10 +817,10 @@ const _r = {
|
|
|
817
817
|
fetchCreatedOrUpdatedByUsers: i = async () => []
|
|
818
818
|
// Mockable fetcher
|
|
819
819
|
}) => {
|
|
820
|
-
const [
|
|
820
|
+
const [c, y] = B({
|
|
821
821
|
createdBy: [],
|
|
822
822
|
updatedBy: []
|
|
823
|
-
}), [
|
|
823
|
+
}), [v, x] = B({
|
|
824
824
|
createdBy: !1,
|
|
825
825
|
updatedBy: !1
|
|
826
826
|
}), a = yt({
|
|
@@ -828,51 +828,51 @@ const _r = {
|
|
|
828
828
|
// Deep copy
|
|
829
829
|
onSubmit: (C) => {
|
|
830
830
|
const T = {};
|
|
831
|
-
Object.keys(C).forEach((
|
|
832
|
-
T[
|
|
833
|
-
operator: C[
|
|
834
|
-
values: Array.isArray(C[
|
|
835
|
-
range: C[
|
|
831
|
+
Object.keys(C).forEach((I) => {
|
|
832
|
+
T[I] = {
|
|
833
|
+
operator: C[I].operator || "in",
|
|
834
|
+
values: Array.isArray(C[I].values) ? C[I].values : [],
|
|
835
|
+
range: C[I].range || null
|
|
836
836
|
};
|
|
837
837
|
}), console.log("[storybook filter] Applied Filters:", T), typeof s == "function" && s({
|
|
838
838
|
filters: T,
|
|
839
|
-
activeCount:
|
|
839
|
+
activeCount: h
|
|
840
840
|
}), r();
|
|
841
841
|
},
|
|
842
842
|
enableReinitialize: !0
|
|
843
843
|
}), k = ce(() => n.reduce((C, T) => {
|
|
844
|
-
const
|
|
844
|
+
const I = T.key, E = a.values[I];
|
|
845
845
|
let V = !1;
|
|
846
|
-
if (
|
|
846
|
+
if (E)
|
|
847
847
|
switch (T.type) {
|
|
848
848
|
case "multiselect":
|
|
849
849
|
case "multiselect-users":
|
|
850
|
-
V = Array.isArray(
|
|
850
|
+
V = Array.isArray(E.values) && E.values.length > 0;
|
|
851
851
|
break;
|
|
852
852
|
case "date":
|
|
853
|
-
(
|
|
853
|
+
(E.range && E.range !== "" || Array.isArray(E.values) && E.values.length > 0) && (V = !0);
|
|
854
854
|
break;
|
|
855
855
|
}
|
|
856
|
-
return C[
|
|
857
|
-
}, {}), [n, a.values]),
|
|
856
|
+
return C[I] = V, C;
|
|
857
|
+
}, {}), [n, a.values]), h = Object.values(k).filter(Boolean).length, g = async (C, T) => {
|
|
858
858
|
try {
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
y((
|
|
862
|
-
} catch (
|
|
863
|
-
console.error(`Error fetching ${C} users:`,
|
|
859
|
+
x((E) => ({ ...E, [C]: !0 }));
|
|
860
|
+
const I = await i(C, T);
|
|
861
|
+
y((E) => ({ ...E, [C]: I }));
|
|
862
|
+
} catch (I) {
|
|
863
|
+
console.error(`Error fetching ${C} users:`, I);
|
|
864
864
|
} finally {
|
|
865
|
-
|
|
865
|
+
x((I) => ({ ...I, [C]: !1 }));
|
|
866
866
|
}
|
|
867
867
|
}, $ = (C) => {
|
|
868
|
-
const T = n[C].key,
|
|
869
|
-
n[C].type === "multiselect-users" &&
|
|
868
|
+
const T = n[C].key, I = n[C].url;
|
|
869
|
+
n[C].type === "multiselect-users" && c[T].length === 0 && !v[T] && g(T, I);
|
|
870
870
|
}, L = () => {
|
|
871
871
|
a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
|
|
872
872
|
}, O = (C) => {
|
|
873
873
|
const T = n.find((V) => V.key === C);
|
|
874
874
|
if (!T) return null;
|
|
875
|
-
const
|
|
875
|
+
const I = a.values[C] || u[C], E = Array.isArray(I.values) ? I.values : [];
|
|
876
876
|
switch (T.type) {
|
|
877
877
|
case "multiselect":
|
|
878
878
|
return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
|
|
@@ -881,10 +881,10 @@ const _r = {
|
|
|
881
881
|
/* @__PURE__ */ e(
|
|
882
882
|
"select",
|
|
883
883
|
{
|
|
884
|
-
value:
|
|
885
|
-
onChange: (
|
|
884
|
+
value: I.operator || "in",
|
|
885
|
+
onChange: (d) => a.setFieldValue(`${C}.operator`, d.target.value),
|
|
886
886
|
className: "filter-select",
|
|
887
|
-
children: T.operators.map((
|
|
887
|
+
children: T.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
|
|
888
888
|
}
|
|
889
889
|
)
|
|
890
890
|
] }),
|
|
@@ -896,10 +896,10 @@ const _r = {
|
|
|
896
896
|
type: "checkbox",
|
|
897
897
|
id: `select-all-${C}`,
|
|
898
898
|
className: "filter-checkbox-input",
|
|
899
|
-
checked: T.options.length > 0 &&
|
|
900
|
-
onChange: (
|
|
901
|
-
const
|
|
902
|
-
a.setFieldValue(`${C}.values`,
|
|
899
|
+
checked: T.options.length > 0 && E.length === T.options.length,
|
|
900
|
+
onChange: (d) => {
|
|
901
|
+
const m = d.target.checked ? T.options.map((b) => b.value) : [];
|
|
902
|
+
a.setFieldValue(`${C}.values`, m);
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
),
|
|
@@ -912,43 +912,43 @@ const _r = {
|
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
] }),
|
|
915
|
-
T.options.map((
|
|
915
|
+
T.options.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
|
|
916
916
|
/* @__PURE__ */ e(
|
|
917
917
|
"input",
|
|
918
918
|
{
|
|
919
919
|
type: "checkbox",
|
|
920
|
-
id: `${C}-${
|
|
920
|
+
id: `${C}-${d.value}`,
|
|
921
921
|
className: "filter-checkbox-input",
|
|
922
|
-
checked:
|
|
923
|
-
onChange: (
|
|
924
|
-
const
|
|
925
|
-
a.setFieldValue(`${C}.values`,
|
|
922
|
+
checked: E.includes(d.value),
|
|
923
|
+
onChange: (m) => {
|
|
924
|
+
const b = m.target.checked ? [...E, d.value] : E.filter((D) => D !== d.value);
|
|
925
|
+
a.setFieldValue(`${C}.values`, b);
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
),
|
|
929
929
|
/* @__PURE__ */ e(
|
|
930
930
|
"label",
|
|
931
931
|
{
|
|
932
|
-
htmlFor: `${C}-${
|
|
932
|
+
htmlFor: `${C}-${d.value}`,
|
|
933
933
|
className: "filter-checkbox-label",
|
|
934
|
-
children:
|
|
934
|
+
children: d.label
|
|
935
935
|
}
|
|
936
936
|
)
|
|
937
|
-
] },
|
|
937
|
+
] }, d.value))
|
|
938
938
|
] })
|
|
939
939
|
] });
|
|
940
940
|
case "multiselect-users":
|
|
941
|
-
const V =
|
|
941
|
+
const V = c[C] || [], q = v[C];
|
|
942
942
|
return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
|
|
943
943
|
/* @__PURE__ */ l("div", { className: "filter-operator-group", children: [
|
|
944
944
|
/* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
|
|
945
945
|
/* @__PURE__ */ e(
|
|
946
946
|
"select",
|
|
947
947
|
{
|
|
948
|
-
value:
|
|
949
|
-
onChange: (
|
|
948
|
+
value: I.operator || "in",
|
|
949
|
+
onChange: (d) => a.setFieldValue(`${C}.operator`, d.target.value),
|
|
950
950
|
className: "filter-select",
|
|
951
|
-
children: T.operators.map((
|
|
951
|
+
children: T.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
|
|
952
952
|
}
|
|
953
953
|
)
|
|
954
954
|
] }),
|
|
@@ -960,12 +960,12 @@ const _r = {
|
|
|
960
960
|
type: "checkbox",
|
|
961
961
|
id: `select-all-users-${C}`,
|
|
962
962
|
className: "filter-checkbox-input",
|
|
963
|
-
checked: V.length > 0 &&
|
|
964
|
-
onChange: (
|
|
965
|
-
const
|
|
963
|
+
checked: V.length > 0 && E.length === V.length,
|
|
964
|
+
onChange: (d) => {
|
|
965
|
+
const m = d.target.checked ? V.map((b) => b.email) : [];
|
|
966
966
|
a.setFieldValue(
|
|
967
967
|
`${C}.values`,
|
|
968
|
-
|
|
968
|
+
m
|
|
969
969
|
);
|
|
970
970
|
}
|
|
971
971
|
}
|
|
@@ -979,19 +979,19 @@ const _r = {
|
|
|
979
979
|
}
|
|
980
980
|
)
|
|
981
981
|
] }),
|
|
982
|
-
V.map((
|
|
982
|
+
V.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item createdby", children: [
|
|
983
983
|
/* @__PURE__ */ e(
|
|
984
984
|
"input",
|
|
985
985
|
{
|
|
986
986
|
type: "checkbox",
|
|
987
|
-
id: `${C}-${
|
|
987
|
+
id: `${C}-${d.email}`,
|
|
988
988
|
className: "filter-checkbox-input",
|
|
989
|
-
checked:
|
|
990
|
-
onChange: (
|
|
991
|
-
const
|
|
989
|
+
checked: E.includes(d.email),
|
|
990
|
+
onChange: (m) => {
|
|
991
|
+
const b = m.target.checked ? [...E, d.email] : E.filter((D) => D !== d.email);
|
|
992
992
|
a.setFieldValue(
|
|
993
993
|
`${C}.values`,
|
|
994
|
-
|
|
994
|
+
b
|
|
995
995
|
);
|
|
996
996
|
}
|
|
997
997
|
}
|
|
@@ -999,20 +999,20 @@ const _r = {
|
|
|
999
999
|
/* @__PURE__ */ l(
|
|
1000
1000
|
"label",
|
|
1001
1001
|
{
|
|
1002
|
-
htmlFor: `${C}-${
|
|
1002
|
+
htmlFor: `${C}-${d.email}`,
|
|
1003
1003
|
className: "filter-checkbox-label",
|
|
1004
1004
|
children: [
|
|
1005
|
-
/* @__PURE__ */ e("span", { className: "user-label-name", children:
|
|
1006
|
-
/* @__PURE__ */ e("span", { className: "user-label-email", children:
|
|
1005
|
+
/* @__PURE__ */ e("span", { className: "user-label-name", children: d.name }),
|
|
1006
|
+
/* @__PURE__ */ e("span", { className: "user-label-email", children: d.email })
|
|
1007
1007
|
]
|
|
1008
1008
|
}
|
|
1009
1009
|
)
|
|
1010
|
-
] },
|
|
1010
|
+
] }, d.email))
|
|
1011
1011
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1012
1012
|
] });
|
|
1013
1013
|
case "date":
|
|
1014
|
-
const G =
|
|
1015
|
-
startDate:
|
|
1014
|
+
const G = I.values || [], [N, p] = G, f = N && p, w = {
|
|
1015
|
+
startDate: N instanceof Date ? N : /* @__PURE__ */ new Date(),
|
|
1016
1016
|
// Fallback to today
|
|
1017
1017
|
endDate: p instanceof Date ? p : /* @__PURE__ */ new Date(),
|
|
1018
1018
|
// Fallback to today
|
|
@@ -1024,10 +1024,10 @@ const _r = {
|
|
|
1024
1024
|
/* @__PURE__ */ e(
|
|
1025
1025
|
"select",
|
|
1026
1026
|
{
|
|
1027
|
-
value:
|
|
1028
|
-
onChange: (
|
|
1027
|
+
value: I.operator,
|
|
1028
|
+
onChange: (d) => a.setFieldValue(`${C}.operator`, d.target.value),
|
|
1029
1029
|
className: "filter-select",
|
|
1030
|
-
children: T.operators.map((
|
|
1030
|
+
children: T.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Is" : "Is not" }, d))
|
|
1031
1031
|
}
|
|
1032
1032
|
),
|
|
1033
1033
|
f && /* @__PURE__ */ e(
|
|
@@ -1049,11 +1049,11 @@ const _r = {
|
|
|
1049
1049
|
ft.DateRangePicker,
|
|
1050
1050
|
{
|
|
1051
1051
|
ranges: [w],
|
|
1052
|
-
onChange: (
|
|
1053
|
-
const { startDate:
|
|
1052
|
+
onChange: (d) => {
|
|
1053
|
+
const { startDate: m, endDate: b } = d.selection;
|
|
1054
1054
|
a.setFieldValue(`${C}.values`, [
|
|
1055
|
-
|
|
1056
|
-
|
|
1055
|
+
m,
|
|
1056
|
+
b
|
|
1057
1057
|
]);
|
|
1058
1058
|
},
|
|
1059
1059
|
showSelectionPreview: !0,
|
|
@@ -1169,7 +1169,7 @@ const _r = {
|
|
|
1169
1169
|
children: [
|
|
1170
1170
|
"Apply Filters",
|
|
1171
1171
|
" ",
|
|
1172
|
-
|
|
1172
|
+
h > 0 ? `(${h})` : ""
|
|
1173
1173
|
]
|
|
1174
1174
|
}
|
|
1175
1175
|
)
|
|
@@ -1188,9 +1188,9 @@ const _r = {
|
|
|
1188
1188
|
className: u,
|
|
1189
1189
|
ref: i,
|
|
1190
1190
|
// ✅ 'ref' is now received directly as a prop
|
|
1191
|
-
...
|
|
1191
|
+
...c
|
|
1192
1192
|
}) => {
|
|
1193
|
-
const y = r ||
|
|
1193
|
+
const y = r || c.name;
|
|
1194
1194
|
return /* @__PURE__ */ l("div", { className: `input-wrapper ${u || ""}`, children: [
|
|
1195
1195
|
t && /* @__PURE__ */ e("label", { htmlFor: y, className: "input-label", children: t }),
|
|
1196
1196
|
/* @__PURE__ */ l("div", { className: "input-field-container", children: [
|
|
@@ -1205,7 +1205,7 @@ const _r = {
|
|
|
1205
1205
|
"input-field--error": !!n,
|
|
1206
1206
|
"input-field--with-icon": !!o
|
|
1207
1207
|
}),
|
|
1208
|
-
...
|
|
1208
|
+
...c
|
|
1209
1209
|
}
|
|
1210
1210
|
)
|
|
1211
1211
|
] }),
|
|
@@ -1241,14 +1241,14 @@ const _r = {
|
|
|
1241
1241
|
// No default
|
|
1242
1242
|
variant: i = "info",
|
|
1243
1243
|
// 'info', 'warning', 'delete'
|
|
1244
|
-
loading:
|
|
1244
|
+
loading: c = !1,
|
|
1245
1245
|
buttonProps: y = {},
|
|
1246
|
-
size:
|
|
1246
|
+
size: v
|
|
1247
1247
|
// Add size prop
|
|
1248
1248
|
}) => {
|
|
1249
|
-
const
|
|
1249
|
+
const x = ma[i] || ma.info, a = x.icon, k = () => {
|
|
1250
1250
|
r({ primary: !0, secondary: !1 });
|
|
1251
|
-
},
|
|
1251
|
+
}, h = () => {
|
|
1252
1252
|
r({ primary: !1, secondary: !0 });
|
|
1253
1253
|
};
|
|
1254
1254
|
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "modal-dialog", onClose: () => r({}), children: [
|
|
@@ -1275,9 +1275,9 @@ const _r = {
|
|
|
1275
1275
|
leave: "ease-in duration-200",
|
|
1276
1276
|
leaveFrom: "opacity-100 scale-100",
|
|
1277
1277
|
leaveTo: "opacity-0 scale-95",
|
|
1278
|
-
children: /* @__PURE__ */ l(Se, { className:
|
|
1278
|
+
children: /* @__PURE__ */ l(Se, { className: v === "large" ? "modal-panel modal-panel--large" : "modal-panel", children: [
|
|
1279
1279
|
/* @__PURE__ */ l("div", { className: "modal-content-wrapper", children: [
|
|
1280
|
-
/* @__PURE__ */ e("div", { className: `modal-icon-container ${
|
|
1280
|
+
/* @__PURE__ */ e("div", { className: `modal-icon-container ${x.iconClass}`, children: /* @__PURE__ */ e(a, { size: 24, "aria-hidden": "true" }) }),
|
|
1281
1281
|
/* @__PURE__ */ l("div", { className: "modal-text-content", children: [
|
|
1282
1282
|
/* @__PURE__ */ e(_e, { as: "h3", className: "modal-title", children: s }),
|
|
1283
1283
|
/* @__PURE__ */ e("div", { className: "modal-description", children: o })
|
|
@@ -1287,7 +1287,7 @@ const _r = {
|
|
|
1287
1287
|
u && /* @__PURE__ */ e(
|
|
1288
1288
|
H,
|
|
1289
1289
|
{
|
|
1290
|
-
onClick:
|
|
1290
|
+
onClick: h,
|
|
1291
1291
|
label: u,
|
|
1292
1292
|
category: "secondary"
|
|
1293
1293
|
}
|
|
@@ -1313,14 +1313,14 @@ const _r = {
|
|
|
1313
1313
|
onItemsPerPageChange: n,
|
|
1314
1314
|
itemsPerPageOptions: u = [10, 15, 20]
|
|
1315
1315
|
}) => {
|
|
1316
|
-
const i = Math.ceil(r / s), [
|
|
1316
|
+
const i = Math.ceil(r / s), [c, y] = B(t);
|
|
1317
1317
|
X(() => {
|
|
1318
1318
|
y(t);
|
|
1319
1319
|
}, [t]);
|
|
1320
|
-
const
|
|
1320
|
+
const v = Math.min((t - 1) * s + 1, r), x = Math.min(t * s, r), a = (k) => {
|
|
1321
1321
|
k.preventDefault();
|
|
1322
|
-
let
|
|
1323
|
-
isNaN(
|
|
1322
|
+
let h = parseInt(c, 10);
|
|
1323
|
+
isNaN(h) || h < 1 ? h = 1 : h > i && (h = i), y(h), h !== t && o(h);
|
|
1324
1324
|
};
|
|
1325
1325
|
return /* @__PURE__ */ l("div", { className: "pagination-container", children: [
|
|
1326
1326
|
/* @__PURE__ */ l("div", { className: "pagination-left", children: [
|
|
@@ -1336,9 +1336,9 @@ const _r = {
|
|
|
1336
1336
|
}
|
|
1337
1337
|
),
|
|
1338
1338
|
/* @__PURE__ */ l("span", { className: "pagination-info", children: [
|
|
1339
|
-
|
|
1339
|
+
v,
|
|
1340
1340
|
"-",
|
|
1341
|
-
|
|
1341
|
+
x,
|
|
1342
1342
|
" of ",
|
|
1343
1343
|
r,
|
|
1344
1344
|
" items"
|
|
@@ -1370,7 +1370,7 @@ const _r = {
|
|
|
1370
1370
|
{
|
|
1371
1371
|
type: "number",
|
|
1372
1372
|
className: "page-input",
|
|
1373
|
-
value:
|
|
1373
|
+
value: c,
|
|
1374
1374
|
onChange: (k) => y(k.target.value),
|
|
1375
1375
|
onBlur: a,
|
|
1376
1376
|
"aria-label": `Current page, Page ${t}`
|
|
@@ -1422,12 +1422,12 @@ const _r = {
|
|
|
1422
1422
|
ze.Option,
|
|
1423
1423
|
{
|
|
1424
1424
|
value: i.value,
|
|
1425
|
-
className: ({ active:
|
|
1426
|
-
"radiogroup-option--active":
|
|
1425
|
+
className: ({ active: c, checked: y }) => J("radiogroup-option", {
|
|
1426
|
+
"radiogroup-option--active": c,
|
|
1427
1427
|
"radiogroup-option--checked": y,
|
|
1428
1428
|
"radiogroup-option--error": !!n
|
|
1429
1429
|
}),
|
|
1430
|
-
children: ({ checked:
|
|
1430
|
+
children: ({ checked: c }) => /* @__PURE__ */ l(ee, { children: [
|
|
1431
1431
|
/* @__PURE__ */ l("div", { className: "radiogroup-option-content", children: [
|
|
1432
1432
|
/* @__PURE__ */ e(ze.Label, { as: "p", className: "option-label", children: i.label }),
|
|
1433
1433
|
i.description && /* @__PURE__ */ e(
|
|
@@ -1439,7 +1439,7 @@ const _r = {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
)
|
|
1441
1441
|
] }),
|
|
1442
|
-
|
|
1442
|
+
c && /* @__PURE__ */ e("div", { className: "option-checkmark", children: /* @__PURE__ */ e(wt, { size: 20 }) })
|
|
1443
1443
|
] })
|
|
1444
1444
|
},
|
|
1445
1445
|
i.value
|
|
@@ -1457,20 +1457,20 @@ const _r = {
|
|
|
1457
1457
|
customClass: u = "",
|
|
1458
1458
|
...i
|
|
1459
1459
|
}) => {
|
|
1460
|
-
const [
|
|
1460
|
+
const [c, y] = B(t);
|
|
1461
1461
|
X(() => {
|
|
1462
1462
|
y(t);
|
|
1463
1463
|
}, [t]);
|
|
1464
|
-
const
|
|
1464
|
+
const v = K(
|
|
1465
1465
|
vr((a) => {
|
|
1466
1466
|
r?.(a);
|
|
1467
1467
|
}, s),
|
|
1468
1468
|
[s, r]
|
|
1469
1469
|
);
|
|
1470
|
-
X(() => (
|
|
1471
|
-
|
|
1472
|
-
}), [
|
|
1473
|
-
const
|
|
1470
|
+
X(() => (c !== t && v(c), () => {
|
|
1471
|
+
v.cancel();
|
|
1472
|
+
}), [c, v, t]);
|
|
1473
|
+
const x = (a) => {
|
|
1474
1474
|
y(a.target.value);
|
|
1475
1475
|
};
|
|
1476
1476
|
return /* @__PURE__ */ l("div", { className: `search-bar-wrapper ${u}`, children: [
|
|
@@ -1484,8 +1484,8 @@ const _r = {
|
|
|
1484
1484
|
placeholder: o,
|
|
1485
1485
|
type: "search",
|
|
1486
1486
|
name: "search",
|
|
1487
|
-
value:
|
|
1488
|
-
onChange:
|
|
1487
|
+
value: c,
|
|
1488
|
+
onChange: x,
|
|
1489
1489
|
...i
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
@@ -1500,14 +1500,14 @@ const _r = {
|
|
|
1500
1500
|
placeholder: n = "Select an option...",
|
|
1501
1501
|
disabled: u = !1,
|
|
1502
1502
|
error: i,
|
|
1503
|
-
ref:
|
|
1503
|
+
ref: c,
|
|
1504
1504
|
// From RHF's <Controller>
|
|
1505
1505
|
showSearch: y = !0
|
|
1506
1506
|
}) => {
|
|
1507
|
-
const [
|
|
1508
|
-
(
|
|
1509
|
-
), k = o.find((
|
|
1510
|
-
return /* @__PURE__ */ e(Z, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref:
|
|
1507
|
+
const [v, x] = B(""), a = v === "" ? o : o.filter(
|
|
1508
|
+
(h) => h.label.toLowerCase().includes(v.toLowerCase())
|
|
1509
|
+
), k = o.find((h) => r?.id ? h.id === r.id : h.id === r || h.value === r);
|
|
1510
|
+
return /* @__PURE__ */ e(Z, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: c, children: [
|
|
1511
1511
|
t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
|
|
1512
1512
|
/* @__PURE__ */ l("div", { className: "select-button-container", children: [
|
|
1513
1513
|
/* @__PURE__ */ l(
|
|
@@ -1532,24 +1532,24 @@ const _r = {
|
|
|
1532
1532
|
y && /* @__PURE__ */ e("div", { className: "search-input-wrapper", children: /* @__PURE__ */ e(
|
|
1533
1533
|
he,
|
|
1534
1534
|
{
|
|
1535
|
-
value:
|
|
1536
|
-
onDebouncedChange:
|
|
1535
|
+
value: v,
|
|
1536
|
+
onDebouncedChange: x,
|
|
1537
1537
|
placeholder: "Search..."
|
|
1538
1538
|
}
|
|
1539
1539
|
) }),
|
|
1540
|
-
/* @__PURE__ */ e("div", { className: "select-options-list", children: a.length === 0 &&
|
|
1540
|
+
/* @__PURE__ */ e("div", { className: "select-options-list", children: a.length === 0 && v !== "" ? /* @__PURE__ */ e("div", { className: "no-results", children: "No results found." }) : a.map((h) => /* @__PURE__ */ e(
|
|
1541
1541
|
ur,
|
|
1542
1542
|
{
|
|
1543
1543
|
className: ({ active: g }) => `select-option ${g ? "active" : ""}`,
|
|
1544
|
-
value:
|
|
1544
|
+
value: h,
|
|
1545
1545
|
children: ({ selected: g }) => /* @__PURE__ */ l(ee, { children: [
|
|
1546
1546
|
/* @__PURE__ */ l("div", { className: "option-content", children: [
|
|
1547
|
-
|
|
1547
|
+
h.icon && /* @__PURE__ */ e(h.icon, { className: "option-icon" }),
|
|
1548
1548
|
/* @__PURE__ */ e(
|
|
1549
1549
|
"span",
|
|
1550
1550
|
{
|
|
1551
1551
|
className: `option-label ${g ? "selected" : ""}`,
|
|
1552
|
-
children:
|
|
1552
|
+
children: h.label
|
|
1553
1553
|
}
|
|
1554
1554
|
)
|
|
1555
1555
|
] }),
|
|
@@ -1562,7 +1562,7 @@ const _r = {
|
|
|
1562
1562
|
) : null
|
|
1563
1563
|
] })
|
|
1564
1564
|
},
|
|
1565
|
-
|
|
1565
|
+
h.id || h.value || h.label
|
|
1566
1566
|
)) })
|
|
1567
1567
|
] })
|
|
1568
1568
|
}
|
|
@@ -1586,18 +1586,18 @@ const _r = {
|
|
|
1586
1586
|
return s;
|
|
1587
1587
|
return null;
|
|
1588
1588
|
}, Va = ({ item: t, isCollapsed: r, level: s = 0 }) => {
|
|
1589
|
-
const { pathname: o } = Hr(), n = t.href || t.url || t.path, [u, i] = B(!1),
|
|
1589
|
+
const { pathname: o } = Hr(), n = t.href || t.url || t.path, [u, i] = B(!1), c = t.icon;
|
|
1590
1590
|
X(() => {
|
|
1591
1591
|
na([t], o) && i(!0);
|
|
1592
1592
|
}, [t, o]);
|
|
1593
|
-
const y = o === n,
|
|
1593
|
+
const y = o === n, v = !y && !!na([t], o), x = (a) => {
|
|
1594
1594
|
a.preventDefault(), i(!u);
|
|
1595
1595
|
};
|
|
1596
1596
|
return /* @__PURE__ */ l(
|
|
1597
1597
|
"div",
|
|
1598
1598
|
{
|
|
1599
1599
|
className: J("nav-item-container", {
|
|
1600
|
-
"nav-item-container--parent-active":
|
|
1600
|
+
"nav-item-container--parent-active": v,
|
|
1601
1601
|
[`nav-item-container--level-${s}`]: s > 0
|
|
1602
1602
|
}),
|
|
1603
1603
|
children: [
|
|
@@ -1613,13 +1613,13 @@ const _r = {
|
|
|
1613
1613
|
}),
|
|
1614
1614
|
"aria-current": y ? "page" : void 0,
|
|
1615
1615
|
children: [
|
|
1616
|
-
|
|
1616
|
+
c && /* @__PURE__ */ e(c, { className: "nav-icon", "aria-hidden": "true" }),
|
|
1617
1617
|
/* @__PURE__ */ e("span", { className: "nav-label", children: t.label || t.name }),
|
|
1618
1618
|
t.children && /* @__PURE__ */ e(
|
|
1619
1619
|
"button",
|
|
1620
1620
|
{
|
|
1621
1621
|
className: "nav-chevron-button",
|
|
1622
|
-
onClick:
|
|
1622
|
+
onClick: x,
|
|
1623
1623
|
"aria-expanded": u,
|
|
1624
1624
|
"aria-label": u ? "Collapse menu" : "Expand menu",
|
|
1625
1625
|
children: /* @__PURE__ */ e(
|
|
@@ -1665,7 +1665,7 @@ const _r = {
|
|
|
1665
1665
|
onToggleMobile: n,
|
|
1666
1666
|
logoSmall: u,
|
|
1667
1667
|
logoLarge: i,
|
|
1668
|
-
user:
|
|
1668
|
+
user: c = { name: "", email: "" }
|
|
1669
1669
|
}) => /* @__PURE__ */ l(ee, { children: [
|
|
1670
1670
|
o && /* @__PURE__ */ e(
|
|
1671
1671
|
"div",
|
|
@@ -1710,10 +1710,10 @@ const _r = {
|
|
|
1710
1710
|
] }),
|
|
1711
1711
|
/* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((y) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(Va, { item: y, isCollapsed: r }) }, y.label || y.name)) }) }),
|
|
1712
1712
|
/* @__PURE__ */ l("div", { className: "sidebar-footer", children: [
|
|
1713
|
-
/* @__PURE__ */ e(za, { src:
|
|
1713
|
+
/* @__PURE__ */ e(za, { src: c.avatar, name: c.name, size: "medium" }),
|
|
1714
1714
|
/* @__PURE__ */ l("div", { className: "user-info", children: [
|
|
1715
|
-
/* @__PURE__ */ e("span", { className: "user-name", children:
|
|
1716
|
-
/* @__PURE__ */ e("span", { className: "user-email", children:
|
|
1715
|
+
/* @__PURE__ */ e("span", { className: "user-name", children: c.name }),
|
|
1716
|
+
/* @__PURE__ */ e("span", { className: "user-email", children: c.email })
|
|
1717
1717
|
] }),
|
|
1718
1718
|
/* @__PURE__ */ e(
|
|
1719
1719
|
"button",
|
|
@@ -1774,13 +1774,13 @@ const _r = {
|
|
|
1774
1774
|
// ✅ New prop for max length
|
|
1775
1775
|
showCharCount: i = !1,
|
|
1776
1776
|
// ✅ New prop to control visibility
|
|
1777
|
-
...
|
|
1777
|
+
...c
|
|
1778
1778
|
}) => {
|
|
1779
|
-
const y = r ||
|
|
1780
|
-
|
|
1781
|
-
), a = (
|
|
1782
|
-
|
|
1783
|
-
}, k = u -
|
|
1779
|
+
const y = r || c.name, [v, x] = B(
|
|
1780
|
+
c.value?.length || c.defaultValue?.length || 0
|
|
1781
|
+
), a = (h) => {
|
|
1782
|
+
x(h.target.value.length), c.onChange && c.onChange(h);
|
|
1783
|
+
}, k = u - v;
|
|
1784
1784
|
return /* @__PURE__ */ l("div", { className: `textarea-wrapper ${o || ""}`, children: [
|
|
1785
1785
|
/* @__PURE__ */ l("div", { className: "textarea-header", children: [
|
|
1786
1786
|
t && /* @__PURE__ */ e("label", { htmlFor: y, className: "textarea-label", children: t }),
|
|
@@ -1799,7 +1799,7 @@ const _r = {
|
|
|
1799
1799
|
}),
|
|
1800
1800
|
maxLength: u,
|
|
1801
1801
|
onChange: a,
|
|
1802
|
-
...
|
|
1802
|
+
...c
|
|
1803
1803
|
}
|
|
1804
1804
|
),
|
|
1805
1805
|
s && /* @__PURE__ */ e("p", { className: "textarea-error-message", children: s })
|
|
@@ -1843,13 +1843,13 @@ const _r = {
|
|
|
1843
1843
|
// For external styling of the tooltip itself
|
|
1844
1844
|
...i
|
|
1845
1845
|
}) => {
|
|
1846
|
-
const
|
|
1846
|
+
const c = ae.useId();
|
|
1847
1847
|
return /* @__PURE__ */ l(ee, { children: [
|
|
1848
|
-
ae.cloneElement(t, { "data-tooltip-id":
|
|
1848
|
+
ae.cloneElement(t, { "data-tooltip-id": c }),
|
|
1849
1849
|
/* @__PURE__ */ e(
|
|
1850
1850
|
Dt,
|
|
1851
1851
|
{
|
|
1852
|
-
id:
|
|
1852
|
+
id: c,
|
|
1853
1853
|
content: r,
|
|
1854
1854
|
place: n,
|
|
1855
1855
|
variant: s,
|
|
@@ -1879,17 +1879,17 @@ const _r = {
|
|
|
1879
1879
|
direction: n = 1,
|
|
1880
1880
|
stepProps: u = {},
|
|
1881
1881
|
title: i,
|
|
1882
|
-
description:
|
|
1882
|
+
description: c,
|
|
1883
1883
|
showProgress: y = !0,
|
|
1884
|
-
closeOnOverlayClick:
|
|
1884
|
+
closeOnOverlayClick: v = !0
|
|
1885
1885
|
}) => {
|
|
1886
|
-
const
|
|
1886
|
+
const x = s[o], a = Object.keys(s), k = a.indexOf(o), h = (k + 1) / a.length * 100, g = k > 0 && u.onBack;
|
|
1887
1887
|
return /* @__PURE__ */ e(oe, { show: t, as: Q, children: /* @__PURE__ */ l(
|
|
1888
1888
|
me,
|
|
1889
1889
|
{
|
|
1890
1890
|
as: "div",
|
|
1891
1891
|
className: "wizard-dialog",
|
|
1892
|
-
onClose:
|
|
1892
|
+
onClose: v ? r : () => {
|
|
1893
1893
|
},
|
|
1894
1894
|
children: [
|
|
1895
1895
|
/* @__PURE__ */ e(
|
|
@@ -1924,12 +1924,12 @@ const _r = {
|
|
|
1924
1924
|
onClick: u.onBack,
|
|
1925
1925
|
className: "wizard-back-button",
|
|
1926
1926
|
"aria-label": "Go back to previous step",
|
|
1927
|
-
children: /* @__PURE__ */ e(
|
|
1927
|
+
children: /* @__PURE__ */ e(Ft, { size: 20 })
|
|
1928
1928
|
}
|
|
1929
1929
|
),
|
|
1930
1930
|
/* @__PURE__ */ l("div", { className: "wizard-header-text", children: [
|
|
1931
1931
|
/* @__PURE__ */ e(me.Title, { as: "h3", className: "wizard-title", children: i }),
|
|
1932
|
-
|
|
1932
|
+
c && /* @__PURE__ */ e(me.Description, { className: "wizard-description", children: c })
|
|
1933
1933
|
] })
|
|
1934
1934
|
] }),
|
|
1935
1935
|
/* @__PURE__ */ e(
|
|
@@ -1946,7 +1946,7 @@ const _r = {
|
|
|
1946
1946
|
"div",
|
|
1947
1947
|
{
|
|
1948
1948
|
className: "wizard-progress-bar",
|
|
1949
|
-
style: { width: `${
|
|
1949
|
+
style: { width: `${h}%` }
|
|
1950
1950
|
}
|
|
1951
1951
|
) }),
|
|
1952
1952
|
/* @__PURE__ */ e("div", { className: "wizard-body", children: /* @__PURE__ */ e(
|
|
@@ -1970,7 +1970,7 @@ const _r = {
|
|
|
1970
1970
|
},
|
|
1971
1971
|
className: "wizard-step-motion-wrapper",
|
|
1972
1972
|
style: { overflowX: "hidden" },
|
|
1973
|
-
children:
|
|
1973
|
+
children: x && /* @__PURE__ */ e(x, { ...u })
|
|
1974
1974
|
},
|
|
1975
1975
|
o
|
|
1976
1976
|
)
|
|
@@ -1991,7 +1991,7 @@ const _r = {
|
|
|
1991
1991
|
tertiary: u,
|
|
1992
1992
|
fullHeight: i = !1,
|
|
1993
1993
|
// A clearer prop name
|
|
1994
|
-
...
|
|
1994
|
+
...c
|
|
1995
1995
|
}) => {
|
|
1996
1996
|
const y = J(
|
|
1997
1997
|
"page-layout",
|
|
@@ -1999,9 +1999,9 @@ const _r = {
|
|
|
1999
1999
|
"page-layout--with-footer": r,
|
|
2000
2000
|
"page-layout--full-height": i
|
|
2001
2001
|
},
|
|
2002
|
-
|
|
2002
|
+
c.className
|
|
2003
2003
|
);
|
|
2004
|
-
return /* @__PURE__ */ l("div", { className: y, ...
|
|
2004
|
+
return /* @__PURE__ */ l("div", { className: y, ...c, children: [
|
|
2005
2005
|
/* @__PURE__ */ e("div", { className: "page-layout-content", children: t }),
|
|
2006
2006
|
r && /* @__PURE__ */ e("footer", { className: "page-layout-footer", children: s || /* @__PURE__ */ l("div", { className: "footer-actions", children: [
|
|
2007
2007
|
u?.show && /* @__PURE__ */ e(
|
|
@@ -2056,7 +2056,7 @@ const _r = {
|
|
|
2056
2056
|
] }), an = ({
|
|
2057
2057
|
options: t = [],
|
|
2058
2058
|
onSelect: r,
|
|
2059
|
-
triggerIcon: s =
|
|
2059
|
+
triggerIcon: s = $t
|
|
2060
2060
|
}) => {
|
|
2061
2061
|
const { refs: o, floatingStyles: n } = Ta({
|
|
2062
2062
|
whileElementsMounted: Ia,
|
|
@@ -2256,13 +2256,13 @@ function ha() {
|
|
|
2256
2256
|
}
|
|
2257
2257
|
function cn(t) {
|
|
2258
2258
|
if (t && t.isAxiosError) {
|
|
2259
|
-
const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null, i = r?.data ?? null,
|
|
2259
|
+
const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null, i = r?.data ?? null, c = typeof i == "string" && i || i?.message || i?.msg || i?.error || i?.errors?.[0]?.message || null;
|
|
2260
2260
|
return {
|
|
2261
2261
|
ok: !1,
|
|
2262
2262
|
status: n,
|
|
2263
2263
|
statusText: u,
|
|
2264
2264
|
code: i?.code || null,
|
|
2265
|
-
message:
|
|
2265
|
+
message: c || o || "Request failed",
|
|
2266
2266
|
details: i || null,
|
|
2267
2267
|
request: {
|
|
2268
2268
|
url: s?.url || null,
|
|
@@ -2293,41 +2293,41 @@ function dn({
|
|
|
2293
2293
|
// timeout: 20000,
|
|
2294
2294
|
});
|
|
2295
2295
|
s.interceptors.response.use(
|
|
2296
|
-
(
|
|
2297
|
-
message:
|
|
2296
|
+
(v) => v?.data ?? {
|
|
2297
|
+
message: v?.statusText || "Request succeeded"
|
|
2298
2298
|
},
|
|
2299
|
-
(
|
|
2300
|
-
const
|
|
2301
|
-
return t && (a === 401 || a === 403) && (window.location.href.includes("/login") || (window.historyPath = window.location.pathname, localStorage.clear(), sessionStorage.clear(), window.location.href = "/login")), Promise.reject(
|
|
2299
|
+
(v) => {
|
|
2300
|
+
const x = cn(v), a = x.status;
|
|
2301
|
+
return t && (a === 401 || a === 403) && (window.location.href.includes("/login") || (window.historyPath = window.location.pathname, localStorage.clear(), sessionStorage.clear(), window.location.href = "/login")), Promise.reject(x);
|
|
2302
2302
|
}
|
|
2303
2303
|
);
|
|
2304
|
-
function o({ open:
|
|
2305
|
-
if (
|
|
2304
|
+
function o({ open: v = !1, customHeader: x = {} } = {}) {
|
|
2305
|
+
if (v) {
|
|
2306
2306
|
const { Authorization: a, ...k } = ha();
|
|
2307
2307
|
return {
|
|
2308
|
-
headers: { ...k, ...r, ...
|
|
2308
|
+
headers: { ...k, ...r, ...x }
|
|
2309
2309
|
};
|
|
2310
2310
|
}
|
|
2311
|
-
return { headers: { ...ha(), ...
|
|
2311
|
+
return { headers: { ...ha(), ...x } };
|
|
2312
2312
|
}
|
|
2313
|
-
async function n(
|
|
2314
|
-
return s.get(
|
|
2315
|
-
params:
|
|
2313
|
+
async function n(v, x, a = !1, k = {}) {
|
|
2314
|
+
return s.get(v, {
|
|
2315
|
+
params: x,
|
|
2316
2316
|
...o({ open: a, customHeader: k })
|
|
2317
2317
|
});
|
|
2318
2318
|
}
|
|
2319
|
-
async function u(
|
|
2320
|
-
const
|
|
2321
|
-
return
|
|
2319
|
+
async function u(v, x, a = !1, k = {}) {
|
|
2320
|
+
const h = { ...o({ open: a, customHeader: k }) };
|
|
2321
|
+
return x !== void 0 && (h.data = x), s.delete(v, h);
|
|
2322
2322
|
}
|
|
2323
|
-
async function i(
|
|
2324
|
-
return s.post(
|
|
2323
|
+
async function i(v, x = {}, a = !1, k = {}) {
|
|
2324
|
+
return s.post(v, x, o({ open: a, customHeader: k }));
|
|
2325
2325
|
}
|
|
2326
|
-
async function
|
|
2327
|
-
return s.put(
|
|
2326
|
+
async function c(v, x = {}, a = !1, k = {}) {
|
|
2327
|
+
return s.put(v, x, o({ open: a, customHeader: k }));
|
|
2328
2328
|
}
|
|
2329
|
-
async function y(
|
|
2330
|
-
return s.patch(
|
|
2329
|
+
async function y(v, x = {}, a = !1, k = {}) {
|
|
2330
|
+
return s.patch(v, x, o({ open: a, customHeader: k }));
|
|
2331
2331
|
}
|
|
2332
2332
|
return {
|
|
2333
2333
|
instance: s,
|
|
@@ -2335,7 +2335,7 @@ function dn({
|
|
|
2335
2335
|
axiosGet: n,
|
|
2336
2336
|
axiosDelete: u,
|
|
2337
2337
|
axiosPost: i,
|
|
2338
|
-
axiosPut:
|
|
2338
|
+
axiosPut: c,
|
|
2339
2339
|
axiosPatch: y
|
|
2340
2340
|
};
|
|
2341
2341
|
}
|
|
@@ -2446,9 +2446,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2446
2446
|
}) => {
|
|
2447
2447
|
const n = t.slice(0, 2), u = [];
|
|
2448
2448
|
t.length > 0 && u.push(t[0].name), r.length > 0 && u.push(r[0].name), s.length > 0 && u.length < 2 && u.push(s[0].name);
|
|
2449
|
-
const i = t.length + r.length + s.length,
|
|
2449
|
+
const i = t.length + r.length + s.length, c = i - u.length;
|
|
2450
2450
|
let y = u.join(", ");
|
|
2451
|
-
return
|
|
2451
|
+
return c > 0 && (y += ` and ${c} others`), i === 0 ? /* @__PURE__ */ e(
|
|
2452
2452
|
"div",
|
|
2453
2453
|
{
|
|
2454
2454
|
className: "flex items-center justify-between p-3 border border-dashed border-gray-400 rounded-lg hover:bg-gray-50",
|
|
@@ -2461,15 +2461,15 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2461
2461
|
className: "flex items-center justify-between p-3 border border-gray-300 rounded-lg hover:bg-gray-50 hover:cursor-pointer transition-colors duration-150",
|
|
2462
2462
|
children: [
|
|
2463
2463
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
2464
|
-
/* @__PURE__ */ e("div", { className: "flex items-center", children: n.map((
|
|
2464
|
+
/* @__PURE__ */ e("div", { className: "flex items-center", children: n.map((v, x) => /* @__PURE__ */ e(
|
|
2465
2465
|
"img",
|
|
2466
2466
|
{
|
|
2467
|
-
src:
|
|
2468
|
-
alt:
|
|
2469
|
-
className: `w-10 h-10 rounded-full border-2 border-white ${
|
|
2470
|
-
style: { zIndex:
|
|
2467
|
+
src: v.avatarUrl || `https://avatar.vercel.sh/${v.name}.svg?text=${v?.name?.charAt(0) || "U"}`,
|
|
2468
|
+
alt: v.name,
|
|
2469
|
+
className: `w-10 h-10 rounded-full border-2 border-white ${x > 0 ? "-ml-4" : ""}`,
|
|
2470
|
+
style: { zIndex: x }
|
|
2471
2471
|
},
|
|
2472
|
-
|
|
2472
|
+
v.id || x
|
|
2473
2473
|
)) }),
|
|
2474
2474
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-800 truncate", children: y })
|
|
2475
2475
|
] }),
|
|
@@ -2495,44 +2495,44 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2495
2495
|
showExistingShares: u = !1,
|
|
2496
2496
|
onFinalSubmit: i = () => {
|
|
2497
2497
|
},
|
|
2498
|
-
isChanged:
|
|
2498
|
+
isChanged: c = !1
|
|
2499
2499
|
}) => {
|
|
2500
|
-
const [y,
|
|
2501
|
-
control:
|
|
2500
|
+
const [y, v] = B(ga[0]), [x, a] = B(""), k = oa(x, 400), [h, g] = B([]), [$, L] = B(/* @__PURE__ */ new Set()), [O, C] = B(!1), [T, I] = B(ya[0]), {
|
|
2501
|
+
control: E,
|
|
2502
2502
|
handleSubmit: V,
|
|
2503
2503
|
watch: q,
|
|
2504
|
-
formState: { errors: G, isSubmitting:
|
|
2504
|
+
formState: { errors: G, isSubmitting: N }
|
|
2505
2505
|
} = zt({
|
|
2506
2506
|
defaultValues: { pendingInvites: [] },
|
|
2507
2507
|
resolver: Lt(yn)
|
|
2508
|
-
}), { fields: p, append: f, remove: w, update:
|
|
2509
|
-
control:
|
|
2508
|
+
}), { fields: p, append: f, remove: w, update: d } = Pt({
|
|
2509
|
+
control: E,
|
|
2510
2510
|
name: "pendingInvites"
|
|
2511
|
-
}),
|
|
2511
|
+
}), m = q("pendingInvites");
|
|
2512
2512
|
X(() => {
|
|
2513
|
-
k.length > 1 ? (C(!0), hn(y.name, k).then((
|
|
2514
|
-
g(
|
|
2515
|
-
}).catch((
|
|
2513
|
+
k.length > 1 ? (C(!0), hn(y.name, k).then((F) => {
|
|
2514
|
+
g(F);
|
|
2515
|
+
}).catch((F) => console.error("Search failed:", F)).finally(() => C(!1))) : (g([]), L(/* @__PURE__ */ new Set()));
|
|
2516
2516
|
}, [k, y]);
|
|
2517
|
-
const
|
|
2517
|
+
const b = (F) => {
|
|
2518
2518
|
L((z) => {
|
|
2519
2519
|
const U = new Set(z);
|
|
2520
|
-
return U.has(
|
|
2520
|
+
return U.has(F) ? U.delete(F) : U.add(F), U;
|
|
2521
2521
|
});
|
|
2522
|
-
},
|
|
2523
|
-
|
|
2524
|
-
p.find((z) => z.id ===
|
|
2522
|
+
}, D = () => {
|
|
2523
|
+
h.filter((F) => $.has(F.id)).forEach((F) => {
|
|
2524
|
+
p.find((z) => z.id === F.id) || f({ ...F, permission: T.name });
|
|
2525
2525
|
}), L(/* @__PURE__ */ new Set()), a("");
|
|
2526
|
-
},
|
|
2527
|
-
|
|
2528
|
-
(z, U) =>
|
|
2526
|
+
}, R = (F) => {
|
|
2527
|
+
I(F), p.forEach(
|
|
2528
|
+
(z, U) => d(U, { ...p[U], permission: F.name })
|
|
2529
2529
|
);
|
|
2530
|
-
}, j = async (
|
|
2530
|
+
}, j = async (F) => {
|
|
2531
2531
|
try {
|
|
2532
2532
|
if (n === se.DRIVE) {
|
|
2533
2533
|
const z = {
|
|
2534
2534
|
entity: t,
|
|
2535
|
-
userGroupRolesObj:
|
|
2535
|
+
userGroupRolesObj: F.pendingInvites.map((U) => ({
|
|
2536
2536
|
id: U.id,
|
|
2537
2537
|
permission: U.permission,
|
|
2538
2538
|
type: U.type.toLowerCase()
|
|
@@ -2540,7 +2540,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2540
2540
|
};
|
|
2541
2541
|
i(z, o);
|
|
2542
2542
|
} else if (n === se.INTEREST) {
|
|
2543
|
-
const z =
|
|
2543
|
+
const z = F.pendingInvites.map((U) => ({
|
|
2544
2544
|
identity: U.id,
|
|
2545
2545
|
type: U.type.toLowerCase(),
|
|
2546
2546
|
opt: !0,
|
|
@@ -2553,7 +2553,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2553
2553
|
} else if (n === se.ARTICLE) {
|
|
2554
2554
|
const z = {
|
|
2555
2555
|
entity: t,
|
|
2556
|
-
userGroupRolesObj:
|
|
2556
|
+
userGroupRolesObj: F.pendingInvites.map((U) => ({
|
|
2557
2557
|
id: U.id,
|
|
2558
2558
|
permission: U.permission,
|
|
2559
2559
|
type: U.type.toLowerCase()
|
|
@@ -2561,15 +2561,15 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2561
2561
|
};
|
|
2562
2562
|
i(z, o);
|
|
2563
2563
|
} else
|
|
2564
|
-
i(
|
|
2564
|
+
i(F, o);
|
|
2565
2565
|
setTimeout(() => {
|
|
2566
2566
|
s();
|
|
2567
2567
|
}, 1e3);
|
|
2568
2568
|
} catch (z) {
|
|
2569
2569
|
throw console.error("Failed to submit invites:", z), z;
|
|
2570
2570
|
}
|
|
2571
|
-
}, S = (
|
|
2572
|
-
const z = o[y.code].find((U) => U.name ===
|
|
2571
|
+
}, S = (F) => {
|
|
2572
|
+
const z = o[y.code].find((U) => U.name === F.name && U.permission !== "remove") || m.find((U) => U.name === F.name);
|
|
2573
2573
|
return z ? `${z.permission}` : "";
|
|
2574
2574
|
}, A = () => {
|
|
2575
2575
|
switch (n) {
|
|
@@ -2582,7 +2582,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2582
2582
|
default:
|
|
2583
2583
|
return "Add User, Groups or Roles test";
|
|
2584
2584
|
}
|
|
2585
|
-
}, M = ce(() =>
|
|
2585
|
+
}, M = ce(() => (console.log("InviteFlow - isChanged:", c, "pendingInvites.length:", m.length), m.length === 0 && !c), [m.length, c]);
|
|
2586
2586
|
return /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2587
2587
|
/* @__PURE__ */ l("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2588
2588
|
/* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: A() }),
|
|
@@ -2605,14 +2605,14 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2605
2605
|
(n === se.DRIVE || u) && /* @__PURE__ */ e(
|
|
2606
2606
|
gn,
|
|
2607
2607
|
{
|
|
2608
|
-
users: o.users.filter((
|
|
2609
|
-
groups: o.groups.filter((
|
|
2610
|
-
roles: o.roles.filter((
|
|
2608
|
+
users: o.users.filter((F) => F.permission !== "remove"),
|
|
2609
|
+
groups: o.groups.filter((F) => F.permission !== "remove"),
|
|
2610
|
+
roles: o.roles.filter((F) => F.permission !== "remove"),
|
|
2611
2611
|
onClick: r
|
|
2612
2612
|
}
|
|
2613
2613
|
),
|
|
2614
2614
|
/* @__PURE__ */ l("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
|
|
2615
|
-
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(Z, { value: y, onChange:
|
|
2615
|
+
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(Z, { value: y, onChange: v, children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2616
2616
|
/* @__PURE__ */ l(Z.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: [
|
|
2617
2617
|
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
2618
2618
|
/* @__PURE__ */ e(y.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
@@ -2627,10 +2627,10 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2627
2627
|
leave: "transition ease-in duration-100",
|
|
2628
2628
|
leaveFrom: "opacity-100",
|
|
2629
2629
|
leaveTo: "opacity-0",
|
|
2630
|
-
children: /* @__PURE__ */ e(Z.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: ga.map((
|
|
2630
|
+
children: /* @__PURE__ */ e(Z.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: ga.map((F) => /* @__PURE__ */ e(
|
|
2631
2631
|
Z.Option,
|
|
2632
2632
|
{
|
|
2633
|
-
value:
|
|
2633
|
+
value: F,
|
|
2634
2634
|
className: ({ active: z }) => `${z ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2635
2635
|
children: ({ selected: z }) => /* @__PURE__ */ l(ee, { children: [
|
|
2636
2636
|
/* @__PURE__ */ l(
|
|
@@ -2639,19 +2639,19 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2639
2639
|
className: `${z ? "font-medium" : "font-normal"} flex items-center`,
|
|
2640
2640
|
children: [
|
|
2641
2641
|
/* @__PURE__ */ e(
|
|
2642
|
-
|
|
2642
|
+
F.icon,
|
|
2643
2643
|
{
|
|
2644
2644
|
className: `h-5 w-5 mr-2 ${z ? "text-white" : "text-gray-400"}`
|
|
2645
2645
|
}
|
|
2646
2646
|
),
|
|
2647
|
-
|
|
2647
|
+
F.name
|
|
2648
2648
|
]
|
|
2649
2649
|
}
|
|
2650
2650
|
),
|
|
2651
2651
|
z && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-white", children: /* @__PURE__ */ e(ta, { className: "h-5 w-5" }) })
|
|
2652
2652
|
] })
|
|
2653
2653
|
},
|
|
2654
|
-
|
|
2654
|
+
F.id
|
|
2655
2655
|
)) })
|
|
2656
2656
|
}
|
|
2657
2657
|
)
|
|
@@ -2660,11 +2660,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2660
2660
|
he,
|
|
2661
2661
|
{
|
|
2662
2662
|
placeholder: `Search by ${y.name.toLowerCase()}...`,
|
|
2663
|
-
onDebouncedChange: (
|
|
2664
|
-
value:
|
|
2663
|
+
onDebouncedChange: (F) => a(F),
|
|
2664
|
+
value: x
|
|
2665
2665
|
}
|
|
2666
2666
|
) }),
|
|
2667
|
-
/* @__PURE__ */ e(be, { children: (
|
|
2667
|
+
/* @__PURE__ */ e(be, { children: (h?.length > 0 || O) && /* @__PURE__ */ e(
|
|
2668
2668
|
ne.div,
|
|
2669
2669
|
{
|
|
2670
2670
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2673,19 +2673,19 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2673
2673
|
transition: { duration: 0.2 },
|
|
2674
2674
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2675
2675
|
children: O ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(ee, { children: [
|
|
2676
|
-
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children:
|
|
2677
|
-
const z = S(
|
|
2676
|
+
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: h.map((F) => {
|
|
2677
|
+
const z = S(F);
|
|
2678
2678
|
return /* @__PURE__ */ l(
|
|
2679
2679
|
"div",
|
|
2680
2680
|
{
|
|
2681
|
-
onClick: () => z ? null :
|
|
2681
|
+
onClick: () => z ? null : b(F.id),
|
|
2682
2682
|
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${z ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2683
2683
|
children: [
|
|
2684
2684
|
/* @__PURE__ */ e(
|
|
2685
2685
|
"input",
|
|
2686
2686
|
{
|
|
2687
2687
|
type: "checkbox",
|
|
2688
|
-
checked: $.has(
|
|
2688
|
+
checked: $.has(F.id),
|
|
2689
2689
|
readOnly: !0,
|
|
2690
2690
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
|
|
2691
2691
|
disabled: !!z
|
|
@@ -2694,19 +2694,19 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2694
2694
|
/* @__PURE__ */ e(
|
|
2695
2695
|
"img",
|
|
2696
2696
|
{
|
|
2697
|
-
src:
|
|
2698
|
-
alt:
|
|
2697
|
+
src: F.avatarUrl || `https://avatar.vercel.sh/${F.name}.svg?text=${F.name.charAt(0)}`,
|
|
2698
|
+
alt: F.name,
|
|
2699
2699
|
className: "w-8 h-8 rounded-full"
|
|
2700
2700
|
}
|
|
2701
2701
|
),
|
|
2702
|
-
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children:
|
|
2702
|
+
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: F.name }),
|
|
2703
2703
|
z ? /* @__PURE__ */ l(ee, { children: [
|
|
2704
2704
|
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children: z }),
|
|
2705
2705
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
|
|
2706
2706
|
] }) : ""
|
|
2707
2707
|
]
|
|
2708
2708
|
},
|
|
2709
|
-
|
|
2709
|
+
F.id
|
|
2710
2710
|
);
|
|
2711
2711
|
}) }),
|
|
2712
2712
|
/* @__PURE__ */ l("div", { className: "flex justify-end gap-2 p-2 border-t border-gray-300", children: [
|
|
@@ -2721,7 +2721,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2721
2721
|
/* @__PURE__ */ e(
|
|
2722
2722
|
"button",
|
|
2723
2723
|
{
|
|
2724
|
-
onClick:
|
|
2724
|
+
onClick: D,
|
|
2725
2725
|
disabled: $.size === 0,
|
|
2726
2726
|
className: "px-3 py-1 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed hover:cursor-pointer",
|
|
2727
2727
|
children: "Add"
|
|
@@ -2749,7 +2749,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2749
2749
|
Z,
|
|
2750
2750
|
{
|
|
2751
2751
|
value: T,
|
|
2752
|
-
onChange:
|
|
2752
|
+
onChange: R,
|
|
2753
2753
|
children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2754
2754
|
/* @__PURE__ */ l(Z.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2755
2755
|
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
@@ -2768,10 +2768,10 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2768
2768
|
leave: "transition ease-in duration-100",
|
|
2769
2769
|
leaveFrom: "opacity-100",
|
|
2770
2770
|
leaveTo: "opacity-0",
|
|
2771
|
-
children: /* @__PURE__ */ e(Z.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: ya.map((
|
|
2771
|
+
children: /* @__PURE__ */ e(Z.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: ya.map((F) => /* @__PURE__ */ e(
|
|
2772
2772
|
Z.Option,
|
|
2773
2773
|
{
|
|
2774
|
-
value:
|
|
2774
|
+
value: F,
|
|
2775
2775
|
className: ({ active: z }) => `${z ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2776
2776
|
children: ({ selected: z, active: U }) => /* @__PURE__ */ l(ee, { children: [
|
|
2777
2777
|
/* @__PURE__ */ l(
|
|
@@ -2780,13 +2780,13 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2780
2780
|
className: `${z ? "font-medium" : "font-normal"} flex items-center`,
|
|
2781
2781
|
children: [
|
|
2782
2782
|
/* @__PURE__ */ e(
|
|
2783
|
-
|
|
2783
|
+
F.icon,
|
|
2784
2784
|
{
|
|
2785
2785
|
className: `h-5 w-5 mr-2 ${U ? "text-white" : "text-gray-400"}`
|
|
2786
2786
|
}
|
|
2787
2787
|
),
|
|
2788
2788
|
"Can ",
|
|
2789
|
-
|
|
2789
|
+
F.name
|
|
2790
2790
|
]
|
|
2791
2791
|
}
|
|
2792
2792
|
),
|
|
@@ -2799,7 +2799,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2799
2799
|
) })
|
|
2800
2800
|
] })
|
|
2801
2801
|
},
|
|
2802
|
-
|
|
2802
|
+
F.id
|
|
2803
2803
|
)) })
|
|
2804
2804
|
}
|
|
2805
2805
|
)
|
|
@@ -2807,7 +2807,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2807
2807
|
}
|
|
2808
2808
|
)
|
|
2809
2809
|
] }),
|
|
2810
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(be, { children: p.map((
|
|
2810
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(be, { children: p.map((F, z) => /* @__PURE__ */ l(
|
|
2811
2811
|
ne.div,
|
|
2812
2812
|
{
|
|
2813
2813
|
layout: !0,
|
|
@@ -2821,16 +2821,16 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2821
2821
|
/* @__PURE__ */ e(
|
|
2822
2822
|
"img",
|
|
2823
2823
|
{
|
|
2824
|
-
src:
|
|
2824
|
+
src: F.avatarUrl || `https://avatar.vercel.sh/${F.name}.svg?text=${F.name.charAt(0)}`,
|
|
2825
2825
|
className: "w-8 h-8 rounded-full flex-shrink-0"
|
|
2826
2826
|
}
|
|
2827
2827
|
),
|
|
2828
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-sm text-gray-800 truncate", children:
|
|
2828
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-sm text-gray-800 truncate", children: F.name })
|
|
2829
2829
|
] }),
|
|
2830
2830
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
|
|
2831
2831
|
n === se.DRIVE && /* @__PURE__ */ l("span", { className: "text-sm text-gray-500", children: [
|
|
2832
2832
|
"can ",
|
|
2833
|
-
|
|
2833
|
+
F.permission
|
|
2834
2834
|
] }),
|
|
2835
2835
|
/* @__PURE__ */ e(
|
|
2836
2836
|
"button",
|
|
@@ -2843,7 +2843,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2843
2843
|
] })
|
|
2844
2844
|
]
|
|
2845
2845
|
},
|
|
2846
|
-
|
|
2846
|
+
F.id
|
|
2847
2847
|
)) }) })
|
|
2848
2848
|
]
|
|
2849
2849
|
}
|
|
@@ -2851,9 +2851,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2851
2851
|
] }),
|
|
2852
2852
|
/* @__PURE__ */ e("footer", { className: "p-4 border-t border-gray-300 flex-shrink-0", children: /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
|
|
2853
2853
|
/* @__PURE__ */ l("p", { className: "text-sm text-gray-600", children: [
|
|
2854
|
-
|
|
2854
|
+
m.length,
|
|
2855
2855
|
" invitation",
|
|
2856
|
-
|
|
2856
|
+
m.length !== 1 ? "s" : "",
|
|
2857
2857
|
" selected"
|
|
2858
2858
|
] }),
|
|
2859
2859
|
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
@@ -2868,10 +2868,10 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2868
2868
|
/* @__PURE__ */ e(
|
|
2869
2869
|
"button",
|
|
2870
2870
|
{
|
|
2871
|
-
onClick: V(j),
|
|
2872
|
-
disabled:
|
|
2871
|
+
onClick: () => V(j)(),
|
|
2872
|
+
disabled: N || M,
|
|
2873
2873
|
className: "px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md shadow-sm hover:bg-blue-700 hover:cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-blue-300 disabled:cursor-not-allowed",
|
|
2874
|
-
children:
|
|
2874
|
+
children: N ? "Inviting..." : n === se.DRIVE ? "Send Invites" : "Add"
|
|
2875
2875
|
}
|
|
2876
2876
|
)
|
|
2877
2877
|
] })
|
|
@@ -2882,15 +2882,15 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2882
2882
|
{ name: "Can manage", icon: Da, value: "edit" },
|
|
2883
2883
|
{ name: "Remove", icon: Ot, isDestructive: !0, value: "remove" }
|
|
2884
2884
|
], bn = ({ item: t, allowedPermissions: r, onPermissionChange: s }) => {
|
|
2885
|
-
const [o, n] = B(!1), { refs: u, floatingStyles: i, context:
|
|
2885
|
+
const [o, n] = B(!1), { refs: u, floatingStyles: i, context: c } = Ta({
|
|
2886
2886
|
open: o,
|
|
2887
2887
|
onOpenChange: n,
|
|
2888
2888
|
middleware: [Aa(8), Ea(), Ra({ padding: 8 })],
|
|
2889
2889
|
whileElementsMounted: Ia,
|
|
2890
2890
|
placement: "bottom-end"
|
|
2891
|
-
}), y = Nr(
|
|
2891
|
+
}), y = Nr(c), v = xr(c), { getReferenceProps: x, getFloatingProps: a } = kr([
|
|
2892
2892
|
y,
|
|
2893
|
-
|
|
2893
|
+
v
|
|
2894
2894
|
]), k = Ke.find((g) => g.name === t.permission || g.value === t.permission) || Ke[0];
|
|
2895
2895
|
return (
|
|
2896
2896
|
// FIX: The <Listbox> component now wraps both the button and the portal.
|
|
@@ -2902,7 +2902,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2902
2902
|
Z.Button,
|
|
2903
2903
|
{
|
|
2904
2904
|
ref: u.setReference,
|
|
2905
|
-
...
|
|
2905
|
+
...x(),
|
|
2906
2906
|
className: "relative min-w-[120px] text-left text-sm p-2 border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-opacity-75 hover:cursor-pointer",
|
|
2907
2907
|
children: [
|
|
2908
2908
|
/* @__PURE__ */ e("span", { className: "block truncate", children: t.permission }),
|
|
@@ -2970,7 +2970,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2970
2970
|
existingShares: n,
|
|
2971
2971
|
allowedPermissions: u
|
|
2972
2972
|
}) => {
|
|
2973
|
-
const [i,
|
|
2973
|
+
const [i, c] = B(n), [y, v] = B(0), [x, a] = B(""), k = oa(x, 300), h = {
|
|
2974
2974
|
users: i.users.filter(
|
|
2975
2975
|
(C) => C.name.toLowerCase().includes(k.toLowerCase())
|
|
2976
2976
|
),
|
|
@@ -2980,23 +2980,21 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2980
2980
|
roles: i.roles.filter(
|
|
2981
2981
|
(C) => C.name.toLowerCase().includes(k.toLowerCase())
|
|
2982
2982
|
)
|
|
2983
|
-
}, g = async (C, T,
|
|
2983
|
+
}, g = async (C, T, I, E) => {
|
|
2984
2984
|
const V = T.value;
|
|
2985
|
-
|
|
2985
|
+
c((q) => ({
|
|
2986
2986
|
...q,
|
|
2987
|
-
[
|
|
2987
|
+
[I]: q[I].map(
|
|
2988
2988
|
(G) => G.id === C.id ? { ...G, permission: V } : G
|
|
2989
2989
|
)
|
|
2990
2990
|
}));
|
|
2991
2991
|
}, $ = () => {
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
return r(T), T;
|
|
2999
|
-
});
|
|
2992
|
+
const C = {
|
|
2993
|
+
users: i.users.filter((T) => T.permission !== "remove"),
|
|
2994
|
+
groups: i.groups.filter((T) => T.permission !== "remove"),
|
|
2995
|
+
roles: i.roles.filter((T) => T.permission !== "remove")
|
|
2996
|
+
};
|
|
2997
|
+
r(C);
|
|
3000
2998
|
}, L = ["users", "groups", "roles"], O = ["Users", "Groups", "Roles"];
|
|
3001
2999
|
return (
|
|
3002
3000
|
// The main structure remains the same...
|
|
@@ -3008,7 +3006,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3008
3006
|
onClick: () => r(i),
|
|
3009
3007
|
className: "flex items-center gap-1 text-sm font-medium text-gray-600 hover:text-gray-900 hover:cursor-pointer p-2 rounded-md hover:bg-gray-100",
|
|
3010
3008
|
children: [
|
|
3011
|
-
/* @__PURE__ */ e(
|
|
3009
|
+
/* @__PURE__ */ e(Fa, { className: "h-5 w-5" }),
|
|
3012
3010
|
" Back"
|
|
3013
3011
|
]
|
|
3014
3012
|
}
|
|
@@ -3024,7 +3022,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3024
3022
|
)
|
|
3025
3023
|
] }),
|
|
3026
3024
|
/* @__PURE__ */ l("div", { className: "flex flex-col flex-grow", children: [
|
|
3027
|
-
/* @__PURE__ */ l(re.Group, { selectedIndex: y, onChange:
|
|
3025
|
+
/* @__PURE__ */ l(re.Group, { selectedIndex: y, onChange: v, children: [
|
|
3028
3026
|
/* @__PURE__ */ l("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3029
3027
|
/* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: O.map((C) => /* @__PURE__ */ e(
|
|
3030
3028
|
re,
|
|
@@ -3042,7 +3040,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3042
3040
|
he,
|
|
3043
3041
|
{
|
|
3044
3042
|
onDebouncedChange: a,
|
|
3045
|
-
value:
|
|
3043
|
+
value: x,
|
|
3046
3044
|
placeholder: `Search in ${O[y]}...`
|
|
3047
3045
|
}
|
|
3048
3046
|
) })
|
|
@@ -3058,7 +3056,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3058
3056
|
re.Panel,
|
|
3059
3057
|
{
|
|
3060
3058
|
className: "space-y-3 focus:outline-none",
|
|
3061
|
-
children: /* @__PURE__ */ e(be, { children:
|
|
3059
|
+
children: /* @__PURE__ */ e(be, { children: h[C].length > 0 ? h[C].map((T) => /* @__PURE__ */ l(
|
|
3062
3060
|
ne.div,
|
|
3063
3061
|
{
|
|
3064
3062
|
layout: !0,
|
|
@@ -3101,9 +3099,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3101
3099
|
{
|
|
3102
3100
|
item: T,
|
|
3103
3101
|
allowedPermissions: u,
|
|
3104
|
-
onPermissionChange: (
|
|
3102
|
+
onPermissionChange: (I) => g(
|
|
3105
3103
|
T,
|
|
3106
|
-
|
|
3104
|
+
I,
|
|
3107
3105
|
C
|
|
3108
3106
|
)
|
|
3109
3107
|
}
|
|
@@ -3126,7 +3124,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3126
3124
|
O[y],
|
|
3127
3125
|
" Found"
|
|
3128
3126
|
] }),
|
|
3129
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children:
|
|
3127
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: x ? `No results for "${x}"` : `There are no ${O[y].toLowerCase()} with access.` })
|
|
3130
3128
|
]
|
|
3131
3129
|
}
|
|
3132
3130
|
)
|
|
@@ -3162,9 +3160,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3162
3160
|
onClose: s,
|
|
3163
3161
|
members: o
|
|
3164
3162
|
}) => {
|
|
3165
|
-
const [n, u] = B(!0), [i,
|
|
3166
|
-
(
|
|
3167
|
-
),
|
|
3163
|
+
const [n, u] = B(!0), [i, c] = B(""), y = oa(i, 300), v = o.filter(
|
|
3164
|
+
(h) => h.name.toLowerCase().includes(y.toLowerCase())
|
|
3165
|
+
), x = {
|
|
3168
3166
|
hidden: { opacity: 0 },
|
|
3169
3167
|
visible: {
|
|
3170
3168
|
opacity: 1,
|
|
@@ -3178,8 +3176,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3178
3176
|
exit: { opacity: 0, x: -20 }
|
|
3179
3177
|
}, k = () => n ? (
|
|
3180
3178
|
// Show 5 skeleton items while loading
|
|
3181
|
-
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((
|
|
3182
|
-
) :
|
|
3179
|
+
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((h, g) => /* @__PURE__ */ e(Nn, {}, g)) })
|
|
3180
|
+
) : v.length === 0 ? /* @__PURE__ */ l(
|
|
3183
3181
|
ne.div,
|
|
3184
3182
|
{
|
|
3185
3183
|
initial: { opacity: 0, scale: 0.95 },
|
|
@@ -3194,11 +3192,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3194
3192
|
) : /* @__PURE__ */ e(
|
|
3195
3193
|
ne.ul,
|
|
3196
3194
|
{
|
|
3197
|
-
variants:
|
|
3195
|
+
variants: x,
|
|
3198
3196
|
initial: "hidden",
|
|
3199
3197
|
animate: "visible",
|
|
3200
3198
|
className: "divide-y divide-gray-200",
|
|
3201
|
-
children: /* @__PURE__ */ e(be, { children:
|
|
3199
|
+
children: /* @__PURE__ */ e(be, { children: v.map((h) => /* @__PURE__ */ l(
|
|
3202
3200
|
ne.li,
|
|
3203
3201
|
{
|
|
3204
3202
|
layout: !0,
|
|
@@ -3209,20 +3207,20 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3209
3207
|
/* @__PURE__ */ e(
|
|
3210
3208
|
"img",
|
|
3211
3209
|
{
|
|
3212
|
-
src:
|
|
3210
|
+
src: h.avatarUrl || `https://avatar.vercel.sh/${h.name}.svg?text=${h.name.charAt(
|
|
3213
3211
|
0
|
|
3214
3212
|
)}`,
|
|
3215
|
-
alt:
|
|
3213
|
+
alt: h.name,
|
|
3216
3214
|
className: "w-10 h-10 rounded-full flex-shrink-0"
|
|
3217
3215
|
}
|
|
3218
3216
|
),
|
|
3219
3217
|
/* @__PURE__ */ l("div", { className: "overflow-hidden", children: [
|
|
3220
|
-
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children:
|
|
3221
|
-
|
|
3218
|
+
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: h.name }),
|
|
3219
|
+
h.email && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 truncate", children: h.email })
|
|
3222
3220
|
] })
|
|
3223
3221
|
]
|
|
3224
3222
|
},
|
|
3225
|
-
|
|
3223
|
+
h._id
|
|
3226
3224
|
)) })
|
|
3227
3225
|
}
|
|
3228
3226
|
);
|
|
@@ -3234,7 +3232,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3234
3232
|
onClick: r,
|
|
3235
3233
|
className: "flex items-center gap-1 text-sm font-medium text-gray-600 hover:text-gray-900 p-2 rounded-md hover:bg-gray-100 hover:cursor-pointer",
|
|
3236
3234
|
children: [
|
|
3237
|
-
/* @__PURE__ */ e(
|
|
3235
|
+
/* @__PURE__ */ e(Fa, { className: "h-5 w-5" }),
|
|
3238
3236
|
" Back"
|
|
3239
3237
|
]
|
|
3240
3238
|
}
|
|
@@ -3255,7 +3253,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3255
3253
|
/* @__PURE__ */ e("div", { className: "p-4 border-b border-gray-200 flex-shrink-0", children: /* @__PURE__ */ e(
|
|
3256
3254
|
he,
|
|
3257
3255
|
{
|
|
3258
|
-
onDebouncedChange:
|
|
3256
|
+
onDebouncedChange: c,
|
|
3259
3257
|
value: i,
|
|
3260
3258
|
placeholder: "Search members..."
|
|
3261
3259
|
}
|
|
@@ -3280,35 +3278,34 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3280
3278
|
onClose: u = () => {
|
|
3281
3279
|
},
|
|
3282
3280
|
showExistingShares: i = !0,
|
|
3283
|
-
allowedPermissions:
|
|
3281
|
+
allowedPermissions: c = [],
|
|
3284
3282
|
...y
|
|
3285
3283
|
}) => {
|
|
3286
|
-
const [
|
|
3287
|
-
|
|
3284
|
+
const [v, x] = B(de.INVITE), [a, k] = B(t), [h, g] = B(null), [$, L] = B(!1), [O, C] = B([]), [T, I] = B(de.MANAGE), E = () => {
|
|
3285
|
+
x(de.INVITE), g(null), u();
|
|
3288
3286
|
}, V = () => {
|
|
3289
|
-
|
|
3287
|
+
x(de.MANAGE);
|
|
3290
3288
|
}, q = async ({ id: p, name: f, type: w }) => {
|
|
3291
3289
|
if (w === "groups") {
|
|
3292
3290
|
try {
|
|
3293
|
-
const
|
|
3294
|
-
} catch (
|
|
3295
|
-
console.log("Error searching entities:",
|
|
3291
|
+
const d = await Ee(`${Oe.getMembersForGroup(f)}`);
|
|
3292
|
+
} catch (d) {
|
|
3293
|
+
console.log("Error searching entities:", d);
|
|
3296
3294
|
}
|
|
3297
3295
|
C(resp);
|
|
3298
3296
|
}
|
|
3299
|
-
g({ id: p, type: w, name: f }),
|
|
3297
|
+
g({ id: p, type: w, name: f }), I(v), x(de.MEMBERS);
|
|
3300
3298
|
}, G = (p) => {
|
|
3301
|
-
k(p);
|
|
3302
|
-
const f =
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
);
|
|
3306
|
-
L(f), N(b === de.MEMBERS ? T : de.INVITE);
|
|
3299
|
+
console.log("changedExistingShares", p), k(p);
|
|
3300
|
+
const f = He.mapValues(t, (m) => m.map((b) => ({ id: b.id, permission: b.permission })).sort((b, D) => b.id - D.id)), w = He.mapValues(p, (m) => m.map((b) => ({ id: b.id, permission: b.permission })).sort((b, D) => b.id - D.id));
|
|
3301
|
+
console.log("Existing data:", f), console.log("Changed data:", w);
|
|
3302
|
+
const d = !He.isEqual(f, w);
|
|
3303
|
+
console.log("hasPermissionChanged:", d), L(d), x(v === de.MEMBERS ? T : de.INVITE);
|
|
3307
3304
|
};
|
|
3308
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose:
|
|
3305
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: E, children: [
|
|
3309
3306
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
3310
3307
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(Se, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
|
|
3311
|
-
switch (
|
|
3308
|
+
switch (v) {
|
|
3312
3309
|
case de.MANAGE:
|
|
3313
3310
|
return /* @__PURE__ */ e(
|
|
3314
3311
|
ne.div,
|
|
@@ -3323,11 +3320,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3323
3320
|
{
|
|
3324
3321
|
entity: o,
|
|
3325
3322
|
onBack: G,
|
|
3326
|
-
onClose:
|
|
3323
|
+
onClose: E,
|
|
3327
3324
|
onOpenMembers: q,
|
|
3328
3325
|
existingShares: a,
|
|
3329
3326
|
calledBy: n,
|
|
3330
|
-
allowedPermissions:
|
|
3327
|
+
allowedPermissions: c
|
|
3331
3328
|
}
|
|
3332
3329
|
)
|
|
3333
3330
|
},
|
|
@@ -3345,9 +3342,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3345
3342
|
children: /* @__PURE__ */ e(
|
|
3346
3343
|
xn,
|
|
3347
3344
|
{
|
|
3348
|
-
entity:
|
|
3345
|
+
entity: h,
|
|
3349
3346
|
onBack: G,
|
|
3350
|
-
onClose:
|
|
3347
|
+
onClose: E,
|
|
3351
3348
|
calledBy: n,
|
|
3352
3349
|
existingShares: a,
|
|
3353
3350
|
members: O
|
|
@@ -3370,7 +3367,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3370
3367
|
{
|
|
3371
3368
|
entity: o,
|
|
3372
3369
|
onManage: V,
|
|
3373
|
-
onClose:
|
|
3370
|
+
onClose: E,
|
|
3374
3371
|
existingShares: a,
|
|
3375
3372
|
calledBy: n,
|
|
3376
3373
|
showExistingShares: i,
|
|
@@ -3400,35 +3397,35 @@ function Ye({
|
|
|
3400
3397
|
},
|
|
3401
3398
|
placeholder: u = "Select options",
|
|
3402
3399
|
error: i = null,
|
|
3403
|
-
displayLimit:
|
|
3400
|
+
displayLimit: c = 3,
|
|
3404
3401
|
selectionLimit: y = -1,
|
|
3405
3402
|
// NEW: search behavior
|
|
3406
|
-
searchMode:
|
|
3403
|
+
searchMode: v = "client",
|
|
3407
3404
|
// "client" | "server"
|
|
3408
|
-
onSearch:
|
|
3405
|
+
onSearch: x,
|
|
3409
3406
|
// (query: string) => void (required if searchMode==="server")
|
|
3410
3407
|
serverLoading: a = !1,
|
|
3411
3408
|
minSearchChars: k = 2,
|
|
3412
3409
|
// NEW: mappers (id/label keys)
|
|
3413
|
-
getOptionId:
|
|
3410
|
+
getOptionId: h = ($) => String($.id),
|
|
3414
3411
|
getOptionLabel: g = ($) => $.name
|
|
3415
3412
|
}) {
|
|
3416
|
-
const $ = ea(), L = ea(), [O, C] = B(""), T = ue(""),
|
|
3413
|
+
const $ = ea(), L = ea(), [O, C] = B(""), T = ue(""), I = ce(() => {
|
|
3417
3414
|
const p = /* @__PURE__ */ new Map();
|
|
3418
|
-
for (const f of r) p.set(
|
|
3415
|
+
for (const f of r) p.set(h(f), f);
|
|
3419
3416
|
return p;
|
|
3420
|
-
}, [r,
|
|
3417
|
+
}, [r, h]), E = ce(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? I.get(h(p)) || null : I.get(String(p))).filter(Boolean) : [], [s, I, h]), V = ce(() => {
|
|
3421
3418
|
if (!O) return r;
|
|
3422
3419
|
const p = O.toLowerCase();
|
|
3423
3420
|
return r.filter((f) => g(f).toLowerCase().includes(p));
|
|
3424
3421
|
}, [r, O, g]);
|
|
3425
3422
|
X(() => {
|
|
3426
|
-
|
|
3427
|
-
}, [O,
|
|
3428
|
-
const q =
|
|
3429
|
-
if (!
|
|
3423
|
+
v === "server" && O.length >= k && O !== T.current && (T.current = O, x && x(O));
|
|
3424
|
+
}, [O, v, k, x]);
|
|
3425
|
+
const q = v === "client" ? V : r, G = () => {
|
|
3426
|
+
if (!E.length)
|
|
3430
3427
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
|
|
3431
|
-
const p =
|
|
3428
|
+
const p = E.slice(0, c), f = E.length - c;
|
|
3432
3429
|
return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
|
|
3433
3430
|
p.map((w) => /* @__PURE__ */ e(
|
|
3434
3431
|
"span",
|
|
@@ -3436,7 +3433,7 @@ function Ye({
|
|
|
3436
3433
|
className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
|
|
3437
3434
|
children: g(w)
|
|
3438
3435
|
},
|
|
3439
|
-
|
|
3436
|
+
h(w)
|
|
3440
3437
|
)),
|
|
3441
3438
|
f > 0 && /* @__PURE__ */ l("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
|
|
3442
3439
|
"+",
|
|
@@ -3445,8 +3442,8 @@ function Ye({
|
|
|
3445
3442
|
] })
|
|
3446
3443
|
] });
|
|
3447
3444
|
};
|
|
3448
|
-
return /* @__PURE__ */ e(Z, { value:
|
|
3449
|
-
const f = Array.from(new Set(p.map((w) =>
|
|
3445
|
+
return /* @__PURE__ */ e(Z, { value: E, onChange: (p) => {
|
|
3446
|
+
const f = Array.from(new Set(p.map((w) => h(w))));
|
|
3450
3447
|
y !== -1 && f.length > y || o(f);
|
|
3451
3448
|
}, multiple: !0, by: "id", children: ({ open: p }) => /* @__PURE__ */ l("div", { children: [
|
|
3452
3449
|
/* @__PURE__ */ e(
|
|
@@ -3489,37 +3486,37 @@ function Ye({
|
|
|
3489
3486
|
{
|
|
3490
3487
|
value: O,
|
|
3491
3488
|
onDebouncedChange: C,
|
|
3492
|
-
placeholder:
|
|
3489
|
+
placeholder: v === "server" ? `Search (min ${k})…` : "Search options…"
|
|
3493
3490
|
}
|
|
3494
3491
|
) }),
|
|
3495
|
-
|
|
3496
|
-
q.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children:
|
|
3497
|
-
const w =
|
|
3492
|
+
v === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3493
|
+
q.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: v === "server" ? O.length < k ? `Type at least ${k} characters to search.` : "No results." : "No options found." }) : q.map((f) => {
|
|
3494
|
+
const w = h(f), d = g(f), m = E.some((D) => h(D) === w), b = y !== -1 && E.length >= y && !m;
|
|
3498
3495
|
return /* @__PURE__ */ e(
|
|
3499
3496
|
Z.Option,
|
|
3500
3497
|
{
|
|
3501
3498
|
value: f,
|
|
3502
|
-
disabled:
|
|
3503
|
-
className: ({ active:
|
|
3504
|
-
|
|
3499
|
+
disabled: b,
|
|
3500
|
+
className: ({ active: D }) => Pe(
|
|
3501
|
+
b ? " text-gray-400 bg-white cursor-not-allowed" : D ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3505
3502
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3506
3503
|
),
|
|
3507
|
-
children: ({ selected:
|
|
3504
|
+
children: ({ selected: D, active: R }) => /* @__PURE__ */ l(ee, { children: [
|
|
3508
3505
|
/* @__PURE__ */ e(
|
|
3509
3506
|
"span",
|
|
3510
3507
|
{
|
|
3511
3508
|
className: Pe(
|
|
3512
|
-
|
|
3509
|
+
D ? "font-semibold" : "font-normal",
|
|
3513
3510
|
"block truncate"
|
|
3514
3511
|
),
|
|
3515
|
-
children:
|
|
3512
|
+
children: d
|
|
3516
3513
|
}
|
|
3517
3514
|
),
|
|
3518
|
-
|
|
3515
|
+
D && /* @__PURE__ */ e(
|
|
3519
3516
|
"span",
|
|
3520
3517
|
{
|
|
3521
3518
|
className: Pe(
|
|
3522
|
-
|
|
3519
|
+
R ? " text-gray-900" : " text-gray-600",
|
|
3523
3520
|
" absolute inset-y-0 right-0 flex items-center pr-4"
|
|
3524
3521
|
),
|
|
3525
3522
|
children: /* @__PURE__ */ e(Ge, { className: "w-5 h-5", "aria-hidden": "true" })
|
|
@@ -3587,12 +3584,12 @@ const hs = ({
|
|
|
3587
3584
|
footer: n = { show: !0, customFooter: null },
|
|
3588
3585
|
primaryAction: u = { onSubmit: null, label: "Save", loader: !1, disabled: !1 },
|
|
3589
3586
|
secondaryAction: i = { onCancel: null, label: "Cancel" },
|
|
3590
|
-
dialogPanelClass:
|
|
3587
|
+
dialogPanelClass: c = ""
|
|
3591
3588
|
}) => {
|
|
3592
|
-
const y = (
|
|
3593
|
-
|
|
3594
|
-
},
|
|
3595
|
-
|
|
3589
|
+
const y = (x) => {
|
|
3590
|
+
x.target === x.currentTarget && r(!1);
|
|
3591
|
+
}, v = (x) => {
|
|
3592
|
+
x.stopPropagation();
|
|
3596
3593
|
};
|
|
3597
3594
|
return /* @__PURE__ */ l(
|
|
3598
3595
|
me,
|
|
@@ -3611,8 +3608,8 @@ const hs = ({
|
|
|
3611
3608
|
/* @__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(
|
|
3612
3609
|
Se,
|
|
3613
3610
|
{
|
|
3614
|
-
className: `${
|
|
3615
|
-
onClick:
|
|
3611
|
+
className: `${c} 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`,
|
|
3612
|
+
onClick: v,
|
|
3616
3613
|
children: [
|
|
3617
3614
|
/* @__PURE__ */ l("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
|
|
3618
3615
|
o?.customHeader && o.customHeader,
|
|
@@ -3623,7 +3620,7 @@ const hs = ({
|
|
|
3623
3620
|
"div",
|
|
3624
3621
|
{
|
|
3625
3622
|
className: "px-5 mb-5",
|
|
3626
|
-
onClick:
|
|
3623
|
+
onClick: v,
|
|
3627
3624
|
children: s
|
|
3628
3625
|
}
|
|
3629
3626
|
),
|
|
@@ -3684,17 +3681,17 @@ function Cn({
|
|
|
3684
3681
|
onSelect: n,
|
|
3685
3682
|
onCreateChild: u,
|
|
3686
3683
|
onRename: i,
|
|
3687
|
-
onDelete:
|
|
3684
|
+
onDelete: c,
|
|
3688
3685
|
renderActions: y,
|
|
3689
3686
|
// optional override
|
|
3690
|
-
dragId:
|
|
3691
|
-
dropId:
|
|
3687
|
+
dragId: v,
|
|
3688
|
+
dropId: x,
|
|
3692
3689
|
indent: a = 24
|
|
3693
3690
|
}) {
|
|
3694
|
-
const { setNodeRef: k, isOver:
|
|
3691
|
+
const { setNodeRef: k, isOver: h } = Ut({ id: x }), { attributes: g, listeners: $, setNodeRef: L, transform: O, isDragging: C } = Vt({ id: v }), T = O ? { transform: `translate3d(${Math.round(O.x)}px, ${Math.round(O.y)}px, 0)` } : void 0, [I, E] = B(!1), [V, q] = B(t.name), G = () => {
|
|
3695
3692
|
const p = V.trim();
|
|
3696
|
-
|
|
3697
|
-
},
|
|
3693
|
+
E(!1), p && p !== t.name ? i?.(t, p) : q(t.name);
|
|
3694
|
+
}, N = ce(() => /* @__PURE__ */ e(
|
|
3698
3695
|
an,
|
|
3699
3696
|
{
|
|
3700
3697
|
options: [
|
|
@@ -3703,23 +3700,23 @@ function Cn({
|
|
|
3703
3700
|
{ action: "delete", label: "Delete" }
|
|
3704
3701
|
],
|
|
3705
3702
|
onSelect: (f) => {
|
|
3706
|
-
f.action === "create" ? u?.(t) : f.action === "rename" ?
|
|
3703
|
+
f.action === "create" ? u?.(t) : f.action === "rename" ? E(!0) : f.action === "delete" && c?.(t);
|
|
3707
3704
|
}
|
|
3708
3705
|
}
|
|
3709
|
-
), [t, u,
|
|
3706
|
+
), [t, u, c]);
|
|
3710
3707
|
return /* @__PURE__ */ l(
|
|
3711
3708
|
"div",
|
|
3712
3709
|
{
|
|
3713
3710
|
ref: k,
|
|
3714
|
-
className: `tv-row ${
|
|
3711
|
+
className: `tv-row ${h ? "tv-drop-over" : ""} ${C ? "dragging" : ""}`,
|
|
3715
3712
|
style: { ...T, paddingLeft: 8 + r * a },
|
|
3716
3713
|
onClick: (p) => {
|
|
3717
3714
|
p.target.closest(".tv-toggle") || p.target.tagName === "INPUT" || n?.(t);
|
|
3718
3715
|
},
|
|
3719
3716
|
children: [
|
|
3720
3717
|
/* @__PURE__ */ e("button", { className: "tv-toggle", onClick: o, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(wa, { size: 16 }) : /* @__PURE__ */ e(je, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
|
|
3721
|
-
/* @__PURE__ */ e(
|
|
3722
|
-
/* @__PURE__ */ e("div", { className: "tv-name", ref: L, children:
|
|
3718
|
+
/* @__PURE__ */ e($a, { size: 16, className: "tv-folder-ic" }),
|
|
3719
|
+
/* @__PURE__ */ e("div", { className: "tv-name", ref: L, children: I ? /* @__PURE__ */ e(
|
|
3723
3720
|
"input",
|
|
3724
3721
|
{
|
|
3725
3722
|
className: "tv-input",
|
|
@@ -3727,53 +3724,53 @@ function Cn({
|
|
|
3727
3724
|
onChange: (p) => q(p.target.value),
|
|
3728
3725
|
onBlur: G,
|
|
3729
3726
|
onKeyDown: (p) => {
|
|
3730
|
-
p.key === "Enter" && G(), p.key === "Escape" && (
|
|
3727
|
+
p.key === "Enter" && G(), p.key === "Escape" && (E(!1), q(t.name));
|
|
3731
3728
|
},
|
|
3732
3729
|
autoFocus: !0
|
|
3733
3730
|
}
|
|
3734
|
-
) : /* @__PURE__ */ e("span", { onDoubleClick: () =>
|
|
3731
|
+
) : /* @__PURE__ */ e("span", { onDoubleClick: () => E(!0), children: t.name }) }),
|
|
3735
3732
|
/* @__PURE__ */ e(wn, { listeners: $, attributes: g }),
|
|
3736
3733
|
/* @__PURE__ */ e("div", { className: "tv-actions", children: y ? y(t, {
|
|
3737
3734
|
onCreateChild: () => u?.(t),
|
|
3738
|
-
onRename: () =>
|
|
3739
|
-
onDelete: () =>
|
|
3740
|
-
}) :
|
|
3735
|
+
onRename: () => E(!0),
|
|
3736
|
+
onDelete: () => c?.(t)
|
|
3737
|
+
}) : N })
|
|
3741
3738
|
]
|
|
3742
3739
|
}
|
|
3743
3740
|
);
|
|
3744
3741
|
}
|
|
3745
|
-
const Sn = (t) => String(t.id ?? t._id), Dn = (t) => t.parent !== void 0 ? String(t.parent) : t.parentId != null ? String(t.parentId) : "root",
|
|
3742
|
+
const Sn = (t) => String(t.id ?? t._id), Dn = (t) => t.parent !== void 0 ? String(t.parent) : t.parentId != null ? String(t.parentId) : "root", Fn = (t) => t.name ?? t.label ?? "", $n = (t) => Array.isArray(t) && t.some((r) => Array.isArray(r.children));
|
|
3746
3743
|
function Tn(t, { rootId: r, getId: s, getParent: o, getName: n }) {
|
|
3747
3744
|
const u = /* @__PURE__ */ new Map();
|
|
3748
|
-
t.forEach((
|
|
3749
|
-
const y = s(
|
|
3745
|
+
t.forEach((c) => {
|
|
3746
|
+
const y = s(c);
|
|
3750
3747
|
u.set(y, {
|
|
3751
|
-
...
|
|
3748
|
+
...c,
|
|
3752
3749
|
id: y,
|
|
3753
|
-
name: n(
|
|
3754
|
-
parentId: o(
|
|
3750
|
+
name: n(c),
|
|
3751
|
+
parentId: o(c) || r,
|
|
3755
3752
|
children: []
|
|
3756
3753
|
});
|
|
3757
3754
|
});
|
|
3758
3755
|
const i = [];
|
|
3759
|
-
return u.forEach((
|
|
3760
|
-
const y =
|
|
3761
|
-
y !== r && u.has(y) ? u.get(y).children.push(
|
|
3756
|
+
return u.forEach((c) => {
|
|
3757
|
+
const y = c.parentId || r;
|
|
3758
|
+
y !== r && u.has(y) ? u.get(y).children.push(c) : i.push(c);
|
|
3762
3759
|
}), { roots: i, byId: u };
|
|
3763
3760
|
}
|
|
3764
3761
|
function An(t, { rootId: r, getId: s, getName: o }) {
|
|
3765
3762
|
const n = /* @__PURE__ */ new Map();
|
|
3766
|
-
function u(
|
|
3767
|
-
const
|
|
3768
|
-
...
|
|
3769
|
-
id:
|
|
3770
|
-
name: o(
|
|
3763
|
+
function u(c, y) {
|
|
3764
|
+
const v = s(c), x = {
|
|
3765
|
+
...c,
|
|
3766
|
+
id: v,
|
|
3767
|
+
name: o(c),
|
|
3771
3768
|
parentId: y || r,
|
|
3772
|
-
children: (
|
|
3769
|
+
children: (c.children || []).map((a) => u(a, v))
|
|
3773
3770
|
};
|
|
3774
|
-
return n.set(
|
|
3771
|
+
return n.set(v, x), x;
|
|
3775
3772
|
}
|
|
3776
|
-
return { roots: t.map((
|
|
3773
|
+
return { roots: t.map((c) => u(c, null)), byId: n };
|
|
3777
3774
|
}
|
|
3778
3775
|
const Ae = (t) => t.map((r) => ({ ...r, children: Ae(r.children || []) }));
|
|
3779
3776
|
function En(t, r) {
|
|
@@ -3783,8 +3780,8 @@ function En(t, r) {
|
|
|
3783
3780
|
if (i.id === r)
|
|
3784
3781
|
return s = i, null;
|
|
3785
3782
|
if (i.children?.length) {
|
|
3786
|
-
const
|
|
3787
|
-
if (
|
|
3783
|
+
const c = o(i.children);
|
|
3784
|
+
if (c !== i.children) return { ...i, children: c };
|
|
3788
3785
|
}
|
|
3789
3786
|
return i;
|
|
3790
3787
|
}).filter(Boolean);
|
|
@@ -3821,54 +3818,54 @@ function ps({
|
|
|
3821
3818
|
title: s = "Folders",
|
|
3822
3819
|
getId: o = Sn,
|
|
3823
3820
|
getParent: n = Dn,
|
|
3824
|
-
getName: u =
|
|
3821
|
+
getName: u = Fn,
|
|
3825
3822
|
onSelect: i,
|
|
3826
|
-
onCreateRoot:
|
|
3823
|
+
onCreateRoot: c,
|
|
3827
3824
|
onCreateChild: y,
|
|
3828
|
-
onRename:
|
|
3829
|
-
onDelete:
|
|
3825
|
+
onRename: v,
|
|
3826
|
+
onDelete: x,
|
|
3830
3827
|
onMove: a,
|
|
3831
3828
|
renderActions: k,
|
|
3832
|
-
disableMoveToRoot:
|
|
3829
|
+
disableMoveToRoot: h = !1,
|
|
3833
3830
|
// ← allow root moves by default now
|
|
3834
3831
|
indentUnit: g = 24
|
|
3835
3832
|
}) {
|
|
3836
|
-
const { roots: $ } = ce(() =>
|
|
3837
|
-
t.map((
|
|
3833
|
+
const { roots: $ } = ce(() => $n(t) ? An(t, { rootId: r, getId: o, getName: u }) : Tn(
|
|
3834
|
+
t.map((b) => ({ ...b })),
|
|
3838
3835
|
{ rootId: r, getId: o, getParent: n, getName: u }
|
|
3839
|
-
), [t, r, o, n, u]), [L, O] = B({}), C = K((
|
|
3840
|
-
const
|
|
3841
|
-
return (function
|
|
3836
|
+
), [t, r, o, n, u]), [L, O] = B({}), C = K((b) => {
|
|
3837
|
+
const D = {};
|
|
3838
|
+
return (function R(j) {
|
|
3842
3839
|
j.forEach((S) => {
|
|
3843
|
-
|
|
3840
|
+
D[S.id] = !0, S.children?.length && R(S.children);
|
|
3844
3841
|
});
|
|
3845
|
-
})(
|
|
3842
|
+
})(b), D;
|
|
3846
3843
|
}, []);
|
|
3847
3844
|
ae.useEffect(() => {
|
|
3848
3845
|
O(C($));
|
|
3849
3846
|
}, [$, C]);
|
|
3850
3847
|
const T = K(
|
|
3851
|
-
(
|
|
3848
|
+
(b) => O((D) => ({ ...D, [b]: !D[b] })),
|
|
3852
3849
|
[]
|
|
3853
|
-
), [
|
|
3854
|
-
ae.useEffect(() =>
|
|
3850
|
+
), [I, E] = B(() => Ae($));
|
|
3851
|
+
ae.useEffect(() => E(Ae($)), [$]);
|
|
3855
3852
|
const V = qt(
|
|
3856
3853
|
jt(Yt, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
3857
|
-
), q = ue(null), [G,
|
|
3858
|
-
}, w = ({ delta:
|
|
3859
|
-
p.current =
|
|
3860
|
-
},
|
|
3861
|
-
({ active:
|
|
3862
|
-
const
|
|
3863
|
-
if (p.current = 0,
|
|
3864
|
-
const j = String(
|
|
3854
|
+
), q = ue(null), [G, N] = B(null), p = ue(0), f = () => {
|
|
3855
|
+
}, w = ({ delta: b }) => {
|
|
3856
|
+
p.current = b?.x ?? 0;
|
|
3857
|
+
}, d = K(
|
|
3858
|
+
({ active: b, over: D }) => {
|
|
3859
|
+
const R = p.current;
|
|
3860
|
+
if (p.current = 0, N(null), !b || !D) return;
|
|
3861
|
+
const j = String(b.id).replace(/^drag-/, ""), S = String(D.id).replace(/^drop-/, "");
|
|
3865
3862
|
if (!j || !S || j === S) return;
|
|
3866
3863
|
let A = S;
|
|
3867
|
-
const M = Math.max(0, Math.floor(-
|
|
3864
|
+
const M = Math.max(0, Math.floor(-R / g));
|
|
3868
3865
|
if (M > 0) {
|
|
3869
3866
|
let ie = S;
|
|
3870
3867
|
for (let xe = 0; xe < M; xe++) {
|
|
3871
|
-
const P = Ka(
|
|
3868
|
+
const P = Ka(I, ie, null);
|
|
3872
3869
|
if (!P) break;
|
|
3873
3870
|
if (!P.parentId) {
|
|
3874
3871
|
A = r;
|
|
@@ -3877,60 +3874,60 @@ function ps({
|
|
|
3877
3874
|
A = P.parentId, ie = P.parentId;
|
|
3878
3875
|
}
|
|
3879
3876
|
}
|
|
3880
|
-
if (
|
|
3881
|
-
|
|
3877
|
+
if (h && A === r) {
|
|
3878
|
+
E(Ae($));
|
|
3882
3879
|
return;
|
|
3883
3880
|
}
|
|
3884
|
-
const
|
|
3881
|
+
const F = Ae(I), { newRoots: z, removed: U } = En(F, j);
|
|
3885
3882
|
if (!U) return;
|
|
3886
3883
|
const Ne = Rn(z, A, U);
|
|
3887
|
-
|
|
3884
|
+
E(Ne), a?.({ sourceId: j, destParentId: A, newTree: Ne });
|
|
3888
3885
|
},
|
|
3889
|
-
[
|
|
3890
|
-
),
|
|
3891
|
-
(
|
|
3886
|
+
[I, $, r, h, g, a]
|
|
3887
|
+
), m = K(
|
|
3888
|
+
(b, D = 0) => b.map((R) => /* @__PURE__ */ l(ae.Fragment, { children: [
|
|
3892
3889
|
/* @__PURE__ */ e(
|
|
3893
3890
|
Cn,
|
|
3894
3891
|
{
|
|
3895
|
-
node:
|
|
3896
|
-
depth:
|
|
3897
|
-
expanded: !!L[
|
|
3898
|
-
onToggle: () => T(
|
|
3892
|
+
node: R,
|
|
3893
|
+
depth: D,
|
|
3894
|
+
expanded: !!L[R.id],
|
|
3895
|
+
onToggle: () => T(R.id),
|
|
3899
3896
|
onSelect: i,
|
|
3900
3897
|
onCreateChild: y,
|
|
3901
|
-
onRename:
|
|
3902
|
-
onDelete:
|
|
3898
|
+
onRename: v,
|
|
3899
|
+
onDelete: x,
|
|
3903
3900
|
renderActions: k,
|
|
3904
|
-
dragId: `drag-${
|
|
3905
|
-
dropId: `drop-${
|
|
3901
|
+
dragId: `drag-${R.id}`,
|
|
3902
|
+
dropId: `drop-${R.id}`,
|
|
3906
3903
|
indent: g
|
|
3907
3904
|
}
|
|
3908
3905
|
),
|
|
3909
|
-
L[
|
|
3910
|
-
] },
|
|
3911
|
-
[L, g, y,
|
|
3906
|
+
L[R.id] && R.children?.length > 0 ? m(R.children, D + 1) : null
|
|
3907
|
+
] }, R.id)),
|
|
3908
|
+
[L, g, y, x, v, i, k, T]
|
|
3912
3909
|
);
|
|
3913
3910
|
return ae.useMemo(() => {
|
|
3914
3911
|
if (!G) return null;
|
|
3915
|
-
const
|
|
3916
|
-
function
|
|
3917
|
-
for (const j of
|
|
3918
|
-
if (j.id ===
|
|
3919
|
-
const S = j.children?.length ?
|
|
3912
|
+
const b = String(G).replace(/^drag-/, "");
|
|
3913
|
+
function D(R) {
|
|
3914
|
+
for (const j of R) {
|
|
3915
|
+
if (j.id === b) return j;
|
|
3916
|
+
const S = j.children?.length ? D(j.children) : null;
|
|
3920
3917
|
if (S) return S;
|
|
3921
3918
|
}
|
|
3922
3919
|
return null;
|
|
3923
3920
|
}
|
|
3924
|
-
return
|
|
3925
|
-
}, [G,
|
|
3921
|
+
return D(I);
|
|
3922
|
+
}, [G, I]), /* @__PURE__ */ l("div", { className: "tv", children: [
|
|
3926
3923
|
s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
|
|
3927
3924
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
3928
|
-
/* @__PURE__ */ e("button", { className: "tv-btn", onClick:
|
|
3925
|
+
/* @__PURE__ */ e("button", { className: "tv-btn", onClick: c, children: "+ New folder" })
|
|
3929
3926
|
] }),
|
|
3930
3927
|
/* @__PURE__ */ l("div", { className: "tv-root-row", children: [
|
|
3931
|
-
/* @__PURE__ */ e(
|
|
3928
|
+
/* @__PURE__ */ e($a, { size: 16, className: "tv-folder-ic" }),
|
|
3932
3929
|
/* @__PURE__ */ e("strong", { children: "ROOT" }),
|
|
3933
|
-
/* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick:
|
|
3930
|
+
/* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: c, children: "+" })
|
|
3934
3931
|
] }),
|
|
3935
3932
|
/* @__PURE__ */ e(
|
|
3936
3933
|
Gt,
|
|
@@ -3939,9 +3936,9 @@ function ps({
|
|
|
3939
3936
|
sensors: V,
|
|
3940
3937
|
onDragStart: f,
|
|
3941
3938
|
onDragMove: w,
|
|
3942
|
-
onDragEnd:
|
|
3939
|
+
onDragEnd: d,
|
|
3943
3940
|
modifiers: [_t],
|
|
3944
|
-
children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children:
|
|
3941
|
+
children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: m(I, 0) })
|
|
3945
3942
|
}
|
|
3946
3943
|
)
|
|
3947
3944
|
] });
|
|
@@ -3957,17 +3954,17 @@ const gs = ({
|
|
|
3957
3954
|
listClassName: n = "",
|
|
3958
3955
|
panelClassName: u = "",
|
|
3959
3956
|
tabClassName: i,
|
|
3960
|
-
...
|
|
3957
|
+
...c
|
|
3961
3958
|
// Pass remaining props to Tab.Group
|
|
3962
3959
|
}) => {
|
|
3963
|
-
const y = s === "vertical",
|
|
3960
|
+
const y = s === "vertical", v = (k) => fe(
|
|
3964
3961
|
"text-left text-sm rounded-md px-2 py-1.5 focus:outline-none",
|
|
3965
3962
|
k ? "bg-indigo-50 text-indigo-700" : "text-slate-600 hover:bg-slate-50 hover:text-indigo-700"
|
|
3966
|
-
),
|
|
3963
|
+
), x = (k) => fe(
|
|
3967
3964
|
"py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
|
|
3968
3965
|
k ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
|
|
3969
|
-
), a = ({ selected: k }) => i ? typeof i == "function" ? i(k) : i : y ?
|
|
3970
|
-
return /* @__PURE__ */ e(re.Group, { vertical: y, ...
|
|
3966
|
+
), a = ({ selected: k }) => i ? typeof i == "function" ? i(k) : i : y ? v(k) : x(k);
|
|
3967
|
+
return /* @__PURE__ */ e(re.Group, { vertical: y, ...c, children: y ? /* @__PURE__ */ l("div", { className: fe("flex gap-4", o), children: [
|
|
3971
3968
|
/* @__PURE__ */ e(re.List, { className: fe("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((k) => /* @__PURE__ */ e(re, { className: a, children: k.label }, k.key)) }),
|
|
3972
3969
|
/* @__PURE__ */ e(re.Panels, { unmount: !r, className: fe("flex-1", u), children: t.map((k) => /* @__PURE__ */ e(re.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: k.content }) }, k.key)) })
|
|
3973
3970
|
] }) : /* @__PURE__ */ l(ee, { children: [
|
|
@@ -3977,7 +3974,7 @@ const gs = ({
|
|
|
3977
3974
|
};
|
|
3978
3975
|
function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
3979
3976
|
console.log(t);
|
|
3980
|
-
const [n, u] = ae.useState(t), [i,
|
|
3977
|
+
const [n, u] = ae.useState(t), [i, c] = ae.useState(() => {
|
|
3981
3978
|
const a = r && r[t.key] || {};
|
|
3982
3979
|
return console.log("Initial Section data for", t.key, a), a;
|
|
3983
3980
|
}), y = ue(r);
|
|
@@ -3985,29 +3982,29 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
3985
3982
|
if (y.current !== r) {
|
|
3986
3983
|
y.current = r;
|
|
3987
3984
|
const a = r && r[t.key] || {};
|
|
3988
|
-
console.log("Updated Section data for", t.key, a),
|
|
3985
|
+
console.log("Updated Section data for", t.key, a), c(a);
|
|
3989
3986
|
}
|
|
3990
3987
|
}, [r, t.key]), console.log("Section data", i);
|
|
3991
|
-
const
|
|
3988
|
+
const v = ue(i);
|
|
3992
3989
|
X(() => {
|
|
3993
|
-
|
|
3990
|
+
v.current !== i && s && typeof s == "function" && (v.current = i, s(n.key, i));
|
|
3994
3991
|
}, [n.key, i, s]);
|
|
3995
|
-
const
|
|
3992
|
+
const x = (a) => {
|
|
3996
3993
|
if (!a.dependsOn) return !0;
|
|
3997
|
-
const { field: k, value:
|
|
3994
|
+
const { field: k, value: h, operator: g = "equals" } = a.dependsOn, $ = i[k];
|
|
3998
3995
|
switch (g) {
|
|
3999
3996
|
case "equals":
|
|
4000
|
-
return $ ===
|
|
3997
|
+
return $ === h;
|
|
4001
3998
|
case "notEquals":
|
|
4002
|
-
return $ !==
|
|
3999
|
+
return $ !== h;
|
|
4003
4000
|
case "contains":
|
|
4004
|
-
return Array.isArray($) && $.includes(
|
|
4001
|
+
return Array.isArray($) && $.includes(h);
|
|
4005
4002
|
case "notContains":
|
|
4006
|
-
return !Array.isArray($) || !$.includes(
|
|
4003
|
+
return !Array.isArray($) || !$.includes(h);
|
|
4007
4004
|
case "greaterThan":
|
|
4008
|
-
return Number($) > Number(
|
|
4005
|
+
return Number($) > Number(h);
|
|
4009
4006
|
case "lessThan":
|
|
4010
|
-
return Number($) < Number(
|
|
4007
|
+
return Number($) < Number(h);
|
|
4011
4008
|
case "isEmpty":
|
|
4012
4009
|
return !$ || Array.isArray($) && $.length === 0;
|
|
4013
4010
|
case "isNotEmpty":
|
|
@@ -4029,7 +4026,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4029
4026
|
}
|
|
4030
4027
|
),
|
|
4031
4028
|
/* @__PURE__ */ e("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: n.description }),
|
|
4032
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: n.fields.map((a, k) =>
|
|
4029
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: n.fields.map((a, k) => x(a) && /* @__PURE__ */ l("div", { style: { marginBottom: "10px" }, children: [
|
|
4033
4030
|
/* @__PURE__ */ l(
|
|
4034
4031
|
"label",
|
|
4035
4032
|
{
|
|
@@ -4054,9 +4051,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4054
4051
|
defaultValue: a.default,
|
|
4055
4052
|
placeholder: a.placeholder,
|
|
4056
4053
|
value: i[a.key] || "",
|
|
4057
|
-
onChange: (
|
|
4058
|
-
const g = { ...i, [a.key]:
|
|
4059
|
-
|
|
4054
|
+
onChange: (h) => {
|
|
4055
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4056
|
+
c(g), s && s(n.key, g);
|
|
4060
4057
|
},
|
|
4061
4058
|
required: a.required,
|
|
4062
4059
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4073,9 +4070,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4073
4070
|
defaultValue: a.default,
|
|
4074
4071
|
placeholder: a.placeholder,
|
|
4075
4072
|
value: i[a.key] || "",
|
|
4076
|
-
onChange: (
|
|
4077
|
-
const g = { ...i, [a.key]:
|
|
4078
|
-
|
|
4073
|
+
onChange: (h) => {
|
|
4074
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4075
|
+
c(g), s && s(n.key, g);
|
|
4079
4076
|
},
|
|
4080
4077
|
rows: 3,
|
|
4081
4078
|
required: a.required,
|
|
@@ -4094,9 +4091,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4094
4091
|
defaultValue: a.default,
|
|
4095
4092
|
placeholder: a.placeholder,
|
|
4096
4093
|
value: i[a.key] || "",
|
|
4097
|
-
onChange: (
|
|
4098
|
-
const g = { ...i, [a.key]:
|
|
4099
|
-
|
|
4094
|
+
onChange: (h) => {
|
|
4095
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4096
|
+
c(g), s && s(n.key, g);
|
|
4100
4097
|
},
|
|
4101
4098
|
required: a.required,
|
|
4102
4099
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4111,9 +4108,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4111
4108
|
{
|
|
4112
4109
|
name: a.key,
|
|
4113
4110
|
checked: !!(i[a.key] || a.default),
|
|
4114
|
-
onChange: (
|
|
4115
|
-
const g = { ...i, [a.key]:
|
|
4116
|
-
|
|
4111
|
+
onChange: (h) => {
|
|
4112
|
+
const g = { ...i, [a.key]: h };
|
|
4113
|
+
c(g), s && s(n.key, g);
|
|
4117
4114
|
},
|
|
4118
4115
|
label: a.placeholder || a.label,
|
|
4119
4116
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4129,9 +4126,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4129
4126
|
name: a.key,
|
|
4130
4127
|
defaultValue: a.default,
|
|
4131
4128
|
value: i[a.key] || "",
|
|
4132
|
-
onChange: (
|
|
4133
|
-
const g = { ...i, [a.key]:
|
|
4134
|
-
|
|
4129
|
+
onChange: (h) => {
|
|
4130
|
+
const g = { ...i, [a.key]: h };
|
|
4131
|
+
c(g);
|
|
4135
4132
|
},
|
|
4136
4133
|
options: a.options || [],
|
|
4137
4134
|
placeholder: a.placeholder || `Select ${a.label}`,
|
|
@@ -4151,9 +4148,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4151
4148
|
defaultValue: a.default,
|
|
4152
4149
|
placeholder: a.placeholder || "Enter email address",
|
|
4153
4150
|
value: i[a.key] || "",
|
|
4154
|
-
onChange: (
|
|
4155
|
-
const g = { ...i, [a.key]:
|
|
4156
|
-
|
|
4151
|
+
onChange: (h) => {
|
|
4152
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4153
|
+
c(g), s && s(n.key, g);
|
|
4157
4154
|
},
|
|
4158
4155
|
required: a.required,
|
|
4159
4156
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4171,9 +4168,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4171
4168
|
defaultValue: a.default,
|
|
4172
4169
|
placeholder: a.placeholder || "Enter URL",
|
|
4173
4170
|
value: i[a.key] || "",
|
|
4174
|
-
onChange: (
|
|
4175
|
-
const g = { ...i, [a.key]:
|
|
4176
|
-
|
|
4171
|
+
onChange: (h) => {
|
|
4172
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4173
|
+
c(g), s && s(n.key, g);
|
|
4177
4174
|
},
|
|
4178
4175
|
required: a.required,
|
|
4179
4176
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4191,9 +4188,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4191
4188
|
defaultValue: a.default,
|
|
4192
4189
|
placeholder: a.placeholder || "Enter password",
|
|
4193
4190
|
value: i[a.key] || "",
|
|
4194
|
-
onChange: (
|
|
4195
|
-
const g = { ...i, [a.key]:
|
|
4196
|
-
|
|
4191
|
+
onChange: (h) => {
|
|
4192
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4193
|
+
c(g), s && s(n.key, g);
|
|
4197
4194
|
},
|
|
4198
4195
|
required: a.required,
|
|
4199
4196
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4207,9 +4204,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4207
4204
|
Ye,
|
|
4208
4205
|
{
|
|
4209
4206
|
selectedItems: i[a.key] || [],
|
|
4210
|
-
onSelectionChange: (
|
|
4211
|
-
const g = { ...i, [a.key]:
|
|
4212
|
-
|
|
4207
|
+
onSelectionChange: (h) => {
|
|
4208
|
+
const g = { ...i, [a.key]: h };
|
|
4209
|
+
c(g), s && s(n.key, g);
|
|
4213
4210
|
},
|
|
4214
4211
|
options: a.options || [],
|
|
4215
4212
|
placeholder: a.placeholder || `Select ${a.label}`,
|
|
@@ -4224,10 +4221,10 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4224
4221
|
Ga,
|
|
4225
4222
|
{
|
|
4226
4223
|
checked: typeof i[a.key] == "boolean" ? i[a.key] : a.default,
|
|
4227
|
-
onChange: (
|
|
4228
|
-
console.log("Toggle changed:", a.key,
|
|
4229
|
-
const g = { ...i, [a.key]:
|
|
4230
|
-
|
|
4224
|
+
onChange: (h) => {
|
|
4225
|
+
console.log("Toggle changed:", a.key, h);
|
|
4226
|
+
const g = { ...i, [a.key]: h };
|
|
4227
|
+
c(g), s && s(n.key, g);
|
|
4231
4228
|
},
|
|
4232
4229
|
label: a.placeholder || a.label,
|
|
4233
4230
|
disabled: a.disabled ? a.disabled : !1
|
|
@@ -4240,9 +4237,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4240
4237
|
{
|
|
4241
4238
|
label: a.label,
|
|
4242
4239
|
value: i[a.key] ? new Date(i[a.key]) : null,
|
|
4243
|
-
onChange: (
|
|
4244
|
-
const g = { ...i, [a.key]:
|
|
4245
|
-
|
|
4240
|
+
onChange: (h) => {
|
|
4241
|
+
const g = { ...i, [a.key]: h ? h.toISOString().split("T")[0] : "" };
|
|
4242
|
+
c(g), s && s(n.key, g);
|
|
4246
4243
|
},
|
|
4247
4244
|
placeholder: a.placeholder || "Select date",
|
|
4248
4245
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4255,9 +4252,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4255
4252
|
{
|
|
4256
4253
|
label: a.label,
|
|
4257
4254
|
value: i[a.key] || { from: null, to: null },
|
|
4258
|
-
onChange: (
|
|
4259
|
-
const g = { ...i, [a.key]:
|
|
4260
|
-
|
|
4255
|
+
onChange: (h) => {
|
|
4256
|
+
const g = { ...i, [a.key]: h };
|
|
4257
|
+
c(g), s && s(n.key, g);
|
|
4261
4258
|
},
|
|
4262
4259
|
placeholder: a.placeholder || "Select date range",
|
|
4263
4260
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4270,9 +4267,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4270
4267
|
Ua,
|
|
4271
4268
|
{
|
|
4272
4269
|
selectedValue: typeof i[a.key] < "u" ? i[a.key] : a.default || "",
|
|
4273
|
-
onValueChange: (
|
|
4274
|
-
const g = { ...i, [a.key]:
|
|
4275
|
-
|
|
4270
|
+
onValueChange: (h) => {
|
|
4271
|
+
const g = { ...i, [a.key]: h };
|
|
4272
|
+
c(g), s && s(n.key, g);
|
|
4276
4273
|
},
|
|
4277
4274
|
options: a.options || [],
|
|
4278
4275
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4282,27 +4279,27 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4282
4279
|
o[n.key]?.[a.key] && /* @__PURE__ */ e("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: o[n.key][a.key] })
|
|
4283
4280
|
] }),
|
|
4284
4281
|
a.fieldtype === "native-radio" && /* @__PURE__ */ l("div", { className: "native-radiogroup-container", children: [
|
|
4285
|
-
(a.options || []).map((
|
|
4282
|
+
(a.options || []).map((h) => /* @__PURE__ */ l("div", { className: "native-radio-option", children: [
|
|
4286
4283
|
/* @__PURE__ */ e(
|
|
4287
4284
|
"input",
|
|
4288
4285
|
{
|
|
4289
4286
|
type: "radio",
|
|
4290
|
-
id: `${a.key}-${
|
|
4287
|
+
id: `${a.key}-${h.value}`,
|
|
4291
4288
|
name: a.key,
|
|
4292
|
-
value:
|
|
4293
|
-
checked: i[a.key] ===
|
|
4289
|
+
value: h.value,
|
|
4290
|
+
checked: i[a.key] === h.value,
|
|
4294
4291
|
onChange: (g) => {
|
|
4295
4292
|
const $ = { ...i, [a.key]: g.target.value };
|
|
4296
|
-
|
|
4293
|
+
c($), s && s(n.key, $);
|
|
4297
4294
|
},
|
|
4298
4295
|
disabled: a.disabled
|
|
4299
4296
|
}
|
|
4300
4297
|
),
|
|
4301
|
-
/* @__PURE__ */ l("label", { htmlFor: `${a.key}-${
|
|
4302
|
-
/* @__PURE__ */ e("span", { className: "native-radio-label", children:
|
|
4303
|
-
|
|
4298
|
+
/* @__PURE__ */ l("label", { htmlFor: `${a.key}-${h.value}`, children: [
|
|
4299
|
+
/* @__PURE__ */ e("span", { className: "native-radio-label", children: h.label }),
|
|
4300
|
+
h.description && /* @__PURE__ */ e("span", { className: "native-radio-description", children: h.description })
|
|
4304
4301
|
] })
|
|
4305
|
-
] },
|
|
4302
|
+
] }, h.value)),
|
|
4306
4303
|
o[n.key]?.[a.key] && /* @__PURE__ */ e("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: o[n.key][a.key] })
|
|
4307
4304
|
] }),
|
|
4308
4305
|
a.fieldtype === "search" && /* @__PURE__ */ l("div", { children: [
|
|
@@ -4310,9 +4307,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4310
4307
|
he,
|
|
4311
4308
|
{
|
|
4312
4309
|
value: i[a.key] || "",
|
|
4313
|
-
onChange: (
|
|
4314
|
-
const g = { ...i, [a.key]:
|
|
4315
|
-
|
|
4310
|
+
onChange: (h) => {
|
|
4311
|
+
const g = { ...i, [a.key]: h };
|
|
4312
|
+
c(g), s && s(n.key, g);
|
|
4316
4313
|
},
|
|
4317
4314
|
placeholder: a.placeholder || `Search ${a.label}`,
|
|
4318
4315
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4329,9 +4326,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4329
4326
|
defaultValue: a.default,
|
|
4330
4327
|
placeholder: a.placeholder || "Select date and time",
|
|
4331
4328
|
value: i[a.key] || "",
|
|
4332
|
-
onChange: (
|
|
4333
|
-
const g = { ...i, [a.key]:
|
|
4334
|
-
|
|
4329
|
+
onChange: (h) => {
|
|
4330
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4331
|
+
c(g), s && s(n.key, g);
|
|
4335
4332
|
},
|
|
4336
4333
|
required: a.required,
|
|
4337
4334
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4348,9 +4345,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4348
4345
|
defaultValue: a.default,
|
|
4349
4346
|
placeholder: a.placeholder || "Select time",
|
|
4350
4347
|
value: i[a.key] || "",
|
|
4351
|
-
onChange: (
|
|
4352
|
-
const g = { ...i, [a.key]:
|
|
4353
|
-
|
|
4348
|
+
onChange: (h) => {
|
|
4349
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4350
|
+
c(g), s && s(n.key, g);
|
|
4354
4351
|
},
|
|
4355
4352
|
required: a.required,
|
|
4356
4353
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4366,9 +4363,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4366
4363
|
name: a.key,
|
|
4367
4364
|
defaultValue: a.default || "#000000",
|
|
4368
4365
|
value: i[a.key] || "#000000",
|
|
4369
|
-
onChange: (
|
|
4370
|
-
const g = { ...i, [a.key]:
|
|
4371
|
-
|
|
4366
|
+
onChange: (h) => {
|
|
4367
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4368
|
+
c(g), s && s(n.key, g);
|
|
4372
4369
|
},
|
|
4373
4370
|
className: `w-full h-10 ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
4374
4371
|
}
|
|
@@ -4383,9 +4380,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4383
4380
|
name: a.key,
|
|
4384
4381
|
defaultValue: a.default || a.min || 0,
|
|
4385
4382
|
value: i[a.key] || a.min || 0,
|
|
4386
|
-
onChange: (
|
|
4387
|
-
const g = { ...i, [a.key]:
|
|
4388
|
-
|
|
4383
|
+
onChange: (h) => {
|
|
4384
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4385
|
+
c(g), s && s(n.key, g);
|
|
4389
4386
|
},
|
|
4390
4387
|
min: a.min || 0,
|
|
4391
4388
|
max: a.max || 100,
|
|
@@ -4409,9 +4406,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4409
4406
|
{
|
|
4410
4407
|
type: "file",
|
|
4411
4408
|
name: a.key,
|
|
4412
|
-
onChange: (
|
|
4413
|
-
const g =
|
|
4414
|
-
|
|
4409
|
+
onChange: (h) => {
|
|
4410
|
+
const g = h.target.files[0], $ = { ...i, [a.key]: g ? g.name : "" };
|
|
4411
|
+
c($), s && s(n.key, $);
|
|
4415
4412
|
},
|
|
4416
4413
|
accept: a.accept,
|
|
4417
4414
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4426,9 +4423,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4426
4423
|
endpoints: a.endpoints || {},
|
|
4427
4424
|
initialData: i[a.key] || a.initialData || [],
|
|
4428
4425
|
className: a.className || "",
|
|
4429
|
-
onCollectionChange: (
|
|
4430
|
-
const g = { ...i, [a.key]:
|
|
4431
|
-
|
|
4426
|
+
onCollectionChange: (h) => {
|
|
4427
|
+
const g = { ...i, [a.key]: h };
|
|
4428
|
+
c(g), s && s(n.key, g);
|
|
4432
4429
|
},
|
|
4433
4430
|
showSearch: a.showSearch !== !1,
|
|
4434
4431
|
allowAdd: a.allowAdd !== !1,
|
|
@@ -4456,278 +4453,278 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4456
4453
|
const zn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
4457
4454
|
function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
4458
4455
|
console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
|
|
4459
|
-
const [n, u] = B(t), [i,
|
|
4456
|
+
const [n, u] = B(t), [i, c] = B(null), [y, v] = B(null);
|
|
4460
4457
|
console.log(`[DataTableRenderer] ${n.key} - Received props:`, { item: t, initialData: r });
|
|
4461
|
-
const [
|
|
4462
|
-
const
|
|
4458
|
+
const [x, a] = B(() => {
|
|
4459
|
+
const N = r && r[n.key] || [], p = N.length > 0 ? N : [{ id: 0 }];
|
|
4463
4460
|
return console.log(`[DataTableRenderer] ${n.key} - Initial data:`, p), p;
|
|
4464
4461
|
}), k = ue(r);
|
|
4465
4462
|
X(() => {
|
|
4466
4463
|
if (console.log(`[DataTableRenderer] ${n.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${n.key} - Previous:`, k.current), console.log(`[DataTableRenderer] ${n.key} - Current:`, r), k.current !== r) {
|
|
4467
4464
|
k.current = r;
|
|
4468
|
-
const
|
|
4465
|
+
const N = r && r[n.key] || [], p = N.length > 0 ? N : [{ id: 0 }];
|
|
4469
4466
|
console.log(`[DataTableRenderer] ${n.key} - Setting new data:`, p), a(p);
|
|
4470
4467
|
}
|
|
4471
4468
|
}, [r, n.key]);
|
|
4472
|
-
const
|
|
4469
|
+
const h = ue(x), g = ue(null);
|
|
4473
4470
|
X(() => {
|
|
4474
|
-
|
|
4475
|
-
s(n.key,
|
|
4471
|
+
h.current !== x && s && typeof s == "function" && (h.current = x, g.current && clearTimeout(g.current), g.current = setTimeout(() => {
|
|
4472
|
+
s(n.key, x);
|
|
4476
4473
|
}, 300));
|
|
4477
|
-
}, [n.key,
|
|
4474
|
+
}, [n.key, x, s]), X(() => () => {
|
|
4478
4475
|
g.current && clearTimeout(g.current);
|
|
4479
4476
|
}, []);
|
|
4480
|
-
const $ = (
|
|
4481
|
-
const p = (
|
|
4482
|
-
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex:
|
|
4483
|
-
const
|
|
4484
|
-
return
|
|
4477
|
+
const $ = (N) => {
|
|
4478
|
+
const p = (d, m) => {
|
|
4479
|
+
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: d, value: m, type: typeof m }), a((b) => {
|
|
4480
|
+
const D = [...b];
|
|
4481
|
+
return D[d][N.key] = m, D;
|
|
4485
4482
|
});
|
|
4486
|
-
}, f = (
|
|
4487
|
-
const
|
|
4488
|
-
return
|
|
4483
|
+
}, f = (d) => o[n.key]?.[d]?.[N.key], w = (d) => {
|
|
4484
|
+
const m = f(d);
|
|
4485
|
+
return m ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: m }) : null;
|
|
4489
4486
|
};
|
|
4490
|
-
switch (
|
|
4487
|
+
switch (N.fieldtype) {
|
|
4491
4488
|
case "text":
|
|
4492
|
-
return (
|
|
4489
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4493
4490
|
/* @__PURE__ */ e(
|
|
4494
4491
|
Y,
|
|
4495
4492
|
{
|
|
4496
|
-
value:
|
|
4497
|
-
onChange: (
|
|
4498
|
-
placeholder:
|
|
4499
|
-
required:
|
|
4500
|
-
className: `w-full ${f(
|
|
4493
|
+
value: d[N.key] || "",
|
|
4494
|
+
onChange: (b) => p(m, b.target.value),
|
|
4495
|
+
placeholder: N.placeholder || `Enter ${N.label}`,
|
|
4496
|
+
required: N.required,
|
|
4497
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4501
4498
|
}
|
|
4502
4499
|
),
|
|
4503
|
-
w(
|
|
4500
|
+
w(m)
|
|
4504
4501
|
] });
|
|
4505
4502
|
case "textarea":
|
|
4506
|
-
return (
|
|
4503
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4507
4504
|
/* @__PURE__ */ e(
|
|
4508
4505
|
ja,
|
|
4509
4506
|
{
|
|
4510
|
-
value:
|
|
4511
|
-
onChange: (
|
|
4512
|
-
placeholder:
|
|
4513
|
-
required:
|
|
4514
|
-
className: `w-full ${f(
|
|
4507
|
+
value: d[N.key] || "",
|
|
4508
|
+
onChange: (b) => p(m, b.target.value),
|
|
4509
|
+
placeholder: N.placeholder || `Enter ${N.label}`,
|
|
4510
|
+
required: N.required,
|
|
4511
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`,
|
|
4515
4512
|
rows: 3
|
|
4516
4513
|
}
|
|
4517
4514
|
),
|
|
4518
|
-
w(
|
|
4515
|
+
w(m)
|
|
4519
4516
|
] });
|
|
4520
4517
|
case "number":
|
|
4521
|
-
return (
|
|
4518
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4522
4519
|
/* @__PURE__ */ e(
|
|
4523
4520
|
Y,
|
|
4524
4521
|
{
|
|
4525
4522
|
type: "number",
|
|
4526
|
-
value:
|
|
4527
|
-
onChange: (
|
|
4528
|
-
placeholder:
|
|
4529
|
-
required:
|
|
4530
|
-
className: `w-full ${f(
|
|
4523
|
+
value: d[N.key] || "",
|
|
4524
|
+
onChange: (b) => p(m, b.target.value),
|
|
4525
|
+
placeholder: N.placeholder || `Enter ${N.label}`,
|
|
4526
|
+
required: N.required,
|
|
4527
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4531
4528
|
}
|
|
4532
4529
|
),
|
|
4533
|
-
w(
|
|
4530
|
+
w(m)
|
|
4534
4531
|
] });
|
|
4535
4532
|
case "email":
|
|
4536
|
-
return (
|
|
4533
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4537
4534
|
/* @__PURE__ */ e(
|
|
4538
4535
|
Y,
|
|
4539
4536
|
{
|
|
4540
4537
|
type: "email",
|
|
4541
|
-
value:
|
|
4542
|
-
onChange: (
|
|
4543
|
-
placeholder:
|
|
4544
|
-
required:
|
|
4545
|
-
className: `w-full ${f(
|
|
4538
|
+
value: d[N.key] || "",
|
|
4539
|
+
onChange: (b) => p(m, b.target.value),
|
|
4540
|
+
placeholder: N.placeholder || "Enter email address",
|
|
4541
|
+
required: N.required,
|
|
4542
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4546
4543
|
}
|
|
4547
4544
|
),
|
|
4548
|
-
w(
|
|
4545
|
+
w(m)
|
|
4549
4546
|
] });
|
|
4550
4547
|
case "url":
|
|
4551
|
-
return (
|
|
4548
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4552
4549
|
/* @__PURE__ */ e(
|
|
4553
4550
|
Y,
|
|
4554
4551
|
{
|
|
4555
4552
|
type: "url",
|
|
4556
|
-
value:
|
|
4557
|
-
onChange: (
|
|
4558
|
-
placeholder:
|
|
4559
|
-
required:
|
|
4560
|
-
className: `w-full ${f(
|
|
4553
|
+
value: d[N.key] || "",
|
|
4554
|
+
onChange: (b) => p(m, b.target.value),
|
|
4555
|
+
placeholder: N.placeholder || "Enter URL",
|
|
4556
|
+
required: N.required,
|
|
4557
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4561
4558
|
}
|
|
4562
4559
|
),
|
|
4563
|
-
w(
|
|
4560
|
+
w(m)
|
|
4564
4561
|
] });
|
|
4565
4562
|
case "password":
|
|
4566
|
-
return (
|
|
4563
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4567
4564
|
/* @__PURE__ */ e(
|
|
4568
4565
|
Y,
|
|
4569
4566
|
{
|
|
4570
4567
|
type: "password",
|
|
4571
|
-
value:
|
|
4572
|
-
onChange: (
|
|
4573
|
-
placeholder:
|
|
4574
|
-
required:
|
|
4575
|
-
className: `w-full ${f(
|
|
4568
|
+
value: d[N.key] || "",
|
|
4569
|
+
onChange: (b) => p(m, b.target.value),
|
|
4570
|
+
placeholder: N.placeholder || "Enter password",
|
|
4571
|
+
required: N.required,
|
|
4572
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4576
4573
|
}
|
|
4577
4574
|
),
|
|
4578
|
-
w(
|
|
4575
|
+
w(m)
|
|
4579
4576
|
] });
|
|
4580
4577
|
case "select":
|
|
4581
4578
|
case "dropdown":
|
|
4582
|
-
return (
|
|
4579
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4583
4580
|
/* @__PURE__ */ e(
|
|
4584
4581
|
ra,
|
|
4585
4582
|
{
|
|
4586
|
-
value:
|
|
4587
|
-
onChange: (
|
|
4588
|
-
options:
|
|
4589
|
-
placeholder:
|
|
4590
|
-
required:
|
|
4591
|
-
className: `w-full ${f(
|
|
4583
|
+
value: d[N.key] || "",
|
|
4584
|
+
onChange: (b) => p(m, b),
|
|
4585
|
+
options: N.options || [],
|
|
4586
|
+
placeholder: N.placeholder || `Select ${N.label}`,
|
|
4587
|
+
required: N.required,
|
|
4588
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4592
4589
|
}
|
|
4593
4590
|
),
|
|
4594
|
-
w(
|
|
4591
|
+
w(m)
|
|
4595
4592
|
] });
|
|
4596
4593
|
case "selectDynamic":
|
|
4597
|
-
return (
|
|
4598
|
-
const
|
|
4599
|
-
if (
|
|
4600
|
-
const { config:
|
|
4594
|
+
return (d, m) => {
|
|
4595
|
+
const b = () => {
|
|
4596
|
+
if (N.optionsFrom && r) {
|
|
4597
|
+
const { config: D, valueField: R, labelField: j } = N.optionsFrom, S = r[D] || [];
|
|
4601
4598
|
if (Array.isArray(S))
|
|
4602
4599
|
return S.map((A) => ({
|
|
4603
|
-
id: A[
|
|
4604
|
-
value: A[
|
|
4600
|
+
id: A[R] || "",
|
|
4601
|
+
value: A[R] || "",
|
|
4605
4602
|
label: A[j] || ""
|
|
4606
4603
|
}));
|
|
4607
4604
|
}
|
|
4608
|
-
return
|
|
4605
|
+
return N.options || [];
|
|
4609
4606
|
};
|
|
4610
4607
|
return /* @__PURE__ */ l("div", { children: [
|
|
4611
4608
|
/* @__PURE__ */ e(
|
|
4612
4609
|
ra,
|
|
4613
4610
|
{
|
|
4614
|
-
index:
|
|
4615
|
-
value:
|
|
4616
|
-
onChange: (
|
|
4617
|
-
options:
|
|
4618
|
-
placeholder:
|
|
4619
|
-
required:
|
|
4620
|
-
className: `w-full ${f(
|
|
4611
|
+
index: m,
|
|
4612
|
+
value: d[N.key] || "",
|
|
4613
|
+
onChange: (D) => p(m, D),
|
|
4614
|
+
options: b(),
|
|
4615
|
+
placeholder: N.placeholder || `Select ${N.label}`,
|
|
4616
|
+
required: N.required,
|
|
4617
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4621
4618
|
},
|
|
4622
4619
|
Math.random()
|
|
4623
4620
|
),
|
|
4624
|
-
w(
|
|
4621
|
+
w(m)
|
|
4625
4622
|
] });
|
|
4626
4623
|
};
|
|
4627
4624
|
case "multiselect":
|
|
4628
|
-
return (
|
|
4629
|
-
const
|
|
4625
|
+
return (d, m) => {
|
|
4626
|
+
const b = d[N.key] || [];
|
|
4630
4627
|
return /* @__PURE__ */ e(
|
|
4631
4628
|
Ye,
|
|
4632
4629
|
{
|
|
4633
|
-
selectedItems:
|
|
4634
|
-
onSelectionChange: (
|
|
4635
|
-
options:
|
|
4636
|
-
placeholder:
|
|
4630
|
+
selectedItems: b,
|
|
4631
|
+
onSelectionChange: (D) => p(m, D),
|
|
4632
|
+
options: N.options || [],
|
|
4633
|
+
placeholder: N.placeholder || `Select ${N.label}`,
|
|
4637
4634
|
className: "w-full"
|
|
4638
4635
|
}
|
|
4639
4636
|
);
|
|
4640
4637
|
};
|
|
4641
4638
|
case "checkbox":
|
|
4642
4639
|
case "boolean":
|
|
4643
|
-
return (
|
|
4640
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4644
4641
|
Pa,
|
|
4645
4642
|
{
|
|
4646
|
-
checked: !!
|
|
4647
|
-
onChange: (
|
|
4648
|
-
label:
|
|
4643
|
+
checked: !!d[N.key],
|
|
4644
|
+
onChange: (b) => p(m, b),
|
|
4645
|
+
label: N.placeholder || N.label,
|
|
4649
4646
|
className: "w-full"
|
|
4650
4647
|
}
|
|
4651
4648
|
);
|
|
4652
4649
|
case "toggle":
|
|
4653
4650
|
case "switch":
|
|
4654
|
-
return (
|
|
4651
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4655
4652
|
Ga,
|
|
4656
4653
|
{
|
|
4657
|
-
isOn: !!
|
|
4658
|
-
onToggle: (
|
|
4659
|
-
label:
|
|
4654
|
+
isOn: !!d[N.key],
|
|
4655
|
+
onToggle: (b) => p(m, b),
|
|
4656
|
+
label: N.placeholder || N.label,
|
|
4660
4657
|
className: "w-full"
|
|
4661
4658
|
}
|
|
4662
4659
|
);
|
|
4663
4660
|
case "date":
|
|
4664
|
-
return (
|
|
4661
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4665
4662
|
Ma,
|
|
4666
4663
|
{
|
|
4667
|
-
selectedDate:
|
|
4668
|
-
onDateChange: (
|
|
4669
|
-
placeholder:
|
|
4664
|
+
selectedDate: d[N.key] ? new Date(d[N.key]) : null,
|
|
4665
|
+
onDateChange: (b) => p(m, b ? b.toISOString().split("T")[0] : ""),
|
|
4666
|
+
placeholder: N.placeholder || "Select date",
|
|
4670
4667
|
className: "w-full"
|
|
4671
4668
|
}
|
|
4672
4669
|
);
|
|
4673
4670
|
case "datetime":
|
|
4674
|
-
return (
|
|
4671
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4675
4672
|
Y,
|
|
4676
4673
|
{
|
|
4677
4674
|
type: "datetime-local",
|
|
4678
|
-
value:
|
|
4679
|
-
onChange: (
|
|
4680
|
-
placeholder:
|
|
4681
|
-
required:
|
|
4675
|
+
value: d[N.key] || "",
|
|
4676
|
+
onChange: (b) => p(m, b.target.value),
|
|
4677
|
+
placeholder: N.placeholder || "Select date and time",
|
|
4678
|
+
required: N.required,
|
|
4682
4679
|
className: "w-full"
|
|
4683
4680
|
}
|
|
4684
4681
|
);
|
|
4685
4682
|
case "time":
|
|
4686
|
-
return (
|
|
4683
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4687
4684
|
Y,
|
|
4688
4685
|
{
|
|
4689
4686
|
type: "time",
|
|
4690
|
-
value:
|
|
4691
|
-
onChange: (
|
|
4692
|
-
placeholder:
|
|
4693
|
-
required:
|
|
4687
|
+
value: d[N.key] || "",
|
|
4688
|
+
onChange: (b) => p(m, b.target.value),
|
|
4689
|
+
placeholder: N.placeholder || "Select time",
|
|
4690
|
+
required: N.required,
|
|
4694
4691
|
className: "w-full"
|
|
4695
4692
|
}
|
|
4696
4693
|
);
|
|
4697
4694
|
case "radio":
|
|
4698
|
-
return (
|
|
4695
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4699
4696
|
Ua,
|
|
4700
4697
|
{
|
|
4701
|
-
selectedValue:
|
|
4702
|
-
onValueChange: (
|
|
4703
|
-
options:
|
|
4698
|
+
selectedValue: d[N.key] || "",
|
|
4699
|
+
onValueChange: (b) => p(m, b),
|
|
4700
|
+
options: N.options || [],
|
|
4704
4701
|
className: "w-full"
|
|
4705
4702
|
}
|
|
4706
4703
|
);
|
|
4707
4704
|
case "search":
|
|
4708
|
-
return (
|
|
4705
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4709
4706
|
he,
|
|
4710
4707
|
{
|
|
4711
|
-
value:
|
|
4712
|
-
onChange: (
|
|
4713
|
-
placeholder:
|
|
4708
|
+
value: d[N.key] || "",
|
|
4709
|
+
onChange: (b) => p(m, b),
|
|
4710
|
+
placeholder: N.placeholder || `Search ${N.label}`,
|
|
4714
4711
|
className: "w-full"
|
|
4715
4712
|
}
|
|
4716
4713
|
);
|
|
4717
4714
|
case "audience":
|
|
4718
|
-
return (
|
|
4719
|
-
const
|
|
4720
|
-
...
|
|
4721
|
-
...
|
|
4722
|
-
...
|
|
4715
|
+
return (d, m) => {
|
|
4716
|
+
const b = d[N.key] || { users: [], groups: [], roles: [] }, D = [
|
|
4717
|
+
...b.users || [],
|
|
4718
|
+
...b.groups || [],
|
|
4719
|
+
...b.roles || []
|
|
4723
4720
|
];
|
|
4724
4721
|
return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
4725
|
-
/* @__PURE__ */ e(zn, { children:
|
|
4722
|
+
/* @__PURE__ */ e(zn, { children: D.length > 0 ? D.slice(0, 3).map((R, j) => /* @__PURE__ */ e(
|
|
4726
4723
|
za,
|
|
4727
4724
|
{
|
|
4728
4725
|
size: "small",
|
|
4729
|
-
name:
|
|
4730
|
-
src:
|
|
4726
|
+
name: R.name || R.displayName || R.id,
|
|
4727
|
+
src: R.avatarUrl
|
|
4731
4728
|
},
|
|
4732
4729
|
j
|
|
4733
4730
|
)) : null }),
|
|
@@ -4736,121 +4733,121 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4736
4733
|
{
|
|
4737
4734
|
className: "text-blue-600 font-semibold hover:text-blue-800",
|
|
4738
4735
|
onClick: () => {
|
|
4739
|
-
|
|
4736
|
+
v(N.key), c(m);
|
|
4740
4737
|
},
|
|
4741
|
-
children:
|
|
4738
|
+
children: D.length > 0 ? "Edit" : "Assign"
|
|
4742
4739
|
}
|
|
4743
4740
|
)
|
|
4744
4741
|
] });
|
|
4745
4742
|
};
|
|
4746
4743
|
case "color":
|
|
4747
|
-
return (
|
|
4744
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4748
4745
|
Y,
|
|
4749
4746
|
{
|
|
4750
4747
|
type: "color",
|
|
4751
|
-
value:
|
|
4752
|
-
onChange: (
|
|
4748
|
+
value: d[N.key] || "#000000",
|
|
4749
|
+
onChange: (b) => p(m, b.target.value),
|
|
4753
4750
|
className: "w-full h-10"
|
|
4754
4751
|
}
|
|
4755
4752
|
);
|
|
4756
4753
|
case "range":
|
|
4757
|
-
return (
|
|
4754
|
+
return (d, m) => /* @__PURE__ */ l("div", { className: "w-full", children: [
|
|
4758
4755
|
/* @__PURE__ */ e(
|
|
4759
4756
|
Y,
|
|
4760
4757
|
{
|
|
4761
4758
|
type: "range",
|
|
4762
|
-
value:
|
|
4763
|
-
onChange: (
|
|
4764
|
-
min:
|
|
4765
|
-
max:
|
|
4766
|
-
step:
|
|
4759
|
+
value: d[N.key] || N.min || 0,
|
|
4760
|
+
onChange: (b) => p(m, b.target.value),
|
|
4761
|
+
min: N.min || 0,
|
|
4762
|
+
max: N.max || 100,
|
|
4763
|
+
step: N.step || 1,
|
|
4767
4764
|
className: "w-full"
|
|
4768
4765
|
}
|
|
4769
4766
|
),
|
|
4770
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children:
|
|
4767
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: d[N.key] || N.min || 0 })
|
|
4771
4768
|
] });
|
|
4772
4769
|
case "file":
|
|
4773
|
-
return (
|
|
4770
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4774
4771
|
Y,
|
|
4775
4772
|
{
|
|
4776
4773
|
type: "file",
|
|
4777
|
-
onChange: (
|
|
4778
|
-
const
|
|
4779
|
-
p(
|
|
4774
|
+
onChange: (b) => {
|
|
4775
|
+
const D = b.target.files[0];
|
|
4776
|
+
p(m, D ? D.name : "");
|
|
4780
4777
|
},
|
|
4781
|
-
accept:
|
|
4778
|
+
accept: N.accept,
|
|
4782
4779
|
className: "w-full"
|
|
4783
4780
|
}
|
|
4784
4781
|
);
|
|
4785
4782
|
case "hidden":
|
|
4786
|
-
return (
|
|
4783
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4787
4784
|
Y,
|
|
4788
4785
|
{
|
|
4789
4786
|
type: "hidden",
|
|
4790
|
-
value:
|
|
4791
|
-
onChange: (
|
|
4787
|
+
value: d[N.key] || "",
|
|
4788
|
+
onChange: (b) => p(m, b.target.value)
|
|
4792
4789
|
}
|
|
4793
4790
|
);
|
|
4794
4791
|
// Default fallback for unknown field types
|
|
4795
4792
|
default:
|
|
4796
|
-
return (
|
|
4793
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4797
4794
|
/* @__PURE__ */ e(
|
|
4798
4795
|
Y,
|
|
4799
4796
|
{
|
|
4800
|
-
value:
|
|
4801
|
-
onChange: (
|
|
4802
|
-
placeholder:
|
|
4803
|
-
required:
|
|
4804
|
-
className: `w-full ${f(
|
|
4797
|
+
value: d[N.key] || "",
|
|
4798
|
+
onChange: (b) => p(m, b.target.value),
|
|
4799
|
+
placeholder: N.placeholder || `Enter ${N.label}`,
|
|
4800
|
+
required: N.required,
|
|
4801
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4805
4802
|
}
|
|
4806
4803
|
),
|
|
4807
|
-
w(
|
|
4804
|
+
w(m)
|
|
4808
4805
|
] });
|
|
4809
4806
|
}
|
|
4810
4807
|
}, L = K(() => {
|
|
4811
|
-
console.log("[DataTableRenderer] Adding blank row"), a((
|
|
4812
|
-
console.log("[DataTableRenderer] Current data before add:",
|
|
4808
|
+
console.log("[DataTableRenderer] Adding blank row"), a((N) => {
|
|
4809
|
+
console.log("[DataTableRenderer] Current data before add:", N);
|
|
4813
4810
|
const p = {
|
|
4814
|
-
id:
|
|
4811
|
+
id: N.length
|
|
4815
4812
|
// Assign next available ID
|
|
4816
4813
|
};
|
|
4817
4814
|
n.fields.forEach((w) => {
|
|
4818
4815
|
w.fieldtype === "audience" ? p[w.key] = { users: [], groups: [], roles: [] } : p[w.key] = w.default || "";
|
|
4819
4816
|
}), console.log("[DataTableRenderer] New blank row:", p);
|
|
4820
|
-
const f = [...
|
|
4817
|
+
const f = [...N, p];
|
|
4821
4818
|
return console.log("[DataTableRenderer] Updated data:", f), f;
|
|
4822
4819
|
});
|
|
4823
|
-
}, [n.fields]), O = K((
|
|
4820
|
+
}, [n.fields]), O = K((N) => {
|
|
4824
4821
|
a((p) => {
|
|
4825
4822
|
if (p.length <= 1)
|
|
4826
4823
|
return p;
|
|
4827
4824
|
const f = [...p];
|
|
4828
|
-
return f.splice(
|
|
4825
|
+
return f.splice(N, 1), f;
|
|
4829
4826
|
});
|
|
4830
|
-
}, []), [C, T] = B(null),
|
|
4831
|
-
T(p),
|
|
4832
|
-
}, []),
|
|
4833
|
-
|
|
4834
|
-
}, []), V = K((
|
|
4835
|
-
|
|
4836
|
-
const w = [...f],
|
|
4837
|
-
return w.splice(C, 1), w.splice(p, 0,
|
|
4827
|
+
}, []), [C, T] = B(null), I = K((N, p) => {
|
|
4828
|
+
T(p), N.dataTransfer.effectAllowed = "move", N.dataTransfer.setData("text/html", "");
|
|
4829
|
+
}, []), E = K((N) => {
|
|
4830
|
+
N.preventDefault(), N.dataTransfer.dropEffect = "move";
|
|
4831
|
+
}, []), V = K((N, p) => {
|
|
4832
|
+
N.preventDefault(), !(C === null || C === p) && (a((f) => {
|
|
4833
|
+
const w = [...f], d = w[C];
|
|
4834
|
+
return w.splice(C, 1), w.splice(p, 0, d), w;
|
|
4838
4835
|
}), T(null));
|
|
4839
4836
|
}, [C]), q = K(() => {
|
|
4840
4837
|
T(null);
|
|
4841
|
-
}, []), G = K((
|
|
4842
|
-
console.log("[DataTableRenderer] handleAddAudience called with:",
|
|
4838
|
+
}, []), G = K((N) => {
|
|
4839
|
+
console.log("[DataTableRenderer] handleAddAudience called with:", N), a((p) => {
|
|
4843
4840
|
const f = [...p];
|
|
4844
4841
|
if (i !== null && y && f[i]) {
|
|
4845
|
-
const w =
|
|
4842
|
+
const w = N.pendingInvites || [], d = w.filter((D) => D.type === "User"), m = w.filter((D) => D.type === "Group"), b = w.filter((D) => D.type === "Role");
|
|
4846
4843
|
f[i][y] = {
|
|
4847
|
-
users: [...f[i][y]?.users || [], ...
|
|
4848
|
-
groups: [...f[i][y]?.groups || [], ...
|
|
4849
|
-
roles: [...f[i][y]?.roles || [], ...
|
|
4844
|
+
users: [...f[i][y]?.users || [], ...d],
|
|
4845
|
+
groups: [...f[i][y]?.groups || [], ...m],
|
|
4846
|
+
roles: [...f[i][y]?.roles || [], ...b]
|
|
4850
4847
|
}, console.log("[DataTableRenderer] Updated audience data:", f[i][y]);
|
|
4851
4848
|
}
|
|
4852
4849
|
return f;
|
|
4853
|
-
}),
|
|
4850
|
+
}), c(null), v(null);
|
|
4854
4851
|
}, [i, y]);
|
|
4855
4852
|
return /* @__PURE__ */ l("div", { children: [
|
|
4856
4853
|
/* @__PURE__ */ l("div", { style: { marginBottom: "20px" }, children: [
|
|
@@ -4870,28 +4867,28 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4870
4867
|
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ l("table", { className: "min-w-full bg-white border border-gray-300", style: { marginBottom: "20px" }, children: [
|
|
4871
4868
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "bg-gray-50", children: [
|
|
4872
4869
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-10" }),
|
|
4873
|
-
n.fields.map((
|
|
4870
|
+
n.fields.map((N, p) => /* @__PURE__ */ e(
|
|
4874
4871
|
"th",
|
|
4875
4872
|
{
|
|
4876
4873
|
className: "px-4 py-2 text-left text-sm font-medium text-gray-700",
|
|
4877
|
-
children:
|
|
4874
|
+
children: N.label || N.key
|
|
4878
4875
|
},
|
|
4879
4876
|
p
|
|
4880
4877
|
)),
|
|
4881
4878
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-16" })
|
|
4882
4879
|
] }) }),
|
|
4883
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
4880
|
+
/* @__PURE__ */ e("tbody", { children: x.map((N, p) => /* @__PURE__ */ l(
|
|
4884
4881
|
"tr",
|
|
4885
4882
|
{
|
|
4886
4883
|
className: `hover:bg-gray-50 ${C === p ? "opacity-50" : ""}`,
|
|
4887
4884
|
draggable: !0,
|
|
4888
|
-
onDragStart: (f) =>
|
|
4889
|
-
onDragOver:
|
|
4885
|
+
onDragStart: (f) => I(f, p),
|
|
4886
|
+
onDragOver: E,
|
|
4890
4887
|
onDrop: (f) => V(f, p),
|
|
4891
4888
|
onDragEnd: q,
|
|
4892
4889
|
children: [
|
|
4893
4890
|
/* @__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(sa, { size: 16 }) }) }),
|
|
4894
|
-
n.fields.map((f, w) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: $(f)(
|
|
4891
|
+
n.fields.map((f, w) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: $(f)(N, p) }, w)),
|
|
4895
4892
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
4896
4893
|
"button",
|
|
4897
4894
|
{
|
|
@@ -4907,20 +4904,20 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4907
4904
|
)) })
|
|
4908
4905
|
] }) }),
|
|
4909
4906
|
i !== null && (() => {
|
|
4910
|
-
const
|
|
4911
|
-
users:
|
|
4912
|
-
groups:
|
|
4913
|
-
roles:
|
|
4907
|
+
const N = x[i] && x[i][y] ? {
|
|
4908
|
+
users: x[i][y].users || [],
|
|
4909
|
+
groups: x[i][y].groups || [],
|
|
4910
|
+
roles: x[i][y].roles || []
|
|
4914
4911
|
} : { users: [], groups: [], roles: [] };
|
|
4915
|
-
return console.log("[DataTableRenderer] Opening modal with existing data:",
|
|
4912
|
+
return console.log("[DataTableRenderer] Opening modal with existing data:", N), console.log("[DataTableRenderer] Row data:", x[i]), console.log("[DataTableRenderer] Field name:", y), /* @__PURE__ */ e(
|
|
4916
4913
|
kn,
|
|
4917
4914
|
{
|
|
4918
4915
|
isOpen: !0,
|
|
4919
4916
|
onClose: () => {
|
|
4920
|
-
|
|
4917
|
+
c(null), v(null);
|
|
4921
4918
|
},
|
|
4922
4919
|
onFinalSubmit: G,
|
|
4923
|
-
existingShares:
|
|
4920
|
+
existingShares: N,
|
|
4924
4921
|
allowedPermissions: ["view", "remove"]
|
|
4925
4922
|
}
|
|
4926
4923
|
);
|
|
@@ -4990,33 +4987,33 @@ const fa = () => {
|
|
|
4990
4987
|
allowAdd: n = !0,
|
|
4991
4988
|
allowEdit: u = !0,
|
|
4992
4989
|
allowDelete: i = !0,
|
|
4993
|
-
allowReorder:
|
|
4990
|
+
allowReorder: c = !0,
|
|
4994
4991
|
initialData: y = null
|
|
4995
4992
|
// Add prop for initial demo data
|
|
4996
4993
|
}) => {
|
|
4997
|
-
const [
|
|
4994
|
+
const [v, x] = B(null), [a, k] = B(""), [h, g] = B(() => Array.isArray(y) ? y : []), [$, L] = B(null), [O, C] = B(null), [T, I] = B(""), E = async () => {
|
|
4998
4995
|
try {
|
|
4999
4996
|
const S = await Ee(t.collectionList);
|
|
5000
4997
|
if (S) {
|
|
5001
|
-
const A = S.map((M,
|
|
4998
|
+
const A = S.map((M, F) => ({
|
|
5002
4999
|
...M,
|
|
5003
|
-
order: typeof M.order == "number" ? M.order :
|
|
5000
|
+
order: typeof M.order == "number" ? M.order : F + 1
|
|
5004
5001
|
}));
|
|
5005
|
-
A.sort((M,
|
|
5002
|
+
A.sort((M, F) => (M.order ?? 0) - (F.order ?? 0)), g(A), s?.(A);
|
|
5006
5003
|
}
|
|
5007
5004
|
} catch (S) {
|
|
5008
5005
|
console.log("Error loading collections:", S), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
|
|
5009
5006
|
}
|
|
5010
5007
|
};
|
|
5011
5008
|
X(() => {
|
|
5012
|
-
(!y || y.length === 0) &&
|
|
5009
|
+
(!y || y.length === 0) && E();
|
|
5013
5010
|
}, [y]), X(() => {
|
|
5014
5011
|
Array.isArray(y) && g(y);
|
|
5015
5012
|
}, [y]);
|
|
5016
5013
|
const V = (S) => {
|
|
5017
|
-
u && (
|
|
5014
|
+
u && (x(S.id), k(S.categoryName || ""));
|
|
5018
5015
|
}, q = () => {
|
|
5019
|
-
if (!n ||
|
|
5016
|
+
if (!n || v !== null) return;
|
|
5020
5017
|
const S = `temp-${Date.now()}`;
|
|
5021
5018
|
g((A) => [
|
|
5022
5019
|
...A,
|
|
@@ -5027,52 +5024,52 @@ const fa = () => {
|
|
|
5027
5024
|
order: (A.at(-1)?.order ?? 0) + 1,
|
|
5028
5025
|
_temp: !0
|
|
5029
5026
|
}
|
|
5030
|
-
]),
|
|
5027
|
+
]), x(S), k("");
|
|
5031
5028
|
}, G = () => {
|
|
5032
|
-
|
|
5033
|
-
const A = S.find((
|
|
5029
|
+
v != null && (g((S) => {
|
|
5030
|
+
const A = S.find((F) => F.id === v), M = A && A._temp ? S.filter((F) => F.id !== v) : S;
|
|
5034
5031
|
return s?.(M), M;
|
|
5035
|
-
}),
|
|
5036
|
-
},
|
|
5037
|
-
if (
|
|
5038
|
-
const S = typeof
|
|
5032
|
+
}), x(null), k(""));
|
|
5033
|
+
}, N = async () => {
|
|
5034
|
+
if (v == null || !a.trim()) return;
|
|
5035
|
+
const S = typeof v == "string" && v.startsWith("temp-");
|
|
5039
5036
|
try {
|
|
5040
5037
|
if (S) {
|
|
5041
5038
|
const A = await Re(t.collectionCreate, {
|
|
5042
5039
|
categoryName: a.trim(),
|
|
5043
|
-
order: (Array.isArray(
|
|
5040
|
+
order: (Array.isArray(h) && h.length > 0 ? h.at(-1)?.order ?? 0 : 0) + 1
|
|
5044
5041
|
});
|
|
5045
5042
|
A && (g((M) => {
|
|
5046
|
-
const
|
|
5047
|
-
return s?.(
|
|
5043
|
+
const F = M.map((z) => z.id === v ? A : z);
|
|
5044
|
+
return s?.(F), F;
|
|
5048
5045
|
}), ke.success("Collection created successfully"));
|
|
5049
5046
|
} else {
|
|
5050
5047
|
const A = await mn(
|
|
5051
|
-
`${t.collectionUpdate}/${
|
|
5048
|
+
`${t.collectionUpdate}/${v}?newName=${a.trim()}`
|
|
5052
5049
|
);
|
|
5053
5050
|
g((M) => {
|
|
5054
|
-
const
|
|
5055
|
-
(z) => z.id ===
|
|
5051
|
+
const F = M.map(
|
|
5052
|
+
(z) => z.id === v ? A && A.id ? { ...z, ...A } : { ...z, categoryName: a.trim() } : z
|
|
5056
5053
|
);
|
|
5057
|
-
return s?.(
|
|
5054
|
+
return s?.(F), F;
|
|
5058
5055
|
}), le.success("Collection updated successfully");
|
|
5059
5056
|
}
|
|
5060
|
-
|
|
5057
|
+
x(null), k("");
|
|
5061
5058
|
} catch (A) {
|
|
5062
5059
|
console.log(A), le.error("Failed to save collection");
|
|
5063
5060
|
}
|
|
5064
5061
|
}, p = async (S) => {
|
|
5065
5062
|
if (i)
|
|
5066
5063
|
try {
|
|
5067
|
-
await un(`${t.collectionUpdate}/${S.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }),
|
|
5064
|
+
await un(`${t.collectionUpdate}/${S.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), E());
|
|
5068
5065
|
} catch (A) {
|
|
5069
5066
|
console.log(A), le.error("Failed to delete collection");
|
|
5070
5067
|
}
|
|
5071
5068
|
}, f = (S, A, M) => {
|
|
5072
|
-
if (!
|
|
5073
|
-
const
|
|
5074
|
-
if (
|
|
5075
|
-
const U = [...S], [Ne] = U.splice(
|
|
5069
|
+
if (!c || !A || !M || A === M) return S;
|
|
5070
|
+
const F = S.findIndex((ie) => ie.id === A), z = S.findIndex((ie) => ie.id === M);
|
|
5071
|
+
if (F === -1 || z === -1) return S;
|
|
5072
|
+
const U = [...S], [Ne] = U.splice(F, 1);
|
|
5076
5073
|
return U.splice(z, 0, Ne), U.map((ie, xe) => ({ ...ie, order: xe + 1 }));
|
|
5077
5074
|
}, w = async (S) => {
|
|
5078
5075
|
const A = S.map((M) => ({
|
|
@@ -5085,22 +5082,22 @@ const fa = () => {
|
|
|
5085
5082
|
} catch (M) {
|
|
5086
5083
|
console.log(M), le.error("Failed to save order", { autoClose: 2500 });
|
|
5087
5084
|
}
|
|
5088
|
-
},
|
|
5089
|
-
|
|
5090
|
-
},
|
|
5085
|
+
}, d = (S, A) => {
|
|
5086
|
+
c && (S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", String(A)), L(A));
|
|
5087
|
+
}, m = (S) => {
|
|
5091
5088
|
$ && S !== O && C(S);
|
|
5092
|
-
},
|
|
5089
|
+
}, b = (S) => {
|
|
5093
5090
|
S.preventDefault();
|
|
5094
|
-
},
|
|
5091
|
+
}, D = async (S, A) => {
|
|
5095
5092
|
S.preventDefault();
|
|
5096
5093
|
const M = S.dataTransfer.getData("text/plain");
|
|
5097
|
-
M && (g((
|
|
5098
|
-
const z = f(
|
|
5094
|
+
M && (g((F) => {
|
|
5095
|
+
const z = f(F, M, A);
|
|
5099
5096
|
return console.log("Reordered", z), w(z), s?.(z), z;
|
|
5100
5097
|
}), L(null), C(null));
|
|
5101
|
-
},
|
|
5098
|
+
}, R = () => {
|
|
5102
5099
|
L(null), C(null);
|
|
5103
|
-
}, j = Array.isArray(
|
|
5100
|
+
}, j = Array.isArray(h) ? h.filter(
|
|
5104
5101
|
(S) => S.categoryName?.toLowerCase().includes(T.toLowerCase())
|
|
5105
5102
|
) : [];
|
|
5106
5103
|
return /* @__PURE__ */ l("div", { className: `manage-collection-list ${r}`, children: [
|
|
@@ -5109,7 +5106,7 @@ const fa = () => {
|
|
|
5109
5106
|
he,
|
|
5110
5107
|
{
|
|
5111
5108
|
value: T,
|
|
5112
|
-
onDebouncedChange:
|
|
5109
|
+
onDebouncedChange: I,
|
|
5113
5110
|
placeholder: "Search Collection",
|
|
5114
5111
|
customClass: "mr-4 searchmanagecollection"
|
|
5115
5112
|
}
|
|
@@ -5119,28 +5116,28 @@ const fa = () => {
|
|
|
5119
5116
|
{
|
|
5120
5117
|
className: [
|
|
5121
5118
|
"px-4 py-3 bg-black text-white rounded-2xl ml-4",
|
|
5122
|
-
|
|
5119
|
+
v !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
5123
5120
|
].join(" "),
|
|
5124
5121
|
onClick: q,
|
|
5125
|
-
disabled:
|
|
5122
|
+
disabled: v !== null,
|
|
5126
5123
|
children: "Add a Collection"
|
|
5127
5124
|
}
|
|
5128
5125
|
)
|
|
5129
5126
|
] }) }),
|
|
5130
5127
|
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: j.map((S) => {
|
|
5131
|
-
const A =
|
|
5128
|
+
const A = v === S.id, M = S?.links?.length ?? 0, F = $ === S.id, z = O === S.id && $ !== S.id;
|
|
5132
5129
|
return /* @__PURE__ */ e(
|
|
5133
5130
|
"div",
|
|
5134
5131
|
{
|
|
5135
|
-
onDragEnter: () =>
|
|
5136
|
-
onDragOver:
|
|
5137
|
-
onDrop: (U) =>
|
|
5138
|
-
onDragEnd:
|
|
5132
|
+
onDragEnter: () => m(S.id),
|
|
5133
|
+
onDragOver: b,
|
|
5134
|
+
onDrop: (U) => D(U, S.id),
|
|
5135
|
+
onDragEnd: R,
|
|
5139
5136
|
className: [
|
|
5140
5137
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5141
5138
|
"border-gray-300",
|
|
5142
5139
|
z ? "ring-2 ring-gray-800/20" : "",
|
|
5143
|
-
|
|
5140
|
+
F ? "opacity-60" : ""
|
|
5144
5141
|
].join(" "),
|
|
5145
5142
|
children: A ? /* @__PURE__ */ l(ee, { children: [
|
|
5146
5143
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
@@ -5152,7 +5149,7 @@ const fa = () => {
|
|
|
5152
5149
|
placeholder: S._temp ? "New collection name" : "Edit collection name",
|
|
5153
5150
|
onChange: (U) => k(U.target.value),
|
|
5154
5151
|
onKeyDown: (U) => {
|
|
5155
|
-
U.key === "Enter" &&
|
|
5152
|
+
U.key === "Enter" && N(), U.key === "Escape" && G();
|
|
5156
5153
|
},
|
|
5157
5154
|
autoFocus: !0
|
|
5158
5155
|
}
|
|
@@ -5174,7 +5171,7 @@ const fa = () => {
|
|
|
5174
5171
|
"border p-2 rounded-2xl",
|
|
5175
5172
|
a.trim() ? "cursor-pointer border-gray-300" : "cursor-not-allowed border-gray-200"
|
|
5176
5173
|
].join(" "),
|
|
5177
|
-
onClick:
|
|
5174
|
+
onClick: N,
|
|
5178
5175
|
"aria-label": "Save",
|
|
5179
5176
|
disabled: !a.trim(),
|
|
5180
5177
|
title: a.trim() ? "Save" : "Name required",
|
|
@@ -5184,14 +5181,14 @@ const fa = () => {
|
|
|
5184
5181
|
] })
|
|
5185
5182
|
] }) : /* @__PURE__ */ l(ee, { children: [
|
|
5186
5183
|
/* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
|
|
5187
|
-
|
|
5184
|
+
c && /* @__PURE__ */ e(
|
|
5188
5185
|
"span",
|
|
5189
5186
|
{
|
|
5190
5187
|
role: "button",
|
|
5191
5188
|
"aria-label": "Drag to reorder",
|
|
5192
5189
|
className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
|
|
5193
5190
|
draggable: !0,
|
|
5194
|
-
onDragStart: (U) =>
|
|
5191
|
+
onDragStart: (U) => d(U, S.id),
|
|
5195
5192
|
children: /* @__PURE__ */ e(sa, {})
|
|
5196
5193
|
}
|
|
5197
5194
|
),
|
|
@@ -5230,13 +5227,13 @@ const fa = () => {
|
|
|
5230
5227
|
description: n = "",
|
|
5231
5228
|
endpoints: u = {},
|
|
5232
5229
|
initialData: i = null,
|
|
5233
|
-
showSearch:
|
|
5230
|
+
showSearch: c = !0,
|
|
5234
5231
|
allowAdd: y = !0,
|
|
5235
|
-
allowEdit:
|
|
5236
|
-
allowDelete:
|
|
5232
|
+
allowEdit: v = !0,
|
|
5233
|
+
allowDelete: x = !0,
|
|
5237
5234
|
allowReorder: a = !0,
|
|
5238
5235
|
className: k = ""
|
|
5239
|
-
} = t,
|
|
5236
|
+
} = t, h = r?.[t.key] || i || [], g = Array.isArray(h) ? h : [];
|
|
5240
5237
|
return /* @__PURE__ */ l("div", { className: "dynamic-config-manage-collection-list", children: [
|
|
5241
5238
|
(o || n) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
5242
5239
|
o && /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 mb-1", children: o }),
|
|
@@ -5251,10 +5248,10 @@ const fa = () => {
|
|
|
5251
5248
|
onCollectionChange: (L) => {
|
|
5252
5249
|
s && s(t.key, L);
|
|
5253
5250
|
},
|
|
5254
|
-
showSearch:
|
|
5251
|
+
showSearch: c,
|
|
5255
5252
|
allowAdd: y,
|
|
5256
|
-
allowEdit:
|
|
5257
|
-
allowDelete:
|
|
5253
|
+
allowEdit: v,
|
|
5254
|
+
allowDelete: x,
|
|
5258
5255
|
allowReorder: a
|
|
5259
5256
|
}
|
|
5260
5257
|
)
|
|
@@ -5282,50 +5279,50 @@ function Un({
|
|
|
5282
5279
|
onCancel: o,
|
|
5283
5280
|
onSave: n
|
|
5284
5281
|
}) {
|
|
5285
|
-
const [u, i] = ae.useState(r), [
|
|
5282
|
+
const [u, i] = ae.useState(r), [c, y] = ae.useState(null), [v, x] = B(!1), [a, k] = B(!1), [h, g] = B({}), $ = `${ve()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, L = $, [O, C] = B(1), T = (f) => {
|
|
5286
5283
|
if (!r || !r.configuration)
|
|
5287
5284
|
return f;
|
|
5288
|
-
const w = {},
|
|
5289
|
-
return r.configuration.forEach((
|
|
5290
|
-
if (
|
|
5291
|
-
const
|
|
5292
|
-
const S = { id:
|
|
5293
|
-
return
|
|
5285
|
+
const w = {}, d = f?.configuration || {};
|
|
5286
|
+
return r.configuration.forEach((m) => {
|
|
5287
|
+
if (m.key && m.type === "datatable") {
|
|
5288
|
+
const D = (d[m.key] || []).map((R, j) => {
|
|
5289
|
+
const S = { id: R.id || 0 };
|
|
5290
|
+
return m.fields && m.fields.forEach((A) => {
|
|
5294
5291
|
if (A.fieldtype === "audience") {
|
|
5295
5292
|
let M = { users: [], groups: [], roles: [] };
|
|
5296
|
-
|
|
5297
|
-
users:
|
|
5298
|
-
groups:
|
|
5299
|
-
roles:
|
|
5293
|
+
R[A.key] && (Array.isArray(R[A.key]) ? M = { users: [], groups: [], roles: [] } : typeof R[A.key] == "object" && (M = {
|
|
5294
|
+
users: R[A.key].users || [],
|
|
5295
|
+
groups: R[A.key].groups || [],
|
|
5296
|
+
roles: R[A.key].roles || []
|
|
5300
5297
|
})), S[A.key] = M;
|
|
5301
5298
|
} else
|
|
5302
|
-
S[A.key] =
|
|
5299
|
+
S[A.key] = R[A.key] || A.default || "";
|
|
5303
5300
|
}), S;
|
|
5304
5301
|
});
|
|
5305
|
-
if (
|
|
5306
|
-
const
|
|
5307
|
-
|
|
5308
|
-
j.fieldtype === "audience" ?
|
|
5309
|
-
}),
|
|
5302
|
+
if (D.length === 0) {
|
|
5303
|
+
const R = { id: 0 };
|
|
5304
|
+
m.fields && m.fields.forEach((j) => {
|
|
5305
|
+
j.fieldtype === "audience" ? R[j.key] = { users: [], groups: [], roles: [] } : R[j.key] = j.default || "";
|
|
5306
|
+
}), D.push(R);
|
|
5310
5307
|
}
|
|
5311
|
-
w[
|
|
5312
|
-
} else
|
|
5308
|
+
w[m.key] = D;
|
|
5309
|
+
} else m.key && (w[m.key] = d[m.key] || {});
|
|
5313
5310
|
}), w;
|
|
5314
|
-
},
|
|
5311
|
+
}, I = () => {
|
|
5315
5312
|
if (r && r.configuration) {
|
|
5316
5313
|
const f = {};
|
|
5317
5314
|
r.configuration.forEach((w) => {
|
|
5318
5315
|
if (w.key)
|
|
5319
5316
|
if (w.type === "datatable") {
|
|
5320
|
-
const
|
|
5321
|
-
w.fields && w.fields.forEach((
|
|
5322
|
-
|
|
5323
|
-
}), f[w.key] = [
|
|
5317
|
+
const d = { id: 0 };
|
|
5318
|
+
w.fields && w.fields.forEach((m) => {
|
|
5319
|
+
m.fieldtype === "audience" ? d[m.key] = { users: [], groups: [], roles: [] } : d[m.key] = m.default || "";
|
|
5320
|
+
}), f[w.key] = [d];
|
|
5324
5321
|
} else if (w.type === "section") {
|
|
5325
|
-
const
|
|
5326
|
-
w.fields && Array.isArray(w.fields) && w.fields.forEach((
|
|
5327
|
-
|
|
5328
|
-
}), f[w.key] =
|
|
5322
|
+
const d = {};
|
|
5323
|
+
w.fields && Array.isArray(w.fields) && w.fields.forEach((m) => {
|
|
5324
|
+
m.key && (d[m.key] = m.default || "");
|
|
5325
|
+
}), f[w.key] = d;
|
|
5329
5326
|
} else
|
|
5330
5327
|
f[w.key] = {};
|
|
5331
5328
|
}), y(f);
|
|
@@ -5333,57 +5330,57 @@ function Un({
|
|
|
5333
5330
|
};
|
|
5334
5331
|
X(() => {
|
|
5335
5332
|
if (s) {
|
|
5336
|
-
|
|
5333
|
+
x(!1);
|
|
5337
5334
|
return;
|
|
5338
5335
|
}
|
|
5339
5336
|
const f = async () => {
|
|
5340
5337
|
try {
|
|
5341
|
-
|
|
5338
|
+
x(!0);
|
|
5342
5339
|
let w = await Ee($);
|
|
5343
5340
|
if (w) {
|
|
5344
|
-
const
|
|
5345
|
-
y(
|
|
5341
|
+
const d = T(w);
|
|
5342
|
+
y(d);
|
|
5346
5343
|
} else
|
|
5347
|
-
|
|
5344
|
+
I();
|
|
5348
5345
|
} catch (w) {
|
|
5349
5346
|
console.error("Error fetching configuration:", w);
|
|
5350
|
-
let
|
|
5347
|
+
let d = "Failed to load configuration";
|
|
5351
5348
|
if (w.response) {
|
|
5352
|
-
const
|
|
5353
|
-
|
|
5354
|
-
} else w.request ?
|
|
5355
|
-
ke.error(
|
|
5349
|
+
const m = w.response.status, b = w.response.data?.message || w.response.data?.error;
|
|
5350
|
+
m === 400 ? d = b || "Invalid request. Please check the application ID." : m === 401 ? d = "You are not authorized to access this configuration." : m === 403 ? d = "Access denied. You don't have permission to view this configuration." : m === 404 ? d = "Configuration not found. It may not exist yet or the application ID is incorrect." : m >= 500 ? d = b || "Server error. Please try again later." : d = b || `Failed to load configuration (Error ${m})`;
|
|
5351
|
+
} else w.request ? d = "Network error. Please check your connection and try again." : d = w.message || "An unexpected error occurred while loading configuration.";
|
|
5352
|
+
ke.error(d), I();
|
|
5356
5353
|
} finally {
|
|
5357
|
-
|
|
5354
|
+
x(!1);
|
|
5358
5355
|
}
|
|
5359
5356
|
};
|
|
5360
|
-
r && (i(r), t ? f() :
|
|
5357
|
+
r && (i(r), t ? f() : I());
|
|
5361
5358
|
}, [r, O, t, s]);
|
|
5362
|
-
const
|
|
5363
|
-
y((
|
|
5364
|
-
...
|
|
5359
|
+
const E = (f, w) => {
|
|
5360
|
+
y((d) => ({
|
|
5361
|
+
...d,
|
|
5365
5362
|
[f]: w
|
|
5366
|
-
})), g((
|
|
5367
|
-
const
|
|
5368
|
-
return
|
|
5363
|
+
})), g((d) => {
|
|
5364
|
+
const m = { ...d };
|
|
5365
|
+
return m[f] && delete m[f], m;
|
|
5369
5366
|
});
|
|
5370
5367
|
}, V = () => {
|
|
5371
5368
|
const f = {};
|
|
5372
|
-
return !u || !
|
|
5369
|
+
return !u || !c || u.configuration.forEach((w) => {
|
|
5373
5370
|
if (w.type === "section")
|
|
5374
|
-
w.fields.forEach((
|
|
5375
|
-
if (
|
|
5376
|
-
const
|
|
5377
|
-
(!
|
|
5371
|
+
w.fields.forEach((d) => {
|
|
5372
|
+
if (d.required) {
|
|
5373
|
+
const m = c[w.key]?.[d.key];
|
|
5374
|
+
(!m || typeof m == "string" && m.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][d.key] = `${d.label} is required`);
|
|
5378
5375
|
}
|
|
5379
5376
|
});
|
|
5380
5377
|
else if (w.type === "datatable") {
|
|
5381
|
-
const
|
|
5382
|
-
Array.isArray(
|
|
5383
|
-
w.fields.forEach((
|
|
5384
|
-
if (
|
|
5385
|
-
const
|
|
5386
|
-
(!
|
|
5378
|
+
const d = c[w.key];
|
|
5379
|
+
Array.isArray(d) && d.forEach((m, b) => {
|
|
5380
|
+
w.fields.forEach((D) => {
|
|
5381
|
+
if (D.required) {
|
|
5382
|
+
const R = m[D.key];
|
|
5383
|
+
(!R || typeof R == "string" && R.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][b] || (f[w.key][b] = {}), f[w.key][b][D.key] = `${D.label} is required`);
|
|
5387
5384
|
}
|
|
5388
5385
|
});
|
|
5389
5386
|
});
|
|
@@ -5392,12 +5389,12 @@ function Un({
|
|
|
5392
5389
|
}, q = (f) => Object.keys(f).length > 0, G = () => {
|
|
5393
5390
|
const f = V();
|
|
5394
5391
|
if (g(f), q(f)) {
|
|
5395
|
-
let
|
|
5396
|
-
Object.keys(f).forEach((
|
|
5397
|
-
typeof f[
|
|
5398
|
-
typeof f[
|
|
5399
|
-
|
|
5400
|
-
}) :
|
|
5392
|
+
let d = [];
|
|
5393
|
+
Object.keys(f).forEach((m) => {
|
|
5394
|
+
typeof f[m] == "object" && Object.keys(f[m]).forEach((b) => {
|
|
5395
|
+
typeof f[m][b] == "object" ? Object.keys(f[m][b]).forEach((D) => {
|
|
5396
|
+
d.push(`${m} row ${parseInt(b) + 1}: ${f[m][b][D]}`);
|
|
5397
|
+
}) : d.push(`${m}: ${f[m][b]}`);
|
|
5401
5398
|
});
|
|
5402
5399
|
});
|
|
5403
5400
|
return;
|
|
@@ -5405,45 +5402,45 @@ function Un({
|
|
|
5405
5402
|
(async () => {
|
|
5406
5403
|
try {
|
|
5407
5404
|
k(!0);
|
|
5408
|
-
const
|
|
5409
|
-
|
|
5410
|
-
const
|
|
5411
|
-
(
|
|
5405
|
+
const d = {};
|
|
5406
|
+
c && Object.keys(c).forEach((b) => {
|
|
5407
|
+
const D = r?.configuration?.find(
|
|
5408
|
+
(R) => R.key === b && R.type === "datatable"
|
|
5412
5409
|
);
|
|
5413
|
-
|
|
5414
|
-
const j = { id:
|
|
5415
|
-
return
|
|
5410
|
+
D && Array.isArray(c[b]) ? d[b] = c[b].map((R) => {
|
|
5411
|
+
const j = { id: R.id || 0 };
|
|
5412
|
+
return D.fields && D.fields.forEach((S) => {
|
|
5416
5413
|
if (S.fieldtype === "audience") {
|
|
5417
5414
|
let A = { users: [], groups: [], roles: [] };
|
|
5418
|
-
|
|
5419
|
-
users:
|
|
5420
|
-
groups:
|
|
5421
|
-
roles:
|
|
5415
|
+
R[S.key] && typeof R[S.key] == "object" && !Array.isArray(R[S.key]) && (A = {
|
|
5416
|
+
users: R[S.key].users || [],
|
|
5417
|
+
groups: R[S.key].groups || [],
|
|
5418
|
+
roles: R[S.key].roles || []
|
|
5422
5419
|
}), j[S.key] = A;
|
|
5423
5420
|
} else
|
|
5424
|
-
j[S.key] =
|
|
5421
|
+
j[S.key] = R[S.key] || "";
|
|
5425
5422
|
}), j;
|
|
5426
|
-
}) :
|
|
5423
|
+
}) : d[b] = c[b];
|
|
5427
5424
|
});
|
|
5428
|
-
let
|
|
5429
|
-
if (console.log(),
|
|
5425
|
+
let m = await Re(L, d);
|
|
5426
|
+
if (console.log(), m && m.status != "fail") {
|
|
5430
5427
|
g({});
|
|
5431
|
-
const
|
|
5432
|
-
ke.success(
|
|
5428
|
+
const b = m.message || "Configuration has been saved successfully";
|
|
5429
|
+
ke.success(b), n && typeof n == "function" && n(c);
|
|
5433
5430
|
} else
|
|
5434
|
-
throw ke.error(
|
|
5435
|
-
} catch (
|
|
5436
|
-
console.error("Error saving configuration:",
|
|
5431
|
+
throw ke.error(m?.message || "Failed to save configuration"), new Error("No response received from server");
|
|
5432
|
+
} catch (d) {
|
|
5433
|
+
console.error("Error saving configuration:", d), ke.error(d?.message || "Failed to save configuration");
|
|
5437
5434
|
} finally {
|
|
5438
5435
|
k(!1);
|
|
5439
5436
|
}
|
|
5440
5437
|
})();
|
|
5441
|
-
},
|
|
5438
|
+
}, N = () => {
|
|
5442
5439
|
if (o) {
|
|
5443
5440
|
o();
|
|
5444
5441
|
return;
|
|
5445
5442
|
}
|
|
5446
|
-
|
|
5443
|
+
h && Object.keys(h).length > 0 && !window.confirm(
|
|
5447
5444
|
"You have validation errors that will be lost. Are you sure you want to cancel?"
|
|
5448
5445
|
) || (g({}), y(null), C((w) => w + 1), ke.info("Configuration changes cancelled"));
|
|
5449
5446
|
};
|
|
@@ -5451,7 +5448,7 @@ function Un({
|
|
|
5451
5448
|
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" }) });
|
|
5452
5449
|
const p = r?.configuration || u?.configuration;
|
|
5453
5450
|
return X(() => {
|
|
5454
|
-
s && r ? (!
|
|
5451
|
+
s && r ? (!c || Object.keys(c).length === 0) && I() : s && !r && I();
|
|
5455
5452
|
}, [s, r]), /* @__PURE__ */ l("div", { children: [
|
|
5456
5453
|
/* @__PURE__ */ l(
|
|
5457
5454
|
"div",
|
|
@@ -5459,17 +5456,17 @@ function Un({
|
|
|
5459
5456
|
className: "dynamic-config bg-white w-full h-[calc(100vh-350px)] overflow-y-auto",
|
|
5460
5457
|
style: { padding: "0px 20px 0px 0px" },
|
|
5461
5458
|
children: [
|
|
5462
|
-
|
|
5463
|
-
!
|
|
5464
|
-
const
|
|
5465
|
-
if (
|
|
5459
|
+
v && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(qa, { size: "large" }) }),
|
|
5460
|
+
!v && p?.map((f, w) => {
|
|
5461
|
+
const d = Mn(f.type);
|
|
5462
|
+
if (d && d !== "UnknownType")
|
|
5466
5463
|
return /* @__PURE__ */ e(
|
|
5467
|
-
|
|
5464
|
+
d,
|
|
5468
5465
|
{
|
|
5469
5466
|
item: f,
|
|
5470
|
-
data:
|
|
5471
|
-
updateHandler:
|
|
5472
|
-
validationErrors:
|
|
5467
|
+
data: c,
|
|
5468
|
+
updateHandler: E,
|
|
5469
|
+
validationErrors: h
|
|
5473
5470
|
},
|
|
5474
5471
|
w
|
|
5475
5472
|
);
|
|
@@ -5482,7 +5479,7 @@ function Un({
|
|
|
5482
5479
|
H,
|
|
5483
5480
|
{
|
|
5484
5481
|
category: "secondary",
|
|
5485
|
-
onClick:
|
|
5482
|
+
onClick: N,
|
|
5486
5483
|
label: "Cancel",
|
|
5487
5484
|
disabled: a
|
|
5488
5485
|
}
|
|
@@ -5505,32 +5502,32 @@ const ys = ({
|
|
|
5505
5502
|
appid: r = "Configuration-Page",
|
|
5506
5503
|
disableApi: s = !1
|
|
5507
5504
|
}) => {
|
|
5508
|
-
const [o, n] = B(0), [u, i] = B(!1), [
|
|
5509
|
-
pageHeader:
|
|
5510
|
-
appletHeader:
|
|
5505
|
+
const [o, n] = B(0), [u, i] = B(!1), [c, y] = B(r), {
|
|
5506
|
+
pageHeader: v = {},
|
|
5507
|
+
appletHeader: x = {},
|
|
5511
5508
|
breadcrumb: a = [],
|
|
5512
5509
|
overview: k = {},
|
|
5513
|
-
configuration:
|
|
5514
|
-
} = t, g =
|
|
5510
|
+
configuration: h = []
|
|
5511
|
+
} = t, g = h.map((p) => {
|
|
5515
5512
|
if (p.type === "section" && p.fields) {
|
|
5516
|
-
const f = [...p.fields], w = f.findIndex((
|
|
5513
|
+
const f = [...p.fields], w = f.findIndex((d) => d.key === "appkey");
|
|
5517
5514
|
if (w !== -1) {
|
|
5518
|
-
const
|
|
5515
|
+
const d = f[w];
|
|
5519
5516
|
if (f[w] = {
|
|
5520
|
-
...
|
|
5517
|
+
...d,
|
|
5521
5518
|
default: r,
|
|
5522
5519
|
value: r,
|
|
5523
5520
|
disabled: !0,
|
|
5524
5521
|
placeholder: r
|
|
5525
|
-
}, f.some((
|
|
5526
|
-
const
|
|
5527
|
-
f[
|
|
5528
|
-
...f[
|
|
5522
|
+
}, f.some((b) => b.key === "displayname")) {
|
|
5523
|
+
const b = f.findIndex((D) => D.key === "displayname");
|
|
5524
|
+
f[b] = {
|
|
5525
|
+
...f[b],
|
|
5529
5526
|
default: r,
|
|
5530
5527
|
value: r
|
|
5531
5528
|
};
|
|
5532
5529
|
} else {
|
|
5533
|
-
const
|
|
5530
|
+
const b = {
|
|
5534
5531
|
key: "displayname",
|
|
5535
5532
|
label: "Display Name",
|
|
5536
5533
|
fieldtype: "text",
|
|
@@ -5539,7 +5536,7 @@ const ys = ({
|
|
|
5539
5536
|
placeholder: "Enter display name",
|
|
5540
5537
|
required: !1
|
|
5541
5538
|
};
|
|
5542
|
-
f.splice(w + 1, 0,
|
|
5539
|
+
f.splice(w + 1, 0, b);
|
|
5543
5540
|
}
|
|
5544
5541
|
}
|
|
5545
5542
|
return {
|
|
@@ -5553,7 +5550,7 @@ const ys = ({
|
|
|
5553
5550
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
5554
5551
|
isLeftArrow: !0,
|
|
5555
5552
|
onBackClick: () => window.history.back(),
|
|
5556
|
-
...
|
|
5553
|
+
...v
|
|
5557
5554
|
}, L = a.map((p) => ({
|
|
5558
5555
|
label: p.text,
|
|
5559
5556
|
href: p.href || "#"
|
|
@@ -5573,16 +5570,16 @@ const ys = ({
|
|
|
5573
5570
|
ae.useEffect(() => {
|
|
5574
5571
|
y(T());
|
|
5575
5572
|
}, [g]);
|
|
5576
|
-
const
|
|
5573
|
+
const I = K((p) => {
|
|
5577
5574
|
console.log("Config saved with data:", p), Object.keys(p).forEach((f) => {
|
|
5578
5575
|
const w = p[f];
|
|
5579
5576
|
console.log(`Checking section ${f}:`, w), w && w.displayname && (console.log("Found displayname:", w.displayname), y(w.displayname));
|
|
5580
5577
|
});
|
|
5581
|
-
}, []),
|
|
5578
|
+
}, []), E = {
|
|
5582
5579
|
subHeading: "Application configuration and details",
|
|
5583
5580
|
tags: [],
|
|
5584
|
-
...
|
|
5585
|
-
heading:
|
|
5581
|
+
...x,
|
|
5582
|
+
heading: c
|
|
5586
5583
|
// Ensure displayname always overrides config heading
|
|
5587
5584
|
}, V = {
|
|
5588
5585
|
about: "This application provides comprehensive functionality for your organization.",
|
|
@@ -5603,13 +5600,13 @@ const ys = ({
|
|
|
5603
5600
|
],
|
|
5604
5601
|
...k
|
|
5605
5602
|
}, q = [
|
|
5606
|
-
{ label: "Overview", content:
|
|
5607
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: O, onSave:
|
|
5603
|
+
{ label: "Overview", content: N(V) },
|
|
5604
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: O, onSave: I }) }
|
|
5608
5605
|
];
|
|
5609
5606
|
function G(p) {
|
|
5610
5607
|
return p ? p.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: p } }) : p : "📱";
|
|
5611
5608
|
}
|
|
5612
|
-
function
|
|
5609
|
+
function N(p) {
|
|
5613
5610
|
return /* @__PURE__ */ l("div", { className: "bg-white rounded-2xl p-1", children: [
|
|
5614
5611
|
/* @__PURE__ */ l("section", { className: "mb-8", children: [
|
|
5615
5612
|
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
|
|
@@ -5663,11 +5660,11 @@ const ys = ({
|
|
|
5663
5660
|
}
|
|
5664
5661
|
),
|
|
5665
5662
|
/* @__PURE__ */ l("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
|
|
5666
|
-
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: G(
|
|
5663
|
+
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: G(E.icon) }),
|
|
5667
5664
|
/* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
|
|
5668
|
-
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children:
|
|
5669
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children:
|
|
5670
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children:
|
|
5665
|
+
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: E.heading }),
|
|
5666
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: E.subHeading }),
|
|
5667
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: E.tags && E.tags.map((p, f) => /* @__PURE__ */ e(
|
|
5671
5668
|
"span",
|
|
5672
5669
|
{
|
|
5673
5670
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
@@ -5739,14 +5736,14 @@ const bs = ({
|
|
|
5739
5736
|
// preferred
|
|
5740
5737
|
onAdd: u,
|
|
5741
5738
|
onFilterOpen: i,
|
|
5742
|
-
addBtnText:
|
|
5739
|
+
addBtnText: c = "Add",
|
|
5743
5740
|
// Feature toggles
|
|
5744
5741
|
showSearch: y = !0,
|
|
5745
|
-
showColumnChooser:
|
|
5746
|
-
showFilter:
|
|
5742
|
+
showColumnChooser: v = !0,
|
|
5743
|
+
showFilter: x = !1,
|
|
5747
5744
|
showPrint: a = !1,
|
|
5748
5745
|
showExcel: k = !1,
|
|
5749
|
-
showPdf:
|
|
5746
|
+
showPdf: h = !1,
|
|
5750
5747
|
showRefresh: g = !1,
|
|
5751
5748
|
showAdd: $ = !1,
|
|
5752
5749
|
// Additional props
|
|
@@ -5757,51 +5754,51 @@ const bs = ({
|
|
|
5757
5754
|
},
|
|
5758
5755
|
// Optional: override export file names
|
|
5759
5756
|
excelFileName: T,
|
|
5760
|
-
pdfFileName:
|
|
5757
|
+
pdfFileName: I
|
|
5761
5758
|
}) => {
|
|
5762
|
-
const
|
|
5763
|
-
(
|
|
5764
|
-
const
|
|
5765
|
-
if (console.log("openColumnChooserNear",
|
|
5766
|
-
if (typeof window > "u" || !
|
|
5767
|
-
|
|
5759
|
+
const E = () => n?.current || o?.current, [V, q] = ae.useState(""), G = (t || "export").toString().trim() || "export", N = `${T || G}.xlsx`, p = `${I || G}.pdf`, f = (m, b, D) => Math.max(b, Math.min(m, D)), w = K(
|
|
5760
|
+
(m) => {
|
|
5761
|
+
const b = E();
|
|
5762
|
+
if (console.log("openColumnChooserNear", b), !!b?.openColumnChooser) {
|
|
5763
|
+
if (typeof window > "u" || !m?.currentTarget) {
|
|
5764
|
+
b.openColumnChooser();
|
|
5768
5765
|
return;
|
|
5769
5766
|
}
|
|
5770
5767
|
try {
|
|
5771
|
-
const
|
|
5772
|
-
let S =
|
|
5773
|
-
const M = window.innerWidth,
|
|
5774
|
-
S = f(S, window.scrollX + 8, window.scrollX + M - 340), A = f(A, window.scrollY, window.scrollY +
|
|
5775
|
-
} catch (
|
|
5776
|
-
console.log("coloumn choose error",
|
|
5768
|
+
const D = m.currentTarget.getBoundingClientRect(), R = D.left + window.scrollX, j = D.bottom + window.scrollY;
|
|
5769
|
+
let S = R - 120, A = j - 120;
|
|
5770
|
+
const M = window.innerWidth, F = window.innerHeight;
|
|
5771
|
+
S = f(S, window.scrollX + 8, window.scrollX + M - 340), A = f(A, window.scrollY, window.scrollY + F - 120), console.log("openColumnChooserNear", S, A), b.openColumnChooser(S, A);
|
|
5772
|
+
} catch (D) {
|
|
5773
|
+
console.log("coloumn choose error", D);
|
|
5777
5774
|
}
|
|
5778
5775
|
}
|
|
5779
5776
|
},
|
|
5780
5777
|
[]
|
|
5781
5778
|
// no external deps; reads ref at call time
|
|
5782
|
-
),
|
|
5783
|
-
(
|
|
5784
|
-
const
|
|
5785
|
-
if (
|
|
5786
|
-
switch (
|
|
5779
|
+
), d = K(
|
|
5780
|
+
(m, b) => {
|
|
5781
|
+
const D = E();
|
|
5782
|
+
if (D)
|
|
5783
|
+
switch (m) {
|
|
5787
5784
|
case "ColumnChooser":
|
|
5788
|
-
|
|
5785
|
+
v && (console.log("openColumnChooser", b), b ? w(b) : D.openColumnChooser?.()), console.log("openColumnChooser out", b);
|
|
5789
5786
|
break;
|
|
5790
5787
|
case "Print":
|
|
5791
|
-
a &&
|
|
5788
|
+
a && D.print?.();
|
|
5792
5789
|
break;
|
|
5793
5790
|
case "Excel":
|
|
5794
|
-
k &&
|
|
5791
|
+
k && D.excelExport?.({ fileName: N });
|
|
5795
5792
|
break;
|
|
5796
5793
|
case "Pdf":
|
|
5797
|
-
|
|
5794
|
+
h && D.pdfExport?.({ fileName: p });
|
|
5798
5795
|
break;
|
|
5799
5796
|
case "Refresh":
|
|
5800
5797
|
g && O();
|
|
5801
5798
|
break;
|
|
5802
5799
|
}
|
|
5803
5800
|
},
|
|
5804
|
-
[
|
|
5801
|
+
[v, a, k, h, g, N, p, O, w]
|
|
5805
5802
|
);
|
|
5806
5803
|
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: [
|
|
5807
5804
|
/* @__PURE__ */ l("div", { className: "flex flex-col", children: [
|
|
@@ -5818,25 +5815,25 @@ const bs = ({
|
|
|
5818
5815
|
{
|
|
5819
5816
|
placeholder: L,
|
|
5820
5817
|
value: V,
|
|
5821
|
-
onDebouncedChange: (
|
|
5822
|
-
q(
|
|
5818
|
+
onDebouncedChange: (m) => {
|
|
5819
|
+
q(m), C(m);
|
|
5823
5820
|
}
|
|
5824
5821
|
}
|
|
5825
5822
|
) }),
|
|
5826
5823
|
/* @__PURE__ */ l("div", { className: "flex gap-3", children: [
|
|
5827
5824
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
5828
|
-
|
|
5825
|
+
v && /* @__PURE__ */ e(
|
|
5829
5826
|
H,
|
|
5830
5827
|
{
|
|
5831
5828
|
icon: Xt,
|
|
5832
|
-
onClick: (
|
|
5829
|
+
onClick: (m) => d("ColumnChooser", m),
|
|
5833
5830
|
size: "small",
|
|
5834
5831
|
ariaLabel: "Column Chooser",
|
|
5835
5832
|
category: "secondary",
|
|
5836
5833
|
title: "Choose Columns"
|
|
5837
5834
|
}
|
|
5838
5835
|
),
|
|
5839
|
-
|
|
5836
|
+
x && /* @__PURE__ */ e(
|
|
5840
5837
|
H,
|
|
5841
5838
|
{
|
|
5842
5839
|
icon: Zt,
|
|
@@ -5851,7 +5848,7 @@ const bs = ({
|
|
|
5851
5848
|
H,
|
|
5852
5849
|
{
|
|
5853
5850
|
icon: Ht,
|
|
5854
|
-
onClick: () =>
|
|
5851
|
+
onClick: () => d("Print"),
|
|
5855
5852
|
ariaLabel: "Print",
|
|
5856
5853
|
size: "small",
|
|
5857
5854
|
category: "secondary",
|
|
@@ -5862,18 +5859,18 @@ const bs = ({
|
|
|
5862
5859
|
H,
|
|
5863
5860
|
{
|
|
5864
5861
|
icon: Kt,
|
|
5865
|
-
onClick: () =>
|
|
5862
|
+
onClick: () => d("Excel"),
|
|
5866
5863
|
ariaLabel: "Excel Download",
|
|
5867
5864
|
size: "small",
|
|
5868
5865
|
category: "secondary",
|
|
5869
|
-
title: `Export Excel (${
|
|
5866
|
+
title: `Export Excel (${N})`
|
|
5870
5867
|
}
|
|
5871
5868
|
),
|
|
5872
|
-
|
|
5869
|
+
h && /* @__PURE__ */ e(
|
|
5873
5870
|
H,
|
|
5874
5871
|
{
|
|
5875
5872
|
icon: er,
|
|
5876
|
-
onClick: () =>
|
|
5873
|
+
onClick: () => d("Pdf"),
|
|
5877
5874
|
ariaLabel: "PDF Download",
|
|
5878
5875
|
size: "small",
|
|
5879
5876
|
category: "secondary",
|
|
@@ -5884,7 +5881,7 @@ const bs = ({
|
|
|
5884
5881
|
H,
|
|
5885
5882
|
{
|
|
5886
5883
|
icon: ar,
|
|
5887
|
-
onClick: () =>
|
|
5884
|
+
onClick: () => d("Refresh"),
|
|
5888
5885
|
ariaLabel: "Refresh",
|
|
5889
5886
|
size: "small",
|
|
5890
5887
|
category: "secondary",
|
|
@@ -5895,12 +5892,12 @@ const bs = ({
|
|
|
5895
5892
|
$ && u && /* @__PURE__ */ e(
|
|
5896
5893
|
H,
|
|
5897
5894
|
{
|
|
5898
|
-
label:
|
|
5895
|
+
label: c,
|
|
5899
5896
|
icon: tr,
|
|
5900
5897
|
onClick: u,
|
|
5901
5898
|
size: "small",
|
|
5902
5899
|
ariaLabel: "Add New",
|
|
5903
|
-
title:
|
|
5900
|
+
title: c
|
|
5904
5901
|
}
|
|
5905
5902
|
)
|
|
5906
5903
|
] })
|
|
@@ -5917,33 +5914,33 @@ function vs(t) {
|
|
|
5917
5914
|
// pageSize = 10,
|
|
5918
5915
|
allowPaging: u = !0,
|
|
5919
5916
|
allowSorting: i = !0,
|
|
5920
|
-
allowFiltering:
|
|
5917
|
+
allowFiltering: c = !1,
|
|
5921
5918
|
allowGrouping: y = !1,
|
|
5922
|
-
allowReordering:
|
|
5923
|
-
allowResizing:
|
|
5919
|
+
allowReordering: v = !0,
|
|
5920
|
+
allowResizing: x = !0,
|
|
5924
5921
|
allowExcelExport: a = !1,
|
|
5925
5922
|
allowPdfExport: k = !1,
|
|
5926
|
-
showColumnChooser:
|
|
5923
|
+
showColumnChooser: h = !1,
|
|
5927
5924
|
enableSearchApi: g = !1,
|
|
5928
5925
|
height: $ = "600",
|
|
5929
5926
|
selectionSettings: L = { type: "Multiple", mode: "Row" },
|
|
5930
5927
|
enableCheckbox: O = !1,
|
|
5931
5928
|
columns: C = [],
|
|
5932
5929
|
onGridStateChange: T,
|
|
5933
|
-
onRowSelected:
|
|
5934
|
-
onRowDeselected:
|
|
5930
|
+
onRowSelected: I,
|
|
5931
|
+
onRowDeselected: E,
|
|
5935
5932
|
onRowDoubleClick: V,
|
|
5936
5933
|
apiRef: q,
|
|
5937
5934
|
gridProps: G = {}
|
|
5938
|
-
} = t,
|
|
5935
|
+
} = t, N = ue(null), {
|
|
5939
5936
|
pageSettings: p,
|
|
5940
5937
|
sortSettings: f,
|
|
5941
5938
|
...w
|
|
5942
|
-
} = G || {}, [
|
|
5943
|
-
const P = [
|
|
5944
|
-
return i && P.push(
|
|
5945
|
-
}, [i,
|
|
5946
|
-
const P = () =>
|
|
5939
|
+
} = G || {}, [d, m] = ae.useState(p?.page || 1), [b, D] = ae.useState(f?.pageSize || 20), [R, j] = ae.useState(f?.sortKey || "updatedDate"), [S, A] = ae.useState(f?.direction || "Descending"), M = ce(() => {
|
|
5940
|
+
const P = [Fr];
|
|
5941
|
+
return i && P.push($r), c && P.push(Tr), y && P.push(Ar), g && P.push(Er), a && P.push(Rr), k && P.push(Ir), h && P.push(zr), x && P.push(Pr), v && P.push(Br), P.push(Lr), P;
|
|
5942
|
+
}, [i, c, y, g, a, k, h, x, v]), F = ce(() => {
|
|
5943
|
+
const P = () => N.current, te = (W, pe) => {
|
|
5947
5944
|
!pe && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${W} requested but related service/feature is disabled.`);
|
|
5948
5945
|
};
|
|
5949
5946
|
return {
|
|
@@ -5964,26 +5961,26 @@ function vs(t) {
|
|
|
5964
5961
|
te("pdfExport()", k), P()?.pdfExport?.(W);
|
|
5965
5962
|
},
|
|
5966
5963
|
openColumnChooser: (W, pe) => {
|
|
5967
|
-
te("openColumnChooser()",
|
|
5964
|
+
te("openColumnChooser()", h), P()?.columnChooserModule?.openColumnChooser?.(W, pe);
|
|
5968
5965
|
}
|
|
5969
5966
|
};
|
|
5970
5967
|
}, []);
|
|
5971
5968
|
X(() => {
|
|
5972
|
-
q && (q.current =
|
|
5973
|
-
}, [q,
|
|
5969
|
+
q && (q.current = F);
|
|
5970
|
+
}, [q, F]), X(() => () => {
|
|
5974
5971
|
q && (q.current = null);
|
|
5975
5972
|
}, []);
|
|
5976
5973
|
const z = (P) => {
|
|
5977
5974
|
const te = String(P || "");
|
|
5978
5975
|
return te === "Ascending" || te === "Descending" ? te : te.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
5979
5976
|
}, U = (P) => {
|
|
5980
|
-
const te =
|
|
5981
|
-
field:
|
|
5982
|
-
dir: z(
|
|
5977
|
+
const te = N.current, W = P?.requestType, pe = W === "paging" ? "paging" : W === "sorting" ? "sorting" : W === "searching" ? "searching" : W === "filtering" ? "filtering" : W === "grouping" ? "grouping" : W === "reorder" ? "reorder" : W === "columnstate" ? "columnstate" : "other", Fe = P?.pageSize ?? te?.pageSettings?.pageSize ?? b, Ie = P?.currentPage ?? te?.pageSettings?.currentPage ?? n, Je = P?.columnName && P?.direction ? [{ field: P.columnName, dir: z(P.direction) }] : (te?.sortSettings?.columns || []).map(($e) => ({
|
|
5978
|
+
field: $e.field,
|
|
5979
|
+
dir: z($e.direction ?? $e.dir)
|
|
5983
5980
|
})), Qe = P?.searchString ?? "", Xe = P?.columns ?? te?.filterSettings?.columns ?? [];
|
|
5984
5981
|
return {
|
|
5985
5982
|
reason: pe,
|
|
5986
|
-
page: { index: Ie, size:
|
|
5983
|
+
page: { index: Ie, size: Fe, skip: (Ie - 1) * Fe, take: Fe },
|
|
5987
5984
|
sort: Je,
|
|
5988
5985
|
// [{ field, dir: 'Ascending'|'Descending' }]
|
|
5989
5986
|
search: Qe,
|
|
@@ -5992,8 +5989,8 @@ function vs(t) {
|
|
|
5992
5989
|
};
|
|
5993
5990
|
}, Ne = (P) => {
|
|
5994
5991
|
setTimeout(() => {
|
|
5995
|
-
|
|
5996
|
-
}, 1e3), P.requestType === "paging" && (
|
|
5992
|
+
N?.current?.hideSpinner();
|
|
5993
|
+
}, 1e3), P.requestType === "paging" && (m(P.currentPage), D(P.pageSize)), P.requestType === "sorting" && (j(P.columnName || "updatedDate"), A(P.direction === "Ascending" ? "ASC" : "DESC")), T && T(U(P), P);
|
|
5997
5994
|
}, ie = (P) => {
|
|
5998
5995
|
typeof V == "function" && V(P?.rowData, P);
|
|
5999
5996
|
}, xe = () => {
|
|
@@ -6001,12 +5998,12 @@ function vs(t) {
|
|
|
6001
5998
|
return O && P.push(/* @__PURE__ */ e(ia, { type: "checkbox", width: "50" }, "__checkbox__")), C.forEach((te, W) => {
|
|
6002
5999
|
const {
|
|
6003
6000
|
field: pe,
|
|
6004
|
-
headerText:
|
|
6001
|
+
headerText: Fe,
|
|
6005
6002
|
width: Ie,
|
|
6006
6003
|
textAlign: Je = "Left",
|
|
6007
6004
|
template: Qe,
|
|
6008
6005
|
isPrimaryKey: Xe,
|
|
6009
|
-
showInColumnChooser:
|
|
6006
|
+
showInColumnChooser: $e = !0,
|
|
6010
6007
|
allowFiltering: tt = !0,
|
|
6011
6008
|
allowSorting: rt = !0,
|
|
6012
6009
|
type: nt,
|
|
@@ -6022,12 +6019,12 @@ function vs(t) {
|
|
|
6022
6019
|
ia,
|
|
6023
6020
|
{
|
|
6024
6021
|
field: pe,
|
|
6025
|
-
headerText:
|
|
6022
|
+
headerText: Fe,
|
|
6026
6023
|
width: Ie,
|
|
6027
6024
|
textAlign: Je,
|
|
6028
6025
|
template: Qe,
|
|
6029
6026
|
isPrimaryKey: Xe,
|
|
6030
|
-
showInColumnChooser:
|
|
6027
|
+
showInColumnChooser: $e,
|
|
6031
6028
|
allowFiltering: tt,
|
|
6032
6029
|
allowSorting: rt,
|
|
6033
6030
|
type: nt,
|
|
@@ -6047,7 +6044,7 @@ function vs(t) {
|
|
|
6047
6044
|
Or,
|
|
6048
6045
|
{
|
|
6049
6046
|
id: o,
|
|
6050
|
-
ref:
|
|
6047
|
+
ref: N,
|
|
6051
6048
|
dataSource: {
|
|
6052
6049
|
result: r,
|
|
6053
6050
|
count: s
|
|
@@ -6055,20 +6052,20 @@ function vs(t) {
|
|
|
6055
6052
|
height: $,
|
|
6056
6053
|
allowPaging: u,
|
|
6057
6054
|
allowSorting: i,
|
|
6058
|
-
allowFiltering:
|
|
6055
|
+
allowFiltering: c,
|
|
6059
6056
|
allowGrouping: y,
|
|
6060
|
-
allowReordering:
|
|
6061
|
-
allowResizing:
|
|
6062
|
-
showColumnChooser:
|
|
6057
|
+
allowReordering: v,
|
|
6058
|
+
allowResizing: x,
|
|
6059
|
+
showColumnChooser: h,
|
|
6063
6060
|
selectionSettings: L,
|
|
6064
6061
|
pageSettings: { pageSize: 10, pageSizes: p?.pageSizes ?? [20, 40, 60, 80, 100] },
|
|
6065
6062
|
sortSettings: f ?? {
|
|
6066
|
-
columns: [{ field:
|
|
6063
|
+
columns: [{ field: R, direction: z(S) }],
|
|
6067
6064
|
allowUnsort: !1
|
|
6068
6065
|
},
|
|
6069
6066
|
actionBegin: Ne,
|
|
6070
|
-
rowSelected:
|
|
6071
|
-
rowDeselected:
|
|
6067
|
+
rowSelected: I,
|
|
6068
|
+
rowDeselected: E,
|
|
6072
6069
|
recordDoubleClick: ie,
|
|
6073
6070
|
...w,
|
|
6074
6071
|
children: [
|