unifyedx-storybook-new 0.2.27 → 0.2.28
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 n, jsx as e, Fragment as te } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import se, { useState as M, useMemo as ue, useId as Qe, Fragment as Q, useEffect as Z, useCallback as ne, useRef as xe } from "react";
|
|
3
3
|
import { a as H, U as mt, X as ge, P as c, L as Ua, C as ve, b as tt, f as Ze, d as yt, D as Yt, F as qa, e as Ga, h as Ya, T as Ke, u as Wa, i as zt, I as Wt, j as Jt, k as Ja, l as Xa, m as Ha, n as Xt, S as vt, o as Ht, M as Qa, p as Za, q as wt, r as Ka, A as er, E as Qt, s as tr, t as ar, v as rr, w as nr, x as Zt, y as sr, z as Kt, B as ea, G as lr, H as ir, J as or, K as et, N as ut, O as ht, Q as cr, R as dr, V as ta, W as mr, Y as Nt, Z as ur, _ as hr, $ as Me, a0 as pr, a1 as gr, a2 as br, a3 as fr, a4 as xr, a5 as yr, a6 as St, a7 as vr, a8 as wr, a9 as Nr, aa as kr, ab as Cr, ac as zr, ad as Sr, ae as Dr, af as $r, ag as Fe, ah as aa, ai as Tr, aj as Ar, ak as Fr, al as Er, am as Rr, an as ra, ao as Ir, ap as Or, aq as na, ar as Pr, as as pt, at as sa, au as Lr } from "./vendor-wRQnjUYv.js";
|
|
4
|
-
import { Popover as Mr, PopoverButton as Br, PopoverPanel as jr, Transition as he, Dialog as ye, TransitionChild as Ne, DialogPanel as Ee, DialogTitle as at, TabGroup as Vr, TabList as _r, Tab as
|
|
4
|
+
import { Popover as Mr, PopoverButton as Br, PopoverPanel as jr, Transition as he, Dialog as ye, TransitionChild as Ne, DialogPanel as Ee, DialogTitle as at, TabGroup as Vr, TabList as _r, Tab as re, TabPanels as Ur, RadioGroup as qe, Listbox as K, ListboxButton as qr, ListboxOptions as Gr, ListboxOption as Yr, SwitchGroup as Wr, Switch as ot, Menu as Jr, MenuButton as Xr, Portal as Hr, MenuItems as Qr, MenuItem as Zr, DialogBackdrop as Kr } from "@headlessui/react";
|
|
5
5
|
import { motion as le, AnimatePresence as Ce } from "framer-motion";
|
|
6
6
|
import { d as en } from "./vendor-lodash-C6Pmit-j.js";
|
|
7
7
|
import { useFloating as la, offset as ia, flip as oa, shift as ca, autoUpdate as da, useClick as tn, useDismiss as an, useInteractions as rn, FloatingPortal as nn } from "@floating-ui/react";
|
|
@@ -15,8 +15,8 @@ const kn = (t) => {
|
|
|
15
15
|
a ^= t.charCodeAt(s), a += (a << 1) + (a << 4) + (a << 7) + (a << 8) + (a << 24);
|
|
16
16
|
return a >>> 0;
|
|
17
17
|
}, Cn = (t) => {
|
|
18
|
-
const a = (t ?? "").trim().toLowerCase(), s = parseInt((a.match(/\d+$/) ?? [0])[0], 10) || 0, i = kn(a), l = (i % 360 + 37 * s) % 360, m = 55 + (i >>> 8) % 20, o = 30 + (i >>> 16) % 10, u = 86 + (i >>> 24) % 8, p = `hsl(${l}, ${m}%, ${u}%)`,
|
|
19
|
-
return { bg: p, text:
|
|
18
|
+
const a = (t ?? "").trim().toLowerCase(), s = parseInt((a.match(/\d+$/) ?? [0])[0], 10) || 0, i = kn(a), l = (i % 360 + 37 * s) % 360, m = 55 + (i >>> 8) % 20, o = 30 + (i >>> 16) % 10, u = 86 + (i >>> 24) % 8, p = `hsl(${l}, ${m}%, ${u}%)`, g = `hsl(${l}, ${m}%, ${o}%)`;
|
|
19
|
+
return { bg: p, text: g };
|
|
20
20
|
}, zn = (t = "") => t.split(" ").map((a) => a[0]).slice(0, 2).join("").toUpperCase(), ze = ({
|
|
21
21
|
src: t,
|
|
22
22
|
name: a,
|
|
@@ -29,16 +29,16 @@ const kn = (t) => {
|
|
|
29
29
|
className: m,
|
|
30
30
|
...o
|
|
31
31
|
}) => {
|
|
32
|
-
const [u, p] =
|
|
32
|
+
const [u, p] = M(!1), g = ue(() => Cn(a), []), b = t && !u, r = !b && a, y = !b && !a, d = H(
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
m
|
|
36
|
-
), h =
|
|
36
|
+
), h = b ? "transparent" : i || g.bg, $ = l || g.text;
|
|
37
37
|
return /* @__PURE__ */ n("div", { className: d, style: {
|
|
38
38
|
backgroundColor: h,
|
|
39
|
-
color:
|
|
39
|
+
color: $
|
|
40
40
|
}, ...o, children: [
|
|
41
|
-
|
|
41
|
+
b && /* @__PURE__ */ e(
|
|
42
42
|
"img",
|
|
43
43
|
{
|
|
44
44
|
src: t,
|
|
@@ -48,10 +48,10 @@ const kn = (t) => {
|
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
50
|
r && /* @__PURE__ */ e("span", { className: "avatar-initials", "aria-label": a, children: zn(a) }),
|
|
51
|
-
|
|
51
|
+
y && /* @__PURE__ */ e("span", { className: "avatar-icon", children: /* @__PURE__ */ e(mt, {}) })
|
|
52
52
|
] });
|
|
53
53
|
}, Sn = ({ children: t, max: a = 4, truncatedMessage: s = "Members", ...i }) => {
|
|
54
|
-
const l =
|
|
54
|
+
const l = se.Children.toArray(t), m = l.slice(0, a), o = l.length - a;
|
|
55
55
|
return /* @__PURE__ */ n("div", { className: "avatar-group-container", ...i, children: [
|
|
56
56
|
m,
|
|
57
57
|
o > 0 && /* @__PURE__ */ n("div", { className: "avatar-container avatar--size-medium avatar-excess", children: [
|
|
@@ -74,14 +74,14 @@ const kn = (t) => {
|
|
|
74
74
|
className: u,
|
|
75
75
|
...p
|
|
76
76
|
}) => {
|
|
77
|
-
const
|
|
77
|
+
const g = H(
|
|
78
78
|
"badge",
|
|
79
79
|
`badge--variant-${a}`,
|
|
80
80
|
`badge--size-${s}`,
|
|
81
81
|
{ "badge--with-remove": !!l },
|
|
82
82
|
u
|
|
83
83
|
);
|
|
84
|
-
return /* @__PURE__ */ n("span", { className:
|
|
84
|
+
return /* @__PURE__ */ n("span", { className: g, style: m && o ? {
|
|
85
85
|
backgroundColor: m,
|
|
86
86
|
color: o,
|
|
87
87
|
borderColor: "#ff0000"
|
|
@@ -149,20 +149,20 @@ const $n = {
|
|
|
149
149
|
icon: u,
|
|
150
150
|
// Renamed for clarity, expecting a component type e.g., CheckCircle
|
|
151
151
|
disabled: p = !1,
|
|
152
|
-
size:
|
|
153
|
-
label:
|
|
152
|
+
size: g = "medium",
|
|
153
|
+
label: b,
|
|
154
154
|
children: r,
|
|
155
155
|
// ✅ Add children to the props list
|
|
156
|
-
onClick:
|
|
156
|
+
onClick: y,
|
|
157
157
|
...d
|
|
158
158
|
}) => {
|
|
159
|
-
const h = p || m,
|
|
159
|
+
const h = p || m, $ = u && !b, T = H(
|
|
160
160
|
"btn-base",
|
|
161
|
-
$n[
|
|
161
|
+
$n[g],
|
|
162
162
|
Tn[o],
|
|
163
163
|
{
|
|
164
164
|
"is-loading": m,
|
|
165
|
-
"btn-icon-only":
|
|
165
|
+
"btn-icon-only": $
|
|
166
166
|
},
|
|
167
167
|
l
|
|
168
168
|
);
|
|
@@ -171,15 +171,15 @@ const $n = {
|
|
|
171
171
|
{
|
|
172
172
|
"data-testid": t,
|
|
173
173
|
type: s,
|
|
174
|
-
className:
|
|
174
|
+
className: T,
|
|
175
175
|
disabled: h,
|
|
176
|
-
onClick:
|
|
177
|
-
title: a ||
|
|
178
|
-
"aria-label": i ||
|
|
176
|
+
onClick: y,
|
|
177
|
+
title: a || $ && i || (typeof b == "string" ? b : void 0),
|
|
178
|
+
"aria-label": i || $ && a || (typeof b == "string" ? b : void 0),
|
|
179
179
|
...d,
|
|
180
180
|
children: m ? /* @__PURE__ */ e(Ua, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(te, { children: [
|
|
181
|
-
u && /* @__PURE__ */ e(u, { size:
|
|
182
|
-
|
|
181
|
+
u && /* @__PURE__ */ e(u, { size: g === "large" ? 20 : 16 }),
|
|
182
|
+
b,
|
|
183
183
|
r,
|
|
184
184
|
" "
|
|
185
185
|
] })
|
|
@@ -218,13 +218,13 @@ const $n = {
|
|
|
218
218
|
onChange: o,
|
|
219
219
|
...u
|
|
220
220
|
}) => {
|
|
221
|
-
const p = Qe(),
|
|
221
|
+
const p = Qe(), g = a || p;
|
|
222
222
|
return /* @__PURE__ */ n("div", { className: `checkbox-container ${i || ""}`, children: [
|
|
223
|
-
/* @__PURE__ */ n("label", { htmlFor:
|
|
223
|
+
/* @__PURE__ */ n("label", { htmlFor: g, className: "checkbox-wrapper", children: [
|
|
224
224
|
/* @__PURE__ */ e(
|
|
225
225
|
"input",
|
|
226
226
|
{
|
|
227
|
-
id:
|
|
227
|
+
id: g,
|
|
228
228
|
type: "checkbox",
|
|
229
229
|
ref: l,
|
|
230
230
|
className: "checkbox-input",
|
|
@@ -259,8 +259,8 @@ const $n = {
|
|
|
259
259
|
className: u,
|
|
260
260
|
...p
|
|
261
261
|
}) => {
|
|
262
|
-
const
|
|
263
|
-
|
|
262
|
+
const g = (b) => {
|
|
263
|
+
b.stopPropagation(), b.preventDefault(), s?.();
|
|
264
264
|
};
|
|
265
265
|
return /* @__PURE__ */ n("div", { className: H("datepicker-wrapper", u), children: [
|
|
266
266
|
l && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: l }),
|
|
@@ -287,7 +287,7 @@ const $n = {
|
|
|
287
287
|
"button",
|
|
288
288
|
{
|
|
289
289
|
type: "button",
|
|
290
|
-
onClick:
|
|
290
|
+
onClick: g,
|
|
291
291
|
className: "datepicker-clear-button",
|
|
292
292
|
"aria-label": "Clear selected date",
|
|
293
293
|
children: /* @__PURE__ */ e(ge, { size: 16 })
|
|
@@ -319,12 +319,12 @@ const $n = {
|
|
|
319
319
|
className: u,
|
|
320
320
|
...p
|
|
321
321
|
}) => {
|
|
322
|
-
const
|
|
322
|
+
const g = t?.from, b = t?.to, r = (d) => {
|
|
323
323
|
d.stopPropagation(), d.preventDefault(), s?.();
|
|
324
|
-
},
|
|
325
|
-
Ze(
|
|
324
|
+
}, y = g && b ? /* @__PURE__ */ n(te, { children: [
|
|
325
|
+
Ze(g, "MMM d, y"),
|
|
326
326
|
" - ",
|
|
327
|
-
Ze(
|
|
327
|
+
Ze(b, "MMM d, y")
|
|
328
328
|
] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: i });
|
|
329
329
|
return /* @__PURE__ */ n("div", { className: H("datepicker-wrapper", u), children: [
|
|
330
330
|
l && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: l }),
|
|
@@ -340,14 +340,14 @@ const $n = {
|
|
|
340
340
|
"datepicker-trigger--disabled": o
|
|
341
341
|
}),
|
|
342
342
|
disabled: o,
|
|
343
|
-
"aria-label":
|
|
343
|
+
"aria-label": g && b ? `Selected range is ${y}` : i,
|
|
344
344
|
children: [
|
|
345
345
|
/* @__PURE__ */ e(yt, { className: "datepicker-icon" }),
|
|
346
|
-
/* @__PURE__ */ e("span", { className: "datepicker-value", children:
|
|
346
|
+
/* @__PURE__ */ e("span", { className: "datepicker-value", children: y })
|
|
347
347
|
]
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
|
-
|
|
350
|
+
g && s && !o && /* @__PURE__ */ e(
|
|
351
351
|
"button",
|
|
352
352
|
{
|
|
353
353
|
type: "button",
|
|
@@ -627,15 +627,15 @@ const $n = {
|
|
|
627
627
|
validFiles: o = [],
|
|
628
628
|
rejectedFiles: u = [],
|
|
629
629
|
handleRemoveValidFile: p,
|
|
630
|
-
handleRemoveRejectedFile:
|
|
631
|
-
handleSubmit:
|
|
630
|
+
handleRemoveRejectedFile: g,
|
|
631
|
+
handleSubmit: b,
|
|
632
632
|
isSubmitting: r,
|
|
633
|
-
formErrors:
|
|
633
|
+
formErrors: y,
|
|
634
634
|
// --- UI Text ---
|
|
635
635
|
title: d = "Upload Files",
|
|
636
636
|
subHeading: h = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
637
637
|
}) => {
|
|
638
|
-
const
|
|
638
|
+
const $ = o.length > 0 || u.length > 0;
|
|
639
639
|
return /* @__PURE__ */ e(he, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ n(
|
|
640
640
|
ye,
|
|
641
641
|
{
|
|
@@ -671,10 +671,10 @@ const $n = {
|
|
|
671
671
|
Ee,
|
|
672
672
|
{
|
|
673
673
|
className: "dialog-panel",
|
|
674
|
-
onClick: (
|
|
674
|
+
onClick: (T) => T.stopPropagation(),
|
|
675
675
|
children: [
|
|
676
676
|
/* @__PURE__ */ e("input", { ...i() }),
|
|
677
|
-
/* @__PURE__ */ n("form", { onSubmit:
|
|
677
|
+
/* @__PURE__ */ n("form", { onSubmit: b, className: "form-wrapper", children: [
|
|
678
678
|
/* @__PURE__ */ n("div", { className: "dialog-header", children: [
|
|
679
679
|
/* @__PURE__ */ e(at, { as: "h3", className: "dialog-title-text", children: d }),
|
|
680
680
|
/* @__PURE__ */ e(
|
|
@@ -710,11 +710,11 @@ const $n = {
|
|
|
710
710
|
]
|
|
711
711
|
}
|
|
712
712
|
),
|
|
713
|
-
|
|
714
|
-
|
|
713
|
+
y.filesToUpload && /* @__PURE__ */ e("p", { className: "form-error-message", children: y.filesToUpload.message }),
|
|
714
|
+
$ && /* @__PURE__ */ n("div", { className: "file-list-container", children: [
|
|
715
715
|
/* @__PURE__ */ e("h3", { children: "Upload Queue" }),
|
|
716
716
|
/* @__PURE__ */ n("ul", { className: "file-list", children: [
|
|
717
|
-
o.map((
|
|
717
|
+
o.map((T, F) => /* @__PURE__ */ n(
|
|
718
718
|
"li",
|
|
719
719
|
{
|
|
720
720
|
className: "file-item",
|
|
@@ -723,28 +723,28 @@ const $n = {
|
|
|
723
723
|
/* @__PURE__ */ e(
|
|
724
724
|
Tt,
|
|
725
725
|
{
|
|
726
|
-
extension:
|
|
726
|
+
extension: T.name.split(".").pop()
|
|
727
727
|
}
|
|
728
728
|
),
|
|
729
729
|
/* @__PURE__ */ n("div", { children: [
|
|
730
|
-
/* @__PURE__ */ e("p", { className: "file-item-name", children:
|
|
731
|
-
/* @__PURE__ */ e("p", { className: "file-item-size", children: At(
|
|
730
|
+
/* @__PURE__ */ e("p", { className: "file-item-name", children: T.name }),
|
|
731
|
+
/* @__PURE__ */ e("p", { className: "file-item-size", children: At(T.size) })
|
|
732
732
|
] })
|
|
733
733
|
] }),
|
|
734
734
|
/* @__PURE__ */ e(
|
|
735
735
|
"button",
|
|
736
736
|
{
|
|
737
737
|
type: "button",
|
|
738
|
-
onClick: () => p(
|
|
738
|
+
onClick: () => p(F),
|
|
739
739
|
className: "remove-file-button",
|
|
740
740
|
children: /* @__PURE__ */ e(Ke, { size: 16 })
|
|
741
741
|
}
|
|
742
742
|
)
|
|
743
743
|
]
|
|
744
744
|
},
|
|
745
|
-
`${
|
|
745
|
+
`${T.name}-${F}`
|
|
746
746
|
)),
|
|
747
|
-
u.map(({ file:
|
|
747
|
+
u.map(({ file: T, message: F }, A) => /* @__PURE__ */ n(
|
|
748
748
|
"li",
|
|
749
749
|
{
|
|
750
750
|
className: "file-item file-item--rejected",
|
|
@@ -753,27 +753,27 @@ const $n = {
|
|
|
753
753
|
/* @__PURE__ */ e(
|
|
754
754
|
Tt,
|
|
755
755
|
{
|
|
756
|
-
extension:
|
|
756
|
+
extension: T.name.split(".").pop()
|
|
757
757
|
}
|
|
758
758
|
),
|
|
759
759
|
/* @__PURE__ */ n("div", { children: [
|
|
760
|
-
/* @__PURE__ */ e("p", { className: "file-item-name", children:
|
|
761
|
-
/* @__PURE__ */ e("p", { className: "file-item-size", children: At(
|
|
762
|
-
/* @__PURE__ */ e("p", { className: "rejection-reason", children:
|
|
760
|
+
/* @__PURE__ */ e("p", { className: "file-item-name", children: T.name }),
|
|
761
|
+
/* @__PURE__ */ e("p", { className: "file-item-size", children: At(T.size) }),
|
|
762
|
+
/* @__PURE__ */ e("p", { className: "rejection-reason", children: F })
|
|
763
763
|
] })
|
|
764
764
|
] }),
|
|
765
765
|
/* @__PURE__ */ e(
|
|
766
766
|
"button",
|
|
767
767
|
{
|
|
768
768
|
type: "button",
|
|
769
|
-
onClick: () =>
|
|
769
|
+
onClick: () => g(A),
|
|
770
770
|
className: "remove-file-button",
|
|
771
771
|
children: /* @__PURE__ */ e(Ke, { size: 16 })
|
|
772
772
|
}
|
|
773
773
|
)
|
|
774
774
|
]
|
|
775
775
|
},
|
|
776
|
-
`${
|
|
776
|
+
`${T.name}-${A}`
|
|
777
777
|
))
|
|
778
778
|
] })
|
|
779
779
|
] })
|
|
@@ -858,75 +858,75 @@ const $n = {
|
|
|
858
858
|
fetchCreatedOrUpdatedByUsers: u = async () => []
|
|
859
859
|
// Mockable fetcher
|
|
860
860
|
}) => {
|
|
861
|
-
const [p,
|
|
861
|
+
const [p, g] = M({
|
|
862
862
|
createdBy: [],
|
|
863
863
|
updatedBy: []
|
|
864
|
-
}), [
|
|
864
|
+
}), [b, r] = M({
|
|
865
865
|
createdBy: !1,
|
|
866
866
|
updatedBy: !1
|
|
867
|
-
}), [
|
|
867
|
+
}), [y, d] = M({
|
|
868
868
|
startDate: null
|
|
869
|
-
}), [h,
|
|
869
|
+
}), [h, $] = M({
|
|
870
870
|
endDate: null
|
|
871
|
-
}),
|
|
871
|
+
}), T = Wa({
|
|
872
872
|
initialValues: JSON.parse(JSON.stringify(m)),
|
|
873
873
|
// Deep copy
|
|
874
|
-
onSubmit: (
|
|
875
|
-
const
|
|
876
|
-
Object.keys(
|
|
877
|
-
v
|
|
878
|
-
operator:
|
|
879
|
-
values: Array.isArray(
|
|
880
|
-
range:
|
|
874
|
+
onSubmit: (z) => {
|
|
875
|
+
const f = {};
|
|
876
|
+
Object.keys(z).forEach((v) => {
|
|
877
|
+
f[v] = {
|
|
878
|
+
operator: z[v].operator || "in",
|
|
879
|
+
values: Array.isArray(z[v].values) ? z[v].values : [],
|
|
880
|
+
range: z[v].range || null
|
|
881
881
|
};
|
|
882
|
-
}), console.log("[storybook filter] Applied Filters:",
|
|
883
|
-
filters:
|
|
884
|
-
activeCount:
|
|
882
|
+
}), console.log("[storybook filter] Applied Filters:", f), typeof s == "function" && s({
|
|
883
|
+
filters: f,
|
|
884
|
+
activeCount: A
|
|
885
885
|
}), a();
|
|
886
886
|
},
|
|
887
887
|
enableReinitialize: !0
|
|
888
|
-
}),
|
|
889
|
-
const
|
|
888
|
+
}), F = ue(() => l.reduce((z, f) => {
|
|
889
|
+
const v = f.key, w = T.values[v];
|
|
890
890
|
let C = !1;
|
|
891
|
-
if (
|
|
892
|
-
switch (
|
|
891
|
+
if (w)
|
|
892
|
+
switch (f.type) {
|
|
893
893
|
case "multiselect":
|
|
894
894
|
case "multiselect-users":
|
|
895
|
-
C = Array.isArray(
|
|
895
|
+
C = Array.isArray(w.values) && w.values.length > 0;
|
|
896
896
|
break;
|
|
897
897
|
case "date":
|
|
898
|
-
(
|
|
898
|
+
(w.range && w.range !== "" || Array.isArray(w.values) && w.values.length > 0) && (C = !0);
|
|
899
899
|
break;
|
|
900
900
|
}
|
|
901
|
-
return
|
|
902
|
-
}, {}), [l,
|
|
903
|
-
if (
|
|
904
|
-
const
|
|
905
|
-
if (!Array.isArray(
|
|
906
|
-
const [
|
|
907
|
-
if (!
|
|
908
|
-
const C =
|
|
901
|
+
return z[v] = C, z;
|
|
902
|
+
}, {}), [l, T.values]), A = Object.values(F).filter(Boolean).length, I = ue(() => l.some((z) => {
|
|
903
|
+
if (z.type !== "date") return !1;
|
|
904
|
+
const f = T.values?.[z.key]?.values;
|
|
905
|
+
if (!Array.isArray(f) || f.length < 2) return !1;
|
|
906
|
+
const [v, w] = f;
|
|
907
|
+
if (!v || !w) return !1;
|
|
908
|
+
const C = v instanceof Date ? v : new Date(v), N = w instanceof Date ? w : new Date(w);
|
|
909
909
|
return C > N;
|
|
910
|
-
}), [l,
|
|
910
|
+
}), [l, T.values]), V = async (z, f) => {
|
|
911
911
|
try {
|
|
912
|
-
r((
|
|
913
|
-
const
|
|
914
|
-
|
|
915
|
-
} catch (
|
|
916
|
-
console.error(`Error fetching ${
|
|
912
|
+
r((w) => ({ ...w, [z]: !0 }));
|
|
913
|
+
const v = await u(z, f);
|
|
914
|
+
g((w) => ({ ...w, [z]: v }));
|
|
915
|
+
} catch (v) {
|
|
916
|
+
console.error(`Error fetching ${z} users:`, v);
|
|
917
917
|
} finally {
|
|
918
|
-
r((
|
|
918
|
+
r((v) => ({ ...v, [z]: !1 }));
|
|
919
919
|
}
|
|
920
|
-
},
|
|
921
|
-
const
|
|
922
|
-
l[
|
|
920
|
+
}, U = (z) => {
|
|
921
|
+
const f = l[z].key, v = l[z].url;
|
|
922
|
+
l[z].type === "multiselect-users" && p[f].length === 0 && !b[f] && V(f, v);
|
|
923
923
|
}, G = () => {
|
|
924
|
-
|
|
925
|
-
},
|
|
926
|
-
const
|
|
927
|
-
if (!
|
|
928
|
-
const
|
|
929
|
-
switch (
|
|
924
|
+
T.resetForm(), g({ createdBy: [], updatedBy: [] }), i();
|
|
925
|
+
}, B = (z) => {
|
|
926
|
+
const f = l.find((C) => C.key === z);
|
|
927
|
+
if (!f) return null;
|
|
928
|
+
const v = T.values[z] || m[z], w = Array.isArray(v.values) ? v.values : [];
|
|
929
|
+
switch (f.type) {
|
|
930
930
|
case "multiselect":
|
|
931
931
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
932
932
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
@@ -934,10 +934,10 @@ const $n = {
|
|
|
934
934
|
/* @__PURE__ */ e(
|
|
935
935
|
"select",
|
|
936
936
|
{
|
|
937
|
-
value:
|
|
938
|
-
onChange: (R) =>
|
|
937
|
+
value: v.operator || "in",
|
|
938
|
+
onChange: (R) => T.setFieldValue(`${z}.operator`, R.target.value),
|
|
939
939
|
className: "filter-select",
|
|
940
|
-
children:
|
|
940
|
+
children: f.operators.map((R) => /* @__PURE__ */ e("option", { value: R, children: R === "in" ? "Includes" : "Excludes" }, R))
|
|
941
941
|
}
|
|
942
942
|
)
|
|
943
943
|
] }),
|
|
@@ -947,42 +947,42 @@ const $n = {
|
|
|
947
947
|
"input",
|
|
948
948
|
{
|
|
949
949
|
type: "checkbox",
|
|
950
|
-
id: `select-all-${
|
|
950
|
+
id: `select-all-${z}`,
|
|
951
951
|
className: "filter-checkbox-input",
|
|
952
|
-
checked:
|
|
952
|
+
checked: f.options.length > 0 && w.length === f.options.length,
|
|
953
953
|
onChange: (R) => {
|
|
954
|
-
const Y = R.target.checked ?
|
|
955
|
-
|
|
954
|
+
const Y = R.target.checked ? f.options.map((W) => W.value) : [];
|
|
955
|
+
T.setFieldValue(`${z}.values`, Y);
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
958
|
),
|
|
959
959
|
/* @__PURE__ */ e(
|
|
960
960
|
"label",
|
|
961
961
|
{
|
|
962
|
-
htmlFor: `select-all-${
|
|
962
|
+
htmlFor: `select-all-${z}`,
|
|
963
963
|
className: "filter-checkbox-label",
|
|
964
964
|
children: "Select All"
|
|
965
965
|
}
|
|
966
966
|
)
|
|
967
967
|
] }),
|
|
968
|
-
|
|
968
|
+
f.options.map((R) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
|
|
969
969
|
/* @__PURE__ */ e(
|
|
970
970
|
"input",
|
|
971
971
|
{
|
|
972
972
|
type: "checkbox",
|
|
973
|
-
id: `${
|
|
973
|
+
id: `${z}-${R.value}`,
|
|
974
974
|
className: "filter-checkbox-input",
|
|
975
|
-
checked:
|
|
975
|
+
checked: w.includes(R.value),
|
|
976
976
|
onChange: (Y) => {
|
|
977
|
-
const W = Y.target.checked ? [...
|
|
978
|
-
|
|
977
|
+
const W = Y.target.checked ? [...w, R.value] : w.filter((pe) => pe !== R.value);
|
|
978
|
+
T.setFieldValue(`${z}.values`, W);
|
|
979
979
|
}
|
|
980
980
|
}
|
|
981
981
|
),
|
|
982
982
|
/* @__PURE__ */ e(
|
|
983
983
|
"label",
|
|
984
984
|
{
|
|
985
|
-
htmlFor: `${
|
|
985
|
+
htmlFor: `${z}-${R.value}`,
|
|
986
986
|
className: "filter-checkbox-label",
|
|
987
987
|
children: R.label
|
|
988
988
|
}
|
|
@@ -991,17 +991,17 @@ const $n = {
|
|
|
991
991
|
] })
|
|
992
992
|
] });
|
|
993
993
|
case "multiselect-users":
|
|
994
|
-
const C = p[
|
|
994
|
+
const C = p[z] || [], N = b[z];
|
|
995
995
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
996
996
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
997
997
|
/* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
|
|
998
998
|
/* @__PURE__ */ e(
|
|
999
999
|
"select",
|
|
1000
1000
|
{
|
|
1001
|
-
value:
|
|
1002
|
-
onChange: (R) =>
|
|
1001
|
+
value: v.operator || "in",
|
|
1002
|
+
onChange: (R) => T.setFieldValue(`${z}.operator`, R.target.value),
|
|
1003
1003
|
className: "filter-select",
|
|
1004
|
-
children:
|
|
1004
|
+
children: f.operators.map((R) => /* @__PURE__ */ e("option", { value: R, children: R === "in" ? "Includes" : "Excludes" }, R))
|
|
1005
1005
|
}
|
|
1006
1006
|
)
|
|
1007
1007
|
] }),
|
|
@@ -1011,13 +1011,13 @@ const $n = {
|
|
|
1011
1011
|
"input",
|
|
1012
1012
|
{
|
|
1013
1013
|
type: "checkbox",
|
|
1014
|
-
id: `select-all-users-${
|
|
1014
|
+
id: `select-all-users-${z}`,
|
|
1015
1015
|
className: "filter-checkbox-input",
|
|
1016
|
-
checked: C.length > 0 &&
|
|
1016
|
+
checked: C.length > 0 && w.length === C.length,
|
|
1017
1017
|
onChange: (R) => {
|
|
1018
1018
|
const Y = R.target.checked ? C.map((W) => W.email) : [];
|
|
1019
|
-
|
|
1020
|
-
`${
|
|
1019
|
+
T.setFieldValue(
|
|
1020
|
+
`${z}.values`,
|
|
1021
1021
|
Y
|
|
1022
1022
|
);
|
|
1023
1023
|
}
|
|
@@ -1026,7 +1026,7 @@ const $n = {
|
|
|
1026
1026
|
/* @__PURE__ */ e(
|
|
1027
1027
|
"label",
|
|
1028
1028
|
{
|
|
1029
|
-
htmlFor: `select-all-users-${
|
|
1029
|
+
htmlFor: `select-all-users-${z}`,
|
|
1030
1030
|
className: "filter-checkbox-label",
|
|
1031
1031
|
children: "Select All Users"
|
|
1032
1032
|
}
|
|
@@ -1037,13 +1037,13 @@ const $n = {
|
|
|
1037
1037
|
"input",
|
|
1038
1038
|
{
|
|
1039
1039
|
type: "checkbox",
|
|
1040
|
-
id: `${
|
|
1040
|
+
id: `${z}-${R.email}`,
|
|
1041
1041
|
className: "filter-checkbox-input",
|
|
1042
|
-
checked:
|
|
1042
|
+
checked: w.includes(R.email),
|
|
1043
1043
|
onChange: (Y) => {
|
|
1044
|
-
const W = Y.target.checked ? [...
|
|
1045
|
-
|
|
1046
|
-
`${
|
|
1044
|
+
const W = Y.target.checked ? [...w, R.email] : w.filter((pe) => pe !== R.email);
|
|
1045
|
+
T.setFieldValue(
|
|
1046
|
+
`${z}.values`,
|
|
1047
1047
|
W
|
|
1048
1048
|
);
|
|
1049
1049
|
}
|
|
@@ -1052,7 +1052,7 @@ const $n = {
|
|
|
1052
1052
|
/* @__PURE__ */ n(
|
|
1053
1053
|
"label",
|
|
1054
1054
|
{
|
|
1055
|
-
htmlFor: `${
|
|
1055
|
+
htmlFor: `${z}-${R.email}`,
|
|
1056
1056
|
className: "filter-checkbox-label",
|
|
1057
1057
|
children: [
|
|
1058
1058
|
/* @__PURE__ */ e("span", { className: "user-label-name", children: R.name }),
|
|
@@ -1064,9 +1064,9 @@ const $n = {
|
|
|
1064
1064
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1065
1065
|
] });
|
|
1066
1066
|
case "date":
|
|
1067
|
-
const
|
|
1068
|
-
startDate:
|
|
1069
|
-
endDate:
|
|
1067
|
+
const x = v.values || [], [k, E] = x, L = k && E, q = x[0] || null, S = x[1] || null, O = {
|
|
1068
|
+
startDate: q instanceof Date ? q.toISOString().slice(0, 10) : null,
|
|
1069
|
+
endDate: q instanceof Date ? q.toISOString().slice(0, 10) : null
|
|
1070
1070
|
}, D = {
|
|
1071
1071
|
startDate: S instanceof Date ? S.toISOString().slice(0, 10) : null,
|
|
1072
1072
|
endDate: S instanceof Date ? S.toISOString().slice(0, 10) : null
|
|
@@ -1080,15 +1080,15 @@ const $n = {
|
|
|
1080
1080
|
{ key: "custom", label: "Custom" }
|
|
1081
1081
|
], _ = (R) => {
|
|
1082
1082
|
if (R === "anytime") {
|
|
1083
|
-
|
|
1083
|
+
T.setFieldValue(`${z}.values`, []), T.setFieldValue(`${z}.range`, "anytime");
|
|
1084
1084
|
return;
|
|
1085
1085
|
}
|
|
1086
1086
|
if (R === "custom") {
|
|
1087
|
-
|
|
1087
|
+
T.setFieldValue(`${z}.range`, "custom");
|
|
1088
1088
|
return;
|
|
1089
1089
|
}
|
|
1090
1090
|
const [Y, W] = On(R);
|
|
1091
|
-
|
|
1091
|
+
T.setFieldValue(`${z}.values`, Y && W ? [Y, W] : []), T.setFieldValue(`${z}.range`, R);
|
|
1092
1092
|
};
|
|
1093
1093
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
1094
1094
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
@@ -1096,20 +1096,20 @@ const $n = {
|
|
|
1096
1096
|
/* @__PURE__ */ e(
|
|
1097
1097
|
"select",
|
|
1098
1098
|
{
|
|
1099
|
-
value:
|
|
1100
|
-
onChange: (R) =>
|
|
1099
|
+
value: v.operator,
|
|
1100
|
+
onChange: (R) => T.setFieldValue(`${z}.operator`, R.target.value),
|
|
1101
1101
|
className: "filter-select",
|
|
1102
|
-
children:
|
|
1102
|
+
children: f.operators.map((R) => /* @__PURE__ */ e("option", { value: R, children: R === "in" ? "Is" : "Is not" }, R))
|
|
1103
1103
|
}
|
|
1104
1104
|
),
|
|
1105
|
-
|
|
1105
|
+
L && /* @__PURE__ */ e(
|
|
1106
1106
|
"button",
|
|
1107
1107
|
{
|
|
1108
1108
|
type: "button",
|
|
1109
1109
|
onClick: () => {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
m[
|
|
1110
|
+
T.setFieldValue(
|
|
1111
|
+
z,
|
|
1112
|
+
m[z]
|
|
1113
1113
|
);
|
|
1114
1114
|
},
|
|
1115
1115
|
className: "filter-clear-selection-button",
|
|
@@ -1118,7 +1118,7 @@ const $n = {
|
|
|
1118
1118
|
)
|
|
1119
1119
|
] }),
|
|
1120
1120
|
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: P.map((R) => {
|
|
1121
|
-
const Y =
|
|
1121
|
+
const Y = v.range === R.key || R.key === "anytime" && (!Array.isArray(v.values) || v.values.length === 0);
|
|
1122
1122
|
return /* @__PURE__ */ n(
|
|
1123
1123
|
"label",
|
|
1124
1124
|
{
|
|
@@ -1128,7 +1128,7 @@ const $n = {
|
|
|
1128
1128
|
"input",
|
|
1129
1129
|
{
|
|
1130
1130
|
type: "radio",
|
|
1131
|
-
name: `preset-${
|
|
1131
|
+
name: `preset-${z}`,
|
|
1132
1132
|
checked: Y,
|
|
1133
1133
|
onChange: () => _(R.key),
|
|
1134
1134
|
className: "h-4 w-4"
|
|
@@ -1152,8 +1152,8 @@ const $n = {
|
|
|
1152
1152
|
useRange: !1,
|
|
1153
1153
|
value: O,
|
|
1154
1154
|
onChange: (R) => {
|
|
1155
|
-
const Y = R?.startDate ? Be(new Date(R.startDate)) : null, W =
|
|
1156
|
-
Y && (
|
|
1155
|
+
const Y = R?.startDate ? Be(new Date(R.startDate)) : null, W = x[1] || null;
|
|
1156
|
+
Y && (T.setFieldValue(`${z}.values`, [Y, W]), T.setFieldValue(`${z}.range`, "custom"));
|
|
1157
1157
|
},
|
|
1158
1158
|
inputClassName: "w-full rounded-xl border border-[#767676] px-4 py-2 text-sm font-normal text-[#101112] focus:border-violet-500 focus:outline-none focus:ring-1 focus:ring-violet-500",
|
|
1159
1159
|
primaryColor: "violet",
|
|
@@ -1176,8 +1176,8 @@ const $n = {
|
|
|
1176
1176
|
useRange: !1,
|
|
1177
1177
|
value: D,
|
|
1178
1178
|
onChange: (R) => {
|
|
1179
|
-
const Y = R?.startDate ? je(new Date(R.startDate)) : null, W =
|
|
1180
|
-
Y && (
|
|
1179
|
+
const Y = R?.startDate ? je(new Date(R.startDate)) : null, W = x[0] || null;
|
|
1180
|
+
Y && (T.setFieldValue(`${z}.values`, [W, Y]), T.setFieldValue(`${z}.range`, "custom"));
|
|
1181
1181
|
},
|
|
1182
1182
|
inputClassName: "w-full rounded-xl border border-[#767676] px-4 py-2 text-sm font-normal text-[#101112] focus:border-violet-500 focus:outline-none focus:ring-1 focus:ring-violet-500",
|
|
1183
1183
|
primaryColor: "violet",
|
|
@@ -1190,7 +1190,7 @@ const $n = {
|
|
|
1190
1190
|
}
|
|
1191
1191
|
)
|
|
1192
1192
|
] }),
|
|
1193
|
-
|
|
1193
|
+
q && S && q > S && /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-2", children: "End date must be after start date" })
|
|
1194
1194
|
] })
|
|
1195
1195
|
] });
|
|
1196
1196
|
default:
|
|
@@ -1234,22 +1234,22 @@ const $n = {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
)
|
|
1236
1236
|
] }),
|
|
1237
|
-
/* @__PURE__ */ n("form", { onSubmit:
|
|
1237
|
+
/* @__PURE__ */ n("form", { onSubmit: T.handleSubmit, className: "filter-form", children: [
|
|
1238
1238
|
/* @__PURE__ */ e("div", { className: "filter-content-wrapper", children: /* @__PURE__ */ n(
|
|
1239
1239
|
Vr,
|
|
1240
1240
|
{
|
|
1241
1241
|
vertical: !0,
|
|
1242
|
-
onChange:
|
|
1242
|
+
onChange: U,
|
|
1243
1243
|
style: {
|
|
1244
1244
|
display: "flex",
|
|
1245
1245
|
flexGrow: 1
|
|
1246
1246
|
},
|
|
1247
1247
|
children: [
|
|
1248
|
-
/* @__PURE__ */ e(_r, { className: "filter-tabs-list", children: l.map((
|
|
1248
|
+
/* @__PURE__ */ e(_r, { className: "filter-tabs-list", children: l.map((z) => /* @__PURE__ */ n(re, { className: "filter-tab-item", children: [
|
|
1249
1249
|
/* @__PURE__ */ e("div", { className: "filter-selection-horizontal-indicator" }),
|
|
1250
1250
|
/* @__PURE__ */ n("div", { className: "filter-lbl-indicator-wrapper", children: [
|
|
1251
|
-
|
|
1252
|
-
|
|
1251
|
+
z.label,
|
|
1252
|
+
F[z.key] && /* @__PURE__ */ e(
|
|
1253
1253
|
"span",
|
|
1254
1254
|
{
|
|
1255
1255
|
className: "filter-active-indicator",
|
|
@@ -1257,9 +1257,9 @@ const $n = {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
)
|
|
1259
1259
|
] })
|
|
1260
|
-
] },
|
|
1261
|
-
/* @__PURE__ */ e(Ur, { className: "filter-tabs-panels", children: l.map((
|
|
1262
|
-
|
|
1260
|
+
] }, z.key)) }),
|
|
1261
|
+
/* @__PURE__ */ e(Ur, { className: "filter-tabs-panels", children: l.map((z) => /* @__PURE__ */ e(
|
|
1262
|
+
re.Panel,
|
|
1263
1263
|
{
|
|
1264
1264
|
className: "filter-tab-panel",
|
|
1265
1265
|
children: /* @__PURE__ */ e(
|
|
@@ -1269,12 +1269,12 @@ const $n = {
|
|
|
1269
1269
|
animate: { opacity: 1, x: 0 },
|
|
1270
1270
|
transition: { duration: 0.3 },
|
|
1271
1271
|
className: "h-full",
|
|
1272
|
-
children:
|
|
1272
|
+
children: B(z.key)
|
|
1273
1273
|
},
|
|
1274
|
-
|
|
1274
|
+
z.key
|
|
1275
1275
|
)
|
|
1276
1276
|
},
|
|
1277
|
-
|
|
1277
|
+
z.key
|
|
1278
1278
|
)) })
|
|
1279
1279
|
]
|
|
1280
1280
|
}
|
|
@@ -1293,12 +1293,12 @@ const $n = {
|
|
|
1293
1293
|
"button",
|
|
1294
1294
|
{
|
|
1295
1295
|
type: "submit",
|
|
1296
|
-
disabled:
|
|
1296
|
+
disabled: !T.dirty || I,
|
|
1297
1297
|
className: "filter-button apply",
|
|
1298
1298
|
children: [
|
|
1299
1299
|
"Apply Filters",
|
|
1300
1300
|
" ",
|
|
1301
|
-
|
|
1301
|
+
A > 0 ? `(${A})` : ""
|
|
1302
1302
|
]
|
|
1303
1303
|
}
|
|
1304
1304
|
)
|
|
@@ -1372,10 +1372,10 @@ const $n = {
|
|
|
1372
1372
|
// 'info', 'warning', 'delete'
|
|
1373
1373
|
loading: u = !1,
|
|
1374
1374
|
buttonProps: p = {},
|
|
1375
|
-
size:
|
|
1375
|
+
size: g
|
|
1376
1376
|
// Add size prop
|
|
1377
1377
|
}) => {
|
|
1378
|
-
const
|
|
1378
|
+
const b = Rt[o] || Rt.info, r = b.icon, y = () => {
|
|
1379
1379
|
a({ primary: !0, secondary: !1 });
|
|
1380
1380
|
}, d = () => {
|
|
1381
1381
|
a({ primary: !1, secondary: !0 });
|
|
@@ -1404,9 +1404,9 @@ const $n = {
|
|
|
1404
1404
|
leave: "ease-in duration-200",
|
|
1405
1405
|
leaveFrom: "opacity-100 scale-100",
|
|
1406
1406
|
leaveTo: "opacity-0 scale-95",
|
|
1407
|
-
children: /* @__PURE__ */ n(Ee, { className:
|
|
1407
|
+
children: /* @__PURE__ */ n(Ee, { className: g === "large" ? "modal-panel modal-panel--large" : "modal-panel", children: [
|
|
1408
1408
|
/* @__PURE__ */ n("div", { className: "modal-content-wrapper", children: [
|
|
1409
|
-
/* @__PURE__ */ e("div", { className: `modal-icon-container ${
|
|
1409
|
+
/* @__PURE__ */ e("div", { className: `modal-icon-container ${b.iconClass}`, children: /* @__PURE__ */ e(r, { size: 24, "aria-hidden": "true" }) }),
|
|
1410
1410
|
/* @__PURE__ */ n("div", { className: "modal-text-content", children: [
|
|
1411
1411
|
/* @__PURE__ */ e(at, { as: "h3", className: "modal-title", children: s }),
|
|
1412
1412
|
/* @__PURE__ */ e("div", { className: "modal-description", children: i })
|
|
@@ -1424,7 +1424,7 @@ const $n = {
|
|
|
1424
1424
|
l && /* @__PURE__ */ e(
|
|
1425
1425
|
ee,
|
|
1426
1426
|
{
|
|
1427
|
-
onClick:
|
|
1427
|
+
onClick: y,
|
|
1428
1428
|
label: l,
|
|
1429
1429
|
...p
|
|
1430
1430
|
}
|
|
@@ -1442,12 +1442,12 @@ const $n = {
|
|
|
1442
1442
|
onItemsPerPageChange: l,
|
|
1443
1443
|
itemsPerPageOptions: m = [10, 15, 20]
|
|
1444
1444
|
}) => {
|
|
1445
|
-
const o = Math.ceil(a / s), [u, p] =
|
|
1445
|
+
const o = Math.ceil(a / s), [u, p] = M(t);
|
|
1446
1446
|
Z(() => {
|
|
1447
1447
|
p(t);
|
|
1448
1448
|
}, [t]);
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1449
|
+
const g = Math.min((t - 1) * s + 1, a), b = Math.min(t * s, a), r = (y) => {
|
|
1450
|
+
y.preventDefault();
|
|
1451
1451
|
let d = parseInt(u, 10);
|
|
1452
1452
|
isNaN(d) || d < 1 ? d = 1 : d > o && (d = o), p(d), d !== t && i(d);
|
|
1453
1453
|
};
|
|
@@ -1460,14 +1460,14 @@ const $n = {
|
|
|
1460
1460
|
id: "items-per-page",
|
|
1461
1461
|
className: "pagination-select",
|
|
1462
1462
|
value: s,
|
|
1463
|
-
onChange: (
|
|
1464
|
-
children: m.map((
|
|
1463
|
+
onChange: (y) => l(Number(y.target.value)),
|
|
1464
|
+
children: m.map((y) => /* @__PURE__ */ e("option", { value: y, children: y }, y))
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
1467
|
/* @__PURE__ */ n("span", { className: "pagination-info", children: [
|
|
1468
|
-
|
|
1468
|
+
g,
|
|
1469
1469
|
"-",
|
|
1470
|
-
|
|
1470
|
+
b,
|
|
1471
1471
|
" of ",
|
|
1472
1472
|
a,
|
|
1473
1473
|
" items"
|
|
@@ -1500,7 +1500,7 @@ const $n = {
|
|
|
1500
1500
|
type: "number",
|
|
1501
1501
|
className: "page-input",
|
|
1502
1502
|
value: u,
|
|
1503
|
-
onChange: (
|
|
1503
|
+
onChange: (y) => p(y.target.value),
|
|
1504
1504
|
onBlur: r,
|
|
1505
1505
|
"aria-label": `Current page, Page ${t}`
|
|
1506
1506
|
}
|
|
@@ -1586,20 +1586,20 @@ const $n = {
|
|
|
1586
1586
|
customClass: m = "",
|
|
1587
1587
|
...o
|
|
1588
1588
|
}) => {
|
|
1589
|
-
const [u, p] =
|
|
1589
|
+
const [u, p] = M(t);
|
|
1590
1590
|
Z(() => {
|
|
1591
1591
|
p(t);
|
|
1592
1592
|
}, [t]);
|
|
1593
|
-
const
|
|
1593
|
+
const g = ne(
|
|
1594
1594
|
en((r) => {
|
|
1595
1595
|
a?.(r);
|
|
1596
1596
|
}, s),
|
|
1597
1597
|
[s, a]
|
|
1598
1598
|
);
|
|
1599
|
-
Z(() => (u !== t &&
|
|
1600
|
-
|
|
1601
|
-
}), [u,
|
|
1602
|
-
const
|
|
1599
|
+
Z(() => (u !== t && g(u), () => {
|
|
1600
|
+
g.cancel();
|
|
1601
|
+
}), [u, g, t]);
|
|
1602
|
+
const b = (r) => {
|
|
1603
1603
|
p(r.target.value);
|
|
1604
1604
|
};
|
|
1605
1605
|
return /* @__PURE__ */ n("div", { className: `search-bar-wrapper ${m}`, children: [
|
|
@@ -1614,7 +1614,7 @@ const $n = {
|
|
|
1614
1614
|
type: "search",
|
|
1615
1615
|
name: "search",
|
|
1616
1616
|
value: u,
|
|
1617
|
-
onChange:
|
|
1617
|
+
onChange: b,
|
|
1618
1618
|
...o
|
|
1619
1619
|
}
|
|
1620
1620
|
)
|
|
@@ -1633,9 +1633,9 @@ const $n = {
|
|
|
1633
1633
|
// From RHF's <Controller>
|
|
1634
1634
|
showSearch: p = !0
|
|
1635
1635
|
}) => {
|
|
1636
|
-
const [
|
|
1637
|
-
(d) => d.label.toLowerCase().includes(
|
|
1638
|
-
),
|
|
1636
|
+
const [g, b] = M(""), r = g === "" ? i : i.filter(
|
|
1637
|
+
(d) => d.label.toLowerCase().includes(g.toLowerCase())
|
|
1638
|
+
), y = i.find((d) => a?.id ? d.id === a.id : d.id === a || d.value === a);
|
|
1639
1639
|
return /* @__PURE__ */ e(K, { value: a, onChange: s, disabled: m, children: /* @__PURE__ */ n("div", { className: "select-wrapper", ref: u, children: [
|
|
1640
1640
|
t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
|
|
1641
1641
|
/* @__PURE__ */ n("div", { className: "select-button-container", children: [
|
|
@@ -1646,7 +1646,7 @@ const $n = {
|
|
|
1646
1646
|
"select-button--error": !!o
|
|
1647
1647
|
}),
|
|
1648
1648
|
children: [
|
|
1649
|
-
/* @__PURE__ */ e("span", { className: "select-value-display", children:
|
|
1649
|
+
/* @__PURE__ */ e("span", { className: "select-value-display", children: y ? y.label : /* @__PURE__ */ e("span", { className: "placeholder", children: l }) }),
|
|
1650
1650
|
/* @__PURE__ */ e(Ht, { className: "select-chevron", "aria-hidden": "true" })
|
|
1651
1651
|
]
|
|
1652
1652
|
}
|
|
@@ -1661,12 +1661,12 @@ const $n = {
|
|
|
1661
1661
|
p && /* @__PURE__ */ e("div", { className: "search-input-wrapper", children: /* @__PURE__ */ e(
|
|
1662
1662
|
be,
|
|
1663
1663
|
{
|
|
1664
|
-
value:
|
|
1665
|
-
onDebouncedChange:
|
|
1664
|
+
value: g,
|
|
1665
|
+
onDebouncedChange: b,
|
|
1666
1666
|
placeholder: "Search..."
|
|
1667
1667
|
}
|
|
1668
1668
|
) }),
|
|
1669
|
-
/* @__PURE__ */ e("div", { className: "select-options-list", children: r.length === 0 &&
|
|
1669
|
+
/* @__PURE__ */ e("div", { className: "select-options-list", children: r.length === 0 && g !== "" ? /* @__PURE__ */ e("div", { className: "no-results", children: "No results found." }) : r.map((d) => /* @__PURE__ */ e(
|
|
1670
1670
|
Yr,
|
|
1671
1671
|
{
|
|
1672
1672
|
className: ({ active: h }) => `select-option ${h ? "active" : ""}`,
|
|
@@ -1700,7 +1700,7 @@ const $n = {
|
|
|
1700
1700
|
o && /* @__PURE__ */ e("p", { className: "select-error-message", children: o })
|
|
1701
1701
|
] }) });
|
|
1702
1702
|
}, Ln = () => {
|
|
1703
|
-
const [t, a] =
|
|
1703
|
+
const [t, a] = M(window.location.pathname);
|
|
1704
1704
|
return Z(() => {
|
|
1705
1705
|
const s = () => {
|
|
1706
1706
|
a(window.location.pathname);
|
|
@@ -1715,18 +1715,18 @@ const $n = {
|
|
|
1715
1715
|
return s;
|
|
1716
1716
|
return null;
|
|
1717
1717
|
}, fa = ({ item: t, isCollapsed: a, level: s = 0 }) => {
|
|
1718
|
-
const { pathname: i } = Ln(), l = t.href || t.url || t.path, [m, o] =
|
|
1718
|
+
const { pathname: i } = Ln(), l = t.href || t.url || t.path, [m, o] = M(!1), u = t.icon;
|
|
1719
1719
|
Z(() => {
|
|
1720
1720
|
xt([t], i) && o(!0);
|
|
1721
1721
|
}, [t, i]);
|
|
1722
|
-
const p = i === l,
|
|
1722
|
+
const p = i === l, g = !p && !!xt([t], i), b = (r) => {
|
|
1723
1723
|
r.preventDefault(), o(!m);
|
|
1724
1724
|
};
|
|
1725
1725
|
return /* @__PURE__ */ n(
|
|
1726
1726
|
"div",
|
|
1727
1727
|
{
|
|
1728
1728
|
className: H("nav-item-container", {
|
|
1729
|
-
"nav-item-container--parent-active":
|
|
1729
|
+
"nav-item-container--parent-active": g,
|
|
1730
1730
|
[`nav-item-container--level-${s}`]: s > 0
|
|
1731
1731
|
}),
|
|
1732
1732
|
children: [
|
|
@@ -1748,7 +1748,7 @@ const $n = {
|
|
|
1748
1748
|
"button",
|
|
1749
1749
|
{
|
|
1750
1750
|
className: "nav-chevron-button",
|
|
1751
|
-
onClick:
|
|
1751
|
+
onClick: b,
|
|
1752
1752
|
"aria-expanded": m,
|
|
1753
1753
|
"aria-label": m ? "Collapse menu" : "Expand menu",
|
|
1754
1754
|
children: /* @__PURE__ */ e(
|
|
@@ -1905,16 +1905,16 @@ const $n = {
|
|
|
1905
1905
|
// ✅ New prop to control visibility
|
|
1906
1906
|
...u
|
|
1907
1907
|
}) => {
|
|
1908
|
-
const p = a || u.name, [
|
|
1908
|
+
const p = a || u.name, [g, b] = M(
|
|
1909
1909
|
u.value?.length || u.defaultValue?.length || 0
|
|
1910
1910
|
), r = (d) => {
|
|
1911
|
-
|
|
1912
|
-
},
|
|
1911
|
+
b(d.target.value.length), u.onChange && u.onChange(d);
|
|
1912
|
+
}, y = m - g;
|
|
1913
1913
|
return /* @__PURE__ */ n("div", { className: `textarea-wrapper ${i || ""}`, children: [
|
|
1914
1914
|
/* @__PURE__ */ n("div", { className: "textarea-header", children: [
|
|
1915
1915
|
t && /* @__PURE__ */ e("label", { htmlFor: p, className: "textarea-label", children: t }),
|
|
1916
1916
|
o && m && /* @__PURE__ */ n("span", { className: "char-counter", children: [
|
|
1917
|
-
|
|
1917
|
+
y,
|
|
1918
1918
|
" characters remaining"
|
|
1919
1919
|
] })
|
|
1920
1920
|
] }),
|
|
@@ -1972,9 +1972,9 @@ const $n = {
|
|
|
1972
1972
|
// For external styling of the tooltip itself
|
|
1973
1973
|
...o
|
|
1974
1974
|
}) => {
|
|
1975
|
-
const u =
|
|
1975
|
+
const u = se.useId();
|
|
1976
1976
|
return /* @__PURE__ */ n(te, { children: [
|
|
1977
|
-
|
|
1977
|
+
se.cloneElement(t, { "data-tooltip-id": u }),
|
|
1978
1978
|
/* @__PURE__ */ e(
|
|
1979
1979
|
Ka,
|
|
1980
1980
|
{
|
|
@@ -2010,15 +2010,15 @@ const $n = {
|
|
|
2010
2010
|
title: o,
|
|
2011
2011
|
description: u,
|
|
2012
2012
|
showProgress: p = !0,
|
|
2013
|
-
closeOnOverlayClick:
|
|
2013
|
+
closeOnOverlayClick: g = !0
|
|
2014
2014
|
}) => {
|
|
2015
|
-
const
|
|
2015
|
+
const b = s[i], r = Object.keys(s), y = r.indexOf(i), d = (y + 1) / r.length * 100, h = y > 0 && m.onBack;
|
|
2016
2016
|
return /* @__PURE__ */ e(he, { show: t, as: Q, children: /* @__PURE__ */ n(
|
|
2017
2017
|
ye,
|
|
2018
2018
|
{
|
|
2019
2019
|
as: "div",
|
|
2020
2020
|
className: "wizard-dialog",
|
|
2021
|
-
onClose:
|
|
2021
|
+
onClose: g ? a : () => {
|
|
2022
2022
|
},
|
|
2023
2023
|
children: [
|
|
2024
2024
|
/* @__PURE__ */ e(
|
|
@@ -2099,7 +2099,7 @@ const $n = {
|
|
|
2099
2099
|
},
|
|
2100
2100
|
className: "wizard-step-motion-wrapper",
|
|
2101
2101
|
style: { overflowX: "hidden" },
|
|
2102
|
-
children:
|
|
2102
|
+
children: b && /* @__PURE__ */ e(b, { ...m })
|
|
2103
2103
|
},
|
|
2104
2104
|
i
|
|
2105
2105
|
)
|
|
@@ -2130,11 +2130,11 @@ const $n = {
|
|
|
2130
2130
|
// Renamed for clarity, expecting a component type e.g., CheckCircle
|
|
2131
2131
|
disabled: u = !1,
|
|
2132
2132
|
size: p = "small",
|
|
2133
|
-
label:
|
|
2134
|
-
children:
|
|
2133
|
+
label: g,
|
|
2134
|
+
children: b,
|
|
2135
2135
|
// ✅ Add children to the props list
|
|
2136
2136
|
onClick: r,
|
|
2137
|
-
...
|
|
2137
|
+
...y
|
|
2138
2138
|
}) => {
|
|
2139
2139
|
const d = u, h = H(
|
|
2140
2140
|
"btn-base",
|
|
@@ -2153,7 +2153,7 @@ const $n = {
|
|
|
2153
2153
|
onClick: r,
|
|
2154
2154
|
title: i,
|
|
2155
2155
|
"aria-label": i,
|
|
2156
|
-
...
|
|
2156
|
+
...y,
|
|
2157
2157
|
children: o && /* @__PURE__ */ e(o, { size: p === "large" ? 20 : 16 })
|
|
2158
2158
|
}
|
|
2159
2159
|
);
|
|
@@ -2468,41 +2468,41 @@ function Hn({
|
|
|
2468
2468
|
// timeout: 20000,
|
|
2469
2469
|
});
|
|
2470
2470
|
s.interceptors.response.use(
|
|
2471
|
-
(
|
|
2472
|
-
message:
|
|
2471
|
+
(g) => g?.data ?? {
|
|
2472
|
+
message: g?.statusText || "Request succeeded"
|
|
2473
2473
|
},
|
|
2474
|
-
(
|
|
2475
|
-
const
|
|
2476
|
-
return t && (r === 401 || r === 403) && (window.location.href.includes("/login") || (window.historyPath = window.location.pathname, localStorage.clear(), sessionStorage.clear(), window.location.href = "/login")), Promise.reject(
|
|
2474
|
+
(g) => {
|
|
2475
|
+
const b = Xn(g), r = b.status;
|
|
2476
|
+
return t && (r === 401 || r === 403) && (window.location.href.includes("/login") || (window.historyPath = window.location.pathname, localStorage.clear(), sessionStorage.clear(), window.location.href = "/login")), Promise.reject(b);
|
|
2477
2477
|
}
|
|
2478
2478
|
);
|
|
2479
|
-
function i({ open:
|
|
2480
|
-
if (
|
|
2481
|
-
const { Authorization: r, ...
|
|
2479
|
+
function i({ open: g = !1, customHeader: b = {} } = {}) {
|
|
2480
|
+
if (g) {
|
|
2481
|
+
const { Authorization: r, ...y } = It();
|
|
2482
2482
|
return {
|
|
2483
|
-
headers: { ...
|
|
2483
|
+
headers: { ...y, ...a, ...b }
|
|
2484
2484
|
};
|
|
2485
2485
|
}
|
|
2486
|
-
return { headers: { ...It(), ...
|
|
2486
|
+
return { headers: { ...It(), ...b } };
|
|
2487
2487
|
}
|
|
2488
|
-
async function l(
|
|
2489
|
-
return s.get(
|
|
2490
|
-
params:
|
|
2491
|
-
...i({ open: r, customHeader:
|
|
2488
|
+
async function l(g, b, r = !1, y = {}) {
|
|
2489
|
+
return s.get(g, {
|
|
2490
|
+
params: b,
|
|
2491
|
+
...i({ open: r, customHeader: y })
|
|
2492
2492
|
});
|
|
2493
2493
|
}
|
|
2494
|
-
async function m(
|
|
2495
|
-
const d = { ...i({ open: r, customHeader:
|
|
2496
|
-
return
|
|
2494
|
+
async function m(g, b, r = !1, y = {}) {
|
|
2495
|
+
const d = { ...i({ open: r, customHeader: y }) };
|
|
2496
|
+
return b !== void 0 && (d.data = b), s.delete(g, d);
|
|
2497
2497
|
}
|
|
2498
|
-
async function o(
|
|
2499
|
-
return s.post(
|
|
2498
|
+
async function o(g, b = {}, r = !1, y = {}) {
|
|
2499
|
+
return s.post(g, b, i({ open: r, customHeader: y }));
|
|
2500
2500
|
}
|
|
2501
|
-
async function u(
|
|
2502
|
-
return s.put(
|
|
2501
|
+
async function u(g, b = {}, r = !1, y = {}) {
|
|
2502
|
+
return s.put(g, b, i({ open: r, customHeader: y }));
|
|
2503
2503
|
}
|
|
2504
|
-
async function p(
|
|
2505
|
-
return s.patch(
|
|
2504
|
+
async function p(g, b = {}, r = !1, y = {}) {
|
|
2505
|
+
return s.patch(g, b, i({ open: r, customHeader: y }));
|
|
2506
2506
|
}
|
|
2507
2507
|
return {
|
|
2508
2508
|
instance: s,
|
|
@@ -2600,7 +2600,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2600
2600
|
return es(i);
|
|
2601
2601
|
}
|
|
2602
2602
|
}, Ct = (t, a) => {
|
|
2603
|
-
const [s, i] =
|
|
2603
|
+
const [s, i] = M(t);
|
|
2604
2604
|
return Z(
|
|
2605
2605
|
() => {
|
|
2606
2606
|
const l = sn(() => {
|
|
@@ -2636,15 +2636,15 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2636
2636
|
className: "flex items-center justify-between p-3 border border-gray-300 rounded-lg hover:bg-gray-50 hover:cursor-pointer transition-colors duration-150",
|
|
2637
2637
|
children: [
|
|
2638
2638
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
2639
|
-
/* @__PURE__ */ e("div", { className: "flex items-center", children: l.map((
|
|
2639
|
+
/* @__PURE__ */ e("div", { className: "flex items-center", children: l.map((g, b) => /* @__PURE__ */ e(
|
|
2640
2640
|
"img",
|
|
2641
2641
|
{
|
|
2642
|
-
src:
|
|
2643
|
-
alt:
|
|
2644
|
-
className: `w-10 h-10 rounded-full border-2 border-white ${
|
|
2645
|
-
style: { zIndex:
|
|
2642
|
+
src: g.avatarUrl || `https://avatar.vercel.sh/${g.name}.svg?text=${g?.name?.charAt(0) || "U"}`,
|
|
2643
|
+
alt: g.name,
|
|
2644
|
+
className: `w-10 h-10 rounded-full border-2 border-white ${b > 0 ? "-ml-4" : ""}`,
|
|
2645
|
+
style: { zIndex: b }
|
|
2646
2646
|
},
|
|
2647
|
-
|
|
2647
|
+
g.id || b
|
|
2648
2648
|
)) }),
|
|
2649
2649
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-800 truncate", children: p })
|
|
2650
2650
|
] }),
|
|
@@ -2672,37 +2672,37 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2672
2672
|
},
|
|
2673
2673
|
isChanged: u = !1
|
|
2674
2674
|
}) => {
|
|
2675
|
-
const [p,
|
|
2676
|
-
control:
|
|
2675
|
+
const [p, g] = M(Pt[0]), [b, r] = M(""), y = Ct(b, 400), [d, h] = M([]), [$, T] = M(/* @__PURE__ */ new Set()), [F, A] = M(!1), [I, V] = M(Lt[0]), {
|
|
2676
|
+
control: U,
|
|
2677
2677
|
handleSubmit: G,
|
|
2678
|
-
watch:
|
|
2679
|
-
formState: { errors:
|
|
2678
|
+
watch: B,
|
|
2679
|
+
formState: { errors: z, isSubmitting: f }
|
|
2680
2680
|
} = lr({
|
|
2681
2681
|
defaultValues: { pendingInvites: [] },
|
|
2682
2682
|
resolver: cr(as)
|
|
2683
|
-
}), { fields:
|
|
2684
|
-
control:
|
|
2683
|
+
}), { fields: v, append: w, remove: C, update: N } = ir({
|
|
2684
|
+
control: U,
|
|
2685
2685
|
name: "pendingInvites"
|
|
2686
|
-
}),
|
|
2686
|
+
}), x = B("pendingInvites");
|
|
2687
2687
|
Z(() => {
|
|
2688
|
-
|
|
2688
|
+
y.length > 1 ? (A(!0), Kn(p.name, y).then((D) => {
|
|
2689
2689
|
h(D);
|
|
2690
|
-
}).catch((D) => console.error("Search failed:", D)).finally(() =>
|
|
2691
|
-
}, [
|
|
2690
|
+
}).catch((D) => console.error("Search failed:", D)).finally(() => A(!1))) : (h([]), T(/* @__PURE__ */ new Set()));
|
|
2691
|
+
}, [y, p]);
|
|
2692
2692
|
const k = (D) => {
|
|
2693
|
-
|
|
2693
|
+
T((P) => {
|
|
2694
2694
|
const _ = new Set(P);
|
|
2695
2695
|
return _.has(D) ? _.delete(D) : _.add(D), _;
|
|
2696
2696
|
});
|
|
2697
|
-
},
|
|
2698
|
-
d.filter((D) =>
|
|
2699
|
-
|
|
2700
|
-
}),
|
|
2701
|
-
},
|
|
2702
|
-
|
|
2703
|
-
(P, _) => N(_, { ...
|
|
2697
|
+
}, E = () => {
|
|
2698
|
+
d.filter((D) => $.has(D.id)).forEach((D) => {
|
|
2699
|
+
v.find((P) => P.id === D.id) || w({ ...D, permission: I.name });
|
|
2700
|
+
}), T(/* @__PURE__ */ new Set()), r("");
|
|
2701
|
+
}, L = (D) => {
|
|
2702
|
+
V(D), v.forEach(
|
|
2703
|
+
(P, _) => N(_, { ...v[_], permission: D.name })
|
|
2704
2704
|
);
|
|
2705
|
-
},
|
|
2705
|
+
}, q = async (D) => {
|
|
2706
2706
|
try {
|
|
2707
2707
|
if (l === de.DRIVE) {
|
|
2708
2708
|
const P = D.pendingInvites.map((R) => ({
|
|
@@ -2747,7 +2747,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2747
2747
|
throw console.error("Failed to submit invites:", P), P;
|
|
2748
2748
|
}
|
|
2749
2749
|
}, S = (D) => {
|
|
2750
|
-
const P = i[p.code].find((_) => _.name === D.name && _.permission !== "remove") ||
|
|
2750
|
+
const P = i[p.code].find((_) => _.name === D.name && _.permission !== "remove") || x.find((_) => _.name === D.name);
|
|
2751
2751
|
return P ? `${P.permission}` : "";
|
|
2752
2752
|
}, O = () => {
|
|
2753
2753
|
switch (l) {
|
|
@@ -2761,7 +2761,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2761
2761
|
return "Add User, Groups or Roles test";
|
|
2762
2762
|
}
|
|
2763
2763
|
};
|
|
2764
|
-
return ue(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:",
|
|
2764
|
+
return ue(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", x.length), x.length === 0 && !u), [x.length, u]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2765
2765
|
/* @__PURE__ */ n("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2766
2766
|
/* @__PURE__ */ e(ye.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: O() }),
|
|
2767
2767
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
|
|
@@ -2790,7 +2790,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2790
2790
|
}
|
|
2791
2791
|
),
|
|
2792
2792
|
/* @__PURE__ */ n("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
|
|
2793
|
-
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(K, { value: p, onChange:
|
|
2793
|
+
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(K, { value: p, onChange: g, children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2794
2794
|
/* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2795
2795
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
2796
2796
|
/* @__PURE__ */ e(p.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
@@ -2839,10 +2839,10 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2839
2839
|
{
|
|
2840
2840
|
placeholder: `Search by ${p.name.toLowerCase()}...`,
|
|
2841
2841
|
onDebouncedChange: (D) => r(D),
|
|
2842
|
-
value:
|
|
2842
|
+
value: b
|
|
2843
2843
|
}
|
|
2844
2844
|
) }),
|
|
2845
|
-
/* @__PURE__ */ e(Ce, { children: (d?.length > 0 ||
|
|
2845
|
+
/* @__PURE__ */ e(Ce, { children: (d?.length > 0 || F) && /* @__PURE__ */ e(
|
|
2846
2846
|
le.div,
|
|
2847
2847
|
{
|
|
2848
2848
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2850,7 +2850,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2850
2850
|
exit: { opacity: 0, y: -10 },
|
|
2851
2851
|
transition: { duration: 0.2 },
|
|
2852
2852
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2853
|
-
children:
|
|
2853
|
+
children: F ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(te, { children: [
|
|
2854
2854
|
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((D) => {
|
|
2855
2855
|
const P = S(D);
|
|
2856
2856
|
return /* @__PURE__ */ n(
|
|
@@ -2863,7 +2863,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2863
2863
|
"input",
|
|
2864
2864
|
{
|
|
2865
2865
|
type: "checkbox",
|
|
2866
|
-
checked:
|
|
2866
|
+
checked: $.has(D.id),
|
|
2867
2867
|
readOnly: !0,
|
|
2868
2868
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
|
|
2869
2869
|
disabled: !!P
|
|
@@ -2899,8 +2899,8 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2899
2899
|
/* @__PURE__ */ e(
|
|
2900
2900
|
"button",
|
|
2901
2901
|
{
|
|
2902
|
-
onClick:
|
|
2903
|
-
disabled:
|
|
2902
|
+
onClick: E,
|
|
2903
|
+
disabled: $.size === 0,
|
|
2904
2904
|
className: "px-3 py-1 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed hover:cursor-pointer",
|
|
2905
2905
|
children: "Add"
|
|
2906
2906
|
}
|
|
@@ -2910,7 +2910,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2910
2910
|
}
|
|
2911
2911
|
) })
|
|
2912
2912
|
] }),
|
|
2913
|
-
/* @__PURE__ */ e(Ce, { children:
|
|
2913
|
+
/* @__PURE__ */ e(Ce, { children: v.length > 0 && /* @__PURE__ */ n(
|
|
2914
2914
|
le.div,
|
|
2915
2915
|
{
|
|
2916
2916
|
initial: { opacity: 0, y: 20 },
|
|
@@ -2920,14 +2920,14 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2920
2920
|
/* @__PURE__ */ n("div", { className: "flex justify-between items-center", children: [
|
|
2921
2921
|
/* @__PURE__ */ n("div", { className: "font-semibold text-gray-800", children: [
|
|
2922
2922
|
"Pending Invites (",
|
|
2923
|
-
|
|
2923
|
+
v.length,
|
|
2924
2924
|
")"
|
|
2925
2925
|
] }),
|
|
2926
2926
|
l === de.DRIVE && /* @__PURE__ */ e(
|
|
2927
2927
|
K,
|
|
2928
2928
|
{
|
|
2929
2929
|
value: I,
|
|
2930
|
-
onChange:
|
|
2930
|
+
onChange: L,
|
|
2931
2931
|
children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2932
2932
|
/* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2933
2933
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
@@ -2985,7 +2985,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2985
2985
|
}
|
|
2986
2986
|
)
|
|
2987
2987
|
] }),
|
|
2988
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Ce, { children:
|
|
2988
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Ce, { children: v.map((D, P) => /* @__PURE__ */ n(
|
|
2989
2989
|
le.div,
|
|
2990
2990
|
{
|
|
2991
2991
|
layout: !0,
|
|
@@ -3029,9 +3029,9 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3029
3029
|
] }),
|
|
3030
3030
|
/* @__PURE__ */ e("footer", { className: "p-4 border-t border-gray-300 flex-shrink-0", children: /* @__PURE__ */ n("div", { className: "flex justify-between items-center", children: [
|
|
3031
3031
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600", children: [
|
|
3032
|
-
|
|
3032
|
+
x.length,
|
|
3033
3033
|
" invitation",
|
|
3034
|
-
|
|
3034
|
+
x.length !== 1 ? "s" : "",
|
|
3035
3035
|
" selected"
|
|
3036
3036
|
] }),
|
|
3037
3037
|
/* @__PURE__ */ n("div", { className: "flex gap-2", children: [
|
|
@@ -3046,10 +3046,10 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3046
3046
|
/* @__PURE__ */ e(
|
|
3047
3047
|
"button",
|
|
3048
3048
|
{
|
|
3049
|
-
onClick: () => G(
|
|
3050
|
-
disabled:
|
|
3049
|
+
onClick: () => G(q)(),
|
|
3050
|
+
disabled: f || x.length === 0 && !u,
|
|
3051
3051
|
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",
|
|
3052
|
-
children:
|
|
3052
|
+
children: f ? "Inviting..." : l === de.DRIVE ? "Send Invites" : "Add"
|
|
3053
3053
|
}
|
|
3054
3054
|
)
|
|
3055
3055
|
] })
|
|
@@ -3060,27 +3060,27 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3060
3060
|
{ name: "Can manage", icon: ea, value: "edit" },
|
|
3061
3061
|
{ name: "Remove", icon: dr, isDestructive: !0, value: "remove" }
|
|
3062
3062
|
], ns = ({ item: t, allowedPermissions: a, onPermissionChange: s }) => {
|
|
3063
|
-
const [i, l] =
|
|
3063
|
+
const [i, l] = M(!1), { refs: m, floatingStyles: o, context: u } = la({
|
|
3064
3064
|
open: i,
|
|
3065
3065
|
onOpenChange: l,
|
|
3066
3066
|
middleware: [ia(8), oa(), ca({ padding: 8 })],
|
|
3067
3067
|
whileElementsMounted: da,
|
|
3068
3068
|
placement: "bottom-end"
|
|
3069
|
-
}), p = tn(u),
|
|
3069
|
+
}), p = tn(u), g = an(u), { getReferenceProps: b, getFloatingProps: r } = rn([
|
|
3070
3070
|
p,
|
|
3071
|
-
|
|
3072
|
-
]),
|
|
3071
|
+
g
|
|
3072
|
+
]), y = dt.find((h) => h.name === t.permission || h.value === t.permission) || dt[0];
|
|
3073
3073
|
return (
|
|
3074
3074
|
// FIX: The <Listbox> component now wraps both the button and the portal.
|
|
3075
3075
|
// This provides the necessary context for both children.
|
|
3076
|
-
/* @__PURE__ */ n(K, { value:
|
|
3076
|
+
/* @__PURE__ */ n(K, { value: y, onChange: (h) => {
|
|
3077
3077
|
s(h), l(!1);
|
|
3078
3078
|
}, children: [
|
|
3079
3079
|
/* @__PURE__ */ n(
|
|
3080
3080
|
K.Button,
|
|
3081
3081
|
{
|
|
3082
3082
|
ref: m.setReference,
|
|
3083
|
-
...
|
|
3083
|
+
...b(),
|
|
3084
3084
|
className: "relative min-w-[120px] text-left text-sm p-2 border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-opacity-75 hover:cursor-pointer",
|
|
3085
3085
|
children: [
|
|
3086
3086
|
/* @__PURE__ */ e("span", { className: "block truncate", children: t.permission }),
|
|
@@ -3111,24 +3111,24 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3111
3111
|
K.Option,
|
|
3112
3112
|
{
|
|
3113
3113
|
className: ({
|
|
3114
|
-
active:
|
|
3114
|
+
active: $
|
|
3115
3115
|
}) => `relative select-none py-2 pl-10 pr-4 hover:cursor-pointer
|
|
3116
|
-
${
|
|
3117
|
-
${h.isDestructive &&
|
|
3118
|
-
${h.isDestructive &&
|
|
3116
|
+
${$ ? "bg-blue-100 text-blue-900" : "text-gray-900"}
|
|
3117
|
+
${h.isDestructive && $ ? "bg-red-100 text-red-900" : ""}
|
|
3118
|
+
${h.isDestructive && !$ ? "text-red-600" : ""}`,
|
|
3119
3119
|
value: h,
|
|
3120
|
-
children: ({ selected:
|
|
3120
|
+
children: ({ selected: $ }) => /* @__PURE__ */ n(te, { children: [
|
|
3121
3121
|
/* @__PURE__ */ n(
|
|
3122
3122
|
"span",
|
|
3123
3123
|
{
|
|
3124
|
-
className: `flex items-center gap-2 truncate ${
|
|
3124
|
+
className: `flex items-center gap-2 truncate ${$ ? "font-medium" : "font-normal"}`,
|
|
3125
3125
|
children: [
|
|
3126
3126
|
/* @__PURE__ */ e(h.icon, { className: "h-5 w-5", "aria-hidden": "true" }),
|
|
3127
3127
|
h.name
|
|
3128
3128
|
]
|
|
3129
3129
|
}
|
|
3130
3130
|
),
|
|
3131
|
-
|
|
3131
|
+
$ && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(ht, { className: "h-5 w-5", "aria-hidden": "true" }) })
|
|
3132
3132
|
] })
|
|
3133
3133
|
},
|
|
3134
3134
|
h.name
|
|
@@ -3148,32 +3148,32 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3148
3148
|
existingShares: l,
|
|
3149
3149
|
allowedPermissions: m
|
|
3150
3150
|
}) => {
|
|
3151
|
-
const [o, u] =
|
|
3151
|
+
const [o, u] = M(l), [p, g] = M(0), [b, r] = M(""), y = Ct(b, 300), d = {
|
|
3152
3152
|
users: o.users.filter(
|
|
3153
|
-
(
|
|
3153
|
+
(A) => A.name.toLowerCase().includes(y.toLowerCase())
|
|
3154
3154
|
),
|
|
3155
3155
|
groups: o.groups.filter(
|
|
3156
|
-
(
|
|
3156
|
+
(A) => A.name.toLowerCase().includes(y.toLowerCase())
|
|
3157
3157
|
),
|
|
3158
3158
|
roles: o.roles.filter(
|
|
3159
|
-
(
|
|
3159
|
+
(A) => A.name.toLowerCase().includes(y.toLowerCase())
|
|
3160
3160
|
)
|
|
3161
|
-
}, h = async (
|
|
3161
|
+
}, h = async (A, I, V, U) => {
|
|
3162
3162
|
const G = I.value;
|
|
3163
|
-
u((
|
|
3164
|
-
...
|
|
3165
|
-
[
|
|
3166
|
-
(
|
|
3163
|
+
u((B) => ({
|
|
3164
|
+
...B,
|
|
3165
|
+
[V]: B[V].map(
|
|
3166
|
+
(z) => z.id === A.id ? { ...z, permission: G } : z
|
|
3167
3167
|
)
|
|
3168
3168
|
}));
|
|
3169
|
-
},
|
|
3170
|
-
const
|
|
3169
|
+
}, $ = () => {
|
|
3170
|
+
const A = {
|
|
3171
3171
|
users: o.users.filter((I) => I.permission !== "remove"),
|
|
3172
3172
|
groups: o.groups.filter((I) => I.permission !== "remove"),
|
|
3173
3173
|
roles: o.roles.filter((I) => I.permission !== "remove")
|
|
3174
3174
|
};
|
|
3175
|
-
a(
|
|
3176
|
-
},
|
|
3175
|
+
a(A);
|
|
3176
|
+
}, T = ["users", "groups", "roles"], F = ["Users", "Groups", "Roles"];
|
|
3177
3177
|
return (
|
|
3178
3178
|
// The main structure remains the same...
|
|
3179
3179
|
/* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-gray-50", children: [
|
|
@@ -3200,26 +3200,26 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3200
3200
|
)
|
|
3201
3201
|
] }),
|
|
3202
3202
|
/* @__PURE__ */ n("div", { className: "flex flex-col flex-grow", children: [
|
|
3203
|
-
/* @__PURE__ */ n(
|
|
3203
|
+
/* @__PURE__ */ n(re.Group, { selectedIndex: p, onChange: g, children: [
|
|
3204
3204
|
/* @__PURE__ */ n("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3205
|
-
/* @__PURE__ */ e(
|
|
3206
|
-
|
|
3205
|
+
/* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: F.map((A) => /* @__PURE__ */ e(
|
|
3206
|
+
re,
|
|
3207
3207
|
{
|
|
3208
3208
|
className: ({
|
|
3209
3209
|
selected: I
|
|
3210
3210
|
}) => `w-full py-2 text-sm font-medium leading-5 rounded-md
|
|
3211
3211
|
focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
|
|
3212
3212
|
${I ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
|
|
3213
|
-
children:
|
|
3213
|
+
children: A
|
|
3214
3214
|
},
|
|
3215
|
-
|
|
3215
|
+
A
|
|
3216
3216
|
)) }),
|
|
3217
3217
|
/* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
|
|
3218
3218
|
be,
|
|
3219
3219
|
{
|
|
3220
3220
|
onDebouncedChange: r,
|
|
3221
|
-
value:
|
|
3222
|
-
placeholder: `Search in ${
|
|
3221
|
+
value: b,
|
|
3222
|
+
placeholder: `Search in ${F[p]}...`
|
|
3223
3223
|
}
|
|
3224
3224
|
) })
|
|
3225
3225
|
] }),
|
|
@@ -3230,11 +3230,11 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3230
3230
|
animate: { y: 0, opacity: 1 },
|
|
3231
3231
|
exit: { y: -10, opacity: 0 },
|
|
3232
3232
|
transition: { duration: 0.2 },
|
|
3233
|
-
children: /* @__PURE__ */ e(
|
|
3234
|
-
|
|
3233
|
+
children: /* @__PURE__ */ e(re.Panels, { as: Q, children: T.map((A) => /* @__PURE__ */ e(
|
|
3234
|
+
re.Panel,
|
|
3235
3235
|
{
|
|
3236
3236
|
className: "space-y-3 focus:outline-none",
|
|
3237
|
-
children: /* @__PURE__ */ e(Ce, { children: d[
|
|
3237
|
+
children: /* @__PURE__ */ e(Ce, { children: d[A].length > 0 ? d[A].map((I) => /* @__PURE__ */ n(
|
|
3238
3238
|
le.div,
|
|
3239
3239
|
{
|
|
3240
3240
|
layout: !0,
|
|
@@ -3258,12 +3258,12 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3258
3258
|
),
|
|
3259
3259
|
/* @__PURE__ */ n("div", { className: "overflow-hidden", children: [
|
|
3260
3260
|
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: I.name }),
|
|
3261
|
-
|
|
3261
|
+
A !== "users" && /* @__PURE__ */ e(
|
|
3262
3262
|
"button",
|
|
3263
3263
|
{
|
|
3264
3264
|
onClick: () => i({
|
|
3265
3265
|
id: I.id,
|
|
3266
|
-
type:
|
|
3266
|
+
type: A,
|
|
3267
3267
|
name: I.name
|
|
3268
3268
|
}),
|
|
3269
3269
|
className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
|
|
@@ -3277,10 +3277,10 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3277
3277
|
{
|
|
3278
3278
|
item: I,
|
|
3279
3279
|
allowedPermissions: m,
|
|
3280
|
-
onPermissionChange: (
|
|
3280
|
+
onPermissionChange: (V) => h(
|
|
3281
3281
|
I,
|
|
3282
|
-
|
|
3283
|
-
|
|
3282
|
+
V,
|
|
3283
|
+
A
|
|
3284
3284
|
)
|
|
3285
3285
|
}
|
|
3286
3286
|
)
|
|
@@ -3299,16 +3299,16 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3299
3299
|
/* @__PURE__ */ e(Zt, { className: "h-12 w-12 text-gray-400" }),
|
|
3300
3300
|
/* @__PURE__ */ n("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
|
|
3301
3301
|
"No ",
|
|
3302
|
-
|
|
3302
|
+
F[p],
|
|
3303
3303
|
" Found"
|
|
3304
3304
|
] }),
|
|
3305
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children:
|
|
3305
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: b ? `No results for "${b}"` : `There are no ${F[p].toLowerCase()} with access.` })
|
|
3306
3306
|
]
|
|
3307
3307
|
}
|
|
3308
3308
|
)
|
|
3309
3309
|
) })
|
|
3310
3310
|
},
|
|
3311
|
-
|
|
3311
|
+
A
|
|
3312
3312
|
)) })
|
|
3313
3313
|
},
|
|
3314
3314
|
p
|
|
@@ -3317,7 +3317,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3317
3317
|
/* @__PURE__ */ e("div", { className: "p-4 bg-white border-t border-gray-300 flex justify-end", children: /* @__PURE__ */ e(
|
|
3318
3318
|
"button",
|
|
3319
3319
|
{
|
|
3320
|
-
onClick:
|
|
3320
|
+
onClick: $,
|
|
3321
3321
|
className: "px-4 py-2 bg-blue-600 text-white rounded-md shadow hover:bg-blue-700",
|
|
3322
3322
|
children: "Update"
|
|
3323
3323
|
}
|
|
@@ -3338,9 +3338,9 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3338
3338
|
onClose: s,
|
|
3339
3339
|
members: i
|
|
3340
3340
|
}) => {
|
|
3341
|
-
const [l, m] =
|
|
3341
|
+
const [l, m] = M(!0), [o, u] = M(""), p = Ct(o, 300), g = i.filter(
|
|
3342
3342
|
(d) => d.name.toLowerCase().includes(p.toLowerCase())
|
|
3343
|
-
),
|
|
3343
|
+
), b = {
|
|
3344
3344
|
hidden: { opacity: 0 },
|
|
3345
3345
|
visible: {
|
|
3346
3346
|
opacity: 1,
|
|
@@ -3352,10 +3352,10 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3352
3352
|
hidden: { y: 20, opacity: 0 },
|
|
3353
3353
|
visible: { y: 0, opacity: 1 },
|
|
3354
3354
|
exit: { opacity: 0, x: -20 }
|
|
3355
|
-
},
|
|
3355
|
+
}, y = () => l ? (
|
|
3356
3356
|
// Show 5 skeleton items while loading
|
|
3357
3357
|
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d, h) => /* @__PURE__ */ e(ls, {}, h)) })
|
|
3358
|
-
) :
|
|
3358
|
+
) : g.length === 0 ? /* @__PURE__ */ n(
|
|
3359
3359
|
le.div,
|
|
3360
3360
|
{
|
|
3361
3361
|
initial: { opacity: 0, scale: 0.95 },
|
|
@@ -3370,11 +3370,11 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3370
3370
|
) : /* @__PURE__ */ e(
|
|
3371
3371
|
le.ul,
|
|
3372
3372
|
{
|
|
3373
|
-
variants:
|
|
3373
|
+
variants: b,
|
|
3374
3374
|
initial: "hidden",
|
|
3375
3375
|
animate: "visible",
|
|
3376
3376
|
className: "divide-y divide-gray-200",
|
|
3377
|
-
children: /* @__PURE__ */ e(Ce, { children:
|
|
3377
|
+
children: /* @__PURE__ */ e(Ce, { children: g.map((d) => /* @__PURE__ */ n(
|
|
3378
3378
|
le.li,
|
|
3379
3379
|
{
|
|
3380
3380
|
layout: !0,
|
|
@@ -3436,7 +3436,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3436
3436
|
placeholder: "Search members..."
|
|
3437
3437
|
}
|
|
3438
3438
|
) }),
|
|
3439
|
-
/* @__PURE__ */ e("div", { className: "flex-grow overflow-y-auto", children:
|
|
3439
|
+
/* @__PURE__ */ e("div", { className: "flex-grow overflow-y-auto", children: y() })
|
|
3440
3440
|
] });
|
|
3441
3441
|
}, fe = {
|
|
3442
3442
|
INVITE: "invite",
|
|
@@ -3459,31 +3459,31 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3459
3459
|
allowedPermissions: u = [],
|
|
3460
3460
|
...p
|
|
3461
3461
|
}) => {
|
|
3462
|
-
const [
|
|
3463
|
-
|
|
3462
|
+
const [g, b] = M(fe.INVITE), [r, y] = M(t), [d, h] = M(null), [$, T] = M(!1), [F, A] = M([]), [I, V] = M(fe.MANAGE), U = () => {
|
|
3463
|
+
b(fe.INVITE), h(null), m();
|
|
3464
3464
|
}, G = () => {
|
|
3465
|
-
|
|
3466
|
-
},
|
|
3465
|
+
b(fe.MANAGE);
|
|
3466
|
+
}, B = async ({ id: v, name: w, type: C }) => {
|
|
3467
3467
|
if (C === "groups") {
|
|
3468
3468
|
try {
|
|
3469
|
-
const N = await Ve(`${Xe.getMembersForGroup(
|
|
3469
|
+
const N = await Ve(`${Xe.getMembersForGroup(w)}`);
|
|
3470
3470
|
} catch (N) {
|
|
3471
3471
|
console.log("Error searching entities:", N);
|
|
3472
3472
|
}
|
|
3473
|
-
|
|
3473
|
+
A(resp);
|
|
3474
3474
|
}
|
|
3475
|
-
h({ id:
|
|
3476
|
-
},
|
|
3477
|
-
console.log("changedExistingShares",
|
|
3478
|
-
const
|
|
3479
|
-
console.log("Existing data:",
|
|
3480
|
-
const N = !ct.isEqual(
|
|
3481
|
-
console.log("hasPermissionChanged:", N),
|
|
3475
|
+
h({ id: v, type: C, name: w }), V(g), b(fe.MEMBERS);
|
|
3476
|
+
}, z = (v) => {
|
|
3477
|
+
console.log("changedExistingShares", v), y(v);
|
|
3478
|
+
const w = ct.mapValues(t, (x) => x.map((k) => ({ id: k.id, permission: k.permission })).sort((k, E) => k.id - E.id)), C = ct.mapValues(v, (x) => x.map((k) => ({ id: k.id, permission: k.permission })).sort((k, E) => k.id - E.id));
|
|
3479
|
+
console.log("Existing data:", w), console.log("Changed data:", C);
|
|
3480
|
+
const N = !ct.isEqual(w, C);
|
|
3481
|
+
console.log("hasPermissionChanged:", N), T(N), b(g === fe.MEMBERS ? I : fe.INVITE);
|
|
3482
3482
|
};
|
|
3483
|
-
return /* @__PURE__ */ e(he, { appear: !0, show: a, as: Q, children: /* @__PURE__ */ n(ye, { as: "div", className: "relative z-50", onClose:
|
|
3483
|
+
return /* @__PURE__ */ e(he, { appear: !0, show: a, as: Q, children: /* @__PURE__ */ n(ye, { as: "div", className: "relative z-50", onClose: U, children: [
|
|
3484
3484
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
3485
3485
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(Ee, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
|
|
3486
|
-
switch (
|
|
3486
|
+
switch (g) {
|
|
3487
3487
|
case fe.MANAGE:
|
|
3488
3488
|
return /* @__PURE__ */ e(
|
|
3489
3489
|
le.div,
|
|
@@ -3497,9 +3497,9 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3497
3497
|
ss,
|
|
3498
3498
|
{
|
|
3499
3499
|
entity: i,
|
|
3500
|
-
onBack:
|
|
3501
|
-
onClose:
|
|
3502
|
-
onOpenMembers:
|
|
3500
|
+
onBack: z,
|
|
3501
|
+
onClose: U,
|
|
3502
|
+
onOpenMembers: B,
|
|
3503
3503
|
existingShares: r,
|
|
3504
3504
|
calledBy: l,
|
|
3505
3505
|
allowedPermissions: u
|
|
@@ -3521,11 +3521,11 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3521
3521
|
is,
|
|
3522
3522
|
{
|
|
3523
3523
|
entity: d,
|
|
3524
|
-
onBack:
|
|
3525
|
-
onClose:
|
|
3524
|
+
onBack: z,
|
|
3525
|
+
onClose: U,
|
|
3526
3526
|
calledBy: l,
|
|
3527
3527
|
existingShares: r,
|
|
3528
|
-
members:
|
|
3528
|
+
members: F
|
|
3529
3529
|
}
|
|
3530
3530
|
)
|
|
3531
3531
|
},
|
|
@@ -3545,14 +3545,14 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3545
3545
|
{
|
|
3546
3546
|
entity: i,
|
|
3547
3547
|
onManage: G,
|
|
3548
|
-
onClose:
|
|
3548
|
+
onClose: U,
|
|
3549
3549
|
existingShares: r,
|
|
3550
3550
|
calledBy: l,
|
|
3551
3551
|
showExistingShares: o,
|
|
3552
|
-
onFinalSubmit: (
|
|
3553
|
-
s(
|
|
3552
|
+
onFinalSubmit: (v) => {
|
|
3553
|
+
s(v, r);
|
|
3554
3554
|
},
|
|
3555
|
-
isChanged:
|
|
3555
|
+
isChanged: $
|
|
3556
3556
|
}
|
|
3557
3557
|
)
|
|
3558
3558
|
},
|
|
@@ -3578,34 +3578,34 @@ function nt({
|
|
|
3578
3578
|
displayLimit: u = 3,
|
|
3579
3579
|
selectionLimit: p = -1,
|
|
3580
3580
|
// NEW: search behavior
|
|
3581
|
-
searchMode:
|
|
3581
|
+
searchMode: g = "client",
|
|
3582
3582
|
// "client" | "server"
|
|
3583
|
-
onSearch:
|
|
3583
|
+
onSearch: b,
|
|
3584
3584
|
// (query: string) => void (required if searchMode==="server")
|
|
3585
3585
|
serverLoading: r = !1,
|
|
3586
|
-
minSearchChars:
|
|
3586
|
+
minSearchChars: y = 2,
|
|
3587
3587
|
// NEW: mappers (id/label keys)
|
|
3588
|
-
getOptionId: d = (
|
|
3589
|
-
getOptionLabel: h = (
|
|
3588
|
+
getOptionId: d = ($) => String($.id),
|
|
3589
|
+
getOptionLabel: h = ($) => $.name
|
|
3590
3590
|
}) {
|
|
3591
|
-
const
|
|
3592
|
-
const
|
|
3593
|
-
for (const
|
|
3594
|
-
return
|
|
3595
|
-
}, [a, d]),
|
|
3596
|
-
if (!
|
|
3597
|
-
const
|
|
3598
|
-
return a.filter((
|
|
3599
|
-
}, [a,
|
|
3591
|
+
const $ = Qe(), T = Qe(), [F, A] = M(""), I = xe(""), V = ue(() => {
|
|
3592
|
+
const v = /* @__PURE__ */ new Map();
|
|
3593
|
+
for (const w of a) v.set(d(w), w);
|
|
3594
|
+
return v;
|
|
3595
|
+
}, [a, d]), U = ue(() => Array.isArray(s) ? s.map((v) => v && typeof v == "object" ? V.get(d(v)) || null : V.get(String(v))).filter(Boolean) : [], [s, V, d]), G = ue(() => {
|
|
3596
|
+
if (!F) return a;
|
|
3597
|
+
const v = F.toLowerCase();
|
|
3598
|
+
return a.filter((w) => h(w).toLowerCase().includes(v));
|
|
3599
|
+
}, [a, F, h]);
|
|
3600
3600
|
Z(() => {
|
|
3601
|
-
|
|
3602
|
-
}, [
|
|
3603
|
-
const
|
|
3604
|
-
if (!
|
|
3601
|
+
g === "server" && F.length >= y && F !== I.current && (I.current = F, b && b(F));
|
|
3602
|
+
}, [F, g, y, b]);
|
|
3603
|
+
const B = g === "client" ? G : a, z = () => {
|
|
3604
|
+
if (!U.length)
|
|
3605
3605
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
|
|
3606
|
-
const
|
|
3606
|
+
const v = U.slice(0, u), w = U.length - u;
|
|
3607
3607
|
return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2", children: [
|
|
3608
|
-
|
|
3608
|
+
v.map((C) => /* @__PURE__ */ e(
|
|
3609
3609
|
"span",
|
|
3610
3610
|
{
|
|
3611
3611
|
className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
|
|
@@ -3613,21 +3613,21 @@ function nt({
|
|
|
3613
3613
|
},
|
|
3614
3614
|
d(C)
|
|
3615
3615
|
)),
|
|
3616
|
-
|
|
3616
|
+
w > 0 && /* @__PURE__ */ n("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
|
|
3617
3617
|
"+",
|
|
3618
|
-
|
|
3618
|
+
w,
|
|
3619
3619
|
" more"
|
|
3620
3620
|
] })
|
|
3621
3621
|
] });
|
|
3622
3622
|
};
|
|
3623
|
-
return /* @__PURE__ */ e(K, { value:
|
|
3624
|
-
const
|
|
3625
|
-
p !== -1 &&
|
|
3626
|
-
}, multiple: !0, by: "id", children: ({ open:
|
|
3623
|
+
return /* @__PURE__ */ e(K, { value: U, onChange: (v) => {
|
|
3624
|
+
const w = Array.from(new Set(v.map((C) => d(C))));
|
|
3625
|
+
p !== -1 && w.length > p || i(w);
|
|
3626
|
+
}, multiple: !0, by: "id", children: ({ open: v }) => /* @__PURE__ */ n("div", { children: [
|
|
3627
3627
|
/* @__PURE__ */ e(
|
|
3628
3628
|
K.Label,
|
|
3629
3629
|
{
|
|
3630
|
-
id:
|
|
3630
|
+
id: $,
|
|
3631
3631
|
className: "block text-sm font-medium leading-6 text-gray-900",
|
|
3632
3632
|
children: t
|
|
3633
3633
|
}
|
|
@@ -3636,16 +3636,16 @@ function nt({
|
|
|
3636
3636
|
/* @__PURE__ */ n(
|
|
3637
3637
|
K.Button,
|
|
3638
3638
|
{
|
|
3639
|
-
"aria-labelledby":
|
|
3639
|
+
"aria-labelledby": $,
|
|
3640
3640
|
"aria-invalid": !!o,
|
|
3641
|
-
"aria-describedby": o ?
|
|
3641
|
+
"aria-describedby": o ? T : void 0,
|
|
3642
3642
|
onBlur: l,
|
|
3643
3643
|
className: Ge(
|
|
3644
3644
|
"relative w-full min-h-[38px] cursor-default rounded-md bg-white py-1.5 pl-3 pr-10 text-left text-gray-900 shadow-sm ring-1 ring-inset focus:outline-none focus:ring-2 focus:ring-gray-600 sm:text-sm sm:leading-6",
|
|
3645
3645
|
o ? "ring-red-500" : "ring-gray-300"
|
|
3646
3646
|
),
|
|
3647
3647
|
children: [
|
|
3648
|
-
/* @__PURE__ */ e("span", { className: "block truncate", children:
|
|
3648
|
+
/* @__PURE__ */ e("span", { className: "block truncate", children: z() }),
|
|
3649
3649
|
/* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(Ht, { className: "w-5 h-5 text-gray-400", "aria-hidden": "true" }) })
|
|
3650
3650
|
]
|
|
3651
3651
|
}
|
|
@@ -3654,7 +3654,7 @@ function nt({
|
|
|
3654
3654
|
he,
|
|
3655
3655
|
{
|
|
3656
3656
|
as: Q,
|
|
3657
|
-
show:
|
|
3657
|
+
show: v,
|
|
3658
3658
|
leave: "transition ease-in duration-100",
|
|
3659
3659
|
leaveFrom: "opacity-100",
|
|
3660
3660
|
leaveTo: "opacity-0",
|
|
@@ -3662,39 +3662,39 @@ function nt({
|
|
|
3662
3662
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3663
3663
|
be,
|
|
3664
3664
|
{
|
|
3665
|
-
value:
|
|
3666
|
-
onDebouncedChange:
|
|
3667
|
-
placeholder:
|
|
3665
|
+
value: F,
|
|
3666
|
+
onDebouncedChange: A,
|
|
3667
|
+
placeholder: g === "server" ? `Search (min ${y})…` : "Search options…"
|
|
3668
3668
|
}
|
|
3669
3669
|
) }),
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
const C = d(
|
|
3670
|
+
g === "server" && r && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3671
|
+
B.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: g === "server" ? F.length < y ? `Type at least ${y} characters to search.` : "No results." : "No options found." }) : B.map((w) => {
|
|
3672
|
+
const C = d(w), N = h(w), x = U.some((E) => d(E) === C), k = p !== -1 && U.length >= p && !x;
|
|
3673
3673
|
return /* @__PURE__ */ e(
|
|
3674
3674
|
K.Option,
|
|
3675
3675
|
{
|
|
3676
|
-
value:
|
|
3676
|
+
value: w,
|
|
3677
3677
|
disabled: k,
|
|
3678
|
-
className: ({ active:
|
|
3679
|
-
k ? " text-gray-400 bg-white cursor-not-allowed" :
|
|
3678
|
+
className: ({ active: E }) => Ge(
|
|
3679
|
+
k ? " text-gray-400 bg-white cursor-not-allowed" : E ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3680
3680
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3681
3681
|
),
|
|
3682
|
-
children: ({ selected:
|
|
3682
|
+
children: ({ selected: E, active: L }) => /* @__PURE__ */ n(te, { children: [
|
|
3683
3683
|
/* @__PURE__ */ e(
|
|
3684
3684
|
"span",
|
|
3685
3685
|
{
|
|
3686
3686
|
className: Ge(
|
|
3687
|
-
|
|
3687
|
+
E ? "font-semibold" : "font-normal",
|
|
3688
3688
|
"block truncate"
|
|
3689
3689
|
),
|
|
3690
3690
|
children: N
|
|
3691
3691
|
}
|
|
3692
3692
|
),
|
|
3693
|
-
|
|
3693
|
+
E && /* @__PURE__ */ e(
|
|
3694
3694
|
"span",
|
|
3695
3695
|
{
|
|
3696
3696
|
className: Ge(
|
|
3697
|
-
|
|
3697
|
+
L ? " text-gray-900" : " text-gray-600",
|
|
3698
3698
|
" absolute inset-y-0 right-0 flex items-center pr-4"
|
|
3699
3699
|
),
|
|
3700
3700
|
children: /* @__PURE__ */ e(tt, { className: "w-5 h-5", "aria-hidden": "true" })
|
|
@@ -3708,7 +3708,7 @@ function nt({
|
|
|
3708
3708
|
] })
|
|
3709
3709
|
}
|
|
3710
3710
|
),
|
|
3711
|
-
o && /* @__PURE__ */ e("p", { id:
|
|
3711
|
+
o && /* @__PURE__ */ e("p", { id: T, className: "mt-1 text-sm text-red-600", children: o })
|
|
3712
3712
|
] })
|
|
3713
3713
|
] }) });
|
|
3714
3714
|
}
|
|
@@ -3764,10 +3764,10 @@ const Wl = ({
|
|
|
3764
3764
|
secondaryAction: o = { onCancel: null, label: "Cancel" },
|
|
3765
3765
|
dialogPanelClass: u = ""
|
|
3766
3766
|
}) => {
|
|
3767
|
-
const p = (
|
|
3768
|
-
|
|
3769
|
-
},
|
|
3770
|
-
|
|
3767
|
+
const p = (b) => {
|
|
3768
|
+
b.target === b.currentTarget && a(!1);
|
|
3769
|
+
}, g = (b) => {
|
|
3770
|
+
b.stopPropagation();
|
|
3771
3771
|
};
|
|
3772
3772
|
return /* @__PURE__ */ n(
|
|
3773
3773
|
ye,
|
|
@@ -3787,7 +3787,7 @@ const Wl = ({
|
|
|
3787
3787
|
Ee,
|
|
3788
3788
|
{
|
|
3789
3789
|
className: `${u} relative bg-white align-middle w-full lg:w-[36rem] mx-5 lg:mx-0 transform overflow-hidden rounded-2xl text-left shadow-xl lg:min-w-[36rem] md:min-w-96 transition-all`,
|
|
3790
|
-
onClick:
|
|
3790
|
+
onClick: g,
|
|
3791
3791
|
children: [
|
|
3792
3792
|
/* @__PURE__ */ n("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
|
|
3793
3793
|
i?.customHeader && i.customHeader,
|
|
@@ -3798,7 +3798,7 @@ const Wl = ({
|
|
|
3798
3798
|
"div",
|
|
3799
3799
|
{
|
|
3800
3800
|
className: "px-5 mb-5",
|
|
3801
|
-
onClick:
|
|
3801
|
+
onClick: g,
|
|
3802
3802
|
children: s
|
|
3803
3803
|
}
|
|
3804
3804
|
),
|
|
@@ -3862,14 +3862,14 @@ function ds({
|
|
|
3862
3862
|
onDelete: u,
|
|
3863
3863
|
renderActions: p,
|
|
3864
3864
|
// optional override
|
|
3865
|
-
dragId:
|
|
3866
|
-
dropId:
|
|
3865
|
+
dragId: g,
|
|
3866
|
+
dropId: b,
|
|
3867
3867
|
indent: r = 24
|
|
3868
3868
|
}) {
|
|
3869
|
-
const { setNodeRef:
|
|
3870
|
-
const
|
|
3871
|
-
|
|
3872
|
-
},
|
|
3869
|
+
const { setNodeRef: y, isOver: d } = ur({ id: b }), { attributes: h, listeners: $, setNodeRef: T, transform: F, isDragging: A } = hr({ id: g }), I = F ? { transform: `translate3d(${Math.round(F.x)}px, ${Math.round(F.y)}px, 0)` } : void 0, [V, U] = M(!1), [G, B] = M(t.name), z = () => {
|
|
3870
|
+
const v = G.trim();
|
|
3871
|
+
U(!1), v && v !== t.name ? o?.(t, v) : B(t.name);
|
|
3872
|
+
}, f = ue(() => /* @__PURE__ */ e(
|
|
3873
3873
|
_n,
|
|
3874
3874
|
{
|
|
3875
3875
|
options: [
|
|
@@ -3877,42 +3877,42 @@ function ds({
|
|
|
3877
3877
|
{ action: "rename", label: "Rename" },
|
|
3878
3878
|
{ action: "delete", label: "Delete" }
|
|
3879
3879
|
],
|
|
3880
|
-
onSelect: (
|
|
3881
|
-
|
|
3880
|
+
onSelect: (w) => {
|
|
3881
|
+
w.action === "create" ? m?.(t) : w.action === "rename" ? U(!0) : w.action === "delete" && u?.(t);
|
|
3882
3882
|
}
|
|
3883
3883
|
}
|
|
3884
3884
|
), [t, m, u]);
|
|
3885
3885
|
return /* @__PURE__ */ n(
|
|
3886
3886
|
"div",
|
|
3887
3887
|
{
|
|
3888
|
-
ref:
|
|
3889
|
-
className: `tv-row ${d ? "tv-drop-over" : ""} ${
|
|
3888
|
+
ref: y,
|
|
3889
|
+
className: `tv-row ${d ? "tv-drop-over" : ""} ${A ? "dragging" : ""}`,
|
|
3890
3890
|
style: { ...I, paddingLeft: 8 + a * r },
|
|
3891
|
-
onClick: (
|
|
3892
|
-
|
|
3891
|
+
onClick: (v) => {
|
|
3892
|
+
v.target.closest(".tv-toggle") || v.target.tagName === "INPUT" || l?.(t);
|
|
3893
3893
|
},
|
|
3894
3894
|
children: [
|
|
3895
3895
|
/* @__PURE__ */ e("button", { className: "tv-toggle", onClick: i, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(wt, { size: 16 }) : /* @__PURE__ */ e(ve, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
|
|
3896
3896
|
/* @__PURE__ */ e(Me, { size: 16, className: "tv-folder-ic" }),
|
|
3897
|
-
/* @__PURE__ */ e("div", { className: "tv-name", ref:
|
|
3897
|
+
/* @__PURE__ */ e("div", { className: "tv-name", ref: T, children: V ? /* @__PURE__ */ e(
|
|
3898
3898
|
"input",
|
|
3899
3899
|
{
|
|
3900
3900
|
className: "tv-input",
|
|
3901
3901
|
value: G,
|
|
3902
|
-
onChange: (
|
|
3903
|
-
onBlur:
|
|
3904
|
-
onKeyDown: (
|
|
3905
|
-
|
|
3902
|
+
onChange: (v) => B(v.target.value),
|
|
3903
|
+
onBlur: z,
|
|
3904
|
+
onKeyDown: (v) => {
|
|
3905
|
+
v.key === "Enter" && z(), v.key === "Escape" && (U(!1), B(t.name));
|
|
3906
3906
|
},
|
|
3907
3907
|
autoFocus: !0
|
|
3908
3908
|
}
|
|
3909
|
-
) : /* @__PURE__ */ e("span", { onDoubleClick: () =>
|
|
3910
|
-
/* @__PURE__ */ e(cs, { listeners:
|
|
3909
|
+
) : /* @__PURE__ */ e("span", { onDoubleClick: () => U(!0), children: t.name }) }),
|
|
3910
|
+
/* @__PURE__ */ e(cs, { listeners: $, attributes: h }),
|
|
3911
3911
|
/* @__PURE__ */ e("div", { className: "tv-actions", children: p ? p(t, {
|
|
3912
3912
|
onCreateChild: () => m?.(t),
|
|
3913
|
-
onRename: () =>
|
|
3913
|
+
onRename: () => U(!0),
|
|
3914
3914
|
onDelete: () => u?.(t)
|
|
3915
|
-
}) :
|
|
3915
|
+
}) : f })
|
|
3916
3916
|
]
|
|
3917
3917
|
}
|
|
3918
3918
|
);
|
|
@@ -3939,14 +3939,14 @@ function gs(t, { rootId: a, getId: s, getParent: i, getName: l }) {
|
|
|
3939
3939
|
function bs(t, { rootId: a, getId: s, getName: i }) {
|
|
3940
3940
|
const l = /* @__PURE__ */ new Map();
|
|
3941
3941
|
function m(u, p) {
|
|
3942
|
-
const
|
|
3942
|
+
const g = s(u), b = {
|
|
3943
3943
|
...u,
|
|
3944
|
-
id:
|
|
3944
|
+
id: g,
|
|
3945
3945
|
name: i(u),
|
|
3946
3946
|
parentId: p || a,
|
|
3947
|
-
children: (u.children || []).map((r) => m(r,
|
|
3947
|
+
children: (u.children || []).map((r) => m(r, g))
|
|
3948
3948
|
};
|
|
3949
|
-
return l.set(
|
|
3949
|
+
return l.set(g, b), b;
|
|
3950
3950
|
}
|
|
3951
3951
|
return { roots: t.map((u) => m(u, null)), byId: l };
|
|
3952
3952
|
}
|
|
@@ -4000,104 +4000,104 @@ function Jl({
|
|
|
4000
4000
|
onSelect: o,
|
|
4001
4001
|
onCreateRoot: u,
|
|
4002
4002
|
onCreateChild: p,
|
|
4003
|
-
onRename:
|
|
4004
|
-
onDelete:
|
|
4003
|
+
onRename: g,
|
|
4004
|
+
onDelete: b,
|
|
4005
4005
|
onMove: r,
|
|
4006
|
-
renderActions:
|
|
4006
|
+
renderActions: y,
|
|
4007
4007
|
disableMoveToRoot: d = !1,
|
|
4008
4008
|
// ← allow root moves by default now
|
|
4009
4009
|
indentUnit: h = 24
|
|
4010
4010
|
}) {
|
|
4011
|
-
const { roots:
|
|
4011
|
+
const { roots: $ } = ue(() => ps(t) ? bs(t, { rootId: a, getId: i, getName: m }) : gs(
|
|
4012
4012
|
t.map((k) => ({ ...k })),
|
|
4013
4013
|
{ rootId: a, getId: i, getParent: l, getName: m }
|
|
4014
|
-
), [t, a, i, l, m]), [
|
|
4015
|
-
const
|
|
4016
|
-
return (function
|
|
4017
|
-
|
|
4018
|
-
|
|
4014
|
+
), [t, a, i, l, m]), [T, F] = M({}), A = ne((k) => {
|
|
4015
|
+
const E = {};
|
|
4016
|
+
return (function L(q) {
|
|
4017
|
+
q.forEach((S) => {
|
|
4018
|
+
E[S.id] = !0, S.children?.length && L(S.children);
|
|
4019
4019
|
});
|
|
4020
|
-
})(k),
|
|
4020
|
+
})(k), E;
|
|
4021
4021
|
}, []);
|
|
4022
|
-
|
|
4023
|
-
A(
|
|
4024
|
-
}, [
|
|
4025
|
-
const I =
|
|
4026
|
-
(k) =>
|
|
4022
|
+
se.useEffect(() => {
|
|
4023
|
+
F(A($));
|
|
4024
|
+
}, [$, A]);
|
|
4025
|
+
const I = ne(
|
|
4026
|
+
(k) => F((E) => ({ ...E, [k]: !E[k] })),
|
|
4027
4027
|
[]
|
|
4028
|
-
), [
|
|
4029
|
-
|
|
4028
|
+
), [V, U] = M(() => Le($));
|
|
4029
|
+
se.useEffect(() => U(Le($)), [$]);
|
|
4030
4030
|
const G = pr(
|
|
4031
4031
|
gr(yr, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
4032
|
-
),
|
|
4032
|
+
), B = xe(null), [z, f] = M(null), v = xe(0), w = () => {
|
|
4033
4033
|
}, C = ({ delta: k }) => {
|
|
4034
|
-
|
|
4035
|
-
}, N =
|
|
4036
|
-
({ active: k, over:
|
|
4037
|
-
const
|
|
4038
|
-
if (
|
|
4039
|
-
const
|
|
4040
|
-
if (!
|
|
4034
|
+
v.current = k?.x ?? 0;
|
|
4035
|
+
}, N = ne(
|
|
4036
|
+
({ active: k, over: E }) => {
|
|
4037
|
+
const L = v.current;
|
|
4038
|
+
if (v.current = 0, f(null), !k || !E) return;
|
|
4039
|
+
const q = String(k.id).replace(/^drag-/, ""), S = String(E.id).replace(/^drop-/, "");
|
|
4040
|
+
if (!q || !S || q === S) return;
|
|
4041
4041
|
let O = S;
|
|
4042
|
-
const D = Math.max(0, Math.floor(-
|
|
4042
|
+
const D = Math.max(0, Math.floor(-L / h));
|
|
4043
4043
|
if (D > 0) {
|
|
4044
4044
|
let W = S;
|
|
4045
4045
|
for (let pe = 0; pe < D; pe++) {
|
|
4046
|
-
const
|
|
4047
|
-
if (!
|
|
4048
|
-
if (!
|
|
4046
|
+
const j = Ta(V, W, null);
|
|
4047
|
+
if (!j) break;
|
|
4048
|
+
if (!j.parentId) {
|
|
4049
4049
|
O = a;
|
|
4050
4050
|
break;
|
|
4051
4051
|
}
|
|
4052
|
-
O =
|
|
4052
|
+
O = j.parentId, W = j.parentId;
|
|
4053
4053
|
}
|
|
4054
4054
|
}
|
|
4055
4055
|
if (d && O === a) {
|
|
4056
|
-
|
|
4056
|
+
U(Le($));
|
|
4057
4057
|
return;
|
|
4058
4058
|
}
|
|
4059
|
-
const P = Le(
|
|
4059
|
+
const P = Le(V), { newRoots: _, removed: R } = fs(P, q);
|
|
4060
4060
|
if (!R) return;
|
|
4061
4061
|
const Y = xs(_, O, R);
|
|
4062
|
-
|
|
4062
|
+
U(Y), r?.({ sourceId: q, destParentId: O, newTree: Y });
|
|
4063
4063
|
},
|
|
4064
|
-
[
|
|
4065
|
-
),
|
|
4066
|
-
(k,
|
|
4064
|
+
[V, $, a, d, h, r]
|
|
4065
|
+
), x = ne(
|
|
4066
|
+
(k, E = 0) => k.map((L) => /* @__PURE__ */ n(se.Fragment, { children: [
|
|
4067
4067
|
/* @__PURE__ */ e(
|
|
4068
4068
|
ds,
|
|
4069
4069
|
{
|
|
4070
|
-
node:
|
|
4071
|
-
depth:
|
|
4072
|
-
expanded:
|
|
4073
|
-
onToggle: () => I(
|
|
4070
|
+
node: L,
|
|
4071
|
+
depth: E,
|
|
4072
|
+
expanded: !!T[L.id],
|
|
4073
|
+
onToggle: () => I(L.id),
|
|
4074
4074
|
onSelect: o,
|
|
4075
4075
|
onCreateChild: p,
|
|
4076
|
-
onRename:
|
|
4077
|
-
onDelete:
|
|
4078
|
-
renderActions:
|
|
4079
|
-
dragId: `drag-${
|
|
4080
|
-
dropId: `drop-${
|
|
4076
|
+
onRename: g,
|
|
4077
|
+
onDelete: b,
|
|
4078
|
+
renderActions: y,
|
|
4079
|
+
dragId: `drag-${L.id}`,
|
|
4080
|
+
dropId: `drop-${L.id}`,
|
|
4081
4081
|
indent: h
|
|
4082
4082
|
}
|
|
4083
4083
|
),
|
|
4084
|
-
|
|
4085
|
-
] },
|
|
4086
|
-
[
|
|
4084
|
+
T[L.id] && L.children?.length > 0 ? x(L.children, E + 1) : null
|
|
4085
|
+
] }, L.id)),
|
|
4086
|
+
[T, h, p, b, g, o, y, I]
|
|
4087
4087
|
);
|
|
4088
|
-
return
|
|
4089
|
-
if (!
|
|
4090
|
-
const k = String(
|
|
4091
|
-
function
|
|
4092
|
-
for (const
|
|
4093
|
-
if (
|
|
4094
|
-
const S =
|
|
4088
|
+
return se.useMemo(() => {
|
|
4089
|
+
if (!z) return null;
|
|
4090
|
+
const k = String(z).replace(/^drag-/, "");
|
|
4091
|
+
function E(L) {
|
|
4092
|
+
for (const q of L) {
|
|
4093
|
+
if (q.id === k) return q;
|
|
4094
|
+
const S = q.children?.length ? E(q.children) : null;
|
|
4095
4095
|
if (S) return S;
|
|
4096
4096
|
}
|
|
4097
4097
|
return null;
|
|
4098
4098
|
}
|
|
4099
|
-
return
|
|
4100
|
-
}, [
|
|
4099
|
+
return E(V);
|
|
4100
|
+
}, [z, V]), /* @__PURE__ */ n("div", { className: "tv", children: [
|
|
4101
4101
|
s !== !1 && /* @__PURE__ */ n("div", { className: "tv-header", children: [
|
|
4102
4102
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
4103
4103
|
/* @__PURE__ */ e("button", { className: "tv-btn", onClick: u, children: "+ New folder" })
|
|
@@ -4112,11 +4112,11 @@ function Jl({
|
|
|
4112
4112
|
{
|
|
4113
4113
|
collisionDetection: xr,
|
|
4114
4114
|
sensors: G,
|
|
4115
|
-
onDragStart:
|
|
4115
|
+
onDragStart: w,
|
|
4116
4116
|
onDragMove: C,
|
|
4117
4117
|
onDragEnd: N,
|
|
4118
4118
|
modifiers: [fr],
|
|
4119
|
-
children: /* @__PURE__ */ e("div", { ref:
|
|
4119
|
+
children: /* @__PURE__ */ e("div", { ref: B, className: "tv-list", children: x(V, 0) })
|
|
4120
4120
|
}
|
|
4121
4121
|
)
|
|
4122
4122
|
] });
|
|
@@ -4135,21 +4135,21 @@ const Xl = ({
|
|
|
4135
4135
|
...u
|
|
4136
4136
|
// Pass remaining props to Tab.Group
|
|
4137
4137
|
}) => {
|
|
4138
|
-
const p = s === "vertical",
|
|
4138
|
+
const p = s === "vertical", g = (y) => ke(
|
|
4139
4139
|
"py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
|
|
4140
|
-
|
|
4141
|
-
),
|
|
4140
|
+
y ? "border-primaryX text-textX" : "border-transparent text-slate-600 hover:text-indigo-700"
|
|
4141
|
+
), b = (y) => ke(
|
|
4142
4142
|
"text-left text-sm rounded-md px-2 py-1.5 focus:outline-none",
|
|
4143
|
-
|
|
4144
|
-
), r = ({ selected:
|
|
4145
|
-
return /* @__PURE__ */ e(
|
|
4146
|
-
/* @__PURE__ */ e(
|
|
4147
|
-
/* @__PURE__ */ e(
|
|
4143
|
+
y ? "bg-primaryX text-white" : "text-textX hover:bg-lightgray-100 hover:text-primaryX"
|
|
4144
|
+
), r = ({ selected: y }) => o ? typeof o == "function" ? o(y) : o : p ? b(y) : g(y);
|
|
4145
|
+
return /* @__PURE__ */ e(re.Group, { vertical: p, ...u, children: p ? /* @__PURE__ */ n("div", { className: ke("flex gap-4", i), children: [
|
|
4146
|
+
/* @__PURE__ */ e(re.List, { className: ke("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", l), children: t.map((y) => /* @__PURE__ */ e(re, { className: r, children: y.label }, y.key)) }),
|
|
4147
|
+
/* @__PURE__ */ e(re.Panels, { unmount: !a, className: ke("flex-1", m), children: t.map((y) => /* @__PURE__ */ e(re.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: y.content }) }, y.key)) })
|
|
4148
4148
|
] }) : (
|
|
4149
4149
|
// mostly this part is used : horizontal
|
|
4150
4150
|
/* @__PURE__ */ n(te, { children: [
|
|
4151
|
-
/* @__PURE__ */ e(
|
|
4152
|
-
/* @__PURE__ */ e(
|
|
4151
|
+
/* @__PURE__ */ e(re.List, { className: ke("flex gap-6 border rounded-t-2xl px-1.5 border-gray-300 mb-3 ", l), children: t.map((y) => /* @__PURE__ */ e(re, { className: r, children: y.label }, y.key)) }),
|
|
4152
|
+
/* @__PURE__ */ e(re.Panels, { unmount: !a, className: ke("mt-2", m), children: t.map((y) => /* @__PURE__ */ e(re.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: y.content }) }, y.key)) })
|
|
4153
4153
|
] })
|
|
4154
4154
|
) });
|
|
4155
4155
|
};
|
|
@@ -4159,7 +4159,7 @@ function Hl(t, a = "YYYY-MM-DD HH:mm:ss") {
|
|
|
4159
4159
|
c.string;
|
|
4160
4160
|
function ys({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
4161
4161
|
console.log(t);
|
|
4162
|
-
const [l, m] =
|
|
4162
|
+
const [l, m] = se.useState(t), [o, u] = se.useState(() => {
|
|
4163
4163
|
const r = a && a[t.key] || {};
|
|
4164
4164
|
return console.log("Initial Section data for", t.key, r), r;
|
|
4165
4165
|
}), p = xe(a);
|
|
@@ -4170,30 +4170,30 @@ function ys({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4170
4170
|
console.log("Updated Section data for", t.key, r), u(r);
|
|
4171
4171
|
}
|
|
4172
4172
|
}, [a, t.key]), console.log("Section data", o);
|
|
4173
|
-
const
|
|
4173
|
+
const g = xe(o);
|
|
4174
4174
|
Z(() => {
|
|
4175
|
-
|
|
4175
|
+
g.current !== o && s && typeof s == "function" && (g.current = o, s(l.key, o));
|
|
4176
4176
|
}, [l.key, o, s]);
|
|
4177
|
-
const
|
|
4177
|
+
const b = (r) => {
|
|
4178
4178
|
if (!r.dependsOn) return !0;
|
|
4179
|
-
const { field:
|
|
4179
|
+
const { field: y, value: d, operator: h = "equals" } = r.dependsOn, $ = o[y];
|
|
4180
4180
|
switch (h) {
|
|
4181
4181
|
case "equals":
|
|
4182
|
-
return
|
|
4182
|
+
return $ === d;
|
|
4183
4183
|
case "notEquals":
|
|
4184
|
-
return
|
|
4184
|
+
return $ !== d;
|
|
4185
4185
|
case "contains":
|
|
4186
|
-
return Array.isArray(
|
|
4186
|
+
return Array.isArray($) && $.includes(d);
|
|
4187
4187
|
case "notContains":
|
|
4188
|
-
return !Array.isArray(
|
|
4188
|
+
return !Array.isArray($) || !$.includes(d);
|
|
4189
4189
|
case "greaterThan":
|
|
4190
|
-
return Number(
|
|
4190
|
+
return Number($) > Number(d);
|
|
4191
4191
|
case "lessThan":
|
|
4192
|
-
return Number(
|
|
4192
|
+
return Number($) < Number(d);
|
|
4193
4193
|
case "isEmpty":
|
|
4194
|
-
return
|
|
4194
|
+
return !$ || Array.isArray($) && $.length === 0;
|
|
4195
4195
|
case "isNotEmpty":
|
|
4196
|
-
return
|
|
4196
|
+
return $ && (!Array.isArray($) || $.length > 0);
|
|
4197
4197
|
default:
|
|
4198
4198
|
return !0;
|
|
4199
4199
|
}
|
|
@@ -4211,7 +4211,7 @@ function ys({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4211
4211
|
}
|
|
4212
4212
|
),
|
|
4213
4213
|
/* @__PURE__ */ e("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: l.description }),
|
|
4214
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: l.fields.map((r,
|
|
4214
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: l.fields.map((r, y) => b(r) && /* @__PURE__ */ n("div", { style: { marginBottom: "10px" }, children: [
|
|
4215
4215
|
/* @__PURE__ */ n(
|
|
4216
4216
|
"label",
|
|
4217
4217
|
{
|
|
@@ -4411,7 +4411,6 @@ function ys({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4411
4411
|
const h = { ...o, [r.key]: d };
|
|
4412
4412
|
u(h), s && s(l.key, h);
|
|
4413
4413
|
},
|
|
4414
|
-
label: r.placeholder || r.label,
|
|
4415
4414
|
disabled: r.disabled ? r.disabled : !1
|
|
4416
4415
|
}
|
|
4417
4416
|
),
|
|
@@ -4474,8 +4473,8 @@ function ys({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4474
4473
|
value: d.value,
|
|
4475
4474
|
checked: o[r.key] === d.value,
|
|
4476
4475
|
onChange: (h) => {
|
|
4477
|
-
const
|
|
4478
|
-
u(
|
|
4476
|
+
const $ = { ...o, [r.key]: h.target.value };
|
|
4477
|
+
u($), s && s(l.key, $);
|
|
4479
4478
|
},
|
|
4480
4479
|
disabled: r.disabled
|
|
4481
4480
|
}
|
|
@@ -4592,8 +4591,8 @@ function ys({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4592
4591
|
type: "file",
|
|
4593
4592
|
name: r.key,
|
|
4594
4593
|
onChange: (d) => {
|
|
4595
|
-
const h = d.target.files[0],
|
|
4596
|
-
u(
|
|
4594
|
+
const h = d.target.files[0], $ = { ...o, [r.key]: h ? h.name : "" };
|
|
4595
|
+
u($), s && s(l.key, $);
|
|
4597
4596
|
},
|
|
4598
4597
|
accept: r.accept,
|
|
4599
4598
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4632,407 +4631,407 @@ function ys({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4632
4631
|
children: r.info
|
|
4633
4632
|
}
|
|
4634
4633
|
)
|
|
4635
|
-
] },
|
|
4634
|
+
] }, y)) })
|
|
4636
4635
|
] }) });
|
|
4637
4636
|
}
|
|
4638
4637
|
const vs = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
4639
4638
|
function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
4640
4639
|
console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
|
|
4641
|
-
const [l, m] =
|
|
4640
|
+
const [l, m] = M(t), [o, u] = M(null), [p, g] = M(null);
|
|
4642
4641
|
console.log(`[DataTableRenderer] ${l.key} - Received props:`, { item: t, initialData: a });
|
|
4643
|
-
const [
|
|
4644
|
-
const
|
|
4645
|
-
return console.log(`[DataTableRenderer] ${l.key} - Initial data:`,
|
|
4646
|
-
}),
|
|
4642
|
+
const [b, r] = M(() => {
|
|
4643
|
+
const f = a && a[l.key] || [], v = f.length > 0 ? f : [{ id: 0 }];
|
|
4644
|
+
return console.log(`[DataTableRenderer] ${l.key} - Initial data:`, v), v;
|
|
4645
|
+
}), y = xe(a);
|
|
4647
4646
|
Z(() => {
|
|
4648
|
-
if (console.log(`[DataTableRenderer] ${l.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${l.key} - Previous:`,
|
|
4649
|
-
|
|
4650
|
-
const
|
|
4651
|
-
console.log(`[DataTableRenderer] ${l.key} - Setting new data:`,
|
|
4647
|
+
if (console.log(`[DataTableRenderer] ${l.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${l.key} - Previous:`, y.current), console.log(`[DataTableRenderer] ${l.key} - Current:`, a), y.current !== a) {
|
|
4648
|
+
y.current = a;
|
|
4649
|
+
const f = a && a[l.key] || [], v = f.length > 0 ? f : [{ id: 0 }];
|
|
4650
|
+
console.log(`[DataTableRenderer] ${l.key} - Setting new data:`, v), r(v);
|
|
4652
4651
|
}
|
|
4653
4652
|
}, [a, l.key]);
|
|
4654
|
-
const d = xe(
|
|
4653
|
+
const d = xe(b), h = xe(null);
|
|
4655
4654
|
Z(() => {
|
|
4656
|
-
d.current !==
|
|
4657
|
-
s(l.key,
|
|
4655
|
+
d.current !== b && s && typeof s == "function" && (d.current = b, h.current && clearTimeout(h.current), h.current = setTimeout(() => {
|
|
4656
|
+
s(l.key, b);
|
|
4658
4657
|
}, 300));
|
|
4659
|
-
}, [l.key,
|
|
4658
|
+
}, [l.key, b, s]), Z(() => () => {
|
|
4660
4659
|
h.current && clearTimeout(h.current);
|
|
4661
4660
|
}, []);
|
|
4662
|
-
const
|
|
4663
|
-
const
|
|
4664
|
-
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: N, value:
|
|
4665
|
-
const
|
|
4666
|
-
return
|
|
4661
|
+
const $ = (f) => {
|
|
4662
|
+
const v = (N, x) => {
|
|
4663
|
+
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: N, value: x, type: typeof x }), r((k) => {
|
|
4664
|
+
const E = [...k];
|
|
4665
|
+
return E[N][f.key] = x, E;
|
|
4667
4666
|
});
|
|
4668
|
-
},
|
|
4669
|
-
const
|
|
4670
|
-
return
|
|
4667
|
+
}, w = (N) => i[l.key]?.[N]?.[f.key], C = (N) => {
|
|
4668
|
+
const x = w(N);
|
|
4669
|
+
return x ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: x }) : null;
|
|
4671
4670
|
};
|
|
4672
|
-
switch (
|
|
4671
|
+
switch (f.fieldtype) {
|
|
4673
4672
|
case "text":
|
|
4674
|
-
return (N,
|
|
4673
|
+
return (N, x) => /* @__PURE__ */ n("div", { children: [
|
|
4675
4674
|
/* @__PURE__ */ e(
|
|
4676
4675
|
X,
|
|
4677
4676
|
{
|
|
4678
|
-
value: N[
|
|
4679
|
-
onChange: (k) =>
|
|
4680
|
-
placeholder:
|
|
4681
|
-
required:
|
|
4682
|
-
className: `w-full ${x
|
|
4677
|
+
value: N[f.key] || "",
|
|
4678
|
+
onChange: (k) => v(x, k.target.value),
|
|
4679
|
+
placeholder: f.placeholder || `Enter ${f.label}`,
|
|
4680
|
+
required: f.required,
|
|
4681
|
+
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
4683
4682
|
}
|
|
4684
4683
|
),
|
|
4685
|
-
C(
|
|
4684
|
+
C(x)
|
|
4686
4685
|
] });
|
|
4687
4686
|
case "textarea":
|
|
4688
|
-
return (N,
|
|
4687
|
+
return (N, x) => /* @__PURE__ */ n("div", { children: [
|
|
4689
4688
|
/* @__PURE__ */ e(
|
|
4690
4689
|
ya,
|
|
4691
4690
|
{
|
|
4692
|
-
value: N[
|
|
4693
|
-
onChange: (k) =>
|
|
4694
|
-
placeholder:
|
|
4695
|
-
required:
|
|
4696
|
-
className: `w-full ${x
|
|
4691
|
+
value: N[f.key] || "",
|
|
4692
|
+
onChange: (k) => v(x, k.target.value),
|
|
4693
|
+
placeholder: f.placeholder || `Enter ${f.label}`,
|
|
4694
|
+
required: f.required,
|
|
4695
|
+
className: `w-full ${w(x) ? "border-red-500" : ""}`,
|
|
4697
4696
|
rows: 3
|
|
4698
4697
|
}
|
|
4699
4698
|
),
|
|
4700
|
-
C(
|
|
4699
|
+
C(x)
|
|
4701
4700
|
] });
|
|
4702
4701
|
case "number":
|
|
4703
|
-
return (N,
|
|
4702
|
+
return (N, x) => /* @__PURE__ */ n("div", { children: [
|
|
4704
4703
|
/* @__PURE__ */ e(
|
|
4705
4704
|
X,
|
|
4706
4705
|
{
|
|
4707
4706
|
type: "number",
|
|
4708
|
-
value: N[
|
|
4709
|
-
onChange: (k) =>
|
|
4710
|
-
placeholder:
|
|
4711
|
-
required:
|
|
4712
|
-
className: `w-full ${x
|
|
4707
|
+
value: N[f.key] || "",
|
|
4708
|
+
onChange: (k) => v(x, k.target.value),
|
|
4709
|
+
placeholder: f.placeholder || `Enter ${f.label}`,
|
|
4710
|
+
required: f.required,
|
|
4711
|
+
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
4713
4712
|
}
|
|
4714
4713
|
),
|
|
4715
|
-
C(
|
|
4714
|
+
C(x)
|
|
4716
4715
|
] });
|
|
4717
4716
|
case "email":
|
|
4718
|
-
return (N,
|
|
4717
|
+
return (N, x) => /* @__PURE__ */ n("div", { children: [
|
|
4719
4718
|
/* @__PURE__ */ e(
|
|
4720
4719
|
X,
|
|
4721
4720
|
{
|
|
4722
4721
|
type: "email",
|
|
4723
|
-
value: N[
|
|
4724
|
-
onChange: (k) =>
|
|
4725
|
-
placeholder:
|
|
4726
|
-
required:
|
|
4727
|
-
className: `w-full ${x
|
|
4722
|
+
value: N[f.key] || "",
|
|
4723
|
+
onChange: (k) => v(x, k.target.value),
|
|
4724
|
+
placeholder: f.placeholder || "Enter email address",
|
|
4725
|
+
required: f.required,
|
|
4726
|
+
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
4728
4727
|
}
|
|
4729
4728
|
),
|
|
4730
|
-
C(
|
|
4729
|
+
C(x)
|
|
4731
4730
|
] });
|
|
4732
4731
|
case "url":
|
|
4733
|
-
return (N,
|
|
4732
|
+
return (N, x) => /* @__PURE__ */ n("div", { children: [
|
|
4734
4733
|
/* @__PURE__ */ e(
|
|
4735
4734
|
X,
|
|
4736
4735
|
{
|
|
4737
4736
|
type: "url",
|
|
4738
|
-
value: N[
|
|
4739
|
-
onChange: (k) =>
|
|
4740
|
-
placeholder:
|
|
4741
|
-
required:
|
|
4742
|
-
className: `w-full ${x
|
|
4737
|
+
value: N[f.key] || "",
|
|
4738
|
+
onChange: (k) => v(x, k.target.value),
|
|
4739
|
+
placeholder: f.placeholder || "Enter URL",
|
|
4740
|
+
required: f.required,
|
|
4741
|
+
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
4743
4742
|
}
|
|
4744
4743
|
),
|
|
4745
|
-
C(
|
|
4744
|
+
C(x)
|
|
4746
4745
|
] });
|
|
4747
4746
|
case "password":
|
|
4748
|
-
return (N,
|
|
4747
|
+
return (N, x) => /* @__PURE__ */ n("div", { children: [
|
|
4749
4748
|
/* @__PURE__ */ e(
|
|
4750
4749
|
X,
|
|
4751
4750
|
{
|
|
4752
4751
|
type: "password",
|
|
4753
|
-
value: N[
|
|
4754
|
-
onChange: (k) =>
|
|
4755
|
-
placeholder:
|
|
4756
|
-
required:
|
|
4757
|
-
className: `w-full ${x
|
|
4752
|
+
value: N[f.key] || "",
|
|
4753
|
+
onChange: (k) => v(x, k.target.value),
|
|
4754
|
+
placeholder: f.placeholder || "Enter password",
|
|
4755
|
+
required: f.required,
|
|
4756
|
+
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
4758
4757
|
}
|
|
4759
4758
|
),
|
|
4760
|
-
C(
|
|
4759
|
+
C(x)
|
|
4761
4760
|
] });
|
|
4762
4761
|
case "select":
|
|
4763
4762
|
case "dropdown":
|
|
4764
|
-
return (N,
|
|
4763
|
+
return (N, x) => /* @__PURE__ */ n("div", { children: [
|
|
4765
4764
|
/* @__PURE__ */ e(
|
|
4766
4765
|
ft,
|
|
4767
4766
|
{
|
|
4768
|
-
value: N[
|
|
4769
|
-
onChange: (k) =>
|
|
4770
|
-
options:
|
|
4771
|
-
placeholder:
|
|
4772
|
-
required:
|
|
4773
|
-
className: `w-full ${x
|
|
4767
|
+
value: N[f.key] || "",
|
|
4768
|
+
onChange: (k) => v(x, k),
|
|
4769
|
+
options: f.options || [],
|
|
4770
|
+
placeholder: f.placeholder || `Select ${f.label}`,
|
|
4771
|
+
required: f.required,
|
|
4772
|
+
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
4774
4773
|
}
|
|
4775
4774
|
),
|
|
4776
|
-
C(
|
|
4775
|
+
C(x)
|
|
4777
4776
|
] });
|
|
4778
4777
|
case "selectDynamic":
|
|
4779
|
-
return (N,
|
|
4778
|
+
return (N, x) => {
|
|
4780
4779
|
const k = () => {
|
|
4781
|
-
if (
|
|
4782
|
-
const { config:
|
|
4780
|
+
if (f.optionsFrom && a) {
|
|
4781
|
+
const { config: E, valueField: L, labelField: q } = f.optionsFrom, S = a[E] || [];
|
|
4783
4782
|
if (Array.isArray(S))
|
|
4784
4783
|
return S.map((O) => ({
|
|
4785
|
-
id: O[
|
|
4786
|
-
value: O[
|
|
4787
|
-
label: O[
|
|
4784
|
+
id: O[L] || "",
|
|
4785
|
+
value: O[L] || "",
|
|
4786
|
+
label: O[q] || ""
|
|
4788
4787
|
}));
|
|
4789
4788
|
}
|
|
4790
|
-
return
|
|
4789
|
+
return f.options || [];
|
|
4791
4790
|
};
|
|
4792
4791
|
return /* @__PURE__ */ n("div", { children: [
|
|
4793
4792
|
/* @__PURE__ */ e(
|
|
4794
4793
|
ft,
|
|
4795
4794
|
{
|
|
4796
|
-
index:
|
|
4797
|
-
value: N[
|
|
4798
|
-
onChange: (
|
|
4795
|
+
index: x,
|
|
4796
|
+
value: N[f.key] || "",
|
|
4797
|
+
onChange: (E) => v(x, E),
|
|
4799
4798
|
options: k(),
|
|
4800
|
-
placeholder:
|
|
4801
|
-
required:
|
|
4802
|
-
className: `w-full ${x
|
|
4799
|
+
placeholder: f.placeholder || `Select ${f.label}`,
|
|
4800
|
+
required: f.required,
|
|
4801
|
+
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
4803
4802
|
},
|
|
4804
4803
|
Math.random()
|
|
4805
4804
|
),
|
|
4806
|
-
C(
|
|
4805
|
+
C(x)
|
|
4807
4806
|
] });
|
|
4808
4807
|
};
|
|
4809
4808
|
case "multiselect":
|
|
4810
|
-
return (N,
|
|
4811
|
-
const k = N[
|
|
4809
|
+
return (N, x) => {
|
|
4810
|
+
const k = N[f.key] || [];
|
|
4812
4811
|
return /* @__PURE__ */ e(
|
|
4813
4812
|
nt,
|
|
4814
4813
|
{
|
|
4815
4814
|
selectedItems: k,
|
|
4816
|
-
onSelectionChange: (
|
|
4817
|
-
options:
|
|
4818
|
-
placeholder:
|
|
4815
|
+
onSelectionChange: (E) => v(x, E),
|
|
4816
|
+
options: f.options || [],
|
|
4817
|
+
placeholder: f.placeholder || `Select ${f.label}`,
|
|
4819
4818
|
className: "w-full"
|
|
4820
4819
|
}
|
|
4821
4820
|
);
|
|
4822
4821
|
};
|
|
4823
4822
|
case "checkbox":
|
|
4824
4823
|
case "boolean":
|
|
4825
|
-
return (N,
|
|
4824
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4826
4825
|
ma,
|
|
4827
4826
|
{
|
|
4828
|
-
checked: !!N[
|
|
4829
|
-
onChange: (k) =>
|
|
4830
|
-
label:
|
|
4827
|
+
checked: !!N[f.key],
|
|
4828
|
+
onChange: (k) => v(x, k),
|
|
4829
|
+
label: f.placeholder || f.label,
|
|
4831
4830
|
className: "w-full"
|
|
4832
4831
|
}
|
|
4833
4832
|
);
|
|
4834
4833
|
case "toggle":
|
|
4835
4834
|
case "switch":
|
|
4836
|
-
return (N,
|
|
4835
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4837
4836
|
va,
|
|
4838
4837
|
{
|
|
4839
|
-
isOn: !!N[
|
|
4840
|
-
onToggle: (k) =>
|
|
4841
|
-
label:
|
|
4838
|
+
isOn: !!N[f.key],
|
|
4839
|
+
onToggle: (k) => v(x, k),
|
|
4840
|
+
label: f.placeholder || f.label,
|
|
4842
4841
|
className: "w-full"
|
|
4843
4842
|
}
|
|
4844
4843
|
);
|
|
4845
4844
|
case "date":
|
|
4846
|
-
return (N,
|
|
4845
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4847
4846
|
ga,
|
|
4848
4847
|
{
|
|
4849
|
-
selectedDate: N[
|
|
4850
|
-
onDateChange: (k) =>
|
|
4851
|
-
placeholder:
|
|
4848
|
+
selectedDate: N[f.key] ? new Date(N[f.key]) : null,
|
|
4849
|
+
onDateChange: (k) => v(x, k ? k.toISOString().split("T")[0] : ""),
|
|
4850
|
+
placeholder: f.placeholder || "Select date",
|
|
4852
4851
|
className: "w-full"
|
|
4853
4852
|
}
|
|
4854
4853
|
);
|
|
4855
4854
|
case "datetime":
|
|
4856
|
-
return (N,
|
|
4855
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4857
4856
|
X,
|
|
4858
4857
|
{
|
|
4859
4858
|
type: "datetime-local",
|
|
4860
|
-
value: N[
|
|
4861
|
-
onChange: (k) =>
|
|
4862
|
-
placeholder:
|
|
4863
|
-
required:
|
|
4859
|
+
value: N[f.key] || "",
|
|
4860
|
+
onChange: (k) => v(x, k.target.value),
|
|
4861
|
+
placeholder: f.placeholder || "Select date and time",
|
|
4862
|
+
required: f.required,
|
|
4864
4863
|
className: "w-full"
|
|
4865
4864
|
}
|
|
4866
4865
|
);
|
|
4867
4866
|
case "time":
|
|
4868
|
-
return (N,
|
|
4867
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4869
4868
|
X,
|
|
4870
4869
|
{
|
|
4871
4870
|
type: "time",
|
|
4872
|
-
value: N[
|
|
4873
|
-
onChange: (k) =>
|
|
4874
|
-
placeholder:
|
|
4875
|
-
required:
|
|
4871
|
+
value: N[f.key] || "",
|
|
4872
|
+
onChange: (k) => v(x, k.target.value),
|
|
4873
|
+
placeholder: f.placeholder || "Select time",
|
|
4874
|
+
required: f.required,
|
|
4876
4875
|
className: "w-full"
|
|
4877
4876
|
}
|
|
4878
4877
|
);
|
|
4879
4878
|
case "radio":
|
|
4880
|
-
return (N,
|
|
4879
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4881
4880
|
ba,
|
|
4882
4881
|
{
|
|
4883
|
-
selectedValue: N[
|
|
4884
|
-
onValueChange: (k) =>
|
|
4885
|
-
options:
|
|
4882
|
+
selectedValue: N[f.key] || "",
|
|
4883
|
+
onValueChange: (k) => v(x, k),
|
|
4884
|
+
options: f.options || [],
|
|
4886
4885
|
className: "w-full"
|
|
4887
4886
|
}
|
|
4888
4887
|
);
|
|
4889
4888
|
case "search":
|
|
4890
|
-
return (N,
|
|
4889
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4891
4890
|
be,
|
|
4892
4891
|
{
|
|
4893
|
-
value: N[
|
|
4894
|
-
onChange: (k) =>
|
|
4895
|
-
placeholder:
|
|
4892
|
+
value: N[f.key] || "",
|
|
4893
|
+
onChange: (k) => v(x, k),
|
|
4894
|
+
placeholder: f.placeholder || `Search ${f.label}`,
|
|
4896
4895
|
className: "w-full"
|
|
4897
4896
|
}
|
|
4898
4897
|
);
|
|
4899
4898
|
case "audience":
|
|
4900
|
-
return (N,
|
|
4901
|
-
const k = N[
|
|
4899
|
+
return (N, x) => {
|
|
4900
|
+
const k = N[f.key] || { users: [], groups: [], roles: [] }, E = [
|
|
4902
4901
|
...k.users || [],
|
|
4903
4902
|
...k.groups || [],
|
|
4904
4903
|
...k.roles || []
|
|
4905
4904
|
];
|
|
4906
4905
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
4907
|
-
/* @__PURE__ */ e(vs, { children:
|
|
4906
|
+
/* @__PURE__ */ e(vs, { children: E.length > 0 ? E.slice(0, 3).map((L, q) => /* @__PURE__ */ e(
|
|
4908
4907
|
ze,
|
|
4909
4908
|
{
|
|
4910
4909
|
size: "small",
|
|
4911
|
-
name:
|
|
4912
|
-
src:
|
|
4910
|
+
name: L.name || L.displayName || L.id,
|
|
4911
|
+
src: L.avatarUrl
|
|
4913
4912
|
},
|
|
4914
|
-
|
|
4913
|
+
q
|
|
4915
4914
|
)) : null }),
|
|
4916
4915
|
/* @__PURE__ */ e(
|
|
4917
4916
|
"button",
|
|
4918
4917
|
{
|
|
4919
4918
|
className: "text-blue-600 font-semibold hover:text-blue-800",
|
|
4920
4919
|
onClick: () => {
|
|
4921
|
-
|
|
4920
|
+
g(f.key), u(x);
|
|
4922
4921
|
},
|
|
4923
|
-
children:
|
|
4922
|
+
children: E.length > 0 ? "Edit" : "Assign"
|
|
4924
4923
|
}
|
|
4925
4924
|
)
|
|
4926
4925
|
] });
|
|
4927
4926
|
};
|
|
4928
4927
|
case "color":
|
|
4929
|
-
return (N,
|
|
4928
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4930
4929
|
X,
|
|
4931
4930
|
{
|
|
4932
4931
|
type: "color",
|
|
4933
|
-
value: N[
|
|
4934
|
-
onChange: (k) =>
|
|
4932
|
+
value: N[f.key] || "#000000",
|
|
4933
|
+
onChange: (k) => v(x, k.target.value),
|
|
4935
4934
|
className: "w-full h-10"
|
|
4936
4935
|
}
|
|
4937
4936
|
);
|
|
4938
4937
|
case "range":
|
|
4939
|
-
return (N,
|
|
4938
|
+
return (N, x) => /* @__PURE__ */ n("div", { className: "w-full", children: [
|
|
4940
4939
|
/* @__PURE__ */ e(
|
|
4941
4940
|
X,
|
|
4942
4941
|
{
|
|
4943
4942
|
type: "range",
|
|
4944
|
-
value: N[
|
|
4945
|
-
onChange: (k) =>
|
|
4946
|
-
min:
|
|
4947
|
-
max:
|
|
4948
|
-
step:
|
|
4943
|
+
value: N[f.key] || f.min || 0,
|
|
4944
|
+
onChange: (k) => v(x, k.target.value),
|
|
4945
|
+
min: f.min || 0,
|
|
4946
|
+
max: f.max || 100,
|
|
4947
|
+
step: f.step || 1,
|
|
4949
4948
|
className: "w-full"
|
|
4950
4949
|
}
|
|
4951
4950
|
),
|
|
4952
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: N[
|
|
4951
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: N[f.key] || f.min || 0 })
|
|
4953
4952
|
] });
|
|
4954
4953
|
case "file":
|
|
4955
|
-
return (N,
|
|
4954
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4956
4955
|
X,
|
|
4957
4956
|
{
|
|
4958
4957
|
type: "file",
|
|
4959
4958
|
onChange: (k) => {
|
|
4960
|
-
const
|
|
4961
|
-
|
|
4959
|
+
const E = k.target.files[0];
|
|
4960
|
+
v(x, E ? E.name : "");
|
|
4962
4961
|
},
|
|
4963
|
-
accept:
|
|
4962
|
+
accept: f.accept,
|
|
4964
4963
|
className: "w-full"
|
|
4965
4964
|
}
|
|
4966
4965
|
);
|
|
4967
4966
|
case "hidden":
|
|
4968
|
-
return (N,
|
|
4967
|
+
return (N, x) => /* @__PURE__ */ e(
|
|
4969
4968
|
X,
|
|
4970
4969
|
{
|
|
4971
4970
|
type: "hidden",
|
|
4972
|
-
value: N[
|
|
4973
|
-
onChange: (k) =>
|
|
4971
|
+
value: N[f.key] || "",
|
|
4972
|
+
onChange: (k) => v(x, k.target.value)
|
|
4974
4973
|
}
|
|
4975
4974
|
);
|
|
4976
4975
|
// Default fallback for unknown field types
|
|
4977
4976
|
default:
|
|
4978
|
-
return (N,
|
|
4977
|
+
return (N, x) => /* @__PURE__ */ n("div", { children: [
|
|
4979
4978
|
/* @__PURE__ */ e(
|
|
4980
4979
|
X,
|
|
4981
4980
|
{
|
|
4982
|
-
value: N[
|
|
4983
|
-
onChange: (k) =>
|
|
4984
|
-
placeholder:
|
|
4985
|
-
required:
|
|
4986
|
-
className: `w-full ${x
|
|
4981
|
+
value: N[f.key] || "",
|
|
4982
|
+
onChange: (k) => v(x, k.target.value),
|
|
4983
|
+
placeholder: f.placeholder || `Enter ${f.label}`,
|
|
4984
|
+
required: f.required,
|
|
4985
|
+
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
4987
4986
|
}
|
|
4988
4987
|
),
|
|
4989
|
-
C(
|
|
4988
|
+
C(x)
|
|
4990
4989
|
] });
|
|
4991
4990
|
}
|
|
4992
|
-
},
|
|
4993
|
-
console.log("[DataTableRenderer] Adding blank row"), r((
|
|
4994
|
-
console.log("[DataTableRenderer] Current data before add:",
|
|
4995
|
-
const
|
|
4996
|
-
id:
|
|
4991
|
+
}, T = ne(() => {
|
|
4992
|
+
console.log("[DataTableRenderer] Adding blank row"), r((f) => {
|
|
4993
|
+
console.log("[DataTableRenderer] Current data before add:", f);
|
|
4994
|
+
const v = {
|
|
4995
|
+
id: f.length
|
|
4997
4996
|
// Assign next available ID
|
|
4998
4997
|
};
|
|
4999
4998
|
l.fields.forEach((C) => {
|
|
5000
|
-
C.fieldtype === "audience" ?
|
|
5001
|
-
}), console.log("[DataTableRenderer] New blank row:",
|
|
5002
|
-
const
|
|
5003
|
-
return console.log("[DataTableRenderer] Updated data:",
|
|
4999
|
+
C.fieldtype === "audience" ? v[C.key] = { users: [], groups: [], roles: [] } : v[C.key] = C.default || "";
|
|
5000
|
+
}), console.log("[DataTableRenderer] New blank row:", v);
|
|
5001
|
+
const w = [...f, v];
|
|
5002
|
+
return console.log("[DataTableRenderer] Updated data:", w), w;
|
|
5004
5003
|
});
|
|
5005
|
-
}, [l.fields]),
|
|
5006
|
-
r((
|
|
5007
|
-
if (
|
|
5008
|
-
return
|
|
5009
|
-
const
|
|
5010
|
-
return
|
|
5004
|
+
}, [l.fields]), F = ne((f) => {
|
|
5005
|
+
r((v) => {
|
|
5006
|
+
if (v.length <= 1)
|
|
5007
|
+
return v;
|
|
5008
|
+
const w = [...v];
|
|
5009
|
+
return w.splice(f, 1), w;
|
|
5011
5010
|
});
|
|
5012
|
-
}, []), [
|
|
5013
|
-
I(
|
|
5014
|
-
}, []),
|
|
5015
|
-
|
|
5016
|
-
}, []), G =
|
|
5017
|
-
|
|
5018
|
-
const C = [...
|
|
5019
|
-
return C.splice(
|
|
5011
|
+
}, []), [A, I] = M(null), V = ne((f, v) => {
|
|
5012
|
+
I(v), f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/html", "");
|
|
5013
|
+
}, []), U = ne((f) => {
|
|
5014
|
+
f.preventDefault(), f.dataTransfer.dropEffect = "move";
|
|
5015
|
+
}, []), G = ne((f, v) => {
|
|
5016
|
+
f.preventDefault(), !(A === null || A === v) && (r((w) => {
|
|
5017
|
+
const C = [...w], N = C[A];
|
|
5018
|
+
return C.splice(A, 1), C.splice(v, 0, N), C;
|
|
5020
5019
|
}), I(null));
|
|
5021
|
-
}, [
|
|
5020
|
+
}, [A]), B = ne(() => {
|
|
5022
5021
|
I(null);
|
|
5023
|
-
}, []),
|
|
5024
|
-
console.log("[DataTableRenderer] handleAddAudience called with:",
|
|
5025
|
-
const
|
|
5026
|
-
if (o !== null && p &&
|
|
5027
|
-
const C =
|
|
5028
|
-
|
|
5029
|
-
users: [...
|
|
5030
|
-
groups: [...
|
|
5031
|
-
roles: [...
|
|
5032
|
-
}, console.log("[DataTableRenderer] Updated audience data:",
|
|
5022
|
+
}, []), z = ne((f) => {
|
|
5023
|
+
console.log("[DataTableRenderer] handleAddAudience called with:", f), r((v) => {
|
|
5024
|
+
const w = [...v];
|
|
5025
|
+
if (o !== null && p && w[o]) {
|
|
5026
|
+
const C = f.pendingInvites || [], N = C.filter((E) => E.type === "User"), x = C.filter((E) => E.type === "Group"), k = C.filter((E) => E.type === "Role");
|
|
5027
|
+
w[o][p] = {
|
|
5028
|
+
users: [...w[o][p]?.users || [], ...N],
|
|
5029
|
+
groups: [...w[o][p]?.groups || [], ...x],
|
|
5030
|
+
roles: [...w[o][p]?.roles || [], ...k]
|
|
5031
|
+
}, console.log("[DataTableRenderer] Updated audience data:", w[o][p]);
|
|
5033
5032
|
}
|
|
5034
|
-
return
|
|
5035
|
-
}), u(null),
|
|
5033
|
+
return w;
|
|
5034
|
+
}), u(null), g(null);
|
|
5036
5035
|
}, [o, p]);
|
|
5037
5036
|
return /* @__PURE__ */ n("div", { children: [
|
|
5038
5037
|
/* @__PURE__ */ n("div", { style: { marginBottom: "20px" }, children: [
|
|
@@ -5042,7 +5041,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5042
5041
|
"button",
|
|
5043
5042
|
{
|
|
5044
5043
|
className: "btn btn-primary text-white px-6 py-2 rounded-2xl cursor-pointer hover:bg-gray-800",
|
|
5045
|
-
onClick:
|
|
5044
|
+
onClick: T,
|
|
5046
5045
|
children: "Add"
|
|
5047
5046
|
}
|
|
5048
5047
|
)
|
|
@@ -5052,32 +5051,32 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5052
5051
|
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ n("table", { className: "min-w-full bg-white border border-gray-300", style: { marginBottom: "20px" }, children: [
|
|
5053
5052
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "bg-gray-50", children: [
|
|
5054
5053
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-10" }),
|
|
5055
|
-
l.fields.map((
|
|
5054
|
+
l.fields.map((f, v) => /* @__PURE__ */ e(
|
|
5056
5055
|
"th",
|
|
5057
5056
|
{
|
|
5058
5057
|
className: "px-4 py-2 text-left text-sm font-medium text-gray-700",
|
|
5059
|
-
children:
|
|
5058
|
+
children: f.label || f.key
|
|
5060
5059
|
},
|
|
5061
|
-
|
|
5060
|
+
v
|
|
5062
5061
|
)),
|
|
5063
5062
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-16" })
|
|
5064
5063
|
] }) }),
|
|
5065
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
5064
|
+
/* @__PURE__ */ e("tbody", { children: b.map((f, v) => /* @__PURE__ */ n(
|
|
5066
5065
|
"tr",
|
|
5067
5066
|
{
|
|
5068
|
-
className: `hover:bg-gray-50 ${
|
|
5067
|
+
className: `hover:bg-gray-50 ${A === v ? "opacity-50" : ""}`,
|
|
5069
5068
|
draggable: !0,
|
|
5070
|
-
onDragStart: (
|
|
5071
|
-
onDragOver:
|
|
5072
|
-
onDrop: (
|
|
5073
|
-
onDragEnd:
|
|
5069
|
+
onDragStart: (w) => V(w, v),
|
|
5070
|
+
onDragOver: U,
|
|
5071
|
+
onDrop: (w) => G(w, v),
|
|
5072
|
+
onDragEnd: B,
|
|
5074
5073
|
children: [
|
|
5075
5074
|
/* @__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(Nt, { size: 16 }) }) }),
|
|
5076
|
-
l.fields.map((
|
|
5075
|
+
l.fields.map((w, C) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: $(w)(f, v) }, C)),
|
|
5077
5076
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
5078
5077
|
"button",
|
|
5079
5078
|
{
|
|
5080
|
-
onClick: () =>
|
|
5079
|
+
onClick: () => F(v),
|
|
5081
5080
|
className: "text-red-500 hover:text-red-700",
|
|
5082
5081
|
title: "Delete row",
|
|
5083
5082
|
children: /* @__PURE__ */ e(vr, { size: 16 })
|
|
@@ -5085,24 +5084,24 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5085
5084
|
) })
|
|
5086
5085
|
]
|
|
5087
5086
|
},
|
|
5088
|
-
|
|
5087
|
+
v
|
|
5089
5088
|
)) })
|
|
5090
5089
|
] }) }),
|
|
5091
5090
|
o !== null && (() => {
|
|
5092
|
-
const
|
|
5093
|
-
users:
|
|
5094
|
-
groups:
|
|
5095
|
-
roles:
|
|
5091
|
+
const f = b[o] && b[o][p] ? {
|
|
5092
|
+
users: b[o][p].users || [],
|
|
5093
|
+
groups: b[o][p].groups || [],
|
|
5094
|
+
roles: b[o][p].roles || []
|
|
5096
5095
|
} : { users: [], groups: [], roles: [] };
|
|
5097
|
-
return console.log("[DataTableRenderer] Opening modal with existing data:",
|
|
5096
|
+
return console.log("[DataTableRenderer] Opening modal with existing data:", f), console.log("[DataTableRenderer] Row data:", b[o]), console.log("[DataTableRenderer] Field name:", p), /* @__PURE__ */ e(
|
|
5098
5097
|
os,
|
|
5099
5098
|
{
|
|
5100
5099
|
isOpen: !0,
|
|
5101
5100
|
onClose: () => {
|
|
5102
|
-
u(null),
|
|
5101
|
+
u(null), g(null);
|
|
5103
5102
|
},
|
|
5104
|
-
onFinalSubmit:
|
|
5105
|
-
existingShares:
|
|
5103
|
+
onFinalSubmit: z,
|
|
5104
|
+
existingShares: f,
|
|
5106
5105
|
allowedPermissions: ["view", "remove"]
|
|
5107
5106
|
}
|
|
5108
5107
|
);
|
|
@@ -5176,7 +5175,7 @@ const Mt = () => {
|
|
|
5176
5175
|
initialData: p = null
|
|
5177
5176
|
// Add prop for initial demo data
|
|
5178
5177
|
}) => {
|
|
5179
|
-
const [
|
|
5178
|
+
const [g, b] = M(null), [r, y] = M(""), [d, h] = M(() => Array.isArray(p) ? p : []), [$, T] = M(null), [F, A] = M(null), [I, V] = M(""), U = async () => {
|
|
5180
5179
|
try {
|
|
5181
5180
|
const S = await Ve(t.collectionList);
|
|
5182
5181
|
if (S) {
|
|
@@ -5191,14 +5190,14 @@ const Mt = () => {
|
|
|
5191
5190
|
}
|
|
5192
5191
|
};
|
|
5193
5192
|
Z(() => {
|
|
5194
|
-
(!p || p.length === 0) &&
|
|
5193
|
+
(!p || p.length === 0) && U();
|
|
5195
5194
|
}, [p]), Z(() => {
|
|
5196
5195
|
Array.isArray(p) && h(p);
|
|
5197
5196
|
}, [p]);
|
|
5198
5197
|
const G = (S) => {
|
|
5199
|
-
m && (
|
|
5200
|
-
},
|
|
5201
|
-
if (!l ||
|
|
5198
|
+
m && (b(S.id), y(S.categoryName || ""));
|
|
5199
|
+
}, B = () => {
|
|
5200
|
+
if (!l || g !== null) return;
|
|
5202
5201
|
const S = `temp-${Date.now()}`;
|
|
5203
5202
|
h((O) => [
|
|
5204
5203
|
...O,
|
|
@@ -5209,15 +5208,15 @@ const Mt = () => {
|
|
|
5209
5208
|
order: (O.at(-1)?.order ?? 0) + 1,
|
|
5210
5209
|
_temp: !0
|
|
5211
5210
|
}
|
|
5212
|
-
]),
|
|
5213
|
-
},
|
|
5214
|
-
|
|
5215
|
-
const O = S.find((P) => P.id ===
|
|
5211
|
+
]), b(S), y("");
|
|
5212
|
+
}, z = () => {
|
|
5213
|
+
g != null && (h((S) => {
|
|
5214
|
+
const O = S.find((P) => P.id === g), D = O && O._temp ? S.filter((P) => P.id !== g) : S;
|
|
5216
5215
|
return s?.(D), D;
|
|
5217
|
-
}),
|
|
5218
|
-
},
|
|
5219
|
-
if (
|
|
5220
|
-
const S = typeof
|
|
5216
|
+
}), b(null), y(""));
|
|
5217
|
+
}, f = async () => {
|
|
5218
|
+
if (g == null || !r.trim()) return;
|
|
5219
|
+
const S = typeof g == "string" && g.startsWith("temp-");
|
|
5221
5220
|
try {
|
|
5222
5221
|
if (S) {
|
|
5223
5222
|
const O = await _e(t.collectionCreate, {
|
|
@@ -5225,32 +5224,32 @@ const Mt = () => {
|
|
|
5225
5224
|
order: (Array.isArray(d) && d.length > 0 ? d.at(-1)?.order ?? 0 : 0) + 1
|
|
5226
5225
|
});
|
|
5227
5226
|
O && (h((D) => {
|
|
5228
|
-
const P = D.map((_) => _.id ===
|
|
5227
|
+
const P = D.map((_) => _.id === g ? O : _);
|
|
5229
5228
|
return s?.(P), P;
|
|
5230
5229
|
}), De.success("Collection created successfully"));
|
|
5231
5230
|
} else {
|
|
5232
5231
|
const O = await Zn(
|
|
5233
|
-
`${t.collectionUpdate}/${
|
|
5232
|
+
`${t.collectionUpdate}/${g}?newName=${r.trim()}`
|
|
5234
5233
|
);
|
|
5235
5234
|
h((D) => {
|
|
5236
5235
|
const P = D.map(
|
|
5237
|
-
(_) => _.id ===
|
|
5236
|
+
(_) => _.id === g ? O && O.id ? { ..._, ...O } : { ..._, categoryName: r.trim() } : _
|
|
5238
5237
|
);
|
|
5239
5238
|
return s?.(P), P;
|
|
5240
5239
|
}), me.success("Collection updated successfully");
|
|
5241
5240
|
}
|
|
5242
|
-
|
|
5241
|
+
b(null), y("");
|
|
5243
5242
|
} catch (O) {
|
|
5244
5243
|
console.log(O), me.error("Failed to save collection");
|
|
5245
5244
|
}
|
|
5246
|
-
},
|
|
5245
|
+
}, v = async (S) => {
|
|
5247
5246
|
if (o)
|
|
5248
5247
|
try {
|
|
5249
|
-
await Qn(`${t.collectionUpdate}/${S.id}`) && (me.success("Deleted successfully", { autoClose: 3e3 }),
|
|
5248
|
+
await Qn(`${t.collectionUpdate}/${S.id}`) && (me.success("Deleted successfully", { autoClose: 3e3 }), U());
|
|
5250
5249
|
} catch (O) {
|
|
5251
5250
|
console.log(O), me.error("Failed to delete collection");
|
|
5252
5251
|
}
|
|
5253
|
-
},
|
|
5252
|
+
}, w = (S, O, D) => {
|
|
5254
5253
|
if (!u || !O || !D || O === D) return S;
|
|
5255
5254
|
const P = S.findIndex((W) => W.id === O), _ = S.findIndex((W) => W.id === D);
|
|
5256
5255
|
if (P === -1 || _ === -1) return S;
|
|
@@ -5268,21 +5267,21 @@ const Mt = () => {
|
|
|
5268
5267
|
console.log(D), me.error("Failed to save order", { autoClose: 2500 });
|
|
5269
5268
|
}
|
|
5270
5269
|
}, N = (S, O) => {
|
|
5271
|
-
u && (S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", String(O)),
|
|
5272
|
-
},
|
|
5273
|
-
|
|
5270
|
+
u && (S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", String(O)), T(O));
|
|
5271
|
+
}, x = (S) => {
|
|
5272
|
+
$ && S !== F && A(S);
|
|
5274
5273
|
}, k = (S) => {
|
|
5275
5274
|
S.preventDefault();
|
|
5276
|
-
},
|
|
5275
|
+
}, E = async (S, O) => {
|
|
5277
5276
|
S.preventDefault();
|
|
5278
5277
|
const D = S.dataTransfer.getData("text/plain");
|
|
5279
5278
|
D && (h((P) => {
|
|
5280
|
-
const _ =
|
|
5279
|
+
const _ = w(P, D, O);
|
|
5281
5280
|
return console.log("Reordered", _), C(_), s?.(_), _;
|
|
5282
|
-
}),
|
|
5283
|
-
},
|
|
5284
|
-
|
|
5285
|
-
},
|
|
5281
|
+
}), T(null), A(null));
|
|
5282
|
+
}, L = () => {
|
|
5283
|
+
T(null), A(null);
|
|
5284
|
+
}, q = Array.isArray(d) ? d.filter(
|
|
5286
5285
|
(S) => S.categoryName?.toLowerCase().includes(I.toLowerCase())
|
|
5287
5286
|
) : [];
|
|
5288
5287
|
return /* @__PURE__ */ n("div", { className: `manage-collection-list ${a}`, children: [
|
|
@@ -5291,7 +5290,7 @@ const Mt = () => {
|
|
|
5291
5290
|
be,
|
|
5292
5291
|
{
|
|
5293
5292
|
value: I,
|
|
5294
|
-
onDebouncedChange:
|
|
5293
|
+
onDebouncedChange: V,
|
|
5295
5294
|
placeholder: "Search Collection",
|
|
5296
5295
|
customClass: "mr-4 searchmanagecollection"
|
|
5297
5296
|
}
|
|
@@ -5301,23 +5300,23 @@ const Mt = () => {
|
|
|
5301
5300
|
{
|
|
5302
5301
|
className: [
|
|
5303
5302
|
"px-4 py-3 bg-black text-white rounded-2xl ml-4",
|
|
5304
|
-
|
|
5303
|
+
g !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
5305
5304
|
].join(" "),
|
|
5306
|
-
onClick:
|
|
5307
|
-
disabled:
|
|
5305
|
+
onClick: B,
|
|
5306
|
+
disabled: g !== null,
|
|
5308
5307
|
children: "Add a Collection"
|
|
5309
5308
|
}
|
|
5310
5309
|
)
|
|
5311
5310
|
] }) }),
|
|
5312
|
-
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children:
|
|
5313
|
-
const O =
|
|
5311
|
+
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: q.map((S) => {
|
|
5312
|
+
const O = g === S.id, D = S?.links?.length ?? 0, P = $ === S.id, _ = F === S.id && $ !== S.id;
|
|
5314
5313
|
return /* @__PURE__ */ e(
|
|
5315
5314
|
"div",
|
|
5316
5315
|
{
|
|
5317
|
-
onDragEnter: () =>
|
|
5316
|
+
onDragEnter: () => x(S.id),
|
|
5318
5317
|
onDragOver: k,
|
|
5319
|
-
onDrop: (R) =>
|
|
5320
|
-
onDragEnd:
|
|
5318
|
+
onDrop: (R) => E(R, S.id),
|
|
5319
|
+
onDragEnd: L,
|
|
5321
5320
|
className: [
|
|
5322
5321
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5323
5322
|
"border-gray-300",
|
|
@@ -5332,9 +5331,9 @@ const Mt = () => {
|
|
|
5332
5331
|
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",
|
|
5333
5332
|
value: r,
|
|
5334
5333
|
placeholder: S._temp ? "New collection name" : "Edit collection name",
|
|
5335
|
-
onChange: (R) =>
|
|
5334
|
+
onChange: (R) => y(R.target.value),
|
|
5336
5335
|
onKeyDown: (R) => {
|
|
5337
|
-
R.key === "Enter" &&
|
|
5336
|
+
R.key === "Enter" && f(), R.key === "Escape" && z();
|
|
5338
5337
|
},
|
|
5339
5338
|
autoFocus: !0
|
|
5340
5339
|
}
|
|
@@ -5344,7 +5343,7 @@ const Mt = () => {
|
|
|
5344
5343
|
"button",
|
|
5345
5344
|
{
|
|
5346
5345
|
className: "cursor-pointer border border-gray-300 p-2 rounded-2xl",
|
|
5347
|
-
onClick:
|
|
5346
|
+
onClick: z,
|
|
5348
5347
|
"aria-label": "Cancel edit",
|
|
5349
5348
|
children: /* @__PURE__ */ e(ge, { color: "#767676" })
|
|
5350
5349
|
}
|
|
@@ -5356,7 +5355,7 @@ const Mt = () => {
|
|
|
5356
5355
|
"border p-2 rounded-2xl",
|
|
5357
5356
|
r.trim() ? "cursor-pointer border-gray-300" : "cursor-not-allowed border-gray-200"
|
|
5358
5357
|
].join(" "),
|
|
5359
|
-
onClick:
|
|
5358
|
+
onClick: f,
|
|
5360
5359
|
"aria-label": "Save",
|
|
5361
5360
|
disabled: !r.trim(),
|
|
5362
5361
|
title: r.trim() ? "Save" : "Name required",
|
|
@@ -5395,7 +5394,7 @@ const Mt = () => {
|
|
|
5395
5394
|
{
|
|
5396
5395
|
className: D === 0 && !S.protected ? "cursor-pointer" : "cursor-not-allowed",
|
|
5397
5396
|
title: D === 0 && !S.protected ? "Delete" : "Cannot delete this collection",
|
|
5398
|
-
onClick: D === 0 ? () =>
|
|
5397
|
+
onClick: D === 0 ? () => v(S) : null,
|
|
5399
5398
|
children: /* @__PURE__ */ e(Ke, { color: D === 0 ? "#767676" : "#C2C2C2" })
|
|
5400
5399
|
}
|
|
5401
5400
|
)
|
|
@@ -5414,10 +5413,10 @@ const Mt = () => {
|
|
|
5414
5413
|
initialData: o = null,
|
|
5415
5414
|
showSearch: u = !0,
|
|
5416
5415
|
allowAdd: p = !0,
|
|
5417
|
-
allowEdit:
|
|
5418
|
-
allowDelete:
|
|
5416
|
+
allowEdit: g = !0,
|
|
5417
|
+
allowDelete: b = !0,
|
|
5419
5418
|
allowReorder: r = !0,
|
|
5420
|
-
className:
|
|
5419
|
+
className: y = ""
|
|
5421
5420
|
} = t, d = a?.[t.key] || o || [], h = Array.isArray(d) ? d : [];
|
|
5422
5421
|
return /* @__PURE__ */ n("div", { className: "dynamic-config-manage-collection-list", children: [
|
|
5423
5422
|
(i || l) && /* @__PURE__ */ n("div", { className: "mb-4", children: [
|
|
@@ -5429,14 +5428,14 @@ const Mt = () => {
|
|
|
5429
5428
|
{
|
|
5430
5429
|
endpoints: m,
|
|
5431
5430
|
initialData: h,
|
|
5432
|
-
className:
|
|
5433
|
-
onCollectionChange: (
|
|
5434
|
-
s && s(t.key,
|
|
5431
|
+
className: y,
|
|
5432
|
+
onCollectionChange: (T) => {
|
|
5433
|
+
s && s(t.key, T);
|
|
5435
5434
|
},
|
|
5436
5435
|
showSearch: u,
|
|
5437
5436
|
allowAdd: p,
|
|
5438
|
-
allowEdit:
|
|
5439
|
-
allowDelete:
|
|
5437
|
+
allowEdit: g,
|
|
5438
|
+
allowDelete: b,
|
|
5440
5439
|
allowReorder: r
|
|
5441
5440
|
}
|
|
5442
5441
|
)
|
|
@@ -5464,176 +5463,176 @@ function Ss({
|
|
|
5464
5463
|
onCancel: i,
|
|
5465
5464
|
onSave: l
|
|
5466
5465
|
}) {
|
|
5467
|
-
const [m, o] =
|
|
5466
|
+
const [m, o] = se.useState(a), [u, p] = se.useState(null), [g, b] = M(!1), [r, y] = M(!1), [d, h] = M({}), $ = `${Se()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, T = $, [F, A] = M(1), I = (w) => {
|
|
5468
5467
|
if (!a || !a.configuration)
|
|
5469
|
-
return
|
|
5470
|
-
const C = {}, N =
|
|
5471
|
-
return a.configuration.forEach((
|
|
5472
|
-
if (
|
|
5473
|
-
const
|
|
5474
|
-
const S = { id:
|
|
5475
|
-
return
|
|
5468
|
+
return w;
|
|
5469
|
+
const C = {}, N = w?.configuration || {};
|
|
5470
|
+
return a.configuration.forEach((x) => {
|
|
5471
|
+
if (x.key && x.type === "datatable") {
|
|
5472
|
+
const E = (N[x.key] || []).map((L, q) => {
|
|
5473
|
+
const S = { id: L.id || 0 };
|
|
5474
|
+
return x.fields && x.fields.forEach((O) => {
|
|
5476
5475
|
if (O.fieldtype === "audience") {
|
|
5477
5476
|
let D = { users: [], groups: [], roles: [] };
|
|
5478
|
-
|
|
5479
|
-
users:
|
|
5480
|
-
groups:
|
|
5481
|
-
roles:
|
|
5477
|
+
L[O.key] && (Array.isArray(L[O.key]) ? D = { users: [], groups: [], roles: [] } : typeof L[O.key] == "object" && (D = {
|
|
5478
|
+
users: L[O.key].users || [],
|
|
5479
|
+
groups: L[O.key].groups || [],
|
|
5480
|
+
roles: L[O.key].roles || []
|
|
5482
5481
|
})), S[O.key] = D;
|
|
5483
5482
|
} else
|
|
5484
|
-
S[O.key] =
|
|
5483
|
+
S[O.key] = L[O.key] || O.default || "";
|
|
5485
5484
|
}), S;
|
|
5486
5485
|
});
|
|
5487
|
-
if (
|
|
5488
|
-
const
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
}),
|
|
5486
|
+
if (E.length === 0) {
|
|
5487
|
+
const L = { id: 0 };
|
|
5488
|
+
x.fields && x.fields.forEach((q) => {
|
|
5489
|
+
q.fieldtype === "audience" ? L[q.key] = { users: [], groups: [], roles: [] } : L[q.key] = q.default || "";
|
|
5490
|
+
}), E.push(L);
|
|
5492
5491
|
}
|
|
5493
|
-
C[
|
|
5494
|
-
} else
|
|
5492
|
+
C[x.key] = E;
|
|
5493
|
+
} else x.key && (C[x.key] = N[x.key] || {});
|
|
5495
5494
|
}), C;
|
|
5496
|
-
},
|
|
5495
|
+
}, V = () => {
|
|
5497
5496
|
if (a && a.configuration) {
|
|
5498
|
-
const
|
|
5497
|
+
const w = {};
|
|
5499
5498
|
a.configuration.forEach((C) => {
|
|
5500
5499
|
if (C.key)
|
|
5501
5500
|
if (C.type === "datatable") {
|
|
5502
5501
|
const N = { id: 0 };
|
|
5503
|
-
C.fields && C.fields.forEach((
|
|
5504
|
-
|
|
5505
|
-
}),
|
|
5502
|
+
C.fields && C.fields.forEach((x) => {
|
|
5503
|
+
x.fieldtype === "audience" ? N[x.key] = { users: [], groups: [], roles: [] } : N[x.key] = x.default || "";
|
|
5504
|
+
}), w[C.key] = [N];
|
|
5506
5505
|
} else if (C.type === "section") {
|
|
5507
5506
|
const N = {};
|
|
5508
|
-
C.fields && Array.isArray(C.fields) && C.fields.forEach((
|
|
5509
|
-
|
|
5510
|
-
}),
|
|
5507
|
+
C.fields && Array.isArray(C.fields) && C.fields.forEach((x) => {
|
|
5508
|
+
x.key && (N[x.key] = x.default || "");
|
|
5509
|
+
}), w[C.key] = N;
|
|
5511
5510
|
} else
|
|
5512
|
-
|
|
5513
|
-
}), p(
|
|
5511
|
+
w[C.key] = {};
|
|
5512
|
+
}), p(w);
|
|
5514
5513
|
}
|
|
5515
5514
|
};
|
|
5516
5515
|
Z(() => {
|
|
5517
5516
|
if (s) {
|
|
5518
|
-
|
|
5517
|
+
b(!1);
|
|
5519
5518
|
return;
|
|
5520
5519
|
}
|
|
5521
|
-
const
|
|
5520
|
+
const w = async () => {
|
|
5522
5521
|
try {
|
|
5523
|
-
|
|
5524
|
-
let C = await Ve(
|
|
5522
|
+
b(!0);
|
|
5523
|
+
let C = await Ve($);
|
|
5525
5524
|
if (C) {
|
|
5526
5525
|
const N = I(C);
|
|
5527
5526
|
p(N);
|
|
5528
5527
|
} else
|
|
5529
|
-
|
|
5528
|
+
V();
|
|
5530
5529
|
} catch (C) {
|
|
5531
5530
|
console.error("Error fetching configuration:", C);
|
|
5532
5531
|
let N = "Failed to load configuration";
|
|
5533
5532
|
if (C.response) {
|
|
5534
|
-
const
|
|
5535
|
-
|
|
5533
|
+
const x = C.response.status, k = C.response.data?.message || C.response.data?.error;
|
|
5534
|
+
x === 400 ? N = k || "Invalid request. Please check the application ID." : x === 401 ? N = "You are not authorized to access this configuration." : x === 403 ? N = "Access denied. You don't have permission to view this configuration." : x === 404 ? N = "Configuration not found. It may not exist yet or the application ID is incorrect." : x >= 500 ? N = k || "Server error. Please try again later." : N = k || `Failed to load configuration (Error ${x})`;
|
|
5536
5535
|
} else C.request ? N = "Network error. Please check your connection and try again." : N = C.message || "An unexpected error occurred while loading configuration.";
|
|
5537
|
-
De.error(N),
|
|
5536
|
+
De.error(N), V();
|
|
5538
5537
|
} finally {
|
|
5539
|
-
|
|
5538
|
+
b(!1);
|
|
5540
5539
|
}
|
|
5541
5540
|
};
|
|
5542
|
-
a && (o(a), t ?
|
|
5543
|
-
}, [a,
|
|
5544
|
-
const
|
|
5541
|
+
a && (o(a), t ? w() : V());
|
|
5542
|
+
}, [a, F, t, s]);
|
|
5543
|
+
const U = (w, C) => {
|
|
5545
5544
|
p((N) => ({
|
|
5546
5545
|
...N,
|
|
5547
|
-
[
|
|
5546
|
+
[w]: C
|
|
5548
5547
|
})), h((N) => {
|
|
5549
|
-
const
|
|
5550
|
-
return
|
|
5548
|
+
const x = { ...N };
|
|
5549
|
+
return x[w] && delete x[w], x;
|
|
5551
5550
|
});
|
|
5552
5551
|
}, G = () => {
|
|
5553
|
-
const
|
|
5552
|
+
const w = {};
|
|
5554
5553
|
return !m || !u || m.configuration.forEach((C) => {
|
|
5555
5554
|
if (C.type === "section")
|
|
5556
5555
|
C.fields.forEach((N) => {
|
|
5557
5556
|
if (N.required) {
|
|
5558
|
-
const
|
|
5559
|
-
(!
|
|
5557
|
+
const x = u[C.key]?.[N.key];
|
|
5558
|
+
(!x || typeof x == "string" && x.trim() === "") && (w[C.key] || (w[C.key] = {}), w[C.key][N.key] = `${N.label} is required`);
|
|
5560
5559
|
}
|
|
5561
5560
|
});
|
|
5562
5561
|
else if (C.type === "datatable") {
|
|
5563
5562
|
const N = u[C.key];
|
|
5564
|
-
Array.isArray(N) && N.forEach((
|
|
5565
|
-
C.fields.forEach((
|
|
5566
|
-
if (
|
|
5567
|
-
const
|
|
5568
|
-
(!
|
|
5563
|
+
Array.isArray(N) && N.forEach((x, k) => {
|
|
5564
|
+
C.fields.forEach((E) => {
|
|
5565
|
+
if (E.required) {
|
|
5566
|
+
const L = x[E.key];
|
|
5567
|
+
(!L || typeof L == "string" && L.trim() === "") && (w[C.key] || (w[C.key] = {}), w[C.key][k] || (w[C.key][k] = {}), w[C.key][k][E.key] = `${E.label} is required`);
|
|
5569
5568
|
}
|
|
5570
5569
|
});
|
|
5571
5570
|
});
|
|
5572
5571
|
}
|
|
5573
|
-
}),
|
|
5574
|
-
},
|
|
5575
|
-
const
|
|
5576
|
-
if (h(
|
|
5572
|
+
}), w;
|
|
5573
|
+
}, B = (w) => Object.keys(w).length > 0, z = () => {
|
|
5574
|
+
const w = G();
|
|
5575
|
+
if (h(w), B(w)) {
|
|
5577
5576
|
let N = [];
|
|
5578
|
-
Object.keys(
|
|
5579
|
-
typeof x
|
|
5580
|
-
typeof x
|
|
5581
|
-
N.push(`${
|
|
5582
|
-
}) : N.push(`${
|
|
5577
|
+
Object.keys(w).forEach((x) => {
|
|
5578
|
+
typeof w[x] == "object" && Object.keys(w[x]).forEach((k) => {
|
|
5579
|
+
typeof w[x][k] == "object" ? Object.keys(w[x][k]).forEach((E) => {
|
|
5580
|
+
N.push(`${x} row ${parseInt(k) + 1}: ${w[x][k][E]}`);
|
|
5581
|
+
}) : N.push(`${x}: ${w[x][k]}`);
|
|
5583
5582
|
});
|
|
5584
5583
|
});
|
|
5585
5584
|
return;
|
|
5586
5585
|
}
|
|
5587
5586
|
(async () => {
|
|
5588
5587
|
try {
|
|
5589
|
-
|
|
5588
|
+
y(!0);
|
|
5590
5589
|
const N = {};
|
|
5591
5590
|
u && Object.keys(u).forEach((k) => {
|
|
5592
|
-
const
|
|
5593
|
-
(
|
|
5591
|
+
const E = a?.configuration?.find(
|
|
5592
|
+
(L) => L.key === k && L.type === "datatable"
|
|
5594
5593
|
);
|
|
5595
|
-
|
|
5596
|
-
const
|
|
5597
|
-
return
|
|
5594
|
+
E && Array.isArray(u[k]) ? N[k] = u[k].map((L) => {
|
|
5595
|
+
const q = { id: L.id || 0 };
|
|
5596
|
+
return E.fields && E.fields.forEach((S) => {
|
|
5598
5597
|
if (S.fieldtype === "audience") {
|
|
5599
5598
|
let O = { users: [], groups: [], roles: [] };
|
|
5600
|
-
|
|
5601
|
-
users:
|
|
5602
|
-
groups:
|
|
5603
|
-
roles:
|
|
5604
|
-
}),
|
|
5599
|
+
L[S.key] && typeof L[S.key] == "object" && !Array.isArray(L[S.key]) && (O = {
|
|
5600
|
+
users: L[S.key].users || [],
|
|
5601
|
+
groups: L[S.key].groups || [],
|
|
5602
|
+
roles: L[S.key].roles || []
|
|
5603
|
+
}), q[S.key] = O;
|
|
5605
5604
|
} else
|
|
5606
|
-
|
|
5607
|
-
}),
|
|
5605
|
+
q[S.key] = L[S.key] || "";
|
|
5606
|
+
}), q;
|
|
5608
5607
|
}) : N[k] = u[k];
|
|
5609
5608
|
});
|
|
5610
|
-
let
|
|
5611
|
-
if (console.log(),
|
|
5609
|
+
let x = await _e(T, N);
|
|
5610
|
+
if (console.log(), x && x.status != "fail") {
|
|
5612
5611
|
h({});
|
|
5613
|
-
const k =
|
|
5612
|
+
const k = x.message || "Configuration has been saved successfully";
|
|
5614
5613
|
De.success(k), l && typeof l == "function" && l(u);
|
|
5615
5614
|
} else
|
|
5616
|
-
throw De.error(
|
|
5615
|
+
throw De.error(x?.message || "Failed to save configuration"), new Error("No response received from server");
|
|
5617
5616
|
} catch (N) {
|
|
5618
5617
|
console.error("Error saving configuration:", N), De.error(N?.message || "Failed to save configuration");
|
|
5619
5618
|
} finally {
|
|
5620
|
-
|
|
5619
|
+
y(!1);
|
|
5621
5620
|
}
|
|
5622
5621
|
})();
|
|
5623
|
-
},
|
|
5622
|
+
}, f = () => {
|
|
5624
5623
|
if (i) {
|
|
5625
5624
|
i();
|
|
5626
5625
|
return;
|
|
5627
5626
|
}
|
|
5628
5627
|
d && Object.keys(d).length > 0 && !window.confirm(
|
|
5629
5628
|
"You have validation errors that will be lost. Are you sure you want to cancel?"
|
|
5630
|
-
) || (h({}), p(null),
|
|
5629
|
+
) || (h({}), p(null), A((C) => C + 1), De.info("Configuration changes cancelled"));
|
|
5631
5630
|
};
|
|
5632
5631
|
if (!m?.configuration && !a?.configuration)
|
|
5633
5632
|
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" }) });
|
|
5634
|
-
const
|
|
5633
|
+
const v = a?.configuration || m?.configuration;
|
|
5635
5634
|
return Z(() => {
|
|
5636
|
-
s && a ? (!u || Object.keys(u).length === 0) &&
|
|
5635
|
+
s && a ? (!u || Object.keys(u).length === 0) && V() : s && !a && V();
|
|
5637
5636
|
}, [s, a]), /* @__PURE__ */ n("div", { children: [
|
|
5638
5637
|
/* @__PURE__ */ n(
|
|
5639
5638
|
"div",
|
|
@@ -5641,16 +5640,16 @@ function Ss({
|
|
|
5641
5640
|
className: "dynamic-config bg-white w-full h-[calc(100vh-350px)] overflow-y-auto",
|
|
5642
5641
|
style: { padding: "0px 20px 0px 0px" },
|
|
5643
5642
|
children: [
|
|
5644
|
-
|
|
5645
|
-
!
|
|
5646
|
-
const N = zs(
|
|
5643
|
+
g && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(xa, { size: "large" }) }),
|
|
5644
|
+
!g && v?.map((w, C) => {
|
|
5645
|
+
const N = zs(w.type);
|
|
5647
5646
|
if (N && N !== "UnknownType")
|
|
5648
5647
|
return /* @__PURE__ */ e(
|
|
5649
5648
|
N,
|
|
5650
5649
|
{
|
|
5651
|
-
item:
|
|
5650
|
+
item: w,
|
|
5652
5651
|
data: u,
|
|
5653
|
-
updateHandler:
|
|
5652
|
+
updateHandler: U,
|
|
5654
5653
|
validationErrors: d
|
|
5655
5654
|
},
|
|
5656
5655
|
C
|
|
@@ -5664,7 +5663,7 @@ function Ss({
|
|
|
5664
5663
|
ee,
|
|
5665
5664
|
{
|
|
5666
5665
|
category: "secondary",
|
|
5667
|
-
onClick:
|
|
5666
|
+
onClick: f,
|
|
5668
5667
|
label: "Cancel",
|
|
5669
5668
|
disabled: r
|
|
5670
5669
|
}
|
|
@@ -5673,7 +5672,7 @@ function Ss({
|
|
|
5673
5672
|
ee,
|
|
5674
5673
|
{
|
|
5675
5674
|
category: "primary",
|
|
5676
|
-
onClick:
|
|
5675
|
+
onClick: z,
|
|
5677
5676
|
disabled: r,
|
|
5678
5677
|
label: r ? "Saving..." : "Apply",
|
|
5679
5678
|
type: "submit"
|
|
@@ -5687,32 +5686,32 @@ const Ql = ({
|
|
|
5687
5686
|
appid: a = "Configuration-Page",
|
|
5688
5687
|
disableApi: s = !1
|
|
5689
5688
|
}) => {
|
|
5690
|
-
const [i, l] =
|
|
5691
|
-
pageHeader:
|
|
5692
|
-
appletHeader:
|
|
5693
|
-
breadcrumb:
|
|
5694
|
-
overview:
|
|
5695
|
-
configuration:
|
|
5696
|
-
} = t,
|
|
5697
|
-
if (
|
|
5698
|
-
const
|
|
5699
|
-
if (
|
|
5700
|
-
const
|
|
5701
|
-
if (
|
|
5702
|
-
...
|
|
5689
|
+
const [i, l] = M(0), [m, o] = M(!1), {
|
|
5690
|
+
pageHeader: u = {},
|
|
5691
|
+
appletHeader: p = {},
|
|
5692
|
+
breadcrumb: g = [],
|
|
5693
|
+
overview: b = {},
|
|
5694
|
+
configuration: r = []
|
|
5695
|
+
} = t, y = r.map((B) => {
|
|
5696
|
+
if (B.type === "section" && B.fields) {
|
|
5697
|
+
const z = [...B.fields], f = z.findIndex((v) => v.key === "appkey");
|
|
5698
|
+
if (f !== -1) {
|
|
5699
|
+
const v = z[f];
|
|
5700
|
+
if (z[f] = {
|
|
5701
|
+
...v,
|
|
5703
5702
|
default: a,
|
|
5704
5703
|
value: a,
|
|
5705
5704
|
disabled: !0,
|
|
5706
5705
|
placeholder: a
|
|
5707
|
-
},
|
|
5708
|
-
const
|
|
5709
|
-
|
|
5710
|
-
...
|
|
5711
|
-
default: a,
|
|
5712
|
-
|
|
5706
|
+
}, z.some((C) => C.key === "displayname")) {
|
|
5707
|
+
const C = z.findIndex((x) => x.key === "displayname"), N = z[C] || {};
|
|
5708
|
+
z[C] = {
|
|
5709
|
+
...N,
|
|
5710
|
+
default: N.default || N.value || a,
|
|
5711
|
+
placeholder: N.placeholder || "Enter display name"
|
|
5713
5712
|
};
|
|
5714
5713
|
} else {
|
|
5715
|
-
const
|
|
5714
|
+
const C = {
|
|
5716
5715
|
key: "displayname",
|
|
5717
5716
|
label: "Display Name",
|
|
5718
5717
|
fieldtype: "text",
|
|
@@ -5721,52 +5720,44 @@ const Ql = ({
|
|
|
5721
5720
|
placeholder: "Enter display name",
|
|
5722
5721
|
required: !1
|
|
5723
5722
|
};
|
|
5724
|
-
|
|
5723
|
+
z.splice(f + 1, 0, C);
|
|
5725
5724
|
}
|
|
5726
5725
|
}
|
|
5727
5726
|
return {
|
|
5728
|
-
...
|
|
5729
|
-
fields:
|
|
5727
|
+
...B,
|
|
5728
|
+
fields: z
|
|
5730
5729
|
};
|
|
5731
5730
|
}
|
|
5732
|
-
return
|
|
5733
|
-
}),
|
|
5731
|
+
return B;
|
|
5732
|
+
}), d = {
|
|
5734
5733
|
heading: "App Details",
|
|
5735
5734
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
5736
5735
|
isLeftArrow: !0,
|
|
5737
5736
|
onBackClick: () => window.history.back(),
|
|
5738
|
-
...
|
|
5739
|
-
},
|
|
5740
|
-
label:
|
|
5741
|
-
href:
|
|
5742
|
-
})),
|
|
5737
|
+
...u
|
|
5738
|
+
}, h = g.map((B) => ({
|
|
5739
|
+
label: B.text,
|
|
5740
|
+
href: B.href || "#"
|
|
5741
|
+
})), $ = ne(() => {
|
|
5743
5742
|
console.log("handleCancelRequest called - showing modal"), o(!0);
|
|
5744
|
-
}, []),
|
|
5745
|
-
o(!1),
|
|
5746
|
-
}, []),
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
return
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
p(I());
|
|
5757
|
-
}, [h]);
|
|
5758
|
-
const j = ae((g) => {
|
|
5759
|
-
console.log("Config saved with data:", g), Object.keys(g).forEach((x) => {
|
|
5760
|
-
const C = g[x];
|
|
5761
|
-
console.log(`Checking section ${x}:`, C), C && C.displayname && (console.log("Found displayname:", C.displayname), p(C.displayname));
|
|
5762
|
-
});
|
|
5763
|
-
}, []), V = {
|
|
5743
|
+
}, []), T = ne((B) => {
|
|
5744
|
+
o(!1), B.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
|
|
5745
|
+
}, []), F = (() => {
|
|
5746
|
+
if (Array.isArray(r)) {
|
|
5747
|
+
for (const B of r)
|
|
5748
|
+
if (B && B.fields) {
|
|
5749
|
+
const z = B.fields.find((f) => f && f.key === "displayname");
|
|
5750
|
+
if (z) return z.default ?? z.value ?? a;
|
|
5751
|
+
}
|
|
5752
|
+
}
|
|
5753
|
+
return p.heading || a;
|
|
5754
|
+
})(), A = {
|
|
5764
5755
|
subHeading: "Application configuration and details",
|
|
5765
5756
|
tags: [],
|
|
5766
|
-
...
|
|
5767
|
-
heading:
|
|
5768
|
-
//
|
|
5769
|
-
},
|
|
5757
|
+
...p,
|
|
5758
|
+
heading: F
|
|
5759
|
+
// Use resolvedDisplayName only
|
|
5760
|
+
}, I = {
|
|
5770
5761
|
about: "This application provides comprehensive functionality for your organization.",
|
|
5771
5762
|
images: {
|
|
5772
5763
|
desktop: "https://via.placeholder.com/600x400?text=Desktop+View",
|
|
@@ -5783,25 +5774,25 @@ const Ql = ({
|
|
|
5783
5774
|
description: "Description of feature 2"
|
|
5784
5775
|
}
|
|
5785
5776
|
],
|
|
5786
|
-
...
|
|
5787
|
-
},
|
|
5788
|
-
{ label: "Overview", content:
|
|
5789
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: { configuration:
|
|
5777
|
+
...b
|
|
5778
|
+
}, V = [
|
|
5779
|
+
{ label: "Overview", content: G(I) },
|
|
5780
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: { configuration: y }, disableApi: s, onCancel: $, onSave: handleConfigChange }) }
|
|
5790
5781
|
];
|
|
5791
|
-
function
|
|
5792
|
-
return
|
|
5782
|
+
function U(B) {
|
|
5783
|
+
return B ? B.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: B } }) : B : "📱";
|
|
5793
5784
|
}
|
|
5794
|
-
function
|
|
5785
|
+
function G(B) {
|
|
5795
5786
|
return /* @__PURE__ */ n("div", { className: "bg-white rounded-2xl p-1", children: [
|
|
5796
5787
|
/* @__PURE__ */ n("section", { className: "mb-8", children: [
|
|
5797
5788
|
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
|
|
5798
|
-
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children:
|
|
5789
|
+
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children: B.about })
|
|
5799
5790
|
] }),
|
|
5800
5791
|
/* @__PURE__ */ n("section", { className: "flex flex-row gap-6 justify-center items-center mb-8", children: [
|
|
5801
5792
|
/* @__PURE__ */ e(
|
|
5802
5793
|
"img",
|
|
5803
5794
|
{
|
|
5804
|
-
src:
|
|
5795
|
+
src: B.images.desktop,
|
|
5805
5796
|
alt: "Desktop View",
|
|
5806
5797
|
className: "rounded-xl border border-gray-200 w-[340px] h-[220px] object-cover"
|
|
5807
5798
|
}
|
|
@@ -5809,7 +5800,7 @@ const Ql = ({
|
|
|
5809
5800
|
/* @__PURE__ */ e(
|
|
5810
5801
|
"img",
|
|
5811
5802
|
{
|
|
5812
|
-
src:
|
|
5803
|
+
src: B.images.mobile1,
|
|
5813
5804
|
alt: "Mobile View 1",
|
|
5814
5805
|
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
5815
5806
|
}
|
|
@@ -5817,7 +5808,7 @@ const Ql = ({
|
|
|
5817
5808
|
/* @__PURE__ */ e(
|
|
5818
5809
|
"img",
|
|
5819
5810
|
{
|
|
5820
|
-
src:
|
|
5811
|
+
src: B.images.mobile2,
|
|
5821
5812
|
alt: "Mobile View 2",
|
|
5822
5813
|
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
5823
5814
|
}
|
|
@@ -5825,11 +5816,11 @@ const Ql = ({
|
|
|
5825
5816
|
] }),
|
|
5826
5817
|
/* @__PURE__ */ n("section", { children: [
|
|
5827
5818
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
|
|
5828
|
-
/* @__PURE__ */ e("ul", { className: "space-y-3", children:
|
|
5829
|
-
/* @__PURE__ */ e("span", { className: "font-semibold", children:
|
|
5819
|
+
/* @__PURE__ */ e("ul", { className: "space-y-3", children: B.features.map((z, f) => /* @__PURE__ */ n("li", { children: [
|
|
5820
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: z.title }),
|
|
5830
5821
|
/* @__PURE__ */ e("br", {}),
|
|
5831
|
-
/* @__PURE__ */ e("span", { className: "text-gray-700", children:
|
|
5832
|
-
] },
|
|
5822
|
+
/* @__PURE__ */ e("span", { className: "text-gray-700", children: z.description })
|
|
5823
|
+
] }, f)) })
|
|
5833
5824
|
] })
|
|
5834
5825
|
] });
|
|
5835
5826
|
}
|
|
@@ -5837,45 +5828,45 @@ const Ql = ({
|
|
|
5837
5828
|
/* @__PURE__ */ e(
|
|
5838
5829
|
Vn,
|
|
5839
5830
|
{
|
|
5840
|
-
heading:
|
|
5841
|
-
subHeading:
|
|
5842
|
-
breadcrumbItems:
|
|
5843
|
-
isLeftArrow:
|
|
5844
|
-
onBackClick:
|
|
5831
|
+
heading: d.heading,
|
|
5832
|
+
subHeading: h.length > 0 ? void 0 : d.subHeading,
|
|
5833
|
+
breadcrumbItems: h,
|
|
5834
|
+
isLeftArrow: d.isLeftArrow,
|
|
5835
|
+
onBackClick: d.onBackClick
|
|
5845
5836
|
}
|
|
5846
5837
|
),
|
|
5847
5838
|
/* @__PURE__ */ n("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
|
|
5848
|
-
/* @__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:
|
|
5839
|
+
/* @__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: U(A.icon) }),
|
|
5849
5840
|
/* @__PURE__ */ n("div", { className: "flex flex-col min-w-0", children: [
|
|
5850
|
-
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children:
|
|
5851
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children:
|
|
5852
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children:
|
|
5841
|
+
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: A.heading }),
|
|
5842
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: A.subHeading }),
|
|
5843
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: A.tags && A.tags.map((B, z) => /* @__PURE__ */ e(
|
|
5853
5844
|
"span",
|
|
5854
5845
|
{
|
|
5855
5846
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
5856
|
-
children:
|
|
5847
|
+
children: B
|
|
5857
5848
|
},
|
|
5858
|
-
|
|
5849
|
+
z
|
|
5859
5850
|
)) })
|
|
5860
5851
|
] })
|
|
5861
5852
|
] }),
|
|
5862
5853
|
/* @__PURE__ */ n("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
|
|
5863
|
-
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children:
|
|
5854
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: V.map((B, z) => /* @__PURE__ */ e(
|
|
5864
5855
|
"button",
|
|
5865
5856
|
{
|
|
5866
|
-
onClick: () => l(
|
|
5867
|
-
className: `${i ===
|
|
5868
|
-
children:
|
|
5857
|
+
onClick: () => l(z),
|
|
5858
|
+
className: `${i === z ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
|
|
5859
|
+
children: B.label
|
|
5869
5860
|
},
|
|
5870
|
-
|
|
5861
|
+
z
|
|
5871
5862
|
)) }) }),
|
|
5872
|
-
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children:
|
|
5863
|
+
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: V[i].content })
|
|
5873
5864
|
] }),
|
|
5874
5865
|
/* @__PURE__ */ e(
|
|
5875
5866
|
Pn,
|
|
5876
5867
|
{
|
|
5877
5868
|
isOpen: m,
|
|
5878
|
-
onClose:
|
|
5869
|
+
onClose: T,
|
|
5879
5870
|
variant: "warning",
|
|
5880
5871
|
title: "Are you sure you want to cancel?",
|
|
5881
5872
|
primaryButtonText: "Proceed",
|
|
@@ -5924,66 +5915,66 @@ const Kl = ({
|
|
|
5924
5915
|
addBtnText: u = "Add",
|
|
5925
5916
|
// Feature toggles
|
|
5926
5917
|
showSearch: p = !0,
|
|
5927
|
-
showColumnChooser:
|
|
5928
|
-
showFilter:
|
|
5918
|
+
showColumnChooser: g = !0,
|
|
5919
|
+
showFilter: b = !1,
|
|
5929
5920
|
showPrint: r = !1,
|
|
5930
|
-
showExcel:
|
|
5921
|
+
showExcel: y = !1,
|
|
5931
5922
|
showPdf: d = !1,
|
|
5932
5923
|
showRefresh: h = !1,
|
|
5933
|
-
showAdd:
|
|
5924
|
+
showAdd: $ = !1,
|
|
5934
5925
|
// Additional props
|
|
5935
|
-
searchPlaceholder:
|
|
5936
|
-
handleRefreshClick:
|
|
5926
|
+
searchPlaceholder: T = "Search...",
|
|
5927
|
+
handleRefreshClick: F = () => {
|
|
5937
5928
|
},
|
|
5938
|
-
handleSearchChange:
|
|
5929
|
+
handleSearchChange: A = () => {
|
|
5939
5930
|
},
|
|
5940
5931
|
// Optional: override export file names
|
|
5941
5932
|
excelFileName: I,
|
|
5942
|
-
pdfFileName:
|
|
5933
|
+
pdfFileName: V
|
|
5943
5934
|
}) => {
|
|
5944
|
-
const
|
|
5945
|
-
(
|
|
5946
|
-
const k =
|
|
5935
|
+
const U = () => l?.current || i?.current, [G, B] = se.useState(""), z = (t || "export").toString().trim() || "export", f = `${I || z}.xlsx`, v = `${V || z}.pdf`, w = (x, k, E) => Math.max(k, Math.min(x, E)), C = ne(
|
|
5936
|
+
(x) => {
|
|
5937
|
+
const k = U();
|
|
5947
5938
|
if (console.log("openColumnChooserNear", k), !!k?.openColumnChooser) {
|
|
5948
|
-
if (typeof window > "u" || !
|
|
5939
|
+
if (typeof window > "u" || !x?.currentTarget) {
|
|
5949
5940
|
k.openColumnChooser();
|
|
5950
5941
|
return;
|
|
5951
5942
|
}
|
|
5952
5943
|
try {
|
|
5953
|
-
const
|
|
5954
|
-
let S =
|
|
5944
|
+
const E = x.currentTarget.getBoundingClientRect(), L = E.left + window.scrollX, q = E.bottom + window.scrollY;
|
|
5945
|
+
let S = L - 120, O = q - 120;
|
|
5955
5946
|
const D = window.innerWidth, P = window.innerHeight;
|
|
5956
|
-
S =
|
|
5957
|
-
} catch (
|
|
5958
|
-
console.log("coloumn choose error",
|
|
5947
|
+
S = w(S, window.scrollX + 8, window.scrollX + D - 340), O = w(O, window.scrollY, window.scrollY + P - 120), console.log("openColumnChooserNear", S, O), k.openColumnChooser(S, O);
|
|
5948
|
+
} catch (E) {
|
|
5949
|
+
console.log("coloumn choose error", E);
|
|
5959
5950
|
}
|
|
5960
5951
|
}
|
|
5961
5952
|
},
|
|
5962
5953
|
[]
|
|
5963
5954
|
// no external deps; reads ref at call time
|
|
5964
|
-
), N =
|
|
5965
|
-
(
|
|
5966
|
-
const
|
|
5967
|
-
if (
|
|
5968
|
-
switch (
|
|
5955
|
+
), N = ne(
|
|
5956
|
+
(x, k) => {
|
|
5957
|
+
const E = U();
|
|
5958
|
+
if (E)
|
|
5959
|
+
switch (x) {
|
|
5969
5960
|
case "ColumnChooser":
|
|
5970
|
-
|
|
5961
|
+
g && (console.log("openColumnChooser", k), k ? C(k) : E.openColumnChooser?.()), console.log("openColumnChooser out", k);
|
|
5971
5962
|
break;
|
|
5972
5963
|
case "Print":
|
|
5973
|
-
r &&
|
|
5964
|
+
r && E.print?.();
|
|
5974
5965
|
break;
|
|
5975
5966
|
case "Excel":
|
|
5976
|
-
|
|
5967
|
+
y && E.excelExport?.({ fileName: f });
|
|
5977
5968
|
break;
|
|
5978
5969
|
case "Pdf":
|
|
5979
|
-
d &&
|
|
5970
|
+
d && E.pdfExport?.({ fileName: v });
|
|
5980
5971
|
break;
|
|
5981
5972
|
case "Refresh":
|
|
5982
|
-
h &&
|
|
5973
|
+
h && F();
|
|
5983
5974
|
break;
|
|
5984
5975
|
}
|
|
5985
5976
|
},
|
|
5986
|
-
[
|
|
5977
|
+
[g, r, y, d, h, f, v, F, C]
|
|
5987
5978
|
);
|
|
5988
5979
|
return /* @__PURE__ */ n("div", { className: "flex items-center flex-wrap justify-between w-full px-4 py-2 bg-white border border-gray-200 rounded-t-2xl mb-0", children: [
|
|
5989
5980
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
@@ -5998,27 +5989,27 @@ const Kl = ({
|
|
|
5998
5989
|
p && /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
|
|
5999
5990
|
be,
|
|
6000
5991
|
{
|
|
6001
|
-
placeholder:
|
|
5992
|
+
placeholder: T,
|
|
6002
5993
|
value: G,
|
|
6003
|
-
onDebouncedChange: (
|
|
6004
|
-
|
|
5994
|
+
onDebouncedChange: (x) => {
|
|
5995
|
+
B(x), A(x);
|
|
6005
5996
|
}
|
|
6006
5997
|
}
|
|
6007
5998
|
) }),
|
|
6008
5999
|
/* @__PURE__ */ n("div", { className: "flex gap-3", children: [
|
|
6009
6000
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
|
|
6010
|
-
|
|
6001
|
+
g && /* @__PURE__ */ e(
|
|
6011
6002
|
ee,
|
|
6012
6003
|
{
|
|
6013
6004
|
icon: Nr,
|
|
6014
|
-
onClick: (
|
|
6005
|
+
onClick: (x) => N("ColumnChooser", x),
|
|
6015
6006
|
size: "small",
|
|
6016
6007
|
ariaLabel: "Column Chooser",
|
|
6017
6008
|
category: "secondary",
|
|
6018
6009
|
title: "Choose Columns"
|
|
6019
6010
|
}
|
|
6020
6011
|
),
|
|
6021
|
-
|
|
6012
|
+
b && /* @__PURE__ */ e(
|
|
6022
6013
|
ee,
|
|
6023
6014
|
{
|
|
6024
6015
|
icon: kr,
|
|
@@ -6040,7 +6031,7 @@ const Kl = ({
|
|
|
6040
6031
|
title: "Print Grid"
|
|
6041
6032
|
}
|
|
6042
6033
|
),
|
|
6043
|
-
|
|
6034
|
+
y && /* @__PURE__ */ e(
|
|
6044
6035
|
ee,
|
|
6045
6036
|
{
|
|
6046
6037
|
icon: zr,
|
|
@@ -6048,7 +6039,7 @@ const Kl = ({
|
|
|
6048
6039
|
ariaLabel: "Excel Download",
|
|
6049
6040
|
size: "small",
|
|
6050
6041
|
category: "secondary",
|
|
6051
|
-
title: `Export Excel (${
|
|
6042
|
+
title: `Export Excel (${f})`
|
|
6052
6043
|
}
|
|
6053
6044
|
),
|
|
6054
6045
|
d && /* @__PURE__ */ e(
|
|
@@ -6059,7 +6050,7 @@ const Kl = ({
|
|
|
6059
6050
|
ariaLabel: "PDF Download",
|
|
6060
6051
|
size: "small",
|
|
6061
6052
|
category: "secondary",
|
|
6062
|
-
title: `Export PDF (${
|
|
6053
|
+
title: `Export PDF (${v})`
|
|
6063
6054
|
}
|
|
6064
6055
|
),
|
|
6065
6056
|
h && /* @__PURE__ */ e(
|
|
@@ -6074,7 +6065,7 @@ const Kl = ({
|
|
|
6074
6065
|
}
|
|
6075
6066
|
)
|
|
6076
6067
|
] }),
|
|
6077
|
-
|
|
6068
|
+
$ && m && /* @__PURE__ */ e(
|
|
6078
6069
|
ee,
|
|
6079
6070
|
{
|
|
6080
6071
|
label: u,
|
|
@@ -6101,68 +6092,68 @@ function ei(t) {
|
|
|
6101
6092
|
allowSorting: o = !0,
|
|
6102
6093
|
allowFiltering: u = !1,
|
|
6103
6094
|
allowGrouping: p = !1,
|
|
6104
|
-
allowReordering:
|
|
6105
|
-
allowResizing:
|
|
6095
|
+
allowReordering: g = !0,
|
|
6096
|
+
allowResizing: b = !0,
|
|
6106
6097
|
allowExcelExport: r = !1,
|
|
6107
|
-
allowPdfExport:
|
|
6098
|
+
allowPdfExport: y = !1,
|
|
6108
6099
|
showColumnChooser: d = !1,
|
|
6109
6100
|
enableSearchApi: h = !1,
|
|
6110
|
-
height:
|
|
6111
|
-
selectionSettings:
|
|
6112
|
-
enableCheckbox:
|
|
6113
|
-
columns:
|
|
6101
|
+
height: $ = "600",
|
|
6102
|
+
selectionSettings: T = { type: "Multiple", mode: "Row" },
|
|
6103
|
+
enableCheckbox: F = !1,
|
|
6104
|
+
columns: A = [],
|
|
6114
6105
|
onGridStateChange: I,
|
|
6115
|
-
onRowSelected:
|
|
6116
|
-
onRowDeselected:
|
|
6106
|
+
onRowSelected: V,
|
|
6107
|
+
onRowDeselected: U,
|
|
6117
6108
|
onRowDoubleClick: G,
|
|
6118
|
-
apiRef:
|
|
6119
|
-
gridProps:
|
|
6120
|
-
} = t,
|
|
6121
|
-
pageSettings:
|
|
6122
|
-
sortSettings:
|
|
6109
|
+
apiRef: B,
|
|
6110
|
+
gridProps: z = {}
|
|
6111
|
+
} = t, f = xe(null), {
|
|
6112
|
+
pageSettings: v,
|
|
6113
|
+
sortSettings: w,
|
|
6123
6114
|
...C
|
|
6124
|
-
} =
|
|
6125
|
-
const
|
|
6126
|
-
return o &&
|
|
6127
|
-
}, [o, u, p, h, r,
|
|
6128
|
-
const
|
|
6115
|
+
} = z || {}, [N, x] = se.useState(v?.page || 1), [k, E] = se.useState(w?.pageSize || 20), [L, q] = se.useState(w?.sortKey || "updatedDate"), [S, O] = se.useState(w?.direction || "Descending"), D = ue(() => {
|
|
6116
|
+
const j = [cn];
|
|
6117
|
+
return o && j.push(dn), u && j.push(mn), p && j.push(un), h && j.push(hn), r && j.push(pn), y && j.push(gn), d && j.push(bn), b && j.push(fn), g && j.push(xn), j.push(yn), j;
|
|
6118
|
+
}, [o, u, p, h, r, y, d, b, g]), P = ue(() => {
|
|
6119
|
+
const j = () => f.current, ae = (J, we) => {
|
|
6129
6120
|
!we && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${J} requested but related service/feature is disabled.`);
|
|
6130
6121
|
};
|
|
6131
6122
|
return {
|
|
6132
|
-
getInstance: () =>
|
|
6133
|
-
refresh: () =>
|
|
6134
|
-
getSelectedRecords: () =>
|
|
6135
|
-
clearSelection: () =>
|
|
6136
|
-
selectRow: (J) =>
|
|
6137
|
-
selectRows: (J) =>
|
|
6123
|
+
getInstance: () => j(),
|
|
6124
|
+
refresh: () => j()?.refresh?.(),
|
|
6125
|
+
getSelectedRecords: () => j()?.getSelectedRecords?.() ?? [],
|
|
6126
|
+
clearSelection: () => j()?.clearSelection?.(),
|
|
6127
|
+
selectRow: (J) => j()?.selectRow?.(J),
|
|
6128
|
+
selectRows: (J) => j()?.selectRows?.(J),
|
|
6138
6129
|
search: (J) => {
|
|
6139
|
-
|
|
6130
|
+
ae("search()", h), j()?.search?.(J);
|
|
6140
6131
|
},
|
|
6141
|
-
print: () =>
|
|
6132
|
+
print: () => j()?.print?.(),
|
|
6142
6133
|
excelExport: (J) => {
|
|
6143
|
-
|
|
6134
|
+
ae("excelExport()", r), j()?.excelExport?.(J);
|
|
6144
6135
|
},
|
|
6145
6136
|
pdfExport: (J) => {
|
|
6146
|
-
|
|
6137
|
+
ae("pdfExport()", y), j()?.pdfExport?.(J);
|
|
6147
6138
|
},
|
|
6148
6139
|
openColumnChooser: (J, we) => {
|
|
6149
|
-
|
|
6140
|
+
ae("openColumnChooser()", d), j()?.columnChooserModule?.openColumnChooser?.(J, we);
|
|
6150
6141
|
}
|
|
6151
6142
|
};
|
|
6152
6143
|
}, []);
|
|
6153
6144
|
Z(() => {
|
|
6154
|
-
|
|
6155
|
-
}, [
|
|
6156
|
-
|
|
6145
|
+
B && (B.current = P);
|
|
6146
|
+
}, [B, P]), Z(() => () => {
|
|
6147
|
+
B && (B.current = null);
|
|
6157
6148
|
}, []);
|
|
6158
|
-
const _ = (
|
|
6159
|
-
const
|
|
6160
|
-
return
|
|
6161
|
-
}, R = (
|
|
6162
|
-
const
|
|
6149
|
+
const _ = (j) => {
|
|
6150
|
+
const ae = String(j || "");
|
|
6151
|
+
return ae === "Ascending" || ae === "Descending" ? ae : ae.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
6152
|
+
}, R = (j) => {
|
|
6153
|
+
const ae = f.current, J = j?.requestType, we = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Ie = j?.pageSize ?? ae?.pageSettings?.pageSize ?? k, Ue = j?.currentPage ?? ae?.pageSettings?.currentPage ?? l, st = j?.columnName && j?.direction ? [{ field: j.columnName, dir: _(j.direction) }] : (ae?.sortSettings?.columns || []).map((Oe) => ({
|
|
6163
6154
|
field: Oe.field,
|
|
6164
6155
|
dir: _(Oe.direction ?? Oe.dir)
|
|
6165
|
-
})), lt =
|
|
6156
|
+
})), lt = j?.searchString ?? "", it = j?.columns ?? ae?.filterSettings?.columns ?? [];
|
|
6166
6157
|
return {
|
|
6167
6158
|
reason: we,
|
|
6168
6159
|
page: { index: Ue, size: Ie, skip: (Ue - 1) * Ie, take: Ie },
|
|
@@ -6170,17 +6161,17 @@ function ei(t) {
|
|
|
6170
6161
|
// [{ field, dir: 'Ascending'|'Descending' }]
|
|
6171
6162
|
search: lt,
|
|
6172
6163
|
filters: it,
|
|
6173
|
-
rawEvent:
|
|
6164
|
+
rawEvent: j
|
|
6174
6165
|
};
|
|
6175
|
-
}, Y = (
|
|
6166
|
+
}, Y = (j) => {
|
|
6176
6167
|
setTimeout(() => {
|
|
6177
|
-
|
|
6178
|
-
}, 1e3),
|
|
6179
|
-
}, W = (
|
|
6180
|
-
typeof G == "function" && G(
|
|
6168
|
+
f?.current?.hideSpinner();
|
|
6169
|
+
}, 1e3), j.requestType === "paging" && (x(j.currentPage), E(j.pageSize)), j.requestType === "sorting" && (q(j.columnName || "updatedDate"), O(j.direction === "Ascending" ? "ASC" : "DESC")), I && I(R(j), j);
|
|
6170
|
+
}, W = (j) => {
|
|
6171
|
+
typeof G == "function" && G(j?.rowData, j);
|
|
6181
6172
|
}, pe = () => {
|
|
6182
|
-
const
|
|
6183
|
-
return
|
|
6173
|
+
const j = [];
|
|
6174
|
+
return F && j.push(/* @__PURE__ */ e(Dt, { type: "checkbox", width: "50" }, "__checkbox__")), A.forEach((ae, J) => {
|
|
6184
6175
|
const {
|
|
6185
6176
|
field: we,
|
|
6186
6177
|
headerText: Ie,
|
|
@@ -6198,8 +6189,8 @@ function ei(t) {
|
|
|
6198
6189
|
maxWidth: ja,
|
|
6199
6190
|
customAttributes: Va,
|
|
6200
6191
|
..._a
|
|
6201
|
-
} =
|
|
6202
|
-
|
|
6192
|
+
} = ae || {};
|
|
6193
|
+
j.push(
|
|
6203
6194
|
/* @__PURE__ */ e(
|
|
6204
6195
|
Dt,
|
|
6205
6196
|
{
|
|
@@ -6223,34 +6214,34 @@ function ei(t) {
|
|
|
6223
6214
|
we || `col-${J}`
|
|
6224
6215
|
)
|
|
6225
6216
|
);
|
|
6226
|
-
}),
|
|
6217
|
+
}), j;
|
|
6227
6218
|
};
|
|
6228
6219
|
return /* @__PURE__ */ n(
|
|
6229
6220
|
vn,
|
|
6230
6221
|
{
|
|
6231
6222
|
id: i,
|
|
6232
|
-
ref:
|
|
6223
|
+
ref: f,
|
|
6233
6224
|
dataSource: {
|
|
6234
6225
|
result: a,
|
|
6235
6226
|
count: s
|
|
6236
6227
|
},
|
|
6237
|
-
height:
|
|
6228
|
+
height: $,
|
|
6238
6229
|
allowPaging: m,
|
|
6239
6230
|
allowSorting: o,
|
|
6240
6231
|
allowFiltering: u,
|
|
6241
6232
|
allowGrouping: p,
|
|
6242
|
-
allowReordering:
|
|
6243
|
-
allowResizing:
|
|
6233
|
+
allowReordering: g,
|
|
6234
|
+
allowResizing: b,
|
|
6244
6235
|
showColumnChooser: d,
|
|
6245
|
-
selectionSettings:
|
|
6246
|
-
pageSettings: { pageSize: 10, pageSizes:
|
|
6247
|
-
sortSettings:
|
|
6248
|
-
columns: [{ field:
|
|
6236
|
+
selectionSettings: T,
|
|
6237
|
+
pageSettings: { pageSize: 10, pageSizes: v?.pageSizes ?? [20, 40, 60, 80, 100] },
|
|
6238
|
+
sortSettings: w ?? {
|
|
6239
|
+
columns: [{ field: L, direction: _(S) }],
|
|
6249
6240
|
allowUnsort: !1
|
|
6250
6241
|
},
|
|
6251
6242
|
actionBegin: Y,
|
|
6252
|
-
rowSelected:
|
|
6253
|
-
rowDeselected:
|
|
6243
|
+
rowSelected: V,
|
|
6244
|
+
rowDeselected: U,
|
|
6254
6245
|
recordDoubleClick: W,
|
|
6255
6246
|
...C,
|
|
6256
6247
|
children: [
|
|
@@ -6294,10 +6285,10 @@ function ie({
|
|
|
6294
6285
|
details: o = {},
|
|
6295
6286
|
...u
|
|
6296
6287
|
}) {
|
|
6297
|
-
const p = Qe(),
|
|
6288
|
+
const p = Qe(), g = Ds(u, m), b = (y) => {
|
|
6298
6289
|
l?.({
|
|
6299
|
-
key:
|
|
6300
|
-
checked:
|
|
6290
|
+
key: g,
|
|
6291
|
+
checked: y.target.checked,
|
|
6301
6292
|
details: o,
|
|
6302
6293
|
props: u
|
|
6303
6294
|
});
|
|
@@ -6314,7 +6305,7 @@ function ie({
|
|
|
6314
6305
|
id: p,
|
|
6315
6306
|
type: "checkbox",
|
|
6316
6307
|
className: "h-4 w-4 rounded border-zinc-300 focus:ring-[var(--primaryColor)]",
|
|
6317
|
-
onChange:
|
|
6308
|
+
onChange: b,
|
|
6318
6309
|
"aria-label": "Select card"
|
|
6319
6310
|
}
|
|
6320
6311
|
) }),
|
|
@@ -6341,11 +6332,11 @@ function $s({
|
|
|
6341
6332
|
group: o = "Global",
|
|
6342
6333
|
moreGroupsLabel: u = "+ 5 more",
|
|
6343
6334
|
author: p = "Judith Black",
|
|
6344
|
-
timeLabel:
|
|
6345
|
-
imageUrl:
|
|
6335
|
+
timeLabel: g = "Just now",
|
|
6336
|
+
imageUrl: b = "https://images.unsplash.com/photo-1469980098053-382eb10ba017?q=80&w=1200&auto=format&fit=crop",
|
|
6346
6337
|
description: r = "Columbia University is a prestigious Ivy League institution located in the heart of New York City.",
|
|
6347
6338
|
// spread remaining props (_id, instanceId, etc.)
|
|
6348
|
-
...
|
|
6339
|
+
...y
|
|
6349
6340
|
}) {
|
|
6350
6341
|
const d = oe(t), h = ce[d];
|
|
6351
6342
|
return /* @__PURE__ */ n(
|
|
@@ -6357,7 +6348,7 @@ function $s({
|
|
|
6357
6348
|
onSelect: i,
|
|
6358
6349
|
identity: l,
|
|
6359
6350
|
details: { type: "activity", title: m, group: o, author: p },
|
|
6360
|
-
...
|
|
6351
|
+
...y,
|
|
6361
6352
|
children: [
|
|
6362
6353
|
/* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${h.title} ml-3`, children: m }) }),
|
|
6363
6354
|
/* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${h.meta}`, children: [
|
|
@@ -6375,13 +6366,13 @@ function $s({
|
|
|
6375
6366
|
)
|
|
6376
6367
|
] }) : null,
|
|
6377
6368
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", className: "px-2", children: "•" }),
|
|
6378
|
-
/* @__PURE__ */ e("span", { children:
|
|
6369
|
+
/* @__PURE__ */ e("span", { children: g })
|
|
6379
6370
|
] }),
|
|
6380
6371
|
/* @__PURE__ */ n("div", { className: "mt-2 flex items-center gap-3", children: [
|
|
6381
6372
|
/* @__PURE__ */ e(ze, { name: "John", size: "medium" }),
|
|
6382
6373
|
/* @__PURE__ */ n("div", { className: "leading-tight", children: [
|
|
6383
6374
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-100", children: p }),
|
|
6384
|
-
/* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${h.meta}`, children:
|
|
6375
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${h.meta}`, children: g })
|
|
6385
6376
|
] })
|
|
6386
6377
|
] }),
|
|
6387
6378
|
/* @__PURE__ */ n("p", { className: "mt-2 text-zinc-700 dark:text-zinc-300", children: [
|
|
@@ -6399,7 +6390,7 @@ function $s({
|
|
|
6399
6390
|
"div",
|
|
6400
6391
|
{
|
|
6401
6392
|
className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${h.media}`,
|
|
6402
|
-
children: /* @__PURE__ */ e("img", { src:
|
|
6393
|
+
children: /* @__PURE__ */ e("img", { src: b, alt: "", className: "h-full w-full object-cover" })
|
|
6403
6394
|
}
|
|
6404
6395
|
),
|
|
6405
6396
|
/* @__PURE__ */ e("div", { className: "mt-3 w-full flex justify-center", children: /* @__PURE__ */ e(
|
|
@@ -6466,11 +6457,11 @@ function Rs({
|
|
|
6466
6457
|
// spread for identity (_id/instanceId/etc)
|
|
6467
6458
|
...p
|
|
6468
6459
|
}) {
|
|
6469
|
-
const
|
|
6460
|
+
const g = oe(t), b = ce[g], r = Es[g], y = (d) => `px-1 pb-2 text-sm font-medium ${d === o ? "text-zinc-900 dark:text-zinc-100 border-b-2" : "text-zinc-500 dark:text-zinc-400"}`;
|
|
6470
6461
|
return /* @__PURE__ */ n(
|
|
6471
6462
|
ie,
|
|
6472
6463
|
{
|
|
6473
|
-
className: `flex flex-col ${
|
|
6464
|
+
className: `flex flex-col ${b.card} ${r.wrap}`,
|
|
6474
6465
|
showCheckbox: a,
|
|
6475
6466
|
checkboxPosition: s,
|
|
6476
6467
|
onSelect: i,
|
|
@@ -6479,7 +6470,7 @@ function Rs({
|
|
|
6479
6470
|
...p,
|
|
6480
6471
|
children: [
|
|
6481
6472
|
/* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
|
|
6482
|
-
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
6473
|
+
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${b.title}`, children: m }),
|
|
6483
6474
|
/* @__PURE__ */ e(
|
|
6484
6475
|
"span",
|
|
6485
6476
|
{
|
|
@@ -6493,14 +6484,14 @@ function Rs({
|
|
|
6493
6484
|
/* @__PURE__ */ e(
|
|
6494
6485
|
"span",
|
|
6495
6486
|
{
|
|
6496
|
-
className: `${
|
|
6487
|
+
className: `${y("joined")} ${o === "joined" ? "border-[var(--primaryColor)]" : "border-transparent"}`,
|
|
6497
6488
|
children: "Joined"
|
|
6498
6489
|
}
|
|
6499
6490
|
),
|
|
6500
6491
|
/* @__PURE__ */ e(
|
|
6501
6492
|
"span",
|
|
6502
6493
|
{
|
|
6503
|
-
className: `${
|
|
6494
|
+
className: `${y("suggested")} ${o === "suggested" ? "border-[var(--primaryColor)]" : "border-transparent"}`,
|
|
6504
6495
|
children: "Suggested"
|
|
6505
6496
|
}
|
|
6506
6497
|
)
|
|
@@ -6650,11 +6641,11 @@ function Ps({
|
|
|
6650
6641
|
// spread for identity fields: _id / id / instanceId etc.
|
|
6651
6642
|
...u
|
|
6652
6643
|
}) {
|
|
6653
|
-
const p = oe(t),
|
|
6644
|
+
const p = oe(t), g = ce[p], b = Os[p];
|
|
6654
6645
|
return /* @__PURE__ */ n(
|
|
6655
6646
|
ie,
|
|
6656
6647
|
{
|
|
6657
|
-
className: `flex flex-col ${
|
|
6648
|
+
className: `flex flex-col ${g.card} ${b.wrap || ""}`,
|
|
6658
6649
|
showCheckbox: a,
|
|
6659
6650
|
checkboxPosition: s,
|
|
6660
6651
|
onSelect: i,
|
|
@@ -6663,17 +6654,17 @@ function Ps({
|
|
|
6663
6654
|
...u,
|
|
6664
6655
|
children: [
|
|
6665
6656
|
/* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
|
|
6666
|
-
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
6657
|
+
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${g.title}`, children: m }),
|
|
6667
6658
|
/* @__PURE__ */ e("span", { className: "text-sm text-indigo-700 cursor-default select-none", children: "View All" })
|
|
6668
6659
|
] }),
|
|
6669
6660
|
p === "lg" ? (
|
|
6670
6661
|
// Large: 3-up grid of image cards
|
|
6671
|
-
/* @__PURE__ */ e("div", { className: `mt-4 ${
|
|
6672
|
-
/* @__PURE__ */ e("img", { src: r.thumb, alt: "", className:
|
|
6673
|
-
/* @__PURE__ */ e("h4", { className: `mt-3 ${
|
|
6674
|
-
/* @__PURE__ */ e("div", { className: `mt-1 text-zinc-500 dark:text-zinc-400 ${
|
|
6662
|
+
/* @__PURE__ */ e("div", { className: `mt-4 ${b.grid}`, children: o.slice(0, 3).map((r) => /* @__PURE__ */ n("article", { children: [
|
|
6663
|
+
/* @__PURE__ */ e("img", { src: r.thumb, alt: "", className: b.cardImg }),
|
|
6664
|
+
/* @__PURE__ */ e("h4", { className: `mt-3 ${b.title} text-zinc-900 dark:text-zinc-100`, children: r.title }),
|
|
6665
|
+
/* @__PURE__ */ e("div", { className: `mt-1 text-zinc-500 dark:text-zinc-400 ${b.date}`, children: r.date }),
|
|
6675
6666
|
/* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(jt, { label: r.tag }) }),
|
|
6676
|
-
/* @__PURE__ */ n("p", { className: `mt-2 ${
|
|
6667
|
+
/* @__PURE__ */ n("p", { className: `mt-2 ${b.excerpt}`, children: [
|
|
6677
6668
|
r.excerpt,
|
|
6678
6669
|
" ",
|
|
6679
6670
|
/* @__PURE__ */ e("span", { className: "underline decoration-dotted text-indigo-700 cursor-default", children: "View more" })
|
|
@@ -6686,12 +6677,12 @@ function Ps({
|
|
|
6686
6677
|
{
|
|
6687
6678
|
className: "flex items-start gap-3 rounded-xl border border-zinc-200 dark:border-zinc-800 p-2",
|
|
6688
6679
|
children: [
|
|
6689
|
-
/* @__PURE__ */ e("div", { className: `overflow-hidden rounded-lg ${
|
|
6680
|
+
/* @__PURE__ */ e("div", { className: `overflow-hidden rounded-lg ${b.itemThumb} flex-shrink-0`, children: /* @__PURE__ */ e("img", { src: r.thumb, alt: "", className: "h-full w-full object-cover" }) }),
|
|
6690
6681
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
6691
|
-
/* @__PURE__ */ e("h4", { className: `${
|
|
6692
|
-
/* @__PURE__ */ e("div", { className: `mt-1 text-zinc-500 dark:text-zinc-400 ${
|
|
6682
|
+
/* @__PURE__ */ e("h4", { className: `${b.title} text-zinc-900 dark:text-zinc-100 line-clamp-2`, children: r.title }),
|
|
6683
|
+
/* @__PURE__ */ e("div", { className: `mt-1 text-zinc-500 dark:text-zinc-400 ${b.date}`, children: r.date }),
|
|
6693
6684
|
/* @__PURE__ */ e("div", { className: "mt-1", children: /* @__PURE__ */ e(jt, { label: r.tag }) }),
|
|
6694
|
-
|
|
6685
|
+
b.excerpt !== "hidden" && /* @__PURE__ */ n("p", { className: `mt-2 ${b.excerpt}`, children: [
|
|
6695
6686
|
r.excerpt,
|
|
6696
6687
|
" ",
|
|
6697
6688
|
/* @__PURE__ */ e("span", { className: "underline decoration-dotted text-indigo-700 cursor-default", children: "View more" })
|
|
@@ -6766,29 +6757,29 @@ function Vs({
|
|
|
6766
6757
|
filters: u = Ls,
|
|
6767
6758
|
activeFilter: p = "All",
|
|
6768
6759
|
// NEW: iframe controls
|
|
6769
|
-
mapQuery:
|
|
6770
|
-
zoom:
|
|
6760
|
+
mapQuery: g = "Florida",
|
|
6761
|
+
zoom: b = 12,
|
|
6771
6762
|
mapUrl: r,
|
|
6772
6763
|
// optional full embed URL override
|
|
6773
|
-
...
|
|
6764
|
+
...y
|
|
6774
6765
|
}) {
|
|
6775
|
-
const d = oe(t), h = ce[d],
|
|
6766
|
+
const d = oe(t), h = ce[d], $ = Ms[d], T = r || js(g, b);
|
|
6776
6767
|
return /* @__PURE__ */ e(
|
|
6777
6768
|
ie,
|
|
6778
6769
|
{
|
|
6779
|
-
className: `flex flex-col ${h.card} ${
|
|
6770
|
+
className: `flex flex-col ${h.card} ${$.wrap}`,
|
|
6780
6771
|
showCheckbox: a,
|
|
6781
6772
|
checkboxPosition: s,
|
|
6782
6773
|
onSelect: i,
|
|
6783
6774
|
identity: l,
|
|
6784
|
-
details: { type: "campus-map", title: m, campusName: o, activeFilter: p, mapQuery:
|
|
6785
|
-
...
|
|
6786
|
-
children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${
|
|
6775
|
+
details: { type: "campus-map", title: m, campusName: o, activeFilter: p, mapQuery: g, zoom: b },
|
|
6776
|
+
...y,
|
|
6777
|
+
children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${$.mapH}`, children: [
|
|
6787
6778
|
/* @__PURE__ */ e(
|
|
6788
6779
|
"iframe",
|
|
6789
6780
|
{
|
|
6790
6781
|
title: "Google Map",
|
|
6791
|
-
src:
|
|
6782
|
+
src: T,
|
|
6792
6783
|
className: "h-full w-full",
|
|
6793
6784
|
style: { border: 0 },
|
|
6794
6785
|
loading: "lazy",
|
|
@@ -6797,7 +6788,7 @@ function Vs({
|
|
|
6797
6788
|
}
|
|
6798
6789
|
),
|
|
6799
6790
|
/* @__PURE__ */ n("div", { className: "absolute left-4 right-4 top-3 flex items-center justify-between pointer-events-none", children: [
|
|
6800
|
-
/* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${
|
|
6791
|
+
/* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${$.campusPill}`, children: [
|
|
6801
6792
|
/* @__PURE__ */ e("span", { className: "truncate max-w-[60vw]", children: o }),
|
|
6802
6793
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-400", children: "▾" })
|
|
6803
6794
|
] }),
|
|
@@ -6806,8 +6797,8 @@ function Vs({
|
|
|
6806
6797
|
/* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-full bg-white/90 border border-zinc-300 flex items-center justify-center", children: "›" })
|
|
6807
6798
|
] })
|
|
6808
6799
|
] }),
|
|
6809
|
-
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-14 md:top-12 pointer-events-none mt-2", children: /* @__PURE__ */ e("div", { className: `flex ${
|
|
6810
|
-
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-28 md:top-24 pointer-events-none", children: /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 px-4 ${
|
|
6800
|
+
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-14 md:top-12 pointer-events-none mt-2", children: /* @__PURE__ */ e("div", { className: `flex ${$.chipGap} overflow-x-auto scrollbar-none`, children: u.map((F) => /* @__PURE__ */ e(Bs, { label: F, active: F === p, size: d }, F)) }) }),
|
|
6801
|
+
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-28 md:top-24 pointer-events-none", children: /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 px-4 ${$.searchH}`, children: [
|
|
6811
6802
|
/* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 24 24", "aria-hidden": "true", className: "opacity-60", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M15.5 14h-.79l-.28-.27a6.471 6.471 0 001.48-4.23C15.91 6.01 13.4 3.5 10.45 3.5S5 6.01 5 9.5 7.5 15.5 10.45 15.5c1.61 0 3.09-.59 4.23-1.48l.27.28v.79l4.25 4.25c.41.41 1.07.41 1.48 0s.41-1.07 0-1.48L15.5 14Zm-5.05 0C8.01 14 6 11.99 6 9.5S8.01 5 10.45 5s4.45 2.01 4.45 4.5-2.01 4.5-4.45 4.5Z" }) }),
|
|
6812
6803
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-500 dark:text-zinc-400", children: "Search places" })
|
|
6813
6804
|
] }) })
|
|
@@ -6978,13 +6969,13 @@ function Ys({
|
|
|
6978
6969
|
selectedIndex: u = 0,
|
|
6979
6970
|
...p
|
|
6980
6971
|
}) {
|
|
6981
|
-
const [
|
|
6982
|
-
|
|
6983
|
-
},
|
|
6972
|
+
const [g, b] = M(u), r = oe(t), y = ce[r], d = Us[r], h = o[g] || o[0], $ = (F, A) => {
|
|
6973
|
+
b(A), i?.(F);
|
|
6974
|
+
}, T = r === "lg";
|
|
6984
6975
|
return /* @__PURE__ */ n(
|
|
6985
6976
|
ie,
|
|
6986
6977
|
{
|
|
6987
|
-
className: `flex flex-col ${
|
|
6978
|
+
className: `flex flex-col ${y.card} ${d.wrap}`,
|
|
6988
6979
|
showCheckbox: a,
|
|
6989
6980
|
checkboxPosition: s,
|
|
6990
6981
|
onSelect: i,
|
|
@@ -6993,38 +6984,38 @@ function Ys({
|
|
|
6993
6984
|
...p,
|
|
6994
6985
|
children: [
|
|
6995
6986
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between mb-4", children: [
|
|
6996
|
-
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
6987
|
+
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${y.title}`, children: m }),
|
|
6997
6988
|
/* @__PURE__ */ e("button", { className: "text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200", children: "View All" })
|
|
6998
6989
|
] }),
|
|
6999
|
-
|
|
6990
|
+
T ? (
|
|
7000
6991
|
// Large: Two-column layout
|
|
7001
6992
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
7002
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((
|
|
6993
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((F, A) => /* @__PURE__ */ e(
|
|
7003
6994
|
Vt,
|
|
7004
6995
|
{
|
|
7005
|
-
ev:
|
|
6996
|
+
ev: F,
|
|
7006
6997
|
sizeMeta: d,
|
|
7007
|
-
isSelected:
|
|
7008
|
-
onClick: (I) =>
|
|
6998
|
+
isSelected: A === g,
|
|
6999
|
+
onClick: (I) => $(I, A)
|
|
7009
7000
|
},
|
|
7010
|
-
|
|
7001
|
+
F._id || F.id || A
|
|
7011
7002
|
)) }),
|
|
7012
7003
|
/* @__PURE__ */ e(Gs, { ev: h, sizeMeta: d })
|
|
7013
7004
|
] })
|
|
7014
7005
|
) : (
|
|
7015
7006
|
// Small/Medium: Simple list only
|
|
7016
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((
|
|
7007
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((F, A) => /* @__PURE__ */ e(
|
|
7017
7008
|
Vt,
|
|
7018
7009
|
{
|
|
7019
|
-
ev:
|
|
7010
|
+
ev: F,
|
|
7020
7011
|
sizeMeta: d,
|
|
7021
|
-
isSelected:
|
|
7022
|
-
onClick: (I) =>
|
|
7012
|
+
isSelected: A === g,
|
|
7013
|
+
onClick: (I) => $(I, A)
|
|
7023
7014
|
},
|
|
7024
|
-
|
|
7015
|
+
F._id || F.id || A
|
|
7025
7016
|
)) })
|
|
7026
7017
|
),
|
|
7027
|
-
|
|
7018
|
+
!T && /* @__PURE__ */ e("div", { className: "mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-800", children: /* @__PURE__ */ e("button", { className: "w-full text-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200", children: "View All" }) })
|
|
7028
7019
|
]
|
|
7029
7020
|
}
|
|
7030
7021
|
);
|
|
@@ -7192,42 +7183,42 @@ function Hs({
|
|
|
7192
7183
|
emails: o = Ws,
|
|
7193
7184
|
selectedIndex: u = 0,
|
|
7194
7185
|
onStar: p,
|
|
7195
|
-
onPin:
|
|
7196
|
-
...
|
|
7186
|
+
onPin: g,
|
|
7187
|
+
...b
|
|
7197
7188
|
}) {
|
|
7198
|
-
const [r,
|
|
7199
|
-
|
|
7189
|
+
const [r, y] = M(u), d = oe(t), h = ce[d], $ = Js[d], T = (I, V) => {
|
|
7190
|
+
y(V), i?.(I);
|
|
7191
|
+
}, F = (I) => {
|
|
7192
|
+
const V = { ...I, starred: !I.starred };
|
|
7193
|
+
p?.(V);
|
|
7200
7194
|
}, A = (I) => {
|
|
7201
|
-
const
|
|
7202
|
-
|
|
7203
|
-
}, E = (I) => {
|
|
7204
|
-
const j = { ...I, pinned: !I.pinned };
|
|
7205
|
-
b?.(j);
|
|
7195
|
+
const V = { ...I, pinned: !I.pinned };
|
|
7196
|
+
g?.(V);
|
|
7206
7197
|
};
|
|
7207
7198
|
return /* @__PURE__ */ n(
|
|
7208
7199
|
ie,
|
|
7209
7200
|
{
|
|
7210
|
-
className: `flex flex-col ${h.card} ${
|
|
7201
|
+
className: `flex flex-col ${h.card} ${$.wrap}`,
|
|
7211
7202
|
showCheckbox: a,
|
|
7212
7203
|
checkboxPosition: s,
|
|
7213
7204
|
onSelect: i,
|
|
7214
7205
|
identity: l,
|
|
7215
7206
|
details: { type: "emails", title: m, count: o?.length ?? 0 },
|
|
7216
|
-
...
|
|
7207
|
+
...b,
|
|
7217
7208
|
children: [
|
|
7218
7209
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${h.title}`, children: m }) }),
|
|
7219
7210
|
/* @__PURE__ */ e(be, { placeholder: "Type to search..." }),
|
|
7220
|
-
/* @__PURE__ */ e("div", { className: "space-y-0", children: o.map((I,
|
|
7211
|
+
/* @__PURE__ */ e("div", { className: "space-y-0", children: o.map((I, V) => /* @__PURE__ */ e(
|
|
7221
7212
|
Xs,
|
|
7222
7213
|
{
|
|
7223
7214
|
email: I,
|
|
7224
|
-
sizeMeta:
|
|
7225
|
-
isSelected:
|
|
7226
|
-
onClick: (
|
|
7227
|
-
onStar:
|
|
7228
|
-
onPin:
|
|
7215
|
+
sizeMeta: $,
|
|
7216
|
+
isSelected: V === r,
|
|
7217
|
+
onClick: (U) => T(U, V),
|
|
7218
|
+
onStar: F,
|
|
7219
|
+
onPin: A
|
|
7229
7220
|
},
|
|
7230
|
-
I._id || I.id ||
|
|
7221
|
+
I._id || I.id || V
|
|
7231
7222
|
)) }),
|
|
7232
7223
|
/* @__PURE__ */ e("div", { className: "mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-800", children: /* @__PURE__ */ e("button", { className: "w-full text-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200", children: "View All" }) })
|
|
7233
7224
|
]
|
|
@@ -7447,13 +7438,13 @@ function tl({
|
|
|
7447
7438
|
selectedIndex: u = 0,
|
|
7448
7439
|
...p
|
|
7449
7440
|
}) {
|
|
7450
|
-
const [
|
|
7451
|
-
|
|
7452
|
-
},
|
|
7441
|
+
const [g, b] = M(u), r = oe(t), y = ce[r], d = Zs[r], h = (F, A) => {
|
|
7442
|
+
b(A), i?.(F);
|
|
7443
|
+
}, $ = o[g] || o[0], T = d.layout === "split";
|
|
7453
7444
|
return /* @__PURE__ */ n(
|
|
7454
7445
|
ie,
|
|
7455
7446
|
{
|
|
7456
|
-
className: `flex flex-col ${
|
|
7447
|
+
className: `flex flex-col ${y.card} ${d.wrap}`,
|
|
7457
7448
|
showCheckbox: a,
|
|
7458
7449
|
checkboxPosition: s,
|
|
7459
7450
|
onSelect: i,
|
|
@@ -7461,37 +7452,37 @@ function tl({
|
|
|
7461
7452
|
details: { type: "directory", title: m, count: o?.length ?? 0 },
|
|
7462
7453
|
...p,
|
|
7463
7454
|
children: [
|
|
7464
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between mb-4", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
7455
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between mb-4", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${y.title}`, children: m }) }),
|
|
7465
7456
|
/* @__PURE__ */ e(el, { sizeMeta: d }),
|
|
7466
|
-
|
|
7467
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((
|
|
7457
|
+
T ? /* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0", children: [
|
|
7458
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((F, A) => /* @__PURE__ */ e(
|
|
7468
7459
|
_t,
|
|
7469
7460
|
{
|
|
7470
|
-
contact:
|
|
7461
|
+
contact: F,
|
|
7471
7462
|
sizeMeta: d,
|
|
7472
|
-
isSelected:
|
|
7473
|
-
onClick: (I) => h(I,
|
|
7463
|
+
isSelected: A === g,
|
|
7464
|
+
onClick: (I) => h(I, A)
|
|
7474
7465
|
},
|
|
7475
|
-
|
|
7466
|
+
F._id || F.id || A
|
|
7476
7467
|
)) }),
|
|
7477
7468
|
/* @__PURE__ */ e(
|
|
7478
7469
|
Ks,
|
|
7479
7470
|
{
|
|
7480
|
-
contact:
|
|
7471
|
+
contact: $,
|
|
7481
7472
|
sizeMeta: d
|
|
7482
7473
|
}
|
|
7483
7474
|
)
|
|
7484
7475
|
] }) : (
|
|
7485
7476
|
// Single column layout for small screens
|
|
7486
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((
|
|
7477
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((F, A) => /* @__PURE__ */ e(
|
|
7487
7478
|
_t,
|
|
7488
7479
|
{
|
|
7489
|
-
contact:
|
|
7480
|
+
contact: F,
|
|
7490
7481
|
sizeMeta: d,
|
|
7491
|
-
isSelected:
|
|
7492
|
-
onClick: (I) => h(I,
|
|
7482
|
+
isSelected: A === g,
|
|
7483
|
+
onClick: (I) => h(I, A)
|
|
7493
7484
|
},
|
|
7494
|
-
|
|
7485
|
+
F._id || F.id || A
|
|
7495
7486
|
)) })
|
|
7496
7487
|
),
|
|
7497
7488
|
/* @__PURE__ */ e("div", { className: "mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-800", children: /* @__PURE__ */ e("button", { className: "w-full text-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200", children: "View All" }) })
|
|
@@ -7580,8 +7571,8 @@ function nl({
|
|
|
7580
7571
|
termLabel: o = "Spring 2024",
|
|
7581
7572
|
balance: u = 3e3,
|
|
7582
7573
|
totalCharges: p = 4440,
|
|
7583
|
-
totalPayments:
|
|
7584
|
-
transactions:
|
|
7574
|
+
totalPayments: g = 1568,
|
|
7575
|
+
transactions: b = [
|
|
7585
7576
|
{
|
|
7586
7577
|
id: "t1",
|
|
7587
7578
|
date: "February 16, 2025",
|
|
@@ -7599,7 +7590,7 @@ function nl({
|
|
|
7599
7590
|
],
|
|
7600
7591
|
...r
|
|
7601
7592
|
}) {
|
|
7602
|
-
const
|
|
7593
|
+
const y = oe(t), d = ce[y], h = rl[y];
|
|
7603
7594
|
return /* @__PURE__ */ n(
|
|
7604
7595
|
ie,
|
|
7605
7596
|
{
|
|
@@ -7608,7 +7599,7 @@ function nl({
|
|
|
7608
7599
|
checkboxPosition: s,
|
|
7609
7600
|
onSelect: i,
|
|
7610
7601
|
identity: l,
|
|
7611
|
-
details: { type: "account-summary", termLabel: o, balance: u, totalCharges: p, totalPayments:
|
|
7602
|
+
details: { type: "account-summary", termLabel: o, balance: u, totalCharges: p, totalPayments: g },
|
|
7612
7603
|
...r,
|
|
7613
7604
|
children: [
|
|
7614
7605
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
@@ -7629,7 +7620,7 @@ function nl({
|
|
|
7629
7620
|
] }),
|
|
7630
7621
|
/* @__PURE__ */ n("div", { children: [
|
|
7631
7622
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Payments" }),
|
|
7632
|
-
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: $e(
|
|
7623
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: $e(g) })
|
|
7633
7624
|
] })
|
|
7634
7625
|
] })
|
|
7635
7626
|
] }),
|
|
@@ -7641,19 +7632,19 @@ function nl({
|
|
|
7641
7632
|
] }),
|
|
7642
7633
|
/* @__PURE__ */ n("div", { children: [
|
|
7643
7634
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Payments" }),
|
|
7644
|
-
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: $e(
|
|
7635
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: $e(g) })
|
|
7645
7636
|
] })
|
|
7646
7637
|
] }),
|
|
7647
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
7638
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: b.slice(0, 2).map(($, T) => /* @__PURE__ */ e(
|
|
7648
7639
|
al,
|
|
7649
7640
|
{
|
|
7650
|
-
side:
|
|
7651
|
-
date:
|
|
7652
|
-
title:
|
|
7653
|
-
amount:
|
|
7654
|
-
kind:
|
|
7641
|
+
side: T === 0 ? "left" : "right",
|
|
7642
|
+
date: $.date,
|
|
7643
|
+
title: $.title,
|
|
7644
|
+
amount: $.amount,
|
|
7645
|
+
kind: $.kind
|
|
7655
7646
|
},
|
|
7656
|
-
|
|
7647
|
+
$.id || T
|
|
7657
7648
|
)) })
|
|
7658
7649
|
] })
|
|
7659
7650
|
] }),
|
|
@@ -7772,7 +7763,7 @@ function ll({
|
|
|
7772
7763
|
term: o = "Fall 2025",
|
|
7773
7764
|
...u
|
|
7774
7765
|
}) {
|
|
7775
|
-
const [p,
|
|
7766
|
+
const [p, g] = M("vacation"), [b, r] = M(!1), y = oe(t), d = ce[y], h = sl[y], $ = We.find((T) => T.id === p) || We[0];
|
|
7776
7767
|
return /* @__PURE__ */ n(
|
|
7777
7768
|
ie,
|
|
7778
7769
|
{
|
|
@@ -7798,38 +7789,38 @@ function ll({
|
|
|
7798
7789
|
"button",
|
|
7799
7790
|
{
|
|
7800
7791
|
className: "flex items-center gap-1 p-2 text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors duration-200",
|
|
7801
|
-
onClick: () => r(!
|
|
7792
|
+
onClick: () => r(!b),
|
|
7802
7793
|
children: /* @__PURE__ */ e(na, { className: "h-4 w-4" })
|
|
7803
7794
|
}
|
|
7804
7795
|
),
|
|
7805
|
-
|
|
7796
|
+
b && /* @__PURE__ */ n("div", { className: "absolute right-0 top-full mt-1 w-48 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-md shadow-lg z-10 py-1", children: [
|
|
7806
7797
|
/* @__PURE__ */ e("button", { className: "w-full px-4 py-2 text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700 text-left", children: "Download Pay Stub" }),
|
|
7807
7798
|
/* @__PURE__ */ e("button", { className: "w-full px-4 py-2 text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700 text-left", children: "View Leave History" })
|
|
7808
7799
|
] })
|
|
7809
7800
|
] })
|
|
7810
7801
|
] }),
|
|
7811
|
-
h.showTabs && /* @__PURE__ */ e("div", { className: "flex border-b border-zinc-200 dark:border-zinc-800", children: We.map((
|
|
7802
|
+
h.showTabs && /* @__PURE__ */ e("div", { className: "flex border-b border-zinc-200 dark:border-zinc-800", children: We.map((T) => /* @__PURE__ */ e(
|
|
7812
7803
|
"button",
|
|
7813
7804
|
{
|
|
7814
|
-
className: `flex-1 py-2 px-4 text-center ${h.tab} font-medium border-b-2 transition-colors duration-200 ${p ===
|
|
7815
|
-
onClick: () =>
|
|
7816
|
-
children:
|
|
7805
|
+
className: `flex-1 py-2 px-4 text-center ${h.tab} font-medium border-b-2 transition-colors duration-200 ${p === T.id ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100"}`,
|
|
7806
|
+
onClick: () => g(T.id),
|
|
7807
|
+
children: T.name.split(" ")[0]
|
|
7817
7808
|
},
|
|
7818
|
-
|
|
7809
|
+
T.id
|
|
7819
7810
|
)) }),
|
|
7820
7811
|
/* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children: h.showAllLeave ? (
|
|
7821
7812
|
// LG: Show all leave types
|
|
7822
|
-
We.map((
|
|
7813
|
+
We.map((T) => /* @__PURE__ */ e(Ut, { leave: T, sizeMeta: h }, T.id))
|
|
7823
7814
|
) : h.showSingleLeave ? (
|
|
7824
7815
|
// MD: Show active tab leave type
|
|
7825
|
-
/* @__PURE__ */ e(Ut, { leave:
|
|
7816
|
+
/* @__PURE__ */ e(Ut, { leave: $, sizeMeta: h })
|
|
7826
7817
|
) : (
|
|
7827
7818
|
// SM: Show only available hours
|
|
7828
7819
|
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-900 rounded-lg border border-zinc-200 dark:border-zinc-800 p-4", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-3 mb-3", children: [
|
|
7829
7820
|
/* @__PURE__ */ e(Fe, { className: "h-5 w-5 text-blue-600 dark:text-blue-400" }),
|
|
7830
7821
|
/* @__PURE__ */ n("div", { children: [
|
|
7831
7822
|
/* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${h.table}`, children: "Available Leave" }),
|
|
7832
|
-
/* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${h.table}`, children:
|
|
7823
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${h.table}`, children: $.available })
|
|
7833
7824
|
] })
|
|
7834
7825
|
] }) })
|
|
7835
7826
|
) }),
|
|
@@ -7963,11 +7954,11 @@ function dl({
|
|
|
7963
7954
|
subtitle: o = "Drive Shared",
|
|
7964
7955
|
...u
|
|
7965
7956
|
}) {
|
|
7966
|
-
const [p,
|
|
7957
|
+
const [p, g] = M(!1), b = oe(t), r = ce[b], y = cl[b];
|
|
7967
7958
|
return /* @__PURE__ */ n(
|
|
7968
7959
|
ie,
|
|
7969
7960
|
{
|
|
7970
|
-
className: `flex flex-col ${r.card} ${
|
|
7961
|
+
className: `flex flex-col ${r.card} ${y.wrap}`,
|
|
7971
7962
|
showCheckbox: a,
|
|
7972
7963
|
checkboxPosition: s,
|
|
7973
7964
|
onSelect: i,
|
|
@@ -7977,7 +7968,7 @@ function dl({
|
|
|
7977
7968
|
children: [
|
|
7978
7969
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
7979
7970
|
/* @__PURE__ */ n("div", { children: [
|
|
7980
|
-
/* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${
|
|
7971
|
+
/* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${y.title} mb-1`, children: m }),
|
|
7981
7972
|
/* @__PURE__ */ e("div", { className: "text-zinc-600 dark:text-zinc-400 text-sm", children: o })
|
|
7982
7973
|
] }),
|
|
7983
7974
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
@@ -7985,7 +7976,7 @@ function dl({
|
|
|
7985
7976
|
"button",
|
|
7986
7977
|
{
|
|
7987
7978
|
className: "flex items-center gap-1 p-2 text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors duration-200",
|
|
7988
|
-
onClick: () =>
|
|
7979
|
+
onClick: () => g(!p),
|
|
7989
7980
|
children: /* @__PURE__ */ e(Qt, { className: "h-4 w-4" })
|
|
7990
7981
|
}
|
|
7991
7982
|
),
|
|
@@ -8001,21 +7992,21 @@ function dl({
|
|
|
8001
7992
|
] })
|
|
8002
7993
|
] })
|
|
8003
7994
|
] }),
|
|
8004
|
-
/* @__PURE__ */ e("div", { className: `grid ${
|
|
7995
|
+
/* @__PURE__ */ e("div", { className: `grid ${y.gridCols} gap-3 `, children: il.map((d) => /* @__PURE__ */ e(
|
|
8005
7996
|
qt,
|
|
8006
7997
|
{
|
|
8007
7998
|
item: d,
|
|
8008
|
-
sizeMeta:
|
|
7999
|
+
sizeMeta: y
|
|
8009
8000
|
},
|
|
8010
8001
|
d.id
|
|
8011
8002
|
)) }),
|
|
8012
|
-
|
|
8013
|
-
/* @__PURE__ */ e("h4", { className: `font-semibold text-zinc-900 dark:text-zinc-100 mb-3 ${
|
|
8003
|
+
y.showRecent && /* @__PURE__ */ n("div", { className: "", children: [
|
|
8004
|
+
/* @__PURE__ */ e("h4", { className: `font-semibold text-zinc-900 dark:text-zinc-100 mb-3 ${y.item}`, children: "Recent Files" }),
|
|
8014
8005
|
/* @__PURE__ */ e("div", { className: "space-y-2", children: ol.map((d) => /* @__PURE__ */ e(
|
|
8015
8006
|
qt,
|
|
8016
8007
|
{
|
|
8017
8008
|
item: d,
|
|
8018
|
-
sizeMeta:
|
|
8009
|
+
sizeMeta: y,
|
|
8019
8010
|
showDate: !0
|
|
8020
8011
|
},
|
|
8021
8012
|
d.id
|
|
@@ -8155,7 +8146,7 @@ const ml = [
|
|
|
8155
8146
|
}
|
|
8156
8147
|
};
|
|
8157
8148
|
function pl({ alert: t, sizeMeta: a, onDismiss: s, onMarkRead: i }) {
|
|
8158
|
-
const [l, m] =
|
|
8149
|
+
const [l, m] = M(!1), o = Ra(t.type), u = hl(t.type);
|
|
8159
8150
|
return l ? null : /* @__PURE__ */ n("div", { className: `relative rounded-lg border-l-4 p-4 transition-all duration-200 ${o.bg} ${o.border} ${t.read ? "border-l-2 opacity-80" : "border-l-4"}`, style: { borderLeftColor: o.accent }, children: [
|
|
8160
8151
|
/* @__PURE__ */ e(
|
|
8161
8152
|
"button",
|
|
@@ -8179,7 +8170,7 @@ function pl({ alert: t, sizeMeta: a, onDismiss: s, onMarkRead: i }) {
|
|
|
8179
8170
|
] });
|
|
8180
8171
|
}
|
|
8181
8172
|
function gl({ alert: t, onDismiss: a }) {
|
|
8182
|
-
const [s, i] =
|
|
8173
|
+
const [s, i] = M(!1), l = Ra("banner"), m = () => {
|
|
8183
8174
|
i(!0), a?.(t);
|
|
8184
8175
|
};
|
|
8185
8176
|
return s ? null : /* @__PURE__ */ e("div", { className: `rounded-lg border p-4 ${l.bg} ${l.border} relative`, children: /* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
|
|
@@ -8209,36 +8200,36 @@ function bl({
|
|
|
8209
8200
|
showBanner: u = !0,
|
|
8210
8201
|
...p
|
|
8211
8202
|
}) {
|
|
8212
|
-
const [
|
|
8213
|
-
|
|
8214
|
-
},
|
|
8203
|
+
const [g, b] = M(o), r = oe(t), y = ce[r], d = ul[r], h = (F) => {
|
|
8204
|
+
b((A) => A.filter((I) => I.id !== F.id));
|
|
8205
|
+
}, $ = g.find((F) => F.type === "banner"), T = g.filter((F) => F.type !== "banner");
|
|
8215
8206
|
return /* @__PURE__ */ n(
|
|
8216
8207
|
ie,
|
|
8217
8208
|
{
|
|
8218
|
-
className: `flex flex-col ${
|
|
8209
|
+
className: `flex flex-col ${y.card} ${d.wrap}`,
|
|
8219
8210
|
showCheckbox: a,
|
|
8220
8211
|
checkboxPosition: s,
|
|
8221
8212
|
onSelect: i,
|
|
8222
8213
|
identity: l,
|
|
8223
|
-
details: { type: "alerts", title: m, count:
|
|
8214
|
+
details: { type: "alerts", title: m, count: g.length },
|
|
8224
8215
|
...p,
|
|
8225
8216
|
children: [
|
|
8226
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between ", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
8227
|
-
u &&
|
|
8217
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between ", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${y.title}`, children: m }) }),
|
|
8218
|
+
u && $ && t !== "sm" && /* @__PURE__ */ e(
|
|
8228
8219
|
gl,
|
|
8229
8220
|
{
|
|
8230
|
-
alert:
|
|
8221
|
+
alert: $,
|
|
8231
8222
|
onDismiss: h
|
|
8232
8223
|
}
|
|
8233
8224
|
),
|
|
8234
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children:
|
|
8225
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: T.slice(0, 3).map((F) => /* @__PURE__ */ e(
|
|
8235
8226
|
pl,
|
|
8236
8227
|
{
|
|
8237
|
-
alert:
|
|
8228
|
+
alert: F,
|
|
8238
8229
|
sizeMeta: d,
|
|
8239
8230
|
onDismiss: h
|
|
8240
8231
|
},
|
|
8241
|
-
|
|
8232
|
+
F.id
|
|
8242
8233
|
)) }),
|
|
8243
8234
|
/* @__PURE__ */ e("button", { className: "w-full py-3 px-4 border border-zinc-300 dark:border-zinc-600 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 font-medium rounded-lg transition-colors duration-200", children: "View All" })
|
|
8244
8235
|
]
|
|
@@ -8343,7 +8334,7 @@ const fl = [
|
|
|
8343
8334
|
}
|
|
8344
8335
|
};
|
|
8345
8336
|
function yl({ video: t, sizeMeta: a }) {
|
|
8346
|
-
const [s, i] =
|
|
8337
|
+
const [s, i] = M(!1);
|
|
8347
8338
|
return /* @__PURE__ */ n("div", { className: "group cursor-pointer", children: [
|
|
8348
8339
|
/* @__PURE__ */ n("div", { className: `relative ${a.thumbnailHeight} rounded-lg overflow-hidden bg-zinc-200 dark:bg-zinc-800`, children: [
|
|
8349
8340
|
/* @__PURE__ */ e(
|
|
@@ -8385,11 +8376,11 @@ function vl({
|
|
|
8385
8376
|
videos: o = fl,
|
|
8386
8377
|
...u
|
|
8387
8378
|
}) {
|
|
8388
|
-
const [p,
|
|
8379
|
+
const [p, g] = M(!1), b = oe(t), r = ce[b], y = xl[b];
|
|
8389
8380
|
return /* @__PURE__ */ n(
|
|
8390
8381
|
ie,
|
|
8391
8382
|
{
|
|
8392
|
-
className: `flex flex-col ${r.card} ${
|
|
8383
|
+
className: `flex flex-col ${r.card} ${y.wrap}`,
|
|
8393
8384
|
showCheckbox: a,
|
|
8394
8385
|
checkboxPosition: s,
|
|
8395
8386
|
onSelect: i,
|
|
@@ -8404,7 +8395,7 @@ function vl({
|
|
|
8404
8395
|
"button",
|
|
8405
8396
|
{
|
|
8406
8397
|
className: "flex items-center gap-1 px-3 py-1.5 text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 border border-zinc-300 dark:border-zinc-600 rounded-md transition-colors duration-200",
|
|
8407
|
-
onClick: () =>
|
|
8398
|
+
onClick: () => g(!p),
|
|
8408
8399
|
children: [
|
|
8409
8400
|
"Filter",
|
|
8410
8401
|
/* @__PURE__ */ e(ve, { className: "h-4 w-4 transform rotate-90" })
|
|
@@ -8419,11 +8410,11 @@ function vl({
|
|
|
8419
8410
|
] })
|
|
8420
8411
|
] })
|
|
8421
8412
|
] }),
|
|
8422
|
-
/* @__PURE__ */ e("div", { className: `grid ${
|
|
8413
|
+
/* @__PURE__ */ e("div", { className: `grid ${y.gridCols} gap-4 `, children: o.slice(0, y.gridCols === "grid-cols-3" ? 6 : 4).map((d) => /* @__PURE__ */ e(
|
|
8423
8414
|
yl,
|
|
8424
8415
|
{
|
|
8425
8416
|
video: d,
|
|
8426
|
-
sizeMeta:
|
|
8417
|
+
sizeMeta: y
|
|
8427
8418
|
},
|
|
8428
8419
|
d.id
|
|
8429
8420
|
)) }),
|