unifyedx-storybook-new 0.2.29 → 0.2.30
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,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e, Fragment as te } from "react/jsx-runtime";
|
|
2
2
|
import se, { useState as M, useMemo as ue, useId as Qe, Fragment as Q, useEffect as Z, useCallback as ae, useRef as xe } from "react";
|
|
3
|
-
import { a as H, U as mt, X as ge, P as c, L as Ua, C as ve, b as tt, f as Ze, d as yt, D as Yt, F as qa, e as Ga, h as Ya, T as Ke, u as Wa, i as zt, I as Wt, j as Jt, k as Ja, l as Xa, m as Ha, n as Xt, S as vt, o as Ht, M as Qa, p as Za, q as wt, r as Ka, A as er, E as Qt, s as tr, t as ar, v as rr, w as nr, x as Zt, y as sr, z as Kt, B as ea, G as lr, H as ir, J as or, K as et, N as ut, O as ht, Q as cr, R as dr, V as ta, W as mr, Y as Nt, Z as ur, _ as hr, $ as Me, a0 as pr, a1 as gr, a2 as br, a3 as fr, a4 as xr, a5 as yr, a6 as St, a7 as vr, a8 as wr, a9 as Nr, aa as kr, ab as Cr, ac as zr, ad as Sr, ae as Dr, af as $r, ag as Fe, ah as aa, ai as Tr, aj as Ar, ak as Fr, al as Er, am as Rr, an as ra, ao as Ir, ap as
|
|
3
|
+
import { a as H, U as mt, X as ge, P as c, L as Ua, C as ve, b as tt, f as Ze, d as yt, D as Yt, F as qa, e as Ga, h as Ya, T as Ke, u as Wa, i as zt, I as Wt, j as Jt, k as Ja, l as Xa, m as Ha, n as Xt, S as vt, o as Ht, M as Qa, p as Za, q as wt, r as Ka, A as er, E as Qt, s as tr, t as ar, v as rr, w as nr, x as Zt, y as sr, z as Kt, B as ea, G as lr, H as ir, J as or, K as et, N as ut, O as ht, Q as cr, R as dr, V as ta, W as mr, Y as Nt, Z as ur, _ as hr, $ as Me, a0 as pr, a1 as gr, a2 as br, a3 as fr, a4 as xr, a5 as yr, a6 as St, a7 as vr, a8 as wr, a9 as Nr, aa as kr, ab as Cr, ac as zr, ad as Sr, ae as Dr, af as $r, ag as Fe, ah as aa, ai as Tr, aj as Ar, ak as Fr, al as Er, am as Rr, an as ra, ao as Ir, ap as Pr, aq as na, ar as Or, as as pt, at as sa, au as Lr } from "./vendor-wRQnjUYv.js";
|
|
4
4
|
import { Popover as Mr, PopoverButton as Br, PopoverPanel as jr, Transition as he, Dialog as ye, TransitionChild as Ne, DialogPanel as Ee, DialogTitle as at, TabGroup as Vr, TabList as _r, Tab as ne, TabPanels as Ur, RadioGroup as qe, Listbox as K, ListboxButton as qr, ListboxOptions as Gr, ListboxOption as Yr, SwitchGroup as Wr, Switch as ot, Menu as Jr, MenuButton as Xr, Portal as Hr, MenuItems as Qr, MenuItem as Zr, DialogBackdrop as Kr } from "@headlessui/react";
|
|
5
5
|
import { motion as le, AnimatePresence as Ce } from "framer-motion";
|
|
6
6
|
import { d as en } from "./vendor-lodash-C6Pmit-j.js";
|
|
@@ -825,7 +825,7 @@ const $n = {
|
|
|
825
825
|
}, Et = (t) => {
|
|
826
826
|
const a = new Date(t);
|
|
827
827
|
return je(new Date(a.getFullYear(), a.getMonth() + 1, 0));
|
|
828
|
-
},
|
|
828
|
+
}, Pn = (t) => {
|
|
829
829
|
const a = /* @__PURE__ */ new Date();
|
|
830
830
|
switch (t) {
|
|
831
831
|
case "anytime":
|
|
@@ -871,13 +871,13 @@ const $n = {
|
|
|
871
871
|
}), T = Wa({
|
|
872
872
|
initialValues: JSON.parse(JSON.stringify(m)),
|
|
873
873
|
// Deep copy
|
|
874
|
-
onSubmit: (
|
|
874
|
+
onSubmit: (k) => {
|
|
875
875
|
const g = {};
|
|
876
|
-
Object.keys(
|
|
876
|
+
Object.keys(k).forEach((v) => {
|
|
877
877
|
g[v] = {
|
|
878
|
-
operator:
|
|
879
|
-
values: Array.isArray(
|
|
880
|
-
range:
|
|
878
|
+
operator: k[v].operator || "in",
|
|
879
|
+
values: Array.isArray(k[v].values) ? k[v].values : [],
|
|
880
|
+
range: k[v].range || null
|
|
881
881
|
};
|
|
882
882
|
}), console.log("[storybook filter] Applied Filters:", g), typeof s == "function" && s({
|
|
883
883
|
filters: g,
|
|
@@ -885,7 +885,7 @@ const $n = {
|
|
|
885
885
|
}), a();
|
|
886
886
|
},
|
|
887
887
|
enableReinitialize: !0
|
|
888
|
-
}), A = ue(() => l.reduce((
|
|
888
|
+
}), A = ue(() => l.reduce((k, g) => {
|
|
889
889
|
const v = g.key, w = T.values[v];
|
|
890
890
|
let z = !1;
|
|
891
891
|
if (w)
|
|
@@ -898,34 +898,34 @@ const $n = {
|
|
|
898
898
|
(w.range && w.range !== "" || Array.isArray(w.values) && w.values.length > 0) && (z = !0);
|
|
899
899
|
break;
|
|
900
900
|
}
|
|
901
|
-
return
|
|
902
|
-
}, {}), [l, T.values]), E = Object.values(A).filter(Boolean).length, I = ue(() => l.some((
|
|
903
|
-
if (
|
|
904
|
-
const g = T.values?.[
|
|
901
|
+
return k[v] = z, k;
|
|
902
|
+
}, {}), [l, T.values]), E = Object.values(A).filter(Boolean).length, I = ue(() => l.some((k) => {
|
|
903
|
+
if (k.type !== "date") return !1;
|
|
904
|
+
const g = T.values?.[k.key]?.values;
|
|
905
905
|
if (!Array.isArray(g) || g.length < 2) return !1;
|
|
906
906
|
const [v, w] = g;
|
|
907
907
|
if (!v || !w) return !1;
|
|
908
908
|
const z = v instanceof Date ? v : new Date(v), N = w instanceof Date ? w : new Date(w);
|
|
909
909
|
return z > N;
|
|
910
|
-
}), [l, T.values]), j = async (
|
|
910
|
+
}), [l, T.values]), j = async (k, g) => {
|
|
911
911
|
try {
|
|
912
|
-
r((w) => ({ ...w, [
|
|
913
|
-
const v = await u(
|
|
914
|
-
b((w) => ({ ...w, [
|
|
912
|
+
r((w) => ({ ...w, [k]: !0 }));
|
|
913
|
+
const v = await u(k, g);
|
|
914
|
+
b((w) => ({ ...w, [k]: v }));
|
|
915
915
|
} catch (v) {
|
|
916
|
-
console.error(`Error fetching ${
|
|
916
|
+
console.error(`Error fetching ${k} users:`, v);
|
|
917
917
|
} finally {
|
|
918
|
-
r((v) => ({ ...v, [
|
|
918
|
+
r((v) => ({ ...v, [k]: !1 }));
|
|
919
919
|
}
|
|
920
|
-
}, _ = (
|
|
921
|
-
const g = l[
|
|
922
|
-
l[
|
|
920
|
+
}, _ = (k) => {
|
|
921
|
+
const g = l[k].key, v = l[k].url;
|
|
922
|
+
l[k].type === "multiselect-users" && p[g].length === 0 && !f[g] && j(g, v);
|
|
923
923
|
}, G = () => {
|
|
924
924
|
T.resetForm(), b({ createdBy: [], updatedBy: [] }), i();
|
|
925
|
-
}, q = (
|
|
926
|
-
const g = l.find((z) => z.key ===
|
|
925
|
+
}, q = (k) => {
|
|
926
|
+
const g = l.find((z) => z.key === k);
|
|
927
927
|
if (!g) return null;
|
|
928
|
-
const v = T.values[
|
|
928
|
+
const v = T.values[k] || m[k], w = Array.isArray(v.values) ? v.values : [];
|
|
929
929
|
switch (g.type) {
|
|
930
930
|
case "multiselect":
|
|
931
931
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
@@ -935,7 +935,7 @@ const $n = {
|
|
|
935
935
|
"select",
|
|
936
936
|
{
|
|
937
937
|
value: v.operator || "in",
|
|
938
|
-
onChange: (R) => T.setFieldValue(`${
|
|
938
|
+
onChange: (R) => T.setFieldValue(`${k}.operator`, R.target.value),
|
|
939
939
|
className: "filter-select",
|
|
940
940
|
children: g.operators.map((R) => /* @__PURE__ */ e("option", { value: R, children: R === "in" ? "Includes" : "Excludes" }, R))
|
|
941
941
|
}
|
|
@@ -947,19 +947,19 @@ const $n = {
|
|
|
947
947
|
"input",
|
|
948
948
|
{
|
|
949
949
|
type: "checkbox",
|
|
950
|
-
id: `select-all-${
|
|
950
|
+
id: `select-all-${k}`,
|
|
951
951
|
className: "filter-checkbox-input",
|
|
952
952
|
checked: g.options.length > 0 && w.length === g.options.length,
|
|
953
953
|
onChange: (R) => {
|
|
954
954
|
const Y = R.target.checked ? g.options.map((W) => W.value) : [];
|
|
955
|
-
T.setFieldValue(`${
|
|
955
|
+
T.setFieldValue(`${k}.values`, Y);
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
958
|
),
|
|
959
959
|
/* @__PURE__ */ e(
|
|
960
960
|
"label",
|
|
961
961
|
{
|
|
962
|
-
htmlFor: `select-all-${
|
|
962
|
+
htmlFor: `select-all-${k}`,
|
|
963
963
|
className: "filter-checkbox-label",
|
|
964
964
|
children: "Select All"
|
|
965
965
|
}
|
|
@@ -970,19 +970,19 @@ const $n = {
|
|
|
970
970
|
"input",
|
|
971
971
|
{
|
|
972
972
|
type: "checkbox",
|
|
973
|
-
id: `${
|
|
973
|
+
id: `${k}-${R.value}`,
|
|
974
974
|
className: "filter-checkbox-input",
|
|
975
975
|
checked: w.includes(R.value),
|
|
976
976
|
onChange: (Y) => {
|
|
977
977
|
const W = Y.target.checked ? [...w, R.value] : w.filter((pe) => pe !== R.value);
|
|
978
|
-
T.setFieldValue(`${
|
|
978
|
+
T.setFieldValue(`${k}.values`, W);
|
|
979
979
|
}
|
|
980
980
|
}
|
|
981
981
|
),
|
|
982
982
|
/* @__PURE__ */ e(
|
|
983
983
|
"label",
|
|
984
984
|
{
|
|
985
|
-
htmlFor: `${
|
|
985
|
+
htmlFor: `${k}-${R.value}`,
|
|
986
986
|
className: "filter-checkbox-label",
|
|
987
987
|
children: R.label
|
|
988
988
|
}
|
|
@@ -991,7 +991,7 @@ const $n = {
|
|
|
991
991
|
] })
|
|
992
992
|
] });
|
|
993
993
|
case "multiselect-users":
|
|
994
|
-
const z = p[
|
|
994
|
+
const z = p[k] || [], N = f[k];
|
|
995
995
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
996
996
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
997
997
|
/* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
|
|
@@ -999,7 +999,7 @@ const $n = {
|
|
|
999
999
|
"select",
|
|
1000
1000
|
{
|
|
1001
1001
|
value: v.operator || "in",
|
|
1002
|
-
onChange: (R) => T.setFieldValue(`${
|
|
1002
|
+
onChange: (R) => T.setFieldValue(`${k}.operator`, R.target.value),
|
|
1003
1003
|
className: "filter-select",
|
|
1004
1004
|
children: g.operators.map((R) => /* @__PURE__ */ e("option", { value: R, children: R === "in" ? "Includes" : "Excludes" }, R))
|
|
1005
1005
|
}
|
|
@@ -1011,13 +1011,13 @@ const $n = {
|
|
|
1011
1011
|
"input",
|
|
1012
1012
|
{
|
|
1013
1013
|
type: "checkbox",
|
|
1014
|
-
id: `select-all-users-${
|
|
1014
|
+
id: `select-all-users-${k}`,
|
|
1015
1015
|
className: "filter-checkbox-input",
|
|
1016
1016
|
checked: z.length > 0 && w.length === z.length,
|
|
1017
1017
|
onChange: (R) => {
|
|
1018
1018
|
const Y = R.target.checked ? z.map((W) => W.email) : [];
|
|
1019
1019
|
T.setFieldValue(
|
|
1020
|
-
`${
|
|
1020
|
+
`${k}.values`,
|
|
1021
1021
|
Y
|
|
1022
1022
|
);
|
|
1023
1023
|
}
|
|
@@ -1026,7 +1026,7 @@ const $n = {
|
|
|
1026
1026
|
/* @__PURE__ */ e(
|
|
1027
1027
|
"label",
|
|
1028
1028
|
{
|
|
1029
|
-
htmlFor: `select-all-users-${
|
|
1029
|
+
htmlFor: `select-all-users-${k}`,
|
|
1030
1030
|
className: "filter-checkbox-label",
|
|
1031
1031
|
children: "Select All Users"
|
|
1032
1032
|
}
|
|
@@ -1037,13 +1037,13 @@ const $n = {
|
|
|
1037
1037
|
"input",
|
|
1038
1038
|
{
|
|
1039
1039
|
type: "checkbox",
|
|
1040
|
-
id: `${
|
|
1040
|
+
id: `${k}-${R.email}`,
|
|
1041
1041
|
className: "filter-checkbox-input",
|
|
1042
1042
|
checked: w.includes(R.email),
|
|
1043
1043
|
onChange: (Y) => {
|
|
1044
1044
|
const W = Y.target.checked ? [...w, R.email] : w.filter((pe) => pe !== R.email);
|
|
1045
1045
|
T.setFieldValue(
|
|
1046
|
-
`${
|
|
1046
|
+
`${k}.values`,
|
|
1047
1047
|
W
|
|
1048
1048
|
);
|
|
1049
1049
|
}
|
|
@@ -1052,7 +1052,7 @@ const $n = {
|
|
|
1052
1052
|
/* @__PURE__ */ n(
|
|
1053
1053
|
"label",
|
|
1054
1054
|
{
|
|
1055
|
-
htmlFor: `${
|
|
1055
|
+
htmlFor: `${k}-${R.email}`,
|
|
1056
1056
|
className: "filter-checkbox-label",
|
|
1057
1057
|
children: [
|
|
1058
1058
|
/* @__PURE__ */ e("span", { className: "user-label-name", children: R.name }),
|
|
@@ -1064,13 +1064,13 @@ const $n = {
|
|
|
1064
1064
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1065
1065
|
] });
|
|
1066
1066
|
case "date":
|
|
1067
|
-
const x = v.values || [], [
|
|
1067
|
+
const x = v.values || [], [C, F] = x, L = C && F, U = x[0] || null, S = x[1] || null, P = {
|
|
1068
1068
|
startDate: U instanceof Date ? U.toISOString().slice(0, 10) : null,
|
|
1069
1069
|
endDate: U instanceof Date ? U.toISOString().slice(0, 10) : null
|
|
1070
1070
|
}, D = {
|
|
1071
1071
|
startDate: S instanceof Date ? S.toISOString().slice(0, 10) : null,
|
|
1072
1072
|
endDate: S instanceof Date ? S.toISOString().slice(0, 10) : null
|
|
1073
|
-
},
|
|
1073
|
+
}, O = [
|
|
1074
1074
|
{ key: "anytime", label: "Anytime" },
|
|
1075
1075
|
{ key: "today", label: "Today" },
|
|
1076
1076
|
{ key: "this_week", label: "This Week" },
|
|
@@ -1080,15 +1080,15 @@ const $n = {
|
|
|
1080
1080
|
{ key: "custom", label: "Custom" }
|
|
1081
1081
|
], V = (R) => {
|
|
1082
1082
|
if (R === "anytime") {
|
|
1083
|
-
T.setFieldValue(`${
|
|
1083
|
+
T.setFieldValue(`${k}.values`, []), T.setFieldValue(`${k}.range`, "anytime");
|
|
1084
1084
|
return;
|
|
1085
1085
|
}
|
|
1086
1086
|
if (R === "custom") {
|
|
1087
|
-
T.setFieldValue(`${
|
|
1087
|
+
T.setFieldValue(`${k}.range`, "custom");
|
|
1088
1088
|
return;
|
|
1089
1089
|
}
|
|
1090
|
-
const [Y, W] =
|
|
1091
|
-
T.setFieldValue(`${
|
|
1090
|
+
const [Y, W] = Pn(R);
|
|
1091
|
+
T.setFieldValue(`${k}.values`, Y && W ? [Y, W] : []), T.setFieldValue(`${k}.range`, R);
|
|
1092
1092
|
};
|
|
1093
1093
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
1094
1094
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
@@ -1097,7 +1097,7 @@ const $n = {
|
|
|
1097
1097
|
"select",
|
|
1098
1098
|
{
|
|
1099
1099
|
value: v.operator,
|
|
1100
|
-
onChange: (R) => T.setFieldValue(`${
|
|
1100
|
+
onChange: (R) => T.setFieldValue(`${k}.operator`, R.target.value),
|
|
1101
1101
|
className: "filter-select",
|
|
1102
1102
|
children: g.operators.map((R) => /* @__PURE__ */ e("option", { value: R, children: R === "in" ? "Is" : "Is not" }, R))
|
|
1103
1103
|
}
|
|
@@ -1108,8 +1108,8 @@ const $n = {
|
|
|
1108
1108
|
type: "button",
|
|
1109
1109
|
onClick: () => {
|
|
1110
1110
|
T.setFieldValue(
|
|
1111
|
-
|
|
1112
|
-
m[
|
|
1111
|
+
k,
|
|
1112
|
+
m[k]
|
|
1113
1113
|
);
|
|
1114
1114
|
},
|
|
1115
1115
|
className: "filter-clear-selection-button",
|
|
@@ -1117,7 +1117,7 @@ const $n = {
|
|
|
1117
1117
|
}
|
|
1118
1118
|
)
|
|
1119
1119
|
] }),
|
|
1120
|
-
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
1120
|
+
/* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: O.map((R) => {
|
|
1121
1121
|
const Y = v.range === R.key || R.key === "anytime" && (!Array.isArray(v.values) || v.values.length === 0);
|
|
1122
1122
|
return /* @__PURE__ */ n(
|
|
1123
1123
|
"label",
|
|
@@ -1128,7 +1128,7 @@ const $n = {
|
|
|
1128
1128
|
"input",
|
|
1129
1129
|
{
|
|
1130
1130
|
type: "radio",
|
|
1131
|
-
name: `preset-${
|
|
1131
|
+
name: `preset-${k}`,
|
|
1132
1132
|
checked: Y,
|
|
1133
1133
|
onChange: () => V(R.key),
|
|
1134
1134
|
className: "h-4 w-4"
|
|
@@ -1150,10 +1150,10 @@ const $n = {
|
|
|
1150
1150
|
{
|
|
1151
1151
|
asSingle: !0,
|
|
1152
1152
|
useRange: !1,
|
|
1153
|
-
value:
|
|
1153
|
+
value: P,
|
|
1154
1154
|
onChange: (R) => {
|
|
1155
1155
|
const Y = R?.startDate ? Be(new Date(R.startDate)) : null, W = x[1] || null;
|
|
1156
|
-
Y && (T.setFieldValue(`${
|
|
1156
|
+
Y && (T.setFieldValue(`${k}.values`, [Y, W]), T.setFieldValue(`${k}.range`, "custom"));
|
|
1157
1157
|
},
|
|
1158
1158
|
inputClassName: "w-full rounded-xl border border-[#767676] px-4 py-2 text-sm font-normal text-[#101112] focus:border-violet-500 focus:outline-none focus:ring-1 focus:ring-violet-500",
|
|
1159
1159
|
primaryColor: "violet",
|
|
@@ -1177,7 +1177,7 @@ const $n = {
|
|
|
1177
1177
|
value: D,
|
|
1178
1178
|
onChange: (R) => {
|
|
1179
1179
|
const Y = R?.startDate ? je(new Date(R.startDate)) : null, W = x[0] || null;
|
|
1180
|
-
Y && (T.setFieldValue(`${
|
|
1180
|
+
Y && (T.setFieldValue(`${k}.values`, [W, Y]), T.setFieldValue(`${k}.range`, "custom"));
|
|
1181
1181
|
},
|
|
1182
1182
|
inputClassName: "w-full rounded-xl border border-[#767676] px-4 py-2 text-sm font-normal text-[#101112] focus:border-violet-500 focus:outline-none focus:ring-1 focus:ring-violet-500",
|
|
1183
1183
|
primaryColor: "violet",
|
|
@@ -1245,11 +1245,11 @@ const $n = {
|
|
|
1245
1245
|
flexGrow: 1
|
|
1246
1246
|
},
|
|
1247
1247
|
children: [
|
|
1248
|
-
/* @__PURE__ */ e(_r, { className: "filter-tabs-list", children: l.map((
|
|
1248
|
+
/* @__PURE__ */ e(_r, { className: "filter-tabs-list", children: l.map((k) => /* @__PURE__ */ n(ne, { className: "filter-tab-item", children: [
|
|
1249
1249
|
/* @__PURE__ */ e("div", { className: "filter-selection-horizontal-indicator" }),
|
|
1250
1250
|
/* @__PURE__ */ n("div", { className: "filter-lbl-indicator-wrapper", children: [
|
|
1251
|
-
|
|
1252
|
-
A[
|
|
1251
|
+
k.label,
|
|
1252
|
+
A[k.key] && /* @__PURE__ */ e(
|
|
1253
1253
|
"span",
|
|
1254
1254
|
{
|
|
1255
1255
|
className: "filter-active-indicator",
|
|
@@ -1257,8 +1257,8 @@ const $n = {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
)
|
|
1259
1259
|
] })
|
|
1260
|
-
] },
|
|
1261
|
-
/* @__PURE__ */ e(Ur, { className: "filter-tabs-panels", children: l.map((
|
|
1260
|
+
] }, k.key)) }),
|
|
1261
|
+
/* @__PURE__ */ e(Ur, { className: "filter-tabs-panels", children: l.map((k) => /* @__PURE__ */ e(
|
|
1262
1262
|
ne.Panel,
|
|
1263
1263
|
{
|
|
1264
1264
|
className: "filter-tab-panel",
|
|
@@ -1269,12 +1269,12 @@ const $n = {
|
|
|
1269
1269
|
animate: { opacity: 1, x: 0 },
|
|
1270
1270
|
transition: { duration: 0.3 },
|
|
1271
1271
|
className: "h-full",
|
|
1272
|
-
children: q(
|
|
1272
|
+
children: q(k.key)
|
|
1273
1273
|
},
|
|
1274
|
-
|
|
1274
|
+
k.key
|
|
1275
1275
|
)
|
|
1276
1276
|
},
|
|
1277
|
-
|
|
1277
|
+
k.key
|
|
1278
1278
|
)) })
|
|
1279
1279
|
]
|
|
1280
1280
|
}
|
|
@@ -1358,7 +1358,7 @@ const $n = {
|
|
|
1358
1358
|
iconClass: "icon--info",
|
|
1359
1359
|
primaryButtonCategory: "primary"
|
|
1360
1360
|
}
|
|
1361
|
-
},
|
|
1361
|
+
}, On = ({
|
|
1362
1362
|
isOpen: t,
|
|
1363
1363
|
onClose: a,
|
|
1364
1364
|
title: s,
|
|
@@ -1434,7 +1434,7 @@ const $n = {
|
|
|
1434
1434
|
}
|
|
1435
1435
|
) })
|
|
1436
1436
|
] }) });
|
|
1437
|
-
},
|
|
1437
|
+
}, Pl = ({
|
|
1438
1438
|
currentPage: t,
|
|
1439
1439
|
totalItems: a,
|
|
1440
1440
|
itemsPerPage: s,
|
|
@@ -1786,7 +1786,7 @@ const $n = {
|
|
|
1786
1786
|
]
|
|
1787
1787
|
}
|
|
1788
1788
|
);
|
|
1789
|
-
},
|
|
1789
|
+
}, Ol = ({
|
|
1790
1790
|
navItems: t = [],
|
|
1791
1791
|
isCollapsed: a = !1,
|
|
1792
1792
|
onToggleCollapse: s,
|
|
@@ -2541,7 +2541,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2541
2541
|
type: "User",
|
|
2542
2542
|
avatarUrl: a?.profileImage || Je(l)
|
|
2543
2543
|
};
|
|
2544
|
-
}),
|
|
2544
|
+
}), Pt = (t) => {
|
|
2545
2545
|
try {
|
|
2546
2546
|
const a = JSON.parse(t);
|
|
2547
2547
|
return Array.isArray(a) ? a : [];
|
|
@@ -2592,10 +2592,10 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2592
2592
|
if (Array.isArray(s))
|
|
2593
2593
|
i = s;
|
|
2594
2594
|
else if (typeof s == "string")
|
|
2595
|
-
i =
|
|
2595
|
+
i = Pt(s.trim());
|
|
2596
2596
|
else if (s && typeof s == "object") {
|
|
2597
2597
|
const l = s.data;
|
|
2598
|
-
Array.isArray(l) ? i = l : typeof l == "string" && (i =
|
|
2598
|
+
Array.isArray(l) ? i = l : typeof l == "string" && (i = Pt(l.trim()));
|
|
2599
2599
|
}
|
|
2600
2600
|
return es(i);
|
|
2601
2601
|
}
|
|
@@ -2652,7 +2652,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2652
2652
|
]
|
|
2653
2653
|
}
|
|
2654
2654
|
);
|
|
2655
|
-
},
|
|
2655
|
+
}, Ot = [
|
|
2656
2656
|
{ id: 1, name: Te.USER, icon: nr, code: "users" },
|
|
2657
2657
|
{ id: 2, name: Te.GROUP, icon: Zt, code: "groups" },
|
|
2658
2658
|
{ id: 3, name: Te.ROLE, icon: sr, code: "roles" }
|
|
@@ -2672,11 +2672,11 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2672
2672
|
},
|
|
2673
2673
|
isChanged: u = !1
|
|
2674
2674
|
}) => {
|
|
2675
|
-
const [p, b] = M(
|
|
2675
|
+
const [p, b] = M(Ot[0]), [f, r] = M(""), y = Ct(f, 400), [d, h] = M([]), [$, T] = M(/* @__PURE__ */ new Set()), [A, E] = M(!1), [I, j] = M(Lt[0]), {
|
|
2676
2676
|
control: _,
|
|
2677
2677
|
handleSubmit: G,
|
|
2678
2678
|
watch: q,
|
|
2679
|
-
formState: { errors:
|
|
2679
|
+
formState: { errors: k, isSubmitting: g }
|
|
2680
2680
|
} = lr({
|
|
2681
2681
|
defaultValues: { pendingInvites: [] },
|
|
2682
2682
|
resolver: cr(as)
|
|
@@ -2689,35 +2689,35 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2689
2689
|
h(D);
|
|
2690
2690
|
}).catch((D) => console.error("Search failed:", D)).finally(() => E(!1))) : (h([]), T(/* @__PURE__ */ new Set()));
|
|
2691
2691
|
}, [y, p]);
|
|
2692
|
-
const
|
|
2693
|
-
T((
|
|
2694
|
-
const V = new Set(
|
|
2692
|
+
const C = (D) => {
|
|
2693
|
+
T((O) => {
|
|
2694
|
+
const V = new Set(O);
|
|
2695
2695
|
return V.has(D) ? V.delete(D) : V.add(D), V;
|
|
2696
2696
|
});
|
|
2697
2697
|
}, F = () => {
|
|
2698
2698
|
d.filter((D) => $.has(D.id)).forEach((D) => {
|
|
2699
|
-
v.find((
|
|
2699
|
+
v.find((O) => O.id === D.id) || w({ ...D, permission: I.name });
|
|
2700
2700
|
}), T(/* @__PURE__ */ new Set()), r("");
|
|
2701
2701
|
}, L = (D) => {
|
|
2702
2702
|
j(D), v.forEach(
|
|
2703
|
-
(
|
|
2703
|
+
(O, V) => N(V, { ...v[V], permission: D.name })
|
|
2704
2704
|
);
|
|
2705
2705
|
}, U = async (D) => {
|
|
2706
2706
|
try {
|
|
2707
2707
|
if (l === de.DRIVE) {
|
|
2708
|
-
const
|
|
2708
|
+
const O = D.pendingInvites.map((R) => ({
|
|
2709
2709
|
id: R.id,
|
|
2710
2710
|
permission: R.permission,
|
|
2711
2711
|
type: R.type.toLowerCase()
|
|
2712
2712
|
}));
|
|
2713
2713
|
o({
|
|
2714
2714
|
entity: t,
|
|
2715
|
-
userGroupRolesObj:
|
|
2715
|
+
userGroupRolesObj: O,
|
|
2716
2716
|
existingShares: i
|
|
2717
2717
|
// Always send updated existing shares
|
|
2718
2718
|
}, i);
|
|
2719
2719
|
} else if (l === de.INTEREST) {
|
|
2720
|
-
const
|
|
2720
|
+
const O = D.pendingInvites.map((V) => ({
|
|
2721
2721
|
identity: V.id,
|
|
2722
2722
|
type: V.type.toLowerCase(),
|
|
2723
2723
|
opt: !0,
|
|
@@ -2726,16 +2726,16 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2726
2726
|
userName: V.name,
|
|
2727
2727
|
interestId: t?.data?.id
|
|
2728
2728
|
}));
|
|
2729
|
-
o(
|
|
2729
|
+
o(O, i);
|
|
2730
2730
|
} else if (l === de.ARTICLE) {
|
|
2731
|
-
const
|
|
2731
|
+
const O = D.pendingInvites.map((R) => ({
|
|
2732
2732
|
id: R.id,
|
|
2733
2733
|
permission: R.permission,
|
|
2734
2734
|
type: R.type.toLowerCase()
|
|
2735
2735
|
}));
|
|
2736
2736
|
o({
|
|
2737
2737
|
entity: t,
|
|
2738
|
-
userGroupRolesObj:
|
|
2738
|
+
userGroupRolesObj: O,
|
|
2739
2739
|
existingShares: i
|
|
2740
2740
|
}, i);
|
|
2741
2741
|
} else
|
|
@@ -2743,13 +2743,13 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2743
2743
|
setTimeout(() => {
|
|
2744
2744
|
s();
|
|
2745
2745
|
}, 1e3);
|
|
2746
|
-
} catch (
|
|
2747
|
-
throw console.error("Failed to submit invites:",
|
|
2746
|
+
} catch (O) {
|
|
2747
|
+
throw console.error("Failed to submit invites:", O), O;
|
|
2748
2748
|
}
|
|
2749
2749
|
}, S = (D) => {
|
|
2750
|
-
const
|
|
2751
|
-
return
|
|
2752
|
-
},
|
|
2750
|
+
const O = i[p.code].find((V) => V.name === D.name && V.permission !== "remove") || x.find((V) => V.name === D.name);
|
|
2751
|
+
return O ? `${O.permission}` : "";
|
|
2752
|
+
}, P = () => {
|
|
2753
2753
|
switch (l) {
|
|
2754
2754
|
case de.DRIVE:
|
|
2755
2755
|
return "Share with others";
|
|
@@ -2763,7 +2763,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2763
2763
|
};
|
|
2764
2764
|
return ue(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", x.length), x.length === 0 && !u), [x.length, u]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2765
2765
|
/* @__PURE__ */ n("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2766
|
-
/* @__PURE__ */ e(ye.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children:
|
|
2766
|
+
/* @__PURE__ */ e(ye.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: P() }),
|
|
2767
2767
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
|
|
2768
2768
|
l === de.DRIVE && /* @__PURE__ */ n("button", { className: "flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800 font-semibold hover:cursor-pointer", children: [
|
|
2769
2769
|
/* @__PURE__ */ e(or, { className: "h-5 w-5" }),
|
|
@@ -2805,28 +2805,28 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2805
2805
|
leave: "transition ease-in duration-100",
|
|
2806
2806
|
leaveFrom: "opacity-100",
|
|
2807
2807
|
leaveTo: "opacity-0",
|
|
2808
|
-
children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children:
|
|
2808
|
+
children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Ot.map((D) => /* @__PURE__ */ e(
|
|
2809
2809
|
K.Option,
|
|
2810
2810
|
{
|
|
2811
2811
|
value: D,
|
|
2812
|
-
className: ({ active:
|
|
2813
|
-
children: ({ selected:
|
|
2812
|
+
className: ({ active: O }) => `${O ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2813
|
+
children: ({ selected: O }) => /* @__PURE__ */ n(te, { children: [
|
|
2814
2814
|
/* @__PURE__ */ n(
|
|
2815
2815
|
"span",
|
|
2816
2816
|
{
|
|
2817
|
-
className: `${
|
|
2817
|
+
className: `${O ? "font-medium" : "font-normal"} flex items-center`,
|
|
2818
2818
|
children: [
|
|
2819
2819
|
/* @__PURE__ */ e(
|
|
2820
2820
|
D.icon,
|
|
2821
2821
|
{
|
|
2822
|
-
className: `h-5 w-5 mr-2 ${
|
|
2822
|
+
className: `h-5 w-5 mr-2 ${O ? "text-white" : "text-gray-400"}`
|
|
2823
2823
|
}
|
|
2824
2824
|
),
|
|
2825
2825
|
D.name
|
|
2826
2826
|
]
|
|
2827
2827
|
}
|
|
2828
2828
|
),
|
|
2829
|
-
|
|
2829
|
+
O && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-white", children: /* @__PURE__ */ e(ht, { className: "h-5 w-5" }) })
|
|
2830
2830
|
] })
|
|
2831
2831
|
},
|
|
2832
2832
|
D.id
|
|
@@ -2852,12 +2852,12 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2852
2852
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2853
2853
|
children: A ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(te, { children: [
|
|
2854
2854
|
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((D) => {
|
|
2855
|
-
const
|
|
2855
|
+
const O = S(D);
|
|
2856
2856
|
return /* @__PURE__ */ n(
|
|
2857
2857
|
"div",
|
|
2858
2858
|
{
|
|
2859
|
-
onClick: () =>
|
|
2860
|
-
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${
|
|
2859
|
+
onClick: () => O ? null : C(D.id),
|
|
2860
|
+
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${O ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2861
2861
|
children: [
|
|
2862
2862
|
/* @__PURE__ */ e(
|
|
2863
2863
|
"input",
|
|
@@ -2866,7 +2866,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2866
2866
|
checked: $.has(D.id),
|
|
2867
2867
|
readOnly: !0,
|
|
2868
2868
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
|
|
2869
|
-
disabled: !!
|
|
2869
|
+
disabled: !!O
|
|
2870
2870
|
}
|
|
2871
2871
|
),
|
|
2872
2872
|
/* @__PURE__ */ e(
|
|
@@ -2878,8 +2878,8 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2878
2878
|
}
|
|
2879
2879
|
),
|
|
2880
2880
|
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: D.name }),
|
|
2881
|
-
|
|
2882
|
-
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children:
|
|
2881
|
+
O ? /* @__PURE__ */ n(te, { children: [
|
|
2882
|
+
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children: O }),
|
|
2883
2883
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
|
|
2884
2884
|
] }) : ""
|
|
2885
2885
|
]
|
|
@@ -2950,12 +2950,12 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2950
2950
|
K.Option,
|
|
2951
2951
|
{
|
|
2952
2952
|
value: D,
|
|
2953
|
-
className: ({ active:
|
|
2954
|
-
children: ({ selected:
|
|
2953
|
+
className: ({ active: O }) => `${O ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2954
|
+
children: ({ selected: O, active: V }) => /* @__PURE__ */ n(te, { children: [
|
|
2955
2955
|
/* @__PURE__ */ n(
|
|
2956
2956
|
"span",
|
|
2957
2957
|
{
|
|
2958
|
-
className: `${
|
|
2958
|
+
className: `${O ? "font-medium" : "font-normal"} flex items-center`,
|
|
2959
2959
|
children: [
|
|
2960
2960
|
/* @__PURE__ */ e(
|
|
2961
2961
|
D.icon,
|
|
@@ -2968,7 +2968,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2968
2968
|
]
|
|
2969
2969
|
}
|
|
2970
2970
|
),
|
|
2971
|
-
|
|
2971
|
+
O && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(
|
|
2972
2972
|
ht,
|
|
2973
2973
|
{
|
|
2974
2974
|
className: "h-5 w-5",
|
|
@@ -2985,7 +2985,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
2985
2985
|
}
|
|
2986
2986
|
)
|
|
2987
2987
|
] }),
|
|
2988
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Ce, { children: v.map((D,
|
|
2988
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Ce, { children: v.map((D, O) => /* @__PURE__ */ n(
|
|
2989
2989
|
le.div,
|
|
2990
2990
|
{
|
|
2991
2991
|
layout: !0,
|
|
@@ -3013,7 +3013,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3013
3013
|
/* @__PURE__ */ e(
|
|
3014
3014
|
"button",
|
|
3015
3015
|
{
|
|
3016
|
-
onClick: () => z(
|
|
3016
|
+
onClick: () => z(O),
|
|
3017
3017
|
className: "text-gray-400 hover:text-red-500 hover:cursor-pointer",
|
|
3018
3018
|
children: /* @__PURE__ */ e(et, { className: "h-5 w-5" })
|
|
3019
3019
|
}
|
|
@@ -3163,7 +3163,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3163
3163
|
u((q) => ({
|
|
3164
3164
|
...q,
|
|
3165
3165
|
[j]: q[j].map(
|
|
3166
|
-
(
|
|
3166
|
+
(k) => k.id === E.id ? { ...k, permission: G } : k
|
|
3167
3167
|
)
|
|
3168
3168
|
}));
|
|
3169
3169
|
}, $ = () => {
|
|
@@ -3473,9 +3473,9 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3473
3473
|
E(resp);
|
|
3474
3474
|
}
|
|
3475
3475
|
h({ id: v, type: z, name: w }), j(b), f(fe.MEMBERS);
|
|
3476
|
-
},
|
|
3476
|
+
}, k = (v) => {
|
|
3477
3477
|
console.log("changedExistingShares", v), y(v);
|
|
3478
|
-
const w = ct.mapValues(t, (x) => x.map((
|
|
3478
|
+
const w = ct.mapValues(t, (x) => x.map((C) => ({ id: C.id, permission: C.permission })).sort((C, F) => C.id - F.id)), z = ct.mapValues(v, (x) => x.map((C) => ({ id: C.id, permission: C.permission })).sort((C, F) => C.id - F.id));
|
|
3479
3479
|
console.log("Existing data:", w), console.log("Changed data:", z);
|
|
3480
3480
|
const N = !ct.isEqual(w, z);
|
|
3481
3481
|
console.log("hasPermissionChanged:", N), T(N), f(b === fe.MEMBERS ? I : fe.INVITE);
|
|
@@ -3497,7 +3497,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3497
3497
|
ss,
|
|
3498
3498
|
{
|
|
3499
3499
|
entity: i,
|
|
3500
|
-
onBack:
|
|
3500
|
+
onBack: k,
|
|
3501
3501
|
onClose: _,
|
|
3502
3502
|
onOpenMembers: q,
|
|
3503
3503
|
existingShares: r,
|
|
@@ -3521,7 +3521,7 @@ const Re = Hn(), Ve = Re.axiosGet, Qn = Re.axiosDelete, _e = Re.axiosPost, Zn =
|
|
|
3521
3521
|
is,
|
|
3522
3522
|
{
|
|
3523
3523
|
entity: d,
|
|
3524
|
-
onBack:
|
|
3524
|
+
onBack: k,
|
|
3525
3525
|
onClose: _,
|
|
3526
3526
|
calledBy: l,
|
|
3527
3527
|
existingShares: r,
|
|
@@ -3600,7 +3600,7 @@ function nt({
|
|
|
3600
3600
|
Z(() => {
|
|
3601
3601
|
b === "server" && A.length >= y && A !== I.current && (I.current = A, f && f(A));
|
|
3602
3602
|
}, [A, b, y, f]);
|
|
3603
|
-
const q = b === "client" ? G : a,
|
|
3603
|
+
const q = b === "client" ? G : a, k = () => {
|
|
3604
3604
|
if (!_.length)
|
|
3605
3605
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
|
|
3606
3606
|
const v = _.slice(0, u), w = _.length - u;
|
|
@@ -3645,7 +3645,7 @@ function nt({
|
|
|
3645
3645
|
o ? "ring-red-500" : "ring-gray-300"
|
|
3646
3646
|
),
|
|
3647
3647
|
children: [
|
|
3648
|
-
/* @__PURE__ */ e("span", { className: "block truncate", children:
|
|
3648
|
+
/* @__PURE__ */ e("span", { className: "block truncate", children: k() }),
|
|
3649
3649
|
/* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(Ht, { className: "w-5 h-5 text-gray-400", "aria-hidden": "true" }) })
|
|
3650
3650
|
]
|
|
3651
3651
|
}
|
|
@@ -3669,14 +3669,14 @@ function nt({
|
|
|
3669
3669
|
) }),
|
|
3670
3670
|
b === "server" && r && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3671
3671
|
q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? A.length < y ? `Type at least ${y} characters to search.` : "No results." : "No options found." }) : q.map((w) => {
|
|
3672
|
-
const z = d(w), N = h(w), x = _.some((F) => d(F) === z),
|
|
3672
|
+
const z = d(w), N = h(w), x = _.some((F) => d(F) === z), C = p !== -1 && _.length >= p && !x;
|
|
3673
3673
|
return /* @__PURE__ */ e(
|
|
3674
3674
|
K.Option,
|
|
3675
3675
|
{
|
|
3676
3676
|
value: w,
|
|
3677
|
-
disabled:
|
|
3677
|
+
disabled: C,
|
|
3678
3678
|
className: ({ active: F }) => Ge(
|
|
3679
|
-
|
|
3679
|
+
C ? " text-gray-400 bg-white cursor-not-allowed" : F ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3680
3680
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3681
3681
|
),
|
|
3682
3682
|
children: ({ selected: F, active: L }) => /* @__PURE__ */ n(te, { children: [
|
|
@@ -3866,7 +3866,7 @@ function ds({
|
|
|
3866
3866
|
dropId: f,
|
|
3867
3867
|
indent: r = 24
|
|
3868
3868
|
}) {
|
|
3869
|
-
const { setNodeRef: y, isOver: d } = ur({ id: f }), { attributes: h, listeners: $, setNodeRef: T, transform: A, isDragging: E } = hr({ id: b }), I = A ? { transform: `translate3d(${Math.round(A.x)}px, ${Math.round(A.y)}px, 0)` } : void 0, [j, _] = M(!1), [G, q] = M(t.name),
|
|
3869
|
+
const { setNodeRef: y, isOver: d } = ur({ id: f }), { attributes: h, listeners: $, setNodeRef: T, transform: A, isDragging: E } = hr({ id: b }), I = A ? { transform: `translate3d(${Math.round(A.x)}px, ${Math.round(A.y)}px, 0)` } : void 0, [j, _] = M(!1), [G, q] = M(t.name), k = () => {
|
|
3870
3870
|
const v = G.trim();
|
|
3871
3871
|
_(!1), v && v !== t.name ? o?.(t, v) : q(t.name);
|
|
3872
3872
|
}, g = ue(() => /* @__PURE__ */ e(
|
|
@@ -3900,9 +3900,9 @@ function ds({
|
|
|
3900
3900
|
className: "tv-input",
|
|
3901
3901
|
value: G,
|
|
3902
3902
|
onChange: (v) => q(v.target.value),
|
|
3903
|
-
onBlur:
|
|
3903
|
+
onBlur: k,
|
|
3904
3904
|
onKeyDown: (v) => {
|
|
3905
|
-
v.key === "Enter" &&
|
|
3905
|
+
v.key === "Enter" && k(), v.key === "Escape" && (_(!1), q(t.name));
|
|
3906
3906
|
},
|
|
3907
3907
|
autoFocus: !0
|
|
3908
3908
|
}
|
|
@@ -4009,36 +4009,36 @@ function Jl({
|
|
|
4009
4009
|
indentUnit: h = 24
|
|
4010
4010
|
}) {
|
|
4011
4011
|
const { roots: $ } = ue(() => ps(t) ? bs(t, { rootId: a, getId: i, getName: m }) : gs(
|
|
4012
|
-
t.map((
|
|
4012
|
+
t.map((C) => ({ ...C })),
|
|
4013
4013
|
{ rootId: a, getId: i, getParent: l, getName: m }
|
|
4014
|
-
), [t, a, i, l, m]), [T, A] = M({}), E = ae((
|
|
4014
|
+
), [t, a, i, l, m]), [T, A] = M({}), E = ae((C) => {
|
|
4015
4015
|
const F = {};
|
|
4016
4016
|
return (function L(U) {
|
|
4017
4017
|
U.forEach((S) => {
|
|
4018
4018
|
F[S.id] = !0, S.children?.length && L(S.children);
|
|
4019
4019
|
});
|
|
4020
|
-
})(
|
|
4020
|
+
})(C), F;
|
|
4021
4021
|
}, []);
|
|
4022
4022
|
se.useEffect(() => {
|
|
4023
4023
|
A(E($));
|
|
4024
4024
|
}, [$, E]);
|
|
4025
4025
|
const I = ae(
|
|
4026
|
-
(
|
|
4026
|
+
(C) => A((F) => ({ ...F, [C]: !F[C] })),
|
|
4027
4027
|
[]
|
|
4028
4028
|
), [j, _] = M(() => Le($));
|
|
4029
4029
|
se.useEffect(() => _(Le($)), [$]);
|
|
4030
4030
|
const G = pr(
|
|
4031
4031
|
gr(yr, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
4032
|
-
), q = xe(null), [
|
|
4033
|
-
}, z = ({ delta:
|
|
4034
|
-
v.current =
|
|
4032
|
+
), q = xe(null), [k, g] = M(null), v = xe(0), w = () => {
|
|
4033
|
+
}, z = ({ delta: C }) => {
|
|
4034
|
+
v.current = C?.x ?? 0;
|
|
4035
4035
|
}, N = ae(
|
|
4036
|
-
({ active:
|
|
4036
|
+
({ active: C, over: F }) => {
|
|
4037
4037
|
const L = v.current;
|
|
4038
|
-
if (v.current = 0, g(null), !
|
|
4039
|
-
const U = String(
|
|
4038
|
+
if (v.current = 0, g(null), !C || !F) return;
|
|
4039
|
+
const U = String(C.id).replace(/^drag-/, ""), S = String(F.id).replace(/^drop-/, "");
|
|
4040
4040
|
if (!U || !S || U === S) return;
|
|
4041
|
-
let
|
|
4041
|
+
let P = S;
|
|
4042
4042
|
const D = Math.max(0, Math.floor(-L / h));
|
|
4043
4043
|
if (D > 0) {
|
|
4044
4044
|
let W = S;
|
|
@@ -4046,24 +4046,24 @@ function Jl({
|
|
|
4046
4046
|
const B = Ta(j, W, null);
|
|
4047
4047
|
if (!B) break;
|
|
4048
4048
|
if (!B.parentId) {
|
|
4049
|
-
|
|
4049
|
+
P = a;
|
|
4050
4050
|
break;
|
|
4051
4051
|
}
|
|
4052
|
-
|
|
4052
|
+
P = B.parentId, W = B.parentId;
|
|
4053
4053
|
}
|
|
4054
4054
|
}
|
|
4055
|
-
if (d &&
|
|
4055
|
+
if (d && P === a) {
|
|
4056
4056
|
_(Le($));
|
|
4057
4057
|
return;
|
|
4058
4058
|
}
|
|
4059
|
-
const
|
|
4059
|
+
const O = Le(j), { newRoots: V, removed: R } = fs(O, U);
|
|
4060
4060
|
if (!R) return;
|
|
4061
|
-
const Y = xs(V,
|
|
4062
|
-
_(Y), r?.({ sourceId: U, destParentId:
|
|
4061
|
+
const Y = xs(V, P, R);
|
|
4062
|
+
_(Y), r?.({ sourceId: U, destParentId: P, newTree: Y });
|
|
4063
4063
|
},
|
|
4064
4064
|
[j, $, a, d, h, r]
|
|
4065
4065
|
), x = ae(
|
|
4066
|
-
(
|
|
4066
|
+
(C, F = 0) => C.map((L) => /* @__PURE__ */ n(se.Fragment, { children: [
|
|
4067
4067
|
/* @__PURE__ */ e(
|
|
4068
4068
|
ds,
|
|
4069
4069
|
{
|
|
@@ -4086,18 +4086,18 @@ function Jl({
|
|
|
4086
4086
|
[T, h, p, f, b, o, y, I]
|
|
4087
4087
|
);
|
|
4088
4088
|
return se.useMemo(() => {
|
|
4089
|
-
if (!
|
|
4090
|
-
const
|
|
4089
|
+
if (!k) return null;
|
|
4090
|
+
const C = String(k).replace(/^drag-/, "");
|
|
4091
4091
|
function F(L) {
|
|
4092
4092
|
for (const U of L) {
|
|
4093
|
-
if (U.id ===
|
|
4093
|
+
if (U.id === C) return U;
|
|
4094
4094
|
const S = U.children?.length ? F(U.children) : null;
|
|
4095
4095
|
if (S) return S;
|
|
4096
4096
|
}
|
|
4097
4097
|
return null;
|
|
4098
4098
|
}
|
|
4099
4099
|
return F(j);
|
|
4100
|
-
}, [
|
|
4100
|
+
}, [k, j]), /* @__PURE__ */ n("div", { className: "tv", children: [
|
|
4101
4101
|
s !== !1 && /* @__PURE__ */ n("div", { className: "tv-header", children: [
|
|
4102
4102
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
4103
4103
|
/* @__PURE__ */ e("button", { className: "tv-btn", onClick: u, children: "+ New folder" })
|
|
@@ -4660,8 +4660,8 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4660
4660
|
}, []);
|
|
4661
4661
|
const $ = (g) => {
|
|
4662
4662
|
const v = (N, x) => {
|
|
4663
|
-
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: N, value: x, type: typeof x }), r((
|
|
4664
|
-
const F = [...
|
|
4663
|
+
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: N, value: x, type: typeof x }), r((C) => {
|
|
4664
|
+
const F = [...C];
|
|
4665
4665
|
return F[N][g.key] = x, F;
|
|
4666
4666
|
});
|
|
4667
4667
|
}, w = (N) => i[l.key]?.[N]?.[g.key], z = (N) => {
|
|
@@ -4675,7 +4675,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4675
4675
|
X,
|
|
4676
4676
|
{
|
|
4677
4677
|
value: N[g.key] || "",
|
|
4678
|
-
onChange: (
|
|
4678
|
+
onChange: (C) => v(x, C.target.value),
|
|
4679
4679
|
placeholder: g.placeholder || `Enter ${g.label}`,
|
|
4680
4680
|
required: g.required,
|
|
4681
4681
|
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
@@ -4689,7 +4689,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4689
4689
|
ya,
|
|
4690
4690
|
{
|
|
4691
4691
|
value: N[g.key] || "",
|
|
4692
|
-
onChange: (
|
|
4692
|
+
onChange: (C) => v(x, C.target.value),
|
|
4693
4693
|
placeholder: g.placeholder || `Enter ${g.label}`,
|
|
4694
4694
|
required: g.required,
|
|
4695
4695
|
className: `w-full ${w(x) ? "border-red-500" : ""}`,
|
|
@@ -4705,7 +4705,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4705
4705
|
{
|
|
4706
4706
|
type: "number",
|
|
4707
4707
|
value: N[g.key] || "",
|
|
4708
|
-
onChange: (
|
|
4708
|
+
onChange: (C) => v(x, C.target.value),
|
|
4709
4709
|
placeholder: g.placeholder || `Enter ${g.label}`,
|
|
4710
4710
|
required: g.required,
|
|
4711
4711
|
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
@@ -4720,7 +4720,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4720
4720
|
{
|
|
4721
4721
|
type: "email",
|
|
4722
4722
|
value: N[g.key] || "",
|
|
4723
|
-
onChange: (
|
|
4723
|
+
onChange: (C) => v(x, C.target.value),
|
|
4724
4724
|
placeholder: g.placeholder || "Enter email address",
|
|
4725
4725
|
required: g.required,
|
|
4726
4726
|
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
@@ -4735,7 +4735,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4735
4735
|
{
|
|
4736
4736
|
type: "url",
|
|
4737
4737
|
value: N[g.key] || "",
|
|
4738
|
-
onChange: (
|
|
4738
|
+
onChange: (C) => v(x, C.target.value),
|
|
4739
4739
|
placeholder: g.placeholder || "Enter URL",
|
|
4740
4740
|
required: g.required,
|
|
4741
4741
|
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
@@ -4750,7 +4750,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4750
4750
|
{
|
|
4751
4751
|
type: "password",
|
|
4752
4752
|
value: N[g.key] || "",
|
|
4753
|
-
onChange: (
|
|
4753
|
+
onChange: (C) => v(x, C.target.value),
|
|
4754
4754
|
placeholder: g.placeholder || "Enter password",
|
|
4755
4755
|
required: g.required,
|
|
4756
4756
|
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
@@ -4765,7 +4765,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4765
4765
|
ft,
|
|
4766
4766
|
{
|
|
4767
4767
|
value: N[g.key] || "",
|
|
4768
|
-
onChange: (
|
|
4768
|
+
onChange: (C) => v(x, C),
|
|
4769
4769
|
options: g.options || [],
|
|
4770
4770
|
placeholder: g.placeholder || `Select ${g.label}`,
|
|
4771
4771
|
required: g.required,
|
|
@@ -4776,14 +4776,14 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4776
4776
|
] });
|
|
4777
4777
|
case "selectDynamic":
|
|
4778
4778
|
return (N, x) => {
|
|
4779
|
-
const
|
|
4779
|
+
const C = () => {
|
|
4780
4780
|
if (g.optionsFrom && a) {
|
|
4781
4781
|
const { config: F, valueField: L, labelField: U } = g.optionsFrom, S = a[F] || [];
|
|
4782
4782
|
if (Array.isArray(S))
|
|
4783
|
-
return S.map((
|
|
4784
|
-
id:
|
|
4785
|
-
value:
|
|
4786
|
-
label:
|
|
4783
|
+
return S.map((P) => ({
|
|
4784
|
+
id: P[L] || "",
|
|
4785
|
+
value: P[L] || "",
|
|
4786
|
+
label: P[U] || ""
|
|
4787
4787
|
}));
|
|
4788
4788
|
}
|
|
4789
4789
|
return g.options || [];
|
|
@@ -4795,7 +4795,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4795
4795
|
index: x,
|
|
4796
4796
|
value: N[g.key] || "",
|
|
4797
4797
|
onChange: (F) => v(x, F),
|
|
4798
|
-
options:
|
|
4798
|
+
options: C(),
|
|
4799
4799
|
placeholder: g.placeholder || `Select ${g.label}`,
|
|
4800
4800
|
required: g.required,
|
|
4801
4801
|
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
@@ -4807,11 +4807,11 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4807
4807
|
};
|
|
4808
4808
|
case "multiselect":
|
|
4809
4809
|
return (N, x) => {
|
|
4810
|
-
const
|
|
4810
|
+
const C = N[g.key] || [];
|
|
4811
4811
|
return /* @__PURE__ */ e(
|
|
4812
4812
|
nt,
|
|
4813
4813
|
{
|
|
4814
|
-
selectedItems:
|
|
4814
|
+
selectedItems: C,
|
|
4815
4815
|
onSelectionChange: (F) => v(x, F),
|
|
4816
4816
|
options: g.options || [],
|
|
4817
4817
|
placeholder: g.placeholder || `Select ${g.label}`,
|
|
@@ -4825,7 +4825,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4825
4825
|
ma,
|
|
4826
4826
|
{
|
|
4827
4827
|
checked: !!N[g.key],
|
|
4828
|
-
onChange: (
|
|
4828
|
+
onChange: (C) => v(x, C),
|
|
4829
4829
|
label: g.placeholder || g.label,
|
|
4830
4830
|
className: "w-full"
|
|
4831
4831
|
}
|
|
@@ -4836,7 +4836,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4836
4836
|
va,
|
|
4837
4837
|
{
|
|
4838
4838
|
isOn: !!N[g.key],
|
|
4839
|
-
onToggle: (
|
|
4839
|
+
onToggle: (C) => v(x, C),
|
|
4840
4840
|
label: g.placeholder || g.label,
|
|
4841
4841
|
className: "w-full"
|
|
4842
4842
|
}
|
|
@@ -4846,7 +4846,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4846
4846
|
ga,
|
|
4847
4847
|
{
|
|
4848
4848
|
selectedDate: N[g.key] ? new Date(N[g.key]) : null,
|
|
4849
|
-
onDateChange: (
|
|
4849
|
+
onDateChange: (C) => v(x, C ? C.toISOString().split("T")[0] : ""),
|
|
4850
4850
|
placeholder: g.placeholder || "Select date",
|
|
4851
4851
|
className: "w-full"
|
|
4852
4852
|
}
|
|
@@ -4857,7 +4857,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4857
4857
|
{
|
|
4858
4858
|
type: "datetime-local",
|
|
4859
4859
|
value: N[g.key] || "",
|
|
4860
|
-
onChange: (
|
|
4860
|
+
onChange: (C) => v(x, C.target.value),
|
|
4861
4861
|
placeholder: g.placeholder || "Select date and time",
|
|
4862
4862
|
required: g.required,
|
|
4863
4863
|
className: "w-full"
|
|
@@ -4869,7 +4869,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4869
4869
|
{
|
|
4870
4870
|
type: "time",
|
|
4871
4871
|
value: N[g.key] || "",
|
|
4872
|
-
onChange: (
|
|
4872
|
+
onChange: (C) => v(x, C.target.value),
|
|
4873
4873
|
placeholder: g.placeholder || "Select time",
|
|
4874
4874
|
required: g.required,
|
|
4875
4875
|
className: "w-full"
|
|
@@ -4880,7 +4880,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4880
4880
|
ba,
|
|
4881
4881
|
{
|
|
4882
4882
|
selectedValue: N[g.key] || "",
|
|
4883
|
-
onValueChange: (
|
|
4883
|
+
onValueChange: (C) => v(x, C),
|
|
4884
4884
|
options: g.options || [],
|
|
4885
4885
|
className: "w-full"
|
|
4886
4886
|
}
|
|
@@ -4890,17 +4890,17 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4890
4890
|
be,
|
|
4891
4891
|
{
|
|
4892
4892
|
value: N[g.key] || "",
|
|
4893
|
-
onChange: (
|
|
4893
|
+
onChange: (C) => v(x, C),
|
|
4894
4894
|
placeholder: g.placeholder || `Search ${g.label}`,
|
|
4895
4895
|
className: "w-full"
|
|
4896
4896
|
}
|
|
4897
4897
|
);
|
|
4898
4898
|
case "audience":
|
|
4899
4899
|
return (N, x) => {
|
|
4900
|
-
const
|
|
4901
|
-
...
|
|
4902
|
-
...
|
|
4903
|
-
...
|
|
4900
|
+
const C = N[g.key] || { users: [], groups: [], roles: [] }, F = [
|
|
4901
|
+
...C.users || [],
|
|
4902
|
+
...C.groups || [],
|
|
4903
|
+
...C.roles || []
|
|
4904
4904
|
];
|
|
4905
4905
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
4906
4906
|
/* @__PURE__ */ e(vs, { children: F.length > 0 ? F.slice(0, 3).map((L, U) => /* @__PURE__ */ e(
|
|
@@ -4930,7 +4930,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4930
4930
|
{
|
|
4931
4931
|
type: "color",
|
|
4932
4932
|
value: N[g.key] || "#000000",
|
|
4933
|
-
onChange: (
|
|
4933
|
+
onChange: (C) => v(x, C.target.value),
|
|
4934
4934
|
className: "w-full h-10"
|
|
4935
4935
|
}
|
|
4936
4936
|
);
|
|
@@ -4941,7 +4941,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4941
4941
|
{
|
|
4942
4942
|
type: "range",
|
|
4943
4943
|
value: N[g.key] || g.min || 0,
|
|
4944
|
-
onChange: (
|
|
4944
|
+
onChange: (C) => v(x, C.target.value),
|
|
4945
4945
|
min: g.min || 0,
|
|
4946
4946
|
max: g.max || 100,
|
|
4947
4947
|
step: g.step || 1,
|
|
@@ -4955,8 +4955,8 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4955
4955
|
X,
|
|
4956
4956
|
{
|
|
4957
4957
|
type: "file",
|
|
4958
|
-
onChange: (
|
|
4959
|
-
const F =
|
|
4958
|
+
onChange: (C) => {
|
|
4959
|
+
const F = C.target.files[0];
|
|
4960
4960
|
v(x, F ? F.name : "");
|
|
4961
4961
|
},
|
|
4962
4962
|
accept: g.accept,
|
|
@@ -4969,7 +4969,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4969
4969
|
{
|
|
4970
4970
|
type: "hidden",
|
|
4971
4971
|
value: N[g.key] || "",
|
|
4972
|
-
onChange: (
|
|
4972
|
+
onChange: (C) => v(x, C.target.value)
|
|
4973
4973
|
}
|
|
4974
4974
|
);
|
|
4975
4975
|
// Default fallback for unknown field types
|
|
@@ -4979,7 +4979,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
4979
4979
|
X,
|
|
4980
4980
|
{
|
|
4981
4981
|
value: N[g.key] || "",
|
|
4982
|
-
onChange: (
|
|
4982
|
+
onChange: (C) => v(x, C.target.value),
|
|
4983
4983
|
placeholder: g.placeholder || `Enter ${g.label}`,
|
|
4984
4984
|
required: g.required,
|
|
4985
4985
|
className: `w-full ${w(x) ? "border-red-500" : ""}`
|
|
@@ -5019,15 +5019,15 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5019
5019
|
}), I(null));
|
|
5020
5020
|
}, [E]), q = ae(() => {
|
|
5021
5021
|
I(null);
|
|
5022
|
-
}, []),
|
|
5022
|
+
}, []), k = ae((g) => {
|
|
5023
5023
|
console.log("[DataTableRenderer] handleAddAudience called with:", g), r((v) => {
|
|
5024
5024
|
const w = [...v];
|
|
5025
5025
|
if (o !== null && p && w[o]) {
|
|
5026
|
-
const z = g.pendingInvites || [], N = z.filter((F) => F.type === "User"), x = z.filter((F) => F.type === "Group"),
|
|
5026
|
+
const z = g.pendingInvites || [], N = z.filter((F) => F.type === "User"), x = z.filter((F) => F.type === "Group"), C = z.filter((F) => F.type === "Role");
|
|
5027
5027
|
w[o][p] = {
|
|
5028
5028
|
users: [...w[o][p]?.users || [], ...N],
|
|
5029
5029
|
groups: [...w[o][p]?.groups || [], ...x],
|
|
5030
|
-
roles: [...w[o][p]?.roles || [], ...
|
|
5030
|
+
roles: [...w[o][p]?.roles || [], ...C]
|
|
5031
5031
|
}, console.log("[DataTableRenderer] Updated audience data:", w[o][p]);
|
|
5032
5032
|
}
|
|
5033
5033
|
return w;
|
|
@@ -5100,7 +5100,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5100
5100
|
onClose: () => {
|
|
5101
5101
|
u(null), b(null);
|
|
5102
5102
|
},
|
|
5103
|
-
onFinalSubmit:
|
|
5103
|
+
onFinalSubmit: k,
|
|
5104
5104
|
existingShares: g,
|
|
5105
5105
|
allowedPermissions: ["view", "remove"]
|
|
5106
5106
|
}
|
|
@@ -5108,7 +5108,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
|
|
|
5108
5108
|
})()
|
|
5109
5109
|
] });
|
|
5110
5110
|
}
|
|
5111
|
-
const
|
|
5111
|
+
const Oe = {
|
|
5112
5112
|
containerId: "ui-toast",
|
|
5113
5113
|
position: "bottom-right",
|
|
5114
5114
|
autoClose: 3500,
|
|
@@ -5122,12 +5122,12 @@ const Mt = () => {
|
|
|
5122
5122
|
}, Bt = () => {
|
|
5123
5123
|
typeof document > "u" || (He = Math.max(0, He - 1), He === 0 && document.body.classList.remove("toast-backdrop"));
|
|
5124
5124
|
}, De = {
|
|
5125
|
-
success: (t, a) => me.success(t, { ...
|
|
5126
|
-
info: (t, a) => me.info(t, { ...
|
|
5127
|
-
warn: (t, a) => me.warn(t, { ...
|
|
5125
|
+
success: (t, a) => me.success(t, { ...Oe, ...a }),
|
|
5126
|
+
info: (t, a) => me.info(t, { ...Oe, ...a }),
|
|
5127
|
+
warn: (t, a) => me.warn(t, { ...Oe, ...a }),
|
|
5128
5128
|
// Error: no autoClose + modal-like behavior via backdrop
|
|
5129
5129
|
error: (t, a) => me.error(t, {
|
|
5130
|
-
...
|
|
5130
|
+
...Oe,
|
|
5131
5131
|
autoClose: !1,
|
|
5132
5132
|
closeOnClick: !1,
|
|
5133
5133
|
draggable: !1,
|
|
@@ -5150,7 +5150,7 @@ const Mt = () => {
|
|
|
5150
5150
|
onClose: Bt
|
|
5151
5151
|
}
|
|
5152
5152
|
},
|
|
5153
|
-
{ ...
|
|
5153
|
+
{ ...Oe, ...s }
|
|
5154
5154
|
)
|
|
5155
5155
|
}, Ye = (t) => {
|
|
5156
5156
|
try {
|
|
@@ -5179,11 +5179,11 @@ const Mt = () => {
|
|
|
5179
5179
|
try {
|
|
5180
5180
|
const S = await Ve(t.collectionList);
|
|
5181
5181
|
if (S) {
|
|
5182
|
-
const
|
|
5182
|
+
const P = S.map((D, O) => ({
|
|
5183
5183
|
...D,
|
|
5184
|
-
order: typeof D.order == "number" ? D.order :
|
|
5184
|
+
order: typeof D.order == "number" ? D.order : O + 1
|
|
5185
5185
|
}));
|
|
5186
|
-
|
|
5186
|
+
P.sort((D, O) => (D.order ?? 0) - (O.order ?? 0)), h(P), s?.(P);
|
|
5187
5187
|
}
|
|
5188
5188
|
} catch (S) {
|
|
5189
5189
|
console.log("Error loading collections:", S), typeof window < "u" && !window.location.pathname.includes("iframe.html") && me.error("Failed to load collections");
|
|
@@ -5199,19 +5199,19 @@ const Mt = () => {
|
|
|
5199
5199
|
}, q = () => {
|
|
5200
5200
|
if (!l || b !== null) return;
|
|
5201
5201
|
const S = `temp-${Date.now()}`;
|
|
5202
|
-
h((
|
|
5203
|
-
...
|
|
5202
|
+
h((P) => [
|
|
5203
|
+
...P,
|
|
5204
5204
|
{
|
|
5205
5205
|
id: S,
|
|
5206
5206
|
categoryName: "",
|
|
5207
5207
|
links: [],
|
|
5208
|
-
order: (
|
|
5208
|
+
order: (P.at(-1)?.order ?? 0) + 1,
|
|
5209
5209
|
_temp: !0
|
|
5210
5210
|
}
|
|
5211
5211
|
]), f(S), y("");
|
|
5212
|
-
},
|
|
5212
|
+
}, k = () => {
|
|
5213
5213
|
b != null && (h((S) => {
|
|
5214
|
-
const
|
|
5214
|
+
const P = S.find((O) => O.id === b), D = P && P._temp ? S.filter((O) => O.id !== b) : S;
|
|
5215
5215
|
return s?.(D), D;
|
|
5216
5216
|
}), f(null), y(""));
|
|
5217
5217
|
}, g = async () => {
|
|
@@ -5219,64 +5219,64 @@ const Mt = () => {
|
|
|
5219
5219
|
const S = typeof b == "string" && b.startsWith("temp-");
|
|
5220
5220
|
try {
|
|
5221
5221
|
if (S) {
|
|
5222
|
-
const
|
|
5222
|
+
const P = await _e(t.collectionCreate, {
|
|
5223
5223
|
categoryName: r.trim(),
|
|
5224
5224
|
order: (Array.isArray(d) && d.length > 0 ? d.at(-1)?.order ?? 0 : 0) + 1
|
|
5225
5225
|
});
|
|
5226
|
-
|
|
5227
|
-
const
|
|
5228
|
-
return s?.(
|
|
5226
|
+
P && (h((D) => {
|
|
5227
|
+
const O = D.map((V) => V.id === b ? P : V);
|
|
5228
|
+
return s?.(O), O;
|
|
5229
5229
|
}), De.success("Collection created successfully"));
|
|
5230
5230
|
} else {
|
|
5231
|
-
const
|
|
5231
|
+
const P = await Zn(
|
|
5232
5232
|
`${t.collectionUpdate}/${b}?newName=${r.trim()}`
|
|
5233
5233
|
);
|
|
5234
5234
|
h((D) => {
|
|
5235
|
-
const
|
|
5236
|
-
(V) => V.id === b ?
|
|
5235
|
+
const O = D.map(
|
|
5236
|
+
(V) => V.id === b ? P && P.id ? { ...V, ...P } : { ...V, categoryName: r.trim() } : V
|
|
5237
5237
|
);
|
|
5238
|
-
return s?.(
|
|
5238
|
+
return s?.(O), O;
|
|
5239
5239
|
}), me.success("Collection updated successfully");
|
|
5240
5240
|
}
|
|
5241
5241
|
f(null), y("");
|
|
5242
|
-
} catch (
|
|
5243
|
-
console.log(
|
|
5242
|
+
} catch (P) {
|
|
5243
|
+
console.log(P), me.error("Failed to save collection");
|
|
5244
5244
|
}
|
|
5245
5245
|
}, v = async (S) => {
|
|
5246
5246
|
if (o)
|
|
5247
5247
|
try {
|
|
5248
5248
|
await Qn(`${t.collectionUpdate}/${S.id}`) && (me.success("Deleted successfully", { autoClose: 3e3 }), _());
|
|
5249
|
-
} catch (
|
|
5250
|
-
console.log(
|
|
5249
|
+
} catch (P) {
|
|
5250
|
+
console.log(P), me.error("Failed to delete collection");
|
|
5251
5251
|
}
|
|
5252
|
-
}, w = (S,
|
|
5253
|
-
if (!u || !
|
|
5254
|
-
const
|
|
5255
|
-
if (
|
|
5256
|
-
const R = [...S], [Y] = R.splice(
|
|
5252
|
+
}, w = (S, P, D) => {
|
|
5253
|
+
if (!u || !P || !D || P === D) return S;
|
|
5254
|
+
const O = S.findIndex((W) => W.id === P), V = S.findIndex((W) => W.id === D);
|
|
5255
|
+
if (O === -1 || V === -1) return S;
|
|
5256
|
+
const R = [...S], [Y] = R.splice(O, 1);
|
|
5257
5257
|
return R.splice(V, 0, Y), R.map((W, pe) => ({ ...W, order: pe + 1 }));
|
|
5258
5258
|
}, z = async (S) => {
|
|
5259
|
-
const
|
|
5259
|
+
const P = S.map((D) => ({
|
|
5260
5260
|
id: D.id,
|
|
5261
5261
|
order: D.order,
|
|
5262
5262
|
categoryName: D.categoryName
|
|
5263
5263
|
}));
|
|
5264
5264
|
try {
|
|
5265
|
-
await _e(t.updateCollection,
|
|
5265
|
+
await _e(t.updateCollection, P);
|
|
5266
5266
|
} catch (D) {
|
|
5267
5267
|
console.log(D), me.error("Failed to save order", { autoClose: 2500 });
|
|
5268
5268
|
}
|
|
5269
|
-
}, N = (S,
|
|
5270
|
-
u && (S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", String(
|
|
5269
|
+
}, N = (S, P) => {
|
|
5270
|
+
u && (S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", String(P)), T(P));
|
|
5271
5271
|
}, x = (S) => {
|
|
5272
5272
|
$ && S !== A && E(S);
|
|
5273
|
-
},
|
|
5273
|
+
}, C = (S) => {
|
|
5274
5274
|
S.preventDefault();
|
|
5275
|
-
}, F = async (S,
|
|
5275
|
+
}, F = async (S, P) => {
|
|
5276
5276
|
S.preventDefault();
|
|
5277
5277
|
const D = S.dataTransfer.getData("text/plain");
|
|
5278
|
-
D && (h((
|
|
5279
|
-
const V = w(
|
|
5278
|
+
D && (h((O) => {
|
|
5279
|
+
const V = w(O, D, P);
|
|
5280
5280
|
return console.log("Reordered", V), z(V), s?.(V), V;
|
|
5281
5281
|
}), T(null), E(null));
|
|
5282
5282
|
}, L = () => {
|
|
@@ -5309,21 +5309,21 @@ const Mt = () => {
|
|
|
5309
5309
|
)
|
|
5310
5310
|
] }) }),
|
|
5311
5311
|
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: U.map((S) => {
|
|
5312
|
-
const
|
|
5312
|
+
const P = b === S.id, D = S?.links?.length ?? 0, O = $ === S.id, V = A === S.id && $ !== S.id;
|
|
5313
5313
|
return /* @__PURE__ */ e(
|
|
5314
5314
|
"div",
|
|
5315
5315
|
{
|
|
5316
5316
|
onDragEnter: () => x(S.id),
|
|
5317
|
-
onDragOver:
|
|
5317
|
+
onDragOver: C,
|
|
5318
5318
|
onDrop: (R) => F(R, S.id),
|
|
5319
5319
|
onDragEnd: L,
|
|
5320
5320
|
className: [
|
|
5321
5321
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5322
5322
|
"border-gray-300",
|
|
5323
5323
|
V ? "ring-2 ring-gray-800/20" : "",
|
|
5324
|
-
|
|
5324
|
+
O ? "opacity-60" : ""
|
|
5325
5325
|
].join(" "),
|
|
5326
|
-
children:
|
|
5326
|
+
children: P ? /* @__PURE__ */ n(te, { children: [
|
|
5327
5327
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
5328
5328
|
"input",
|
|
5329
5329
|
{
|
|
@@ -5333,7 +5333,7 @@ const Mt = () => {
|
|
|
5333
5333
|
placeholder: S._temp ? "New collection name" : "Edit collection name",
|
|
5334
5334
|
onChange: (R) => y(R.target.value),
|
|
5335
5335
|
onKeyDown: (R) => {
|
|
5336
|
-
R.key === "Enter" && g(), R.key === "Escape" &&
|
|
5336
|
+
R.key === "Enter" && g(), R.key === "Escape" && k();
|
|
5337
5337
|
},
|
|
5338
5338
|
autoFocus: !0
|
|
5339
5339
|
}
|
|
@@ -5343,7 +5343,7 @@ const Mt = () => {
|
|
|
5343
5343
|
"button",
|
|
5344
5344
|
{
|
|
5345
5345
|
className: "cursor-pointer border border-gray-300 p-2 rounded-2xl",
|
|
5346
|
-
onClick:
|
|
5346
|
+
onClick: k,
|
|
5347
5347
|
"aria-label": "Cancel edit",
|
|
5348
5348
|
children: /* @__PURE__ */ e(ge, { color: "#767676" })
|
|
5349
5349
|
}
|
|
@@ -5471,16 +5471,16 @@ function Ss({
|
|
|
5471
5471
|
if (x.key && x.type === "datatable") {
|
|
5472
5472
|
const F = (N[x.key] || []).map((L, U) => {
|
|
5473
5473
|
const S = { id: L.id || 0 };
|
|
5474
|
-
return x.fields && x.fields.forEach((
|
|
5475
|
-
if (
|
|
5474
|
+
return x.fields && x.fields.forEach((P) => {
|
|
5475
|
+
if (P.fieldtype === "audience") {
|
|
5476
5476
|
let D = { users: [], groups: [], roles: [] };
|
|
5477
|
-
L[
|
|
5478
|
-
users: L[
|
|
5479
|
-
groups: L[
|
|
5480
|
-
roles: L[
|
|
5481
|
-
})), S[
|
|
5477
|
+
L[P.key] && (Array.isArray(L[P.key]) ? D = { users: [], groups: [], roles: [] } : typeof L[P.key] == "object" && (D = {
|
|
5478
|
+
users: L[P.key].users || [],
|
|
5479
|
+
groups: L[P.key].groups || [],
|
|
5480
|
+
roles: L[P.key].roles || []
|
|
5481
|
+
})), S[P.key] = D;
|
|
5482
5482
|
} else
|
|
5483
|
-
S[
|
|
5483
|
+
S[P.key] = L[P.key] || P.default || "";
|
|
5484
5484
|
}), S;
|
|
5485
5485
|
});
|
|
5486
5486
|
if (F.length === 0) {
|
|
@@ -5530,8 +5530,8 @@ function Ss({
|
|
|
5530
5530
|
console.error("Error fetching configuration:", z);
|
|
5531
5531
|
let N = "Failed to load configuration";
|
|
5532
5532
|
if (z.response) {
|
|
5533
|
-
const x = z.response.status,
|
|
5534
|
-
x === 400 ? N =
|
|
5533
|
+
const x = z.response.status, C = z.response.data?.message || z.response.data?.error;
|
|
5534
|
+
x === 400 ? N = C || "Invalid request. Please check the application ID." : x === 401 ? N = "You are not authorized to access this configuration." : x === 403 ? N = "Access denied. You don't have permission to view this configuration." : x === 404 ? N = "Configuration not found. It may not exist yet or the application ID is incorrect." : x >= 500 ? N = C || "Server error. Please try again later." : N = C || `Failed to load configuration (Error ${x})`;
|
|
5535
5535
|
} else z.request ? N = "Network error. Please check your connection and try again." : N = z.message || "An unexpected error occurred while loading configuration.";
|
|
5536
5536
|
De.error(N), j();
|
|
5537
5537
|
} finally {
|
|
@@ -5560,25 +5560,25 @@ function Ss({
|
|
|
5560
5560
|
});
|
|
5561
5561
|
else if (z.type === "datatable") {
|
|
5562
5562
|
const N = u[z.key];
|
|
5563
|
-
Array.isArray(N) && N.forEach((x,
|
|
5563
|
+
Array.isArray(N) && N.forEach((x, C) => {
|
|
5564
5564
|
z.fields.forEach((F) => {
|
|
5565
5565
|
if (F.required) {
|
|
5566
5566
|
const L = x[F.key];
|
|
5567
|
-
(!L || typeof L == "string" && L.trim() === "") && (w[z.key] || (w[z.key] = {}), w[z.key][
|
|
5567
|
+
(!L || typeof L == "string" && L.trim() === "") && (w[z.key] || (w[z.key] = {}), w[z.key][C] || (w[z.key][C] = {}), w[z.key][C][F.key] = `${F.label} is required`);
|
|
5568
5568
|
}
|
|
5569
5569
|
});
|
|
5570
5570
|
});
|
|
5571
5571
|
}
|
|
5572
5572
|
}), w;
|
|
5573
|
-
}, q = (w) => Object.keys(w).length > 0,
|
|
5573
|
+
}, q = (w) => Object.keys(w).length > 0, k = () => {
|
|
5574
5574
|
const w = G();
|
|
5575
5575
|
if (h(w), q(w)) {
|
|
5576
5576
|
let N = [];
|
|
5577
5577
|
Object.keys(w).forEach((x) => {
|
|
5578
|
-
typeof w[x] == "object" && Object.keys(w[x]).forEach((
|
|
5579
|
-
typeof w[x][
|
|
5580
|
-
N.push(`${x} row ${parseInt(
|
|
5581
|
-
}) : N.push(`${x}: ${w[x][
|
|
5578
|
+
typeof w[x] == "object" && Object.keys(w[x]).forEach((C) => {
|
|
5579
|
+
typeof w[x][C] == "object" ? Object.keys(w[x][C]).forEach((F) => {
|
|
5580
|
+
N.push(`${x} row ${parseInt(C) + 1}: ${w[x][C][F]}`);
|
|
5581
|
+
}) : N.push(`${x}: ${w[x][C]}`);
|
|
5582
5582
|
});
|
|
5583
5583
|
});
|
|
5584
5584
|
return;
|
|
@@ -5587,30 +5587,30 @@ function Ss({
|
|
|
5587
5587
|
try {
|
|
5588
5588
|
y(!0);
|
|
5589
5589
|
const N = {};
|
|
5590
|
-
u && Object.keys(u).forEach((
|
|
5590
|
+
u && Object.keys(u).forEach((C) => {
|
|
5591
5591
|
const F = a?.configuration?.find(
|
|
5592
|
-
(L) => L.key ===
|
|
5592
|
+
(L) => L.key === C && L.type === "datatable"
|
|
5593
5593
|
);
|
|
5594
|
-
F && Array.isArray(u[
|
|
5594
|
+
F && Array.isArray(u[C]) ? N[C] = u[C].map((L) => {
|
|
5595
5595
|
const U = { id: L.id || 0 };
|
|
5596
5596
|
return F.fields && F.fields.forEach((S) => {
|
|
5597
5597
|
if (S.fieldtype === "audience") {
|
|
5598
|
-
let
|
|
5599
|
-
L[S.key] && typeof L[S.key] == "object" && !Array.isArray(L[S.key]) && (
|
|
5598
|
+
let P = { users: [], groups: [], roles: [] };
|
|
5599
|
+
L[S.key] && typeof L[S.key] == "object" && !Array.isArray(L[S.key]) && (P = {
|
|
5600
5600
|
users: L[S.key].users || [],
|
|
5601
5601
|
groups: L[S.key].groups || [],
|
|
5602
5602
|
roles: L[S.key].roles || []
|
|
5603
|
-
}), U[S.key] =
|
|
5603
|
+
}), U[S.key] = P;
|
|
5604
5604
|
} else
|
|
5605
5605
|
U[S.key] = L[S.key] || "";
|
|
5606
5606
|
}), U;
|
|
5607
|
-
}) : N[
|
|
5607
|
+
}) : N[C] = u[C];
|
|
5608
5608
|
});
|
|
5609
5609
|
let x = await _e(T, N);
|
|
5610
5610
|
if (console.log(), x && x.status != "fail") {
|
|
5611
5611
|
h({});
|
|
5612
|
-
const
|
|
5613
|
-
De.success(
|
|
5612
|
+
const C = x.message || "Configuration has been saved successfully";
|
|
5613
|
+
De.success(C), l && typeof l == "function" && l(u);
|
|
5614
5614
|
} else
|
|
5615
5615
|
throw De.error(x?.message || "Failed to save configuration"), new Error("No response received from server");
|
|
5616
5616
|
} catch (N) {
|
|
@@ -5672,7 +5672,7 @@ function Ss({
|
|
|
5672
5672
|
ee,
|
|
5673
5673
|
{
|
|
5674
5674
|
category: "primary",
|
|
5675
|
-
onClick:
|
|
5675
|
+
onClick: k,
|
|
5676
5676
|
disabled: r,
|
|
5677
5677
|
label: r ? "Saving..." : "Apply",
|
|
5678
5678
|
type: "submit"
|
|
@@ -5692,9 +5692,9 @@ const Ql = ({
|
|
|
5692
5692
|
breadcrumb: b = [],
|
|
5693
5693
|
overview: f = {},
|
|
5694
5694
|
configuration: r = []
|
|
5695
|
-
} = t, y = r.map((
|
|
5696
|
-
if (
|
|
5697
|
-
const g = [...
|
|
5695
|
+
} = t, y = r.map((k) => {
|
|
5696
|
+
if (k.type === "section" && k.fields) {
|
|
5697
|
+
const g = [...k.fields], v = g.findIndex((w) => w.key === "appkey");
|
|
5698
5698
|
if (v !== -1) {
|
|
5699
5699
|
const w = g[v];
|
|
5700
5700
|
if (g[v] = {
|
|
@@ -5704,7 +5704,7 @@ const Ql = ({
|
|
|
5704
5704
|
disabled: !0,
|
|
5705
5705
|
placeholder: a
|
|
5706
5706
|
}, g.some((N) => N.key === "displayname")) {
|
|
5707
|
-
const N = g.findIndex((
|
|
5707
|
+
const N = g.findIndex((C) => C.key === "displayname"), x = g[N] || {};
|
|
5708
5708
|
g[N] = {
|
|
5709
5709
|
...x,
|
|
5710
5710
|
default: x.default || x.value || a,
|
|
@@ -5724,31 +5724,39 @@ const Ql = ({
|
|
|
5724
5724
|
}
|
|
5725
5725
|
}
|
|
5726
5726
|
return {
|
|
5727
|
-
...
|
|
5727
|
+
...k,
|
|
5728
5728
|
fields: g
|
|
5729
5729
|
};
|
|
5730
5730
|
}
|
|
5731
|
-
return
|
|
5731
|
+
return k;
|
|
5732
5732
|
}), d = {
|
|
5733
5733
|
heading: "App Details",
|
|
5734
5734
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
5735
5735
|
isLeftArrow: !0,
|
|
5736
5736
|
onBackClick: () => window.history.back(),
|
|
5737
5737
|
...u
|
|
5738
|
-
}, h = b.map((
|
|
5739
|
-
label:
|
|
5740
|
-
href:
|
|
5738
|
+
}, h = b.map((k) => ({
|
|
5739
|
+
label: k.text,
|
|
5740
|
+
href: k.href || "#"
|
|
5741
5741
|
})), $ = ae(() => {
|
|
5742
5742
|
console.log("handleCancelRequest called - showing modal"), o(!0);
|
|
5743
|
-
}, []), T = ae((
|
|
5744
|
-
o(!1),
|
|
5745
|
-
}, []), A = ae((
|
|
5746
|
-
console.log("Configuration changed:",
|
|
5743
|
+
}, []), T = ae((k) => {
|
|
5744
|
+
o(!1), k.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
|
|
5745
|
+
}, []), A = ae((k) => {
|
|
5746
|
+
console.log("Configuration changed:", k);
|
|
5747
5747
|
}, []), E = (() => {
|
|
5748
|
+
if (p.headingKey && Array.isArray(r)) {
|
|
5749
|
+
const k = p.headingKey.split("."), g = k[0], v = k[1], w = r.find((z) => z && z.key === g);
|
|
5750
|
+
if (w && w.fields) {
|
|
5751
|
+
const z = w.fields.find((N) => N && N.key === v);
|
|
5752
|
+
if (z)
|
|
5753
|
+
return z.default ?? z.value ?? p.heading ?? a;
|
|
5754
|
+
}
|
|
5755
|
+
}
|
|
5748
5756
|
if (Array.isArray(r)) {
|
|
5749
|
-
for (const
|
|
5750
|
-
if (
|
|
5751
|
-
const g =
|
|
5757
|
+
for (const k of r)
|
|
5758
|
+
if (k && k.fields) {
|
|
5759
|
+
const g = k.fields.find((v) => v && v.key === "displayname");
|
|
5752
5760
|
if (g) return g.default ?? g.value ?? a;
|
|
5753
5761
|
}
|
|
5754
5762
|
}
|
|
@@ -5781,20 +5789,20 @@ const Ql = ({
|
|
|
5781
5789
|
{ label: "Overview", content: q(j) },
|
|
5782
5790
|
{ label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: { configuration: y }, disableApi: s, onCancel: $, onSave: A }) }
|
|
5783
5791
|
];
|
|
5784
|
-
function G(
|
|
5785
|
-
return
|
|
5792
|
+
function G(k) {
|
|
5793
|
+
return k ? k.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: k } }) : k : "📱";
|
|
5786
5794
|
}
|
|
5787
|
-
function q(
|
|
5795
|
+
function q(k) {
|
|
5788
5796
|
return /* @__PURE__ */ n("div", { className: "bg-white rounded-2xl p-1", children: [
|
|
5789
5797
|
/* @__PURE__ */ n("section", { className: "mb-8", children: [
|
|
5790
5798
|
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
|
|
5791
|
-
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children:
|
|
5799
|
+
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children: k.about })
|
|
5792
5800
|
] }),
|
|
5793
5801
|
/* @__PURE__ */ n("section", { className: "flex flex-row gap-6 justify-center items-center mb-8", children: [
|
|
5794
5802
|
/* @__PURE__ */ e(
|
|
5795
5803
|
"img",
|
|
5796
5804
|
{
|
|
5797
|
-
src:
|
|
5805
|
+
src: k.images.desktop,
|
|
5798
5806
|
alt: "Desktop View",
|
|
5799
5807
|
className: "rounded-xl border border-gray-200 w-[340px] h-[220px] object-cover"
|
|
5800
5808
|
}
|
|
@@ -5802,7 +5810,7 @@ const Ql = ({
|
|
|
5802
5810
|
/* @__PURE__ */ e(
|
|
5803
5811
|
"img",
|
|
5804
5812
|
{
|
|
5805
|
-
src:
|
|
5813
|
+
src: k.images.mobile1,
|
|
5806
5814
|
alt: "Mobile View 1",
|
|
5807
5815
|
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
5808
5816
|
}
|
|
@@ -5810,7 +5818,7 @@ const Ql = ({
|
|
|
5810
5818
|
/* @__PURE__ */ e(
|
|
5811
5819
|
"img",
|
|
5812
5820
|
{
|
|
5813
|
-
src:
|
|
5821
|
+
src: k.images.mobile2,
|
|
5814
5822
|
alt: "Mobile View 2",
|
|
5815
5823
|
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
5816
5824
|
}
|
|
@@ -5818,7 +5826,7 @@ const Ql = ({
|
|
|
5818
5826
|
] }),
|
|
5819
5827
|
/* @__PURE__ */ n("section", { children: [
|
|
5820
5828
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
|
|
5821
|
-
/* @__PURE__ */ e("ul", { className: "space-y-3", children:
|
|
5829
|
+
/* @__PURE__ */ e("ul", { className: "space-y-3", children: k.features.map((g, v) => /* @__PURE__ */ n("li", { children: [
|
|
5822
5830
|
/* @__PURE__ */ e("span", { className: "font-semibold", children: g.title }),
|
|
5823
5831
|
/* @__PURE__ */ e("br", {}),
|
|
5824
5832
|
/* @__PURE__ */ e("span", { className: "text-gray-700", children: g.description })
|
|
@@ -5842,30 +5850,30 @@ const Ql = ({
|
|
|
5842
5850
|
/* @__PURE__ */ n("div", { className: "flex flex-col min-w-0", children: [
|
|
5843
5851
|
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: I.heading }),
|
|
5844
5852
|
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: I.subHeading }),
|
|
5845
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: I.tags && I.tags.map((
|
|
5853
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: I.tags && I.tags.map((k, g) => /* @__PURE__ */ e(
|
|
5846
5854
|
"span",
|
|
5847
5855
|
{
|
|
5848
5856
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
5849
|
-
children:
|
|
5857
|
+
children: k
|
|
5850
5858
|
},
|
|
5851
5859
|
g
|
|
5852
5860
|
)) })
|
|
5853
5861
|
] })
|
|
5854
5862
|
] }),
|
|
5855
5863
|
/* @__PURE__ */ n("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
|
|
5856
|
-
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: _.map((
|
|
5864
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: _.map((k, g) => /* @__PURE__ */ e(
|
|
5857
5865
|
"button",
|
|
5858
5866
|
{
|
|
5859
5867
|
onClick: () => l(g),
|
|
5860
5868
|
className: `${i === g ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
|
|
5861
|
-
children:
|
|
5869
|
+
children: k.label
|
|
5862
5870
|
},
|
|
5863
5871
|
g
|
|
5864
5872
|
)) }) }),
|
|
5865
5873
|
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: _[i].content })
|
|
5866
5874
|
] }),
|
|
5867
5875
|
/* @__PURE__ */ e(
|
|
5868
|
-
|
|
5876
|
+
On,
|
|
5869
5877
|
{
|
|
5870
5878
|
isOpen: m,
|
|
5871
5879
|
onClose: T,
|
|
@@ -5934,19 +5942,19 @@ const Kl = ({
|
|
|
5934
5942
|
excelFileName: I,
|
|
5935
5943
|
pdfFileName: j
|
|
5936
5944
|
}) => {
|
|
5937
|
-
const _ = () => l?.current || i?.current, [G, q] = se.useState(""),
|
|
5945
|
+
const _ = () => l?.current || i?.current, [G, q] = se.useState(""), k = (t || "export").toString().trim() || "export", g = `${I || k}.xlsx`, v = `${j || k}.pdf`, w = (x, C, F) => Math.max(C, Math.min(x, F)), z = ae(
|
|
5938
5946
|
(x) => {
|
|
5939
|
-
const
|
|
5940
|
-
if (console.log("openColumnChooserNear",
|
|
5947
|
+
const C = _();
|
|
5948
|
+
if (console.log("openColumnChooserNear", C), !!C?.openColumnChooser) {
|
|
5941
5949
|
if (typeof window > "u" || !x?.currentTarget) {
|
|
5942
|
-
|
|
5950
|
+
C.openColumnChooser();
|
|
5943
5951
|
return;
|
|
5944
5952
|
}
|
|
5945
5953
|
try {
|
|
5946
5954
|
const F = x.currentTarget.getBoundingClientRect(), L = F.left + window.scrollX, U = F.bottom + window.scrollY;
|
|
5947
|
-
let S = L - 120,
|
|
5948
|
-
const D = window.innerWidth,
|
|
5949
|
-
S = w(S, window.scrollX + 8, window.scrollX + D - 340),
|
|
5955
|
+
let S = L - 120, P = U - 120;
|
|
5956
|
+
const D = window.innerWidth, O = window.innerHeight;
|
|
5957
|
+
S = w(S, window.scrollX + 8, window.scrollX + D - 340), P = w(P, window.scrollY, window.scrollY + O - 120), console.log("openColumnChooserNear", S, P), C.openColumnChooser(S, P);
|
|
5950
5958
|
} catch (F) {
|
|
5951
5959
|
console.log("coloumn choose error", F);
|
|
5952
5960
|
}
|
|
@@ -5955,12 +5963,12 @@ const Kl = ({
|
|
|
5955
5963
|
[]
|
|
5956
5964
|
// no external deps; reads ref at call time
|
|
5957
5965
|
), N = ae(
|
|
5958
|
-
(x,
|
|
5966
|
+
(x, C) => {
|
|
5959
5967
|
const F = _();
|
|
5960
5968
|
if (F)
|
|
5961
5969
|
switch (x) {
|
|
5962
5970
|
case "ColumnChooser":
|
|
5963
|
-
b && (console.log("openColumnChooser",
|
|
5971
|
+
b && (console.log("openColumnChooser", C), C ? z(C) : F.openColumnChooser?.()), console.log("openColumnChooser out", C);
|
|
5964
5972
|
break;
|
|
5965
5973
|
case "Print":
|
|
5966
5974
|
r && F.print?.();
|
|
@@ -6109,15 +6117,15 @@ function ei(t) {
|
|
|
6109
6117
|
onRowDeselected: _,
|
|
6110
6118
|
onRowDoubleClick: G,
|
|
6111
6119
|
apiRef: q,
|
|
6112
|
-
gridProps:
|
|
6120
|
+
gridProps: k = {}
|
|
6113
6121
|
} = t, g = xe(null), {
|
|
6114
6122
|
pageSettings: v,
|
|
6115
6123
|
sortSettings: w,
|
|
6116
6124
|
...z
|
|
6117
|
-
} =
|
|
6125
|
+
} = k || {}, [N, x] = se.useState(v?.page || 1), [C, F] = se.useState(w?.pageSize || 20), [L, U] = se.useState(w?.sortKey || "updatedDate"), [S, P] = se.useState(w?.direction || "Descending"), D = ue(() => {
|
|
6118
6126
|
const B = [cn];
|
|
6119
6127
|
return o && B.push(dn), u && B.push(mn), p && B.push(un), h && B.push(hn), r && B.push(pn), y && B.push(gn), d && B.push(bn), f && B.push(fn), b && B.push(xn), B.push(yn), B;
|
|
6120
|
-
}, [o, u, p, h, r, y, d, f, b]),
|
|
6128
|
+
}, [o, u, p, h, r, y, d, f, b]), O = ue(() => {
|
|
6121
6129
|
const B = () => g.current, re = (J, we) => {
|
|
6122
6130
|
!we && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${J} requested but related service/feature is disabled.`);
|
|
6123
6131
|
};
|
|
@@ -6144,17 +6152,17 @@ function ei(t) {
|
|
|
6144
6152
|
};
|
|
6145
6153
|
}, []);
|
|
6146
6154
|
Z(() => {
|
|
6147
|
-
q && (q.current =
|
|
6148
|
-
}, [q,
|
|
6155
|
+
q && (q.current = O);
|
|
6156
|
+
}, [q, O]), Z(() => () => {
|
|
6149
6157
|
q && (q.current = null);
|
|
6150
6158
|
}, []);
|
|
6151
6159
|
const V = (B) => {
|
|
6152
6160
|
const re = String(B || "");
|
|
6153
6161
|
return re === "Ascending" || re === "Descending" ? re : re.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
6154
6162
|
}, R = (B) => {
|
|
6155
|
-
const re = g.current, J = B?.requestType, we = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Ie = B?.pageSize ?? re?.pageSettings?.pageSize ??
|
|
6156
|
-
field:
|
|
6157
|
-
dir: V(
|
|
6163
|
+
const re = g.current, J = B?.requestType, we = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Ie = B?.pageSize ?? re?.pageSettings?.pageSize ?? C, Ue = B?.currentPage ?? re?.pageSettings?.currentPage ?? l, st = B?.columnName && B?.direction ? [{ field: B.columnName, dir: V(B.direction) }] : (re?.sortSettings?.columns || []).map((Pe) => ({
|
|
6164
|
+
field: Pe.field,
|
|
6165
|
+
dir: V(Pe.direction ?? Pe.dir)
|
|
6158
6166
|
})), lt = B?.searchString ?? "", it = B?.columns ?? re?.filterSettings?.columns ?? [];
|
|
6159
6167
|
return {
|
|
6160
6168
|
reason: we,
|
|
@@ -6168,7 +6176,7 @@ function ei(t) {
|
|
|
6168
6176
|
}, Y = (B) => {
|
|
6169
6177
|
setTimeout(() => {
|
|
6170
6178
|
g?.current?.hideSpinner();
|
|
6171
|
-
}, 1e3), B.requestType === "paging" && (x(B.currentPage), F(B.pageSize)), B.requestType === "sorting" && (U(B.columnName || "updatedDate"),
|
|
6179
|
+
}, 1e3), B.requestType === "paging" && (x(B.currentPage), F(B.pageSize)), B.requestType === "sorting" && (U(B.columnName || "updatedDate"), P(B.direction === "Ascending" ? "ASC" : "DESC")), I && I(R(B), B);
|
|
6172
6180
|
}, W = (B) => {
|
|
6173
6181
|
typeof G == "function" && G(B?.rowData, B);
|
|
6174
6182
|
}, pe = () => {
|
|
@@ -6181,10 +6189,10 @@ function ei(t) {
|
|
|
6181
6189
|
textAlign: st = "Left",
|
|
6182
6190
|
template: lt,
|
|
6183
6191
|
isPrimaryKey: it,
|
|
6184
|
-
showInColumnChooser:
|
|
6192
|
+
showInColumnChooser: Pe = !0,
|
|
6185
6193
|
allowFiltering: Ia = !0,
|
|
6186
|
-
allowSorting:
|
|
6187
|
-
type:
|
|
6194
|
+
allowSorting: Pa = !0,
|
|
6195
|
+
type: Oa,
|
|
6188
6196
|
format: La,
|
|
6189
6197
|
visible: Ma = !0,
|
|
6190
6198
|
minWidth: Ba,
|
|
@@ -6202,10 +6210,10 @@ function ei(t) {
|
|
|
6202
6210
|
textAlign: st,
|
|
6203
6211
|
template: lt,
|
|
6204
6212
|
isPrimaryKey: it,
|
|
6205
|
-
showInColumnChooser:
|
|
6213
|
+
showInColumnChooser: Pe,
|
|
6206
6214
|
allowFiltering: Ia,
|
|
6207
|
-
allowSorting:
|
|
6208
|
-
type:
|
|
6215
|
+
allowSorting: Pa,
|
|
6216
|
+
type: Oa,
|
|
6209
6217
|
format: La,
|
|
6210
6218
|
visible: Ma,
|
|
6211
6219
|
minWidth: Ba,
|
|
@@ -6607,7 +6615,7 @@ const Is = [
|
|
|
6607
6615
|
thumb: "https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=640&auto=format&fit=crop",
|
|
6608
6616
|
excerpt: "Community and business partners joined KCC leadership to recognize outstanding collaborations and celebrate student success…"
|
|
6609
6617
|
}
|
|
6610
|
-
],
|
|
6618
|
+
], Ps = {
|
|
6611
6619
|
sm: {
|
|
6612
6620
|
wrap: "max-w-md",
|
|
6613
6621
|
itemThumb: "h-14 w-20",
|
|
@@ -6632,7 +6640,7 @@ const Is = [
|
|
|
6632
6640
|
excerpt: "text-sm text-zinc-600 dark:text-zinc-300 line-clamp-2"
|
|
6633
6641
|
}
|
|
6634
6642
|
}, jt = ({ label: t }) => /* @__PURE__ */ e("span", { className: "mt-1 inline-flex items-center rounded-full border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-900 px-2 py-0.5 text-[11px] font-semibold tracking-wide", children: t });
|
|
6635
|
-
function
|
|
6643
|
+
function Os({
|
|
6636
6644
|
size: t = "md",
|
|
6637
6645
|
showCheckbox: a = !1,
|
|
6638
6646
|
checkboxPosition: s = "top-left",
|
|
@@ -6643,7 +6651,7 @@ function Ps({
|
|
|
6643
6651
|
// spread for identity fields: _id / id / instanceId etc.
|
|
6644
6652
|
...u
|
|
6645
6653
|
}) {
|
|
6646
|
-
const p = oe(t), b = ce[p], f =
|
|
6654
|
+
const p = oe(t), b = ce[p], f = Ps[p];
|
|
6647
6655
|
return /* @__PURE__ */ n(
|
|
6648
6656
|
ie,
|
|
6649
6657
|
{
|
|
@@ -6700,7 +6708,7 @@ function Ps({
|
|
|
6700
6708
|
}
|
|
6701
6709
|
);
|
|
6702
6710
|
}
|
|
6703
|
-
|
|
6711
|
+
Os.propTypes = {
|
|
6704
6712
|
size: c.string,
|
|
6705
6713
|
showCheckbox: c.bool,
|
|
6706
6714
|
checkboxPosition: c.oneOf(["top-left", "top-right"]),
|
|
@@ -7659,7 +7667,7 @@ function nl({
|
|
|
7659
7667
|
"aria-label": "View Transactions (mock)",
|
|
7660
7668
|
children: [
|
|
7661
7669
|
"View Transactions",
|
|
7662
|
-
/* @__PURE__ */ e(
|
|
7670
|
+
/* @__PURE__ */ e(Pr, { className: "h-4 w-4" })
|
|
7663
7671
|
]
|
|
7664
7672
|
}
|
|
7665
7673
|
)
|
|
@@ -7988,7 +7996,7 @@ function dl({
|
|
|
7988
7996
|
"Download All"
|
|
7989
7997
|
] }),
|
|
7990
7998
|
/* @__PURE__ */ n("button", { className: "w-full px-4 py-2 text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700 text-left flex items-center gap-2", children: [
|
|
7991
|
-
/* @__PURE__ */ e(
|
|
7999
|
+
/* @__PURE__ */ e(Or, { className: "h-4 w-4" }),
|
|
7992
8000
|
"Share Drive"
|
|
7993
8001
|
] })
|
|
7994
8002
|
] })
|
|
@@ -8477,19 +8485,19 @@ export {
|
|
|
8477
8485
|
X as Input,
|
|
8478
8486
|
ll as LeaveBalanceMock,
|
|
8479
8487
|
Aa as ManageCollectionList,
|
|
8480
|
-
|
|
8488
|
+
On as Modal,
|
|
8481
8489
|
nt as MultiSelect,
|
|
8482
|
-
|
|
8490
|
+
Os as NewsMock,
|
|
8483
8491
|
Hs as O365MailsMock,
|
|
8484
8492
|
_n as OptionsMenu,
|
|
8485
8493
|
Vn as PageHeader,
|
|
8486
8494
|
Vl as PageLayout,
|
|
8487
|
-
|
|
8495
|
+
Pl as Pagination,
|
|
8488
8496
|
ba as RadioGroup,
|
|
8489
8497
|
be as SearchBar,
|
|
8490
8498
|
ft as Select,
|
|
8491
8499
|
ie as SelectableCard,
|
|
8492
|
-
|
|
8500
|
+
Ol as Sidebar,
|
|
8493
8501
|
xa as Spinner,
|
|
8494
8502
|
ya as Textarea,
|
|
8495
8503
|
Zl as ToastProvider,
|