unifyedx-storybook-new 0.2.13 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
-
import ae, { useState as B, useMemo as ce, useId as ea, Fragment as
|
|
3
|
-
import { a as
|
|
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
|
|
2
|
+
import ae, { useState as B, useMemo as ce, useId as ea, Fragment as J, useEffect as Q, useCallback as K, useRef as ue } from "react";
|
|
3
|
+
import { a as Y, U as ut, X as ye, P as G, 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 $t, E as Ft, 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 $a, W as Mt, Y as sa, Z as Ut, _ as Vt, $ as Fa, 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
|
+
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 X, 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";
|
|
7
7
|
import { useFloating as Ta, offset as Aa, flip as Ea, shift as Ra, autoUpdate as Ia, useClick as Nr, useDismiss as xr, useInteractions as kr, FloatingPortal as wr } from "@floating-ui/react";
|
|
@@ -15,7 +15,7 @@ const Vr = (t) => {
|
|
|
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,
|
|
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}%)`, b = `hsl(${n}, ${u}%, ${i}%)`;
|
|
19
19
|
return { bg: y, text: b };
|
|
20
20
|
}, jr = (t = "") => t.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase(), za = ({
|
|
21
21
|
src: t,
|
|
@@ -29,7 +29,7 @@ const Vr = (t) => {
|
|
|
29
29
|
className: u,
|
|
30
30
|
...i
|
|
31
31
|
}) => {
|
|
32
|
-
const [
|
|
32
|
+
const [c, y] = B(!1), b = ce(() => qr(r), []), N = t && !c, a = !N && r, k = !N && !r, m = Y(
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
u
|
|
@@ -71,15 +71,15 @@ 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 b =
|
|
77
|
+
const b = Y(
|
|
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
84
|
return /* @__PURE__ */ l("span", { className: b, style: u && i ? {
|
|
85
85
|
backgroundColor: u,
|
|
@@ -120,15 +120,15 @@ const Vr = (t) => {
|
|
|
120
120
|
};
|
|
121
121
|
Gr.propTypes = {
|
|
122
122
|
/** Is this the principal call to action on the page? */
|
|
123
|
-
primary:
|
|
123
|
+
primary: G.bool,
|
|
124
124
|
/** What background color to use */
|
|
125
|
-
backgroundColor:
|
|
125
|
+
backgroundColor: G.string,
|
|
126
126
|
/** How large should the button be? */
|
|
127
|
-
size:
|
|
127
|
+
size: G.oneOf(["small", "medium", "large"]),
|
|
128
128
|
/** Button contents */
|
|
129
|
-
label:
|
|
129
|
+
label: G.string.isRequired,
|
|
130
130
|
/** Optional click handler */
|
|
131
|
-
onClick:
|
|
131
|
+
onClick: G.func
|
|
132
132
|
};
|
|
133
133
|
const _r = {
|
|
134
134
|
small: "btn-sm",
|
|
@@ -137,7 +137,7 @@ const _r = {
|
|
|
137
137
|
}, Wr = {
|
|
138
138
|
primary: "btn-primary",
|
|
139
139
|
secondary: "btn-secondary"
|
|
140
|
-
},
|
|
140
|
+
}, Z = ({
|
|
141
141
|
dataTestId: t,
|
|
142
142
|
title: r,
|
|
143
143
|
type: s = "button",
|
|
@@ -146,7 +146,7 @@ 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
152
|
size: b = "medium",
|
|
@@ -156,7 +156,7 @@ const _r = {
|
|
|
156
156
|
onClick: k,
|
|
157
157
|
...m
|
|
158
158
|
}) => {
|
|
159
|
-
const g = y || u, $ =
|
|
159
|
+
const g = y || u, $ = c && !N, L = Y(
|
|
160
160
|
"btn-base",
|
|
161
161
|
_r[b],
|
|
162
162
|
Wr[i],
|
|
@@ -178,7 +178,7 @@ const _r = {
|
|
|
178
178
|
"aria-label": o || $ && r || (typeof N == "string" ? N : void 0),
|
|
179
179
|
...m,
|
|
180
180
|
children: u ? /* @__PURE__ */ e(mt, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ l(ee, { children: [
|
|
181
|
-
|
|
181
|
+
c && /* @__PURE__ */ e(c, { size: b === "large" ? 20 : 16 }),
|
|
182
182
|
N,
|
|
183
183
|
a,
|
|
184
184
|
" "
|
|
@@ -216,7 +216,7 @@ const _r = {
|
|
|
216
216
|
ref: n,
|
|
217
217
|
checked: u,
|
|
218
218
|
onChange: i,
|
|
219
|
-
...
|
|
219
|
+
...c
|
|
220
220
|
}) => {
|
|
221
221
|
const y = ea(), b = r || y;
|
|
222
222
|
return /* @__PURE__ */ l("div", { className: `checkbox-container ${o || ""}`, children: [
|
|
@@ -230,13 +230,13 @@ const _r = {
|
|
|
230
230
|
className: "checkbox-input",
|
|
231
231
|
checked: u,
|
|
232
232
|
onChange: i,
|
|
233
|
-
...
|
|
233
|
+
...c
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
/* @__PURE__ */ e(
|
|
237
237
|
"div",
|
|
238
238
|
{
|
|
239
|
-
className:
|
|
239
|
+
className: Y("checkbox-box", {
|
|
240
240
|
"checkbox-box--checked": u,
|
|
241
241
|
"checkbox-box--error": !!s
|
|
242
242
|
}),
|
|
@@ -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
262
|
const b = (N) => {
|
|
263
263
|
N.stopPropagation(), N.preventDefault(), s?.();
|
|
264
264
|
};
|
|
265
|
-
return /* @__PURE__ */ l("div", { className:
|
|
265
|
+
return /* @__PURE__ */ l("div", { className: Y("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: [
|
|
@@ -271,7 +271,7 @@ const _r = {
|
|
|
271
271
|
{
|
|
272
272
|
id: "datepicker-input",
|
|
273
273
|
type: "button",
|
|
274
|
-
className:
|
|
274
|
+
className: Y("datepicker-trigger", {
|
|
275
275
|
"datepicker-trigger--error": !!u,
|
|
276
276
|
"datepicker-trigger--disabled": i
|
|
277
277
|
}),
|
|
@@ -316,7 +316,7 @@ 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
322
|
const b = t?.from, N = t?.to, a = (m) => {
|
|
@@ -326,7 +326,7 @@ const _r = {
|
|
|
326
326
|
" - ",
|
|
327
327
|
Ue(N, "MMM d, y")
|
|
328
328
|
] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
|
|
329
|
-
return /* @__PURE__ */ l("div", { className:
|
|
329
|
+
return /* @__PURE__ */ l("div", { className: Y("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: [
|
|
@@ -335,7 +335,7 @@ const _r = {
|
|
|
335
335
|
{
|
|
336
336
|
id: "daterangepicker-input",
|
|
337
337
|
type: "button",
|
|
338
|
-
className:
|
|
338
|
+
className: Y("datepicker-trigger", {
|
|
339
339
|
"datepicker-trigger--error": !!u,
|
|
340
340
|
"datepicker-trigger--disabled": i
|
|
341
341
|
}),
|
|
@@ -625,7 +625,7 @@ 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
630
|
handleRemoveRejectedFile: b,
|
|
631
631
|
handleSubmit: N,
|
|
@@ -635,8 +635,8 @@ const _r = {
|
|
|
635
635
|
title: m = "Upload Files",
|
|
636
636
|
subHeading: g = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
637
637
|
}) => {
|
|
638
|
-
const $ = i.length > 0 ||
|
|
639
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as:
|
|
638
|
+
const $ = i.length > 0 || c.length > 0;
|
|
639
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(
|
|
640
640
|
me,
|
|
641
641
|
{
|
|
642
642
|
as: "div",
|
|
@@ -647,7 +647,7 @@ const _r = {
|
|
|
647
647
|
/* @__PURE__ */ e(
|
|
648
648
|
ge,
|
|
649
649
|
{
|
|
650
|
-
as:
|
|
650
|
+
as: J,
|
|
651
651
|
enter: "ease-out duration-300",
|
|
652
652
|
enterFrom: "opacity-0",
|
|
653
653
|
enterTo: "opacity-100",
|
|
@@ -660,7 +660,7 @@ const _r = {
|
|
|
660
660
|
/* @__PURE__ */ e("div", { className: "dialog-positioner", children: /* @__PURE__ */ e(
|
|
661
661
|
ge,
|
|
662
662
|
{
|
|
663
|
-
as:
|
|
663
|
+
as: J,
|
|
664
664
|
enter: "ease-out duration-300",
|
|
665
665
|
enterFrom: "opacity-0 scale-95",
|
|
666
666
|
enterTo: "opacity-100 scale-100",
|
|
@@ -714,7 +714,7 @@ const _r = {
|
|
|
714
714
|
$ && /* @__PURE__ */ l("div", { className: "file-list-container", children: [
|
|
715
715
|
/* @__PURE__ */ e("h3", { children: "Upload Queue" }),
|
|
716
716
|
/* @__PURE__ */ l("ul", { className: "file-list", children: [
|
|
717
|
-
i.map((L,
|
|
717
|
+
i.map((L, M) => /* @__PURE__ */ l(
|
|
718
718
|
"li",
|
|
719
719
|
{
|
|
720
720
|
className: "file-item",
|
|
@@ -735,16 +735,16 @@ const _r = {
|
|
|
735
735
|
"button",
|
|
736
736
|
{
|
|
737
737
|
type: "button",
|
|
738
|
-
onClick: () => y(
|
|
738
|
+
onClick: () => y(M),
|
|
739
739
|
className: "remove-file-button",
|
|
740
740
|
children: /* @__PURE__ */ e(Ve, { size: 16 })
|
|
741
741
|
}
|
|
742
742
|
)
|
|
743
743
|
]
|
|
744
744
|
},
|
|
745
|
-
`${L.name}-${
|
|
745
|
+
`${L.name}-${M}`
|
|
746
746
|
)),
|
|
747
|
-
|
|
747
|
+
c.map(({ file: L, message: M }, C) => /* @__PURE__ */ l(
|
|
748
748
|
"li",
|
|
749
749
|
{
|
|
750
750
|
className: "file-item file-item--rejected",
|
|
@@ -759,7 +759,7 @@ const _r = {
|
|
|
759
759
|
/* @__PURE__ */ l("div", { children: [
|
|
760
760
|
/* @__PURE__ */ e("p", { className: "file-item-name", children: L.name }),
|
|
761
761
|
/* @__PURE__ */ e("p", { className: "file-item-size", children: ua(L.size) }),
|
|
762
|
-
/* @__PURE__ */ e("p", { className: "rejection-reason", children:
|
|
762
|
+
/* @__PURE__ */ e("p", { className: "rejection-reason", children: M })
|
|
763
763
|
] })
|
|
764
764
|
] }),
|
|
765
765
|
/* @__PURE__ */ e(
|
|
@@ -780,7 +780,7 @@ const _r = {
|
|
|
780
780
|
] }),
|
|
781
781
|
/* @__PURE__ */ l("div", { className: "dialog-footer", children: [
|
|
782
782
|
/* @__PURE__ */ e(
|
|
783
|
-
|
|
783
|
+
Z,
|
|
784
784
|
{
|
|
785
785
|
type: "button",
|
|
786
786
|
category: "secondary",
|
|
@@ -789,7 +789,7 @@ const _r = {
|
|
|
789
789
|
}
|
|
790
790
|
),
|
|
791
791
|
/* @__PURE__ */ e(
|
|
792
|
-
|
|
792
|
+
Z,
|
|
793
793
|
{
|
|
794
794
|
type: "submit",
|
|
795
795
|
label: a ? "Uploading..." : "Upload Files",
|
|
@@ -817,7 +817,7 @@ 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
|
}), [b, N] = B({
|
|
@@ -828,11 +828,11 @@ const _r = {
|
|
|
828
828
|
// Deep copy
|
|
829
829
|
onSubmit: (C) => {
|
|
830
830
|
const T = {};
|
|
831
|
-
Object.keys(C).forEach((
|
|
832
|
-
T[
|
|
833
|
-
operator: C[
|
|
834
|
-
values: Array.isArray(C[
|
|
835
|
-
range: C[
|
|
831
|
+
Object.keys(C).forEach((E) => {
|
|
832
|
+
T[E] = {
|
|
833
|
+
operator: C[E].operator || "in",
|
|
834
|
+
values: Array.isArray(C[E].values) ? C[E].values : [],
|
|
835
|
+
range: C[E].range || null
|
|
836
836
|
};
|
|
837
837
|
}), console.log("[storybook filter] Applied Filters:", T), typeof s == "function" && s({
|
|
838
838
|
filters: T,
|
|
@@ -841,38 +841,38 @@ const _r = {
|
|
|
841
841
|
},
|
|
842
842
|
enableReinitialize: !0
|
|
843
843
|
}), k = ce(() => n.reduce((C, T) => {
|
|
844
|
-
const
|
|
845
|
-
let
|
|
846
|
-
if (
|
|
844
|
+
const E = T.key, R = a.values[E];
|
|
845
|
+
let U = !1;
|
|
846
|
+
if (R)
|
|
847
847
|
switch (T.type) {
|
|
848
848
|
case "multiselect":
|
|
849
849
|
case "multiselect-users":
|
|
850
|
-
|
|
850
|
+
U = Array.isArray(R.values) && R.values.length > 0;
|
|
851
851
|
break;
|
|
852
852
|
case "date":
|
|
853
|
-
(
|
|
853
|
+
(R.range && R.range !== "" || Array.isArray(R.values) && R.values.length > 0) && (U = !0);
|
|
854
854
|
break;
|
|
855
855
|
}
|
|
856
|
-
return C[
|
|
856
|
+
return C[E] = U, C;
|
|
857
857
|
}, {}), [n, a.values]), m = Object.values(k).filter(Boolean).length, g = async (C, T) => {
|
|
858
858
|
try {
|
|
859
|
-
N((
|
|
860
|
-
const
|
|
861
|
-
y((
|
|
862
|
-
} catch (
|
|
863
|
-
console.error(`Error fetching ${C} users:`,
|
|
859
|
+
N((R) => ({ ...R, [C]: !0 }));
|
|
860
|
+
const E = await i(C, T);
|
|
861
|
+
y((R) => ({ ...R, [C]: E }));
|
|
862
|
+
} catch (E) {
|
|
863
|
+
console.error(`Error fetching ${C} users:`, E);
|
|
864
864
|
} finally {
|
|
865
|
-
N((
|
|
865
|
+
N((E) => ({ ...E, [C]: !1 }));
|
|
866
866
|
}
|
|
867
867
|
}, $ = (C) => {
|
|
868
|
-
const T = n[C].key,
|
|
869
|
-
n[C].type === "multiselect-users" &&
|
|
868
|
+
const T = n[C].key, E = n[C].url;
|
|
869
|
+
n[C].type === "multiselect-users" && c[T].length === 0 && !b[T] && g(T, E);
|
|
870
870
|
}, L = () => {
|
|
871
871
|
a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
|
|
872
|
-
},
|
|
873
|
-
const T = n.find((
|
|
872
|
+
}, M = (C) => {
|
|
873
|
+
const T = n.find((U) => U.key === C);
|
|
874
874
|
if (!T) return null;
|
|
875
|
-
const
|
|
875
|
+
const E = a.values[C] || u[C], R = Array.isArray(E.values) ? E.values : [];
|
|
876
876
|
switch (T.type) {
|
|
877
877
|
case "multiselect":
|
|
878
878
|
return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
|
|
@@ -881,10 +881,10 @@ const _r = {
|
|
|
881
881
|
/* @__PURE__ */ e(
|
|
882
882
|
"select",
|
|
883
883
|
{
|
|
884
|
-
value:
|
|
885
|
-
onChange: (
|
|
884
|
+
value: E.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,9 +896,9 @@ 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 h =
|
|
899
|
+
checked: T.options.length > 0 && R.length === T.options.length,
|
|
900
|
+
onChange: (d) => {
|
|
901
|
+
const h = d.target.checked ? T.options.map((x) => x.value) : [];
|
|
902
902
|
a.setFieldValue(`${C}.values`, h);
|
|
903
903
|
}
|
|
904
904
|
}
|
|
@@ -912,16 +912,16 @@ 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:
|
|
922
|
+
checked: R.includes(d.value),
|
|
923
923
|
onChange: (h) => {
|
|
924
|
-
const x = h.target.checked ? [...
|
|
924
|
+
const x = h.target.checked ? [...R, d.value] : R.filter((F) => F !== d.value);
|
|
925
925
|
a.setFieldValue(`${C}.values`, x);
|
|
926
926
|
}
|
|
927
927
|
}
|
|
@@ -929,30 +929,30 @@ const _r = {
|
|
|
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
|
|
941
|
+
const U = c[C] || [], V = b[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: E.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
|
] }),
|
|
955
|
-
|
|
955
|
+
V ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: U.length > 0 ? /* @__PURE__ */ l(ee, { children: [
|
|
956
956
|
/* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
|
|
957
957
|
/* @__PURE__ */ e(
|
|
958
958
|
"input",
|
|
@@ -960,9 +960,9 @@ const _r = {
|
|
|
960
960
|
type: "checkbox",
|
|
961
961
|
id: `select-all-users-${C}`,
|
|
962
962
|
className: "filter-checkbox-input",
|
|
963
|
-
checked:
|
|
964
|
-
onChange: (
|
|
965
|
-
const h =
|
|
963
|
+
checked: U.length > 0 && R.length === U.length,
|
|
964
|
+
onChange: (d) => {
|
|
965
|
+
const h = d.target.checked ? U.map((x) => x.email) : [];
|
|
966
966
|
a.setFieldValue(
|
|
967
967
|
`${C}.values`,
|
|
968
968
|
h
|
|
@@ -979,16 +979,16 @@ const _r = {
|
|
|
979
979
|
}
|
|
980
980
|
)
|
|
981
981
|
] }),
|
|
982
|
-
|
|
982
|
+
U.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:
|
|
989
|
+
checked: R.includes(d.email),
|
|
990
990
|
onChange: (h) => {
|
|
991
|
-
const x = h.target.checked ? [...
|
|
991
|
+
const x = h.target.checked ? [...R, d.email] : R.filter((F) => F !== d.email);
|
|
992
992
|
a.setFieldValue(
|
|
993
993
|
`${C}.values`,
|
|
994
994
|
x
|
|
@@ -999,19 +999,19 @@ 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
|
|
1014
|
+
const j = E.values || [], [v, p] = j, f = v && p, w = {
|
|
1015
1015
|
startDate: v instanceof Date ? v : /* @__PURE__ */ new Date(),
|
|
1016
1016
|
// Fallback to today
|
|
1017
1017
|
endDate: p instanceof Date ? p : /* @__PURE__ */ new Date(),
|
|
@@ -1024,10 +1024,10 @@ const _r = {
|
|
|
1024
1024
|
/* @__PURE__ */ e(
|
|
1025
1025
|
"select",
|
|
1026
1026
|
{
|
|
1027
|
-
value:
|
|
1028
|
-
onChange: (
|
|
1027
|
+
value: E.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,8 +1049,8 @@ const _r = {
|
|
|
1049
1049
|
ft.DateRangePicker,
|
|
1050
1050
|
{
|
|
1051
1051
|
ranges: [w],
|
|
1052
|
-
onChange: (
|
|
1053
|
-
const { startDate: h, endDate: x } =
|
|
1052
|
+
onChange: (d) => {
|
|
1053
|
+
const { startDate: h, endDate: x } = d.selection;
|
|
1054
1054
|
a.setFieldValue(`${C}.values`, [
|
|
1055
1055
|
h,
|
|
1056
1056
|
x
|
|
@@ -1068,11 +1068,11 @@ const _r = {
|
|
|
1068
1068
|
return null;
|
|
1069
1069
|
}
|
|
1070
1070
|
};
|
|
1071
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as:
|
|
1071
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: r, children: [
|
|
1072
1072
|
/* @__PURE__ */ e(
|
|
1073
1073
|
ge,
|
|
1074
1074
|
{
|
|
1075
|
-
as:
|
|
1075
|
+
as: J,
|
|
1076
1076
|
enter: "ease-out duration-300",
|
|
1077
1077
|
enterFrom: "opacity-0",
|
|
1078
1078
|
enterTo: "opacity-100",
|
|
@@ -1085,7 +1085,7 @@ const _r = {
|
|
|
1085
1085
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(
|
|
1086
1086
|
ge,
|
|
1087
1087
|
{
|
|
1088
|
-
as:
|
|
1088
|
+
as: J,
|
|
1089
1089
|
enter: "ease-out duration-300",
|
|
1090
1090
|
enterFrom: "opacity-0 translate-x-full",
|
|
1091
1091
|
enterTo: "opacity-100 translate-x-0",
|
|
@@ -1140,7 +1140,7 @@ const _r = {
|
|
|
1140
1140
|
animate: { opacity: 1, x: 0 },
|
|
1141
1141
|
transition: { duration: 0.3 },
|
|
1142
1142
|
className: "h-full",
|
|
1143
|
-
children:
|
|
1143
|
+
children: M(C.key)
|
|
1144
1144
|
},
|
|
1145
1145
|
C.key
|
|
1146
1146
|
)
|
|
@@ -1179,7 +1179,7 @@ const _r = {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
) }) })
|
|
1181
1181
|
] }) });
|
|
1182
|
-
},
|
|
1182
|
+
}, W = ({
|
|
1183
1183
|
label: t,
|
|
1184
1184
|
id: r,
|
|
1185
1185
|
type: s = "text",
|
|
@@ -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: [
|
|
@@ -1201,11 +1201,11 @@ const _r = {
|
|
|
1201
1201
|
id: y,
|
|
1202
1202
|
type: s,
|
|
1203
1203
|
ref: i,
|
|
1204
|
-
className:
|
|
1204
|
+
className: Y("input-field", {
|
|
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,7 +1241,7 @@ 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
1246
|
size: b
|
|
1247
1247
|
// Add size prop
|
|
@@ -1251,11 +1251,11 @@ const _r = {
|
|
|
1251
1251
|
}, m = () => {
|
|
1252
1252
|
r({ primary: !1, secondary: !0 });
|
|
1253
1253
|
};
|
|
1254
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as:
|
|
1254
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "modal-dialog", onClose: () => r({}), children: [
|
|
1255
1255
|
/* @__PURE__ */ e(
|
|
1256
1256
|
ge,
|
|
1257
1257
|
{
|
|
1258
|
-
as:
|
|
1258
|
+
as: J,
|
|
1259
1259
|
enter: "ease-out duration-300",
|
|
1260
1260
|
enterFrom: "opacity-0",
|
|
1261
1261
|
enterTo: "opacity-100",
|
|
@@ -1268,7 +1268,7 @@ const _r = {
|
|
|
1268
1268
|
/* @__PURE__ */ e("div", { className: "modal-positioner", children: /* @__PURE__ */ e(
|
|
1269
1269
|
ge,
|
|
1270
1270
|
{
|
|
1271
|
-
as:
|
|
1271
|
+
as: J,
|
|
1272
1272
|
enter: "ease-out duration-300",
|
|
1273
1273
|
enterFrom: "opacity-0 scale-95",
|
|
1274
1274
|
enterTo: "opacity-100 scale-100",
|
|
@@ -1285,7 +1285,7 @@ const _r = {
|
|
|
1285
1285
|
] }),
|
|
1286
1286
|
(n || u) && /* @__PURE__ */ l("div", { className: "modal-footer", children: [
|
|
1287
1287
|
u && /* @__PURE__ */ e(
|
|
1288
|
-
|
|
1288
|
+
Z,
|
|
1289
1289
|
{
|
|
1290
1290
|
onClick: m,
|
|
1291
1291
|
label: u,
|
|
@@ -1293,7 +1293,7 @@ const _r = {
|
|
|
1293
1293
|
}
|
|
1294
1294
|
),
|
|
1295
1295
|
n && /* @__PURE__ */ e(
|
|
1296
|
-
|
|
1296
|
+
Z,
|
|
1297
1297
|
{
|
|
1298
1298
|
onClick: k,
|
|
1299
1299
|
label: n,
|
|
@@ -1313,13 +1313,13 @@ const _r = {
|
|
|
1313
1313
|
onItemsPerPageChange: n,
|
|
1314
1314
|
itemsPerPageOptions: u = [10, 15, 20]
|
|
1315
1315
|
}) => {
|
|
1316
|
-
const i = Math.ceil(r / s), [
|
|
1317
|
-
|
|
1316
|
+
const i = Math.ceil(r / s), [c, y] = B(t);
|
|
1317
|
+
Q(() => {
|
|
1318
1318
|
y(t);
|
|
1319
1319
|
}, [t]);
|
|
1320
1320
|
const b = Math.min((t - 1) * s + 1, r), N = Math.min(t * s, r), a = (k) => {
|
|
1321
1321
|
k.preventDefault();
|
|
1322
|
-
let m = parseInt(
|
|
1322
|
+
let m = parseInt(c, 10);
|
|
1323
1323
|
isNaN(m) || m < 1 ? m = 1 : m > i && (m = i), y(m), m !== t && o(m);
|
|
1324
1324
|
};
|
|
1325
1325
|
return /* @__PURE__ */ l("div", { className: "pagination-container", children: [
|
|
@@ -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 }) => Y("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,8 +1457,8 @@ const _r = {
|
|
|
1457
1457
|
customClass: u = "",
|
|
1458
1458
|
...i
|
|
1459
1459
|
}) => {
|
|
1460
|
-
const [
|
|
1461
|
-
|
|
1460
|
+
const [c, y] = B(t);
|
|
1461
|
+
Q(() => {
|
|
1462
1462
|
y(t);
|
|
1463
1463
|
}, [t]);
|
|
1464
1464
|
const b = K(
|
|
@@ -1467,9 +1467,9 @@ const _r = {
|
|
|
1467
1467
|
}, s),
|
|
1468
1468
|
[s, r]
|
|
1469
1469
|
);
|
|
1470
|
-
|
|
1470
|
+
Q(() => (c !== t && b(c), () => {
|
|
1471
1471
|
b.cancel();
|
|
1472
|
-
}), [
|
|
1472
|
+
}), [c, b, t]);
|
|
1473
1473
|
const N = (a) => {
|
|
1474
1474
|
y(a.target.value);
|
|
1475
1475
|
};
|
|
@@ -1484,7 +1484,7 @@ const _r = {
|
|
|
1484
1484
|
placeholder: o,
|
|
1485
1485
|
type: "search",
|
|
1486
1486
|
name: "search",
|
|
1487
|
-
value:
|
|
1487
|
+
value: c,
|
|
1488
1488
|
onChange: N,
|
|
1489
1489
|
...i
|
|
1490
1490
|
}
|
|
@@ -1500,20 +1500,20 @@ 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
1507
|
const [b, N] = B(""), a = b === "" ? o : o.filter(
|
|
1508
1508
|
(m) => m.label.toLowerCase().includes(b.toLowerCase())
|
|
1509
1509
|
), k = o.find((m) => r?.id ? m.id === r.id : m.id === r || m.value === r);
|
|
1510
|
-
return /* @__PURE__ */ e(
|
|
1510
|
+
return /* @__PURE__ */ e(X, { 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(
|
|
1514
1514
|
cr,
|
|
1515
1515
|
{
|
|
1516
|
-
className:
|
|
1516
|
+
className: Y("select-button", {
|
|
1517
1517
|
"select-button--error": !!i
|
|
1518
1518
|
}),
|
|
1519
1519
|
children: [
|
|
@@ -1572,7 +1572,7 @@ const _r = {
|
|
|
1572
1572
|
] }) });
|
|
1573
1573
|
}, Hr = () => {
|
|
1574
1574
|
const [t, r] = B(window.location.pathname);
|
|
1575
|
-
return
|
|
1575
|
+
return Q(() => {
|
|
1576
1576
|
const s = () => {
|
|
1577
1577
|
r(window.location.pathname);
|
|
1578
1578
|
};
|
|
@@ -1586,8 +1586,8 @@ 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),
|
|
1590
|
-
|
|
1589
|
+
const { pathname: o } = Hr(), n = t.href || t.url || t.path, [u, i] = B(!1), c = t.icon;
|
|
1590
|
+
Q(() => {
|
|
1591
1591
|
na([t], o) && i(!0);
|
|
1592
1592
|
}, [t, o]);
|
|
1593
1593
|
const y = o === n, b = !y && !!na([t], o), N = (a) => {
|
|
@@ -1596,7 +1596,7 @@ const _r = {
|
|
|
1596
1596
|
return /* @__PURE__ */ l(
|
|
1597
1597
|
"div",
|
|
1598
1598
|
{
|
|
1599
|
-
className:
|
|
1599
|
+
className: Y("nav-item-container", {
|
|
1600
1600
|
"nav-item-container--parent-active": b,
|
|
1601
1601
|
[`nav-item-container--level-${s}`]: s > 0
|
|
1602
1602
|
}),
|
|
@@ -1607,13 +1607,13 @@ const _r = {
|
|
|
1607
1607
|
href: n,
|
|
1608
1608
|
target: t.target,
|
|
1609
1609
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
1610
|
-
className:
|
|
1610
|
+
className: Y("nav-item", {
|
|
1611
1611
|
"nav-item--active": y,
|
|
1612
1612
|
"nav-item--collapsed": 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",
|
|
@@ -1625,7 +1625,7 @@ const _r = {
|
|
|
1625
1625
|
children: /* @__PURE__ */ e(
|
|
1626
1626
|
wa,
|
|
1627
1627
|
{
|
|
1628
|
-
className:
|
|
1628
|
+
className: Y("nav-chevron", {
|
|
1629
1629
|
"nav-chevron--open": u
|
|
1630
1630
|
})
|
|
1631
1631
|
}
|
|
@@ -1638,7 +1638,7 @@ const _r = {
|
|
|
1638
1638
|
t.children && /* @__PURE__ */ e(
|
|
1639
1639
|
"div",
|
|
1640
1640
|
{
|
|
1641
|
-
className:
|
|
1641
|
+
className: Y("sub-menu", {
|
|
1642
1642
|
"sub-menu--open": u,
|
|
1643
1643
|
"sub-menu--collapsed": r
|
|
1644
1644
|
}),
|
|
@@ -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",
|
|
@@ -1678,7 +1678,7 @@ const _r = {
|
|
|
1678
1678
|
/* @__PURE__ */ l(
|
|
1679
1679
|
"aside",
|
|
1680
1680
|
{
|
|
1681
|
-
className:
|
|
1681
|
+
className: Y("sidebar", {
|
|
1682
1682
|
"sidebar--collapsed": r,
|
|
1683
1683
|
"sidebar--mobile-open": o
|
|
1684
1684
|
}),
|
|
@@ -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",
|
|
@@ -1736,7 +1736,7 @@ const _r = {
|
|
|
1736
1736
|
className: s,
|
|
1737
1737
|
...o
|
|
1738
1738
|
}) => {
|
|
1739
|
-
const n =
|
|
1739
|
+
const n = Y(
|
|
1740
1740
|
"spinner",
|
|
1741
1741
|
`spinner--size-${t}`,
|
|
1742
1742
|
`spinner--color-${r}`,
|
|
@@ -1774,12 +1774,12 @@ 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
|
-
|
|
1779
|
+
const y = r || c.name, [b, N] = B(
|
|
1780
|
+
c.value?.length || c.defaultValue?.length || 0
|
|
1781
1781
|
), a = (m) => {
|
|
1782
|
-
N(m.target.value.length),
|
|
1782
|
+
N(m.target.value.length), c.onChange && c.onChange(m);
|
|
1783
1783
|
}, k = u - b;
|
|
1784
1784
|
return /* @__PURE__ */ l("div", { className: `textarea-wrapper ${o || ""}`, children: [
|
|
1785
1785
|
/* @__PURE__ */ l("div", { className: "textarea-header", children: [
|
|
@@ -1794,12 +1794,12 @@ const _r = {
|
|
|
1794
1794
|
{
|
|
1795
1795
|
id: y,
|
|
1796
1796
|
ref: n,
|
|
1797
|
-
className:
|
|
1797
|
+
className: Y("textarea-field", {
|
|
1798
1798
|
"textarea-field--error": !!s
|
|
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 })
|
|
@@ -1819,7 +1819,7 @@ const _r = {
|
|
|
1819
1819
|
{
|
|
1820
1820
|
checked: r,
|
|
1821
1821
|
onChange: s,
|
|
1822
|
-
className:
|
|
1822
|
+
className: Y("switch-element", {
|
|
1823
1823
|
// Renamed from switch-wrapper
|
|
1824
1824
|
"switch-element--error": !!n
|
|
1825
1825
|
}),
|
|
@@ -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,12 +1879,12 @@ 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
1884
|
closeOnOverlayClick: b = !0
|
|
1885
1885
|
}) => {
|
|
1886
1886
|
const N = s[o], a = Object.keys(s), k = a.indexOf(o), m = (k + 1) / a.length * 100, g = k > 0 && u.onBack;
|
|
1887
|
-
return /* @__PURE__ */ e(oe, { show: t, as:
|
|
1887
|
+
return /* @__PURE__ */ e(oe, { show: t, as: J, children: /* @__PURE__ */ l(
|
|
1888
1888
|
me,
|
|
1889
1889
|
{
|
|
1890
1890
|
as: "div",
|
|
@@ -1895,7 +1895,7 @@ const _r = {
|
|
|
1895
1895
|
/* @__PURE__ */ e(
|
|
1896
1896
|
ge,
|
|
1897
1897
|
{
|
|
1898
|
-
as:
|
|
1898
|
+
as: J,
|
|
1899
1899
|
enter: "ease-out duration-300",
|
|
1900
1900
|
enterFrom: "opacity-0",
|
|
1901
1901
|
enterTo: "opacity-100",
|
|
@@ -1908,7 +1908,7 @@ const _r = {
|
|
|
1908
1908
|
/* @__PURE__ */ e("div", { className: "wizard-container", children: /* @__PURE__ */ e("div", { className: "wizard-positioner", children: /* @__PURE__ */ e(
|
|
1909
1909
|
ge,
|
|
1910
1910
|
{
|
|
1911
|
-
as:
|
|
1911
|
+
as: J,
|
|
1912
1912
|
enter: "transform transition ease-in-out duration-500",
|
|
1913
1913
|
enterFrom: "translate-x-full",
|
|
1914
1914
|
enterTo: "translate-x-0",
|
|
@@ -1929,7 +1929,7 @@ const _r = {
|
|
|
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(
|
|
@@ -1991,21 +1991,21 @@ const _r = {
|
|
|
1991
1991
|
tertiary: u,
|
|
1992
1992
|
fullHeight: i = !1,
|
|
1993
1993
|
// A clearer prop name
|
|
1994
|
-
...
|
|
1994
|
+
...c
|
|
1995
1995
|
}) => {
|
|
1996
|
-
const y =
|
|
1996
|
+
const y = Y(
|
|
1997
1997
|
"page-layout",
|
|
1998
1998
|
{
|
|
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(
|
|
2008
|
-
|
|
2008
|
+
Z,
|
|
2009
2009
|
{
|
|
2010
2010
|
category: "secondary",
|
|
2011
2011
|
label: u.label || "Tertiary",
|
|
@@ -2013,7 +2013,7 @@ const _r = {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
),
|
|
2015
2015
|
n?.show && /* @__PURE__ */ e(
|
|
2016
|
-
|
|
2016
|
+
Z,
|
|
2017
2017
|
{
|
|
2018
2018
|
category: "secondary",
|
|
2019
2019
|
label: n.label || "Cancel",
|
|
@@ -2021,7 +2021,7 @@ const _r = {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
),
|
|
2023
2023
|
o?.show && /* @__PURE__ */ e(
|
|
2024
|
-
|
|
2024
|
+
Z,
|
|
2025
2025
|
{
|
|
2026
2026
|
category: "primary",
|
|
2027
2027
|
label: o.label || "Save",
|
|
@@ -2067,7 +2067,7 @@ const _r = {
|
|
|
2067
2067
|
/* @__PURE__ */ e(gr, { children: /* @__PURE__ */ e(
|
|
2068
2068
|
oe,
|
|
2069
2069
|
{
|
|
2070
|
-
as:
|
|
2070
|
+
as: J,
|
|
2071
2071
|
enter: "transition ease-out duration-100",
|
|
2072
2072
|
enterFrom: "transform opacity-0 scale-95",
|
|
2073
2073
|
enterTo: "transform opacity-100 scale-100",
|
|
@@ -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,
|
|
@@ -2323,7 +2323,7 @@ function dn({
|
|
|
2323
2323
|
async function i(b, N = {}, a = !1, k = {}) {
|
|
2324
2324
|
return s.post(b, N, o({ open: a, customHeader: k }));
|
|
2325
2325
|
}
|
|
2326
|
-
async function
|
|
2326
|
+
async function c(b, N = {}, a = !1, k = {}) {
|
|
2327
2327
|
return s.put(b, N, o({ open: a, customHeader: k }));
|
|
2328
2328
|
}
|
|
2329
2329
|
async function y(b, N = {}, a = !1, k = {}) {
|
|
@@ -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
|
}
|
|
@@ -2426,7 +2426,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2426
2426
|
}
|
|
2427
2427
|
}, oa = (t, r) => {
|
|
2428
2428
|
const [s, o] = B(t);
|
|
2429
|
-
return
|
|
2429
|
+
return Q(
|
|
2430
2430
|
() => {
|
|
2431
2431
|
const n = Cr(() => {
|
|
2432
2432
|
o(t);
|
|
@@ -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",
|
|
@@ -2495,82 +2495,82 @@ 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, b] = B(ga[0]), [N, a] = B(""), k = oa(N, 400), [m, g] = B([]), [$, L] = B(/* @__PURE__ */ new Set()), [
|
|
2501
|
-
control:
|
|
2502
|
-
handleSubmit:
|
|
2503
|
-
watch:
|
|
2504
|
-
formState: { errors:
|
|
2500
|
+
const [y, b] = B(ga[0]), [N, a] = B(""), k = oa(N, 400), [m, g] = B([]), [$, L] = B(/* @__PURE__ */ new Set()), [M, C] = B(!1), [T, E] = B(ya[0]), {
|
|
2501
|
+
control: R,
|
|
2502
|
+
handleSubmit: U,
|
|
2503
|
+
watch: V,
|
|
2504
|
+
formState: { errors: j, isSubmitting: v }
|
|
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: R,
|
|
2510
2510
|
name: "pendingInvites"
|
|
2511
|
-
}), h =
|
|
2512
|
-
|
|
2513
|
-
k.length > 1 ? (C(!0), hn(y.name, k).then((
|
|
2514
|
-
g(
|
|
2515
|
-
}).catch((
|
|
2511
|
+
}), h = V("pendingInvites");
|
|
2512
|
+
Q(() => {
|
|
2513
|
+
k.length > 1 ? (C(!0), hn(y.name, k).then((S) => {
|
|
2514
|
+
g(S);
|
|
2515
|
+
}).catch((S) => console.error("Search failed:", S)).finally(() => C(!1))) : (g([]), L(/* @__PURE__ */ new Set()));
|
|
2516
2516
|
}, [k, y]);
|
|
2517
|
-
const x = (
|
|
2518
|
-
L((
|
|
2519
|
-
const
|
|
2520
|
-
return
|
|
2517
|
+
const x = (S) => {
|
|
2518
|
+
L((I) => {
|
|
2519
|
+
const O = new Set(I);
|
|
2520
|
+
return O.has(S) ? O.delete(S) : O.add(S), O;
|
|
2521
2521
|
});
|
|
2522
2522
|
}, F = () => {
|
|
2523
|
-
m.filter((
|
|
2524
|
-
p.find((
|
|
2523
|
+
m.filter((S) => $.has(S.id)).forEach((S) => {
|
|
2524
|
+
p.find((I) => I.id === S.id) || f({ ...S, permission: T.name });
|
|
2525
2525
|
}), L(/* @__PURE__ */ new Set()), a("");
|
|
2526
|
-
},
|
|
2527
|
-
|
|
2528
|
-
(
|
|
2526
|
+
}, z = (S) => {
|
|
2527
|
+
E(S), p.forEach(
|
|
2528
|
+
(I, O) => d(O, { ...p[O], permission: S.name })
|
|
2529
2529
|
);
|
|
2530
|
-
},
|
|
2530
|
+
}, q = async (S) => {
|
|
2531
2531
|
try {
|
|
2532
2532
|
if (n === se.DRIVE) {
|
|
2533
|
-
const
|
|
2533
|
+
const I = {
|
|
2534
2534
|
entity: t,
|
|
2535
|
-
userGroupRolesObj:
|
|
2536
|
-
id:
|
|
2537
|
-
permission:
|
|
2538
|
-
type:
|
|
2535
|
+
userGroupRolesObj: S.pendingInvites.map((O) => ({
|
|
2536
|
+
id: O.id,
|
|
2537
|
+
permission: O.permission,
|
|
2538
|
+
type: O.type.toLowerCase()
|
|
2539
2539
|
}))
|
|
2540
2540
|
};
|
|
2541
|
-
i(
|
|
2541
|
+
i(I, o);
|
|
2542
2542
|
} else if (n === se.INTEREST) {
|
|
2543
|
-
const
|
|
2544
|
-
identity:
|
|
2545
|
-
type:
|
|
2543
|
+
const I = S.pendingInvites.map((O) => ({
|
|
2544
|
+
identity: O.id,
|
|
2545
|
+
type: O.type.toLowerCase(),
|
|
2546
2546
|
opt: !0,
|
|
2547
2547
|
lock: !1,
|
|
2548
2548
|
moderator: !1,
|
|
2549
|
-
userName:
|
|
2549
|
+
userName: O.name,
|
|
2550
2550
|
interestId: t?.data?.id
|
|
2551
2551
|
}));
|
|
2552
|
-
i(
|
|
2552
|
+
i(I, o);
|
|
2553
2553
|
} else if (n === se.ARTICLE) {
|
|
2554
|
-
const
|
|
2554
|
+
const I = {
|
|
2555
2555
|
entity: t,
|
|
2556
|
-
userGroupRolesObj:
|
|
2557
|
-
id:
|
|
2558
|
-
permission:
|
|
2559
|
-
type:
|
|
2556
|
+
userGroupRolesObj: S.pendingInvites.map((O) => ({
|
|
2557
|
+
id: O.id,
|
|
2558
|
+
permission: O.permission,
|
|
2559
|
+
type: O.type.toLowerCase()
|
|
2560
2560
|
}))
|
|
2561
2561
|
};
|
|
2562
|
-
i(
|
|
2562
|
+
i(I, o);
|
|
2563
2563
|
} else
|
|
2564
|
-
i(
|
|
2564
|
+
i(S, o);
|
|
2565
2565
|
setTimeout(() => {
|
|
2566
2566
|
s();
|
|
2567
2567
|
}, 1e3);
|
|
2568
|
-
} catch (
|
|
2569
|
-
throw console.error("Failed to submit invites:",
|
|
2568
|
+
} catch (I) {
|
|
2569
|
+
throw console.error("Failed to submit invites:", I), I;
|
|
2570
2570
|
}
|
|
2571
|
-
},
|
|
2572
|
-
const
|
|
2573
|
-
return
|
|
2571
|
+
}, D = (S) => {
|
|
2572
|
+
const I = o[y.code].find((O) => O.name === S.name && O.permission !== "remove") || h.find((O) => O.name === S.name);
|
|
2573
|
+
return I ? `${I.permission}` : "";
|
|
2574
2574
|
}, A = () => {
|
|
2575
2575
|
switch (n) {
|
|
2576
2576
|
case se.DRIVE:
|
|
@@ -2582,8 +2582,8 @@ 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
|
-
}
|
|
2586
|
-
return /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2585
|
+
};
|
|
2586
|
+
return ce(() => $.size === 0 && !c, [$, c]), /* @__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() }),
|
|
2589
2589
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
|
|
@@ -2605,15 +2605,15 @@ 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((S) => S.permission !== "remove"),
|
|
2609
|
+
groups: o.groups.filter((S) => S.permission !== "remove"),
|
|
2610
|
+
roles: o.roles.filter((S) => S.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(
|
|
2616
|
-
/* @__PURE__ */ l(
|
|
2615
|
+
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(X, { value: y, onChange: b, children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2616
|
+
/* @__PURE__ */ l(X.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
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" }),
|
|
2619
2619
|
/* @__PURE__ */ e("span", { className: "truncate", children: y.name })
|
|
@@ -2623,35 +2623,35 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2623
2623
|
/* @__PURE__ */ e(
|
|
2624
2624
|
oe,
|
|
2625
2625
|
{
|
|
2626
|
-
as:
|
|
2626
|
+
as: J,
|
|
2627
2627
|
leave: "transition ease-in duration-100",
|
|
2628
2628
|
leaveFrom: "opacity-100",
|
|
2629
2629
|
leaveTo: "opacity-0",
|
|
2630
|
-
children: /* @__PURE__ */ e(
|
|
2631
|
-
|
|
2630
|
+
children: /* @__PURE__ */ e(X.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: ga.map((S) => /* @__PURE__ */ e(
|
|
2631
|
+
X.Option,
|
|
2632
2632
|
{
|
|
2633
|
-
value:
|
|
2634
|
-
className: ({ active:
|
|
2635
|
-
children: ({ selected:
|
|
2633
|
+
value: S,
|
|
2634
|
+
className: ({ active: I }) => `${I ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2635
|
+
children: ({ selected: I }) => /* @__PURE__ */ l(ee, { children: [
|
|
2636
2636
|
/* @__PURE__ */ l(
|
|
2637
2637
|
"span",
|
|
2638
2638
|
{
|
|
2639
|
-
className: `${
|
|
2639
|
+
className: `${I ? "font-medium" : "font-normal"} flex items-center`,
|
|
2640
2640
|
children: [
|
|
2641
2641
|
/* @__PURE__ */ e(
|
|
2642
|
-
|
|
2642
|
+
S.icon,
|
|
2643
2643
|
{
|
|
2644
|
-
className: `h-5 w-5 mr-2 ${
|
|
2644
|
+
className: `h-5 w-5 mr-2 ${I ? "text-white" : "text-gray-400"}`
|
|
2645
2645
|
}
|
|
2646
2646
|
),
|
|
2647
|
-
|
|
2647
|
+
S.name
|
|
2648
2648
|
]
|
|
2649
2649
|
}
|
|
2650
2650
|
),
|
|
2651
|
-
|
|
2651
|
+
I && /* @__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
|
+
S.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: (
|
|
2663
|
+
onDebouncedChange: (S) => a(S),
|
|
2664
2664
|
value: N
|
|
2665
2665
|
}
|
|
2666
2666
|
) }),
|
|
2667
|
-
/* @__PURE__ */ e(be, { children: (m?.length > 0 ||
|
|
2667
|
+
/* @__PURE__ */ e(be, { children: (m?.length > 0 || M) && /* @__PURE__ */ e(
|
|
2668
2668
|
ne.div,
|
|
2669
2669
|
{
|
|
2670
2670
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2672,41 +2672,41 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2672
2672
|
exit: { opacity: 0, y: -10 },
|
|
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
|
-
children:
|
|
2676
|
-
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: m.map((
|
|
2677
|
-
const
|
|
2675
|
+
children: M ? /* @__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: m.map((S) => {
|
|
2677
|
+
const I = D(S);
|
|
2678
2678
|
return /* @__PURE__ */ l(
|
|
2679
2679
|
"div",
|
|
2680
2680
|
{
|
|
2681
|
-
onClick: () =>
|
|
2682
|
-
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${
|
|
2681
|
+
onClick: () => I ? null : x(S.id),
|
|
2682
|
+
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${I ? " 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(S.id),
|
|
2689
2689
|
readOnly: !0,
|
|
2690
2690
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
|
|
2691
|
-
disabled: !!
|
|
2691
|
+
disabled: !!I
|
|
2692
2692
|
}
|
|
2693
2693
|
),
|
|
2694
2694
|
/* @__PURE__ */ e(
|
|
2695
2695
|
"img",
|
|
2696
2696
|
{
|
|
2697
|
-
src:
|
|
2698
|
-
alt:
|
|
2697
|
+
src: S.avatarUrl || `https://avatar.vercel.sh/${S.name}.svg?text=${S.name.charAt(0)}`,
|
|
2698
|
+
alt: S.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:
|
|
2703
|
-
|
|
2704
|
-
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children:
|
|
2702
|
+
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: S.name }),
|
|
2703
|
+
I ? /* @__PURE__ */ l(ee, { children: [
|
|
2704
|
+
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children: I }),
|
|
2705
2705
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
|
|
2706
2706
|
] }) : ""
|
|
2707
2707
|
]
|
|
2708
2708
|
},
|
|
2709
|
-
|
|
2709
|
+
S.id
|
|
2710
2710
|
);
|
|
2711
2711
|
}) }),
|
|
2712
2712
|
/* @__PURE__ */ l("div", { className: "flex justify-end gap-2 p-2 border-t border-gray-300", children: [
|
|
@@ -2746,12 +2746,12 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2746
2746
|
")"
|
|
2747
2747
|
] }),
|
|
2748
2748
|
n === se.DRIVE && /* @__PURE__ */ e(
|
|
2749
|
-
|
|
2749
|
+
X,
|
|
2750
2750
|
{
|
|
2751
2751
|
value: T,
|
|
2752
|
-
onChange:
|
|
2752
|
+
onChange: z,
|
|
2753
2753
|
children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2754
|
-
/* @__PURE__ */ l(
|
|
2754
|
+
/* @__PURE__ */ l(X.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2755
2755
|
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
2756
2756
|
/* @__PURE__ */ e(T.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2757
2757
|
/* @__PURE__ */ l("span", { className: "truncate", children: [
|
|
@@ -2764,33 +2764,33 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2764
2764
|
/* @__PURE__ */ e(
|
|
2765
2765
|
oe,
|
|
2766
2766
|
{
|
|
2767
|
-
as:
|
|
2767
|
+
as: J,
|
|
2768
2768
|
leave: "transition ease-in duration-100",
|
|
2769
2769
|
leaveFrom: "opacity-100",
|
|
2770
2770
|
leaveTo: "opacity-0",
|
|
2771
|
-
children: /* @__PURE__ */ e(
|
|
2772
|
-
|
|
2771
|
+
children: /* @__PURE__ */ e(X.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: ya.map((S) => /* @__PURE__ */ e(
|
|
2772
|
+
X.Option,
|
|
2773
2773
|
{
|
|
2774
|
-
value:
|
|
2775
|
-
className: ({ active:
|
|
2776
|
-
children: ({ selected:
|
|
2774
|
+
value: S,
|
|
2775
|
+
className: ({ active: I }) => `${I ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2776
|
+
children: ({ selected: I, active: O }) => /* @__PURE__ */ l(ee, { children: [
|
|
2777
2777
|
/* @__PURE__ */ l(
|
|
2778
2778
|
"span",
|
|
2779
2779
|
{
|
|
2780
|
-
className: `${
|
|
2780
|
+
className: `${I ? "font-medium" : "font-normal"} flex items-center`,
|
|
2781
2781
|
children: [
|
|
2782
2782
|
/* @__PURE__ */ e(
|
|
2783
|
-
|
|
2783
|
+
S.icon,
|
|
2784
2784
|
{
|
|
2785
|
-
className: `h-5 w-5 mr-2 ${
|
|
2785
|
+
className: `h-5 w-5 mr-2 ${O ? "text-white" : "text-gray-400"}`
|
|
2786
2786
|
}
|
|
2787
2787
|
),
|
|
2788
2788
|
"Can ",
|
|
2789
|
-
|
|
2789
|
+
S.name
|
|
2790
2790
|
]
|
|
2791
2791
|
}
|
|
2792
2792
|
),
|
|
2793
|
-
|
|
2793
|
+
I && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(
|
|
2794
2794
|
ta,
|
|
2795
2795
|
{
|
|
2796
2796
|
className: "h-5 w-5",
|
|
@@ -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
|
+
S.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((S, I) => /* @__PURE__ */ l(
|
|
2811
2811
|
ne.div,
|
|
2812
2812
|
{
|
|
2813
2813
|
layout: !0,
|
|
@@ -2821,21 +2821,21 @@ 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: S.avatarUrl || `https://avatar.vercel.sh/${S.name}.svg?text=${S.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: S.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
|
+
S.permission
|
|
2834
2834
|
] }),
|
|
2835
2835
|
/* @__PURE__ */ e(
|
|
2836
2836
|
"button",
|
|
2837
2837
|
{
|
|
2838
|
-
onClick: () => w(
|
|
2838
|
+
onClick: () => w(I),
|
|
2839
2839
|
className: "text-gray-400 hover:text-red-500 hover:cursor-pointer",
|
|
2840
2840
|
children: /* @__PURE__ */ e(qe, { className: "h-5 w-5" })
|
|
2841
2841
|
}
|
|
@@ -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
|
+
S.id
|
|
2847
2847
|
)) }) })
|
|
2848
2848
|
]
|
|
2849
2849
|
}
|
|
@@ -2868,8 +2868,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2868
2868
|
/* @__PURE__ */ e(
|
|
2869
2869
|
"button",
|
|
2870
2870
|
{
|
|
2871
|
-
onClick:
|
|
2872
|
-
disabled: v || h.length === 0 &&
|
|
2871
|
+
onClick: () => U(q)(),
|
|
2872
|
+
disabled: v || h.length === 0 && !c,
|
|
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
2874
|
children: v ? "Inviting..." : n === se.DRIVE ? "Send Invites" : "Add"
|
|
2875
2875
|
}
|
|
@@ -2882,24 +2882,24 @@ 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), b = xr(c), { getReferenceProps: N, getFloatingProps: a } = kr([
|
|
2892
2892
|
y,
|
|
2893
2893
|
b
|
|
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.
|
|
2897
2897
|
// This provides the necessary context for both children.
|
|
2898
|
-
/* @__PURE__ */ l(
|
|
2898
|
+
/* @__PURE__ */ l(X, { value: k, onChange: (g) => {
|
|
2899
2899
|
s(g), n(!1);
|
|
2900
2900
|
}, children: [
|
|
2901
2901
|
/* @__PURE__ */ l(
|
|
2902
|
-
|
|
2902
|
+
X.Button,
|
|
2903
2903
|
{
|
|
2904
2904
|
ref: u.setReference,
|
|
2905
2905
|
...N(),
|
|
@@ -2913,7 +2913,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2913
2913
|
/* @__PURE__ */ e(wr, { children: /* @__PURE__ */ e(
|
|
2914
2914
|
oe,
|
|
2915
2915
|
{
|
|
2916
|
-
as:
|
|
2916
|
+
as: J,
|
|
2917
2917
|
show: o,
|
|
2918
2918
|
enter: "transition ease-out duration-100",
|
|
2919
2919
|
enterFrom: "transform opacity-0 scale-95",
|
|
@@ -2922,7 +2922,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2922
2922
|
leaveFrom: "transform opacity-100 scale-100",
|
|
2923
2923
|
leaveTo: "transform opacity-0 scale-95",
|
|
2924
2924
|
children: /* @__PURE__ */ e(
|
|
2925
|
-
|
|
2925
|
+
X.Options,
|
|
2926
2926
|
{
|
|
2927
2927
|
ref: u.setFloating,
|
|
2928
2928
|
style: i,
|
|
@@ -2930,7 +2930,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2930
2930
|
static: !0,
|
|
2931
2931
|
className: "z-50 w-48 bg-white shadow-lg rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",
|
|
2932
2932
|
children: Ke.filter((g) => r.includes(g.value)).map((g) => /* @__PURE__ */ e(
|
|
2933
|
-
|
|
2933
|
+
X.Option,
|
|
2934
2934
|
{
|
|
2935
2935
|
className: ({
|
|
2936
2936
|
active: $
|
|
@@ -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, b] = B(0), [N, a] = B(""), k = oa(N, 300), m = {
|
|
2974
2974
|
users: i.users.filter(
|
|
2975
2975
|
(C) => C.name.toLowerCase().includes(k.toLowerCase())
|
|
2976
2976
|
),
|
|
@@ -2980,21 +2980,24 @@ 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,
|
|
2984
|
-
const
|
|
2985
|
-
|
|
2986
|
-
...
|
|
2987
|
-
[
|
|
2988
|
-
(
|
|
2983
|
+
}, g = async (C, T, E, R) => {
|
|
2984
|
+
const U = T.value;
|
|
2985
|
+
c((V) => ({
|
|
2986
|
+
...V,
|
|
2987
|
+
[E]: V[E].map(
|
|
2988
|
+
(j) => j.id === C.id ? { ...j, permission: U } : j
|
|
2989
2989
|
)
|
|
2990
2990
|
}));
|
|
2991
2991
|
}, $ = () => {
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2992
|
+
c((C) => {
|
|
2993
|
+
const T = {
|
|
2994
|
+
users: C.users.filter((E) => E.permission !== "remove"),
|
|
2995
|
+
groups: C.groups.filter((E) => E.permission !== "remove"),
|
|
2996
|
+
roles: C.roles.filter((E) => E.permission !== "remove")
|
|
2997
|
+
};
|
|
2998
|
+
return r(T), T;
|
|
2999
|
+
});
|
|
3000
|
+
}, L = ["users", "groups", "roles"], M = ["Users", "Groups", "Roles"];
|
|
2998
3001
|
return (
|
|
2999
3002
|
// The main structure remains the same...
|
|
3000
3003
|
/* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-gray-50", children: [
|
|
@@ -3023,7 +3026,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3023
3026
|
/* @__PURE__ */ l("div", { className: "flex flex-col flex-grow", children: [
|
|
3024
3027
|
/* @__PURE__ */ l(re.Group, { selectedIndex: y, onChange: b, children: [
|
|
3025
3028
|
/* @__PURE__ */ l("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3026
|
-
/* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children:
|
|
3029
|
+
/* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: M.map((C) => /* @__PURE__ */ e(
|
|
3027
3030
|
re,
|
|
3028
3031
|
{
|
|
3029
3032
|
className: ({
|
|
@@ -3040,7 +3043,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3040
3043
|
{
|
|
3041
3044
|
onDebouncedChange: a,
|
|
3042
3045
|
value: N,
|
|
3043
|
-
placeholder: `Search in ${
|
|
3046
|
+
placeholder: `Search in ${M[y]}...`
|
|
3044
3047
|
}
|
|
3045
3048
|
) })
|
|
3046
3049
|
] }),
|
|
@@ -3051,7 +3054,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3051
3054
|
animate: { y: 0, opacity: 1 },
|
|
3052
3055
|
exit: { y: -10, opacity: 0 },
|
|
3053
3056
|
transition: { duration: 0.2 },
|
|
3054
|
-
children: /* @__PURE__ */ e(re.Panels, { as:
|
|
3057
|
+
children: /* @__PURE__ */ e(re.Panels, { as: J, children: L.map((C) => /* @__PURE__ */ e(
|
|
3055
3058
|
re.Panel,
|
|
3056
3059
|
{
|
|
3057
3060
|
className: "space-y-3 focus:outline-none",
|
|
@@ -3098,9 +3101,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3098
3101
|
{
|
|
3099
3102
|
item: T,
|
|
3100
3103
|
allowedPermissions: u,
|
|
3101
|
-
onPermissionChange: (
|
|
3104
|
+
onPermissionChange: (E) => g(
|
|
3102
3105
|
T,
|
|
3103
|
-
|
|
3106
|
+
E,
|
|
3104
3107
|
C
|
|
3105
3108
|
)
|
|
3106
3109
|
}
|
|
@@ -3120,10 +3123,10 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3120
3123
|
/* @__PURE__ */ e(Ca, { className: "h-12 w-12 text-gray-400" }),
|
|
3121
3124
|
/* @__PURE__ */ l("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
|
|
3122
3125
|
"No ",
|
|
3123
|
-
|
|
3126
|
+
M[y],
|
|
3124
3127
|
" Found"
|
|
3125
3128
|
] }),
|
|
3126
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${
|
|
3129
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${M[y].toLowerCase()} with access.` })
|
|
3127
3130
|
]
|
|
3128
3131
|
}
|
|
3129
3132
|
)
|
|
@@ -3159,7 +3162,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3159
3162
|
onClose: s,
|
|
3160
3163
|
members: o
|
|
3161
3164
|
}) => {
|
|
3162
|
-
const [n, u] = B(!0), [i,
|
|
3165
|
+
const [n, u] = B(!0), [i, c] = B(""), y = oa(i, 300), b = o.filter(
|
|
3163
3166
|
(m) => m.name.toLowerCase().includes(y.toLowerCase())
|
|
3164
3167
|
), N = {
|
|
3165
3168
|
hidden: { opacity: 0 },
|
|
@@ -3252,7 +3255,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3252
3255
|
/* @__PURE__ */ e("div", { className: "p-4 border-b border-gray-200 flex-shrink-0", children: /* @__PURE__ */ e(
|
|
3253
3256
|
he,
|
|
3254
3257
|
{
|
|
3255
|
-
onDebouncedChange:
|
|
3258
|
+
onDebouncedChange: c,
|
|
3256
3259
|
value: i,
|
|
3257
3260
|
placeholder: "Search members..."
|
|
3258
3261
|
}
|
|
@@ -3277,32 +3280,32 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3277
3280
|
onClose: u = () => {
|
|
3278
3281
|
},
|
|
3279
3282
|
showExistingShares: i = !0,
|
|
3280
|
-
allowedPermissions:
|
|
3283
|
+
allowedPermissions: c = [],
|
|
3281
3284
|
...y
|
|
3282
3285
|
}) => {
|
|
3283
|
-
const [b, N] = B(de.INVITE), [a, k] = B(t), [m, g] = B(null), [$, L] = B(!1), [
|
|
3286
|
+
const [b, N] = B(de.INVITE), [a, k] = B(t), [m, g] = B(null), [$, L] = B(!1), [M, C] = B([]), [T, E] = B(de.MANAGE), R = () => {
|
|
3284
3287
|
N(de.INVITE), g(null), u();
|
|
3285
|
-
},
|
|
3288
|
+
}, U = () => {
|
|
3286
3289
|
N(de.MANAGE);
|
|
3287
|
-
},
|
|
3290
|
+
}, V = async ({ id: p, name: f, type: w }) => {
|
|
3288
3291
|
if (w === "groups") {
|
|
3289
3292
|
try {
|
|
3290
|
-
const
|
|
3291
|
-
} catch (
|
|
3292
|
-
console.log("Error searching entities:",
|
|
3293
|
+
const d = await Ee(`${Oe.getMembersForGroup(f)}`);
|
|
3294
|
+
} catch (d) {
|
|
3295
|
+
console.log("Error searching entities:", d);
|
|
3293
3296
|
}
|
|
3294
3297
|
C(resp);
|
|
3295
3298
|
}
|
|
3296
|
-
g({ id: p, type: w, name: f }),
|
|
3297
|
-
},
|
|
3299
|
+
g({ id: p, type: w, name: f }), E(b), N(de.MEMBERS);
|
|
3300
|
+
}, j = (p) => {
|
|
3298
3301
|
k(p);
|
|
3299
3302
|
const f = !He.isEqual(
|
|
3300
|
-
He.mapValues(t, (w) => w.map((
|
|
3301
|
-
He.mapValues(p, (w) => w.map((
|
|
3303
|
+
He.mapValues(t, (w) => w.map((d) => ({ id: d.id, permission: d.permission }))),
|
|
3304
|
+
He.mapValues(p, (w) => w.map((d) => ({ id: d.id, permission: d.permission })))
|
|
3302
3305
|
);
|
|
3303
3306
|
L(f), N(b === de.MEMBERS ? T : de.INVITE);
|
|
3304
3307
|
};
|
|
3305
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as:
|
|
3308
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: R, children: [
|
|
3306
3309
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
3307
3310
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(Se, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
|
|
3308
3311
|
switch (b) {
|
|
@@ -3319,12 +3322,12 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3319
3322
|
vn,
|
|
3320
3323
|
{
|
|
3321
3324
|
entity: o,
|
|
3322
|
-
onBack:
|
|
3323
|
-
onClose:
|
|
3324
|
-
onOpenMembers:
|
|
3325
|
+
onBack: j,
|
|
3326
|
+
onClose: R,
|
|
3327
|
+
onOpenMembers: V,
|
|
3325
3328
|
existingShares: a,
|
|
3326
3329
|
calledBy: n,
|
|
3327
|
-
allowedPermissions:
|
|
3330
|
+
allowedPermissions: c
|
|
3328
3331
|
}
|
|
3329
3332
|
)
|
|
3330
3333
|
},
|
|
@@ -3343,11 +3346,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3343
3346
|
xn,
|
|
3344
3347
|
{
|
|
3345
3348
|
entity: m,
|
|
3346
|
-
onBack:
|
|
3347
|
-
onClose:
|
|
3349
|
+
onBack: j,
|
|
3350
|
+
onClose: R,
|
|
3348
3351
|
calledBy: n,
|
|
3349
3352
|
existingShares: a,
|
|
3350
|
-
members:
|
|
3353
|
+
members: M
|
|
3351
3354
|
}
|
|
3352
3355
|
)
|
|
3353
3356
|
},
|
|
@@ -3366,8 +3369,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3366
3369
|
fn,
|
|
3367
3370
|
{
|
|
3368
3371
|
entity: o,
|
|
3369
|
-
onManage:
|
|
3370
|
-
onClose:
|
|
3372
|
+
onManage: U,
|
|
3373
|
+
onClose: R,
|
|
3371
3374
|
existingShares: a,
|
|
3372
3375
|
calledBy: n,
|
|
3373
3376
|
showExistingShares: i,
|
|
@@ -3397,7 +3400,7 @@ function Ye({
|
|
|
3397
3400
|
},
|
|
3398
3401
|
placeholder: u = "Select options",
|
|
3399
3402
|
error: i = null,
|
|
3400
|
-
displayLimit:
|
|
3403
|
+
displayLimit: c = 3,
|
|
3401
3404
|
selectionLimit: y = -1,
|
|
3402
3405
|
// NEW: search behavior
|
|
3403
3406
|
searchMode: b = "client",
|
|
@@ -3410,22 +3413,22 @@ function Ye({
|
|
|
3410
3413
|
getOptionId: m = ($) => String($.id),
|
|
3411
3414
|
getOptionLabel: g = ($) => $.name
|
|
3412
3415
|
}) {
|
|
3413
|
-
const $ = ea(), L = ea(), [
|
|
3416
|
+
const $ = ea(), L = ea(), [M, C] = B(""), T = ue(""), E = ce(() => {
|
|
3414
3417
|
const p = /* @__PURE__ */ new Map();
|
|
3415
3418
|
for (const f of r) p.set(m(f), f);
|
|
3416
3419
|
return p;
|
|
3417
|
-
}, [r, m]),
|
|
3418
|
-
if (!
|
|
3419
|
-
const p =
|
|
3420
|
+
}, [r, m]), R = ce(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? E.get(m(p)) || null : E.get(String(p))).filter(Boolean) : [], [s, E, m]), U = ce(() => {
|
|
3421
|
+
if (!M) return r;
|
|
3422
|
+
const p = M.toLowerCase();
|
|
3420
3423
|
return r.filter((f) => g(f).toLowerCase().includes(p));
|
|
3421
|
-
}, [r,
|
|
3422
|
-
|
|
3423
|
-
b === "server" &&
|
|
3424
|
-
}, [
|
|
3425
|
-
const
|
|
3426
|
-
if (!
|
|
3424
|
+
}, [r, M, g]);
|
|
3425
|
+
Q(() => {
|
|
3426
|
+
b === "server" && M.length >= k && M !== T.current && (T.current = M, N && N(M));
|
|
3427
|
+
}, [M, b, k, N]);
|
|
3428
|
+
const V = b === "client" ? U : r, j = () => {
|
|
3429
|
+
if (!R.length)
|
|
3427
3430
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
|
|
3428
|
-
const p =
|
|
3431
|
+
const p = R.slice(0, c), f = R.length - c;
|
|
3429
3432
|
return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
|
|
3430
3433
|
p.map((w) => /* @__PURE__ */ e(
|
|
3431
3434
|
"span",
|
|
@@ -3442,12 +3445,12 @@ function Ye({
|
|
|
3442
3445
|
] })
|
|
3443
3446
|
] });
|
|
3444
3447
|
};
|
|
3445
|
-
return /* @__PURE__ */ e(
|
|
3448
|
+
return /* @__PURE__ */ e(X, { value: R, onChange: (p) => {
|
|
3446
3449
|
const f = Array.from(new Set(p.map((w) => m(w))));
|
|
3447
3450
|
y !== -1 && f.length > y || o(f);
|
|
3448
3451
|
}, multiple: !0, by: "id", children: ({ open: p }) => /* @__PURE__ */ l("div", { children: [
|
|
3449
3452
|
/* @__PURE__ */ e(
|
|
3450
|
-
|
|
3453
|
+
X.Label,
|
|
3451
3454
|
{
|
|
3452
3455
|
id: $,
|
|
3453
3456
|
className: "block text-sm font-medium leading-6 text-gray-900",
|
|
@@ -3456,7 +3459,7 @@ function Ye({
|
|
|
3456
3459
|
),
|
|
3457
3460
|
/* @__PURE__ */ l("div", { className: "relative mt-2", children: [
|
|
3458
3461
|
/* @__PURE__ */ l(
|
|
3459
|
-
|
|
3462
|
+
X.Button,
|
|
3460
3463
|
{
|
|
3461
3464
|
"aria-labelledby": $,
|
|
3462
3465
|
"aria-invalid": !!i,
|
|
@@ -3467,7 +3470,7 @@ function Ye({
|
|
|
3467
3470
|
i ? "ring-red-500" : "ring-gray-300"
|
|
3468
3471
|
),
|
|
3469
3472
|
children: [
|
|
3470
|
-
/* @__PURE__ */ e("span", { className: "block truncate", children:
|
|
3473
|
+
/* @__PURE__ */ e("span", { className: "block truncate", children: j() }),
|
|
3471
3474
|
/* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(ka, { className: "w-5 h-5 text-gray-400", "aria-hidden": "true" }) })
|
|
3472
3475
|
]
|
|
3473
3476
|
}
|
|
@@ -3475,25 +3478,25 @@ function Ye({
|
|
|
3475
3478
|
/* @__PURE__ */ e(
|
|
3476
3479
|
oe,
|
|
3477
3480
|
{
|
|
3478
|
-
as:
|
|
3481
|
+
as: J,
|
|
3479
3482
|
show: p,
|
|
3480
3483
|
leave: "transition ease-in duration-100",
|
|
3481
3484
|
leaveFrom: "opacity-100",
|
|
3482
3485
|
leaveTo: "opacity-0",
|
|
3483
|
-
children: /* @__PURE__ */ l(
|
|
3486
|
+
children: /* @__PURE__ */ l(X.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
|
|
3484
3487
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3485
3488
|
he,
|
|
3486
3489
|
{
|
|
3487
|
-
value:
|
|
3490
|
+
value: M,
|
|
3488
3491
|
onDebouncedChange: C,
|
|
3489
3492
|
placeholder: b === "server" ? `Search (min ${k})…` : "Search options…"
|
|
3490
3493
|
}
|
|
3491
3494
|
) }),
|
|
3492
3495
|
b === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3493
|
-
|
|
3494
|
-
const w = m(f),
|
|
3496
|
+
V.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? M.length < k ? `Type at least ${k} characters to search.` : "No results." : "No options found." }) : V.map((f) => {
|
|
3497
|
+
const w = m(f), d = g(f), h = R.some((F) => m(F) === w), x = y !== -1 && R.length >= y && !h;
|
|
3495
3498
|
return /* @__PURE__ */ e(
|
|
3496
|
-
|
|
3499
|
+
X.Option,
|
|
3497
3500
|
{
|
|
3498
3501
|
value: f,
|
|
3499
3502
|
disabled: x,
|
|
@@ -3501,7 +3504,7 @@ function Ye({
|
|
|
3501
3504
|
x ? " text-gray-400 bg-white cursor-not-allowed" : F ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3502
3505
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3503
3506
|
),
|
|
3504
|
-
children: ({ selected: F, active:
|
|
3507
|
+
children: ({ selected: F, active: z }) => /* @__PURE__ */ l(ee, { children: [
|
|
3505
3508
|
/* @__PURE__ */ e(
|
|
3506
3509
|
"span",
|
|
3507
3510
|
{
|
|
@@ -3509,14 +3512,14 @@ function Ye({
|
|
|
3509
3512
|
F ? "font-semibold" : "font-normal",
|
|
3510
3513
|
"block truncate"
|
|
3511
3514
|
),
|
|
3512
|
-
children:
|
|
3515
|
+
children: d
|
|
3513
3516
|
}
|
|
3514
3517
|
),
|
|
3515
3518
|
F && /* @__PURE__ */ e(
|
|
3516
3519
|
"span",
|
|
3517
3520
|
{
|
|
3518
3521
|
className: Pe(
|
|
3519
|
-
|
|
3522
|
+
z ? " text-gray-900" : " text-gray-600",
|
|
3520
3523
|
" absolute inset-y-0 right-0 flex items-center pr-4"
|
|
3521
3524
|
),
|
|
3522
3525
|
children: /* @__PURE__ */ e(Ge, { className: "w-5 h-5", "aria-hidden": "true" })
|
|
@@ -3535,28 +3538,28 @@ function Ye({
|
|
|
3535
3538
|
] }) });
|
|
3536
3539
|
}
|
|
3537
3540
|
Ye.propTypes = {
|
|
3538
|
-
label:
|
|
3539
|
-
options:
|
|
3540
|
-
|
|
3541
|
-
id:
|
|
3542
|
-
name:
|
|
3541
|
+
label: G.string.isRequired,
|
|
3542
|
+
options: G.arrayOf(
|
|
3543
|
+
G.shape({
|
|
3544
|
+
id: G.oneOfType([G.string, G.number]),
|
|
3545
|
+
name: G.string
|
|
3543
3546
|
})
|
|
3544
3547
|
),
|
|
3545
|
-
selected:
|
|
3546
|
-
onChange:
|
|
3547
|
-
onBlur:
|
|
3548
|
-
placeholder:
|
|
3549
|
-
error:
|
|
3550
|
-
displayLimit:
|
|
3551
|
-
selectionLimit:
|
|
3548
|
+
selected: G.array,
|
|
3549
|
+
onChange: G.func,
|
|
3550
|
+
onBlur: G.func,
|
|
3551
|
+
placeholder: G.string,
|
|
3552
|
+
error: G.string,
|
|
3553
|
+
displayLimit: G.number,
|
|
3554
|
+
selectionLimit: G.number,
|
|
3552
3555
|
// NEW
|
|
3553
|
-
searchMode:
|
|
3554
|
-
onSearch:
|
|
3556
|
+
searchMode: G.oneOf(["client", "server"]),
|
|
3557
|
+
onSearch: G.func,
|
|
3555
3558
|
// required when searchMode="server"
|
|
3556
|
-
serverLoading:
|
|
3557
|
-
minSearchChars:
|
|
3558
|
-
getOptionId:
|
|
3559
|
-
getOptionLabel:
|
|
3559
|
+
serverLoading: G.bool,
|
|
3560
|
+
minSearchChars: G.number,
|
|
3561
|
+
getOptionId: G.func,
|
|
3562
|
+
getOptionLabel: G.func
|
|
3560
3563
|
};
|
|
3561
3564
|
Ye.defaultProps = {
|
|
3562
3565
|
options: [],
|
|
@@ -3584,7 +3587,7 @@ const hs = ({
|
|
|
3584
3587
|
footer: n = { show: !0, customFooter: null },
|
|
3585
3588
|
primaryAction: u = { onSubmit: null, label: "Save", loader: !1, disabled: !1 },
|
|
3586
3589
|
secondaryAction: i = { onCancel: null, label: "Cancel" },
|
|
3587
|
-
dialogPanelClass:
|
|
3590
|
+
dialogPanelClass: c = ""
|
|
3588
3591
|
}) => {
|
|
3589
3592
|
const y = (N) => {
|
|
3590
3593
|
N.target === N.currentTarget && r(!1);
|
|
@@ -3608,7 +3611,7 @@ const hs = ({
|
|
|
3608
3611
|
/* @__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(
|
|
3609
3612
|
Se,
|
|
3610
3613
|
{
|
|
3611
|
-
className: `${
|
|
3614
|
+
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
3615
|
onClick: b,
|
|
3613
3616
|
children: [
|
|
3614
3617
|
/* @__PURE__ */ l("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
|
|
@@ -3626,7 +3629,7 @@ const hs = ({
|
|
|
3626
3629
|
),
|
|
3627
3630
|
n?.show && !n?.customFooter && /* @__PURE__ */ l("div", { className: "border-t flex justify-end border-gray-200 p-6 flex-shrink-0", children: [
|
|
3628
3631
|
i?.onCancel && /* @__PURE__ */ e(
|
|
3629
|
-
|
|
3632
|
+
Z,
|
|
3630
3633
|
{
|
|
3631
3634
|
"data-testid": "cancel-button",
|
|
3632
3635
|
label: i?.label,
|
|
@@ -3638,7 +3641,7 @@ const hs = ({
|
|
|
3638
3641
|
}
|
|
3639
3642
|
),
|
|
3640
3643
|
u?.onSubmit && /* @__PURE__ */ e(
|
|
3641
|
-
|
|
3644
|
+
Z,
|
|
3642
3645
|
{
|
|
3643
3646
|
label: u?.label,
|
|
3644
3647
|
loader: u?.loader,
|
|
@@ -3681,16 +3684,16 @@ function Cn({
|
|
|
3681
3684
|
onSelect: n,
|
|
3682
3685
|
onCreateChild: u,
|
|
3683
3686
|
onRename: i,
|
|
3684
|
-
onDelete:
|
|
3687
|
+
onDelete: c,
|
|
3685
3688
|
renderActions: y,
|
|
3686
3689
|
// optional override
|
|
3687
3690
|
dragId: b,
|
|
3688
3691
|
dropId: N,
|
|
3689
3692
|
indent: a = 24
|
|
3690
3693
|
}) {
|
|
3691
|
-
const { setNodeRef: k, isOver: m } = Ut({ id: N }), { attributes: g, listeners: $, setNodeRef: L, transform:
|
|
3692
|
-
const p =
|
|
3693
|
-
|
|
3694
|
+
const { setNodeRef: k, isOver: m } = Ut({ id: N }), { attributes: g, listeners: $, setNodeRef: L, transform: M, isDragging: C } = Vt({ id: b }), T = M ? { transform: `translate3d(${Math.round(M.x)}px, ${Math.round(M.y)}px, 0)` } : void 0, [E, R] = B(!1), [U, V] = B(t.name), j = () => {
|
|
3695
|
+
const p = U.trim();
|
|
3696
|
+
R(!1), p && p !== t.name ? i?.(t, p) : V(t.name);
|
|
3694
3697
|
}, v = ce(() => /* @__PURE__ */ e(
|
|
3695
3698
|
an,
|
|
3696
3699
|
{
|
|
@@ -3700,10 +3703,10 @@ function Cn({
|
|
|
3700
3703
|
{ action: "delete", label: "Delete" }
|
|
3701
3704
|
],
|
|
3702
3705
|
onSelect: (f) => {
|
|
3703
|
-
f.action === "create" ? u?.(t) : f.action === "rename" ?
|
|
3706
|
+
f.action === "create" ? u?.(t) : f.action === "rename" ? R(!0) : f.action === "delete" && c?.(t);
|
|
3704
3707
|
}
|
|
3705
3708
|
}
|
|
3706
|
-
), [t, u,
|
|
3709
|
+
), [t, u, c]);
|
|
3707
3710
|
return /* @__PURE__ */ l(
|
|
3708
3711
|
"div",
|
|
3709
3712
|
{
|
|
@@ -3716,24 +3719,24 @@ function Cn({
|
|
|
3716
3719
|
children: [
|
|
3717
3720
|
/* @__PURE__ */ e("button", { className: "tv-toggle", onClick: o, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(wa, { size: 16 }) : /* @__PURE__ */ e(je, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
|
|
3718
3721
|
/* @__PURE__ */ e(Fa, { size: 16, className: "tv-folder-ic" }),
|
|
3719
|
-
/* @__PURE__ */ e("div", { className: "tv-name", ref: L, children:
|
|
3722
|
+
/* @__PURE__ */ e("div", { className: "tv-name", ref: L, children: E ? /* @__PURE__ */ e(
|
|
3720
3723
|
"input",
|
|
3721
3724
|
{
|
|
3722
3725
|
className: "tv-input",
|
|
3723
|
-
value:
|
|
3724
|
-
onChange: (p) =>
|
|
3725
|
-
onBlur:
|
|
3726
|
+
value: U,
|
|
3727
|
+
onChange: (p) => V(p.target.value),
|
|
3728
|
+
onBlur: j,
|
|
3726
3729
|
onKeyDown: (p) => {
|
|
3727
|
-
p.key === "Enter" &&
|
|
3730
|
+
p.key === "Enter" && j(), p.key === "Escape" && (R(!1), V(t.name));
|
|
3728
3731
|
},
|
|
3729
3732
|
autoFocus: !0
|
|
3730
3733
|
}
|
|
3731
|
-
) : /* @__PURE__ */ e("span", { onDoubleClick: () =>
|
|
3734
|
+
) : /* @__PURE__ */ e("span", { onDoubleClick: () => R(!0), children: t.name }) }),
|
|
3732
3735
|
/* @__PURE__ */ e(wn, { listeners: $, attributes: g }),
|
|
3733
3736
|
/* @__PURE__ */ e("div", { className: "tv-actions", children: y ? y(t, {
|
|
3734
3737
|
onCreateChild: () => u?.(t),
|
|
3735
|
-
onRename: () =>
|
|
3736
|
-
onDelete: () =>
|
|
3738
|
+
onRename: () => R(!0),
|
|
3739
|
+
onDelete: () => c?.(t)
|
|
3737
3740
|
}) : v })
|
|
3738
3741
|
]
|
|
3739
3742
|
}
|
|
@@ -3742,35 +3745,35 @@ function Cn({
|
|
|
3742
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", $n = (t) => t.name ?? t.label ?? "", Fn = (t) => Array.isArray(t) && t.some((r) => Array.isArray(r.children));
|
|
3743
3746
|
function Tn(t, { rootId: r, getId: s, getParent: o, getName: n }) {
|
|
3744
3747
|
const u = /* @__PURE__ */ new Map();
|
|
3745
|
-
t.forEach((
|
|
3746
|
-
const y = s(
|
|
3748
|
+
t.forEach((c) => {
|
|
3749
|
+
const y = s(c);
|
|
3747
3750
|
u.set(y, {
|
|
3748
|
-
...
|
|
3751
|
+
...c,
|
|
3749
3752
|
id: y,
|
|
3750
|
-
name: n(
|
|
3751
|
-
parentId: o(
|
|
3753
|
+
name: n(c),
|
|
3754
|
+
parentId: o(c) || r,
|
|
3752
3755
|
children: []
|
|
3753
3756
|
});
|
|
3754
3757
|
});
|
|
3755
3758
|
const i = [];
|
|
3756
|
-
return u.forEach((
|
|
3757
|
-
const y =
|
|
3758
|
-
y !== r && u.has(y) ? u.get(y).children.push(
|
|
3759
|
+
return u.forEach((c) => {
|
|
3760
|
+
const y = c.parentId || r;
|
|
3761
|
+
y !== r && u.has(y) ? u.get(y).children.push(c) : i.push(c);
|
|
3759
3762
|
}), { roots: i, byId: u };
|
|
3760
3763
|
}
|
|
3761
3764
|
function An(t, { rootId: r, getId: s, getName: o }) {
|
|
3762
3765
|
const n = /* @__PURE__ */ new Map();
|
|
3763
|
-
function u(
|
|
3764
|
-
const b = s(
|
|
3765
|
-
...
|
|
3766
|
+
function u(c, y) {
|
|
3767
|
+
const b = s(c), N = {
|
|
3768
|
+
...c,
|
|
3766
3769
|
id: b,
|
|
3767
|
-
name: o(
|
|
3770
|
+
name: o(c),
|
|
3768
3771
|
parentId: y || r,
|
|
3769
|
-
children: (
|
|
3772
|
+
children: (c.children || []).map((a) => u(a, b))
|
|
3770
3773
|
};
|
|
3771
3774
|
return n.set(b, N), N;
|
|
3772
3775
|
}
|
|
3773
|
-
return { roots: t.map((
|
|
3776
|
+
return { roots: t.map((c) => u(c, null)), byId: n };
|
|
3774
3777
|
}
|
|
3775
3778
|
const Ae = (t) => t.map((r) => ({ ...r, children: Ae(r.children || []) }));
|
|
3776
3779
|
function En(t, r) {
|
|
@@ -3780,8 +3783,8 @@ function En(t, r) {
|
|
|
3780
3783
|
if (i.id === r)
|
|
3781
3784
|
return s = i, null;
|
|
3782
3785
|
if (i.children?.length) {
|
|
3783
|
-
const
|
|
3784
|
-
if (
|
|
3786
|
+
const c = o(i.children);
|
|
3787
|
+
if (c !== i.children) return { ...i, children: c };
|
|
3785
3788
|
}
|
|
3786
3789
|
return i;
|
|
3787
3790
|
}).filter(Boolean);
|
|
@@ -3820,7 +3823,7 @@ function ps({
|
|
|
3820
3823
|
getParent: n = Dn,
|
|
3821
3824
|
getName: u = $n,
|
|
3822
3825
|
onSelect: i,
|
|
3823
|
-
onCreateRoot:
|
|
3826
|
+
onCreateRoot: c,
|
|
3824
3827
|
onCreateChild: y,
|
|
3825
3828
|
onRename: b,
|
|
3826
3829
|
onDelete: N,
|
|
@@ -3833,39 +3836,39 @@ function ps({
|
|
|
3833
3836
|
const { roots: $ } = ce(() => Fn(t) ? An(t, { rootId: r, getId: o, getName: u }) : Tn(
|
|
3834
3837
|
t.map((x) => ({ ...x })),
|
|
3835
3838
|
{ rootId: r, getId: o, getParent: n, getName: u }
|
|
3836
|
-
), [t, r, o, n, u]), [L,
|
|
3839
|
+
), [t, r, o, n, u]), [L, M] = B({}), C = K((x) => {
|
|
3837
3840
|
const F = {};
|
|
3838
|
-
return (function
|
|
3839
|
-
|
|
3840
|
-
F[
|
|
3841
|
+
return (function z(q) {
|
|
3842
|
+
q.forEach((D) => {
|
|
3843
|
+
F[D.id] = !0, D.children?.length && z(D.children);
|
|
3841
3844
|
});
|
|
3842
3845
|
})(x), F;
|
|
3843
3846
|
}, []);
|
|
3844
3847
|
ae.useEffect(() => {
|
|
3845
|
-
|
|
3848
|
+
M(C($));
|
|
3846
3849
|
}, [$, C]);
|
|
3847
3850
|
const T = K(
|
|
3848
|
-
(x) =>
|
|
3851
|
+
(x) => M((F) => ({ ...F, [x]: !F[x] })),
|
|
3849
3852
|
[]
|
|
3850
|
-
), [
|
|
3851
|
-
ae.useEffect(() =>
|
|
3852
|
-
const
|
|
3853
|
+
), [E, R] = B(() => Ae($));
|
|
3854
|
+
ae.useEffect(() => R(Ae($)), [$]);
|
|
3855
|
+
const U = qt(
|
|
3853
3856
|
jt(Yt, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
3854
|
-
),
|
|
3857
|
+
), V = ue(null), [j, v] = B(null), p = ue(0), f = () => {
|
|
3855
3858
|
}, w = ({ delta: x }) => {
|
|
3856
3859
|
p.current = x?.x ?? 0;
|
|
3857
|
-
},
|
|
3860
|
+
}, d = K(
|
|
3858
3861
|
({ active: x, over: F }) => {
|
|
3859
|
-
const
|
|
3862
|
+
const z = p.current;
|
|
3860
3863
|
if (p.current = 0, v(null), !x || !F) return;
|
|
3861
|
-
const
|
|
3862
|
-
if (!
|
|
3863
|
-
let A =
|
|
3864
|
-
const
|
|
3865
|
-
if (
|
|
3866
|
-
let ie =
|
|
3867
|
-
for (let xe = 0; xe <
|
|
3868
|
-
const P = Ka(
|
|
3864
|
+
const q = String(x.id).replace(/^drag-/, ""), D = String(F.id).replace(/^drop-/, "");
|
|
3865
|
+
if (!q || !D || q === D) return;
|
|
3866
|
+
let A = D;
|
|
3867
|
+
const S = Math.max(0, Math.floor(-z / g));
|
|
3868
|
+
if (S > 0) {
|
|
3869
|
+
let ie = D;
|
|
3870
|
+
for (let xe = 0; xe < S; xe++) {
|
|
3871
|
+
const P = Ka(E, ie, null);
|
|
3869
3872
|
if (!P) break;
|
|
3870
3873
|
if (!P.parentId) {
|
|
3871
3874
|
A = r;
|
|
@@ -3875,70 +3878,70 @@ function ps({
|
|
|
3875
3878
|
}
|
|
3876
3879
|
}
|
|
3877
3880
|
if (m && A === r) {
|
|
3878
|
-
|
|
3881
|
+
R(Ae($));
|
|
3879
3882
|
return;
|
|
3880
3883
|
}
|
|
3881
|
-
const
|
|
3882
|
-
if (!
|
|
3883
|
-
const Ne = Rn(
|
|
3884
|
-
|
|
3884
|
+
const I = Ae(E), { newRoots: O, removed: H } = En(I, q);
|
|
3885
|
+
if (!H) return;
|
|
3886
|
+
const Ne = Rn(O, A, H);
|
|
3887
|
+
R(Ne), a?.({ sourceId: q, destParentId: A, newTree: Ne });
|
|
3885
3888
|
},
|
|
3886
|
-
[
|
|
3889
|
+
[E, $, r, m, g, a]
|
|
3887
3890
|
), h = K(
|
|
3888
|
-
(x, F = 0) => x.map((
|
|
3891
|
+
(x, F = 0) => x.map((z) => /* @__PURE__ */ l(ae.Fragment, { children: [
|
|
3889
3892
|
/* @__PURE__ */ e(
|
|
3890
3893
|
Cn,
|
|
3891
3894
|
{
|
|
3892
|
-
node:
|
|
3895
|
+
node: z,
|
|
3893
3896
|
depth: F,
|
|
3894
|
-
expanded: !!L[
|
|
3895
|
-
onToggle: () => T(
|
|
3897
|
+
expanded: !!L[z.id],
|
|
3898
|
+
onToggle: () => T(z.id),
|
|
3896
3899
|
onSelect: i,
|
|
3897
3900
|
onCreateChild: y,
|
|
3898
3901
|
onRename: b,
|
|
3899
3902
|
onDelete: N,
|
|
3900
3903
|
renderActions: k,
|
|
3901
|
-
dragId: `drag-${
|
|
3902
|
-
dropId: `drop-${
|
|
3904
|
+
dragId: `drag-${z.id}`,
|
|
3905
|
+
dropId: `drop-${z.id}`,
|
|
3903
3906
|
indent: g
|
|
3904
3907
|
}
|
|
3905
3908
|
),
|
|
3906
|
-
L[
|
|
3907
|
-
] },
|
|
3909
|
+
L[z.id] && z.children?.length > 0 ? h(z.children, F + 1) : null
|
|
3910
|
+
] }, z.id)),
|
|
3908
3911
|
[L, g, y, N, b, i, k, T]
|
|
3909
3912
|
);
|
|
3910
3913
|
return ae.useMemo(() => {
|
|
3911
|
-
if (!
|
|
3912
|
-
const x = String(
|
|
3913
|
-
function F(
|
|
3914
|
-
for (const
|
|
3915
|
-
if (
|
|
3916
|
-
const
|
|
3917
|
-
if (
|
|
3914
|
+
if (!j) return null;
|
|
3915
|
+
const x = String(j).replace(/^drag-/, "");
|
|
3916
|
+
function F(z) {
|
|
3917
|
+
for (const q of z) {
|
|
3918
|
+
if (q.id === x) return q;
|
|
3919
|
+
const D = q.children?.length ? F(q.children) : null;
|
|
3920
|
+
if (D) return D;
|
|
3918
3921
|
}
|
|
3919
3922
|
return null;
|
|
3920
3923
|
}
|
|
3921
|
-
return F(
|
|
3922
|
-
}, [
|
|
3924
|
+
return F(E);
|
|
3925
|
+
}, [j, E]), /* @__PURE__ */ l("div", { className: "tv", children: [
|
|
3923
3926
|
s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
|
|
3924
3927
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
3925
|
-
/* @__PURE__ */ e("button", { className: "tv-btn", onClick:
|
|
3928
|
+
/* @__PURE__ */ e("button", { className: "tv-btn", onClick: c, children: "+ New folder" })
|
|
3926
3929
|
] }),
|
|
3927
3930
|
/* @__PURE__ */ l("div", { className: "tv-root-row", children: [
|
|
3928
3931
|
/* @__PURE__ */ e(Fa, { size: 16, className: "tv-folder-ic" }),
|
|
3929
3932
|
/* @__PURE__ */ e("strong", { children: "ROOT" }),
|
|
3930
|
-
/* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick:
|
|
3933
|
+
/* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: c, children: "+" })
|
|
3931
3934
|
] }),
|
|
3932
3935
|
/* @__PURE__ */ e(
|
|
3933
3936
|
Gt,
|
|
3934
3937
|
{
|
|
3935
3938
|
collisionDetection: Wt,
|
|
3936
|
-
sensors:
|
|
3939
|
+
sensors: U,
|
|
3937
3940
|
onDragStart: f,
|
|
3938
3941
|
onDragMove: w,
|
|
3939
|
-
onDragEnd:
|
|
3942
|
+
onDragEnd: d,
|
|
3940
3943
|
modifiers: [_t],
|
|
3941
|
-
children: /* @__PURE__ */ e("div", { ref:
|
|
3944
|
+
children: /* @__PURE__ */ e("div", { ref: V, className: "tv-list", children: h(E, 0) })
|
|
3942
3945
|
}
|
|
3943
3946
|
)
|
|
3944
3947
|
] });
|
|
@@ -3954,7 +3957,7 @@ const gs = ({
|
|
|
3954
3957
|
listClassName: n = "",
|
|
3955
3958
|
panelClassName: u = "",
|
|
3956
3959
|
tabClassName: i,
|
|
3957
|
-
...
|
|
3960
|
+
...c
|
|
3958
3961
|
// Pass remaining props to Tab.Group
|
|
3959
3962
|
}) => {
|
|
3960
3963
|
const y = s === "vertical", b = (k) => fe(
|
|
@@ -3964,7 +3967,7 @@ const gs = ({
|
|
|
3964
3967
|
"py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
|
|
3965
3968
|
k ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
|
|
3966
3969
|
), a = ({ selected: k }) => i ? typeof i == "function" ? i(k) : i : y ? b(k) : N(k);
|
|
3967
|
-
return /* @__PURE__ */ e(re.Group, { vertical: y, ...
|
|
3970
|
+
return /* @__PURE__ */ e(re.Group, { vertical: y, ...c, children: y ? /* @__PURE__ */ l("div", { className: fe("flex gap-4", o), children: [
|
|
3968
3971
|
/* @__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)) }),
|
|
3969
3972
|
/* @__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)) })
|
|
3970
3973
|
] }) : /* @__PURE__ */ l(ee, { children: [
|
|
@@ -3974,19 +3977,19 @@ const gs = ({
|
|
|
3974
3977
|
};
|
|
3975
3978
|
function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
3976
3979
|
console.log(t);
|
|
3977
|
-
const [n, u] = ae.useState(t), [i,
|
|
3980
|
+
const [n, u] = ae.useState(t), [i, c] = ae.useState(() => {
|
|
3978
3981
|
const a = r && r[t.key] || {};
|
|
3979
3982
|
return console.log("Initial Section data for", t.key, a), a;
|
|
3980
3983
|
}), y = ue(r);
|
|
3981
|
-
|
|
3984
|
+
Q(() => {
|
|
3982
3985
|
if (y.current !== r) {
|
|
3983
3986
|
y.current = r;
|
|
3984
3987
|
const a = r && r[t.key] || {};
|
|
3985
|
-
console.log("Updated Section data for", t.key, a),
|
|
3988
|
+
console.log("Updated Section data for", t.key, a), c(a);
|
|
3986
3989
|
}
|
|
3987
3990
|
}, [r, t.key]), console.log("Section data", i);
|
|
3988
3991
|
const b = ue(i);
|
|
3989
|
-
|
|
3992
|
+
Q(() => {
|
|
3990
3993
|
b.current !== i && s && typeof s == "function" && (b.current = i, s(n.key, i));
|
|
3991
3994
|
}, [n.key, i, s]);
|
|
3992
3995
|
const N = (a) => {
|
|
@@ -4044,7 +4047,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4044
4047
|
),
|
|
4045
4048
|
a.fieldtype === "text" && /* @__PURE__ */ l("div", { children: [
|
|
4046
4049
|
/* @__PURE__ */ e(
|
|
4047
|
-
|
|
4050
|
+
W,
|
|
4048
4051
|
{
|
|
4049
4052
|
type: "text",
|
|
4050
4053
|
name: a.key,
|
|
@@ -4053,7 +4056,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4053
4056
|
value: i[a.key] || "",
|
|
4054
4057
|
onChange: (m) => {
|
|
4055
4058
|
const g = { ...i, [a.key]: m.target.value };
|
|
4056
|
-
|
|
4059
|
+
c(g), s && s(n.key, g);
|
|
4057
4060
|
},
|
|
4058
4061
|
required: a.required,
|
|
4059
4062
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4072,7 +4075,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4072
4075
|
value: i[a.key] || "",
|
|
4073
4076
|
onChange: (m) => {
|
|
4074
4077
|
const g = { ...i, [a.key]: m.target.value };
|
|
4075
|
-
|
|
4078
|
+
c(g), s && s(n.key, g);
|
|
4076
4079
|
},
|
|
4077
4080
|
rows: 3,
|
|
4078
4081
|
required: a.required,
|
|
@@ -4084,7 +4087,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4084
4087
|
] }),
|
|
4085
4088
|
a.fieldtype === "number" && /* @__PURE__ */ l("div", { children: [
|
|
4086
4089
|
/* @__PURE__ */ e(
|
|
4087
|
-
|
|
4090
|
+
W,
|
|
4088
4091
|
{
|
|
4089
4092
|
type: "number",
|
|
4090
4093
|
name: a.key,
|
|
@@ -4093,7 +4096,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4093
4096
|
value: i[a.key] || "",
|
|
4094
4097
|
onChange: (m) => {
|
|
4095
4098
|
const g = { ...i, [a.key]: m.target.value };
|
|
4096
|
-
|
|
4099
|
+
c(g), s && s(n.key, g);
|
|
4097
4100
|
},
|
|
4098
4101
|
required: a.required,
|
|
4099
4102
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4110,7 +4113,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4110
4113
|
checked: !!(i[a.key] || a.default),
|
|
4111
4114
|
onChange: (m) => {
|
|
4112
4115
|
const g = { ...i, [a.key]: m };
|
|
4113
|
-
|
|
4116
|
+
c(g), s && s(n.key, g);
|
|
4114
4117
|
},
|
|
4115
4118
|
label: a.placeholder || a.label,
|
|
4116
4119
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4128,7 +4131,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4128
4131
|
value: i[a.key] || "",
|
|
4129
4132
|
onChange: (m) => {
|
|
4130
4133
|
const g = { ...i, [a.key]: m };
|
|
4131
|
-
|
|
4134
|
+
c(g);
|
|
4132
4135
|
},
|
|
4133
4136
|
options: a.options || [],
|
|
4134
4137
|
placeholder: a.placeholder || `Select ${a.label}`,
|
|
@@ -4141,7 +4144,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4141
4144
|
] }),
|
|
4142
4145
|
a.fieldtype === "email" && /* @__PURE__ */ l("div", { children: [
|
|
4143
4146
|
/* @__PURE__ */ e(
|
|
4144
|
-
|
|
4147
|
+
W,
|
|
4145
4148
|
{
|
|
4146
4149
|
type: "email",
|
|
4147
4150
|
name: a.key,
|
|
@@ -4150,7 +4153,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4150
4153
|
value: i[a.key] || "",
|
|
4151
4154
|
onChange: (m) => {
|
|
4152
4155
|
const g = { ...i, [a.key]: m.target.value };
|
|
4153
|
-
|
|
4156
|
+
c(g), s && s(n.key, g);
|
|
4154
4157
|
},
|
|
4155
4158
|
required: a.required,
|
|
4156
4159
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4161,7 +4164,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4161
4164
|
] }),
|
|
4162
4165
|
a.fieldtype === "url" && /* @__PURE__ */ l("div", { children: [
|
|
4163
4166
|
/* @__PURE__ */ e(
|
|
4164
|
-
|
|
4167
|
+
W,
|
|
4165
4168
|
{
|
|
4166
4169
|
type: "url",
|
|
4167
4170
|
name: a.key,
|
|
@@ -4170,7 +4173,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4170
4173
|
value: i[a.key] || "",
|
|
4171
4174
|
onChange: (m) => {
|
|
4172
4175
|
const g = { ...i, [a.key]: m.target.value };
|
|
4173
|
-
|
|
4176
|
+
c(g), s && s(n.key, g);
|
|
4174
4177
|
},
|
|
4175
4178
|
required: a.required,
|
|
4176
4179
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4181,7 +4184,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4181
4184
|
] }),
|
|
4182
4185
|
a.fieldtype === "password" && /* @__PURE__ */ l("div", { children: [
|
|
4183
4186
|
/* @__PURE__ */ e(
|
|
4184
|
-
|
|
4187
|
+
W,
|
|
4185
4188
|
{
|
|
4186
4189
|
type: "password",
|
|
4187
4190
|
name: a.key,
|
|
@@ -4190,7 +4193,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4190
4193
|
value: i[a.key] || "",
|
|
4191
4194
|
onChange: (m) => {
|
|
4192
4195
|
const g = { ...i, [a.key]: m.target.value };
|
|
4193
|
-
|
|
4196
|
+
c(g), s && s(n.key, g);
|
|
4194
4197
|
},
|
|
4195
4198
|
required: a.required,
|
|
4196
4199
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4206,7 +4209,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4206
4209
|
selectedItems: i[a.key] || [],
|
|
4207
4210
|
onSelectionChange: (m) => {
|
|
4208
4211
|
const g = { ...i, [a.key]: m };
|
|
4209
|
-
|
|
4212
|
+
c(g), s && s(n.key, g);
|
|
4210
4213
|
},
|
|
4211
4214
|
options: a.options || [],
|
|
4212
4215
|
placeholder: a.placeholder || `Select ${a.label}`,
|
|
@@ -4224,7 +4227,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4224
4227
|
onChange: (m) => {
|
|
4225
4228
|
console.log("Toggle changed:", a.key, m);
|
|
4226
4229
|
const g = { ...i, [a.key]: m };
|
|
4227
|
-
|
|
4230
|
+
c(g), s && s(n.key, g);
|
|
4228
4231
|
},
|
|
4229
4232
|
label: a.placeholder || a.label,
|
|
4230
4233
|
disabled: a.disabled ? a.disabled : !1
|
|
@@ -4239,7 +4242,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4239
4242
|
value: i[a.key] ? new Date(i[a.key]) : null,
|
|
4240
4243
|
onChange: (m) => {
|
|
4241
4244
|
const g = { ...i, [a.key]: m ? m.toISOString().split("T")[0] : "" };
|
|
4242
|
-
|
|
4245
|
+
c(g), s && s(n.key, g);
|
|
4243
4246
|
},
|
|
4244
4247
|
placeholder: a.placeholder || "Select date",
|
|
4245
4248
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4254,7 +4257,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4254
4257
|
value: i[a.key] || { from: null, to: null },
|
|
4255
4258
|
onChange: (m) => {
|
|
4256
4259
|
const g = { ...i, [a.key]: m };
|
|
4257
|
-
|
|
4260
|
+
c(g), s && s(n.key, g);
|
|
4258
4261
|
},
|
|
4259
4262
|
placeholder: a.placeholder || "Select date range",
|
|
4260
4263
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4269,7 +4272,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4269
4272
|
selectedValue: typeof i[a.key] < "u" ? i[a.key] : a.default || "",
|
|
4270
4273
|
onValueChange: (m) => {
|
|
4271
4274
|
const g = { ...i, [a.key]: m };
|
|
4272
|
-
|
|
4275
|
+
c(g), s && s(n.key, g);
|
|
4273
4276
|
},
|
|
4274
4277
|
options: a.options || [],
|
|
4275
4278
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4290,7 +4293,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4290
4293
|
checked: i[a.key] === m.value,
|
|
4291
4294
|
onChange: (g) => {
|
|
4292
4295
|
const $ = { ...i, [a.key]: g.target.value };
|
|
4293
|
-
|
|
4296
|
+
c($), s && s(n.key, $);
|
|
4294
4297
|
},
|
|
4295
4298
|
disabled: a.disabled
|
|
4296
4299
|
}
|
|
@@ -4309,7 +4312,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4309
4312
|
value: i[a.key] || "",
|
|
4310
4313
|
onChange: (m) => {
|
|
4311
4314
|
const g = { ...i, [a.key]: m };
|
|
4312
|
-
|
|
4315
|
+
c(g), s && s(n.key, g);
|
|
4313
4316
|
},
|
|
4314
4317
|
placeholder: a.placeholder || `Search ${a.label}`,
|
|
4315
4318
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4319,7 +4322,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4319
4322
|
] }),
|
|
4320
4323
|
(a.fieldtype === "datetime" || a.fieldtype === "datetime-local") && /* @__PURE__ */ l("div", { children: [
|
|
4321
4324
|
/* @__PURE__ */ e(
|
|
4322
|
-
|
|
4325
|
+
W,
|
|
4323
4326
|
{
|
|
4324
4327
|
type: "datetime-local",
|
|
4325
4328
|
name: a.key,
|
|
@@ -4328,7 +4331,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4328
4331
|
value: i[a.key] || "",
|
|
4329
4332
|
onChange: (m) => {
|
|
4330
4333
|
const g = { ...i, [a.key]: m.target.value };
|
|
4331
|
-
|
|
4334
|
+
c(g), s && s(n.key, g);
|
|
4332
4335
|
},
|
|
4333
4336
|
required: a.required,
|
|
4334
4337
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4338,7 +4341,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4338
4341
|
] }),
|
|
4339
4342
|
a.fieldtype === "time" && /* @__PURE__ */ l("div", { children: [
|
|
4340
4343
|
/* @__PURE__ */ e(
|
|
4341
|
-
|
|
4344
|
+
W,
|
|
4342
4345
|
{
|
|
4343
4346
|
type: "time",
|
|
4344
4347
|
name: a.key,
|
|
@@ -4347,7 +4350,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4347
4350
|
value: i[a.key] || "",
|
|
4348
4351
|
onChange: (m) => {
|
|
4349
4352
|
const g = { ...i, [a.key]: m.target.value };
|
|
4350
|
-
|
|
4353
|
+
c(g), s && s(n.key, g);
|
|
4351
4354
|
},
|
|
4352
4355
|
required: a.required,
|
|
4353
4356
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4357,7 +4360,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4357
4360
|
] }),
|
|
4358
4361
|
a.fieldtype === "color" && /* @__PURE__ */ l("div", { children: [
|
|
4359
4362
|
/* @__PURE__ */ e(
|
|
4360
|
-
|
|
4363
|
+
W,
|
|
4361
4364
|
{
|
|
4362
4365
|
type: "color",
|
|
4363
4366
|
name: a.key,
|
|
@@ -4365,7 +4368,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4365
4368
|
value: i[a.key] || "#000000",
|
|
4366
4369
|
onChange: (m) => {
|
|
4367
4370
|
const g = { ...i, [a.key]: m.target.value };
|
|
4368
|
-
|
|
4371
|
+
c(g), s && s(n.key, g);
|
|
4369
4372
|
},
|
|
4370
4373
|
className: `w-full h-10 ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
4371
4374
|
}
|
|
@@ -4374,7 +4377,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4374
4377
|
] }),
|
|
4375
4378
|
a.fieldtype === "range" && /* @__PURE__ */ l("div", { children: [
|
|
4376
4379
|
/* @__PURE__ */ e(
|
|
4377
|
-
|
|
4380
|
+
W,
|
|
4378
4381
|
{
|
|
4379
4382
|
type: "range",
|
|
4380
4383
|
name: a.key,
|
|
@@ -4382,7 +4385,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4382
4385
|
value: i[a.key] || a.min || 0,
|
|
4383
4386
|
onChange: (m) => {
|
|
4384
4387
|
const g = { ...i, [a.key]: m.target.value };
|
|
4385
|
-
|
|
4388
|
+
c(g), s && s(n.key, g);
|
|
4386
4389
|
},
|
|
4387
4390
|
min: a.min || 0,
|
|
4388
4391
|
max: a.max || 100,
|
|
@@ -4402,13 +4405,13 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4402
4405
|
] }),
|
|
4403
4406
|
a.fieldtype === "file" && /* @__PURE__ */ l("div", { children: [
|
|
4404
4407
|
/* @__PURE__ */ e(
|
|
4405
|
-
|
|
4408
|
+
W,
|
|
4406
4409
|
{
|
|
4407
4410
|
type: "file",
|
|
4408
4411
|
name: a.key,
|
|
4409
4412
|
onChange: (m) => {
|
|
4410
4413
|
const g = m.target.files[0], $ = { ...i, [a.key]: g ? g.name : "" };
|
|
4411
|
-
|
|
4414
|
+
c($), s && s(n.key, $);
|
|
4412
4415
|
},
|
|
4413
4416
|
accept: a.accept,
|
|
4414
4417
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4425,7 +4428,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4425
4428
|
className: a.className || "",
|
|
4426
4429
|
onCollectionChange: (m) => {
|
|
4427
4430
|
const g = { ...i, [a.key]: m };
|
|
4428
|
-
|
|
4431
|
+
c(g), s && s(n.key, g);
|
|
4429
4432
|
},
|
|
4430
4433
|
showSearch: a.showSearch !== !1,
|
|
4431
4434
|
allowAdd: a.allowAdd !== !1,
|
|
@@ -4453,13 +4456,13 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4453
4456
|
const zn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
4454
4457
|
function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
4455
4458
|
console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
|
|
4456
|
-
const [n, u] = B(t), [i,
|
|
4459
|
+
const [n, u] = B(t), [i, c] = B(null), [y, b] = B(null);
|
|
4457
4460
|
console.log(`[DataTableRenderer] ${n.key} - Received props:`, { item: t, initialData: r });
|
|
4458
4461
|
const [N, a] = B(() => {
|
|
4459
4462
|
const v = r && r[n.key] || [], p = v.length > 0 ? v : [{ id: 0 }];
|
|
4460
4463
|
return console.log(`[DataTableRenderer] ${n.key} - Initial data:`, p), p;
|
|
4461
4464
|
}), k = ue(r);
|
|
4462
|
-
|
|
4465
|
+
Q(() => {
|
|
4463
4466
|
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) {
|
|
4464
4467
|
k.current = r;
|
|
4465
4468
|
const v = r && r[n.key] || [], p = v.length > 0 ? v : [{ id: 0 }];
|
|
@@ -4467,30 +4470,30 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4467
4470
|
}
|
|
4468
4471
|
}, [r, n.key]);
|
|
4469
4472
|
const m = ue(N), g = ue(null);
|
|
4470
|
-
|
|
4473
|
+
Q(() => {
|
|
4471
4474
|
m.current !== N && s && typeof s == "function" && (m.current = N, g.current && clearTimeout(g.current), g.current = setTimeout(() => {
|
|
4472
4475
|
s(n.key, N);
|
|
4473
4476
|
}, 300));
|
|
4474
|
-
}, [n.key, N, s]),
|
|
4477
|
+
}, [n.key, N, s]), Q(() => () => {
|
|
4475
4478
|
g.current && clearTimeout(g.current);
|
|
4476
4479
|
}, []);
|
|
4477
4480
|
const $ = (v) => {
|
|
4478
|
-
const p = (
|
|
4479
|
-
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex:
|
|
4481
|
+
const p = (d, h) => {
|
|
4482
|
+
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: d, value: h, type: typeof h }), a((x) => {
|
|
4480
4483
|
const F = [...x];
|
|
4481
|
-
return F[
|
|
4484
|
+
return F[d][v.key] = h, F;
|
|
4482
4485
|
});
|
|
4483
|
-
}, f = (
|
|
4484
|
-
const h = f(
|
|
4486
|
+
}, f = (d) => o[n.key]?.[d]?.[v.key], w = (d) => {
|
|
4487
|
+
const h = f(d);
|
|
4485
4488
|
return h ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: h }) : null;
|
|
4486
4489
|
};
|
|
4487
4490
|
switch (v.fieldtype) {
|
|
4488
4491
|
case "text":
|
|
4489
|
-
return (
|
|
4492
|
+
return (d, h) => /* @__PURE__ */ l("div", { children: [
|
|
4490
4493
|
/* @__PURE__ */ e(
|
|
4491
|
-
|
|
4494
|
+
W,
|
|
4492
4495
|
{
|
|
4493
|
-
value:
|
|
4496
|
+
value: d[v.key] || "",
|
|
4494
4497
|
onChange: (x) => p(h, x.target.value),
|
|
4495
4498
|
placeholder: v.placeholder || `Enter ${v.label}`,
|
|
4496
4499
|
required: v.required,
|
|
@@ -4500,11 +4503,11 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4500
4503
|
w(h)
|
|
4501
4504
|
] });
|
|
4502
4505
|
case "textarea":
|
|
4503
|
-
return (
|
|
4506
|
+
return (d, h) => /* @__PURE__ */ l("div", { children: [
|
|
4504
4507
|
/* @__PURE__ */ e(
|
|
4505
4508
|
ja,
|
|
4506
4509
|
{
|
|
4507
|
-
value:
|
|
4510
|
+
value: d[v.key] || "",
|
|
4508
4511
|
onChange: (x) => p(h, x.target.value),
|
|
4509
4512
|
placeholder: v.placeholder || `Enter ${v.label}`,
|
|
4510
4513
|
required: v.required,
|
|
@@ -4515,12 +4518,12 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4515
4518
|
w(h)
|
|
4516
4519
|
] });
|
|
4517
4520
|
case "number":
|
|
4518
|
-
return (
|
|
4521
|
+
return (d, h) => /* @__PURE__ */ l("div", { children: [
|
|
4519
4522
|
/* @__PURE__ */ e(
|
|
4520
|
-
|
|
4523
|
+
W,
|
|
4521
4524
|
{
|
|
4522
4525
|
type: "number",
|
|
4523
|
-
value:
|
|
4526
|
+
value: d[v.key] || "",
|
|
4524
4527
|
onChange: (x) => p(h, x.target.value),
|
|
4525
4528
|
placeholder: v.placeholder || `Enter ${v.label}`,
|
|
4526
4529
|
required: v.required,
|
|
@@ -4530,12 +4533,12 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4530
4533
|
w(h)
|
|
4531
4534
|
] });
|
|
4532
4535
|
case "email":
|
|
4533
|
-
return (
|
|
4536
|
+
return (d, h) => /* @__PURE__ */ l("div", { children: [
|
|
4534
4537
|
/* @__PURE__ */ e(
|
|
4535
|
-
|
|
4538
|
+
W,
|
|
4536
4539
|
{
|
|
4537
4540
|
type: "email",
|
|
4538
|
-
value:
|
|
4541
|
+
value: d[v.key] || "",
|
|
4539
4542
|
onChange: (x) => p(h, x.target.value),
|
|
4540
4543
|
placeholder: v.placeholder || "Enter email address",
|
|
4541
4544
|
required: v.required,
|
|
@@ -4545,12 +4548,12 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4545
4548
|
w(h)
|
|
4546
4549
|
] });
|
|
4547
4550
|
case "url":
|
|
4548
|
-
return (
|
|
4551
|
+
return (d, h) => /* @__PURE__ */ l("div", { children: [
|
|
4549
4552
|
/* @__PURE__ */ e(
|
|
4550
|
-
|
|
4553
|
+
W,
|
|
4551
4554
|
{
|
|
4552
4555
|
type: "url",
|
|
4553
|
-
value:
|
|
4556
|
+
value: d[v.key] || "",
|
|
4554
4557
|
onChange: (x) => p(h, x.target.value),
|
|
4555
4558
|
placeholder: v.placeholder || "Enter URL",
|
|
4556
4559
|
required: v.required,
|
|
@@ -4560,12 +4563,12 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4560
4563
|
w(h)
|
|
4561
4564
|
] });
|
|
4562
4565
|
case "password":
|
|
4563
|
-
return (
|
|
4566
|
+
return (d, h) => /* @__PURE__ */ l("div", { children: [
|
|
4564
4567
|
/* @__PURE__ */ e(
|
|
4565
|
-
|
|
4568
|
+
W,
|
|
4566
4569
|
{
|
|
4567
4570
|
type: "password",
|
|
4568
|
-
value:
|
|
4571
|
+
value: d[v.key] || "",
|
|
4569
4572
|
onChange: (x) => p(h, x.target.value),
|
|
4570
4573
|
placeholder: v.placeholder || "Enter password",
|
|
4571
4574
|
required: v.required,
|
|
@@ -4576,11 +4579,11 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4576
4579
|
] });
|
|
4577
4580
|
case "select":
|
|
4578
4581
|
case "dropdown":
|
|
4579
|
-
return (
|
|
4582
|
+
return (d, h) => /* @__PURE__ */ l("div", { children: [
|
|
4580
4583
|
/* @__PURE__ */ e(
|
|
4581
4584
|
ra,
|
|
4582
4585
|
{
|
|
4583
|
-
value:
|
|
4586
|
+
value: d[v.key] || "",
|
|
4584
4587
|
onChange: (x) => p(h, x),
|
|
4585
4588
|
options: v.options || [],
|
|
4586
4589
|
placeholder: v.placeholder || `Select ${v.label}`,
|
|
@@ -4591,15 +4594,15 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4591
4594
|
w(h)
|
|
4592
4595
|
] });
|
|
4593
4596
|
case "selectDynamic":
|
|
4594
|
-
return (
|
|
4597
|
+
return (d, h) => {
|
|
4595
4598
|
const x = () => {
|
|
4596
4599
|
if (v.optionsFrom && r) {
|
|
4597
|
-
const { config: F, valueField:
|
|
4598
|
-
if (Array.isArray(
|
|
4599
|
-
return
|
|
4600
|
-
id: A[
|
|
4601
|
-
value: A[
|
|
4602
|
-
label: A[
|
|
4600
|
+
const { config: F, valueField: z, labelField: q } = v.optionsFrom, D = r[F] || [];
|
|
4601
|
+
if (Array.isArray(D))
|
|
4602
|
+
return D.map((A) => ({
|
|
4603
|
+
id: A[z] || "",
|
|
4604
|
+
value: A[z] || "",
|
|
4605
|
+
label: A[q] || ""
|
|
4603
4606
|
}));
|
|
4604
4607
|
}
|
|
4605
4608
|
return v.options || [];
|
|
@@ -4609,7 +4612,7 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4609
4612
|
ra,
|
|
4610
4613
|
{
|
|
4611
4614
|
index: h,
|
|
4612
|
-
value:
|
|
4615
|
+
value: d[v.key] || "",
|
|
4613
4616
|
onChange: (F) => p(h, F),
|
|
4614
4617
|
options: x(),
|
|
4615
4618
|
placeholder: v.placeholder || `Select ${v.label}`,
|
|
@@ -4622,8 +4625,8 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4622
4625
|
] });
|
|
4623
4626
|
};
|
|
4624
4627
|
case "multiselect":
|
|
4625
|
-
return (
|
|
4626
|
-
const x =
|
|
4628
|
+
return (d, h) => {
|
|
4629
|
+
const x = d[v.key] || [];
|
|
4627
4630
|
return /* @__PURE__ */ e(
|
|
4628
4631
|
Ye,
|
|
4629
4632
|
{
|
|
@@ -4637,10 +4640,10 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4637
4640
|
};
|
|
4638
4641
|
case "checkbox":
|
|
4639
4642
|
case "boolean":
|
|
4640
|
-
return (
|
|
4643
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4641
4644
|
Pa,
|
|
4642
4645
|
{
|
|
4643
|
-
checked: !!
|
|
4646
|
+
checked: !!d[v.key],
|
|
4644
4647
|
onChange: (x) => p(h, x),
|
|
4645
4648
|
label: v.placeholder || v.label,
|
|
4646
4649
|
className: "w-full"
|
|
@@ -4648,31 +4651,31 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4648
4651
|
);
|
|
4649
4652
|
case "toggle":
|
|
4650
4653
|
case "switch":
|
|
4651
|
-
return (
|
|
4654
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4652
4655
|
Ga,
|
|
4653
4656
|
{
|
|
4654
|
-
isOn: !!
|
|
4657
|
+
isOn: !!d[v.key],
|
|
4655
4658
|
onToggle: (x) => p(h, x),
|
|
4656
4659
|
label: v.placeholder || v.label,
|
|
4657
4660
|
className: "w-full"
|
|
4658
4661
|
}
|
|
4659
4662
|
);
|
|
4660
4663
|
case "date":
|
|
4661
|
-
return (
|
|
4664
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4662
4665
|
Ma,
|
|
4663
4666
|
{
|
|
4664
|
-
selectedDate:
|
|
4667
|
+
selectedDate: d[v.key] ? new Date(d[v.key]) : null,
|
|
4665
4668
|
onDateChange: (x) => p(h, x ? x.toISOString().split("T")[0] : ""),
|
|
4666
4669
|
placeholder: v.placeholder || "Select date",
|
|
4667
4670
|
className: "w-full"
|
|
4668
4671
|
}
|
|
4669
4672
|
);
|
|
4670
4673
|
case "datetime":
|
|
4671
|
-
return (
|
|
4672
|
-
|
|
4674
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4675
|
+
W,
|
|
4673
4676
|
{
|
|
4674
4677
|
type: "datetime-local",
|
|
4675
|
-
value:
|
|
4678
|
+
value: d[v.key] || "",
|
|
4676
4679
|
onChange: (x) => p(h, x.target.value),
|
|
4677
4680
|
placeholder: v.placeholder || "Select date and time",
|
|
4678
4681
|
required: v.required,
|
|
@@ -4680,11 +4683,11 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4680
4683
|
}
|
|
4681
4684
|
);
|
|
4682
4685
|
case "time":
|
|
4683
|
-
return (
|
|
4684
|
-
|
|
4686
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4687
|
+
W,
|
|
4685
4688
|
{
|
|
4686
4689
|
type: "time",
|
|
4687
|
-
value:
|
|
4690
|
+
value: d[v.key] || "",
|
|
4688
4691
|
onChange: (x) => p(h, x.target.value),
|
|
4689
4692
|
placeholder: v.placeholder || "Select time",
|
|
4690
4693
|
required: v.required,
|
|
@@ -4692,48 +4695,48 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4692
4695
|
}
|
|
4693
4696
|
);
|
|
4694
4697
|
case "radio":
|
|
4695
|
-
return (
|
|
4698
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4696
4699
|
Ua,
|
|
4697
4700
|
{
|
|
4698
|
-
selectedValue:
|
|
4701
|
+
selectedValue: d[v.key] || "",
|
|
4699
4702
|
onValueChange: (x) => p(h, x),
|
|
4700
4703
|
options: v.options || [],
|
|
4701
4704
|
className: "w-full"
|
|
4702
4705
|
}
|
|
4703
4706
|
);
|
|
4704
4707
|
case "search":
|
|
4705
|
-
return (
|
|
4708
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4706
4709
|
he,
|
|
4707
4710
|
{
|
|
4708
|
-
value:
|
|
4711
|
+
value: d[v.key] || "",
|
|
4709
4712
|
onChange: (x) => p(h, x),
|
|
4710
4713
|
placeholder: v.placeholder || `Search ${v.label}`,
|
|
4711
4714
|
className: "w-full"
|
|
4712
4715
|
}
|
|
4713
4716
|
);
|
|
4714
4717
|
case "audience":
|
|
4715
|
-
return (
|
|
4716
|
-
const x =
|
|
4718
|
+
return (d, h) => {
|
|
4719
|
+
const x = d[v.key] || { users: [], groups: [], roles: [] }, F = [
|
|
4717
4720
|
...x.users || [],
|
|
4718
4721
|
...x.groups || [],
|
|
4719
4722
|
...x.roles || []
|
|
4720
4723
|
];
|
|
4721
4724
|
return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
4722
|
-
/* @__PURE__ */ e(zn, { children: F.length > 0 ? F.slice(0, 3).map((
|
|
4725
|
+
/* @__PURE__ */ e(zn, { children: F.length > 0 ? F.slice(0, 3).map((z, q) => /* @__PURE__ */ e(
|
|
4723
4726
|
za,
|
|
4724
4727
|
{
|
|
4725
4728
|
size: "small",
|
|
4726
|
-
name:
|
|
4727
|
-
src:
|
|
4729
|
+
name: z.name || z.displayName || z.id,
|
|
4730
|
+
src: z.avatarUrl
|
|
4728
4731
|
},
|
|
4729
|
-
|
|
4732
|
+
q
|
|
4730
4733
|
)) : null }),
|
|
4731
4734
|
/* @__PURE__ */ e(
|
|
4732
4735
|
"button",
|
|
4733
4736
|
{
|
|
4734
4737
|
className: "text-blue-600 font-semibold hover:text-blue-800",
|
|
4735
4738
|
onClick: () => {
|
|
4736
|
-
b(v.key),
|
|
4739
|
+
b(v.key), c(h);
|
|
4737
4740
|
},
|
|
4738
4741
|
children: F.length > 0 ? "Edit" : "Assign"
|
|
4739
4742
|
}
|
|
@@ -4741,22 +4744,22 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4741
4744
|
] });
|
|
4742
4745
|
};
|
|
4743
4746
|
case "color":
|
|
4744
|
-
return (
|
|
4745
|
-
|
|
4747
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4748
|
+
W,
|
|
4746
4749
|
{
|
|
4747
4750
|
type: "color",
|
|
4748
|
-
value:
|
|
4751
|
+
value: d[v.key] || "#000000",
|
|
4749
4752
|
onChange: (x) => p(h, x.target.value),
|
|
4750
4753
|
className: "w-full h-10"
|
|
4751
4754
|
}
|
|
4752
4755
|
);
|
|
4753
4756
|
case "range":
|
|
4754
|
-
return (
|
|
4757
|
+
return (d, h) => /* @__PURE__ */ l("div", { className: "w-full", children: [
|
|
4755
4758
|
/* @__PURE__ */ e(
|
|
4756
|
-
|
|
4759
|
+
W,
|
|
4757
4760
|
{
|
|
4758
4761
|
type: "range",
|
|
4759
|
-
value:
|
|
4762
|
+
value: d[v.key] || v.min || 0,
|
|
4760
4763
|
onChange: (x) => p(h, x.target.value),
|
|
4761
4764
|
min: v.min || 0,
|
|
4762
4765
|
max: v.max || 100,
|
|
@@ -4764,11 +4767,11 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4764
4767
|
className: "w-full"
|
|
4765
4768
|
}
|
|
4766
4769
|
),
|
|
4767
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children:
|
|
4770
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: d[v.key] || v.min || 0 })
|
|
4768
4771
|
] });
|
|
4769
4772
|
case "file":
|
|
4770
|
-
return (
|
|
4771
|
-
|
|
4773
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4774
|
+
W,
|
|
4772
4775
|
{
|
|
4773
4776
|
type: "file",
|
|
4774
4777
|
onChange: (x) => {
|
|
@@ -4780,21 +4783,21 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4780
4783
|
}
|
|
4781
4784
|
);
|
|
4782
4785
|
case "hidden":
|
|
4783
|
-
return (
|
|
4784
|
-
|
|
4786
|
+
return (d, h) => /* @__PURE__ */ e(
|
|
4787
|
+
W,
|
|
4785
4788
|
{
|
|
4786
4789
|
type: "hidden",
|
|
4787
|
-
value:
|
|
4790
|
+
value: d[v.key] || "",
|
|
4788
4791
|
onChange: (x) => p(h, x.target.value)
|
|
4789
4792
|
}
|
|
4790
4793
|
);
|
|
4791
4794
|
// Default fallback for unknown field types
|
|
4792
4795
|
default:
|
|
4793
|
-
return (
|
|
4796
|
+
return (d, h) => /* @__PURE__ */ l("div", { children: [
|
|
4794
4797
|
/* @__PURE__ */ e(
|
|
4795
|
-
|
|
4798
|
+
W,
|
|
4796
4799
|
{
|
|
4797
|
-
value:
|
|
4800
|
+
value: d[v.key] || "",
|
|
4798
4801
|
onChange: (x) => p(h, x.target.value),
|
|
4799
4802
|
placeholder: v.placeholder || `Enter ${v.label}`,
|
|
4800
4803
|
required: v.required,
|
|
@@ -4817,37 +4820,37 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4817
4820
|
const f = [...v, p];
|
|
4818
4821
|
return console.log("[DataTableRenderer] Updated data:", f), f;
|
|
4819
4822
|
});
|
|
4820
|
-
}, [n.fields]),
|
|
4823
|
+
}, [n.fields]), M = K((v) => {
|
|
4821
4824
|
a((p) => {
|
|
4822
4825
|
if (p.length <= 1)
|
|
4823
4826
|
return p;
|
|
4824
4827
|
const f = [...p];
|
|
4825
4828
|
return f.splice(v, 1), f;
|
|
4826
4829
|
});
|
|
4827
|
-
}, []), [C, T] = B(null),
|
|
4830
|
+
}, []), [C, T] = B(null), E = K((v, p) => {
|
|
4828
4831
|
T(p), v.dataTransfer.effectAllowed = "move", v.dataTransfer.setData("text/html", "");
|
|
4829
|
-
}, []),
|
|
4832
|
+
}, []), R = K((v) => {
|
|
4830
4833
|
v.preventDefault(), v.dataTransfer.dropEffect = "move";
|
|
4831
|
-
}, []),
|
|
4834
|
+
}, []), U = K((v, p) => {
|
|
4832
4835
|
v.preventDefault(), !(C === null || C === p) && (a((f) => {
|
|
4833
|
-
const w = [...f],
|
|
4834
|
-
return w.splice(C, 1), w.splice(p, 0,
|
|
4836
|
+
const w = [...f], d = w[C];
|
|
4837
|
+
return w.splice(C, 1), w.splice(p, 0, d), w;
|
|
4835
4838
|
}), T(null));
|
|
4836
|
-
}, [C]),
|
|
4839
|
+
}, [C]), V = K(() => {
|
|
4837
4840
|
T(null);
|
|
4838
|
-
}, []),
|
|
4841
|
+
}, []), j = K((v) => {
|
|
4839
4842
|
console.log("[DataTableRenderer] handleAddAudience called with:", v), a((p) => {
|
|
4840
4843
|
const f = [...p];
|
|
4841
4844
|
if (i !== null && y && f[i]) {
|
|
4842
|
-
const w = v.pendingInvites || [],
|
|
4845
|
+
const w = v.pendingInvites || [], d = w.filter((F) => F.type === "User"), h = w.filter((F) => F.type === "Group"), x = w.filter((F) => F.type === "Role");
|
|
4843
4846
|
f[i][y] = {
|
|
4844
|
-
users: [...f[i][y]?.users || [], ...
|
|
4847
|
+
users: [...f[i][y]?.users || [], ...d],
|
|
4845
4848
|
groups: [...f[i][y]?.groups || [], ...h],
|
|
4846
4849
|
roles: [...f[i][y]?.roles || [], ...x]
|
|
4847
4850
|
}, console.log("[DataTableRenderer] Updated audience data:", f[i][y]);
|
|
4848
4851
|
}
|
|
4849
4852
|
return f;
|
|
4850
|
-
}),
|
|
4853
|
+
}), c(null), b(null);
|
|
4851
4854
|
}, [i, y]);
|
|
4852
4855
|
return /* @__PURE__ */ l("div", { children: [
|
|
4853
4856
|
/* @__PURE__ */ l("div", { style: { marginBottom: "20px" }, children: [
|
|
@@ -4882,17 +4885,17 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4882
4885
|
{
|
|
4883
4886
|
className: `hover:bg-gray-50 ${C === p ? "opacity-50" : ""}`,
|
|
4884
4887
|
draggable: !0,
|
|
4885
|
-
onDragStart: (f) =>
|
|
4886
|
-
onDragOver:
|
|
4887
|
-
onDrop: (f) =>
|
|
4888
|
-
onDragEnd:
|
|
4888
|
+
onDragStart: (f) => E(f, p),
|
|
4889
|
+
onDragOver: R,
|
|
4890
|
+
onDrop: (f) => U(f, p),
|
|
4891
|
+
onDragEnd: V,
|
|
4889
4892
|
children: [
|
|
4890
4893
|
/* @__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 }) }) }),
|
|
4891
4894
|
n.fields.map((f, w) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: $(f)(v, p) }, w)),
|
|
4892
4895
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
4893
4896
|
"button",
|
|
4894
4897
|
{
|
|
4895
|
-
onClick: () =>
|
|
4898
|
+
onClick: () => M(p),
|
|
4896
4899
|
className: "text-red-500 hover:text-red-700",
|
|
4897
4900
|
title: "Delete row",
|
|
4898
4901
|
children: /* @__PURE__ */ e(Jt, { size: 16 })
|
|
@@ -4914,9 +4917,9 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4914
4917
|
{
|
|
4915
4918
|
isOpen: !0,
|
|
4916
4919
|
onClose: () => {
|
|
4917
|
-
|
|
4920
|
+
c(null), b(null);
|
|
4918
4921
|
},
|
|
4919
|
-
onFinalSubmit:
|
|
4922
|
+
onFinalSubmit: j,
|
|
4920
4923
|
existingShares: v,
|
|
4921
4924
|
allowedPermissions: ["view", "remove"]
|
|
4922
4925
|
}
|
|
@@ -4987,118 +4990,118 @@ const fa = () => {
|
|
|
4987
4990
|
allowAdd: n = !0,
|
|
4988
4991
|
allowEdit: u = !0,
|
|
4989
4992
|
allowDelete: i = !0,
|
|
4990
|
-
allowReorder:
|
|
4993
|
+
allowReorder: c = !0,
|
|
4991
4994
|
initialData: y = null
|
|
4992
4995
|
// Add prop for initial demo data
|
|
4993
4996
|
}) => {
|
|
4994
|
-
const [b, N] = B(null), [a, k] = B(""), [m, g] = B(() => Array.isArray(y) ? y : []), [$, L] = B(null), [
|
|
4997
|
+
const [b, N] = B(null), [a, k] = B(""), [m, g] = B(() => Array.isArray(y) ? y : []), [$, L] = B(null), [M, C] = B(null), [T, E] = B(""), R = async () => {
|
|
4995
4998
|
try {
|
|
4996
|
-
const
|
|
4997
|
-
if (
|
|
4998
|
-
const A =
|
|
4999
|
-
...
|
|
5000
|
-
order: typeof
|
|
4999
|
+
const D = await Ee(t.collectionList);
|
|
5000
|
+
if (D) {
|
|
5001
|
+
const A = D.map((S, I) => ({
|
|
5002
|
+
...S,
|
|
5003
|
+
order: typeof S.order == "number" ? S.order : I + 1
|
|
5001
5004
|
}));
|
|
5002
|
-
A.sort((
|
|
5005
|
+
A.sort((S, I) => (S.order ?? 0) - (I.order ?? 0)), g(A), s?.(A);
|
|
5003
5006
|
}
|
|
5004
|
-
} catch (
|
|
5005
|
-
console.log("Error loading collections:",
|
|
5007
|
+
} catch (D) {
|
|
5008
|
+
console.log("Error loading collections:", D), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
|
|
5006
5009
|
}
|
|
5007
5010
|
};
|
|
5008
|
-
|
|
5009
|
-
(!y || y.length === 0) &&
|
|
5010
|
-
}, [y]),
|
|
5011
|
+
Q(() => {
|
|
5012
|
+
(!y || y.length === 0) && R();
|
|
5013
|
+
}, [y]), Q(() => {
|
|
5011
5014
|
Array.isArray(y) && g(y);
|
|
5012
5015
|
}, [y]);
|
|
5013
|
-
const
|
|
5014
|
-
u && (N(
|
|
5015
|
-
},
|
|
5016
|
+
const U = (D) => {
|
|
5017
|
+
u && (N(D.id), k(D.categoryName || ""));
|
|
5018
|
+
}, V = () => {
|
|
5016
5019
|
if (!n || b !== null) return;
|
|
5017
|
-
const
|
|
5020
|
+
const D = `temp-${Date.now()}`;
|
|
5018
5021
|
g((A) => [
|
|
5019
5022
|
...A,
|
|
5020
5023
|
{
|
|
5021
|
-
id:
|
|
5024
|
+
id: D,
|
|
5022
5025
|
categoryName: "",
|
|
5023
5026
|
links: [],
|
|
5024
5027
|
order: (A.at(-1)?.order ?? 0) + 1,
|
|
5025
5028
|
_temp: !0
|
|
5026
5029
|
}
|
|
5027
|
-
]), N(
|
|
5028
|
-
},
|
|
5029
|
-
b != null && (g((
|
|
5030
|
-
const A =
|
|
5031
|
-
return s?.(
|
|
5030
|
+
]), N(D), k("");
|
|
5031
|
+
}, j = () => {
|
|
5032
|
+
b != null && (g((D) => {
|
|
5033
|
+
const A = D.find((I) => I.id === b), S = A && A._temp ? D.filter((I) => I.id !== b) : D;
|
|
5034
|
+
return s?.(S), S;
|
|
5032
5035
|
}), N(null), k(""));
|
|
5033
5036
|
}, v = async () => {
|
|
5034
5037
|
if (b == null || !a.trim()) return;
|
|
5035
|
-
const
|
|
5038
|
+
const D = typeof b == "string" && b.startsWith("temp-");
|
|
5036
5039
|
try {
|
|
5037
|
-
if (
|
|
5040
|
+
if (D) {
|
|
5038
5041
|
const A = await Re(t.collectionCreate, {
|
|
5039
5042
|
categoryName: a.trim(),
|
|
5040
5043
|
order: (Array.isArray(m) && m.length > 0 ? m.at(-1)?.order ?? 0 : 0) + 1
|
|
5041
5044
|
});
|
|
5042
|
-
A && (g((
|
|
5043
|
-
const
|
|
5044
|
-
return s?.(
|
|
5045
|
+
A && (g((S) => {
|
|
5046
|
+
const I = S.map((O) => O.id === b ? A : O);
|
|
5047
|
+
return s?.(I), I;
|
|
5045
5048
|
}), ke.success("Collection created successfully"));
|
|
5046
5049
|
} else {
|
|
5047
5050
|
const A = await mn(
|
|
5048
5051
|
`${t.collectionUpdate}/${b}?newName=${a.trim()}`
|
|
5049
5052
|
);
|
|
5050
|
-
g((
|
|
5051
|
-
const
|
|
5052
|
-
(
|
|
5053
|
+
g((S) => {
|
|
5054
|
+
const I = S.map(
|
|
5055
|
+
(O) => O.id === b ? A && A.id ? { ...O, ...A } : { ...O, categoryName: a.trim() } : O
|
|
5053
5056
|
);
|
|
5054
|
-
return s?.(
|
|
5057
|
+
return s?.(I), I;
|
|
5055
5058
|
}), le.success("Collection updated successfully");
|
|
5056
5059
|
}
|
|
5057
5060
|
N(null), k("");
|
|
5058
5061
|
} catch (A) {
|
|
5059
5062
|
console.log(A), le.error("Failed to save collection");
|
|
5060
5063
|
}
|
|
5061
|
-
}, p = async (
|
|
5064
|
+
}, p = async (D) => {
|
|
5062
5065
|
if (i)
|
|
5063
5066
|
try {
|
|
5064
|
-
await un(`${t.collectionUpdate}/${
|
|
5067
|
+
await un(`${t.collectionUpdate}/${D.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), R());
|
|
5065
5068
|
} catch (A) {
|
|
5066
5069
|
console.log(A), le.error("Failed to delete collection");
|
|
5067
5070
|
}
|
|
5068
|
-
}, f = (
|
|
5069
|
-
if (!
|
|
5070
|
-
const
|
|
5071
|
-
if (
|
|
5072
|
-
const
|
|
5073
|
-
return
|
|
5074
|
-
}, w = async (
|
|
5075
|
-
const A =
|
|
5076
|
-
id:
|
|
5077
|
-
order:
|
|
5078
|
-
categoryName:
|
|
5071
|
+
}, f = (D, A, S) => {
|
|
5072
|
+
if (!c || !A || !S || A === S) return D;
|
|
5073
|
+
const I = D.findIndex((ie) => ie.id === A), O = D.findIndex((ie) => ie.id === S);
|
|
5074
|
+
if (I === -1 || O === -1) return D;
|
|
5075
|
+
const H = [...D], [Ne] = H.splice(I, 1);
|
|
5076
|
+
return H.splice(O, 0, Ne), H.map((ie, xe) => ({ ...ie, order: xe + 1 }));
|
|
5077
|
+
}, w = async (D) => {
|
|
5078
|
+
const A = D.map((S) => ({
|
|
5079
|
+
id: S.id,
|
|
5080
|
+
order: S.order,
|
|
5081
|
+
categoryName: S.categoryName
|
|
5079
5082
|
}));
|
|
5080
5083
|
try {
|
|
5081
5084
|
await Re(t.updateCollection, A);
|
|
5082
|
-
} catch (
|
|
5083
|
-
console.log(
|
|
5085
|
+
} catch (S) {
|
|
5086
|
+
console.log(S), le.error("Failed to save order", { autoClose: 2500 });
|
|
5084
5087
|
}
|
|
5085
|
-
},
|
|
5086
|
-
|
|
5087
|
-
}, h = (
|
|
5088
|
-
$ &&
|
|
5089
|
-
}, x = (
|
|
5090
|
-
|
|
5091
|
-
}, F = async (
|
|
5092
|
-
|
|
5093
|
-
const
|
|
5094
|
-
|
|
5095
|
-
const
|
|
5096
|
-
return console.log("Reordered",
|
|
5088
|
+
}, d = (D, A) => {
|
|
5089
|
+
c && (D.dataTransfer.effectAllowed = "move", D.dataTransfer.setData("text/plain", String(A)), L(A));
|
|
5090
|
+
}, h = (D) => {
|
|
5091
|
+
$ && D !== M && C(D);
|
|
5092
|
+
}, x = (D) => {
|
|
5093
|
+
D.preventDefault();
|
|
5094
|
+
}, F = async (D, A) => {
|
|
5095
|
+
D.preventDefault();
|
|
5096
|
+
const S = D.dataTransfer.getData("text/plain");
|
|
5097
|
+
S && (g((I) => {
|
|
5098
|
+
const O = f(I, S, A);
|
|
5099
|
+
return console.log("Reordered", O), w(O), s?.(O), O;
|
|
5097
5100
|
}), L(null), C(null));
|
|
5098
|
-
},
|
|
5101
|
+
}, z = () => {
|
|
5099
5102
|
L(null), C(null);
|
|
5100
|
-
},
|
|
5101
|
-
(
|
|
5103
|
+
}, q = Array.isArray(m) ? m.filter(
|
|
5104
|
+
(D) => D.categoryName?.toLowerCase().includes(T.toLowerCase())
|
|
5102
5105
|
) : [];
|
|
5103
5106
|
return /* @__PURE__ */ l("div", { className: `manage-collection-list ${r}`, children: [
|
|
5104
5107
|
/* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ l("div", { className: "w-1/2 flex justify-end", children: [
|
|
@@ -5106,7 +5109,7 @@ const fa = () => {
|
|
|
5106
5109
|
he,
|
|
5107
5110
|
{
|
|
5108
5111
|
value: T,
|
|
5109
|
-
onDebouncedChange:
|
|
5112
|
+
onDebouncedChange: E,
|
|
5110
5113
|
placeholder: "Search Collection",
|
|
5111
5114
|
customClass: "mr-4 searchmanagecollection"
|
|
5112
5115
|
}
|
|
@@ -5118,26 +5121,26 @@ const fa = () => {
|
|
|
5118
5121
|
"px-4 py-3 bg-black text-white rounded-2xl ml-4",
|
|
5119
5122
|
b !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
5120
5123
|
].join(" "),
|
|
5121
|
-
onClick:
|
|
5124
|
+
onClick: V,
|
|
5122
5125
|
disabled: b !== null,
|
|
5123
5126
|
children: "Add a Collection"
|
|
5124
5127
|
}
|
|
5125
5128
|
)
|
|
5126
5129
|
] }) }),
|
|
5127
|
-
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children:
|
|
5128
|
-
const A = b ===
|
|
5130
|
+
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: q.map((D) => {
|
|
5131
|
+
const A = b === D.id, S = D?.links?.length ?? 0, I = $ === D.id, O = M === D.id && $ !== D.id;
|
|
5129
5132
|
return /* @__PURE__ */ e(
|
|
5130
5133
|
"div",
|
|
5131
5134
|
{
|
|
5132
|
-
onDragEnter: () => h(
|
|
5135
|
+
onDragEnter: () => h(D.id),
|
|
5133
5136
|
onDragOver: x,
|
|
5134
|
-
onDrop: (
|
|
5135
|
-
onDragEnd:
|
|
5137
|
+
onDrop: (H) => F(H, D.id),
|
|
5138
|
+
onDragEnd: z,
|
|
5136
5139
|
className: [
|
|
5137
5140
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5138
5141
|
"border-gray-300",
|
|
5139
|
-
|
|
5140
|
-
|
|
5142
|
+
O ? "ring-2 ring-gray-800/20" : "",
|
|
5143
|
+
I ? "opacity-60" : ""
|
|
5141
5144
|
].join(" "),
|
|
5142
5145
|
children: A ? /* @__PURE__ */ l(ee, { children: [
|
|
5143
5146
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
@@ -5146,10 +5149,10 @@ const fa = () => {
|
|
|
5146
5149
|
type: "text",
|
|
5147
5150
|
className: "flex-1 h-10 px-3 max-w-[200px] border border-gray-300 rounded-2xl outline-none focus:ring-2 focus:ring-gray-800/20",
|
|
5148
5151
|
value: a,
|
|
5149
|
-
placeholder:
|
|
5150
|
-
onChange: (
|
|
5151
|
-
onKeyDown: (
|
|
5152
|
-
|
|
5152
|
+
placeholder: D._temp ? "New collection name" : "Edit collection name",
|
|
5153
|
+
onChange: (H) => k(H.target.value),
|
|
5154
|
+
onKeyDown: (H) => {
|
|
5155
|
+
H.key === "Enter" && v(), H.key === "Escape" && j();
|
|
5153
5156
|
},
|
|
5154
5157
|
autoFocus: !0
|
|
5155
5158
|
}
|
|
@@ -5159,7 +5162,7 @@ const fa = () => {
|
|
|
5159
5162
|
"button",
|
|
5160
5163
|
{
|
|
5161
5164
|
className: "cursor-pointer border border-gray-300 p-2 rounded-2xl",
|
|
5162
|
-
onClick:
|
|
5165
|
+
onClick: j,
|
|
5163
5166
|
"aria-label": "Cancel edit",
|
|
5164
5167
|
children: /* @__PURE__ */ e(ye, { color: "#767676" })
|
|
5165
5168
|
}
|
|
@@ -5181,43 +5184,43 @@ const fa = () => {
|
|
|
5181
5184
|
] })
|
|
5182
5185
|
] }) : /* @__PURE__ */ l(ee, { children: [
|
|
5183
5186
|
/* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
|
|
5184
|
-
|
|
5187
|
+
c && /* @__PURE__ */ e(
|
|
5185
5188
|
"span",
|
|
5186
5189
|
{
|
|
5187
5190
|
role: "button",
|
|
5188
5191
|
"aria-label": "Drag to reorder",
|
|
5189
5192
|
className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
|
|
5190
5193
|
draggable: !0,
|
|
5191
|
-
onDragStart: (
|
|
5194
|
+
onDragStart: (H) => d(H, D.id),
|
|
5192
5195
|
children: /* @__PURE__ */ e(sa, {})
|
|
5193
5196
|
}
|
|
5194
5197
|
),
|
|
5195
|
-
/* @__PURE__ */ e("span", { children:
|
|
5198
|
+
/* @__PURE__ */ e("span", { children: D.categoryName })
|
|
5196
5199
|
] }),
|
|
5197
5200
|
/* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
|
|
5198
|
-
|
|
5201
|
+
D.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: D.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${S} ${S === 1 ? "link" : "links"}` }),
|
|
5199
5202
|
u && /* @__PURE__ */ e(
|
|
5200
5203
|
"button",
|
|
5201
5204
|
{
|
|
5202
5205
|
className: "cursor-pointer",
|
|
5203
|
-
onClick: () =>
|
|
5204
|
-
"aria-label": `Edit ${
|
|
5206
|
+
onClick: () => U(D),
|
|
5207
|
+
"aria-label": `Edit ${D.categoryName}`,
|
|
5205
5208
|
children: /* @__PURE__ */ e(Qt, { color: "#767676" })
|
|
5206
5209
|
}
|
|
5207
5210
|
),
|
|
5208
5211
|
i && /* @__PURE__ */ e(
|
|
5209
5212
|
"span",
|
|
5210
5213
|
{
|
|
5211
|
-
className:
|
|
5212
|
-
title:
|
|
5213
|
-
onClick:
|
|
5214
|
-
children: /* @__PURE__ */ e(Ve, { color:
|
|
5214
|
+
className: S === 0 && !D.protected ? "cursor-pointer" : "cursor-not-allowed",
|
|
5215
|
+
title: S === 0 && !D.protected ? "Delete" : "Cannot delete this collection",
|
|
5216
|
+
onClick: S === 0 ? () => p(D) : null,
|
|
5217
|
+
children: /* @__PURE__ */ e(Ve, { color: S === 0 ? "#767676" : "#C2C2C2" })
|
|
5215
5218
|
}
|
|
5216
5219
|
)
|
|
5217
5220
|
] })
|
|
5218
5221
|
] })
|
|
5219
5222
|
},
|
|
5220
|
-
|
|
5223
|
+
D.id
|
|
5221
5224
|
);
|
|
5222
5225
|
}) })
|
|
5223
5226
|
] });
|
|
@@ -5227,7 +5230,7 @@ const fa = () => {
|
|
|
5227
5230
|
description: n = "",
|
|
5228
5231
|
endpoints: u = {},
|
|
5229
5232
|
initialData: i = null,
|
|
5230
|
-
showSearch:
|
|
5233
|
+
showSearch: c = !0,
|
|
5231
5234
|
allowAdd: y = !0,
|
|
5232
5235
|
allowEdit: b = !0,
|
|
5233
5236
|
allowDelete: N = !0,
|
|
@@ -5248,7 +5251,7 @@ const fa = () => {
|
|
|
5248
5251
|
onCollectionChange: (L) => {
|
|
5249
5252
|
s && s(t.key, L);
|
|
5250
5253
|
},
|
|
5251
|
-
showSearch:
|
|
5254
|
+
showSearch: c,
|
|
5252
5255
|
allowAdd: y,
|
|
5253
5256
|
allowEdit: b,
|
|
5254
5257
|
allowDelete: N,
|
|
@@ -5279,56 +5282,56 @@ function Un({
|
|
|
5279
5282
|
onCancel: o,
|
|
5280
5283
|
onSave: n
|
|
5281
5284
|
}) {
|
|
5282
|
-
const [u, i] = ae.useState(r), [
|
|
5285
|
+
const [u, i] = ae.useState(r), [c, y] = ae.useState(null), [b, N] = B(!1), [a, k] = B(!1), [m, g] = B({}), $ = `${ve()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, L = $, [M, C] = B(1), T = (f) => {
|
|
5283
5286
|
if (!r || !r.configuration)
|
|
5284
5287
|
return f;
|
|
5285
|
-
const w = {},
|
|
5288
|
+
const w = {}, d = f?.configuration || {};
|
|
5286
5289
|
return r.configuration.forEach((h) => {
|
|
5287
5290
|
if (h.key && h.type === "datatable") {
|
|
5288
|
-
const F = (
|
|
5289
|
-
const
|
|
5291
|
+
const F = (d[h.key] || []).map((z, q) => {
|
|
5292
|
+
const D = { id: z.id || 0 };
|
|
5290
5293
|
return h.fields && h.fields.forEach((A) => {
|
|
5291
5294
|
if (A.fieldtype === "audience") {
|
|
5292
|
-
let
|
|
5293
|
-
|
|
5294
|
-
users:
|
|
5295
|
-
groups:
|
|
5296
|
-
roles:
|
|
5297
|
-
})),
|
|
5295
|
+
let S = { users: [], groups: [], roles: [] };
|
|
5296
|
+
z[A.key] && (Array.isArray(z[A.key]) ? S = { users: [], groups: [], roles: [] } : typeof z[A.key] == "object" && (S = {
|
|
5297
|
+
users: z[A.key].users || [],
|
|
5298
|
+
groups: z[A.key].groups || [],
|
|
5299
|
+
roles: z[A.key].roles || []
|
|
5300
|
+
})), D[A.key] = S;
|
|
5298
5301
|
} else
|
|
5299
|
-
|
|
5300
|
-
}),
|
|
5302
|
+
D[A.key] = z[A.key] || A.default || "";
|
|
5303
|
+
}), D;
|
|
5301
5304
|
});
|
|
5302
5305
|
if (F.length === 0) {
|
|
5303
|
-
const
|
|
5304
|
-
h.fields && h.fields.forEach((
|
|
5305
|
-
|
|
5306
|
-
}), F.push(
|
|
5306
|
+
const z = { id: 0 };
|
|
5307
|
+
h.fields && h.fields.forEach((q) => {
|
|
5308
|
+
q.fieldtype === "audience" ? z[q.key] = { users: [], groups: [], roles: [] } : z[q.key] = q.default || "";
|
|
5309
|
+
}), F.push(z);
|
|
5307
5310
|
}
|
|
5308
5311
|
w[h.key] = F;
|
|
5309
|
-
} else h.key && (w[h.key] =
|
|
5312
|
+
} else h.key && (w[h.key] = d[h.key] || {});
|
|
5310
5313
|
}), w;
|
|
5311
|
-
},
|
|
5314
|
+
}, E = () => {
|
|
5312
5315
|
if (r && r.configuration) {
|
|
5313
5316
|
const f = {};
|
|
5314
5317
|
r.configuration.forEach((w) => {
|
|
5315
5318
|
if (w.key)
|
|
5316
5319
|
if (w.type === "datatable") {
|
|
5317
|
-
const
|
|
5320
|
+
const d = { id: 0 };
|
|
5318
5321
|
w.fields && w.fields.forEach((h) => {
|
|
5319
|
-
h.fieldtype === "audience" ?
|
|
5320
|
-
}), f[w.key] = [
|
|
5322
|
+
h.fieldtype === "audience" ? d[h.key] = { users: [], groups: [], roles: [] } : d[h.key] = h.default || "";
|
|
5323
|
+
}), f[w.key] = [d];
|
|
5321
5324
|
} else if (w.type === "section") {
|
|
5322
|
-
const
|
|
5325
|
+
const d = {};
|
|
5323
5326
|
w.fields && Array.isArray(w.fields) && w.fields.forEach((h) => {
|
|
5324
|
-
h.key && (
|
|
5325
|
-
}), f[w.key] =
|
|
5327
|
+
h.key && (d[h.key] = h.default || "");
|
|
5328
|
+
}), f[w.key] = d;
|
|
5326
5329
|
} else
|
|
5327
5330
|
f[w.key] = {};
|
|
5328
5331
|
}), y(f);
|
|
5329
5332
|
}
|
|
5330
5333
|
};
|
|
5331
|
-
|
|
5334
|
+
Q(() => {
|
|
5332
5335
|
if (s) {
|
|
5333
5336
|
N(!1);
|
|
5334
5337
|
return;
|
|
@@ -5338,63 +5341,63 @@ function Un({
|
|
|
5338
5341
|
N(!0);
|
|
5339
5342
|
let w = await Ee($);
|
|
5340
5343
|
if (w) {
|
|
5341
|
-
const
|
|
5342
|
-
y(
|
|
5344
|
+
const d = T(w);
|
|
5345
|
+
y(d);
|
|
5343
5346
|
} else
|
|
5344
|
-
|
|
5347
|
+
E();
|
|
5345
5348
|
} catch (w) {
|
|
5346
5349
|
console.error("Error fetching configuration:", w);
|
|
5347
|
-
let
|
|
5350
|
+
let d = "Failed to load configuration";
|
|
5348
5351
|
if (w.response) {
|
|
5349
5352
|
const h = w.response.status, x = w.response.data?.message || w.response.data?.error;
|
|
5350
|
-
h === 400 ?
|
|
5351
|
-
} else w.request ?
|
|
5352
|
-
ke.error(
|
|
5353
|
+
h === 400 ? d = x || "Invalid request. Please check the application ID." : h === 401 ? d = "You are not authorized to access this configuration." : h === 403 ? d = "Access denied. You don't have permission to view this configuration." : h === 404 ? d = "Configuration not found. It may not exist yet or the application ID is incorrect." : h >= 500 ? d = x || "Server error. Please try again later." : d = x || `Failed to load configuration (Error ${h})`;
|
|
5354
|
+
} else w.request ? d = "Network error. Please check your connection and try again." : d = w.message || "An unexpected error occurred while loading configuration.";
|
|
5355
|
+
ke.error(d), E();
|
|
5353
5356
|
} finally {
|
|
5354
5357
|
N(!1);
|
|
5355
5358
|
}
|
|
5356
5359
|
};
|
|
5357
|
-
r && (i(r), t ? f() :
|
|
5358
|
-
}, [r,
|
|
5359
|
-
const
|
|
5360
|
-
y((
|
|
5361
|
-
...
|
|
5360
|
+
r && (i(r), t ? f() : E());
|
|
5361
|
+
}, [r, M, t, s]);
|
|
5362
|
+
const R = (f, w) => {
|
|
5363
|
+
y((d) => ({
|
|
5364
|
+
...d,
|
|
5362
5365
|
[f]: w
|
|
5363
|
-
})), g((
|
|
5364
|
-
const h = { ...
|
|
5366
|
+
})), g((d) => {
|
|
5367
|
+
const h = { ...d };
|
|
5365
5368
|
return h[f] && delete h[f], h;
|
|
5366
5369
|
});
|
|
5367
|
-
},
|
|
5370
|
+
}, U = () => {
|
|
5368
5371
|
const f = {};
|
|
5369
|
-
return !u || !
|
|
5372
|
+
return !u || !c || u.configuration.forEach((w) => {
|
|
5370
5373
|
if (w.type === "section")
|
|
5371
|
-
w.fields.forEach((
|
|
5372
|
-
if (
|
|
5373
|
-
const h =
|
|
5374
|
-
(!h || typeof h == "string" && h.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][
|
|
5374
|
+
w.fields.forEach((d) => {
|
|
5375
|
+
if (d.required) {
|
|
5376
|
+
const h = c[w.key]?.[d.key];
|
|
5377
|
+
(!h || typeof h == "string" && h.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][d.key] = `${d.label} is required`);
|
|
5375
5378
|
}
|
|
5376
5379
|
});
|
|
5377
5380
|
else if (w.type === "datatable") {
|
|
5378
|
-
const
|
|
5379
|
-
Array.isArray(
|
|
5381
|
+
const d = c[w.key];
|
|
5382
|
+
Array.isArray(d) && d.forEach((h, x) => {
|
|
5380
5383
|
w.fields.forEach((F) => {
|
|
5381
5384
|
if (F.required) {
|
|
5382
|
-
const
|
|
5383
|
-
(!
|
|
5385
|
+
const z = h[F.key];
|
|
5386
|
+
(!z || typeof z == "string" && z.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][x] || (f[w.key][x] = {}), f[w.key][x][F.key] = `${F.label} is required`);
|
|
5384
5387
|
}
|
|
5385
5388
|
});
|
|
5386
5389
|
});
|
|
5387
5390
|
}
|
|
5388
5391
|
}), f;
|
|
5389
|
-
},
|
|
5390
|
-
const f =
|
|
5391
|
-
if (g(f),
|
|
5392
|
-
let
|
|
5392
|
+
}, V = (f) => Object.keys(f).length > 0, j = () => {
|
|
5393
|
+
const f = U();
|
|
5394
|
+
if (g(f), V(f)) {
|
|
5395
|
+
let d = [];
|
|
5393
5396
|
Object.keys(f).forEach((h) => {
|
|
5394
5397
|
typeof f[h] == "object" && Object.keys(f[h]).forEach((x) => {
|
|
5395
5398
|
typeof f[h][x] == "object" ? Object.keys(f[h][x]).forEach((F) => {
|
|
5396
|
-
|
|
5397
|
-
}) :
|
|
5399
|
+
d.push(`${h} row ${parseInt(x) + 1}: ${f[h][x][F]}`);
|
|
5400
|
+
}) : d.push(`${h}: ${f[h][x]}`);
|
|
5398
5401
|
});
|
|
5399
5402
|
});
|
|
5400
5403
|
return;
|
|
@@ -5402,35 +5405,35 @@ function Un({
|
|
|
5402
5405
|
(async () => {
|
|
5403
5406
|
try {
|
|
5404
5407
|
k(!0);
|
|
5405
|
-
const
|
|
5406
|
-
|
|
5408
|
+
const d = {};
|
|
5409
|
+
c && Object.keys(c).forEach((x) => {
|
|
5407
5410
|
const F = r?.configuration?.find(
|
|
5408
|
-
(
|
|
5411
|
+
(z) => z.key === x && z.type === "datatable"
|
|
5409
5412
|
);
|
|
5410
|
-
F && Array.isArray(
|
|
5411
|
-
const
|
|
5412
|
-
return F.fields && F.fields.forEach((
|
|
5413
|
-
if (
|
|
5413
|
+
F && Array.isArray(c[x]) ? d[x] = c[x].map((z) => {
|
|
5414
|
+
const q = { id: z.id || 0 };
|
|
5415
|
+
return F.fields && F.fields.forEach((D) => {
|
|
5416
|
+
if (D.fieldtype === "audience") {
|
|
5414
5417
|
let A = { users: [], groups: [], roles: [] };
|
|
5415
|
-
|
|
5416
|
-
users:
|
|
5417
|
-
groups:
|
|
5418
|
-
roles:
|
|
5419
|
-
}),
|
|
5418
|
+
z[D.key] && typeof z[D.key] == "object" && !Array.isArray(z[D.key]) && (A = {
|
|
5419
|
+
users: z[D.key].users || [],
|
|
5420
|
+
groups: z[D.key].groups || [],
|
|
5421
|
+
roles: z[D.key].roles || []
|
|
5422
|
+
}), q[D.key] = A;
|
|
5420
5423
|
} else
|
|
5421
|
-
|
|
5422
|
-
}),
|
|
5423
|
-
}) :
|
|
5424
|
+
q[D.key] = z[D.key] || "";
|
|
5425
|
+
}), q;
|
|
5426
|
+
}) : d[x] = c[x];
|
|
5424
5427
|
});
|
|
5425
|
-
let h = await Re(L,
|
|
5428
|
+
let h = await Re(L, d);
|
|
5426
5429
|
if (console.log(), h && h.status != "fail") {
|
|
5427
5430
|
g({});
|
|
5428
5431
|
const x = h.message || "Configuration has been saved successfully";
|
|
5429
|
-
ke.success(x), n && typeof n == "function" && n(
|
|
5432
|
+
ke.success(x), n && typeof n == "function" && n(c);
|
|
5430
5433
|
} else
|
|
5431
5434
|
throw ke.error(h?.message || "Failed to save configuration"), new Error("No response received from server");
|
|
5432
|
-
} catch (
|
|
5433
|
-
console.error("Error saving configuration:",
|
|
5435
|
+
} catch (d) {
|
|
5436
|
+
console.error("Error saving configuration:", d), ke.error(d?.message || "Failed to save configuration");
|
|
5434
5437
|
} finally {
|
|
5435
5438
|
k(!1);
|
|
5436
5439
|
}
|
|
@@ -5447,8 +5450,8 @@ function Un({
|
|
|
5447
5450
|
if (!u?.configuration && !r?.configuration)
|
|
5448
5451
|
return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-gray-500", children: "No configuration available" }) });
|
|
5449
5452
|
const p = r?.configuration || u?.configuration;
|
|
5450
|
-
return
|
|
5451
|
-
s && r ? (!
|
|
5453
|
+
return Q(() => {
|
|
5454
|
+
s && r ? (!c || Object.keys(c).length === 0) && E() : s && !r && E();
|
|
5452
5455
|
}, [s, r]), /* @__PURE__ */ l("div", { children: [
|
|
5453
5456
|
/* @__PURE__ */ l(
|
|
5454
5457
|
"div",
|
|
@@ -5458,14 +5461,14 @@ function Un({
|
|
|
5458
5461
|
children: [
|
|
5459
5462
|
b && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(qa, { size: "large" }) }),
|
|
5460
5463
|
!b && p?.map((f, w) => {
|
|
5461
|
-
const
|
|
5462
|
-
if (
|
|
5464
|
+
const d = Mn(f.type);
|
|
5465
|
+
if (d && d !== "UnknownType")
|
|
5463
5466
|
return /* @__PURE__ */ e(
|
|
5464
|
-
|
|
5467
|
+
d,
|
|
5465
5468
|
{
|
|
5466
5469
|
item: f,
|
|
5467
|
-
data:
|
|
5468
|
-
updateHandler:
|
|
5470
|
+
data: c,
|
|
5471
|
+
updateHandler: R,
|
|
5469
5472
|
validationErrors: m
|
|
5470
5473
|
},
|
|
5471
5474
|
w
|
|
@@ -5476,7 +5479,7 @@ function Un({
|
|
|
5476
5479
|
),
|
|
5477
5480
|
/* @__PURE__ */ l("div", { className: "w-full gap-5 bg-white flex justify-end py-3 px-7 rounded-t-md rounded-b-2xl border border-gray-300", style: { boxShadow: "0 -2px 10px 0 rgba(0, 0, 0, 0.20)", marginTop: "20px" }, children: [
|
|
5478
5481
|
/* @__PURE__ */ e(
|
|
5479
|
-
|
|
5482
|
+
Z,
|
|
5480
5483
|
{
|
|
5481
5484
|
category: "secondary",
|
|
5482
5485
|
onClick: v,
|
|
@@ -5485,10 +5488,10 @@ function Un({
|
|
|
5485
5488
|
}
|
|
5486
5489
|
),
|
|
5487
5490
|
/* @__PURE__ */ e(
|
|
5488
|
-
|
|
5491
|
+
Z,
|
|
5489
5492
|
{
|
|
5490
5493
|
category: "primary",
|
|
5491
|
-
onClick:
|
|
5494
|
+
onClick: j,
|
|
5492
5495
|
disabled: a,
|
|
5493
5496
|
label: a ? "Saving..." : "Apply",
|
|
5494
5497
|
type: "submit"
|
|
@@ -5502,7 +5505,7 @@ const ys = ({
|
|
|
5502
5505
|
appid: r = "Configuration-Page",
|
|
5503
5506
|
disableApi: s = !1
|
|
5504
5507
|
}) => {
|
|
5505
|
-
const [o, n] = B(0), [u, i] = B(!1), [
|
|
5508
|
+
const [o, n] = B(0), [u, i] = B(!1), [c, y] = B(r), {
|
|
5506
5509
|
pageHeader: b = {},
|
|
5507
5510
|
appletHeader: N = {},
|
|
5508
5511
|
breadcrumb: a = [],
|
|
@@ -5510,11 +5513,11 @@ const ys = ({
|
|
|
5510
5513
|
configuration: m = []
|
|
5511
5514
|
} = t, g = m.map((p) => {
|
|
5512
5515
|
if (p.type === "section" && p.fields) {
|
|
5513
|
-
const f = [...p.fields], w = f.findIndex((
|
|
5516
|
+
const f = [...p.fields], w = f.findIndex((d) => d.key === "appkey");
|
|
5514
5517
|
if (w !== -1) {
|
|
5515
|
-
const
|
|
5518
|
+
const d = f[w];
|
|
5516
5519
|
if (f[w] = {
|
|
5517
|
-
...
|
|
5520
|
+
...d,
|
|
5518
5521
|
default: r,
|
|
5519
5522
|
value: r,
|
|
5520
5523
|
disabled: !0,
|
|
@@ -5554,7 +5557,7 @@ const ys = ({
|
|
|
5554
5557
|
}, L = a.map((p) => ({
|
|
5555
5558
|
label: p.text,
|
|
5556
5559
|
href: p.href || "#"
|
|
5557
|
-
})),
|
|
5560
|
+
})), M = K(() => {
|
|
5558
5561
|
console.log("handleCancelRequest called - showing modal"), i(!0);
|
|
5559
5562
|
}, []), C = K((p) => {
|
|
5560
5563
|
i(!1), p.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
|
|
@@ -5570,18 +5573,18 @@ const ys = ({
|
|
|
5570
5573
|
ae.useEffect(() => {
|
|
5571
5574
|
y(T());
|
|
5572
5575
|
}, [g]);
|
|
5573
|
-
const
|
|
5576
|
+
const E = K((p) => {
|
|
5574
5577
|
console.log("Config saved with data:", p), Object.keys(p).forEach((f) => {
|
|
5575
5578
|
const w = p[f];
|
|
5576
5579
|
console.log(`Checking section ${f}:`, w), w && w.displayname && (console.log("Found displayname:", w.displayname), y(w.displayname));
|
|
5577
5580
|
});
|
|
5578
|
-
}, []),
|
|
5581
|
+
}, []), R = {
|
|
5579
5582
|
subHeading: "Application configuration and details",
|
|
5580
5583
|
tags: [],
|
|
5581
5584
|
...N,
|
|
5582
|
-
heading:
|
|
5585
|
+
heading: c
|
|
5583
5586
|
// Ensure displayname always overrides config heading
|
|
5584
|
-
},
|
|
5587
|
+
}, U = {
|
|
5585
5588
|
about: "This application provides comprehensive functionality for your organization.",
|
|
5586
5589
|
images: {
|
|
5587
5590
|
desktop: "https://via.placeholder.com/600x400?text=Desktop+View",
|
|
@@ -5599,11 +5602,11 @@ const ys = ({
|
|
|
5599
5602
|
}
|
|
5600
5603
|
],
|
|
5601
5604
|
...k
|
|
5602
|
-
},
|
|
5603
|
-
{ label: "Overview", content: v(
|
|
5604
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel:
|
|
5605
|
+
}, V = [
|
|
5606
|
+
{ label: "Overview", content: v(U) },
|
|
5607
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: M, onSave: E }) }
|
|
5605
5608
|
];
|
|
5606
|
-
function
|
|
5609
|
+
function j(p) {
|
|
5607
5610
|
return p ? p.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: p } }) : p : "📱";
|
|
5608
5611
|
}
|
|
5609
5612
|
function v(p) {
|
|
@@ -5660,11 +5663,11 @@ const ys = ({
|
|
|
5660
5663
|
}
|
|
5661
5664
|
),
|
|
5662
5665
|
/* @__PURE__ */ l("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
|
|
5663
|
-
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children:
|
|
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: j(R.icon) }),
|
|
5664
5667
|
/* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
|
|
5665
|
-
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children:
|
|
5666
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children:
|
|
5667
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children:
|
|
5668
|
+
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: R.heading }),
|
|
5669
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: R.subHeading }),
|
|
5670
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: R.tags && R.tags.map((p, f) => /* @__PURE__ */ e(
|
|
5668
5671
|
"span",
|
|
5669
5672
|
{
|
|
5670
5673
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
@@ -5675,7 +5678,7 @@ const ys = ({
|
|
|
5675
5678
|
] })
|
|
5676
5679
|
] }),
|
|
5677
5680
|
/* @__PURE__ */ l("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
|
|
5678
|
-
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children:
|
|
5681
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: V.map((p, f) => /* @__PURE__ */ e(
|
|
5679
5682
|
"button",
|
|
5680
5683
|
{
|
|
5681
5684
|
onClick: () => n(f),
|
|
@@ -5684,7 +5687,7 @@ const ys = ({
|
|
|
5684
5687
|
},
|
|
5685
5688
|
f
|
|
5686
5689
|
)) }) }),
|
|
5687
|
-
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children:
|
|
5690
|
+
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: V[o].content })
|
|
5688
5691
|
] }),
|
|
5689
5692
|
/* @__PURE__ */ e(
|
|
5690
5693
|
Zr,
|
|
@@ -5736,7 +5739,7 @@ const bs = ({
|
|
|
5736
5739
|
// preferred
|
|
5737
5740
|
onAdd: u,
|
|
5738
5741
|
onFilterOpen: i,
|
|
5739
|
-
addBtnText:
|
|
5742
|
+
addBtnText: c = "Add",
|
|
5740
5743
|
// Feature toggles
|
|
5741
5744
|
showSearch: y = !0,
|
|
5742
5745
|
showColumnChooser: b = !0,
|
|
@@ -5748,27 +5751,27 @@ const bs = ({
|
|
|
5748
5751
|
showAdd: $ = !1,
|
|
5749
5752
|
// Additional props
|
|
5750
5753
|
searchPlaceholder: L = "Search...",
|
|
5751
|
-
handleRefreshClick:
|
|
5754
|
+
handleRefreshClick: M = () => {
|
|
5752
5755
|
},
|
|
5753
5756
|
handleSearchChange: C = () => {
|
|
5754
5757
|
},
|
|
5755
5758
|
// Optional: override export file names
|
|
5756
5759
|
excelFileName: T,
|
|
5757
|
-
pdfFileName:
|
|
5760
|
+
pdfFileName: E
|
|
5758
5761
|
}) => {
|
|
5759
|
-
const
|
|
5762
|
+
const R = () => n?.current || o?.current, [U, V] = ae.useState(""), j = (t || "export").toString().trim() || "export", v = `${T || j}.xlsx`, p = `${E || j}.pdf`, f = (h, x, F) => Math.max(x, Math.min(h, F)), w = K(
|
|
5760
5763
|
(h) => {
|
|
5761
|
-
const x =
|
|
5764
|
+
const x = R();
|
|
5762
5765
|
if (console.log("openColumnChooserNear", x), !!x?.openColumnChooser) {
|
|
5763
5766
|
if (typeof window > "u" || !h?.currentTarget) {
|
|
5764
5767
|
x.openColumnChooser();
|
|
5765
5768
|
return;
|
|
5766
5769
|
}
|
|
5767
5770
|
try {
|
|
5768
|
-
const F = h.currentTarget.getBoundingClientRect(),
|
|
5769
|
-
let
|
|
5770
|
-
const
|
|
5771
|
-
|
|
5771
|
+
const F = h.currentTarget.getBoundingClientRect(), z = F.left + window.scrollX, q = F.bottom + window.scrollY;
|
|
5772
|
+
let D = z - 120, A = q - 120;
|
|
5773
|
+
const S = window.innerWidth, I = window.innerHeight;
|
|
5774
|
+
D = f(D, window.scrollX + 8, window.scrollX + S - 340), A = f(A, window.scrollY, window.scrollY + I - 120), console.log("openColumnChooserNear", D, A), x.openColumnChooser(D, A);
|
|
5772
5775
|
} catch (F) {
|
|
5773
5776
|
console.log("coloumn choose error", F);
|
|
5774
5777
|
}
|
|
@@ -5776,9 +5779,9 @@ const bs = ({
|
|
|
5776
5779
|
},
|
|
5777
5780
|
[]
|
|
5778
5781
|
// no external deps; reads ref at call time
|
|
5779
|
-
),
|
|
5782
|
+
), d = K(
|
|
5780
5783
|
(h, x) => {
|
|
5781
|
-
const F =
|
|
5784
|
+
const F = R();
|
|
5782
5785
|
if (F)
|
|
5783
5786
|
switch (h) {
|
|
5784
5787
|
case "ColumnChooser":
|
|
@@ -5794,11 +5797,11 @@ const bs = ({
|
|
|
5794
5797
|
m && F.pdfExport?.({ fileName: p });
|
|
5795
5798
|
break;
|
|
5796
5799
|
case "Refresh":
|
|
5797
|
-
g &&
|
|
5800
|
+
g && M();
|
|
5798
5801
|
break;
|
|
5799
5802
|
}
|
|
5800
5803
|
},
|
|
5801
|
-
[b, a, k, m, g, v, p,
|
|
5804
|
+
[b, a, k, m, g, v, p, M, w]
|
|
5802
5805
|
);
|
|
5803
5806
|
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: [
|
|
5804
5807
|
/* @__PURE__ */ l("div", { className: "flex flex-col", children: [
|
|
@@ -5814,19 +5817,19 @@ const bs = ({
|
|
|
5814
5817
|
he,
|
|
5815
5818
|
{
|
|
5816
5819
|
placeholder: L,
|
|
5817
|
-
value:
|
|
5820
|
+
value: U,
|
|
5818
5821
|
onDebouncedChange: (h) => {
|
|
5819
|
-
|
|
5822
|
+
V(h), C(h);
|
|
5820
5823
|
}
|
|
5821
5824
|
}
|
|
5822
5825
|
) }),
|
|
5823
5826
|
/* @__PURE__ */ l("div", { className: "flex gap-3", children: [
|
|
5824
5827
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
5825
5828
|
b && /* @__PURE__ */ e(
|
|
5826
|
-
|
|
5829
|
+
Z,
|
|
5827
5830
|
{
|
|
5828
5831
|
icon: Xt,
|
|
5829
|
-
onClick: (h) =>
|
|
5832
|
+
onClick: (h) => d("ColumnChooser", h),
|
|
5830
5833
|
size: "small",
|
|
5831
5834
|
ariaLabel: "Column Chooser",
|
|
5832
5835
|
category: "secondary",
|
|
@@ -5834,7 +5837,7 @@ const bs = ({
|
|
|
5834
5837
|
}
|
|
5835
5838
|
),
|
|
5836
5839
|
N && /* @__PURE__ */ e(
|
|
5837
|
-
|
|
5840
|
+
Z,
|
|
5838
5841
|
{
|
|
5839
5842
|
icon: Zt,
|
|
5840
5843
|
onClick: i,
|
|
@@ -5845,10 +5848,10 @@ const bs = ({
|
|
|
5845
5848
|
}
|
|
5846
5849
|
),
|
|
5847
5850
|
a && /* @__PURE__ */ e(
|
|
5848
|
-
|
|
5851
|
+
Z,
|
|
5849
5852
|
{
|
|
5850
5853
|
icon: Ht,
|
|
5851
|
-
onClick: () =>
|
|
5854
|
+
onClick: () => d("Print"),
|
|
5852
5855
|
ariaLabel: "Print",
|
|
5853
5856
|
size: "small",
|
|
5854
5857
|
category: "secondary",
|
|
@@ -5856,10 +5859,10 @@ const bs = ({
|
|
|
5856
5859
|
}
|
|
5857
5860
|
),
|
|
5858
5861
|
k && /* @__PURE__ */ e(
|
|
5859
|
-
|
|
5862
|
+
Z,
|
|
5860
5863
|
{
|
|
5861
5864
|
icon: Kt,
|
|
5862
|
-
onClick: () =>
|
|
5865
|
+
onClick: () => d("Excel"),
|
|
5863
5866
|
ariaLabel: "Excel Download",
|
|
5864
5867
|
size: "small",
|
|
5865
5868
|
category: "secondary",
|
|
@@ -5867,10 +5870,10 @@ const bs = ({
|
|
|
5867
5870
|
}
|
|
5868
5871
|
),
|
|
5869
5872
|
m && /* @__PURE__ */ e(
|
|
5870
|
-
|
|
5873
|
+
Z,
|
|
5871
5874
|
{
|
|
5872
5875
|
icon: er,
|
|
5873
|
-
onClick: () =>
|
|
5876
|
+
onClick: () => d("Pdf"),
|
|
5874
5877
|
ariaLabel: "PDF Download",
|
|
5875
5878
|
size: "small",
|
|
5876
5879
|
category: "secondary",
|
|
@@ -5878,10 +5881,10 @@ const bs = ({
|
|
|
5878
5881
|
}
|
|
5879
5882
|
),
|
|
5880
5883
|
g && /* @__PURE__ */ e(
|
|
5881
|
-
|
|
5884
|
+
Z,
|
|
5882
5885
|
{
|
|
5883
5886
|
icon: ar,
|
|
5884
|
-
onClick: () =>
|
|
5887
|
+
onClick: () => d("Refresh"),
|
|
5885
5888
|
ariaLabel: "Refresh",
|
|
5886
5889
|
size: "small",
|
|
5887
5890
|
category: "secondary",
|
|
@@ -5890,14 +5893,14 @@ const bs = ({
|
|
|
5890
5893
|
)
|
|
5891
5894
|
] }),
|
|
5892
5895
|
$ && u && /* @__PURE__ */ e(
|
|
5893
|
-
|
|
5896
|
+
Z,
|
|
5894
5897
|
{
|
|
5895
|
-
label:
|
|
5898
|
+
label: c,
|
|
5896
5899
|
icon: tr,
|
|
5897
5900
|
onClick: u,
|
|
5898
5901
|
size: "small",
|
|
5899
5902
|
ariaLabel: "Add New",
|
|
5900
|
-
title:
|
|
5903
|
+
title: c
|
|
5901
5904
|
}
|
|
5902
5905
|
)
|
|
5903
5906
|
] })
|
|
@@ -5914,7 +5917,7 @@ function vs(t) {
|
|
|
5914
5917
|
// pageSize = 10,
|
|
5915
5918
|
allowPaging: u = !0,
|
|
5916
5919
|
allowSorting: i = !0,
|
|
5917
|
-
allowFiltering:
|
|
5920
|
+
allowFiltering: c = !1,
|
|
5918
5921
|
allowGrouping: y = !1,
|
|
5919
5922
|
allowReordering: b = !0,
|
|
5920
5923
|
allowResizing: N = !0,
|
|
@@ -5924,59 +5927,59 @@ function vs(t) {
|
|
|
5924
5927
|
enableSearchApi: g = !1,
|
|
5925
5928
|
height: $ = "600",
|
|
5926
5929
|
selectionSettings: L = { type: "Multiple", mode: "Row" },
|
|
5927
|
-
enableCheckbox:
|
|
5930
|
+
enableCheckbox: M = !1,
|
|
5928
5931
|
columns: C = [],
|
|
5929
5932
|
onGridStateChange: T,
|
|
5930
|
-
onRowSelected:
|
|
5931
|
-
onRowDeselected:
|
|
5932
|
-
onRowDoubleClick:
|
|
5933
|
-
apiRef:
|
|
5934
|
-
gridProps:
|
|
5933
|
+
onRowSelected: E,
|
|
5934
|
+
onRowDeselected: R,
|
|
5935
|
+
onRowDoubleClick: U,
|
|
5936
|
+
apiRef: V,
|
|
5937
|
+
gridProps: j = {}
|
|
5935
5938
|
} = t, v = ue(null), {
|
|
5936
5939
|
pageSettings: p,
|
|
5937
5940
|
sortSettings: f,
|
|
5938
5941
|
...w
|
|
5939
|
-
} =
|
|
5942
|
+
} = j || {}, [d, h] = ae.useState(p?.page || 1), [x, F] = ae.useState(f?.pageSize || 20), [z, q] = ae.useState(f?.sortKey || "updatedDate"), [D, A] = ae.useState(f?.direction || "Descending"), S = ce(() => {
|
|
5940
5943
|
const P = [$r];
|
|
5941
|
-
return i && P.push(Fr),
|
|
5942
|
-
}, [i,
|
|
5943
|
-
const P = () => v.current, te = (
|
|
5944
|
-
!pe && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${
|
|
5944
|
+
return i && P.push(Fr), c && P.push(Tr), y && P.push(Ar), g && P.push(Er), a && P.push(Rr), k && P.push(Ir), m && P.push(zr), N && P.push(Pr), b && P.push(Br), P.push(Lr), P;
|
|
5945
|
+
}, [i, c, y, g, a, k, m, N, b]), I = ce(() => {
|
|
5946
|
+
const P = () => v.current, te = (_, pe) => {
|
|
5947
|
+
!pe && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${_} requested but related service/feature is disabled.`);
|
|
5945
5948
|
};
|
|
5946
5949
|
return {
|
|
5947
5950
|
getInstance: () => P(),
|
|
5948
5951
|
refresh: () => P()?.refresh?.(),
|
|
5949
5952
|
getSelectedRecords: () => P()?.getSelectedRecords?.() ?? [],
|
|
5950
5953
|
clearSelection: () => P()?.clearSelection?.(),
|
|
5951
|
-
selectRow: (
|
|
5952
|
-
selectRows: (
|
|
5953
|
-
search: (
|
|
5954
|
-
te("search()", g), P()?.search?.(
|
|
5954
|
+
selectRow: (_) => P()?.selectRow?.(_),
|
|
5955
|
+
selectRows: (_) => P()?.selectRows?.(_),
|
|
5956
|
+
search: (_) => {
|
|
5957
|
+
te("search()", g), P()?.search?.(_);
|
|
5955
5958
|
},
|
|
5956
5959
|
print: () => P()?.print?.(),
|
|
5957
|
-
excelExport: (
|
|
5958
|
-
te("excelExport()", a), P()?.excelExport?.(
|
|
5960
|
+
excelExport: (_) => {
|
|
5961
|
+
te("excelExport()", a), P()?.excelExport?.(_);
|
|
5959
5962
|
},
|
|
5960
|
-
pdfExport: (
|
|
5961
|
-
te("pdfExport()", k), P()?.pdfExport?.(
|
|
5963
|
+
pdfExport: (_) => {
|
|
5964
|
+
te("pdfExport()", k), P()?.pdfExport?.(_);
|
|
5962
5965
|
},
|
|
5963
|
-
openColumnChooser: (
|
|
5964
|
-
te("openColumnChooser()", m), P()?.columnChooserModule?.openColumnChooser?.(
|
|
5966
|
+
openColumnChooser: (_, pe) => {
|
|
5967
|
+
te("openColumnChooser()", m), P()?.columnChooserModule?.openColumnChooser?.(_, pe);
|
|
5965
5968
|
}
|
|
5966
5969
|
};
|
|
5967
5970
|
}, []);
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
}, [
|
|
5971
|
-
|
|
5971
|
+
Q(() => {
|
|
5972
|
+
V && (V.current = I);
|
|
5973
|
+
}, [V, I]), Q(() => () => {
|
|
5974
|
+
V && (V.current = null);
|
|
5972
5975
|
}, []);
|
|
5973
|
-
const
|
|
5976
|
+
const O = (P) => {
|
|
5974
5977
|
const te = String(P || "");
|
|
5975
5978
|
return te === "Ascending" || te === "Descending" ? te : te.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
5976
|
-
},
|
|
5977
|
-
const te = v.current,
|
|
5979
|
+
}, H = (P) => {
|
|
5980
|
+
const te = v.current, _ = P?.requestType, pe = _ === "paging" ? "paging" : _ === "sorting" ? "sorting" : _ === "searching" ? "searching" : _ === "filtering" ? "filtering" : _ === "grouping" ? "grouping" : _ === "reorder" ? "reorder" : _ === "columnstate" ? "columnstate" : "other", $e = P?.pageSize ?? te?.pageSettings?.pageSize ?? x, Ie = P?.currentPage ?? te?.pageSettings?.currentPage ?? n, Je = P?.columnName && P?.direction ? [{ field: P.columnName, dir: O(P.direction) }] : (te?.sortSettings?.columns || []).map((Fe) => ({
|
|
5978
5981
|
field: Fe.field,
|
|
5979
|
-
dir:
|
|
5982
|
+
dir: O(Fe.direction ?? Fe.dir)
|
|
5980
5983
|
})), Qe = P?.searchString ?? "", Xe = P?.columns ?? te?.filterSettings?.columns ?? [];
|
|
5981
5984
|
return {
|
|
5982
5985
|
reason: pe,
|
|
@@ -5990,12 +5993,12 @@ function vs(t) {
|
|
|
5990
5993
|
}, Ne = (P) => {
|
|
5991
5994
|
setTimeout(() => {
|
|
5992
5995
|
v?.current?.hideSpinner();
|
|
5993
|
-
}, 1e3), P.requestType === "paging" && (h(P.currentPage), F(P.pageSize)), P.requestType === "sorting" && (
|
|
5996
|
+
}, 1e3), P.requestType === "paging" && (h(P.currentPage), F(P.pageSize)), P.requestType === "sorting" && (q(P.columnName || "updatedDate"), A(P.direction === "Ascending" ? "ASC" : "DESC")), T && T(H(P), P);
|
|
5994
5997
|
}, ie = (P) => {
|
|
5995
|
-
typeof
|
|
5998
|
+
typeof U == "function" && U(P?.rowData, P);
|
|
5996
5999
|
}, xe = () => {
|
|
5997
6000
|
const P = [];
|
|
5998
|
-
return
|
|
6001
|
+
return M && P.push(/* @__PURE__ */ e(ia, { type: "checkbox", width: "50" }, "__checkbox__")), C.forEach((te, _) => {
|
|
5999
6002
|
const {
|
|
6000
6003
|
field: pe,
|
|
6001
6004
|
headerText: $e,
|
|
@@ -6035,7 +6038,7 @@ function vs(t) {
|
|
|
6035
6038
|
customAttributes: ct,
|
|
6036
6039
|
...dt
|
|
6037
6040
|
},
|
|
6038
|
-
pe || `col-${
|
|
6041
|
+
pe || `col-${_}`
|
|
6039
6042
|
)
|
|
6040
6043
|
);
|
|
6041
6044
|
}), P;
|
|
@@ -6052,7 +6055,7 @@ function vs(t) {
|
|
|
6052
6055
|
height: $,
|
|
6053
6056
|
allowPaging: u,
|
|
6054
6057
|
allowSorting: i,
|
|
6055
|
-
allowFiltering:
|
|
6058
|
+
allowFiltering: c,
|
|
6056
6059
|
allowGrouping: y,
|
|
6057
6060
|
allowReordering: b,
|
|
6058
6061
|
allowResizing: N,
|
|
@@ -6060,17 +6063,17 @@ function vs(t) {
|
|
|
6060
6063
|
selectionSettings: L,
|
|
6061
6064
|
pageSettings: { pageSize: 10, pageSizes: p?.pageSizes ?? [20, 40, 60, 80, 100] },
|
|
6062
6065
|
sortSettings: f ?? {
|
|
6063
|
-
columns: [{ field:
|
|
6066
|
+
columns: [{ field: z, direction: O(D) }],
|
|
6064
6067
|
allowUnsort: !1
|
|
6065
6068
|
},
|
|
6066
6069
|
actionBegin: Ne,
|
|
6067
|
-
rowSelected:
|
|
6068
|
-
rowDeselected:
|
|
6070
|
+
rowSelected: E,
|
|
6071
|
+
rowDeselected: R,
|
|
6069
6072
|
recordDoubleClick: ie,
|
|
6070
6073
|
...w,
|
|
6071
6074
|
children: [
|
|
6072
6075
|
/* @__PURE__ */ e(Mr, { children: xe() }),
|
|
6073
|
-
/* @__PURE__ */ e(Ur, { services:
|
|
6076
|
+
/* @__PURE__ */ e(Ur, { services: S })
|
|
6074
6077
|
]
|
|
6075
6078
|
}
|
|
6076
6079
|
);
|
|
@@ -6094,7 +6097,7 @@ export {
|
|
|
6094
6097
|
ys as FullConfigPage,
|
|
6095
6098
|
ns as FullScreenLoader,
|
|
6096
6099
|
as as GenericFilter,
|
|
6097
|
-
|
|
6100
|
+
W as Input,
|
|
6098
6101
|
et as ManageCollectionList,
|
|
6099
6102
|
Zr as Modal,
|
|
6100
6103
|
Ye as MultiSelect,
|
|
@@ -6112,7 +6115,7 @@ export {
|
|
|
6112
6115
|
Ga as ToggleSwitch,
|
|
6113
6116
|
ss as Tooltip,
|
|
6114
6117
|
ps as TreeView,
|
|
6115
|
-
|
|
6118
|
+
Z as UnifyedCoreButton,
|
|
6116
6119
|
ls as WizardModal,
|
|
6117
6120
|
Qa as adGroupsListSearchApi,
|
|
6118
6121
|
un as axiosDelete,
|