unifyedx-storybook-new 0.2.89 → 0.2.90
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 +867 -883
- 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,43 @@ 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:
|
|
2678
|
+
control: G,
|
|
2680
2679
|
name: "pendingInvites"
|
|
2681
2680
|
}), P = J("pendingInvites");
|
|
2682
2681
|
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
|
-
|
|
2682
|
+
x.length > 1 ? (O(!0), Yn(f.name, x).then((y) => {
|
|
2683
|
+
b(y);
|
|
2684
|
+
}).catch((y) => console.error("Search failed:", y)).finally(() => O(!1))) : (b([]), T(/* @__PURE__ */ new Set()));
|
|
2685
|
+
}, [x, f]);
|
|
2686
|
+
const $ = (y) => {
|
|
2687
|
+
T((N) => {
|
|
2689
2688
|
const R = new Set(N);
|
|
2690
2689
|
return R.has(y) ? R.delete(y) : R.add(y), R;
|
|
2691
2690
|
});
|
|
2692
2691
|
}, p = () => {
|
|
2693
2692
|
d.filter((y) => C.has(y.id)).forEach((y) => {
|
|
2694
2693
|
F.find((N) => N.id === y.id) || m({ ...y, permission: V.name });
|
|
2695
|
-
}),
|
|
2696
|
-
},
|
|
2694
|
+
}), T(/* @__PURE__ */ new Set()), r("");
|
|
2695
|
+
}, z = (y) => {
|
|
2697
2696
|
_(y), F.forEach(
|
|
2698
2697
|
(N, R) => L(R, { ...F[R], permission: y.name })
|
|
2699
2698
|
);
|
|
2700
2699
|
}, I = async (y) => {
|
|
2701
2700
|
try {
|
|
2702
2701
|
if (l === pe.DRIVE) {
|
|
2703
|
-
const N = y.pendingInvites.map((
|
|
2704
|
-
id:
|
|
2705
|
-
permission:
|
|
2706
|
-
type:
|
|
2702
|
+
const N = y.pendingInvites.map((D) => ({
|
|
2703
|
+
id: D.id,
|
|
2704
|
+
permission: D.permission,
|
|
2705
|
+
type: D.type.toLowerCase()
|
|
2707
2706
|
}));
|
|
2708
2707
|
o({
|
|
2709
2708
|
entity: t,
|
|
@@ -2723,10 +2722,10 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2723
2722
|
}));
|
|
2724
2723
|
o(N, i);
|
|
2725
2724
|
} else if (l === pe.ARTICLE) {
|
|
2726
|
-
const N = y.pendingInvites.map((
|
|
2727
|
-
id:
|
|
2728
|
-
permission:
|
|
2729
|
-
type:
|
|
2725
|
+
const N = y.pendingInvites.map((D) => ({
|
|
2726
|
+
id: D.id,
|
|
2727
|
+
permission: D.permission,
|
|
2728
|
+
type: D.type.toLowerCase()
|
|
2730
2729
|
}));
|
|
2731
2730
|
o({
|
|
2732
2731
|
entity: t,
|
|
@@ -2742,9 +2741,9 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2742
2741
|
throw console.error("Failed to submit invites:", N), N;
|
|
2743
2742
|
}
|
|
2744
2743
|
}, w = (y) => {
|
|
2745
|
-
const N = i[
|
|
2744
|
+
const N = i[f.code].find((R) => R.name === y.name && R.permission !== "remove") || P.find((R) => R.name === y.name);
|
|
2746
2745
|
return N ? `${N.permission}` : "";
|
|
2747
|
-
},
|
|
2746
|
+
}, S = () => {
|
|
2748
2747
|
switch (l) {
|
|
2749
2748
|
case pe.DRIVE:
|
|
2750
2749
|
return "Share with others";
|
|
@@ -2758,7 +2757,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2758
2757
|
};
|
|
2759
2758
|
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
2759
|
/* @__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:
|
|
2760
|
+
/* @__PURE__ */ e(xe.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: S() }),
|
|
2762
2761
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
|
|
2763
2762
|
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
2763
|
/* @__PURE__ */ e(er, { className: "h-5 w-5" }),
|
|
@@ -2785,11 +2784,11 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2785
2784
|
}
|
|
2786
2785
|
),
|
|
2787
2786
|
/* @__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:
|
|
2787
|
+
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(oe, { value: f, onChange: v, children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2789
2788
|
/* @__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
2789
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
2791
|
-
/* @__PURE__ */ e(
|
|
2792
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2790
|
+
/* @__PURE__ */ e(f.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2791
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: f.name })
|
|
2793
2792
|
] }),
|
|
2794
2793
|
/* @__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
2794
|
] }),
|
|
@@ -2832,12 +2831,12 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2832
2831
|
/* @__PURE__ */ e("div", { className: "col-span-2", children: /* @__PURE__ */ e(
|
|
2833
2832
|
ye,
|
|
2834
2833
|
{
|
|
2835
|
-
placeholder: `Search by ${
|
|
2834
|
+
placeholder: `Search by ${f.name.toLowerCase()}...`,
|
|
2836
2835
|
onDebouncedChange: (y) => r(y),
|
|
2837
2836
|
value: g
|
|
2838
2837
|
}
|
|
2839
2838
|
) }),
|
|
2840
|
-
/* @__PURE__ */ e(De, { children: (d?.length > 0 ||
|
|
2839
|
+
/* @__PURE__ */ e(De, { children: (d?.length > 0 || A) && /* @__PURE__ */ e(
|
|
2841
2840
|
ce.div,
|
|
2842
2841
|
{
|
|
2843
2842
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2845,13 +2844,13 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2845
2844
|
exit: { opacity: 0, y: -10 },
|
|
2846
2845
|
transition: { duration: 0.2 },
|
|
2847
2846
|
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:
|
|
2847
|
+
children: A ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(re, { children: [
|
|
2849
2848
|
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((y) => {
|
|
2850
2849
|
const N = w(y);
|
|
2851
2850
|
return /* @__PURE__ */ n(
|
|
2852
2851
|
"div",
|
|
2853
2852
|
{
|
|
2854
|
-
onClick: () => N ? null :
|
|
2853
|
+
onClick: () => N ? null : $(y.id),
|
|
2855
2854
|
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${N ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2856
2855
|
children: [
|
|
2857
2856
|
/* @__PURE__ */ e(
|
|
@@ -2867,7 +2866,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2867
2866
|
/* @__PURE__ */ e(we, { src: y.avatarUrl, name: y.name, size: "small" }),
|
|
2868
2867
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
2869
2868
|
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: y.name }),
|
|
2870
|
-
|
|
2869
|
+
f.name === $e.USER && /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: y.id })
|
|
2871
2870
|
] }),
|
|
2872
2871
|
N ? /* @__PURE__ */ n(re, { children: [
|
|
2873
2872
|
/* @__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 +2917,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
2918
2917
|
oe,
|
|
2919
2918
|
{
|
|
2920
2919
|
value: V,
|
|
2921
|
-
onChange:
|
|
2920
|
+
onChange: z,
|
|
2922
2921
|
children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2923
2922
|
/* @__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
2923
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
@@ -3038,8 +3037,8 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3038
3037
|
ie,
|
|
3039
3038
|
{
|
|
3040
3039
|
onClick: () => W(I)(),
|
|
3041
|
-
disabled:
|
|
3042
|
-
label:
|
|
3040
|
+
disabled: U || P.length === 0 && !h,
|
|
3041
|
+
label: U ? "Inviting..." : l === pe.DRIVE ? "Send Invites" : "Add"
|
|
3043
3042
|
}
|
|
3044
3043
|
)
|
|
3045
3044
|
] })
|
|
@@ -3054,24 +3053,24 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3054
3053
|
existingShares: l,
|
|
3055
3054
|
allowedPermissions: u
|
|
3056
3055
|
}) => {
|
|
3057
|
-
const [o, h] = B(l), [
|
|
3056
|
+
const [o, h] = B(l), [f, v] = B(0), [g, r] = B(""), x = kt(g, 300), d = {
|
|
3058
3057
|
users: o.users.filter(
|
|
3059
|
-
(
|
|
3058
|
+
(A) => A.name.toLowerCase().includes(x.toLowerCase())
|
|
3060
3059
|
),
|
|
3061
3060
|
groups: o.groups.filter(
|
|
3062
|
-
(
|
|
3061
|
+
(A) => A.name.toLowerCase().includes(x.toLowerCase())
|
|
3063
3062
|
),
|
|
3064
3063
|
roles: o.roles.filter(
|
|
3065
|
-
(
|
|
3064
|
+
(A) => A.name.toLowerCase().includes(x.toLowerCase())
|
|
3066
3065
|
)
|
|
3067
|
-
},
|
|
3068
|
-
console.log("[ManageFlow] Removing item:", { itemToRemove:
|
|
3066
|
+
}, b = (A, O) => {
|
|
3067
|
+
console.log("[ManageFlow] Removing item:", { itemToRemove: A, listKey: O });
|
|
3069
3068
|
const V = {
|
|
3070
3069
|
...o,
|
|
3071
|
-
[O]: o[O].filter((_) => _.id !==
|
|
3070
|
+
[O]: o[O].filter((_) => _.id !== A.id)
|
|
3072
3071
|
};
|
|
3073
3072
|
h(V), console.log("[ManageFlow] Syncing updated shares with parent:", V), a(V, !0);
|
|
3074
|
-
}, C = ["users", "groups", "roles"],
|
|
3073
|
+
}, C = ["users", "groups", "roles"], T = ["Users", "Groups", "Roles"];
|
|
3075
3074
|
return (
|
|
3076
3075
|
// The main structure remains the same...
|
|
3077
3076
|
/* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-gray-50", children: [
|
|
@@ -3097,9 +3096,9 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3097
3096
|
}
|
|
3098
3097
|
)
|
|
3099
3098
|
] }),
|
|
3100
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col flex-grow", children: /* @__PURE__ */ n(le.Group, { selectedIndex:
|
|
3099
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col flex-grow", children: /* @__PURE__ */ n(le.Group, { selectedIndex: f, onChange: v, children: [
|
|
3101
3100
|
/* @__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:
|
|
3101
|
+
/* @__PURE__ */ e(le.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: T.map((A) => /* @__PURE__ */ e(
|
|
3103
3102
|
le,
|
|
3104
3103
|
{
|
|
3105
3104
|
className: ({
|
|
@@ -3107,16 +3106,16 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3107
3106
|
}) => `w-full py-2 text-sm font-medium leading-5 rounded-md
|
|
3108
3107
|
focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
|
|
3109
3108
|
${O ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
|
|
3110
|
-
children:
|
|
3109
|
+
children: A
|
|
3111
3110
|
},
|
|
3112
|
-
|
|
3111
|
+
A
|
|
3113
3112
|
)) }),
|
|
3114
3113
|
/* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
|
|
3115
3114
|
ye,
|
|
3116
3115
|
{
|
|
3117
3116
|
onDebouncedChange: r,
|
|
3118
3117
|
value: g,
|
|
3119
|
-
placeholder: `Search in ${
|
|
3118
|
+
placeholder: `Search in ${T[f]}...`
|
|
3120
3119
|
}
|
|
3121
3120
|
) })
|
|
3122
3121
|
] }),
|
|
@@ -3127,11 +3126,11 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3127
3126
|
animate: { y: 0, opacity: 1 },
|
|
3128
3127
|
exit: { y: -10, opacity: 0 },
|
|
3129
3128
|
transition: { duration: 0.2 },
|
|
3130
|
-
children: /* @__PURE__ */ e(le.Panels, { as: ee, children: C.map((
|
|
3129
|
+
children: /* @__PURE__ */ e(le.Panels, { as: ee, children: C.map((A) => /* @__PURE__ */ e(
|
|
3131
3130
|
le.Panel,
|
|
3132
3131
|
{
|
|
3133
3132
|
className: "space-y-3 focus:outline-none",
|
|
3134
|
-
children: /* @__PURE__ */ e(De, { children: d[
|
|
3133
|
+
children: /* @__PURE__ */ e(De, { children: d[A].length > 0 ? d[A].map((O) => /* @__PURE__ */ n(
|
|
3135
3134
|
ce.div,
|
|
3136
3135
|
{
|
|
3137
3136
|
layout: !0,
|
|
@@ -3155,12 +3154,12 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3155
3154
|
),
|
|
3156
3155
|
/* @__PURE__ */ n("div", { className: "overflow-hidden", children: [
|
|
3157
3156
|
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: O.name }),
|
|
3158
|
-
|
|
3157
|
+
A !== "users" && /* @__PURE__ */ e(
|
|
3159
3158
|
"button",
|
|
3160
3159
|
{
|
|
3161
3160
|
onClick: () => i({
|
|
3162
3161
|
id: O.id,
|
|
3163
|
-
type:
|
|
3162
|
+
type: A,
|
|
3164
3163
|
name: O.name
|
|
3165
3164
|
}),
|
|
3166
3165
|
className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
|
|
@@ -3172,7 +3171,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3172
3171
|
/* @__PURE__ */ e(
|
|
3173
3172
|
"button",
|
|
3174
3173
|
{
|
|
3175
|
-
onClick: () =>
|
|
3174
|
+
onClick: () => b(O, A),
|
|
3176
3175
|
className: "text-gray-400 hover:text-red-500 hover:cursor-pointer p-1 rounded-full hover:bg-red-50",
|
|
3177
3176
|
title: "Remove access",
|
|
3178
3177
|
children: /* @__PURE__ */ e(Ve, { className: "h-5 w-5" })
|
|
@@ -3193,19 +3192,19 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3193
3192
|
/* @__PURE__ */ e(Kt, { className: "h-12 w-12 text-gray-400" }),
|
|
3194
3193
|
/* @__PURE__ */ n("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
|
|
3195
3194
|
"No ",
|
|
3196
|
-
|
|
3195
|
+
T[f],
|
|
3197
3196
|
" Found"
|
|
3198
3197
|
] }),
|
|
3199
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: g ? `No results for "${g}"` : `There are no ${
|
|
3198
|
+
/* @__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
3199
|
]
|
|
3201
3200
|
}
|
|
3202
3201
|
)
|
|
3203
3202
|
) })
|
|
3204
3203
|
},
|
|
3205
|
-
|
|
3204
|
+
A
|
|
3206
3205
|
)) })
|
|
3207
3206
|
},
|
|
3208
|
-
|
|
3207
|
+
f
|
|
3209
3208
|
) }) })
|
|
3210
3209
|
] }) })
|
|
3211
3210
|
] })
|
|
@@ -3223,8 +3222,8 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3223
3222
|
onClose: s,
|
|
3224
3223
|
members: i
|
|
3225
3224
|
}) => {
|
|
3226
|
-
const [l, u] = B(!0), [o, h] = B(""),
|
|
3227
|
-
(d) => d.name.toLowerCase().includes(
|
|
3225
|
+
const [l, u] = B(!0), [o, h] = B(""), f = kt(o, 300), v = i.filter(
|
|
3226
|
+
(d) => d.name.toLowerCase().includes(f.toLowerCase())
|
|
3228
3227
|
), g = {
|
|
3229
3228
|
hidden: { opacity: 0 },
|
|
3230
3229
|
visible: {
|
|
@@ -3239,7 +3238,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3239
3238
|
exit: { opacity: 0, x: -20 }
|
|
3240
3239
|
}, x = () => l ? (
|
|
3241
3240
|
// Show 5 skeleton items while loading
|
|
3242
|
-
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d,
|
|
3241
|
+
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d, b) => /* @__PURE__ */ e(Zn, {}, b)) })
|
|
3243
3242
|
) : v.length === 0 ? /* @__PURE__ */ n(
|
|
3244
3243
|
ce.div,
|
|
3245
3244
|
{
|
|
@@ -3249,7 +3248,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3249
3248
|
children: [
|
|
3250
3249
|
/* @__PURE__ */ e(ar, { className: "h-12 w-12 text-gray-400" }),
|
|
3251
3250
|
/* @__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:
|
|
3251
|
+
/* @__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
3252
|
]
|
|
3254
3253
|
}
|
|
3255
3254
|
) : /* @__PURE__ */ e(
|
|
@@ -3342,10 +3341,10 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3342
3341
|
},
|
|
3343
3342
|
showExistingShares: o = !0,
|
|
3344
3343
|
allowedPermissions: h = [],
|
|
3345
|
-
...
|
|
3344
|
+
...f
|
|
3346
3345
|
}) => {
|
|
3347
|
-
const [v, g] = B(be.INVITE), [r, x] = B(t), [d,
|
|
3348
|
-
g(be.INVITE),
|
|
3346
|
+
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 = () => {
|
|
3347
|
+
g(be.INVITE), b(null), u();
|
|
3349
3348
|
}, W = () => {
|
|
3350
3349
|
g(be.MANAGE);
|
|
3351
3350
|
}, J = async ({ id: F, name: m, type: k }) => {
|
|
@@ -3357,15 +3356,15 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3357
3356
|
}
|
|
3358
3357
|
O(resp);
|
|
3359
3358
|
}
|
|
3360
|
-
|
|
3359
|
+
b({ id: F, type: k, name: m }), _(v), g(be.MEMBERS);
|
|
3361
3360
|
}, E = (F, m = !1) => {
|
|
3362
3361
|
console.log("changedExistingShares", F), x(F);
|
|
3363
|
-
const k = ot.mapValues(t, (
|
|
3362
|
+
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
3363
|
console.log("Existing data:", k), console.log("Changed data:", L);
|
|
3365
3364
|
const P = !ot.isEqual(k, L);
|
|
3366
|
-
console.log("hasPermissionChanged:", P),
|
|
3365
|
+
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
3366
|
};
|
|
3368
|
-
return /* @__PURE__ */ e(fe, { appear: !0, show: a, as: ee, children: /* @__PURE__ */ n(xe, { as: "div", className: "relative z-50", onClose:
|
|
3367
|
+
return /* @__PURE__ */ e(fe, { appear: !0, show: a, as: ee, children: /* @__PURE__ */ n(xe, { as: "div", className: "relative z-50", onClose: G, children: [
|
|
3369
3368
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
3370
3369
|
/* @__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
3370
|
switch (v) {
|
|
@@ -3383,7 +3382,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3383
3382
|
{
|
|
3384
3383
|
entity: i,
|
|
3385
3384
|
onBack: E,
|
|
3386
|
-
onClose:
|
|
3385
|
+
onClose: G,
|
|
3387
3386
|
onOpenMembers: J,
|
|
3388
3387
|
existingShares: r,
|
|
3389
3388
|
calledBy: l,
|
|
@@ -3407,10 +3406,10 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3407
3406
|
{
|
|
3408
3407
|
entity: d,
|
|
3409
3408
|
onBack: E,
|
|
3410
|
-
onClose:
|
|
3409
|
+
onClose: G,
|
|
3411
3410
|
calledBy: l,
|
|
3412
3411
|
existingShares: r,
|
|
3413
|
-
members:
|
|
3412
|
+
members: A
|
|
3414
3413
|
}
|
|
3415
3414
|
)
|
|
3416
3415
|
},
|
|
@@ -3430,7 +3429,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
|
|
|
3430
3429
|
{
|
|
3431
3430
|
entity: i,
|
|
3432
3431
|
onManage: W,
|
|
3433
|
-
onClose:
|
|
3432
|
+
onClose: G,
|
|
3434
3433
|
existingShares: r,
|
|
3435
3434
|
calledBy: l,
|
|
3436
3435
|
showExistingShares: o,
|
|
@@ -3461,7 +3460,7 @@ function rt({
|
|
|
3461
3460
|
placeholder: u = "Select options",
|
|
3462
3461
|
error: o = null,
|
|
3463
3462
|
displayLimit: h = 3,
|
|
3464
|
-
selectionLimit:
|
|
3463
|
+
selectionLimit: f = -1,
|
|
3465
3464
|
// NEW: search behavior
|
|
3466
3465
|
searchMode: v = "client",
|
|
3467
3466
|
// "client" | "server"
|
|
@@ -3471,30 +3470,30 @@ function rt({
|
|
|
3471
3470
|
minSearchChars: x = 2,
|
|
3472
3471
|
// NEW: mappers (id/label keys)
|
|
3473
3472
|
getOptionId: d = (C) => String(C.id),
|
|
3474
|
-
getOptionLabel:
|
|
3473
|
+
getOptionLabel: b = (C) => C.name
|
|
3475
3474
|
}) {
|
|
3476
|
-
const C = Ze(),
|
|
3475
|
+
const C = Ze(), T = Ze(), [A, O] = B(""), V = ge(""), _ = ae(() => {
|
|
3477
3476
|
const F = /* @__PURE__ */ new Map();
|
|
3478
3477
|
for (const m of a) F.set(d(m), m);
|
|
3479
3478
|
return F;
|
|
3480
|
-
}, [a, d]),
|
|
3481
|
-
if (!
|
|
3482
|
-
const F =
|
|
3483
|
-
return a.filter((m) =>
|
|
3484
|
-
}, [a,
|
|
3479
|
+
}, [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(() => {
|
|
3480
|
+
if (!A) return a;
|
|
3481
|
+
const F = A.toLowerCase();
|
|
3482
|
+
return a.filter((m) => b(m).toLowerCase().includes(F));
|
|
3483
|
+
}, [a, A, b]);
|
|
3485
3484
|
te(() => {
|
|
3486
|
-
v === "server" &&
|
|
3487
|
-
}, [
|
|
3485
|
+
v === "server" && A.length >= x && A !== V.current && (V.current = A, g && g(A));
|
|
3486
|
+
}, [A, v, x, g]);
|
|
3488
3487
|
const J = v === "client" ? W : a, E = () => {
|
|
3489
|
-
if (!
|
|
3488
|
+
if (!G.length)
|
|
3490
3489
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
|
|
3491
|
-
const F =
|
|
3490
|
+
const F = G.slice(0, h), m = G.length - h;
|
|
3492
3491
|
return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2", children: [
|
|
3493
3492
|
F.map((k) => /* @__PURE__ */ e(
|
|
3494
3493
|
"span",
|
|
3495
3494
|
{
|
|
3496
3495
|
className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
|
|
3497
|
-
children:
|
|
3496
|
+
children: b(k)
|
|
3498
3497
|
},
|
|
3499
3498
|
d(k)
|
|
3500
3499
|
)),
|
|
@@ -3505,9 +3504,9 @@ function rt({
|
|
|
3505
3504
|
] })
|
|
3506
3505
|
] });
|
|
3507
3506
|
};
|
|
3508
|
-
return /* @__PURE__ */ e(oe, { value:
|
|
3507
|
+
return /* @__PURE__ */ e(oe, { value: G, onChange: (F) => {
|
|
3509
3508
|
const m = Array.from(new Set(F.map((k) => d(k))));
|
|
3510
|
-
|
|
3509
|
+
f !== -1 && m.length > f || i(m);
|
|
3511
3510
|
}, multiple: !0, by: "id", children: ({ open: F }) => /* @__PURE__ */ n("div", { children: [
|
|
3512
3511
|
/* @__PURE__ */ e(
|
|
3513
3512
|
oe.Label,
|
|
@@ -3523,7 +3522,7 @@ function rt({
|
|
|
3523
3522
|
{
|
|
3524
3523
|
"aria-labelledby": C,
|
|
3525
3524
|
"aria-invalid": !!o,
|
|
3526
|
-
"aria-describedby": o ?
|
|
3525
|
+
"aria-describedby": o ? T : void 0,
|
|
3527
3526
|
onBlur: l,
|
|
3528
3527
|
className: Ye(
|
|
3529
3528
|
"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 +3546,24 @@ function rt({
|
|
|
3547
3546
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3548
3547
|
ye,
|
|
3549
3548
|
{
|
|
3550
|
-
value:
|
|
3549
|
+
value: A,
|
|
3551
3550
|
onDebouncedChange: O,
|
|
3552
3551
|
placeholder: v === "server" ? `Search (min ${x})…` : "Search options…"
|
|
3553
3552
|
}
|
|
3554
3553
|
) }),
|
|
3555
3554
|
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 =
|
|
3555
|
+
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) => {
|
|
3556
|
+
const k = d(m), L = b(m), P = G.some((p) => d(p) === k), $ = f !== -1 && G.length >= f && !P;
|
|
3558
3557
|
return /* @__PURE__ */ e(
|
|
3559
3558
|
oe.Option,
|
|
3560
3559
|
{
|
|
3561
3560
|
value: m,
|
|
3562
|
-
disabled:
|
|
3561
|
+
disabled: $,
|
|
3563
3562
|
className: ({ active: p }) => Ye(
|
|
3564
|
-
|
|
3563
|
+
$ ? " text-gray-400 bg-white cursor-not-allowed" : p ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3565
3564
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3566
3565
|
),
|
|
3567
|
-
children: ({ selected: p, active:
|
|
3566
|
+
children: ({ selected: p, active: z }) => /* @__PURE__ */ n(re, { children: [
|
|
3568
3567
|
/* @__PURE__ */ e(
|
|
3569
3568
|
"span",
|
|
3570
3569
|
{
|
|
@@ -3579,7 +3578,7 @@ function rt({
|
|
|
3579
3578
|
"span",
|
|
3580
3579
|
{
|
|
3581
3580
|
className: Ye(
|
|
3582
|
-
|
|
3581
|
+
z ? " text-gray-900" : " text-gray-600",
|
|
3583
3582
|
" absolute inset-y-0 right-0 flex items-center pr-4"
|
|
3584
3583
|
),
|
|
3585
3584
|
children: /* @__PURE__ */ e(tt, { className: "w-5 h-5", "aria-hidden": "true" })
|
|
@@ -3593,7 +3592,7 @@ function rt({
|
|
|
3593
3592
|
] })
|
|
3594
3593
|
}
|
|
3595
3594
|
),
|
|
3596
|
-
o && /* @__PURE__ */ e("p", { id:
|
|
3595
|
+
o && /* @__PURE__ */ e("p", { id: T, className: "mt-1 text-sm text-red-600", children: o })
|
|
3597
3596
|
] })
|
|
3598
3597
|
] }) });
|
|
3599
3598
|
}
|
|
@@ -3649,7 +3648,7 @@ const Vl = ({
|
|
|
3649
3648
|
secondaryAction: o = { onCancel: null, label: "Cancel" },
|
|
3650
3649
|
dialogPanelClass: h = ""
|
|
3651
3650
|
}) => {
|
|
3652
|
-
const
|
|
3651
|
+
const f = (g) => {
|
|
3653
3652
|
g.target === g.currentTarget && a(!1);
|
|
3654
3653
|
}, v = (g) => {
|
|
3655
3654
|
g.stopPropagation();
|
|
@@ -3662,10 +3661,10 @@ const Vl = ({
|
|
|
3662
3661
|
className: "relative z-50 overflow-y-auto",
|
|
3663
3662
|
children: [
|
|
3664
3663
|
/* @__PURE__ */ e(
|
|
3665
|
-
|
|
3664
|
+
Gr,
|
|
3666
3665
|
{
|
|
3667
3666
|
className: "fixed inset-0 bg-black/30",
|
|
3668
|
-
onClick:
|
|
3667
|
+
onClick: f
|
|
3669
3668
|
}
|
|
3670
3669
|
),
|
|
3671
3670
|
/* @__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 +3744,16 @@ function as({
|
|
|
3745
3744
|
onCreateChild: u,
|
|
3746
3745
|
onRename: o,
|
|
3747
3746
|
onDelete: h,
|
|
3748
|
-
renderActions:
|
|
3747
|
+
renderActions: f,
|
|
3749
3748
|
// optional override
|
|
3750
3749
|
dragId: v,
|
|
3751
3750
|
dropId: g,
|
|
3752
3751
|
indent: r = 24
|
|
3753
3752
|
}) {
|
|
3754
|
-
const { setNodeRef: x, isOver: d } = rr({ id: g }), { attributes:
|
|
3753
|
+
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
3754
|
const F = W.trim();
|
|
3756
|
-
|
|
3757
|
-
},
|
|
3755
|
+
G(!1), F && F !== t.name ? o?.(t, F) : J(t.name);
|
|
3756
|
+
}, U = ae(() => /* @__PURE__ */ e(
|
|
3758
3757
|
Pn,
|
|
3759
3758
|
{
|
|
3760
3759
|
options: [
|
|
@@ -3763,7 +3762,7 @@ function as({
|
|
|
3763
3762
|
{ action: "delete", label: "Delete" }
|
|
3764
3763
|
],
|
|
3765
3764
|
onSelect: (m) => {
|
|
3766
|
-
m.action === "create" ? u?.(t) : m.action === "rename" ?
|
|
3765
|
+
m.action === "create" ? u?.(t) : m.action === "rename" ? G(!0) : m.action === "delete" && h?.(t);
|
|
3767
3766
|
}
|
|
3768
3767
|
}
|
|
3769
3768
|
), [t, u, h]);
|
|
@@ -3779,7 +3778,7 @@ function as({
|
|
|
3779
3778
|
children: [
|
|
3780
3779
|
/* @__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
3780
|
/* @__PURE__ */ e(je, { size: 16, className: "tv-folder-ic" }),
|
|
3782
|
-
/* @__PURE__ */ e("div", { className: "tv-name", ref:
|
|
3781
|
+
/* @__PURE__ */ e("div", { className: "tv-name", ref: T, children: _ ? /* @__PURE__ */ e(
|
|
3783
3782
|
"input",
|
|
3784
3783
|
{
|
|
3785
3784
|
className: "tv-input",
|
|
@@ -3787,17 +3786,17 @@ function as({
|
|
|
3787
3786
|
onChange: (F) => J(F.target.value),
|
|
3788
3787
|
onBlur: E,
|
|
3789
3788
|
onKeyDown: (F) => {
|
|
3790
|
-
F.key === "Enter" && E(), F.key === "Escape" && (
|
|
3789
|
+
F.key === "Enter" && E(), F.key === "Escape" && (G(!1), J(t.name));
|
|
3791
3790
|
},
|
|
3792
3791
|
autoFocus: !0
|
|
3793
3792
|
}
|
|
3794
|
-
) : /* @__PURE__ */ e("span", { onDoubleClick: () =>
|
|
3795
|
-
/* @__PURE__ */ e(ts, { listeners: C, attributes:
|
|
3796
|
-
/* @__PURE__ */ e("div", { className: "tv-actions", children:
|
|
3793
|
+
) : /* @__PURE__ */ e("span", { onDoubleClick: () => G(!0), children: t.name }) }),
|
|
3794
|
+
/* @__PURE__ */ e(ts, { listeners: C, attributes: b }),
|
|
3795
|
+
/* @__PURE__ */ e("div", { className: "tv-actions", children: f ? f(t, {
|
|
3797
3796
|
onCreateChild: () => u?.(t),
|
|
3798
|
-
onRename: () =>
|
|
3797
|
+
onRename: () => G(!0),
|
|
3799
3798
|
onDelete: () => h?.(t)
|
|
3800
|
-
}) :
|
|
3799
|
+
}) : U })
|
|
3801
3800
|
]
|
|
3802
3801
|
}
|
|
3803
3802
|
);
|
|
@@ -3806,10 +3805,10 @@ const rs = (t) => String(t.id ?? t._id), ns = (t) => t.parent !== void 0 ? Strin
|
|
|
3806
3805
|
function is(t, { rootId: a, getId: s, getParent: i, getName: l }) {
|
|
3807
3806
|
const u = /* @__PURE__ */ new Map();
|
|
3808
3807
|
t.forEach((h) => {
|
|
3809
|
-
const
|
|
3810
|
-
u.set(
|
|
3808
|
+
const f = s(h);
|
|
3809
|
+
u.set(f, {
|
|
3811
3810
|
...h,
|
|
3812
|
-
id:
|
|
3811
|
+
id: f,
|
|
3813
3812
|
name: l(h),
|
|
3814
3813
|
parentId: i(h) || a,
|
|
3815
3814
|
children: []
|
|
@@ -3817,18 +3816,18 @@ function is(t, { rootId: a, getId: s, getParent: i, getName: l }) {
|
|
|
3817
3816
|
});
|
|
3818
3817
|
const o = [];
|
|
3819
3818
|
return u.forEach((h) => {
|
|
3820
|
-
const
|
|
3821
|
-
|
|
3819
|
+
const f = h.parentId || a;
|
|
3820
|
+
f !== a && u.has(f) ? u.get(f).children.push(h) : o.push(h);
|
|
3822
3821
|
}), { roots: o, byId: u };
|
|
3823
3822
|
}
|
|
3824
3823
|
function os(t, { rootId: a, getId: s, getName: i }) {
|
|
3825
3824
|
const l = /* @__PURE__ */ new Map();
|
|
3826
|
-
function u(h,
|
|
3825
|
+
function u(h, f) {
|
|
3827
3826
|
const v = s(h), g = {
|
|
3828
3827
|
...h,
|
|
3829
3828
|
id: v,
|
|
3830
3829
|
name: i(h),
|
|
3831
|
-
parentId:
|
|
3830
|
+
parentId: f || a,
|
|
3832
3831
|
children: (h.children || []).map((r) => u(r, v))
|
|
3833
3832
|
};
|
|
3834
3833
|
return l.set(v, g), g;
|
|
@@ -3884,98 +3883,98 @@ function jl({
|
|
|
3884
3883
|
getName: u = ss,
|
|
3885
3884
|
onSelect: o,
|
|
3886
3885
|
onCreateRoot: h,
|
|
3887
|
-
onCreateChild:
|
|
3886
|
+
onCreateChild: f,
|
|
3888
3887
|
onRename: v,
|
|
3889
3888
|
onDelete: g,
|
|
3890
3889
|
onMove: r,
|
|
3891
3890
|
renderActions: x,
|
|
3892
3891
|
disableMoveToRoot: d = !1,
|
|
3893
3892
|
// ← allow root moves by default now
|
|
3894
|
-
indentUnit:
|
|
3893
|
+
indentUnit: b = 24
|
|
3895
3894
|
}) {
|
|
3896
3895
|
const { roots: C } = ae(() => ls(t) ? os(t, { rootId: a, getId: i, getName: u }) : is(
|
|
3897
|
-
t.map((
|
|
3896
|
+
t.map(($) => ({ ...$ })),
|
|
3898
3897
|
{ rootId: a, getId: i, getParent: l, getName: u }
|
|
3899
|
-
), [t, a, i, l, u]), [
|
|
3898
|
+
), [t, a, i, l, u]), [T, A] = B({}), O = K(($) => {
|
|
3900
3899
|
const p = {};
|
|
3901
|
-
return (function
|
|
3900
|
+
return (function z(I) {
|
|
3902
3901
|
I.forEach((w) => {
|
|
3903
|
-
p[w.id] = !0, w.children?.length &&
|
|
3902
|
+
p[w.id] = !0, w.children?.length && z(w.children);
|
|
3904
3903
|
});
|
|
3905
|
-
})(
|
|
3904
|
+
})($), p;
|
|
3906
3905
|
}, []);
|
|
3907
3906
|
ne.useEffect(() => {
|
|
3908
|
-
|
|
3907
|
+
A(O(C));
|
|
3909
3908
|
}, [C, O]);
|
|
3910
3909
|
const V = K(
|
|
3911
|
-
(
|
|
3910
|
+
($) => A((p) => ({ ...p, [$]: !p[$] })),
|
|
3912
3911
|
[]
|
|
3913
|
-
), [_,
|
|
3914
|
-
ne.useEffect(() =>
|
|
3912
|
+
), [_, G] = B(() => Le(C));
|
|
3913
|
+
ne.useEffect(() => G(Le(C)), [C]);
|
|
3915
3914
|
const W = sr(
|
|
3916
3915
|
lr(dr, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
3917
|
-
), J = ge(null), [E,
|
|
3918
|
-
}, k = ({ delta:
|
|
3919
|
-
F.current =
|
|
3916
|
+
), J = ge(null), [E, U] = B(null), F = ge(0), m = () => {
|
|
3917
|
+
}, k = ({ delta: $ }) => {
|
|
3918
|
+
F.current = $?.x ?? 0;
|
|
3920
3919
|
}, L = K(
|
|
3921
|
-
({ active:
|
|
3922
|
-
const
|
|
3923
|
-
if (F.current = 0,
|
|
3924
|
-
const I = String(
|
|
3920
|
+
({ active: $, over: p }) => {
|
|
3921
|
+
const z = F.current;
|
|
3922
|
+
if (F.current = 0, U(null), !$ || !p) return;
|
|
3923
|
+
const I = String($.id).replace(/^drag-/, ""), w = String(p.id).replace(/^drop-/, "");
|
|
3925
3924
|
if (!I || !w || I === w) return;
|
|
3926
|
-
let
|
|
3927
|
-
const y = Math.max(0, Math.floor(-
|
|
3925
|
+
let S = w;
|
|
3926
|
+
const y = Math.max(0, Math.floor(-z / b));
|
|
3928
3927
|
if (y > 0) {
|
|
3929
3928
|
let q = w;
|
|
3930
3929
|
for (let X = 0; X < y; X++) {
|
|
3931
3930
|
const Y = xa(_, q, null);
|
|
3932
3931
|
if (!Y) break;
|
|
3933
3932
|
if (!Y.parentId) {
|
|
3934
|
-
|
|
3933
|
+
S = a;
|
|
3935
3934
|
break;
|
|
3936
3935
|
}
|
|
3937
|
-
|
|
3936
|
+
S = Y.parentId, q = Y.parentId;
|
|
3938
3937
|
}
|
|
3939
3938
|
}
|
|
3940
|
-
if (d &&
|
|
3941
|
-
|
|
3939
|
+
if (d && S === a) {
|
|
3940
|
+
G(Le(C));
|
|
3942
3941
|
return;
|
|
3943
3942
|
}
|
|
3944
|
-
const N = Le(_), { newRoots: R, removed:
|
|
3945
|
-
if (
|
|
3946
|
-
const M = ds(R,
|
|
3947
|
-
|
|
3943
|
+
const N = Le(_), { newRoots: R, removed: D } = cs(N, I);
|
|
3944
|
+
if (!D) return;
|
|
3945
|
+
const M = ds(R, S, D);
|
|
3946
|
+
G(M), r?.({ sourceId: I, destParentId: S, newTree: M });
|
|
3948
3947
|
},
|
|
3949
|
-
[_, C, a, d,
|
|
3948
|
+
[_, C, a, d, b, r]
|
|
3950
3949
|
), P = K(
|
|
3951
|
-
(
|
|
3950
|
+
($, p = 0) => $.map((z) => /* @__PURE__ */ n(ne.Fragment, { children: [
|
|
3952
3951
|
/* @__PURE__ */ e(
|
|
3953
3952
|
as,
|
|
3954
3953
|
{
|
|
3955
|
-
node:
|
|
3954
|
+
node: z,
|
|
3956
3955
|
depth: p,
|
|
3957
|
-
expanded: !!
|
|
3958
|
-
onToggle: () => V(
|
|
3956
|
+
expanded: !!T[z.id],
|
|
3957
|
+
onToggle: () => V(z.id),
|
|
3959
3958
|
onSelect: o,
|
|
3960
|
-
onCreateChild:
|
|
3959
|
+
onCreateChild: f,
|
|
3961
3960
|
onRename: v,
|
|
3962
3961
|
onDelete: g,
|
|
3963
3962
|
renderActions: x,
|
|
3964
|
-
dragId: `drag-${
|
|
3965
|
-
dropId: `drop-${
|
|
3966
|
-
indent:
|
|
3963
|
+
dragId: `drag-${z.id}`,
|
|
3964
|
+
dropId: `drop-${z.id}`,
|
|
3965
|
+
indent: b
|
|
3967
3966
|
}
|
|
3968
3967
|
),
|
|
3969
|
-
|
|
3970
|
-
] },
|
|
3971
|
-
[
|
|
3968
|
+
T[z.id] && z.children?.length > 0 ? P(z.children, p + 1) : null
|
|
3969
|
+
] }, z.id)),
|
|
3970
|
+
[T, b, f, g, v, o, x, V]
|
|
3972
3971
|
);
|
|
3973
3972
|
return ne.useMemo(() => {
|
|
3974
3973
|
if (!E) return null;
|
|
3975
|
-
const
|
|
3976
|
-
function p(
|
|
3977
|
-
for (const I of
|
|
3978
|
-
if (I.id ===
|
|
3974
|
+
const $ = String(E).replace(/^drag-/, "");
|
|
3975
|
+
function p(z) {
|
|
3976
|
+
for (const I of z) {
|
|
3977
|
+
if (I.id === $) return I;
|
|
3979
3978
|
const w = I.children?.length ? p(I.children) : null;
|
|
3980
3979
|
if (w) return w;
|
|
3981
3980
|
}
|
|
@@ -4020,14 +4019,14 @@ const _l = ({
|
|
|
4020
4019
|
...h
|
|
4021
4020
|
// Pass remaining props to Tab.Group
|
|
4022
4021
|
}) => {
|
|
4023
|
-
const
|
|
4022
|
+
const f = s === "vertical", v = (x) => Se(
|
|
4024
4023
|
"py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
|
|
4025
4024
|
x ? "border-primaryX text-textX" : "border-transparent text-slate-600 hover:text-indigo-700"
|
|
4026
4025
|
), g = (x) => Se(
|
|
4027
4026
|
"text-left text-sm rounded-md px-2 py-1.5 focus:outline-none",
|
|
4028
4027
|
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:
|
|
4028
|
+
), r = ({ selected: x }) => o ? typeof o == "function" ? o(x) : o : f ? g(x) : v(x);
|
|
4029
|
+
return /* @__PURE__ */ e(le.Group, { vertical: f, ...h, children: f ? /* @__PURE__ */ n("div", { className: Se("flex gap-4", i), children: [
|
|
4031
4030
|
/* @__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
4031
|
/* @__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
4032
|
] }) : (
|
|
@@ -4038,31 +4037,27 @@ const _l = ({
|
|
|
4038
4037
|
] })
|
|
4039
4038
|
) });
|
|
4040
4039
|
};
|
|
4041
|
-
function
|
|
4040
|
+
function Gl(t, a = "YYYY-MM-DD HH:mm:ss") {
|
|
4042
4041
|
return t ? (t.endsWith("Z") || /[+\-]\d{2}:?\d{2}$/.test(t) ? Dt.parseZone(t) : Dt.utc(t)).local().format(a) : null;
|
|
4043
4042
|
}
|
|
4044
4043
|
c.string;
|
|
4045
4044
|
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);
|
|
4045
|
+
const [l, u] = ne.useState(t), [o, h] = ne.useState(() => a && a[t.key] || {}), f = ge(a);
|
|
4051
4046
|
te(() => {
|
|
4052
|
-
if (
|
|
4053
|
-
|
|
4047
|
+
if (f.current !== a) {
|
|
4048
|
+
f.current = a;
|
|
4054
4049
|
const r = a && a[t.key] || {};
|
|
4055
|
-
|
|
4050
|
+
h(r);
|
|
4056
4051
|
}
|
|
4057
|
-
}, [a, t.key])
|
|
4052
|
+
}, [a, t.key]);
|
|
4058
4053
|
const v = ge(o);
|
|
4059
4054
|
te(() => {
|
|
4060
4055
|
v.current !== o && s && typeof s == "function" && (v.current = o, s(l.key, o));
|
|
4061
4056
|
}, [l.key, o, s]);
|
|
4062
4057
|
const g = (r) => {
|
|
4063
4058
|
if (!r.dependsOn) return !0;
|
|
4064
|
-
const { field: x, value: d, operator:
|
|
4065
|
-
switch (
|
|
4059
|
+
const { field: x, value: d, operator: b = "equals" } = r.dependsOn, C = o[x];
|
|
4060
|
+
switch (b) {
|
|
4066
4061
|
case "equals":
|
|
4067
4062
|
return C === d;
|
|
4068
4063
|
case "notEquals":
|
|
@@ -4104,7 +4099,7 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4104
4099
|
name: r.key,
|
|
4105
4100
|
checked: !!(o[r.key] || r.default),
|
|
4106
4101
|
onChange: (d) => {
|
|
4107
|
-
const
|
|
4102
|
+
const b = d.target ? d.target.checked : d, C = { ...o, [r.key]: b };
|
|
4108
4103
|
h(C), s && s(l.key, C);
|
|
4109
4104
|
},
|
|
4110
4105
|
label: r.label,
|
|
@@ -4159,8 +4154,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4159
4154
|
placeholder: r.placeholder,
|
|
4160
4155
|
value: o[r.key] || "",
|
|
4161
4156
|
onChange: (d) => {
|
|
4162
|
-
const
|
|
4163
|
-
h(
|
|
4157
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4158
|
+
h(b), s && s(l.key, b);
|
|
4164
4159
|
},
|
|
4165
4160
|
required: r.required,
|
|
4166
4161
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4179,8 +4174,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4179
4174
|
placeholder: r.placeholder,
|
|
4180
4175
|
value: o[r.key] || "",
|
|
4181
4176
|
onChange: (d) => {
|
|
4182
|
-
const
|
|
4183
|
-
h(
|
|
4177
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4178
|
+
h(b), s && s(l.key, b);
|
|
4184
4179
|
},
|
|
4185
4180
|
rows: 3,
|
|
4186
4181
|
required: r.required,
|
|
@@ -4204,13 +4199,13 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4204
4199
|
max: r.max,
|
|
4205
4200
|
step: r.step,
|
|
4206
4201
|
onChange: (d) => {
|
|
4207
|
-
const
|
|
4202
|
+
const b = d.target.value, C = { ...o, [r.key]: b };
|
|
4208
4203
|
h(C), s && s(l.key, C);
|
|
4209
4204
|
},
|
|
4210
4205
|
onBlur: (d) => {
|
|
4211
|
-
const
|
|
4212
|
-
if (
|
|
4213
|
-
const C = Number(
|
|
4206
|
+
const b = d.target.value;
|
|
4207
|
+
if (b !== "" && b !== null && b !== void 0) {
|
|
4208
|
+
const C = Number(b);
|
|
4214
4209
|
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
4210
|
}
|
|
4216
4211
|
},
|
|
@@ -4236,7 +4231,7 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4236
4231
|
name: r.key,
|
|
4237
4232
|
checked: !!(o[r.key] || r.default),
|
|
4238
4233
|
onChange: (d) => {
|
|
4239
|
-
const
|
|
4234
|
+
const b = d.target ? d.target.checked : d, C = { ...o, [r.key]: b };
|
|
4240
4235
|
h(C), s && s(l.key, C);
|
|
4241
4236
|
},
|
|
4242
4237
|
label: r.placeholder || r.label,
|
|
@@ -4254,8 +4249,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4254
4249
|
defaultValue: r.default,
|
|
4255
4250
|
value: o[r.key] || "",
|
|
4256
4251
|
onChange: (d) => {
|
|
4257
|
-
const
|
|
4258
|
-
h(
|
|
4252
|
+
const b = { ...o, [r.key]: d };
|
|
4253
|
+
h(b);
|
|
4259
4254
|
},
|
|
4260
4255
|
options: r.options || [],
|
|
4261
4256
|
placeholder: r.placeholder || `Select ${r.label}`,
|
|
@@ -4276,8 +4271,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4276
4271
|
placeholder: r.placeholder || "Enter email address",
|
|
4277
4272
|
value: o[r.key] || "",
|
|
4278
4273
|
onChange: (d) => {
|
|
4279
|
-
const
|
|
4280
|
-
h(
|
|
4274
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4275
|
+
h(b), s && s(l.key, b);
|
|
4281
4276
|
},
|
|
4282
4277
|
required: r.required,
|
|
4283
4278
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4296,8 +4291,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4296
4291
|
placeholder: r.placeholder || "Enter URL",
|
|
4297
4292
|
value: o[r.key] || "",
|
|
4298
4293
|
onChange: (d) => {
|
|
4299
|
-
const
|
|
4300
|
-
h(
|
|
4294
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4295
|
+
h(b), s && s(l.key, b);
|
|
4301
4296
|
},
|
|
4302
4297
|
required: r.required,
|
|
4303
4298
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4316,8 +4311,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4316
4311
|
placeholder: r.placeholder || "Enter password",
|
|
4317
4312
|
value: o[r.key] || "",
|
|
4318
4313
|
onChange: (d) => {
|
|
4319
|
-
const
|
|
4320
|
-
h(
|
|
4314
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4315
|
+
h(b), s && s(l.key, b);
|
|
4321
4316
|
},
|
|
4322
4317
|
required: r.required,
|
|
4323
4318
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4332,8 +4327,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4332
4327
|
{
|
|
4333
4328
|
selectedItems: o[r.key] || [],
|
|
4334
4329
|
onSelectionChange: (d) => {
|
|
4335
|
-
const
|
|
4336
|
-
h(
|
|
4330
|
+
const b = { ...o, [r.key]: d };
|
|
4331
|
+
h(b), s && s(l.key, b);
|
|
4337
4332
|
},
|
|
4338
4333
|
options: r.options || [],
|
|
4339
4334
|
placeholder: r.placeholder || `Select ${r.label}`,
|
|
@@ -4350,8 +4345,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4350
4345
|
checked: typeof o[r.key] == "boolean" ? o[r.key] : r.default,
|
|
4351
4346
|
onChange: (d) => {
|
|
4352
4347
|
console.log("Toggle changed:", r.key, d);
|
|
4353
|
-
const
|
|
4354
|
-
h(
|
|
4348
|
+
const b = { ...o, [r.key]: d };
|
|
4349
|
+
h(b), s && s(l.key, b);
|
|
4355
4350
|
},
|
|
4356
4351
|
disabled: r.disabled ? r.disabled : !1
|
|
4357
4352
|
}
|
|
@@ -4364,8 +4359,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4364
4359
|
label: r.label,
|
|
4365
4360
|
value: o[r.key] ? new Date(o[r.key]) : null,
|
|
4366
4361
|
onChange: (d) => {
|
|
4367
|
-
const
|
|
4368
|
-
h(
|
|
4362
|
+
const b = { ...o, [r.key]: d ? d.toISOString().split("T")[0] : "" };
|
|
4363
|
+
h(b), s && s(l.key, b);
|
|
4369
4364
|
},
|
|
4370
4365
|
placeholder: r.placeholder || "Select date",
|
|
4371
4366
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4379,8 +4374,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4379
4374
|
label: r.label,
|
|
4380
4375
|
value: o[r.key] || { from: null, to: null },
|
|
4381
4376
|
onChange: (d) => {
|
|
4382
|
-
const
|
|
4383
|
-
h(
|
|
4377
|
+
const b = { ...o, [r.key]: d };
|
|
4378
|
+
h(b), s && s(l.key, b);
|
|
4384
4379
|
},
|
|
4385
4380
|
placeholder: r.placeholder || "Select date range",
|
|
4386
4381
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4394,8 +4389,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4394
4389
|
{
|
|
4395
4390
|
selectedValue: typeof o[r.key] < "u" ? o[r.key] : r.default || "",
|
|
4396
4391
|
onValueChange: (d) => {
|
|
4397
|
-
const
|
|
4398
|
-
h(
|
|
4392
|
+
const b = { ...o, [r.key]: d };
|
|
4393
|
+
h(b), s && s(l.key, b);
|
|
4399
4394
|
},
|
|
4400
4395
|
options: r.options || [],
|
|
4401
4396
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4414,8 +4409,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4414
4409
|
name: r.key,
|
|
4415
4410
|
value: d.value,
|
|
4416
4411
|
checked: o[r.key] === d.value,
|
|
4417
|
-
onChange: (
|
|
4418
|
-
const C = { ...o, [r.key]:
|
|
4412
|
+
onChange: (b) => {
|
|
4413
|
+
const C = { ...o, [r.key]: b.target.value };
|
|
4419
4414
|
h(C), s && s(l.key, C);
|
|
4420
4415
|
},
|
|
4421
4416
|
disabled: r.disabled
|
|
@@ -4434,8 +4429,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4434
4429
|
{
|
|
4435
4430
|
value: o[r.key] || "",
|
|
4436
4431
|
onChange: (d) => {
|
|
4437
|
-
const
|
|
4438
|
-
h(
|
|
4432
|
+
const b = { ...o, [r.key]: d };
|
|
4433
|
+
h(b), s && s(l.key, b);
|
|
4439
4434
|
},
|
|
4440
4435
|
placeholder: r.placeholder || `Search ${r.label}`,
|
|
4441
4436
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4453,8 +4448,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4453
4448
|
placeholder: r.placeholder || "Select date and time",
|
|
4454
4449
|
value: o[r.key] || "",
|
|
4455
4450
|
onChange: (d) => {
|
|
4456
|
-
const
|
|
4457
|
-
h(
|
|
4451
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4452
|
+
h(b), s && s(l.key, b);
|
|
4458
4453
|
},
|
|
4459
4454
|
required: r.required,
|
|
4460
4455
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4472,8 +4467,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4472
4467
|
placeholder: r.placeholder || "Select time",
|
|
4473
4468
|
value: o[r.key] || "",
|
|
4474
4469
|
onChange: (d) => {
|
|
4475
|
-
const
|
|
4476
|
-
h(
|
|
4470
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4471
|
+
h(b), s && s(l.key, b);
|
|
4477
4472
|
},
|
|
4478
4473
|
required: r.required,
|
|
4479
4474
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4490,8 +4485,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4490
4485
|
defaultValue: r.default || "#000000",
|
|
4491
4486
|
value: o[r.key] || "#000000",
|
|
4492
4487
|
onChange: (d) => {
|
|
4493
|
-
const
|
|
4494
|
-
h(
|
|
4488
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4489
|
+
h(b), s && s(l.key, b);
|
|
4495
4490
|
},
|
|
4496
4491
|
className: `w-full h-10 ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
4497
4492
|
}
|
|
@@ -4507,8 +4502,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4507
4502
|
defaultValue: r.default || r.min || 0,
|
|
4508
4503
|
value: o[r.key] || r.min || 0,
|
|
4509
4504
|
onChange: (d) => {
|
|
4510
|
-
const
|
|
4511
|
-
h(
|
|
4505
|
+
const b = { ...o, [r.key]: d.target.value };
|
|
4506
|
+
h(b), s && s(l.key, b);
|
|
4512
4507
|
},
|
|
4513
4508
|
min: r.min || 0,
|
|
4514
4509
|
max: r.max || 100,
|
|
@@ -4533,7 +4528,7 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4533
4528
|
type: "file",
|
|
4534
4529
|
name: r.key,
|
|
4535
4530
|
onChange: (d) => {
|
|
4536
|
-
const
|
|
4531
|
+
const b = d.target.files[0], C = { ...o, [r.key]: b ? b.name : "" };
|
|
4537
4532
|
h(C), s && s(l.key, C);
|
|
4538
4533
|
},
|
|
4539
4534
|
accept: r.accept,
|
|
@@ -4550,8 +4545,8 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4550
4545
|
initialData: o[r.key] || r.initialData || [],
|
|
4551
4546
|
className: r.className || "",
|
|
4552
4547
|
onCollectionChange: (d) => {
|
|
4553
|
-
const
|
|
4554
|
-
h(
|
|
4548
|
+
const b = { ...o, [r.key]: d };
|
|
4549
|
+
h(b), s && s(l.key, b);
|
|
4555
4550
|
},
|
|
4556
4551
|
showSearch: r.showSearch !== !1,
|
|
4557
4552
|
allowAdd: r.allowAdd !== !1,
|
|
@@ -4578,54 +4573,51 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4578
4573
|
}
|
|
4579
4574
|
const us = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
4580
4575
|
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(() => {
|
|
4576
|
+
const [l, u] = B(t), [o, h] = B(null), [f, v] = B(null), [g, r] = B(() => {
|
|
4585
4577
|
const m = a && a[l.key] || [];
|
|
4586
4578
|
let k;
|
|
4587
4579
|
return m.length > 0 ? k = m.map((L, P) => ({
|
|
4588
4580
|
...L,
|
|
4589
4581
|
id: L.id !== void 0 ? L.id : P
|
|
4590
|
-
})) : k = [{ id: 0 }],
|
|
4582
|
+
})) : k = [{ id: 0 }], k;
|
|
4591
4583
|
}), x = ge(a), d = ge(null);
|
|
4592
4584
|
te(() => {
|
|
4593
4585
|
const m = a && a[l.key] || [], k = d.current;
|
|
4594
4586
|
if (JSON.stringify(m) !== JSON.stringify(k)) {
|
|
4595
|
-
|
|
4587
|
+
x.current = a, d.current = m;
|
|
4596
4588
|
let P;
|
|
4597
|
-
m.length > 0 ? P = m.map((
|
|
4598
|
-
|
|
4599
|
-
id:
|
|
4600
|
-
})) : P = [{ id: 0 }],
|
|
4589
|
+
m.length > 0 ? P = m.map(($, p) => ({
|
|
4590
|
+
...$,
|
|
4591
|
+
id: $.id !== void 0 ? $.id : p
|
|
4592
|
+
})) : P = [{ id: 0 }], r(P);
|
|
4601
4593
|
}
|
|
4602
4594
|
}, [a, l.key]);
|
|
4603
|
-
const
|
|
4595
|
+
const b = ge(g), C = ge(null), T = ge(!1);
|
|
4604
4596
|
te(() => {
|
|
4605
|
-
|
|
4597
|
+
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
4598
|
s(l.key, g);
|
|
4607
4599
|
}, 300));
|
|
4608
4600
|
}, [l.key, g, s]), te(() => () => {
|
|
4609
4601
|
C.current && clearTimeout(C.current);
|
|
4610
4602
|
}, []);
|
|
4611
|
-
const
|
|
4612
|
-
const k = (
|
|
4613
|
-
|
|
4614
|
-
const I = [...
|
|
4615
|
-
return I[
|
|
4603
|
+
const A = (m) => {
|
|
4604
|
+
const k = ($, p) => {
|
|
4605
|
+
r((z) => {
|
|
4606
|
+
const I = [...z];
|
|
4607
|
+
return I[$][m.key] = p, I;
|
|
4616
4608
|
});
|
|
4617
|
-
}, L = (
|
|
4618
|
-
const p = L(
|
|
4609
|
+
}, L = ($) => i[l.key]?.[$]?.[m.key], P = ($) => {
|
|
4610
|
+
const p = L($);
|
|
4619
4611
|
return p ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: p }) : null;
|
|
4620
4612
|
};
|
|
4621
4613
|
switch (m.fieldtype) {
|
|
4622
4614
|
case "text":
|
|
4623
|
-
return (
|
|
4615
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4624
4616
|
/* @__PURE__ */ e(
|
|
4625
4617
|
H,
|
|
4626
4618
|
{
|
|
4627
|
-
value:
|
|
4628
|
-
onChange: (
|
|
4619
|
+
value: $[m.key] || "",
|
|
4620
|
+
onChange: (z) => k(p, z.target.value),
|
|
4629
4621
|
placeholder: m.placeholder || `Enter ${m.label}`,
|
|
4630
4622
|
required: m.required,
|
|
4631
4623
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4634,12 +4626,12 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4634
4626
|
P(p)
|
|
4635
4627
|
] });
|
|
4636
4628
|
case "textarea":
|
|
4637
|
-
return (
|
|
4629
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4638
4630
|
/* @__PURE__ */ e(
|
|
4639
4631
|
da,
|
|
4640
4632
|
{
|
|
4641
|
-
value:
|
|
4642
|
-
onChange: (
|
|
4633
|
+
value: $[m.key] || "",
|
|
4634
|
+
onChange: (z) => k(p, z.target.value),
|
|
4643
4635
|
placeholder: m.placeholder || `Enter ${m.label}`,
|
|
4644
4636
|
required: m.required,
|
|
4645
4637
|
className: `w-full ${L(p) ? "border-red-500" : ""}`,
|
|
@@ -4649,21 +4641,21 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4649
4641
|
P(p)
|
|
4650
4642
|
] });
|
|
4651
4643
|
case "number":
|
|
4652
|
-
return (
|
|
4644
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4653
4645
|
/* @__PURE__ */ e(
|
|
4654
4646
|
H,
|
|
4655
4647
|
{
|
|
4656
4648
|
type: "number",
|
|
4657
|
-
value:
|
|
4649
|
+
value: $[m.key] || "",
|
|
4658
4650
|
min: m.min,
|
|
4659
4651
|
max: m.max,
|
|
4660
4652
|
step: m.step,
|
|
4661
|
-
onChange: (
|
|
4662
|
-
onBlur: (
|
|
4663
|
-
const I =
|
|
4653
|
+
onChange: (z) => k(p, z.target.value),
|
|
4654
|
+
onBlur: (z) => {
|
|
4655
|
+
const I = z.target.value;
|
|
4664
4656
|
if (I !== "" && I !== null && I !== void 0) {
|
|
4665
4657
|
const w = Number(I);
|
|
4666
|
-
isNaN(w) || (m.min !== void 0 && w < m.min ? (
|
|
4658
|
+
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
4659
|
}
|
|
4668
4660
|
},
|
|
4669
4661
|
placeholder: m.placeholder || `Enter ${m.label}`,
|
|
@@ -4682,13 +4674,13 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4682
4674
|
P(p)
|
|
4683
4675
|
] });
|
|
4684
4676
|
case "email":
|
|
4685
|
-
return (
|
|
4677
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4686
4678
|
/* @__PURE__ */ e(
|
|
4687
4679
|
H,
|
|
4688
4680
|
{
|
|
4689
4681
|
type: "email",
|
|
4690
|
-
value:
|
|
4691
|
-
onChange: (
|
|
4682
|
+
value: $[m.key] || "",
|
|
4683
|
+
onChange: (z) => k(p, z.target.value),
|
|
4692
4684
|
placeholder: m.placeholder || "Enter email address",
|
|
4693
4685
|
required: m.required,
|
|
4694
4686
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4697,13 +4689,13 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4697
4689
|
P(p)
|
|
4698
4690
|
] });
|
|
4699
4691
|
case "url":
|
|
4700
|
-
return (
|
|
4692
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4701
4693
|
/* @__PURE__ */ e(
|
|
4702
4694
|
H,
|
|
4703
4695
|
{
|
|
4704
4696
|
type: "url",
|
|
4705
|
-
value:
|
|
4706
|
-
onChange: (
|
|
4697
|
+
value: $[m.key] || "",
|
|
4698
|
+
onChange: (z) => k(p, z.target.value),
|
|
4707
4699
|
placeholder: m.placeholder || "Enter URL",
|
|
4708
4700
|
required: m.required,
|
|
4709
4701
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4712,13 +4704,13 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4712
4704
|
P(p)
|
|
4713
4705
|
] });
|
|
4714
4706
|
case "password":
|
|
4715
|
-
return (
|
|
4707
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4716
4708
|
/* @__PURE__ */ e(
|
|
4717
4709
|
H,
|
|
4718
4710
|
{
|
|
4719
4711
|
type: "password",
|
|
4720
|
-
value:
|
|
4721
|
-
onChange: (
|
|
4712
|
+
value: $[m.key] || "",
|
|
4713
|
+
onChange: (z) => k(p, z.target.value),
|
|
4722
4714
|
placeholder: m.placeholder || "Enter password",
|
|
4723
4715
|
required: m.required,
|
|
4724
4716
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4728,12 +4720,12 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4728
4720
|
] });
|
|
4729
4721
|
case "select":
|
|
4730
4722
|
case "dropdown":
|
|
4731
|
-
return (
|
|
4723
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4732
4724
|
/* @__PURE__ */ e(
|
|
4733
4725
|
gt,
|
|
4734
4726
|
{
|
|
4735
|
-
value:
|
|
4736
|
-
onChange: (
|
|
4727
|
+
value: $[m.key] || "",
|
|
4728
|
+
onChange: (z) => k(p, z),
|
|
4737
4729
|
options: m.options || [],
|
|
4738
4730
|
placeholder: m.placeholder || `Select ${m.label}`,
|
|
4739
4731
|
required: m.required,
|
|
@@ -4743,15 +4735,15 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4743
4735
|
P(p)
|
|
4744
4736
|
] });
|
|
4745
4737
|
case "selectDynamic":
|
|
4746
|
-
return (
|
|
4747
|
-
const
|
|
4738
|
+
return ($, p) => {
|
|
4739
|
+
const z = () => {
|
|
4748
4740
|
if (m.optionsFrom && a) {
|
|
4749
|
-
const { config: I, valueField: w, labelField:
|
|
4741
|
+
const { config: I, valueField: w, labelField: S } = m.optionsFrom, y = a[I] || [];
|
|
4750
4742
|
if (Array.isArray(y))
|
|
4751
4743
|
return y.map((N) => ({
|
|
4752
4744
|
id: N[w] || "",
|
|
4753
4745
|
value: N[w] || "",
|
|
4754
|
-
label: N[
|
|
4746
|
+
label: N[S] || ""
|
|
4755
4747
|
}));
|
|
4756
4748
|
}
|
|
4757
4749
|
return m.options || [];
|
|
@@ -4761,9 +4753,9 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4761
4753
|
gt,
|
|
4762
4754
|
{
|
|
4763
4755
|
index: p,
|
|
4764
|
-
value:
|
|
4756
|
+
value: $[m.key] || "",
|
|
4765
4757
|
onChange: (I) => k(p, I),
|
|
4766
|
-
options:
|
|
4758
|
+
options: z(),
|
|
4767
4759
|
placeholder: m.placeholder || `Select ${m.label}`,
|
|
4768
4760
|
required: m.required,
|
|
4769
4761
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4774,12 +4766,12 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4774
4766
|
] });
|
|
4775
4767
|
};
|
|
4776
4768
|
case "multiselect":
|
|
4777
|
-
return (
|
|
4778
|
-
const
|
|
4769
|
+
return ($, p) => {
|
|
4770
|
+
const z = $[m.key] || [];
|
|
4779
4771
|
return /* @__PURE__ */ e(
|
|
4780
4772
|
rt,
|
|
4781
4773
|
{
|
|
4782
|
-
selectedItems:
|
|
4774
|
+
selectedItems: z,
|
|
4783
4775
|
onSelectionChange: (I) => k(p, I),
|
|
4784
4776
|
options: m.options || [],
|
|
4785
4777
|
placeholder: m.placeholder || `Select ${m.label}`,
|
|
@@ -4789,96 +4781,96 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4789
4781
|
};
|
|
4790
4782
|
case "checkbox":
|
|
4791
4783
|
case "boolean":
|
|
4792
|
-
return (
|
|
4784
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4793
4785
|
ut,
|
|
4794
4786
|
{
|
|
4795
|
-
checked:
|
|
4796
|
-
onChange: (
|
|
4787
|
+
checked: !!$[m.key],
|
|
4788
|
+
onChange: (z) => k(p, z),
|
|
4797
4789
|
label: m.placeholder || m.label,
|
|
4798
4790
|
className: "w-full"
|
|
4799
4791
|
}
|
|
4800
4792
|
);
|
|
4801
4793
|
case "toggle":
|
|
4802
4794
|
case "switch":
|
|
4803
|
-
return (
|
|
4795
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4804
4796
|
ma,
|
|
4805
4797
|
{
|
|
4806
|
-
isOn:
|
|
4807
|
-
onToggle: (
|
|
4798
|
+
isOn: !!$[m.key],
|
|
4799
|
+
onToggle: (z) => k(p, z),
|
|
4808
4800
|
label: m.placeholder || m.label,
|
|
4809
4801
|
className: "w-full"
|
|
4810
4802
|
}
|
|
4811
4803
|
);
|
|
4812
4804
|
case "date":
|
|
4813
|
-
return (
|
|
4805
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4814
4806
|
la,
|
|
4815
4807
|
{
|
|
4816
|
-
selectedDate:
|
|
4817
|
-
onDateChange: (
|
|
4808
|
+
selectedDate: $[m.key] ? new Date($[m.key]) : null,
|
|
4809
|
+
onDateChange: (z) => k(p, z ? z.toISOString().split("T")[0] : ""),
|
|
4818
4810
|
placeholder: m.placeholder || "Select date",
|
|
4819
4811
|
className: "w-full"
|
|
4820
4812
|
}
|
|
4821
4813
|
);
|
|
4822
4814
|
case "datetime":
|
|
4823
|
-
return (
|
|
4815
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4824
4816
|
H,
|
|
4825
4817
|
{
|
|
4826
4818
|
type: "datetime-local",
|
|
4827
|
-
value:
|
|
4828
|
-
onChange: (
|
|
4819
|
+
value: $[m.key] || "",
|
|
4820
|
+
onChange: (z) => k(p, z.target.value),
|
|
4829
4821
|
placeholder: m.placeholder || "Select date and time",
|
|
4830
4822
|
required: m.required,
|
|
4831
4823
|
className: "w-full"
|
|
4832
4824
|
}
|
|
4833
4825
|
);
|
|
4834
4826
|
case "time":
|
|
4835
|
-
return (
|
|
4827
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4836
4828
|
H,
|
|
4837
4829
|
{
|
|
4838
4830
|
type: "time",
|
|
4839
|
-
value:
|
|
4840
|
-
onChange: (
|
|
4831
|
+
value: $[m.key] || "",
|
|
4832
|
+
onChange: (z) => k(p, z.target.value),
|
|
4841
4833
|
placeholder: m.placeholder || "Select time",
|
|
4842
4834
|
required: m.required,
|
|
4843
4835
|
className: "w-full"
|
|
4844
4836
|
}
|
|
4845
4837
|
);
|
|
4846
4838
|
case "radio":
|
|
4847
|
-
return (
|
|
4839
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4848
4840
|
ia,
|
|
4849
4841
|
{
|
|
4850
|
-
selectedValue:
|
|
4851
|
-
onValueChange: (
|
|
4842
|
+
selectedValue: $[m.key] || "",
|
|
4843
|
+
onValueChange: (z) => k(p, z),
|
|
4852
4844
|
options: m.options || [],
|
|
4853
4845
|
className: "w-full"
|
|
4854
4846
|
}
|
|
4855
4847
|
);
|
|
4856
4848
|
case "search":
|
|
4857
|
-
return (
|
|
4849
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4858
4850
|
ye,
|
|
4859
4851
|
{
|
|
4860
|
-
value:
|
|
4861
|
-
onChange: (
|
|
4852
|
+
value: $[m.key] || "",
|
|
4853
|
+
onChange: (z) => k(p, z),
|
|
4862
4854
|
placeholder: m.placeholder || `Search ${m.label}`,
|
|
4863
4855
|
className: "w-full"
|
|
4864
4856
|
}
|
|
4865
4857
|
);
|
|
4866
4858
|
case "audience":
|
|
4867
|
-
return (
|
|
4868
|
-
const
|
|
4869
|
-
...
|
|
4870
|
-
...
|
|
4871
|
-
...
|
|
4859
|
+
return ($, p) => {
|
|
4860
|
+
const z = $[m.key] || { users: [], groups: [], roles: [] }, I = [
|
|
4861
|
+
...z.users || [],
|
|
4862
|
+
...z.groups || [],
|
|
4863
|
+
...z.roles || []
|
|
4872
4864
|
];
|
|
4873
4865
|
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,
|
|
4866
|
+
/* @__PURE__ */ e(us, { children: I.length > 0 ? I.slice(0, 3).map((w, S) => /* @__PURE__ */ e(
|
|
4875
4867
|
we,
|
|
4876
4868
|
{
|
|
4877
4869
|
size: "small",
|
|
4878
4870
|
name: w.name || w.displayName || w.id,
|
|
4879
4871
|
src: w.avatarUrl
|
|
4880
4872
|
},
|
|
4881
|
-
|
|
4873
|
+
S
|
|
4882
4874
|
)) : null }),
|
|
4883
4875
|
/* @__PURE__ */ e(
|
|
4884
4876
|
"button",
|
|
@@ -4893,38 +4885,38 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4893
4885
|
] });
|
|
4894
4886
|
};
|
|
4895
4887
|
case "color":
|
|
4896
|
-
return (
|
|
4888
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4897
4889
|
H,
|
|
4898
4890
|
{
|
|
4899
4891
|
type: "color",
|
|
4900
|
-
value:
|
|
4901
|
-
onChange: (
|
|
4892
|
+
value: $[m.key] || "#000000",
|
|
4893
|
+
onChange: (z) => k(p, z.target.value),
|
|
4902
4894
|
className: "w-full h-10"
|
|
4903
4895
|
}
|
|
4904
4896
|
);
|
|
4905
4897
|
case "range":
|
|
4906
|
-
return (
|
|
4898
|
+
return ($, p) => /* @__PURE__ */ n("div", { className: "w-full", children: [
|
|
4907
4899
|
/* @__PURE__ */ e(
|
|
4908
4900
|
H,
|
|
4909
4901
|
{
|
|
4910
4902
|
type: "range",
|
|
4911
|
-
value:
|
|
4912
|
-
onChange: (
|
|
4903
|
+
value: $[m.key] || m.min || 0,
|
|
4904
|
+
onChange: (z) => k(p, z.target.value),
|
|
4913
4905
|
min: m.min || 0,
|
|
4914
4906
|
max: m.max || 100,
|
|
4915
4907
|
step: m.step || 1,
|
|
4916
4908
|
className: "w-full"
|
|
4917
4909
|
}
|
|
4918
4910
|
),
|
|
4919
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children:
|
|
4911
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: $[m.key] || m.min || 0 })
|
|
4920
4912
|
] });
|
|
4921
4913
|
case "file":
|
|
4922
|
-
return (
|
|
4914
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4923
4915
|
H,
|
|
4924
4916
|
{
|
|
4925
4917
|
type: "file",
|
|
4926
|
-
onChange: (
|
|
4927
|
-
const I =
|
|
4918
|
+
onChange: (z) => {
|
|
4919
|
+
const I = z.target.files[0];
|
|
4928
4920
|
k(p, I ? I.name : "");
|
|
4929
4921
|
},
|
|
4930
4922
|
accept: m.accept,
|
|
@@ -4932,22 +4924,22 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4932
4924
|
}
|
|
4933
4925
|
);
|
|
4934
4926
|
case "hidden":
|
|
4935
|
-
return (
|
|
4927
|
+
return ($, p) => /* @__PURE__ */ e(
|
|
4936
4928
|
H,
|
|
4937
4929
|
{
|
|
4938
4930
|
type: "hidden",
|
|
4939
|
-
value:
|
|
4940
|
-
onChange: (
|
|
4931
|
+
value: $[m.key] || "",
|
|
4932
|
+
onChange: (z) => k(p, z.target.value)
|
|
4941
4933
|
}
|
|
4942
4934
|
);
|
|
4943
4935
|
// Default fallback for unknown field types
|
|
4944
4936
|
default:
|
|
4945
|
-
return (
|
|
4937
|
+
return ($, p) => /* @__PURE__ */ n("div", { children: [
|
|
4946
4938
|
/* @__PURE__ */ e(
|
|
4947
4939
|
H,
|
|
4948
4940
|
{
|
|
4949
|
-
value:
|
|
4950
|
-
onChange: (
|
|
4941
|
+
value: $[m.key] || "",
|
|
4942
|
+
onChange: (z) => k(p, z.target.value),
|
|
4951
4943
|
placeholder: m.placeholder || `Enter ${m.label}`,
|
|
4952
4944
|
required: m.required,
|
|
4953
4945
|
className: `w-full ${L(p) ? "border-red-500" : ""}`
|
|
@@ -4957,17 +4949,14 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4957
4949
|
] });
|
|
4958
4950
|
}
|
|
4959
4951
|
}, O = K(() => {
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
id: L
|
|
4952
|
+
r((m) => {
|
|
4953
|
+
const P = {
|
|
4954
|
+
id: (m.length > 0 ? Math.max(...m.map((p) => p.id || 0)) : -1) + 1
|
|
4964
4955
|
// Assign unique incremental ID
|
|
4965
4956
|
};
|
|
4966
|
-
l.fields.forEach((p) => {
|
|
4957
|
+
return l.fields.forEach((p) => {
|
|
4967
4958
|
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;
|
|
4959
|
+
}), [...m, P];
|
|
4971
4960
|
});
|
|
4972
4961
|
}, [l.fields]), V = K((m) => {
|
|
4973
4962
|
r((k) => {
|
|
@@ -4976,40 +4965,39 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4976
4965
|
const L = [...k];
|
|
4977
4966
|
return L.splice(m, 1), L;
|
|
4978
4967
|
});
|
|
4979
|
-
}, []), [_,
|
|
4980
|
-
|
|
4968
|
+
}, []), [_, G] = B(null), W = K((m, k) => {
|
|
4969
|
+
G(k), m.dataTransfer.effectAllowed = "move", m.dataTransfer.setData("text/html", "");
|
|
4981
4970
|
}, []), J = K((m) => {
|
|
4982
4971
|
m.preventDefault(), m.dataTransfer.dropEffect = "move";
|
|
4983
4972
|
}, []), E = K((m, k) => {
|
|
4984
4973
|
m.preventDefault(), !(_ === null || _ === k) && (r((L) => {
|
|
4985
|
-
const P = [...L],
|
|
4986
|
-
return P.splice(_, 1), P.splice(k, 0,
|
|
4987
|
-
}),
|
|
4988
|
-
}, [_]),
|
|
4989
|
-
|
|
4974
|
+
const P = [...L], $ = P[_];
|
|
4975
|
+
return P.splice(_, 1), P.splice(k, 0, $), P;
|
|
4976
|
+
}), G(null));
|
|
4977
|
+
}, [_]), U = K(() => {
|
|
4978
|
+
G(null);
|
|
4990
4979
|
}, []), F = K((m, k) => {
|
|
4991
|
-
|
|
4992
|
-
const
|
|
4993
|
-
if (o !== null &&
|
|
4980
|
+
r((P) => {
|
|
4981
|
+
const $ = [...P];
|
|
4982
|
+
if (o !== null && f && $[o]) {
|
|
4994
4983
|
const p = m?.pendingInvites || [];
|
|
4995
4984
|
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] = {
|
|
4985
|
+
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: [] };
|
|
4986
|
+
$[o][f] = {
|
|
4987
|
+
users: [...S.users || [], ...z],
|
|
4988
|
+
groups: [...S.groups || [], ...I],
|
|
4989
|
+
roles: [...S.roles || [], ...w]
|
|
4990
|
+
};
|
|
4991
|
+
} else k && ($[o][f] = {
|
|
5004
4992
|
users: k.users || [],
|
|
5005
4993
|
groups: k.groups || [],
|
|
5006
4994
|
roles: k.roles || []
|
|
5007
|
-
}
|
|
5008
|
-
|
|
4995
|
+
});
|
|
4996
|
+
T.current = !0;
|
|
5009
4997
|
}
|
|
5010
|
-
return
|
|
4998
|
+
return $;
|
|
5011
4999
|
}), (m?.pendingInvites || []).length > 0 && (h(null), v(null));
|
|
5012
|
-
}, [o,
|
|
5000
|
+
}, [o, f, s]);
|
|
5013
5001
|
return /* @__PURE__ */ n("div", { children: [
|
|
5014
5002
|
/* @__PURE__ */ n("div", { style: { marginBottom: "20px" }, children: [
|
|
5015
5003
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5046,10 +5034,10 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5046
5034
|
onDragStart: (L) => W(L, k),
|
|
5047
5035
|
onDragOver: J,
|
|
5048
5036
|
onDrop: (L) => E(L, k),
|
|
5049
|
-
onDragEnd:
|
|
5037
|
+
onDragEnd: U,
|
|
5050
5038
|
children: [
|
|
5051
5039
|
/* @__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:
|
|
5040
|
+
l.fields.map((L, P) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: A(L)(m, k) }, P)),
|
|
5053
5041
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
5054
5042
|
"button",
|
|
5055
5043
|
{
|
|
@@ -5065,12 +5053,12 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5065
5053
|
)) })
|
|
5066
5054
|
] }) }),
|
|
5067
5055
|
o !== null && (() => {
|
|
5068
|
-
const m = g[o] && g[o][
|
|
5069
|
-
users: g[o][
|
|
5070
|
-
groups: g[o][
|
|
5071
|
-
roles: g[o][
|
|
5056
|
+
const m = g[o] && g[o][f] ? {
|
|
5057
|
+
users: g[o][f].users || [],
|
|
5058
|
+
groups: g[o][f].groups || [],
|
|
5059
|
+
roles: g[o][f].roles || []
|
|
5072
5060
|
} : { users: [], groups: [], roles: [] };
|
|
5073
|
-
return
|
|
5061
|
+
return /* @__PURE__ */ e(
|
|
5074
5062
|
es,
|
|
5075
5063
|
{
|
|
5076
5064
|
isOpen: !0,
|
|
@@ -5109,19 +5097,19 @@ function fs({
|
|
|
5109
5097
|
widgetId: o,
|
|
5110
5098
|
mode: h = "app"
|
|
5111
5099
|
}) {
|
|
5112
|
-
const [
|
|
5100
|
+
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
5101
|
if (!x || !g)
|
|
5114
|
-
return
|
|
5102
|
+
return !1;
|
|
5115
5103
|
const w = (R) => {
|
|
5116
5104
|
if (R == null || typeof R != "object") return R;
|
|
5117
5105
|
if (Array.isArray(R)) return R.map(w);
|
|
5118
|
-
const
|
|
5106
|
+
const D = {};
|
|
5119
5107
|
return Object.keys(R).sort().forEach((M) => {
|
|
5120
|
-
|
|
5121
|
-
}),
|
|
5122
|
-
},
|
|
5108
|
+
D[M] = w(R[M]);
|
|
5109
|
+
}), D;
|
|
5110
|
+
}, S = w(x), y = w(g), N = JSON.stringify(S) !== JSON.stringify(y);
|
|
5123
5111
|
return console.log("[DynamicConfig] hasUnsavedChanges:", N, {
|
|
5124
|
-
originalData:
|
|
5112
|
+
originalData: S,
|
|
5125
5113
|
currentData: y,
|
|
5126
5114
|
originalRaw: x,
|
|
5127
5115
|
currentRaw: g
|
|
@@ -5129,10 +5117,10 @@ function fs({
|
|
|
5129
5117
|
}, m = (w) => {
|
|
5130
5118
|
if (!a || !a.configuration)
|
|
5131
5119
|
return w;
|
|
5132
|
-
const
|
|
5120
|
+
const S = {}, y = w?.configuration || {};
|
|
5133
5121
|
return a.configuration.forEach((N) => {
|
|
5134
5122
|
if (N.key && N.type === "datatable") {
|
|
5135
|
-
const
|
|
5123
|
+
const D = (y[N.key] || []).map((M, q) => {
|
|
5136
5124
|
const X = { id: M.id || 0 };
|
|
5137
5125
|
return N.fields && N.fields.forEach((Y) => {
|
|
5138
5126
|
if (Y.fieldtype === "audience") {
|
|
@@ -5145,37 +5133,37 @@ function fs({
|
|
|
5145
5133
|
} 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
5134
|
}), X;
|
|
5147
5135
|
});
|
|
5148
|
-
if (
|
|
5136
|
+
if (D.length === 0) {
|
|
5149
5137
|
const M = { id: 0 };
|
|
5150
5138
|
N.fields && N.fields.forEach((q) => {
|
|
5151
5139
|
q.fieldtype === "audience" ? M[q.key] = { users: [], groups: [], roles: [] } : M[q.key] = q.default || "";
|
|
5152
|
-
}),
|
|
5140
|
+
}), D.push(M);
|
|
5153
5141
|
}
|
|
5154
|
-
|
|
5142
|
+
S[N.key] = D;
|
|
5155
5143
|
} else if (N.key) {
|
|
5156
5144
|
const R = y[N.key] || {};
|
|
5157
|
-
N.type === "section" && N.fields && N.fields.forEach((
|
|
5158
|
-
|
|
5159
|
-
}),
|
|
5145
|
+
N.type === "section" && N.fields && N.fields.forEach((D) => {
|
|
5146
|
+
D.fieldtype === "managecollectionlist" && D.key && (!R[D.key] || !Array.isArray(R[D.key])) && (R[D.key] = D.initialData || []);
|
|
5147
|
+
}), S[N.key] = R;
|
|
5160
5148
|
}
|
|
5161
|
-
}),
|
|
5149
|
+
}), S;
|
|
5162
5150
|
}, k = () => {
|
|
5163
5151
|
if (a && a.configuration) {
|
|
5164
5152
|
const w = {};
|
|
5165
|
-
a.configuration.forEach((
|
|
5166
|
-
if (
|
|
5167
|
-
if (
|
|
5153
|
+
a.configuration.forEach((S) => {
|
|
5154
|
+
if (S.key)
|
|
5155
|
+
if (S.type === "datatable") {
|
|
5168
5156
|
const y = { id: 0 };
|
|
5169
|
-
|
|
5157
|
+
S.fields && S.fields.forEach((N) => {
|
|
5170
5158
|
N.fieldtype === "audience" ? y[N.key] = { users: [], groups: [], roles: [] } : (N.fieldtype, y[N.key] = N.default || "");
|
|
5171
|
-
}), w[
|
|
5172
|
-
} else if (
|
|
5159
|
+
}), w[S.key] = [y];
|
|
5160
|
+
} else if (S.type === "section") {
|
|
5173
5161
|
const y = {};
|
|
5174
|
-
|
|
5162
|
+
S.fields && Array.isArray(S.fields) && S.fields.forEach((N) => {
|
|
5175
5163
|
N.key && (N.fieldtype === "managecollectionlist" ? y[N.key] = N.initialData || [] : y[N.key] = N.default || "");
|
|
5176
|
-
}), w[
|
|
5164
|
+
}), w[S.key] = y;
|
|
5177
5165
|
} else
|
|
5178
|
-
w[
|
|
5166
|
+
w[S.key] = {};
|
|
5179
5167
|
}), r(w), d(w);
|
|
5180
5168
|
}
|
|
5181
5169
|
};
|
|
@@ -5187,19 +5175,19 @@ function fs({
|
|
|
5187
5175
|
const w = async () => {
|
|
5188
5176
|
try {
|
|
5189
5177
|
C(!0);
|
|
5190
|
-
let
|
|
5191
|
-
if (
|
|
5192
|
-
const y = m(
|
|
5178
|
+
let S = await Ke(W);
|
|
5179
|
+
if (S) {
|
|
5180
|
+
const y = m(S);
|
|
5193
5181
|
r(y), d(y);
|
|
5194
5182
|
} else
|
|
5195
5183
|
k();
|
|
5196
|
-
} catch (
|
|
5197
|
-
console.error("Error fetching configuration:",
|
|
5184
|
+
} catch (S) {
|
|
5185
|
+
console.error("Error fetching configuration:", S);
|
|
5198
5186
|
let y = "Failed to load configuration";
|
|
5199
|
-
if (
|
|
5200
|
-
const N =
|
|
5187
|
+
if (S.response) {
|
|
5188
|
+
const N = S.response.status, R = S.response.data?.message || S.response.data?.error;
|
|
5201
5189
|
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
|
|
5190
|
+
} else S.request ? y = "Network error. Please check your connection and try again." : y = S.message || "An unexpected error occurred while loading configuration.";
|
|
5203
5191
|
We.error(y), k();
|
|
5204
5192
|
} finally {
|
|
5205
5193
|
C(!1);
|
|
@@ -5207,62 +5195,56 @@ function fs({
|
|
|
5207
5195
|
};
|
|
5208
5196
|
a && (v(a), t ? w() : k());
|
|
5209
5197
|
}, [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) => {
|
|
5198
|
+
const L = (w, S) => {
|
|
5199
|
+
r((y) => ({
|
|
5200
|
+
...y,
|
|
5201
|
+
[w]: S
|
|
5202
|
+
})), V((y) => {
|
|
5218
5203
|
const N = { ...y };
|
|
5219
5204
|
return N[w] && delete N[w], N;
|
|
5220
5205
|
});
|
|
5221
5206
|
}, P = () => {
|
|
5222
5207
|
const w = {};
|
|
5223
|
-
return !
|
|
5224
|
-
if (
|
|
5225
|
-
|
|
5226
|
-
const N = g[
|
|
5208
|
+
return !f || !g || f.configuration.forEach((S) => {
|
|
5209
|
+
if (S.type === "section")
|
|
5210
|
+
S.fields.forEach((y) => {
|
|
5211
|
+
const N = g[S.key]?.[y.key];
|
|
5227
5212
|
if (y.required && (!N || typeof N == "string" && N.trim() === "")) {
|
|
5228
|
-
w[
|
|
5213
|
+
w[S.key] || (w[S.key] = {}), w[S.key][y.key] = `${y.label} is required`;
|
|
5229
5214
|
return;
|
|
5230
5215
|
}
|
|
5231
5216
|
if (y.fieldtype === "number" && N !== "" && N !== null && N !== void 0) {
|
|
5232
5217
|
const R = Number(N);
|
|
5233
|
-
isNaN(R) ? (w[
|
|
5218
|
+
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
5219
|
}
|
|
5235
5220
|
});
|
|
5236
|
-
else if (
|
|
5237
|
-
const y = g[
|
|
5221
|
+
else if (S.type === "datatable") {
|
|
5222
|
+
const y = g[S.key];
|
|
5238
5223
|
Array.isArray(y) && y.forEach((N, R) => {
|
|
5239
|
-
|
|
5240
|
-
const M = N[
|
|
5241
|
-
if (
|
|
5242
|
-
w[
|
|
5224
|
+
S.fields.forEach((D) => {
|
|
5225
|
+
const M = N[D.key];
|
|
5226
|
+
if (D.required && (!M || typeof M == "string" && M.trim() === "")) {
|
|
5227
|
+
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
5228
|
return;
|
|
5244
5229
|
}
|
|
5245
|
-
if (
|
|
5230
|
+
if (D.fieldtype === "number" && M !== "" && M !== null && M !== void 0) {
|
|
5246
5231
|
const q = Number(M);
|
|
5247
|
-
isNaN(q) ? (w[
|
|
5232
|
+
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
5233
|
}
|
|
5249
5234
|
});
|
|
5250
5235
|
});
|
|
5251
5236
|
}
|
|
5252
5237
|
}), w;
|
|
5253
|
-
},
|
|
5254
|
-
if (
|
|
5255
|
-
console.log("[handleSave] Already saving, ignoring duplicate call");
|
|
5238
|
+
}, $ = (w) => Object.keys(w).length > 0, p = () => {
|
|
5239
|
+
if (T)
|
|
5256
5240
|
return;
|
|
5257
|
-
}
|
|
5258
|
-
console.log("[handleSave] Starting save process");
|
|
5259
5241
|
const w = P();
|
|
5260
|
-
if (V(w),
|
|
5242
|
+
if (V(w), $(w)) {
|
|
5261
5243
|
let y = [];
|
|
5262
5244
|
Object.keys(w).forEach((N) => {
|
|
5263
5245
|
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][
|
|
5246
|
+
typeof w[N][R] == "object" ? Object.keys(w[N][R]).forEach((D) => {
|
|
5247
|
+
y.push(`${N} row ${parseInt(R) + 1}: ${w[N][R][D]}`);
|
|
5266
5248
|
}) : y.push(`${N}: ${w[N][R]}`);
|
|
5267
5249
|
});
|
|
5268
5250
|
});
|
|
@@ -5270,15 +5252,15 @@ function fs({
|
|
|
5270
5252
|
}
|
|
5271
5253
|
(async () => {
|
|
5272
5254
|
try {
|
|
5273
|
-
|
|
5255
|
+
A(!0);
|
|
5274
5256
|
const y = {};
|
|
5275
5257
|
g && Object.keys(g).forEach((R) => {
|
|
5276
|
-
const
|
|
5258
|
+
const D = a?.configuration?.find(
|
|
5277
5259
|
(M) => M.key === R && M.type === "datatable"
|
|
5278
5260
|
);
|
|
5279
|
-
|
|
5261
|
+
D && Array.isArray(g[R]) ? y[R] = g[R].map((M) => {
|
|
5280
5262
|
const q = { id: M.id || 0 };
|
|
5281
|
-
return
|
|
5263
|
+
return D.fields && D.fields.forEach((X) => {
|
|
5282
5264
|
if (X.fieldtype === "audience") {
|
|
5283
5265
|
let Y = { users: [], groups: [], roles: [] };
|
|
5284
5266
|
M[X.key] && typeof M[X.key] == "object" && !Array.isArray(M[X.key]) && (Y = {
|
|
@@ -5301,15 +5283,15 @@ function fs({
|
|
|
5301
5283
|
} catch (y) {
|
|
5302
5284
|
console.error("Error saving configuration:", y), We.error(y?.message || "Failed to save configuration");
|
|
5303
5285
|
} finally {
|
|
5304
|
-
|
|
5286
|
+
A(!1);
|
|
5305
5287
|
}
|
|
5306
5288
|
})();
|
|
5307
|
-
},
|
|
5308
|
-
|
|
5289
|
+
}, z = () => {
|
|
5290
|
+
F() ? l ? l() : console.warn("[DynamicConfig] onShowCancelModal not provided, cannot show modal") : u ? u() : window.history.back();
|
|
5309
5291
|
};
|
|
5310
|
-
if (!
|
|
5292
|
+
if (!f?.configuration && !a?.configuration)
|
|
5311
5293
|
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 ||
|
|
5294
|
+
const I = a?.configuration || f?.configuration;
|
|
5313
5295
|
return te(() => {
|
|
5314
5296
|
s && a ? (!g || Object.keys(g).length === 0) && k() : s && !a && k();
|
|
5315
5297
|
}, [s, a]), /* @__PURE__ */ n("div", { children: [
|
|
@@ -5319,19 +5301,22 @@ function fs({
|
|
|
5319
5301
|
className: `dynamic-config bg-white w-full overflow-y-auto ${h !== "widget" ? "h-[calc(100vh-500px)]" : ""}`,
|
|
5320
5302
|
style: { padding: "0px 20px 0px 0px" },
|
|
5321
5303
|
children: [
|
|
5322
|
-
|
|
5323
|
-
!
|
|
5324
|
-
const y =
|
|
5325
|
-
|
|
5304
|
+
b && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(ca, { size: "large" }) }),
|
|
5305
|
+
!b && I?.map((w, S) => {
|
|
5306
|
+
const y = {
|
|
5307
|
+
...w,
|
|
5308
|
+
fields: Array.isArray(w.fields) ? w.fields.filter((R) => !R.hidden) : w.fields
|
|
5309
|
+
}, N = bs(w.type);
|
|
5310
|
+
if (N && N !== "UnknownType")
|
|
5326
5311
|
return /* @__PURE__ */ e(
|
|
5327
|
-
|
|
5312
|
+
N,
|
|
5328
5313
|
{
|
|
5329
|
-
item:
|
|
5314
|
+
item: y,
|
|
5330
5315
|
data: g,
|
|
5331
5316
|
updateHandler: L,
|
|
5332
5317
|
validationErrors: O
|
|
5333
5318
|
},
|
|
5334
|
-
|
|
5319
|
+
S
|
|
5335
5320
|
);
|
|
5336
5321
|
})
|
|
5337
5322
|
]
|
|
@@ -5342,9 +5327,9 @@ function fs({
|
|
|
5342
5327
|
ie,
|
|
5343
5328
|
{
|
|
5344
5329
|
category: "secondary",
|
|
5345
|
-
onClick:
|
|
5330
|
+
onClick: z,
|
|
5346
5331
|
label: "Cancel",
|
|
5347
|
-
disabled:
|
|
5332
|
+
disabled: T,
|
|
5348
5333
|
type: "button"
|
|
5349
5334
|
}
|
|
5350
5335
|
),
|
|
@@ -5353,22 +5338,22 @@ function fs({
|
|
|
5353
5338
|
{
|
|
5354
5339
|
category: "primary",
|
|
5355
5340
|
onClick: p,
|
|
5356
|
-
disabled:
|
|
5357
|
-
label:
|
|
5341
|
+
disabled: T,
|
|
5342
|
+
label: T ? "Saving..." : "Save",
|
|
5358
5343
|
type: "submit"
|
|
5359
5344
|
}
|
|
5360
5345
|
)
|
|
5361
5346
|
] })
|
|
5362
5347
|
] });
|
|
5363
5348
|
}
|
|
5364
|
-
const
|
|
5349
|
+
const Ul = ({
|
|
5365
5350
|
config: t,
|
|
5366
5351
|
appid: a = "Configuration-Page",
|
|
5367
5352
|
disableApi: s = !1,
|
|
5368
5353
|
hasConfig: i = !1
|
|
5369
5354
|
}) => {
|
|
5370
5355
|
const [l, u] = B(0), [o, h] = B(!1), {
|
|
5371
|
-
pageHeader:
|
|
5356
|
+
pageHeader: f = {},
|
|
5372
5357
|
appletHeader: v = {},
|
|
5373
5358
|
breadcrumb: g = [],
|
|
5374
5359
|
overview: r = {},
|
|
@@ -5386,11 +5371,11 @@ const Gl = ({
|
|
|
5386
5371
|
placeholder: a,
|
|
5387
5372
|
disabled: !1
|
|
5388
5373
|
}, k.some((p) => p.key === "displayname")) {
|
|
5389
|
-
const p = k.findIndex((I) => I.key === "displayname"),
|
|
5374
|
+
const p = k.findIndex((I) => I.key === "displayname"), z = k[p] || {};
|
|
5390
5375
|
k[p] = {
|
|
5391
|
-
...
|
|
5392
|
-
default:
|
|
5393
|
-
placeholder:
|
|
5376
|
+
...z,
|
|
5377
|
+
default: z.default || z.value || a,
|
|
5378
|
+
placeholder: z.placeholder || "Enter display name"
|
|
5394
5379
|
};
|
|
5395
5380
|
} else {
|
|
5396
5381
|
const p = {
|
|
@@ -5411,30 +5396,29 @@ const Gl = ({
|
|
|
5411
5396
|
};
|
|
5412
5397
|
}
|
|
5413
5398
|
return m;
|
|
5414
|
-
}), [x, a]),
|
|
5399
|
+
}), [x, a]), b = {
|
|
5415
5400
|
heading: "App Details",
|
|
5416
5401
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
5417
5402
|
isLeftArrow: !0,
|
|
5418
5403
|
onBackClick: () => window.history.back(),
|
|
5419
|
-
...
|
|
5404
|
+
...f
|
|
5420
5405
|
}, C = g.map((m) => ({
|
|
5421
5406
|
label: m.text,
|
|
5422
5407
|
href: m.href || "#"
|
|
5423
|
-
})),
|
|
5408
|
+
})), T = K(() => {
|
|
5424
5409
|
h(!0);
|
|
5425
|
-
}, []),
|
|
5410
|
+
}, []), A = K((m) => {
|
|
5426
5411
|
h(!1), m.primary && window.history.back();
|
|
5427
5412
|
}, []), O = K((m) => {
|
|
5428
|
-
console.log("Configuration changed:", m);
|
|
5429
5413
|
}, []), V = K(() => {
|
|
5430
5414
|
window.history.back();
|
|
5431
5415
|
}, []), _ = (() => {
|
|
5432
5416
|
if (v.headingKey && Array.isArray(x)) {
|
|
5433
|
-
const m = v.headingKey.split("."), k = m[0], L = m[1], P = x.find((
|
|
5417
|
+
const m = v.headingKey.split("."), k = m[0], L = m[1], P = x.find(($) => $ && $.key === k);
|
|
5434
5418
|
if (P && P.fields) {
|
|
5435
|
-
const
|
|
5436
|
-
if (
|
|
5437
|
-
return
|
|
5419
|
+
const $ = P.fields.find((p) => p && p.key === L);
|
|
5420
|
+
if ($)
|
|
5421
|
+
return $.default ?? $.value ?? v.heading ?? a;
|
|
5438
5422
|
}
|
|
5439
5423
|
}
|
|
5440
5424
|
if (Array.isArray(x)) {
|
|
@@ -5445,7 +5429,7 @@ const Gl = ({
|
|
|
5445
5429
|
}
|
|
5446
5430
|
}
|
|
5447
5431
|
return v.heading || a;
|
|
5448
|
-
})(),
|
|
5432
|
+
})(), G = {
|
|
5449
5433
|
subHeading: "Application configuration and details",
|
|
5450
5434
|
tags: [],
|
|
5451
5435
|
...v,
|
|
@@ -5473,9 +5457,9 @@ const Gl = ({
|
|
|
5473
5457
|
configuration: d
|
|
5474
5458
|
}), [d]), E = ae(() => [
|
|
5475
5459
|
{ 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
|
|
5460
|
+
i && { label: "Configuration", content: /* @__PURE__ */ e(fs, { appid: a, configdata: J, disableApi: s, onSave: O, onShowCancelModal: T, onCancel: V }) }
|
|
5461
|
+
].filter(Boolean), [a, J, s, O, T, V, W]);
|
|
5462
|
+
function U(m) {
|
|
5479
5463
|
return m ? m.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: m } }) : m : "📱";
|
|
5480
5464
|
}
|
|
5481
5465
|
function F(m) {
|
|
@@ -5516,19 +5500,19 @@ const Gl = ({
|
|
|
5516
5500
|
/* @__PURE__ */ e(
|
|
5517
5501
|
Mn,
|
|
5518
5502
|
{
|
|
5519
|
-
heading:
|
|
5520
|
-
subHeading: C.length > 0 ? void 0 :
|
|
5503
|
+
heading: b.heading,
|
|
5504
|
+
subHeading: C.length > 0 ? void 0 : b.subHeading,
|
|
5521
5505
|
breadcrumbItems: C,
|
|
5522
|
-
isLeftArrow:
|
|
5523
|
-
onBackClick:
|
|
5506
|
+
isLeftArrow: b.isLeftArrow,
|
|
5507
|
+
onBackClick: b.onBackClick
|
|
5524
5508
|
}
|
|
5525
5509
|
),
|
|
5526
5510
|
/* @__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
|
|
5511
|
+
/* @__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
5512
|
/* @__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:
|
|
5513
|
+
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: G.heading }),
|
|
5514
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: G.subHeading }),
|
|
5515
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: G.tags && G.tags.map((m, k) => /* @__PURE__ */ e(
|
|
5532
5516
|
"span",
|
|
5533
5517
|
{
|
|
5534
5518
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
@@ -5554,7 +5538,7 @@ const Gl = ({
|
|
|
5554
5538
|
Fn,
|
|
5555
5539
|
{
|
|
5556
5540
|
isOpen: o,
|
|
5557
|
-
onClose:
|
|
5541
|
+
onClose: A,
|
|
5558
5542
|
variant: "warning",
|
|
5559
5543
|
title: "Are you sure you want to cancel?",
|
|
5560
5544
|
primaryButtonText: "Yes",
|
|
@@ -5573,67 +5557,67 @@ const Gl = ({
|
|
|
5573
5557
|
allowReorder: o = !0,
|
|
5574
5558
|
initialData: h = null
|
|
5575
5559
|
}) => {
|
|
5576
|
-
const [
|
|
5560
|
+
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
5561
|
te(() => {
|
|
5578
5562
|
Array.isArray(h) && d(h);
|
|
5579
5563
|
}, [h]);
|
|
5580
5564
|
const _ = (p) => {
|
|
5581
5565
|
l && (v(p._id), r(p.categoryName || ""));
|
|
5582
|
-
},
|
|
5583
|
-
if (!i ||
|
|
5584
|
-
const
|
|
5566
|
+
}, G = () => {
|
|
5567
|
+
if (!i || f !== null) return;
|
|
5568
|
+
const z = (x.length > 0 ? Math.max(...x.map((I) => typeof I._id == "number" ? I._id : 0)) : 0) + 1;
|
|
5585
5569
|
d((I) => [
|
|
5586
5570
|
...I,
|
|
5587
5571
|
{
|
|
5588
|
-
_id:
|
|
5572
|
+
_id: z,
|
|
5589
5573
|
categoryName: "",
|
|
5590
5574
|
links: [],
|
|
5591
5575
|
order: (I.at(-1)?.order ?? 0) + 1,
|
|
5592
5576
|
protected: !1,
|
|
5593
5577
|
_class: "com.unifyed.model.Collection"
|
|
5594
5578
|
}
|
|
5595
|
-
]), v(
|
|
5579
|
+
]), v(z), r("");
|
|
5596
5580
|
}, W = () => {
|
|
5597
|
-
|
|
5598
|
-
const I = !Array.isArray(h) || !h.some((w) => w._id ===
|
|
5581
|
+
f != null && (d((p) => {
|
|
5582
|
+
const I = !Array.isArray(h) || !h.some((w) => w._id === f) ? p.filter((w) => w._id !== f) : p;
|
|
5599
5583
|
return a?.(I), I;
|
|
5600
5584
|
}), v(null), r(""));
|
|
5601
5585
|
}, J = () => {
|
|
5602
|
-
|
|
5603
|
-
const
|
|
5586
|
+
f == null || !g.trim() || (d((p) => {
|
|
5587
|
+
const z = p.map((I) => I._id === f ? {
|
|
5604
5588
|
...I,
|
|
5605
5589
|
categoryName: g.trim()
|
|
5606
5590
|
} : I);
|
|
5607
|
-
return a?.(
|
|
5591
|
+
return a?.(z), z;
|
|
5608
5592
|
}), v(null), r(""));
|
|
5609
5593
|
}, E = (p) => {
|
|
5610
|
-
u && d((
|
|
5611
|
-
const I =
|
|
5594
|
+
u && d((z) => {
|
|
5595
|
+
const I = z.filter((w) => w._id !== p._id);
|
|
5612
5596
|
return a?.(I), I;
|
|
5613
5597
|
});
|
|
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) ===
|
|
5598
|
+
}, U = (p, z, I) => {
|
|
5599
|
+
const w = Number(z), S = Number(I);
|
|
5600
|
+
if (!o || w === S) return p;
|
|
5601
|
+
const y = p.findIndex((M) => Number(M._id) === w), N = p.findIndex((M) => Number(M._id) === S);
|
|
5618
5602
|
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(
|
|
5603
|
+
const R = [...p], [D] = R.splice(y, 1);
|
|
5604
|
+
return R.splice(N, 0, D), R.map((M, q) => ({ ...M, order: q + 1 }));
|
|
5605
|
+
}, F = (p, z) => {
|
|
5606
|
+
o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(z)), C(Number(z)));
|
|
5623
5607
|
}, m = (p) => {
|
|
5624
|
-
|
|
5608
|
+
b && p !== T && A(p);
|
|
5625
5609
|
}, k = (p) => {
|
|
5626
5610
|
p.preventDefault();
|
|
5627
|
-
}, L = (p,
|
|
5611
|
+
}, L = (p, z) => {
|
|
5628
5612
|
p.preventDefault();
|
|
5629
|
-
const I = p.dataTransfer.getData("text/plain"), w = I === "0" ? 0 : Number(I),
|
|
5630
|
-
w === void 0 ||
|
|
5631
|
-
const N =
|
|
5613
|
+
const I = p.dataTransfer.getData("text/plain"), w = I === "0" ? 0 : Number(I), S = z === "0" ? 0 : Number(z);
|
|
5614
|
+
w === void 0 || S === void 0 || (d((y) => {
|
|
5615
|
+
const N = U(y, w, S);
|
|
5632
5616
|
return a?.(N), N;
|
|
5633
|
-
}), C(null),
|
|
5617
|
+
}), C(null), A(null));
|
|
5634
5618
|
}, P = () => {
|
|
5635
|
-
C(null),
|
|
5636
|
-
},
|
|
5619
|
+
C(null), A(null);
|
|
5620
|
+
}, $ = Array.isArray(x) ? x.filter(
|
|
5637
5621
|
(p) => p.categoryName?.toLowerCase().includes(O.toLowerCase())
|
|
5638
5622
|
) : [];
|
|
5639
5623
|
return /* @__PURE__ */ n("div", { className: `manage-collection-list ${t}`, children: [
|
|
@@ -5652,16 +5636,16 @@ const Gl = ({
|
|
|
5652
5636
|
{
|
|
5653
5637
|
className: [
|
|
5654
5638
|
"px-4 py-3 bg-black text-white rounded-2xl ml-4",
|
|
5655
|
-
|
|
5639
|
+
f !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
5656
5640
|
].join(" "),
|
|
5657
|
-
onClick:
|
|
5658
|
-
disabled:
|
|
5641
|
+
onClick: G,
|
|
5642
|
+
disabled: f !== null,
|
|
5659
5643
|
children: "Add a Collection"
|
|
5660
5644
|
}
|
|
5661
5645
|
)
|
|
5662
5646
|
] }) }),
|
|
5663
|
-
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children:
|
|
5664
|
-
const
|
|
5647
|
+
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: $.map((p) => {
|
|
5648
|
+
const z = f === p._id, I = p?.links?.length ?? 0, w = b === p._id, S = T === p._id && b !== p._id;
|
|
5665
5649
|
return /* @__PURE__ */ e(
|
|
5666
5650
|
"div",
|
|
5667
5651
|
{
|
|
@@ -5672,10 +5656,10 @@ const Gl = ({
|
|
|
5672
5656
|
className: [
|
|
5673
5657
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5674
5658
|
"border-gray-300",
|
|
5675
|
-
|
|
5659
|
+
S ? "ring-2 ring-gray-800/20" : "",
|
|
5676
5660
|
w ? "opacity-60" : ""
|
|
5677
5661
|
].join(" "),
|
|
5678
|
-
children:
|
|
5662
|
+
children: z ? /* @__PURE__ */ n(re, { children: [
|
|
5679
5663
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
5680
5664
|
"input",
|
|
5681
5665
|
{
|
|
@@ -5840,44 +5824,44 @@ const Bt = () => {
|
|
|
5840
5824
|
onFilterOpen: o,
|
|
5841
5825
|
addBtnText: h = "Add",
|
|
5842
5826
|
// Feature toggles
|
|
5843
|
-
showSearch:
|
|
5827
|
+
showSearch: f = !0,
|
|
5844
5828
|
showDelete: v = !0,
|
|
5845
5829
|
showColumnChooser: g = !0,
|
|
5846
5830
|
showFilter: r = !1,
|
|
5847
5831
|
showPrint: x = !1,
|
|
5848
5832
|
showExcel: d = !1,
|
|
5849
|
-
showPdf:
|
|
5833
|
+
showPdf: b = !1,
|
|
5850
5834
|
showRefresh: C = !1,
|
|
5851
|
-
showAdd:
|
|
5852
|
-
iSelectedRecords:
|
|
5835
|
+
showAdd: T = !1,
|
|
5836
|
+
iSelectedRecords: A = 0,
|
|
5853
5837
|
// Additional props
|
|
5854
5838
|
searchPlaceholder: O = "Search...",
|
|
5855
5839
|
handleRefreshClick: V = () => {
|
|
5856
5840
|
},
|
|
5857
5841
|
handleSearchChange: _ = () => {
|
|
5858
5842
|
},
|
|
5859
|
-
handleDeleteClick:
|
|
5843
|
+
handleDeleteClick: G = () => {
|
|
5860
5844
|
},
|
|
5861
5845
|
// Optional: override export file names
|
|
5862
5846
|
excelFileName: W,
|
|
5863
5847
|
pdfFileName: J,
|
|
5864
5848
|
searchIconSize: E,
|
|
5865
|
-
searchIconClass:
|
|
5849
|
+
searchIconClass: U,
|
|
5866
5850
|
inputStyle: F
|
|
5867
5851
|
}) => {
|
|
5868
|
-
const m = () => l?.current || i?.current, [k, L] = ne.useState(""), P = (t || "export").toString().trim() || "export",
|
|
5869
|
-
(
|
|
5852
|
+
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(
|
|
5853
|
+
(S) => {
|
|
5870
5854
|
const y = m();
|
|
5871
5855
|
if (y?.openColumnChooser) {
|
|
5872
|
-
if (typeof window > "u" || !
|
|
5856
|
+
if (typeof window > "u" || !S?.currentTarget) {
|
|
5873
5857
|
y.openColumnChooser();
|
|
5874
5858
|
return;
|
|
5875
5859
|
}
|
|
5876
5860
|
try {
|
|
5877
|
-
const N =
|
|
5878
|
-
let M = R - 120, q =
|
|
5861
|
+
const N = S.currentTarget.getBoundingClientRect(), R = N.left + window.scrollX, D = N.bottom + window.scrollY;
|
|
5862
|
+
let M = R - 120, q = D - 120;
|
|
5879
5863
|
const X = window.innerWidth, Y = window.innerHeight;
|
|
5880
|
-
M =
|
|
5864
|
+
M = z(M, window.scrollX + 8, window.scrollX + X - 340), q = z(q, window.scrollY, window.scrollY + Y - 120), y.openColumnChooser(M, q);
|
|
5881
5865
|
} catch (N) {
|
|
5882
5866
|
console.log("coloumn choose error", N);
|
|
5883
5867
|
}
|
|
@@ -5886,14 +5870,14 @@ const Bt = () => {
|
|
|
5886
5870
|
[]
|
|
5887
5871
|
// no external deps; reads ref at call time
|
|
5888
5872
|
), w = K(
|
|
5889
|
-
(
|
|
5873
|
+
(S, y) => {
|
|
5890
5874
|
const N = m();
|
|
5891
5875
|
if (N)
|
|
5892
|
-
switch (
|
|
5876
|
+
switch (S) {
|
|
5893
5877
|
case "Delete": {
|
|
5894
5878
|
if (v) {
|
|
5895
5879
|
const R = N.getSelectedRecords();
|
|
5896
|
-
return
|
|
5880
|
+
return G(R);
|
|
5897
5881
|
}
|
|
5898
5882
|
break;
|
|
5899
5883
|
}
|
|
@@ -5904,17 +5888,17 @@ const Bt = () => {
|
|
|
5904
5888
|
x && N.print?.();
|
|
5905
5889
|
break;
|
|
5906
5890
|
case "Excel":
|
|
5907
|
-
d && N.excelExport?.({ fileName:
|
|
5891
|
+
d && N.excelExport?.({ fileName: $ });
|
|
5908
5892
|
break;
|
|
5909
5893
|
case "Pdf":
|
|
5910
|
-
|
|
5894
|
+
b && N.pdfExport?.({ fileName: p });
|
|
5911
5895
|
break;
|
|
5912
5896
|
case "Refresh":
|
|
5913
5897
|
C && V();
|
|
5914
5898
|
break;
|
|
5915
5899
|
}
|
|
5916
5900
|
},
|
|
5917
|
-
[g, x, d,
|
|
5901
|
+
[g, x, d, b, C, $, p, V, I]
|
|
5918
5902
|
);
|
|
5919
5903
|
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
5904
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
@@ -5926,16 +5910,16 @@ const Bt = () => {
|
|
|
5926
5910
|
a ? /* @__PURE__ */ e("div", { className: "text-sm text-gray-500", children: a }) : null
|
|
5927
5911
|
] }),
|
|
5928
5912
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
5929
|
-
|
|
5913
|
+
f && /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
|
|
5930
5914
|
ye,
|
|
5931
5915
|
{
|
|
5932
5916
|
placeholder: O,
|
|
5933
5917
|
value: k,
|
|
5934
|
-
onDebouncedChange: (
|
|
5935
|
-
L(
|
|
5918
|
+
onDebouncedChange: (S) => {
|
|
5919
|
+
L(S), _(S);
|
|
5936
5920
|
},
|
|
5937
5921
|
searchIconSize: E || 16,
|
|
5938
|
-
searchIconClass:
|
|
5922
|
+
searchIconClass: U || "",
|
|
5939
5923
|
inputStyle: F || { paddingTop: "4px", paddingBottom: "4px" }
|
|
5940
5924
|
}
|
|
5941
5925
|
) }),
|
|
@@ -5947,14 +5931,14 @@ const Bt = () => {
|
|
|
5947
5931
|
icon: Be,
|
|
5948
5932
|
onClick: () => w("Delete"),
|
|
5949
5933
|
ariaLabel: "Delete",
|
|
5950
|
-
disabled:
|
|
5934
|
+
disabled: A === 0
|
|
5951
5935
|
}
|
|
5952
5936
|
),
|
|
5953
5937
|
g && /* @__PURE__ */ e(
|
|
5954
5938
|
ze,
|
|
5955
5939
|
{
|
|
5956
5940
|
icon: hr,
|
|
5957
|
-
onClick: (
|
|
5941
|
+
onClick: (S) => w("ColumnChooser", S),
|
|
5958
5942
|
ariaLabel: "Column Chooser"
|
|
5959
5943
|
}
|
|
5960
5944
|
),
|
|
@@ -5982,7 +5966,7 @@ const Bt = () => {
|
|
|
5982
5966
|
ariaLabel: "Excel Download"
|
|
5983
5967
|
}
|
|
5984
5968
|
),
|
|
5985
|
-
|
|
5969
|
+
b && /* @__PURE__ */ e(
|
|
5986
5970
|
ze,
|
|
5987
5971
|
{
|
|
5988
5972
|
icon: fr,
|
|
@@ -5999,7 +5983,7 @@ const Bt = () => {
|
|
|
5999
5983
|
}
|
|
6000
5984
|
)
|
|
6001
5985
|
] }),
|
|
6002
|
-
|
|
5986
|
+
T && u && /* @__PURE__ */ e(
|
|
6003
5987
|
ie,
|
|
6004
5988
|
{
|
|
6005
5989
|
label: h,
|
|
@@ -6023,30 +6007,30 @@ function Wl(t) {
|
|
|
6023
6007
|
pageSize: u = 20,
|
|
6024
6008
|
allowPaging: o = !0,
|
|
6025
6009
|
allowSorting: h = !0,
|
|
6026
|
-
allowFiltering:
|
|
6010
|
+
allowFiltering: f = !1,
|
|
6027
6011
|
allowGrouping: v = !1,
|
|
6028
6012
|
allowReordering: g = !0,
|
|
6029
6013
|
allowResizing: r = !0,
|
|
6030
6014
|
allowExcelExport: x = !1,
|
|
6031
6015
|
allowPdfExport: d = !1,
|
|
6032
|
-
showColumnChooser:
|
|
6016
|
+
showColumnChooser: b = !1,
|
|
6033
6017
|
enableSearchApi: C = !1,
|
|
6034
|
-
height:
|
|
6035
|
-
selectionSettings:
|
|
6018
|
+
height: T = "600",
|
|
6019
|
+
selectionSettings: A,
|
|
6036
6020
|
enableCheckbox: O = !1,
|
|
6037
6021
|
columns: V = [],
|
|
6038
6022
|
onGridStateChange: _,
|
|
6039
|
-
onRowSelected:
|
|
6023
|
+
onRowSelected: G,
|
|
6040
6024
|
onRowDeselected: W,
|
|
6041
6025
|
onRowDoubleClick: J,
|
|
6042
6026
|
apiRef: E,
|
|
6043
|
-
gridProps:
|
|
6027
|
+
gridProps: U = {}
|
|
6044
6028
|
} = t, F = ge(null), {
|
|
6045
6029
|
pageSettings: m,
|
|
6046
6030
|
sortSettings: k,
|
|
6047
6031
|
...L
|
|
6048
|
-
} =
|
|
6049
|
-
const j =
|
|
6032
|
+
} = 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(() => {
|
|
6033
|
+
const j = A || {
|
|
6050
6034
|
type: "Multiple",
|
|
6051
6035
|
mode: "Row"
|
|
6052
6036
|
};
|
|
@@ -6059,22 +6043,22 @@ function Wl(t) {
|
|
|
6059
6043
|
checkboxOnly: !1,
|
|
6060
6044
|
enableSimpleMultiRowSelection: !0
|
|
6061
6045
|
} : j;
|
|
6062
|
-
}, [
|
|
6046
|
+
}, [A, O]), R = ae(() => {
|
|
6063
6047
|
const j = [Kr];
|
|
6064
|
-
return (O ||
|
|
6048
|
+
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
6049
|
}, [
|
|
6066
6050
|
h,
|
|
6067
|
-
|
|
6051
|
+
f,
|
|
6068
6052
|
v,
|
|
6069
6053
|
C,
|
|
6070
6054
|
x,
|
|
6071
6055
|
d,
|
|
6072
|
-
|
|
6056
|
+
b,
|
|
6073
6057
|
r,
|
|
6074
6058
|
g,
|
|
6075
6059
|
O,
|
|
6076
|
-
|
|
6077
|
-
]),
|
|
6060
|
+
A
|
|
6061
|
+
]), D = ae(() => {
|
|
6078
6062
|
const j = () => F.current, se = (Q, me) => {
|
|
6079
6063
|
!me && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${Q} requested but related service/feature is disabled.`);
|
|
6080
6064
|
};
|
|
@@ -6096,33 +6080,33 @@ function Wl(t) {
|
|
|
6096
6080
|
se("pdfExport()", d), j()?.pdfExport?.(Q);
|
|
6097
6081
|
},
|
|
6098
6082
|
openColumnChooser: (Q, me) => {
|
|
6099
|
-
se("openColumnChooser()",
|
|
6083
|
+
se("openColumnChooser()", b), j()?.columnChooserModule?.openColumnChooser?.(Q, me);
|
|
6100
6084
|
},
|
|
6101
6085
|
// Additional useful methods
|
|
6102
6086
|
getColumns: () => j()?.getColumns?.(),
|
|
6103
6087
|
getFilteredRecords: () => j()?.getFilteredRecords?.(),
|
|
6104
6088
|
autoFitColumns: (Q) => j()?.autoFitColumns?.(Q)
|
|
6105
6089
|
};
|
|
6106
|
-
}, [C, x, d,
|
|
6090
|
+
}, [C, x, d, b]);
|
|
6107
6091
|
te(() => {
|
|
6108
|
-
E && (E.current =
|
|
6109
|
-
}, [E,
|
|
6092
|
+
E && (E.current = D);
|
|
6093
|
+
}, [E, D]), te(() => () => {
|
|
6110
6094
|
E && (E.current = null);
|
|
6111
6095
|
}, [E]);
|
|
6112
6096
|
const M = (j) => {
|
|
6113
6097
|
const se = String(j || "");
|
|
6114
6098
|
return se === "Ascending" || se === "Descending" ? se : se.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
6115
6099
|
}, 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,
|
|
6100
|
+
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
6101
|
field: Oe.field,
|
|
6118
6102
|
dir: M(Oe.direction ?? Oe.dir)
|
|
6119
6103
|
})), st = j?.searchString ?? "", lt = j?.columns ?? se?.filterSettings?.columns ?? [];
|
|
6120
6104
|
return {
|
|
6121
6105
|
reason: me,
|
|
6122
6106
|
page: {
|
|
6123
|
-
index:
|
|
6107
|
+
index: Ue,
|
|
6124
6108
|
size: Ie,
|
|
6125
|
-
skip: (
|
|
6109
|
+
skip: (Ue - 1) * Ie,
|
|
6126
6110
|
take: Ie
|
|
6127
6111
|
},
|
|
6128
6112
|
sort: nt,
|
|
@@ -6133,7 +6117,7 @@ function Wl(t) {
|
|
|
6133
6117
|
}, X = (j) => {
|
|
6134
6118
|
setTimeout(() => {
|
|
6135
6119
|
F?.current?.hideSpinner();
|
|
6136
|
-
}, 1e3), j.requestType === "paging" && (
|
|
6120
|
+
}, 1e3), j.requestType === "paging" && ($(j.currentPage), z(j.pageSize)), j.requestType === "sorting" && (w(j.columnName || "updatedDate"), y(j.direction)), _?.(q(j), j);
|
|
6137
6121
|
}, Y = (j) => {
|
|
6138
6122
|
J?.(j?.rowData, j);
|
|
6139
6123
|
}, Re = () => {
|
|
@@ -6155,7 +6139,7 @@ function Wl(t) {
|
|
|
6155
6139
|
const {
|
|
6156
6140
|
field: me,
|
|
6157
6141
|
headerText: Ie,
|
|
6158
|
-
width:
|
|
6142
|
+
width: Ue,
|
|
6159
6143
|
textAlign: nt = "Left",
|
|
6160
6144
|
template: st,
|
|
6161
6145
|
isPrimaryKey: lt,
|
|
@@ -6165,8 +6149,8 @@ function Wl(t) {
|
|
|
6165
6149
|
type: Sa,
|
|
6166
6150
|
format: Da,
|
|
6167
6151
|
visible: $a = !0,
|
|
6168
|
-
minWidth:
|
|
6169
|
-
maxWidth:
|
|
6152
|
+
minWidth: Aa,
|
|
6153
|
+
maxWidth: Ta,
|
|
6170
6154
|
customAttributes: Fa,
|
|
6171
6155
|
...Ea
|
|
6172
6156
|
} = se || {};
|
|
@@ -6176,7 +6160,7 @@ function Wl(t) {
|
|
|
6176
6160
|
{
|
|
6177
6161
|
field: me,
|
|
6178
6162
|
headerText: Ie,
|
|
6179
|
-
width:
|
|
6163
|
+
width: Ue,
|
|
6180
6164
|
textAlign: nt,
|
|
6181
6165
|
template: st,
|
|
6182
6166
|
isPrimaryKey: lt,
|
|
@@ -6186,8 +6170,8 @@ function Wl(t) {
|
|
|
6186
6170
|
type: Sa,
|
|
6187
6171
|
format: Da,
|
|
6188
6172
|
visible: $a,
|
|
6189
|
-
minWidth:
|
|
6190
|
-
maxWidth:
|
|
6173
|
+
minWidth: Aa,
|
|
6174
|
+
maxWidth: Ta,
|
|
6191
6175
|
customAttributes: Fa,
|
|
6192
6176
|
...Ea
|
|
6193
6177
|
},
|
|
@@ -6201,9 +6185,9 @@ function Wl(t) {
|
|
|
6201
6185
|
pageSizes: m?.pageSizes ?? [10, 20, 40, 60, 80, 100],
|
|
6202
6186
|
totalCount: s
|
|
6203
6187
|
}), [P, p, m?.pageSizes, s]), ka = ae(() => k ?? {
|
|
6204
|
-
columns: [{ field: I, direction: M(
|
|
6188
|
+
columns: [{ field: I, direction: M(S) }],
|
|
6205
6189
|
allowUnsort: !1
|
|
6206
|
-
}, [k, I,
|
|
6190
|
+
}, [k, I, S]);
|
|
6207
6191
|
return /* @__PURE__ */ n(
|
|
6208
6192
|
un,
|
|
6209
6193
|
{
|
|
@@ -6213,19 +6197,19 @@ function Wl(t) {
|
|
|
6213
6197
|
result: a,
|
|
6214
6198
|
count: s
|
|
6215
6199
|
},
|
|
6216
|
-
height:
|
|
6200
|
+
height: T,
|
|
6217
6201
|
allowPaging: o,
|
|
6218
6202
|
allowSorting: h,
|
|
6219
|
-
allowFiltering:
|
|
6203
|
+
allowFiltering: f,
|
|
6220
6204
|
allowGrouping: v,
|
|
6221
6205
|
allowReordering: g,
|
|
6222
6206
|
allowResizing: r,
|
|
6223
|
-
showColumnChooser:
|
|
6207
|
+
showColumnChooser: b,
|
|
6224
6208
|
selectionSettings: N,
|
|
6225
6209
|
pageSettings: wa,
|
|
6226
6210
|
sortSettings: ka,
|
|
6227
6211
|
actionBegin: X,
|
|
6228
|
-
rowSelected:
|
|
6212
|
+
rowSelected: G,
|
|
6229
6213
|
rowDeselected: W,
|
|
6230
6214
|
recordDoubleClick: Y,
|
|
6231
6215
|
cssClass: "custom-grid-padding",
|
|
@@ -6271,7 +6255,7 @@ function de({
|
|
|
6271
6255
|
details: o = {},
|
|
6272
6256
|
...h
|
|
6273
6257
|
}) {
|
|
6274
|
-
const
|
|
6258
|
+
const f = Ze(), v = xs(h, u), g = (x) => {
|
|
6275
6259
|
l?.({
|
|
6276
6260
|
key: v,
|
|
6277
6261
|
checked: x.target.checked,
|
|
@@ -6288,7 +6272,7 @@ function de({
|
|
|
6288
6272
|
s && /* @__PURE__ */ e("div", { className: `absolute ${r} z-10`, children: /* @__PURE__ */ e(
|
|
6289
6273
|
"input",
|
|
6290
6274
|
{
|
|
6291
|
-
id:
|
|
6275
|
+
id: f,
|
|
6292
6276
|
type: "checkbox",
|
|
6293
6277
|
className: "h-4 w-4 rounded border-zinc-300 focus:ring-[var(--primaryColor)]",
|
|
6294
6278
|
onChange: g,
|
|
@@ -6317,27 +6301,27 @@ function vs({
|
|
|
6317
6301
|
title: u = "Activity",
|
|
6318
6302
|
group: o = "Global",
|
|
6319
6303
|
moreGroupsLabel: h = "+ 5 more",
|
|
6320
|
-
author:
|
|
6304
|
+
author: f = "Judith Black",
|
|
6321
6305
|
timeLabel: v = "Just now",
|
|
6322
6306
|
imageUrl: g = "https://images.unsplash.com/photo-1469980098053-382eb10ba017?q=80&w=1200&auto=format&fit=crop",
|
|
6323
6307
|
description: r = "Columbia University is a prestigious Ivy League institution located in the heart of New York City.",
|
|
6324
6308
|
// spread remaining props (_id, instanceId, etc.)
|
|
6325
6309
|
...x
|
|
6326
6310
|
}) {
|
|
6327
|
-
const d = ue(t),
|
|
6311
|
+
const d = ue(t), b = he[d];
|
|
6328
6312
|
return /* @__PURE__ */ n(
|
|
6329
6313
|
de,
|
|
6330
6314
|
{
|
|
6331
|
-
className: `flex flex-col ${
|
|
6315
|
+
className: `flex flex-col ${b.card}`,
|
|
6332
6316
|
showCheckbox: a,
|
|
6333
6317
|
checkboxPosition: s,
|
|
6334
6318
|
onSelect: i,
|
|
6335
6319
|
identity: l,
|
|
6336
|
-
details: { type: "activity", title: u, group: o, author:
|
|
6320
|
+
details: { type: "activity", title: u, group: o, author: f },
|
|
6337
6321
|
...x,
|
|
6338
6322
|
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 ${
|
|
6323
|
+
/* @__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 }) }),
|
|
6324
|
+
/* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${b.meta}`, children: [
|
|
6341
6325
|
"Posted in ",
|
|
6342
6326
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Global" }),
|
|
6343
6327
|
h ? /* @__PURE__ */ n(re, { children: [
|
|
@@ -6357,8 +6341,8 @@ function vs({
|
|
|
6357
6341
|
/* @__PURE__ */ n("div", { className: "mt-2 flex items-center gap-3", children: [
|
|
6358
6342
|
/* @__PURE__ */ e(we, { name: "John", size: "medium" }),
|
|
6359
6343
|
/* @__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 ${
|
|
6344
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-100", children: f }),
|
|
6345
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${b.meta}`, children: v })
|
|
6362
6346
|
] })
|
|
6363
6347
|
] }),
|
|
6364
6348
|
/* @__PURE__ */ n("p", { className: "mt-2 text-zinc-700 dark:text-zinc-300", children: [
|
|
@@ -6375,7 +6359,7 @@ function vs({
|
|
|
6375
6359
|
/* @__PURE__ */ e(
|
|
6376
6360
|
"div",
|
|
6377
6361
|
{
|
|
6378
|
-
className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${
|
|
6362
|
+
className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${b.media}`,
|
|
6379
6363
|
children: /* @__PURE__ */ e("img", { src: g, alt: "", className: "h-full w-full object-cover" })
|
|
6380
6364
|
}
|
|
6381
6365
|
),
|
|
@@ -6441,7 +6425,7 @@ function zs({
|
|
|
6441
6425
|
// "joined" | "suggested"
|
|
6442
6426
|
items: h = ks,
|
|
6443
6427
|
// spread for identity (_id/instanceId/etc)
|
|
6444
|
-
...
|
|
6428
|
+
...f
|
|
6445
6429
|
}) {
|
|
6446
6430
|
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
6431
|
return /* @__PURE__ */ n(
|
|
@@ -6453,7 +6437,7 @@ function zs({
|
|
|
6453
6437
|
onSelect: i,
|
|
6454
6438
|
identity: l,
|
|
6455
6439
|
details: { type: "communities", title: u, activeTab: o, count: h?.length ?? 0 },
|
|
6456
|
-
...
|
|
6440
|
+
...f,
|
|
6457
6441
|
children: [
|
|
6458
6442
|
/* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
|
|
6459
6443
|
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${g.title}`, children: u }),
|
|
@@ -6627,7 +6611,7 @@ function $s({
|
|
|
6627
6611
|
// spread for identity fields: _id / id / instanceId etc.
|
|
6628
6612
|
...h
|
|
6629
6613
|
}) {
|
|
6630
|
-
const
|
|
6614
|
+
const f = ue(t), v = he[f], g = Ds[f];
|
|
6631
6615
|
return /* @__PURE__ */ n(
|
|
6632
6616
|
de,
|
|
6633
6617
|
{
|
|
@@ -6643,7 +6627,7 @@ function $s({
|
|
|
6643
6627
|
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: u }),
|
|
6644
6628
|
/* @__PURE__ */ e("span", { className: "text-sm text-indigo-700 cursor-default select-none", children: "View All" })
|
|
6645
6629
|
] }),
|
|
6646
|
-
|
|
6630
|
+
f === "lg" ? (
|
|
6647
6631
|
// Large: 3-up grid of image cards
|
|
6648
6632
|
/* @__PURE__ */ e("div", { className: `mt-4 ${g.grid}`, children: o.slice(0, 3).map((r) => /* @__PURE__ */ n("article", { children: [
|
|
6649
6633
|
/* @__PURE__ */ e("img", { src: r.thumb, alt: "", className: g.cardImg }),
|
|
@@ -6702,7 +6686,7 @@ $s.propTypes = {
|
|
|
6702
6686
|
})
|
|
6703
6687
|
)
|
|
6704
6688
|
};
|
|
6705
|
-
const
|
|
6689
|
+
const As = ["All", "Library", "Restaurant", "Parking", "Bus Stop"], Ts = {
|
|
6706
6690
|
sm: {
|
|
6707
6691
|
wrap: "max-w-md w-full md:w-auto flex-none justify-self-start",
|
|
6708
6692
|
mapH: "h-48",
|
|
@@ -6740,8 +6724,8 @@ function Rs({
|
|
|
6740
6724
|
identity: l = "_id",
|
|
6741
6725
|
title: u = "Campus Map",
|
|
6742
6726
|
campusName: o = "Morningside Heights Campus",
|
|
6743
|
-
filters: h =
|
|
6744
|
-
activeFilter:
|
|
6727
|
+
filters: h = As,
|
|
6728
|
+
activeFilter: f = "All",
|
|
6745
6729
|
// NEW: iframe controls
|
|
6746
6730
|
mapQuery: v = "Florida",
|
|
6747
6731
|
zoom: g = 12,
|
|
@@ -6749,23 +6733,23 @@ function Rs({
|
|
|
6749
6733
|
// optional full embed URL override
|
|
6750
6734
|
...x
|
|
6751
6735
|
}) {
|
|
6752
|
-
const d = ue(t),
|
|
6736
|
+
const d = ue(t), b = he[d], C = Ts[d], T = r || Es(v, g);
|
|
6753
6737
|
return /* @__PURE__ */ e(
|
|
6754
6738
|
de,
|
|
6755
6739
|
{
|
|
6756
|
-
className: `flex flex-col ${
|
|
6740
|
+
className: `flex flex-col ${b.card} ${C.wrap}`,
|
|
6757
6741
|
showCheckbox: a,
|
|
6758
6742
|
checkboxPosition: s,
|
|
6759
6743
|
onSelect: i,
|
|
6760
6744
|
identity: l,
|
|
6761
|
-
details: { type: "campus-map", title: u, campusName: o, activeFilter:
|
|
6745
|
+
details: { type: "campus-map", title: u, campusName: o, activeFilter: f, mapQuery: v, zoom: g },
|
|
6762
6746
|
...x,
|
|
6763
6747
|
children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${C.mapH}`, children: [
|
|
6764
6748
|
/* @__PURE__ */ e(
|
|
6765
6749
|
"iframe",
|
|
6766
6750
|
{
|
|
6767
6751
|
title: "Google Map",
|
|
6768
|
-
src:
|
|
6752
|
+
src: T,
|
|
6769
6753
|
className: "h-full w-full",
|
|
6770
6754
|
style: { border: 0 },
|
|
6771
6755
|
loading: "lazy",
|
|
@@ -6783,7 +6767,7 @@ function Rs({
|
|
|
6783
6767
|
/* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-full bg-white/90 border border-zinc-300 flex items-center justify-center", children: "›" })
|
|
6784
6768
|
] })
|
|
6785
6769
|
] }),
|
|
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((
|
|
6770
|
+
/* @__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
6771
|
/* @__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
6772
|
/* @__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
6773
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-500 dark:text-zinc-400", children: "Search places" })
|
|
@@ -6900,7 +6884,7 @@ function _t({ ev: t, sizeMeta: a, isSelected: s, onClick: i }) {
|
|
|
6900
6884
|
/* @__PURE__ */ n("div", { className: "flex-grow min-w-0", children: [
|
|
6901
6885
|
/* @__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
6886
|
/* @__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(
|
|
6887
|
+
/* @__PURE__ */ e(Te, { className: "h-3 w-3" }),
|
|
6904
6888
|
t.allDayNote ? t.allDayNote : o
|
|
6905
6889
|
] })
|
|
6906
6890
|
] })
|
|
@@ -6920,7 +6904,7 @@ function Ps({ ev: t, sizeMeta: a }) {
|
|
|
6920
6904
|
/* @__PURE__ */ n("div", { className: "flex-grow", children: [
|
|
6921
6905
|
/* @__PURE__ */ e("h3", { className: `${a.title} text-zinc-900 dark:text-zinc-100 mb-2`, children: t.title }),
|
|
6922
6906
|
/* @__PURE__ */ n("div", { className: `flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400 ${a.meta}`, children: [
|
|
6923
|
-
/* @__PURE__ */ e(
|
|
6907
|
+
/* @__PURE__ */ e(Te, { className: "h-4 w-4" }),
|
|
6924
6908
|
t.allDayNote ? t.allDayNote : l
|
|
6925
6909
|
] })
|
|
6926
6910
|
] })
|
|
@@ -6953,11 +6937,11 @@ function Ls({
|
|
|
6953
6937
|
title: u = "Upcoming Events",
|
|
6954
6938
|
events: o = Is,
|
|
6955
6939
|
selectedIndex: h = 0,
|
|
6956
|
-
...
|
|
6940
|
+
...f
|
|
6957
6941
|
}) {
|
|
6958
|
-
const [v, g] = B(h), r = ue(t), x = he[r], d = Os[r],
|
|
6959
|
-
g(O), i?.(
|
|
6960
|
-
},
|
|
6942
|
+
const [v, g] = B(h), r = ue(t), x = he[r], d = Os[r], b = o[v] || o[0], C = (A, O) => {
|
|
6943
|
+
g(O), i?.(A);
|
|
6944
|
+
}, T = r === "lg";
|
|
6961
6945
|
return /* @__PURE__ */ n(
|
|
6962
6946
|
de,
|
|
6963
6947
|
{
|
|
@@ -6967,41 +6951,41 @@ function Ls({
|
|
|
6967
6951
|
onSelect: i,
|
|
6968
6952
|
identity: l,
|
|
6969
6953
|
details: { type: "events", title: u, count: o?.length ?? 0 },
|
|
6970
|
-
...
|
|
6954
|
+
...f,
|
|
6971
6955
|
children: [
|
|
6972
6956
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between mb-4", children: [
|
|
6973
6957
|
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${x.title}`, children: u }),
|
|
6974
6958
|
/* @__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
6959
|
] }),
|
|
6976
|
-
|
|
6960
|
+
T ? (
|
|
6977
6961
|
// Large: Two-column layout
|
|
6978
6962
|
/* @__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((
|
|
6963
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((A, O) => /* @__PURE__ */ e(
|
|
6980
6964
|
_t,
|
|
6981
6965
|
{
|
|
6982
|
-
ev:
|
|
6966
|
+
ev: A,
|
|
6983
6967
|
sizeMeta: d,
|
|
6984
6968
|
isSelected: O === v,
|
|
6985
6969
|
onClick: (V) => C(V, O)
|
|
6986
6970
|
},
|
|
6987
|
-
|
|
6971
|
+
A._id || A.id || O
|
|
6988
6972
|
)) }),
|
|
6989
|
-
/* @__PURE__ */ e(Ps, { ev:
|
|
6973
|
+
/* @__PURE__ */ e(Ps, { ev: b, sizeMeta: d })
|
|
6990
6974
|
] })
|
|
6991
6975
|
) : (
|
|
6992
6976
|
// Small/Medium: Simple list only
|
|
6993
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((
|
|
6977
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((A, O) => /* @__PURE__ */ e(
|
|
6994
6978
|
_t,
|
|
6995
6979
|
{
|
|
6996
|
-
ev:
|
|
6980
|
+
ev: A,
|
|
6997
6981
|
sizeMeta: d,
|
|
6998
6982
|
isSelected: O === v,
|
|
6999
6983
|
onClick: (V) => C(V, O)
|
|
7000
6984
|
},
|
|
7001
|
-
|
|
6985
|
+
A._id || A.id || O
|
|
7002
6986
|
)) })
|
|
7003
6987
|
),
|
|
7004
|
-
!
|
|
6988
|
+
!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
6989
|
]
|
|
7006
6990
|
}
|
|
7007
6991
|
);
|
|
@@ -7111,10 +7095,10 @@ const Bs = [
|
|
|
7111
7095
|
}
|
|
7112
7096
|
};
|
|
7113
7097
|
function js({ email: t, sizeMeta: a, isSelected: s, onClick: i, onStar: l, onPin: u }) {
|
|
7114
|
-
const o = (
|
|
7115
|
-
|
|
7116
|
-
}, h = (
|
|
7117
|
-
|
|
7098
|
+
const o = (f) => {
|
|
7099
|
+
f.stopPropagation(), l?.(t);
|
|
7100
|
+
}, h = (f) => {
|
|
7101
|
+
f.stopPropagation(), u?.(t);
|
|
7118
7102
|
};
|
|
7119
7103
|
return /* @__PURE__ */ n(
|
|
7120
7104
|
"div",
|
|
@@ -7147,7 +7131,7 @@ function js({ email: t, sizeMeta: a, isSelected: s, onClick: i, onStar: l, onPin
|
|
|
7147
7131
|
/* @__PURE__ */ e("span", { className: `${a.sender} text-zinc-900 dark:text-zinc-100 ${t.unread ? "font-bold" : ""}`, children: t.sender })
|
|
7148
7132
|
] }),
|
|
7149
7133
|
/* @__PURE__ */ n("div", { className: `flex items-center gap-1 ${a.time} text-zinc-500 dark:text-zinc-400`, children: [
|
|
7150
|
-
/* @__PURE__ */ e(
|
|
7134
|
+
/* @__PURE__ */ e(Te, { className: "h-3 w-3" }),
|
|
7151
7135
|
t.time
|
|
7152
7136
|
] })
|
|
7153
7137
|
] }),
|
|
@@ -7168,15 +7152,15 @@ function _s({
|
|
|
7168
7152
|
title: u = "0365 Mails",
|
|
7169
7153
|
emails: o = Bs,
|
|
7170
7154
|
selectedIndex: h = 0,
|
|
7171
|
-
onStar:
|
|
7155
|
+
onStar: f,
|
|
7172
7156
|
onPin: v,
|
|
7173
7157
|
...g
|
|
7174
7158
|
}) {
|
|
7175
|
-
const [r, x] = B(h), d = ue(t),
|
|
7159
|
+
const [r, x] = B(h), d = ue(t), b = he[d], C = Vs[d], T = (V, _) => {
|
|
7176
7160
|
x(_), i?.(V);
|
|
7177
|
-
},
|
|
7161
|
+
}, A = (V) => {
|
|
7178
7162
|
const _ = { ...V, starred: !V.starred };
|
|
7179
|
-
|
|
7163
|
+
f?.(_);
|
|
7180
7164
|
}, O = (V) => {
|
|
7181
7165
|
const _ = { ...V, pinned: !V.pinned };
|
|
7182
7166
|
v?.(_);
|
|
@@ -7184,7 +7168,7 @@ function _s({
|
|
|
7184
7168
|
return /* @__PURE__ */ n(
|
|
7185
7169
|
de,
|
|
7186
7170
|
{
|
|
7187
|
-
className: `flex flex-col ${
|
|
7171
|
+
className: `flex flex-col ${b.card} ${C.wrap}`,
|
|
7188
7172
|
showCheckbox: a,
|
|
7189
7173
|
checkboxPosition: s,
|
|
7190
7174
|
onSelect: i,
|
|
@@ -7192,7 +7176,7 @@ function _s({
|
|
|
7192
7176
|
details: { type: "emails", title: u, count: o?.length ?? 0 },
|
|
7193
7177
|
...g,
|
|
7194
7178
|
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 ${
|
|
7179
|
+
/* @__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
7180
|
/* @__PURE__ */ e(ye, { placeholder: "Type to search..." }),
|
|
7197
7181
|
/* @__PURE__ */ e("div", { className: "space-y-0", children: o.map((V, _) => /* @__PURE__ */ e(
|
|
7198
7182
|
js,
|
|
@@ -7200,8 +7184,8 @@ function _s({
|
|
|
7200
7184
|
email: V,
|
|
7201
7185
|
sizeMeta: C,
|
|
7202
7186
|
isSelected: _ === r,
|
|
7203
|
-
onClick: (
|
|
7204
|
-
onStar:
|
|
7187
|
+
onClick: (G) => T(G, _),
|
|
7188
|
+
onStar: A,
|
|
7205
7189
|
onPin: O
|
|
7206
7190
|
},
|
|
7207
7191
|
V._id || V.id || _
|
|
@@ -7235,7 +7219,7 @@ _s.propTypes = {
|
|
|
7235
7219
|
onStar: c.func,
|
|
7236
7220
|
onPin: c.func
|
|
7237
7221
|
};
|
|
7238
|
-
const
|
|
7222
|
+
const Gs = [
|
|
7239
7223
|
{
|
|
7240
7224
|
_id: "contact-1",
|
|
7241
7225
|
name: "Branden Baker",
|
|
@@ -7276,7 +7260,7 @@ const Us = [
|
|
|
7276
7260
|
// building: "Security Building",
|
|
7277
7261
|
// initials: "AM"
|
|
7278
7262
|
// }
|
|
7279
|
-
],
|
|
7263
|
+
], Us = {
|
|
7280
7264
|
sm: {
|
|
7281
7265
|
wrap: "max-w-sm w-full",
|
|
7282
7266
|
searchHeight: "h-8",
|
|
@@ -7323,7 +7307,7 @@ const Us = [
|
|
|
7323
7307
|
// two columns for large screens
|
|
7324
7308
|
}
|
|
7325
7309
|
};
|
|
7326
|
-
function
|
|
7310
|
+
function Gt({ contact: t, sizeMeta: a, isSelected: s, onClick: i }) {
|
|
7327
7311
|
return /* @__PURE__ */ n(
|
|
7328
7312
|
"div",
|
|
7329
7313
|
{
|
|
@@ -7420,13 +7404,13 @@ function Ws({
|
|
|
7420
7404
|
onSelect: i,
|
|
7421
7405
|
identity: l = "_id",
|
|
7422
7406
|
title: u = "Directory",
|
|
7423
|
-
contacts: o =
|
|
7407
|
+
contacts: o = Gs,
|
|
7424
7408
|
selectedIndex: h = 0,
|
|
7425
|
-
...
|
|
7409
|
+
...f
|
|
7426
7410
|
}) {
|
|
7427
|
-
const [v, g] = B(h), r = ue(t), x = he[r], d =
|
|
7428
|
-
g(O), i?.(
|
|
7429
|
-
}, C = o[v] || o[0],
|
|
7411
|
+
const [v, g] = B(h), r = ue(t), x = he[r], d = Us[r], b = (A, O) => {
|
|
7412
|
+
g(O), i?.(A);
|
|
7413
|
+
}, C = o[v] || o[0], T = d.layout === "split";
|
|
7430
7414
|
return /* @__PURE__ */ n(
|
|
7431
7415
|
de,
|
|
7432
7416
|
{
|
|
@@ -7436,20 +7420,20 @@ function Ws({
|
|
|
7436
7420
|
onSelect: i,
|
|
7437
7421
|
identity: l,
|
|
7438
7422
|
details: { type: "directory", title: u, count: o?.length ?? 0 },
|
|
7439
|
-
...
|
|
7423
|
+
...f,
|
|
7440
7424
|
children: [
|
|
7441
7425
|
/* @__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
7426
|
/* @__PURE__ */ e(Ys, { sizeMeta: d }),
|
|
7443
|
-
|
|
7444
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((
|
|
7445
|
-
|
|
7427
|
+
T ? /* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0", children: [
|
|
7428
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((A, O) => /* @__PURE__ */ e(
|
|
7429
|
+
Gt,
|
|
7446
7430
|
{
|
|
7447
|
-
contact:
|
|
7431
|
+
contact: A,
|
|
7448
7432
|
sizeMeta: d,
|
|
7449
7433
|
isSelected: O === v,
|
|
7450
|
-
onClick: (V) =>
|
|
7434
|
+
onClick: (V) => b(V, O)
|
|
7451
7435
|
},
|
|
7452
|
-
|
|
7436
|
+
A._id || A.id || O
|
|
7453
7437
|
)) }),
|
|
7454
7438
|
/* @__PURE__ */ e(
|
|
7455
7439
|
qs,
|
|
@@ -7460,15 +7444,15 @@ function Ws({
|
|
|
7460
7444
|
)
|
|
7461
7445
|
] }) : (
|
|
7462
7446
|
// Single column layout for small screens
|
|
7463
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((
|
|
7464
|
-
|
|
7447
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((A, O) => /* @__PURE__ */ e(
|
|
7448
|
+
Gt,
|
|
7465
7449
|
{
|
|
7466
|
-
contact:
|
|
7450
|
+
contact: A,
|
|
7467
7451
|
sizeMeta: d,
|
|
7468
7452
|
isSelected: O === v,
|
|
7469
|
-
onClick: (V) =>
|
|
7453
|
+
onClick: (V) => b(V, O)
|
|
7470
7454
|
},
|
|
7471
|
-
|
|
7455
|
+
A._id || A.id || O
|
|
7472
7456
|
)) })
|
|
7473
7457
|
),
|
|
7474
7458
|
/* @__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 +7481,13 @@ Ws.propTypes = {
|
|
|
7497
7481
|
),
|
|
7498
7482
|
selectedIndex: c.number
|
|
7499
7483
|
};
|
|
7500
|
-
const
|
|
7484
|
+
const Ae = (t) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(Number(t || 0));
|
|
7501
7485
|
function Js({ side: t = "left", date: a, title: s, amount: i, kind: l = "payment" }) {
|
|
7502
7486
|
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
7487
|
/* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: a }),
|
|
7504
7488
|
/* @__PURE__ */ e("div", { className: "mt-1 text-sm text-zinc-700 dark:text-zinc-200", children: s }),
|
|
7505
7489
|
/* @__PURE__ */ n("div", { className: "mt-2 flex items-center justify-between", children: [
|
|
7506
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-semibold", children:
|
|
7490
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-semibold", children: Ae(i) }),
|
|
7507
7491
|
/* @__PURE__ */ e(
|
|
7508
7492
|
"div",
|
|
7509
7493
|
{
|
|
@@ -7556,7 +7540,7 @@ function Qs({
|
|
|
7556
7540
|
title: u = "Account Summary",
|
|
7557
7541
|
termLabel: o = "Spring 2024",
|
|
7558
7542
|
balance: h = 3e3,
|
|
7559
|
-
totalCharges:
|
|
7543
|
+
totalCharges: f = 4440,
|
|
7560
7544
|
totalPayments: v = 1568,
|
|
7561
7545
|
transactions: g = [
|
|
7562
7546
|
{
|
|
@@ -7576,16 +7560,16 @@ function Qs({
|
|
|
7576
7560
|
],
|
|
7577
7561
|
...r
|
|
7578
7562
|
}) {
|
|
7579
|
-
const x = ue(t), d = he[x],
|
|
7563
|
+
const x = ue(t), d = he[x], b = Xs[x];
|
|
7580
7564
|
return /* @__PURE__ */ n(
|
|
7581
7565
|
de,
|
|
7582
7566
|
{
|
|
7583
|
-
className: `flex flex-col ${d.card} ${
|
|
7567
|
+
className: `flex flex-col ${d.card} ${b.wrap}`,
|
|
7584
7568
|
showCheckbox: a,
|
|
7585
7569
|
checkboxPosition: s,
|
|
7586
7570
|
onSelect: i,
|
|
7587
7571
|
identity: l,
|
|
7588
|
-
details: { type: "account-summary", termLabel: o, balance: h, totalCharges:
|
|
7572
|
+
details: { type: "account-summary", termLabel: o, balance: h, totalCharges: f, totalPayments: v },
|
|
7589
7573
|
...r,
|
|
7590
7574
|
children: [
|
|
7591
7575
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
@@ -7595,42 +7579,42 @@ function Qs({
|
|
|
7595
7579
|
/* @__PURE__ */ e(xt, { className: "h-4 w-4 opacity-70" })
|
|
7596
7580
|
] })
|
|
7597
7581
|
] }),
|
|
7598
|
-
/* @__PURE__ */ n("div", { className:
|
|
7582
|
+
/* @__PURE__ */ n("div", { className: b.topGrid || b.grid, children: [
|
|
7599
7583
|
/* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
7600
7584
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Account Balance" }),
|
|
7601
|
-
/* @__PURE__ */ e("div", { className:
|
|
7602
|
-
!
|
|
7585
|
+
/* @__PURE__ */ e("div", { className: b.balance, children: Ae(h) }),
|
|
7586
|
+
!b.showTxns && /* @__PURE__ */ n("div", { className: b.totalsRow, children: [
|
|
7603
7587
|
/* @__PURE__ */ n("div", { children: [
|
|
7604
7588
|
/* @__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:
|
|
7589
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Ae(f) })
|
|
7606
7590
|
] }),
|
|
7607
7591
|
/* @__PURE__ */ n("div", { children: [
|
|
7608
7592
|
/* @__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:
|
|
7593
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: Ae(v) })
|
|
7610
7594
|
] })
|
|
7611
7595
|
] })
|
|
7612
7596
|
] }),
|
|
7613
|
-
|
|
7614
|
-
/* @__PURE__ */ n("div", { className:
|
|
7597
|
+
b.showTxns && /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
7598
|
+
/* @__PURE__ */ n("div", { className: b.totalsRow, children: [
|
|
7615
7599
|
/* @__PURE__ */ n("div", { children: [
|
|
7616
7600
|
/* @__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:
|
|
7601
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Ae(f) })
|
|
7618
7602
|
] }),
|
|
7619
7603
|
/* @__PURE__ */ n("div", { children: [
|
|
7620
7604
|
/* @__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:
|
|
7605
|
+
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: Ae(v) })
|
|
7622
7606
|
] })
|
|
7623
7607
|
] }),
|
|
7624
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: g.slice(0, 2).map((C,
|
|
7608
|
+
/* @__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
7609
|
Js,
|
|
7626
7610
|
{
|
|
7627
|
-
side:
|
|
7611
|
+
side: T === 0 ? "left" : "right",
|
|
7628
7612
|
date: C.date,
|
|
7629
7613
|
title: C.title,
|
|
7630
7614
|
amount: C.amount,
|
|
7631
7615
|
kind: C.kind
|
|
7632
7616
|
},
|
|
7633
|
-
C.id ||
|
|
7617
|
+
C.id || T
|
|
7634
7618
|
)) })
|
|
7635
7619
|
] })
|
|
7636
7620
|
] }),
|
|
@@ -7638,7 +7622,7 @@ function Qs({
|
|
|
7638
7622
|
"button",
|
|
7639
7623
|
{
|
|
7640
7624
|
type: "button",
|
|
7641
|
-
className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${
|
|
7625
|
+
className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${b.buttonPad}
|
|
7642
7626
|
border-orange-400 text-zinc-900 dark:text-zinc-100 bg-white dark:bg-zinc-900`,
|
|
7643
7627
|
"aria-label": "View Transactions (mock)",
|
|
7644
7628
|
children: [
|
|
@@ -7727,7 +7711,7 @@ const Hs = {
|
|
|
7727
7711
|
]
|
|
7728
7712
|
}
|
|
7729
7713
|
];
|
|
7730
|
-
function
|
|
7714
|
+
function Ut({ leave: t, sizeMeta: a }) {
|
|
7731
7715
|
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
7716
|
/* @__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
7717
|
/* @__PURE__ */ e("span", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${a.table}`, children: t.name }),
|
|
@@ -7749,11 +7733,11 @@ function Zs({
|
|
|
7749
7733
|
term: o = "Fall 2025",
|
|
7750
7734
|
...h
|
|
7751
7735
|
}) {
|
|
7752
|
-
const [
|
|
7736
|
+
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
7737
|
return /* @__PURE__ */ n(
|
|
7754
7738
|
de,
|
|
7755
7739
|
{
|
|
7756
|
-
className: `flex flex-col ${d.card} ${
|
|
7740
|
+
className: `flex flex-col ${d.card} ${b.wrap}`,
|
|
7757
7741
|
showCheckbox: a,
|
|
7758
7742
|
checkboxPosition: s,
|
|
7759
7743
|
onSelect: i,
|
|
@@ -7763,8 +7747,8 @@ function Zs({
|
|
|
7763
7747
|
children: [
|
|
7764
7748
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
7765
7749
|
/* @__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 ${
|
|
7750
|
+
/* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${b.title} mb-1`, children: u }),
|
|
7751
|
+
/* @__PURE__ */ n("div", { className: `text-zinc-600 dark:text-zinc-400 ${b.term} flex items-center gap-2`, children: [
|
|
7768
7752
|
/* @__PURE__ */ e(Wt, { className: "h-4 w-4" }),
|
|
7769
7753
|
"Term - ",
|
|
7770
7754
|
o
|
|
@@ -7785,28 +7769,28 @@ function Zs({
|
|
|
7785
7769
|
] })
|
|
7786
7770
|
] })
|
|
7787
7771
|
] }),
|
|
7788
|
-
|
|
7772
|
+
b.showTabs && /* @__PURE__ */ e("div", { className: "flex border-b border-zinc-200 dark:border-zinc-800", children: Je.map((T) => /* @__PURE__ */ e(
|
|
7789
7773
|
"button",
|
|
7790
7774
|
{
|
|
7791
|
-
className: `flex-1 py-2 px-4 text-center ${
|
|
7792
|
-
onClick: () => v(
|
|
7793
|
-
children:
|
|
7775
|
+
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"}`,
|
|
7776
|
+
onClick: () => v(T.id),
|
|
7777
|
+
children: T.name.split(" ")[0]
|
|
7794
7778
|
},
|
|
7795
|
-
|
|
7779
|
+
T.id
|
|
7796
7780
|
)) }),
|
|
7797
|
-
/* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children:
|
|
7781
|
+
/* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children: b.showAllLeave ? (
|
|
7798
7782
|
// LG: Show all leave types
|
|
7799
|
-
Je.map((
|
|
7800
|
-
) :
|
|
7783
|
+
Je.map((T) => /* @__PURE__ */ e(Ut, { leave: T, sizeMeta: b }, T.id))
|
|
7784
|
+
) : b.showSingleLeave ? (
|
|
7801
7785
|
// MD: Show active tab leave type
|
|
7802
|
-
/* @__PURE__ */ e(
|
|
7786
|
+
/* @__PURE__ */ e(Ut, { leave: C, sizeMeta: b })
|
|
7803
7787
|
) : (
|
|
7804
7788
|
// SM: Show only available hours
|
|
7805
7789
|
/* @__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(
|
|
7790
|
+
/* @__PURE__ */ e(Te, { className: "h-5 w-5 text-blue-600 dark:text-blue-400" }),
|
|
7807
7791
|
/* @__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 ${
|
|
7792
|
+
/* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${b.table}`, children: "Available Leave" }),
|
|
7793
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${b.table}`, children: C.available })
|
|
7810
7794
|
] })
|
|
7811
7795
|
] }) })
|
|
7812
7796
|
) }),
|
|
@@ -7940,7 +7924,7 @@ function al({
|
|
|
7940
7924
|
subtitle: o = "Drive Shared",
|
|
7941
7925
|
...h
|
|
7942
7926
|
}) {
|
|
7943
|
-
const [
|
|
7927
|
+
const [f, v] = B(!1), g = ue(t), r = he[g], x = tl[g];
|
|
7944
7928
|
return /* @__PURE__ */ n(
|
|
7945
7929
|
de,
|
|
7946
7930
|
{
|
|
@@ -7962,11 +7946,11 @@ function al({
|
|
|
7962
7946
|
"button",
|
|
7963
7947
|
{
|
|
7964
7948
|
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(!
|
|
7949
|
+
onClick: () => v(!f),
|
|
7966
7950
|
children: /* @__PURE__ */ e(Zt, { className: "h-4 w-4" })
|
|
7967
7951
|
}
|
|
7968
7952
|
),
|
|
7969
|
-
|
|
7953
|
+
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
7954
|
/* @__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
7955
|
/* @__PURE__ */ e(ra, { className: "h-4 w-4" }),
|
|
7972
7956
|
"Download All"
|
|
@@ -8147,7 +8131,7 @@ function ll({ alert: t, sizeMeta: a, onDismiss: s, onMarkRead: i }) {
|
|
|
8147
8131
|
/* @__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
8132
|
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
8133
|
/* @__PURE__ */ n("div", { className: `flex items-center gap-1 ${a.time} text-zinc-500 dark:text-zinc-400`, children: [
|
|
8150
|
-
/* @__PURE__ */ e(
|
|
8134
|
+
/* @__PURE__ */ e(Te, { className: "h-3 w-3" }),
|
|
8151
8135
|
t.time
|
|
8152
8136
|
] })
|
|
8153
8137
|
] })
|
|
@@ -8184,11 +8168,11 @@ function ol({
|
|
|
8184
8168
|
title: u = "Alerts",
|
|
8185
8169
|
alerts: o = rl,
|
|
8186
8170
|
showBanner: h = !0,
|
|
8187
|
-
...
|
|
8171
|
+
...f
|
|
8188
8172
|
}) {
|
|
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((
|
|
8173
|
+
const [v, g] = B(o), r = ue(t), x = he[r], d = nl[r], b = (A) => {
|
|
8174
|
+
g((O) => O.filter((V) => V.id !== A.id));
|
|
8175
|
+
}, C = v.find((A) => A.type === "banner"), T = v.filter((A) => A.type !== "banner");
|
|
8192
8176
|
return /* @__PURE__ */ n(
|
|
8193
8177
|
de,
|
|
8194
8178
|
{
|
|
@@ -8198,24 +8182,24 @@ function ol({
|
|
|
8198
8182
|
onSelect: i,
|
|
8199
8183
|
identity: l,
|
|
8200
8184
|
details: { type: "alerts", title: u, count: v.length },
|
|
8201
|
-
...
|
|
8185
|
+
...f,
|
|
8202
8186
|
children: [
|
|
8203
8187
|
/* @__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
8188
|
h && C && t !== "sm" && /* @__PURE__ */ e(
|
|
8205
8189
|
il,
|
|
8206
8190
|
{
|
|
8207
8191
|
alert: C,
|
|
8208
|
-
onDismiss:
|
|
8192
|
+
onDismiss: b
|
|
8209
8193
|
}
|
|
8210
8194
|
),
|
|
8211
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children:
|
|
8195
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: T.slice(0, 3).map((A) => /* @__PURE__ */ e(
|
|
8212
8196
|
ll,
|
|
8213
8197
|
{
|
|
8214
|
-
alert:
|
|
8198
|
+
alert: A,
|
|
8215
8199
|
sizeMeta: d,
|
|
8216
|
-
onDismiss:
|
|
8200
|
+
onDismiss: b
|
|
8217
8201
|
},
|
|
8218
|
-
|
|
8202
|
+
A.id
|
|
8219
8203
|
)) }),
|
|
8220
8204
|
/* @__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
8205
|
]
|
|
@@ -8345,7 +8329,7 @@ function ml({ video: t, sizeMeta: a }) {
|
|
|
8345
8329
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
8346
8330
|
/* @__PURE__ */ e("span", { className: `text-xs text-zinc-500 dark:text-zinc-400 ${a.description}`, children: t.category }),
|
|
8347
8331
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 text-xs text-zinc-500 dark:text-zinc-400", children: [
|
|
8348
|
-
/* @__PURE__ */ e(
|
|
8332
|
+
/* @__PURE__ */ e(Te, { className: "h-3 w-3" }),
|
|
8349
8333
|
t.duration
|
|
8350
8334
|
] })
|
|
8351
8335
|
] })
|
|
@@ -8362,7 +8346,7 @@ function ul({
|
|
|
8362
8346
|
videos: o = cl,
|
|
8363
8347
|
...h
|
|
8364
8348
|
}) {
|
|
8365
|
-
const [
|
|
8349
|
+
const [f, v] = B(!1), g = ue(t), r = he[g], x = dl[g];
|
|
8366
8350
|
return /* @__PURE__ */ n(
|
|
8367
8351
|
de,
|
|
8368
8352
|
{
|
|
@@ -8381,14 +8365,14 @@ function ul({
|
|
|
8381
8365
|
"button",
|
|
8382
8366
|
{
|
|
8383
8367
|
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(!
|
|
8368
|
+
onClick: () => v(!f),
|
|
8385
8369
|
children: [
|
|
8386
8370
|
"Filter",
|
|
8387
8371
|
/* @__PURE__ */ e(ve, { className: "h-4 w-4 transform rotate-90" })
|
|
8388
8372
|
]
|
|
8389
8373
|
}
|
|
8390
8374
|
),
|
|
8391
|
-
|
|
8375
|
+
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
8376
|
/* @__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
8377
|
/* @__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
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: "Academic" }),
|
|
@@ -8454,8 +8438,8 @@ export {
|
|
|
8454
8438
|
fs as DynamicConfig,
|
|
8455
8439
|
Ls as EventsMock,
|
|
8456
8440
|
zl as FileUploadModal,
|
|
8457
|
-
|
|
8458
|
-
|
|
8441
|
+
Ul as FullConfigPage,
|
|
8442
|
+
Al as FullScreenLoader,
|
|
8459
8443
|
Sl as GenericFilter,
|
|
8460
8444
|
ze as IconButton,
|
|
8461
8445
|
H as Input,
|
|
@@ -8478,7 +8462,7 @@ export {
|
|
|
8478
8462
|
da as Textarea,
|
|
8479
8463
|
ql as ToastProvider,
|
|
8480
8464
|
ma as ToggleSwitch,
|
|
8481
|
-
|
|
8465
|
+
Tl as Tooltip,
|
|
8482
8466
|
jl as TreeView,
|
|
8483
8467
|
ie as UnifyedCoreButton,
|
|
8484
8468
|
ul as VideosMock,
|
|
@@ -8507,6 +8491,6 @@ export {
|
|
|
8507
8491
|
ya as searchRolesApi,
|
|
8508
8492
|
Rl as sessionStore,
|
|
8509
8493
|
he as sizeClasses,
|
|
8510
|
-
|
|
8494
|
+
Gl as toBrowserLocalTime,
|
|
8511
8495
|
pa as userSearchBase
|
|
8512
8496
|
};
|