unifyedx-storybook-new 0.2.89 → 0.2.91
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.
- package/dist/unifyedx-storybook-new.css +1 -1
- package/dist/unifyedx-storybook-new.css.br +0 -0
- package/dist/unifyedx-storybook-new.css.gz +0 -0
- package/dist/unifyedx-storybook-new.es.js +870 -884
- package/dist/unifyedx-storybook-new.es.js.br +0 -0
- package/dist/unifyedx-storybook-new.es.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e, Fragment as re } from "react/jsx-runtime";
|
|
2
2
|
import ne, { useState as B, useMemo as ae, useId as Ze, Fragment as ee, useEffect as te, useCallback as K, useRef as ge } from "react";
|
|
3
|
-
import { a as Z, U as ct, X as Ne, P as c, L as Ra, C as ve, b as tt, D as dt, f as Ct, d as Wt, F as Ia, e as Oa, h as Ma, T as Be, u as Pa, I as Jt, i as Xt, j as La, k as Ba, l as Va, m as Qt, S as yt, n as Ht, M as ja, o as _a, p as xt, q as
|
|
4
|
-
import { Popover as $r, PopoverButton as
|
|
3
|
+
import { a as Z, U as ct, X as Ne, P as c, L as Ra, C as ve, b as tt, D as dt, f as Ct, d as Wt, F as Ia, e as Oa, h as Ma, T as Be, u as Pa, I as Jt, i as Xt, j as La, k as Ba, l as Va, m as Qt, S as yt, n as Ht, M as ja, o as _a, p as xt, q as Ga, A as Ua, E as Zt, r as qa, s as Ya, t as Wa, v as Ja, w as Kt, x as Xa, y as Qa, z as Ha, B as Za, G as Ka, H as er, J as Ve, K as zt, N as St, O as tr, Q as ea, R as ar, V as vt, W as rr, Y as nr, Z as je, _ as sr, $ as lr, a0 as ir, a1 as or, a2 as cr, a3 as dr, a4 as Dt, a5 as mr, a6 as ur, a7 as hr, a8 as pr, a9 as gr, aa as br, ab as fr, ac as yr, ad as Te, ae as ta, af as xr, ag as vr, ah as Nr, ai as wr, aj as kr, ak as aa, al as Cr, am as zr, an as ra, ao as Sr, ap as mt, aq as na, ar as Dr } from "./vendor-CU8ed0Ft.js";
|
|
4
|
+
import { Popover as $r, PopoverButton as Ar, PopoverPanel as Tr, Transition as fe, Dialog as xe, TransitionChild as ke, DialogPanel as Fe, DialogTitle as at, TabGroup as Fr, TabList as Er, Tab as le, TabPanels as Rr, RadioGroup as qe, Listbox as oe, ListboxButton as Ir, ListboxOptions as Or, ListboxOption as Mr, SwitchGroup as Pr, Switch as it, Menu as Lr, MenuButton as Br, Portal as Vr, MenuItems as jr, MenuItem as _r, DialogBackdrop as Gr } from "@headlessui/react";
|
|
5
5
|
import { motion as ce, AnimatePresence as De } from "framer-motion";
|
|
6
|
-
import { d as
|
|
6
|
+
import { d as Ur } from "./vendor-lodash-BV9sr8Va.js";
|
|
7
7
|
import { useFloating as qr, offset as Yr, flip as Wr, shift as Jr, autoUpdate as Xr } from "@floating-ui/react";
|
|
8
8
|
import ot, { debounce as Qr } from "lodash";
|
|
9
9
|
import { ToastContainer as Hr, Slide as Zr, toast as Me } from "react-toastify";
|
|
@@ -15,8 +15,8 @@ const gn = (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
|
}, bn = (t) => {
|
|
18
|
-
const a = (t ?? "").trim().toLowerCase(), s = parseInt((a.match(/\d+$/) ?? [0])[0], 10) || 0, i = gn(a), l = (i % 360 + 37 * s) % 360, u = 55 + (i >>> 8) % 20, o = 30 + (i >>> 16) % 10, h = 86 + (i >>> 24) % 8,
|
|
19
|
-
return { bg:
|
|
18
|
+
const a = (t ?? "").trim().toLowerCase(), s = parseInt((a.match(/\d+$/) ?? [0])[0], 10) || 0, i = gn(a), l = (i % 360 + 37 * s) % 360, u = 55 + (i >>> 8) % 20, o = 30 + (i >>> 16) % 10, h = 86 + (i >>> 24) % 8, f = `hsl(${l}, ${u}%, ${h}%)`, v = `hsl(${l}, ${u}%, ${o}%)`;
|
|
19
|
+
return { bg: f, text: v };
|
|
20
20
|
}, fn = (t = "") => t.split(" ").map((a) => a[0]).slice(0, 2).join("").toUpperCase(), we = ({
|
|
21
21
|
src: t,
|
|
22
22
|
name: a,
|
|
@@ -29,13 +29,13 @@ const gn = (t) => {
|
|
|
29
29
|
className: u,
|
|
30
30
|
...o
|
|
31
31
|
}) => {
|
|
32
|
-
const [h,
|
|
32
|
+
const [h, f] = B(!1), v = ae(() => bn(a), []), g = t && !h, r = !g && a, x = !g && !a, d = Z(
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
u
|
|
36
|
-
),
|
|
36
|
+
), b = g ? "transparent" : i || v.bg, C = l || v.text;
|
|
37
37
|
return /* @__PURE__ */ n("div", { className: d, style: {
|
|
38
|
-
backgroundColor:
|
|
38
|
+
backgroundColor: b,
|
|
39
39
|
color: C
|
|
40
40
|
}, ...o, children: [
|
|
41
41
|
g && /* @__PURE__ */ e(
|
|
@@ -44,7 +44,7 @@ const gn = (t) => {
|
|
|
44
44
|
src: t,
|
|
45
45
|
alt: a || "User avatar",
|
|
46
46
|
className: "avatar-image",
|
|
47
|
-
onError: () =>
|
|
47
|
+
onError: () => f(!0)
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
50
|
r && /* @__PURE__ */ e("span", { className: "avatar-initials", "aria-label": a, children: fn(a) }),
|
|
@@ -72,7 +72,7 @@ const gn = (t) => {
|
|
|
72
72
|
bgColor: u,
|
|
73
73
|
textColor: o,
|
|
74
74
|
className: h,
|
|
75
|
-
...
|
|
75
|
+
...f
|
|
76
76
|
}) => {
|
|
77
77
|
const v = Z(
|
|
78
78
|
"badge",
|
|
@@ -85,7 +85,7 @@ const gn = (t) => {
|
|
|
85
85
|
backgroundColor: u,
|
|
86
86
|
color: o,
|
|
87
87
|
borderColor: "#ff0000"
|
|
88
|
-
} : {}, ...
|
|
88
|
+
} : {}, ...f, children: [
|
|
89
89
|
i && /* @__PURE__ */ e(i, { className: "badge-icon" }),
|
|
90
90
|
/* @__PURE__ */ e("span", { className: "badge-label", children: t }),
|
|
91
91
|
l && /* @__PURE__ */ e(
|
|
@@ -113,6 +113,7 @@ const gn = (t) => {
|
|
|
113
113
|
type: "button",
|
|
114
114
|
className: ["storybook-button", `storybook-button--${s}`, u].join(" "),
|
|
115
115
|
style: a && { backgroundColor: a },
|
|
116
|
+
"aria-label": typeof i == "string" ? i : void 0,
|
|
116
117
|
...l,
|
|
117
118
|
children: i
|
|
118
119
|
}
|
|
@@ -148,19 +149,19 @@ const vn = {
|
|
|
148
149
|
category: o = "primary",
|
|
149
150
|
icon: h,
|
|
150
151
|
// Renamed for clarity, expecting a component type e.g., CheckCircle
|
|
151
|
-
disabled:
|
|
152
|
+
disabled: f = !1,
|
|
152
153
|
size: v = "medium",
|
|
153
154
|
label: g,
|
|
154
155
|
children: r,
|
|
155
156
|
// ✅ Add children to the props list
|
|
156
157
|
iconWidth: x,
|
|
157
158
|
iconHeight: d,
|
|
158
|
-
iconColor:
|
|
159
|
+
iconColor: b,
|
|
159
160
|
strokeWidth: C,
|
|
160
|
-
onClick:
|
|
161
|
-
...
|
|
161
|
+
onClick: T,
|
|
162
|
+
...A
|
|
162
163
|
}) => {
|
|
163
|
-
const O =
|
|
164
|
+
const O = f || u, V = h && !g, _ = Z(
|
|
164
165
|
"btn-base",
|
|
165
166
|
vn[v],
|
|
166
167
|
Nn[o],
|
|
@@ -177,12 +178,12 @@ const vn = {
|
|
|
177
178
|
type: s,
|
|
178
179
|
className: _,
|
|
179
180
|
disabled: O,
|
|
180
|
-
onClick:
|
|
181
|
+
onClick: T,
|
|
181
182
|
title: a || V && i || (typeof g == "string" ? g : void 0),
|
|
182
183
|
"aria-label": i || V && a || (typeof g == "string" ? g : void 0),
|
|
183
|
-
...
|
|
184
|
+
...A,
|
|
184
185
|
children: u ? /* @__PURE__ */ e(Ra, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(re, { children: [
|
|
185
|
-
h && /* @__PURE__ */ e(h, { size: v === "large" ? 20 : 16, width: x || 16, height: d || 16, color:
|
|
186
|
+
h && /* @__PURE__ */ e(h, { size: v === "large" ? 20 : 16, width: x || 16, height: d || 16, color: b || "#767676", strokeWidth: C || 2 }),
|
|
186
187
|
g,
|
|
187
188
|
r,
|
|
188
189
|
" "
|
|
@@ -222,7 +223,7 @@ const vn = {
|
|
|
222
223
|
onChange: o,
|
|
223
224
|
...h
|
|
224
225
|
}) => {
|
|
225
|
-
const
|
|
226
|
+
const f = Ze(), v = a || f;
|
|
226
227
|
return /* @__PURE__ */ n("div", { className: `checkbox-container ${i || ""}`, children: [
|
|
227
228
|
/* @__PURE__ */ n("label", { htmlFor: v, className: "checkbox-wrapper", children: [
|
|
228
229
|
/* @__PURE__ */ e(
|
|
@@ -252,7 +253,7 @@ const vn = {
|
|
|
252
253
|
] }),
|
|
253
254
|
s && /* @__PURE__ */ e("p", { className: "checkbox-error-message", children: s })
|
|
254
255
|
] });
|
|
255
|
-
}, kn = ({ children: t }) => /* @__PURE__ */ e($r, { className: "popover-container", children: t }), Cn = ({ children: t }) => /* @__PURE__ */ e(
|
|
256
|
+
}, kn = ({ children: t }) => /* @__PURE__ */ e($r, { className: "popover-container", children: t }), Cn = ({ children: t }) => /* @__PURE__ */ e(Ar, { as: "div", children: t }), zn = ({ children: t, className: a }) => /* @__PURE__ */ e(Tr, { className: `popover-panel ${a || ""}`, children: t }), sa = dt, la = ({
|
|
256
257
|
value: t,
|
|
257
258
|
onChange: a,
|
|
258
259
|
onClear: s,
|
|
@@ -261,7 +262,7 @@ const vn = {
|
|
|
261
262
|
error: u,
|
|
262
263
|
disabled: o = !1,
|
|
263
264
|
className: h,
|
|
264
|
-
...
|
|
265
|
+
...f
|
|
265
266
|
}) => /* @__PURE__ */ n("div", { className: Z("datepicker-wrapper", h), children: [
|
|
266
267
|
l && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: l }),
|
|
267
268
|
/* @__PURE__ */ e(
|
|
@@ -289,7 +290,7 @@ const vn = {
|
|
|
289
290
|
error: u,
|
|
290
291
|
disabled: o = !1,
|
|
291
292
|
className: h,
|
|
292
|
-
...
|
|
293
|
+
...f
|
|
293
294
|
}) => {
|
|
294
295
|
const v = t?.from, g = t?.to, r = (d) => {
|
|
295
296
|
d.stopPropagation(), d.preventDefault(), s?.();
|
|
@@ -559,10 +560,10 @@ const vn = {
|
|
|
559
560
|
DRIVE: "drive",
|
|
560
561
|
INTEREST: "interest",
|
|
561
562
|
ARTICLE: "article"
|
|
562
|
-
},
|
|
563
|
+
}, At = {
|
|
563
564
|
View: "view",
|
|
564
565
|
Manage: "edit"
|
|
565
|
-
},
|
|
566
|
+
}, Tt = ({ extension: t, size: a = 36 }) => {
|
|
566
567
|
const s = (t || "").toLowerCase(), i = Dn[s];
|
|
567
568
|
return i ? /* @__PURE__ */ e("div", { style: { width: a }, className: "flex-shrink-0", children: /* @__PURE__ */ e(
|
|
568
569
|
Ia,
|
|
@@ -600,14 +601,14 @@ const vn = {
|
|
|
600
601
|
// --- Form and File State ---
|
|
601
602
|
validFiles: o = [],
|
|
602
603
|
rejectedFiles: h = [],
|
|
603
|
-
handleRemoveValidFile:
|
|
604
|
+
handleRemoveValidFile: f,
|
|
604
605
|
handleRemoveRejectedFile: v,
|
|
605
606
|
handleSubmit: g,
|
|
606
607
|
isSubmitting: r,
|
|
607
608
|
formErrors: x,
|
|
608
609
|
// --- UI Text ---
|
|
609
610
|
title: d = "Upload Files",
|
|
610
|
-
subHeading:
|
|
611
|
+
subHeading: b = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
611
612
|
}) => {
|
|
612
613
|
const C = o.length > 0 || h.length > 0;
|
|
613
614
|
return /* @__PURE__ */ e(fe, { appear: !0, show: t, as: ee, children: /* @__PURE__ */ n(
|
|
@@ -645,7 +646,7 @@ const vn = {
|
|
|
645
646
|
Fe,
|
|
646
647
|
{
|
|
647
648
|
className: "dialog-panel",
|
|
648
|
-
onClick: (
|
|
649
|
+
onClick: (T) => T.stopPropagation(),
|
|
649
650
|
children: [
|
|
650
651
|
/* @__PURE__ */ e("input", { ...i() }),
|
|
651
652
|
/* @__PURE__ */ n("form", { onSubmit: g, className: "form-wrapper", children: [
|
|
@@ -669,7 +670,7 @@ const vn = {
|
|
|
669
670
|
children: [
|
|
670
671
|
/* @__PURE__ */ e(Ma, { size: 48, className: "text-gray-400" }),
|
|
671
672
|
/* @__PURE__ */ e("p", { children: "Drag and drop files here" }),
|
|
672
|
-
/* @__PURE__ */ e("p", { className: "sub-heading", children:
|
|
673
|
+
/* @__PURE__ */ e("p", { className: "sub-heading", children: b }),
|
|
673
674
|
/* @__PURE__ */ e("hr", {}),
|
|
674
675
|
/* @__PURE__ */ e("p", { children: "OR" }),
|
|
675
676
|
/* @__PURE__ */ e(
|
|
@@ -688,52 +689,52 @@ const vn = {
|
|
|
688
689
|
C && /* @__PURE__ */ n("div", { className: "file-list-container", children: [
|
|
689
690
|
/* @__PURE__ */ e("h3", { children: "Upload Queue" }),
|
|
690
691
|
/* @__PURE__ */ n("ul", { className: "file-list", children: [
|
|
691
|
-
o.map((
|
|
692
|
+
o.map((T, A) => /* @__PURE__ */ n(
|
|
692
693
|
"li",
|
|
693
694
|
{
|
|
694
695
|
className: "file-item",
|
|
695
696
|
children: [
|
|
696
697
|
/* @__PURE__ */ n("div", { className: "file-item-details", children: [
|
|
697
698
|
/* @__PURE__ */ e(
|
|
698
|
-
|
|
699
|
+
Tt,
|
|
699
700
|
{
|
|
700
|
-
extension:
|
|
701
|
+
extension: T.name.split(".").pop()
|
|
701
702
|
}
|
|
702
703
|
),
|
|
703
704
|
/* @__PURE__ */ n("div", { children: [
|
|
704
|
-
/* @__PURE__ */ e("p", { className: "file-item-name", children:
|
|
705
|
-
/* @__PURE__ */ e("p", { className: "file-item-size", children: Ft(
|
|
705
|
+
/* @__PURE__ */ e("p", { className: "file-item-name", children: T.name }),
|
|
706
|
+
/* @__PURE__ */ e("p", { className: "file-item-size", children: Ft(T.size) })
|
|
706
707
|
] })
|
|
707
708
|
] }),
|
|
708
709
|
/* @__PURE__ */ e(
|
|
709
710
|
"button",
|
|
710
711
|
{
|
|
711
712
|
type: "button",
|
|
712
|
-
onClick: () =>
|
|
713
|
+
onClick: () => f(A),
|
|
713
714
|
className: "remove-file-button",
|
|
714
715
|
children: /* @__PURE__ */ e(Be, { size: 16 })
|
|
715
716
|
}
|
|
716
717
|
)
|
|
717
718
|
]
|
|
718
719
|
},
|
|
719
|
-
`${
|
|
720
|
+
`${T.name}-${A}`
|
|
720
721
|
)),
|
|
721
|
-
h.map(({ file:
|
|
722
|
+
h.map(({ file: T, message: A }, O) => /* @__PURE__ */ n(
|
|
722
723
|
"li",
|
|
723
724
|
{
|
|
724
725
|
className: "file-item file-item--rejected",
|
|
725
726
|
children: [
|
|
726
727
|
/* @__PURE__ */ n("div", { className: "file-item-details", children: [
|
|
727
728
|
/* @__PURE__ */ e(
|
|
728
|
-
|
|
729
|
+
Tt,
|
|
729
730
|
{
|
|
730
|
-
extension:
|
|
731
|
+
extension: T.name.split(".").pop()
|
|
731
732
|
}
|
|
732
733
|
),
|
|
733
734
|
/* @__PURE__ */ n("div", { children: [
|
|
734
|
-
/* @__PURE__ */ e("p", { className: "file-item-name", children:
|
|
735
|
-
/* @__PURE__ */ e("p", { className: "file-item-size", children: Ft(
|
|
736
|
-
/* @__PURE__ */ e("p", { className: "rejection-reason", children:
|
|
735
|
+
/* @__PURE__ */ e("p", { className: "file-item-name", children: T.name }),
|
|
736
|
+
/* @__PURE__ */ e("p", { className: "file-item-size", children: Ft(T.size) }),
|
|
737
|
+
/* @__PURE__ */ e("p", { className: "rejection-reason", children: A })
|
|
737
738
|
] })
|
|
738
739
|
] }),
|
|
739
740
|
/* @__PURE__ */ e(
|
|
@@ -747,7 +748,7 @@ const vn = {
|
|
|
747
748
|
)
|
|
748
749
|
]
|
|
749
750
|
},
|
|
750
|
-
`${
|
|
751
|
+
`${T.name}-${O}`
|
|
751
752
|
))
|
|
752
753
|
] })
|
|
753
754
|
] })
|
|
@@ -784,7 +785,7 @@ const vn = {
|
|
|
784
785
|
}, _e = (t) => {
|
|
785
786
|
const a = new Date(t);
|
|
786
787
|
return a.setHours(0, 0, 0, 0), a;
|
|
787
|
-
},
|
|
788
|
+
}, Ge = (t) => {
|
|
788
789
|
const a = new Date(t);
|
|
789
790
|
return a.setHours(23, 59, 59, 999), a;
|
|
790
791
|
}, ht = (t, a) => {
|
|
@@ -793,24 +794,24 @@ const vn = {
|
|
|
793
794
|
}, pt = (t) => {
|
|
794
795
|
const a = new Date(t), s = a.getDay(), i = a.getDate() - s;
|
|
795
796
|
return _e(new Date(a.setDate(i)));
|
|
796
|
-
},
|
|
797
|
+
}, An = (t) => Ge(ht(pt(t), 6)), Et = (t) => {
|
|
797
798
|
const a = new Date(t);
|
|
798
799
|
return _e(new Date(a.getFullYear(), a.getMonth(), 1));
|
|
799
800
|
}, Rt = (t) => {
|
|
800
801
|
const a = new Date(t);
|
|
801
|
-
return
|
|
802
|
-
},
|
|
802
|
+
return Ge(new Date(a.getFullYear(), a.getMonth() + 1, 0));
|
|
803
|
+
}, Tn = (t) => {
|
|
803
804
|
const a = /* @__PURE__ */ new Date();
|
|
804
805
|
switch (t) {
|
|
805
806
|
case "anytime":
|
|
806
807
|
return [null, null];
|
|
807
808
|
case "today":
|
|
808
|
-
return [_e(a),
|
|
809
|
+
return [_e(a), Ge(a)];
|
|
809
810
|
case "this_week":
|
|
810
|
-
return [pt(a),
|
|
811
|
+
return [pt(a), An(a)];
|
|
811
812
|
case "last_week": {
|
|
812
813
|
const s = ht(pt(a), -7);
|
|
813
|
-
return [_e(s),
|
|
814
|
+
return [_e(s), Ge(ht(s, 6))];
|
|
814
815
|
}
|
|
815
816
|
case "this_month":
|
|
816
817
|
return [Et(a), Rt(a)];
|
|
@@ -832,7 +833,7 @@ const vn = {
|
|
|
832
833
|
fetchCreatedOrUpdatedByUsers: h = async () => []
|
|
833
834
|
// Mockable fetcher
|
|
834
835
|
}) => {
|
|
835
|
-
const [
|
|
836
|
+
const [f, v] = B({
|
|
836
837
|
createdBy: [],
|
|
837
838
|
updatedBy: []
|
|
838
839
|
}), [g, r] = B({
|
|
@@ -840,30 +841,30 @@ const vn = {
|
|
|
840
841
|
updatedBy: !1
|
|
841
842
|
}), [x, d] = B({
|
|
842
843
|
startDate: null
|
|
843
|
-
}), [
|
|
844
|
+
}), [b, C] = B({
|
|
844
845
|
endDate: null
|
|
845
|
-
}),
|
|
846
|
+
}), T = Pa({
|
|
846
847
|
initialValues: JSON.parse(JSON.stringify(u)),
|
|
847
848
|
// Deep copy
|
|
848
849
|
onSubmit: (E) => {
|
|
849
|
-
const
|
|
850
|
+
const U = {};
|
|
850
851
|
Object.keys(E).forEach((F) => {
|
|
851
|
-
|
|
852
|
+
U[F] = {
|
|
852
853
|
operator: E[F].operator || "in",
|
|
853
854
|
values: Array.isArray(E[F].values) ? E[F].values : [],
|
|
854
855
|
range: E[F].range || null
|
|
855
856
|
};
|
|
856
|
-
}), console.log("[storybook filter] Applied Filters:",
|
|
857
|
-
filters:
|
|
857
|
+
}), console.log("[storybook filter] Applied Filters:", U), typeof s == "function" && s({
|
|
858
|
+
filters: U,
|
|
858
859
|
activeCount: O
|
|
859
860
|
}), a();
|
|
860
861
|
},
|
|
861
862
|
enableReinitialize: !0
|
|
862
|
-
}),
|
|
863
|
-
const F =
|
|
863
|
+
}), A = ae(() => l.reduce((E, U) => {
|
|
864
|
+
const F = U.key, m = T.values[F];
|
|
864
865
|
let k = !1;
|
|
865
866
|
if (m)
|
|
866
|
-
switch (
|
|
867
|
+
switch (U.type) {
|
|
867
868
|
case "multiselect":
|
|
868
869
|
case "multiselect-users":
|
|
869
870
|
k = Array.isArray(m.values) && m.values.length > 0;
|
|
@@ -873,34 +874,34 @@ const vn = {
|
|
|
873
874
|
break;
|
|
874
875
|
}
|
|
875
876
|
return E[F] = k, E;
|
|
876
|
-
}, {}), [l,
|
|
877
|
+
}, {}), [l, T.values]), O = Object.values(A).filter(Boolean).length, V = ae(() => l.some((E) => {
|
|
877
878
|
if (E.type !== "date") return !1;
|
|
878
|
-
const
|
|
879
|
-
if (!Array.isArray(
|
|
880
|
-
const [F, m] =
|
|
879
|
+
const U = T.values?.[E.key]?.values;
|
|
880
|
+
if (!Array.isArray(U) || U.length < 2) return !1;
|
|
881
|
+
const [F, m] = U;
|
|
881
882
|
if (!F || !m) return !1;
|
|
882
883
|
const k = F instanceof Date ? F : new Date(F), L = m instanceof Date ? m : new Date(m);
|
|
883
884
|
return k > L;
|
|
884
|
-
}), [l,
|
|
885
|
+
}), [l, T.values]), _ = async (E, U) => {
|
|
885
886
|
try {
|
|
886
887
|
r((m) => ({ ...m, [E]: !0 }));
|
|
887
|
-
const F = await h(E,
|
|
888
|
+
const F = await h(E, U);
|
|
888
889
|
v((m) => ({ ...m, [E]: F }));
|
|
889
890
|
} catch (F) {
|
|
890
891
|
console.error(`Error fetching ${E} users:`, F);
|
|
891
892
|
} finally {
|
|
892
893
|
r((F) => ({ ...F, [E]: !1 }));
|
|
893
894
|
}
|
|
894
|
-
},
|
|
895
|
-
const
|
|
896
|
-
l[E].type === "multiselect-users" &&
|
|
895
|
+
}, G = (E) => {
|
|
896
|
+
const U = l[E].key, F = l[E].url;
|
|
897
|
+
l[E].type === "multiselect-users" && f[U].length === 0 && !g[U] && _(U, F);
|
|
897
898
|
}, W = () => {
|
|
898
|
-
|
|
899
|
+
T.resetForm(), v({ createdBy: [], updatedBy: [] }), i();
|
|
899
900
|
}, J = (E) => {
|
|
900
|
-
const
|
|
901
|
-
if (!
|
|
902
|
-
const F =
|
|
903
|
-
switch (
|
|
901
|
+
const U = l.find((k) => k.key === E);
|
|
902
|
+
if (!U) return null;
|
|
903
|
+
const F = T.values[E] || u[E], m = Array.isArray(F.values) ? F.values : [];
|
|
904
|
+
switch (U.type) {
|
|
904
905
|
case "multiselect":
|
|
905
906
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
906
907
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
@@ -909,9 +910,9 @@ const vn = {
|
|
|
909
910
|
"select",
|
|
910
911
|
{
|
|
911
912
|
value: F.operator || "in",
|
|
912
|
-
onChange: (
|
|
913
|
+
onChange: (D) => T.setFieldValue(`${E}.operator`, D.target.value),
|
|
913
914
|
className: "filter-select",
|
|
914
|
-
children:
|
|
915
|
+
children: U.operators.map((D) => /* @__PURE__ */ e("option", { value: D, children: D === "in" ? "Includes" : "Excludes" }, D))
|
|
915
916
|
}
|
|
916
917
|
)
|
|
917
918
|
] }),
|
|
@@ -923,10 +924,10 @@ const vn = {
|
|
|
923
924
|
type: "checkbox",
|
|
924
925
|
id: `select-all-${E}`,
|
|
925
926
|
className: "filter-checkbox-input",
|
|
926
|
-
checked:
|
|
927
|
-
onChange: (
|
|
928
|
-
const M =
|
|
929
|
-
|
|
927
|
+
checked: U.options.length > 0 && m.length === U.options.length,
|
|
928
|
+
onChange: (D) => {
|
|
929
|
+
const M = D.target.checked ? U.options.map((q) => q.value) : [];
|
|
930
|
+
T.setFieldValue(`${E}.values`, M);
|
|
930
931
|
}
|
|
931
932
|
}
|
|
932
933
|
),
|
|
@@ -939,33 +940,33 @@ const vn = {
|
|
|
939
940
|
}
|
|
940
941
|
)
|
|
941
942
|
] }),
|
|
942
|
-
|
|
943
|
+
U.options.map((D) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
|
|
943
944
|
/* @__PURE__ */ e(
|
|
944
945
|
"input",
|
|
945
946
|
{
|
|
946
947
|
type: "checkbox",
|
|
947
|
-
id: `${E}-${
|
|
948
|
+
id: `${E}-${D.value}`,
|
|
948
949
|
className: "filter-checkbox-input",
|
|
949
|
-
checked: m.includes(
|
|
950
|
+
checked: m.includes(D.value),
|
|
950
951
|
onChange: (M) => {
|
|
951
|
-
const q = M.target.checked ? [...m,
|
|
952
|
-
|
|
952
|
+
const q = M.target.checked ? [...m, D.value] : m.filter((X) => X !== D.value);
|
|
953
|
+
T.setFieldValue(`${E}.values`, q);
|
|
953
954
|
}
|
|
954
955
|
}
|
|
955
956
|
),
|
|
956
957
|
/* @__PURE__ */ e(
|
|
957
958
|
"label",
|
|
958
959
|
{
|
|
959
|
-
htmlFor: `${E}-${
|
|
960
|
+
htmlFor: `${E}-${D.value}`,
|
|
960
961
|
className: "filter-checkbox-label",
|
|
961
|
-
children:
|
|
962
|
+
children: D.label
|
|
962
963
|
}
|
|
963
964
|
)
|
|
964
|
-
] },
|
|
965
|
+
] }, D.value))
|
|
965
966
|
] })
|
|
966
967
|
] });
|
|
967
968
|
case "multiselect-users":
|
|
968
|
-
const k =
|
|
969
|
+
const k = f[E] || [], L = g[E];
|
|
969
970
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
970
971
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
971
972
|
/* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
|
|
@@ -973,9 +974,9 @@ const vn = {
|
|
|
973
974
|
"select",
|
|
974
975
|
{
|
|
975
976
|
value: F.operator || "in",
|
|
976
|
-
onChange: (
|
|
977
|
+
onChange: (D) => T.setFieldValue(`${E}.operator`, D.target.value),
|
|
977
978
|
className: "filter-select",
|
|
978
|
-
children:
|
|
979
|
+
children: U.operators.map((D) => /* @__PURE__ */ e("option", { value: D, children: D === "in" ? "Includes" : "Excludes" }, D))
|
|
979
980
|
}
|
|
980
981
|
)
|
|
981
982
|
] }),
|
|
@@ -988,9 +989,9 @@ const vn = {
|
|
|
988
989
|
id: `select-all-users-${E}`,
|
|
989
990
|
className: "filter-checkbox-input",
|
|
990
991
|
checked: k.length > 0 && m.length === k.length,
|
|
991
|
-
onChange: (
|
|
992
|
-
const M =
|
|
993
|
-
|
|
992
|
+
onChange: (D) => {
|
|
993
|
+
const M = D.target.checked ? k.map((q) => q.email) : [];
|
|
994
|
+
T.setFieldValue(
|
|
994
995
|
`${E}.values`,
|
|
995
996
|
M
|
|
996
997
|
);
|
|
@@ -1006,17 +1007,17 @@ const vn = {
|
|
|
1006
1007
|
}
|
|
1007
1008
|
)
|
|
1008
1009
|
] }),
|
|
1009
|
-
k.map((
|
|
1010
|
+
k.map((D) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item createdby", children: [
|
|
1010
1011
|
/* @__PURE__ */ e(
|
|
1011
1012
|
"input",
|
|
1012
1013
|
{
|
|
1013
1014
|
type: "checkbox",
|
|
1014
|
-
id: `${E}-${
|
|
1015
|
+
id: `${E}-${D.email}`,
|
|
1015
1016
|
className: "filter-checkbox-input",
|
|
1016
|
-
checked: m.includes(
|
|
1017
|
+
checked: m.includes(D.email),
|
|
1017
1018
|
onChange: (M) => {
|
|
1018
|
-
const q = M.target.checked ? [...m,
|
|
1019
|
-
|
|
1019
|
+
const q = M.target.checked ? [...m, D.email] : m.filter((X) => X !== D.email);
|
|
1020
|
+
T.setFieldValue(
|
|
1020
1021
|
`${E}.values`,
|
|
1021
1022
|
q
|
|
1022
1023
|
);
|
|
@@ -1026,19 +1027,19 @@ const vn = {
|
|
|
1026
1027
|
/* @__PURE__ */ n(
|
|
1027
1028
|
"label",
|
|
1028
1029
|
{
|
|
1029
|
-
htmlFor: `${E}-${
|
|
1030
|
+
htmlFor: `${E}-${D.email}`,
|
|
1030
1031
|
className: "filter-checkbox-label",
|
|
1031
1032
|
children: [
|
|
1032
|
-
/* @__PURE__ */ e("span", { className: "user-label-name", children:
|
|
1033
|
-
/* @__PURE__ */ e("span", { className: "user-label-email", children:
|
|
1033
|
+
/* @__PURE__ */ e("span", { className: "user-label-name", children: D.name }),
|
|
1034
|
+
/* @__PURE__ */ e("span", { className: "user-label-email", children: D.email })
|
|
1034
1035
|
]
|
|
1035
1036
|
}
|
|
1036
1037
|
)
|
|
1037
|
-
] },
|
|
1038
|
+
] }, D.email))
|
|
1038
1039
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1039
1040
|
] });
|
|
1040
1041
|
case "date":
|
|
1041
|
-
const P = F.values || [], [
|
|
1042
|
+
const P = F.values || [], [$, p] = P, z = $ && p, I = P[0] || null, w = P[1] || null, S = {
|
|
1042
1043
|
startDate: I instanceof Date ? I.toISOString().slice(0, 10) : null,
|
|
1043
1044
|
endDate: I instanceof Date ? I.toISOString().slice(0, 10) : null
|
|
1044
1045
|
}, y = {
|
|
@@ -1052,17 +1053,17 @@ const vn = {
|
|
|
1052
1053
|
{ key: "this_month", label: "This Month" },
|
|
1053
1054
|
{ key: "last_month", label: "Last Month" },
|
|
1054
1055
|
{ key: "custom", label: "Custom" }
|
|
1055
|
-
], R = (
|
|
1056
|
-
if (
|
|
1057
|
-
|
|
1056
|
+
], R = (D) => {
|
|
1057
|
+
if (D === "anytime") {
|
|
1058
|
+
T.setFieldValue(`${E}.values`, []), T.setFieldValue(`${E}.range`, "anytime");
|
|
1058
1059
|
return;
|
|
1059
1060
|
}
|
|
1060
|
-
if (
|
|
1061
|
-
|
|
1061
|
+
if (D === "custom") {
|
|
1062
|
+
T.setFieldValue(`${E}.range`, "custom");
|
|
1062
1063
|
return;
|
|
1063
1064
|
}
|
|
1064
|
-
const [M, q] =
|
|
1065
|
-
|
|
1065
|
+
const [M, q] = Tn(D);
|
|
1066
|
+
T.setFieldValue(`${E}.values`, M && q ? [M, q] : []), T.setFieldValue(`${E}.range`, D);
|
|
1066
1067
|
};
|
|
1067
1068
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
1068
1069
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
@@ -1071,17 +1072,17 @@ const vn = {
|
|
|
1071
1072
|
"select",
|
|
1072
1073
|
{
|
|
1073
1074
|
value: F.operator,
|
|
1074
|
-
onChange: (
|
|
1075
|
+
onChange: (D) => T.setFieldValue(`${E}.operator`, D.target.value),
|
|
1075
1076
|
className: "filter-select",
|
|
1076
|
-
children:
|
|
1077
|
+
children: U.operators.map((D) => /* @__PURE__ */ e("option", { value: D, children: D === "in" ? "Is" : "Is not" }, D))
|
|
1077
1078
|
}
|
|
1078
1079
|
),
|
|
1079
|
-
|
|
1080
|
+
z && /* @__PURE__ */ e(
|
|
1080
1081
|
"button",
|
|
1081
1082
|
{
|
|
1082
1083
|
type: "button",
|
|
1083
1084
|
onClick: () => {
|
|
1084
|
-
|
|
1085
|
+
T.setFieldValue(
|
|
1085
1086
|
E,
|
|
1086
1087
|
u[E]
|
|
1087
1088
|
);
|
|
@@ -1091,8 +1092,8 @@ const vn = {
|
|
|
1091
1092
|
}
|
|
1092
1093
|
)
|
|
1093
1094
|
] }),
|
|
1094
|
-
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: N.map((
|
|
1095
|
-
const M = F.range ===
|
|
1095
|
+
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: N.map((D) => {
|
|
1096
|
+
const M = F.range === D.key || D.key === "anytime" && (!Array.isArray(F.values) || F.values.length === 0);
|
|
1096
1097
|
return /* @__PURE__ */ n(
|
|
1097
1098
|
"label",
|
|
1098
1099
|
{
|
|
@@ -1104,15 +1105,15 @@ const vn = {
|
|
|
1104
1105
|
type: "radio",
|
|
1105
1106
|
name: `preset-${E}`,
|
|
1106
1107
|
checked: M,
|
|
1107
|
-
onChange: () => R(
|
|
1108
|
+
onChange: () => R(D.key),
|
|
1108
1109
|
className: "h-4 w-4"
|
|
1109
1110
|
}
|
|
1110
1111
|
),
|
|
1111
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-[#222]", children:
|
|
1112
|
-
|
|
1112
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-[#222]", children: D.label }),
|
|
1113
|
+
D.key === "anytime" && M && /* @__PURE__ */ e("span", { className: "ml-2 text-xs bg-yellow-100 text-yellow-800 px-2 py-0.5 rounded", children: "Default" })
|
|
1113
1114
|
]
|
|
1114
1115
|
},
|
|
1115
|
-
|
|
1116
|
+
D.key
|
|
1116
1117
|
);
|
|
1117
1118
|
}) }) }),
|
|
1118
1119
|
/* @__PURE__ */ n("div", { className: "", children: [
|
|
@@ -1124,10 +1125,10 @@ const vn = {
|
|
|
1124
1125
|
{
|
|
1125
1126
|
asSingle: !0,
|
|
1126
1127
|
useRange: !1,
|
|
1127
|
-
value:
|
|
1128
|
-
onChange: (
|
|
1129
|
-
const M =
|
|
1130
|
-
M && (
|
|
1128
|
+
value: S,
|
|
1129
|
+
onChange: (D) => {
|
|
1130
|
+
const M = D?.startDate ? _e(new Date(D.startDate)) : null, q = P[1] || null;
|
|
1131
|
+
M && (T.setFieldValue(`${E}.values`, [M, q]), T.setFieldValue(`${E}.range`, "custom"));
|
|
1131
1132
|
},
|
|
1132
1133
|
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",
|
|
1133
1134
|
primaryColor: "violet",
|
|
@@ -1149,9 +1150,9 @@ const vn = {
|
|
|
1149
1150
|
asSingle: !0,
|
|
1150
1151
|
useRange: !1,
|
|
1151
1152
|
value: y,
|
|
1152
|
-
onChange: (
|
|
1153
|
-
const M =
|
|
1154
|
-
M && (
|
|
1153
|
+
onChange: (D) => {
|
|
1154
|
+
const M = D?.startDate ? Ge(new Date(D.startDate)) : null, q = P[0] || null;
|
|
1155
|
+
M && (T.setFieldValue(`${E}.values`, [q, M]), T.setFieldValue(`${E}.range`, "custom"));
|
|
1155
1156
|
},
|
|
1156
1157
|
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",
|
|
1157
1158
|
primaryColor: "violet",
|
|
@@ -1208,12 +1209,12 @@ const vn = {
|
|
|
1208
1209
|
}
|
|
1209
1210
|
)
|
|
1210
1211
|
] }),
|
|
1211
|
-
/* @__PURE__ */ n("form", { onSubmit:
|
|
1212
|
+
/* @__PURE__ */ n("form", { onSubmit: T.handleSubmit, className: "filter-form", children: [
|
|
1212
1213
|
/* @__PURE__ */ e("div", { className: "filter-content-wrapper", children: /* @__PURE__ */ n(
|
|
1213
1214
|
Fr,
|
|
1214
1215
|
{
|
|
1215
1216
|
vertical: !0,
|
|
1216
|
-
onChange:
|
|
1217
|
+
onChange: G,
|
|
1217
1218
|
style: {
|
|
1218
1219
|
display: "flex",
|
|
1219
1220
|
flexGrow: 1
|
|
@@ -1223,7 +1224,7 @@ const vn = {
|
|
|
1223
1224
|
/* @__PURE__ */ e("div", { className: "filter-selection-horizontal-indicator" }),
|
|
1224
1225
|
/* @__PURE__ */ n("div", { className: "filter-lbl-indicator-wrapper", children: [
|
|
1225
1226
|
E.label,
|
|
1226
|
-
|
|
1227
|
+
A[E.key] && /* @__PURE__ */ e(
|
|
1227
1228
|
"span",
|
|
1228
1229
|
{
|
|
1229
1230
|
className: "filter-active-indicator",
|
|
@@ -1267,7 +1268,7 @@ const vn = {
|
|
|
1267
1268
|
"button",
|
|
1268
1269
|
{
|
|
1269
1270
|
type: "submit",
|
|
1270
|
-
disabled: !
|
|
1271
|
+
disabled: !T.dirty || V,
|
|
1271
1272
|
className: "filter-button apply",
|
|
1272
1273
|
children: [
|
|
1273
1274
|
"Apply Filters",
|
|
@@ -1293,15 +1294,15 @@ const vn = {
|
|
|
1293
1294
|
// ✅ 'ref' is now received directly as a prop
|
|
1294
1295
|
...h
|
|
1295
1296
|
}) => {
|
|
1296
|
-
const
|
|
1297
|
+
const f = a || h.name;
|
|
1297
1298
|
return /* @__PURE__ */ n("div", { className: `input-wrapper ${u || ""}`, children: [
|
|
1298
|
-
t && /* @__PURE__ */ e("label", { htmlFor:
|
|
1299
|
+
t && /* @__PURE__ */ e("label", { htmlFor: f, className: "input-label", children: t }),
|
|
1299
1300
|
/* @__PURE__ */ n("div", { className: "input-field-container", children: [
|
|
1300
1301
|
i && /* @__PURE__ */ e(i, { className: "input-icon", size: 20 }),
|
|
1301
1302
|
/* @__PURE__ */ e(
|
|
1302
1303
|
"input",
|
|
1303
1304
|
{
|
|
1304
|
-
id:
|
|
1305
|
+
id: f,
|
|
1305
1306
|
type: s,
|
|
1306
1307
|
ref: o,
|
|
1307
1308
|
className: Z("input-field", {
|
|
@@ -1345,7 +1346,7 @@ const vn = {
|
|
|
1345
1346
|
variant: o = "info",
|
|
1346
1347
|
// 'info', 'warning', 'delete'
|
|
1347
1348
|
loading: h = !1,
|
|
1348
|
-
buttonProps:
|
|
1349
|
+
buttonProps: f = {},
|
|
1349
1350
|
size: v
|
|
1350
1351
|
// Add size prop
|
|
1351
1352
|
}) => {
|
|
@@ -1402,7 +1403,7 @@ const vn = {
|
|
|
1402
1403
|
type: "button",
|
|
1403
1404
|
onClick: x,
|
|
1404
1405
|
label: l,
|
|
1405
|
-
...
|
|
1406
|
+
...f
|
|
1406
1407
|
}
|
|
1407
1408
|
)
|
|
1408
1409
|
] })
|
|
@@ -1418,14 +1419,14 @@ const vn = {
|
|
|
1418
1419
|
onItemsPerPageChange: l,
|
|
1419
1420
|
itemsPerPageOptions: u = [10, 15, 20]
|
|
1420
1421
|
}) => {
|
|
1421
|
-
const o = Math.ceil(a / s), [h,
|
|
1422
|
+
const o = Math.ceil(a / s), [h, f] = B(t);
|
|
1422
1423
|
te(() => {
|
|
1423
|
-
|
|
1424
|
+
f(t);
|
|
1424
1425
|
}, [t]);
|
|
1425
1426
|
const v = Math.min((t - 1) * s + 1, a), g = Math.min(t * s, a), r = (x) => {
|
|
1426
1427
|
x.preventDefault();
|
|
1427
1428
|
let d = parseInt(h, 10);
|
|
1428
|
-
isNaN(d) || d < 1 ? d = 1 : d > o && (d = o),
|
|
1429
|
+
isNaN(d) || d < 1 ? d = 1 : d > o && (d = o), f(d), d !== t && i(d);
|
|
1429
1430
|
};
|
|
1430
1431
|
return /* @__PURE__ */ n("div", { className: "pagination-container", children: [
|
|
1431
1432
|
/* @__PURE__ */ n("div", { className: "pagination-left", children: [
|
|
@@ -1476,7 +1477,7 @@ const vn = {
|
|
|
1476
1477
|
type: "number",
|
|
1477
1478
|
className: "page-input",
|
|
1478
1479
|
value: h,
|
|
1479
|
-
onChange: (x) =>
|
|
1480
|
+
onChange: (x) => f(x.target.value),
|
|
1480
1481
|
onBlur: r,
|
|
1481
1482
|
"aria-label": `Current page, Page ${t}`
|
|
1482
1483
|
}
|
|
@@ -1527,9 +1528,9 @@ const vn = {
|
|
|
1527
1528
|
qe.Option,
|
|
1528
1529
|
{
|
|
1529
1530
|
value: o.value,
|
|
1530
|
-
className: ({ active: h, checked:
|
|
1531
|
+
className: ({ active: h, checked: f }) => Z("radiogroup-option", {
|
|
1531
1532
|
"radiogroup-option--active": h,
|
|
1532
|
-
"radiogroup-option--checked":
|
|
1533
|
+
"radiogroup-option--checked": f,
|
|
1533
1534
|
"radiogroup-option--error": !!l
|
|
1534
1535
|
}),
|
|
1535
1536
|
children: ({ checked: h }) => /* @__PURE__ */ n(re, { children: [
|
|
@@ -1562,7 +1563,7 @@ const vn = {
|
|
|
1562
1563
|
customClass: u = "",
|
|
1563
1564
|
inputStyle: o = {},
|
|
1564
1565
|
placeholderClass: h = "",
|
|
1565
|
-
searchIconSize:
|
|
1566
|
+
searchIconSize: f = 16,
|
|
1566
1567
|
searchIconClass: v = "",
|
|
1567
1568
|
...g
|
|
1568
1569
|
}) => {
|
|
@@ -1571,7 +1572,7 @@ const vn = {
|
|
|
1571
1572
|
x(t);
|
|
1572
1573
|
}, [t]);
|
|
1573
1574
|
const d = K(
|
|
1574
|
-
|
|
1575
|
+
Ur((C) => {
|
|
1575
1576
|
a?.(C);
|
|
1576
1577
|
}, s),
|
|
1577
1578
|
[s, a]
|
|
@@ -1579,12 +1580,12 @@ const vn = {
|
|
|
1579
1580
|
te(() => (r !== t && d(r), () => {
|
|
1580
1581
|
d.cancel();
|
|
1581
1582
|
}), [r, d, t]);
|
|
1582
|
-
const
|
|
1583
|
+
const b = (C) => {
|
|
1583
1584
|
x(C.target.value);
|
|
1584
1585
|
};
|
|
1585
1586
|
return /* @__PURE__ */ n("div", { className: `search-bar-wrapper ${u}`, children: [
|
|
1586
1587
|
l && /* @__PURE__ */ e("label", { htmlFor: "search-field", className: "sr-only", children: l }),
|
|
1587
|
-
/* @__PURE__ */ e("div", { className: "search-bar-icon-wrapper", children: /* @__PURE__ */ e(yt, { size:
|
|
1588
|
+
/* @__PURE__ */ e("div", { className: "search-bar-icon-wrapper", children: /* @__PURE__ */ e(yt, { size: f || 16, className: `search-bar-icon ${v}`, "aria-hidden": "true" }) }),
|
|
1588
1589
|
/* @__PURE__ */ e(
|
|
1589
1590
|
"input",
|
|
1590
1591
|
{
|
|
@@ -1594,7 +1595,7 @@ const vn = {
|
|
|
1594
1595
|
type: "search",
|
|
1595
1596
|
name: "search",
|
|
1596
1597
|
value: r,
|
|
1597
|
-
onChange:
|
|
1598
|
+
onChange: b,
|
|
1598
1599
|
style: o,
|
|
1599
1600
|
...g
|
|
1600
1601
|
}
|
|
@@ -1612,11 +1613,9 @@ const vn = {
|
|
|
1612
1613
|
error: o,
|
|
1613
1614
|
ref: h,
|
|
1614
1615
|
// From RHF's <Controller>
|
|
1615
|
-
showSearch:
|
|
1616
|
+
showSearch: f = !0
|
|
1616
1617
|
}) => {
|
|
1617
|
-
const [v, g] = B("")
|
|
1618
|
-
console.log("Select component - value:", a, "type:", typeof a), console.log("Select component - options:", i);
|
|
1619
|
-
const r = v === "" ? i : i.filter(
|
|
1618
|
+
const [v, g] = B(""), r = v === "" ? i : i.filter(
|
|
1620
1619
|
(d) => d.label.toLowerCase().includes(v.toLowerCase())
|
|
1621
1620
|
), x = i.find((d) => {
|
|
1622
1621
|
if (typeof a == "object" && a !== null) {
|
|
@@ -1649,7 +1648,7 @@ const vn = {
|
|
|
1649
1648
|
leaveFrom: "opacity-100",
|
|
1650
1649
|
leaveTo: "opacity-0",
|
|
1651
1650
|
children: /* @__PURE__ */ n(Or, { className: "select-options", children: [
|
|
1652
|
-
|
|
1651
|
+
f && /* @__PURE__ */ e("div", { className: "search-input-wrapper", children: /* @__PURE__ */ e(
|
|
1653
1652
|
ye,
|
|
1654
1653
|
{
|
|
1655
1654
|
onKeyDown: (d) => {
|
|
@@ -1663,20 +1662,20 @@ const vn = {
|
|
|
1663
1662
|
/* @__PURE__ */ e("div", { className: "select-options-list", children: r.length === 0 && v !== "" ? /* @__PURE__ */ e("div", { className: "no-results", children: "No results found." }) : r.map((d) => /* @__PURE__ */ e(
|
|
1664
1663
|
Mr,
|
|
1665
1664
|
{
|
|
1666
|
-
className: ({ active:
|
|
1665
|
+
className: ({ active: b }) => `select-option ${b ? "active" : ""}`,
|
|
1667
1666
|
value: d,
|
|
1668
|
-
children: ({ selected:
|
|
1667
|
+
children: ({ selected: b }) => /* @__PURE__ */ n(re, { children: [
|
|
1669
1668
|
/* @__PURE__ */ n("div", { className: "option-content", children: [
|
|
1670
1669
|
d.icon && /* @__PURE__ */ e(d.icon, { className: "option-icon" }),
|
|
1671
1670
|
/* @__PURE__ */ e(
|
|
1672
1671
|
"span",
|
|
1673
1672
|
{
|
|
1674
|
-
className: `option-label ${
|
|
1673
|
+
className: `option-label ${b ? "selected" : ""}`,
|
|
1675
1674
|
children: d.label
|
|
1676
1675
|
}
|
|
1677
1676
|
)
|
|
1678
1677
|
] }),
|
|
1679
|
-
|
|
1678
|
+
b ? /* @__PURE__ */ e(
|
|
1680
1679
|
tt,
|
|
1681
1680
|
{
|
|
1682
1681
|
className: "option-check-icon",
|
|
@@ -1713,7 +1712,7 @@ const vn = {
|
|
|
1713
1712
|
te(() => {
|
|
1714
1713
|
bt([t], i) && o(!0);
|
|
1715
1714
|
}, [t, i]);
|
|
1716
|
-
const
|
|
1715
|
+
const f = i === l, v = !f && !!bt([t], i), g = (r) => {
|
|
1717
1716
|
r.preventDefault(), o(!u);
|
|
1718
1717
|
};
|
|
1719
1718
|
return /* @__PURE__ */ n(
|
|
@@ -1731,10 +1730,10 @@ const vn = {
|
|
|
1731
1730
|
target: t.target,
|
|
1732
1731
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
1733
1732
|
className: Z("nav-item", {
|
|
1734
|
-
"nav-item--active":
|
|
1733
|
+
"nav-item--active": f,
|
|
1735
1734
|
"nav-item--collapsed": a
|
|
1736
1735
|
}),
|
|
1737
|
-
"aria-current":
|
|
1736
|
+
"aria-current": f ? "page" : void 0,
|
|
1738
1737
|
children: [
|
|
1739
1738
|
h && /* @__PURE__ */ e(h, { className: "nav-icon", "aria-hidden": "true" }),
|
|
1740
1739
|
/* @__PURE__ */ e("span", { className: "nav-label", children: t.label || t.name }),
|
|
@@ -1831,7 +1830,7 @@ const vn = {
|
|
|
1831
1830
|
}
|
|
1832
1831
|
)
|
|
1833
1832
|
] }),
|
|
1834
|
-
/* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((
|
|
1833
|
+
/* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((f) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(oa, { item: f, isCollapsed: a }) }, f.label || f.name)) }) }),
|
|
1835
1834
|
/* @__PURE__ */ n("div", { className: "sidebar-footer", children: [
|
|
1836
1835
|
/* @__PURE__ */ e(we, { src: h.avatar, name: h.name, size: "medium" }),
|
|
1837
1836
|
/* @__PURE__ */ n("div", { className: "user-info", children: [
|
|
@@ -1884,7 +1883,7 @@ const vn = {
|
|
|
1884
1883
|
]
|
|
1885
1884
|
}
|
|
1886
1885
|
);
|
|
1887
|
-
},
|
|
1886
|
+
}, Al = ({ label: t = "Loading..." }) => /* @__PURE__ */ e("div", { className: "fullscreen-loader-overlay", role: "alert", "aria-busy": "true", children: /* @__PURE__ */ n("div", { className: "loader-content", children: [
|
|
1888
1887
|
/* @__PURE__ */ e(ca, { size: "large" }),
|
|
1889
1888
|
t && /* @__PURE__ */ e("span", { className: "loader-label", children: t })
|
|
1890
1889
|
] }) }), da = ({
|
|
@@ -1899,14 +1898,14 @@ const vn = {
|
|
|
1899
1898
|
// ✅ New prop to control visibility
|
|
1900
1899
|
...h
|
|
1901
1900
|
}) => {
|
|
1902
|
-
const
|
|
1901
|
+
const f = a || h.name, [v, g] = B(
|
|
1903
1902
|
h.value?.length || h.defaultValue?.length || 0
|
|
1904
1903
|
), r = (d) => {
|
|
1905
1904
|
g(d.target.value.length), h.onChange && h.onChange(d);
|
|
1906
1905
|
}, x = u - v;
|
|
1907
1906
|
return /* @__PURE__ */ n("div", { className: `textarea-wrapper ${i || ""}`, children: [
|
|
1908
1907
|
/* @__PURE__ */ n("div", { className: "textarea-header", children: [
|
|
1909
|
-
t && /* @__PURE__ */ e("label", { htmlFor:
|
|
1908
|
+
t && /* @__PURE__ */ e("label", { htmlFor: f, className: "textarea-label", children: t }),
|
|
1910
1909
|
o && u && /* @__PURE__ */ n("span", { className: "char-counter", children: [
|
|
1911
1910
|
x,
|
|
1912
1911
|
" characters remaining"
|
|
@@ -1915,7 +1914,7 @@ const vn = {
|
|
|
1915
1914
|
/* @__PURE__ */ e(
|
|
1916
1915
|
"textarea",
|
|
1917
1916
|
{
|
|
1918
|
-
id:
|
|
1917
|
+
id: f,
|
|
1919
1918
|
ref: l,
|
|
1920
1919
|
className: Z("textarea-field", {
|
|
1921
1920
|
"textarea-field--error": !!s
|
|
@@ -1954,7 +1953,7 @@ const vn = {
|
|
|
1954
1953
|
t && i === "right" && /* @__PURE__ */ e(it.Label, { className: `switch-label ${u}`, passive: !0, children: t })
|
|
1955
1954
|
] }),
|
|
1956
1955
|
l && /* @__PURE__ */ e("p", { className: "switch-error-message", children: l })
|
|
1957
|
-
] }),
|
|
1956
|
+
] }), Tl = ({
|
|
1958
1957
|
children: t,
|
|
1959
1958
|
content: a,
|
|
1960
1959
|
variant: s = "dark",
|
|
@@ -1971,7 +1970,7 @@ const vn = {
|
|
|
1971
1970
|
return /* @__PURE__ */ n(re, { children: [
|
|
1972
1971
|
ne.cloneElement(t, { "data-tooltip-id": h }),
|
|
1973
1972
|
/* @__PURE__ */ e(
|
|
1974
|
-
|
|
1973
|
+
Ga,
|
|
1975
1974
|
{
|
|
1976
1975
|
id: h,
|
|
1977
1976
|
content: a,
|
|
@@ -2004,10 +2003,10 @@ const vn = {
|
|
|
2004
2003
|
stepProps: u = {},
|
|
2005
2004
|
title: o,
|
|
2006
2005
|
description: h,
|
|
2007
|
-
showProgress:
|
|
2006
|
+
showProgress: f = !0,
|
|
2008
2007
|
closeOnOverlayClick: v = !0
|
|
2009
2008
|
}) => {
|
|
2010
|
-
const g = s[i], r = Object.keys(s), x = r.indexOf(i), d = (x + 1) / r.length * 100,
|
|
2009
|
+
const g = s[i], r = Object.keys(s), x = r.indexOf(i), d = (x + 1) / r.length * 100, b = x > 0 && u.onBack;
|
|
2011
2010
|
return /* @__PURE__ */ e(fe, { show: t, as: ee, children: /* @__PURE__ */ n(
|
|
2012
2011
|
xe,
|
|
2013
2012
|
{
|
|
@@ -2042,13 +2041,13 @@ const vn = {
|
|
|
2042
2041
|
children: /* @__PURE__ */ n(Fe, { className: "wizard-panel", children: [
|
|
2043
2042
|
/* @__PURE__ */ n("header", { className: "wizard-header", children: [
|
|
2044
2043
|
/* @__PURE__ */ n("div", { className: "wizard-header-content", children: [
|
|
2045
|
-
|
|
2044
|
+
b && /* @__PURE__ */ e(
|
|
2046
2045
|
"button",
|
|
2047
2046
|
{
|
|
2048
2047
|
onClick: u.onBack,
|
|
2049
2048
|
className: "wizard-back-button",
|
|
2050
2049
|
"aria-label": "Go back to previous step",
|
|
2051
|
-
children: /* @__PURE__ */ e(
|
|
2050
|
+
children: /* @__PURE__ */ e(Ua, { size: 20 })
|
|
2052
2051
|
}
|
|
2053
2052
|
),
|
|
2054
2053
|
/* @__PURE__ */ n("div", { className: "wizard-header-text", children: [
|
|
@@ -2066,7 +2065,7 @@ const vn = {
|
|
|
2066
2065
|
}
|
|
2067
2066
|
)
|
|
2068
2067
|
] }),
|
|
2069
|
-
|
|
2068
|
+
f && /* @__PURE__ */ e("div", { className: "wizard-progress-container", children: /* @__PURE__ */ e(
|
|
2070
2069
|
"div",
|
|
2071
2070
|
{
|
|
2072
2071
|
className: "wizard-progress-bar",
|
|
@@ -2124,17 +2123,17 @@ const vn = {
|
|
|
2124
2123
|
icon: o,
|
|
2125
2124
|
// Renamed for clarity, expecting a component type e.g., CheckCircle
|
|
2126
2125
|
disabled: h = !1,
|
|
2127
|
-
size:
|
|
2126
|
+
size: f = "small",
|
|
2128
2127
|
label: v,
|
|
2129
2128
|
children: g,
|
|
2130
2129
|
// ✅ Add children to the props list
|
|
2131
2130
|
onClick: r,
|
|
2132
2131
|
...x
|
|
2133
2132
|
}) => {
|
|
2134
|
-
const d = h,
|
|
2133
|
+
const d = h, b = Z(
|
|
2135
2134
|
"btn-base-icon",
|
|
2136
2135
|
"btn-icon-only",
|
|
2137
|
-
In[
|
|
2136
|
+
In[f],
|
|
2138
2137
|
On[u],
|
|
2139
2138
|
l
|
|
2140
2139
|
);
|
|
@@ -2143,13 +2142,13 @@ const vn = {
|
|
|
2143
2142
|
{
|
|
2144
2143
|
"data-testid": t,
|
|
2145
2144
|
type: s,
|
|
2146
|
-
className:
|
|
2145
|
+
className: b,
|
|
2147
2146
|
disabled: d,
|
|
2148
2147
|
onClick: r,
|
|
2149
2148
|
title: i,
|
|
2150
2149
|
"aria-label": i,
|
|
2151
2150
|
...x,
|
|
2152
|
-
children: o && /* @__PURE__ */ e(o, { size:
|
|
2151
|
+
children: o && /* @__PURE__ */ e(o, { size: f === "large" ? 20 : 16 })
|
|
2153
2152
|
}
|
|
2154
2153
|
);
|
|
2155
2154
|
}, El = ({
|
|
@@ -2219,7 +2218,7 @@ const vn = {
|
|
|
2219
2218
|
}
|
|
2220
2219
|
),
|
|
2221
2220
|
/* @__PURE__ */ n("div", { className: "page-header-content", children: [
|
|
2222
|
-
/* @__PURE__ */ e("h1", { className: "page-header-heading", children: t }),
|
|
2221
|
+
t && /* @__PURE__ */ e("h1", { className: "page-header-heading", children: t }),
|
|
2223
2222
|
s.length > 1 ? /* @__PURE__ */ e(wn, { crumbs: s }) : a ? /* @__PURE__ */ e("p", { className: "page-header-subheading", children: a }) : null
|
|
2224
2223
|
] })
|
|
2225
2224
|
] }), Pn = ({
|
|
@@ -2351,20 +2350,20 @@ const ha = ua(localStorage), Rl = ua(sessionStorage), Il = {
|
|
|
2351
2350
|
}
|
|
2352
2351
|
};
|
|
2353
2352
|
function Nt() {
|
|
2354
|
-
const t = window.location.hostname
|
|
2355
|
-
return
|
|
2353
|
+
const t = window.location.hostname;
|
|
2354
|
+
return t === "localhost" || t === "127.0.0.1" ? "https://dev.unifyed.com" : `${window.location.protocol}//${t}`;
|
|
2356
2355
|
}
|
|
2357
2356
|
function Vn() {
|
|
2358
2357
|
try {
|
|
2359
2358
|
const t = ha.get("userProfile"), a = t && typeof t == "object" ? t : {};
|
|
2360
|
-
return
|
|
2359
|
+
return a.gatewaypath ? a.gatewaypath : "/unifyd-gateway/api";
|
|
2361
2360
|
} catch (t) {
|
|
2362
2361
|
return console.warn("Error reading gateway URL from profile", t), "/unifyd-gateway/api";
|
|
2363
2362
|
}
|
|
2364
2363
|
}
|
|
2365
2364
|
function Ce() {
|
|
2366
|
-
const t = Nt().replace(/\/$/, ""), a = Vn().replace(/^\//, ""), s = `${t}/${a}
|
|
2367
|
-
return
|
|
2365
|
+
const t = Nt().replace(/\/$/, ""), a = Vn().replace(/^\//, ""), s = `${t}/${a}`;
|
|
2366
|
+
return ha.get("userProfile"), s;
|
|
2368
2367
|
}
|
|
2369
2368
|
function pa() {
|
|
2370
2369
|
return `${Ce()}/unifyedstudioutility/commonutility/users/list?sortkey=firstName&sortorder=false&page=0&size=999&onlineusersonly=false`;
|
|
@@ -2404,7 +2403,7 @@ function Ol() {
|
|
|
2404
2403
|
FILE_PERMISSIONS_API: _n()
|
|
2405
2404
|
});
|
|
2406
2405
|
}
|
|
2407
|
-
function
|
|
2406
|
+
function Gn(t) {
|
|
2408
2407
|
try {
|
|
2409
2408
|
const a = localStorage.getItem(t);
|
|
2410
2409
|
return a ? JSON.parse(a) : null;
|
|
@@ -2413,7 +2412,7 @@ function Un(t) {
|
|
|
2413
2412
|
}
|
|
2414
2413
|
}
|
|
2415
2414
|
function Ot() {
|
|
2416
|
-
const t =
|
|
2415
|
+
const t = Gn("userProfile") || {}, a = localStorage.getItem("access_token") || t.accessToken || "", s = localStorage.getItem("siteId") || t.siteId || "", i = t.tenant || "", l = t.tenantdomain || "", u = t.username || t.displayName || "", o = t.email || "";
|
|
2417
2416
|
return {
|
|
2418
2417
|
Authorization: a ? `Bearer ${a}` : void 0,
|
|
2419
2418
|
"x-tenant-id": i || void 0,
|
|
@@ -2424,7 +2423,7 @@ function Ot() {
|
|
|
2424
2423
|
"x-user-email": o || void 0
|
|
2425
2424
|
};
|
|
2426
2425
|
}
|
|
2427
|
-
function
|
|
2426
|
+
function Un(t) {
|
|
2428
2427
|
if (t && t.isAxiosError) {
|
|
2429
2428
|
const { response: a, config: s, message: i } = t, l = a?.status ?? null, u = a?.statusText ?? null, o = a?.data ?? null, h = typeof o == "string" && o || o?.message || o?.msg || o?.error || o?.errors?.[0]?.message || null;
|
|
2430
2429
|
return {
|
|
@@ -2467,7 +2466,7 @@ function qn({
|
|
|
2467
2466
|
message: v?.statusText || "Request succeeded"
|
|
2468
2467
|
},
|
|
2469
2468
|
(v) => {
|
|
2470
|
-
const g =
|
|
2469
|
+
const g = Un(v), r = g.status;
|
|
2471
2470
|
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(g);
|
|
2472
2471
|
}
|
|
2473
2472
|
);
|
|
@@ -2496,7 +2495,7 @@ function qn({
|
|
|
2496
2495
|
async function h(v, g = {}, r = !1, x = {}) {
|
|
2497
2496
|
return s.put(v, g, i({ open: r, customHeader: x }));
|
|
2498
2497
|
}
|
|
2499
|
-
async function
|
|
2498
|
+
async function f(v, g = {}, r = !1, x = {}) {
|
|
2500
2499
|
return s.patch(v, g, i({ open: r, customHeader: x }));
|
|
2501
2500
|
}
|
|
2502
2501
|
return {
|
|
@@ -2506,7 +2505,7 @@ function qn({
|
|
|
2506
2505
|
axiosDelete: u,
|
|
2507
2506
|
axiosPost: o,
|
|
2508
2507
|
axiosPut: h,
|
|
2509
|
-
axiosPatch:
|
|
2508
|
+
axiosPatch: f
|
|
2510
2509
|
};
|
|
2511
2510
|
}
|
|
2512
2511
|
const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl = Ee.axiosPut, Ll = Ee.axiosPatch, Bl = Ee.instance, Yn = async (t, a) => {
|
|
@@ -2617,8 +2616,8 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2617
2616
|
const l = t.slice(0, 2), u = [];
|
|
2618
2617
|
t.length > 0 && u.push(t[0].name), a.length > 0 && u.push(a[0].name), s.length > 0 && u.length < 2 && u.push(s[0].name);
|
|
2619
2618
|
const o = t.length + a.length + s.length, h = o - u.length;
|
|
2620
|
-
let
|
|
2621
|
-
return h > 0 && (
|
|
2619
|
+
let f = u.join(", ");
|
|
2620
|
+
return h > 0 && (f += ` and ${h} others`), o === 0 ? /* @__PURE__ */ e(
|
|
2622
2621
|
"div",
|
|
2623
2622
|
{
|
|
2624
2623
|
className: "flex items-center justify-between p-3 border border-dashed border-gray-400 rounded-lg hover:bg-gray-50",
|
|
@@ -2641,7 +2640,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2641
2640
|
},
|
|
2642
2641
|
v.id || g
|
|
2643
2642
|
)) }),
|
|
2644
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-800 truncate", children:
|
|
2643
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-800 truncate", children: f })
|
|
2645
2644
|
] }),
|
|
2646
2645
|
/* @__PURE__ */ e(ve, { size: 20 })
|
|
2647
2646
|
]
|
|
@@ -2652,8 +2651,8 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2652
2651
|
{ id: 2, name: $e.GROUP, icon: Kt, code: "groups" },
|
|
2653
2652
|
{ id: 3, name: $e.ROLE, icon: Xa, code: "roles" }
|
|
2654
2653
|
], Lt = [
|
|
2655
|
-
{ id: 1, name:
|
|
2656
|
-
{ id: 2, name:
|
|
2654
|
+
{ id: 1, name: At.View, icon: Qa },
|
|
2655
|
+
{ id: 2, name: At.Manage, icon: Ha }
|
|
2657
2656
|
], Xn = Ya().shape({
|
|
2658
2657
|
pendingInvites: Wa().min(1, "You must add at least one person to invite.")
|
|
2659
2658
|
}), Qn = ({
|
|
@@ -2667,43 +2666,45 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2667
2666
|
},
|
|
2668
2667
|
isChanged: h = !1
|
|
2669
2668
|
}) => {
|
|
2670
|
-
const [
|
|
2671
|
-
control:
|
|
2669
|
+
const [f, v] = B(Pt[0]), [g, r] = B(""), x = kt(g, 400), [d, b] = B([]), [C, T] = B(/* @__PURE__ */ new Set()), [A, O] = B(!1), [V, _] = B(Lt[0]), {
|
|
2670
|
+
control: G,
|
|
2672
2671
|
handleSubmit: W,
|
|
2673
2672
|
watch: J,
|
|
2674
|
-
formState: { errors: E, isSubmitting:
|
|
2673
|
+
formState: { errors: E, isSubmitting: U }
|
|
2675
2674
|
} = Za({
|
|
2676
2675
|
defaultValues: { pendingInvites: [] },
|
|
2677
2676
|
resolver: tr(Xn)
|
|
2678
2677
|
}), { fields: F, append: m, remove: k, update: L } = Ka({
|
|
2679
|
-
control:
|
|
2680
|
-
name: "pendingInvites"
|
|
2678
|
+
control: G,
|
|
2679
|
+
name: "pendingInvites",
|
|
2680
|
+
keyName: "fieldId"
|
|
2681
|
+
// This is auto generated key name created by react form hook to avoid conflict with 'id' in data
|
|
2681
2682
|
}), P = J("pendingInvites");
|
|
2682
2683
|
te(() => {
|
|
2683
|
-
x.length > 1 ? (O(!0), Yn(
|
|
2684
|
-
|
|
2685
|
-
}).catch((y) => console.error("Search failed:", y)).finally(() => O(!1))) : (
|
|
2686
|
-
}, [x,
|
|
2687
|
-
const
|
|
2688
|
-
|
|
2684
|
+
x.length > 1 ? (O(!0), Yn(f.name, x).then((y) => {
|
|
2685
|
+
b(y);
|
|
2686
|
+
}).catch((y) => console.error("Search failed:", y)).finally(() => O(!1))) : (b([]), T(/* @__PURE__ */ new Set()));
|
|
2687
|
+
}, [x, f]);
|
|
2688
|
+
const $ = (y) => {
|
|
2689
|
+
T((N) => {
|
|
2689
2690
|
const R = new Set(N);
|
|
2690
2691
|
return R.has(y) ? R.delete(y) : R.add(y), R;
|
|
2691
2692
|
});
|
|
2692
2693
|
}, p = () => {
|
|
2693
2694
|
d.filter((y) => C.has(y.id)).forEach((y) => {
|
|
2694
2695
|
F.find((N) => N.id === y.id) || m({ ...y, permission: V.name });
|
|
2695
|
-
}),
|
|
2696
|
-
},
|
|
2696
|
+
}), T(/* @__PURE__ */ new Set()), r("");
|
|
2697
|
+
}, z = (y) => {
|
|
2697
2698
|
_(y), F.forEach(
|
|
2698
2699
|
(N, R) => L(R, { ...F[R], permission: y.name })
|
|
2699
2700
|
);
|
|
2700
2701
|
}, I = async (y) => {
|
|
2701
2702
|
try {
|
|
2702
2703
|
if (l === pe.DRIVE) {
|
|
2703
|
-
const N = y.pendingInvites.map((
|
|
2704
|
-
id:
|
|
2705
|
-
permission:
|
|
2706
|
-
type:
|
|
2704
|
+
const N = y.pendingInvites.map((D) => ({
|
|
2705
|
+
id: D.id,
|
|
2706
|
+
permission: D.permission,
|
|
2707
|
+
type: D.type.toLowerCase()
|
|
2707
2708
|
}));
|
|
2708
2709
|
o({
|
|
2709
2710
|
entity: t,
|
|
@@ -2723,10 +2724,10 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2723
2724
|
}));
|
|
2724
2725
|
o(N, i);
|
|
2725
2726
|
} else if (l === pe.ARTICLE) {
|
|
2726
|
-
const N = y.pendingInvites.map((
|
|
2727
|
-
id:
|
|
2728
|
-
permission:
|
|
2729
|
-
type:
|
|
2727
|
+
const N = y.pendingInvites.map((D) => ({
|
|
2728
|
+
id: D.id,
|
|
2729
|
+
permission: D.permission,
|
|
2730
|
+
type: D.type.toLowerCase()
|
|
2730
2731
|
}));
|
|
2731
2732
|
o({
|
|
2732
2733
|
entity: t,
|
|
@@ -2742,9 +2743,9 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2742
2743
|
throw console.error("Failed to submit invites:", N), N;
|
|
2743
2744
|
}
|
|
2744
2745
|
}, w = (y) => {
|
|
2745
|
-
const N = i[
|
|
2746
|
+
const N = i[f.code].find((R) => R.name === y.name && R.permission !== "remove") || P.find((R) => R.name === y.name);
|
|
2746
2747
|
return N ? `${N.permission}` : "";
|
|
2747
|
-
},
|
|
2748
|
+
}, S = () => {
|
|
2748
2749
|
switch (l) {
|
|
2749
2750
|
case pe.DRIVE:
|
|
2750
2751
|
return "Share with others";
|
|
@@ -2758,7 +2759,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2758
2759
|
};
|
|
2759
2760
|
return ae(() => (console.log("InviteFlow - isChanged:", h, "pendingInvites.length:", P.length), P.length === 0 && !h), [P.length, h]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2760
2761
|
/* @__PURE__ */ n("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2761
|
-
/* @__PURE__ */ e(xe.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children:
|
|
2762
|
+
/* @__PURE__ */ e(xe.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: S() }),
|
|
2762
2763
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
|
|
2763
2764
|
l === pe.DRIVE && /* @__PURE__ */ n("button", { className: "flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800 font-semibold hover:cursor-pointer", children: [
|
|
2764
2765
|
/* @__PURE__ */ e(er, { className: "h-5 w-5" }),
|
|
@@ -2785,11 +2786,11 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2785
2786
|
}
|
|
2786
2787
|
),
|
|
2787
2788
|
/* @__PURE__ */ n("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
|
|
2788
|
-
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(oe, { value:
|
|
2789
|
+
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(oe, { value: f, onChange: v, children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2789
2790
|
/* @__PURE__ */ n(oe.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: [
|
|
2790
2791
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
2791
|
-
/* @__PURE__ */ e(
|
|
2792
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2792
|
+
/* @__PURE__ */ e(f.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2793
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: f.name })
|
|
2793
2794
|
] }),
|
|
2794
2795
|
/* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(zt, { className: "h-5 w-5 text-gray-400" }) })
|
|
2795
2796
|
] }),
|
|
@@ -2832,12 +2833,12 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2832
2833
|
/* @__PURE__ */ e("div", { className: "col-span-2", children: /* @__PURE__ */ e(
|
|
2833
2834
|
ye,
|
|
2834
2835
|
{
|
|
2835
|
-
placeholder: `Search by ${
|
|
2836
|
+
placeholder: `Search by ${f.name.toLowerCase()}...`,
|
|
2836
2837
|
onDebouncedChange: (y) => r(y),
|
|
2837
2838
|
value: g
|
|
2838
2839
|
}
|
|
2839
2840
|
) }),
|
|
2840
|
-
/* @__PURE__ */ e(De, { children: (d?.length > 0 ||
|
|
2841
|
+
/* @__PURE__ */ e(De, { children: (d?.length > 0 || A) && /* @__PURE__ */ e(
|
|
2841
2842
|
ce.div,
|
|
2842
2843
|
{
|
|
2843
2844
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2845,13 +2846,13 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2845
2846
|
exit: { opacity: 0, y: -10 },
|
|
2846
2847
|
transition: { duration: 0.2 },
|
|
2847
2848
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2848
|
-
children:
|
|
2849
|
+
children: A ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(re, { children: [
|
|
2849
2850
|
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((y) => {
|
|
2850
2851
|
const N = w(y);
|
|
2851
2852
|
return /* @__PURE__ */ n(
|
|
2852
2853
|
"div",
|
|
2853
2854
|
{
|
|
2854
|
-
onClick: () => N ? null :
|
|
2855
|
+
onClick: () => N ? null : $(y.id),
|
|
2855
2856
|
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${N ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2856
2857
|
children: [
|
|
2857
2858
|
/* @__PURE__ */ e(
|
|
@@ -2867,7 +2868,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2867
2868
|
/* @__PURE__ */ e(we, { src: y.avatarUrl, name: y.name, size: "small" }),
|
|
2868
2869
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
2869
2870
|
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: y.name }),
|
|
2870
|
-
|
|
2871
|
+
f.name === $e.USER && /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: y.id })
|
|
2871
2872
|
] }),
|
|
2872
2873
|
N ? /* @__PURE__ */ n(re, { children: [
|
|
2873
2874
|
/* @__PURE__ */ e("span", { className: "text-sm px-3 py-0.5 border border-dashed rounded-xl bg-teal-100 text-teal-700", children: N }),
|
|
@@ -2918,7 +2919,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2918
2919
|
oe,
|
|
2919
2920
|
{
|
|
2920
2921
|
value: V,
|
|
2921
|
-
onChange:
|
|
2922
|
+
onChange: z,
|
|
2922
2923
|
children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2923
2924
|
/* @__PURE__ */ n(oe.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: [
|
|
2924
2925
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
@@ -3038,8 +3039,8 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3038
3039
|
ie,
|
|
3039
3040
|
{
|
|
3040
3041
|
onClick: () => W(I)(),
|
|
3041
|
-
disabled:
|
|
3042
|
-
label:
|
|
3042
|
+
disabled: U || P.length === 0 && !h,
|
|
3043
|
+
label: U ? "Inviting..." : l === pe.DRIVE ? "Send Invites" : "Add"
|
|
3043
3044
|
}
|
|
3044
3045
|
)
|
|
3045
3046
|
] })
|
|
@@ -3054,24 +3055,24 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3054
3055
|
existingShares: l,
|
|
3055
3056
|
allowedPermissions: u
|
|
3056
3057
|
}) => {
|
|
3057
|
-
const [o, h] = B(l), [
|
|
3058
|
+
const [o, h] = B(l), [f, v] = B(0), [g, r] = B(""), x = kt(g, 300), d = {
|
|
3058
3059
|
users: o.users.filter(
|
|
3059
|
-
(
|
|
3060
|
+
(A) => A.name.toLowerCase().includes(x.toLowerCase())
|
|
3060
3061
|
),
|
|
3061
3062
|
groups: o.groups.filter(
|
|
3062
|
-
(
|
|
3063
|
+
(A) => A.name.toLowerCase().includes(x.toLowerCase())
|
|
3063
3064
|
),
|
|
3064
3065
|
roles: o.roles.filter(
|
|
3065
|
-
(
|
|
3066
|
+
(A) => A.name.toLowerCase().includes(x.toLowerCase())
|
|
3066
3067
|
)
|
|
3067
|
-
},
|
|
3068
|
-
console.log("[ManageFlow] Removing item:", { itemToRemove:
|
|
3068
|
+
}, b = (A, O) => {
|
|
3069
|
+
console.log("[ManageFlow] Removing item:", { itemToRemove: A, listKey: O });
|
|
3069
3070
|
const V = {
|
|
3070
3071
|
...o,
|
|
3071
|
-
[O]: o[O].filter((_) => _.id !==
|
|
3072
|
+
[O]: o[O].filter((_) => _.id !== A.id)
|
|
3072
3073
|
};
|
|
3073
3074
|
h(V), console.log("[ManageFlow] Syncing updated shares with parent:", V), a(V, !0);
|
|
3074
|
-
}, C = ["users", "groups", "roles"],
|
|
3075
|
+
}, C = ["users", "groups", "roles"], T = ["Users", "Groups", "Roles"];
|
|
3075
3076
|
return (
|
|
3076
3077
|
// The main structure remains the same...
|
|
3077
3078
|
/* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-gray-50", children: [
|
|
@@ -3097,9 +3098,9 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3097
3098
|
}
|
|
3098
3099
|
)
|
|
3099
3100
|
] }),
|
|
3100
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col flex-grow", children: /* @__PURE__ */ n(le.Group, { selectedIndex:
|
|
3101
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col flex-grow", children: /* @__PURE__ */ n(le.Group, { selectedIndex: f, onChange: v, children: [
|
|
3101
3102
|
/* @__PURE__ */ n("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3102
|
-
/* @__PURE__ */ e(le.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children:
|
|
3103
|
+
/* @__PURE__ */ e(le.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: T.map((A) => /* @__PURE__ */ e(
|
|
3103
3104
|
le,
|
|
3104
3105
|
{
|
|
3105
3106
|
className: ({
|
|
@@ -3107,16 +3108,16 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3107
3108
|
}) => `w-full py-2 text-sm font-medium leading-5 rounded-md
|
|
3108
3109
|
focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
|
|
3109
3110
|
${O ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
|
|
3110
|
-
children:
|
|
3111
|
+
children: A
|
|
3111
3112
|
},
|
|
3112
|
-
|
|
3113
|
+
A
|
|
3113
3114
|
)) }),
|
|
3114
3115
|
/* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
|
|
3115
3116
|
ye,
|
|
3116
3117
|
{
|
|
3117
3118
|
onDebouncedChange: r,
|
|
3118
3119
|
value: g,
|
|
3119
|
-
placeholder: `Search in ${
|
|
3120
|
+
placeholder: `Search in ${T[f]}...`
|
|
3120
3121
|
}
|
|
3121
3122
|
) })
|
|
3122
3123
|
] }),
|
|
@@ -3127,11 +3128,11 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3127
3128
|
animate: { y: 0, opacity: 1 },
|
|
3128
3129
|
exit: { y: -10, opacity: 0 },
|
|
3129
3130
|
transition: { duration: 0.2 },
|
|
3130
|
-
children: /* @__PURE__ */ e(le.Panels, { as: ee, children: C.map((
|
|
3131
|
+
children: /* @__PURE__ */ e(le.Panels, { as: ee, children: C.map((A) => /* @__PURE__ */ e(
|
|
3131
3132
|
le.Panel,
|
|
3132
3133
|
{
|
|
3133
3134
|
className: "space-y-3 focus:outline-none",
|
|
3134
|
-
children: /* @__PURE__ */ e(De, { children: d[
|
|
3135
|
+
children: /* @__PURE__ */ e(De, { children: d[A].length > 0 ? d[A].map((O) => /* @__PURE__ */ n(
|
|
3135
3136
|
ce.div,
|
|
3136
3137
|
{
|
|
3137
3138
|
layout: !0,
|
|
@@ -3155,12 +3156,12 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3155
3156
|
),
|
|
3156
3157
|
/* @__PURE__ */ n("div", { className: "overflow-hidden", children: [
|
|
3157
3158
|
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: O.name }),
|
|
3158
|
-
|
|
3159
|
+
A !== "users" && /* @__PURE__ */ e(
|
|
3159
3160
|
"button",
|
|
3160
3161
|
{
|
|
3161
3162
|
onClick: () => i({
|
|
3162
3163
|
id: O.id,
|
|
3163
|
-
type:
|
|
3164
|
+
type: A,
|
|
3164
3165
|
name: O.name
|
|
3165
3166
|
}),
|
|
3166
3167
|
className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
|
|
@@ -3172,7 +3173,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3172
3173
|
/* @__PURE__ */ e(
|
|
3173
3174
|
"button",
|
|
3174
3175
|
{
|
|
3175
|
-
onClick: () =>
|
|
3176
|
+
onClick: () => b(O, A),
|
|
3176
3177
|
className: "text-gray-400 hover:text-red-500 hover:cursor-pointer p-1 rounded-full hover:bg-red-50",
|
|
3177
3178
|
title: "Remove access",
|
|
3178
3179
|
children: /* @__PURE__ */ e(Ve, { className: "h-5 w-5" })
|
|
@@ -3193,19 +3194,19 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3193
3194
|
/* @__PURE__ */ e(Kt, { className: "h-12 w-12 text-gray-400" }),
|
|
3194
3195
|
/* @__PURE__ */ n("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
|
|
3195
3196
|
"No ",
|
|
3196
|
-
|
|
3197
|
+
T[f],
|
|
3197
3198
|
" Found"
|
|
3198
3199
|
] }),
|
|
3199
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: g ? `No results for "${g}"` : `There are no ${
|
|
3200
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: g ? `No results for "${g}"` : `There are no ${T[f].toLowerCase()} with access.` })
|
|
3200
3201
|
]
|
|
3201
3202
|
}
|
|
3202
3203
|
)
|
|
3203
3204
|
) })
|
|
3204
3205
|
},
|
|
3205
|
-
|
|
3206
|
+
A
|
|
3206
3207
|
)) })
|
|
3207
3208
|
},
|
|
3208
|
-
|
|
3209
|
+
f
|
|
3209
3210
|
) }) })
|
|
3210
3211
|
] }) })
|
|
3211
3212
|
] })
|
|
@@ -3223,8 +3224,8 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3223
3224
|
onClose: s,
|
|
3224
3225
|
members: i
|
|
3225
3226
|
}) => {
|
|
3226
|
-
const [l, u] = B(!0), [o, h] = B(""),
|
|
3227
|
-
(d) => d.name.toLowerCase().includes(
|
|
3227
|
+
const [l, u] = B(!0), [o, h] = B(""), f = kt(o, 300), v = i.filter(
|
|
3228
|
+
(d) => d.name.toLowerCase().includes(f.toLowerCase())
|
|
3228
3229
|
), g = {
|
|
3229
3230
|
hidden: { opacity: 0 },
|
|
3230
3231
|
visible: {
|
|
@@ -3239,7 +3240,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3239
3240
|
exit: { opacity: 0, x: -20 }
|
|
3240
3241
|
}, x = () => l ? (
|
|
3241
3242
|
// Show 5 skeleton items while loading
|
|
3242
|
-
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d,
|
|
3243
|
+
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d, b) => /* @__PURE__ */ e(Zn, {}, b)) })
|
|
3243
3244
|
) : v.length === 0 ? /* @__PURE__ */ n(
|
|
3244
3245
|
ce.div,
|
|
3245
3246
|
{
|
|
@@ -3249,7 +3250,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3249
3250
|
children: [
|
|
3250
3251
|
/* @__PURE__ */ e(ar, { className: "h-12 w-12 text-gray-400" }),
|
|
3251
3252
|
/* @__PURE__ */ e("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: "No Users Found" }),
|
|
3252
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children:
|
|
3253
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: f ? `No one found matching "${f}"` : `There are no users in this ${t.type}.` })
|
|
3253
3254
|
]
|
|
3254
3255
|
}
|
|
3255
3256
|
) : /* @__PURE__ */ e(
|
|
@@ -3342,10 +3343,10 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3342
3343
|
},
|
|
3343
3344
|
showExistingShares: o = !0,
|
|
3344
3345
|
allowedPermissions: h = [],
|
|
3345
|
-
...
|
|
3346
|
+
...f
|
|
3346
3347
|
}) => {
|
|
3347
|
-
const [v, g] = B(be.INVITE), [r, x] = B(t), [d,
|
|
3348
|
-
g(be.INVITE),
|
|
3348
|
+
const [v, g] = B(be.INVITE), [r, x] = B(t), [d, b] = B(null), [C, T] = B(!1), [A, O] = B([]), [V, _] = B(be.MANAGE), G = () => {
|
|
3349
|
+
g(be.INVITE), b(null), u();
|
|
3349
3350
|
}, W = () => {
|
|
3350
3351
|
g(be.MANAGE);
|
|
3351
3352
|
}, J = async ({ id: F, name: m, type: k }) => {
|
|
@@ -3357,15 +3358,15 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3357
3358
|
}
|
|
3358
3359
|
O(resp);
|
|
3359
3360
|
}
|
|
3360
|
-
|
|
3361
|
+
b({ id: F, type: k, name: m }), _(v), g(be.MEMBERS);
|
|
3361
3362
|
}, E = (F, m = !1) => {
|
|
3362
3363
|
console.log("changedExistingShares", F), x(F);
|
|
3363
|
-
const k = ot.mapValues(t, (
|
|
3364
|
+
const k = ot.mapValues(t, ($) => $.map((p) => ({ id: p.id, permission: p.permission })).sort((p, z) => p.id - z.id)), L = ot.mapValues(F, ($) => $.map((p) => ({ id: p.id, permission: p.permission })).sort((p, z) => p.id - z.id));
|
|
3364
3365
|
console.log("Existing data:", k), console.log("Changed data:", L);
|
|
3365
3366
|
const P = !ot.isEqual(k, L);
|
|
3366
|
-
console.log("hasPermissionChanged:", P),
|
|
3367
|
+
console.log("hasPermissionChanged:", P), T(P), P && (console.log("[AddUserGroupsRolesModal] Immediately syncing changes with parent"), s({ pendingInvites: [] }, F)), m && v === be.MANAGE ? console.log("[AddUserGroupsRolesModal] Staying in ManageFlow after removal") : g(v === be.MEMBERS ? V : be.INVITE);
|
|
3367
3368
|
};
|
|
3368
|
-
return /* @__PURE__ */ e(fe, { appear: !0, show: a, as: ee, children: /* @__PURE__ */ n(xe, { as: "div", className: "relative z-50", onClose:
|
|
3369
|
+
return /* @__PURE__ */ e(fe, { appear: !0, show: a, as: ee, children: /* @__PURE__ */ n(xe, { as: "div", className: "relative z-50", onClose: G, children: [
|
|
3369
3370
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
3370
3371
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(Fe, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
|
|
3371
3372
|
switch (v) {
|
|
@@ -3383,7 +3384,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3383
3384
|
{
|
|
3384
3385
|
entity: i,
|
|
3385
3386
|
onBack: E,
|
|
3386
|
-
onClose:
|
|
3387
|
+
onClose: G,
|
|
3387
3388
|
onOpenMembers: J,
|
|
3388
3389
|
existingShares: r,
|
|
3389
3390
|
calledBy: l,
|
|
@@ -3407,10 +3408,10 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3407
3408
|
{
|
|
3408
3409
|
entity: d,
|
|
3409
3410
|
onBack: E,
|
|
3410
|
-
onClose:
|
|
3411
|
+
onClose: G,
|
|
3411
3412
|
calledBy: l,
|
|
3412
3413
|
existingShares: r,
|
|
3413
|
-
members:
|
|
3414
|
+
members: A
|
|
3414
3415
|
}
|
|
3415
3416
|
)
|
|
3416
3417
|
},
|
|
@@ -3430,7 +3431,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3430
3431
|
{
|
|
3431
3432
|
entity: i,
|
|
3432
3433
|
onManage: W,
|
|
3433
|
-
onClose:
|
|
3434
|
+
onClose: G,
|
|
3434
3435
|
existingShares: r,
|
|
3435
3436
|
calledBy: l,
|
|
3436
3437
|
showExistingShares: o,
|
|
@@ -3461,7 +3462,7 @@ function rt({
|
|
|
3461
3462
|
placeholder: u = "Select options",
|
|
3462
3463
|
error: o = null,
|
|
3463
3464
|
displayLimit: h = 3,
|
|
3464
|
-
selectionLimit:
|
|
3465
|
+
selectionLimit: f = -1,
|
|
3465
3466
|
// NEW: search behavior
|
|
3466
3467
|
searchMode: v = "client",
|
|
3467
3468
|
// "client" | "server"
|
|
@@ -3471,30 +3472,30 @@ function rt({
|
|
|
3471
3472
|
minSearchChars: x = 2,
|
|
3472
3473
|
// NEW: mappers (id/label keys)
|
|
3473
3474
|
getOptionId: d = (C) => String(C.id),
|
|
3474
|
-
getOptionLabel:
|
|
3475
|
+
getOptionLabel: b = (C) => C.name
|
|
3475
3476
|
}) {
|
|
3476
|
-
const C = Ze(),
|
|
3477
|
+
const C = Ze(), T = Ze(), [A, O] = B(""), V = ge(""), _ = ae(() => {
|
|
3477
3478
|
const F = /* @__PURE__ */ new Map();
|
|
3478
3479
|
for (const m of a) F.set(d(m), m);
|
|
3479
3480
|
return F;
|
|
3480
|
-
}, [a, d]),
|
|
3481
|
-
if (!
|
|
3482
|
-
const F =
|
|
3483
|
-
return a.filter((m) =>
|
|
3484
|
-
}, [a,
|
|
3481
|
+
}, [a, d]), G = ae(() => Array.isArray(s) ? s.map((F) => F && typeof F == "object" ? _.get(d(F)) || null : _.get(String(F))).filter(Boolean) : [], [s, _, d]), W = ae(() => {
|
|
3482
|
+
if (!A) return a;
|
|
3483
|
+
const F = A.toLowerCase();
|
|
3484
|
+
return a.filter((m) => b(m).toLowerCase().includes(F));
|
|
3485
|
+
}, [a, A, b]);
|
|
3485
3486
|
te(() => {
|
|
3486
|
-
v === "server" &&
|
|
3487
|
-
}, [
|
|
3487
|
+
v === "server" && A.length >= x && A !== V.current && (V.current = A, g && g(A));
|
|
3488
|
+
}, [A, v, x, g]);
|
|
3488
3489
|
const J = v === "client" ? W : a, E = () => {
|
|
3489
|
-
if (!
|
|
3490
|
+
if (!G.length)
|
|
3490
3491
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
|
|
3491
|
-
const F =
|
|
3492
|
+
const F = G.slice(0, h), m = G.length - h;
|
|
3492
3493
|
return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2", children: [
|
|
3493
3494
|
F.map((k) => /* @__PURE__ */ e(
|
|
3494
3495
|
"span",
|
|
3495
3496
|
{
|
|
3496
3497
|
className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
|
|
3497
|
-
children:
|
|
3498
|
+
children: b(k)
|
|
3498
3499
|
},
|
|
3499
3500
|
d(k)
|
|
3500
3501
|
)),
|
|
@@ -3505,9 +3506,9 @@ function rt({
|
|
|
3505
3506
|
] })
|
|
3506
3507
|
] });
|
|
3507
3508
|
};
|
|
3508
|
-
return /* @__PURE__ */ e(oe, { value:
|
|
3509
|
+
return /* @__PURE__ */ e(oe, { value: G, onChange: (F) => {
|
|
3509
3510
|
const m = Array.from(new Set(F.map((k) => d(k))));
|
|
3510
|
-
|
|
3511
|
+
f !== -1 && m.length > f || i(m);
|
|
3511
3512
|
}, multiple: !0, by: "id", children: ({ open: F }) => /* @__PURE__ */ n("div", { children: [
|
|
3512
3513
|
/* @__PURE__ */ e(
|
|
3513
3514
|
oe.Label,
|
|
@@ -3523,7 +3524,7 @@ function rt({
|
|
|
3523
3524
|
{
|
|
3524
3525
|
"aria-labelledby": C,
|
|
3525
3526
|
"aria-invalid": !!o,
|
|
3526
|
-
"aria-describedby": o ?
|
|
3527
|
+
"aria-describedby": o ? T : void 0,
|
|
3527
3528
|
onBlur: l,
|
|
3528
3529
|
className: Ye(
|
|
3529
3530
|
"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",
|
|
@@ -3547,24 +3548,24 @@ function rt({
|
|
|
3547
3548
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3548
3549
|
ye,
|
|
3549
3550
|
{
|
|
3550
|
-
value:
|
|
3551
|
+
value: A,
|
|
3551
3552
|
onDebouncedChange: O,
|
|
3552
3553
|
placeholder: v === "server" ? `Search (min ${x})…` : "Search options…"
|
|
3553
3554
|
}
|
|
3554
3555
|
) }),
|
|
3555
3556
|
v === "server" && r && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3556
|
-
J.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: v === "server" ?
|
|
3557
|
-
const k = d(m), L =
|
|
3557
|
+
J.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: v === "server" ? A.length < x ? `Type at least ${x} characters to search.` : "No results." : "No options found." }) : J.map((m) => {
|
|
3558
|
+
const k = d(m), L = b(m), P = G.some((p) => d(p) === k), $ = f !== -1 && G.length >= f && !P;
|
|
3558
3559
|
return /* @__PURE__ */ e(
|
|
3559
3560
|
oe.Option,
|
|
3560
3561
|
{
|
|
3561
3562
|
value: m,
|
|
3562
|
-
disabled:
|
|
3563
|
+
disabled: $,
|
|
3563
3564
|
className: ({ active: p }) => Ye(
|
|
3564
|
-
|
|
3565
|
+
$ ? " text-gray-400 bg-white cursor-not-allowed" : p ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3565
3566
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3566
3567
|
),
|
|
3567
|
-
children: ({ selected: p, active:
|
|
3568
|
+
children: ({ selected: p, active: z }) => /* @__PURE__ */ n(re, { children: [
|
|
3568
3569
|
/* @__PURE__ */ e(
|
|
3569
3570
|
"span",
|
|
3570
3571
|
{
|
|
@@ -3579,7 +3580,7 @@ function rt({
|
|
|
3579
3580
|
"span",
|
|
3580
3581
|
{
|
|
3581
3582
|
className: Ye(
|
|
3582
|
-
|
|
3583
|
+
z ? " text-gray-900" : " text-gray-600",
|
|
3583
3584
|
" absolute inset-y-0 right-0 flex items-center pr-4"
|
|
3584
3585
|
),
|
|
3585
3586
|
children: /* @__PURE__ */ e(tt, { className: "w-5 h-5", "aria-hidden": "true" })
|
|
@@ -3593,7 +3594,7 @@ function rt({
|
|
|
3593
3594
|
] })
|
|
3594
3595
|
}
|
|
3595
3596
|
),
|
|
3596
|
-
o && /* @__PURE__ */ e("p", { id:
|
|
3597
|
+
o && /* @__PURE__ */ e("p", { id: T, className: "mt-1 text-sm text-red-600", children: o })
|
|
3597
3598
|
] })
|
|
3598
3599
|
] }) });
|
|
3599
3600
|
}
|
|
@@ -3649,7 +3650,7 @@ const Vl = ({
|
|
|
3649
3650
|
secondaryAction: o = { onCancel: null, label: "Cancel" },
|
|
3650
3651
|
dialogPanelClass: h = ""
|
|
3651
3652
|
}) => {
|
|
3652
|
-
const
|
|
3653
|
+
const f = (g) => {
|
|
3653
3654
|
g.target === g.currentTarget && a(!1);
|
|
3654
3655
|
}, v = (g) => {
|
|
3655
3656
|
g.stopPropagation();
|
|
@@ -3662,10 +3663,10 @@ const Vl = ({
|
|
|
3662
3663
|
className: "relative z-50 overflow-y-auto",
|
|
3663
3664
|
children: [
|
|
3664
3665
|
/* @__PURE__ */ e(
|
|
3665
|
-
|
|
3666
|
+
Gr,
|
|
3666
3667
|
{
|
|
3667
3668
|
className: "fixed inset-0 bg-black/30",
|
|
3668
|
-
onClick:
|
|
3669
|
+
onClick: f
|
|
3669
3670
|
}
|
|
3670
3671
|
),
|
|
3671
3672
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "flex min-h-full items-center justify-center p-4", children: /* @__PURE__ */ n(
|
|
@@ -3745,16 +3746,16 @@ function as({
|
|
|
3745
3746
|
onCreateChild: u,
|
|
3746
3747
|
onRename: o,
|
|
3747
3748
|
onDelete: h,
|
|
3748
|
-
renderActions:
|
|
3749
|
+
renderActions: f,
|
|
3749
3750
|
// optional override
|
|
3750
3751
|
dragId: v,
|
|
3751
3752
|
dropId: g,
|
|
3752
3753
|
indent: r = 24
|
|
3753
3754
|
}) {
|
|
3754
|
-
const { setNodeRef: x, isOver: d } = rr({ id: g }), { attributes:
|
|
3755
|
+
const { setNodeRef: x, isOver: d } = rr({ id: g }), { attributes: b, listeners: C, setNodeRef: T, transform: A, isDragging: O } = nr({ id: v }), V = A ? { transform: `translate3d(${Math.round(A.x)}px, ${Math.round(A.y)}px, 0)` } : void 0, [_, G] = B(!1), [W, J] = B(t.name), E = () => {
|
|
3755
3756
|
const F = W.trim();
|
|
3756
|
-
|
|
3757
|
-
},
|
|
3757
|
+
G(!1), F && F !== t.name ? o?.(t, F) : J(t.name);
|
|
3758
|
+
}, U = ae(() => /* @__PURE__ */ e(
|
|
3758
3759
|
Pn,
|
|
3759
3760
|
{
|
|
3760
3761
|
options: [
|
|
@@ -3763,7 +3764,7 @@ function as({
|
|
|
3763
3764
|
{ action: "delete", label: "Delete" }
|
|
3764
3765
|
],
|
|
3765
3766
|
onSelect: (m) => {
|
|
3766
|
-
m.action === "create" ? u?.(t) : m.action === "rename" ?
|
|
3767
|
+
m.action === "create" ? u?.(t) : m.action === "rename" ? G(!0) : m.action === "delete" && h?.(t);
|
|
3767
3768
|
}
|
|
3768
3769
|
}
|
|
3769
3770
|
), [t, u, h]);
|
|
@@ -3779,7 +3780,7 @@ function as({
|
|
|
3779
3780
|
children: [
|
|
3780
3781
|
/* @__PURE__ */ e("button", { className: "tv-toggle", onClick: i, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(xt, { size: 16 }) : /* @__PURE__ */ e(ve, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
|
|
3781
3782
|
/* @__PURE__ */ e(je, { size: 16, className: "tv-folder-ic" }),
|
|
3782
|
-
/* @__PURE__ */ e("div", { className: "tv-name", ref:
|
|
3783
|
+
/* @__PURE__ */ e("div", { className: "tv-name", ref: T, children: _ ? /* @__PURE__ */ e(
|
|
3783
3784
|
"input",
|
|
3784
3785
|
{
|
|
3785
3786
|
className: "tv-input",
|
|
@@ -3787,17 +3788,17 @@ function as({
|
|
|
3787
3788
|
onChange: (F) => J(F.target.value),
|
|
3788
3789
|
onBlur: E,
|
|
3789
3790
|
onKeyDown: (F) => {
|
|
3790
|
-
F.key === "Enter" && E(), F.key === "Escape" && (
|
|
3791
|
+
F.key === "Enter" && E(), F.key === "Escape" && (G(!1), J(t.name));
|
|
3791
3792
|
},
|
|
3792
3793
|
autoFocus: !0
|
|
3793
3794
|
}
|
|
3794
|
-
) : /* @__PURE__ */ e("span", { onDoubleClick: () =>
|
|
3795
|
-
/* @__PURE__ */ e(ts, { listeners: C, attributes:
|
|
3796
|
-
/* @__PURE__ */ e("div", { className: "tv-actions", children:
|
|
3795
|
+
) : /* @__PURE__ */ e("span", { onDoubleClick: () => G(!0), children: t.name }) }),
|
|
3796
|
+
/* @__PURE__ */ e(ts, { listeners: C, attributes: b }),
|
|
3797
|
+
/* @__PURE__ */ e("div", { className: "tv-actions", children: f ? f(t, {
|
|
3797
3798
|
onCreateChild: () => u?.(t),
|
|
3798
|
-
onRename: () =>
|
|
3799
|
+
onRename: () => G(!0),
|
|
3799
3800
|
onDelete: () => h?.(t)
|
|
3800
|
-
}) :
|
|
3801
|
+
}) : U })
|
|
3801
3802
|
]
|
|
3802
3803
|
}
|
|
3803
3804
|
);
|
|
@@ -3806,10 +3807,10 @@ const rs = (t) => String(t.id ?? t._id), ns = (t) => t.parent !== void 0 ? Strin
|
|
|
3806
3807
|
function is(t, { rootId: a, getId: s, getParent: i, getName: l }) {
|
|
3807
3808
|
const u = /* @__PURE__ */ new Map();
|
|
3808
3809
|
t.forEach((h) => {
|
|
3809
|
-
const
|
|
3810
|
-
u.set(
|
|
3810
|
+
const f = s(h);
|
|
3811
|
+
u.set(f, {
|
|
3811
3812
|
...h,
|
|
3812
|
-
id:
|
|
3813
|
+
id: f,
|
|
3813
3814
|
name: l(h),
|
|
3814
3815
|
parentId: i(h) || a,
|
|
3815
3816
|
children: []
|
|
@@ -3817,18 +3818,18 @@ function is(t, { rootId: a, getId: s, getParent: i, getName: l }) {
|
|
|
3817
3818
|
});
|
|
3818
3819
|
const o = [];
|
|
3819
3820
|
return u.forEach((h) => {
|
|
3820
|
-
const
|
|
3821
|
-
|
|
3821
|
+
const f = h.parentId || a;
|
|
3822
|
+
f !== a && u.has(f) ? u.get(f).children.push(h) : o.push(h);
|
|
3822
3823
|
}), { roots: o, byId: u };
|
|
3823
3824
|
}
|
|
3824
3825
|
function os(t, { rootId: a, getId: s, getName: i }) {
|
|
3825
3826
|
const l = /* @__PURE__ */ new Map();
|
|
3826
|
-
function u(h,
|
|
3827
|
+
function u(h, f) {
|
|
3827
3828
|
const v = s(h), g = {
|
|
3828
3829
|
...h,
|
|
3829
3830
|
id: v,
|
|
3830
3831
|
name: i(h),
|
|
3831
|
-
parentId:
|
|
3832
|
+
parentId: f || a,
|
|
3832
3833
|
children: (h.children || []).map((r) => u(r, v))
|
|
3833
3834
|
};
|
|
3834
3835
|
return l.set(v, g), g;
|
|
@@ -3884,98 +3885,98 @@ function jl({
|
|
|
3884
3885
|
getName: u = ss,
|
|
3885
3886
|
onSelect: o,
|
|
3886
3887
|
onCreateRoot: h,
|
|
3887
|
-
onCreateChild:
|
|
3888
|
+
onCreateChild: f,
|
|
3888
3889
|
onRename: v,
|
|
3889
3890
|
onDelete: g,
|
|
3890
3891
|
onMove: r,
|
|
3891
3892
|
renderActions: x,
|
|
3892
3893
|
disableMoveToRoot: d = !1,
|
|
3893
3894
|
// ← allow root moves by default now
|
|
3894
|
-
indentUnit:
|
|
3895
|
+
indentUnit: b = 24
|
|
3895
3896
|
}) {
|
|
3896
3897
|
const { roots: C } = ae(() => ls(t) ? os(t, { rootId: a, getId: i, getName: u }) : is(
|
|
3897
|
-
t.map((
|
|
3898
|
+
t.map(($) => ({ ...$ })),
|
|
3898
3899
|
{ rootId: a, getId: i, getParent: l, getName: u }
|
|
3899
|
-
), [t, a, i, l, u]), [
|
|
3900
|
+
), [t, a, i, l, u]), [T, A] = B({}), O = K(($) => {
|
|
3900
3901
|
const p = {};
|
|
3901
|
-
return (function
|
|
3902
|
+
return (function z(I) {
|
|
3902
3903
|
I.forEach((w) => {
|
|
3903
|
-
p[w.id] = !0, w.children?.length &&
|
|
3904
|
+
p[w.id] = !0, w.children?.length && z(w.children);
|
|
3904
3905
|
});
|
|
3905
|
-
})(
|
|
3906
|
+
})($), p;
|
|
3906
3907
|
}, []);
|
|
3907
3908
|
ne.useEffect(() => {
|
|
3908
|
-
|
|
3909
|
+
A(O(C));
|
|
3909
3910
|
}, [C, O]);
|
|
3910
3911
|
const V = K(
|
|
3911
|
-
(
|
|
3912
|
+
($) => A((p) => ({ ...p, [$]: !p[$] })),
|
|
3912
3913
|
[]
|
|
3913
|
-
), [_,
|
|
3914
|
-
ne.useEffect(() =>
|
|
3914
|
+
), [_, G] = B(() => Le(C));
|
|
3915
|
+
ne.useEffect(() => G(Le(C)), [C]);
|
|
3915
3916
|
const W = sr(
|
|
3916
3917
|
lr(dr, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
3917
|
-
), J = ge(null), [E,
|
|
3918
|
-
}, k = ({ delta:
|
|
3919
|
-
F.current =
|
|
3918
|
+
), J = ge(null), [E, U] = B(null), F = ge(0), m = () => {
|
|
3919
|
+
}, k = ({ delta: $ }) => {
|
|
3920
|
+
F.current = $?.x ?? 0;
|
|
3920
3921
|
}, L = K(
|
|
3921
|
-
({ active:
|
|
3922
|
-
const
|
|
3923
|
-
if (F.current = 0,
|
|
3924
|
-
const I = String(
|
|
3922
|
+
({ active: $, over: p }) => {
|
|
3923
|
+
const z = F.current;
|
|
3924
|
+
if (F.current = 0, U(null), !$ || !p) return;
|
|
3925
|
+
const I = String($.id).replace(/^drag-/, ""), w = String(p.id).replace(/^drop-/, "");
|
|
3925
3926
|
if (!I || !w || I === w) return;
|
|
3926
|
-
let
|
|
3927
|
-
const y = Math.max(0, Math.floor(-
|
|
3927
|
+
let S = w;
|
|
3928
|
+
const y = Math.max(0, Math.floor(-z / b));
|
|
3928
3929
|
if (y > 0) {
|
|
3929
3930
|
let q = w;
|
|
3930
3931
|
for (let X = 0; X < y; X++) {
|
|
3931
3932
|
const Y = xa(_, q, null);
|
|
3932
3933
|
if (!Y) break;
|
|
3933
3934
|
if (!Y.parentId) {
|
|
3934
|
-
|
|
3935
|
+
S = a;
|
|
3935
3936
|
break;
|
|
3936
3937
|
}
|
|
3937
|
-
|
|
3938
|
+
S = Y.parentId, q = Y.parentId;
|
|
3938
3939
|
}
|
|
3939
3940
|
}
|
|
3940
|
-
if (d &&
|
|
3941
|
-
|
|
3941
|
+
if (d && S === a) {
|
|
3942
|
+
G(Le(C));
|
|
3942
3943
|
return;
|
|
3943
3944
|
}
|
|
3944
|
-
const N = Le(_), { newRoots: R, removed:
|
|
3945
|
-
if (
|
|
3946
|
-
const M = ds(R,
|
|
3947
|
-
|
|
3945
|
+
const N = Le(_), { newRoots: R, removed: D } = cs(N, I);
|
|
3946
|
+
if (!D) return;
|
|
3947
|
+
const M = ds(R, S, D);
|
|
3948
|
+
G(M), r?.({ sourceId: I, destParentId: S, newTree: M });
|
|
3948
3949
|
},
|
|
3949
|
-
[_, C, a, d,
|
|
3950
|
+
[_, C, a, d, b, r]
|
|
3950
3951
|
), P = K(
|
|
3951
|
-
(
|
|
3952
|
+
($, p = 0) => $.map((z) => /* @__PURE__ */ n(ne.Fragment, { children: [
|
|
3952
3953
|
/* @__PURE__ */ e(
|
|
3953
3954
|
as,
|
|
3954
3955
|
{
|
|
3955
|
-
node:
|
|
3956
|
+
node: z,
|
|
3956
3957
|
depth: p,
|
|
3957
|
-
expanded: !!
|
|
3958
|
-
onToggle: () => V(
|
|
3958
|
+
expanded: !!T[z.id],
|
|
3959
|
+
onToggle: () => V(z.id),
|
|
3959
3960
|
onSelect: o,
|
|
3960
|
-
onCreateChild:
|
|
3961
|
+
onCreateChild: f,
|
|
3961
3962
|
onRename: v,
|
|
3962
3963
|
onDelete: g,
|
|
3963
3964
|
renderActions: x,
|
|
3964
|
-
dragId: `drag-${
|
|
3965
|
-
dropId: `drop-${
|
|
3966
|
-
indent:
|
|
3965
|
+
dragId: `drag-${z.id}`,
|
|
3966
|
+
dropId: `drop-${z.id}`,
|
|
3967
|
+
indent: b
|
|
3967
3968
|
}
|
|
3968
3969
|
),
|
|
3969
|
-
|
|
3970
|
-
] },
|
|
3971
|
-
[
|
|
3970
|
+
T[z.id] && z.children?.length > 0 ? P(z.children, p + 1) : null
|
|
3971
|
+
] }, z.id)),
|
|
3972
|
+
[T, b, f, g, v, o, x, V]
|
|
3972
3973
|
);
|
|
3973
3974
|
return ne.useMemo(() => {
|
|
3974
3975
|
if (!E) return null;
|
|
3975
|
-
const
|
|
3976
|
-
function p(
|
|
3977
|
-
for (const I of
|
|
3978
|
-
if (I.id ===
|
|
3976
|
+
const $ = String(E).replace(/^drag-/, "");
|
|
3977
|
+
function p(z) {
|
|
3978
|
+
for (const I of z) {
|
|
3979
|
+
if (I.id === $) return I;
|
|
3979
3980
|
const w = I.children?.length ? p(I.children) : null;
|
|
3980
3981
|
if (w) return w;
|
|
3981
3982
|
}
|
|
@@ -4020,14 +4021,14 @@ const _l = ({
|
|
|
4020
4021
|
...h
|
|
4021
4022
|
// Pass remaining props to Tab.Group
|
|
4022
4023
|
}) => {
|
|
4023
|
-
const
|
|
4024
|
+
const f = s === "vertical", v = (x) => Se(
|
|
4024
4025
|
"py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
|
|
4025
4026
|
x ? "border-primaryX text-textX" : "border-transparent text-slate-600 hover:text-indigo-700"
|
|
4026
4027
|
), g = (x) => Se(
|
|
4027
4028
|
"text-left text-sm rounded-md px-2 py-1.5 focus:outline-none",
|
|
4028
4029
|
x ? "bg-primaryX text-white" : "text-textX hover:bg-lightgray-100 hover:text-primaryX"
|
|
4029
|
-
), r = ({ selected: x }) => o ? typeof o == "function" ? o(x) : o :
|
|
4030
|
-
return /* @__PURE__ */ e(le.Group, { vertical:
|
|
4030
|
+
), r = ({ selected: x }) => o ? typeof o == "function" ? o(x) : o : f ? g(x) : v(x);
|
|
4031
|
+
return /* @__PURE__ */ e(le.Group, { vertical: f, ...h, children: f ? /* @__PURE__ */ n("div", { className: Se("flex gap-4", i), children: [
|
|
4031
4032
|
/* @__PURE__ */ e(le.List, { className: Se("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", l), children: t.map((x) => /* @__PURE__ */ e(le, { className: r, children: x.label }, x.key)) }),
|
|
4032
4033
|
/* @__PURE__ */ e(le.Panels, { unmount: !a, className: Se("flex-1", u), children: t.map((x) => /* @__PURE__ */ e(le.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: x.content }) }, x.key)) })
|
|
4033
4034
|
] }) : (
|
|
@@ -4038,31 +4039,27 @@ const _l = ({
|
|
|
4038
4039
|
] })
|
|
4039
4040
|
) });
|
|
4040
4041
|
};
|
|
4041
|
-
function
|
|
4042
|
+
function Gl(t, a = "YYYY-MM-DD HH:mm:ss") {
|
|
4042
4043
|
return t ? (t.endsWith("Z") || /[+\-]\d{2}:?\d{2}$/.test(t) ? Dt.parseZone(t) : Dt.utc(t)).local().format(a) : null;
|
|
4043
4044
|
}
|
|
4044
4045
|
c.string;
|
|
4045
4046
|
function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
4046
|
-
|
|
4047
|
-
const [l, u] = ne.useState(t), [o, h] = ne.useState(() => {
|
|
4048
|
-
const r = a && a[t.key] || {};
|
|
4049
|
-
return console.log("Initial Section data for", t.key, r), r;
|
|
4050
|
-
}), b = ge(a);
|
|
4047
|
+
const [l, u] = ne.useState(t), [o, h] = ne.useState(() => a && a[t.key] || {}), f = ge(a);
|
|
4051
4048
|
te(() => {
|
|
4052
|
-
if (
|
|
4053
|
-
|
|
4049
|
+
if (f.current !== a) {
|
|
4050
|
+
f.current = a;
|
|
4054
4051
|
const r = a && a[t.key] || {};
|
|
4055
|
-
|
|
4052
|
+
h(r);
|
|
4056
4053
|
}
|
|
4057
|
-
}, [a, t.key])
|
|
4054
|
+
}, [a, t.key]);
|
|
4058
4055
|
const v = ge(o);
|
|
4059
4056
|
te(() => {
|
|
4060
4057
|
v.current !== o && s && typeof s == "function" && (v.current = o, s(l.key, o));
|
|
4061
4058
|
}, [l.key, o, s]);
|
|
4062
4059
|
const g = (r) => {
|
|
4063
4060
|
if (!r.dependsOn) return !0;
|
|
4064
|
-
const { field: x, value: d, operator:
|
|
4065
|
-
switch (
|
|
4061
|
+
const { field: x, value: d, operator: b = "equals" } = r.dependsOn, C = o[x];
|
|
4062
|
+
switch (b) {
|
|
4066
4063
|
case "equals":
|
|
4067
4064
|
return C === d;
|
|
4068
4065
|
case "notEquals":
|
|
@@ -4104,7 +4101,7 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4104
4101
|
name: r.key,
|
|
4105
4102
|
checked: !!(o[r.key] || r.default),
|
|
4106
4103
|
onChange: (d) => {
|
|
4107
|
-
const
|
|
4104
|
+
const b = d.target ? d.target.checked : d, C = { ...o, [r.key]: b };
|
|
4108
4105
|
h(C), s && s(l.key, C);
|
|
4109
4106
|
},
|
|
4110
4107
|
label: r.label,
|
|
@@ -4159,8 +4156,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4159
4156
|
placeholder: r.placeholder,
|
|
4160
4157
|
value: o[r.key] || "",
|
|
4161
4158
|
onChange: (d) => {
|
|
4162
|
-
const
|
|
4163
|
-
h(
|
|
4159
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4160
|
+
h(b), s && s(l.key, b);
|
|
4164
4161
|
},
|
|
4165
4162
|
required: r.required,
|
|
4166
4163
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4179,8 +4176,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4179
4176
|
placeholder: r.placeholder,
|
|
4180
4177
|
value: o[r.key] || "",
|
|
4181
4178
|
onChange: (d) => {
|
|
4182
|
-
const
|
|
4183
|
-
h(
|
|
4179
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4180
|
+
h(b), s && s(l.key, b);
|
|
4184
4181
|
},
|
|
4185
4182
|
rows: 3,
|
|
4186
4183
|
required: r.required,
|
|
@@ -4204,13 +4201,13 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4204
4201
|
max: r.max,
|
|
4205
4202
|
step: r.step,
|
|
4206
4203
|
onChange: (d) => {
|
|
4207
|
-
const
|
|
4204
|
+
const b = d.target.value, C = { ...o, [r.key]: b };
|
|
4208
4205
|
h(C), s && s(l.key, C);
|
|
4209
4206
|
},
|
|
4210
4207
|
onBlur: (d) => {
|
|
4211
|
-
const
|
|
4212
|
-
if (
|
|
4213
|
-
const C = Number(
|
|
4208
|
+
const b = d.target.value;
|
|
4209
|
+
if (b !== "" && b !== null && b !== void 0) {
|
|
4210
|
+
const C = Number(b);
|
|
4214
4211
|
isNaN(C) || (r.min !== void 0 && C < r.min ? (d.target.setCustomValidity(`${r.label} must be at least ${r.min}`), d.target.reportValidity()) : r.max !== void 0 && C > r.max ? (d.target.setCustomValidity(`${r.label} must not exceed ${r.max}`), d.target.reportValidity()) : d.target.setCustomValidity(""));
|
|
4215
4212
|
}
|
|
4216
4213
|
},
|
|
@@ -4236,7 +4233,7 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4236
4233
|
name: r.key,
|
|
4237
4234
|
checked: !!(o[r.key] || r.default),
|
|
4238
4235
|
onChange: (d) => {
|
|
4239
|
-
const
|
|
4236
|
+
const b = d.target ? d.target.checked : d, C = { ...o, [r.key]: b };
|
|
4240
4237
|
h(C), s && s(l.key, C);
|
|
4241
4238
|
},
|
|
4242
4239
|
label: r.placeholder || r.label,
|
|
@@ -4254,8 +4251,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4254
4251
|
defaultValue: r.default,
|
|
4255
4252
|
value: o[r.key] || "",
|
|
4256
4253
|
onChange: (d) => {
|
|
4257
|
-
const
|
|
4258
|
-
h(
|
|
4254
|
+
const b = { ...o, [r.key]: d };
|
|
4255
|
+
h(b);
|
|
4259
4256
|
},
|
|
4260
4257
|
options: r.options || [],
|
|
4261
4258
|
placeholder: r.placeholder || `Select ${r.label}`,
|
|
@@ -4276,8 +4273,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4276
4273
|
placeholder: r.placeholder || "Enter email address",
|
|
4277
4274
|
value: o[r.key] || "",
|
|
4278
4275
|
onChange: (d) => {
|
|
4279
|
-
const
|
|
4280
|
-
h(
|
|
4276
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4277
|
+
h(b), s && s(l.key, b);
|
|
4281
4278
|
},
|
|
4282
4279
|
required: r.required,
|
|
4283
4280
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4296,8 +4293,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4296
4293
|
placeholder: r.placeholder || "Enter URL",
|
|
4297
4294
|
value: o[r.key] || "",
|
|
4298
4295
|
onChange: (d) => {
|
|
4299
|
-
const
|
|
4300
|
-
h(
|
|
4296
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4297
|
+
h(b), s && s(l.key, b);
|
|
4301
4298
|
},
|
|
4302
4299
|
required: r.required,
|
|
4303
4300
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4316,8 +4313,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4316
4313
|
placeholder: r.placeholder || "Enter password",
|
|
4317
4314
|
value: o[r.key] || "",
|
|
4318
4315
|
onChange: (d) => {
|
|
4319
|
-
const
|
|
4320
|
-
h(
|
|
4316
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4317
|
+
h(b), s && s(l.key, b);
|
|
4321
4318
|
},
|
|
4322
4319
|
required: r.required,
|
|
4323
4320
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4332,8 +4329,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4332
4329
|
{
|
|
4333
4330
|
selectedItems: o[r.key] || [],
|
|
4334
4331
|
onSelectionChange: (d) => {
|
|
4335
|
-
const
|
|
4336
|
-
h(
|
|
4332
|
+
const b = { ...o, [r.key]: d };
|
|
4333
|
+
h(b), s && s(l.key, b);
|
|
4337
4334
|
},
|
|
4338
4335
|
options: r.options || [],
|
|
4339
4336
|
placeholder: r.placeholder || `Select ${r.label}`,
|
|
@@ -4350,8 +4347,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4350
4347
|
checked: typeof o[r.key] == "boolean" ? o[r.key] : r.default,
|
|
4351
4348
|
onChange: (d) => {
|
|
4352
4349
|
console.log("Toggle changed:", r.key, d);
|
|
4353
|
-
const
|
|
4354
|
-
h(
|
|
4350
|
+
const b = { ...o, [r.key]: d };
|
|
4351
|
+
h(b), s && s(l.key, b);
|
|
4355
4352
|
},
|
|
4356
4353
|
disabled: r.disabled ? r.disabled : !1
|
|
4357
4354
|
}
|
|
@@ -4364,8 +4361,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4364
4361
|
label: r.label,
|
|
4365
4362
|
value: o[r.key] ? new Date(o[r.key]) : null,
|
|
4366
4363
|
onChange: (d) => {
|
|
4367
|
-
const
|
|
4368
|
-
h(
|
|
4364
|
+
const b = { ...o, [r.key]: d ? d.toISOString().split("T")[0] : "" };
|
|
4365
|
+
h(b), s && s(l.key, b);
|
|
4369
4366
|
},
|
|
4370
4367
|
placeholder: r.placeholder || "Select date",
|
|
4371
4368
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4379,8 +4376,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4379
4376
|
label: r.label,
|
|
4380
4377
|
value: o[r.key] || { from: null, to: null },
|
|
4381
4378
|
onChange: (d) => {
|
|
4382
|
-
const
|
|
4383
|
-
h(
|
|
4379
|
+
const b = { ...o, [r.key]: d };
|
|
4380
|
+
h(b), s && s(l.key, b);
|
|
4384
4381
|
},
|
|
4385
4382
|
placeholder: r.placeholder || "Select date range",
|
|
4386
4383
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4394,8 +4391,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4394
4391
|
{
|
|
4395
4392
|
selectedValue: typeof o[r.key] < "u" ? o[r.key] : r.default || "",
|
|
4396
4393
|
onValueChange: (d) => {
|
|
4397
|
-
const
|
|
4398
|
-
h(
|
|
4394
|
+
const b = { ...o, [r.key]: d };
|
|
4395
|
+
h(b), s && s(l.key, b);
|
|
4399
4396
|
},
|
|
4400
4397
|
options: r.options || [],
|
|
4401
4398
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4414,8 +4411,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4414
4411
|
name: r.key,
|
|
4415
4412
|
value: d.value,
|
|
4416
4413
|
checked: o[r.key] === d.value,
|
|
4417
|
-
onChange: (
|
|
4418
|
-
const C = { ...o, [r.key]:
|
|
4414
|
+
onChange: (b) => {
|
|
4415
|
+
const C = { ...o, [r.key]: b.target.value };
|
|
4419
4416
|
h(C), s && s(l.key, C);
|
|
4420
4417
|
},
|
|
4421
4418
|
disabled: r.disabled
|
|
@@ -4434,8 +4431,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4434
4431
|
{
|
|
4435
4432
|
value: o[r.key] || "",
|
|
4436
4433
|
onChange: (d) => {
|
|
4437
|
-
const
|
|
4438
|
-
h(
|
|
4434
|
+
const b = { ...o, [r.key]: d };
|
|
4435
|
+
h(b), s && s(l.key, b);
|
|
4439
4436
|
},
|
|
4440
4437
|
placeholder: r.placeholder || `Search ${r.label}`,
|
|
4441
4438
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4453,8 +4450,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4453
4450
|
placeholder: r.placeholder || "Select date and time",
|
|
4454
4451
|
value: o[r.key] || "",
|
|
4455
4452
|
onChange: (d) => {
|
|
4456
|
-
const
|
|
4457
|
-
h(
|
|
4453
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4454
|
+
h(b), s && s(l.key, b);
|
|
4458
4455
|
},
|
|
4459
4456
|
required: r.required,
|
|
4460
4457
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4472,8 +4469,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4472
4469
|
placeholder: r.placeholder || "Select time",
|
|
4473
4470
|
value: o[r.key] || "",
|
|
4474
4471
|
onChange: (d) => {
|
|
4475
|
-
const
|
|
4476
|
-
h(
|
|
4472
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4473
|
+
h(b), s && s(l.key, b);
|
|
4477
4474
|
},
|
|
4478
4475
|
required: r.required,
|
|
4479
4476
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4490,8 +4487,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4490
4487
|
defaultValue: r.default || "#000000",
|
|
4491
4488
|
value: o[r.key] || "#000000",
|
|
4492
4489
|
onChange: (d) => {
|
|
4493
|
-
const
|
|
4494
|
-
h(
|
|
4490
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4491
|
+
h(b), s && s(l.key, b);
|
|
4495
4492
|
},
|
|
4496
4493
|
className: `w-full h-10 ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
4497
4494
|
}
|
|
@@ -4507,8 +4504,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4507
4504
|
defaultValue: r.default || r.min || 0,
|
|
4508
4505
|
value: o[r.key] || r.min || 0,
|
|
4509
4506
|
onChange: (d) => {
|
|
4510
|
-
const
|
|
4511
|
-
h(
|
|
4507
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4508
|
+
h(b), s && s(l.key, b);
|
|
4512
4509
|
},
|
|
4513
4510
|
min: r.min || 0,
|
|
4514
4511
|
max: r.max || 100,
|
|
@@ -4533,7 +4530,7 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4533
4530
|
type: "file",
|
|
4534
4531
|
name: r.key,
|
|
4535
4532
|
onChange: (d) => {
|
|
4536
|
-
const
|
|
4533
|
+
const b = d.target.files[0], C = { ...o, [r.key]: b ? b.name : "" };
|
|
4537
4534
|
h(C), s && s(l.key, C);
|
|
4538
4535
|
},
|
|
4539
4536
|
accept: r.accept,
|
|
@@ -4550,8 +4547,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4550
4547
|
initialData: o[r.key] || r.initialData || [],
|
|
4551
4548
|
className: r.className || "",
|
|
4552
4549
|
onCollectionChange: (d) => {
|
|
4553
|
-
const
|
|
4554
|
-
h(
|
|
4550
|
+
const b = { ...o, [r.key]: d };
|
|
4551
|
+
h(b), s && s(l.key, b);
|
|
4555
4552
|
},
|
|
4556
4553
|
showSearch: r.showSearch !== !1,
|
|
4557
4554
|
allowAdd: r.allowAdd !== !1,
|
|
@@ -4578,54 +4575,51 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4578
4575
|
}
|
|
4579
4576
|
const us = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
4580
4577
|
function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
4581
|
-
|
|
4582
|
-
const [l, u] = B(t), [o, h] = B(null), [b, v] = B(null);
|
|
4583
|
-
console.log(`[DataTableRenderer] ${l.key} - Received props:`, { item: t, initialData: a });
|
|
4584
|
-
const [g, r] = B(() => {
|
|
4578
|
+
const [l, u] = B(t), [o, h] = B(null), [f, v] = B(null), [g, r] = B(() => {
|
|
4585
4579
|
const m = a && a[l.key] || [];
|
|
4586
4580
|
let k;
|
|
4587
4581
|
return m.length > 0 ? k = m.map((L, P) => ({
|
|
4588
4582
|
...L,
|
|
4589
4583
|
id: L.id !== void 0 ? L.id : P
|
|
4590
|
-
})) : k = [{ id: 0 }],
|
|
4584
|
+
})) : k = [{ id: 0 }], k;
|
|
4591
4585
|
}), x = ge(a), d = ge(null);
|
|
4592
4586
|
te(() => {
|
|
4593
4587
|
const m = a && a[l.key] || [], k = d.current;
|
|
4594
4588
|
if (JSON.stringify(m) !== JSON.stringify(k)) {
|
|
4595
|
-
|
|
4589
|
+
x.current = a, d.current = m;
|
|
4596
4590
|
let P;
|
|
4597
|
-
m.length > 0 ? P = m.map((
|
|
4598
|
-
|
|
4599
|
-
id:
|
|
4600
|
-
})) : P = [{ id: 0 }],
|
|
4591
|
+
m.length > 0 ? P = m.map(($, p) => ({
|
|
4592
|
+
...$,
|
|
4593
|
+
id: $.id !== void 0 ? $.id : p
|
|
4594
|
+
})) : P = [{ id: 0 }], r(P);
|
|
4601
4595
|
}
|
|
4602
4596
|
}, [a, l.key]);
|
|
4603
|
-
const
|
|
4597
|
+
const b = ge(g), C = ge(null), T = ge(!1);
|
|
4604
4598
|
te(() => {
|
|
4605
|
-
|
|
4599
|
+
b.current !== g && s && typeof s == "function" && (b.current = g, C.current && clearTimeout(C.current), T.current ? (T.current = !1, s(l.key, g)) : C.current = setTimeout(() => {
|
|
4606
4600
|
s(l.key, g);
|
|
4607
4601
|
}, 300));
|
|
4608
4602
|
}, [l.key, g, s]), te(() => () => {
|
|
4609
4603
|
C.current && clearTimeout(C.current);
|
|
4610
4604
|
}, []);
|
|
4611
|
-
const
|
|
4612
|
-
const k = (
|
|
4613
|
-
|
|
4614
|
-
const I = [...
|
|
4615
|
-
return I[
|
|
4605
|
+
const A = (m) => {
|
|
4606
|
+
const k = ($, p) => {
|
|
4607
|
+
r((z) => {
|
|
4608
|
+
const I = [...z];
|
|
4609
|
+
return I[$][m.key] = p, I;
|
|
4616
4610
|
});
|
|
4617
|
-
}, L = (
|
|
4618
|
-
const p = L(
|
|
4611
|
+
}, L = ($) => i[l.key]?.[$]?.[m.key], P = ($) => {
|
|
4612
|
+
const p = L($);
|
|
4619
4613
|
return p ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: p }) : null;
|
|
4620
4614
|
};
|
|
4621
4615
|
switch (m.fieldtype) {
|
|
4622
4616
|
case "text":
|
|
4623
|
-
return (
|
|
4617
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4624
4618
|
/* @__PURE__ */ e(
|
|
4625
4619
|
H,
|
|
4626
4620
|
{
|
|
4627
|
-
value:
|
|
4628
|
-
onChange: (
|
|
4621
|
+
value: $[m.key] || "",
|
|
4622
|
+
onChange: (z) => k(p, z.target.value),
|
|
4629
4623
|
placeholder: m.placeholder || `Enter ${m.label}`,
|
|
4630
4624
|
required: m.required,
|
|
4631
4625
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4634,12 +4628,12 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4634
4628
|
P(p)
|
|
4635
4629
|
] });
|
|
4636
4630
|
case "textarea":
|
|
4637
|
-
return (
|
|
4631
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4638
4632
|
/* @__PURE__ */ e(
|
|
4639
4633
|
da,
|
|
4640
4634
|
{
|
|
4641
|
-
value:
|
|
4642
|
-
onChange: (
|
|
4635
|
+
value: $[m.key] || "",
|
|
4636
|
+
onChange: (z) => k(p, z.target.value),
|
|
4643
4637
|
placeholder: m.placeholder || `Enter ${m.label}`,
|
|
4644
4638
|
required: m.required,
|
|
4645
4639
|
className: `w-full ${L(p) ? "border-red-500" : ""}`,
|
|
@@ -4649,21 +4643,21 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4649
4643
|
P(p)
|
|
4650
4644
|
] });
|
|
4651
4645
|
case "number":
|
|
4652
|
-
return (
|
|
4646
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4653
4647
|
/* @__PURE__ */ e(
|
|
4654
4648
|
H,
|
|
4655
4649
|
{
|
|
4656
4650
|
type: "number",
|
|
4657
|
-
value:
|
|
4651
|
+
value: $[m.key] || "",
|
|
4658
4652
|
min: m.min,
|
|
4659
4653
|
max: m.max,
|
|
4660
4654
|
step: m.step,
|
|
4661
|
-
onChange: (
|
|
4662
|
-
onBlur: (
|
|
4663
|
-
const I =
|
|
4655
|
+
onChange: (z) => k(p, z.target.value),
|
|
4656
|
+
onBlur: (z) => {
|
|
4657
|
+
const I = z.target.value;
|
|
4664
4658
|
if (I !== "" && I !== null && I !== void 0) {
|
|
4665
4659
|
const w = Number(I);
|
|
4666
|
-
isNaN(w) || (m.min !== void 0 && w < m.min ? (
|
|
4660
|
+
isNaN(w) || (m.min !== void 0 && w < m.min ? (z.target.setCustomValidity(`${m.label} must be at least ${m.min}`), z.target.reportValidity()) : m.max !== void 0 && w > m.max ? (z.target.setCustomValidity(`${m.label} must not exceed ${m.max}`), z.target.reportValidity()) : z.target.setCustomValidity(""));
|
|
4667
4661
|
}
|
|
4668
4662
|
},
|
|
4669
4663
|
placeholder: m.placeholder || `Enter ${m.label}`,
|
|
@@ -4682,13 +4676,13 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4682
4676
|
P(p)
|
|
4683
4677
|
] });
|
|
4684
4678
|
case "email":
|
|
4685
|
-
return (
|
|
4679
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4686
4680
|
/* @__PURE__ */ e(
|
|
4687
4681
|
H,
|
|
4688
4682
|
{
|
|
4689
4683
|
type: "email",
|
|
4690
|
-
value:
|
|
4691
|
-
onChange: (
|
|
4684
|
+
value: $[m.key] || "",
|
|
4685
|
+
onChange: (z) => k(p, z.target.value),
|
|
4692
4686
|
placeholder: m.placeholder || "Enter email address",
|
|
4693
4687
|
required: m.required,
|
|
4694
4688
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4697,13 +4691,13 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4697
4691
|
P(p)
|
|
4698
4692
|
] });
|
|
4699
4693
|
case "url":
|
|
4700
|
-
return (
|
|
4694
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4701
4695
|
/* @__PURE__ */ e(
|
|
4702
4696
|
H,
|
|
4703
4697
|
{
|
|
4704
4698
|
type: "url",
|
|
4705
|
-
value:
|
|
4706
|
-
onChange: (
|
|
4699
|
+
value: $[m.key] || "",
|
|
4700
|
+
onChange: (z) => k(p, z.target.value),
|
|
4707
4701
|
placeholder: m.placeholder || "Enter URL",
|
|
4708
4702
|
required: m.required,
|
|
4709
4703
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4712,13 +4706,13 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4712
4706
|
P(p)
|
|
4713
4707
|
] });
|
|
4714
4708
|
case "password":
|
|
4715
|
-
return (
|
|
4709
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4716
4710
|
/* @__PURE__ */ e(
|
|
4717
4711
|
H,
|
|
4718
4712
|
{
|
|
4719
4713
|
type: "password",
|
|
4720
|
-
value:
|
|
4721
|
-
onChange: (
|
|
4714
|
+
value: $[m.key] || "",
|
|
4715
|
+
onChange: (z) => k(p, z.target.value),
|
|
4722
4716
|
placeholder: m.placeholder || "Enter password",
|
|
4723
4717
|
required: m.required,
|
|
4724
4718
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4728,12 +4722,12 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4728
4722
|
] });
|
|
4729
4723
|
case "select":
|
|
4730
4724
|
case "dropdown":
|
|
4731
|
-
return (
|
|
4725
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4732
4726
|
/* @__PURE__ */ e(
|
|
4733
4727
|
gt,
|
|
4734
4728
|
{
|
|
4735
|
-
value:
|
|
4736
|
-
onChange: (
|
|
4729
|
+
value: $[m.key] || "",
|
|
4730
|
+
onChange: (z) => k(p, z),
|
|
4737
4731
|
options: m.options || [],
|
|
4738
4732
|
placeholder: m.placeholder || `Select ${m.label}`,
|
|
4739
4733
|
required: m.required,
|
|
@@ -4743,15 +4737,15 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4743
4737
|
P(p)
|
|
4744
4738
|
] });
|
|
4745
4739
|
case "selectDynamic":
|
|
4746
|
-
return (
|
|
4747
|
-
const
|
|
4740
|
+
return ($, p) => {
|
|
4741
|
+
const z = () => {
|
|
4748
4742
|
if (m.optionsFrom && a) {
|
|
4749
|
-
const { config: I, valueField: w, labelField:
|
|
4743
|
+
const { config: I, valueField: w, labelField: S } = m.optionsFrom, y = a[I] || [];
|
|
4750
4744
|
if (Array.isArray(y))
|
|
4751
4745
|
return y.map((N) => ({
|
|
4752
4746
|
id: N[w] || "",
|
|
4753
4747
|
value: N[w] || "",
|
|
4754
|
-
label: N[
|
|
4748
|
+
label: N[S] || ""
|
|
4755
4749
|
}));
|
|
4756
4750
|
}
|
|
4757
4751
|
return m.options || [];
|
|
@@ -4761,9 +4755,9 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4761
4755
|
gt,
|
|
4762
4756
|
{
|
|
4763
4757
|
index: p,
|
|
4764
|
-
value:
|
|
4758
|
+
value: $[m.key] || "",
|
|
4765
4759
|
onChange: (I) => k(p, I),
|
|
4766
|
-
options:
|
|
4760
|
+
options: z(),
|
|
4767
4761
|
placeholder: m.placeholder || `Select ${m.label}`,
|
|
4768
4762
|
required: m.required,
|
|
4769
4763
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4774,12 +4768,12 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4774
4768
|
] });
|
|
4775
4769
|
};
|
|
4776
4770
|
case "multiselect":
|
|
4777
|
-
return (
|
|
4778
|
-
const
|
|
4771
|
+
return ($, p) => {
|
|
4772
|
+
const z = $[m.key] || [];
|
|
4779
4773
|
return /* @__PURE__ */ e(
|
|
4780
4774
|
rt,
|
|
4781
4775
|
{
|
|
4782
|
-
selectedItems:
|
|
4776
|
+
selectedItems: z,
|
|
4783
4777
|
onSelectionChange: (I) => k(p, I),
|
|
4784
4778
|
options: m.options || [],
|
|
4785
4779
|
placeholder: m.placeholder || `Select ${m.label}`,
|
|
@@ -4789,96 +4783,96 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4789
4783
|
};
|
|
4790
4784
|
case "checkbox":
|
|
4791
4785
|
case "boolean":
|
|
4792
|
-
return (
|
|
4786
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4793
4787
|
ut,
|
|
4794
4788
|
{
|
|
4795
|
-
checked:
|
|
4796
|
-
onChange: (
|
|
4789
|
+
checked: !!$[m.key],
|
|
4790
|
+
onChange: (z) => k(p, z),
|
|
4797
4791
|
label: m.placeholder || m.label,
|
|
4798
4792
|
className: "w-full"
|
|
4799
4793
|
}
|
|
4800
4794
|
);
|
|
4801
4795
|
case "toggle":
|
|
4802
4796
|
case "switch":
|
|
4803
|
-
return (
|
|
4797
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4804
4798
|
ma,
|
|
4805
4799
|
{
|
|
4806
|
-
isOn:
|
|
4807
|
-
onToggle: (
|
|
4800
|
+
isOn: !!$[m.key],
|
|
4801
|
+
onToggle: (z) => k(p, z),
|
|
4808
4802
|
label: m.placeholder || m.label,
|
|
4809
4803
|
className: "w-full"
|
|
4810
4804
|
}
|
|
4811
4805
|
);
|
|
4812
4806
|
case "date":
|
|
4813
|
-
return (
|
|
4807
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4814
4808
|
la,
|
|
4815
4809
|
{
|
|
4816
|
-
selectedDate:
|
|
4817
|
-
onDateChange: (
|
|
4810
|
+
selectedDate: $[m.key] ? new Date($[m.key]) : null,
|
|
4811
|
+
onDateChange: (z) => k(p, z ? z.toISOString().split("T")[0] : ""),
|
|
4818
4812
|
placeholder: m.placeholder || "Select date",
|
|
4819
4813
|
className: "w-full"
|
|
4820
4814
|
}
|
|
4821
4815
|
);
|
|
4822
4816
|
case "datetime":
|
|
4823
|
-
return (
|
|
4817
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4824
4818
|
H,
|
|
4825
4819
|
{
|
|
4826
4820
|
type: "datetime-local",
|
|
4827
|
-
value:
|
|
4828
|
-
onChange: (
|
|
4821
|
+
value: $[m.key] || "",
|
|
4822
|
+
onChange: (z) => k(p, z.target.value),
|
|
4829
4823
|
placeholder: m.placeholder || "Select date and time",
|
|
4830
4824
|
required: m.required,
|
|
4831
4825
|
className: "w-full"
|
|
4832
4826
|
}
|
|
4833
4827
|
);
|
|
4834
4828
|
case "time":
|
|
4835
|
-
return (
|
|
4829
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4836
4830
|
H,
|
|
4837
4831
|
{
|
|
4838
4832
|
type: "time",
|
|
4839
|
-
value:
|
|
4840
|
-
onChange: (
|
|
4833
|
+
value: $[m.key] || "",
|
|
4834
|
+
onChange: (z) => k(p, z.target.value),
|
|
4841
4835
|
placeholder: m.placeholder || "Select time",
|
|
4842
4836
|
required: m.required,
|
|
4843
4837
|
className: "w-full"
|
|
4844
4838
|
}
|
|
4845
4839
|
);
|
|
4846
4840
|
case "radio":
|
|
4847
|
-
return (
|
|
4841
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4848
4842
|
ia,
|
|
4849
4843
|
{
|
|
4850
|
-
selectedValue:
|
|
4851
|
-
onValueChange: (
|
|
4844
|
+
selectedValue: $[m.key] || "",
|
|
4845
|
+
onValueChange: (z) => k(p, z),
|
|
4852
4846
|
options: m.options || [],
|
|
4853
4847
|
className: "w-full"
|
|
4854
4848
|
}
|
|
4855
4849
|
);
|
|
4856
4850
|
case "search":
|
|
4857
|
-
return (
|
|
4851
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4858
4852
|
ye,
|
|
4859
4853
|
{
|
|
4860
|
-
value:
|
|
4861
|
-
onChange: (
|
|
4854
|
+
value: $[m.key] || "",
|
|
4855
|
+
onChange: (z) => k(p, z),
|
|
4862
4856
|
placeholder: m.placeholder || `Search ${m.label}`,
|
|
4863
4857
|
className: "w-full"
|
|
4864
4858
|
}
|
|
4865
4859
|
);
|
|
4866
4860
|
case "audience":
|
|
4867
|
-
return (
|
|
4868
|
-
const
|
|
4869
|
-
...
|
|
4870
|
-
...
|
|
4871
|
-
...
|
|
4861
|
+
return ($, p) => {
|
|
4862
|
+
const z = $[m.key] || { users: [], groups: [], roles: [] }, I = [
|
|
4863
|
+
...z.users || [],
|
|
4864
|
+
...z.groups || [],
|
|
4865
|
+
...z.roles || []
|
|
4872
4866
|
];
|
|
4873
4867
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
4874
|
-
/* @__PURE__ */ e(us, { children: I.length > 0 ? I.slice(0, 3).map((w,
|
|
4868
|
+
/* @__PURE__ */ e(us, { children: I.length > 0 ? I.slice(0, 3).map((w, S) => /* @__PURE__ */ e(
|
|
4875
4869
|
we,
|
|
4876
4870
|
{
|
|
4877
4871
|
size: "small",
|
|
4878
4872
|
name: w.name || w.displayName || w.id,
|
|
4879
4873
|
src: w.avatarUrl
|
|
4880
4874
|
},
|
|
4881
|
-
|
|
4875
|
+
S
|
|
4882
4876
|
)) : null }),
|
|
4883
4877
|
/* @__PURE__ */ e(
|
|
4884
4878
|
"button",
|
|
@@ -4893,38 +4887,38 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4893
4887
|
] });
|
|
4894
4888
|
};
|
|
4895
4889
|
case "color":
|
|
4896
|
-
return (
|
|
4890
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4897
4891
|
H,
|
|
4898
4892
|
{
|
|
4899
4893
|
type: "color",
|
|
4900
|
-
value:
|
|
4901
|
-
onChange: (
|
|
4894
|
+
value: $[m.key] || "#000000",
|
|
4895
|
+
onChange: (z) => k(p, z.target.value),
|
|
4902
4896
|
className: "w-full h-10"
|
|
4903
4897
|
}
|
|
4904
4898
|
);
|
|
4905
4899
|
case "range":
|
|
4906
|
-
return (
|
|
4900
|
+
return ($, p) => /* @__PURE__ */ n("div", { className: "w-full", children: [
|
|
4907
4901
|
/* @__PURE__ */ e(
|
|
4908
4902
|
H,
|
|
4909
4903
|
{
|
|
4910
4904
|
type: "range",
|
|
4911
|
-
value:
|
|
4912
|
-
onChange: (
|
|
4905
|
+
value: $[m.key] || m.min || 0,
|
|
4906
|
+
onChange: (z) => k(p, z.target.value),
|
|
4913
4907
|
min: m.min || 0,
|
|
4914
4908
|
max: m.max || 100,
|
|
4915
4909
|
step: m.step || 1,
|
|
4916
4910
|
className: "w-full"
|
|
4917
4911
|
}
|
|
4918
4912
|
),
|
|
4919
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children:
|
|
4913
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: $[m.key] || m.min || 0 })
|
|
4920
4914
|
] });
|
|
4921
4915
|
case "file":
|
|
4922
|
-
return (
|
|
4916
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4923
4917
|
H,
|
|
4924
4918
|
{
|
|
4925
4919
|
type: "file",
|
|
4926
|
-
onChange: (
|
|
4927
|
-
const I =
|
|
4920
|
+
onChange: (z) => {
|
|
4921
|
+
const I = z.target.files[0];
|
|
4928
4922
|
k(p, I ? I.name : "");
|
|
4929
4923
|
},
|
|
4930
4924
|
accept: m.accept,
|
|
@@ -4932,22 +4926,22 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4932
4926
|
}
|
|
4933
4927
|
);
|
|
4934
4928
|
case "hidden":
|
|
4935
|
-
return (
|
|
4929
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4936
4930
|
H,
|
|
4937
4931
|
{
|
|
4938
4932
|
type: "hidden",
|
|
4939
|
-
value:
|
|
4940
|
-
onChange: (
|
|
4933
|
+
value: $[m.key] || "",
|
|
4934
|
+
onChange: (z) => k(p, z.target.value)
|
|
4941
4935
|
}
|
|
4942
4936
|
);
|
|
4943
4937
|
// Default fallback for unknown field types
|
|
4944
4938
|
default:
|
|
4945
|
-
return (
|
|
4939
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4946
4940
|
/* @__PURE__ */ e(
|
|
4947
4941
|
H,
|
|
4948
4942
|
{
|
|
4949
|
-
value:
|
|
4950
|
-
onChange: (
|
|
4943
|
+
value: $[m.key] || "",
|
|
4944
|
+
onChange: (z) => k(p, z.target.value),
|
|
4951
4945
|
placeholder: m.placeholder || `Enter ${m.label}`,
|
|
4952
4946
|
required: m.required,
|
|
4953
4947
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4957,17 +4951,14 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4957
4951
|
] });
|
|
4958
4952
|
}
|
|
4959
4953
|
}, O = K(() => {
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
id: L
|
|
4954
|
+
r((m) => {
|
|
4955
|
+
const P = {
|
|
4956
|
+
id: (m.length > 0 ? Math.max(...m.map((p) => p.id || 0)) : -1) + 1
|
|
4964
4957
|
// Assign unique incremental ID
|
|
4965
4958
|
};
|
|
4966
|
-
l.fields.forEach((p) => {
|
|
4959
|
+
return l.fields.forEach((p) => {
|
|
4967
4960
|
p.fieldtype === "audience" ? P[p.key] = { users: [], groups: [], roles: [] } : P[p.key] = p.default || "";
|
|
4968
|
-
}),
|
|
4969
|
-
const D = [...m, P];
|
|
4970
|
-
return console.log("[DataTableRenderer] Updated data:", D), D;
|
|
4961
|
+
}), [...m, P];
|
|
4971
4962
|
});
|
|
4972
4963
|
}, [l.fields]), V = K((m) => {
|
|
4973
4964
|
r((k) => {
|
|
@@ -4976,40 +4967,39 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4976
4967
|
const L = [...k];
|
|
4977
4968
|
return L.splice(m, 1), L;
|
|
4978
4969
|
});
|
|
4979
|
-
}, []), [_,
|
|
4980
|
-
|
|
4970
|
+
}, []), [_, G] = B(null), W = K((m, k) => {
|
|
4971
|
+
G(k), m.dataTransfer.effectAllowed = "move", m.dataTransfer.setData("text/html", "");
|
|
4981
4972
|
}, []), J = K((m) => {
|
|
4982
4973
|
m.preventDefault(), m.dataTransfer.dropEffect = "move";
|
|
4983
4974
|
}, []), E = K((m, k) => {
|
|
4984
4975
|
m.preventDefault(), !(_ === null || _ === k) && (r((L) => {
|
|
4985
|
-
const P = [...L],
|
|
4986
|
-
return P.splice(_, 1), P.splice(k, 0,
|
|
4987
|
-
}),
|
|
4988
|
-
}, [_]),
|
|
4989
|
-
|
|
4976
|
+
const P = [...L], $ = P[_];
|
|
4977
|
+
return P.splice(_, 1), P.splice(k, 0, $), P;
|
|
4978
|
+
}), G(null));
|
|
4979
|
+
}, [_]), U = K(() => {
|
|
4980
|
+
G(null);
|
|
4990
4981
|
}, []), F = K((m, k) => {
|
|
4991
|
-
|
|
4992
|
-
const
|
|
4993
|
-
if (o !== null &&
|
|
4982
|
+
r((P) => {
|
|
4983
|
+
const $ = [...P];
|
|
4984
|
+
if (o !== null && f && $[o]) {
|
|
4994
4985
|
const p = m?.pendingInvites || [];
|
|
4995
4986
|
if (p.length > 0) {
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
} else k && (console.log("[DataTableRenderer] Updating audience from ManageFlow with existing shares:", k), D[o][b] = {
|
|
4987
|
+
const z = p.filter((y) => y.type === "User"), I = p.filter((y) => y.type === "Group"), w = p.filter((y) => y.type === "Role"), S = $[o][f] || { users: [], groups: [], roles: [] };
|
|
4988
|
+
$[o][f] = {
|
|
4989
|
+
users: [...S.users || [], ...z],
|
|
4990
|
+
groups: [...S.groups || [], ...I],
|
|
4991
|
+
roles: [...S.roles || [], ...w]
|
|
4992
|
+
};
|
|
4993
|
+
} else k && ($[o][f] = {
|
|
5004
4994
|
users: k.users || [],
|
|
5005
4995
|
groups: k.groups || [],
|
|
5006
4996
|
roles: k.roles || []
|
|
5007
|
-
}
|
|
5008
|
-
|
|
4997
|
+
});
|
|
4998
|
+
T.current = !0;
|
|
5009
4999
|
}
|
|
5010
|
-
return
|
|
5000
|
+
return $;
|
|
5011
5001
|
}), (m?.pendingInvites || []).length > 0 && (h(null), v(null));
|
|
5012
|
-
}, [o,
|
|
5002
|
+
}, [o, f, s]);
|
|
5013
5003
|
return /* @__PURE__ */ n("div", { children: [
|
|
5014
5004
|
/* @__PURE__ */ n("div", { style: { marginBottom: "20px" }, children: [
|
|
5015
5005
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5046,10 +5036,10 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5046
5036
|
onDragStart: (L) => W(L, k),
|
|
5047
5037
|
onDragOver: J,
|
|
5048
5038
|
onDrop: (L) => E(L, k),
|
|
5049
|
-
onDragEnd:
|
|
5039
|
+
onDragEnd: U,
|
|
5050
5040
|
children: [
|
|
5051
5041
|
/* @__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(vt, { size: 16 }) }) }),
|
|
5052
|
-
l.fields.map((L, P) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children:
|
|
5042
|
+
l.fields.map((L, P) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: A(L)(m, k) }, P)),
|
|
5053
5043
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
5054
5044
|
"button",
|
|
5055
5045
|
{
|
|
@@ -5065,12 +5055,12 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5065
5055
|
)) })
|
|
5066
5056
|
] }) }),
|
|
5067
5057
|
o !== null && (() => {
|
|
5068
|
-
const m = g[o] && g[o][
|
|
5069
|
-
users: g[o][
|
|
5070
|
-
groups: g[o][
|
|
5071
|
-
roles: g[o][
|
|
5058
|
+
const m = g[o] && g[o][f] ? {
|
|
5059
|
+
users: g[o][f].users || [],
|
|
5060
|
+
groups: g[o][f].groups || [],
|
|
5061
|
+
roles: g[o][f].roles || []
|
|
5072
5062
|
} : { users: [], groups: [], roles: [] };
|
|
5073
|
-
return
|
|
5063
|
+
return /* @__PURE__ */ e(
|
|
5074
5064
|
es,
|
|
5075
5065
|
{
|
|
5076
5066
|
isOpen: !0,
|
|
@@ -5109,19 +5099,19 @@ function fs({
|
|
|
5109
5099
|
widgetId: o,
|
|
5110
5100
|
mode: h = "app"
|
|
5111
5101
|
}) {
|
|
5112
|
-
const [
|
|
5102
|
+
const [f, v] = ne.useState(a), [g, r] = ne.useState(null), [x, d] = ne.useState(null), [b, C] = B(!1), [T, A] = B(!1), [O, V] = B({}), _ = `${Ce()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, G = `${Ce()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration?widgetid=${o}`, W = h === "widget" ? G : _, J = W, [E, U] = B(1), F = () => {
|
|
5113
5103
|
if (!x || !g)
|
|
5114
|
-
return
|
|
5104
|
+
return !1;
|
|
5115
5105
|
const w = (R) => {
|
|
5116
5106
|
if (R == null || typeof R != "object") return R;
|
|
5117
5107
|
if (Array.isArray(R)) return R.map(w);
|
|
5118
|
-
const
|
|
5108
|
+
const D = {};
|
|
5119
5109
|
return Object.keys(R).sort().forEach((M) => {
|
|
5120
|
-
|
|
5121
|
-
}),
|
|
5122
|
-
},
|
|
5110
|
+
D[M] = w(R[M]);
|
|
5111
|
+
}), D;
|
|
5112
|
+
}, S = w(x), y = w(g), N = JSON.stringify(S) !== JSON.stringify(y);
|
|
5123
5113
|
return console.log("[DynamicConfig] hasUnsavedChanges:", N, {
|
|
5124
|
-
originalData:
|
|
5114
|
+
originalData: S,
|
|
5125
5115
|
currentData: y,
|
|
5126
5116
|
originalRaw: x,
|
|
5127
5117
|
currentRaw: g
|
|
@@ -5129,10 +5119,10 @@ function fs({
|
|
|
5129
5119
|
}, m = (w) => {
|
|
5130
5120
|
if (!a || !a.configuration)
|
|
5131
5121
|
return w;
|
|
5132
|
-
const
|
|
5122
|
+
const S = {}, y = w?.configuration || {};
|
|
5133
5123
|
return a.configuration.forEach((N) => {
|
|
5134
5124
|
if (N.key && N.type === "datatable") {
|
|
5135
|
-
const
|
|
5125
|
+
const D = (y[N.key] || []).map((M, q) => {
|
|
5136
5126
|
const X = { id: M.id || 0 };
|
|
5137
5127
|
return N.fields && N.fields.forEach((Y) => {
|
|
5138
5128
|
if (Y.fieldtype === "audience") {
|
|
@@ -5145,37 +5135,37 @@ function fs({
|
|
|
5145
5135
|
} else Y.fieldtype === "select" ? X[Y.key] = M[Y.key] !== void 0 && M[Y.key] !== "" ? M[Y.key] : Y.default || "" : X[Y.key] = M[Y.key] || Y.default || "";
|
|
5146
5136
|
}), X;
|
|
5147
5137
|
});
|
|
5148
|
-
if (
|
|
5138
|
+
if (D.length === 0) {
|
|
5149
5139
|
const M = { id: 0 };
|
|
5150
5140
|
N.fields && N.fields.forEach((q) => {
|
|
5151
5141
|
q.fieldtype === "audience" ? M[q.key] = { users: [], groups: [], roles: [] } : M[q.key] = q.default || "";
|
|
5152
|
-
}),
|
|
5142
|
+
}), D.push(M);
|
|
5153
5143
|
}
|
|
5154
|
-
|
|
5144
|
+
S[N.key] = D;
|
|
5155
5145
|
} else if (N.key) {
|
|
5156
5146
|
const R = y[N.key] || {};
|
|
5157
|
-
N.type === "section" && N.fields && N.fields.forEach((
|
|
5158
|
-
|
|
5159
|
-
}),
|
|
5147
|
+
N.type === "section" && N.fields && N.fields.forEach((D) => {
|
|
5148
|
+
D.fieldtype === "managecollectionlist" && D.key && (!R[D.key] || !Array.isArray(R[D.key])) && (R[D.key] = D.initialData || []);
|
|
5149
|
+
}), S[N.key] = R;
|
|
5160
5150
|
}
|
|
5161
|
-
}),
|
|
5151
|
+
}), S;
|
|
5162
5152
|
}, k = () => {
|
|
5163
5153
|
if (a && a.configuration) {
|
|
5164
5154
|
const w = {};
|
|
5165
|
-
a.configuration.forEach((
|
|
5166
|
-
if (
|
|
5167
|
-
if (
|
|
5155
|
+
a.configuration.forEach((S) => {
|
|
5156
|
+
if (S.key)
|
|
5157
|
+
if (S.type === "datatable") {
|
|
5168
5158
|
const y = { id: 0 };
|
|
5169
|
-
|
|
5159
|
+
S.fields && S.fields.forEach((N) => {
|
|
5170
5160
|
N.fieldtype === "audience" ? y[N.key] = { users: [], groups: [], roles: [] } : (N.fieldtype, y[N.key] = N.default || "");
|
|
5171
|
-
}), w[
|
|
5172
|
-
} else if (
|
|
5161
|
+
}), w[S.key] = [y];
|
|
5162
|
+
} else if (S.type === "section") {
|
|
5173
5163
|
const y = {};
|
|
5174
|
-
|
|
5164
|
+
S.fields && Array.isArray(S.fields) && S.fields.forEach((N) => {
|
|
5175
5165
|
N.key && (N.fieldtype === "managecollectionlist" ? y[N.key] = N.initialData || [] : y[N.key] = N.default || "");
|
|
5176
|
-
}), w[
|
|
5166
|
+
}), w[S.key] = y;
|
|
5177
5167
|
} else
|
|
5178
|
-
w[
|
|
5168
|
+
w[S.key] = {};
|
|
5179
5169
|
}), r(w), d(w);
|
|
5180
5170
|
}
|
|
5181
5171
|
};
|
|
@@ -5187,19 +5177,19 @@ function fs({
|
|
|
5187
5177
|
const w = async () => {
|
|
5188
5178
|
try {
|
|
5189
5179
|
C(!0);
|
|
5190
|
-
let
|
|
5191
|
-
if (
|
|
5192
|
-
const y = m(
|
|
5180
|
+
let S = await Ke(W);
|
|
5181
|
+
if (S) {
|
|
5182
|
+
const y = m(S);
|
|
5193
5183
|
r(y), d(y);
|
|
5194
5184
|
} else
|
|
5195
5185
|
k();
|
|
5196
|
-
} catch (
|
|
5197
|
-
console.error("Error fetching configuration:",
|
|
5186
|
+
} catch (S) {
|
|
5187
|
+
console.error("Error fetching configuration:", S);
|
|
5198
5188
|
let y = "Failed to load configuration";
|
|
5199
|
-
if (
|
|
5200
|
-
const N =
|
|
5189
|
+
if (S.response) {
|
|
5190
|
+
const N = S.response.status, R = S.response.data?.message || S.response.data?.error;
|
|
5201
5191
|
N === 400 ? y = R || "Invalid request. Please check the application ID." : N === 401 ? y = "You are not authorized to access this configuration." : N === 403 ? y = "Access denied. You don't have permission to view this configuration." : N === 404 ? y = "Configuration not found. It may not exist yet or the application ID is incorrect." : N >= 500 ? y = R || "Server error. Please try again later." : y = R || `Failed to load configuration (Error ${N})`;
|
|
5202
|
-
} else
|
|
5192
|
+
} else S.request ? y = "Network error. Please check your connection and try again." : y = S.message || "An unexpected error occurred while loading configuration.";
|
|
5203
5193
|
We.error(y), k();
|
|
5204
5194
|
} finally {
|
|
5205
5195
|
C(!1);
|
|
@@ -5207,62 +5197,56 @@ function fs({
|
|
|
5207
5197
|
};
|
|
5208
5198
|
a && (v(a), t ? w() : k());
|
|
5209
5199
|
}, [a, E, t, s]);
|
|
5210
|
-
const L = (w,
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
};
|
|
5216
|
-
return console.log("[DynamicConfig] Updated data state:", N), N;
|
|
5217
|
-
}), V((y) => {
|
|
5200
|
+
const L = (w, S) => {
|
|
5201
|
+
r((y) => ({
|
|
5202
|
+
...y,
|
|
5203
|
+
[w]: S
|
|
5204
|
+
})), V((y) => {
|
|
5218
5205
|
const N = { ...y };
|
|
5219
5206
|
return N[w] && delete N[w], N;
|
|
5220
5207
|
});
|
|
5221
5208
|
}, P = () => {
|
|
5222
5209
|
const w = {};
|
|
5223
|
-
return !
|
|
5224
|
-
if (
|
|
5225
|
-
|
|
5226
|
-
const N = g[
|
|
5210
|
+
return !f || !g || f.configuration.forEach((S) => {
|
|
5211
|
+
if (S.type === "section")
|
|
5212
|
+
S.fields.forEach((y) => {
|
|
5213
|
+
const N = g[S.key]?.[y.key];
|
|
5227
5214
|
if (y.required && (!N || typeof N == "string" && N.trim() === "")) {
|
|
5228
|
-
w[
|
|
5215
|
+
w[S.key] || (w[S.key] = {}), w[S.key][y.key] = `${y.label} is required`;
|
|
5229
5216
|
return;
|
|
5230
5217
|
}
|
|
5231
5218
|
if (y.fieldtype === "number" && N !== "" && N !== null && N !== void 0) {
|
|
5232
5219
|
const R = Number(N);
|
|
5233
|
-
isNaN(R) ? (w[
|
|
5220
|
+
isNaN(R) ? (w[S.key] || (w[S.key] = {}), w[S.key][y.key] = `${y.label} must be a valid number`) : (y.min !== void 0 && R < y.min && (w[S.key] || (w[S.key] = {}), w[S.key][y.key] = `${y.label} must be at least ${y.min}`), y.max !== void 0 && R > y.max && (w[S.key] || (w[S.key] = {}), w[S.key][y.key] = `${y.label} must not exceed ${y.max}`));
|
|
5234
5221
|
}
|
|
5235
5222
|
});
|
|
5236
|
-
else if (
|
|
5237
|
-
const y = g[
|
|
5223
|
+
else if (S.type === "datatable") {
|
|
5224
|
+
const y = g[S.key];
|
|
5238
5225
|
Array.isArray(y) && y.forEach((N, R) => {
|
|
5239
|
-
|
|
5240
|
-
const M = N[
|
|
5241
|
-
if (
|
|
5242
|
-
w[
|
|
5226
|
+
S.fields.forEach((D) => {
|
|
5227
|
+
const M = N[D.key];
|
|
5228
|
+
if (D.required && (!M || typeof M == "string" && M.trim() === "")) {
|
|
5229
|
+
w[S.key] || (w[S.key] = {}), w[S.key][R] || (w[S.key][R] = {}), w[S.key][R][D.key] = `${D.label} is required`;
|
|
5243
5230
|
return;
|
|
5244
5231
|
}
|
|
5245
|
-
if (
|
|
5232
|
+
if (D.fieldtype === "number" && M !== "" && M !== null && M !== void 0) {
|
|
5246
5233
|
const q = Number(M);
|
|
5247
|
-
isNaN(q) ? (w[
|
|
5234
|
+
isNaN(q) ? (w[S.key] || (w[S.key] = {}), w[S.key][R] || (w[S.key][R] = {}), w[S.key][R][D.key] = `${D.label} must be a valid number`) : (D.min !== void 0 && q < D.min && (w[S.key] || (w[S.key] = {}), w[S.key][R] || (w[S.key][R] = {}), w[S.key][R][D.key] = `${D.label} must be at least ${D.min}`), D.max !== void 0 && q > D.max && (w[S.key] || (w[S.key] = {}), w[S.key][R] || (w[S.key][R] = {}), w[S.key][R][D.key] = `${D.label} must not exceed ${D.max}`));
|
|
5248
5235
|
}
|
|
5249
5236
|
});
|
|
5250
5237
|
});
|
|
5251
5238
|
}
|
|
5252
5239
|
}), w;
|
|
5253
|
-
},
|
|
5254
|
-
if (
|
|
5255
|
-
console.log("[handleSave] Already saving, ignoring duplicate call");
|
|
5240
|
+
}, $ = (w) => Object.keys(w).length > 0, p = () => {
|
|
5241
|
+
if (T)
|
|
5256
5242
|
return;
|
|
5257
|
-
}
|
|
5258
|
-
console.log("[handleSave] Starting save process");
|
|
5259
5243
|
const w = P();
|
|
5260
|
-
if (V(w),
|
|
5244
|
+
if (V(w), $(w)) {
|
|
5261
5245
|
let y = [];
|
|
5262
5246
|
Object.keys(w).forEach((N) => {
|
|
5263
5247
|
typeof w[N] == "object" && Object.keys(w[N]).forEach((R) => {
|
|
5264
|
-
typeof w[N][R] == "object" ? Object.keys(w[N][R]).forEach((
|
|
5265
|
-
y.push(`${N} row ${parseInt(R) + 1}: ${w[N][R][
|
|
5248
|
+
typeof w[N][R] == "object" ? Object.keys(w[N][R]).forEach((D) => {
|
|
5249
|
+
y.push(`${N} row ${parseInt(R) + 1}: ${w[N][R][D]}`);
|
|
5266
5250
|
}) : y.push(`${N}: ${w[N][R]}`);
|
|
5267
5251
|
});
|
|
5268
5252
|
});
|
|
@@ -5270,15 +5254,15 @@ function fs({
|
|
|
5270
5254
|
}
|
|
5271
5255
|
(async () => {
|
|
5272
5256
|
try {
|
|
5273
|
-
|
|
5257
|
+
A(!0);
|
|
5274
5258
|
const y = {};
|
|
5275
5259
|
g && Object.keys(g).forEach((R) => {
|
|
5276
|
-
const
|
|
5260
|
+
const D = a?.configuration?.find(
|
|
5277
5261
|
(M) => M.key === R && M.type === "datatable"
|
|
5278
5262
|
);
|
|
5279
|
-
|
|
5263
|
+
D && Array.isArray(g[R]) ? y[R] = g[R].map((M) => {
|
|
5280
5264
|
const q = { id: M.id || 0 };
|
|
5281
|
-
return
|
|
5265
|
+
return D.fields && D.fields.forEach((X) => {
|
|
5282
5266
|
if (X.fieldtype === "audience") {
|
|
5283
5267
|
let Y = { users: [], groups: [], roles: [] };
|
|
5284
5268
|
M[X.key] && typeof M[X.key] == "object" && !Array.isArray(M[X.key]) && (Y = {
|
|
@@ -5301,15 +5285,15 @@ function fs({
|
|
|
5301
5285
|
} catch (y) {
|
|
5302
5286
|
console.error("Error saving configuration:", y), We.error(y?.message || "Failed to save configuration");
|
|
5303
5287
|
} finally {
|
|
5304
|
-
|
|
5288
|
+
A(!1);
|
|
5305
5289
|
}
|
|
5306
5290
|
})();
|
|
5307
|
-
},
|
|
5308
|
-
|
|
5291
|
+
}, z = () => {
|
|
5292
|
+
F() ? l ? l() : console.warn("[DynamicConfig] onShowCancelModal not provided, cannot show modal") : u ? u() : window.history.back();
|
|
5309
5293
|
};
|
|
5310
|
-
if (!
|
|
5294
|
+
if (!f?.configuration && !a?.configuration)
|
|
5311
5295
|
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" }) });
|
|
5312
|
-
const I = a?.configuration ||
|
|
5296
|
+
const I = a?.configuration || f?.configuration;
|
|
5313
5297
|
return te(() => {
|
|
5314
5298
|
s && a ? (!g || Object.keys(g).length === 0) && k() : s && !a && k();
|
|
5315
5299
|
}, [s, a]), /* @__PURE__ */ n("div", { children: [
|
|
@@ -5319,19 +5303,22 @@ function fs({
|
|
|
5319
5303
|
className: `dynamic-config bg-white w-full overflow-y-auto ${h !== "widget" ? "h-[calc(100vh-500px)]" : ""}`,
|
|
5320
5304
|
style: { padding: "0px 20px 0px 0px" },
|
|
5321
5305
|
children: [
|
|
5322
|
-
|
|
5323
|
-
!
|
|
5324
|
-
const y =
|
|
5325
|
-
|
|
5306
|
+
b && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(ca, { size: "large" }) }),
|
|
5307
|
+
!b && I?.map((w, S) => {
|
|
5308
|
+
const y = {
|
|
5309
|
+
...w,
|
|
5310
|
+
fields: Array.isArray(w.fields) ? w.fields.filter((R) => !R.hidden) : w.fields
|
|
5311
|
+
}, N = bs(w.type);
|
|
5312
|
+
if (N && N !== "UnknownType")
|
|
5326
5313
|
return /* @__PURE__ */ e(
|
|
5327
|
-
|
|
5314
|
+
N,
|
|
5328
5315
|
{
|
|
5329
|
-
item:
|
|
5316
|
+
item: y,
|
|
5330
5317
|
data: g,
|
|
5331
5318
|
updateHandler: L,
|
|
5332
5319
|
validationErrors: O
|
|
5333
5320
|
},
|
|
5334
|
-
|
|
5321
|
+
S
|
|
5335
5322
|
);
|
|
5336
5323
|
})
|
|
5337
5324
|
]
|
|
@@ -5342,9 +5329,9 @@ function fs({
|
|
|
5342
5329
|
ie,
|
|
5343
5330
|
{
|
|
5344
5331
|
category: "secondary",
|
|
5345
|
-
onClick:
|
|
5332
|
+
onClick: z,
|
|
5346
5333
|
label: "Cancel",
|
|
5347
|
-
disabled:
|
|
5334
|
+
disabled: T,
|
|
5348
5335
|
type: "button"
|
|
5349
5336
|
}
|
|
5350
5337
|
),
|
|
@@ -5353,22 +5340,22 @@ function fs({
|
|
|
5353
5340
|
{
|
|
5354
5341
|
category: "primary",
|
|
5355
5342
|
onClick: p,
|
|
5356
|
-
disabled:
|
|
5357
|
-
label:
|
|
5343
|
+
disabled: T,
|
|
5344
|
+
label: T ? "Saving..." : "Save",
|
|
5358
5345
|
type: "submit"
|
|
5359
5346
|
}
|
|
5360
5347
|
)
|
|
5361
5348
|
] })
|
|
5362
5349
|
] });
|
|
5363
5350
|
}
|
|
5364
|
-
const
|
|
5351
|
+
const Ul = ({
|
|
5365
5352
|
config: t,
|
|
5366
5353
|
appid: a = "Configuration-Page",
|
|
5367
5354
|
disableApi: s = !1,
|
|
5368
5355
|
hasConfig: i = !1
|
|
5369
5356
|
}) => {
|
|
5370
5357
|
const [l, u] = B(0), [o, h] = B(!1), {
|
|
5371
|
-
pageHeader:
|
|
5358
|
+
pageHeader: f = {},
|
|
5372
5359
|
appletHeader: v = {},
|
|
5373
5360
|
breadcrumb: g = [],
|
|
5374
5361
|
overview: r = {},
|
|
@@ -5386,11 +5373,11 @@ const Gl = ({
|
|
|
5386
5373
|
placeholder: a,
|
|
5387
5374
|
disabled: !1
|
|
5388
5375
|
}, k.some((p) => p.key === "displayname")) {
|
|
5389
|
-
const p = k.findIndex((I) => I.key === "displayname"),
|
|
5376
|
+
const p = k.findIndex((I) => I.key === "displayname"), z = k[p] || {};
|
|
5390
5377
|
k[p] = {
|
|
5391
|
-
...
|
|
5392
|
-
default:
|
|
5393
|
-
placeholder:
|
|
5378
|
+
...z,
|
|
5379
|
+
default: z.default || z.value || a,
|
|
5380
|
+
placeholder: z.placeholder || "Enter display name"
|
|
5394
5381
|
};
|
|
5395
5382
|
} else {
|
|
5396
5383
|
const p = {
|
|
@@ -5411,30 +5398,29 @@ const Gl = ({
|
|
|
5411
5398
|
};
|
|
5412
5399
|
}
|
|
5413
5400
|
return m;
|
|
5414
|
-
}), [x, a]),
|
|
5401
|
+
}), [x, a]), b = {
|
|
5415
5402
|
heading: "App Details",
|
|
5416
5403
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
5417
5404
|
isLeftArrow: !0,
|
|
5418
5405
|
onBackClick: () => window.history.back(),
|
|
5419
|
-
...
|
|
5406
|
+
...f
|
|
5420
5407
|
}, C = g.map((m) => ({
|
|
5421
5408
|
label: m.text,
|
|
5422
5409
|
href: m.href || "#"
|
|
5423
|
-
})),
|
|
5410
|
+
})), T = K(() => {
|
|
5424
5411
|
h(!0);
|
|
5425
|
-
}, []),
|
|
5412
|
+
}, []), A = K((m) => {
|
|
5426
5413
|
h(!1), m.primary && window.history.back();
|
|
5427
5414
|
}, []), O = K((m) => {
|
|
5428
|
-
console.log("Configuration changed:", m);
|
|
5429
5415
|
}, []), V = K(() => {
|
|
5430
5416
|
window.history.back();
|
|
5431
5417
|
}, []), _ = (() => {
|
|
5432
5418
|
if (v.headingKey && Array.isArray(x)) {
|
|
5433
|
-
const m = v.headingKey.split("."), k = m[0], L = m[1], P = x.find((
|
|
5419
|
+
const m = v.headingKey.split("."), k = m[0], L = m[1], P = x.find(($) => $ && $.key === k);
|
|
5434
5420
|
if (P && P.fields) {
|
|
5435
|
-
const
|
|
5436
|
-
if (
|
|
5437
|
-
return
|
|
5421
|
+
const $ = P.fields.find((p) => p && p.key === L);
|
|
5422
|
+
if ($)
|
|
5423
|
+
return $.default ?? $.value ?? v.heading ?? a;
|
|
5438
5424
|
}
|
|
5439
5425
|
}
|
|
5440
5426
|
if (Array.isArray(x)) {
|
|
@@ -5445,7 +5431,7 @@ const Gl = ({
|
|
|
5445
5431
|
}
|
|
5446
5432
|
}
|
|
5447
5433
|
return v.heading || a;
|
|
5448
|
-
})(),
|
|
5434
|
+
})(), G = {
|
|
5449
5435
|
subHeading: "Application configuration and details",
|
|
5450
5436
|
tags: [],
|
|
5451
5437
|
...v,
|
|
@@ -5473,9 +5459,9 @@ const Gl = ({
|
|
|
5473
5459
|
configuration: d
|
|
5474
5460
|
}), [d]), E = ae(() => [
|
|
5475
5461
|
{ label: "Overview", content: F(W) },
|
|
5476
|
-
i && { label: "Configuration", content: /* @__PURE__ */ e(fs, { appid: a, configdata: J, disableApi: s, onSave: O, onShowCancelModal:
|
|
5477
|
-
].filter(Boolean), [a, J, s, O,
|
|
5478
|
-
function
|
|
5462
|
+
i && { label: "Configuration", content: /* @__PURE__ */ e(fs, { appid: a, configdata: J, disableApi: s, onSave: O, onShowCancelModal: T, onCancel: V }) }
|
|
5463
|
+
].filter(Boolean), [a, J, s, O, T, V, W]);
|
|
5464
|
+
function U(m) {
|
|
5479
5465
|
return m ? m.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: m } }) : m : "📱";
|
|
5480
5466
|
}
|
|
5481
5467
|
function F(m) {
|
|
@@ -5516,19 +5502,19 @@ const Gl = ({
|
|
|
5516
5502
|
/* @__PURE__ */ e(
|
|
5517
5503
|
Mn,
|
|
5518
5504
|
{
|
|
5519
|
-
heading:
|
|
5520
|
-
subHeading: C.length > 0 ? void 0 :
|
|
5505
|
+
heading: b.heading,
|
|
5506
|
+
subHeading: C.length > 0 ? void 0 : b.subHeading,
|
|
5521
5507
|
breadcrumbItems: C,
|
|
5522
|
-
isLeftArrow:
|
|
5523
|
-
onBackClick:
|
|
5508
|
+
isLeftArrow: b.isLeftArrow,
|
|
5509
|
+
onBackClick: b.onBackClick
|
|
5524
5510
|
}
|
|
5525
5511
|
),
|
|
5526
5512
|
/* @__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: [
|
|
5527
|
-
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: G
|
|
5513
|
+
/* @__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(G.icon) }),
|
|
5528
5514
|
/* @__PURE__ */ n("div", { className: "flex flex-col min-w-0", children: [
|
|
5529
|
-
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children:
|
|
5530
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children:
|
|
5531
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children:
|
|
5515
|
+
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: G.heading }),
|
|
5516
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: G.subHeading }),
|
|
5517
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: G.tags && G.tags.map((m, k) => /* @__PURE__ */ e(
|
|
5532
5518
|
"span",
|
|
5533
5519
|
{
|
|
5534
5520
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
@@ -5554,7 +5540,7 @@ const Gl = ({
|
|
|
5554
5540
|
Fn,
|
|
5555
5541
|
{
|
|
5556
5542
|
isOpen: o,
|
|
5557
|
-
onClose:
|
|
5543
|
+
onClose: A,
|
|
5558
5544
|
variant: "warning",
|
|
5559
5545
|
title: "Are you sure you want to cancel?",
|
|
5560
5546
|
primaryButtonText: "Yes",
|
|
@@ -5573,67 +5559,67 @@ const Gl = ({
|
|
|
5573
5559
|
allowReorder: o = !0,
|
|
5574
5560
|
initialData: h = null
|
|
5575
5561
|
}) => {
|
|
5576
|
-
const [
|
|
5562
|
+
const [f, v] = B(null), [g, r] = B(""), [x, d] = B(() => Array.isArray(h) ? h : []), [b, C] = B(null), [T, A] = B(null), [O, V] = B("");
|
|
5577
5563
|
te(() => {
|
|
5578
5564
|
Array.isArray(h) && d(h);
|
|
5579
5565
|
}, [h]);
|
|
5580
5566
|
const _ = (p) => {
|
|
5581
5567
|
l && (v(p._id), r(p.categoryName || ""));
|
|
5582
|
-
},
|
|
5583
|
-
if (!i ||
|
|
5584
|
-
const
|
|
5568
|
+
}, G = () => {
|
|
5569
|
+
if (!i || f !== null) return;
|
|
5570
|
+
const z = (x.length > 0 ? Math.max(...x.map((I) => typeof I._id == "number" ? I._id : 0)) : 0) + 1;
|
|
5585
5571
|
d((I) => [
|
|
5586
5572
|
...I,
|
|
5587
5573
|
{
|
|
5588
|
-
_id:
|
|
5574
|
+
_id: z,
|
|
5589
5575
|
categoryName: "",
|
|
5590
5576
|
links: [],
|
|
5591
5577
|
order: (I.at(-1)?.order ?? 0) + 1,
|
|
5592
5578
|
protected: !1,
|
|
5593
5579
|
_class: "com.unifyed.model.Collection"
|
|
5594
5580
|
}
|
|
5595
|
-
]), v(
|
|
5581
|
+
]), v(z), r("");
|
|
5596
5582
|
}, W = () => {
|
|
5597
|
-
|
|
5598
|
-
const I = !Array.isArray(h) || !h.some((w) => w._id ===
|
|
5583
|
+
f != null && (d((p) => {
|
|
5584
|
+
const I = !Array.isArray(h) || !h.some((w) => w._id === f) ? p.filter((w) => w._id !== f) : p;
|
|
5599
5585
|
return a?.(I), I;
|
|
5600
5586
|
}), v(null), r(""));
|
|
5601
5587
|
}, J = () => {
|
|
5602
|
-
|
|
5603
|
-
const
|
|
5588
|
+
f == null || !g.trim() || (d((p) => {
|
|
5589
|
+
const z = p.map((I) => I._id === f ? {
|
|
5604
5590
|
...I,
|
|
5605
5591
|
categoryName: g.trim()
|
|
5606
5592
|
} : I);
|
|
5607
|
-
return a?.(
|
|
5593
|
+
return a?.(z), z;
|
|
5608
5594
|
}), v(null), r(""));
|
|
5609
5595
|
}, E = (p) => {
|
|
5610
|
-
u && d((
|
|
5611
|
-
const I =
|
|
5596
|
+
u && d((z) => {
|
|
5597
|
+
const I = z.filter((w) => w._id !== p._id);
|
|
5612
5598
|
return a?.(I), I;
|
|
5613
5599
|
});
|
|
5614
|
-
},
|
|
5615
|
-
const w = Number(
|
|
5616
|
-
if (!o || w ===
|
|
5617
|
-
const y = p.findIndex((M) => Number(M._id) === w), N = p.findIndex((M) => Number(M._id) ===
|
|
5600
|
+
}, U = (p, z, I) => {
|
|
5601
|
+
const w = Number(z), S = Number(I);
|
|
5602
|
+
if (!o || w === S) return p;
|
|
5603
|
+
const y = p.findIndex((M) => Number(M._id) === w), N = p.findIndex((M) => Number(M._id) === S);
|
|
5618
5604
|
if (y === -1 || N === -1) return p;
|
|
5619
|
-
const R = [...p], [
|
|
5620
|
-
return R.splice(N, 0,
|
|
5621
|
-
}, F = (p,
|
|
5622
|
-
o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(
|
|
5605
|
+
const R = [...p], [D] = R.splice(y, 1);
|
|
5606
|
+
return R.splice(N, 0, D), R.map((M, q) => ({ ...M, order: q + 1 }));
|
|
5607
|
+
}, F = (p, z) => {
|
|
5608
|
+
o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(z)), C(Number(z)));
|
|
5623
5609
|
}, m = (p) => {
|
|
5624
|
-
|
|
5610
|
+
b && p !== T && A(p);
|
|
5625
5611
|
}, k = (p) => {
|
|
5626
5612
|
p.preventDefault();
|
|
5627
|
-
}, L = (p,
|
|
5613
|
+
}, L = (p, z) => {
|
|
5628
5614
|
p.preventDefault();
|
|
5629
|
-
const I = p.dataTransfer.getData("text/plain"), w = I === "0" ? 0 : Number(I),
|
|
5630
|
-
w === void 0 ||
|
|
5631
|
-
const N =
|
|
5615
|
+
const I = p.dataTransfer.getData("text/plain"), w = I === "0" ? 0 : Number(I), S = z === "0" ? 0 : Number(z);
|
|
5616
|
+
w === void 0 || S === void 0 || (d((y) => {
|
|
5617
|
+
const N = U(y, w, S);
|
|
5632
5618
|
return a?.(N), N;
|
|
5633
|
-
}), C(null),
|
|
5619
|
+
}), C(null), A(null));
|
|
5634
5620
|
}, P = () => {
|
|
5635
|
-
C(null),
|
|
5636
|
-
},
|
|
5621
|
+
C(null), A(null);
|
|
5622
|
+
}, $ = Array.isArray(x) ? x.filter(
|
|
5637
5623
|
(p) => p.categoryName?.toLowerCase().includes(O.toLowerCase())
|
|
5638
5624
|
) : [];
|
|
5639
5625
|
return /* @__PURE__ */ n("div", { className: `manage-collection-list ${t}`, children: [
|
|
@@ -5652,16 +5638,16 @@ const Gl = ({
|
|
|
5652
5638
|
{
|
|
5653
5639
|
className: [
|
|
5654
5640
|
"px-4 py-3 bg-black text-white rounded-2xl ml-4",
|
|
5655
|
-
|
|
5641
|
+
f !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
5656
5642
|
].join(" "),
|
|
5657
|
-
onClick:
|
|
5658
|
-
disabled:
|
|
5643
|
+
onClick: G,
|
|
5644
|
+
disabled: f !== null,
|
|
5659
5645
|
children: "Add a Collection"
|
|
5660
5646
|
}
|
|
5661
5647
|
)
|
|
5662
5648
|
] }) }),
|
|
5663
|
-
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children:
|
|
5664
|
-
const
|
|
5649
|
+
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: $.map((p) => {
|
|
5650
|
+
const z = f === p._id, I = p?.links?.length ?? 0, w = b === p._id, S = T === p._id && b !== p._id;
|
|
5665
5651
|
return /* @__PURE__ */ e(
|
|
5666
5652
|
"div",
|
|
5667
5653
|
{
|
|
@@ -5672,10 +5658,10 @@ const Gl = ({
|
|
|
5672
5658
|
className: [
|
|
5673
5659
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5674
5660
|
"border-gray-300",
|
|
5675
|
-
|
|
5661
|
+
S ? "ring-2 ring-gray-800/20" : "",
|
|
5676
5662
|
w ? "opacity-60" : ""
|
|
5677
5663
|
].join(" "),
|
|
5678
|
-
children:
|
|
5664
|
+
children: z ? /* @__PURE__ */ n(re, { children: [
|
|
5679
5665
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
5680
5666
|
"input",
|
|
5681
5667
|
{
|
|
@@ -5840,44 +5826,44 @@ const Bt = () => {
|
|
|
5840
5826
|
onFilterOpen: o,
|
|
5841
5827
|
addBtnText: h = "Add",
|
|
5842
5828
|
// Feature toggles
|
|
5843
|
-
showSearch:
|
|
5829
|
+
showSearch: f = !0,
|
|
5844
5830
|
showDelete: v = !0,
|
|
5845
5831
|
showColumnChooser: g = !0,
|
|
5846
5832
|
showFilter: r = !1,
|
|
5847
5833
|
showPrint: x = !1,
|
|
5848
5834
|
showExcel: d = !1,
|
|
5849
|
-
showPdf:
|
|
5835
|
+
showPdf: b = !1,
|
|
5850
5836
|
showRefresh: C = !1,
|
|
5851
|
-
showAdd:
|
|
5852
|
-
iSelectedRecords:
|
|
5837
|
+
showAdd: T = !1,
|
|
5838
|
+
iSelectedRecords: A = 0,
|
|
5853
5839
|
// Additional props
|
|
5854
5840
|
searchPlaceholder: O = "Search...",
|
|
5855
5841
|
handleRefreshClick: V = () => {
|
|
5856
5842
|
},
|
|
5857
5843
|
handleSearchChange: _ = () => {
|
|
5858
5844
|
},
|
|
5859
|
-
handleDeleteClick:
|
|
5845
|
+
handleDeleteClick: G = () => {
|
|
5860
5846
|
},
|
|
5861
5847
|
// Optional: override export file names
|
|
5862
5848
|
excelFileName: W,
|
|
5863
5849
|
pdfFileName: J,
|
|
5864
5850
|
searchIconSize: E,
|
|
5865
|
-
searchIconClass:
|
|
5851
|
+
searchIconClass: U,
|
|
5866
5852
|
inputStyle: F
|
|
5867
5853
|
}) => {
|
|
5868
|
-
const m = () => l?.current || i?.current, [k, L] = ne.useState(""), P = (t || "export").toString().trim() || "export",
|
|
5869
|
-
(
|
|
5854
|
+
const m = () => l?.current || i?.current, [k, L] = ne.useState(""), P = (t || "export").toString().trim() || "export", $ = `${W || P}.xlsx`, p = `${J || P}.pdf`, z = (S, y, N) => Math.max(y, Math.min(S, N)), I = K(
|
|
5855
|
+
(S) => {
|
|
5870
5856
|
const y = m();
|
|
5871
5857
|
if (y?.openColumnChooser) {
|
|
5872
|
-
if (typeof window > "u" || !
|
|
5858
|
+
if (typeof window > "u" || !S?.currentTarget) {
|
|
5873
5859
|
y.openColumnChooser();
|
|
5874
5860
|
return;
|
|
5875
5861
|
}
|
|
5876
5862
|
try {
|
|
5877
|
-
const N =
|
|
5878
|
-
let M = R - 120, q =
|
|
5863
|
+
const N = S.currentTarget.getBoundingClientRect(), R = N.left + window.scrollX, D = N.bottom + window.scrollY;
|
|
5864
|
+
let M = R - 120, q = D - 120;
|
|
5879
5865
|
const X = window.innerWidth, Y = window.innerHeight;
|
|
5880
|
-
M =
|
|
5866
|
+
M = z(M, window.scrollX + 8, window.scrollX + X - 340), q = z(q, window.scrollY, window.scrollY + Y - 120), y.openColumnChooser(M, q);
|
|
5881
5867
|
} catch (N) {
|
|
5882
5868
|
console.log("coloumn choose error", N);
|
|
5883
5869
|
}
|
|
@@ -5886,14 +5872,14 @@ const Bt = () => {
|
|
|
5886
5872
|
[]
|
|
5887
5873
|
// no external deps; reads ref at call time
|
|
5888
5874
|
), w = K(
|
|
5889
|
-
(
|
|
5875
|
+
(S, y) => {
|
|
5890
5876
|
const N = m();
|
|
5891
5877
|
if (N)
|
|
5892
|
-
switch (
|
|
5878
|
+
switch (S) {
|
|
5893
5879
|
case "Delete": {
|
|
5894
5880
|
if (v) {
|
|
5895
5881
|
const R = N.getSelectedRecords();
|
|
5896
|
-
return
|
|
5882
|
+
return G(R);
|
|
5897
5883
|
}
|
|
5898
5884
|
break;
|
|
5899
5885
|
}
|
|
@@ -5904,17 +5890,17 @@ const Bt = () => {
|
|
|
5904
5890
|
x && N.print?.();
|
|
5905
5891
|
break;
|
|
5906
5892
|
case "Excel":
|
|
5907
|
-
d && N.excelExport?.({ fileName:
|
|
5893
|
+
d && N.excelExport?.({ fileName: $ });
|
|
5908
5894
|
break;
|
|
5909
5895
|
case "Pdf":
|
|
5910
|
-
|
|
5896
|
+
b && N.pdfExport?.({ fileName: p });
|
|
5911
5897
|
break;
|
|
5912
5898
|
case "Refresh":
|
|
5913
5899
|
C && V();
|
|
5914
5900
|
break;
|
|
5915
5901
|
}
|
|
5916
5902
|
},
|
|
5917
|
-
[g, x, d,
|
|
5903
|
+
[g, x, d, b, C, $, p, V, I]
|
|
5918
5904
|
);
|
|
5919
5905
|
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: [
|
|
5920
5906
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
@@ -5926,16 +5912,16 @@ const Bt = () => {
|
|
|
5926
5912
|
a ? /* @__PURE__ */ e("div", { className: "text-sm text-gray-500", children: a }) : null
|
|
5927
5913
|
] }),
|
|
5928
5914
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
5929
|
-
|
|
5915
|
+
f && /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
|
|
5930
5916
|
ye,
|
|
5931
5917
|
{
|
|
5932
5918
|
placeholder: O,
|
|
5933
5919
|
value: k,
|
|
5934
|
-
onDebouncedChange: (
|
|
5935
|
-
L(
|
|
5920
|
+
onDebouncedChange: (S) => {
|
|
5921
|
+
L(S), _(S);
|
|
5936
5922
|
},
|
|
5937
5923
|
searchIconSize: E || 16,
|
|
5938
|
-
searchIconClass:
|
|
5924
|
+
searchIconClass: U || "",
|
|
5939
5925
|
inputStyle: F || { paddingTop: "4px", paddingBottom: "4px" }
|
|
5940
5926
|
}
|
|
5941
5927
|
) }),
|
|
@@ -5947,14 +5933,14 @@ const Bt = () => {
|
|
|
5947
5933
|
icon: Be,
|
|
5948
5934
|
onClick: () => w("Delete"),
|
|
5949
5935
|
ariaLabel: "Delete",
|
|
5950
|
-
disabled:
|
|
5936
|
+
disabled: A === 0
|
|
5951
5937
|
}
|
|
5952
5938
|
),
|
|
5953
5939
|
g && /* @__PURE__ */ e(
|
|
5954
5940
|
ze,
|
|
5955
5941
|
{
|
|
5956
5942
|
icon: hr,
|
|
5957
|
-
onClick: (
|
|
5943
|
+
onClick: (S) => w("ColumnChooser", S),
|
|
5958
5944
|
ariaLabel: "Column Chooser"
|
|
5959
5945
|
}
|
|
5960
5946
|
),
|
|
@@ -5982,7 +5968,7 @@ const Bt = () => {
|
|
|
5982
5968
|
ariaLabel: "Excel Download"
|
|
5983
5969
|
}
|
|
5984
5970
|
),
|
|
5985
|
-
|
|
5971
|
+
b && /* @__PURE__ */ e(
|
|
5986
5972
|
ze,
|
|
5987
5973
|
{
|
|
5988
5974
|
icon: fr,
|
|
@@ -5999,7 +5985,7 @@ const Bt = () => {
|
|
|
5999
5985
|
}
|
|
6000
5986
|
)
|
|
6001
5987
|
] }),
|
|
6002
|
-
|
|
5988
|
+
T && u && /* @__PURE__ */ e(
|
|
6003
5989
|
ie,
|
|
6004
5990
|
{
|
|
6005
5991
|
label: h,
|
|
@@ -6023,30 +6009,30 @@ function Wl(t) {
|
|
|
6023
6009
|
pageSize: u = 20,
|
|
6024
6010
|
allowPaging: o = !0,
|
|
6025
6011
|
allowSorting: h = !0,
|
|
6026
|
-
allowFiltering:
|
|
6012
|
+
allowFiltering: f = !1,
|
|
6027
6013
|
allowGrouping: v = !1,
|
|
6028
6014
|
allowReordering: g = !0,
|
|
6029
6015
|
allowResizing: r = !0,
|
|
6030
6016
|
allowExcelExport: x = !1,
|
|
6031
6017
|
allowPdfExport: d = !1,
|
|
6032
|
-
showColumnChooser:
|
|
6018
|
+
showColumnChooser: b = !1,
|
|
6033
6019
|
enableSearchApi: C = !1,
|
|
6034
|
-
height:
|
|
6035
|
-
selectionSettings:
|
|
6020
|
+
height: T = "600",
|
|
6021
|
+
selectionSettings: A,
|
|
6036
6022
|
enableCheckbox: O = !1,
|
|
6037
6023
|
columns: V = [],
|
|
6038
6024
|
onGridStateChange: _,
|
|
6039
|
-
onRowSelected:
|
|
6025
|
+
onRowSelected: G,
|
|
6040
6026
|
onRowDeselected: W,
|
|
6041
6027
|
onRowDoubleClick: J,
|
|
6042
6028
|
apiRef: E,
|
|
6043
|
-
gridProps:
|
|
6029
|
+
gridProps: U = {}
|
|
6044
6030
|
} = t, F = ge(null), {
|
|
6045
6031
|
pageSettings: m,
|
|
6046
6032
|
sortSettings: k,
|
|
6047
6033
|
...L
|
|
6048
|
-
} =
|
|
6049
|
-
const j =
|
|
6034
|
+
} = U || {}, [P, $] = ne.useState(m?.page || l), [p, z] = ne.useState(m?.pageSize || u), [I, w] = ne.useState(k?.sortKey || "updatedDate"), [S, y] = ne.useState(k?.direction || "Descending"), N = ae(() => {
|
|
6035
|
+
const j = A || {
|
|
6050
6036
|
type: "Multiple",
|
|
6051
6037
|
mode: "Row"
|
|
6052
6038
|
};
|
|
@@ -6059,22 +6045,22 @@ function Wl(t) {
|
|
|
6059
6045
|
checkboxOnly: !1,
|
|
6060
6046
|
enableSimpleMultiRowSelection: !0
|
|
6061
6047
|
} : j;
|
|
6062
|
-
}, [
|
|
6048
|
+
}, [A, O]), R = ae(() => {
|
|
6063
6049
|
const j = [Kr];
|
|
6064
|
-
return (O ||
|
|
6050
|
+
return (O || A) && j.push(en), h && j.push(tn), f && j.push(an), v && j.push(rn), C && j.push(nn), x && j.push(sn), d && j.push(ln), b && j.push(on), r && j.push(cn), g && j.push(dn), j.push(mn), j;
|
|
6065
6051
|
}, [
|
|
6066
6052
|
h,
|
|
6067
|
-
|
|
6053
|
+
f,
|
|
6068
6054
|
v,
|
|
6069
6055
|
C,
|
|
6070
6056
|
x,
|
|
6071
6057
|
d,
|
|
6072
|
-
|
|
6058
|
+
b,
|
|
6073
6059
|
r,
|
|
6074
6060
|
g,
|
|
6075
6061
|
O,
|
|
6076
|
-
|
|
6077
|
-
]),
|
|
6062
|
+
A
|
|
6063
|
+
]), D = ae(() => {
|
|
6078
6064
|
const j = () => F.current, se = (Q, me) => {
|
|
6079
6065
|
!me && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${Q} requested but related service/feature is disabled.`);
|
|
6080
6066
|
};
|
|
@@ -6096,33 +6082,33 @@ function Wl(t) {
|
|
|
6096
6082
|
se("pdfExport()", d), j()?.pdfExport?.(Q);
|
|
6097
6083
|
},
|
|
6098
6084
|
openColumnChooser: (Q, me) => {
|
|
6099
|
-
se("openColumnChooser()",
|
|
6085
|
+
se("openColumnChooser()", b), j()?.columnChooserModule?.openColumnChooser?.(Q, me);
|
|
6100
6086
|
},
|
|
6101
6087
|
// Additional useful methods
|
|
6102
6088
|
getColumns: () => j()?.getColumns?.(),
|
|
6103
6089
|
getFilteredRecords: () => j()?.getFilteredRecords?.(),
|
|
6104
6090
|
autoFitColumns: (Q) => j()?.autoFitColumns?.(Q)
|
|
6105
6091
|
};
|
|
6106
|
-
}, [C, x, d,
|
|
6092
|
+
}, [C, x, d, b]);
|
|
6107
6093
|
te(() => {
|
|
6108
|
-
E && (E.current =
|
|
6109
|
-
}, [E,
|
|
6094
|
+
E && (E.current = D);
|
|
6095
|
+
}, [E, D]), te(() => () => {
|
|
6110
6096
|
E && (E.current = null);
|
|
6111
6097
|
}, [E]);
|
|
6112
6098
|
const M = (j) => {
|
|
6113
6099
|
const se = String(j || "");
|
|
6114
6100
|
return se === "Ascending" || se === "Descending" ? se : se.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
6115
6101
|
}, q = (j) => {
|
|
6116
|
-
const se = F.current, Q = j?.requestType, me = Q === "paging" ? "paging" : Q === "sorting" ? "sorting" : Q === "searching" ? "searching" : Q === "filtering" ? "filtering" : Q === "grouping" ? "grouping" : Q === "reorder" ? "reorder" : Q === "columnstate" ? "columnstate" : "other", Ie = j?.pageSize ?? se?.pageSettings?.pageSize ?? p,
|
|
6102
|
+
const se = F.current, Q = j?.requestType, me = Q === "paging" ? "paging" : Q === "sorting" ? "sorting" : Q === "searching" ? "searching" : Q === "filtering" ? "filtering" : Q === "grouping" ? "grouping" : Q === "reorder" ? "reorder" : Q === "columnstate" ? "columnstate" : "other", Ie = j?.pageSize ?? se?.pageSettings?.pageSize ?? p, Ue = j?.currentPage ?? se?.pageSettings?.currentPage ?? l, nt = j?.columnName && j?.direction ? [{ field: j.columnName, dir: M(j.direction) }] : (se?.sortSettings?.columns || []).map((Oe) => ({
|
|
6117
6103
|
field: Oe.field,
|
|
6118
6104
|
dir: M(Oe.direction ?? Oe.dir)
|
|
6119
6105
|
})), st = j?.searchString ?? "", lt = j?.columns ?? se?.filterSettings?.columns ?? [];
|
|
6120
6106
|
return {
|
|
6121
6107
|
reason: me,
|
|
6122
6108
|
page: {
|
|
6123
|
-
index:
|
|
6109
|
+
index: Ue,
|
|
6124
6110
|
size: Ie,
|
|
6125
|
-
skip: (
|
|
6111
|
+
skip: (Ue - 1) * Ie,
|
|
6126
6112
|
take: Ie
|
|
6127
6113
|
},
|
|
6128
6114
|
sort: nt,
|
|
@@ -6133,7 +6119,7 @@ function Wl(t) {
|
|
|
6133
6119
|
}, X = (j) => {
|
|
6134
6120
|
setTimeout(() => {
|
|
6135
6121
|
F?.current?.hideSpinner();
|
|
6136
|
-
}, 1e3), j.requestType === "paging" && (
|
|
6122
|
+
}, 1e3), j.requestType === "paging" && ($(j.currentPage), z(j.pageSize)), j.requestType === "sorting" && (w(j.columnName || "updatedDate"), y(j.direction)), _?.(q(j), j);
|
|
6137
6123
|
}, Y = (j) => {
|
|
6138
6124
|
J?.(j?.rowData, j);
|
|
6139
6125
|
}, Re = () => {
|
|
@@ -6155,7 +6141,7 @@ function Wl(t) {
|
|
|
6155
6141
|
const {
|
|
6156
6142
|
field: me,
|
|
6157
6143
|
headerText: Ie,
|
|
6158
|
-
width:
|
|
6144
|
+
width: Ue,
|
|
6159
6145
|
textAlign: nt = "Left",
|
|
6160
6146
|
template: st,
|
|
6161
6147
|
isPrimaryKey: lt,
|
|
@@ -6165,8 +6151,8 @@ function Wl(t) {
|
|
|
6165
6151
|
type: Sa,
|
|
6166
6152
|
format: Da,
|
|
6167
6153
|
visible: $a = !0,
|
|
6168
|
-
minWidth:
|
|
6169
|
-
maxWidth:
|
|
6154
|
+
minWidth: Aa,
|
|
6155
|
+
maxWidth: Ta,
|
|
6170
6156
|
customAttributes: Fa,
|
|
6171
6157
|
...Ea
|
|
6172
6158
|
} = se || {};
|
|
@@ -6176,7 +6162,7 @@ function Wl(t) {
|
|
|
6176
6162
|
{
|
|
6177
6163
|
field: me,
|
|
6178
6164
|
headerText: Ie,
|
|
6179
|
-
width:
|
|
6165
|
+
width: Ue,
|
|
6180
6166
|
textAlign: nt,
|
|
6181
6167
|
template: st,
|
|
6182
6168
|
isPrimaryKey: lt,
|
|
@@ -6186,8 +6172,8 @@ function Wl(t) {
|
|
|
6186
6172
|
type: Sa,
|
|
6187
6173
|
format: Da,
|
|
6188
6174
|
visible: $a,
|
|
6189
|
-
minWidth:
|
|
6190
|
-
maxWidth:
|
|
6175
|
+
minWidth: Aa,
|
|
6176
|
+
maxWidth: Ta,
|
|
6191
6177
|
customAttributes: Fa,
|
|
6192
6178
|
...Ea
|
|
6193
6179
|
},
|
|
@@ -6201,9 +6187,9 @@ function Wl(t) {
|
|
|
6201
6187
|
pageSizes: m?.pageSizes ?? [10, 20, 40, 60, 80, 100],
|
|
6202
6188
|
totalCount: s
|
|
6203
6189
|
}), [P, p, m?.pageSizes, s]), ka = ae(() => k ?? {
|
|
6204
|
-
columns: [{ field: I, direction: M(
|
|
6190
|
+
columns: [{ field: I, direction: M(S) }],
|
|
6205
6191
|
allowUnsort: !1
|
|
6206
|
-
}, [k, I,
|
|
6192
|
+
}, [k, I, S]);
|
|
6207
6193
|
return /* @__PURE__ */ n(
|
|
6208
6194
|
un,
|
|
6209
6195
|
{
|
|
@@ -6213,19 +6199,19 @@ function Wl(t) {
|
|
|
6213
6199
|
result: a,
|
|
6214
6200
|
count: s
|
|
6215
6201
|
},
|
|
6216
|
-
height:
|
|
6202
|
+
height: T,
|
|
6217
6203
|
allowPaging: o,
|
|
6218
6204
|
allowSorting: h,
|
|
6219
|
-
allowFiltering:
|
|
6205
|
+
allowFiltering: f,
|
|
6220
6206
|
allowGrouping: v,
|
|
6221
6207
|
allowReordering: g,
|
|
6222
6208
|
allowResizing: r,
|
|
6223
|
-
showColumnChooser:
|
|
6209
|
+
showColumnChooser: b,
|
|
6224
6210
|
selectionSettings: N,
|
|
6225
6211
|
pageSettings: wa,
|
|
6226
6212
|
sortSettings: ka,
|
|
6227
6213
|
actionBegin: X,
|
|
6228
|
-
rowSelected:
|
|
6214
|
+
rowSelected: G,
|
|
6229
6215
|
rowDeselected: W,
|
|
6230
6216
|
recordDoubleClick: Y,
|
|
6231
6217
|
cssClass: "custom-grid-padding",
|
|
@@ -6271,7 +6257,7 @@ function de({
|
|
|
6271
6257
|
details: o = {},
|
|
6272
6258
|
...h
|
|
6273
6259
|
}) {
|
|
6274
|
-
const
|
|
6260
|
+
const f = Ze(), v = xs(h, u), g = (x) => {
|
|
6275
6261
|
l?.({
|
|
6276
6262
|
key: v,
|
|
6277
6263
|
checked: x.target.checked,
|
|
@@ -6288,7 +6274,7 @@ function de({
|
|
|
6288
6274
|
s && /* @__PURE__ */ e("div", { className: `absolute ${r} z-10`, children: /* @__PURE__ */ e(
|
|
6289
6275
|
"input",
|
|
6290
6276
|
{
|
|
6291
|
-
id:
|
|
6277
|
+
id: f,
|
|
6292
6278
|
type: "checkbox",
|
|
6293
6279
|
className: "h-4 w-4 rounded border-zinc-300 focus:ring-[var(--primaryColor)]",
|
|
6294
6280
|
onChange: g,
|
|
@@ -6317,27 +6303,27 @@ function vs({
|
|
|
6317
6303
|
title: u = "Activity",
|
|
6318
6304
|
group: o = "Global",
|
|
6319
6305
|
moreGroupsLabel: h = "+ 5 more",
|
|
6320
|
-
author:
|
|
6306
|
+
author: f = "Judith Black",
|
|
6321
6307
|
timeLabel: v = "Just now",
|
|
6322
6308
|
imageUrl: g = "https://images.unsplash.com/photo-1469980098053-382eb10ba017?q=80&w=1200&auto=format&fit=crop",
|
|
6323
6309
|
description: r = "Columbia University is a prestigious Ivy League institution located in the heart of New York City.",
|
|
6324
6310
|
// spread remaining props (_id, instanceId, etc.)
|
|
6325
6311
|
...x
|
|
6326
6312
|
}) {
|
|
6327
|
-
const d = ue(t),
|
|
6313
|
+
const d = ue(t), b = he[d];
|
|
6328
6314
|
return /* @__PURE__ */ n(
|
|
6329
6315
|
de,
|
|
6330
6316
|
{
|
|
6331
|
-
className: `flex flex-col ${
|
|
6317
|
+
className: `flex flex-col ${b.card}`,
|
|
6332
6318
|
showCheckbox: a,
|
|
6333
6319
|
checkboxPosition: s,
|
|
6334
6320
|
onSelect: i,
|
|
6335
6321
|
identity: l,
|
|
6336
|
-
details: { type: "activity", title: u, group: o, author:
|
|
6322
|
+
details: { type: "activity", title: u, group: o, author: f },
|
|
6337
6323
|
...x,
|
|
6338
6324
|
children: [
|
|
6339
|
-
/* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
6340
|
-
/* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${
|
|
6325
|
+
/* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${b.title} ml-3`, children: u }) }),
|
|
6326
|
+
/* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${b.meta}`, children: [
|
|
6341
6327
|
"Posted in ",
|
|
6342
6328
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Global" }),
|
|
6343
6329
|
h ? /* @__PURE__ */ n(re, { children: [
|
|
@@ -6357,8 +6343,8 @@ function vs({
|
|
|
6357
6343
|
/* @__PURE__ */ n("div", { className: "mt-2 flex items-center gap-3", children: [
|
|
6358
6344
|
/* @__PURE__ */ e(we, { name: "John", size: "medium" }),
|
|
6359
6345
|
/* @__PURE__ */ n("div", { className: "leading-tight", children: [
|
|
6360
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-100", children:
|
|
6361
|
-
/* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${
|
|
6346
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-100", children: f }),
|
|
6347
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${b.meta}`, children: v })
|
|
6362
6348
|
] })
|
|
6363
6349
|
] }),
|
|
6364
6350
|
/* @__PURE__ */ n("p", { className: "mt-2 text-zinc-700 dark:text-zinc-300", children: [
|
|
@@ -6375,7 +6361,7 @@ function vs({
|
|
|
6375
6361
|
/* @__PURE__ */ e(
|
|
6376
6362
|
"div",
|
|
6377
6363
|
{
|
|
6378
|
-
className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${
|
|
6364
|
+
className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${b.media}`,
|
|
6379
6365
|
children: /* @__PURE__ */ e("img", { src: g, alt: "", className: "h-full w-full object-cover" })
|
|
6380
6366
|
}
|
|
6381
6367
|
),
|
|
@@ -6441,7 +6427,7 @@ function zs({
|
|
|
6441
6427
|
// "joined" | "suggested"
|
|
6442
6428
|
items: h = ks,
|
|
6443
6429
|
// spread for identity (_id/instanceId/etc)
|
|
6444
|
-
...
|
|
6430
|
+
...f
|
|
6445
6431
|
}) {
|
|
6446
6432
|
const v = ue(t), g = he[v], r = Cs[v], x = (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"}`;
|
|
6447
6433
|
return /* @__PURE__ */ n(
|
|
@@ -6453,7 +6439,7 @@ function zs({
|
|
|
6453
6439
|
onSelect: i,
|
|
6454
6440
|
identity: l,
|
|
6455
6441
|
details: { type: "communities", title: u, activeTab: o, count: h?.length ?? 0 },
|
|
6456
|
-
...
|
|
6442
|
+
...f,
|
|
6457
6443
|
children: [
|
|
6458
6444
|
/* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
|
|
6459
6445
|
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${g.title}`, children: u }),
|
|
@@ -6627,7 +6613,7 @@ function $s({
|
|
|
6627
6613
|
// spread for identity fields: _id / id / instanceId etc.
|
|
6628
6614
|
...h
|
|
6629
6615
|
}) {
|
|
6630
|
-
const
|
|
6616
|
+
const f = ue(t), v = he[f], g = Ds[f];
|
|
6631
6617
|
return /* @__PURE__ */ n(
|
|
6632
6618
|
de,
|
|
6633
6619
|
{
|
|
@@ -6643,7 +6629,7 @@ function $s({
|
|
|
6643
6629
|
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: u }),
|
|
6644
6630
|
/* @__PURE__ */ e("span", { className: "text-sm text-indigo-700 cursor-default select-none", children: "View All" })
|
|
6645
6631
|
] }),
|
|
6646
|
-
|
|
6632
|
+
f === "lg" ? (
|
|
6647
6633
|
// Large: 3-up grid of image cards
|
|
6648
6634
|
/* @__PURE__ */ e("div", { className: `mt-4 ${g.grid}`, children: o.slice(0, 3).map((r) => /* @__PURE__ */ n("article", { children: [
|
|
6649
6635
|
/* @__PURE__ */ e("img", { src: r.thumb, alt: "", className: g.cardImg }),
|
|
@@ -6702,7 +6688,7 @@ $s.propTypes = {
|
|
|
6702
6688
|
})
|
|
6703
6689
|
)
|
|
6704
6690
|
};
|
|
6705
|
-
const
|
|
6691
|
+
const As = ["All", "Library", "Restaurant", "Parking", "Bus Stop"], Ts = {
|
|
6706
6692
|
sm: {
|
|
6707
6693
|
wrap: "max-w-md w-full md:w-auto flex-none justify-self-start",
|
|
6708
6694
|
mapH: "h-48",
|
|
@@ -6740,8 +6726,8 @@ function Rs({
|
|
|
6740
6726
|
identity: l = "_id",
|
|
6741
6727
|
title: u = "Campus Map",
|
|
6742
6728
|
campusName: o = "Morningside Heights Campus",
|
|
6743
|
-
filters: h =
|
|
6744
|
-
activeFilter:
|
|
6729
|
+
filters: h = As,
|
|
6730
|
+
activeFilter: f = "All",
|
|
6745
6731
|
// NEW: iframe controls
|
|
6746
6732
|
mapQuery: v = "Florida",
|
|
6747
6733
|
zoom: g = 12,
|
|
@@ -6749,23 +6735,23 @@ function Rs({
|
|
|
6749
6735
|
// optional full embed URL override
|
|
6750
6736
|
...x
|
|
6751
6737
|
}) {
|
|
6752
|
-
const d = ue(t),
|
|
6738
|
+
const d = ue(t), b = he[d], C = Ts[d], T = r || Es(v, g);
|
|
6753
6739
|
return /* @__PURE__ */ e(
|
|
6754
6740
|
de,
|
|
6755
6741
|
{
|
|
6756
|
-
className: `flex flex-col ${
|
|
6742
|
+
className: `flex flex-col ${b.card} ${C.wrap}`,
|
|
6757
6743
|
showCheckbox: a,
|
|
6758
6744
|
checkboxPosition: s,
|
|
6759
6745
|
onSelect: i,
|
|
6760
6746
|
identity: l,
|
|
6761
|
-
details: { type: "campus-map", title: u, campusName: o, activeFilter:
|
|
6747
|
+
details: { type: "campus-map", title: u, campusName: o, activeFilter: f, mapQuery: v, zoom: g },
|
|
6762
6748
|
...x,
|
|
6763
6749
|
children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${C.mapH}`, children: [
|
|
6764
6750
|
/* @__PURE__ */ e(
|
|
6765
6751
|
"iframe",
|
|
6766
6752
|
{
|
|
6767
6753
|
title: "Google Map",
|
|
6768
|
-
src:
|
|
6754
|
+
src: T,
|
|
6769
6755
|
className: "h-full w-full",
|
|
6770
6756
|
style: { border: 0 },
|
|
6771
6757
|
loading: "lazy",
|
|
@@ -6783,7 +6769,7 @@ function Rs({
|
|
|
6783
6769
|
/* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-full bg-white/90 border border-zinc-300 flex items-center justify-center", children: "›" })
|
|
6784
6770
|
] })
|
|
6785
6771
|
] }),
|
|
6786
|
-
/* @__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 ${C.chipGap} overflow-x-auto scrollbar-none`, children: h.map((
|
|
6772
|
+
/* @__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 ${C.chipGap} overflow-x-auto scrollbar-none`, children: h.map((A) => /* @__PURE__ */ e(Fs, { label: A, active: A === f, size: d }, A)) }) }),
|
|
6787
6773
|
/* @__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 ${C.searchH}`, children: [
|
|
6788
6774
|
/* @__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" }) }),
|
|
6789
6775
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-500 dark:text-zinc-400", children: "Search places" })
|
|
@@ -6900,7 +6886,7 @@ function _t({ ev: t, sizeMeta: a, isSelected: s, onClick: i }) {
|
|
|
6900
6886
|
/* @__PURE__ */ n("div", { className: "flex-grow min-w-0", children: [
|
|
6901
6887
|
/* @__PURE__ */ e("div", { className: `${a.title} text-zinc-900 dark:text-zinc-100 line-clamp-2 group-hover:text-blue-600 dark:group-hover:text-blue-400`, children: t.title }),
|
|
6902
6888
|
/* @__PURE__ */ n("div", { className: `flex items-center gap-1.5 mt-1 text-zinc-500 dark:text-zinc-400 ${a.meta}`, children: [
|
|
6903
|
-
/* @__PURE__ */ e(
|
|
6889
|
+
/* @__PURE__ */ e(Te, { className: "h-3 w-3" }),
|
|
6904
6890
|
t.allDayNote ? t.allDayNote : o
|
|
6905
6891
|
] })
|
|
6906
6892
|
] })
|
|
@@ -6920,7 +6906,7 @@ function Ps({ ev: t, sizeMeta: a }) {
|
|
|
6920
6906
|
/* @__PURE__ */ n("div", { className: "flex-grow", children: [
|
|
6921
6907
|
/* @__PURE__ */ e("h3", { className: `${a.title} text-zinc-900 dark:text-zinc-100 mb-2`, children: t.title }),
|
|
6922
6908
|
/* @__PURE__ */ n("div", { className: `flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400 ${a.meta}`, children: [
|
|
6923
|
-
/* @__PURE__ */ e(
|
|
6909
|
+
/* @__PURE__ */ e(Te, { className: "h-4 w-4" }),
|
|
6924
6910
|
t.allDayNote ? t.allDayNote : l
|
|
6925
6911
|
] })
|
|
6926
6912
|
] })
|
|
@@ -6953,11 +6939,11 @@ function Ls({
|
|
|
6953
6939
|
title: u = "Upcoming Events",
|
|
6954
6940
|
events: o = Is,
|
|
6955
6941
|
selectedIndex: h = 0,
|
|
6956
|
-
...
|
|
6942
|
+
...f
|
|
6957
6943
|
}) {
|
|
6958
|
-
const [v, g] = B(h), r = ue(t), x = he[r], d = Os[r],
|
|
6959
|
-
g(O), i?.(
|
|
6960
|
-
},
|
|
6944
|
+
const [v, g] = B(h), r = ue(t), x = he[r], d = Os[r], b = o[v] || o[0], C = (A, O) => {
|
|
6945
|
+
g(O), i?.(A);
|
|
6946
|
+
}, T = r === "lg";
|
|
6961
6947
|
return /* @__PURE__ */ n(
|
|
6962
6948
|
de,
|
|
6963
6949
|
{
|
|
@@ -6967,41 +6953,41 @@ function Ls({
|
|
|
6967
6953
|
onSelect: i,
|
|
6968
6954
|
identity: l,
|
|
6969
6955
|
details: { type: "events", title: u, count: o?.length ?? 0 },
|
|
6970
|
-
...
|
|
6956
|
+
...f,
|
|
6971
6957
|
children: [
|
|
6972
6958
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between mb-4", children: [
|
|
6973
6959
|
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${x.title}`, children: u }),
|
|
6974
6960
|
/* @__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" })
|
|
6975
6961
|
] }),
|
|
6976
|
-
|
|
6962
|
+
T ? (
|
|
6977
6963
|
// Large: Two-column layout
|
|
6978
6964
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
6979
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((
|
|
6965
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((A, O) => /* @__PURE__ */ e(
|
|
6980
6966
|
_t,
|
|
6981
6967
|
{
|
|
6982
|
-
ev:
|
|
6968
|
+
ev: A,
|
|
6983
6969
|
sizeMeta: d,
|
|
6984
6970
|
isSelected: O === v,
|
|
6985
6971
|
onClick: (V) => C(V, O)
|
|
6986
6972
|
},
|
|
6987
|
-
|
|
6973
|
+
A._id || A.id || O
|
|
6988
6974
|
)) }),
|
|
6989
|
-
/* @__PURE__ */ e(Ps, { ev:
|
|
6975
|
+
/* @__PURE__ */ e(Ps, { ev: b, sizeMeta: d })
|
|
6990
6976
|
] })
|
|
6991
6977
|
) : (
|
|
6992
6978
|
// Small/Medium: Simple list only
|
|
6993
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((
|
|
6979
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((A, O) => /* @__PURE__ */ e(
|
|
6994
6980
|
_t,
|
|
6995
6981
|
{
|
|
6996
|
-
ev:
|
|
6982
|
+
ev: A,
|
|
6997
6983
|
sizeMeta: d,
|
|
6998
6984
|
isSelected: O === v,
|
|
6999
6985
|
onClick: (V) => C(V, O)
|
|
7000
6986
|
},
|
|
7001
|
-
|
|
6987
|
+
A._id || A.id || O
|
|
7002
6988
|
)) })
|
|
7003
6989
|
),
|
|
7004
|
-
!
|
|
6990
|
+
!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" }) })
|
|
7005
6991
|
]
|
|
7006
6992
|
}
|
|
7007
6993
|
);
|
|
@@ -7111,10 +7097,10 @@ const Bs = [
|
|
|
7111
7097
|
}
|
|
7112
7098
|
};
|
|
7113
7099
|
function js({ email: t, sizeMeta: a, isSelected: s, onClick: i, onStar: l, onPin: u }) {
|
|
7114
|
-
const o = (
|
|
7115
|
-
|
|
7116
|
-
}, h = (
|
|
7117
|
-
|
|
7100
|
+
const o = (f) => {
|
|
7101
|
+
f.stopPropagation(), l?.(t);
|
|
7102
|
+
}, h = (f) => {
|
|
7103
|
+
f.stopPropagation(), u?.(t);
|
|
7118
7104
|
};
|
|
7119
7105
|
return /* @__PURE__ */ n(
|
|
7120
7106
|
"div",
|
|
@@ -7147,7 +7133,7 @@ function js({ email: t, sizeMeta: a, isSelected: s, onClick: i, onStar: l, onPin
|
|
|
7147
7133
|
/* @__PURE__ */ e("span", { className: `${a.sender} text-zinc-900 dark:text-zinc-100 ${t.unread ? "font-bold" : ""}`, children: t.sender })
|
|
7148
7134
|
] }),
|
|
7149
7135
|
/* @__PURE__ */ n("div", { className: `flex items-center gap-1 ${a.time} text-zinc-500 dark:text-zinc-400`, children: [
|
|
7150
|
-
/* @__PURE__ */ e(
|
|
7136
|
+
/* @__PURE__ */ e(Te, { className: "h-3 w-3" }),
|
|
7151
7137
|
t.time
|
|
7152
7138
|
] })
|
|
7153
7139
|
] }),
|
|
@@ -7168,15 +7154,15 @@ function _s({
|
|
|
7168
7154
|
title: u = "0365 Mails",
|
|
7169
7155
|
emails: o = Bs,
|
|
7170
7156
|
selectedIndex: h = 0,
|
|
7171
|
-
onStar:
|
|
7157
|
+
onStar: f,
|
|
7172
7158
|
onPin: v,
|
|
7173
7159
|
...g
|
|
7174
7160
|
}) {
|
|
7175
|
-
const [r, x] = B(h), d = ue(t),
|
|
7161
|
+
const [r, x] = B(h), d = ue(t), b = he[d], C = Vs[d], T = (V, _) => {
|
|
7176
7162
|
x(_), i?.(V);
|
|
7177
|
-
},
|
|
7163
|
+
}, A = (V) => {
|
|
7178
7164
|
const _ = { ...V, starred: !V.starred };
|
|
7179
|
-
|
|
7165
|
+
f?.(_);
|
|
7180
7166
|
}, O = (V) => {
|
|
7181
7167
|
const _ = { ...V, pinned: !V.pinned };
|
|
7182
7168
|
v?.(_);
|
|
@@ -7184,7 +7170,7 @@ function _s({
|
|
|
7184
7170
|
return /* @__PURE__ */ n(
|
|
7185
7171
|
de,
|
|
7186
7172
|
{
|
|
7187
|
-
className: `flex flex-col ${
|
|
7173
|
+
className: `flex flex-col ${b.card} ${C.wrap}`,
|
|
7188
7174
|
showCheckbox: a,
|
|
7189
7175
|
checkboxPosition: s,
|
|
7190
7176
|
onSelect: i,
|
|
@@ -7192,7 +7178,7 @@ function _s({
|
|
|
7192
7178
|
details: { type: "emails", title: u, count: o?.length ?? 0 },
|
|
7193
7179
|
...g,
|
|
7194
7180
|
children: [
|
|
7195
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
7181
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${b.title}`, children: u }) }),
|
|
7196
7182
|
/* @__PURE__ */ e(ye, { placeholder: "Type to search..." }),
|
|
7197
7183
|
/* @__PURE__ */ e("div", { className: "space-y-0", children: o.map((V, _) => /* @__PURE__ */ e(
|
|
7198
7184
|
js,
|
|
@@ -7200,8 +7186,8 @@ function _s({
|
|
|
7200
7186
|
email: V,
|
|
7201
7187
|
sizeMeta: C,
|
|
7202
7188
|
isSelected: _ === r,
|
|
7203
|
-
onClick: (
|
|
7204
|
-
onStar:
|
|
7189
|
+
onClick: (G) => T(G, _),
|
|
7190
|
+
onStar: A,
|
|
7205
7191
|
onPin: O
|
|
7206
7192
|
},
|
|
7207
7193
|
V._id || V.id || _
|
|
@@ -7235,7 +7221,7 @@ _s.propTypes = {
|
|
|
7235
7221
|
onStar: c.func,
|
|
7236
7222
|
onPin: c.func
|
|
7237
7223
|
};
|
|
7238
|
-
const
|
|
7224
|
+
const Gs = [
|
|
7239
7225
|
{
|
|
7240
7226
|
_id: "contact-1",
|
|
7241
7227
|
name: "Branden Baker",
|
|
@@ -7276,7 +7262,7 @@ const Us = [
|
|
|
7276
7262
|
// building: "Security Building",
|
|
7277
7263
|
// initials: "AM"
|
|
7278
7264
|
// }
|
|
7279
|
-
],
|
|
7265
|
+
], Us = {
|
|
7280
7266
|
sm: {
|
|
7281
7267
|
wrap: "max-w-sm w-full",
|
|
7282
7268
|
searchHeight: "h-8",
|
|
@@ -7323,7 +7309,7 @@ const Us = [
|
|
|
7323
7309
|
// two columns for large screens
|
|
7324
7310
|
}
|
|
7325
7311
|
};
|
|
7326
|
-
function
|
|
7312
|
+
function Gt({ contact: t, sizeMeta: a, isSelected: s, onClick: i }) {
|
|
7327
7313
|
return /* @__PURE__ */ n(
|
|
7328
7314
|
"div",
|
|
7329
7315
|
{
|
|
@@ -7420,13 +7406,13 @@ function Ws({
|
|
|
7420
7406
|
onSelect: i,
|
|
7421
7407
|
identity: l = "_id",
|
|
7422
7408
|
title: u = "Directory",
|
|
7423
|
-
contacts: o =
|
|
7409
|
+
contacts: o = Gs,
|
|
7424
7410
|
selectedIndex: h = 0,
|
|
7425
|
-
...
|
|
7411
|
+
...f
|
|
7426
7412
|
}) {
|
|
7427
|
-
const [v, g] = B(h), r = ue(t), x = he[r], d =
|
|
7428
|
-
g(O), i?.(
|
|
7429
|
-
}, C = o[v] || o[0],
|
|
7413
|
+
const [v, g] = B(h), r = ue(t), x = he[r], d = Us[r], b = (A, O) => {
|
|
7414
|
+
g(O), i?.(A);
|
|
7415
|
+
}, C = o[v] || o[0], T = d.layout === "split";
|
|
7430
7416
|
return /* @__PURE__ */ n(
|
|
7431
7417
|
de,
|
|
7432
7418
|
{
|
|
@@ -7436,20 +7422,20 @@ function Ws({
|
|
|
7436
7422
|
onSelect: i,
|
|
7437
7423
|
identity: l,
|
|
7438
7424
|
details: { type: "directory", title: u, count: o?.length ?? 0 },
|
|
7439
|
-
...
|
|
7425
|
+
...f,
|
|
7440
7426
|
children: [
|
|
7441
7427
|
/* @__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 ${x.title}`, children: u }) }),
|
|
7442
7428
|
/* @__PURE__ */ e(Ys, { sizeMeta: d }),
|
|
7443
|
-
|
|
7444
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((
|
|
7445
|
-
|
|
7429
|
+
T ? /* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0", children: [
|
|
7430
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((A, O) => /* @__PURE__ */ e(
|
|
7431
|
+
Gt,
|
|
7446
7432
|
{
|
|
7447
|
-
contact:
|
|
7433
|
+
contact: A,
|
|
7448
7434
|
sizeMeta: d,
|
|
7449
7435
|
isSelected: O === v,
|
|
7450
|
-
onClick: (V) =>
|
|
7436
|
+
onClick: (V) => b(V, O)
|
|
7451
7437
|
},
|
|
7452
|
-
|
|
7438
|
+
A._id || A.id || O
|
|
7453
7439
|
)) }),
|
|
7454
7440
|
/* @__PURE__ */ e(
|
|
7455
7441
|
qs,
|
|
@@ -7460,15 +7446,15 @@ function Ws({
|
|
|
7460
7446
|
)
|
|
7461
7447
|
] }) : (
|
|
7462
7448
|
// Single column layout for small screens
|
|
7463
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((
|
|
7464
|
-
|
|
7449
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((A, O) => /* @__PURE__ */ e(
|
|
7450
|
+
Gt,
|
|
7465
7451
|
{
|
|
7466
|
-
contact:
|
|
7452
|
+
contact: A,
|
|
7467
7453
|
sizeMeta: d,
|
|
7468
7454
|
isSelected: O === v,
|
|
7469
|
-
onClick: (V) =>
|
|
7455
|
+
onClick: (V) => b(V, O)
|
|
7470
7456
|
},
|
|
7471
|
-
|
|
7457
|
+
A._id || A.id || O
|
|
7472
7458
|
)) })
|
|
7473
7459
|
),
|
|
7474
7460
|
/* @__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" }) })
|
|
@@ -7497,13 +7483,13 @@ Ws.propTypes = {
|
|
|
7497
7483
|
),
|
|
7498
7484
|
selectedIndex: c.number
|
|
7499
7485
|
};
|
|
7500
|
-
const
|
|
7486
|
+
const Ae = (t) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(Number(t || 0));
|
|
7501
7487
|
function Js({ side: t = "left", date: a, title: s, amount: i, kind: l = "payment" }) {
|
|
7502
7488
|
return /* @__PURE__ */ n("div", { className: `rounded-xl border border-zinc-200 dark:border-zinc-800 p-3 ${l === "payment" ? "border-l-4 border-green-500" : "border-l-4 border-rose-500"}`, children: [
|
|
7503
7489
|
/* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: a }),
|
|
7504
7490
|
/* @__PURE__ */ e("div", { className: "mt-1 text-sm text-zinc-700 dark:text-zinc-200", children: s }),
|
|
7505
7491
|
/* @__PURE__ */ n("div", { className: "mt-2 flex items-center justify-between", children: [
|
|
7506
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-semibold", children:
|
|
7492
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-semibold", children: Ae(i) }),
|
|
7507
7493
|
/* @__PURE__ */ e(
|
|
7508
7494
|
"div",
|
|
7509
7495
|
{
|
|
@@ -7556,7 +7542,7 @@ function Qs({
|
|
|
7556
7542
|
title: u = "Account Summary",
|
|
7557
7543
|
termLabel: o = "Spring 2024",
|
|
7558
7544
|
balance: h = 3e3,
|
|
7559
|
-
totalCharges:
|
|
7545
|
+
totalCharges: f = 4440,
|
|
7560
7546
|
totalPayments: v = 1568,
|
|
7561
7547
|
transactions: g = [
|
|
7562
7548
|
{
|
|
@@ -7576,16 +7562,16 @@ function Qs({
|
|
|
7576
7562
|
],
|
|
7577
7563
|
...r
|
|
7578
7564
|
}) {
|
|
7579
|
-
const x = ue(t), d = he[x],
|
|
7565
|
+
const x = ue(t), d = he[x], b = Xs[x];
|
|
7580
7566
|
return /* @__PURE__ */ n(
|
|
7581
7567
|
de,
|
|
7582
7568
|
{
|
|
7583
|
-
className: `flex flex-col ${d.card} ${
|
|
7569
|
+
className: `flex flex-col ${d.card} ${b.wrap}`,
|
|
7584
7570
|
showCheckbox: a,
|
|
7585
7571
|
checkboxPosition: s,
|
|
7586
7572
|
onSelect: i,
|
|
7587
7573
|
identity: l,
|
|
7588
|
-
details: { type: "account-summary", termLabel: o, balance: h, totalCharges:
|
|
7574
|
+
details: { type: "account-summary", termLabel: o, balance: h, totalCharges: f, totalPayments: v },
|
|
7589
7575
|
...r,
|
|
7590
7576
|
children: [
|
|
7591
7577
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
@@ -7595,42 +7581,42 @@ function Qs({
|
|
|
7595
7581
|
/* @__PURE__ */ e(xt, { className: "h-4 w-4 opacity-70" })
|
|
7596
7582
|
] })
|
|
7597
7583
|
] }),
|
|
7598
|
-
/* @__PURE__ */ n("div", { className:
|
|
7584
|
+
/* @__PURE__ */ n("div", { className: b.topGrid || b.grid, children: [
|
|
7599
7585
|
/* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
7600
7586
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Account Balance" }),
|
|
7601
|
-
/* @__PURE__ */ e("div", { className:
|
|
7602
|
-
!
|
|
7587
|
+
/* @__PURE__ */ e("div", { className: b.balance, children: Ae(h) }),
|
|
7588
|
+
!b.showTxns && /* @__PURE__ */ n("div", { className: b.totalsRow, children: [
|
|
7603
7589
|
/* @__PURE__ */ n("div", { children: [
|
|
7604
7590
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
|
|
7605
|
-
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children:
|
|
7591
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Ae(f) })
|
|
7606
7592
|
] }),
|
|
7607
7593
|
/* @__PURE__ */ n("div", { children: [
|
|
7608
7594
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Payments" }),
|
|
7609
|
-
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children:
|
|
7595
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: Ae(v) })
|
|
7610
7596
|
] })
|
|
7611
7597
|
] })
|
|
7612
7598
|
] }),
|
|
7613
|
-
|
|
7614
|
-
/* @__PURE__ */ n("div", { className:
|
|
7599
|
+
b.showTxns && /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
7600
|
+
/* @__PURE__ */ n("div", { className: b.totalsRow, children: [
|
|
7615
7601
|
/* @__PURE__ */ n("div", { children: [
|
|
7616
7602
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
|
|
7617
|
-
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children:
|
|
7603
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Ae(f) })
|
|
7618
7604
|
] }),
|
|
7619
7605
|
/* @__PURE__ */ n("div", { children: [
|
|
7620
7606
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Payments" }),
|
|
7621
|
-
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children:
|
|
7607
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: Ae(v) })
|
|
7622
7608
|
] })
|
|
7623
7609
|
] }),
|
|
7624
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: g.slice(0, 2).map((C,
|
|
7610
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: g.slice(0, 2).map((C, T) => /* @__PURE__ */ e(
|
|
7625
7611
|
Js,
|
|
7626
7612
|
{
|
|
7627
|
-
side:
|
|
7613
|
+
side: T === 0 ? "left" : "right",
|
|
7628
7614
|
date: C.date,
|
|
7629
7615
|
title: C.title,
|
|
7630
7616
|
amount: C.amount,
|
|
7631
7617
|
kind: C.kind
|
|
7632
7618
|
},
|
|
7633
|
-
C.id ||
|
|
7619
|
+
C.id || T
|
|
7634
7620
|
)) })
|
|
7635
7621
|
] })
|
|
7636
7622
|
] }),
|
|
@@ -7638,7 +7624,7 @@ function Qs({
|
|
|
7638
7624
|
"button",
|
|
7639
7625
|
{
|
|
7640
7626
|
type: "button",
|
|
7641
|
-
className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${
|
|
7627
|
+
className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${b.buttonPad}
|
|
7642
7628
|
border-orange-400 text-zinc-900 dark:text-zinc-100 bg-white dark:bg-zinc-900`,
|
|
7643
7629
|
"aria-label": "View Transactions (mock)",
|
|
7644
7630
|
children: [
|
|
@@ -7727,7 +7713,7 @@ const Hs = {
|
|
|
7727
7713
|
]
|
|
7728
7714
|
}
|
|
7729
7715
|
];
|
|
7730
|
-
function
|
|
7716
|
+
function Ut({ leave: t, sizeMeta: a }) {
|
|
7731
7717
|
return /* @__PURE__ */ n("div", { className: "bg-white dark:bg-zinc-900 rounded-lg border border-zinc-200 dark:border-zinc-800 overflow-hidden", children: [
|
|
7732
7718
|
/* @__PURE__ */ e("div", { className: "bg-zinc-50 dark:bg-zinc-800 px-4 py-3 border-b border-zinc-200 dark:border-zinc-700", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
7733
7719
|
/* @__PURE__ */ e("span", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${a.table}`, children: t.name }),
|
|
@@ -7749,11 +7735,11 @@ function Zs({
|
|
|
7749
7735
|
term: o = "Fall 2025",
|
|
7750
7736
|
...h
|
|
7751
7737
|
}) {
|
|
7752
|
-
const [
|
|
7738
|
+
const [f, v] = B("vacation"), [g, r] = B(!1), x = ue(t), d = he[x], b = Hs[x], C = Je.find((T) => T.id === f) || Je[0];
|
|
7753
7739
|
return /* @__PURE__ */ n(
|
|
7754
7740
|
de,
|
|
7755
7741
|
{
|
|
7756
|
-
className: `flex flex-col ${d.card} ${
|
|
7742
|
+
className: `flex flex-col ${d.card} ${b.wrap}`,
|
|
7757
7743
|
showCheckbox: a,
|
|
7758
7744
|
checkboxPosition: s,
|
|
7759
7745
|
onSelect: i,
|
|
@@ -7763,8 +7749,8 @@ function Zs({
|
|
|
7763
7749
|
children: [
|
|
7764
7750
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
7765
7751
|
/* @__PURE__ */ n("div", { children: [
|
|
7766
|
-
/* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${
|
|
7767
|
-
/* @__PURE__ */ n("div", { className: `text-zinc-600 dark:text-zinc-400 ${
|
|
7752
|
+
/* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${b.title} mb-1`, children: u }),
|
|
7753
|
+
/* @__PURE__ */ n("div", { className: `text-zinc-600 dark:text-zinc-400 ${b.term} flex items-center gap-2`, children: [
|
|
7768
7754
|
/* @__PURE__ */ e(Wt, { className: "h-4 w-4" }),
|
|
7769
7755
|
"Term - ",
|
|
7770
7756
|
o
|
|
@@ -7785,28 +7771,28 @@ function Zs({
|
|
|
7785
7771
|
] })
|
|
7786
7772
|
] })
|
|
7787
7773
|
] }),
|
|
7788
|
-
|
|
7774
|
+
b.showTabs && /* @__PURE__ */ e("div", { className: "flex border-b border-zinc-200 dark:border-zinc-800", children: Je.map((T) => /* @__PURE__ */ e(
|
|
7789
7775
|
"button",
|
|
7790
7776
|
{
|
|
7791
|
-
className: `flex-1 py-2 px-4 text-center ${
|
|
7792
|
-
onClick: () => v(
|
|
7793
|
-
children:
|
|
7777
|
+
className: `flex-1 py-2 px-4 text-center ${b.tab} font-medium border-b-2 transition-colors duration-200 ${f === 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"}`,
|
|
7778
|
+
onClick: () => v(T.id),
|
|
7779
|
+
children: T.name.split(" ")[0]
|
|
7794
7780
|
},
|
|
7795
|
-
|
|
7781
|
+
T.id
|
|
7796
7782
|
)) }),
|
|
7797
|
-
/* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children:
|
|
7783
|
+
/* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children: b.showAllLeave ? (
|
|
7798
7784
|
// LG: Show all leave types
|
|
7799
|
-
Je.map((
|
|
7800
|
-
) :
|
|
7785
|
+
Je.map((T) => /* @__PURE__ */ e(Ut, { leave: T, sizeMeta: b }, T.id))
|
|
7786
|
+
) : b.showSingleLeave ? (
|
|
7801
7787
|
// MD: Show active tab leave type
|
|
7802
|
-
/* @__PURE__ */ e(
|
|
7788
|
+
/* @__PURE__ */ e(Ut, { leave: C, sizeMeta: b })
|
|
7803
7789
|
) : (
|
|
7804
7790
|
// SM: Show only available hours
|
|
7805
7791
|
/* @__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: [
|
|
7806
|
-
/* @__PURE__ */ e(
|
|
7792
|
+
/* @__PURE__ */ e(Te, { className: "h-5 w-5 text-blue-600 dark:text-blue-400" }),
|
|
7807
7793
|
/* @__PURE__ */ n("div", { children: [
|
|
7808
|
-
/* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${
|
|
7809
|
-
/* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${
|
|
7794
|
+
/* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${b.table}`, children: "Available Leave" }),
|
|
7795
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${b.table}`, children: C.available })
|
|
7810
7796
|
] })
|
|
7811
7797
|
] }) })
|
|
7812
7798
|
) }),
|
|
@@ -7940,7 +7926,7 @@ function al({
|
|
|
7940
7926
|
subtitle: o = "Drive Shared",
|
|
7941
7927
|
...h
|
|
7942
7928
|
}) {
|
|
7943
|
-
const [
|
|
7929
|
+
const [f, v] = B(!1), g = ue(t), r = he[g], x = tl[g];
|
|
7944
7930
|
return /* @__PURE__ */ n(
|
|
7945
7931
|
de,
|
|
7946
7932
|
{
|
|
@@ -7962,11 +7948,11 @@ function al({
|
|
|
7962
7948
|
"button",
|
|
7963
7949
|
{
|
|
7964
7950
|
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",
|
|
7965
|
-
onClick: () => v(!
|
|
7951
|
+
onClick: () => v(!f),
|
|
7966
7952
|
children: /* @__PURE__ */ e(Zt, { className: "h-4 w-4" })
|
|
7967
7953
|
}
|
|
7968
7954
|
),
|
|
7969
|
-
|
|
7955
|
+
f && /* @__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: [
|
|
7970
7956
|
/* @__PURE__ */ n("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 flex items-center gap-2", children: [
|
|
7971
7957
|
/* @__PURE__ */ e(ra, { className: "h-4 w-4" }),
|
|
7972
7958
|
"Download All"
|
|
@@ -8147,7 +8133,7 @@ function ll({ alert: t, sizeMeta: a, onDismiss: s, onMarkRead: i }) {
|
|
|
8147
8133
|
/* @__PURE__ */ e("div", { className: `${a.title} text-zinc-900 dark:text-zinc-100 mb-1 ${t.read ? "font-medium" : "font-semibold"}`, children: Yt(t.title, a.maxTitleWords) }),
|
|
8148
8134
|
a.showMessage && t.message && /* @__PURE__ */ e("div", { className: `${a.message} text-zinc-600 dark:text-zinc-400 mb-2 leading-relaxed`, children: Yt(t.message, a.maxMessageWords) }),
|
|
8149
8135
|
/* @__PURE__ */ n("div", { className: `flex items-center gap-1 ${a.time} text-zinc-500 dark:text-zinc-400`, children: [
|
|
8150
|
-
/* @__PURE__ */ e(
|
|
8136
|
+
/* @__PURE__ */ e(Te, { className: "h-3 w-3" }),
|
|
8151
8137
|
t.time
|
|
8152
8138
|
] })
|
|
8153
8139
|
] })
|
|
@@ -8184,11 +8170,11 @@ function ol({
|
|
|
8184
8170
|
title: u = "Alerts",
|
|
8185
8171
|
alerts: o = rl,
|
|
8186
8172
|
showBanner: h = !0,
|
|
8187
|
-
...
|
|
8173
|
+
...f
|
|
8188
8174
|
}) {
|
|
8189
|
-
const [v, g] = B(o), r = ue(t), x = he[r], d = nl[r],
|
|
8190
|
-
g((O) => O.filter((V) => V.id !==
|
|
8191
|
-
}, C = v.find((
|
|
8175
|
+
const [v, g] = B(o), r = ue(t), x = he[r], d = nl[r], b = (A) => {
|
|
8176
|
+
g((O) => O.filter((V) => V.id !== A.id));
|
|
8177
|
+
}, C = v.find((A) => A.type === "banner"), T = v.filter((A) => A.type !== "banner");
|
|
8192
8178
|
return /* @__PURE__ */ n(
|
|
8193
8179
|
de,
|
|
8194
8180
|
{
|
|
@@ -8198,24 +8184,24 @@ function ol({
|
|
|
8198
8184
|
onSelect: i,
|
|
8199
8185
|
identity: l,
|
|
8200
8186
|
details: { type: "alerts", title: u, count: v.length },
|
|
8201
|
-
...
|
|
8187
|
+
...f,
|
|
8202
8188
|
children: [
|
|
8203
8189
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between ", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${x.title}`, children: u }) }),
|
|
8204
8190
|
h && C && t !== "sm" && /* @__PURE__ */ e(
|
|
8205
8191
|
il,
|
|
8206
8192
|
{
|
|
8207
8193
|
alert: C,
|
|
8208
|
-
onDismiss:
|
|
8194
|
+
onDismiss: b
|
|
8209
8195
|
}
|
|
8210
8196
|
),
|
|
8211
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children:
|
|
8197
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: T.slice(0, 3).map((A) => /* @__PURE__ */ e(
|
|
8212
8198
|
ll,
|
|
8213
8199
|
{
|
|
8214
|
-
alert:
|
|
8200
|
+
alert: A,
|
|
8215
8201
|
sizeMeta: d,
|
|
8216
|
-
onDismiss:
|
|
8202
|
+
onDismiss: b
|
|
8217
8203
|
},
|
|
8218
|
-
|
|
8204
|
+
A.id
|
|
8219
8205
|
)) }),
|
|
8220
8206
|
/* @__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" })
|
|
8221
8207
|
]
|
|
@@ -8345,7 +8331,7 @@ function ml({ video: t, sizeMeta: a }) {
|
|
|
8345
8331
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
8346
8332
|
/* @__PURE__ */ e("span", { className: `text-xs text-zinc-500 dark:text-zinc-400 ${a.description}`, children: t.category }),
|
|
8347
8333
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 text-xs text-zinc-500 dark:text-zinc-400", children: [
|
|
8348
|
-
/* @__PURE__ */ e(
|
|
8334
|
+
/* @__PURE__ */ e(Te, { className: "h-3 w-3" }),
|
|
8349
8335
|
t.duration
|
|
8350
8336
|
] })
|
|
8351
8337
|
] })
|
|
@@ -8362,7 +8348,7 @@ function ul({
|
|
|
8362
8348
|
videos: o = cl,
|
|
8363
8349
|
...h
|
|
8364
8350
|
}) {
|
|
8365
|
-
const [
|
|
8351
|
+
const [f, v] = B(!1), g = ue(t), r = he[g], x = dl[g];
|
|
8366
8352
|
return /* @__PURE__ */ n(
|
|
8367
8353
|
de,
|
|
8368
8354
|
{
|
|
@@ -8381,14 +8367,14 @@ function ul({
|
|
|
8381
8367
|
"button",
|
|
8382
8368
|
{
|
|
8383
8369
|
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",
|
|
8384
|
-
onClick: () => v(!
|
|
8370
|
+
onClick: () => v(!f),
|
|
8385
8371
|
children: [
|
|
8386
8372
|
"Filter",
|
|
8387
8373
|
/* @__PURE__ */ e(ve, { className: "h-4 w-4 transform rotate-90" })
|
|
8388
8374
|
]
|
|
8389
8375
|
}
|
|
8390
8376
|
),
|
|
8391
|
-
|
|
8377
|
+
f && /* @__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: [
|
|
8392
8378
|
/* @__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: "All Videos" }),
|
|
8393
8379
|
/* @__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: "Campus Life" }),
|
|
8394
8380
|
/* @__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: "Academic" }),
|
|
@@ -8454,8 +8440,8 @@ export {
|
|
|
8454
8440
|
fs as DynamicConfig,
|
|
8455
8441
|
Ls as EventsMock,
|
|
8456
8442
|
zl as FileUploadModal,
|
|
8457
|
-
|
|
8458
|
-
|
|
8443
|
+
Ul as FullConfigPage,
|
|
8444
|
+
Al as FullScreenLoader,
|
|
8459
8445
|
Sl as GenericFilter,
|
|
8460
8446
|
ze as IconButton,
|
|
8461
8447
|
H as Input,
|
|
@@ -8478,7 +8464,7 @@ export {
|
|
|
8478
8464
|
da as Textarea,
|
|
8479
8465
|
ql as ToastProvider,
|
|
8480
8466
|
ma as ToggleSwitch,
|
|
8481
|
-
|
|
8467
|
+
Tl as Tooltip,
|
|
8482
8468
|
jl as TreeView,
|
|
8483
8469
|
ie as UnifyedCoreButton,
|
|
8484
8470
|
ul as VideosMock,
|
|
@@ -8507,6 +8493,6 @@ export {
|
|
|
8507
8493
|
ya as searchRolesApi,
|
|
8508
8494
|
Rl as sessionStore,
|
|
8509
8495
|
he as sizeClasses,
|
|
8510
|
-
|
|
8496
|
+
Gl as toBrowserLocalTime,
|
|
8511
8497
|
pa as userSearchBase
|
|
8512
8498
|
};
|