unifyedx-storybook-new 0.2.61 → 0.2.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
-
import ae, { useState as
|
|
2
|
+
import ae, { useState as B, useMemo as se, useId as Xe, Fragment as Q, useEffect as te, useCallback as K, useRef as ge } from "react";
|
|
3
3
|
import { a as H, U as ot, X as ye, P as c, L as Ma, C as fe, b as Ke, D as ct, f as zt, d as Yt, F as La, e as Ba, h as Va, T as Me, u as ja, I as Wt, i as Jt, j as _a, k as Ua, l as Ga, m as Xt, S as xt, n as Ht, M as qa, o as Ya, p as vt, q as Wa, A as Ja, E as Qt, r as Xa, s as Ha, t as Qa, v as Za, w as Zt, x as Ka, y as Kt, z as ea, B as er, G as tr, H as ar, J as He, K as dt, N as mt, O as rr, Q as nr, R as ta, V as sr, W as Nt, Y as lr, Z as ir, _ as Le, $ as or, a0 as cr, a1 as dr, a2 as mr, a3 as ur, a4 as hr, a5 as St, a6 as pr, a7 as gr, a8 as br, a9 as fr, aa as yr, ab as xr, ac as vr, ad as Nr, ae as wr, af as Te, ag as aa, ah as kr, ai as Cr, aj as zr, ak as Sr, al as Dr, am as ra, an as $r, ao as Tr, ap as na, aq as Ar, ar as ut, as as sa, at as Fr } from "./vendor-yf0QH1Io.js";
|
|
4
|
-
import { Popover as Er, PopoverButton as Rr, PopoverPanel as
|
|
4
|
+
import { Popover as Er, PopoverButton as Rr, PopoverPanel as Ir, Transition as ue, Dialog as be, TransitionChild as Ne, DialogPanel as Ae, DialogTitle as et, TabGroup as Or, TabList as Pr, Tab as ne, TabPanels as Mr, RadioGroup as _e, Listbox as Z, ListboxButton as Lr, ListboxOptions as Br, ListboxOption as Vr, SwitchGroup as jr, Switch as st, Menu as _r, MenuButton as Ur, Portal as Gr, MenuItems as qr, MenuItem as Yr, DialogBackdrop as Wr } from "@headlessui/react";
|
|
5
5
|
import { motion as le, AnimatePresence as Ce } from "framer-motion";
|
|
6
6
|
import { d as Jr } from "./vendor-lodash-Dkzj2D3U.js";
|
|
7
7
|
import { useFloating as la, offset as ia, flip as oa, shift as ca, autoUpdate as da, useClick as Xr, useDismiss as Hr, useInteractions as Qr, FloatingPortal as Zr } from "@floating-ui/react";
|
|
8
8
|
import lt, { debounce as Kr } from "lodash";
|
|
9
|
-
import { ToastContainer as en, Slide as tn, toast as
|
|
9
|
+
import { ToastContainer as en, Slide as tn, toast as Ie } from "react-toastify";
|
|
10
10
|
import "react-toastify/dist/ReactToastify.css";
|
|
11
11
|
import { P as an, S as rn, F as nn, G as sn, a as ln, E as on, b as cn, C as dn, R as mn, c as un, d as hn, e as pn, f as gn, I as bn, g as Dt } from "./vendor-syncfusion-v-M3ddHK.js";
|
|
12
12
|
const fn = (t) => {
|
|
@@ -29,7 +29,7 @@ const fn = (t) => {
|
|
|
29
29
|
className: m,
|
|
30
30
|
...o
|
|
31
31
|
}) => {
|
|
32
|
-
const [u, h] =
|
|
32
|
+
const [u, h] = B(!1), N = se(() => yn(a), []), y = t && !u, r = !y && a, v = !y && !a, d = H(
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
m
|
|
@@ -248,7 +248,7 @@ const wn = {
|
|
|
248
248
|
] }),
|
|
249
249
|
s && /* @__PURE__ */ e("p", { className: "checkbox-error-message", children: s })
|
|
250
250
|
] });
|
|
251
|
-
}, zn = ({ children: t }) => /* @__PURE__ */ e(Er, { className: "popover-container", children: t }), Sn = ({ children: t }) => /* @__PURE__ */ e(Rr, { as: "div", children: t }), Dn = ({ children: t, className: a }) => /* @__PURE__ */ e(
|
|
251
|
+
}, zn = ({ children: t }) => /* @__PURE__ */ e(Er, { className: "popover-container", children: t }), Sn = ({ children: t }) => /* @__PURE__ */ e(Rr, { as: "div", children: t }), Dn = ({ children: t, className: a }) => /* @__PURE__ */ e(Ir, { className: `popover-panel ${a || ""}`, children: t }), ma = ct, ua = ({
|
|
252
252
|
value: t,
|
|
253
253
|
onChange: a,
|
|
254
254
|
onClear: s,
|
|
@@ -714,7 +714,7 @@ const wn = {
|
|
|
714
714
|
},
|
|
715
715
|
`${A.name}-${E}`
|
|
716
716
|
)),
|
|
717
|
-
u.map(({ file: A, message: E },
|
|
717
|
+
u.map(({ file: A, message: E }, I) => /* @__PURE__ */ n(
|
|
718
718
|
"li",
|
|
719
719
|
{
|
|
720
720
|
className: "file-item file-item--rejected",
|
|
@@ -736,14 +736,14 @@ const wn = {
|
|
|
736
736
|
"button",
|
|
737
737
|
{
|
|
738
738
|
type: "button",
|
|
739
|
-
onClick: () => N(
|
|
739
|
+
onClick: () => N(I),
|
|
740
740
|
className: "remove-file-button",
|
|
741
741
|
children: /* @__PURE__ */ e(Me, { size: 16 })
|
|
742
742
|
}
|
|
743
743
|
)
|
|
744
744
|
]
|
|
745
745
|
},
|
|
746
|
-
`${A.name}-${
|
|
746
|
+
`${A.name}-${I}`
|
|
747
747
|
))
|
|
748
748
|
] })
|
|
749
749
|
] })
|
|
@@ -828,15 +828,15 @@ const wn = {
|
|
|
828
828
|
fetchCreatedOrUpdatedByUsers: u = async () => []
|
|
829
829
|
// Mockable fetcher
|
|
830
830
|
}) => {
|
|
831
|
-
const [h, N] =
|
|
831
|
+
const [h, N] = B({
|
|
832
832
|
createdBy: [],
|
|
833
833
|
updatedBy: []
|
|
834
|
-
}), [y, r] =
|
|
834
|
+
}), [y, r] = B({
|
|
835
835
|
createdBy: !1,
|
|
836
836
|
updatedBy: !1
|
|
837
|
-
}), [v, d] =
|
|
837
|
+
}), [v, d] = B({
|
|
838
838
|
startDate: null
|
|
839
|
-
}), [g, z] =
|
|
839
|
+
}), [g, z] = B({
|
|
840
840
|
endDate: null
|
|
841
841
|
}), A = ja({
|
|
842
842
|
initialValues: JSON.parse(JSON.stringify(m)),
|
|
@@ -851,32 +851,32 @@ const wn = {
|
|
|
851
851
|
};
|
|
852
852
|
}), console.log("[storybook filter] Applied Filters:", x), typeof s == "function" && s({
|
|
853
853
|
filters: x,
|
|
854
|
-
activeCount:
|
|
854
|
+
activeCount: I
|
|
855
855
|
}), a();
|
|
856
856
|
},
|
|
857
857
|
enableReinitialize: !0
|
|
858
858
|
}), E = se(() => l.reduce((T, x) => {
|
|
859
859
|
const f = x.key, C = A.values[f];
|
|
860
|
-
let
|
|
860
|
+
let O = !1;
|
|
861
861
|
if (C)
|
|
862
862
|
switch (x.type) {
|
|
863
863
|
case "multiselect":
|
|
864
864
|
case "multiselect-users":
|
|
865
|
-
|
|
865
|
+
O = Array.isArray(C.values) && C.values.length > 0;
|
|
866
866
|
break;
|
|
867
867
|
case "date":
|
|
868
|
-
(C.range && C.range !== "" || Array.isArray(C.values) && C.values.length > 0) && (
|
|
868
|
+
(C.range && C.range !== "" || Array.isArray(C.values) && C.values.length > 0) && (O = !0);
|
|
869
869
|
break;
|
|
870
870
|
}
|
|
871
|
-
return T[f] =
|
|
872
|
-
}, {}), [l, A.values]),
|
|
871
|
+
return T[f] = O, T;
|
|
872
|
+
}, {}), [l, A.values]), I = Object.values(E).filter(Boolean).length, M = se(() => l.some((T) => {
|
|
873
873
|
if (T.type !== "date") return !1;
|
|
874
874
|
const x = A.values?.[T.key]?.values;
|
|
875
875
|
if (!Array.isArray(x) || x.length < 2) return !1;
|
|
876
876
|
const [f, C] = x;
|
|
877
877
|
if (!f || !C) return !1;
|
|
878
|
-
const
|
|
879
|
-
return
|
|
878
|
+
const O = f instanceof Date ? f : new Date(f), R = C instanceof Date ? C : new Date(C);
|
|
879
|
+
return O > R;
|
|
880
880
|
}), [l, A.values]), _ = async (T, x) => {
|
|
881
881
|
try {
|
|
882
882
|
r((C) => ({ ...C, [T]: !0 }));
|
|
@@ -892,8 +892,8 @@ const wn = {
|
|
|
892
892
|
l[T].type === "multiselect-users" && h[x].length === 0 && !y[x] && _(x, f);
|
|
893
893
|
}, Y = () => {
|
|
894
894
|
A.resetForm(), N({ createdBy: [], updatedBy: [] }), i();
|
|
895
|
-
},
|
|
896
|
-
const x = l.find((
|
|
895
|
+
}, q = (T) => {
|
|
896
|
+
const x = l.find((O) => O.key === T);
|
|
897
897
|
if (!x) return null;
|
|
898
898
|
const f = A.values[T] || m[T], C = Array.isArray(f.values) ? f.values : [];
|
|
899
899
|
switch (x.type) {
|
|
@@ -921,8 +921,8 @@ const wn = {
|
|
|
921
921
|
className: "filter-checkbox-input",
|
|
922
922
|
checked: x.options.length > 0 && C.length === x.options.length,
|
|
923
923
|
onChange: (F) => {
|
|
924
|
-
const
|
|
925
|
-
A.setFieldValue(`${T}.values`,
|
|
924
|
+
const G = F.target.checked ? x.options.map((W) => W.value) : [];
|
|
925
|
+
A.setFieldValue(`${T}.values`, G);
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
),
|
|
@@ -943,9 +943,9 @@ const wn = {
|
|
|
943
943
|
id: `${T}-${F.value}`,
|
|
944
944
|
className: "filter-checkbox-input",
|
|
945
945
|
checked: C.includes(F.value),
|
|
946
|
-
onChange: (
|
|
947
|
-
const
|
|
948
|
-
A.setFieldValue(`${T}.values`,
|
|
946
|
+
onChange: (G) => {
|
|
947
|
+
const W = G.target.checked ? [...C, F.value] : C.filter((xe) => xe !== F.value);
|
|
948
|
+
A.setFieldValue(`${T}.values`, W);
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
951
|
),
|
|
@@ -961,7 +961,7 @@ const wn = {
|
|
|
961
961
|
] })
|
|
962
962
|
] });
|
|
963
963
|
case "multiselect-users":
|
|
964
|
-
const
|
|
964
|
+
const O = h[T] || [], R = y[T];
|
|
965
965
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
966
966
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
967
967
|
/* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
|
|
@@ -975,7 +975,7 @@ const wn = {
|
|
|
975
975
|
}
|
|
976
976
|
)
|
|
977
977
|
] }),
|
|
978
|
-
R ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children:
|
|
978
|
+
R ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: O.length > 0 ? /* @__PURE__ */ n(ee, { children: [
|
|
979
979
|
/* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
|
|
980
980
|
/* @__PURE__ */ e(
|
|
981
981
|
"input",
|
|
@@ -983,12 +983,12 @@ const wn = {
|
|
|
983
983
|
type: "checkbox",
|
|
984
984
|
id: `select-all-users-${T}`,
|
|
985
985
|
className: "filter-checkbox-input",
|
|
986
|
-
checked:
|
|
986
|
+
checked: O.length > 0 && C.length === O.length,
|
|
987
987
|
onChange: (F) => {
|
|
988
|
-
const
|
|
988
|
+
const G = F.target.checked ? O.map((W) => W.email) : [];
|
|
989
989
|
A.setFieldValue(
|
|
990
990
|
`${T}.values`,
|
|
991
|
-
|
|
991
|
+
G
|
|
992
992
|
);
|
|
993
993
|
}
|
|
994
994
|
}
|
|
@@ -1002,7 +1002,7 @@ const wn = {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
] }),
|
|
1005
|
-
|
|
1005
|
+
O.map((F) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item createdby", children: [
|
|
1006
1006
|
/* @__PURE__ */ e(
|
|
1007
1007
|
"input",
|
|
1008
1008
|
{
|
|
@@ -1010,11 +1010,11 @@ const wn = {
|
|
|
1010
1010
|
id: `${T}-${F.email}`,
|
|
1011
1011
|
className: "filter-checkbox-input",
|
|
1012
1012
|
checked: C.includes(F.email),
|
|
1013
|
-
onChange: (
|
|
1014
|
-
const
|
|
1013
|
+
onChange: (G) => {
|
|
1014
|
+
const W = G.target.checked ? [...C, F.email] : C.filter((xe) => xe !== F.email);
|
|
1015
1015
|
A.setFieldValue(
|
|
1016
1016
|
`${T}.values`,
|
|
1017
|
-
|
|
1017
|
+
W
|
|
1018
1018
|
);
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
@@ -1040,7 +1040,7 @@ const wn = {
|
|
|
1040
1040
|
}, S = {
|
|
1041
1041
|
startDate: $ instanceof Date ? $.toISOString().slice(0, 10) : null,
|
|
1042
1042
|
endDate: $ instanceof Date ? $.toISOString().slice(0, 10) : null
|
|
1043
|
-
},
|
|
1043
|
+
}, L = [
|
|
1044
1044
|
{ key: "anytime", label: "Anytime" },
|
|
1045
1045
|
{ key: "today", label: "Today" },
|
|
1046
1046
|
{ key: "this_week", label: "This Week" },
|
|
@@ -1057,8 +1057,8 @@ const wn = {
|
|
|
1057
1057
|
A.setFieldValue(`${T}.range`, "custom");
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
|
-
const [
|
|
1061
|
-
A.setFieldValue(`${T}.values`,
|
|
1060
|
+
const [G, W] = En(F);
|
|
1061
|
+
A.setFieldValue(`${T}.values`, G && W ? [G, W] : []), A.setFieldValue(`${T}.range`, F);
|
|
1062
1062
|
};
|
|
1063
1063
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
1064
1064
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
@@ -1087,8 +1087,8 @@ const wn = {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
)
|
|
1089
1089
|
] }),
|
|
1090
|
-
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
1091
|
-
const
|
|
1090
|
+
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: L.map((F) => {
|
|
1091
|
+
const G = f.range === F.key || F.key === "anytime" && (!Array.isArray(f.values) || f.values.length === 0);
|
|
1092
1092
|
return /* @__PURE__ */ n(
|
|
1093
1093
|
"label",
|
|
1094
1094
|
{
|
|
@@ -1099,13 +1099,13 @@ const wn = {
|
|
|
1099
1099
|
{
|
|
1100
1100
|
type: "radio",
|
|
1101
1101
|
name: `preset-${T}`,
|
|
1102
|
-
checked:
|
|
1102
|
+
checked: G,
|
|
1103
1103
|
onChange: () => j(F.key),
|
|
1104
1104
|
className: "h-4 w-4"
|
|
1105
1105
|
}
|
|
1106
1106
|
),
|
|
1107
1107
|
/* @__PURE__ */ e("span", { className: "text-sm text-[#222]", children: F.label }),
|
|
1108
|
-
F.key === "anytime" &&
|
|
1108
|
+
F.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" })
|
|
1109
1109
|
]
|
|
1110
1110
|
},
|
|
1111
1111
|
F.key
|
|
@@ -1122,8 +1122,8 @@ const wn = {
|
|
|
1122
1122
|
useRange: !1,
|
|
1123
1123
|
value: P,
|
|
1124
1124
|
onChange: (F) => {
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1125
|
+
const G = F?.startDate ? Be(new Date(F.startDate)) : null, W = D[1] || null;
|
|
1126
|
+
G && (A.setFieldValue(`${T}.values`, [G, W]), A.setFieldValue(`${T}.range`, "custom"));
|
|
1127
1127
|
},
|
|
1128
1128
|
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",
|
|
1129
1129
|
primaryColor: "violet",
|
|
@@ -1146,8 +1146,8 @@ const wn = {
|
|
|
1146
1146
|
useRange: !1,
|
|
1147
1147
|
value: S,
|
|
1148
1148
|
onChange: (F) => {
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1149
|
+
const G = F?.startDate ? Ve(new Date(F.startDate)) : null, W = D[0] || null;
|
|
1150
|
+
G && (A.setFieldValue(`${T}.values`, [W, G]), A.setFieldValue(`${T}.range`, "custom"));
|
|
1151
1151
|
},
|
|
1152
1152
|
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",
|
|
1153
1153
|
primaryColor: "violet",
|
|
@@ -1206,7 +1206,7 @@ const wn = {
|
|
|
1206
1206
|
] }),
|
|
1207
1207
|
/* @__PURE__ */ n("form", { onSubmit: A.handleSubmit, className: "filter-form", children: [
|
|
1208
1208
|
/* @__PURE__ */ e("div", { className: "filter-content-wrapper", children: /* @__PURE__ */ n(
|
|
1209
|
-
|
|
1209
|
+
Or,
|
|
1210
1210
|
{
|
|
1211
1211
|
vertical: !0,
|
|
1212
1212
|
onChange: U,
|
|
@@ -1239,7 +1239,7 @@ const wn = {
|
|
|
1239
1239
|
animate: { opacity: 1, x: 0 },
|
|
1240
1240
|
transition: { duration: 0.3 },
|
|
1241
1241
|
className: "h-full",
|
|
1242
|
-
children:
|
|
1242
|
+
children: q(T.key)
|
|
1243
1243
|
},
|
|
1244
1244
|
T.key
|
|
1245
1245
|
)
|
|
@@ -1268,7 +1268,7 @@ const wn = {
|
|
|
1268
1268
|
children: [
|
|
1269
1269
|
"Apply Filters",
|
|
1270
1270
|
" ",
|
|
1271
|
-
|
|
1271
|
+
I > 0 ? `(${I})` : ""
|
|
1272
1272
|
]
|
|
1273
1273
|
}
|
|
1274
1274
|
)
|
|
@@ -1278,7 +1278,7 @@ const wn = {
|
|
|
1278
1278
|
}
|
|
1279
1279
|
) }) })
|
|
1280
1280
|
] }) });
|
|
1281
|
-
},
|
|
1281
|
+
}, X = ({
|
|
1282
1282
|
label: t,
|
|
1283
1283
|
id: a,
|
|
1284
1284
|
type: s = "text",
|
|
@@ -1414,7 +1414,7 @@ const wn = {
|
|
|
1414
1414
|
onItemsPerPageChange: l,
|
|
1415
1415
|
itemsPerPageOptions: m = [10, 15, 20]
|
|
1416
1416
|
}) => {
|
|
1417
|
-
const o = Math.ceil(a / s), [u, h] =
|
|
1417
|
+
const o = Math.ceil(a / s), [u, h] = B(t);
|
|
1418
1418
|
te(() => {
|
|
1419
1419
|
h(t);
|
|
1420
1420
|
}, [t]);
|
|
@@ -1562,7 +1562,7 @@ const wn = {
|
|
|
1562
1562
|
searchIconClass: N = "",
|
|
1563
1563
|
...y
|
|
1564
1564
|
}) => {
|
|
1565
|
-
const [r, v] =
|
|
1565
|
+
const [r, v] = B(t);
|
|
1566
1566
|
te(() => {
|
|
1567
1567
|
v(t);
|
|
1568
1568
|
}, [t]);
|
|
@@ -1610,7 +1610,7 @@ const wn = {
|
|
|
1610
1610
|
// From RHF's <Controller>
|
|
1611
1611
|
showSearch: h = !0
|
|
1612
1612
|
}) => {
|
|
1613
|
-
const [N, y] =
|
|
1613
|
+
const [N, y] = B("");
|
|
1614
1614
|
console.log("Select component - value:", a, "type:", typeof a), console.log("Select component - options:", i);
|
|
1615
1615
|
const r = N === "" ? i : i.filter(
|
|
1616
1616
|
(d) => d.label.toLowerCase().includes(N.toLowerCase())
|
|
@@ -1686,8 +1686,8 @@ const wn = {
|
|
|
1686
1686
|
] }),
|
|
1687
1687
|
o && /* @__PURE__ */ e("p", { className: "select-error-message", children: o })
|
|
1688
1688
|
] }) });
|
|
1689
|
-
},
|
|
1690
|
-
const [t, a] =
|
|
1689
|
+
}, In = () => {
|
|
1690
|
+
const [t, a] = B(window.location.pathname);
|
|
1691
1691
|
return te(() => {
|
|
1692
1692
|
const s = () => {
|
|
1693
1693
|
a(window.location.pathname);
|
|
@@ -1702,7 +1702,7 @@ const wn = {
|
|
|
1702
1702
|
return s;
|
|
1703
1703
|
return null;
|
|
1704
1704
|
}, pa = ({ item: t, isCollapsed: a, level: s = 0 }) => {
|
|
1705
|
-
const { pathname: i } =
|
|
1705
|
+
const { pathname: i } = In(), l = t.href || t.url || t.path, [m, o] = B(!1), u = t.icon;
|
|
1706
1706
|
te(() => {
|
|
1707
1707
|
ft([t], i) && o(!0);
|
|
1708
1708
|
}, [t, i]);
|
|
@@ -1892,7 +1892,7 @@ const wn = {
|
|
|
1892
1892
|
// ✅ New prop to control visibility
|
|
1893
1893
|
...u
|
|
1894
1894
|
}) => {
|
|
1895
|
-
const h = a || u.name, [N, y] =
|
|
1895
|
+
const h = a || u.name, [N, y] = B(
|
|
1896
1896
|
u.value?.length || u.defaultValue?.length || 0
|
|
1897
1897
|
), r = (d) => {
|
|
1898
1898
|
y(d.target.value.length), u.onChange && u.onChange(d);
|
|
@@ -1946,7 +1946,7 @@ const wn = {
|
|
|
1946
1946
|
t && i === "right" && /* @__PURE__ */ e(st.Label, { className: "switch-label", passive: !0, children: t })
|
|
1947
1947
|
] }),
|
|
1948
1948
|
l && /* @__PURE__ */ e("p", { className: "switch-error-message", children: l })
|
|
1949
|
-
] }),
|
|
1949
|
+
] }), Il = ({
|
|
1950
1950
|
children: t,
|
|
1951
1951
|
content: a,
|
|
1952
1952
|
variant: s = "dark",
|
|
@@ -1974,7 +1974,7 @@ const wn = {
|
|
|
1974
1974
|
}
|
|
1975
1975
|
)
|
|
1976
1976
|
] });
|
|
1977
|
-
},
|
|
1977
|
+
}, On = {
|
|
1978
1978
|
enter: (t) => ({
|
|
1979
1979
|
x: t > 0 ? "100%" : "-100%",
|
|
1980
1980
|
opacity: 0
|
|
@@ -1987,7 +1987,7 @@ const wn = {
|
|
|
1987
1987
|
x: t < 0 ? "100%" : "-100%",
|
|
1988
1988
|
opacity: 0
|
|
1989
1989
|
})
|
|
1990
|
-
},
|
|
1990
|
+
}, Ol = ({
|
|
1991
1991
|
isOpen: t,
|
|
1992
1992
|
onClose: a,
|
|
1993
1993
|
steps: s = {},
|
|
@@ -2075,7 +2075,7 @@ const wn = {
|
|
|
2075
2075
|
le.div,
|
|
2076
2076
|
{
|
|
2077
2077
|
custom: l,
|
|
2078
|
-
variants:
|
|
2078
|
+
variants: On,
|
|
2079
2079
|
initial: "enter",
|
|
2080
2080
|
animate: "center",
|
|
2081
2081
|
exit: "exit",
|
|
@@ -2404,7 +2404,7 @@ function Yn(t) {
|
|
|
2404
2404
|
return console.log("Error reading JSON from localStorage"), null;
|
|
2405
2405
|
}
|
|
2406
2406
|
}
|
|
2407
|
-
function
|
|
2407
|
+
function It() {
|
|
2408
2408
|
const t = Yn("userProfile") || {}, a = localStorage.getItem("access_token") || t.accessToken || "", s = localStorage.getItem("siteId") || t.siteId || "", i = t.tenant || "", l = t.tenantdomain || "", m = t.username || t.displayName || "", o = t.email || "";
|
|
2409
2409
|
return {
|
|
2410
2410
|
Authorization: a ? `Bearer ${a}` : void 0,
|
|
@@ -2465,12 +2465,12 @@ function Jn({
|
|
|
2465
2465
|
);
|
|
2466
2466
|
function i({ open: N = !1, customHeader: y = {} } = {}) {
|
|
2467
2467
|
if (N) {
|
|
2468
|
-
const { Authorization: r, ...v } =
|
|
2468
|
+
const { Authorization: r, ...v } = It();
|
|
2469
2469
|
return {
|
|
2470
2470
|
headers: { ...v, ...a, ...y }
|
|
2471
2471
|
};
|
|
2472
2472
|
}
|
|
2473
|
-
return { headers: { ...
|
|
2473
|
+
return { headers: { ...It(), ...y } };
|
|
2474
2474
|
}
|
|
2475
2475
|
async function l(N, y, r = !1, v = {}) {
|
|
2476
2476
|
return s.get(N, {
|
|
@@ -2528,7 +2528,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2528
2528
|
type: "User",
|
|
2529
2529
|
avatarUrl: a?.profileImage || Ye(l)
|
|
2530
2530
|
};
|
|
2531
|
-
}),
|
|
2531
|
+
}), Ot = (t) => {
|
|
2532
2532
|
try {
|
|
2533
2533
|
const a = JSON.parse(t);
|
|
2534
2534
|
return Array.isArray(a) ? a : [];
|
|
@@ -2579,15 +2579,15 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2579
2579
|
if (Array.isArray(s))
|
|
2580
2580
|
i = s;
|
|
2581
2581
|
else if (typeof s == "string")
|
|
2582
|
-
i =
|
|
2582
|
+
i = Ot(s.trim());
|
|
2583
2583
|
else if (s && typeof s == "object") {
|
|
2584
2584
|
const l = s.data;
|
|
2585
|
-
Array.isArray(l) ? i = l : typeof l == "string" && (i =
|
|
2585
|
+
Array.isArray(l) ? i = l : typeof l == "string" && (i = Ot(l.trim()));
|
|
2586
2586
|
}
|
|
2587
2587
|
return Hn(i);
|
|
2588
2588
|
}
|
|
2589
2589
|
}, Ct = (t, a) => {
|
|
2590
|
-
const [s, i] =
|
|
2590
|
+
const [s, i] = B(t);
|
|
2591
2591
|
return te(
|
|
2592
2592
|
() => {
|
|
2593
2593
|
const l = Kr(() => {
|
|
@@ -2659,52 +2659,52 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2659
2659
|
},
|
|
2660
2660
|
isChanged: u = !1
|
|
2661
2661
|
}) => {
|
|
2662
|
-
const [h, N] =
|
|
2662
|
+
const [h, N] = B(Pt[0]), [y, r] = B(""), v = Ct(y, 400), [d, g] = B([]), [z, A] = B(/* @__PURE__ */ new Set()), [E, I] = B(!1), [M, _] = B(Mt[0]), {
|
|
2663
2663
|
control: U,
|
|
2664
2664
|
handleSubmit: Y,
|
|
2665
|
-
watch:
|
|
2665
|
+
watch: q,
|
|
2666
2666
|
formState: { errors: T, isSubmitting: x }
|
|
2667
2667
|
} = er({
|
|
2668
2668
|
defaultValues: { pendingInvites: [] },
|
|
2669
2669
|
resolver: rr(Zn)
|
|
2670
|
-
}), { fields: f, append: C, remove:
|
|
2670
|
+
}), { fields: f, append: C, remove: O, update: R } = tr({
|
|
2671
2671
|
control: U,
|
|
2672
2672
|
name: "pendingInvites"
|
|
2673
|
-
}), D =
|
|
2673
|
+
}), D = q("pendingInvites");
|
|
2674
2674
|
te(() => {
|
|
2675
|
-
v.length > 1 ? (
|
|
2675
|
+
v.length > 1 ? (I(!0), Xn(h.name, v).then((S) => {
|
|
2676
2676
|
g(S);
|
|
2677
|
-
}).catch((S) => console.error("Search failed:", S)).finally(() =>
|
|
2677
|
+
}).catch((S) => console.error("Search failed:", S)).finally(() => I(!1))) : (g([]), A(/* @__PURE__ */ new Set()));
|
|
2678
2678
|
}, [v, h]);
|
|
2679
2679
|
const b = (S) => {
|
|
2680
|
-
A((
|
|
2681
|
-
const j = new Set(
|
|
2680
|
+
A((L) => {
|
|
2681
|
+
const j = new Set(L);
|
|
2682
2682
|
return j.has(S) ? j.delete(S) : j.add(S), j;
|
|
2683
2683
|
});
|
|
2684
2684
|
}, p = () => {
|
|
2685
2685
|
d.filter((S) => z.has(S.id)).forEach((S) => {
|
|
2686
|
-
f.find((
|
|
2686
|
+
f.find((L) => L.id === S.id) || C({ ...S, permission: M.name });
|
|
2687
2687
|
}), A(/* @__PURE__ */ new Set()), r("");
|
|
2688
2688
|
}, k = (S) => {
|
|
2689
2689
|
_(S), f.forEach(
|
|
2690
|
-
(
|
|
2690
|
+
(L, j) => R(j, { ...f[j], permission: S.name })
|
|
2691
2691
|
);
|
|
2692
2692
|
}, w = async (S) => {
|
|
2693
2693
|
try {
|
|
2694
2694
|
if (l === me.DRIVE) {
|
|
2695
|
-
const
|
|
2695
|
+
const L = S.pendingInvites.map((F) => ({
|
|
2696
2696
|
id: F.id,
|
|
2697
2697
|
permission: F.permission,
|
|
2698
2698
|
type: F.type.toLowerCase()
|
|
2699
2699
|
}));
|
|
2700
2700
|
o({
|
|
2701
2701
|
entity: t,
|
|
2702
|
-
userGroupRolesObj:
|
|
2702
|
+
userGroupRolesObj: L,
|
|
2703
2703
|
existingShares: i
|
|
2704
2704
|
// Always send updated existing shares
|
|
2705
2705
|
}, i);
|
|
2706
2706
|
} else if (l === me.INTEREST) {
|
|
2707
|
-
const
|
|
2707
|
+
const L = S.pendingInvites.map((j) => ({
|
|
2708
2708
|
identity: j.id,
|
|
2709
2709
|
type: j.type.toLowerCase(),
|
|
2710
2710
|
opt: !0,
|
|
@@ -2713,16 +2713,16 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2713
2713
|
userName: j.name,
|
|
2714
2714
|
interestId: t?.data?.id
|
|
2715
2715
|
}));
|
|
2716
|
-
o(
|
|
2716
|
+
o(L, i);
|
|
2717
2717
|
} else if (l === me.ARTICLE) {
|
|
2718
|
-
const
|
|
2718
|
+
const L = S.pendingInvites.map((F) => ({
|
|
2719
2719
|
id: F.id,
|
|
2720
2720
|
permission: F.permission,
|
|
2721
2721
|
type: F.type.toLowerCase()
|
|
2722
2722
|
}));
|
|
2723
2723
|
o({
|
|
2724
2724
|
entity: t,
|
|
2725
|
-
userGroupRolesObj:
|
|
2725
|
+
userGroupRolesObj: L,
|
|
2726
2726
|
existingShares: i
|
|
2727
2727
|
}, i);
|
|
2728
2728
|
} else
|
|
@@ -2730,12 +2730,12 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2730
2730
|
setTimeout(() => {
|
|
2731
2731
|
s();
|
|
2732
2732
|
}, 1e3);
|
|
2733
|
-
} catch (
|
|
2734
|
-
throw console.error("Failed to submit invites:",
|
|
2733
|
+
} catch (L) {
|
|
2734
|
+
throw console.error("Failed to submit invites:", L), L;
|
|
2735
2735
|
}
|
|
2736
2736
|
}, $ = (S) => {
|
|
2737
|
-
const
|
|
2738
|
-
return
|
|
2737
|
+
const L = i[h.code].find((j) => j.name === S.name && j.permission !== "remove") || D.find((j) => j.name === S.name);
|
|
2738
|
+
return L ? `${L.permission}` : "";
|
|
2739
2739
|
}, P = () => {
|
|
2740
2740
|
switch (l) {
|
|
2741
2741
|
case me.DRIVE:
|
|
@@ -2796,24 +2796,24 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2796
2796
|
Z.Option,
|
|
2797
2797
|
{
|
|
2798
2798
|
value: S,
|
|
2799
|
-
className: ({ active:
|
|
2800
|
-
children: ({ selected:
|
|
2799
|
+
className: ({ active: L }) => `${L ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2800
|
+
children: ({ selected: L }) => /* @__PURE__ */ n(ee, { children: [
|
|
2801
2801
|
/* @__PURE__ */ n(
|
|
2802
2802
|
"span",
|
|
2803
2803
|
{
|
|
2804
|
-
className: `${
|
|
2804
|
+
className: `${L ? "font-medium" : "font-normal"} flex items-center`,
|
|
2805
2805
|
children: [
|
|
2806
2806
|
/* @__PURE__ */ e(
|
|
2807
2807
|
S.icon,
|
|
2808
2808
|
{
|
|
2809
|
-
className: `h-5 w-5 mr-2 ${
|
|
2809
|
+
className: `h-5 w-5 mr-2 ${L ? "text-white" : "text-gray-400"}`
|
|
2810
2810
|
}
|
|
2811
2811
|
),
|
|
2812
2812
|
S.name
|
|
2813
2813
|
]
|
|
2814
2814
|
}
|
|
2815
2815
|
),
|
|
2816
|
-
|
|
2816
|
+
L && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-white", children: /* @__PURE__ */ e(mt, { className: "h-5 w-5" }) })
|
|
2817
2817
|
] })
|
|
2818
2818
|
},
|
|
2819
2819
|
S.id
|
|
@@ -2839,12 +2839,12 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2839
2839
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2840
2840
|
children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(ee, { children: [
|
|
2841
2841
|
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((S) => {
|
|
2842
|
-
const
|
|
2842
|
+
const L = $(S);
|
|
2843
2843
|
return /* @__PURE__ */ n(
|
|
2844
2844
|
"div",
|
|
2845
2845
|
{
|
|
2846
|
-
onClick: () =>
|
|
2847
|
-
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${
|
|
2846
|
+
onClick: () => L ? null : b(S.id),
|
|
2847
|
+
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${L ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2848
2848
|
children: [
|
|
2849
2849
|
/* @__PURE__ */ e(
|
|
2850
2850
|
"input",
|
|
@@ -2853,7 +2853,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2853
2853
|
checked: z.has(S.id),
|
|
2854
2854
|
readOnly: !0,
|
|
2855
2855
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
|
|
2856
|
-
disabled: !!
|
|
2856
|
+
disabled: !!L
|
|
2857
2857
|
}
|
|
2858
2858
|
),
|
|
2859
2859
|
/* @__PURE__ */ e(
|
|
@@ -2865,8 +2865,8 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2865
2865
|
}
|
|
2866
2866
|
),
|
|
2867
2867
|
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: S.name }),
|
|
2868
|
-
|
|
2869
|
-
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children:
|
|
2868
|
+
L ? /* @__PURE__ */ n(ee, { children: [
|
|
2869
|
+
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children: L }),
|
|
2870
2870
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
|
|
2871
2871
|
] }) : ""
|
|
2872
2872
|
]
|
|
@@ -2937,12 +2937,12 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2937
2937
|
Z.Option,
|
|
2938
2938
|
{
|
|
2939
2939
|
value: S,
|
|
2940
|
-
className: ({ active:
|
|
2941
|
-
children: ({ selected:
|
|
2940
|
+
className: ({ active: L }) => `${L ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2941
|
+
children: ({ selected: L, active: j }) => /* @__PURE__ */ n(ee, { children: [
|
|
2942
2942
|
/* @__PURE__ */ n(
|
|
2943
2943
|
"span",
|
|
2944
2944
|
{
|
|
2945
|
-
className: `${
|
|
2945
|
+
className: `${L ? "font-medium" : "font-normal"} flex items-center`,
|
|
2946
2946
|
children: [
|
|
2947
2947
|
/* @__PURE__ */ e(
|
|
2948
2948
|
S.icon,
|
|
@@ -2955,7 +2955,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2955
2955
|
]
|
|
2956
2956
|
}
|
|
2957
2957
|
),
|
|
2958
|
-
|
|
2958
|
+
L && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(
|
|
2959
2959
|
mt,
|
|
2960
2960
|
{
|
|
2961
2961
|
className: "h-5 w-5",
|
|
@@ -2972,7 +2972,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
2972
2972
|
}
|
|
2973
2973
|
)
|
|
2974
2974
|
] }),
|
|
2975
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Ce, { children: f.map((S,
|
|
2975
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Ce, { children: f.map((S, L) => /* @__PURE__ */ n(
|
|
2976
2976
|
le.div,
|
|
2977
2977
|
{
|
|
2978
2978
|
layout: !0,
|
|
@@ -3000,7 +3000,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3000
3000
|
/* @__PURE__ */ e(
|
|
3001
3001
|
"button",
|
|
3002
3002
|
{
|
|
3003
|
-
onClick: () =>
|
|
3003
|
+
onClick: () => O(L),
|
|
3004
3004
|
className: "text-gray-400 hover:text-red-500 hover:cursor-pointer",
|
|
3005
3005
|
children: /* @__PURE__ */ e(He, { className: "h-5 w-5" })
|
|
3006
3006
|
}
|
|
@@ -3047,7 +3047,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3047
3047
|
{ name: "Can manage", icon: ea, value: "edit" },
|
|
3048
3048
|
{ name: "Remove", icon: nr, isDestructive: !0, value: "remove" }
|
|
3049
3049
|
], es = ({ item: t, allowedPermissions: a, onPermissionChange: s }) => {
|
|
3050
|
-
const [i, l] =
|
|
3050
|
+
const [i, l] = B(!1), { refs: m, floatingStyles: o, context: u } = la({
|
|
3051
3051
|
open: i,
|
|
3052
3052
|
onOpenChange: l,
|
|
3053
3053
|
middleware: [ia(8), oa(), ca({ padding: 8 })],
|
|
@@ -3135,31 +3135,31 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3135
3135
|
existingShares: l,
|
|
3136
3136
|
allowedPermissions: m
|
|
3137
3137
|
}) => {
|
|
3138
|
-
const [o, u] =
|
|
3138
|
+
const [o, u] = B(l), [h, N] = B(0), [y, r] = B(""), v = Ct(y, 300), d = {
|
|
3139
3139
|
users: o.users.filter(
|
|
3140
|
-
(
|
|
3140
|
+
(I) => I.name.toLowerCase().includes(v.toLowerCase())
|
|
3141
3141
|
),
|
|
3142
3142
|
groups: o.groups.filter(
|
|
3143
|
-
(
|
|
3143
|
+
(I) => I.name.toLowerCase().includes(v.toLowerCase())
|
|
3144
3144
|
),
|
|
3145
3145
|
roles: o.roles.filter(
|
|
3146
|
-
(
|
|
3146
|
+
(I) => I.name.toLowerCase().includes(v.toLowerCase())
|
|
3147
3147
|
)
|
|
3148
|
-
}, g = async (
|
|
3148
|
+
}, g = async (I, M, _, U) => {
|
|
3149
3149
|
const Y = M.value;
|
|
3150
|
-
u((
|
|
3151
|
-
...
|
|
3152
|
-
[_]:
|
|
3153
|
-
(T) => T.id ===
|
|
3150
|
+
u((q) => ({
|
|
3151
|
+
...q,
|
|
3152
|
+
[_]: q[_].map(
|
|
3153
|
+
(T) => T.id === I.id ? { ...T, permission: Y } : T
|
|
3154
3154
|
)
|
|
3155
3155
|
}));
|
|
3156
3156
|
}, z = () => {
|
|
3157
|
-
const
|
|
3157
|
+
const I = {
|
|
3158
3158
|
users: o.users.filter((M) => M.permission !== "remove"),
|
|
3159
3159
|
groups: o.groups.filter((M) => M.permission !== "remove"),
|
|
3160
3160
|
roles: o.roles.filter((M) => M.permission !== "remove")
|
|
3161
3161
|
};
|
|
3162
|
-
a(
|
|
3162
|
+
a(I);
|
|
3163
3163
|
}, A = ["users", "groups", "roles"], E = ["Users", "Groups", "Roles"];
|
|
3164
3164
|
return (
|
|
3165
3165
|
// The main structure remains the same...
|
|
@@ -3189,7 +3189,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3189
3189
|
/* @__PURE__ */ n("div", { className: "flex flex-col flex-grow", children: [
|
|
3190
3190
|
/* @__PURE__ */ n(ne.Group, { selectedIndex: h, onChange: N, children: [
|
|
3191
3191
|
/* @__PURE__ */ n("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3192
|
-
/* @__PURE__ */ e(ne.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: E.map((
|
|
3192
|
+
/* @__PURE__ */ e(ne.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: E.map((I) => /* @__PURE__ */ e(
|
|
3193
3193
|
ne,
|
|
3194
3194
|
{
|
|
3195
3195
|
className: ({
|
|
@@ -3197,9 +3197,9 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3197
3197
|
}) => `w-full py-2 text-sm font-medium leading-5 rounded-md
|
|
3198
3198
|
focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
|
|
3199
3199
|
${M ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
|
|
3200
|
-
children:
|
|
3200
|
+
children: I
|
|
3201
3201
|
},
|
|
3202
|
-
|
|
3202
|
+
I
|
|
3203
3203
|
)) }),
|
|
3204
3204
|
/* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
|
|
3205
3205
|
he,
|
|
@@ -3217,11 +3217,11 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3217
3217
|
animate: { y: 0, opacity: 1 },
|
|
3218
3218
|
exit: { y: -10, opacity: 0 },
|
|
3219
3219
|
transition: { duration: 0.2 },
|
|
3220
|
-
children: /* @__PURE__ */ e(ne.Panels, { as: Q, children: A.map((
|
|
3220
|
+
children: /* @__PURE__ */ e(ne.Panels, { as: Q, children: A.map((I) => /* @__PURE__ */ e(
|
|
3221
3221
|
ne.Panel,
|
|
3222
3222
|
{
|
|
3223
3223
|
className: "space-y-3 focus:outline-none",
|
|
3224
|
-
children: /* @__PURE__ */ e(Ce, { children: d[
|
|
3224
|
+
children: /* @__PURE__ */ e(Ce, { children: d[I].length > 0 ? d[I].map((M) => /* @__PURE__ */ n(
|
|
3225
3225
|
le.div,
|
|
3226
3226
|
{
|
|
3227
3227
|
layout: !0,
|
|
@@ -3245,12 +3245,12 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3245
3245
|
),
|
|
3246
3246
|
/* @__PURE__ */ n("div", { className: "overflow-hidden", children: [
|
|
3247
3247
|
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: M.name }),
|
|
3248
|
-
|
|
3248
|
+
I !== "users" && /* @__PURE__ */ e(
|
|
3249
3249
|
"button",
|
|
3250
3250
|
{
|
|
3251
3251
|
onClick: () => i({
|
|
3252
3252
|
id: M.id,
|
|
3253
|
-
type:
|
|
3253
|
+
type: I,
|
|
3254
3254
|
name: M.name
|
|
3255
3255
|
}),
|
|
3256
3256
|
className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
|
|
@@ -3267,7 +3267,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3267
3267
|
onPermissionChange: (_) => g(
|
|
3268
3268
|
M,
|
|
3269
3269
|
_,
|
|
3270
|
-
|
|
3270
|
+
I
|
|
3271
3271
|
)
|
|
3272
3272
|
}
|
|
3273
3273
|
)
|
|
@@ -3295,7 +3295,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3295
3295
|
)
|
|
3296
3296
|
) })
|
|
3297
3297
|
},
|
|
3298
|
-
|
|
3298
|
+
I
|
|
3299
3299
|
)) })
|
|
3300
3300
|
},
|
|
3301
3301
|
h
|
|
@@ -3325,7 +3325,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3325
3325
|
onClose: s,
|
|
3326
3326
|
members: i
|
|
3327
3327
|
}) => {
|
|
3328
|
-
const [l, m] =
|
|
3328
|
+
const [l, m] = B(!0), [o, u] = B(""), h = Ct(o, 300), N = i.filter(
|
|
3329
3329
|
(d) => d.name.toLowerCase().includes(h.toLowerCase())
|
|
3330
3330
|
), y = {
|
|
3331
3331
|
hidden: { opacity: 0 },
|
|
@@ -3446,25 +3446,25 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3446
3446
|
allowedPermissions: u = [],
|
|
3447
3447
|
...h
|
|
3448
3448
|
}) => {
|
|
3449
|
-
const [N, y] =
|
|
3449
|
+
const [N, y] = B(pe.INVITE), [r, v] = B(t), [d, g] = B(null), [z, A] = B(!1), [E, I] = B([]), [M, _] = B(pe.MANAGE), U = () => {
|
|
3450
3450
|
y(pe.INVITE), g(null), m();
|
|
3451
3451
|
}, Y = () => {
|
|
3452
3452
|
y(pe.MANAGE);
|
|
3453
|
-
},
|
|
3454
|
-
if (
|
|
3453
|
+
}, q = async ({ id: f, name: C, type: O }) => {
|
|
3454
|
+
if (O === "groups") {
|
|
3455
3455
|
try {
|
|
3456
3456
|
const R = await Qe(`${We.getMembersForGroup(C)}`);
|
|
3457
3457
|
} catch (R) {
|
|
3458
3458
|
console.log("Error searching entities:", R);
|
|
3459
3459
|
}
|
|
3460
|
-
|
|
3460
|
+
I(resp);
|
|
3461
3461
|
}
|
|
3462
|
-
g({ id: f, type:
|
|
3462
|
+
g({ id: f, type: O, name: C }), _(N), y(pe.MEMBERS);
|
|
3463
3463
|
}, T = (f) => {
|
|
3464
3464
|
console.log("changedExistingShares", f), v(f);
|
|
3465
|
-
const C = lt.mapValues(t, (D) => D.map((b) => ({ id: b.id, permission: b.permission })).sort((b, p) => b.id - p.id)),
|
|
3466
|
-
console.log("Existing data:", C), console.log("Changed data:",
|
|
3467
|
-
const R = !lt.isEqual(C,
|
|
3465
|
+
const C = lt.mapValues(t, (D) => D.map((b) => ({ id: b.id, permission: b.permission })).sort((b, p) => b.id - p.id)), O = lt.mapValues(f, (D) => D.map((b) => ({ id: b.id, permission: b.permission })).sort((b, p) => b.id - p.id));
|
|
3466
|
+
console.log("Existing data:", C), console.log("Changed data:", O);
|
|
3467
|
+
const R = !lt.isEqual(C, O);
|
|
3468
3468
|
console.log("hasPermissionChanged:", R), A(R), y(N === pe.MEMBERS ? M : pe.INVITE);
|
|
3469
3469
|
};
|
|
3470
3470
|
return /* @__PURE__ */ e(ue, { appear: !0, show: a, as: Q, children: /* @__PURE__ */ n(be, { as: "div", className: "relative z-50", onClose: U, children: [
|
|
@@ -3486,7 +3486,7 @@ const Fe = Jn(), Qe = Fe.axiosGet, Vl = Fe.axiosDelete, yt = Fe.axiosPost, jl =
|
|
|
3486
3486
|
entity: i,
|
|
3487
3487
|
onBack: T,
|
|
3488
3488
|
onClose: U,
|
|
3489
|
-
onOpenMembers:
|
|
3489
|
+
onOpenMembers: q,
|
|
3490
3490
|
existingShares: r,
|
|
3491
3491
|
calledBy: l,
|
|
3492
3492
|
allowedPermissions: u
|
|
@@ -3575,7 +3575,7 @@ function tt({
|
|
|
3575
3575
|
getOptionId: d = (z) => String(z.id),
|
|
3576
3576
|
getOptionLabel: g = (z) => z.name
|
|
3577
3577
|
}) {
|
|
3578
|
-
const z = Xe(), A = Xe(), [E,
|
|
3578
|
+
const z = Xe(), A = Xe(), [E, I] = B(""), M = ge(""), _ = se(() => {
|
|
3579
3579
|
const f = /* @__PURE__ */ new Map();
|
|
3580
3580
|
for (const C of a) f.set(d(C), C);
|
|
3581
3581
|
return f;
|
|
@@ -3587,18 +3587,18 @@ function tt({
|
|
|
3587
3587
|
te(() => {
|
|
3588
3588
|
N === "server" && E.length >= v && E !== M.current && (M.current = E, y && y(E));
|
|
3589
3589
|
}, [E, N, v, y]);
|
|
3590
|
-
const
|
|
3590
|
+
const q = N === "client" ? Y : a, T = () => {
|
|
3591
3591
|
if (!U.length)
|
|
3592
3592
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
|
|
3593
3593
|
const f = U.slice(0, u), C = U.length - u;
|
|
3594
3594
|
return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2", children: [
|
|
3595
|
-
f.map((
|
|
3595
|
+
f.map((O) => /* @__PURE__ */ e(
|
|
3596
3596
|
"span",
|
|
3597
3597
|
{
|
|
3598
3598
|
className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
|
|
3599
|
-
children: g(
|
|
3599
|
+
children: g(O)
|
|
3600
3600
|
},
|
|
3601
|
-
d(
|
|
3601
|
+
d(O)
|
|
3602
3602
|
)),
|
|
3603
3603
|
C > 0 && /* @__PURE__ */ n("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
|
|
3604
3604
|
"+",
|
|
@@ -3608,7 +3608,7 @@ function tt({
|
|
|
3608
3608
|
] });
|
|
3609
3609
|
};
|
|
3610
3610
|
return /* @__PURE__ */ e(Z, { value: U, onChange: (f) => {
|
|
3611
|
-
const C = Array.from(new Set(f.map((
|
|
3611
|
+
const C = Array.from(new Set(f.map((O) => d(O))));
|
|
3612
3612
|
h !== -1 && C.length > h || i(C);
|
|
3613
3613
|
}, multiple: !0, by: "id", children: ({ open: f }) => /* @__PURE__ */ n("div", { children: [
|
|
3614
3614
|
/* @__PURE__ */ e(
|
|
@@ -3650,13 +3650,13 @@ function tt({
|
|
|
3650
3650
|
he,
|
|
3651
3651
|
{
|
|
3652
3652
|
value: E,
|
|
3653
|
-
onDebouncedChange:
|
|
3653
|
+
onDebouncedChange: I,
|
|
3654
3654
|
placeholder: N === "server" ? `Search (min ${v})…` : "Search options…"
|
|
3655
3655
|
}
|
|
3656
3656
|
) }),
|
|
3657
3657
|
N === "server" && r && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3658
|
-
|
|
3659
|
-
const
|
|
3658
|
+
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((C) => {
|
|
3659
|
+
const O = d(C), R = g(C), D = U.some((p) => d(p) === O), b = h !== -1 && U.length >= h && !D;
|
|
3660
3660
|
return /* @__PURE__ */ e(
|
|
3661
3661
|
Z.Option,
|
|
3662
3662
|
{
|
|
@@ -3689,7 +3689,7 @@ function tt({
|
|
|
3689
3689
|
)
|
|
3690
3690
|
] })
|
|
3691
3691
|
},
|
|
3692
|
-
|
|
3692
|
+
O
|
|
3693
3693
|
);
|
|
3694
3694
|
})
|
|
3695
3695
|
] })
|
|
@@ -3853,9 +3853,9 @@ function ls({
|
|
|
3853
3853
|
dropId: y,
|
|
3854
3854
|
indent: r = 24
|
|
3855
3855
|
}) {
|
|
3856
|
-
const { setNodeRef: v, isOver: d } = lr({ id: y }), { attributes: g, listeners: z, setNodeRef: A, transform: E, isDragging:
|
|
3856
|
+
const { setNodeRef: v, isOver: d } = lr({ id: y }), { attributes: g, listeners: z, setNodeRef: A, transform: E, isDragging: I } = ir({ id: N }), M = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [_, U] = B(!1), [Y, q] = B(t.name), T = () => {
|
|
3857
3857
|
const f = Y.trim();
|
|
3858
|
-
U(!1), f && f !== t.name ? o?.(t, f) :
|
|
3858
|
+
U(!1), f && f !== t.name ? o?.(t, f) : q(t.name);
|
|
3859
3859
|
}, x = se(() => /* @__PURE__ */ e(
|
|
3860
3860
|
Bn,
|
|
3861
3861
|
{
|
|
@@ -3873,7 +3873,7 @@ function ls({
|
|
|
3873
3873
|
"div",
|
|
3874
3874
|
{
|
|
3875
3875
|
ref: v,
|
|
3876
|
-
className: `tv-row ${d ? "tv-drop-over" : ""} ${
|
|
3876
|
+
className: `tv-row ${d ? "tv-drop-over" : ""} ${I ? "dragging" : ""}`,
|
|
3877
3877
|
style: { ...M, paddingLeft: 8 + a * r },
|
|
3878
3878
|
onClick: (f) => {
|
|
3879
3879
|
f.target.closest(".tv-toggle") || f.target.tagName === "INPUT" || l?.(t);
|
|
@@ -3886,10 +3886,10 @@ function ls({
|
|
|
3886
3886
|
{
|
|
3887
3887
|
className: "tv-input",
|
|
3888
3888
|
value: Y,
|
|
3889
|
-
onChange: (f) =>
|
|
3889
|
+
onChange: (f) => q(f.target.value),
|
|
3890
3890
|
onBlur: T,
|
|
3891
3891
|
onKeyDown: (f) => {
|
|
3892
|
-
f.key === "Enter" && T(), f.key === "Escape" && (U(!1),
|
|
3892
|
+
f.key === "Enter" && T(), f.key === "Escape" && (U(!1), q(t.name));
|
|
3893
3893
|
},
|
|
3894
3894
|
autoFocus: !0
|
|
3895
3895
|
}
|
|
@@ -3998,7 +3998,7 @@ function ql({
|
|
|
3998
3998
|
const { roots: z } = se(() => ds(t) ? us(t, { rootId: a, getId: i, getName: m }) : ms(
|
|
3999
3999
|
t.map((b) => ({ ...b })),
|
|
4000
4000
|
{ rootId: a, getId: i, getParent: l, getName: m }
|
|
4001
|
-
), [t, a, i, l, m]), [A, E] =
|
|
4001
|
+
), [t, a, i, l, m]), [A, E] = B({}), I = K((b) => {
|
|
4002
4002
|
const p = {};
|
|
4003
4003
|
return (function k(w) {
|
|
4004
4004
|
w.forEach(($) => {
|
|
@@ -4007,17 +4007,17 @@ function ql({
|
|
|
4007
4007
|
})(b), p;
|
|
4008
4008
|
}, []);
|
|
4009
4009
|
ae.useEffect(() => {
|
|
4010
|
-
E(
|
|
4011
|
-
}, [z,
|
|
4010
|
+
E(I(z));
|
|
4011
|
+
}, [z, I]);
|
|
4012
4012
|
const M = K(
|
|
4013
4013
|
(b) => E((p) => ({ ...p, [b]: !p[b] })),
|
|
4014
4014
|
[]
|
|
4015
|
-
), [_, U] =
|
|
4015
|
+
), [_, U] = B(() => Pe(z));
|
|
4016
4016
|
ae.useEffect(() => U(Pe(z)), [z]);
|
|
4017
4017
|
const Y = or(
|
|
4018
4018
|
cr(hr, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
4019
|
-
),
|
|
4020
|
-
},
|
|
4019
|
+
), q = ge(null), [T, x] = B(null), f = ge(0), C = () => {
|
|
4020
|
+
}, O = ({ delta: b }) => {
|
|
4021
4021
|
f.current = b?.x ?? 0;
|
|
4022
4022
|
}, R = K(
|
|
4023
4023
|
({ active: b, over: p }) => {
|
|
@@ -4028,25 +4028,25 @@ function ql({
|
|
|
4028
4028
|
let P = $;
|
|
4029
4029
|
const S = Math.max(0, Math.floor(-k / g));
|
|
4030
4030
|
if (S > 0) {
|
|
4031
|
-
let
|
|
4031
|
+
let W = $;
|
|
4032
4032
|
for (let xe = 0; xe < S; xe++) {
|
|
4033
|
-
const V = za(_,
|
|
4033
|
+
const V = za(_, W, null);
|
|
4034
4034
|
if (!V) break;
|
|
4035
4035
|
if (!V.parentId) {
|
|
4036
4036
|
P = a;
|
|
4037
4037
|
break;
|
|
4038
4038
|
}
|
|
4039
|
-
P = V.parentId,
|
|
4039
|
+
P = V.parentId, W = V.parentId;
|
|
4040
4040
|
}
|
|
4041
4041
|
}
|
|
4042
4042
|
if (d && P === a) {
|
|
4043
4043
|
U(Pe(z));
|
|
4044
4044
|
return;
|
|
4045
4045
|
}
|
|
4046
|
-
const
|
|
4046
|
+
const L = Pe(_), { newRoots: j, removed: F } = hs(L, w);
|
|
4047
4047
|
if (!F) return;
|
|
4048
|
-
const
|
|
4049
|
-
U(
|
|
4048
|
+
const G = ps(j, P, F);
|
|
4049
|
+
U(G), r?.({ sourceId: w, destParentId: P, newTree: G });
|
|
4050
4050
|
},
|
|
4051
4051
|
[_, z, a, d, g, r]
|
|
4052
4052
|
), D = K(
|
|
@@ -4100,10 +4100,10 @@ function ql({
|
|
|
4100
4100
|
collisionDetection: ur,
|
|
4101
4101
|
sensors: Y,
|
|
4102
4102
|
onDragStart: C,
|
|
4103
|
-
onDragMove:
|
|
4103
|
+
onDragMove: O,
|
|
4104
4104
|
onDragEnd: R,
|
|
4105
4105
|
modifiers: [mr],
|
|
4106
|
-
children: /* @__PURE__ */ e("div", { ref:
|
|
4106
|
+
children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: D(_, 0) })
|
|
4107
4107
|
}
|
|
4108
4108
|
)
|
|
4109
4109
|
] });
|
|
@@ -4253,7 +4253,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4253
4253
|
),
|
|
4254
4254
|
r.fieldtype === "text" && /* @__PURE__ */ n("div", { children: [
|
|
4255
4255
|
/* @__PURE__ */ e(
|
|
4256
|
-
|
|
4256
|
+
X,
|
|
4257
4257
|
{
|
|
4258
4258
|
type: "text",
|
|
4259
4259
|
name: r.key,
|
|
@@ -4295,7 +4295,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4295
4295
|
] }),
|
|
4296
4296
|
r.fieldtype === "number" && /* @__PURE__ */ n("div", { children: [
|
|
4297
4297
|
/* @__PURE__ */ e(
|
|
4298
|
-
|
|
4298
|
+
X,
|
|
4299
4299
|
{
|
|
4300
4300
|
type: "number",
|
|
4301
4301
|
name: r.key,
|
|
@@ -4370,7 +4370,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4370
4370
|
] }),
|
|
4371
4371
|
r.fieldtype === "email" && /* @__PURE__ */ n("div", { children: [
|
|
4372
4372
|
/* @__PURE__ */ e(
|
|
4373
|
-
|
|
4373
|
+
X,
|
|
4374
4374
|
{
|
|
4375
4375
|
type: "email",
|
|
4376
4376
|
name: r.key,
|
|
@@ -4390,7 +4390,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4390
4390
|
] }),
|
|
4391
4391
|
r.fieldtype === "url" && /* @__PURE__ */ n("div", { children: [
|
|
4392
4392
|
/* @__PURE__ */ e(
|
|
4393
|
-
|
|
4393
|
+
X,
|
|
4394
4394
|
{
|
|
4395
4395
|
type: "url",
|
|
4396
4396
|
name: r.key,
|
|
@@ -4410,7 +4410,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4410
4410
|
] }),
|
|
4411
4411
|
r.fieldtype === "password" && /* @__PURE__ */ n("div", { children: [
|
|
4412
4412
|
/* @__PURE__ */ e(
|
|
4413
|
-
|
|
4413
|
+
X,
|
|
4414
4414
|
{
|
|
4415
4415
|
type: "password",
|
|
4416
4416
|
name: r.key,
|
|
@@ -4547,7 +4547,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4547
4547
|
] }),
|
|
4548
4548
|
(r.fieldtype === "datetime" || r.fieldtype === "datetime-local") && /* @__PURE__ */ n("div", { children: [
|
|
4549
4549
|
/* @__PURE__ */ e(
|
|
4550
|
-
|
|
4550
|
+
X,
|
|
4551
4551
|
{
|
|
4552
4552
|
type: "datetime-local",
|
|
4553
4553
|
name: r.key,
|
|
@@ -4566,7 +4566,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4566
4566
|
] }),
|
|
4567
4567
|
r.fieldtype === "time" && /* @__PURE__ */ n("div", { children: [
|
|
4568
4568
|
/* @__PURE__ */ e(
|
|
4569
|
-
|
|
4569
|
+
X,
|
|
4570
4570
|
{
|
|
4571
4571
|
type: "time",
|
|
4572
4572
|
name: r.key,
|
|
@@ -4585,7 +4585,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4585
4585
|
] }),
|
|
4586
4586
|
r.fieldtype === "color" && /* @__PURE__ */ n("div", { children: [
|
|
4587
4587
|
/* @__PURE__ */ e(
|
|
4588
|
-
|
|
4588
|
+
X,
|
|
4589
4589
|
{
|
|
4590
4590
|
type: "color",
|
|
4591
4591
|
name: r.key,
|
|
@@ -4602,7 +4602,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4602
4602
|
] }),
|
|
4603
4603
|
r.fieldtype === "range" && /* @__PURE__ */ n("div", { children: [
|
|
4604
4604
|
/* @__PURE__ */ e(
|
|
4605
|
-
|
|
4605
|
+
X,
|
|
4606
4606
|
{
|
|
4607
4607
|
type: "range",
|
|
4608
4608
|
name: r.key,
|
|
@@ -4630,7 +4630,7 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4630
4630
|
] }),
|
|
4631
4631
|
r.fieldtype === "file" && /* @__PURE__ */ n("div", { children: [
|
|
4632
4632
|
/* @__PURE__ */ e(
|
|
4633
|
-
|
|
4633
|
+
X,
|
|
4634
4634
|
{
|
|
4635
4635
|
type: "file",
|
|
4636
4636
|
name: r.key,
|
|
@@ -4681,9 +4681,9 @@ function gs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4681
4681
|
const bs = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
4682
4682
|
function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
4683
4683
|
console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
|
|
4684
|
-
const [l, m] =
|
|
4684
|
+
const [l, m] = B(t), [o, u] = B(null), [h, N] = B(null);
|
|
4685
4685
|
console.log(`[DataTableRenderer] ${l.key} - Received props:`, { item: t, initialData: a });
|
|
4686
|
-
const [y, r] =
|
|
4686
|
+
const [y, r] = B(() => {
|
|
4687
4687
|
const x = a && a[l.key] || [], f = x.length > 0 ? x : [{ id: 0 }];
|
|
4688
4688
|
return console.log(`[DataTableRenderer] ${l.key} - Initial data:`, f), f;
|
|
4689
4689
|
}), v = ge(a);
|
|
@@ -4708,7 +4708,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4708
4708
|
const p = [...b];
|
|
4709
4709
|
return p[R][x.key] = D, p;
|
|
4710
4710
|
});
|
|
4711
|
-
}, C = (R) => i[l.key]?.[R]?.[x.key],
|
|
4711
|
+
}, C = (R) => i[l.key]?.[R]?.[x.key], O = (R) => {
|
|
4712
4712
|
const D = C(R);
|
|
4713
4713
|
return D ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: D }) : null;
|
|
4714
4714
|
};
|
|
@@ -4716,7 +4716,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4716
4716
|
case "text":
|
|
4717
4717
|
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4718
4718
|
/* @__PURE__ */ e(
|
|
4719
|
-
|
|
4719
|
+
X,
|
|
4720
4720
|
{
|
|
4721
4721
|
value: R[x.key] || "",
|
|
4722
4722
|
onChange: (b) => f(D, b.target.value),
|
|
@@ -4725,7 +4725,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4725
4725
|
className: `w-full ${C(D) ? "border-red-500" : ""}`
|
|
4726
4726
|
}
|
|
4727
4727
|
),
|
|
4728
|
-
|
|
4728
|
+
O(D)
|
|
4729
4729
|
] });
|
|
4730
4730
|
case "textarea":
|
|
4731
4731
|
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
@@ -4740,12 +4740,12 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4740
4740
|
rows: 3
|
|
4741
4741
|
}
|
|
4742
4742
|
),
|
|
4743
|
-
|
|
4743
|
+
O(D)
|
|
4744
4744
|
] });
|
|
4745
4745
|
case "number":
|
|
4746
4746
|
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4747
4747
|
/* @__PURE__ */ e(
|
|
4748
|
-
|
|
4748
|
+
X,
|
|
4749
4749
|
{
|
|
4750
4750
|
type: "number",
|
|
4751
4751
|
value: R[x.key] || "",
|
|
@@ -4773,12 +4773,12 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4773
4773
|
"Max: ",
|
|
4774
4774
|
x.max
|
|
4775
4775
|
] }),
|
|
4776
|
-
|
|
4776
|
+
O(D)
|
|
4777
4777
|
] });
|
|
4778
4778
|
case "email":
|
|
4779
4779
|
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4780
4780
|
/* @__PURE__ */ e(
|
|
4781
|
-
|
|
4781
|
+
X,
|
|
4782
4782
|
{
|
|
4783
4783
|
type: "email",
|
|
4784
4784
|
value: R[x.key] || "",
|
|
@@ -4788,12 +4788,12 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4788
4788
|
className: `w-full ${C(D) ? "border-red-500" : ""}`
|
|
4789
4789
|
}
|
|
4790
4790
|
),
|
|
4791
|
-
|
|
4791
|
+
O(D)
|
|
4792
4792
|
] });
|
|
4793
4793
|
case "url":
|
|
4794
4794
|
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4795
4795
|
/* @__PURE__ */ e(
|
|
4796
|
-
|
|
4796
|
+
X,
|
|
4797
4797
|
{
|
|
4798
4798
|
type: "url",
|
|
4799
4799
|
value: R[x.key] || "",
|
|
@@ -4803,12 +4803,12 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4803
4803
|
className: `w-full ${C(D) ? "border-red-500" : ""}`
|
|
4804
4804
|
}
|
|
4805
4805
|
),
|
|
4806
|
-
|
|
4806
|
+
O(D)
|
|
4807
4807
|
] });
|
|
4808
4808
|
case "password":
|
|
4809
4809
|
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
4810
4810
|
/* @__PURE__ */ e(
|
|
4811
|
-
|
|
4811
|
+
X,
|
|
4812
4812
|
{
|
|
4813
4813
|
type: "password",
|
|
4814
4814
|
value: R[x.key] || "",
|
|
@@ -4818,7 +4818,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4818
4818
|
className: `w-full ${C(D) ? "border-red-500" : ""}`
|
|
4819
4819
|
}
|
|
4820
4820
|
),
|
|
4821
|
-
|
|
4821
|
+
O(D)
|
|
4822
4822
|
] });
|
|
4823
4823
|
case "select":
|
|
4824
4824
|
case "dropdown":
|
|
@@ -4834,7 +4834,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4834
4834
|
className: `w-full ${C(D) ? "border-red-500" : ""}`
|
|
4835
4835
|
}
|
|
4836
4836
|
),
|
|
4837
|
-
|
|
4837
|
+
O(D)
|
|
4838
4838
|
] });
|
|
4839
4839
|
case "selectDynamic":
|
|
4840
4840
|
return (R, D) => {
|
|
@@ -4864,7 +4864,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4864
4864
|
},
|
|
4865
4865
|
Math.random()
|
|
4866
4866
|
),
|
|
4867
|
-
|
|
4867
|
+
O(D)
|
|
4868
4868
|
] });
|
|
4869
4869
|
};
|
|
4870
4870
|
case "multiselect":
|
|
@@ -4915,7 +4915,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4915
4915
|
);
|
|
4916
4916
|
case "datetime":
|
|
4917
4917
|
return (R, D) => /* @__PURE__ */ e(
|
|
4918
|
-
|
|
4918
|
+
X,
|
|
4919
4919
|
{
|
|
4920
4920
|
type: "datetime-local",
|
|
4921
4921
|
value: R[x.key] || "",
|
|
@@ -4927,7 +4927,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4927
4927
|
);
|
|
4928
4928
|
case "time":
|
|
4929
4929
|
return (R, D) => /* @__PURE__ */ e(
|
|
4930
|
-
|
|
4930
|
+
X,
|
|
4931
4931
|
{
|
|
4932
4932
|
type: "time",
|
|
4933
4933
|
value: R[x.key] || "",
|
|
@@ -4988,7 +4988,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4988
4988
|
};
|
|
4989
4989
|
case "color":
|
|
4990
4990
|
return (R, D) => /* @__PURE__ */ e(
|
|
4991
|
-
|
|
4991
|
+
X,
|
|
4992
4992
|
{
|
|
4993
4993
|
type: "color",
|
|
4994
4994
|
value: R[x.key] || "#000000",
|
|
@@ -4999,7 +4999,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4999
4999
|
case "range":
|
|
5000
5000
|
return (R, D) => /* @__PURE__ */ n("div", { className: "w-full", children: [
|
|
5001
5001
|
/* @__PURE__ */ e(
|
|
5002
|
-
|
|
5002
|
+
X,
|
|
5003
5003
|
{
|
|
5004
5004
|
type: "range",
|
|
5005
5005
|
value: R[x.key] || x.min || 0,
|
|
@@ -5014,7 +5014,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5014
5014
|
] });
|
|
5015
5015
|
case "file":
|
|
5016
5016
|
return (R, D) => /* @__PURE__ */ e(
|
|
5017
|
-
|
|
5017
|
+
X,
|
|
5018
5018
|
{
|
|
5019
5019
|
type: "file",
|
|
5020
5020
|
onChange: (b) => {
|
|
@@ -5027,7 +5027,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5027
5027
|
);
|
|
5028
5028
|
case "hidden":
|
|
5029
5029
|
return (R, D) => /* @__PURE__ */ e(
|
|
5030
|
-
|
|
5030
|
+
X,
|
|
5031
5031
|
{
|
|
5032
5032
|
type: "hidden",
|
|
5033
5033
|
value: R[x.key] || "",
|
|
@@ -5038,7 +5038,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5038
5038
|
default:
|
|
5039
5039
|
return (R, D) => /* @__PURE__ */ n("div", { children: [
|
|
5040
5040
|
/* @__PURE__ */ e(
|
|
5041
|
-
|
|
5041
|
+
X,
|
|
5042
5042
|
{
|
|
5043
5043
|
value: R[x.key] || "",
|
|
5044
5044
|
onChange: (b) => f(D, b.target.value),
|
|
@@ -5047,7 +5047,7 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5047
5047
|
className: `w-full ${C(D) ? "border-red-500" : ""}`
|
|
5048
5048
|
}
|
|
5049
5049
|
),
|
|
5050
|
-
|
|
5050
|
+
O(D)
|
|
5051
5051
|
] });
|
|
5052
5052
|
}
|
|
5053
5053
|
}, A = K(() => {
|
|
@@ -5057,8 +5057,8 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5057
5057
|
id: x.length
|
|
5058
5058
|
// Assign next available ID
|
|
5059
5059
|
};
|
|
5060
|
-
l.fields.forEach((
|
|
5061
|
-
|
|
5060
|
+
l.fields.forEach((O) => {
|
|
5061
|
+
O.fieldtype === "audience" ? f[O.key] = { users: [], groups: [], roles: [] } : f[O.key] = O.default || "";
|
|
5062
5062
|
}), console.log("[DataTableRenderer] New blank row:", f);
|
|
5063
5063
|
const C = [...x, f];
|
|
5064
5064
|
return console.log("[DataTableRenderer] Updated data:", C), C;
|
|
@@ -5070,22 +5070,22 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5070
5070
|
const C = [...f];
|
|
5071
5071
|
return C.splice(x, 1), C;
|
|
5072
5072
|
});
|
|
5073
|
-
}, []), [
|
|
5073
|
+
}, []), [I, M] = B(null), _ = K((x, f) => {
|
|
5074
5074
|
M(f), x.dataTransfer.effectAllowed = "move", x.dataTransfer.setData("text/html", "");
|
|
5075
5075
|
}, []), U = K((x) => {
|
|
5076
5076
|
x.preventDefault(), x.dataTransfer.dropEffect = "move";
|
|
5077
5077
|
}, []), Y = K((x, f) => {
|
|
5078
|
-
x.preventDefault(), !(
|
|
5079
|
-
const
|
|
5080
|
-
return
|
|
5078
|
+
x.preventDefault(), !(I === null || I === f) && (r((C) => {
|
|
5079
|
+
const O = [...C], R = O[I];
|
|
5080
|
+
return O.splice(I, 1), O.splice(f, 0, R), O;
|
|
5081
5081
|
}), M(null));
|
|
5082
|
-
}, [
|
|
5082
|
+
}, [I]), q = K(() => {
|
|
5083
5083
|
M(null);
|
|
5084
5084
|
}, []), T = K((x) => {
|
|
5085
5085
|
console.log("[DataTableRenderer] handleAddAudience called with:", x), r((f) => {
|
|
5086
5086
|
const C = [...f];
|
|
5087
5087
|
if (o !== null && h && C[o]) {
|
|
5088
|
-
const
|
|
5088
|
+
const O = x.pendingInvites || [], R = O.filter((p) => p.type === "User"), D = O.filter((p) => p.type === "Group"), b = O.filter((p) => p.type === "Role");
|
|
5089
5089
|
C[o][h] = {
|
|
5090
5090
|
users: [...C[o][h]?.users || [], ...R],
|
|
5091
5091
|
groups: [...C[o][h]?.groups || [], ...D],
|
|
@@ -5126,15 +5126,15 @@ function fs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5126
5126
|
/* @__PURE__ */ e("tbody", { children: y.map((x, f) => /* @__PURE__ */ n(
|
|
5127
5127
|
"tr",
|
|
5128
5128
|
{
|
|
5129
|
-
className: `hover:bg-gray-50 ${
|
|
5129
|
+
className: `hover:bg-gray-50 ${I === f ? "opacity-50" : ""}`,
|
|
5130
5130
|
draggable: !0,
|
|
5131
5131
|
onDragStart: (C) => _(C, f),
|
|
5132
5132
|
onDragOver: U,
|
|
5133
5133
|
onDrop: (C) => Y(C, f),
|
|
5134
|
-
onDragEnd:
|
|
5134
|
+
onDragEnd: q,
|
|
5135
5135
|
children: [
|
|
5136
5136
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e("div", { className: "cursor-move text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ e(Nt, { size: 16 }) }) }),
|
|
5137
|
-
l.fields.map((C,
|
|
5137
|
+
l.fields.map((C, O) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: z(C)(x, f) }, O)),
|
|
5138
5138
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
5139
5139
|
"button",
|
|
5140
5140
|
{
|
|
@@ -5192,7 +5192,7 @@ function Ns({
|
|
|
5192
5192
|
onShowCancelModal: l,
|
|
5193
5193
|
onCancel: m
|
|
5194
5194
|
}) {
|
|
5195
|
-
const [o, u] = ae.useState(a), [h, N] = ae.useState(null), [y, r] = ae.useState(null), [v, d] =
|
|
5195
|
+
const [o, u] = ae.useState(a), [h, N] = ae.useState(null), [y, r] = ae.useState(null), [v, d] = B(!1), [g, z] = B(!1), [A, E] = B({}), I = `${Se()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, M = I, [_, U] = B(1), Y = () => {
|
|
5196
5196
|
if (!y || !h)
|
|
5197
5197
|
return console.log("[DynamicConfig] hasUnsavedChanges: false (no data)", { originalData: y, data: h }), !1;
|
|
5198
5198
|
const b = ($) => {
|
|
@@ -5209,30 +5209,30 @@ function Ns({
|
|
|
5209
5209
|
originalRaw: y,
|
|
5210
5210
|
currentRaw: h
|
|
5211
5211
|
}), w;
|
|
5212
|
-
},
|
|
5212
|
+
}, q = (b) => {
|
|
5213
5213
|
if (!a || !a.configuration)
|
|
5214
5214
|
return b;
|
|
5215
5215
|
const p = {}, k = b?.configuration || {};
|
|
5216
5216
|
return a.configuration.forEach((w) => {
|
|
5217
5217
|
if (w.key && w.type === "datatable") {
|
|
5218
|
-
const P = (k[w.key] || []).map((S,
|
|
5218
|
+
const P = (k[w.key] || []).map((S, L) => {
|
|
5219
5219
|
const j = { id: S.id || 0 };
|
|
5220
5220
|
return w.fields && w.fields.forEach((F) => {
|
|
5221
5221
|
if (F.fieldtype === "audience") {
|
|
5222
|
-
let
|
|
5223
|
-
S[F.key] && (Array.isArray(S[F.key]) ?
|
|
5222
|
+
let G = { users: [], groups: [], roles: [] };
|
|
5223
|
+
S[F.key] && (Array.isArray(S[F.key]) ? G = { users: [], groups: [], roles: [] } : typeof S[F.key] == "object" && (G = {
|
|
5224
5224
|
users: S[F.key].users || [],
|
|
5225
5225
|
groups: S[F.key].groups || [],
|
|
5226
5226
|
roles: S[F.key].roles || []
|
|
5227
|
-
})), j[F.key] =
|
|
5227
|
+
})), j[F.key] = G;
|
|
5228
5228
|
} else
|
|
5229
5229
|
j[F.key] = S[F.key] || F.default || "";
|
|
5230
5230
|
}), j;
|
|
5231
5231
|
});
|
|
5232
5232
|
if (P.length === 0) {
|
|
5233
5233
|
const S = { id: 0 };
|
|
5234
|
-
w.fields && w.fields.forEach((
|
|
5235
|
-
|
|
5234
|
+
w.fields && w.fields.forEach((L) => {
|
|
5235
|
+
L.fieldtype === "audience" ? S[L.key] = { users: [], groups: [], roles: [] } : S[L.key] = L.default || "";
|
|
5236
5236
|
}), P.push(S);
|
|
5237
5237
|
}
|
|
5238
5238
|
p[w.key] = P;
|
|
@@ -5271,9 +5271,9 @@ function Ns({
|
|
|
5271
5271
|
const b = async () => {
|
|
5272
5272
|
try {
|
|
5273
5273
|
d(!0);
|
|
5274
|
-
let p = await Qe(
|
|
5274
|
+
let p = await Qe(I);
|
|
5275
5275
|
if (p) {
|
|
5276
|
-
const k =
|
|
5276
|
+
const k = q(p);
|
|
5277
5277
|
N(k), r(k);
|
|
5278
5278
|
} else
|
|
5279
5279
|
T();
|
|
@@ -5327,14 +5327,14 @@ function Ns({
|
|
|
5327
5327
|
return;
|
|
5328
5328
|
}
|
|
5329
5329
|
if (P.fieldtype === "number" && S !== "" && S !== null && S !== void 0) {
|
|
5330
|
-
const
|
|
5331
|
-
isNaN(
|
|
5330
|
+
const L = Number(S);
|
|
5331
|
+
isNaN(L) ? (b[p.key] || (b[p.key] = {}), b[p.key][$] || (b[p.key][$] = {}), b[p.key][$][P.key] = `${P.label} must be a valid number`) : (P.min !== void 0 && L < P.min && (b[p.key] || (b[p.key] = {}), b[p.key][$] || (b[p.key][$] = {}), b[p.key][$][P.key] = `${P.label} must be at least ${P.min}`), P.max !== void 0 && L > P.max && (b[p.key] || (b[p.key] = {}), b[p.key][$] || (b[p.key][$] = {}), b[p.key][$][P.key] = `${P.label} must not exceed ${P.max}`));
|
|
5332
5332
|
}
|
|
5333
5333
|
});
|
|
5334
5334
|
});
|
|
5335
5335
|
}
|
|
5336
5336
|
}), b;
|
|
5337
|
-
}, C = (b) => Object.keys(b).length > 0,
|
|
5337
|
+
}, C = (b) => Object.keys(b).length > 0, O = () => {
|
|
5338
5338
|
if (g) {
|
|
5339
5339
|
console.log("[handleSave] Already saving, ignoring duplicate call");
|
|
5340
5340
|
return;
|
|
@@ -5361,7 +5361,7 @@ function Ns({
|
|
|
5361
5361
|
(S) => S.key === $ && S.type === "datatable"
|
|
5362
5362
|
);
|
|
5363
5363
|
P && Array.isArray(h[$]) ? k[$] = h[$].map((S) => {
|
|
5364
|
-
const
|
|
5364
|
+
const L = { id: S.id || 0 };
|
|
5365
5365
|
return P.fields && P.fields.forEach((j) => {
|
|
5366
5366
|
if (j.fieldtype === "audience") {
|
|
5367
5367
|
let F = { users: [], groups: [], roles: [] };
|
|
@@ -5369,10 +5369,10 @@ function Ns({
|
|
|
5369
5369
|
users: S[j.key].users || [],
|
|
5370
5370
|
groups: S[j.key].groups || [],
|
|
5371
5371
|
roles: S[j.key].roles || []
|
|
5372
|
-
}),
|
|
5372
|
+
}), L[j.key] = F;
|
|
5373
5373
|
} else
|
|
5374
|
-
|
|
5375
|
-
}),
|
|
5374
|
+
L[j.key] = S[j.key] || "";
|
|
5375
|
+
}), L;
|
|
5376
5376
|
}) : k[$] = h[$];
|
|
5377
5377
|
}), (!k.appkey || k.appkey === "") && (k.appkey = t);
|
|
5378
5378
|
let w = await yt(M, k);
|
|
@@ -5436,7 +5436,7 @@ function Ns({
|
|
|
5436
5436
|
oe,
|
|
5437
5437
|
{
|
|
5438
5438
|
category: "primary",
|
|
5439
|
-
onClick:
|
|
5439
|
+
onClick: O,
|
|
5440
5440
|
disabled: g,
|
|
5441
5441
|
label: g ? "Saving..." : "Save",
|
|
5442
5442
|
type: "submit"
|
|
@@ -5450,7 +5450,7 @@ const Jl = ({
|
|
|
5450
5450
|
appid: a = "Configuration-Page",
|
|
5451
5451
|
disableApi: s = !1
|
|
5452
5452
|
}) => {
|
|
5453
|
-
const [i, l] =
|
|
5453
|
+
const [i, l] = B(0), [m, o] = B(!1), {
|
|
5454
5454
|
pageHeader: u = {},
|
|
5455
5455
|
appletHeader: h = {},
|
|
5456
5456
|
breadcrumb: N = [],
|
|
@@ -5458,10 +5458,10 @@ const Jl = ({
|
|
|
5458
5458
|
configuration: r = []
|
|
5459
5459
|
} = t, v = se(() => r.map((f) => {
|
|
5460
5460
|
if (f.type === "section" && f.fields) {
|
|
5461
|
-
const C = [...f.fields],
|
|
5462
|
-
if (
|
|
5463
|
-
const R = C[
|
|
5464
|
-
if (C[
|
|
5461
|
+
const C = [...f.fields], O = C.findIndex((R) => R && R.key === "appkey");
|
|
5462
|
+
if (O !== -1) {
|
|
5463
|
+
const R = C[O];
|
|
5464
|
+
if (C[O] = {
|
|
5465
5465
|
...R,
|
|
5466
5466
|
default: a,
|
|
5467
5467
|
value: a,
|
|
@@ -5485,7 +5485,7 @@ const Jl = ({
|
|
|
5485
5485
|
placeholder: "Enter display name",
|
|
5486
5486
|
required: !1
|
|
5487
5487
|
};
|
|
5488
|
-
C.splice(
|
|
5488
|
+
C.splice(O + 1, 0, b);
|
|
5489
5489
|
}
|
|
5490
5490
|
}
|
|
5491
5491
|
return {
|
|
@@ -5509,13 +5509,13 @@ const Jl = ({
|
|
|
5509
5509
|
o(!1), f.primary && window.location.reload();
|
|
5510
5510
|
}, []), E = K((f) => {
|
|
5511
5511
|
console.log("Configuration changed:", f);
|
|
5512
|
-
}, []),
|
|
5512
|
+
}, []), I = K(() => {
|
|
5513
5513
|
window.history.back();
|
|
5514
5514
|
}, []), M = (() => {
|
|
5515
5515
|
if (h.headingKey && Array.isArray(r)) {
|
|
5516
|
-
const f = h.headingKey.split("."), C = f[0],
|
|
5516
|
+
const f = h.headingKey.split("."), C = f[0], O = f[1], R = r.find((D) => D && D.key === C);
|
|
5517
5517
|
if (R && R.fields) {
|
|
5518
|
-
const D = R.fields.find((b) => b && b.key ===
|
|
5518
|
+
const D = R.fields.find((b) => b && b.key === O);
|
|
5519
5519
|
if (D)
|
|
5520
5520
|
return D.default ?? D.value ?? h.heading ?? a;
|
|
5521
5521
|
}
|
|
@@ -5523,7 +5523,7 @@ const Jl = ({
|
|
|
5523
5523
|
if (Array.isArray(r)) {
|
|
5524
5524
|
for (const f of r)
|
|
5525
5525
|
if (f && f.fields) {
|
|
5526
|
-
const C = f.fields.find((
|
|
5526
|
+
const C = f.fields.find((O) => O && O.key === "displayname");
|
|
5527
5527
|
if (C) return C.default ?? C.value ?? a;
|
|
5528
5528
|
}
|
|
5529
5529
|
}
|
|
@@ -5554,10 +5554,10 @@ const Jl = ({
|
|
|
5554
5554
|
...y
|
|
5555
5555
|
}, Y = se(() => ({
|
|
5556
5556
|
configuration: v
|
|
5557
|
-
}), [v]),
|
|
5557
|
+
}), [v]), q = se(() => [
|
|
5558
5558
|
{ label: "Overview", content: x(U) },
|
|
5559
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Ns, { appid: a, configdata: Y, disableApi: s, onSave: E, onShowCancelModal: z, onCancel:
|
|
5560
|
-
], [a, Y, s, E, z,
|
|
5559
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Ns, { appid: a, configdata: Y, disableApi: s, onSave: E, onShowCancelModal: z, onCancel: I }) }
|
|
5560
|
+
], [a, Y, s, E, z, I, U]);
|
|
5561
5561
|
function T(f) {
|
|
5562
5562
|
return f ? f.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: f } }) : f : "📱";
|
|
5563
5563
|
}
|
|
@@ -5587,11 +5587,11 @@ const Jl = ({
|
|
|
5587
5587
|
] }),
|
|
5588
5588
|
/* @__PURE__ */ n("section", { children: [
|
|
5589
5589
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
|
|
5590
|
-
/* @__PURE__ */ e("ul", { className: "space-y-3", children: f.features.map((C,
|
|
5590
|
+
/* @__PURE__ */ e("ul", { className: "space-y-3", children: f.features.map((C, O) => /* @__PURE__ */ n("li", { children: [
|
|
5591
5591
|
/* @__PURE__ */ e("span", { className: "font-semibold", children: C.title }),
|
|
5592
5592
|
/* @__PURE__ */ e("br", {}),
|
|
5593
5593
|
/* @__PURE__ */ e("span", { className: "text-gray-700", children: C.description })
|
|
5594
|
-
] },
|
|
5594
|
+
] }, O)) })
|
|
5595
5595
|
] })
|
|
5596
5596
|
] });
|
|
5597
5597
|
}
|
|
@@ -5622,7 +5622,7 @@ const Jl = ({
|
|
|
5622
5622
|
] })
|
|
5623
5623
|
] }),
|
|
5624
5624
|
/* @__PURE__ */ n("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
|
|
5625
|
-
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children:
|
|
5625
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((f, C) => /* @__PURE__ */ e(
|
|
5626
5626
|
"button",
|
|
5627
5627
|
{
|
|
5628
5628
|
onClick: () => l(C),
|
|
@@ -5631,7 +5631,7 @@ const Jl = ({
|
|
|
5631
5631
|
},
|
|
5632
5632
|
C
|
|
5633
5633
|
)) }) }),
|
|
5634
|
-
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children:
|
|
5634
|
+
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: q[i].content })
|
|
5635
5635
|
] }),
|
|
5636
5636
|
/* @__PURE__ */ e(
|
|
5637
5637
|
Rn,
|
|
@@ -5656,7 +5656,7 @@ const Jl = ({
|
|
|
5656
5656
|
allowReorder: o = !0,
|
|
5657
5657
|
initialData: u = null
|
|
5658
5658
|
}) => {
|
|
5659
|
-
const [h, N] =
|
|
5659
|
+
const [h, N] = B(null), [y, r] = B(""), [v, d] = B(() => Array.isArray(u) ? u : []), [g, z] = B(null), [A, E] = B(null), [I, M] = B("");
|
|
5660
5660
|
te(() => {
|
|
5661
5661
|
Array.isArray(u) && d(u);
|
|
5662
5662
|
}, [u]);
|
|
@@ -5672,7 +5672,7 @@ const Jl = ({
|
|
|
5672
5672
|
categoryName: "",
|
|
5673
5673
|
links: [],
|
|
5674
5674
|
order: (w.at(-1)?.order ?? 0) + 1,
|
|
5675
|
-
|
|
5675
|
+
protected: !1,
|
|
5676
5676
|
_class: "com.unifyed.model.Collection"
|
|
5677
5677
|
}
|
|
5678
5678
|
]), N(k), r("");
|
|
@@ -5681,7 +5681,7 @@ const Jl = ({
|
|
|
5681
5681
|
const w = !Array.isArray(u) || !u.some(($) => $._id === h) ? p.filter(($) => $._id !== h) : p;
|
|
5682
5682
|
return a?.(w), w;
|
|
5683
5683
|
}), N(null), r(""));
|
|
5684
|
-
},
|
|
5684
|
+
}, q = () => {
|
|
5685
5685
|
h == null || !y.trim() || (d((p) => {
|
|
5686
5686
|
const k = p.map((w) => w._id === h ? {
|
|
5687
5687
|
...w,
|
|
@@ -5695,35 +5695,36 @@ const Jl = ({
|
|
|
5695
5695
|
return a?.(w), w;
|
|
5696
5696
|
});
|
|
5697
5697
|
}, x = (p, k, w) => {
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5698
|
+
const $ = Number(k), P = Number(w);
|
|
5699
|
+
if (!o || $ === P) return p;
|
|
5700
|
+
const S = p.findIndex((G) => Number(G._id) === $), L = p.findIndex((G) => Number(G._id) === P);
|
|
5701
|
+
if (S === -1 || L === -1) return p;
|
|
5702
|
+
const j = [...p], [F] = j.splice(S, 1);
|
|
5703
|
+
return j.splice(L, 0, F), j.map((G, W) => ({ ...G, order: W + 1 }));
|
|
5703
5704
|
}, f = (p, k) => {
|
|
5704
|
-
o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(k)), z(k));
|
|
5705
|
+
o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(k)), z(Number(k)));
|
|
5705
5706
|
}, C = (p) => {
|
|
5706
5707
|
g && p !== A && E(p);
|
|
5707
|
-
},
|
|
5708
|
+
}, O = (p) => {
|
|
5708
5709
|
p.preventDefault();
|
|
5709
5710
|
}, R = (p, k) => {
|
|
5710
5711
|
p.preventDefault();
|
|
5711
|
-
const w = p.dataTransfer.getData("text/plain");
|
|
5712
|
-
|
|
5713
|
-
const
|
|
5714
|
-
return
|
|
5712
|
+
const w = p.dataTransfer.getData("text/plain"), $ = w === "0" ? 0 : Number(w), P = k === "0" ? 0 : Number(k);
|
|
5713
|
+
$ === void 0 || P === void 0 || (d((S) => {
|
|
5714
|
+
const L = x(S, $, P);
|
|
5715
|
+
return a?.(L), L;
|
|
5715
5716
|
}), z(null), E(null));
|
|
5716
5717
|
}, D = () => {
|
|
5717
5718
|
z(null), E(null);
|
|
5718
5719
|
}, b = Array.isArray(v) ? v.filter(
|
|
5719
|
-
(p) => p.categoryName?.toLowerCase().includes(
|
|
5720
|
+
(p) => p.categoryName?.toLowerCase().includes(I.toLowerCase())
|
|
5720
5721
|
) : [];
|
|
5721
5722
|
return /* @__PURE__ */ n("div", { className: `manage-collection-list ${t}`, children: [
|
|
5722
5723
|
/* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ n("div", { className: "w-1/2 flex justify-end", children: [
|
|
5723
5724
|
s && /* @__PURE__ */ e(
|
|
5724
5725
|
he,
|
|
5725
5726
|
{
|
|
5726
|
-
value:
|
|
5727
|
+
value: I,
|
|
5727
5728
|
onDebouncedChange: M,
|
|
5728
5729
|
placeholder: "Search Collection",
|
|
5729
5730
|
customClass: "mr-4 searchmanagecollection"
|
|
@@ -5748,8 +5749,9 @@ const Jl = ({
|
|
|
5748
5749
|
"div",
|
|
5749
5750
|
{
|
|
5750
5751
|
onDragEnter: () => C(p._id),
|
|
5751
|
-
onDragOver:
|
|
5752
|
+
onDragOver: O,
|
|
5752
5753
|
onDrop: (S) => R(S, p._id),
|
|
5754
|
+
onDragEnd: D,
|
|
5753
5755
|
className: [
|
|
5754
5756
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5755
5757
|
"border-gray-300",
|
|
@@ -5766,7 +5768,7 @@ const Jl = ({
|
|
|
5766
5768
|
placeholder: !Array.isArray(u) || !u.some((S) => S._id === p._id) ? "New collection name" : "Edit collection name",
|
|
5767
5769
|
onChange: (S) => r(S.target.value),
|
|
5768
5770
|
onKeyDown: (S) => {
|
|
5769
|
-
S.key === "Enter" &&
|
|
5771
|
+
S.key === "Enter" && q(), S.key === "Escape" && Y();
|
|
5770
5772
|
},
|
|
5771
5773
|
autoFocus: !0
|
|
5772
5774
|
}
|
|
@@ -5788,7 +5790,7 @@ const Jl = ({
|
|
|
5788
5790
|
"border p-2 rounded-2xl",
|
|
5789
5791
|
y.trim() ? "cursor-pointer border-gray-300" : "cursor-not-allowed border-gray-200"
|
|
5790
5792
|
].join(" "),
|
|
5791
|
-
onClick:
|
|
5793
|
+
onClick: q,
|
|
5792
5794
|
"aria-label": "Save",
|
|
5793
5795
|
disabled: !y.trim(),
|
|
5794
5796
|
title: y.trim() ? "Save" : "Name required",
|
|
@@ -5806,7 +5808,6 @@ const Jl = ({
|
|
|
5806
5808
|
className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
|
|
5807
5809
|
draggable: !0,
|
|
5808
5810
|
onDragStart: (S) => f(S, p._id),
|
|
5809
|
-
onDragEnd: D,
|
|
5810
5811
|
children: /* @__PURE__ */ e(Nt, {})
|
|
5811
5812
|
}
|
|
5812
5813
|
),
|
|
@@ -5865,7 +5866,7 @@ function Xl({ children: t }) {
|
|
|
5865
5866
|
/* @__PURE__ */ e("div", { id: "ui-toast-backdrop", "aria-hidden": "true" })
|
|
5866
5867
|
] });
|
|
5867
5868
|
}
|
|
5868
|
-
const
|
|
5869
|
+
const Oe = {
|
|
5869
5870
|
containerId: "ui-toast",
|
|
5870
5871
|
position: "bottom-right",
|
|
5871
5872
|
autoClose: 3500,
|
|
@@ -5879,12 +5880,12 @@ const Lt = () => {
|
|
|
5879
5880
|
}, Bt = () => {
|
|
5880
5881
|
typeof document > "u" || (Je = Math.max(0, Je - 1), Je === 0 && document.body.classList.remove("toast-backdrop"));
|
|
5881
5882
|
}, Ge = {
|
|
5882
|
-
success: (t, a) =>
|
|
5883
|
-
info: (t, a) =>
|
|
5884
|
-
warn: (t, a) =>
|
|
5883
|
+
success: (t, a) => Ie.success(t, { ...Oe, ...a }),
|
|
5884
|
+
info: (t, a) => Ie.info(t, { ...Oe, ...a }),
|
|
5885
|
+
warn: (t, a) => Ie.warn(t, { ...Oe, ...a }),
|
|
5885
5886
|
// Error: no autoClose + modal-like behavior via backdrop
|
|
5886
|
-
error: (t, a) =>
|
|
5887
|
-
...
|
|
5887
|
+
error: (t, a) => Ie.error(t, {
|
|
5888
|
+
...Oe,
|
|
5888
5889
|
autoClose: !1,
|
|
5889
5890
|
closeOnClick: !1,
|
|
5890
5891
|
draggable: !1,
|
|
@@ -5893,7 +5894,7 @@ const Lt = () => {
|
|
|
5893
5894
|
...a
|
|
5894
5895
|
}),
|
|
5895
5896
|
// Promise helper (error branch inherits the modal behavior)
|
|
5896
|
-
promise: (t, a, s) =>
|
|
5897
|
+
promise: (t, a, s) => Ie.promise(
|
|
5897
5898
|
t,
|
|
5898
5899
|
{
|
|
5899
5900
|
pending: a?.pending,
|
|
@@ -5907,7 +5908,7 @@ const Lt = () => {
|
|
|
5907
5908
|
onClose: Bt
|
|
5908
5909
|
}
|
|
5909
5910
|
},
|
|
5910
|
-
{ ...
|
|
5911
|
+
{ ...Oe, ...s }
|
|
5911
5912
|
)
|
|
5912
5913
|
}, Hl = ({
|
|
5913
5914
|
heading: t = "Data Grid",
|
|
@@ -5933,7 +5934,7 @@ const Lt = () => {
|
|
|
5933
5934
|
showAdd: A = !1,
|
|
5934
5935
|
// Additional props
|
|
5935
5936
|
searchPlaceholder: E = "Search...",
|
|
5936
|
-
handleRefreshClick:
|
|
5937
|
+
handleRefreshClick: I = () => {
|
|
5937
5938
|
},
|
|
5938
5939
|
handleSearchChange: M = () => {
|
|
5939
5940
|
},
|
|
@@ -5941,10 +5942,10 @@ const Lt = () => {
|
|
|
5941
5942
|
excelFileName: _,
|
|
5942
5943
|
pdfFileName: U,
|
|
5943
5944
|
searchIconSize: Y,
|
|
5944
|
-
searchIconClass:
|
|
5945
|
+
searchIconClass: q,
|
|
5945
5946
|
inputStyle: T
|
|
5946
5947
|
}) => {
|
|
5947
|
-
const x = () => l?.current || i?.current, [f, C] = ae.useState(""),
|
|
5948
|
+
const x = () => l?.current || i?.current, [f, C] = ae.useState(""), O = (t || "export").toString().trim() || "export", R = `${_ || O}.xlsx`, D = `${U || O}.pdf`, b = (w, $, P) => Math.max($, Math.min(w, P)), p = K(
|
|
5948
5949
|
(w) => {
|
|
5949
5950
|
const $ = x();
|
|
5950
5951
|
if ($?.openColumnChooser) {
|
|
@@ -5953,10 +5954,10 @@ const Lt = () => {
|
|
|
5953
5954
|
return;
|
|
5954
5955
|
}
|
|
5955
5956
|
try {
|
|
5956
|
-
const P = w.currentTarget.getBoundingClientRect(), S = P.left + window.scrollX,
|
|
5957
|
-
let j = S - 120, F =
|
|
5958
|
-
const
|
|
5959
|
-
j = b(j, window.scrollX + 8, window.scrollX +
|
|
5957
|
+
const P = w.currentTarget.getBoundingClientRect(), S = P.left + window.scrollX, L = P.bottom + window.scrollY;
|
|
5958
|
+
let j = S - 120, F = L - 120;
|
|
5959
|
+
const G = window.innerWidth, W = window.innerHeight;
|
|
5960
|
+
j = b(j, window.scrollX + 8, window.scrollX + G - 340), F = b(F, window.scrollY, window.scrollY + W - 120), $.openColumnChooser(j, F);
|
|
5960
5961
|
} catch (P) {
|
|
5961
5962
|
console.log("coloumn choose error", P);
|
|
5962
5963
|
}
|
|
@@ -5985,11 +5986,11 @@ const Lt = () => {
|
|
|
5985
5986
|
g && P.pdfExport?.({ fileName: D });
|
|
5986
5987
|
break;
|
|
5987
5988
|
case "Refresh":
|
|
5988
|
-
z &&
|
|
5989
|
+
z && I();
|
|
5989
5990
|
break;
|
|
5990
5991
|
}
|
|
5991
5992
|
},
|
|
5992
|
-
[y, v, d, g, z, R, D,
|
|
5993
|
+
[y, v, d, g, z, R, D, I, p]
|
|
5993
5994
|
);
|
|
5994
5995
|
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: [
|
|
5995
5996
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
@@ -6010,7 +6011,7 @@ const Lt = () => {
|
|
|
6010
6011
|
C(w), M(w);
|
|
6011
6012
|
},
|
|
6012
6013
|
searchIconSize: Y || 16,
|
|
6013
|
-
searchIconClass:
|
|
6014
|
+
searchIconClass: q || "",
|
|
6014
6015
|
inputStyle: T || { paddingTop: "4px", paddingBottom: "4px" }
|
|
6015
6016
|
}
|
|
6016
6017
|
) }),
|
|
@@ -6109,56 +6110,56 @@ function Ql(t) {
|
|
|
6109
6110
|
height: z = "600",
|
|
6110
6111
|
selectionSettings: A = { type: "Multiple", mode: "Row" },
|
|
6111
6112
|
enableCheckbox: E = !1,
|
|
6112
|
-
columns:
|
|
6113
|
+
columns: I = [],
|
|
6113
6114
|
onGridStateChange: M,
|
|
6114
6115
|
onRowSelected: _,
|
|
6115
6116
|
onRowDeselected: U,
|
|
6116
6117
|
onRowDoubleClick: Y,
|
|
6117
|
-
apiRef:
|
|
6118
|
+
apiRef: q,
|
|
6118
6119
|
gridProps: T = {}
|
|
6119
6120
|
} = t, x = ge(null), {
|
|
6120
6121
|
pageSettings: f,
|
|
6121
6122
|
sortSettings: C,
|
|
6122
|
-
...
|
|
6123
|
+
...O
|
|
6123
6124
|
} = T || {}, [R, D] = ae.useState(f?.page || 1), [b, p] = ae.useState(C?.pageSize || 20), [k, w] = ae.useState(C?.sortKey || "updatedDate"), [$, P] = ae.useState(C?.direction || "Descending"), S = se(() => {
|
|
6124
6125
|
const V = [an];
|
|
6125
6126
|
return o && V.push(rn), u && V.push(nn), h && V.push(sn), g && V.push(ln), r && V.push(on), v && V.push(cn), d && V.push(dn), y && V.push(mn), N && V.push(un), V.push(hn), V;
|
|
6126
|
-
}, [o, u, h, g, r, v, d, y, N]),
|
|
6127
|
-
const V = () => x.current, re = (
|
|
6128
|
-
!ve && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${
|
|
6127
|
+
}, [o, u, h, g, r, v, d, y, N]), L = se(() => {
|
|
6128
|
+
const V = () => x.current, re = (J, ve) => {
|
|
6129
|
+
!ve && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${J} requested but related service/feature is disabled.`);
|
|
6129
6130
|
};
|
|
6130
6131
|
return {
|
|
6131
6132
|
getInstance: () => V(),
|
|
6132
6133
|
refresh: () => V()?.refresh?.(),
|
|
6133
6134
|
getSelectedRecords: () => V()?.getSelectedRecords?.() ?? [],
|
|
6134
6135
|
clearSelection: () => V()?.clearSelection?.(),
|
|
6135
|
-
selectRow: (
|
|
6136
|
-
selectRows: (
|
|
6137
|
-
search: (
|
|
6138
|
-
re("search()", g), V()?.search?.(
|
|
6136
|
+
selectRow: (J) => V()?.selectRow?.(J),
|
|
6137
|
+
selectRows: (J) => V()?.selectRows?.(J),
|
|
6138
|
+
search: (J) => {
|
|
6139
|
+
re("search()", g), V()?.search?.(J);
|
|
6139
6140
|
},
|
|
6140
6141
|
print: () => V()?.print?.(),
|
|
6141
|
-
excelExport: (
|
|
6142
|
-
re("excelExport()", r), V()?.excelExport?.(
|
|
6142
|
+
excelExport: (J) => {
|
|
6143
|
+
re("excelExport()", r), V()?.excelExport?.(J);
|
|
6143
6144
|
},
|
|
6144
|
-
pdfExport: (
|
|
6145
|
-
re("pdfExport()", v), V()?.pdfExport?.(
|
|
6145
|
+
pdfExport: (J) => {
|
|
6146
|
+
re("pdfExport()", v), V()?.pdfExport?.(J);
|
|
6146
6147
|
},
|
|
6147
|
-
openColumnChooser: (
|
|
6148
|
-
re("openColumnChooser()", d), V()?.columnChooserModule?.openColumnChooser?.(
|
|
6148
|
+
openColumnChooser: (J, ve) => {
|
|
6149
|
+
re("openColumnChooser()", d), V()?.columnChooserModule?.openColumnChooser?.(J, ve);
|
|
6149
6150
|
}
|
|
6150
6151
|
};
|
|
6151
6152
|
}, []);
|
|
6152
6153
|
te(() => {
|
|
6153
|
-
|
|
6154
|
-
}, [
|
|
6155
|
-
|
|
6154
|
+
q && (q.current = L);
|
|
6155
|
+
}, [q, L]), te(() => () => {
|
|
6156
|
+
q && (q.current = null);
|
|
6156
6157
|
}, []);
|
|
6157
6158
|
const j = (V) => {
|
|
6158
6159
|
const re = String(V || "");
|
|
6159
6160
|
return re === "Ascending" || re === "Descending" ? re : re.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
6160
6161
|
}, F = (V) => {
|
|
6161
|
-
const re = x.current,
|
|
6162
|
+
const re = x.current, J = V?.requestType, ve = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Ee = V?.pageSize ?? re?.pageSettings?.pageSize ?? b, je = V?.currentPage ?? re?.pageSettings?.currentPage ?? l, at = V?.columnName && V?.direction ? [{ field: V.columnName, dir: j(V.direction) }] : (re?.sortSettings?.columns || []).map((Re) => ({
|
|
6162
6163
|
field: Re.field,
|
|
6163
6164
|
dir: j(Re.direction ?? Re.dir)
|
|
6164
6165
|
})), rt = V?.searchString ?? "", nt = V?.columns ?? re?.filterSettings?.columns ?? [];
|
|
@@ -6171,15 +6172,15 @@ function Ql(t) {
|
|
|
6171
6172
|
filters: nt,
|
|
6172
6173
|
rawEvent: V
|
|
6173
6174
|
};
|
|
6174
|
-
},
|
|
6175
|
+
}, G = (V) => {
|
|
6175
6176
|
setTimeout(() => {
|
|
6176
6177
|
x?.current?.hideSpinner();
|
|
6177
6178
|
}, 1e3), V.requestType === "paging" && (D(V.currentPage), p(V.pageSize)), V.requestType === "sorting" && (w(V.columnName || "updatedDate"), P(V.direction === "Ascending" ? "ASC" : "DESC")), M && M(F(V), V);
|
|
6178
|
-
},
|
|
6179
|
+
}, W = (V) => {
|
|
6179
6180
|
typeof Y == "function" && Y(V?.rowData, V);
|
|
6180
6181
|
}, xe = () => {
|
|
6181
6182
|
const V = [];
|
|
6182
|
-
return E && V.push(/* @__PURE__ */ e(Dt, { type: "checkbox", width: "50" }, "__checkbox__")),
|
|
6183
|
+
return E && V.push(/* @__PURE__ */ e(Dt, { type: "checkbox", width: "50" }, "__checkbox__")), I.forEach((re, J) => {
|
|
6183
6184
|
const {
|
|
6184
6185
|
field: ve,
|
|
6185
6186
|
headerText: Ee,
|
|
@@ -6194,8 +6195,8 @@ function Ql(t) {
|
|
|
6194
6195
|
format: Fa,
|
|
6195
6196
|
visible: Ea = !0,
|
|
6196
6197
|
minWidth: Ra,
|
|
6197
|
-
maxWidth:
|
|
6198
|
-
customAttributes:
|
|
6198
|
+
maxWidth: Ia,
|
|
6199
|
+
customAttributes: Oa,
|
|
6199
6200
|
...Pa
|
|
6200
6201
|
} = re || {};
|
|
6201
6202
|
V.push(
|
|
@@ -6215,11 +6216,11 @@ function Ql(t) {
|
|
|
6215
6216
|
format: Fa,
|
|
6216
6217
|
visible: Ea,
|
|
6217
6218
|
minWidth: Ra,
|
|
6218
|
-
maxWidth:
|
|
6219
|
-
customAttributes:
|
|
6219
|
+
maxWidth: Ia,
|
|
6220
|
+
customAttributes: Oa,
|
|
6220
6221
|
...Pa
|
|
6221
6222
|
},
|
|
6222
|
-
ve || `col-${
|
|
6223
|
+
ve || `col-${J}`
|
|
6223
6224
|
)
|
|
6224
6225
|
);
|
|
6225
6226
|
}), V;
|
|
@@ -6247,11 +6248,11 @@ function Ql(t) {
|
|
|
6247
6248
|
columns: [{ field: k, direction: j($) }],
|
|
6248
6249
|
allowUnsort: !1
|
|
6249
6250
|
},
|
|
6250
|
-
actionBegin:
|
|
6251
|
+
actionBegin: G,
|
|
6251
6252
|
rowSelected: _,
|
|
6252
6253
|
rowDeselected: U,
|
|
6253
|
-
recordDoubleClick:
|
|
6254
|
-
...
|
|
6254
|
+
recordDoubleClick: W,
|
|
6255
|
+
...O,
|
|
6255
6256
|
children: [
|
|
6256
6257
|
/* @__PURE__ */ e(gn, { children: xe() }),
|
|
6257
6258
|
/* @__PURE__ */ e(bn, { services: S })
|
|
@@ -6724,7 +6725,7 @@ Es.propTypes = {
|
|
|
6724
6725
|
})
|
|
6725
6726
|
)
|
|
6726
6727
|
};
|
|
6727
|
-
const Rs = ["All", "Library", "Restaurant", "Parking", "Bus Stop"],
|
|
6728
|
+
const Rs = ["All", "Library", "Restaurant", "Parking", "Bus Stop"], Is = {
|
|
6728
6729
|
sm: {
|
|
6729
6730
|
wrap: "max-w-md w-full md:w-auto flex-none justify-self-start",
|
|
6730
6731
|
mapH: "h-48",
|
|
@@ -6746,7 +6747,7 @@ const Rs = ["All", "Library", "Restaurant", "Parking", "Bus Stop"], Os = {
|
|
|
6746
6747
|
searchH: "h-11 text-base",
|
|
6747
6748
|
chipGap: "gap-3.5"
|
|
6748
6749
|
}
|
|
6749
|
-
},
|
|
6750
|
+
}, Os = ({ label: t, active: a = !1, size: s = "md", className: i = "" }) => {
|
|
6750
6751
|
const l = "inline-flex items-center justify-center whitespace-nowrap rounded-full border transition-colors duration-150 shadow-[0_0.5px_0_rgba(0,0,0,0.04)]", m = {
|
|
6751
6752
|
sm: "h-8 px-3 text-[11px] font-semibold",
|
|
6752
6753
|
md: "h-9 px-3.5 text-[13px] font-semibold",
|
|
@@ -6771,7 +6772,7 @@ function Ms({
|
|
|
6771
6772
|
// optional full embed URL override
|
|
6772
6773
|
...v
|
|
6773
6774
|
}) {
|
|
6774
|
-
const d = ce(t), g = de[d], z =
|
|
6775
|
+
const d = ce(t), g = de[d], z = Is[d], A = r || Ps(N, y);
|
|
6775
6776
|
return /* @__PURE__ */ e(
|
|
6776
6777
|
ie,
|
|
6777
6778
|
{
|
|
@@ -6805,7 +6806,7 @@ function Ms({
|
|
|
6805
6806
|
/* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-full bg-white/90 border border-zinc-300 flex items-center justify-center", children: "›" })
|
|
6806
6807
|
] })
|
|
6807
6808
|
] }),
|
|
6808
|
-
/* @__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(
|
|
6809
|
+
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-14 md:top-12 pointer-events-none mt-2", children: /* @__PURE__ */ e("div", { className: `flex ${z.chipGap} overflow-x-auto scrollbar-none`, children: u.map((E) => /* @__PURE__ */ e(Os, { label: E, active: E === h, size: d }, E)) }) }),
|
|
6809
6810
|
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-28 md:top-24 pointer-events-none", children: /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 px-4 ${z.searchH}`, children: [
|
|
6810
6811
|
/* @__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" }) }),
|
|
6811
6812
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-500 dark:text-zinc-400", children: "Search places" })
|
|
@@ -6977,8 +6978,8 @@ function _s({
|
|
|
6977
6978
|
selectedIndex: u = 0,
|
|
6978
6979
|
...h
|
|
6979
6980
|
}) {
|
|
6980
|
-
const [N, y] =
|
|
6981
|
-
y(
|
|
6981
|
+
const [N, y] = B(u), r = ce(t), v = de[r], d = Bs[r], g = o[N] || o[0], z = (E, I) => {
|
|
6982
|
+
y(I), i?.(E);
|
|
6982
6983
|
}, A = r === "lg";
|
|
6983
6984
|
return /* @__PURE__ */ n(
|
|
6984
6985
|
ie,
|
|
@@ -6998,29 +6999,29 @@ function _s({
|
|
|
6998
6999
|
A ? (
|
|
6999
7000
|
// Large: Two-column layout
|
|
7000
7001
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
7001
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E,
|
|
7002
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7002
7003
|
jt,
|
|
7003
7004
|
{
|
|
7004
7005
|
ev: E,
|
|
7005
7006
|
sizeMeta: d,
|
|
7006
|
-
isSelected:
|
|
7007
|
-
onClick: (M) => z(M,
|
|
7007
|
+
isSelected: I === N,
|
|
7008
|
+
onClick: (M) => z(M, I)
|
|
7008
7009
|
},
|
|
7009
|
-
E._id || E.id ||
|
|
7010
|
+
E._id || E.id || I
|
|
7010
7011
|
)) }),
|
|
7011
7012
|
/* @__PURE__ */ e(js, { ev: g, sizeMeta: d })
|
|
7012
7013
|
] })
|
|
7013
7014
|
) : (
|
|
7014
7015
|
// Small/Medium: Simple list only
|
|
7015
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E,
|
|
7016
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7016
7017
|
jt,
|
|
7017
7018
|
{
|
|
7018
7019
|
ev: E,
|
|
7019
7020
|
sizeMeta: d,
|
|
7020
|
-
isSelected:
|
|
7021
|
-
onClick: (M) => z(M,
|
|
7021
|
+
isSelected: I === N,
|
|
7022
|
+
onClick: (M) => z(M, I)
|
|
7022
7023
|
},
|
|
7023
|
-
E._id || E.id ||
|
|
7024
|
+
E._id || E.id || I
|
|
7024
7025
|
)) })
|
|
7025
7026
|
),
|
|
7026
7027
|
!A && /* @__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" }) })
|
|
@@ -7194,12 +7195,12 @@ function Ys({
|
|
|
7194
7195
|
onPin: N,
|
|
7195
7196
|
...y
|
|
7196
7197
|
}) {
|
|
7197
|
-
const [r, v] =
|
|
7198
|
+
const [r, v] = B(u), d = ce(t), g = de[d], z = Gs[d], A = (M, _) => {
|
|
7198
7199
|
v(_), i?.(M);
|
|
7199
7200
|
}, E = (M) => {
|
|
7200
7201
|
const _ = { ...M, starred: !M.starred };
|
|
7201
7202
|
h?.(_);
|
|
7202
|
-
},
|
|
7203
|
+
}, I = (M) => {
|
|
7203
7204
|
const _ = { ...M, pinned: !M.pinned };
|
|
7204
7205
|
N?.(_);
|
|
7205
7206
|
};
|
|
@@ -7224,7 +7225,7 @@ function Ys({
|
|
|
7224
7225
|
isSelected: _ === r,
|
|
7225
7226
|
onClick: (U) => A(U, _),
|
|
7226
7227
|
onStar: E,
|
|
7227
|
-
onPin:
|
|
7228
|
+
onPin: I
|
|
7228
7229
|
},
|
|
7229
7230
|
M._id || M.id || _
|
|
7230
7231
|
)) }),
|
|
@@ -7446,8 +7447,8 @@ function Qs({
|
|
|
7446
7447
|
selectedIndex: u = 0,
|
|
7447
7448
|
...h
|
|
7448
7449
|
}) {
|
|
7449
|
-
const [N, y] =
|
|
7450
|
-
y(
|
|
7450
|
+
const [N, y] = B(u), r = ce(t), v = de[r], d = Js[r], g = (E, I) => {
|
|
7451
|
+
y(I), i?.(E);
|
|
7451
7452
|
}, z = o[N] || o[0], A = d.layout === "split";
|
|
7452
7453
|
return /* @__PURE__ */ n(
|
|
7453
7454
|
ie,
|
|
@@ -7463,15 +7464,15 @@ function Qs({
|
|
|
7463
7464
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between mb-4", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: m }) }),
|
|
7464
7465
|
/* @__PURE__ */ e(Hs, { sizeMeta: d }),
|
|
7465
7466
|
A ? /* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0", children: [
|
|
7466
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E,
|
|
7467
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7467
7468
|
_t,
|
|
7468
7469
|
{
|
|
7469
7470
|
contact: E,
|
|
7470
7471
|
sizeMeta: d,
|
|
7471
|
-
isSelected:
|
|
7472
|
-
onClick: (M) => g(M,
|
|
7472
|
+
isSelected: I === N,
|
|
7473
|
+
onClick: (M) => g(M, I)
|
|
7473
7474
|
},
|
|
7474
|
-
E._id || E.id ||
|
|
7475
|
+
E._id || E.id || I
|
|
7475
7476
|
)) }),
|
|
7476
7477
|
/* @__PURE__ */ e(
|
|
7477
7478
|
Xs,
|
|
@@ -7482,15 +7483,15 @@ function Qs({
|
|
|
7482
7483
|
)
|
|
7483
7484
|
] }) : (
|
|
7484
7485
|
// Single column layout for small screens
|
|
7485
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E,
|
|
7486
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, I) => /* @__PURE__ */ e(
|
|
7486
7487
|
_t,
|
|
7487
7488
|
{
|
|
7488
7489
|
contact: E,
|
|
7489
7490
|
sizeMeta: d,
|
|
7490
|
-
isSelected:
|
|
7491
|
-
onClick: (M) => g(M,
|
|
7491
|
+
isSelected: I === N,
|
|
7492
|
+
onClick: (M) => g(M, I)
|
|
7492
7493
|
},
|
|
7493
|
-
E._id || E.id ||
|
|
7494
|
+
E._id || E.id || I
|
|
7494
7495
|
)) })
|
|
7495
7496
|
),
|
|
7496
7497
|
/* @__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" }) })
|
|
@@ -7771,7 +7772,7 @@ function al({
|
|
|
7771
7772
|
term: o = "Fall 2025",
|
|
7772
7773
|
...u
|
|
7773
7774
|
}) {
|
|
7774
|
-
const [h, N] =
|
|
7775
|
+
const [h, N] = B("vacation"), [y, r] = B(!1), v = ce(t), d = de[v], g = tl[v], z = qe.find((A) => A.id === h) || qe[0];
|
|
7775
7776
|
return /* @__PURE__ */ n(
|
|
7776
7777
|
ie,
|
|
7777
7778
|
{
|
|
@@ -7962,7 +7963,7 @@ function ll({
|
|
|
7962
7963
|
subtitle: o = "Drive Shared",
|
|
7963
7964
|
...u
|
|
7964
7965
|
}) {
|
|
7965
|
-
const [h, N] =
|
|
7966
|
+
const [h, N] = B(!1), y = ce(t), r = de[y], v = sl[y];
|
|
7966
7967
|
return /* @__PURE__ */ n(
|
|
7967
7968
|
ie,
|
|
7968
7969
|
{
|
|
@@ -8154,7 +8155,7 @@ const il = [
|
|
|
8154
8155
|
}
|
|
8155
8156
|
};
|
|
8156
8157
|
function dl({ alert: t, sizeMeta: a, onDismiss: s, onMarkRead: i }) {
|
|
8157
|
-
const [l, m] =
|
|
8158
|
+
const [l, m] = B(!1), o = Da(t.type), u = cl(t.type);
|
|
8158
8159
|
return l ? null : /* @__PURE__ */ n("div", { className: `relative rounded-lg border-l-4 p-4 transition-all duration-200 ${o.bg} ${o.border} ${t.read ? "border-l-2 opacity-80" : "border-l-4"}`, style: { borderLeftColor: o.accent }, children: [
|
|
8159
8160
|
/* @__PURE__ */ e(
|
|
8160
8161
|
"button",
|
|
@@ -8178,7 +8179,7 @@ function dl({ alert: t, sizeMeta: a, onDismiss: s, onMarkRead: i }) {
|
|
|
8178
8179
|
] });
|
|
8179
8180
|
}
|
|
8180
8181
|
function ml({ alert: t, onDismiss: a }) {
|
|
8181
|
-
const [s, i] =
|
|
8182
|
+
const [s, i] = B(!1), l = Da("banner"), m = () => {
|
|
8182
8183
|
i(!0), a?.(t);
|
|
8183
8184
|
};
|
|
8184
8185
|
return s ? null : /* @__PURE__ */ e("div", { className: `rounded-lg border p-4 ${l.bg} ${l.border} relative`, children: /* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
|
|
@@ -8208,8 +8209,8 @@ function ul({
|
|
|
8208
8209
|
showBanner: u = !0,
|
|
8209
8210
|
...h
|
|
8210
8211
|
}) {
|
|
8211
|
-
const [N, y] =
|
|
8212
|
-
y((
|
|
8212
|
+
const [N, y] = B(o), r = ce(t), v = de[r], d = ol[r], g = (E) => {
|
|
8213
|
+
y((I) => I.filter((M) => M.id !== E.id));
|
|
8213
8214
|
}, z = N.find((E) => E.type === "banner"), A = N.filter((E) => E.type !== "banner");
|
|
8214
8215
|
return /* @__PURE__ */ n(
|
|
8215
8216
|
ie,
|
|
@@ -8342,7 +8343,7 @@ const hl = [
|
|
|
8342
8343
|
}
|
|
8343
8344
|
};
|
|
8344
8345
|
function gl({ video: t, sizeMeta: a }) {
|
|
8345
|
-
const [s, i] =
|
|
8346
|
+
const [s, i] = B(!1);
|
|
8346
8347
|
return /* @__PURE__ */ n("div", { className: "group cursor-pointer", children: [
|
|
8347
8348
|
/* @__PURE__ */ n("div", { className: `relative ${a.thumbnailHeight} rounded-lg overflow-hidden bg-zinc-200 dark:bg-zinc-800`, children: [
|
|
8348
8349
|
/* @__PURE__ */ e(
|
|
@@ -8384,7 +8385,7 @@ function bl({
|
|
|
8384
8385
|
videos: o = hl,
|
|
8385
8386
|
...u
|
|
8386
8387
|
}) {
|
|
8387
|
-
const [h, N] =
|
|
8388
|
+
const [h, N] = B(!1), y = ce(t), r = de[y], v = pl[y];
|
|
8388
8389
|
return /* @__PURE__ */ n(
|
|
8389
8390
|
ie,
|
|
8390
8391
|
{
|
|
@@ -8480,7 +8481,7 @@ export {
|
|
|
8480
8481
|
Rl as FullScreenLoader,
|
|
8481
8482
|
Al as GenericFilter,
|
|
8482
8483
|
we as IconButton,
|
|
8483
|
-
|
|
8484
|
+
X as Input,
|
|
8484
8485
|
al as LeaveBalanceMock,
|
|
8485
8486
|
ws as ManageCollectionList,
|
|
8486
8487
|
Rn as Modal,
|
|
@@ -8500,11 +8501,11 @@ export {
|
|
|
8500
8501
|
ba as Textarea,
|
|
8501
8502
|
Xl as ToastProvider,
|
|
8502
8503
|
fa as ToggleSwitch,
|
|
8503
|
-
|
|
8504
|
+
Il as Tooltip,
|
|
8504
8505
|
ql as TreeView,
|
|
8505
8506
|
oe as UnifyedCoreButton,
|
|
8506
8507
|
bl as VideosMock,
|
|
8507
|
-
|
|
8508
|
+
Ol as WizardModal,
|
|
8508
8509
|
Na as adGroupsListSearchApi,
|
|
8509
8510
|
Vl as axiosDelete,
|
|
8510
8511
|
Qe as axiosGet,
|