unifyedx-storybook-new 0.2.74 → 0.2.76
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 +916 -907
- 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,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as n, jsx as e, Fragment as
|
|
2
|
-
import re, { useState as B, useMemo as ae, useId as He, Fragment as Q, useEffect as
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import re, { useState as B, useMemo as ae, useId as He, Fragment as Q, useEffect as Z, useCallback as ee, useRef as fe } from "react";
|
|
3
3
|
import { a as H, U as ct, X as ve, P as c, L as ja, C as xe, b as et, D as dt, f as St, d as Wt, F as _a, e as Ua, h as Ga, T as Le, u as qa, I as Jt, i as Xt, j as Ya, k as Wa, l as Ja, m as Ht, S as vt, n as Qt, M as Xa, o as Ha, p as Nt, q as Qa, A as Za, E as Zt, r as Ka, s as er, t as tr, v as ar, w as Kt, x as rr, y as ea, z as ta, B as nr, G as sr, H as lr, J as Qe, K as mt, N as ut, O as ir, Q as or, R as aa, V as cr, W as wt, Y as dr, Z as mr, _ as Be, $ as ur, a0 as hr, a1 as pr, a2 as gr, a3 as br, a4 as fr, a5 as Dt, a6 as yr, a7 as xr, a8 as vr, a9 as Nr, aa as wr, ab as kr, ac as Cr, ad as zr, ae as Sr, af as Ae, ag as ra, ah as Dr, ai as $r, aj as Tr, ak as Ar, al as Fr, am as na, an as Er, ao as Rr, ap as sa, aq as Ir, ar as ht, as as la, at as Or } from "./vendor-yf0QH1Io.js";
|
|
4
|
-
import { Popover as Pr, PopoverButton as Mr, PopoverPanel as Lr, Transition as he, Dialog as ye, TransitionChild as ke, DialogPanel as Fe, DialogTitle as tt, TabGroup as Br, TabList as Vr, Tab as se, TabPanels as jr, RadioGroup as Ue, Listbox as
|
|
4
|
+
import { Popover as Pr, PopoverButton as Mr, PopoverPanel as Lr, Transition as he, Dialog as ye, TransitionChild as ke, DialogPanel as Fe, DialogTitle as tt, TabGroup as Br, TabList as Vr, Tab as se, TabPanels as jr, RadioGroup as Ue, Listbox as K, ListboxButton as _r, ListboxOptions as Ur, ListboxOption as Gr, SwitchGroup as qr, Switch as lt, Menu as Yr, MenuButton as Wr, Portal as Jr, MenuItems as Xr, MenuItem as Hr, DialogBackdrop as Qr } from "@headlessui/react";
|
|
5
5
|
import { motion as ie, AnimatePresence as Se } from "framer-motion";
|
|
6
6
|
import { d as Zr } from "./vendor-lodash-Dkzj2D3U.js";
|
|
7
7
|
import { useFloating as ia, offset as oa, flip as ca, shift as da, autoUpdate as ma, useClick as Kr, useDismiss as en, useInteractions as tn, FloatingPortal as an } from "@floating-ui/react";
|
|
@@ -33,10 +33,10 @@ const wn = (t) => {
|
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
m
|
|
36
|
-
),
|
|
36
|
+
), p = y ? "transparent" : i || N.bg, z = l || N.text;
|
|
37
37
|
return /* @__PURE__ */ n("div", { className: d, style: {
|
|
38
|
-
backgroundColor:
|
|
39
|
-
color:
|
|
38
|
+
backgroundColor: p,
|
|
39
|
+
color: z
|
|
40
40
|
}, ...o, children: [
|
|
41
41
|
y && /* @__PURE__ */ e(
|
|
42
42
|
"img",
|
|
@@ -155,12 +155,12 @@ const Dn = {
|
|
|
155
155
|
// ✅ Add children to the props list
|
|
156
156
|
iconWidth: v,
|
|
157
157
|
iconHeight: d,
|
|
158
|
-
iconColor:
|
|
159
|
-
strokeWidth:
|
|
160
|
-
onClick:
|
|
161
|
-
...
|
|
158
|
+
iconColor: p,
|
|
159
|
+
strokeWidth: z,
|
|
160
|
+
onClick: F,
|
|
161
|
+
...E
|
|
162
162
|
}) => {
|
|
163
|
-
const
|
|
163
|
+
const I = h || m, P = u && !y, j = H(
|
|
164
164
|
"btn-base",
|
|
165
165
|
Dn[N],
|
|
166
166
|
$n[o],
|
|
@@ -176,13 +176,13 @@ const Dn = {
|
|
|
176
176
|
"data-testid": t,
|
|
177
177
|
type: s,
|
|
178
178
|
className: j,
|
|
179
|
-
disabled:
|
|
180
|
-
onClick:
|
|
179
|
+
disabled: I,
|
|
180
|
+
onClick: F,
|
|
181
181
|
title: a || P && i || (typeof y == "string" ? y : void 0),
|
|
182
182
|
"aria-label": i || P && a || (typeof y == "string" ? y : void 0),
|
|
183
|
-
...
|
|
184
|
-
children: m ? /* @__PURE__ */ e(ja, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(
|
|
185
|
-
u && /* @__PURE__ */ e(u, { size: N === "large" ? 20 : 16, width: v || 16, height: d || 16, color:
|
|
183
|
+
...E,
|
|
184
|
+
children: m ? /* @__PURE__ */ e(ja, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(te, { children: [
|
|
185
|
+
u && /* @__PURE__ */ e(u, { size: N === "large" ? 20 : 16, width: v || 16, height: d || 16, color: p || "#767676", strokeWidth: z || 2 }),
|
|
186
186
|
y,
|
|
187
187
|
r,
|
|
188
188
|
" "
|
|
@@ -293,7 +293,7 @@ const Dn = {
|
|
|
293
293
|
}) => {
|
|
294
294
|
const N = t?.from, y = t?.to, r = (d) => {
|
|
295
295
|
d.stopPropagation(), d.preventDefault(), s?.();
|
|
296
|
-
}, v = N && y ? /* @__PURE__ */ n(
|
|
296
|
+
}, v = N && y ? /* @__PURE__ */ n(te, { children: [
|
|
297
297
|
St(N, "MMM d, y"),
|
|
298
298
|
" - ",
|
|
299
299
|
St(y, "MMM d, y")
|
|
@@ -607,9 +607,9 @@ const Dn = {
|
|
|
607
607
|
formErrors: v,
|
|
608
608
|
// --- UI Text ---
|
|
609
609
|
title: d = "Upload Files",
|
|
610
|
-
subHeading:
|
|
610
|
+
subHeading: p = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
611
611
|
}) => {
|
|
612
|
-
const
|
|
612
|
+
const z = o.length > 0 || u.length > 0;
|
|
613
613
|
return /* @__PURE__ */ e(he, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ n(
|
|
614
614
|
ye,
|
|
615
615
|
{
|
|
@@ -645,7 +645,7 @@ const Dn = {
|
|
|
645
645
|
Fe,
|
|
646
646
|
{
|
|
647
647
|
className: "dialog-panel",
|
|
648
|
-
onClick: (
|
|
648
|
+
onClick: (F) => F.stopPropagation(),
|
|
649
649
|
children: [
|
|
650
650
|
/* @__PURE__ */ e("input", { ...i() }),
|
|
651
651
|
/* @__PURE__ */ n("form", { onSubmit: y, className: "form-wrapper", children: [
|
|
@@ -669,7 +669,7 @@ const Dn = {
|
|
|
669
669
|
children: [
|
|
670
670
|
/* @__PURE__ */ e(Ga, { size: 48, className: "text-gray-400" }),
|
|
671
671
|
/* @__PURE__ */ e("p", { children: "Drag and drop files here" }),
|
|
672
|
-
/* @__PURE__ */ e("p", { className: "sub-heading", children:
|
|
672
|
+
/* @__PURE__ */ e("p", { className: "sub-heading", children: p }),
|
|
673
673
|
/* @__PURE__ */ e("hr", {}),
|
|
674
674
|
/* @__PURE__ */ e("p", { children: "OR" }),
|
|
675
675
|
/* @__PURE__ */ e(
|
|
@@ -685,10 +685,10 @@ const Dn = {
|
|
|
685
685
|
}
|
|
686
686
|
),
|
|
687
687
|
v.filesToUpload && /* @__PURE__ */ e("p", { className: "form-error-message", children: v.filesToUpload.message }),
|
|
688
|
-
|
|
688
|
+
z && /* @__PURE__ */ n("div", { className: "file-list-container", children: [
|
|
689
689
|
/* @__PURE__ */ e("h3", { children: "Upload Queue" }),
|
|
690
690
|
/* @__PURE__ */ n("ul", { className: "file-list", children: [
|
|
691
|
-
o.map((
|
|
691
|
+
o.map((F, E) => /* @__PURE__ */ n(
|
|
692
692
|
"li",
|
|
693
693
|
{
|
|
694
694
|
className: "file-item",
|
|
@@ -697,28 +697,28 @@ const Dn = {
|
|
|
697
697
|
/* @__PURE__ */ e(
|
|
698
698
|
At,
|
|
699
699
|
{
|
|
700
|
-
extension:
|
|
700
|
+
extension: F.name.split(".").pop()
|
|
701
701
|
}
|
|
702
702
|
),
|
|
703
703
|
/* @__PURE__ */ n("div", { children: [
|
|
704
|
-
/* @__PURE__ */ e("p", { className: "file-item-name", children:
|
|
705
|
-
/* @__PURE__ */ e("p", { className: "file-item-size", children: Ft(
|
|
704
|
+
/* @__PURE__ */ e("p", { className: "file-item-name", children: F.name }),
|
|
705
|
+
/* @__PURE__ */ e("p", { className: "file-item-size", children: Ft(F.size) })
|
|
706
706
|
] })
|
|
707
707
|
] }),
|
|
708
708
|
/* @__PURE__ */ e(
|
|
709
709
|
"button",
|
|
710
710
|
{
|
|
711
711
|
type: "button",
|
|
712
|
-
onClick: () => h(
|
|
712
|
+
onClick: () => h(E),
|
|
713
713
|
className: "remove-file-button",
|
|
714
714
|
children: /* @__PURE__ */ e(Le, { size: 16 })
|
|
715
715
|
}
|
|
716
716
|
)
|
|
717
717
|
]
|
|
718
718
|
},
|
|
719
|
-
`${
|
|
719
|
+
`${F.name}-${E}`
|
|
720
720
|
)),
|
|
721
|
-
u.map(({ file:
|
|
721
|
+
u.map(({ file: F, message: E }, I) => /* @__PURE__ */ n(
|
|
722
722
|
"li",
|
|
723
723
|
{
|
|
724
724
|
className: "file-item file-item--rejected",
|
|
@@ -727,27 +727,27 @@ const Dn = {
|
|
|
727
727
|
/* @__PURE__ */ e(
|
|
728
728
|
At,
|
|
729
729
|
{
|
|
730
|
-
extension:
|
|
730
|
+
extension: F.name.split(".").pop()
|
|
731
731
|
}
|
|
732
732
|
),
|
|
733
733
|
/* @__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:
|
|
734
|
+
/* @__PURE__ */ e("p", { className: "file-item-name", children: F.name }),
|
|
735
|
+
/* @__PURE__ */ e("p", { className: "file-item-size", children: Ft(F.size) }),
|
|
736
|
+
/* @__PURE__ */ e("p", { className: "rejection-reason", children: E })
|
|
737
737
|
] })
|
|
738
738
|
] }),
|
|
739
739
|
/* @__PURE__ */ e(
|
|
740
740
|
"button",
|
|
741
741
|
{
|
|
742
742
|
type: "button",
|
|
743
|
-
onClick: () => N(
|
|
743
|
+
onClick: () => N(I),
|
|
744
744
|
className: "remove-file-button",
|
|
745
745
|
children: /* @__PURE__ */ e(Le, { size: 16 })
|
|
746
746
|
}
|
|
747
747
|
)
|
|
748
748
|
]
|
|
749
749
|
},
|
|
750
|
-
`${
|
|
750
|
+
`${F.name}-${I}`
|
|
751
751
|
))
|
|
752
752
|
] })
|
|
753
753
|
] })
|
|
@@ -840,66 +840,66 @@ const Dn = {
|
|
|
840
840
|
updatedBy: !1
|
|
841
841
|
}), [v, d] = B({
|
|
842
842
|
startDate: null
|
|
843
|
-
}), [
|
|
843
|
+
}), [p, z] = B({
|
|
844
844
|
endDate: null
|
|
845
|
-
}),
|
|
845
|
+
}), F = qa({
|
|
846
846
|
initialValues: JSON.parse(JSON.stringify(m)),
|
|
847
847
|
// Deep copy
|
|
848
848
|
onSubmit: ($) => {
|
|
849
849
|
const x = {};
|
|
850
|
-
Object.keys($).forEach((
|
|
851
|
-
x[
|
|
852
|
-
operator: $[
|
|
853
|
-
values: Array.isArray($[
|
|
854
|
-
range: $[
|
|
850
|
+
Object.keys($).forEach((b) => {
|
|
851
|
+
x[b] = {
|
|
852
|
+
operator: $[b].operator || "in",
|
|
853
|
+
values: Array.isArray($[b].values) ? $[b].values : [],
|
|
854
|
+
range: $[b].range || null
|
|
855
855
|
};
|
|
856
856
|
}), console.log("[storybook filter] Applied Filters:", x), typeof s == "function" && s({
|
|
857
857
|
filters: x,
|
|
858
|
-
activeCount:
|
|
858
|
+
activeCount: I
|
|
859
859
|
}), a();
|
|
860
860
|
},
|
|
861
861
|
enableReinitialize: !0
|
|
862
|
-
}),
|
|
863
|
-
const
|
|
862
|
+
}), E = ae(() => l.reduce(($, x) => {
|
|
863
|
+
const b = x.key, S = F.values[b];
|
|
864
864
|
let O = !1;
|
|
865
|
-
if (
|
|
865
|
+
if (S)
|
|
866
866
|
switch (x.type) {
|
|
867
867
|
case "multiselect":
|
|
868
868
|
case "multiselect-users":
|
|
869
|
-
O = Array.isArray(
|
|
869
|
+
O = Array.isArray(S.values) && S.values.length > 0;
|
|
870
870
|
break;
|
|
871
871
|
case "date":
|
|
872
|
-
(
|
|
872
|
+
(S.range && S.range !== "" || Array.isArray(S.values) && S.values.length > 0) && (O = !0);
|
|
873
873
|
break;
|
|
874
874
|
}
|
|
875
|
-
return $[
|
|
876
|
-
}, {}), [l,
|
|
875
|
+
return $[b] = O, $;
|
|
876
|
+
}, {}), [l, F.values]), I = Object.values(E).filter(Boolean).length, P = ae(() => l.some(($) => {
|
|
877
877
|
if ($.type !== "date") return !1;
|
|
878
|
-
const x =
|
|
878
|
+
const x = F.values?.[$.key]?.values;
|
|
879
879
|
if (!Array.isArray(x) || x.length < 2) return !1;
|
|
880
|
-
const [
|
|
881
|
-
if (!
|
|
882
|
-
const O =
|
|
883
|
-
return O >
|
|
884
|
-
}), [l,
|
|
880
|
+
const [b, S] = x;
|
|
881
|
+
if (!b || !S) return !1;
|
|
882
|
+
const O = b instanceof Date ? b : new Date(b), R = S instanceof Date ? S : new Date(S);
|
|
883
|
+
return O > R;
|
|
884
|
+
}), [l, F.values]), j = async ($, x) => {
|
|
885
885
|
try {
|
|
886
|
-
r((
|
|
887
|
-
const
|
|
888
|
-
N((
|
|
889
|
-
} catch (
|
|
890
|
-
console.error(`Error fetching ${$} users:`,
|
|
886
|
+
r((S) => ({ ...S, [$]: !0 }));
|
|
887
|
+
const b = await u($, x);
|
|
888
|
+
N((S) => ({ ...S, [$]: b }));
|
|
889
|
+
} catch (b) {
|
|
890
|
+
console.error(`Error fetching ${$} users:`, b);
|
|
891
891
|
} finally {
|
|
892
|
-
r((
|
|
892
|
+
r((b) => ({ ...b, [$]: !1 }));
|
|
893
893
|
}
|
|
894
894
|
}, U = ($) => {
|
|
895
|
-
const x = l[$].key,
|
|
896
|
-
l[$].type === "multiselect-users" && h[x].length === 0 && !y[x] && j(x,
|
|
895
|
+
const x = l[$].key, b = l[$].url;
|
|
896
|
+
l[$].type === "multiselect-users" && h[x].length === 0 && !y[x] && j(x, b);
|
|
897
897
|
}, Y = () => {
|
|
898
|
-
|
|
898
|
+
F.resetForm(), N({ createdBy: [], updatedBy: [] }), i();
|
|
899
899
|
}, q = ($) => {
|
|
900
900
|
const x = l.find((O) => O.key === $);
|
|
901
901
|
if (!x) return null;
|
|
902
|
-
const
|
|
902
|
+
const b = F.values[$] || m[$], S = Array.isArray(b.values) ? b.values : [];
|
|
903
903
|
switch (x.type) {
|
|
904
904
|
case "multiselect":
|
|
905
905
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
@@ -908,10 +908,10 @@ const Dn = {
|
|
|
908
908
|
/* @__PURE__ */ e(
|
|
909
909
|
"select",
|
|
910
910
|
{
|
|
911
|
-
value:
|
|
912
|
-
onChange: (
|
|
911
|
+
value: b.operator || "in",
|
|
912
|
+
onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
|
|
913
913
|
className: "filter-select",
|
|
914
|
-
children: x.operators.map((
|
|
914
|
+
children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Includes" : "Excludes" }, A))
|
|
915
915
|
}
|
|
916
916
|
)
|
|
917
917
|
] }),
|
|
@@ -923,10 +923,10 @@ const Dn = {
|
|
|
923
923
|
type: "checkbox",
|
|
924
924
|
id: `select-all-${$}`,
|
|
925
925
|
className: "filter-checkbox-input",
|
|
926
|
-
checked: x.options.length > 0 &&
|
|
927
|
-
onChange: (
|
|
928
|
-
const G =
|
|
929
|
-
|
|
926
|
+
checked: x.options.length > 0 && S.length === x.options.length,
|
|
927
|
+
onChange: (A) => {
|
|
928
|
+
const G = A.target.checked ? x.options.map((W) => W.value) : [];
|
|
929
|
+
F.setFieldValue(`${$}.values`, G);
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
),
|
|
@@ -939,47 +939,47 @@ const Dn = {
|
|
|
939
939
|
}
|
|
940
940
|
)
|
|
941
941
|
] }),
|
|
942
|
-
x.options.map((
|
|
942
|
+
x.options.map((A) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
|
|
943
943
|
/* @__PURE__ */ e(
|
|
944
944
|
"input",
|
|
945
945
|
{
|
|
946
946
|
type: "checkbox",
|
|
947
|
-
id: `${$}-${
|
|
947
|
+
id: `${$}-${A.value}`,
|
|
948
948
|
className: "filter-checkbox-input",
|
|
949
|
-
checked:
|
|
949
|
+
checked: S.includes(A.value),
|
|
950
950
|
onChange: (G) => {
|
|
951
|
-
const W = G.target.checked ? [...
|
|
952
|
-
|
|
951
|
+
const W = G.target.checked ? [...S, A.value] : S.filter((pe) => pe !== A.value);
|
|
952
|
+
F.setFieldValue(`${$}.values`, W);
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
),
|
|
956
956
|
/* @__PURE__ */ e(
|
|
957
957
|
"label",
|
|
958
958
|
{
|
|
959
|
-
htmlFor: `${$}-${
|
|
959
|
+
htmlFor: `${$}-${A.value}`,
|
|
960
960
|
className: "filter-checkbox-label",
|
|
961
|
-
children:
|
|
961
|
+
children: A.label
|
|
962
962
|
}
|
|
963
963
|
)
|
|
964
|
-
] },
|
|
964
|
+
] }, A.value))
|
|
965
965
|
] })
|
|
966
966
|
] });
|
|
967
967
|
case "multiselect-users":
|
|
968
|
-
const O = h[$] || [],
|
|
968
|
+
const O = h[$] || [], R = y[$];
|
|
969
969
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
970
970
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
971
971
|
/* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
|
|
972
972
|
/* @__PURE__ */ e(
|
|
973
973
|
"select",
|
|
974
974
|
{
|
|
975
|
-
value:
|
|
976
|
-
onChange: (
|
|
975
|
+
value: b.operator || "in",
|
|
976
|
+
onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
|
|
977
977
|
className: "filter-select",
|
|
978
|
-
children: x.operators.map((
|
|
978
|
+
children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Includes" : "Excludes" }, A))
|
|
979
979
|
}
|
|
980
980
|
)
|
|
981
981
|
] }),
|
|
982
|
-
|
|
982
|
+
R ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: O.length > 0 ? /* @__PURE__ */ n(te, { children: [
|
|
983
983
|
/* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
|
|
984
984
|
/* @__PURE__ */ e(
|
|
985
985
|
"input",
|
|
@@ -987,10 +987,10 @@ const Dn = {
|
|
|
987
987
|
type: "checkbox",
|
|
988
988
|
id: `select-all-users-${$}`,
|
|
989
989
|
className: "filter-checkbox-input",
|
|
990
|
-
checked: O.length > 0 &&
|
|
991
|
-
onChange: (
|
|
992
|
-
const G =
|
|
993
|
-
|
|
990
|
+
checked: O.length > 0 && S.length === O.length,
|
|
991
|
+
onChange: (A) => {
|
|
992
|
+
const G = A.target.checked ? O.map((W) => W.email) : [];
|
|
993
|
+
F.setFieldValue(
|
|
994
994
|
`${$}.values`,
|
|
995
995
|
G
|
|
996
996
|
);
|
|
@@ -1006,17 +1006,17 @@ const Dn = {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
)
|
|
1008
1008
|
] }),
|
|
1009
|
-
O.map((
|
|
1009
|
+
O.map((A) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item createdby", children: [
|
|
1010
1010
|
/* @__PURE__ */ e(
|
|
1011
1011
|
"input",
|
|
1012
1012
|
{
|
|
1013
1013
|
type: "checkbox",
|
|
1014
|
-
id: `${$}-${
|
|
1014
|
+
id: `${$}-${A.email}`,
|
|
1015
1015
|
className: "filter-checkbox-input",
|
|
1016
|
-
checked:
|
|
1016
|
+
checked: S.includes(A.email),
|
|
1017
1017
|
onChange: (G) => {
|
|
1018
|
-
const W = G.target.checked ? [...
|
|
1019
|
-
|
|
1018
|
+
const W = G.target.checked ? [...S, A.email] : S.filter((pe) => pe !== A.email);
|
|
1019
|
+
F.setFieldValue(
|
|
1020
1020
|
`${$}.values`,
|
|
1021
1021
|
W
|
|
1022
1022
|
);
|
|
@@ -1026,19 +1026,19 @@ const Dn = {
|
|
|
1026
1026
|
/* @__PURE__ */ n(
|
|
1027
1027
|
"label",
|
|
1028
1028
|
{
|
|
1029
|
-
htmlFor: `${$}-${
|
|
1029
|
+
htmlFor: `${$}-${A.email}`,
|
|
1030
1030
|
className: "filter-checkbox-label",
|
|
1031
1031
|
children: [
|
|
1032
|
-
/* @__PURE__ */ e("span", { className: "user-label-name", children:
|
|
1033
|
-
/* @__PURE__ */ e("span", { className: "user-label-email", children:
|
|
1032
|
+
/* @__PURE__ */ e("span", { className: "user-label-name", children: A.name }),
|
|
1033
|
+
/* @__PURE__ */ e("span", { className: "user-label-email", children: A.email })
|
|
1034
1034
|
]
|
|
1035
1035
|
}
|
|
1036
1036
|
)
|
|
1037
|
-
] },
|
|
1037
|
+
] }, A.email))
|
|
1038
1038
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1039
1039
|
] });
|
|
1040
1040
|
case "date":
|
|
1041
|
-
const D =
|
|
1041
|
+
const D = b.values || [], [f, g] = D, w = f && g, k = D[0] || null, T = D[1] || null, L = {
|
|
1042
1042
|
startDate: k instanceof Date ? k.toISOString().slice(0, 10) : null,
|
|
1043
1043
|
endDate: k instanceof Date ? k.toISOString().slice(0, 10) : null
|
|
1044
1044
|
}, C = {
|
|
@@ -1052,17 +1052,17 @@ const Dn = {
|
|
|
1052
1052
|
{ key: "this_month", label: "This Month" },
|
|
1053
1053
|
{ key: "last_month", label: "Last Month" },
|
|
1054
1054
|
{ key: "custom", label: "Custom" }
|
|
1055
|
-
], _ = (
|
|
1056
|
-
if (
|
|
1057
|
-
|
|
1055
|
+
], _ = (A) => {
|
|
1056
|
+
if (A === "anytime") {
|
|
1057
|
+
F.setFieldValue(`${$}.values`, []), F.setFieldValue(`${$}.range`, "anytime");
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
|
-
if (
|
|
1061
|
-
|
|
1060
|
+
if (A === "custom") {
|
|
1061
|
+
F.setFieldValue(`${$}.range`, "custom");
|
|
1062
1062
|
return;
|
|
1063
1063
|
}
|
|
1064
|
-
const [G, W] = Mn(
|
|
1065
|
-
|
|
1064
|
+
const [G, W] = Mn(A);
|
|
1065
|
+
F.setFieldValue(`${$}.values`, G && W ? [G, W] : []), F.setFieldValue(`${$}.range`, A);
|
|
1066
1066
|
};
|
|
1067
1067
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
1068
1068
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
@@ -1070,10 +1070,10 @@ const Dn = {
|
|
|
1070
1070
|
/* @__PURE__ */ e(
|
|
1071
1071
|
"select",
|
|
1072
1072
|
{
|
|
1073
|
-
value:
|
|
1074
|
-
onChange: (
|
|
1073
|
+
value: b.operator,
|
|
1074
|
+
onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
|
|
1075
1075
|
className: "filter-select",
|
|
1076
|
-
children: x.operators.map((
|
|
1076
|
+
children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Is" : "Is not" }, A))
|
|
1077
1077
|
}
|
|
1078
1078
|
),
|
|
1079
1079
|
w && /* @__PURE__ */ e(
|
|
@@ -1081,7 +1081,7 @@ const Dn = {
|
|
|
1081
1081
|
{
|
|
1082
1082
|
type: "button",
|
|
1083
1083
|
onClick: () => {
|
|
1084
|
-
|
|
1084
|
+
F.setFieldValue(
|
|
1085
1085
|
$,
|
|
1086
1086
|
m[$]
|
|
1087
1087
|
);
|
|
@@ -1091,8 +1091,8 @@ const Dn = {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
)
|
|
1093
1093
|
] }),
|
|
1094
|
-
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((
|
|
1095
|
-
const G =
|
|
1094
|
+
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((A) => {
|
|
1095
|
+
const G = b.range === A.key || A.key === "anytime" && (!Array.isArray(b.values) || b.values.length === 0);
|
|
1096
1096
|
return /* @__PURE__ */ n(
|
|
1097
1097
|
"label",
|
|
1098
1098
|
{
|
|
@@ -1104,15 +1104,15 @@ const Dn = {
|
|
|
1104
1104
|
type: "radio",
|
|
1105
1105
|
name: `preset-${$}`,
|
|
1106
1106
|
checked: G,
|
|
1107
|
-
onChange: () => _(
|
|
1107
|
+
onChange: () => _(A.key),
|
|
1108
1108
|
className: "h-4 w-4"
|
|
1109
1109
|
}
|
|
1110
1110
|
),
|
|
1111
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-[#222]", children:
|
|
1112
|
-
|
|
1111
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-[#222]", children: A.label }),
|
|
1112
|
+
A.key === "anytime" && G && /* @__PURE__ */ e("span", { className: "ml-2 text-xs bg-yellow-100 text-yellow-800 px-2 py-0.5 rounded", children: "Default" })
|
|
1113
1113
|
]
|
|
1114
1114
|
},
|
|
1115
|
-
|
|
1115
|
+
A.key
|
|
1116
1116
|
);
|
|
1117
1117
|
}) }) }),
|
|
1118
1118
|
/* @__PURE__ */ n("div", { className: "", children: [
|
|
@@ -1125,9 +1125,9 @@ const Dn = {
|
|
|
1125
1125
|
asSingle: !0,
|
|
1126
1126
|
useRange: !1,
|
|
1127
1127
|
value: L,
|
|
1128
|
-
onChange: (
|
|
1129
|
-
const G =
|
|
1130
|
-
G && (
|
|
1128
|
+
onChange: (A) => {
|
|
1129
|
+
const G = A?.startDate ? Ve(new Date(A.startDate)) : null, W = D[1] || null;
|
|
1130
|
+
G && (F.setFieldValue(`${$}.values`, [G, W]), F.setFieldValue(`${$}.range`, "custom"));
|
|
1131
1131
|
},
|
|
1132
1132
|
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
1133
|
primaryColor: "violet",
|
|
@@ -1149,9 +1149,9 @@ const Dn = {
|
|
|
1149
1149
|
asSingle: !0,
|
|
1150
1150
|
useRange: !1,
|
|
1151
1151
|
value: C,
|
|
1152
|
-
onChange: (
|
|
1153
|
-
const G =
|
|
1154
|
-
G && (
|
|
1152
|
+
onChange: (A) => {
|
|
1153
|
+
const G = A?.startDate ? je(new Date(A.startDate)) : null, W = D[0] || null;
|
|
1154
|
+
G && (F.setFieldValue(`${$}.values`, [W, G]), F.setFieldValue(`${$}.range`, "custom"));
|
|
1155
1155
|
},
|
|
1156
1156
|
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
1157
|
primaryColor: "violet",
|
|
@@ -1208,7 +1208,7 @@ const Dn = {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
)
|
|
1210
1210
|
] }),
|
|
1211
|
-
/* @__PURE__ */ n("form", { onSubmit:
|
|
1211
|
+
/* @__PURE__ */ n("form", { onSubmit: F.handleSubmit, className: "filter-form", children: [
|
|
1212
1212
|
/* @__PURE__ */ e("div", { className: "filter-content-wrapper", children: /* @__PURE__ */ n(
|
|
1213
1213
|
Br,
|
|
1214
1214
|
{
|
|
@@ -1223,7 +1223,7 @@ const Dn = {
|
|
|
1223
1223
|
/* @__PURE__ */ e("div", { className: "filter-selection-horizontal-indicator" }),
|
|
1224
1224
|
/* @__PURE__ */ n("div", { className: "filter-lbl-indicator-wrapper", children: [
|
|
1225
1225
|
$.label,
|
|
1226
|
-
|
|
1226
|
+
E[$.key] && /* @__PURE__ */ e(
|
|
1227
1227
|
"span",
|
|
1228
1228
|
{
|
|
1229
1229
|
className: "filter-active-indicator",
|
|
@@ -1267,12 +1267,12 @@ const Dn = {
|
|
|
1267
1267
|
"button",
|
|
1268
1268
|
{
|
|
1269
1269
|
type: "submit",
|
|
1270
|
-
disabled: !
|
|
1270
|
+
disabled: !F.dirty || P,
|
|
1271
1271
|
className: "filter-button apply",
|
|
1272
1272
|
children: [
|
|
1273
1273
|
"Apply Filters",
|
|
1274
1274
|
" ",
|
|
1275
|
-
|
|
1275
|
+
I > 0 ? `(${I})` : ""
|
|
1276
1276
|
]
|
|
1277
1277
|
}
|
|
1278
1278
|
)
|
|
@@ -1419,7 +1419,7 @@ const Dn = {
|
|
|
1419
1419
|
itemsPerPageOptions: m = [10, 15, 20]
|
|
1420
1420
|
}) => {
|
|
1421
1421
|
const o = Math.ceil(a / s), [u, h] = B(t);
|
|
1422
|
-
|
|
1422
|
+
Z(() => {
|
|
1423
1423
|
h(t);
|
|
1424
1424
|
}, [t]);
|
|
1425
1425
|
const N = Math.min((t - 1) * s + 1, a), y = Math.min(t * s, a), r = (v) => {
|
|
@@ -1532,7 +1532,7 @@ const Dn = {
|
|
|
1532
1532
|
"radiogroup-option--checked": h,
|
|
1533
1533
|
"radiogroup-option--error": !!l
|
|
1534
1534
|
}),
|
|
1535
|
-
children: ({ checked: u }) => /* @__PURE__ */ n(
|
|
1535
|
+
children: ({ checked: u }) => /* @__PURE__ */ n(te, { children: [
|
|
1536
1536
|
/* @__PURE__ */ n("div", { className: "radiogroup-option-content", children: [
|
|
1537
1537
|
/* @__PURE__ */ e(Ue.Label, { as: "p", className: "option-label", children: o.label }),
|
|
1538
1538
|
o.description && /* @__PURE__ */ e(
|
|
@@ -1567,20 +1567,20 @@ const Dn = {
|
|
|
1567
1567
|
...y
|
|
1568
1568
|
}) => {
|
|
1569
1569
|
const [r, v] = B(t);
|
|
1570
|
-
|
|
1570
|
+
Z(() => {
|
|
1571
1571
|
v(t);
|
|
1572
1572
|
}, [t]);
|
|
1573
|
-
const d =
|
|
1574
|
-
Zr((
|
|
1575
|
-
a?.(
|
|
1573
|
+
const d = ee(
|
|
1574
|
+
Zr((z) => {
|
|
1575
|
+
a?.(z);
|
|
1576
1576
|
}, s),
|
|
1577
1577
|
[s, a]
|
|
1578
1578
|
);
|
|
1579
|
-
|
|
1579
|
+
Z(() => (r !== t && d(r), () => {
|
|
1580
1580
|
d.cancel();
|
|
1581
1581
|
}), [r, d, t]);
|
|
1582
|
-
const
|
|
1583
|
-
v(
|
|
1582
|
+
const p = (z) => {
|
|
1583
|
+
v(z.target.value);
|
|
1584
1584
|
};
|
|
1585
1585
|
return /* @__PURE__ */ n("div", { className: `search-bar-wrapper ${m}`, children: [
|
|
1586
1586
|
l && /* @__PURE__ */ e("label", { htmlFor: "search-field", className: "sr-only", children: l }),
|
|
@@ -1594,7 +1594,7 @@ const Dn = {
|
|
|
1594
1594
|
type: "search",
|
|
1595
1595
|
name: "search",
|
|
1596
1596
|
value: r,
|
|
1597
|
-
onChange:
|
|
1597
|
+
onChange: p,
|
|
1598
1598
|
style: o,
|
|
1599
1599
|
...y
|
|
1600
1600
|
}
|
|
@@ -1627,7 +1627,7 @@ const Dn = {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
return d.id === a || d.value === a || d.label === a;
|
|
1629
1629
|
});
|
|
1630
|
-
return /* @__PURE__ */ e(
|
|
1630
|
+
return /* @__PURE__ */ e(K, { value: a, onChange: s, disabled: m, children: /* @__PURE__ */ n("div", { className: "select-wrapper", ref: u, children: [
|
|
1631
1631
|
t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
|
|
1632
1632
|
/* @__PURE__ */ n("div", { className: "select-button-container", children: [
|
|
1633
1633
|
/* @__PURE__ */ n(
|
|
@@ -1663,20 +1663,20 @@ const Dn = {
|
|
|
1663
1663
|
/* @__PURE__ */ e("div", { className: "select-options-list", children: r.length === 0 && N !== "" ? /* @__PURE__ */ e("div", { className: "no-results", children: "No results found." }) : r.map((d) => /* @__PURE__ */ e(
|
|
1664
1664
|
Gr,
|
|
1665
1665
|
{
|
|
1666
|
-
className: ({ active:
|
|
1666
|
+
className: ({ active: p }) => `select-option ${p ? "active" : ""}`,
|
|
1667
1667
|
value: d,
|
|
1668
|
-
children: ({ selected:
|
|
1668
|
+
children: ({ selected: p }) => /* @__PURE__ */ n(te, { children: [
|
|
1669
1669
|
/* @__PURE__ */ n("div", { className: "option-content", children: [
|
|
1670
1670
|
d.icon && /* @__PURE__ */ e(d.icon, { className: "option-icon" }),
|
|
1671
1671
|
/* @__PURE__ */ e(
|
|
1672
1672
|
"span",
|
|
1673
1673
|
{
|
|
1674
|
-
className: `option-label ${
|
|
1674
|
+
className: `option-label ${p ? "selected" : ""}`,
|
|
1675
1675
|
children: d.label
|
|
1676
1676
|
}
|
|
1677
1677
|
)
|
|
1678
1678
|
] }),
|
|
1679
|
-
|
|
1679
|
+
p ? /* @__PURE__ */ e(
|
|
1680
1680
|
et,
|
|
1681
1681
|
{
|
|
1682
1682
|
className: "option-check-icon",
|
|
@@ -1695,7 +1695,7 @@ const Dn = {
|
|
|
1695
1695
|
] }) });
|
|
1696
1696
|
}, Bn = () => {
|
|
1697
1697
|
const [t, a] = B(window.location.pathname);
|
|
1698
|
-
return
|
|
1698
|
+
return Z(() => {
|
|
1699
1699
|
const s = () => {
|
|
1700
1700
|
a(window.location.pathname);
|
|
1701
1701
|
};
|
|
@@ -1710,7 +1710,7 @@ const Dn = {
|
|
|
1710
1710
|
return null;
|
|
1711
1711
|
}, ga = ({ item: t, isCollapsed: a, level: s = 0 }) => {
|
|
1712
1712
|
const { pathname: i } = Bn(), l = t.href || t.url || t.path, [m, o] = B(!1), u = t.icon;
|
|
1713
|
-
|
|
1713
|
+
Z(() => {
|
|
1714
1714
|
yt([t], i) && o(!0);
|
|
1715
1715
|
}, [t, i]);
|
|
1716
1716
|
const h = i === l, N = !h && !!yt([t], i), y = (r) => {
|
|
@@ -1789,7 +1789,7 @@ const Dn = {
|
|
|
1789
1789
|
logoSmall: m,
|
|
1790
1790
|
logoLarge: o,
|
|
1791
1791
|
user: u = { name: "", email: "" }
|
|
1792
|
-
}) => /* @__PURE__ */ n(
|
|
1792
|
+
}) => /* @__PURE__ */ n(te, { children: [
|
|
1793
1793
|
i && /* @__PURE__ */ e(
|
|
1794
1794
|
"div",
|
|
1795
1795
|
{
|
|
@@ -1968,7 +1968,7 @@ const Dn = {
|
|
|
1968
1968
|
...o
|
|
1969
1969
|
}) => {
|
|
1970
1970
|
const u = re.useId();
|
|
1971
|
-
return /* @__PURE__ */ n(
|
|
1971
|
+
return /* @__PURE__ */ n(te, { children: [
|
|
1972
1972
|
re.cloneElement(t, { "data-tooltip-id": u }),
|
|
1973
1973
|
/* @__PURE__ */ e(
|
|
1974
1974
|
Qa,
|
|
@@ -2007,7 +2007,7 @@ const Dn = {
|
|
|
2007
2007
|
showProgress: h = !0,
|
|
2008
2008
|
closeOnOverlayClick: N = !0
|
|
2009
2009
|
}) => {
|
|
2010
|
-
const y = s[i], r = Object.keys(s), v = r.indexOf(i), d = (v + 1) / r.length * 100,
|
|
2010
|
+
const y = s[i], r = Object.keys(s), v = r.indexOf(i), d = (v + 1) / r.length * 100, p = v > 0 && m.onBack;
|
|
2011
2011
|
return /* @__PURE__ */ e(he, { show: t, as: Q, children: /* @__PURE__ */ n(
|
|
2012
2012
|
ye,
|
|
2013
2013
|
{
|
|
@@ -2042,7 +2042,7 @@ const Dn = {
|
|
|
2042
2042
|
children: /* @__PURE__ */ n(Fe, { className: "wizard-panel", children: [
|
|
2043
2043
|
/* @__PURE__ */ n("header", { className: "wizard-header", children: [
|
|
2044
2044
|
/* @__PURE__ */ n("div", { className: "wizard-header-content", children: [
|
|
2045
|
-
|
|
2045
|
+
p && /* @__PURE__ */ e(
|
|
2046
2046
|
"button",
|
|
2047
2047
|
{
|
|
2048
2048
|
onClick: m.onBack,
|
|
@@ -2131,7 +2131,7 @@ const Dn = {
|
|
|
2131
2131
|
onClick: r,
|
|
2132
2132
|
...v
|
|
2133
2133
|
}) => {
|
|
2134
|
-
const d = u,
|
|
2134
|
+
const d = u, p = H(
|
|
2135
2135
|
"btn-base-icon",
|
|
2136
2136
|
"btn-icon-only",
|
|
2137
2137
|
jn[h],
|
|
@@ -2143,7 +2143,7 @@ const Dn = {
|
|
|
2143
2143
|
{
|
|
2144
2144
|
"data-testid": t,
|
|
2145
2145
|
type: s,
|
|
2146
|
-
className:
|
|
2146
|
+
className: p,
|
|
2147
2147
|
disabled: d,
|
|
2148
2148
|
onClick: r,
|
|
2149
2149
|
title: i,
|
|
@@ -2595,7 +2595,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2595
2595
|
}
|
|
2596
2596
|
}, zt = (t, a) => {
|
|
2597
2597
|
const [s, i] = B(t);
|
|
2598
|
-
return
|
|
2598
|
+
return Z(
|
|
2599
2599
|
() => {
|
|
2600
2600
|
const l = rn(() => {
|
|
2601
2601
|
i(t);
|
|
@@ -2666,7 +2666,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2666
2666
|
},
|
|
2667
2667
|
isChanged: u = !1
|
|
2668
2668
|
}) => {
|
|
2669
|
-
const [h, N] = B(Mt[0]), [y, r] = B(""), v = zt(y, 400), [d,
|
|
2669
|
+
const [h, N] = B(Mt[0]), [y, r] = B(""), v = zt(y, 400), [d, p] = B([]), [z, F] = B(/* @__PURE__ */ new Set()), [E, I] = B(!1), [P, j] = B(Lt[0]), {
|
|
2670
2670
|
control: U,
|
|
2671
2671
|
handleSubmit: Y,
|
|
2672
2672
|
watch: q,
|
|
@@ -2674,35 +2674,35 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2674
2674
|
} = nr({
|
|
2675
2675
|
defaultValues: { pendingInvites: [] },
|
|
2676
2676
|
resolver: ir(rs)
|
|
2677
|
-
}), { fields:
|
|
2677
|
+
}), { fields: b, append: S, remove: O, update: R } = sr({
|
|
2678
2678
|
control: U,
|
|
2679
2679
|
name: "pendingInvites"
|
|
2680
2680
|
}), D = q("pendingInvites");
|
|
2681
|
-
|
|
2682
|
-
v.length > 1 ? (
|
|
2683
|
-
|
|
2684
|
-
}).catch((C) => console.error("Search failed:", C)).finally(() =>
|
|
2681
|
+
Z(() => {
|
|
2682
|
+
v.length > 1 ? (I(!0), es(h.name, v).then((C) => {
|
|
2683
|
+
p(C);
|
|
2684
|
+
}).catch((C) => console.error("Search failed:", C)).finally(() => I(!1))) : (p([]), F(/* @__PURE__ */ new Set()));
|
|
2685
2685
|
}, [v, h]);
|
|
2686
|
-
const
|
|
2687
|
-
|
|
2686
|
+
const f = (C) => {
|
|
2687
|
+
F((M) => {
|
|
2688
2688
|
const _ = new Set(M);
|
|
2689
2689
|
return _.has(C) ? _.delete(C) : _.add(C), _;
|
|
2690
2690
|
});
|
|
2691
|
-
},
|
|
2692
|
-
d.filter((C) =>
|
|
2693
|
-
|
|
2694
|
-
}),
|
|
2691
|
+
}, g = () => {
|
|
2692
|
+
d.filter((C) => z.has(C.id)).forEach((C) => {
|
|
2693
|
+
b.find((M) => M.id === C.id) || S({ ...C, permission: P.name });
|
|
2694
|
+
}), F(/* @__PURE__ */ new Set()), r("");
|
|
2695
2695
|
}, w = (C) => {
|
|
2696
|
-
j(C),
|
|
2697
|
-
(M, _) =>
|
|
2696
|
+
j(C), b.forEach(
|
|
2697
|
+
(M, _) => R(_, { ...b[_], permission: C.name })
|
|
2698
2698
|
);
|
|
2699
2699
|
}, k = async (C) => {
|
|
2700
2700
|
try {
|
|
2701
2701
|
if (l === ue.DRIVE) {
|
|
2702
|
-
const M = C.pendingInvites.map((
|
|
2703
|
-
id:
|
|
2704
|
-
permission:
|
|
2705
|
-
type:
|
|
2702
|
+
const M = C.pendingInvites.map((A) => ({
|
|
2703
|
+
id: A.id,
|
|
2704
|
+
permission: A.permission,
|
|
2705
|
+
type: A.type.toLowerCase()
|
|
2706
2706
|
}));
|
|
2707
2707
|
o({
|
|
2708
2708
|
entity: t,
|
|
@@ -2722,10 +2722,10 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2722
2722
|
}));
|
|
2723
2723
|
o(M, i);
|
|
2724
2724
|
} else if (l === ue.ARTICLE) {
|
|
2725
|
-
const M = C.pendingInvites.map((
|
|
2726
|
-
id:
|
|
2727
|
-
permission:
|
|
2728
|
-
type:
|
|
2725
|
+
const M = C.pendingInvites.map((A) => ({
|
|
2726
|
+
id: A.id,
|
|
2727
|
+
permission: A.permission,
|
|
2728
|
+
type: A.type.toLowerCase()
|
|
2729
2729
|
}));
|
|
2730
2730
|
o({
|
|
2731
2731
|
entity: t,
|
|
@@ -2755,7 +2755,9 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2755
2755
|
return "Add User, Groups or Roles test";
|
|
2756
2756
|
}
|
|
2757
2757
|
};
|
|
2758
|
-
return ae(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", D.length), D.length === 0 && !u), [D.length, u]),
|
|
2758
|
+
return ae(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", D.length), D.length === 0 && !u), [D.length, u]), Z(() => {
|
|
2759
|
+
typeof o == "function" && o({ pendingInvites: D }, i);
|
|
2760
|
+
}, [D]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2759
2761
|
/* @__PURE__ */ n("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2760
2762
|
/* @__PURE__ */ e(ye.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: L() }),
|
|
2761
2763
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
|
|
@@ -2784,8 +2786,8 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2784
2786
|
}
|
|
2785
2787
|
),
|
|
2786
2788
|
/* @__PURE__ */ n("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
|
|
2787
|
-
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(
|
|
2788
|
-
/* @__PURE__ */ n(
|
|
2789
|
+
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(K, { value: h, onChange: N, children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2790
|
+
/* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2789
2791
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
2790
2792
|
/* @__PURE__ */ e(h.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2791
2793
|
/* @__PURE__ */ e("span", { className: "truncate", children: h.name })
|
|
@@ -2799,12 +2801,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2799
2801
|
leave: "transition ease-in duration-100",
|
|
2800
2802
|
leaveFrom: "opacity-100",
|
|
2801
2803
|
leaveTo: "opacity-0",
|
|
2802
|
-
children: /* @__PURE__ */ e(
|
|
2803
|
-
|
|
2804
|
+
children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Mt.map((C) => /* @__PURE__ */ e(
|
|
2805
|
+
K.Option,
|
|
2804
2806
|
{
|
|
2805
2807
|
value: C,
|
|
2806
2808
|
className: ({ active: M }) => `${M ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2807
|
-
children: ({ selected: M }) => /* @__PURE__ */ n(
|
|
2809
|
+
children: ({ selected: M }) => /* @__PURE__ */ n(te, { children: [
|
|
2808
2810
|
/* @__PURE__ */ n(
|
|
2809
2811
|
"span",
|
|
2810
2812
|
{
|
|
@@ -2836,7 +2838,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2836
2838
|
value: y
|
|
2837
2839
|
}
|
|
2838
2840
|
) }),
|
|
2839
|
-
/* @__PURE__ */ e(Se, { children: (d?.length > 0 ||
|
|
2841
|
+
/* @__PURE__ */ e(Se, { children: (d?.length > 0 || E) && /* @__PURE__ */ e(
|
|
2840
2842
|
ie.div,
|
|
2841
2843
|
{
|
|
2842
2844
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2844,20 +2846,20 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2844
2846
|
exit: { opacity: 0, y: -10 },
|
|
2845
2847
|
transition: { duration: 0.2 },
|
|
2846
2848
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2847
|
-
children:
|
|
2849
|
+
children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(te, { children: [
|
|
2848
2850
|
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((C) => {
|
|
2849
2851
|
const M = T(C);
|
|
2850
2852
|
return /* @__PURE__ */ n(
|
|
2851
2853
|
"div",
|
|
2852
2854
|
{
|
|
2853
|
-
onClick: () => M ? null :
|
|
2855
|
+
onClick: () => M ? null : f(C.id),
|
|
2854
2856
|
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${M ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2855
2857
|
children: [
|
|
2856
2858
|
/* @__PURE__ */ e(
|
|
2857
2859
|
"input",
|
|
2858
2860
|
{
|
|
2859
2861
|
type: "checkbox",
|
|
2860
|
-
checked:
|
|
2862
|
+
checked: z.has(C.id),
|
|
2861
2863
|
readOnly: !0,
|
|
2862
2864
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
|
|
2863
2865
|
disabled: !!M
|
|
@@ -2868,7 +2870,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2868
2870
|
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: C.name }),
|
|
2869
2871
|
h.name === De.USER && /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: C.id })
|
|
2870
2872
|
] }),
|
|
2871
|
-
M ? /* @__PURE__ */ n(
|
|
2873
|
+
M ? /* @__PURE__ */ n(te, { children: [
|
|
2872
2874
|
/* @__PURE__ */ e("span", { className: "text-sm px-3 py-0.5 border border-dashed rounded-xl bg-teal-100 text-teal-700", children: M }),
|
|
2873
2875
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
|
|
2874
2876
|
] }) : ""
|
|
@@ -2890,7 +2892,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2890
2892
|
/* @__PURE__ */ e(
|
|
2891
2893
|
le,
|
|
2892
2894
|
{
|
|
2893
|
-
onClick:
|
|
2895
|
+
onClick: g,
|
|
2894
2896
|
size: "small",
|
|
2895
2897
|
label: "Add"
|
|
2896
2898
|
}
|
|
@@ -2900,7 +2902,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2900
2902
|
}
|
|
2901
2903
|
) })
|
|
2902
2904
|
] }),
|
|
2903
|
-
/* @__PURE__ */ e(Se, { children:
|
|
2905
|
+
/* @__PURE__ */ e(Se, { children: b.length > 0 && /* @__PURE__ */ n(
|
|
2904
2906
|
ie.div,
|
|
2905
2907
|
{
|
|
2906
2908
|
initial: { opacity: 0, y: 20 },
|
|
@@ -2910,16 +2912,16 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2910
2912
|
/* @__PURE__ */ n("div", { className: "flex justify-between items-center", children: [
|
|
2911
2913
|
/* @__PURE__ */ n("div", { className: "font-semibold text-gray-800", children: [
|
|
2912
2914
|
"Pending Invites (",
|
|
2913
|
-
|
|
2915
|
+
b.length,
|
|
2914
2916
|
")"
|
|
2915
2917
|
] }),
|
|
2916
2918
|
l === ue.DRIVE && /* @__PURE__ */ e(
|
|
2917
|
-
|
|
2919
|
+
K,
|
|
2918
2920
|
{
|
|
2919
2921
|
value: P,
|
|
2920
2922
|
onChange: w,
|
|
2921
2923
|
children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2922
|
-
/* @__PURE__ */ n(
|
|
2924
|
+
/* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2923
2925
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
2924
2926
|
/* @__PURE__ */ e(P.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2925
2927
|
/* @__PURE__ */ n("span", { className: "truncate", children: [
|
|
@@ -2936,12 +2938,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2936
2938
|
leave: "transition ease-in duration-100",
|
|
2937
2939
|
leaveFrom: "opacity-100",
|
|
2938
2940
|
leaveTo: "opacity-0",
|
|
2939
|
-
children: /* @__PURE__ */ e(
|
|
2940
|
-
|
|
2941
|
+
children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Lt.map((C) => /* @__PURE__ */ e(
|
|
2942
|
+
K.Option,
|
|
2941
2943
|
{
|
|
2942
2944
|
value: C,
|
|
2943
2945
|
className: ({ active: M }) => `${M ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2944
|
-
children: ({ selected: M, active: _ }) => /* @__PURE__ */ n(
|
|
2946
|
+
children: ({ selected: M, active: _ }) => /* @__PURE__ */ n(te, { children: [
|
|
2945
2947
|
/* @__PURE__ */ n(
|
|
2946
2948
|
"span",
|
|
2947
2949
|
{
|
|
@@ -2975,7 +2977,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
2975
2977
|
}
|
|
2976
2978
|
)
|
|
2977
2979
|
] }),
|
|
2978
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Se, { children:
|
|
2980
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Se, { children: b.map((C, M) => /* @__PURE__ */ n(
|
|
2979
2981
|
ie.div,
|
|
2980
2982
|
{
|
|
2981
2983
|
layout: !0,
|
|
@@ -3058,15 +3060,15 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3058
3060
|
}), h = Kr(u), N = en(u), { getReferenceProps: y, getFloatingProps: r } = tn([
|
|
3059
3061
|
h,
|
|
3060
3062
|
N
|
|
3061
|
-
]), v = ot.find((
|
|
3063
|
+
]), v = ot.find((p) => p.name === t.permission || p.value === t.permission) || ot[0];
|
|
3062
3064
|
return (
|
|
3063
3065
|
// FIX: The <Listbox> component now wraps both the button and the portal.
|
|
3064
3066
|
// This provides the necessary context for both children.
|
|
3065
|
-
/* @__PURE__ */ n(
|
|
3066
|
-
s(
|
|
3067
|
+
/* @__PURE__ */ n(K, { value: v, onChange: (p) => {
|
|
3068
|
+
s(p), l(!1);
|
|
3067
3069
|
}, children: [
|
|
3068
3070
|
/* @__PURE__ */ n(
|
|
3069
|
-
|
|
3071
|
+
K.Button,
|
|
3070
3072
|
{
|
|
3071
3073
|
ref: m.setReference,
|
|
3072
3074
|
...y(),
|
|
@@ -3089,38 +3091,38 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3089
3091
|
leaveFrom: "transform opacity-100 scale-100",
|
|
3090
3092
|
leaveTo: "transform opacity-0 scale-95",
|
|
3091
3093
|
children: /* @__PURE__ */ e(
|
|
3092
|
-
|
|
3094
|
+
K.Options,
|
|
3093
3095
|
{
|
|
3094
3096
|
ref: m.setFloating,
|
|
3095
3097
|
style: o,
|
|
3096
3098
|
...r(),
|
|
3097
3099
|
static: !0,
|
|
3098
3100
|
className: "z-50 w-48 bg-white shadow-lg rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",
|
|
3099
|
-
children: ot.filter((
|
|
3100
|
-
|
|
3101
|
+
children: ot.filter((p) => a.includes(p.value)).map((p) => /* @__PURE__ */ e(
|
|
3102
|
+
K.Option,
|
|
3101
3103
|
{
|
|
3102
3104
|
className: ({
|
|
3103
|
-
active:
|
|
3105
|
+
active: z
|
|
3104
3106
|
}) => `relative select-none py-2 pl-10 pr-4 hover:cursor-pointer
|
|
3105
|
-
${
|
|
3106
|
-
${
|
|
3107
|
-
${
|
|
3108
|
-
value:
|
|
3109
|
-
children: ({ selected:
|
|
3107
|
+
${z ? "bg-blue-100 text-blue-900" : "text-gray-900"}
|
|
3108
|
+
${p.isDestructive && z ? "bg-red-100 text-red-900" : ""}
|
|
3109
|
+
${p.isDestructive && !z ? "text-red-600" : ""}`,
|
|
3110
|
+
value: p,
|
|
3111
|
+
children: ({ selected: z }) => /* @__PURE__ */ n(te, { children: [
|
|
3110
3112
|
/* @__PURE__ */ n(
|
|
3111
3113
|
"span",
|
|
3112
3114
|
{
|
|
3113
|
-
className: `flex items-center gap-2 truncate ${
|
|
3115
|
+
className: `flex items-center gap-2 truncate ${z ? "font-medium" : "font-normal"}`,
|
|
3114
3116
|
children: [
|
|
3115
|
-
/* @__PURE__ */ e(
|
|
3116
|
-
|
|
3117
|
+
/* @__PURE__ */ e(p.icon, { className: "h-5 w-5", "aria-hidden": "true" }),
|
|
3118
|
+
p.name
|
|
3117
3119
|
]
|
|
3118
3120
|
}
|
|
3119
3121
|
),
|
|
3120
|
-
|
|
3122
|
+
z && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(ut, { className: "h-5 w-5", "aria-hidden": "true" }) })
|
|
3121
3123
|
] })
|
|
3122
3124
|
},
|
|
3123
|
-
|
|
3125
|
+
p.name
|
|
3124
3126
|
))
|
|
3125
3127
|
}
|
|
3126
3128
|
)
|
|
@@ -3139,30 +3141,30 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3139
3141
|
}) => {
|
|
3140
3142
|
const [o, u] = B(l), [h, N] = B(0), [y, r] = B(""), v = zt(y, 300), d = {
|
|
3141
3143
|
users: o.users.filter(
|
|
3142
|
-
(
|
|
3144
|
+
(I) => I.name.toLowerCase().includes(v.toLowerCase())
|
|
3143
3145
|
),
|
|
3144
3146
|
groups: o.groups.filter(
|
|
3145
|
-
(
|
|
3147
|
+
(I) => I.name.toLowerCase().includes(v.toLowerCase())
|
|
3146
3148
|
),
|
|
3147
3149
|
roles: o.roles.filter(
|
|
3148
|
-
(
|
|
3150
|
+
(I) => I.name.toLowerCase().includes(v.toLowerCase())
|
|
3149
3151
|
)
|
|
3150
|
-
},
|
|
3152
|
+
}, p = async (I, P, j, U) => {
|
|
3151
3153
|
const Y = P.value;
|
|
3152
3154
|
u((q) => ({
|
|
3153
3155
|
...q,
|
|
3154
3156
|
[j]: q[j].map(
|
|
3155
|
-
($) => $.id ===
|
|
3157
|
+
($) => $.id === I.id ? { ...$, permission: Y } : $
|
|
3156
3158
|
)
|
|
3157
3159
|
}));
|
|
3158
|
-
},
|
|
3159
|
-
const
|
|
3160
|
+
}, z = () => {
|
|
3161
|
+
const I = {
|
|
3160
3162
|
users: o.users.filter((P) => P.permission !== "remove"),
|
|
3161
3163
|
groups: o.groups.filter((P) => P.permission !== "remove"),
|
|
3162
3164
|
roles: o.roles.filter((P) => P.permission !== "remove")
|
|
3163
3165
|
};
|
|
3164
|
-
a(
|
|
3165
|
-
},
|
|
3166
|
+
a(I);
|
|
3167
|
+
}, F = ["users", "groups", "roles"], E = ["Users", "Groups", "Roles"];
|
|
3166
3168
|
return (
|
|
3167
3169
|
// The main structure remains the same...
|
|
3168
3170
|
/* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-gray-50", children: [
|
|
@@ -3191,7 +3193,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3191
3193
|
/* @__PURE__ */ n("div", { className: "flex flex-col flex-grow", children: [
|
|
3192
3194
|
/* @__PURE__ */ n(se.Group, { selectedIndex: h, onChange: N, children: [
|
|
3193
3195
|
/* @__PURE__ */ n("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3194
|
-
/* @__PURE__ */ e(se.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children:
|
|
3196
|
+
/* @__PURE__ */ e(se.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: E.map((I) => /* @__PURE__ */ e(
|
|
3195
3197
|
se,
|
|
3196
3198
|
{
|
|
3197
3199
|
className: ({
|
|
@@ -3199,16 +3201,16 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3199
3201
|
}) => `w-full py-2 text-sm font-medium leading-5 rounded-md
|
|
3200
3202
|
focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
|
|
3201
3203
|
${P ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
|
|
3202
|
-
children:
|
|
3204
|
+
children: I
|
|
3203
3205
|
},
|
|
3204
|
-
|
|
3206
|
+
I
|
|
3205
3207
|
)) }),
|
|
3206
3208
|
/* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
|
|
3207
3209
|
ge,
|
|
3208
3210
|
{
|
|
3209
3211
|
onDebouncedChange: r,
|
|
3210
3212
|
value: y,
|
|
3211
|
-
placeholder: `Search in ${
|
|
3213
|
+
placeholder: `Search in ${E[h]}...`
|
|
3212
3214
|
}
|
|
3213
3215
|
) })
|
|
3214
3216
|
] }),
|
|
@@ -3219,11 +3221,11 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3219
3221
|
animate: { y: 0, opacity: 1 },
|
|
3220
3222
|
exit: { y: -10, opacity: 0 },
|
|
3221
3223
|
transition: { duration: 0.2 },
|
|
3222
|
-
children: /* @__PURE__ */ e(se.Panels, { as: Q, children:
|
|
3224
|
+
children: /* @__PURE__ */ e(se.Panels, { as: Q, children: F.map((I) => /* @__PURE__ */ e(
|
|
3223
3225
|
se.Panel,
|
|
3224
3226
|
{
|
|
3225
3227
|
className: "space-y-3 focus:outline-none",
|
|
3226
|
-
children: /* @__PURE__ */ e(Se, { children: d[
|
|
3228
|
+
children: /* @__PURE__ */ e(Se, { children: d[I].length > 0 ? d[I].map((P) => /* @__PURE__ */ n(
|
|
3227
3229
|
ie.div,
|
|
3228
3230
|
{
|
|
3229
3231
|
layout: !0,
|
|
@@ -3247,12 +3249,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3247
3249
|
),
|
|
3248
3250
|
/* @__PURE__ */ n("div", { className: "overflow-hidden", children: [
|
|
3249
3251
|
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: P.name }),
|
|
3250
|
-
|
|
3252
|
+
I !== "users" && /* @__PURE__ */ e(
|
|
3251
3253
|
"button",
|
|
3252
3254
|
{
|
|
3253
3255
|
onClick: () => i({
|
|
3254
3256
|
id: P.id,
|
|
3255
|
-
type:
|
|
3257
|
+
type: I,
|
|
3256
3258
|
name: P.name
|
|
3257
3259
|
}),
|
|
3258
3260
|
className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
|
|
@@ -3266,10 +3268,10 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3266
3268
|
{
|
|
3267
3269
|
item: P,
|
|
3268
3270
|
allowedPermissions: m,
|
|
3269
|
-
onPermissionChange: (j) =>
|
|
3271
|
+
onPermissionChange: (j) => p(
|
|
3270
3272
|
P,
|
|
3271
3273
|
j,
|
|
3272
|
-
|
|
3274
|
+
I
|
|
3273
3275
|
)
|
|
3274
3276
|
}
|
|
3275
3277
|
)
|
|
@@ -3288,16 +3290,16 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3288
3290
|
/* @__PURE__ */ e(Kt, { className: "h-12 w-12 text-gray-400" }),
|
|
3289
3291
|
/* @__PURE__ */ n("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
|
|
3290
3292
|
"No ",
|
|
3291
|
-
|
|
3293
|
+
E[h],
|
|
3292
3294
|
" Found"
|
|
3293
3295
|
] }),
|
|
3294
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: y ? `No results for "${y}"` : `There are no ${
|
|
3296
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: y ? `No results for "${y}"` : `There are no ${E[h].toLowerCase()} with access.` })
|
|
3295
3297
|
]
|
|
3296
3298
|
}
|
|
3297
3299
|
)
|
|
3298
3300
|
) })
|
|
3299
3301
|
},
|
|
3300
|
-
|
|
3302
|
+
I
|
|
3301
3303
|
)) })
|
|
3302
3304
|
},
|
|
3303
3305
|
h
|
|
@@ -3306,7 +3308,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3306
3308
|
/* @__PURE__ */ e("div", { className: "p-4 bg-white border-t border-gray-300 flex justify-end", children: /* @__PURE__ */ e(
|
|
3307
3309
|
"button",
|
|
3308
3310
|
{
|
|
3309
|
-
onClick:
|
|
3311
|
+
onClick: z,
|
|
3310
3312
|
className: "px-4 py-2 bg-blue-600 text-white rounded-md shadow hover:bg-blue-700",
|
|
3311
3313
|
children: "Update"
|
|
3312
3314
|
}
|
|
@@ -3343,7 +3345,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3343
3345
|
exit: { opacity: 0, x: -20 }
|
|
3344
3346
|
}, v = () => l ? (
|
|
3345
3347
|
// Show 5 skeleton items while loading
|
|
3346
|
-
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d,
|
|
3348
|
+
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d, p) => /* @__PURE__ */ e(is, {}, p)) })
|
|
3347
3349
|
) : N.length === 0 ? /* @__PURE__ */ n(
|
|
3348
3350
|
ie.div,
|
|
3349
3351
|
{
|
|
@@ -3448,26 +3450,26 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3448
3450
|
allowedPermissions: u = [],
|
|
3449
3451
|
...h
|
|
3450
3452
|
}) => {
|
|
3451
|
-
const [N, y] = B(be.INVITE), [r, v] = B(t), [d,
|
|
3452
|
-
y(be.INVITE),
|
|
3453
|
+
const [N, y] = B(be.INVITE), [r, v] = B(t), [d, p] = B(null), [z, F] = B(!1), [E, I] = B([]), [P, j] = B(be.MANAGE), U = () => {
|
|
3454
|
+
y(be.INVITE), p(null), m();
|
|
3453
3455
|
}, Y = () => {
|
|
3454
3456
|
y(be.MANAGE);
|
|
3455
|
-
}, q = async ({ id:
|
|
3457
|
+
}, q = async ({ id: b, name: S, type: O }) => {
|
|
3456
3458
|
if (O === "groups") {
|
|
3457
3459
|
try {
|
|
3458
|
-
const
|
|
3459
|
-
} catch (
|
|
3460
|
-
console.log("Error searching entities:",
|
|
3460
|
+
const R = await Ze(`${Je.getMembersForGroup(S)}`);
|
|
3461
|
+
} catch (R) {
|
|
3462
|
+
console.log("Error searching entities:", R);
|
|
3461
3463
|
}
|
|
3462
|
-
|
|
3464
|
+
I(resp);
|
|
3463
3465
|
}
|
|
3464
|
-
|
|
3465
|
-
}, $ = (
|
|
3466
|
-
console.log("changedExistingShares",
|
|
3467
|
-
const
|
|
3468
|
-
console.log("Existing data:",
|
|
3469
|
-
const
|
|
3470
|
-
console.log("hasPermissionChanged:",
|
|
3466
|
+
p({ id: b, type: O, name: S }), j(N), y(be.MEMBERS);
|
|
3467
|
+
}, $ = (b) => {
|
|
3468
|
+
console.log("changedExistingShares", b), v(b);
|
|
3469
|
+
const S = it.mapValues(t, (D) => D.map((f) => ({ id: f.id, permission: f.permission })).sort((f, g) => f.id - g.id)), O = it.mapValues(b, (D) => D.map((f) => ({ id: f.id, permission: f.permission })).sort((f, g) => f.id - g.id));
|
|
3470
|
+
console.log("Existing data:", S), console.log("Changed data:", O);
|
|
3471
|
+
const R = !it.isEqual(S, O);
|
|
3472
|
+
console.log("hasPermissionChanged:", R), F(R), y(N === be.MEMBERS ? P : be.INVITE);
|
|
3471
3473
|
};
|
|
3472
3474
|
return /* @__PURE__ */ e(he, { appear: !0, show: a, as: Q, children: /* @__PURE__ */ n(ye, { as: "div", className: "relative z-50", onClose: U, children: [
|
|
3473
3475
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
@@ -3514,7 +3516,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3514
3516
|
onClose: U,
|
|
3515
3517
|
calledBy: l,
|
|
3516
3518
|
existingShares: r,
|
|
3517
|
-
members:
|
|
3519
|
+
members: E
|
|
3518
3520
|
}
|
|
3519
3521
|
)
|
|
3520
3522
|
},
|
|
@@ -3538,10 +3540,10 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
|
|
|
3538
3540
|
existingShares: r,
|
|
3539
3541
|
calledBy: l,
|
|
3540
3542
|
showExistingShares: o,
|
|
3541
|
-
onFinalSubmit: (
|
|
3542
|
-
s(
|
|
3543
|
+
onFinalSubmit: (b) => {
|
|
3544
|
+
s(b, r);
|
|
3543
3545
|
},
|
|
3544
|
-
isChanged:
|
|
3546
|
+
isChanged: z
|
|
3545
3547
|
}
|
|
3546
3548
|
)
|
|
3547
3549
|
},
|
|
@@ -3574,60 +3576,60 @@ function at({
|
|
|
3574
3576
|
serverLoading: r = !1,
|
|
3575
3577
|
minSearchChars: v = 2,
|
|
3576
3578
|
// NEW: mappers (id/label keys)
|
|
3577
|
-
getOptionId: d = (
|
|
3578
|
-
getOptionLabel:
|
|
3579
|
+
getOptionId: d = (z) => String(z.id),
|
|
3580
|
+
getOptionLabel: p = (z) => z.name
|
|
3579
3581
|
}) {
|
|
3580
|
-
const
|
|
3581
|
-
const
|
|
3582
|
-
for (const
|
|
3583
|
-
return
|
|
3584
|
-
}, [a, d]), U = ae(() => Array.isArray(s) ? s.map((
|
|
3585
|
-
if (!
|
|
3586
|
-
const
|
|
3587
|
-
return a.filter((
|
|
3588
|
-
}, [a,
|
|
3589
|
-
|
|
3590
|
-
N === "server" &&
|
|
3591
|
-
}, [
|
|
3582
|
+
const z = He(), F = He(), [E, I] = B(""), P = fe(""), j = ae(() => {
|
|
3583
|
+
const b = /* @__PURE__ */ new Map();
|
|
3584
|
+
for (const S of a) b.set(d(S), S);
|
|
3585
|
+
return b;
|
|
3586
|
+
}, [a, d]), U = ae(() => Array.isArray(s) ? s.map((b) => b && typeof b == "object" ? j.get(d(b)) || null : j.get(String(b))).filter(Boolean) : [], [s, j, d]), Y = ae(() => {
|
|
3587
|
+
if (!E) return a;
|
|
3588
|
+
const b = E.toLowerCase();
|
|
3589
|
+
return a.filter((S) => p(S).toLowerCase().includes(b));
|
|
3590
|
+
}, [a, E, p]);
|
|
3591
|
+
Z(() => {
|
|
3592
|
+
N === "server" && E.length >= v && E !== P.current && (P.current = E, y && y(E));
|
|
3593
|
+
}, [E, N, v, y]);
|
|
3592
3594
|
const q = N === "client" ? Y : a, $ = () => {
|
|
3593
3595
|
if (!U.length)
|
|
3594
3596
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
|
|
3595
|
-
const
|
|
3597
|
+
const b = U.slice(0, u), S = U.length - u;
|
|
3596
3598
|
return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2", children: [
|
|
3597
|
-
|
|
3599
|
+
b.map((O) => /* @__PURE__ */ e(
|
|
3598
3600
|
"span",
|
|
3599
3601
|
{
|
|
3600
3602
|
className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
|
|
3601
|
-
children:
|
|
3603
|
+
children: p(O)
|
|
3602
3604
|
},
|
|
3603
3605
|
d(O)
|
|
3604
3606
|
)),
|
|
3605
|
-
|
|
3607
|
+
S > 0 && /* @__PURE__ */ n("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
|
|
3606
3608
|
"+",
|
|
3607
|
-
|
|
3609
|
+
S,
|
|
3608
3610
|
" more"
|
|
3609
3611
|
] })
|
|
3610
3612
|
] });
|
|
3611
3613
|
};
|
|
3612
|
-
return /* @__PURE__ */ e(
|
|
3613
|
-
const
|
|
3614
|
-
h !== -1 &&
|
|
3615
|
-
}, multiple: !0, by: "id", children: ({ open:
|
|
3614
|
+
return /* @__PURE__ */ e(K, { value: U, onChange: (b) => {
|
|
3615
|
+
const S = Array.from(new Set(b.map((O) => d(O))));
|
|
3616
|
+
h !== -1 && S.length > h || i(S);
|
|
3617
|
+
}, multiple: !0, by: "id", children: ({ open: b }) => /* @__PURE__ */ n("div", { children: [
|
|
3616
3618
|
/* @__PURE__ */ e(
|
|
3617
|
-
|
|
3619
|
+
K.Label,
|
|
3618
3620
|
{
|
|
3619
|
-
id:
|
|
3621
|
+
id: z,
|
|
3620
3622
|
className: "block text-sm font-medium leading-6 text-gray-900",
|
|
3621
3623
|
children: t
|
|
3622
3624
|
}
|
|
3623
3625
|
),
|
|
3624
3626
|
/* @__PURE__ */ n("div", { className: "relative mt-2", children: [
|
|
3625
3627
|
/* @__PURE__ */ n(
|
|
3626
|
-
|
|
3628
|
+
K.Button,
|
|
3627
3629
|
{
|
|
3628
|
-
"aria-labelledby":
|
|
3630
|
+
"aria-labelledby": z,
|
|
3629
3631
|
"aria-invalid": !!o,
|
|
3630
|
-
"aria-describedby": o ?
|
|
3632
|
+
"aria-describedby": o ? F : void 0,
|
|
3631
3633
|
onBlur: l,
|
|
3632
3634
|
className: Ge(
|
|
3633
3635
|
"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",
|
|
@@ -3643,43 +3645,43 @@ function at({
|
|
|
3643
3645
|
he,
|
|
3644
3646
|
{
|
|
3645
3647
|
as: Q,
|
|
3646
|
-
show:
|
|
3648
|
+
show: b,
|
|
3647
3649
|
leave: "transition ease-in duration-100",
|
|
3648
3650
|
leaveFrom: "opacity-100",
|
|
3649
3651
|
leaveTo: "opacity-0",
|
|
3650
|
-
children: /* @__PURE__ */ n(
|
|
3652
|
+
children: /* @__PURE__ */ n(K.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
|
|
3651
3653
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3652
3654
|
ge,
|
|
3653
3655
|
{
|
|
3654
|
-
value:
|
|
3655
|
-
onDebouncedChange:
|
|
3656
|
+
value: E,
|
|
3657
|
+
onDebouncedChange: I,
|
|
3656
3658
|
placeholder: N === "server" ? `Search (min ${v})…` : "Search options…"
|
|
3657
3659
|
}
|
|
3658
3660
|
) }),
|
|
3659
3661
|
N === "server" && r && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3660
|
-
q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: N === "server" ?
|
|
3661
|
-
const O = d(
|
|
3662
|
+
q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: N === "server" ? E.length < v ? `Type at least ${v} characters to search.` : "No results." : "No options found." }) : q.map((S) => {
|
|
3663
|
+
const O = d(S), R = p(S), D = U.some((g) => d(g) === O), f = h !== -1 && U.length >= h && !D;
|
|
3662
3664
|
return /* @__PURE__ */ e(
|
|
3663
|
-
|
|
3665
|
+
K.Option,
|
|
3664
3666
|
{
|
|
3665
|
-
value:
|
|
3666
|
-
disabled:
|
|
3667
|
-
className: ({ active:
|
|
3668
|
-
|
|
3667
|
+
value: S,
|
|
3668
|
+
disabled: f,
|
|
3669
|
+
className: ({ active: g }) => Ge(
|
|
3670
|
+
f ? " text-gray-400 bg-white cursor-not-allowed" : g ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3669
3671
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3670
3672
|
),
|
|
3671
|
-
children: ({ selected:
|
|
3673
|
+
children: ({ selected: g, active: w }) => /* @__PURE__ */ n(te, { children: [
|
|
3672
3674
|
/* @__PURE__ */ e(
|
|
3673
3675
|
"span",
|
|
3674
3676
|
{
|
|
3675
3677
|
className: Ge(
|
|
3676
|
-
|
|
3678
|
+
g ? "font-semibold" : "font-normal",
|
|
3677
3679
|
"block truncate"
|
|
3678
3680
|
),
|
|
3679
|
-
children:
|
|
3681
|
+
children: R
|
|
3680
3682
|
}
|
|
3681
3683
|
),
|
|
3682
|
-
|
|
3684
|
+
g && /* @__PURE__ */ e(
|
|
3683
3685
|
"span",
|
|
3684
3686
|
{
|
|
3685
3687
|
className: Ge(
|
|
@@ -3697,7 +3699,7 @@ function at({
|
|
|
3697
3699
|
] })
|
|
3698
3700
|
}
|
|
3699
3701
|
),
|
|
3700
|
-
o && /* @__PURE__ */ e("p", { id:
|
|
3702
|
+
o && /* @__PURE__ */ e("p", { id: F, className: "mt-1 text-sm text-red-600", children: o })
|
|
3701
3703
|
] })
|
|
3702
3704
|
] }) });
|
|
3703
3705
|
}
|
|
@@ -3855,9 +3857,9 @@ function ms({
|
|
|
3855
3857
|
dropId: y,
|
|
3856
3858
|
indent: r = 24
|
|
3857
3859
|
}) {
|
|
3858
|
-
const { setNodeRef: v, isOver: d } = dr({ id: y }), { attributes:
|
|
3859
|
-
const
|
|
3860
|
-
U(!1),
|
|
3860
|
+
const { setNodeRef: v, isOver: d } = dr({ id: y }), { attributes: p, listeners: z, setNodeRef: F, transform: E, isDragging: I } = mr({ id: N }), P = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [j, U] = B(!1), [Y, q] = B(t.name), $ = () => {
|
|
3861
|
+
const b = Y.trim();
|
|
3862
|
+
U(!1), b && b !== t.name ? o?.(t, b) : q(t.name);
|
|
3861
3863
|
}, x = ae(() => /* @__PURE__ */ e(
|
|
3862
3864
|
Gn,
|
|
3863
3865
|
{
|
|
@@ -3866,8 +3868,8 @@ function ms({
|
|
|
3866
3868
|
{ action: "rename", label: "Rename" },
|
|
3867
3869
|
{ action: "delete", label: "Delete" }
|
|
3868
3870
|
],
|
|
3869
|
-
onSelect: (
|
|
3870
|
-
|
|
3871
|
+
onSelect: (S) => {
|
|
3872
|
+
S.action === "create" ? m?.(t) : S.action === "rename" ? U(!0) : S.action === "delete" && u?.(t);
|
|
3871
3873
|
}
|
|
3872
3874
|
}
|
|
3873
3875
|
), [t, m, u]);
|
|
@@ -3875,28 +3877,28 @@ function ms({
|
|
|
3875
3877
|
"div",
|
|
3876
3878
|
{
|
|
3877
3879
|
ref: v,
|
|
3878
|
-
className: `tv-row ${d ? "tv-drop-over" : ""} ${
|
|
3880
|
+
className: `tv-row ${d ? "tv-drop-over" : ""} ${I ? "dragging" : ""}`,
|
|
3879
3881
|
style: { ...P, paddingLeft: 8 + a * r },
|
|
3880
|
-
onClick: (
|
|
3881
|
-
|
|
3882
|
+
onClick: (b) => {
|
|
3883
|
+
b.target.closest(".tv-toggle") || b.target.tagName === "INPUT" || l?.(t);
|
|
3882
3884
|
},
|
|
3883
3885
|
children: [
|
|
3884
3886
|
/* @__PURE__ */ e("button", { className: "tv-toggle", onClick: i, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(Nt, { size: 16 }) : /* @__PURE__ */ e(xe, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
|
|
3885
3887
|
/* @__PURE__ */ e(Be, { size: 16, className: "tv-folder-ic" }),
|
|
3886
|
-
/* @__PURE__ */ e("div", { className: "tv-name", ref:
|
|
3888
|
+
/* @__PURE__ */ e("div", { className: "tv-name", ref: F, children: j ? /* @__PURE__ */ e(
|
|
3887
3889
|
"input",
|
|
3888
3890
|
{
|
|
3889
3891
|
className: "tv-input",
|
|
3890
3892
|
value: Y,
|
|
3891
|
-
onChange: (
|
|
3893
|
+
onChange: (b) => q(b.target.value),
|
|
3892
3894
|
onBlur: $,
|
|
3893
|
-
onKeyDown: (
|
|
3894
|
-
|
|
3895
|
+
onKeyDown: (b) => {
|
|
3896
|
+
b.key === "Enter" && $(), b.key === "Escape" && (U(!1), q(t.name));
|
|
3895
3897
|
},
|
|
3896
3898
|
autoFocus: !0
|
|
3897
3899
|
}
|
|
3898
3900
|
) : /* @__PURE__ */ e("span", { onDoubleClick: () => U(!0), children: t.name }) }),
|
|
3899
|
-
/* @__PURE__ */ e(ds, { listeners:
|
|
3901
|
+
/* @__PURE__ */ e(ds, { listeners: z, attributes: p }),
|
|
3900
3902
|
/* @__PURE__ */ e("div", { className: "tv-actions", children: h ? h(t, {
|
|
3901
3903
|
onCreateChild: () => m?.(t),
|
|
3902
3904
|
onRename: () => U(!0),
|
|
@@ -3995,40 +3997,40 @@ function Hl({
|
|
|
3995
3997
|
renderActions: v,
|
|
3996
3998
|
disableMoveToRoot: d = !1,
|
|
3997
3999
|
// ← allow root moves by default now
|
|
3998
|
-
indentUnit:
|
|
4000
|
+
indentUnit: p = 24
|
|
3999
4001
|
}) {
|
|
4000
|
-
const { roots:
|
|
4001
|
-
t.map((
|
|
4002
|
+
const { roots: z } = ae(() => gs(t) ? fs(t, { rootId: a, getId: i, getName: m }) : bs(
|
|
4003
|
+
t.map((f) => ({ ...f })),
|
|
4002
4004
|
{ rootId: a, getId: i, getParent: l, getName: m }
|
|
4003
|
-
), [t, a, i, l, m]), [
|
|
4004
|
-
const
|
|
4005
|
+
), [t, a, i, l, m]), [F, E] = B({}), I = ee((f) => {
|
|
4006
|
+
const g = {};
|
|
4005
4007
|
return (function w(k) {
|
|
4006
4008
|
k.forEach((T) => {
|
|
4007
|
-
|
|
4009
|
+
g[T.id] = !0, T.children?.length && w(T.children);
|
|
4008
4010
|
});
|
|
4009
|
-
})(
|
|
4011
|
+
})(f), g;
|
|
4010
4012
|
}, []);
|
|
4011
4013
|
re.useEffect(() => {
|
|
4012
|
-
|
|
4013
|
-
}, [
|
|
4014
|
-
const P =
|
|
4015
|
-
(
|
|
4014
|
+
E(I(z));
|
|
4015
|
+
}, [z, I]);
|
|
4016
|
+
const P = ee(
|
|
4017
|
+
(f) => E((g) => ({ ...g, [f]: !g[f] })),
|
|
4016
4018
|
[]
|
|
4017
|
-
), [j, U] = B(() => Me(
|
|
4018
|
-
re.useEffect(() => U(Me(
|
|
4019
|
+
), [j, U] = B(() => Me(z));
|
|
4020
|
+
re.useEffect(() => U(Me(z)), [z]);
|
|
4019
4021
|
const Y = ur(
|
|
4020
4022
|
hr(fr, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
4021
|
-
), q = fe(null), [$, x] = B(null),
|
|
4022
|
-
}, O = ({ delta:
|
|
4023
|
-
|
|
4024
|
-
},
|
|
4025
|
-
({ active:
|
|
4026
|
-
const w =
|
|
4027
|
-
if (
|
|
4028
|
-
const k = String(
|
|
4023
|
+
), q = fe(null), [$, x] = B(null), b = fe(0), S = () => {
|
|
4024
|
+
}, O = ({ delta: f }) => {
|
|
4025
|
+
b.current = f?.x ?? 0;
|
|
4026
|
+
}, R = ee(
|
|
4027
|
+
({ active: f, over: g }) => {
|
|
4028
|
+
const w = b.current;
|
|
4029
|
+
if (b.current = 0, x(null), !f || !g) return;
|
|
4030
|
+
const k = String(f.id).replace(/^drag-/, ""), T = String(g.id).replace(/^drop-/, "");
|
|
4029
4031
|
if (!k || !T || k === T) return;
|
|
4030
4032
|
let L = T;
|
|
4031
|
-
const C = Math.max(0, Math.floor(-w /
|
|
4033
|
+
const C = Math.max(0, Math.floor(-w / p));
|
|
4032
4034
|
if (C > 0) {
|
|
4033
4035
|
let W = T;
|
|
4034
4036
|
for (let pe = 0; pe < C; pe++) {
|
|
@@ -4042,23 +4044,23 @@ function Hl({
|
|
|
4042
4044
|
}
|
|
4043
4045
|
}
|
|
4044
4046
|
if (d && L === a) {
|
|
4045
|
-
U(Me(
|
|
4047
|
+
U(Me(z));
|
|
4046
4048
|
return;
|
|
4047
4049
|
}
|
|
4048
|
-
const M = Me(j), { newRoots: _, removed:
|
|
4049
|
-
if (!
|
|
4050
|
-
const G = xs(_, L,
|
|
4050
|
+
const M = Me(j), { newRoots: _, removed: A } = ys(M, k);
|
|
4051
|
+
if (!A) return;
|
|
4052
|
+
const G = xs(_, L, A);
|
|
4051
4053
|
U(G), r?.({ sourceId: k, destParentId: L, newTree: G });
|
|
4052
4054
|
},
|
|
4053
|
-
[j,
|
|
4054
|
-
), D =
|
|
4055
|
-
(
|
|
4055
|
+
[j, z, a, d, p, r]
|
|
4056
|
+
), D = ee(
|
|
4057
|
+
(f, g = 0) => f.map((w) => /* @__PURE__ */ n(re.Fragment, { children: [
|
|
4056
4058
|
/* @__PURE__ */ e(
|
|
4057
4059
|
ms,
|
|
4058
4060
|
{
|
|
4059
4061
|
node: w,
|
|
4060
|
-
depth:
|
|
4061
|
-
expanded: !!
|
|
4062
|
+
depth: g,
|
|
4063
|
+
expanded: !!F[w.id],
|
|
4062
4064
|
onToggle: () => P(w.id),
|
|
4063
4065
|
onSelect: o,
|
|
4064
4066
|
onCreateChild: h,
|
|
@@ -4067,25 +4069,25 @@ function Hl({
|
|
|
4067
4069
|
renderActions: v,
|
|
4068
4070
|
dragId: `drag-${w.id}`,
|
|
4069
4071
|
dropId: `drop-${w.id}`,
|
|
4070
|
-
indent:
|
|
4072
|
+
indent: p
|
|
4071
4073
|
}
|
|
4072
4074
|
),
|
|
4073
|
-
|
|
4075
|
+
F[w.id] && w.children?.length > 0 ? D(w.children, g + 1) : null
|
|
4074
4076
|
] }, w.id)),
|
|
4075
|
-
[
|
|
4077
|
+
[F, p, h, y, N, o, v, P]
|
|
4076
4078
|
);
|
|
4077
4079
|
return re.useMemo(() => {
|
|
4078
4080
|
if (!$) return null;
|
|
4079
|
-
const
|
|
4080
|
-
function
|
|
4081
|
+
const f = String($).replace(/^drag-/, "");
|
|
4082
|
+
function g(w) {
|
|
4081
4083
|
for (const k of w) {
|
|
4082
|
-
if (k.id ===
|
|
4083
|
-
const T = k.children?.length ?
|
|
4084
|
+
if (k.id === f) return k;
|
|
4085
|
+
const T = k.children?.length ? g(k.children) : null;
|
|
4084
4086
|
if (T) return T;
|
|
4085
4087
|
}
|
|
4086
4088
|
return null;
|
|
4087
4089
|
}
|
|
4088
|
-
return
|
|
4090
|
+
return g(j);
|
|
4089
4091
|
}, [$, j]), /* @__PURE__ */ n("div", { className: "tv", children: [
|
|
4090
4092
|
s !== !1 && /* @__PURE__ */ n("div", { className: "tv-header", children: [
|
|
4091
4093
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
@@ -4101,9 +4103,9 @@ function Hl({
|
|
|
4101
4103
|
{
|
|
4102
4104
|
collisionDetection: br,
|
|
4103
4105
|
sensors: Y,
|
|
4104
|
-
onDragStart:
|
|
4106
|
+
onDragStart: S,
|
|
4105
4107
|
onDragMove: O,
|
|
4106
|
-
onDragEnd:
|
|
4108
|
+
onDragEnd: R,
|
|
4107
4109
|
modifiers: [gr],
|
|
4108
4110
|
children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: D(j, 0) })
|
|
4109
4111
|
}
|
|
@@ -4136,7 +4138,7 @@ const Ql = ({
|
|
|
4136
4138
|
/* @__PURE__ */ e(se.Panels, { unmount: !a, className: ze("flex-1", m), children: t.map((v) => /* @__PURE__ */ e(se.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: v.content }) }, v.key)) })
|
|
4137
4139
|
] }) : (
|
|
4138
4140
|
// mostly this part is used : horizontal
|
|
4139
|
-
/* @__PURE__ */ n(
|
|
4141
|
+
/* @__PURE__ */ n(te, { children: [
|
|
4140
4142
|
/* @__PURE__ */ e(se.List, { className: ze("flex gap-6 border rounded-t-2xl px-1.5 border-gray-300 mb-3 ", l), children: t.map((v) => /* @__PURE__ */ e(se, { className: r, children: v.label }, v.key)) }),
|
|
4141
4143
|
/* @__PURE__ */ e(se.Panels, { unmount: !a, className: ze("mt-2", m), children: t.map((v) => /* @__PURE__ */ e(se.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: v.content }) }, v.key)) })
|
|
4142
4144
|
] })
|
|
@@ -4152,7 +4154,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4152
4154
|
const r = a && a[t.key] || {};
|
|
4153
4155
|
return console.log("Initial Section data for", t.key, r), r;
|
|
4154
4156
|
}), h = fe(a);
|
|
4155
|
-
|
|
4157
|
+
Z(() => {
|
|
4156
4158
|
if (h.current !== a) {
|
|
4157
4159
|
h.current = a;
|
|
4158
4160
|
const r = a && a[t.key] || {};
|
|
@@ -4160,29 +4162,29 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4160
4162
|
}
|
|
4161
4163
|
}, [a, t.key]), console.log("Section data", o);
|
|
4162
4164
|
const N = fe(o);
|
|
4163
|
-
|
|
4165
|
+
Z(() => {
|
|
4164
4166
|
N.current !== o && s && typeof s == "function" && (N.current = o, s(l.key, o));
|
|
4165
4167
|
}, [l.key, o, s]);
|
|
4166
4168
|
const y = (r) => {
|
|
4167
4169
|
if (!r.dependsOn) return !0;
|
|
4168
|
-
const { field: v, value: d, operator:
|
|
4169
|
-
switch (
|
|
4170
|
+
const { field: v, value: d, operator: p = "equals" } = r.dependsOn, z = o[v];
|
|
4171
|
+
switch (p) {
|
|
4170
4172
|
case "equals":
|
|
4171
|
-
return
|
|
4173
|
+
return z === d;
|
|
4172
4174
|
case "notEquals":
|
|
4173
|
-
return
|
|
4175
|
+
return z !== d;
|
|
4174
4176
|
case "contains":
|
|
4175
|
-
return Array.isArray(
|
|
4177
|
+
return Array.isArray(z) && z.includes(d);
|
|
4176
4178
|
case "notContains":
|
|
4177
|
-
return !Array.isArray(
|
|
4179
|
+
return !Array.isArray(z) || !z.includes(d);
|
|
4178
4180
|
case "greaterThan":
|
|
4179
|
-
return Number(
|
|
4181
|
+
return Number(z) > Number(d);
|
|
4180
4182
|
case "lessThan":
|
|
4181
|
-
return Number(
|
|
4183
|
+
return Number(z) < Number(d);
|
|
4182
4184
|
case "isEmpty":
|
|
4183
|
-
return !
|
|
4185
|
+
return !z || Array.isArray(z) && z.length === 0;
|
|
4184
4186
|
case "isNotEmpty":
|
|
4185
|
-
return
|
|
4187
|
+
return z && (!Array.isArray(z) || z.length > 0);
|
|
4186
4188
|
default:
|
|
4187
4189
|
return !0;
|
|
4188
4190
|
}
|
|
@@ -4208,8 +4210,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4208
4210
|
name: r.key,
|
|
4209
4211
|
checked: !!(o[r.key] || r.default),
|
|
4210
4212
|
onChange: (d) => {
|
|
4211
|
-
const
|
|
4212
|
-
u(
|
|
4213
|
+
const p = d.target ? d.target.checked : d, z = { ...o, [r.key]: p };
|
|
4214
|
+
u(z), s && s(l.key, z);
|
|
4213
4215
|
},
|
|
4214
4216
|
label: r.label,
|
|
4215
4217
|
disabled: r.disabled ? r.disabled : !1
|
|
@@ -4263,8 +4265,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4263
4265
|
placeholder: r.placeholder,
|
|
4264
4266
|
value: o[r.key] || "",
|
|
4265
4267
|
onChange: (d) => {
|
|
4266
|
-
const
|
|
4267
|
-
u(
|
|
4268
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4269
|
+
u(p), s && s(l.key, p);
|
|
4268
4270
|
},
|
|
4269
4271
|
required: r.required,
|
|
4270
4272
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4283,8 +4285,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4283
4285
|
placeholder: r.placeholder,
|
|
4284
4286
|
value: o[r.key] || "",
|
|
4285
4287
|
onChange: (d) => {
|
|
4286
|
-
const
|
|
4287
|
-
u(
|
|
4288
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4289
|
+
u(p), s && s(l.key, p);
|
|
4288
4290
|
},
|
|
4289
4291
|
rows: 3,
|
|
4290
4292
|
required: r.required,
|
|
@@ -4308,14 +4310,14 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4308
4310
|
max: r.max,
|
|
4309
4311
|
step: r.step,
|
|
4310
4312
|
onChange: (d) => {
|
|
4311
|
-
const
|
|
4312
|
-
u(
|
|
4313
|
+
const p = d.target.value, z = { ...o, [r.key]: p };
|
|
4314
|
+
u(z), s && s(l.key, z);
|
|
4313
4315
|
},
|
|
4314
4316
|
onBlur: (d) => {
|
|
4315
|
-
const
|
|
4316
|
-
if (
|
|
4317
|
-
const
|
|
4318
|
-
isNaN(
|
|
4317
|
+
const p = d.target.value;
|
|
4318
|
+
if (p !== "" && p !== null && p !== void 0) {
|
|
4319
|
+
const z = Number(p);
|
|
4320
|
+
isNaN(z) || (r.min !== void 0 && z < r.min ? (d.target.setCustomValidity(`${r.label} must be at least ${r.min}`), d.target.reportValidity()) : r.max !== void 0 && z > r.max ? (d.target.setCustomValidity(`${r.label} must not exceed ${r.max}`), d.target.reportValidity()) : d.target.setCustomValidity(""));
|
|
4319
4321
|
}
|
|
4320
4322
|
},
|
|
4321
4323
|
required: r.required,
|
|
@@ -4340,8 +4342,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4340
4342
|
name: r.key,
|
|
4341
4343
|
checked: !!(o[r.key] || r.default),
|
|
4342
4344
|
onChange: (d) => {
|
|
4343
|
-
const
|
|
4344
|
-
u(
|
|
4345
|
+
const p = d.target ? d.target.checked : d, z = { ...o, [r.key]: p };
|
|
4346
|
+
u(z), s && s(l.key, z);
|
|
4345
4347
|
},
|
|
4346
4348
|
label: r.placeholder || r.label,
|
|
4347
4349
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4358,8 +4360,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4358
4360
|
defaultValue: r.default,
|
|
4359
4361
|
value: o[r.key] || "",
|
|
4360
4362
|
onChange: (d) => {
|
|
4361
|
-
const
|
|
4362
|
-
u(
|
|
4363
|
+
const p = { ...o, [r.key]: d };
|
|
4364
|
+
u(p);
|
|
4363
4365
|
},
|
|
4364
4366
|
options: r.options || [],
|
|
4365
4367
|
placeholder: r.placeholder || `Select ${r.label}`,
|
|
@@ -4380,8 +4382,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4380
4382
|
placeholder: r.placeholder || "Enter email address",
|
|
4381
4383
|
value: o[r.key] || "",
|
|
4382
4384
|
onChange: (d) => {
|
|
4383
|
-
const
|
|
4384
|
-
u(
|
|
4385
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4386
|
+
u(p), s && s(l.key, p);
|
|
4385
4387
|
},
|
|
4386
4388
|
required: r.required,
|
|
4387
4389
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4400,8 +4402,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4400
4402
|
placeholder: r.placeholder || "Enter URL",
|
|
4401
4403
|
value: o[r.key] || "",
|
|
4402
4404
|
onChange: (d) => {
|
|
4403
|
-
const
|
|
4404
|
-
u(
|
|
4405
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4406
|
+
u(p), s && s(l.key, p);
|
|
4405
4407
|
},
|
|
4406
4408
|
required: r.required,
|
|
4407
4409
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4420,8 +4422,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4420
4422
|
placeholder: r.placeholder || "Enter password",
|
|
4421
4423
|
value: o[r.key] || "",
|
|
4422
4424
|
onChange: (d) => {
|
|
4423
|
-
const
|
|
4424
|
-
u(
|
|
4425
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4426
|
+
u(p), s && s(l.key, p);
|
|
4425
4427
|
},
|
|
4426
4428
|
required: r.required,
|
|
4427
4429
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4436,8 +4438,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4436
4438
|
{
|
|
4437
4439
|
selectedItems: o[r.key] || [],
|
|
4438
4440
|
onSelectionChange: (d) => {
|
|
4439
|
-
const
|
|
4440
|
-
u(
|
|
4441
|
+
const p = { ...o, [r.key]: d };
|
|
4442
|
+
u(p), s && s(l.key, p);
|
|
4441
4443
|
},
|
|
4442
4444
|
options: r.options || [],
|
|
4443
4445
|
placeholder: r.placeholder || `Select ${r.label}`,
|
|
@@ -4454,8 +4456,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4454
4456
|
checked: typeof o[r.key] == "boolean" ? o[r.key] : r.default,
|
|
4455
4457
|
onChange: (d) => {
|
|
4456
4458
|
console.log("Toggle changed:", r.key, d);
|
|
4457
|
-
const
|
|
4458
|
-
u(
|
|
4459
|
+
const p = { ...o, [r.key]: d };
|
|
4460
|
+
u(p), s && s(l.key, p);
|
|
4459
4461
|
},
|
|
4460
4462
|
disabled: r.disabled ? r.disabled : !1
|
|
4461
4463
|
}
|
|
@@ -4468,8 +4470,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4468
4470
|
label: r.label,
|
|
4469
4471
|
value: o[r.key] ? new Date(o[r.key]) : null,
|
|
4470
4472
|
onChange: (d) => {
|
|
4471
|
-
const
|
|
4472
|
-
u(
|
|
4473
|
+
const p = { ...o, [r.key]: d ? d.toISOString().split("T")[0] : "" };
|
|
4474
|
+
u(p), s && s(l.key, p);
|
|
4473
4475
|
},
|
|
4474
4476
|
placeholder: r.placeholder || "Select date",
|
|
4475
4477
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4483,8 +4485,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4483
4485
|
label: r.label,
|
|
4484
4486
|
value: o[r.key] || { from: null, to: null },
|
|
4485
4487
|
onChange: (d) => {
|
|
4486
|
-
const
|
|
4487
|
-
u(
|
|
4488
|
+
const p = { ...o, [r.key]: d };
|
|
4489
|
+
u(p), s && s(l.key, p);
|
|
4488
4490
|
},
|
|
4489
4491
|
placeholder: r.placeholder || "Select date range",
|
|
4490
4492
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4498,8 +4500,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4498
4500
|
{
|
|
4499
4501
|
selectedValue: typeof o[r.key] < "u" ? o[r.key] : r.default || "",
|
|
4500
4502
|
onValueChange: (d) => {
|
|
4501
|
-
const
|
|
4502
|
-
u(
|
|
4503
|
+
const p = { ...o, [r.key]: d };
|
|
4504
|
+
u(p), s && s(l.key, p);
|
|
4503
4505
|
},
|
|
4504
4506
|
options: r.options || [],
|
|
4505
4507
|
disabled: r.disabled ? r.disabled : !1,
|
|
@@ -4518,9 +4520,9 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4518
4520
|
name: r.key,
|
|
4519
4521
|
value: d.value,
|
|
4520
4522
|
checked: o[r.key] === d.value,
|
|
4521
|
-
onChange: (
|
|
4522
|
-
const
|
|
4523
|
-
u(
|
|
4523
|
+
onChange: (p) => {
|
|
4524
|
+
const z = { ...o, [r.key]: p.target.value };
|
|
4525
|
+
u(z), s && s(l.key, z);
|
|
4524
4526
|
},
|
|
4525
4527
|
disabled: r.disabled
|
|
4526
4528
|
}
|
|
@@ -4538,8 +4540,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4538
4540
|
{
|
|
4539
4541
|
value: o[r.key] || "",
|
|
4540
4542
|
onChange: (d) => {
|
|
4541
|
-
const
|
|
4542
|
-
u(
|
|
4543
|
+
const p = { ...o, [r.key]: d };
|
|
4544
|
+
u(p), s && s(l.key, p);
|
|
4543
4545
|
},
|
|
4544
4546
|
placeholder: r.placeholder || `Search ${r.label}`,
|
|
4545
4547
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4557,8 +4559,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4557
4559
|
placeholder: r.placeholder || "Select date and time",
|
|
4558
4560
|
value: o[r.key] || "",
|
|
4559
4561
|
onChange: (d) => {
|
|
4560
|
-
const
|
|
4561
|
-
u(
|
|
4562
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4563
|
+
u(p), s && s(l.key, p);
|
|
4562
4564
|
},
|
|
4563
4565
|
required: r.required,
|
|
4564
4566
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4576,8 +4578,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4576
4578
|
placeholder: r.placeholder || "Select time",
|
|
4577
4579
|
value: o[r.key] || "",
|
|
4578
4580
|
onChange: (d) => {
|
|
4579
|
-
const
|
|
4580
|
-
u(
|
|
4581
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4582
|
+
u(p), s && s(l.key, p);
|
|
4581
4583
|
},
|
|
4582
4584
|
required: r.required,
|
|
4583
4585
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4594,8 +4596,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4594
4596
|
defaultValue: r.default || "#000000",
|
|
4595
4597
|
value: o[r.key] || "#000000",
|
|
4596
4598
|
onChange: (d) => {
|
|
4597
|
-
const
|
|
4598
|
-
u(
|
|
4599
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4600
|
+
u(p), s && s(l.key, p);
|
|
4599
4601
|
},
|
|
4600
4602
|
className: `w-full h-10 ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
4601
4603
|
}
|
|
@@ -4611,8 +4613,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4611
4613
|
defaultValue: r.default || r.min || 0,
|
|
4612
4614
|
value: o[r.key] || r.min || 0,
|
|
4613
4615
|
onChange: (d) => {
|
|
4614
|
-
const
|
|
4615
|
-
u(
|
|
4616
|
+
const p = { ...o, [r.key]: d.target.value };
|
|
4617
|
+
u(p), s && s(l.key, p);
|
|
4616
4618
|
},
|
|
4617
4619
|
min: r.min || 0,
|
|
4618
4620
|
max: r.max || 100,
|
|
@@ -4637,8 +4639,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4637
4639
|
type: "file",
|
|
4638
4640
|
name: r.key,
|
|
4639
4641
|
onChange: (d) => {
|
|
4640
|
-
const
|
|
4641
|
-
u(
|
|
4642
|
+
const p = d.target.files[0], z = { ...o, [r.key]: p ? p.name : "" };
|
|
4643
|
+
u(z), s && s(l.key, z);
|
|
4642
4644
|
},
|
|
4643
4645
|
accept: r.accept,
|
|
4644
4646
|
className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
|
|
@@ -4654,8 +4656,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4654
4656
|
initialData: o[r.key] || r.initialData || [],
|
|
4655
4657
|
className: r.className || "",
|
|
4656
4658
|
onCollectionChange: (d) => {
|
|
4657
|
-
const
|
|
4658
|
-
u(
|
|
4659
|
+
const p = { ...o, [r.key]: d };
|
|
4660
|
+
u(p), s && s(l.key, p);
|
|
4659
4661
|
},
|
|
4660
4662
|
showSearch: r.showSearch !== !1,
|
|
4661
4663
|
allowAdd: r.allowAdd !== !1,
|
|
@@ -4686,85 +4688,85 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4686
4688
|
const [l, m] = B(t), [o, u] = B(null), [h, N] = B(null);
|
|
4687
4689
|
console.log(`[DataTableRenderer] ${l.key} - Received props:`, { item: t, initialData: a });
|
|
4688
4690
|
const [y, r] = B(() => {
|
|
4689
|
-
const x = a && a[l.key] || [],
|
|
4690
|
-
return console.log(`[DataTableRenderer] ${l.key} - Initial data:`,
|
|
4691
|
+
const x = a && a[l.key] || [], b = x.length > 0 ? x : [{ id: 0 }];
|
|
4692
|
+
return console.log(`[DataTableRenderer] ${l.key} - Initial data:`, b), b;
|
|
4691
4693
|
}), v = fe(a);
|
|
4692
|
-
|
|
4694
|
+
Z(() => {
|
|
4693
4695
|
if (console.log(`[DataTableRenderer] ${l.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${l.key} - Previous:`, v.current), console.log(`[DataTableRenderer] ${l.key} - Current:`, a), v.current !== a) {
|
|
4694
4696
|
v.current = a;
|
|
4695
|
-
const x = a && a[l.key] || [],
|
|
4696
|
-
console.log(`[DataTableRenderer] ${l.key} - Setting new data:`,
|
|
4697
|
+
const x = a && a[l.key] || [], b = x.length > 0 ? x : [{ id: 0 }];
|
|
4698
|
+
console.log(`[DataTableRenderer] ${l.key} - Setting new data:`, b), r(b);
|
|
4697
4699
|
}
|
|
4698
4700
|
}, [a, l.key]);
|
|
4699
|
-
const d = fe(y),
|
|
4700
|
-
|
|
4701
|
-
d.current !== y && s && typeof s == "function" && (d.current = y,
|
|
4701
|
+
const d = fe(y), p = fe(null);
|
|
4702
|
+
Z(() => {
|
|
4703
|
+
d.current !== y && s && typeof s == "function" && (d.current = y, p.current && clearTimeout(p.current), p.current = setTimeout(() => {
|
|
4702
4704
|
s(l.key, y);
|
|
4703
4705
|
}, 300));
|
|
4704
|
-
}, [l.key, y, s]),
|
|
4705
|
-
|
|
4706
|
+
}, [l.key, y, s]), Z(() => () => {
|
|
4707
|
+
p.current && clearTimeout(p.current);
|
|
4706
4708
|
}, []);
|
|
4707
|
-
const
|
|
4708
|
-
const
|
|
4709
|
-
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex:
|
|
4710
|
-
const
|
|
4711
|
-
return
|
|
4709
|
+
const z = (x) => {
|
|
4710
|
+
const b = (R, D) => {
|
|
4711
|
+
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: R, value: D, type: typeof D }), r((f) => {
|
|
4712
|
+
const g = [...f];
|
|
4713
|
+
return g[R][x.key] = D, g;
|
|
4712
4714
|
});
|
|
4713
|
-
},
|
|
4714
|
-
const D =
|
|
4715
|
+
}, S = (R) => i[l.key]?.[R]?.[x.key], O = (R) => {
|
|
4716
|
+
const D = S(R);
|
|
4715
4717
|
return D ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: D }) : null;
|
|
4716
4718
|
};
|
|
4717
4719
|
switch (x.fieldtype) {
|
|
4718
4720
|
case "text":
|
|
4719
|
-
return (
|
|
4721
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4720
4722
|
/* @__PURE__ */ e(
|
|
4721
4723
|
X,
|
|
4722
4724
|
{
|
|
4723
|
-
value:
|
|
4724
|
-
onChange: (
|
|
4725
|
+
value: R[x.key] || "",
|
|
4726
|
+
onChange: (f) => b(D, f.target.value),
|
|
4725
4727
|
placeholder: x.placeholder || `Enter ${x.label}`,
|
|
4726
4728
|
required: x.required,
|
|
4727
|
-
className: `w-full ${
|
|
4729
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4728
4730
|
}
|
|
4729
4731
|
),
|
|
4730
4732
|
O(D)
|
|
4731
4733
|
] });
|
|
4732
4734
|
case "textarea":
|
|
4733
|
-
return (
|
|
4735
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4734
4736
|
/* @__PURE__ */ e(
|
|
4735
4737
|
fa,
|
|
4736
4738
|
{
|
|
4737
|
-
value:
|
|
4738
|
-
onChange: (
|
|
4739
|
+
value: R[x.key] || "",
|
|
4740
|
+
onChange: (f) => b(D, f.target.value),
|
|
4739
4741
|
placeholder: x.placeholder || `Enter ${x.label}`,
|
|
4740
4742
|
required: x.required,
|
|
4741
|
-
className: `w-full ${
|
|
4743
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`,
|
|
4742
4744
|
rows: 3
|
|
4743
4745
|
}
|
|
4744
4746
|
),
|
|
4745
4747
|
O(D)
|
|
4746
4748
|
] });
|
|
4747
4749
|
case "number":
|
|
4748
|
-
return (
|
|
4750
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4749
4751
|
/* @__PURE__ */ e(
|
|
4750
4752
|
X,
|
|
4751
4753
|
{
|
|
4752
4754
|
type: "number",
|
|
4753
|
-
value:
|
|
4755
|
+
value: R[x.key] || "",
|
|
4754
4756
|
min: x.min,
|
|
4755
4757
|
max: x.max,
|
|
4756
4758
|
step: x.step,
|
|
4757
|
-
onChange: (
|
|
4758
|
-
onBlur: (
|
|
4759
|
-
const
|
|
4760
|
-
if (
|
|
4761
|
-
const w = Number(
|
|
4762
|
-
isNaN(w) || (x.min !== void 0 && w < x.min ? (
|
|
4759
|
+
onChange: (f) => b(D, f.target.value),
|
|
4760
|
+
onBlur: (f) => {
|
|
4761
|
+
const g = f.target.value;
|
|
4762
|
+
if (g !== "" && g !== null && g !== void 0) {
|
|
4763
|
+
const w = Number(g);
|
|
4764
|
+
isNaN(w) || (x.min !== void 0 && w < x.min ? (f.target.setCustomValidity(`${x.label} must be at least ${x.min}`), f.target.reportValidity()) : x.max !== void 0 && w > x.max ? (f.target.setCustomValidity(`${x.label} must not exceed ${x.max}`), f.target.reportValidity()) : f.target.setCustomValidity(""));
|
|
4763
4765
|
}
|
|
4764
4766
|
},
|
|
4765
4767
|
placeholder: x.placeholder || `Enter ${x.label}`,
|
|
4766
4768
|
required: x.required,
|
|
4767
|
-
className: `w-full ${
|
|
4769
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4768
4770
|
}
|
|
4769
4771
|
),
|
|
4770
4772
|
x.min !== void 0 && /* @__PURE__ */ n("div", { style: { color: "#6b7280", fontSize: "11px", marginTop: "2px" }, children: [
|
|
@@ -4778,71 +4780,71 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4778
4780
|
O(D)
|
|
4779
4781
|
] });
|
|
4780
4782
|
case "email":
|
|
4781
|
-
return (
|
|
4783
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4782
4784
|
/* @__PURE__ */ e(
|
|
4783
4785
|
X,
|
|
4784
4786
|
{
|
|
4785
4787
|
type: "email",
|
|
4786
|
-
value:
|
|
4787
|
-
onChange: (
|
|
4788
|
+
value: R[x.key] || "",
|
|
4789
|
+
onChange: (f) => b(D, f.target.value),
|
|
4788
4790
|
placeholder: x.placeholder || "Enter email address",
|
|
4789
4791
|
required: x.required,
|
|
4790
|
-
className: `w-full ${
|
|
4792
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4791
4793
|
}
|
|
4792
4794
|
),
|
|
4793
4795
|
O(D)
|
|
4794
4796
|
] });
|
|
4795
4797
|
case "url":
|
|
4796
|
-
return (
|
|
4798
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4797
4799
|
/* @__PURE__ */ e(
|
|
4798
4800
|
X,
|
|
4799
4801
|
{
|
|
4800
4802
|
type: "url",
|
|
4801
|
-
value:
|
|
4802
|
-
onChange: (
|
|
4803
|
+
value: R[x.key] || "",
|
|
4804
|
+
onChange: (f) => b(D, f.target.value),
|
|
4803
4805
|
placeholder: x.placeholder || "Enter URL",
|
|
4804
4806
|
required: x.required,
|
|
4805
|
-
className: `w-full ${
|
|
4807
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4806
4808
|
}
|
|
4807
4809
|
),
|
|
4808
4810
|
O(D)
|
|
4809
4811
|
] });
|
|
4810
4812
|
case "password":
|
|
4811
|
-
return (
|
|
4813
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4812
4814
|
/* @__PURE__ */ e(
|
|
4813
4815
|
X,
|
|
4814
4816
|
{
|
|
4815
4817
|
type: "password",
|
|
4816
|
-
value:
|
|
4817
|
-
onChange: (
|
|
4818
|
+
value: R[x.key] || "",
|
|
4819
|
+
onChange: (f) => b(D, f.target.value),
|
|
4818
4820
|
placeholder: x.placeholder || "Enter password",
|
|
4819
4821
|
required: x.required,
|
|
4820
|
-
className: `w-full ${
|
|
4822
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4821
4823
|
}
|
|
4822
4824
|
),
|
|
4823
4825
|
O(D)
|
|
4824
4826
|
] });
|
|
4825
4827
|
case "select":
|
|
4826
4828
|
case "dropdown":
|
|
4827
|
-
return (
|
|
4829
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4828
4830
|
/* @__PURE__ */ e(
|
|
4829
4831
|
ft,
|
|
4830
4832
|
{
|
|
4831
|
-
value:
|
|
4832
|
-
onChange: (
|
|
4833
|
+
value: R[x.key] || "",
|
|
4834
|
+
onChange: (f) => b(D, f),
|
|
4833
4835
|
options: x.options || [],
|
|
4834
4836
|
placeholder: x.placeholder || `Select ${x.label}`,
|
|
4835
4837
|
required: x.required,
|
|
4836
|
-
className: `w-full ${
|
|
4838
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4837
4839
|
}
|
|
4838
4840
|
),
|
|
4839
4841
|
O(D)
|
|
4840
4842
|
] });
|
|
4841
4843
|
case "selectDynamic":
|
|
4842
|
-
return (
|
|
4843
|
-
const
|
|
4844
|
+
return (R, D) => {
|
|
4845
|
+
const f = () => {
|
|
4844
4846
|
if (x.optionsFrom && a) {
|
|
4845
|
-
const { config:
|
|
4847
|
+
const { config: g, valueField: w, labelField: k } = x.optionsFrom, T = a[g] || [];
|
|
4846
4848
|
if (Array.isArray(T))
|
|
4847
4849
|
return T.map((L) => ({
|
|
4848
4850
|
id: L[w] || "",
|
|
@@ -4857,12 +4859,12 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4857
4859
|
ft,
|
|
4858
4860
|
{
|
|
4859
4861
|
index: D,
|
|
4860
|
-
value:
|
|
4861
|
-
onChange: (
|
|
4862
|
-
options:
|
|
4862
|
+
value: R[x.key] || "",
|
|
4863
|
+
onChange: (g) => b(D, g),
|
|
4864
|
+
options: f(),
|
|
4863
4865
|
placeholder: x.placeholder || `Select ${x.label}`,
|
|
4864
4866
|
required: x.required,
|
|
4865
|
-
className: `w-full ${
|
|
4867
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
4866
4868
|
},
|
|
4867
4869
|
Math.random()
|
|
4868
4870
|
),
|
|
@@ -4870,13 +4872,13 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4870
4872
|
] });
|
|
4871
4873
|
};
|
|
4872
4874
|
case "multiselect":
|
|
4873
|
-
return (
|
|
4874
|
-
const
|
|
4875
|
+
return (R, D) => {
|
|
4876
|
+
const f = R[x.key] || [];
|
|
4875
4877
|
return /* @__PURE__ */ e(
|
|
4876
4878
|
at,
|
|
4877
4879
|
{
|
|
4878
|
-
selectedItems:
|
|
4879
|
-
onSelectionChange: (
|
|
4880
|
+
selectedItems: f,
|
|
4881
|
+
onSelectionChange: (g) => b(D, g),
|
|
4880
4882
|
options: x.options || [],
|
|
4881
4883
|
placeholder: x.placeholder || `Select ${x.label}`,
|
|
4882
4884
|
className: "w-full"
|
|
@@ -4885,89 +4887,89 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4885
4887
|
};
|
|
4886
4888
|
case "checkbox":
|
|
4887
4889
|
case "boolean":
|
|
4888
|
-
return (
|
|
4890
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4889
4891
|
pt,
|
|
4890
4892
|
{
|
|
4891
|
-
checked: !!
|
|
4892
|
-
onChange: (
|
|
4893
|
+
checked: !!R[x.key],
|
|
4894
|
+
onChange: (f) => b(D, f),
|
|
4893
4895
|
label: x.placeholder || x.label,
|
|
4894
4896
|
className: "w-full"
|
|
4895
4897
|
}
|
|
4896
4898
|
);
|
|
4897
4899
|
case "toggle":
|
|
4898
4900
|
case "switch":
|
|
4899
|
-
return (
|
|
4901
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4900
4902
|
ya,
|
|
4901
4903
|
{
|
|
4902
|
-
isOn: !!
|
|
4903
|
-
onToggle: (
|
|
4904
|
+
isOn: !!R[x.key],
|
|
4905
|
+
onToggle: (f) => b(D, f),
|
|
4904
4906
|
label: x.placeholder || x.label,
|
|
4905
4907
|
className: "w-full"
|
|
4906
4908
|
}
|
|
4907
4909
|
);
|
|
4908
4910
|
case "date":
|
|
4909
|
-
return (
|
|
4911
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4910
4912
|
ha,
|
|
4911
4913
|
{
|
|
4912
|
-
selectedDate:
|
|
4913
|
-
onDateChange: (
|
|
4914
|
+
selectedDate: R[x.key] ? new Date(R[x.key]) : null,
|
|
4915
|
+
onDateChange: (f) => b(D, f ? f.toISOString().split("T")[0] : ""),
|
|
4914
4916
|
placeholder: x.placeholder || "Select date",
|
|
4915
4917
|
className: "w-full"
|
|
4916
4918
|
}
|
|
4917
4919
|
);
|
|
4918
4920
|
case "datetime":
|
|
4919
|
-
return (
|
|
4921
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4920
4922
|
X,
|
|
4921
4923
|
{
|
|
4922
4924
|
type: "datetime-local",
|
|
4923
|
-
value:
|
|
4924
|
-
onChange: (
|
|
4925
|
+
value: R[x.key] || "",
|
|
4926
|
+
onChange: (f) => b(D, f.target.value),
|
|
4925
4927
|
placeholder: x.placeholder || "Select date and time",
|
|
4926
4928
|
required: x.required,
|
|
4927
4929
|
className: "w-full"
|
|
4928
4930
|
}
|
|
4929
4931
|
);
|
|
4930
4932
|
case "time":
|
|
4931
|
-
return (
|
|
4933
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4932
4934
|
X,
|
|
4933
4935
|
{
|
|
4934
4936
|
type: "time",
|
|
4935
|
-
value:
|
|
4936
|
-
onChange: (
|
|
4937
|
+
value: R[x.key] || "",
|
|
4938
|
+
onChange: (f) => b(D, f.target.value),
|
|
4937
4939
|
placeholder: x.placeholder || "Select time",
|
|
4938
4940
|
required: x.required,
|
|
4939
4941
|
className: "w-full"
|
|
4940
4942
|
}
|
|
4941
4943
|
);
|
|
4942
4944
|
case "radio":
|
|
4943
|
-
return (
|
|
4945
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4944
4946
|
pa,
|
|
4945
4947
|
{
|
|
4946
|
-
selectedValue:
|
|
4947
|
-
onValueChange: (
|
|
4948
|
+
selectedValue: R[x.key] || "",
|
|
4949
|
+
onValueChange: (f) => b(D, f),
|
|
4948
4950
|
options: x.options || [],
|
|
4949
4951
|
className: "w-full"
|
|
4950
4952
|
}
|
|
4951
4953
|
);
|
|
4952
4954
|
case "search":
|
|
4953
|
-
return (
|
|
4955
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4954
4956
|
ge,
|
|
4955
4957
|
{
|
|
4956
|
-
value:
|
|
4957
|
-
onChange: (
|
|
4958
|
+
value: R[x.key] || "",
|
|
4959
|
+
onChange: (f) => b(D, f),
|
|
4958
4960
|
placeholder: x.placeholder || `Search ${x.label}`,
|
|
4959
4961
|
className: "w-full"
|
|
4960
4962
|
}
|
|
4961
4963
|
);
|
|
4962
4964
|
case "audience":
|
|
4963
|
-
return (
|
|
4964
|
-
const
|
|
4965
|
-
...
|
|
4966
|
-
...
|
|
4967
|
-
...
|
|
4965
|
+
return (R, D) => {
|
|
4966
|
+
const f = R[x.key] || { users: [], groups: [], roles: [] }, g = [
|
|
4967
|
+
...f.users || [],
|
|
4968
|
+
...f.groups || [],
|
|
4969
|
+
...f.roles || []
|
|
4968
4970
|
];
|
|
4969
4971
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
4970
|
-
/* @__PURE__ */ e(Ns, { children:
|
|
4972
|
+
/* @__PURE__ */ e(Ns, { children: g.length > 0 ? g.slice(0, 3).map((w, k) => /* @__PURE__ */ e(
|
|
4971
4973
|
we,
|
|
4972
4974
|
{
|
|
4973
4975
|
size: "small",
|
|
@@ -4983,119 +4985,127 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4983
4985
|
onClick: () => {
|
|
4984
4986
|
N(x.key), u(D);
|
|
4985
4987
|
},
|
|
4986
|
-
children:
|
|
4988
|
+
children: g.length > 0 ? "Edit" : "Assign"
|
|
4987
4989
|
}
|
|
4988
4990
|
)
|
|
4989
4991
|
] });
|
|
4990
4992
|
};
|
|
4991
4993
|
case "color":
|
|
4992
|
-
return (
|
|
4994
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
4993
4995
|
X,
|
|
4994
4996
|
{
|
|
4995
4997
|
type: "color",
|
|
4996
|
-
value:
|
|
4997
|
-
onChange: (
|
|
4998
|
+
value: R[x.key] || "#000000",
|
|
4999
|
+
onChange: (f) => b(D, f.target.value),
|
|
4998
5000
|
className: "w-full h-10"
|
|
4999
5001
|
}
|
|
5000
5002
|
);
|
|
5001
5003
|
case "range":
|
|
5002
|
-
return (
|
|
5004
|
+
return (R, D) => /* @__PURE__ */ n("div", { className: "w-full", children: [
|
|
5003
5005
|
/* @__PURE__ */ e(
|
|
5004
5006
|
X,
|
|
5005
5007
|
{
|
|
5006
5008
|
type: "range",
|
|
5007
|
-
value:
|
|
5008
|
-
onChange: (
|
|
5009
|
+
value: R[x.key] || x.min || 0,
|
|
5010
|
+
onChange: (f) => b(D, f.target.value),
|
|
5009
5011
|
min: x.min || 0,
|
|
5010
5012
|
max: x.max || 100,
|
|
5011
5013
|
step: x.step || 1,
|
|
5012
5014
|
className: "w-full"
|
|
5013
5015
|
}
|
|
5014
5016
|
),
|
|
5015
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children:
|
|
5017
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: R[x.key] || x.min || 0 })
|
|
5016
5018
|
] });
|
|
5017
5019
|
case "file":
|
|
5018
|
-
return (
|
|
5020
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
5019
5021
|
X,
|
|
5020
5022
|
{
|
|
5021
5023
|
type: "file",
|
|
5022
|
-
onChange: (
|
|
5023
|
-
const
|
|
5024
|
-
|
|
5024
|
+
onChange: (f) => {
|
|
5025
|
+
const g = f.target.files[0];
|
|
5026
|
+
b(D, g ? g.name : "");
|
|
5025
5027
|
},
|
|
5026
5028
|
accept: x.accept,
|
|
5027
5029
|
className: "w-full"
|
|
5028
5030
|
}
|
|
5029
5031
|
);
|
|
5030
5032
|
case "hidden":
|
|
5031
|
-
return (
|
|
5033
|
+
return (R, D) => /* @__PURE__ */ e(
|
|
5032
5034
|
X,
|
|
5033
5035
|
{
|
|
5034
5036
|
type: "hidden",
|
|
5035
|
-
value:
|
|
5036
|
-
onChange: (
|
|
5037
|
+
value: R[x.key] || "",
|
|
5038
|
+
onChange: (f) => b(D, f.target.value)
|
|
5037
5039
|
}
|
|
5038
5040
|
);
|
|
5039
5041
|
// Default fallback for unknown field types
|
|
5040
5042
|
default:
|
|
5041
|
-
return (
|
|
5043
|
+
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
5042
5044
|
/* @__PURE__ */ e(
|
|
5043
5045
|
X,
|
|
5044
5046
|
{
|
|
5045
|
-
value:
|
|
5046
|
-
onChange: (
|
|
5047
|
+
value: R[x.key] || "",
|
|
5048
|
+
onChange: (f) => b(D, f.target.value),
|
|
5047
5049
|
placeholder: x.placeholder || `Enter ${x.label}`,
|
|
5048
5050
|
required: x.required,
|
|
5049
|
-
className: `w-full ${
|
|
5051
|
+
className: `w-full ${S(D) ? "border-red-500" : ""}`
|
|
5050
5052
|
}
|
|
5051
5053
|
),
|
|
5052
5054
|
O(D)
|
|
5053
5055
|
] });
|
|
5054
5056
|
}
|
|
5055
|
-
},
|
|
5057
|
+
}, F = ee(() => {
|
|
5056
5058
|
console.log("[DataTableRenderer] Adding blank row"), r((x) => {
|
|
5057
5059
|
console.log("[DataTableRenderer] Current data before add:", x);
|
|
5058
|
-
const
|
|
5060
|
+
const b = {
|
|
5059
5061
|
id: x.length
|
|
5060
5062
|
// Assign next available ID
|
|
5061
5063
|
};
|
|
5062
5064
|
l.fields.forEach((O) => {
|
|
5063
|
-
O.fieldtype === "audience" ?
|
|
5064
|
-
}), console.log("[DataTableRenderer] New blank row:",
|
|
5065
|
-
const
|
|
5066
|
-
return console.log("[DataTableRenderer] Updated data:",
|
|
5065
|
+
O.fieldtype === "audience" ? b[O.key] = { users: [], groups: [], roles: [] } : b[O.key] = O.default || "";
|
|
5066
|
+
}), console.log("[DataTableRenderer] New blank row:", b);
|
|
5067
|
+
const S = [...x, b];
|
|
5068
|
+
return console.log("[DataTableRenderer] Updated data:", S), S;
|
|
5067
5069
|
});
|
|
5068
|
-
}, [l.fields]),
|
|
5069
|
-
r((
|
|
5070
|
-
if (
|
|
5071
|
-
return
|
|
5072
|
-
const
|
|
5073
|
-
return
|
|
5070
|
+
}, [l.fields]), E = ee((x) => {
|
|
5071
|
+
r((b) => {
|
|
5072
|
+
if (b.length <= 1)
|
|
5073
|
+
return b;
|
|
5074
|
+
const S = [...b];
|
|
5075
|
+
return S.splice(x, 1), S;
|
|
5074
5076
|
});
|
|
5075
|
-
}, []), [
|
|
5076
|
-
P(
|
|
5077
|
-
}, []), U =
|
|
5077
|
+
}, []), [I, P] = B(null), j = ee((x, b) => {
|
|
5078
|
+
P(b), x.dataTransfer.effectAllowed = "move", x.dataTransfer.setData("text/html", "");
|
|
5079
|
+
}, []), U = ee((x) => {
|
|
5078
5080
|
x.preventDefault(), x.dataTransfer.dropEffect = "move";
|
|
5079
|
-
}, []), Y =
|
|
5080
|
-
x.preventDefault(), !(
|
|
5081
|
-
const O = [...
|
|
5082
|
-
return O.splice(
|
|
5081
|
+
}, []), Y = ee((x, b) => {
|
|
5082
|
+
x.preventDefault(), !(I === null || I === b) && (r((S) => {
|
|
5083
|
+
const O = [...S], R = O[I];
|
|
5084
|
+
return O.splice(I, 1), O.splice(b, 0, R), O;
|
|
5083
5085
|
}), P(null));
|
|
5084
|
-
}, [
|
|
5086
|
+
}, [I]), q = ee(() => {
|
|
5085
5087
|
P(null);
|
|
5086
|
-
}, []), $ =
|
|
5087
|
-
console.log("[DataTableRenderer] handleAddAudience called with:", x), r((
|
|
5088
|
-
const
|
|
5089
|
-
if (o !== null && h &&
|
|
5090
|
-
const
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5088
|
+
}, []), $ = ee((x, b) => {
|
|
5089
|
+
console.log("[DataTableRenderer] handleAddAudience called with:", { selectedEntities: x, existingShares: b }), r((S) => {
|
|
5090
|
+
const O = [...S];
|
|
5091
|
+
if (o !== null && h && O[o]) {
|
|
5092
|
+
const R = x.pendingInvites || [];
|
|
5093
|
+
if (R.length > 0) {
|
|
5094
|
+
const D = R.filter((w) => w.type === "User"), f = R.filter((w) => w.type === "Group"), g = R.filter((w) => w.type === "Role");
|
|
5095
|
+
O[o][h] = {
|
|
5096
|
+
users: [...O[o][h]?.users || [], ...D],
|
|
5097
|
+
groups: [...O[o][h]?.groups || [], ...f],
|
|
5098
|
+
roles: [...O[o][h]?.roles || [], ...g]
|
|
5099
|
+
};
|
|
5100
|
+
} else b && (O[o][h] = {
|
|
5101
|
+
users: b.users || [],
|
|
5102
|
+
groups: b.groups || [],
|
|
5103
|
+
roles: b.roles || []
|
|
5104
|
+
});
|
|
5105
|
+
console.log("[DataTableRenderer] Updated audience data:", O[o][h]);
|
|
5096
5106
|
}
|
|
5097
|
-
return
|
|
5098
|
-
}), u(null), N(null);
|
|
5107
|
+
return O;
|
|
5108
|
+
}), console.log("[DataTableRenderer] Closing modal after update"), u(null), N(null);
|
|
5099
5109
|
}, [o, h]);
|
|
5100
5110
|
return /* @__PURE__ */ n("div", { children: [
|
|
5101
5111
|
/* @__PURE__ */ n("div", { style: { marginBottom: "20px" }, children: [
|
|
@@ -5105,7 +5115,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5105
5115
|
"button",
|
|
5106
5116
|
{
|
|
5107
5117
|
className: "btn btn-primary text-white px-6 py-2 rounded-2xl cursor-pointer hover:bg-gray-800",
|
|
5108
|
-
onClick:
|
|
5118
|
+
onClick: F,
|
|
5109
5119
|
children: "Add"
|
|
5110
5120
|
}
|
|
5111
5121
|
)
|
|
@@ -5115,32 +5125,32 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5115
5125
|
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ n("table", { className: "min-w-full bg-white border border-gray-300", style: { marginBottom: "20px" }, children: [
|
|
5116
5126
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "bg-gray-50", children: [
|
|
5117
5127
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-10" }),
|
|
5118
|
-
l.fields.map((x,
|
|
5128
|
+
l.fields.map((x, b) => /* @__PURE__ */ e(
|
|
5119
5129
|
"th",
|
|
5120
5130
|
{
|
|
5121
5131
|
className: "px-4 py-2 text-left text-sm font-medium text-gray-700",
|
|
5122
5132
|
children: x.label || x.key
|
|
5123
5133
|
},
|
|
5124
|
-
|
|
5134
|
+
b
|
|
5125
5135
|
)),
|
|
5126
5136
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-16" })
|
|
5127
5137
|
] }) }),
|
|
5128
|
-
/* @__PURE__ */ e("tbody", { children: y.map((x,
|
|
5138
|
+
/* @__PURE__ */ e("tbody", { children: y.map((x, b) => /* @__PURE__ */ n(
|
|
5129
5139
|
"tr",
|
|
5130
5140
|
{
|
|
5131
|
-
className: `hover:bg-gray-50 ${
|
|
5141
|
+
className: `hover:bg-gray-50 ${I === b ? "opacity-50" : ""}`,
|
|
5132
5142
|
draggable: !0,
|
|
5133
|
-
onDragStart: (
|
|
5143
|
+
onDragStart: (S) => j(S, b),
|
|
5134
5144
|
onDragOver: U,
|
|
5135
|
-
onDrop: (
|
|
5145
|
+
onDrop: (S) => Y(S, b),
|
|
5136
5146
|
onDragEnd: q,
|
|
5137
5147
|
children: [
|
|
5138
5148
|
/* @__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(wt, { size: 16 }) }) }),
|
|
5139
|
-
l.fields.map((
|
|
5149
|
+
l.fields.map((S, O) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: z(S)(x, b) }, O)),
|
|
5140
5150
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
5141
5151
|
"button",
|
|
5142
5152
|
{
|
|
5143
|
-
onClick: () =>
|
|
5153
|
+
onClick: () => E(b),
|
|
5144
5154
|
className: "text-red-500 hover:text-red-700",
|
|
5145
5155
|
title: "Delete row",
|
|
5146
5156
|
children: /* @__PURE__ */ e(yr, { size: 16 })
|
|
@@ -5148,7 +5158,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5148
5158
|
) })
|
|
5149
5159
|
]
|
|
5150
5160
|
},
|
|
5151
|
-
|
|
5161
|
+
b
|
|
5152
5162
|
)) })
|
|
5153
5163
|
] }) }),
|
|
5154
5164
|
o !== null && (() => {
|
|
@@ -5194,41 +5204,40 @@ function Ss({
|
|
|
5194
5204
|
onShowCancelModal: l,
|
|
5195
5205
|
onCancel: m
|
|
5196
5206
|
}) {
|
|
5197
|
-
const [o, u] = re.useState(a), [h, N] = re.useState(null), [y, r] = re.useState(null), [v, d] = B(!1), [
|
|
5207
|
+
const [o, u] = re.useState(a), [h, N] = re.useState(null), [y, r] = re.useState(null), [v, d] = B(!1), [p, z] = B(!1), [F, E] = B({}), I = `${$e()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, P = I, [j, U] = B(1), Y = () => {
|
|
5198
5208
|
if (!y || !h)
|
|
5199
5209
|
return console.log("[DynamicConfig] hasUnsavedChanges: false (no data)", { originalData: y, data: h }), !1;
|
|
5200
|
-
const
|
|
5210
|
+
const f = (T) => {
|
|
5201
5211
|
if (T == null || typeof T != "object") return T;
|
|
5202
|
-
if (Array.isArray(T)) return T.map(
|
|
5212
|
+
if (Array.isArray(T)) return T.map(f);
|
|
5203
5213
|
const L = {};
|
|
5204
5214
|
return Object.keys(T).sort().forEach((C) => {
|
|
5205
|
-
L[C] =
|
|
5215
|
+
L[C] = f(T[C]);
|
|
5206
5216
|
}), L;
|
|
5207
|
-
},
|
|
5217
|
+
}, g = f(y), w = f(h), k = JSON.stringify(g) !== JSON.stringify(w);
|
|
5208
5218
|
return console.log("[DynamicConfig] hasUnsavedChanges:", k, {
|
|
5209
|
-
originalData:
|
|
5219
|
+
originalData: g,
|
|
5210
5220
|
currentData: w,
|
|
5211
5221
|
originalRaw: y,
|
|
5212
5222
|
currentRaw: h
|
|
5213
5223
|
}), k;
|
|
5214
|
-
}, q = (
|
|
5224
|
+
}, q = (f) => {
|
|
5215
5225
|
if (!a || !a.configuration)
|
|
5216
|
-
return
|
|
5217
|
-
const
|
|
5226
|
+
return f;
|
|
5227
|
+
const g = {}, w = f?.configuration || {};
|
|
5218
5228
|
return a.configuration.forEach((k) => {
|
|
5219
5229
|
if (k.key && k.type === "datatable") {
|
|
5220
5230
|
const L = (w[k.key] || []).map((C, M) => {
|
|
5221
5231
|
const _ = { id: C.id || 0 };
|
|
5222
|
-
return k.fields && k.fields.forEach((
|
|
5223
|
-
if (
|
|
5232
|
+
return k.fields && k.fields.forEach((A) => {
|
|
5233
|
+
if (A.fieldtype === "audience") {
|
|
5224
5234
|
let G = { users: [], groups: [], roles: [] };
|
|
5225
|
-
C[
|
|
5226
|
-
users: C[
|
|
5227
|
-
groups: C[
|
|
5228
|
-
roles: C[
|
|
5229
|
-
})), _[
|
|
5230
|
-
} else
|
|
5231
|
-
_[E.key] = C[E.key] || E.default || "";
|
|
5235
|
+
C[A.key] && (Array.isArray(C[A.key]) ? G = { users: [], groups: [], roles: [] } : typeof C[A.key] == "object" && (G = {
|
|
5236
|
+
users: C[A.key].users || [],
|
|
5237
|
+
groups: C[A.key].groups || [],
|
|
5238
|
+
roles: C[A.key].roles || []
|
|
5239
|
+
})), _[A.key] = G;
|
|
5240
|
+
} else A.fieldtype === "select" ? _[A.key] = C[A.key] !== void 0 && C[A.key] !== "" ? C[A.key] : A.default || "" : _[A.key] = C[A.key] || A.default || "";
|
|
5232
5241
|
}), _;
|
|
5233
5242
|
});
|
|
5234
5243
|
if (L.length === 0) {
|
|
@@ -5237,126 +5246,126 @@ function Ss({
|
|
|
5237
5246
|
M.fieldtype === "audience" ? C[M.key] = { users: [], groups: [], roles: [] } : C[M.key] = M.default || "";
|
|
5238
5247
|
}), L.push(C);
|
|
5239
5248
|
}
|
|
5240
|
-
|
|
5249
|
+
g[k.key] = L;
|
|
5241
5250
|
} else if (k.key) {
|
|
5242
5251
|
const T = w[k.key] || {};
|
|
5243
5252
|
k.type === "section" && k.fields && k.fields.forEach((L) => {
|
|
5244
5253
|
L.fieldtype === "managecollectionlist" && L.key && (!T[L.key] || !Array.isArray(T[L.key])) && (T[L.key] = L.initialData || []);
|
|
5245
|
-
}),
|
|
5254
|
+
}), g[k.key] = T;
|
|
5246
5255
|
}
|
|
5247
|
-
}),
|
|
5256
|
+
}), g;
|
|
5248
5257
|
}, $ = () => {
|
|
5249
5258
|
if (a && a.configuration) {
|
|
5250
|
-
const
|
|
5251
|
-
a.configuration.forEach((
|
|
5252
|
-
if (
|
|
5253
|
-
if (
|
|
5259
|
+
const f = {};
|
|
5260
|
+
a.configuration.forEach((g) => {
|
|
5261
|
+
if (g.key)
|
|
5262
|
+
if (g.type === "datatable") {
|
|
5254
5263
|
const w = { id: 0 };
|
|
5255
|
-
|
|
5256
|
-
k.fieldtype === "audience" ? w[k.key] = { users: [], groups: [], roles: [] } : w[k.key] = k.default || "";
|
|
5257
|
-
}),
|
|
5258
|
-
} else if (
|
|
5264
|
+
g.fields && g.fields.forEach((k) => {
|
|
5265
|
+
k.fieldtype === "audience" ? w[k.key] = { users: [], groups: [], roles: [] } : (k.fieldtype, w[k.key] = k.default || "");
|
|
5266
|
+
}), f[g.key] = [w];
|
|
5267
|
+
} else if (g.type === "section") {
|
|
5259
5268
|
const w = {};
|
|
5260
|
-
|
|
5269
|
+
g.fields && Array.isArray(g.fields) && g.fields.forEach((k) => {
|
|
5261
5270
|
k.key && (k.fieldtype === "managecollectionlist" ? w[k.key] = k.initialData || [] : w[k.key] = k.default || "");
|
|
5262
|
-
}),
|
|
5271
|
+
}), f[g.key] = w;
|
|
5263
5272
|
} else
|
|
5264
|
-
|
|
5265
|
-
}), N(
|
|
5273
|
+
f[g.key] = {};
|
|
5274
|
+
}), N(f), r(f);
|
|
5266
5275
|
}
|
|
5267
5276
|
};
|
|
5268
|
-
|
|
5277
|
+
Z(() => {
|
|
5269
5278
|
if (s) {
|
|
5270
5279
|
d(!1);
|
|
5271
5280
|
return;
|
|
5272
5281
|
}
|
|
5273
|
-
const
|
|
5282
|
+
const f = async () => {
|
|
5274
5283
|
try {
|
|
5275
5284
|
d(!0);
|
|
5276
|
-
let
|
|
5277
|
-
if (
|
|
5278
|
-
const w = q(
|
|
5285
|
+
let g = await Ze(I);
|
|
5286
|
+
if (g) {
|
|
5287
|
+
const w = q(g);
|
|
5279
5288
|
N(w), r(w);
|
|
5280
5289
|
} else
|
|
5281
5290
|
$();
|
|
5282
|
-
} catch (
|
|
5283
|
-
console.error("Error fetching configuration:",
|
|
5291
|
+
} catch (g) {
|
|
5292
|
+
console.error("Error fetching configuration:", g);
|
|
5284
5293
|
let w = "Failed to load configuration";
|
|
5285
|
-
if (
|
|
5286
|
-
const k =
|
|
5294
|
+
if (g.response) {
|
|
5295
|
+
const k = g.response.status, T = g.response.data?.message || g.response.data?.error;
|
|
5287
5296
|
k === 400 ? w = T || "Invalid request. Please check the application ID." : k === 401 ? w = "You are not authorized to access this configuration." : k === 403 ? w = "Access denied. You don't have permission to view this configuration." : k === 404 ? w = "Configuration not found. It may not exist yet or the application ID is incorrect." : k >= 500 ? w = T || "Server error. Please try again later." : w = T || `Failed to load configuration (Error ${k})`;
|
|
5288
|
-
} else
|
|
5297
|
+
} else g.request ? w = "Network error. Please check your connection and try again." : w = g.message || "An unexpected error occurred while loading configuration.";
|
|
5289
5298
|
qe.error(w), $();
|
|
5290
5299
|
} finally {
|
|
5291
5300
|
d(!1);
|
|
5292
5301
|
}
|
|
5293
5302
|
};
|
|
5294
|
-
a && (u(a), t ?
|
|
5303
|
+
a && (u(a), t ? f() : $());
|
|
5295
5304
|
}, [a, j, t, s]);
|
|
5296
|
-
const x = (
|
|
5297
|
-
console.log(`[DynamicConfig] handleSectionChange called for ${
|
|
5305
|
+
const x = (f, g) => {
|
|
5306
|
+
console.log(`[DynamicConfig] handleSectionChange called for ${f}:`, g), N((w) => {
|
|
5298
5307
|
const k = {
|
|
5299
5308
|
...w,
|
|
5300
|
-
[
|
|
5309
|
+
[f]: g
|
|
5301
5310
|
};
|
|
5302
5311
|
return console.log("[DynamicConfig] Updated data state:", k), k;
|
|
5303
|
-
}),
|
|
5312
|
+
}), E((w) => {
|
|
5304
5313
|
const k = { ...w };
|
|
5305
|
-
return k[
|
|
5314
|
+
return k[f] && delete k[f], k;
|
|
5306
5315
|
});
|
|
5307
|
-
},
|
|
5308
|
-
const
|
|
5309
|
-
return !o || !h || o.configuration.forEach((
|
|
5310
|
-
if (
|
|
5311
|
-
|
|
5312
|
-
const k = h[
|
|
5316
|
+
}, b = () => {
|
|
5317
|
+
const f = {};
|
|
5318
|
+
return !o || !h || o.configuration.forEach((g) => {
|
|
5319
|
+
if (g.type === "section")
|
|
5320
|
+
g.fields.forEach((w) => {
|
|
5321
|
+
const k = h[g.key]?.[w.key];
|
|
5313
5322
|
if (w.required && (!k || typeof k == "string" && k.trim() === "")) {
|
|
5314
|
-
|
|
5323
|
+
f[g.key] || (f[g.key] = {}), f[g.key][w.key] = `${w.label} is required`;
|
|
5315
5324
|
return;
|
|
5316
5325
|
}
|
|
5317
5326
|
if (w.fieldtype === "number" && k !== "" && k !== null && k !== void 0) {
|
|
5318
5327
|
const T = Number(k);
|
|
5319
|
-
isNaN(T) ? (
|
|
5328
|
+
isNaN(T) ? (f[g.key] || (f[g.key] = {}), f[g.key][w.key] = `${w.label} must be a valid number`) : (w.min !== void 0 && T < w.min && (f[g.key] || (f[g.key] = {}), f[g.key][w.key] = `${w.label} must be at least ${w.min}`), w.max !== void 0 && T > w.max && (f[g.key] || (f[g.key] = {}), f[g.key][w.key] = `${w.label} must not exceed ${w.max}`));
|
|
5320
5329
|
}
|
|
5321
5330
|
});
|
|
5322
|
-
else if (
|
|
5323
|
-
const w = h[
|
|
5331
|
+
else if (g.type === "datatable") {
|
|
5332
|
+
const w = h[g.key];
|
|
5324
5333
|
Array.isArray(w) && w.forEach((k, T) => {
|
|
5325
|
-
|
|
5334
|
+
g.fields.forEach((L) => {
|
|
5326
5335
|
const C = k[L.key];
|
|
5327
5336
|
if (L.required && (!C || typeof C == "string" && C.trim() === "")) {
|
|
5328
|
-
|
|
5337
|
+
f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} is required`;
|
|
5329
5338
|
return;
|
|
5330
5339
|
}
|
|
5331
5340
|
if (L.fieldtype === "number" && C !== "" && C !== null && C !== void 0) {
|
|
5332
5341
|
const M = Number(C);
|
|
5333
|
-
isNaN(M) ? (
|
|
5342
|
+
isNaN(M) ? (f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} must be a valid number`) : (L.min !== void 0 && M < L.min && (f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} must be at least ${L.min}`), L.max !== void 0 && M > L.max && (f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} must not exceed ${L.max}`));
|
|
5334
5343
|
}
|
|
5335
5344
|
});
|
|
5336
5345
|
});
|
|
5337
5346
|
}
|
|
5338
|
-
}),
|
|
5339
|
-
},
|
|
5340
|
-
if (
|
|
5347
|
+
}), f;
|
|
5348
|
+
}, S = (f) => Object.keys(f).length > 0, O = () => {
|
|
5349
|
+
if (p) {
|
|
5341
5350
|
console.log("[handleSave] Already saving, ignoring duplicate call");
|
|
5342
5351
|
return;
|
|
5343
5352
|
}
|
|
5344
5353
|
console.log("[handleSave] Starting save process");
|
|
5345
|
-
const
|
|
5346
|
-
if (
|
|
5354
|
+
const f = b();
|
|
5355
|
+
if (E(f), S(f)) {
|
|
5347
5356
|
let w = [];
|
|
5348
|
-
Object.keys(
|
|
5349
|
-
typeof
|
|
5350
|
-
typeof
|
|
5351
|
-
w.push(`${k} row ${parseInt(T) + 1}: ${
|
|
5352
|
-
}) : w.push(`${k}: ${
|
|
5357
|
+
Object.keys(f).forEach((k) => {
|
|
5358
|
+
typeof f[k] == "object" && Object.keys(f[k]).forEach((T) => {
|
|
5359
|
+
typeof f[k][T] == "object" ? Object.keys(f[k][T]).forEach((L) => {
|
|
5360
|
+
w.push(`${k} row ${parseInt(T) + 1}: ${f[k][T][L]}`);
|
|
5361
|
+
}) : w.push(`${k}: ${f[k][T]}`);
|
|
5353
5362
|
});
|
|
5354
5363
|
});
|
|
5355
5364
|
return;
|
|
5356
5365
|
}
|
|
5357
5366
|
(async () => {
|
|
5358
5367
|
try {
|
|
5359
|
-
|
|
5368
|
+
z(!0);
|
|
5360
5369
|
const w = {};
|
|
5361
5370
|
h && Object.keys(h).forEach((T) => {
|
|
5362
5371
|
const L = a?.configuration?.find(
|
|
@@ -5366,12 +5375,12 @@ function Ss({
|
|
|
5366
5375
|
const M = { id: C.id || 0 };
|
|
5367
5376
|
return L.fields && L.fields.forEach((_) => {
|
|
5368
5377
|
if (_.fieldtype === "audience") {
|
|
5369
|
-
let
|
|
5370
|
-
C[_.key] && typeof C[_.key] == "object" && !Array.isArray(C[_.key]) && (
|
|
5378
|
+
let A = { users: [], groups: [], roles: [] };
|
|
5379
|
+
C[_.key] && typeof C[_.key] == "object" && !Array.isArray(C[_.key]) && (A = {
|
|
5371
5380
|
users: C[_.key].users || [],
|
|
5372
5381
|
groups: C[_.key].groups || [],
|
|
5373
5382
|
roles: C[_.key].roles || []
|
|
5374
|
-
}), M[_.key] =
|
|
5383
|
+
}), M[_.key] = A;
|
|
5375
5384
|
} else
|
|
5376
5385
|
M[_.key] = C[_.key] || "";
|
|
5377
5386
|
}), M;
|
|
@@ -5379,7 +5388,7 @@ function Ss({
|
|
|
5379
5388
|
}), (!w.appkey || w.appkey === "") && (w.appkey = t);
|
|
5380
5389
|
let k = await xt(P, w);
|
|
5381
5390
|
if (k && k.status != "fail") {
|
|
5382
|
-
|
|
5391
|
+
E({}), r(JSON.parse(JSON.stringify(h)));
|
|
5383
5392
|
const T = k.message || "Configuration has been saved successfully";
|
|
5384
5393
|
qe.success(T), i && typeof i == "function" && i(h);
|
|
5385
5394
|
} else
|
|
@@ -5387,37 +5396,37 @@ function Ss({
|
|
|
5387
5396
|
} catch (w) {
|
|
5388
5397
|
console.error("Error saving configuration:", w), qe.error(w?.message || "Failed to save configuration");
|
|
5389
5398
|
} finally {
|
|
5390
|
-
|
|
5399
|
+
z(!1);
|
|
5391
5400
|
}
|
|
5392
5401
|
})();
|
|
5393
|
-
},
|
|
5402
|
+
}, R = () => {
|
|
5394
5403
|
console.log("[DynamicConfig] handleCancel called"), Y() ? (console.log("[DynamicConfig] Unsaved changes detected - showing modal"), l ? l() : console.warn("[DynamicConfig] onShowCancelModal not provided, cannot show modal")) : (console.log("[DynamicConfig] No unsaved changes - going back directly"), m ? m() : (console.log("[DynamicConfig] Using fallback window.history.back()"), window.history.back()));
|
|
5395
5404
|
};
|
|
5396
5405
|
if (!o?.configuration && !a?.configuration)
|
|
5397
5406
|
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" }) });
|
|
5398
5407
|
const D = a?.configuration || o?.configuration;
|
|
5399
|
-
return
|
|
5408
|
+
return Z(() => {
|
|
5400
5409
|
s && a ? (!h || Object.keys(h).length === 0) && $() : s && !a && $();
|
|
5401
5410
|
}, [s, a]), /* @__PURE__ */ n("div", { children: [
|
|
5402
5411
|
/* @__PURE__ */ n(
|
|
5403
5412
|
"div",
|
|
5404
5413
|
{
|
|
5405
|
-
className: "dynamic-config bg-white w-full h-[calc(100vh-
|
|
5414
|
+
className: "dynamic-config bg-white w-full h-[calc(100vh-500px)] overflow-y-auto",
|
|
5406
5415
|
style: { padding: "0px 20px 0px 0px" },
|
|
5407
5416
|
children: [
|
|
5408
5417
|
v && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(ba, { size: "large" }) }),
|
|
5409
|
-
!v && D?.map((
|
|
5410
|
-
const w = zs(
|
|
5418
|
+
!v && D?.map((f, g) => {
|
|
5419
|
+
const w = zs(f.type);
|
|
5411
5420
|
if (w && w !== "UnknownType")
|
|
5412
5421
|
return /* @__PURE__ */ e(
|
|
5413
5422
|
w,
|
|
5414
5423
|
{
|
|
5415
|
-
item:
|
|
5424
|
+
item: f,
|
|
5416
5425
|
data: h,
|
|
5417
5426
|
updateHandler: x,
|
|
5418
|
-
validationErrors:
|
|
5427
|
+
validationErrors: F
|
|
5419
5428
|
},
|
|
5420
|
-
|
|
5429
|
+
g
|
|
5421
5430
|
);
|
|
5422
5431
|
})
|
|
5423
5432
|
]
|
|
@@ -5428,9 +5437,9 @@ function Ss({
|
|
|
5428
5437
|
le,
|
|
5429
5438
|
{
|
|
5430
5439
|
category: "secondary",
|
|
5431
|
-
onClick:
|
|
5440
|
+
onClick: R,
|
|
5432
5441
|
label: "Cancel",
|
|
5433
|
-
disabled:
|
|
5442
|
+
disabled: p,
|
|
5434
5443
|
type: "button"
|
|
5435
5444
|
}
|
|
5436
5445
|
),
|
|
@@ -5439,8 +5448,8 @@ function Ss({
|
|
|
5439
5448
|
{
|
|
5440
5449
|
category: "primary",
|
|
5441
5450
|
onClick: O,
|
|
5442
|
-
disabled:
|
|
5443
|
-
label:
|
|
5451
|
+
disabled: p,
|
|
5452
|
+
label: p ? "Saving..." : "Save",
|
|
5444
5453
|
type: "submit"
|
|
5445
5454
|
}
|
|
5446
5455
|
)
|
|
@@ -5458,27 +5467,27 @@ const Kl = ({
|
|
|
5458
5467
|
breadcrumb: N = [],
|
|
5459
5468
|
overview: y = {},
|
|
5460
5469
|
configuration: r = []
|
|
5461
|
-
} = t, v = ae(() => r.map((
|
|
5462
|
-
if (
|
|
5463
|
-
const
|
|
5470
|
+
} = t, v = ae(() => r.map((b) => {
|
|
5471
|
+
if (b.type === "section" && b.fields) {
|
|
5472
|
+
const S = [...b.fields], O = S.findIndex((R) => R && R.key === "appkey");
|
|
5464
5473
|
if (O !== -1) {
|
|
5465
|
-
const
|
|
5466
|
-
if (
|
|
5467
|
-
...
|
|
5474
|
+
const R = S[O];
|
|
5475
|
+
if (S[O] = {
|
|
5476
|
+
...R,
|
|
5468
5477
|
default: a,
|
|
5469
5478
|
value: a,
|
|
5470
5479
|
readonly: !0,
|
|
5471
5480
|
placeholder: a,
|
|
5472
5481
|
disabled: !1
|
|
5473
|
-
},
|
|
5474
|
-
const
|
|
5475
|
-
|
|
5476
|
-
...
|
|
5477
|
-
default:
|
|
5478
|
-
placeholder:
|
|
5482
|
+
}, S.some((f) => f.key === "displayname")) {
|
|
5483
|
+
const f = S.findIndex((w) => w.key === "displayname"), g = S[f] || {};
|
|
5484
|
+
S[f] = {
|
|
5485
|
+
...g,
|
|
5486
|
+
default: g.default || g.value || a,
|
|
5487
|
+
placeholder: g.placeholder || "Enter display name"
|
|
5479
5488
|
};
|
|
5480
5489
|
} else {
|
|
5481
|
-
const
|
|
5490
|
+
const f = {
|
|
5482
5491
|
key: "displayname",
|
|
5483
5492
|
label: "Display Name",
|
|
5484
5493
|
fieldtype: "text",
|
|
@@ -5487,46 +5496,46 @@ const Kl = ({
|
|
|
5487
5496
|
placeholder: "Enter display name",
|
|
5488
5497
|
required: !1
|
|
5489
5498
|
};
|
|
5490
|
-
|
|
5499
|
+
S.splice(O + 1, 0, f);
|
|
5491
5500
|
}
|
|
5492
5501
|
}
|
|
5493
5502
|
return {
|
|
5494
|
-
...
|
|
5495
|
-
fields:
|
|
5503
|
+
...b,
|
|
5504
|
+
fields: S
|
|
5496
5505
|
};
|
|
5497
5506
|
}
|
|
5498
|
-
return
|
|
5507
|
+
return b;
|
|
5499
5508
|
}), [r, a]), d = {
|
|
5500
5509
|
heading: "App Details",
|
|
5501
5510
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
5502
5511
|
isLeftArrow: !0,
|
|
5503
5512
|
onBackClick: () => window.history.back(),
|
|
5504
5513
|
...u
|
|
5505
|
-
},
|
|
5506
|
-
label:
|
|
5507
|
-
href:
|
|
5508
|
-
})),
|
|
5514
|
+
}, p = N.map((b) => ({
|
|
5515
|
+
label: b.text,
|
|
5516
|
+
href: b.href || "#"
|
|
5517
|
+
})), z = ee(() => {
|
|
5509
5518
|
o(!0);
|
|
5510
|
-
}, []),
|
|
5511
|
-
o(!1),
|
|
5512
|
-
}, []),
|
|
5513
|
-
console.log("Configuration changed:",
|
|
5514
|
-
}, []),
|
|
5519
|
+
}, []), F = ee((b) => {
|
|
5520
|
+
o(!1), b.primary && window.history.back();
|
|
5521
|
+
}, []), E = ee((b) => {
|
|
5522
|
+
console.log("Configuration changed:", b);
|
|
5523
|
+
}, []), I = ee(() => {
|
|
5515
5524
|
window.history.back();
|
|
5516
5525
|
}, []), P = (() => {
|
|
5517
5526
|
if (h.headingKey && Array.isArray(r)) {
|
|
5518
|
-
const
|
|
5519
|
-
if (
|
|
5520
|
-
const D =
|
|
5527
|
+
const b = h.headingKey.split("."), S = b[0], O = b[1], R = r.find((D) => D && D.key === S);
|
|
5528
|
+
if (R && R.fields) {
|
|
5529
|
+
const D = R.fields.find((f) => f && f.key === O);
|
|
5521
5530
|
if (D)
|
|
5522
5531
|
return D.default ?? D.value ?? h.heading ?? a;
|
|
5523
5532
|
}
|
|
5524
5533
|
}
|
|
5525
5534
|
if (Array.isArray(r)) {
|
|
5526
|
-
for (const
|
|
5527
|
-
if (
|
|
5528
|
-
const
|
|
5529
|
-
if (
|
|
5535
|
+
for (const b of r)
|
|
5536
|
+
if (b && b.fields) {
|
|
5537
|
+
const S = b.fields.find((O) => O && O.key === "displayname");
|
|
5538
|
+
if (S) return S.default ?? S.value ?? a;
|
|
5530
5539
|
}
|
|
5531
5540
|
}
|
|
5532
5541
|
return h.heading || a;
|
|
@@ -5558,22 +5567,22 @@ const Kl = ({
|
|
|
5558
5567
|
configuration: v
|
|
5559
5568
|
}), [v]), q = ae(() => [
|
|
5560
5569
|
{ label: "Overview", content: x(U) },
|
|
5561
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: Y, disableApi: s, onSave:
|
|
5562
|
-
], [a, Y, s,
|
|
5563
|
-
function $(
|
|
5564
|
-
return
|
|
5570
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: Y, disableApi: s, onSave: E, onShowCancelModal: z, onCancel: I }) }
|
|
5571
|
+
], [a, Y, s, E, z, I, U]);
|
|
5572
|
+
function $(b) {
|
|
5573
|
+
return b ? b.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: b } }) : b : "📱";
|
|
5565
5574
|
}
|
|
5566
|
-
function x(
|
|
5575
|
+
function x(b) {
|
|
5567
5576
|
return /* @__PURE__ */ n("div", { className: "bg-white rounded-2xl p-1", children: [
|
|
5568
5577
|
/* @__PURE__ */ n("section", { className: "mb-8", children: [
|
|
5569
5578
|
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
|
|
5570
|
-
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children:
|
|
5579
|
+
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children: b.about })
|
|
5571
5580
|
] }),
|
|
5572
5581
|
/* @__PURE__ */ n("section", { className: "flex flex-row gap-6 justify-center items-center mb-8", children: [
|
|
5573
5582
|
/* @__PURE__ */ e(
|
|
5574
5583
|
"img",
|
|
5575
5584
|
{
|
|
5576
|
-
src:
|
|
5585
|
+
src: b.images.desktop,
|
|
5577
5586
|
alt: "Desktop View",
|
|
5578
5587
|
className: "rounded-xl border border-gray-200 w-[340px] h-[220px] object-cover"
|
|
5579
5588
|
}
|
|
@@ -5581,7 +5590,7 @@ const Kl = ({
|
|
|
5581
5590
|
/* @__PURE__ */ e(
|
|
5582
5591
|
"img",
|
|
5583
5592
|
{
|
|
5584
|
-
src:
|
|
5593
|
+
src: b.images.mobile1,
|
|
5585
5594
|
alt: "Mobile View 1",
|
|
5586
5595
|
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
5587
5596
|
}
|
|
@@ -5589,10 +5598,10 @@ const Kl = ({
|
|
|
5589
5598
|
] }),
|
|
5590
5599
|
/* @__PURE__ */ n("section", { children: [
|
|
5591
5600
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
|
|
5592
|
-
/* @__PURE__ */ e("ul", { className: "space-y-3", children:
|
|
5593
|
-
/* @__PURE__ */ e("span", { className: "font-semibold", children:
|
|
5601
|
+
/* @__PURE__ */ e("ul", { className: "space-y-3", children: b.features.map((S, O) => /* @__PURE__ */ n("li", { children: [
|
|
5602
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: S.title }),
|
|
5594
5603
|
/* @__PURE__ */ e("br", {}),
|
|
5595
|
-
/* @__PURE__ */ e("span", { className: "text-gray-700", children:
|
|
5604
|
+
/* @__PURE__ */ e("span", { className: "text-gray-700", children: S.description })
|
|
5596
5605
|
] }, O)) })
|
|
5597
5606
|
] })
|
|
5598
5607
|
] });
|
|
@@ -5602,8 +5611,8 @@ const Kl = ({
|
|
|
5602
5611
|
Un,
|
|
5603
5612
|
{
|
|
5604
5613
|
heading: d.heading,
|
|
5605
|
-
subHeading:
|
|
5606
|
-
breadcrumbItems:
|
|
5614
|
+
subHeading: p.length > 0 ? void 0 : d.subHeading,
|
|
5615
|
+
breadcrumbItems: p,
|
|
5607
5616
|
isLeftArrow: d.isLeftArrow,
|
|
5608
5617
|
onBackClick: d.onBackClick
|
|
5609
5618
|
}
|
|
@@ -5613,25 +5622,25 @@ const Kl = ({
|
|
|
5613
5622
|
/* @__PURE__ */ n("div", { className: "flex flex-col min-w-0", children: [
|
|
5614
5623
|
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: j.heading }),
|
|
5615
5624
|
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: j.subHeading }),
|
|
5616
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: j.tags && j.tags.map((
|
|
5625
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: j.tags && j.tags.map((b, S) => /* @__PURE__ */ e(
|
|
5617
5626
|
"span",
|
|
5618
5627
|
{
|
|
5619
5628
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
5620
|
-
children:
|
|
5629
|
+
children: b
|
|
5621
5630
|
},
|
|
5622
|
-
|
|
5631
|
+
S
|
|
5623
5632
|
)) })
|
|
5624
5633
|
] })
|
|
5625
5634
|
] }),
|
|
5626
5635
|
/* @__PURE__ */ n("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
|
|
5627
|
-
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((
|
|
5636
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((b, S) => /* @__PURE__ */ e(
|
|
5628
5637
|
"button",
|
|
5629
5638
|
{
|
|
5630
|
-
onClick: () => l(
|
|
5631
|
-
className: `${i ===
|
|
5632
|
-
children:
|
|
5639
|
+
onClick: () => l(S),
|
|
5640
|
+
className: `${i === S ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
|
|
5641
|
+
children: b.label
|
|
5633
5642
|
},
|
|
5634
|
-
|
|
5643
|
+
S
|
|
5635
5644
|
)) }) }),
|
|
5636
5645
|
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: q[i].content })
|
|
5637
5646
|
] }),
|
|
@@ -5639,7 +5648,7 @@ const Kl = ({
|
|
|
5639
5648
|
Ln,
|
|
5640
5649
|
{
|
|
5641
5650
|
isOpen: m,
|
|
5642
|
-
onClose:
|
|
5651
|
+
onClose: F,
|
|
5643
5652
|
variant: "warning",
|
|
5644
5653
|
title: "Are you sure you want to cancel?",
|
|
5645
5654
|
primaryButtonText: "Yes",
|
|
@@ -5658,12 +5667,12 @@ const Kl = ({
|
|
|
5658
5667
|
allowReorder: o = !0,
|
|
5659
5668
|
initialData: u = null
|
|
5660
5669
|
}) => {
|
|
5661
|
-
const [h, N] = B(null), [y, r] = B(""), [v, d] = B(() => Array.isArray(u) ? u : []), [
|
|
5662
|
-
|
|
5670
|
+
const [h, N] = B(null), [y, r] = B(""), [v, d] = B(() => Array.isArray(u) ? u : []), [p, z] = B(null), [F, E] = B(null), [I, P] = B("");
|
|
5671
|
+
Z(() => {
|
|
5663
5672
|
Array.isArray(u) && d(u);
|
|
5664
5673
|
}, [u]);
|
|
5665
|
-
const j = (
|
|
5666
|
-
l && (N(
|
|
5674
|
+
const j = (g) => {
|
|
5675
|
+
l && (N(g._id), r(g.categoryName || ""));
|
|
5667
5676
|
}, U = () => {
|
|
5668
5677
|
if (!i || h !== null) return;
|
|
5669
5678
|
const w = (v.length > 0 ? Math.max(...v.map((k) => typeof k._id == "number" ? k._id : 0)) : 0) + 1;
|
|
@@ -5679,54 +5688,54 @@ const Kl = ({
|
|
|
5679
5688
|
}
|
|
5680
5689
|
]), N(w), r("");
|
|
5681
5690
|
}, Y = () => {
|
|
5682
|
-
h != null && (d((
|
|
5683
|
-
const k = !Array.isArray(u) || !u.some((T) => T._id === h) ?
|
|
5691
|
+
h != null && (d((g) => {
|
|
5692
|
+
const k = !Array.isArray(u) || !u.some((T) => T._id === h) ? g.filter((T) => T._id !== h) : g;
|
|
5684
5693
|
return a?.(k), k;
|
|
5685
5694
|
}), N(null), r(""));
|
|
5686
5695
|
}, q = () => {
|
|
5687
|
-
h == null || !y.trim() || (d((
|
|
5688
|
-
const w =
|
|
5696
|
+
h == null || !y.trim() || (d((g) => {
|
|
5697
|
+
const w = g.map((k) => k._id === h ? {
|
|
5689
5698
|
...k,
|
|
5690
5699
|
categoryName: y.trim()
|
|
5691
5700
|
} : k);
|
|
5692
5701
|
return a?.(w), w;
|
|
5693
5702
|
}), N(null), r(""));
|
|
5694
|
-
}, $ = (
|
|
5703
|
+
}, $ = (g) => {
|
|
5695
5704
|
m && d((w) => {
|
|
5696
|
-
const k = w.filter((T) => T._id !==
|
|
5705
|
+
const k = w.filter((T) => T._id !== g._id);
|
|
5697
5706
|
return a?.(k), k;
|
|
5698
5707
|
});
|
|
5699
|
-
}, x = (
|
|
5708
|
+
}, x = (g, w, k) => {
|
|
5700
5709
|
const T = Number(w), L = Number(k);
|
|
5701
|
-
if (!o || T === L) return
|
|
5702
|
-
const C =
|
|
5703
|
-
if (C === -1 || M === -1) return
|
|
5704
|
-
const _ = [...
|
|
5705
|
-
return _.splice(M, 0,
|
|
5706
|
-
},
|
|
5707
|
-
o && (
|
|
5708
|
-
},
|
|
5709
|
-
|
|
5710
|
-
}, O = (
|
|
5711
|
-
|
|
5712
|
-
},
|
|
5713
|
-
|
|
5714
|
-
const k =
|
|
5710
|
+
if (!o || T === L) return g;
|
|
5711
|
+
const C = g.findIndex((G) => Number(G._id) === T), M = g.findIndex((G) => Number(G._id) === L);
|
|
5712
|
+
if (C === -1 || M === -1) return g;
|
|
5713
|
+
const _ = [...g], [A] = _.splice(C, 1);
|
|
5714
|
+
return _.splice(M, 0, A), _.map((G, W) => ({ ...G, order: W + 1 }));
|
|
5715
|
+
}, b = (g, w) => {
|
|
5716
|
+
o && (g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/plain", String(w)), z(Number(w)));
|
|
5717
|
+
}, S = (g) => {
|
|
5718
|
+
p && g !== F && E(g);
|
|
5719
|
+
}, O = (g) => {
|
|
5720
|
+
g.preventDefault();
|
|
5721
|
+
}, R = (g, w) => {
|
|
5722
|
+
g.preventDefault();
|
|
5723
|
+
const k = g.dataTransfer.getData("text/plain"), T = k === "0" ? 0 : Number(k), L = w === "0" ? 0 : Number(w);
|
|
5715
5724
|
T === void 0 || L === void 0 || (d((C) => {
|
|
5716
5725
|
const M = x(C, T, L);
|
|
5717
5726
|
return a?.(M), M;
|
|
5718
|
-
}),
|
|
5727
|
+
}), z(null), E(null));
|
|
5719
5728
|
}, D = () => {
|
|
5720
|
-
|
|
5721
|
-
},
|
|
5722
|
-
(
|
|
5729
|
+
z(null), E(null);
|
|
5730
|
+
}, f = Array.isArray(v) ? v.filter(
|
|
5731
|
+
(g) => g.categoryName?.toLowerCase().includes(I.toLowerCase())
|
|
5723
5732
|
) : [];
|
|
5724
5733
|
return /* @__PURE__ */ n("div", { className: `manage-collection-list ${t}`, children: [
|
|
5725
5734
|
/* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ n("div", { className: "w-1/2 flex justify-end", children: [
|
|
5726
5735
|
s && /* @__PURE__ */ e(
|
|
5727
5736
|
ge,
|
|
5728
5737
|
{
|
|
5729
|
-
value:
|
|
5738
|
+
value: I,
|
|
5730
5739
|
onDebouncedChange: P,
|
|
5731
5740
|
placeholder: "Search Collection",
|
|
5732
5741
|
customClass: "mr-4 searchmanagecollection"
|
|
@@ -5745,14 +5754,14 @@ const Kl = ({
|
|
|
5745
5754
|
}
|
|
5746
5755
|
)
|
|
5747
5756
|
] }) }),
|
|
5748
|
-
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children:
|
|
5749
|
-
const w = h ===
|
|
5757
|
+
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: f.map((g) => {
|
|
5758
|
+
const w = h === g._id, k = g?.links?.length ?? 0, T = p === g._id, L = F === g._id && p !== g._id;
|
|
5750
5759
|
return /* @__PURE__ */ e(
|
|
5751
5760
|
"div",
|
|
5752
5761
|
{
|
|
5753
|
-
onDragEnter: () =>
|
|
5762
|
+
onDragEnter: () => S(g._id),
|
|
5754
5763
|
onDragOver: O,
|
|
5755
|
-
onDrop: (C) =>
|
|
5764
|
+
onDrop: (C) => R(C, g._id),
|
|
5756
5765
|
onDragEnd: D,
|
|
5757
5766
|
className: [
|
|
5758
5767
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
@@ -5760,14 +5769,14 @@ const Kl = ({
|
|
|
5760
5769
|
L ? "ring-2 ring-gray-800/20" : "",
|
|
5761
5770
|
T ? "opacity-60" : ""
|
|
5762
5771
|
].join(" "),
|
|
5763
|
-
children: w ? /* @__PURE__ */ n(
|
|
5772
|
+
children: w ? /* @__PURE__ */ n(te, { children: [
|
|
5764
5773
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
5765
5774
|
"input",
|
|
5766
5775
|
{
|
|
5767
5776
|
type: "text",
|
|
5768
5777
|
className: "flex-1 h-10 px-3 max-w-[200px] border border-gray-300 rounded-2xl outline-none focus:ring-2 focus:ring-gray-800/20",
|
|
5769
5778
|
value: y,
|
|
5770
|
-
placeholder: !Array.isArray(u) || !u.some((C) => C._id ===
|
|
5779
|
+
placeholder: !Array.isArray(u) || !u.some((C) => C._id === g._id) ? "New collection name" : "Edit collection name",
|
|
5771
5780
|
onChange: (C) => r(C.target.value),
|
|
5772
5781
|
onKeyDown: (C) => {
|
|
5773
5782
|
C.key === "Enter" && q(), C.key === "Escape" && Y();
|
|
@@ -5800,7 +5809,7 @@ const Kl = ({
|
|
|
5800
5809
|
}
|
|
5801
5810
|
)
|
|
5802
5811
|
] })
|
|
5803
|
-
] }) : /* @__PURE__ */ n(
|
|
5812
|
+
] }) : /* @__PURE__ */ n(te, { children: [
|
|
5804
5813
|
/* @__PURE__ */ n("div", { className: "flex gap-2 items-center", children: [
|
|
5805
5814
|
o && /* @__PURE__ */ e(
|
|
5806
5815
|
"span",
|
|
@@ -5809,42 +5818,42 @@ const Kl = ({
|
|
|
5809
5818
|
"aria-label": "Drag to reorder",
|
|
5810
5819
|
className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
|
|
5811
5820
|
draggable: !0,
|
|
5812
|
-
onDragStart: (C) =>
|
|
5821
|
+
onDragStart: (C) => b(C, g._id),
|
|
5813
5822
|
children: /* @__PURE__ */ e(wt, {})
|
|
5814
5823
|
}
|
|
5815
5824
|
),
|
|
5816
|
-
/* @__PURE__ */ e("span", { children:
|
|
5825
|
+
/* @__PURE__ */ e("span", { children: g.categoryName })
|
|
5817
5826
|
] }),
|
|
5818
5827
|
/* @__PURE__ */ n("div", { className: "flex gap-2 items-center", children: [
|
|
5819
|
-
|
|
5828
|
+
g.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: g.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${k} ${k === 1 ? "link" : "links"}` }),
|
|
5820
5829
|
l && /* @__PURE__ */ e(
|
|
5821
5830
|
"button",
|
|
5822
5831
|
{
|
|
5823
5832
|
className: "cursor-pointer",
|
|
5824
|
-
onClick: () => j(
|
|
5825
|
-
"aria-label": `Edit ${
|
|
5833
|
+
onClick: () => j(g),
|
|
5834
|
+
"aria-label": `Edit ${g.categoryName}`,
|
|
5826
5835
|
children: /* @__PURE__ */ e(xr, { color: "#767676" })
|
|
5827
5836
|
}
|
|
5828
5837
|
),
|
|
5829
5838
|
m && /* @__PURE__ */ e(
|
|
5830
5839
|
"span",
|
|
5831
5840
|
{
|
|
5832
|
-
className: k === 0 && !
|
|
5833
|
-
title: k === 0 && !
|
|
5834
|
-
onClick: k === 0 ? () => $(
|
|
5841
|
+
className: k === 0 && !g.protected ? "cursor-pointer" : "cursor-not-allowed",
|
|
5842
|
+
title: k === 0 && !g.protected ? "Delete" : "Cannot delete a collection with linked items",
|
|
5843
|
+
onClick: k === 0 ? () => $(g) : null,
|
|
5835
5844
|
children: /* @__PURE__ */ e(Le, { color: k === 0 ? "#767676" : "#C2C2C2" })
|
|
5836
5845
|
}
|
|
5837
5846
|
)
|
|
5838
5847
|
] })
|
|
5839
5848
|
] })
|
|
5840
5849
|
},
|
|
5841
|
-
|
|
5850
|
+
g._id
|
|
5842
5851
|
);
|
|
5843
5852
|
}) })
|
|
5844
5853
|
] });
|
|
5845
5854
|
};
|
|
5846
5855
|
function ei({ children: t }) {
|
|
5847
|
-
return /* @__PURE__ */ n(
|
|
5856
|
+
return /* @__PURE__ */ n(te, { children: [
|
|
5848
5857
|
t,
|
|
5849
5858
|
/* @__PURE__ */ e(
|
|
5850
5859
|
nn,
|
|
@@ -5931,12 +5940,12 @@ const Bt = () => {
|
|
|
5931
5940
|
showFilter: r = !1,
|
|
5932
5941
|
showPrint: v = !1,
|
|
5933
5942
|
showExcel: d = !1,
|
|
5934
|
-
showPdf:
|
|
5935
|
-
showRefresh:
|
|
5936
|
-
showAdd:
|
|
5937
|
-
iSelectedRecords:
|
|
5943
|
+
showPdf: p = !1,
|
|
5944
|
+
showRefresh: z = !1,
|
|
5945
|
+
showAdd: F = !1,
|
|
5946
|
+
iSelectedRecords: E = 0,
|
|
5938
5947
|
// Additional props
|
|
5939
|
-
searchPlaceholder:
|
|
5948
|
+
searchPlaceholder: I = "Search...",
|
|
5940
5949
|
handleRefreshClick: P = () => {
|
|
5941
5950
|
},
|
|
5942
5951
|
handleSearchChange: j = () => {
|
|
@@ -5948,19 +5957,19 @@ const Bt = () => {
|
|
|
5948
5957
|
pdfFileName: q,
|
|
5949
5958
|
searchIconSize: $,
|
|
5950
5959
|
searchIconClass: x,
|
|
5951
|
-
inputStyle:
|
|
5960
|
+
inputStyle: b
|
|
5952
5961
|
}) => {
|
|
5953
|
-
const
|
|
5962
|
+
const S = () => l?.current || i?.current, [O, R] = re.useState(""), D = (t || "export").toString().trim() || "export", f = `${Y || D}.xlsx`, g = `${q || D}.pdf`, w = (L, C, M) => Math.max(C, Math.min(L, M)), k = ee(
|
|
5954
5963
|
(L) => {
|
|
5955
|
-
const C =
|
|
5964
|
+
const C = S();
|
|
5956
5965
|
if (C?.openColumnChooser) {
|
|
5957
5966
|
if (typeof window > "u" || !L?.currentTarget) {
|
|
5958
5967
|
C.openColumnChooser();
|
|
5959
5968
|
return;
|
|
5960
5969
|
}
|
|
5961
5970
|
try {
|
|
5962
|
-
const M = L.currentTarget.getBoundingClientRect(), _ = M.left + window.scrollX,
|
|
5963
|
-
let G = _ - 120, W =
|
|
5971
|
+
const M = L.currentTarget.getBoundingClientRect(), _ = M.left + window.scrollX, A = M.bottom + window.scrollY;
|
|
5972
|
+
let G = _ - 120, W = A - 120;
|
|
5964
5973
|
const pe = window.innerWidth, Ne = window.innerHeight;
|
|
5965
5974
|
G = w(G, window.scrollX + 8, window.scrollX + pe - 340), W = w(W, window.scrollY, window.scrollY + Ne - 120), C.openColumnChooser(G, W);
|
|
5966
5975
|
} catch (M) {
|
|
@@ -5970,9 +5979,9 @@ const Bt = () => {
|
|
|
5970
5979
|
},
|
|
5971
5980
|
[]
|
|
5972
5981
|
// no external deps; reads ref at call time
|
|
5973
|
-
), T =
|
|
5982
|
+
), T = ee(
|
|
5974
5983
|
(L, C) => {
|
|
5975
|
-
const M =
|
|
5984
|
+
const M = S();
|
|
5976
5985
|
if (M)
|
|
5977
5986
|
switch (L) {
|
|
5978
5987
|
case "Delete": {
|
|
@@ -5989,17 +5998,17 @@ const Bt = () => {
|
|
|
5989
5998
|
v && M.print?.();
|
|
5990
5999
|
break;
|
|
5991
6000
|
case "Excel":
|
|
5992
|
-
d && M.excelExport?.({ fileName:
|
|
6001
|
+
d && M.excelExport?.({ fileName: f });
|
|
5993
6002
|
break;
|
|
5994
6003
|
case "Pdf":
|
|
5995
|
-
|
|
6004
|
+
p && M.pdfExport?.({ fileName: g });
|
|
5996
6005
|
break;
|
|
5997
6006
|
case "Refresh":
|
|
5998
|
-
|
|
6007
|
+
z && P();
|
|
5999
6008
|
break;
|
|
6000
6009
|
}
|
|
6001
6010
|
},
|
|
6002
|
-
[y, v, d,
|
|
6011
|
+
[y, v, d, p, z, f, g, P, k]
|
|
6003
6012
|
);
|
|
6004
6013
|
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: [
|
|
6005
6014
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
@@ -6014,14 +6023,14 @@ const Bt = () => {
|
|
|
6014
6023
|
h && /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
|
|
6015
6024
|
ge,
|
|
6016
6025
|
{
|
|
6017
|
-
placeholder:
|
|
6026
|
+
placeholder: I,
|
|
6018
6027
|
value: O,
|
|
6019
6028
|
onDebouncedChange: (L) => {
|
|
6020
|
-
|
|
6029
|
+
R(L), j(L);
|
|
6021
6030
|
},
|
|
6022
6031
|
searchIconSize: $ || 16,
|
|
6023
6032
|
searchIconClass: x || "",
|
|
6024
|
-
inputStyle:
|
|
6033
|
+
inputStyle: b || { paddingTop: "4px", paddingBottom: "4px" }
|
|
6025
6034
|
}
|
|
6026
6035
|
) }),
|
|
6027
6036
|
/* @__PURE__ */ n("div", { className: "flex gap-3", children: [
|
|
@@ -6032,7 +6041,7 @@ const Bt = () => {
|
|
|
6032
6041
|
icon: Le,
|
|
6033
6042
|
onClick: () => T("Delete"),
|
|
6034
6043
|
ariaLabel: "Delete",
|
|
6035
|
-
disabled:
|
|
6044
|
+
disabled: E === 0
|
|
6036
6045
|
}
|
|
6037
6046
|
),
|
|
6038
6047
|
y && /* @__PURE__ */ e(
|
|
@@ -6067,7 +6076,7 @@ const Bt = () => {
|
|
|
6067
6076
|
ariaLabel: "Excel Download"
|
|
6068
6077
|
}
|
|
6069
6078
|
),
|
|
6070
|
-
|
|
6079
|
+
p && /* @__PURE__ */ e(
|
|
6071
6080
|
Ce,
|
|
6072
6081
|
{
|
|
6073
6082
|
icon: Cr,
|
|
@@ -6075,7 +6084,7 @@ const Bt = () => {
|
|
|
6075
6084
|
ariaLabel: "PDF Download"
|
|
6076
6085
|
}
|
|
6077
6086
|
),
|
|
6078
|
-
|
|
6087
|
+
z && /* @__PURE__ */ e(
|
|
6079
6088
|
Ce,
|
|
6080
6089
|
{
|
|
6081
6090
|
icon: zr,
|
|
@@ -6084,7 +6093,7 @@ const Bt = () => {
|
|
|
6084
6093
|
}
|
|
6085
6094
|
)
|
|
6086
6095
|
] }),
|
|
6087
|
-
|
|
6096
|
+
F && m && /* @__PURE__ */ e(
|
|
6088
6097
|
le,
|
|
6089
6098
|
{
|
|
6090
6099
|
label: u,
|
|
@@ -6115,11 +6124,11 @@ function ai(t) {
|
|
|
6115
6124
|
allowResizing: r = !0,
|
|
6116
6125
|
allowExcelExport: v = !1,
|
|
6117
6126
|
allowPdfExport: d = !1,
|
|
6118
|
-
showColumnChooser:
|
|
6119
|
-
enableSearchApi:
|
|
6120
|
-
height:
|
|
6121
|
-
selectionSettings:
|
|
6122
|
-
enableCheckbox:
|
|
6127
|
+
showColumnChooser: p = !1,
|
|
6128
|
+
enableSearchApi: z = !1,
|
|
6129
|
+
height: F = "600",
|
|
6130
|
+
selectionSettings: E,
|
|
6131
|
+
enableCheckbox: I = !1,
|
|
6123
6132
|
columns: P = [],
|
|
6124
6133
|
onGridStateChange: j,
|
|
6125
6134
|
onRowSelected: U,
|
|
@@ -6127,16 +6136,16 @@ function ai(t) {
|
|
|
6127
6136
|
onRowDoubleClick: q,
|
|
6128
6137
|
apiRef: $,
|
|
6129
6138
|
gridProps: x = {}
|
|
6130
|
-
} = t,
|
|
6131
|
-
pageSettings:
|
|
6139
|
+
} = t, b = fe(null), {
|
|
6140
|
+
pageSettings: S,
|
|
6132
6141
|
sortSettings: O,
|
|
6133
|
-
...
|
|
6134
|
-
} = x || {}, [D,
|
|
6135
|
-
const V =
|
|
6142
|
+
...R
|
|
6143
|
+
} = x || {}, [D, f] = re.useState(S?.page || l), [g, w] = re.useState(S?.pageSize || m), [k, T] = re.useState(O?.sortKey || "updatedDate"), [L, C] = re.useState(O?.direction || "Descending"), M = ae(() => {
|
|
6144
|
+
const V = E || {
|
|
6136
6145
|
type: "Multiple",
|
|
6137
6146
|
mode: "Row"
|
|
6138
6147
|
};
|
|
6139
|
-
return
|
|
6148
|
+
return I ? {
|
|
6140
6149
|
...V,
|
|
6141
6150
|
// These are important for checkbox selection
|
|
6142
6151
|
enableToggle: !0,
|
|
@@ -6145,23 +6154,23 @@ function ai(t) {
|
|
|
6145
6154
|
checkboxOnly: !1,
|
|
6146
6155
|
enableSimpleMultiRowSelection: !0
|
|
6147
6156
|
} : V;
|
|
6148
|
-
}, [
|
|
6157
|
+
}, [E, I]), _ = ae(() => {
|
|
6149
6158
|
const V = [ln];
|
|
6150
|
-
return (
|
|
6159
|
+
return (I || E) && V.push(on), u && V.push(cn), h && V.push(dn), N && V.push(mn), z && V.push(un), v && V.push(hn), d && V.push(pn), p && V.push(gn), r && V.push(bn), y && V.push(fn), V.push(yn), V;
|
|
6151
6160
|
}, [
|
|
6152
6161
|
u,
|
|
6153
6162
|
h,
|
|
6154
6163
|
N,
|
|
6155
|
-
|
|
6164
|
+
z,
|
|
6156
6165
|
v,
|
|
6157
6166
|
d,
|
|
6158
|
-
|
|
6167
|
+
p,
|
|
6159
6168
|
r,
|
|
6160
6169
|
y,
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
]),
|
|
6164
|
-
const V = () =>
|
|
6170
|
+
I,
|
|
6171
|
+
E
|
|
6172
|
+
]), A = ae(() => {
|
|
6173
|
+
const V = () => b.current, ne = (J, ce) => {
|
|
6165
6174
|
!ce && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${J} requested but related service/feature is disabled.`);
|
|
6166
6175
|
};
|
|
6167
6176
|
return {
|
|
@@ -6172,7 +6181,7 @@ function ai(t) {
|
|
|
6172
6181
|
selectRow: (J, ce = !1) => V()?.selectRow?.(J, ce),
|
|
6173
6182
|
selectRows: (J, ce = !1) => V()?.selectRows?.(J, ce),
|
|
6174
6183
|
search: (J) => {
|
|
6175
|
-
ne("search()",
|
|
6184
|
+
ne("search()", z), V()?.search?.(J);
|
|
6176
6185
|
},
|
|
6177
6186
|
print: () => V()?.print?.(),
|
|
6178
6187
|
excelExport: (J) => {
|
|
@@ -6182,24 +6191,24 @@ function ai(t) {
|
|
|
6182
6191
|
ne("pdfExport()", d), V()?.pdfExport?.(J);
|
|
6183
6192
|
},
|
|
6184
6193
|
openColumnChooser: (J, ce) => {
|
|
6185
|
-
ne("openColumnChooser()",
|
|
6194
|
+
ne("openColumnChooser()", p), V()?.columnChooserModule?.openColumnChooser?.(J, ce);
|
|
6186
6195
|
},
|
|
6187
6196
|
// Additional useful methods
|
|
6188
6197
|
getColumns: () => V()?.getColumns?.(),
|
|
6189
6198
|
getFilteredRecords: () => V()?.getFilteredRecords?.(),
|
|
6190
6199
|
autoFitColumns: (J) => V()?.autoFitColumns?.(J)
|
|
6191
6200
|
};
|
|
6192
|
-
}, [
|
|
6193
|
-
|
|
6194
|
-
$ && ($.current =
|
|
6195
|
-
}, [$,
|
|
6201
|
+
}, [z, v, d, p]);
|
|
6202
|
+
Z(() => {
|
|
6203
|
+
$ && ($.current = A);
|
|
6204
|
+
}, [$, A]), Z(() => () => {
|
|
6196
6205
|
$ && ($.current = null);
|
|
6197
6206
|
}, [$]);
|
|
6198
6207
|
const G = (V) => {
|
|
6199
6208
|
const ne = String(V || "");
|
|
6200
6209
|
return ne === "Ascending" || ne === "Descending" ? ne : ne.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
6201
6210
|
}, W = (V) => {
|
|
6202
|
-
const ne =
|
|
6211
|
+
const ne = b.current, J = V?.requestType, ce = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Re = V?.pageSize ?? ne?.pageSettings?.pageSize ?? g, _e = V?.currentPage ?? ne?.pageSettings?.currentPage ?? l, rt = V?.columnName && V?.direction ? [{ field: V.columnName, dir: G(V.direction) }] : (ne?.sortSettings?.columns || []).map((Ie) => ({
|
|
6203
6212
|
field: Ie.field,
|
|
6204
6213
|
dir: G(Ie.direction ?? Ie.dir)
|
|
6205
6214
|
})), nt = V?.searchString ?? "", st = V?.columns ?? ne?.filterSettings?.columns ?? [];
|
|
@@ -6218,13 +6227,13 @@ function ai(t) {
|
|
|
6218
6227
|
};
|
|
6219
6228
|
}, pe = (V) => {
|
|
6220
6229
|
setTimeout(() => {
|
|
6221
|
-
|
|
6222
|
-
}, 1e3), V.requestType === "paging" && (
|
|
6230
|
+
b?.current?.hideSpinner();
|
|
6231
|
+
}, 1e3), V.requestType === "paging" && (f(V.currentPage), w(V.pageSize)), V.requestType === "sorting" && (T(V.columnName || "updatedDate"), C(V.direction)), j?.(W(V), V);
|
|
6223
6232
|
}, Ne = (V) => {
|
|
6224
6233
|
q?.(V?.rowData, V);
|
|
6225
6234
|
}, Ta = () => {
|
|
6226
6235
|
const V = [];
|
|
6227
|
-
return
|
|
6236
|
+
return I && V.push(
|
|
6228
6237
|
/* @__PURE__ */ e(
|
|
6229
6238
|
$t,
|
|
6230
6239
|
{
|
|
@@ -6283,10 +6292,10 @@ function ai(t) {
|
|
|
6283
6292
|
}), V;
|
|
6284
6293
|
}, Aa = ae(() => ({
|
|
6285
6294
|
currentPage: D,
|
|
6286
|
-
pageSize:
|
|
6287
|
-
pageSizes:
|
|
6295
|
+
pageSize: g,
|
|
6296
|
+
pageSizes: S?.pageSizes ?? [10, 20, 40, 60, 80, 100],
|
|
6288
6297
|
totalCount: s
|
|
6289
|
-
}), [D,
|
|
6298
|
+
}), [D, g, S?.pageSizes, s]), Fa = ae(() => O ?? {
|
|
6290
6299
|
columns: [{ field: k, direction: G(L) }],
|
|
6291
6300
|
allowUnsort: !1
|
|
6292
6301
|
}, [O, k, L]);
|
|
@@ -6294,19 +6303,19 @@ function ai(t) {
|
|
|
6294
6303
|
xn,
|
|
6295
6304
|
{
|
|
6296
6305
|
id: i,
|
|
6297
|
-
ref:
|
|
6306
|
+
ref: b,
|
|
6298
6307
|
dataSource: {
|
|
6299
6308
|
result: a,
|
|
6300
6309
|
count: s
|
|
6301
6310
|
},
|
|
6302
|
-
height:
|
|
6311
|
+
height: F,
|
|
6303
6312
|
allowPaging: o,
|
|
6304
6313
|
allowSorting: u,
|
|
6305
6314
|
allowFiltering: h,
|
|
6306
6315
|
allowGrouping: N,
|
|
6307
6316
|
allowReordering: y,
|
|
6308
6317
|
allowResizing: r,
|
|
6309
|
-
showColumnChooser:
|
|
6318
|
+
showColumnChooser: p,
|
|
6310
6319
|
selectionSettings: M,
|
|
6311
6320
|
pageSettings: Aa,
|
|
6312
6321
|
sortSettings: Fa,
|
|
@@ -6315,7 +6324,7 @@ function ai(t) {
|
|
|
6315
6324
|
rowDeselected: Y,
|
|
6316
6325
|
recordDoubleClick: Ne,
|
|
6317
6326
|
cssClass: "custom-grid-padding",
|
|
6318
|
-
...
|
|
6327
|
+
...R,
|
|
6319
6328
|
children: [
|
|
6320
6329
|
/* @__PURE__ */ e(vn, { children: Ta() }),
|
|
6321
6330
|
/* @__PURE__ */ e(Nn, { services: _ })
|
|
@@ -6410,11 +6419,11 @@ function Ts({
|
|
|
6410
6419
|
// spread remaining props (_id, instanceId, etc.)
|
|
6411
6420
|
...v
|
|
6412
6421
|
}) {
|
|
6413
|
-
const d = de(t),
|
|
6422
|
+
const d = de(t), p = me[d];
|
|
6414
6423
|
return /* @__PURE__ */ n(
|
|
6415
6424
|
oe,
|
|
6416
6425
|
{
|
|
6417
|
-
className: `flex flex-col ${
|
|
6426
|
+
className: `flex flex-col ${p.card}`,
|
|
6418
6427
|
showCheckbox: a,
|
|
6419
6428
|
checkboxPosition: s,
|
|
6420
6429
|
onSelect: i,
|
|
@@ -6422,11 +6431,11 @@ function Ts({
|
|
|
6422
6431
|
details: { type: "activity", title: m, group: o, author: h },
|
|
6423
6432
|
...v,
|
|
6424
6433
|
children: [
|
|
6425
|
-
/* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
6426
|
-
/* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${
|
|
6434
|
+
/* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${p.title} ml-3`, children: m }) }),
|
|
6435
|
+
/* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${p.meta}`, children: [
|
|
6427
6436
|
"Posted in ",
|
|
6428
6437
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Global" }),
|
|
6429
|
-
u ? /* @__PURE__ */ n(
|
|
6438
|
+
u ? /* @__PURE__ */ n(te, { children: [
|
|
6430
6439
|
",",
|
|
6431
6440
|
" ",
|
|
6432
6441
|
/* @__PURE__ */ e(
|
|
@@ -6444,7 +6453,7 @@ function Ts({
|
|
|
6444
6453
|
/* @__PURE__ */ e(we, { name: "John", size: "medium" }),
|
|
6445
6454
|
/* @__PURE__ */ n("div", { className: "leading-tight", children: [
|
|
6446
6455
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-100", children: h }),
|
|
6447
|
-
/* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${
|
|
6456
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${p.meta}`, children: N })
|
|
6448
6457
|
] })
|
|
6449
6458
|
] }),
|
|
6450
6459
|
/* @__PURE__ */ n("p", { className: "mt-2 text-zinc-700 dark:text-zinc-300", children: [
|
|
@@ -6461,7 +6470,7 @@ function Ts({
|
|
|
6461
6470
|
/* @__PURE__ */ e(
|
|
6462
6471
|
"div",
|
|
6463
6472
|
{
|
|
6464
|
-
className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${
|
|
6473
|
+
className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${p.media}`,
|
|
6465
6474
|
children: /* @__PURE__ */ e("img", { src: y, alt: "", className: "h-full w-full object-cover" })
|
|
6466
6475
|
}
|
|
6467
6476
|
),
|
|
@@ -6835,23 +6844,23 @@ function _s({
|
|
|
6835
6844
|
// optional full embed URL override
|
|
6836
6845
|
...v
|
|
6837
6846
|
}) {
|
|
6838
|
-
const d = de(t),
|
|
6847
|
+
const d = de(t), p = me[d], z = Bs[d], F = r || js(N, y);
|
|
6839
6848
|
return /* @__PURE__ */ e(
|
|
6840
6849
|
oe,
|
|
6841
6850
|
{
|
|
6842
|
-
className: `flex flex-col ${
|
|
6851
|
+
className: `flex flex-col ${p.card} ${z.wrap}`,
|
|
6843
6852
|
showCheckbox: a,
|
|
6844
6853
|
checkboxPosition: s,
|
|
6845
6854
|
onSelect: i,
|
|
6846
6855
|
identity: l,
|
|
6847
6856
|
details: { type: "campus-map", title: m, campusName: o, activeFilter: h, mapQuery: N, zoom: y },
|
|
6848
6857
|
...v,
|
|
6849
|
-
children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${
|
|
6858
|
+
children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${z.mapH}`, children: [
|
|
6850
6859
|
/* @__PURE__ */ e(
|
|
6851
6860
|
"iframe",
|
|
6852
6861
|
{
|
|
6853
6862
|
title: "Google Map",
|
|
6854
|
-
src:
|
|
6863
|
+
src: F,
|
|
6855
6864
|
className: "h-full w-full",
|
|
6856
6865
|
style: { border: 0 },
|
|
6857
6866
|
loading: "lazy",
|
|
@@ -6860,7 +6869,7 @@ function _s({
|
|
|
6860
6869
|
}
|
|
6861
6870
|
),
|
|
6862
6871
|
/* @__PURE__ */ n("div", { className: "absolute left-4 right-4 top-3 flex items-center justify-between pointer-events-none", children: [
|
|
6863
|
-
/* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${
|
|
6872
|
+
/* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${z.campusPill}`, children: [
|
|
6864
6873
|
/* @__PURE__ */ e("span", { className: "truncate max-w-[60vw]", children: o }),
|
|
6865
6874
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-400", children: "▾" })
|
|
6866
6875
|
] }),
|
|
@@ -6869,8 +6878,8 @@ function _s({
|
|
|
6869
6878
|
/* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-full bg-white/90 border border-zinc-300 flex items-center justify-center", children: "›" })
|
|
6870
6879
|
] })
|
|
6871
6880
|
] }),
|
|
6872
|
-
/* @__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 ${
|
|
6873
|
-
/* @__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 ${
|
|
6881
|
+
/* @__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 ${z.chipGap} overflow-x-auto scrollbar-none`, children: u.map((E) => /* @__PURE__ */ e(Vs, { label: E, active: E === h, size: d }, E)) }) }),
|
|
6882
|
+
/* @__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 ${z.searchH}`, children: [
|
|
6874
6883
|
/* @__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" }) }),
|
|
6875
6884
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-500 dark:text-zinc-400", children: "Search places" })
|
|
6876
6885
|
] }) })
|
|
@@ -7041,9 +7050,9 @@ function Ws({
|
|
|
7041
7050
|
selectedIndex: u = 0,
|
|
7042
7051
|
...h
|
|
7043
7052
|
}) {
|
|
7044
|
-
const [N, y] = B(u), r = de(t), v = me[r], d = Gs[r],
|
|
7045
|
-
y(
|
|
7046
|
-
},
|
|
7053
|
+
const [N, y] = B(u), r = de(t), v = me[r], d = Gs[r], p = o[N] || o[0], z = (E, I) => {
|
|
7054
|
+
y(I), i?.(E);
|
|
7055
|
+
}, F = r === "lg";
|
|
7047
7056
|
return /* @__PURE__ */ n(
|
|
7048
7057
|
oe,
|
|
7049
7058
|
{
|
|
@@ -7059,35 +7068,35 @@ function Ws({
|
|
|
7059
7068
|
/* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: m }),
|
|
7060
7069
|
/* @__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" })
|
|
7061
7070
|
] }),
|
|
7062
|
-
|
|
7071
|
+
F ? (
|
|
7063
7072
|
// Large: Two-column layout
|
|
7064
7073
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
7065
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((
|
|
7074
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7066
7075
|
_t,
|
|
7067
7076
|
{
|
|
7068
|
-
ev:
|
|
7077
|
+
ev: E,
|
|
7069
7078
|
sizeMeta: d,
|
|
7070
|
-
isSelected:
|
|
7071
|
-
onClick: (P) =>
|
|
7079
|
+
isSelected: I === N,
|
|
7080
|
+
onClick: (P) => z(P, I)
|
|
7072
7081
|
},
|
|
7073
|
-
|
|
7082
|
+
E._id || E.id || I
|
|
7074
7083
|
)) }),
|
|
7075
|
-
/* @__PURE__ */ e(Ys, { ev:
|
|
7084
|
+
/* @__PURE__ */ e(Ys, { ev: p, sizeMeta: d })
|
|
7076
7085
|
] })
|
|
7077
7086
|
) : (
|
|
7078
7087
|
// Small/Medium: Simple list only
|
|
7079
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((
|
|
7088
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7080
7089
|
_t,
|
|
7081
7090
|
{
|
|
7082
|
-
ev:
|
|
7091
|
+
ev: E,
|
|
7083
7092
|
sizeMeta: d,
|
|
7084
|
-
isSelected:
|
|
7085
|
-
onClick: (P) =>
|
|
7093
|
+
isSelected: I === N,
|
|
7094
|
+
onClick: (P) => z(P, I)
|
|
7086
7095
|
},
|
|
7087
|
-
|
|
7096
|
+
E._id || E.id || I
|
|
7088
7097
|
)) })
|
|
7089
7098
|
),
|
|
7090
|
-
!
|
|
7099
|
+
!F && /* @__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" }) })
|
|
7091
7100
|
]
|
|
7092
7101
|
}
|
|
7093
7102
|
);
|
|
@@ -7258,19 +7267,19 @@ function Qs({
|
|
|
7258
7267
|
onPin: N,
|
|
7259
7268
|
...y
|
|
7260
7269
|
}) {
|
|
7261
|
-
const [r, v] = B(u), d = de(t),
|
|
7270
|
+
const [r, v] = B(u), d = de(t), p = me[d], z = Xs[d], F = (P, j) => {
|
|
7262
7271
|
v(j), i?.(P);
|
|
7263
|
-
},
|
|
7272
|
+
}, E = (P) => {
|
|
7264
7273
|
const j = { ...P, starred: !P.starred };
|
|
7265
7274
|
h?.(j);
|
|
7266
|
-
},
|
|
7275
|
+
}, I = (P) => {
|
|
7267
7276
|
const j = { ...P, pinned: !P.pinned };
|
|
7268
7277
|
N?.(j);
|
|
7269
7278
|
};
|
|
7270
7279
|
return /* @__PURE__ */ n(
|
|
7271
7280
|
oe,
|
|
7272
7281
|
{
|
|
7273
|
-
className: `flex flex-col ${
|
|
7282
|
+
className: `flex flex-col ${p.card} ${z.wrap}`,
|
|
7274
7283
|
showCheckbox: a,
|
|
7275
7284
|
checkboxPosition: s,
|
|
7276
7285
|
onSelect: i,
|
|
@@ -7278,17 +7287,17 @@ function Qs({
|
|
|
7278
7287
|
details: { type: "emails", title: m, count: o?.length ?? 0 },
|
|
7279
7288
|
...y,
|
|
7280
7289
|
children: [
|
|
7281
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${
|
|
7290
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${p.title}`, children: m }) }),
|
|
7282
7291
|
/* @__PURE__ */ e(ge, { placeholder: "Type to search..." }),
|
|
7283
7292
|
/* @__PURE__ */ e("div", { className: "space-y-0", children: o.map((P, j) => /* @__PURE__ */ e(
|
|
7284
7293
|
Hs,
|
|
7285
7294
|
{
|
|
7286
7295
|
email: P,
|
|
7287
|
-
sizeMeta:
|
|
7296
|
+
sizeMeta: z,
|
|
7288
7297
|
isSelected: j === r,
|
|
7289
|
-
onClick: (U) =>
|
|
7290
|
-
onStar:
|
|
7291
|
-
onPin:
|
|
7298
|
+
onClick: (U) => F(U, j),
|
|
7299
|
+
onStar: E,
|
|
7300
|
+
onPin: I
|
|
7292
7301
|
},
|
|
7293
7302
|
P._id || P.id || j
|
|
7294
7303
|
)) }),
|
|
@@ -7510,9 +7519,9 @@ function al({
|
|
|
7510
7519
|
selectedIndex: u = 0,
|
|
7511
7520
|
...h
|
|
7512
7521
|
}) {
|
|
7513
|
-
const [N, y] = B(u), r = de(t), v = me[r], d = Ks[r],
|
|
7514
|
-
y(
|
|
7515
|
-
},
|
|
7522
|
+
const [N, y] = B(u), r = de(t), v = me[r], d = Ks[r], p = (E, I) => {
|
|
7523
|
+
y(I), i?.(E);
|
|
7524
|
+
}, z = o[N] || o[0], F = d.layout === "split";
|
|
7516
7525
|
return /* @__PURE__ */ n(
|
|
7517
7526
|
oe,
|
|
7518
7527
|
{
|
|
@@ -7526,35 +7535,35 @@ function al({
|
|
|
7526
7535
|
children: [
|
|
7527
7536
|
/* @__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 ${v.title}`, children: m }) }),
|
|
7528
7537
|
/* @__PURE__ */ e(tl, { sizeMeta: d }),
|
|
7529
|
-
|
|
7530
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((
|
|
7538
|
+
F ? /* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0", children: [
|
|
7539
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7531
7540
|
Ut,
|
|
7532
7541
|
{
|
|
7533
|
-
contact:
|
|
7542
|
+
contact: E,
|
|
7534
7543
|
sizeMeta: d,
|
|
7535
|
-
isSelected:
|
|
7536
|
-
onClick: (P) =>
|
|
7544
|
+
isSelected: I === N,
|
|
7545
|
+
onClick: (P) => p(P, I)
|
|
7537
7546
|
},
|
|
7538
|
-
|
|
7547
|
+
E._id || E.id || I
|
|
7539
7548
|
)) }),
|
|
7540
7549
|
/* @__PURE__ */ e(
|
|
7541
7550
|
el,
|
|
7542
7551
|
{
|
|
7543
|
-
contact:
|
|
7552
|
+
contact: z,
|
|
7544
7553
|
sizeMeta: d
|
|
7545
7554
|
}
|
|
7546
7555
|
)
|
|
7547
7556
|
] }) : (
|
|
7548
7557
|
// Single column layout for small screens
|
|
7549
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((
|
|
7558
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7550
7559
|
Ut,
|
|
7551
7560
|
{
|
|
7552
|
-
contact:
|
|
7561
|
+
contact: E,
|
|
7553
7562
|
sizeMeta: d,
|
|
7554
|
-
isSelected:
|
|
7555
|
-
onClick: (P) =>
|
|
7563
|
+
isSelected: I === N,
|
|
7564
|
+
onClick: (P) => p(P, I)
|
|
7556
7565
|
},
|
|
7557
|
-
|
|
7566
|
+
E._id || E.id || I
|
|
7558
7567
|
)) })
|
|
7559
7568
|
),
|
|
7560
7569
|
/* @__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" }) })
|
|
@@ -7662,11 +7671,11 @@ function sl({
|
|
|
7662
7671
|
],
|
|
7663
7672
|
...r
|
|
7664
7673
|
}) {
|
|
7665
|
-
const v = de(t), d = me[v],
|
|
7674
|
+
const v = de(t), d = me[v], p = nl[v];
|
|
7666
7675
|
return /* @__PURE__ */ n(
|
|
7667
7676
|
oe,
|
|
7668
7677
|
{
|
|
7669
|
-
className: `flex flex-col ${d.card} ${
|
|
7678
|
+
className: `flex flex-col ${d.card} ${p.wrap}`,
|
|
7670
7679
|
showCheckbox: a,
|
|
7671
7680
|
checkboxPosition: s,
|
|
7672
7681
|
onSelect: i,
|
|
@@ -7681,11 +7690,11 @@ function sl({
|
|
|
7681
7690
|
/* @__PURE__ */ e(Nt, { className: "h-4 w-4 opacity-70" })
|
|
7682
7691
|
] })
|
|
7683
7692
|
] }),
|
|
7684
|
-
/* @__PURE__ */ n("div", { className:
|
|
7693
|
+
/* @__PURE__ */ n("div", { className: p.topGrid || p.grid, children: [
|
|
7685
7694
|
/* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
7686
7695
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Account Balance" }),
|
|
7687
|
-
/* @__PURE__ */ e("div", { className:
|
|
7688
|
-
!
|
|
7696
|
+
/* @__PURE__ */ e("div", { className: p.balance, children: Te(u) }),
|
|
7697
|
+
!p.showTxns && /* @__PURE__ */ n("div", { className: p.totalsRow, children: [
|
|
7689
7698
|
/* @__PURE__ */ n("div", { children: [
|
|
7690
7699
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
|
|
7691
7700
|
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(h) })
|
|
@@ -7696,8 +7705,8 @@ function sl({
|
|
|
7696
7705
|
] })
|
|
7697
7706
|
] })
|
|
7698
7707
|
] }),
|
|
7699
|
-
|
|
7700
|
-
/* @__PURE__ */ n("div", { className:
|
|
7708
|
+
p.showTxns && /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
7709
|
+
/* @__PURE__ */ n("div", { className: p.totalsRow, children: [
|
|
7701
7710
|
/* @__PURE__ */ n("div", { children: [
|
|
7702
7711
|
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
|
|
7703
7712
|
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(h) })
|
|
@@ -7707,16 +7716,16 @@ function sl({
|
|
|
7707
7716
|
/* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: Te(N) })
|
|
7708
7717
|
] })
|
|
7709
7718
|
] }),
|
|
7710
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: y.slice(0, 2).map((
|
|
7719
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: y.slice(0, 2).map((z, F) => /* @__PURE__ */ e(
|
|
7711
7720
|
rl,
|
|
7712
7721
|
{
|
|
7713
|
-
side:
|
|
7714
|
-
date:
|
|
7715
|
-
title:
|
|
7716
|
-
amount:
|
|
7717
|
-
kind:
|
|
7722
|
+
side: F === 0 ? "left" : "right",
|
|
7723
|
+
date: z.date,
|
|
7724
|
+
title: z.title,
|
|
7725
|
+
amount: z.amount,
|
|
7726
|
+
kind: z.kind
|
|
7718
7727
|
},
|
|
7719
|
-
|
|
7728
|
+
z.id || F
|
|
7720
7729
|
)) })
|
|
7721
7730
|
] })
|
|
7722
7731
|
] }),
|
|
@@ -7724,7 +7733,7 @@ function sl({
|
|
|
7724
7733
|
"button",
|
|
7725
7734
|
{
|
|
7726
7735
|
type: "button",
|
|
7727
|
-
className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${
|
|
7736
|
+
className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${p.buttonPad}
|
|
7728
7737
|
border-orange-400 text-zinc-900 dark:text-zinc-100 bg-white dark:bg-zinc-900`,
|
|
7729
7738
|
"aria-label": "View Transactions (mock)",
|
|
7730
7739
|
children: [
|
|
@@ -7835,11 +7844,11 @@ function il({
|
|
|
7835
7844
|
term: o = "Fall 2025",
|
|
7836
7845
|
...u
|
|
7837
7846
|
}) {
|
|
7838
|
-
const [h, N] = B("vacation"), [y, r] = B(!1), v = de(t), d = me[v],
|
|
7847
|
+
const [h, N] = B("vacation"), [y, r] = B(!1), v = de(t), d = me[v], p = ll[v], z = Ye.find((F) => F.id === h) || Ye[0];
|
|
7839
7848
|
return /* @__PURE__ */ n(
|
|
7840
7849
|
oe,
|
|
7841
7850
|
{
|
|
7842
|
-
className: `flex flex-col ${d.card} ${
|
|
7851
|
+
className: `flex flex-col ${d.card} ${p.wrap}`,
|
|
7843
7852
|
showCheckbox: a,
|
|
7844
7853
|
checkboxPosition: s,
|
|
7845
7854
|
onSelect: i,
|
|
@@ -7849,8 +7858,8 @@ function il({
|
|
|
7849
7858
|
children: [
|
|
7850
7859
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
7851
7860
|
/* @__PURE__ */ n("div", { children: [
|
|
7852
|
-
/* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${
|
|
7853
|
-
/* @__PURE__ */ n("div", { className: `text-zinc-600 dark:text-zinc-400 ${
|
|
7861
|
+
/* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${p.title} mb-1`, children: m }),
|
|
7862
|
+
/* @__PURE__ */ n("div", { className: `text-zinc-600 dark:text-zinc-400 ${p.term} flex items-center gap-2`, children: [
|
|
7854
7863
|
/* @__PURE__ */ e(Wt, { className: "h-4 w-4" }),
|
|
7855
7864
|
"Term - ",
|
|
7856
7865
|
o
|
|
@@ -7871,28 +7880,28 @@ function il({
|
|
|
7871
7880
|
] })
|
|
7872
7881
|
] })
|
|
7873
7882
|
] }),
|
|
7874
|
-
|
|
7883
|
+
p.showTabs && /* @__PURE__ */ e("div", { className: "flex border-b border-zinc-200 dark:border-zinc-800", children: Ye.map((F) => /* @__PURE__ */ e(
|
|
7875
7884
|
"button",
|
|
7876
7885
|
{
|
|
7877
|
-
className: `flex-1 py-2 px-4 text-center ${
|
|
7878
|
-
onClick: () => N(
|
|
7879
|
-
children:
|
|
7886
|
+
className: `flex-1 py-2 px-4 text-center ${p.tab} font-medium border-b-2 transition-colors duration-200 ${h === F.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"}`,
|
|
7887
|
+
onClick: () => N(F.id),
|
|
7888
|
+
children: F.name.split(" ")[0]
|
|
7880
7889
|
},
|
|
7881
|
-
|
|
7890
|
+
F.id
|
|
7882
7891
|
)) }),
|
|
7883
|
-
/* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children:
|
|
7892
|
+
/* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children: p.showAllLeave ? (
|
|
7884
7893
|
// LG: Show all leave types
|
|
7885
|
-
Ye.map((
|
|
7886
|
-
) :
|
|
7894
|
+
Ye.map((F) => /* @__PURE__ */ e(Gt, { leave: F, sizeMeta: p }, F.id))
|
|
7895
|
+
) : p.showSingleLeave ? (
|
|
7887
7896
|
// MD: Show active tab leave type
|
|
7888
|
-
/* @__PURE__ */ e(Gt, { leave:
|
|
7897
|
+
/* @__PURE__ */ e(Gt, { leave: z, sizeMeta: p })
|
|
7889
7898
|
) : (
|
|
7890
7899
|
// SM: Show only available hours
|
|
7891
7900
|
/* @__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: [
|
|
7892
7901
|
/* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-blue-600 dark:text-blue-400" }),
|
|
7893
7902
|
/* @__PURE__ */ n("div", { children: [
|
|
7894
|
-
/* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${
|
|
7895
|
-
/* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${
|
|
7903
|
+
/* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${p.table}`, children: "Available Leave" }),
|
|
7904
|
+
/* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${p.table}`, children: z.available })
|
|
7896
7905
|
] })
|
|
7897
7906
|
] }) })
|
|
7898
7907
|
) }),
|
|
@@ -8272,9 +8281,9 @@ function fl({
|
|
|
8272
8281
|
showBanner: u = !0,
|
|
8273
8282
|
...h
|
|
8274
8283
|
}) {
|
|
8275
|
-
const [N, y] = B(o), r = de(t), v = me[r], d = hl[r],
|
|
8276
|
-
y((
|
|
8277
|
-
},
|
|
8284
|
+
const [N, y] = B(o), r = de(t), v = me[r], d = hl[r], p = (E) => {
|
|
8285
|
+
y((I) => I.filter((P) => P.id !== E.id));
|
|
8286
|
+
}, z = N.find((E) => E.type === "banner"), F = N.filter((E) => E.type !== "banner");
|
|
8278
8287
|
return /* @__PURE__ */ n(
|
|
8279
8288
|
oe,
|
|
8280
8289
|
{
|
|
@@ -8287,21 +8296,21 @@ function fl({
|
|
|
8287
8296
|
...h,
|
|
8288
8297
|
children: [
|
|
8289
8298
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between ", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: m }) }),
|
|
8290
|
-
u &&
|
|
8299
|
+
u && z && t !== "sm" && /* @__PURE__ */ e(
|
|
8291
8300
|
bl,
|
|
8292
8301
|
{
|
|
8293
|
-
alert:
|
|
8294
|
-
onDismiss:
|
|
8302
|
+
alert: z,
|
|
8303
|
+
onDismiss: p
|
|
8295
8304
|
}
|
|
8296
8305
|
),
|
|
8297
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children:
|
|
8306
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: F.slice(0, 3).map((E) => /* @__PURE__ */ e(
|
|
8298
8307
|
gl,
|
|
8299
8308
|
{
|
|
8300
|
-
alert:
|
|
8309
|
+
alert: E,
|
|
8301
8310
|
sizeMeta: d,
|
|
8302
|
-
onDismiss:
|
|
8311
|
+
onDismiss: p
|
|
8303
8312
|
},
|
|
8304
|
-
|
|
8313
|
+
E.id
|
|
8305
8314
|
)) }),
|
|
8306
8315
|
/* @__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" })
|
|
8307
8316
|
]
|