unifyedx-storybook-new 0.2.36 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/unifyedx-storybook-new.css +1 -1
- package/dist/unifyedx-storybook-new.css.br +0 -0
- package/dist/unifyedx-storybook-new.css.gz +0 -0
- package/dist/unifyedx-storybook-new.es.js +526 -528
- package/dist/unifyedx-storybook-new.es.js.br +0 -0
- package/dist/unifyedx-storybook-new.es.js.gz +0 -0
- package/package.json +1 -1
|
@@ -684,7 +684,7 @@ const zn = {
|
|
|
684
684
|
$ && /* @__PURE__ */ n("div", { className: "file-list-container", children: [
|
|
685
685
|
/* @__PURE__ */ e("h3", { children: "Upload Queue" }),
|
|
686
686
|
/* @__PURE__ */ n("ul", { className: "file-list", children: [
|
|
687
|
-
i.map((A,
|
|
687
|
+
i.map((A, E) => /* @__PURE__ */ n(
|
|
688
688
|
"li",
|
|
689
689
|
{
|
|
690
690
|
className: "file-item",
|
|
@@ -705,16 +705,16 @@ const zn = {
|
|
|
705
705
|
"button",
|
|
706
706
|
{
|
|
707
707
|
type: "button",
|
|
708
|
-
onClick: () => g(
|
|
708
|
+
onClick: () => g(E),
|
|
709
709
|
className: "remove-file-button",
|
|
710
710
|
children: /* @__PURE__ */ e(Ze, { size: 16 })
|
|
711
711
|
}
|
|
712
712
|
)
|
|
713
713
|
]
|
|
714
714
|
},
|
|
715
|
-
`${A.name}-${
|
|
715
|
+
`${A.name}-${E}`
|
|
716
716
|
)),
|
|
717
|
-
u.map(({ file: A, message:
|
|
717
|
+
u.map(({ file: A, message: E }, R) => /* @__PURE__ */ n(
|
|
718
718
|
"li",
|
|
719
719
|
{
|
|
720
720
|
className: "file-item file-item--rejected",
|
|
@@ -729,21 +729,21 @@ const zn = {
|
|
|
729
729
|
/* @__PURE__ */ n("div", { children: [
|
|
730
730
|
/* @__PURE__ */ e("p", { className: "file-item-name", children: A.name }),
|
|
731
731
|
/* @__PURE__ */ e("p", { className: "file-item-size", children: Tt(A.size) }),
|
|
732
|
-
/* @__PURE__ */ e("p", { className: "rejection-reason", children:
|
|
732
|
+
/* @__PURE__ */ e("p", { className: "rejection-reason", children: E })
|
|
733
733
|
] })
|
|
734
734
|
] }),
|
|
735
735
|
/* @__PURE__ */ e(
|
|
736
736
|
"button",
|
|
737
737
|
{
|
|
738
738
|
type: "button",
|
|
739
|
-
onClick: () => f(
|
|
739
|
+
onClick: () => f(R),
|
|
740
740
|
className: "remove-file-button",
|
|
741
741
|
children: /* @__PURE__ */ e(Ze, { size: 16 })
|
|
742
742
|
}
|
|
743
743
|
)
|
|
744
744
|
]
|
|
745
745
|
},
|
|
746
|
-
`${A.name}-${
|
|
746
|
+
`${A.name}-${R}`
|
|
747
747
|
))
|
|
748
748
|
] })
|
|
749
749
|
] })
|
|
@@ -841,21 +841,21 @@ const zn = {
|
|
|
841
841
|
}), A = qa({
|
|
842
842
|
initialValues: JSON.parse(JSON.stringify(m)),
|
|
843
843
|
// Deep copy
|
|
844
|
-
onSubmit: (
|
|
844
|
+
onSubmit: (C) => {
|
|
845
845
|
const h = {};
|
|
846
|
-
Object.keys(
|
|
846
|
+
Object.keys(C).forEach((w) => {
|
|
847
847
|
h[w] = {
|
|
848
|
-
operator:
|
|
849
|
-
values: Array.isArray(
|
|
850
|
-
range:
|
|
848
|
+
operator: C[w].operator || "in",
|
|
849
|
+
values: Array.isArray(C[w].values) ? C[w].values : [],
|
|
850
|
+
range: C[w].range || null
|
|
851
851
|
};
|
|
852
852
|
}), console.log("[storybook filter] Applied Filters:", h), typeof s == "function" && s({
|
|
853
853
|
filters: h,
|
|
854
|
-
activeCount:
|
|
854
|
+
activeCount: R
|
|
855
855
|
}), a();
|
|
856
856
|
},
|
|
857
857
|
enableReinitialize: !0
|
|
858
|
-
}),
|
|
858
|
+
}), E = me(() => l.reduce((C, h) => {
|
|
859
859
|
const w = h.key, T = A.values[w];
|
|
860
860
|
let k = !1;
|
|
861
861
|
if (T)
|
|
@@ -868,34 +868,34 @@ const zn = {
|
|
|
868
868
|
(T.range && T.range !== "" || Array.isArray(T.values) && T.values.length > 0) && (k = !0);
|
|
869
869
|
break;
|
|
870
870
|
}
|
|
871
|
-
return
|
|
872
|
-
}, {}), [l, A.values]),
|
|
873
|
-
if (
|
|
874
|
-
const h = A.values?.[
|
|
871
|
+
return C[w] = k, C;
|
|
872
|
+
}, {}), [l, A.values]), R = Object.values(E).filter(Boolean).length, O = me(() => l.some((C) => {
|
|
873
|
+
if (C.type !== "date") return !1;
|
|
874
|
+
const h = A.values?.[C.key]?.values;
|
|
875
875
|
if (!Array.isArray(h) || h.length < 2) return !1;
|
|
876
876
|
const [w, T] = h;
|
|
877
877
|
if (!w || !T) return !1;
|
|
878
878
|
const k = w instanceof Date ? w : new Date(w), v = T instanceof Date ? T : new Date(T);
|
|
879
879
|
return k > v;
|
|
880
|
-
}), [l, A.values]), V = async (
|
|
880
|
+
}), [l, A.values]), V = async (C, h) => {
|
|
881
881
|
try {
|
|
882
|
-
r((T) => ({ ...T, [
|
|
883
|
-
const w = await u(
|
|
884
|
-
f((T) => ({ ...T, [
|
|
882
|
+
r((T) => ({ ...T, [C]: !0 }));
|
|
883
|
+
const w = await u(C, h);
|
|
884
|
+
f((T) => ({ ...T, [C]: w }));
|
|
885
885
|
} catch (w) {
|
|
886
|
-
console.error(`Error fetching ${
|
|
886
|
+
console.error(`Error fetching ${C} users:`, w);
|
|
887
887
|
} finally {
|
|
888
|
-
r((w) => ({ ...w, [
|
|
888
|
+
r((w) => ({ ...w, [C]: !1 }));
|
|
889
889
|
}
|
|
890
|
-
}, U = (
|
|
891
|
-
const h = l[
|
|
892
|
-
l[
|
|
890
|
+
}, U = (C) => {
|
|
891
|
+
const h = l[C].key, w = l[C].url;
|
|
892
|
+
l[C].type === "multiselect-users" && g[h].length === 0 && !x[h] && V(h, w);
|
|
893
893
|
}, Y = () => {
|
|
894
894
|
A.resetForm(), f({ createdBy: [], updatedBy: [] }), o();
|
|
895
|
-
}, q = (
|
|
896
|
-
const h = l.find((k) => k.key ===
|
|
895
|
+
}, q = (C) => {
|
|
896
|
+
const h = l.find((k) => k.key === C);
|
|
897
897
|
if (!h) return null;
|
|
898
|
-
const w = A.values[
|
|
898
|
+
const w = A.values[C] || m[C], T = Array.isArray(w.values) ? w.values : [];
|
|
899
899
|
switch (h.type) {
|
|
900
900
|
case "multiselect":
|
|
901
901
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
@@ -905,7 +905,7 @@ const zn = {
|
|
|
905
905
|
"select",
|
|
906
906
|
{
|
|
907
907
|
value: w.operator || "in",
|
|
908
|
-
onChange: (I) => A.setFieldValue(`${
|
|
908
|
+
onChange: (I) => A.setFieldValue(`${C}.operator`, I.target.value),
|
|
909
909
|
className: "filter-select",
|
|
910
910
|
children: h.operators.map((I) => /* @__PURE__ */ e("option", { value: I, children: I === "in" ? "Includes" : "Excludes" }, I))
|
|
911
911
|
}
|
|
@@ -917,19 +917,19 @@ const zn = {
|
|
|
917
917
|
"input",
|
|
918
918
|
{
|
|
919
919
|
type: "checkbox",
|
|
920
|
-
id: `select-all-${
|
|
920
|
+
id: `select-all-${C}`,
|
|
921
921
|
className: "filter-checkbox-input",
|
|
922
922
|
checked: h.options.length > 0 && T.length === h.options.length,
|
|
923
923
|
onChange: (I) => {
|
|
924
924
|
const G = I.target.checked ? h.options.map((X) => X.value) : [];
|
|
925
|
-
A.setFieldValue(`${
|
|
925
|
+
A.setFieldValue(`${C}.values`, G);
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
),
|
|
929
929
|
/* @__PURE__ */ e(
|
|
930
930
|
"label",
|
|
931
931
|
{
|
|
932
|
-
htmlFor: `select-all-${
|
|
932
|
+
htmlFor: `select-all-${C}`,
|
|
933
933
|
className: "filter-checkbox-label",
|
|
934
934
|
children: "Select All"
|
|
935
935
|
}
|
|
@@ -940,19 +940,19 @@ const zn = {
|
|
|
940
940
|
"input",
|
|
941
941
|
{
|
|
942
942
|
type: "checkbox",
|
|
943
|
-
id: `${
|
|
943
|
+
id: `${C}-${I.value}`,
|
|
944
944
|
className: "filter-checkbox-input",
|
|
945
945
|
checked: T.includes(I.value),
|
|
946
946
|
onChange: (G) => {
|
|
947
947
|
const X = G.target.checked ? [...T, I.value] : T.filter((xe) => xe !== I.value);
|
|
948
|
-
A.setFieldValue(`${
|
|
948
|
+
A.setFieldValue(`${C}.values`, X);
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
951
|
),
|
|
952
952
|
/* @__PURE__ */ e(
|
|
953
953
|
"label",
|
|
954
954
|
{
|
|
955
|
-
htmlFor: `${
|
|
955
|
+
htmlFor: `${C}-${I.value}`,
|
|
956
956
|
className: "filter-checkbox-label",
|
|
957
957
|
children: I.label
|
|
958
958
|
}
|
|
@@ -961,7 +961,7 @@ const zn = {
|
|
|
961
961
|
] })
|
|
962
962
|
] });
|
|
963
963
|
case "multiselect-users":
|
|
964
|
-
const k = g[
|
|
964
|
+
const k = g[C] || [], v = x[C];
|
|
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:" }),
|
|
@@ -969,7 +969,7 @@ const zn = {
|
|
|
969
969
|
"select",
|
|
970
970
|
{
|
|
971
971
|
value: w.operator || "in",
|
|
972
|
-
onChange: (I) => A.setFieldValue(`${
|
|
972
|
+
onChange: (I) => A.setFieldValue(`${C}.operator`, I.target.value),
|
|
973
973
|
className: "filter-select",
|
|
974
974
|
children: h.operators.map((I) => /* @__PURE__ */ e("option", { value: I, children: I === "in" ? "Includes" : "Excludes" }, I))
|
|
975
975
|
}
|
|
@@ -981,13 +981,13 @@ const zn = {
|
|
|
981
981
|
"input",
|
|
982
982
|
{
|
|
983
983
|
type: "checkbox",
|
|
984
|
-
id: `select-all-users-${
|
|
984
|
+
id: `select-all-users-${C}`,
|
|
985
985
|
className: "filter-checkbox-input",
|
|
986
986
|
checked: k.length > 0 && T.length === k.length,
|
|
987
987
|
onChange: (I) => {
|
|
988
988
|
const G = I.target.checked ? k.map((X) => X.email) : [];
|
|
989
989
|
A.setFieldValue(
|
|
990
|
-
`${
|
|
990
|
+
`${C}.values`,
|
|
991
991
|
G
|
|
992
992
|
);
|
|
993
993
|
}
|
|
@@ -996,7 +996,7 @@ const zn = {
|
|
|
996
996
|
/* @__PURE__ */ e(
|
|
997
997
|
"label",
|
|
998
998
|
{
|
|
999
|
-
htmlFor: `select-all-users-${
|
|
999
|
+
htmlFor: `select-all-users-${C}`,
|
|
1000
1000
|
className: "filter-checkbox-label",
|
|
1001
1001
|
children: "Select All Users"
|
|
1002
1002
|
}
|
|
@@ -1007,13 +1007,13 @@ const zn = {
|
|
|
1007
1007
|
"input",
|
|
1008
1008
|
{
|
|
1009
1009
|
type: "checkbox",
|
|
1010
|
-
id: `${
|
|
1010
|
+
id: `${C}-${I.email}`,
|
|
1011
1011
|
className: "filter-checkbox-input",
|
|
1012
1012
|
checked: T.includes(I.email),
|
|
1013
1013
|
onChange: (G) => {
|
|
1014
1014
|
const X = G.target.checked ? [...T, I.email] : T.filter((xe) => xe !== I.email);
|
|
1015
1015
|
A.setFieldValue(
|
|
1016
|
-
`${
|
|
1016
|
+
`${C}.values`,
|
|
1017
1017
|
X
|
|
1018
1018
|
);
|
|
1019
1019
|
}
|
|
@@ -1022,7 +1022,7 @@ const zn = {
|
|
|
1022
1022
|
/* @__PURE__ */ n(
|
|
1023
1023
|
"label",
|
|
1024
1024
|
{
|
|
1025
|
-
htmlFor: `${
|
|
1025
|
+
htmlFor: `${C}-${I.email}`,
|
|
1026
1026
|
className: "filter-checkbox-label",
|
|
1027
1027
|
children: [
|
|
1028
1028
|
/* @__PURE__ */ e("span", { className: "user-label-name", children: I.name }),
|
|
@@ -1034,12 +1034,12 @@ const zn = {
|
|
|
1034
1034
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1035
1035
|
] });
|
|
1036
1036
|
case "date":
|
|
1037
|
-
const b = w.values || [], [y,
|
|
1038
|
-
startDate:
|
|
1039
|
-
endDate:
|
|
1040
|
-
},
|
|
1041
|
-
startDate:
|
|
1042
|
-
endDate:
|
|
1037
|
+
const b = w.values || [], [y, D] = b, M = y && D, z = b[0] || null, P = b[1] || null, F = {
|
|
1038
|
+
startDate: z instanceof Date ? z.toISOString().slice(0, 10) : null,
|
|
1039
|
+
endDate: z instanceof Date ? z.toISOString().slice(0, 10) : null
|
|
1040
|
+
}, S = {
|
|
1041
|
+
startDate: P instanceof Date ? P.toISOString().slice(0, 10) : null,
|
|
1042
|
+
endDate: P instanceof Date ? P.toISOString().slice(0, 10) : null
|
|
1043
1043
|
}, B = [
|
|
1044
1044
|
{ key: "anytime", label: "Anytime" },
|
|
1045
1045
|
{ key: "today", label: "Today" },
|
|
@@ -1050,15 +1050,15 @@ const zn = {
|
|
|
1050
1050
|
{ key: "custom", label: "Custom" }
|
|
1051
1051
|
], _ = (I) => {
|
|
1052
1052
|
if (I === "anytime") {
|
|
1053
|
-
A.setFieldValue(`${
|
|
1053
|
+
A.setFieldValue(`${C}.values`, []), A.setFieldValue(`${C}.range`, "anytime");
|
|
1054
1054
|
return;
|
|
1055
1055
|
}
|
|
1056
1056
|
if (I === "custom") {
|
|
1057
|
-
A.setFieldValue(`${
|
|
1057
|
+
A.setFieldValue(`${C}.range`, "custom");
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
1060
|
const [G, X] = Pn(I);
|
|
1061
|
-
A.setFieldValue(`${
|
|
1061
|
+
A.setFieldValue(`${C}.values`, G && X ? [G, X] : []), A.setFieldValue(`${C}.range`, I);
|
|
1062
1062
|
};
|
|
1063
1063
|
return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
|
|
1064
1064
|
/* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
|
|
@@ -1067,7 +1067,7 @@ const zn = {
|
|
|
1067
1067
|
"select",
|
|
1068
1068
|
{
|
|
1069
1069
|
value: w.operator,
|
|
1070
|
-
onChange: (I) => A.setFieldValue(`${
|
|
1070
|
+
onChange: (I) => A.setFieldValue(`${C}.operator`, I.target.value),
|
|
1071
1071
|
className: "filter-select",
|
|
1072
1072
|
children: h.operators.map((I) => /* @__PURE__ */ e("option", { value: I, children: I === "in" ? "Is" : "Is not" }, I))
|
|
1073
1073
|
}
|
|
@@ -1078,8 +1078,8 @@ const zn = {
|
|
|
1078
1078
|
type: "button",
|
|
1079
1079
|
onClick: () => {
|
|
1080
1080
|
A.setFieldValue(
|
|
1081
|
-
|
|
1082
|
-
m[
|
|
1081
|
+
C,
|
|
1082
|
+
m[C]
|
|
1083
1083
|
);
|
|
1084
1084
|
},
|
|
1085
1085
|
className: "filter-clear-selection-button",
|
|
@@ -1098,7 +1098,7 @@ const zn = {
|
|
|
1098
1098
|
"input",
|
|
1099
1099
|
{
|
|
1100
1100
|
type: "radio",
|
|
1101
|
-
name: `preset-${
|
|
1101
|
+
name: `preset-${C}`,
|
|
1102
1102
|
checked: G,
|
|
1103
1103
|
onChange: () => _(I.key),
|
|
1104
1104
|
className: "h-4 w-4"
|
|
@@ -1120,10 +1120,10 @@ const zn = {
|
|
|
1120
1120
|
{
|
|
1121
1121
|
asSingle: !0,
|
|
1122
1122
|
useRange: !1,
|
|
1123
|
-
value:
|
|
1123
|
+
value: F,
|
|
1124
1124
|
onChange: (I) => {
|
|
1125
1125
|
const G = I?.startDate ? je(new Date(I.startDate)) : null, X = b[1] || null;
|
|
1126
|
-
G && (A.setFieldValue(`${
|
|
1126
|
+
G && (A.setFieldValue(`${C}.values`, [G, X]), A.setFieldValue(`${C}.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",
|
|
@@ -1144,10 +1144,10 @@ const zn = {
|
|
|
1144
1144
|
{
|
|
1145
1145
|
asSingle: !0,
|
|
1146
1146
|
useRange: !1,
|
|
1147
|
-
value:
|
|
1147
|
+
value: S,
|
|
1148
1148
|
onChange: (I) => {
|
|
1149
1149
|
const G = I?.startDate ? Ve(new Date(I.startDate)) : null, X = b[0] || null;
|
|
1150
|
-
G && (A.setFieldValue(`${
|
|
1150
|
+
G && (A.setFieldValue(`${C}.values`, [X, G]), A.setFieldValue(`${C}.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",
|
|
@@ -1160,7 +1160,7 @@ const zn = {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
)
|
|
1162
1162
|
] }),
|
|
1163
|
-
|
|
1163
|
+
z && P && z > P && /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-2", children: "End date must be after start date" })
|
|
1164
1164
|
] })
|
|
1165
1165
|
] });
|
|
1166
1166
|
default:
|
|
@@ -1215,11 +1215,11 @@ const zn = {
|
|
|
1215
1215
|
flexGrow: 1
|
|
1216
1216
|
},
|
|
1217
1217
|
children: [
|
|
1218
|
-
/* @__PURE__ */ e(Br, { className: "filter-tabs-list", children: l.map((
|
|
1218
|
+
/* @__PURE__ */ e(Br, { className: "filter-tabs-list", children: l.map((C) => /* @__PURE__ */ n(ne, { className: "filter-tab-item", children: [
|
|
1219
1219
|
/* @__PURE__ */ e("div", { className: "filter-selection-horizontal-indicator" }),
|
|
1220
1220
|
/* @__PURE__ */ n("div", { className: "filter-lbl-indicator-wrapper", children: [
|
|
1221
|
-
|
|
1222
|
-
|
|
1221
|
+
C.label,
|
|
1222
|
+
E[C.key] && /* @__PURE__ */ e(
|
|
1223
1223
|
"span",
|
|
1224
1224
|
{
|
|
1225
1225
|
className: "filter-active-indicator",
|
|
@@ -1227,8 +1227,8 @@ const zn = {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
)
|
|
1229
1229
|
] })
|
|
1230
|
-
] },
|
|
1231
|
-
/* @__PURE__ */ e(jr, { className: "filter-tabs-panels", children: l.map((
|
|
1230
|
+
] }, C.key)) }),
|
|
1231
|
+
/* @__PURE__ */ e(jr, { className: "filter-tabs-panels", children: l.map((C) => /* @__PURE__ */ e(
|
|
1232
1232
|
ne.Panel,
|
|
1233
1233
|
{
|
|
1234
1234
|
className: "filter-tab-panel",
|
|
@@ -1239,12 +1239,12 @@ const zn = {
|
|
|
1239
1239
|
animate: { opacity: 1, x: 0 },
|
|
1240
1240
|
transition: { duration: 0.3 },
|
|
1241
1241
|
className: "h-full",
|
|
1242
|
-
children: q(
|
|
1242
|
+
children: q(C.key)
|
|
1243
1243
|
},
|
|
1244
|
-
|
|
1244
|
+
C.key
|
|
1245
1245
|
)
|
|
1246
1246
|
},
|
|
1247
|
-
|
|
1247
|
+
C.key
|
|
1248
1248
|
)) })
|
|
1249
1249
|
]
|
|
1250
1250
|
}
|
|
@@ -1263,12 +1263,12 @@ const zn = {
|
|
|
1263
1263
|
"button",
|
|
1264
1264
|
{
|
|
1265
1265
|
type: "submit",
|
|
1266
|
-
disabled: !A.dirty ||
|
|
1266
|
+
disabled: !A.dirty || O,
|
|
1267
1267
|
className: "filter-button apply",
|
|
1268
1268
|
children: [
|
|
1269
1269
|
"Apply Filters",
|
|
1270
1270
|
" ",
|
|
1271
|
-
|
|
1271
|
+
R > 0 ? `(${R})` : ""
|
|
1272
1272
|
]
|
|
1273
1273
|
}
|
|
1274
1274
|
)
|
|
@@ -2642,11 +2642,11 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2642
2642
|
},
|
|
2643
2643
|
isChanged: u = !1
|
|
2644
2644
|
}) => {
|
|
2645
|
-
const [g, f] = L(Pt[0]), [x, r] = L(""), N = kt(x, 400), [d, p] = L([]), [$, A] = L(/* @__PURE__ */ new Set()), [
|
|
2645
|
+
const [g, f] = L(Pt[0]), [x, r] = L(""), N = kt(x, 400), [d, p] = L([]), [$, A] = L(/* @__PURE__ */ new Set()), [E, R] = L(!1), [O, V] = L(It[0]), {
|
|
2646
2646
|
control: U,
|
|
2647
2647
|
handleSubmit: Y,
|
|
2648
2648
|
watch: q,
|
|
2649
|
-
formState: { errors:
|
|
2649
|
+
formState: { errors: C, isSubmitting: h }
|
|
2650
2650
|
} = rr({
|
|
2651
2651
|
defaultValues: { pendingInvites: [] },
|
|
2652
2652
|
resolver: lr(ts)
|
|
@@ -2655,27 +2655,27 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2655
2655
|
name: "pendingInvites"
|
|
2656
2656
|
}), b = q("pendingInvites");
|
|
2657
2657
|
Z(() => {
|
|
2658
|
-
N.length > 1 ? (
|
|
2659
|
-
p(
|
|
2660
|
-
}).catch((
|
|
2658
|
+
N.length > 1 ? (R(!0), Zn(g.name, N).then((S) => {
|
|
2659
|
+
p(S);
|
|
2660
|
+
}).catch((S) => console.error("Search failed:", S)).finally(() => R(!1))) : (p([]), A(/* @__PURE__ */ new Set()));
|
|
2661
2661
|
}, [N, g]);
|
|
2662
|
-
const y = (
|
|
2662
|
+
const y = (S) => {
|
|
2663
2663
|
A((B) => {
|
|
2664
2664
|
const _ = new Set(B);
|
|
2665
|
-
return _.has(
|
|
2665
|
+
return _.has(S) ? _.delete(S) : _.add(S), _;
|
|
2666
2666
|
});
|
|
2667
|
-
},
|
|
2668
|
-
d.filter((
|
|
2669
|
-
w.find((B) => B.id ===
|
|
2667
|
+
}, D = () => {
|
|
2668
|
+
d.filter((S) => $.has(S.id)).forEach((S) => {
|
|
2669
|
+
w.find((B) => B.id === S.id) || T({ ...S, permission: O.name });
|
|
2670
2670
|
}), A(/* @__PURE__ */ new Set()), r("");
|
|
2671
|
-
}, M = (
|
|
2672
|
-
V(
|
|
2673
|
-
(B, _) => v(_, { ...w[_], permission:
|
|
2671
|
+
}, M = (S) => {
|
|
2672
|
+
V(S), w.forEach(
|
|
2673
|
+
(B, _) => v(_, { ...w[_], permission: S.name })
|
|
2674
2674
|
);
|
|
2675
|
-
},
|
|
2675
|
+
}, z = async (S) => {
|
|
2676
2676
|
try {
|
|
2677
2677
|
if (l === de.DRIVE) {
|
|
2678
|
-
const B =
|
|
2678
|
+
const B = S.pendingInvites.map((I) => ({
|
|
2679
2679
|
id: I.id,
|
|
2680
2680
|
permission: I.permission,
|
|
2681
2681
|
type: I.type.toLowerCase()
|
|
@@ -2687,7 +2687,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2687
2687
|
// Always send updated existing shares
|
|
2688
2688
|
}, o);
|
|
2689
2689
|
} else if (l === de.INTEREST) {
|
|
2690
|
-
const B =
|
|
2690
|
+
const B = S.pendingInvites.map((_) => ({
|
|
2691
2691
|
identity: _.id,
|
|
2692
2692
|
type: _.type.toLowerCase(),
|
|
2693
2693
|
opt: !0,
|
|
@@ -2698,7 +2698,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2698
2698
|
}));
|
|
2699
2699
|
i(B, o);
|
|
2700
2700
|
} else if (l === de.ARTICLE) {
|
|
2701
|
-
const B =
|
|
2701
|
+
const B = S.pendingInvites.map((I) => ({
|
|
2702
2702
|
id: I.id,
|
|
2703
2703
|
permission: I.permission,
|
|
2704
2704
|
type: I.type.toLowerCase()
|
|
@@ -2709,17 +2709,17 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2709
2709
|
existingShares: o
|
|
2710
2710
|
}, o);
|
|
2711
2711
|
} else
|
|
2712
|
-
i(
|
|
2712
|
+
i(S, o);
|
|
2713
2713
|
setTimeout(() => {
|
|
2714
2714
|
s();
|
|
2715
2715
|
}, 1e3);
|
|
2716
2716
|
} catch (B) {
|
|
2717
2717
|
throw console.error("Failed to submit invites:", B), B;
|
|
2718
2718
|
}
|
|
2719
|
-
},
|
|
2720
|
-
const B = o[g.code].find((_) => _.name ===
|
|
2719
|
+
}, P = (S) => {
|
|
2720
|
+
const B = o[g.code].find((_) => _.name === S.name && _.permission !== "remove") || b.find((_) => _.name === S.name);
|
|
2721
2721
|
return B ? `${B.permission}` : "";
|
|
2722
|
-
},
|
|
2722
|
+
}, F = () => {
|
|
2723
2723
|
switch (l) {
|
|
2724
2724
|
case de.DRIVE:
|
|
2725
2725
|
return "Share with others";
|
|
@@ -2733,7 +2733,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2733
2733
|
};
|
|
2734
2734
|
return me(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", b.length), b.length === 0 && !u), [b.length, u]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2735
2735
|
/* @__PURE__ */ n("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2736
|
-
/* @__PURE__ */ e(be.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children:
|
|
2736
|
+
/* @__PURE__ */ e(be.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: F() }),
|
|
2737
2737
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
|
|
2738
2738
|
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: [
|
|
2739
2739
|
/* @__PURE__ */ e(sr, { className: "h-5 w-5" }),
|
|
@@ -2753,9 +2753,9 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2753
2753
|
(l === de.DRIVE || m) && /* @__PURE__ */ e(
|
|
2754
2754
|
es,
|
|
2755
2755
|
{
|
|
2756
|
-
users: o.users.filter((
|
|
2757
|
-
groups: o.groups.filter((
|
|
2758
|
-
roles: o.roles.filter((
|
|
2756
|
+
users: o.users.filter((S) => S.permission !== "remove"),
|
|
2757
|
+
groups: o.groups.filter((S) => S.permission !== "remove"),
|
|
2758
|
+
roles: o.roles.filter((S) => S.permission !== "remove"),
|
|
2759
2759
|
onClick: a
|
|
2760
2760
|
}
|
|
2761
2761
|
),
|
|
@@ -2775,10 +2775,10 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2775
2775
|
leave: "transition ease-in duration-100",
|
|
2776
2776
|
leaveFrom: "opacity-100",
|
|
2777
2777
|
leaveTo: "opacity-0",
|
|
2778
|
-
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: Pt.map((
|
|
2778
|
+
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: Pt.map((S) => /* @__PURE__ */ e(
|
|
2779
2779
|
K.Option,
|
|
2780
2780
|
{
|
|
2781
|
-
value:
|
|
2781
|
+
value: S,
|
|
2782
2782
|
className: ({ active: B }) => `${B ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2783
2783
|
children: ({ selected: B }) => /* @__PURE__ */ n(te, { children: [
|
|
2784
2784
|
/* @__PURE__ */ n(
|
|
@@ -2787,19 +2787,19 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2787
2787
|
className: `${B ? "font-medium" : "font-normal"} flex items-center`,
|
|
2788
2788
|
children: [
|
|
2789
2789
|
/* @__PURE__ */ e(
|
|
2790
|
-
|
|
2790
|
+
S.icon,
|
|
2791
2791
|
{
|
|
2792
2792
|
className: `h-5 w-5 mr-2 ${B ? "text-white" : "text-gray-400"}`
|
|
2793
2793
|
}
|
|
2794
2794
|
),
|
|
2795
|
-
|
|
2795
|
+
S.name
|
|
2796
2796
|
]
|
|
2797
2797
|
}
|
|
2798
2798
|
),
|
|
2799
2799
|
B && /* @__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" }) })
|
|
2800
2800
|
] })
|
|
2801
2801
|
},
|
|
2802
|
-
|
|
2802
|
+
S.id
|
|
2803
2803
|
)) })
|
|
2804
2804
|
}
|
|
2805
2805
|
)
|
|
@@ -2808,11 +2808,11 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2808
2808
|
he,
|
|
2809
2809
|
{
|
|
2810
2810
|
placeholder: `Search by ${g.name.toLowerCase()}...`,
|
|
2811
|
-
onDebouncedChange: (
|
|
2811
|
+
onDebouncedChange: (S) => r(S),
|
|
2812
2812
|
value: x
|
|
2813
2813
|
}
|
|
2814
2814
|
) }),
|
|
2815
|
-
/* @__PURE__ */ e(ke, { children: (d?.length > 0 ||
|
|
2815
|
+
/* @__PURE__ */ e(ke, { children: (d?.length > 0 || E) && /* @__PURE__ */ e(
|
|
2816
2816
|
le.div,
|
|
2817
2817
|
{
|
|
2818
2818
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2820,20 +2820,20 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2820
2820
|
exit: { opacity: 0, y: -10 },
|
|
2821
2821
|
transition: { duration: 0.2 },
|
|
2822
2822
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2823
|
-
children:
|
|
2824
|
-
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((
|
|
2825
|
-
const B =
|
|
2823
|
+
children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(te, { children: [
|
|
2824
|
+
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((S) => {
|
|
2825
|
+
const B = P(S);
|
|
2826
2826
|
return /* @__PURE__ */ n(
|
|
2827
2827
|
"div",
|
|
2828
2828
|
{
|
|
2829
|
-
onClick: () => B ? null : y(
|
|
2829
|
+
onClick: () => B ? null : y(S.id),
|
|
2830
2830
|
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${B ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2831
2831
|
children: [
|
|
2832
2832
|
/* @__PURE__ */ e(
|
|
2833
2833
|
"input",
|
|
2834
2834
|
{
|
|
2835
2835
|
type: "checkbox",
|
|
2836
|
-
checked: $.has(
|
|
2836
|
+
checked: $.has(S.id),
|
|
2837
2837
|
readOnly: !0,
|
|
2838
2838
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
|
|
2839
2839
|
disabled: !!B
|
|
@@ -2842,19 +2842,19 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2842
2842
|
/* @__PURE__ */ e(
|
|
2843
2843
|
"img",
|
|
2844
2844
|
{
|
|
2845
|
-
src:
|
|
2846
|
-
alt:
|
|
2845
|
+
src: S.avatarUrl || `https://avatar.vercel.sh/${S.name}.svg?text=${S.name.charAt(0)}`,
|
|
2846
|
+
alt: S.name,
|
|
2847
2847
|
className: "w-8 h-8 rounded-full"
|
|
2848
2848
|
}
|
|
2849
2849
|
),
|
|
2850
|
-
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children:
|
|
2850
|
+
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: S.name }),
|
|
2851
2851
|
B ? /* @__PURE__ */ n(te, { children: [
|
|
2852
2852
|
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children: B }),
|
|
2853
2853
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
|
|
2854
2854
|
] }) : ""
|
|
2855
2855
|
]
|
|
2856
2856
|
},
|
|
2857
|
-
|
|
2857
|
+
S.id
|
|
2858
2858
|
);
|
|
2859
2859
|
}) }),
|
|
2860
2860
|
/* @__PURE__ */ n("div", { className: "flex justify-end gap-2 p-2 border-t border-gray-300", children: [
|
|
@@ -2869,7 +2869,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2869
2869
|
/* @__PURE__ */ e(
|
|
2870
2870
|
"button",
|
|
2871
2871
|
{
|
|
2872
|
-
onClick:
|
|
2872
|
+
onClick: D,
|
|
2873
2873
|
disabled: $.size === 0,
|
|
2874
2874
|
className: "px-3 py-1 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed hover:cursor-pointer",
|
|
2875
2875
|
children: "Add"
|
|
@@ -2896,15 +2896,15 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2896
2896
|
l === de.DRIVE && /* @__PURE__ */ e(
|
|
2897
2897
|
K,
|
|
2898
2898
|
{
|
|
2899
|
-
value:
|
|
2899
|
+
value: O,
|
|
2900
2900
|
onChange: M,
|
|
2901
2901
|
children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2902
2902
|
/* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2903
2903
|
/* @__PURE__ */ n("span", { className: "flex items-center", children: [
|
|
2904
|
-
/* @__PURE__ */ e(
|
|
2904
|
+
/* @__PURE__ */ e(O.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2905
2905
|
/* @__PURE__ */ n("span", { className: "truncate", children: [
|
|
2906
2906
|
"Can ",
|
|
2907
|
-
|
|
2907
|
+
O.name
|
|
2908
2908
|
] })
|
|
2909
2909
|
] }),
|
|
2910
2910
|
/* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(ut, { className: "h-5 w-5 text-gray-400" }) })
|
|
@@ -2916,10 +2916,10 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2916
2916
|
leave: "transition ease-in duration-100",
|
|
2917
2917
|
leaveFrom: "opacity-100",
|
|
2918
2918
|
leaveTo: "opacity-0",
|
|
2919
|
-
children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: It.map((
|
|
2919
|
+
children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: It.map((S) => /* @__PURE__ */ e(
|
|
2920
2920
|
K.Option,
|
|
2921
2921
|
{
|
|
2922
|
-
value:
|
|
2922
|
+
value: S,
|
|
2923
2923
|
className: ({ active: B }) => `${B ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2924
2924
|
children: ({ selected: B, active: _ }) => /* @__PURE__ */ n(te, { children: [
|
|
2925
2925
|
/* @__PURE__ */ n(
|
|
@@ -2928,13 +2928,13 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2928
2928
|
className: `${B ? "font-medium" : "font-normal"} flex items-center`,
|
|
2929
2929
|
children: [
|
|
2930
2930
|
/* @__PURE__ */ e(
|
|
2931
|
-
|
|
2931
|
+
S.icon,
|
|
2932
2932
|
{
|
|
2933
2933
|
className: `h-5 w-5 mr-2 ${_ ? "text-white" : "text-gray-400"}`
|
|
2934
2934
|
}
|
|
2935
2935
|
),
|
|
2936
2936
|
"Can ",
|
|
2937
|
-
|
|
2937
|
+
S.name
|
|
2938
2938
|
]
|
|
2939
2939
|
}
|
|
2940
2940
|
),
|
|
@@ -2947,7 +2947,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2947
2947
|
) })
|
|
2948
2948
|
] })
|
|
2949
2949
|
},
|
|
2950
|
-
|
|
2950
|
+
S.id
|
|
2951
2951
|
)) })
|
|
2952
2952
|
}
|
|
2953
2953
|
)
|
|
@@ -2955,7 +2955,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2955
2955
|
}
|
|
2956
2956
|
)
|
|
2957
2957
|
] }),
|
|
2958
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(ke, { children: w.map((
|
|
2958
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(ke, { children: w.map((S, B) => /* @__PURE__ */ n(
|
|
2959
2959
|
le.div,
|
|
2960
2960
|
{
|
|
2961
2961
|
layout: !0,
|
|
@@ -2969,16 +2969,16 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2969
2969
|
/* @__PURE__ */ e(
|
|
2970
2970
|
"img",
|
|
2971
2971
|
{
|
|
2972
|
-
src:
|
|
2972
|
+
src: S.avatarUrl || `https://avatar.vercel.sh/${S.name}.svg?text=${S.name.charAt(0)}`,
|
|
2973
2973
|
className: "w-8 h-8 rounded-full flex-shrink-0"
|
|
2974
2974
|
}
|
|
2975
2975
|
),
|
|
2976
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-sm text-gray-800 truncate", children:
|
|
2976
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-sm text-gray-800 truncate", children: S.name })
|
|
2977
2977
|
] }),
|
|
2978
2978
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
2979
2979
|
l === de.DRIVE && /* @__PURE__ */ n("span", { className: "text-sm text-gray-500", children: [
|
|
2980
2980
|
"can ",
|
|
2981
|
-
|
|
2981
|
+
S.permission
|
|
2982
2982
|
] }),
|
|
2983
2983
|
/* @__PURE__ */ e(
|
|
2984
2984
|
"button",
|
|
@@ -2991,7 +2991,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
2991
2991
|
] })
|
|
2992
2992
|
]
|
|
2993
2993
|
},
|
|
2994
|
-
|
|
2994
|
+
S.id
|
|
2995
2995
|
)) }) })
|
|
2996
2996
|
]
|
|
2997
2997
|
}
|
|
@@ -3016,7 +3016,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3016
3016
|
/* @__PURE__ */ e(
|
|
3017
3017
|
"button",
|
|
3018
3018
|
{
|
|
3019
|
-
onClick: () => Y(
|
|
3019
|
+
onClick: () => Y(z)(),
|
|
3020
3020
|
disabled: h || b.length === 0 && !u,
|
|
3021
3021
|
className: "px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md shadow-sm hover:bg-blue-700 hover:cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-blue-300 disabled:cursor-not-allowed",
|
|
3022
3022
|
children: h ? "Inviting..." : l === de.DRIVE ? "Send Invites" : "Add"
|
|
@@ -3120,30 +3120,30 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3120
3120
|
}) => {
|
|
3121
3121
|
const [i, u] = L(l), [g, f] = L(0), [x, r] = L(""), N = kt(x, 300), d = {
|
|
3122
3122
|
users: i.users.filter(
|
|
3123
|
-
(
|
|
3123
|
+
(R) => R.name.toLowerCase().includes(N.toLowerCase())
|
|
3124
3124
|
),
|
|
3125
3125
|
groups: i.groups.filter(
|
|
3126
|
-
(
|
|
3126
|
+
(R) => R.name.toLowerCase().includes(N.toLowerCase())
|
|
3127
3127
|
),
|
|
3128
3128
|
roles: i.roles.filter(
|
|
3129
|
-
(
|
|
3129
|
+
(R) => R.name.toLowerCase().includes(N.toLowerCase())
|
|
3130
3130
|
)
|
|
3131
|
-
}, p = async (
|
|
3132
|
-
const Y =
|
|
3131
|
+
}, p = async (R, O, V, U) => {
|
|
3132
|
+
const Y = O.value;
|
|
3133
3133
|
u((q) => ({
|
|
3134
3134
|
...q,
|
|
3135
3135
|
[V]: q[V].map(
|
|
3136
|
-
(
|
|
3136
|
+
(C) => C.id === R.id ? { ...C, permission: Y } : C
|
|
3137
3137
|
)
|
|
3138
3138
|
}));
|
|
3139
3139
|
}, $ = () => {
|
|
3140
|
-
const
|
|
3141
|
-
users: i.users.filter((
|
|
3142
|
-
groups: i.groups.filter((
|
|
3143
|
-
roles: i.roles.filter((
|
|
3140
|
+
const R = {
|
|
3141
|
+
users: i.users.filter((O) => O.permission !== "remove"),
|
|
3142
|
+
groups: i.groups.filter((O) => O.permission !== "remove"),
|
|
3143
|
+
roles: i.roles.filter((O) => O.permission !== "remove")
|
|
3144
3144
|
};
|
|
3145
|
-
a(
|
|
3146
|
-
}, A = ["users", "groups", "roles"],
|
|
3145
|
+
a(R);
|
|
3146
|
+
}, A = ["users", "groups", "roles"], E = ["Users", "Groups", "Roles"];
|
|
3147
3147
|
return (
|
|
3148
3148
|
// The main structure remains the same...
|
|
3149
3149
|
/* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-gray-50", children: [
|
|
@@ -3172,24 +3172,24 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3172
3172
|
/* @__PURE__ */ n("div", { className: "flex flex-col flex-grow", children: [
|
|
3173
3173
|
/* @__PURE__ */ n(ne.Group, { selectedIndex: g, onChange: f, children: [
|
|
3174
3174
|
/* @__PURE__ */ n("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3175
|
-
/* @__PURE__ */ e(ne.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children:
|
|
3175
|
+
/* @__PURE__ */ e(ne.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: E.map((R) => /* @__PURE__ */ e(
|
|
3176
3176
|
ne,
|
|
3177
3177
|
{
|
|
3178
3178
|
className: ({
|
|
3179
|
-
selected:
|
|
3179
|
+
selected: O
|
|
3180
3180
|
}) => `w-full py-2 text-sm font-medium leading-5 rounded-md
|
|
3181
3181
|
focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
|
|
3182
|
-
${
|
|
3183
|
-
children:
|
|
3182
|
+
${O ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
|
|
3183
|
+
children: R
|
|
3184
3184
|
},
|
|
3185
|
-
|
|
3185
|
+
R
|
|
3186
3186
|
)) }),
|
|
3187
3187
|
/* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
|
|
3188
3188
|
he,
|
|
3189
3189
|
{
|
|
3190
3190
|
onDebouncedChange: r,
|
|
3191
3191
|
value: x,
|
|
3192
|
-
placeholder: `Search in ${
|
|
3192
|
+
placeholder: `Search in ${E[g]}...`
|
|
3193
3193
|
}
|
|
3194
3194
|
) })
|
|
3195
3195
|
] }),
|
|
@@ -3200,11 +3200,11 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3200
3200
|
animate: { y: 0, opacity: 1 },
|
|
3201
3201
|
exit: { y: -10, opacity: 0 },
|
|
3202
3202
|
transition: { duration: 0.2 },
|
|
3203
|
-
children: /* @__PURE__ */ e(ne.Panels, { as: Q, children: A.map((
|
|
3203
|
+
children: /* @__PURE__ */ e(ne.Panels, { as: Q, children: A.map((R) => /* @__PURE__ */ e(
|
|
3204
3204
|
ne.Panel,
|
|
3205
3205
|
{
|
|
3206
3206
|
className: "space-y-3 focus:outline-none",
|
|
3207
|
-
children: /* @__PURE__ */ e(ke, { children: d[
|
|
3207
|
+
children: /* @__PURE__ */ e(ke, { children: d[R].length > 0 ? d[R].map((O) => /* @__PURE__ */ n(
|
|
3208
3208
|
le.div,
|
|
3209
3209
|
{
|
|
3210
3210
|
layout: !0,
|
|
@@ -3221,20 +3221,20 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3221
3221
|
/* @__PURE__ */ e(
|
|
3222
3222
|
"img",
|
|
3223
3223
|
{
|
|
3224
|
-
src:
|
|
3225
|
-
alt:
|
|
3224
|
+
src: O.avatarUrl || `https://avatar.vercel.sh/${O.name}.svg?text=${O.name.charAt(0)}`,
|
|
3225
|
+
alt: O.name,
|
|
3226
3226
|
className: "w-10 h-10 rounded-full flex-shrink-0"
|
|
3227
3227
|
}
|
|
3228
3228
|
),
|
|
3229
3229
|
/* @__PURE__ */ n("div", { className: "overflow-hidden", children: [
|
|
3230
|
-
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children:
|
|
3231
|
-
|
|
3230
|
+
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: O.name }),
|
|
3231
|
+
R !== "users" && /* @__PURE__ */ e(
|
|
3232
3232
|
"button",
|
|
3233
3233
|
{
|
|
3234
3234
|
onClick: () => o({
|
|
3235
|
-
id:
|
|
3236
|
-
type:
|
|
3237
|
-
name:
|
|
3235
|
+
id: O.id,
|
|
3236
|
+
type: R,
|
|
3237
|
+
name: O.name
|
|
3238
3238
|
}),
|
|
3239
3239
|
className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
|
|
3240
3240
|
children: "View Members"
|
|
@@ -3245,18 +3245,18 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3245
3245
|
/* @__PURE__ */ e(
|
|
3246
3246
|
rs,
|
|
3247
3247
|
{
|
|
3248
|
-
item:
|
|
3248
|
+
item: O,
|
|
3249
3249
|
allowedPermissions: m,
|
|
3250
3250
|
onPermissionChange: (V) => p(
|
|
3251
|
-
|
|
3251
|
+
O,
|
|
3252
3252
|
V,
|
|
3253
|
-
|
|
3253
|
+
R
|
|
3254
3254
|
)
|
|
3255
3255
|
}
|
|
3256
3256
|
)
|
|
3257
3257
|
]
|
|
3258
3258
|
},
|
|
3259
|
-
|
|
3259
|
+
O.id
|
|
3260
3260
|
)) : (
|
|
3261
3261
|
// Empty state is unchanged
|
|
3262
3262
|
/* @__PURE__ */ n(
|
|
@@ -3269,16 +3269,16 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3269
3269
|
/* @__PURE__ */ e(Qt, { className: "h-12 w-12 text-gray-400" }),
|
|
3270
3270
|
/* @__PURE__ */ n("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
|
|
3271
3271
|
"No ",
|
|
3272
|
-
|
|
3272
|
+
E[g],
|
|
3273
3273
|
" Found"
|
|
3274
3274
|
] }),
|
|
3275
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: x ? `No results for "${x}"` : `There are no ${
|
|
3275
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: x ? `No results for "${x}"` : `There are no ${E[g].toLowerCase()} with access.` })
|
|
3276
3276
|
]
|
|
3277
3277
|
}
|
|
3278
3278
|
)
|
|
3279
3279
|
) })
|
|
3280
3280
|
},
|
|
3281
|
-
|
|
3281
|
+
R
|
|
3282
3282
|
)) })
|
|
3283
3283
|
},
|
|
3284
3284
|
g
|
|
@@ -3429,7 +3429,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3429
3429
|
allowedPermissions: u = [],
|
|
3430
3430
|
...g
|
|
3431
3431
|
}) => {
|
|
3432
|
-
const [f, x] = L(pe.INVITE), [r, N] = L(t), [d, p] = L(null), [$, A] = L(!1), [
|
|
3432
|
+
const [f, x] = L(pe.INVITE), [r, N] = L(t), [d, p] = L(null), [$, A] = L(!1), [E, R] = L([]), [O, V] = L(pe.MANAGE), U = () => {
|
|
3433
3433
|
x(pe.INVITE), p(null), m();
|
|
3434
3434
|
}, Y = () => {
|
|
3435
3435
|
x(pe.MANAGE);
|
|
@@ -3440,15 +3440,15 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3440
3440
|
} catch (v) {
|
|
3441
3441
|
console.log("Error searching entities:", v);
|
|
3442
3442
|
}
|
|
3443
|
-
|
|
3443
|
+
R(resp);
|
|
3444
3444
|
}
|
|
3445
3445
|
p({ id: w, type: k, name: T }), V(f), x(pe.MEMBERS);
|
|
3446
|
-
},
|
|
3446
|
+
}, C = (w) => {
|
|
3447
3447
|
console.log("changedExistingShares", w), N(w);
|
|
3448
|
-
const T = it.mapValues(t, (b) => b.map((y) => ({ id: y.id, permission: y.permission })).sort((y,
|
|
3448
|
+
const T = it.mapValues(t, (b) => b.map((y) => ({ id: y.id, permission: y.permission })).sort((y, D) => y.id - D.id)), k = it.mapValues(w, (b) => b.map((y) => ({ id: y.id, permission: y.permission })).sort((y, D) => y.id - D.id));
|
|
3449
3449
|
console.log("Existing data:", T), console.log("Changed data:", k);
|
|
3450
3450
|
const v = !it.isEqual(T, k);
|
|
3451
|
-
console.log("hasPermissionChanged:", v), A(v), x(f === pe.MEMBERS ?
|
|
3451
|
+
console.log("hasPermissionChanged:", v), A(v), x(f === pe.MEMBERS ? O : pe.INVITE);
|
|
3452
3452
|
};
|
|
3453
3453
|
return /* @__PURE__ */ e(ue, { appear: !0, show: a, as: Q, children: /* @__PURE__ */ n(be, { as: "div", className: "relative z-50", onClose: U, children: [
|
|
3454
3454
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
@@ -3467,7 +3467,7 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3467
3467
|
ns,
|
|
3468
3468
|
{
|
|
3469
3469
|
entity: o,
|
|
3470
|
-
onBack:
|
|
3470
|
+
onBack: C,
|
|
3471
3471
|
onClose: U,
|
|
3472
3472
|
onOpenMembers: q,
|
|
3473
3473
|
existingShares: r,
|
|
@@ -3491,11 +3491,11 @@ const Ee = Hn(), _e = Ee.axiosGet, ql = Ee.axiosDelete, Le = Ee.axiosPost, Qn =
|
|
|
3491
3491
|
ls,
|
|
3492
3492
|
{
|
|
3493
3493
|
entity: d,
|
|
3494
|
-
onBack:
|
|
3494
|
+
onBack: C,
|
|
3495
3495
|
onClose: U,
|
|
3496
3496
|
calledBy: l,
|
|
3497
3497
|
existingShares: r,
|
|
3498
|
-
members:
|
|
3498
|
+
members: E
|
|
3499
3499
|
}
|
|
3500
3500
|
)
|
|
3501
3501
|
},
|
|
@@ -3558,19 +3558,19 @@ function rt({
|
|
|
3558
3558
|
getOptionId: d = ($) => String($.id),
|
|
3559
3559
|
getOptionLabel: p = ($) => $.name
|
|
3560
3560
|
}) {
|
|
3561
|
-
const $ = Qe(), A = Qe(), [
|
|
3561
|
+
const $ = Qe(), A = Qe(), [E, R] = L(""), O = ge(""), V = me(() => {
|
|
3562
3562
|
const w = /* @__PURE__ */ new Map();
|
|
3563
3563
|
for (const T of a) w.set(d(T), T);
|
|
3564
3564
|
return w;
|
|
3565
3565
|
}, [a, d]), U = me(() => Array.isArray(s) ? s.map((w) => w && typeof w == "object" ? V.get(d(w)) || null : V.get(String(w))).filter(Boolean) : [], [s, V, d]), Y = me(() => {
|
|
3566
|
-
if (!
|
|
3567
|
-
const w =
|
|
3566
|
+
if (!E) return a;
|
|
3567
|
+
const w = E.toLowerCase();
|
|
3568
3568
|
return a.filter((T) => p(T).toLowerCase().includes(w));
|
|
3569
|
-
}, [a,
|
|
3569
|
+
}, [a, E, p]);
|
|
3570
3570
|
Z(() => {
|
|
3571
|
-
f === "server" &&
|
|
3572
|
-
}, [
|
|
3573
|
-
const q = f === "client" ? Y : a,
|
|
3571
|
+
f === "server" && E.length >= N && E !== O.current && (O.current = E, x && x(E));
|
|
3572
|
+
}, [E, f, N, x]);
|
|
3573
|
+
const q = f === "client" ? Y : a, C = () => {
|
|
3574
3574
|
if (!U.length)
|
|
3575
3575
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
|
|
3576
3576
|
const w = U.slice(0, u), T = U.length - u;
|
|
@@ -3615,7 +3615,7 @@ function rt({
|
|
|
3615
3615
|
i ? "ring-red-500" : "ring-gray-300"
|
|
3616
3616
|
),
|
|
3617
3617
|
children: [
|
|
3618
|
-
/* @__PURE__ */ e("span", { className: "block truncate", children:
|
|
3618
|
+
/* @__PURE__ */ e("span", { className: "block truncate", children: C() }),
|
|
3619
3619
|
/* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(Xt, { className: "w-5 h-5 text-gray-400", "aria-hidden": "true" }) })
|
|
3620
3620
|
]
|
|
3621
3621
|
}
|
|
@@ -3632,35 +3632,35 @@ function rt({
|
|
|
3632
3632
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3633
3633
|
he,
|
|
3634
3634
|
{
|
|
3635
|
-
value:
|
|
3636
|
-
onDebouncedChange:
|
|
3635
|
+
value: E,
|
|
3636
|
+
onDebouncedChange: R,
|
|
3637
3637
|
placeholder: f === "server" ? `Search (min ${N})…` : "Search options…"
|
|
3638
3638
|
}
|
|
3639
3639
|
) }),
|
|
3640
3640
|
f === "server" && r && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3641
|
-
q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: f === "server" ?
|
|
3642
|
-
const k = d(T), v = p(T), b = U.some((
|
|
3641
|
+
q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: f === "server" ? E.length < N ? `Type at least ${N} characters to search.` : "No results." : "No options found." }) : q.map((T) => {
|
|
3642
|
+
const k = d(T), v = p(T), b = U.some((D) => d(D) === k), y = g !== -1 && U.length >= g && !b;
|
|
3643
3643
|
return /* @__PURE__ */ e(
|
|
3644
3644
|
K.Option,
|
|
3645
3645
|
{
|
|
3646
3646
|
value: T,
|
|
3647
3647
|
disabled: y,
|
|
3648
|
-
className: ({ active:
|
|
3649
|
-
y ? " text-gray-400 bg-white cursor-not-allowed" :
|
|
3648
|
+
className: ({ active: D }) => Ge(
|
|
3649
|
+
y ? " text-gray-400 bg-white cursor-not-allowed" : D ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3650
3650
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3651
3651
|
),
|
|
3652
|
-
children: ({ selected:
|
|
3652
|
+
children: ({ selected: D, active: M }) => /* @__PURE__ */ n(te, { children: [
|
|
3653
3653
|
/* @__PURE__ */ e(
|
|
3654
3654
|
"span",
|
|
3655
3655
|
{
|
|
3656
3656
|
className: Ge(
|
|
3657
|
-
|
|
3657
|
+
D ? "font-semibold" : "font-normal",
|
|
3658
3658
|
"block truncate"
|
|
3659
3659
|
),
|
|
3660
3660
|
children: v
|
|
3661
3661
|
}
|
|
3662
3662
|
),
|
|
3663
|
-
|
|
3663
|
+
D && /* @__PURE__ */ e(
|
|
3664
3664
|
"span",
|
|
3665
3665
|
{
|
|
3666
3666
|
className: Ge(
|
|
@@ -3836,7 +3836,7 @@ function cs({
|
|
|
3836
3836
|
dropId: x,
|
|
3837
3837
|
indent: r = 24
|
|
3838
3838
|
}) {
|
|
3839
|
-
const { setNodeRef: N, isOver: d } = cr({ id: x }), { attributes: p, listeners: $, setNodeRef: A, transform:
|
|
3839
|
+
const { setNodeRef: N, isOver: d } = cr({ id: x }), { attributes: p, listeners: $, setNodeRef: A, transform: E, isDragging: R } = dr({ id: f }), O = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [V, U] = L(!1), [Y, q] = L(t.name), C = () => {
|
|
3840
3840
|
const w = Y.trim();
|
|
3841
3841
|
U(!1), w && w !== t.name ? i?.(t, w) : q(t.name);
|
|
3842
3842
|
}, h = me(() => /* @__PURE__ */ e(
|
|
@@ -3856,8 +3856,8 @@ function cs({
|
|
|
3856
3856
|
"div",
|
|
3857
3857
|
{
|
|
3858
3858
|
ref: N,
|
|
3859
|
-
className: `tv-row ${d ? "tv-drop-over" : ""} ${
|
|
3860
|
-
style: { ...
|
|
3859
|
+
className: `tv-row ${d ? "tv-drop-over" : ""} ${R ? "dragging" : ""}`,
|
|
3860
|
+
style: { ...O, paddingLeft: 8 + a * r },
|
|
3861
3861
|
onClick: (w) => {
|
|
3862
3862
|
w.target.closest(".tv-toggle") || w.target.tagName === "INPUT" || l?.(t);
|
|
3863
3863
|
},
|
|
@@ -3870,9 +3870,9 @@ function cs({
|
|
|
3870
3870
|
className: "tv-input",
|
|
3871
3871
|
value: Y,
|
|
3872
3872
|
onChange: (w) => q(w.target.value),
|
|
3873
|
-
onBlur:
|
|
3873
|
+
onBlur: C,
|
|
3874
3874
|
onKeyDown: (w) => {
|
|
3875
|
-
w.key === "Enter" &&
|
|
3875
|
+
w.key === "Enter" && C(), w.key === "Escape" && (U(!1), q(t.name));
|
|
3876
3876
|
},
|
|
3877
3877
|
autoFocus: !0
|
|
3878
3878
|
}
|
|
@@ -3981,66 +3981,66 @@ function Jl({
|
|
|
3981
3981
|
const { roots: $ } = me(() => hs(t) ? gs(t, { rootId: a, getId: o, getName: m }) : ps(
|
|
3982
3982
|
t.map((y) => ({ ...y })),
|
|
3983
3983
|
{ rootId: a, getId: o, getParent: l, getName: m }
|
|
3984
|
-
), [t, a, o, l, m]), [A,
|
|
3985
|
-
const
|
|
3986
|
-
return (function M(
|
|
3987
|
-
|
|
3988
|
-
|
|
3984
|
+
), [t, a, o, l, m]), [A, E] = L({}), R = ae((y) => {
|
|
3985
|
+
const D = {};
|
|
3986
|
+
return (function M(z) {
|
|
3987
|
+
z.forEach((P) => {
|
|
3988
|
+
D[P.id] = !0, P.children?.length && M(P.children);
|
|
3989
3989
|
});
|
|
3990
|
-
})(y),
|
|
3990
|
+
})(y), D;
|
|
3991
3991
|
}, []);
|
|
3992
3992
|
se.useEffect(() => {
|
|
3993
|
-
R(
|
|
3994
|
-
}, [$,
|
|
3995
|
-
const
|
|
3996
|
-
(y) =>
|
|
3993
|
+
E(R($));
|
|
3994
|
+
}, [$, R]);
|
|
3995
|
+
const O = ae(
|
|
3996
|
+
(y) => E((D) => ({ ...D, [y]: !D[y] })),
|
|
3997
3997
|
[]
|
|
3998
3998
|
), [V, U] = L(() => Me($));
|
|
3999
3999
|
se.useEffect(() => U(Me($)), [$]);
|
|
4000
4000
|
const Y = mr(
|
|
4001
4001
|
ur(br, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
4002
|
-
), q = ge(null), [
|
|
4002
|
+
), q = ge(null), [C, h] = L(null), w = ge(0), T = () => {
|
|
4003
4003
|
}, k = ({ delta: y }) => {
|
|
4004
4004
|
w.current = y?.x ?? 0;
|
|
4005
4005
|
}, v = ae(
|
|
4006
|
-
({ active: y, over:
|
|
4006
|
+
({ active: y, over: D }) => {
|
|
4007
4007
|
const M = w.current;
|
|
4008
|
-
if (w.current = 0, h(null), !y || !
|
|
4009
|
-
const
|
|
4010
|
-
if (!
|
|
4011
|
-
let
|
|
4012
|
-
const
|
|
4013
|
-
if (
|
|
4014
|
-
let X =
|
|
4015
|
-
for (let xe = 0; xe <
|
|
4008
|
+
if (w.current = 0, h(null), !y || !D) return;
|
|
4009
|
+
const z = String(y.id).replace(/^drag-/, ""), P = String(D.id).replace(/^drop-/, "");
|
|
4010
|
+
if (!z || !P || z === P) return;
|
|
4011
|
+
let F = P;
|
|
4012
|
+
const S = Math.max(0, Math.floor(-M / p));
|
|
4013
|
+
if (S > 0) {
|
|
4014
|
+
let X = P;
|
|
4015
|
+
for (let xe = 0; xe < S; xe++) {
|
|
4016
4016
|
const j = Sa(V, X, null);
|
|
4017
4017
|
if (!j) break;
|
|
4018
4018
|
if (!j.parentId) {
|
|
4019
|
-
|
|
4019
|
+
F = a;
|
|
4020
4020
|
break;
|
|
4021
4021
|
}
|
|
4022
|
-
|
|
4022
|
+
F = j.parentId, X = j.parentId;
|
|
4023
4023
|
}
|
|
4024
4024
|
}
|
|
4025
|
-
if (d &&
|
|
4025
|
+
if (d && F === a) {
|
|
4026
4026
|
U(Me($));
|
|
4027
4027
|
return;
|
|
4028
4028
|
}
|
|
4029
|
-
const B = Me(V), { newRoots: _, removed: I } = bs(B,
|
|
4029
|
+
const B = Me(V), { newRoots: _, removed: I } = bs(B, z);
|
|
4030
4030
|
if (!I) return;
|
|
4031
|
-
const G = fs(_,
|
|
4032
|
-
U(G), r?.({ sourceId:
|
|
4031
|
+
const G = fs(_, F, I);
|
|
4032
|
+
U(G), r?.({ sourceId: z, destParentId: F, newTree: G });
|
|
4033
4033
|
},
|
|
4034
4034
|
[V, $, a, d, p, r]
|
|
4035
4035
|
), b = ae(
|
|
4036
|
-
(y,
|
|
4036
|
+
(y, D = 0) => y.map((M) => /* @__PURE__ */ n(se.Fragment, { children: [
|
|
4037
4037
|
/* @__PURE__ */ e(
|
|
4038
4038
|
cs,
|
|
4039
4039
|
{
|
|
4040
4040
|
node: M,
|
|
4041
|
-
depth:
|
|
4041
|
+
depth: D,
|
|
4042
4042
|
expanded: !!A[M.id],
|
|
4043
|
-
onToggle: () =>
|
|
4043
|
+
onToggle: () => O(M.id),
|
|
4044
4044
|
onSelect: i,
|
|
4045
4045
|
onCreateChild: g,
|
|
4046
4046
|
onRename: f,
|
|
@@ -4051,23 +4051,23 @@ function Jl({
|
|
|
4051
4051
|
indent: p
|
|
4052
4052
|
}
|
|
4053
4053
|
),
|
|
4054
|
-
A[M.id] && M.children?.length > 0 ? b(M.children,
|
|
4054
|
+
A[M.id] && M.children?.length > 0 ? b(M.children, D + 1) : null
|
|
4055
4055
|
] }, M.id)),
|
|
4056
|
-
[A, p, g, x, f, i, N,
|
|
4056
|
+
[A, p, g, x, f, i, N, O]
|
|
4057
4057
|
);
|
|
4058
4058
|
return se.useMemo(() => {
|
|
4059
|
-
if (!
|
|
4060
|
-
const y = String(
|
|
4061
|
-
function
|
|
4062
|
-
for (const
|
|
4063
|
-
if (
|
|
4064
|
-
const
|
|
4065
|
-
if (
|
|
4059
|
+
if (!C) return null;
|
|
4060
|
+
const y = String(C).replace(/^drag-/, "");
|
|
4061
|
+
function D(M) {
|
|
4062
|
+
for (const z of M) {
|
|
4063
|
+
if (z.id === y) return z;
|
|
4064
|
+
const P = z.children?.length ? D(z.children) : null;
|
|
4065
|
+
if (P) return P;
|
|
4066
4066
|
}
|
|
4067
4067
|
return null;
|
|
4068
4068
|
}
|
|
4069
|
-
return
|
|
4070
|
-
}, [
|
|
4069
|
+
return D(V);
|
|
4070
|
+
}, [C, V]), /* @__PURE__ */ n("div", { className: "tv", children: [
|
|
4071
4071
|
s !== !1 && /* @__PURE__ */ n("div", { className: "tv-header", children: [
|
|
4072
4072
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
4073
4073
|
/* @__PURE__ */ e("button", { className: "tv-btn", onClick: u, children: "+ New folder" })
|
|
@@ -4181,7 +4181,7 @@ function ys({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4181
4181
|
}
|
|
4182
4182
|
),
|
|
4183
4183
|
/* @__PURE__ */ e("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: l.description }),
|
|
4184
|
-
|
|
4184
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: l.fields.map((r, N) => x(r) && /* @__PURE__ */ n("div", { className: r.fullWidth ? "col-span-full" : "", style: { marginBottom: "10px" }, children: [
|
|
4185
4185
|
/* @__PURE__ */ n(
|
|
4186
4186
|
"label",
|
|
4187
4187
|
{
|
|
@@ -4619,7 +4619,7 @@ function ys({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4619
4619
|
children: r.info
|
|
4620
4620
|
}
|
|
4621
4621
|
)
|
|
4622
|
-
] }, N) })
|
|
4622
|
+
] }, N)) })
|
|
4623
4623
|
] }) });
|
|
4624
4624
|
}
|
|
4625
4625
|
const xs = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
@@ -4649,8 +4649,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4649
4649
|
const $ = (h) => {
|
|
4650
4650
|
const w = (v, b) => {
|
|
4651
4651
|
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: v, value: b, type: typeof b }), r((y) => {
|
|
4652
|
-
const
|
|
4653
|
-
return
|
|
4652
|
+
const D = [...y];
|
|
4653
|
+
return D[v][h.key] = b, D;
|
|
4654
4654
|
});
|
|
4655
4655
|
}, T = (v) => o[l.key]?.[v]?.[h.key], k = (v) => {
|
|
4656
4656
|
const b = T(v);
|
|
@@ -4698,9 +4698,9 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4698
4698
|
step: h.step,
|
|
4699
4699
|
onChange: (y) => w(b, y.target.value),
|
|
4700
4700
|
onBlur: (y) => {
|
|
4701
|
-
const
|
|
4702
|
-
if (
|
|
4703
|
-
const M = Number(
|
|
4701
|
+
const D = y.target.value;
|
|
4702
|
+
if (D !== "" && D !== null && D !== void 0) {
|
|
4703
|
+
const M = Number(D);
|
|
4704
4704
|
isNaN(M) || (h.min !== void 0 && M < h.min ? (y.target.setCustomValidity(`${h.label} must be at least ${h.min}`), y.target.reportValidity()) : h.max !== void 0 && M > h.max ? (y.target.setCustomValidity(`${h.label} must not exceed ${h.max}`), y.target.reportValidity()) : y.target.setCustomValidity(""));
|
|
4705
4705
|
}
|
|
4706
4706
|
},
|
|
@@ -4784,12 +4784,12 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4784
4784
|
return (v, b) => {
|
|
4785
4785
|
const y = () => {
|
|
4786
4786
|
if (h.optionsFrom && a) {
|
|
4787
|
-
const { config:
|
|
4788
|
-
if (Array.isArray(
|
|
4789
|
-
return
|
|
4790
|
-
id:
|
|
4791
|
-
value:
|
|
4792
|
-
label:
|
|
4787
|
+
const { config: D, valueField: M, labelField: z } = h.optionsFrom, P = a[D] || [];
|
|
4788
|
+
if (Array.isArray(P))
|
|
4789
|
+
return P.map((F) => ({
|
|
4790
|
+
id: F[M] || "",
|
|
4791
|
+
value: F[M] || "",
|
|
4792
|
+
label: F[z] || ""
|
|
4793
4793
|
}));
|
|
4794
4794
|
}
|
|
4795
4795
|
return h.options || [];
|
|
@@ -4800,7 +4800,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4800
4800
|
{
|
|
4801
4801
|
index: b,
|
|
4802
4802
|
value: v[h.key] || "",
|
|
4803
|
-
onChange: (
|
|
4803
|
+
onChange: (D) => w(b, D),
|
|
4804
4804
|
options: y(),
|
|
4805
4805
|
placeholder: h.placeholder || `Select ${h.label}`,
|
|
4806
4806
|
required: h.required,
|
|
@@ -4818,7 +4818,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4818
4818
|
rt,
|
|
4819
4819
|
{
|
|
4820
4820
|
selectedItems: y,
|
|
4821
|
-
onSelectionChange: (
|
|
4821
|
+
onSelectionChange: (D) => w(b, D),
|
|
4822
4822
|
options: h.options || [],
|
|
4823
4823
|
placeholder: h.placeholder || `Select ${h.label}`,
|
|
4824
4824
|
className: "w-full"
|
|
@@ -4903,20 +4903,20 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4903
4903
|
);
|
|
4904
4904
|
case "audience":
|
|
4905
4905
|
return (v, b) => {
|
|
4906
|
-
const y = v[h.key] || { users: [], groups: [], roles: [] },
|
|
4906
|
+
const y = v[h.key] || { users: [], groups: [], roles: [] }, D = [
|
|
4907
4907
|
...y.users || [],
|
|
4908
4908
|
...y.groups || [],
|
|
4909
4909
|
...y.roles || []
|
|
4910
4910
|
];
|
|
4911
4911
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
4912
|
-
/* @__PURE__ */ e(xs, { children:
|
|
4912
|
+
/* @__PURE__ */ e(xs, { children: D.length > 0 ? D.slice(0, 3).map((M, z) => /* @__PURE__ */ e(
|
|
4913
4913
|
Ce,
|
|
4914
4914
|
{
|
|
4915
4915
|
size: "small",
|
|
4916
4916
|
name: M.name || M.displayName || M.id,
|
|
4917
4917
|
src: M.avatarUrl
|
|
4918
4918
|
},
|
|
4919
|
-
|
|
4919
|
+
z
|
|
4920
4920
|
)) : null }),
|
|
4921
4921
|
/* @__PURE__ */ e(
|
|
4922
4922
|
"button",
|
|
@@ -4925,7 +4925,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4925
4925
|
onClick: () => {
|
|
4926
4926
|
f(h.key), u(b);
|
|
4927
4927
|
},
|
|
4928
|
-
children:
|
|
4928
|
+
children: D.length > 0 ? "Edit" : "Assign"
|
|
4929
4929
|
}
|
|
4930
4930
|
)
|
|
4931
4931
|
] });
|
|
@@ -4962,8 +4962,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4962
4962
|
{
|
|
4963
4963
|
type: "file",
|
|
4964
4964
|
onChange: (y) => {
|
|
4965
|
-
const
|
|
4966
|
-
w(b,
|
|
4965
|
+
const D = y.target.files[0];
|
|
4966
|
+
w(b, D ? D.name : "");
|
|
4967
4967
|
},
|
|
4968
4968
|
accept: h.accept,
|
|
4969
4969
|
className: "w-full"
|
|
@@ -5007,29 +5007,29 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
5007
5007
|
const T = [...h, w];
|
|
5008
5008
|
return console.log("[DataTableRenderer] Updated data:", T), T;
|
|
5009
5009
|
});
|
|
5010
|
-
}, [l.fields]),
|
|
5010
|
+
}, [l.fields]), E = ae((h) => {
|
|
5011
5011
|
r((w) => {
|
|
5012
5012
|
if (w.length <= 1)
|
|
5013
5013
|
return w;
|
|
5014
5014
|
const T = [...w];
|
|
5015
5015
|
return T.splice(h, 1), T;
|
|
5016
5016
|
});
|
|
5017
|
-
}, []), [
|
|
5018
|
-
|
|
5017
|
+
}, []), [R, O] = L(null), V = ae((h, w) => {
|
|
5018
|
+
O(w), h.dataTransfer.effectAllowed = "move", h.dataTransfer.setData("text/html", "");
|
|
5019
5019
|
}, []), U = ae((h) => {
|
|
5020
5020
|
h.preventDefault(), h.dataTransfer.dropEffect = "move";
|
|
5021
5021
|
}, []), Y = ae((h, w) => {
|
|
5022
|
-
h.preventDefault(), !(
|
|
5023
|
-
const k = [...T], v = k[
|
|
5024
|
-
return k.splice(
|
|
5025
|
-
}),
|
|
5026
|
-
}, [
|
|
5027
|
-
|
|
5028
|
-
}, []),
|
|
5022
|
+
h.preventDefault(), !(R === null || R === w) && (r((T) => {
|
|
5023
|
+
const k = [...T], v = k[R];
|
|
5024
|
+
return k.splice(R, 1), k.splice(w, 0, v), k;
|
|
5025
|
+
}), O(null));
|
|
5026
|
+
}, [R]), q = ae(() => {
|
|
5027
|
+
O(null);
|
|
5028
|
+
}, []), C = ae((h) => {
|
|
5029
5029
|
console.log("[DataTableRenderer] handleAddAudience called with:", h), r((w) => {
|
|
5030
5030
|
const T = [...w];
|
|
5031
5031
|
if (i !== null && g && T[i]) {
|
|
5032
|
-
const k = h.pendingInvites || [], v = k.filter((
|
|
5032
|
+
const k = h.pendingInvites || [], v = k.filter((D) => D.type === "User"), b = k.filter((D) => D.type === "Group"), y = k.filter((D) => D.type === "Role");
|
|
5033
5033
|
T[i][g] = {
|
|
5034
5034
|
users: [...T[i][g]?.users || [], ...v],
|
|
5035
5035
|
groups: [...T[i][g]?.groups || [], ...b],
|
|
@@ -5070,7 +5070,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
5070
5070
|
/* @__PURE__ */ e("tbody", { children: x.map((h, w) => /* @__PURE__ */ n(
|
|
5071
5071
|
"tr",
|
|
5072
5072
|
{
|
|
5073
|
-
className: `hover:bg-gray-50 ${
|
|
5073
|
+
className: `hover:bg-gray-50 ${R === w ? "opacity-50" : ""}`,
|
|
5074
5074
|
draggable: !0,
|
|
5075
5075
|
onDragStart: (T) => V(T, w),
|
|
5076
5076
|
onDragOver: U,
|
|
@@ -5082,7 +5082,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
5082
5082
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
5083
5083
|
"button",
|
|
5084
5084
|
{
|
|
5085
|
-
onClick: () =>
|
|
5085
|
+
onClick: () => E(w),
|
|
5086
5086
|
className: "text-red-500 hover:text-red-700",
|
|
5087
5087
|
title: "Delete row",
|
|
5088
5088
|
children: /* @__PURE__ */ e(fr, { size: 16 })
|
|
@@ -5106,7 +5106,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: o = {} }) {
|
|
|
5106
5106
|
onClose: () => {
|
|
5107
5107
|
u(null), f(null);
|
|
5108
5108
|
},
|
|
5109
|
-
onFinalSubmit:
|
|
5109
|
+
onFinalSubmit: C,
|
|
5110
5110
|
existingShares: h,
|
|
5111
5111
|
allowedPermissions: ["view", "remove"]
|
|
5112
5112
|
}
|
|
@@ -5181,18 +5181,18 @@ const Mt = () => {
|
|
|
5181
5181
|
initialData: g = null
|
|
5182
5182
|
// Add prop for initial demo data
|
|
5183
5183
|
}) => {
|
|
5184
|
-
const [f, x] = L(null), [r, N] = L(""), [d, p] = L(() => Array.isArray(g) ? g : []), [$, A] = L(null), [
|
|
5184
|
+
const [f, x] = L(null), [r, N] = L(""), [d, p] = L(() => Array.isArray(g) ? g : []), [$, A] = L(null), [E, R] = L(null), [O, V] = L(""), U = async () => {
|
|
5185
5185
|
try {
|
|
5186
|
-
const
|
|
5187
|
-
if (
|
|
5188
|
-
const
|
|
5189
|
-
...
|
|
5190
|
-
order: typeof
|
|
5186
|
+
const z = await _e(t.collectionList);
|
|
5187
|
+
if (z) {
|
|
5188
|
+
const P = z.map((F, S) => ({
|
|
5189
|
+
...F,
|
|
5190
|
+
order: typeof F.order == "number" ? F.order : S + 1
|
|
5191
5191
|
}));
|
|
5192
|
-
|
|
5192
|
+
P.sort((F, S) => (F.order ?? 0) - (S.order ?? 0)), p(P), s?.(P);
|
|
5193
5193
|
}
|
|
5194
|
-
} catch (
|
|
5195
|
-
console.log("Error loading collections:",
|
|
5194
|
+
} catch (z) {
|
|
5195
|
+
console.log("Error loading collections:", z), typeof window < "u" && !window.location.pathname.includes("iframe.html") && Se.error("Failed to load collections");
|
|
5196
5196
|
}
|
|
5197
5197
|
};
|
|
5198
5198
|
Z(() => {
|
|
@@ -5200,30 +5200,30 @@ const Mt = () => {
|
|
|
5200
5200
|
}, [g]), Z(() => {
|
|
5201
5201
|
Array.isArray(g) && p(g);
|
|
5202
5202
|
}, [g]);
|
|
5203
|
-
const Y = (
|
|
5204
|
-
m && (x(
|
|
5203
|
+
const Y = (z) => {
|
|
5204
|
+
m && (x(z.id), N(z.categoryName || ""));
|
|
5205
5205
|
}, q = () => {
|
|
5206
5206
|
if (!l || f !== null) return;
|
|
5207
|
-
const
|
|
5208
|
-
p((
|
|
5209
|
-
...
|
|
5207
|
+
const z = `temp-${Date.now()}`;
|
|
5208
|
+
p((P) => [
|
|
5209
|
+
...P,
|
|
5210
5210
|
{
|
|
5211
|
-
id:
|
|
5211
|
+
id: z,
|
|
5212
5212
|
categoryName: "",
|
|
5213
5213
|
links: [],
|
|
5214
|
-
order: (
|
|
5214
|
+
order: (P.at(-1)?.order ?? 0) + 1,
|
|
5215
5215
|
_temp: !0
|
|
5216
5216
|
}
|
|
5217
|
-
]), x(
|
|
5218
|
-
},
|
|
5219
|
-
f != null && (p((
|
|
5220
|
-
const
|
|
5221
|
-
return s?.(
|
|
5217
|
+
]), x(z), N("");
|
|
5218
|
+
}, C = () => {
|
|
5219
|
+
f != null && (p((z) => {
|
|
5220
|
+
const P = z.find((S) => S.id === f), F = P && P._temp ? z.filter((S) => S.id !== f) : z;
|
|
5221
|
+
return s?.(F), F;
|
|
5222
5222
|
}), x(null), N(""));
|
|
5223
5223
|
}, h = () => {
|
|
5224
5224
|
if (f == null || !r.trim()) return;
|
|
5225
5225
|
if (typeof f == "string" && f.startsWith("temp-")) {
|
|
5226
|
-
const
|
|
5226
|
+
const P = {
|
|
5227
5227
|
id: f,
|
|
5228
5228
|
categoryName: r.trim(),
|
|
5229
5229
|
links: [],
|
|
@@ -5233,55 +5233,55 @@ const Mt = () => {
|
|
|
5233
5233
|
_isDraft: !0
|
|
5234
5234
|
// Flag to indicate this is a draft change
|
|
5235
5235
|
};
|
|
5236
|
-
p((
|
|
5237
|
-
const
|
|
5238
|
-
return s?.(
|
|
5236
|
+
p((F) => {
|
|
5237
|
+
const S = F.map((B) => B.id === f ? P : B);
|
|
5238
|
+
return s?.(S), S;
|
|
5239
5239
|
});
|
|
5240
5240
|
} else
|
|
5241
|
-
p((
|
|
5242
|
-
const
|
|
5243
|
-
(
|
|
5241
|
+
p((P) => {
|
|
5242
|
+
const F = P.map(
|
|
5243
|
+
(S) => S.id === f ? { ...S, categoryName: r.trim(), _isDraft: !0 } : S
|
|
5244
5244
|
);
|
|
5245
|
-
return s?.(
|
|
5245
|
+
return s?.(F), F;
|
|
5246
5246
|
});
|
|
5247
5247
|
x(null), N("");
|
|
5248
|
-
}, w = (
|
|
5249
|
-
i && p((
|
|
5250
|
-
const
|
|
5251
|
-
return s?.(
|
|
5248
|
+
}, w = (z) => {
|
|
5249
|
+
i && p((P) => {
|
|
5250
|
+
const F = P.filter((S) => S.id !== z.id);
|
|
5251
|
+
return s?.(F), F;
|
|
5252
5252
|
});
|
|
5253
|
-
}, T = (
|
|
5254
|
-
if (!u || !
|
|
5255
|
-
const
|
|
5256
|
-
if (
|
|
5257
|
-
const _ = [...
|
|
5253
|
+
}, T = (z, P, F) => {
|
|
5254
|
+
if (!u || !P || !F || P === F) return z;
|
|
5255
|
+
const S = z.findIndex((G) => G.id === P), B = z.findIndex((G) => G.id === F);
|
|
5256
|
+
if (S === -1 || B === -1) return z;
|
|
5257
|
+
const _ = [...z], [I] = _.splice(S, 1);
|
|
5258
5258
|
return _.splice(B, 0, I), _.map((G, X) => ({ ...G, order: X + 1 }));
|
|
5259
|
-
}, k = (
|
|
5260
|
-
u && (
|
|
5261
|
-
}, v = (
|
|
5262
|
-
$ &&
|
|
5263
|
-
}, b = (
|
|
5264
|
-
|
|
5265
|
-
}, y = (
|
|
5266
|
-
|
|
5267
|
-
const
|
|
5268
|
-
|
|
5269
|
-
const B = T(
|
|
5259
|
+
}, k = (z, P) => {
|
|
5260
|
+
u && (z.dataTransfer.effectAllowed = "move", z.dataTransfer.setData("text/plain", String(P)), A(P));
|
|
5261
|
+
}, v = (z) => {
|
|
5262
|
+
$ && z !== E && R(z);
|
|
5263
|
+
}, b = (z) => {
|
|
5264
|
+
z.preventDefault();
|
|
5265
|
+
}, y = (z, P) => {
|
|
5266
|
+
z.preventDefault();
|
|
5267
|
+
const F = z.dataTransfer.getData("text/plain");
|
|
5268
|
+
F && (p((S) => {
|
|
5269
|
+
const B = T(S, F, P);
|
|
5270
5270
|
console.log("Reordered", B);
|
|
5271
5271
|
const _ = B.map((I) => ({ ...I, _isDraft: !0 }));
|
|
5272
5272
|
return s?.(_), _;
|
|
5273
|
-
}), A(null),
|
|
5274
|
-
},
|
|
5275
|
-
A(null),
|
|
5273
|
+
}), A(null), R(null));
|
|
5274
|
+
}, D = () => {
|
|
5275
|
+
A(null), R(null);
|
|
5276
5276
|
}, M = Array.isArray(d) ? d.filter(
|
|
5277
|
-
(
|
|
5277
|
+
(z) => z.categoryName?.toLowerCase().includes(O.toLowerCase())
|
|
5278
5278
|
) : [];
|
|
5279
5279
|
return /* @__PURE__ */ n("div", { className: `manage-collection-list ${a}`, children: [
|
|
5280
5280
|
/* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ n("div", { className: "w-1/2 flex justify-end", children: [
|
|
5281
5281
|
o && /* @__PURE__ */ e(
|
|
5282
5282
|
he,
|
|
5283
5283
|
{
|
|
5284
|
-
value:
|
|
5284
|
+
value: O,
|
|
5285
5285
|
onDebouncedChange: V,
|
|
5286
5286
|
placeholder: "Search Collection",
|
|
5287
5287
|
customClass: "mr-4 searchmanagecollection"
|
|
@@ -5300,32 +5300,32 @@ const Mt = () => {
|
|
|
5300
5300
|
}
|
|
5301
5301
|
)
|
|
5302
5302
|
] }) }),
|
|
5303
|
-
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: M.map((
|
|
5304
|
-
const
|
|
5303
|
+
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: M.map((z) => {
|
|
5304
|
+
const P = f === z.id, F = z?.links?.length ?? 0, S = $ === z.id, B = E === z.id && $ !== z.id;
|
|
5305
5305
|
return /* @__PURE__ */ e(
|
|
5306
5306
|
"div",
|
|
5307
5307
|
{
|
|
5308
|
-
onDragEnter: () => v(
|
|
5308
|
+
onDragEnter: () => v(z.id),
|
|
5309
5309
|
onDragOver: b,
|
|
5310
|
-
onDrop: (_) => y(_,
|
|
5311
|
-
onDragEnd:
|
|
5310
|
+
onDrop: (_) => y(_, z.id),
|
|
5311
|
+
onDragEnd: D,
|
|
5312
5312
|
className: [
|
|
5313
5313
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5314
5314
|
"border-gray-300",
|
|
5315
5315
|
B ? "ring-2 ring-gray-800/20" : "",
|
|
5316
|
-
|
|
5316
|
+
S ? "opacity-60" : ""
|
|
5317
5317
|
].join(" "),
|
|
5318
|
-
children:
|
|
5318
|
+
children: P ? /* @__PURE__ */ n(te, { children: [
|
|
5319
5319
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
5320
5320
|
"input",
|
|
5321
5321
|
{
|
|
5322
5322
|
type: "text",
|
|
5323
5323
|
className: "flex-1 h-10 px-3 max-w-[200px] border border-gray-300 rounded-2xl outline-none focus:ring-2 focus:ring-gray-800/20",
|
|
5324
5324
|
value: r,
|
|
5325
|
-
placeholder:
|
|
5325
|
+
placeholder: z._temp ? "New collection name" : "Edit collection name",
|
|
5326
5326
|
onChange: (_) => N(_.target.value),
|
|
5327
5327
|
onKeyDown: (_) => {
|
|
5328
|
-
_.key === "Enter" && h(), _.key === "Escape" &&
|
|
5328
|
+
_.key === "Enter" && h(), _.key === "Escape" && C();
|
|
5329
5329
|
},
|
|
5330
5330
|
autoFocus: !0
|
|
5331
5331
|
}
|
|
@@ -5335,7 +5335,7 @@ const Mt = () => {
|
|
|
5335
5335
|
"button",
|
|
5336
5336
|
{
|
|
5337
5337
|
className: "cursor-pointer border border-gray-300 p-2 rounded-2xl",
|
|
5338
|
-
onClick:
|
|
5338
|
+
onClick: C,
|
|
5339
5339
|
"aria-label": "Cancel edit",
|
|
5340
5340
|
children: /* @__PURE__ */ e(ye, { color: "#767676" })
|
|
5341
5341
|
}
|
|
@@ -5364,36 +5364,36 @@ const Mt = () => {
|
|
|
5364
5364
|
"aria-label": "Drag to reorder",
|
|
5365
5365
|
className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
|
|
5366
5366
|
draggable: !0,
|
|
5367
|
-
onDragStart: (_) => k(_,
|
|
5367
|
+
onDragStart: (_) => k(_, z.id),
|
|
5368
5368
|
children: /* @__PURE__ */ e(Nt, {})
|
|
5369
5369
|
}
|
|
5370
5370
|
),
|
|
5371
|
-
/* @__PURE__ */ e("span", { children:
|
|
5371
|
+
/* @__PURE__ */ e("span", { children: z.categoryName })
|
|
5372
5372
|
] }),
|
|
5373
5373
|
/* @__PURE__ */ n("div", { className: "flex gap-2 items-center", children: [
|
|
5374
|
-
|
|
5374
|
+
z.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: z.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${F} ${F === 1 ? "link" : "links"}` }),
|
|
5375
5375
|
m && /* @__PURE__ */ e(
|
|
5376
5376
|
"button",
|
|
5377
5377
|
{
|
|
5378
5378
|
className: "cursor-pointer",
|
|
5379
|
-
onClick: () => Y(
|
|
5380
|
-
"aria-label": `Edit ${
|
|
5379
|
+
onClick: () => Y(z),
|
|
5380
|
+
"aria-label": `Edit ${z.categoryName}`,
|
|
5381
5381
|
children: /* @__PURE__ */ e(yr, { color: "#767676" })
|
|
5382
5382
|
}
|
|
5383
5383
|
),
|
|
5384
5384
|
i && /* @__PURE__ */ e(
|
|
5385
5385
|
"span",
|
|
5386
5386
|
{
|
|
5387
|
-
className:
|
|
5388
|
-
title:
|
|
5389
|
-
onClick:
|
|
5390
|
-
children: /* @__PURE__ */ e(Ze, { color:
|
|
5387
|
+
className: F === 0 && !z.protected ? "cursor-pointer" : "cursor-not-allowed",
|
|
5388
|
+
title: F === 0 && !z.protected ? "Delete" : "Cannot delete this collection",
|
|
5389
|
+
onClick: F === 0 ? () => w(z) : null,
|
|
5390
|
+
children: /* @__PURE__ */ e(Ze, { color: F === 0 ? "#767676" : "#C2C2C2" })
|
|
5391
5391
|
}
|
|
5392
5392
|
)
|
|
5393
5393
|
] })
|
|
5394
5394
|
] })
|
|
5395
5395
|
},
|
|
5396
|
-
|
|
5396
|
+
z.id
|
|
5397
5397
|
);
|
|
5398
5398
|
}) })
|
|
5399
5399
|
] });
|
|
@@ -5455,31 +5455,31 @@ function zs({
|
|
|
5455
5455
|
onCancel: o,
|
|
5456
5456
|
onSave: l
|
|
5457
5457
|
}) {
|
|
5458
|
-
const [m, i] = se.useState(a), [u, g] = se.useState(null), [f, x] = L(!1), [r, N] = L(!1), [d, p] = L({}), $ = `${ze()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, A = $, [
|
|
5458
|
+
const [m, i] = se.useState(a), [u, g] = se.useState(null), [f, x] = L(!1), [r, N] = L(!1), [d, p] = L({}), $ = `${ze()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, A = $, [E, R] = L(1), O = (k) => {
|
|
5459
5459
|
if (!a || !a.configuration)
|
|
5460
5460
|
return k;
|
|
5461
5461
|
const v = {}, b = k?.configuration || {};
|
|
5462
5462
|
return a.configuration.forEach((y) => {
|
|
5463
5463
|
if (y.key && y.type === "datatable") {
|
|
5464
|
-
const M = (b[y.key] || []).map((
|
|
5465
|
-
const
|
|
5466
|
-
return y.fields && y.fields.forEach((
|
|
5467
|
-
if (
|
|
5464
|
+
const M = (b[y.key] || []).map((z, P) => {
|
|
5465
|
+
const F = { id: z.id || 0 };
|
|
5466
|
+
return y.fields && y.fields.forEach((S) => {
|
|
5467
|
+
if (S.fieldtype === "audience") {
|
|
5468
5468
|
let B = { users: [], groups: [], roles: [] };
|
|
5469
|
-
|
|
5470
|
-
users:
|
|
5471
|
-
groups:
|
|
5472
|
-
roles:
|
|
5473
|
-
})),
|
|
5469
|
+
z[S.key] && (Array.isArray(z[S.key]) ? B = { users: [], groups: [], roles: [] } : typeof z[S.key] == "object" && (B = {
|
|
5470
|
+
users: z[S.key].users || [],
|
|
5471
|
+
groups: z[S.key].groups || [],
|
|
5472
|
+
roles: z[S.key].roles || []
|
|
5473
|
+
})), F[S.key] = B;
|
|
5474
5474
|
} else
|
|
5475
|
-
|
|
5476
|
-
}),
|
|
5475
|
+
F[S.key] = z[S.key] || S.default || "";
|
|
5476
|
+
}), F;
|
|
5477
5477
|
});
|
|
5478
5478
|
if (M.length === 0) {
|
|
5479
|
-
const
|
|
5480
|
-
y.fields && y.fields.forEach((
|
|
5481
|
-
|
|
5482
|
-
}), M.push(
|
|
5479
|
+
const z = { id: 0 };
|
|
5480
|
+
y.fields && y.fields.forEach((P) => {
|
|
5481
|
+
P.fieldtype === "audience" ? z[P.key] = { users: [], groups: [], roles: [] } : z[P.key] = P.default || "";
|
|
5482
|
+
}), M.push(z);
|
|
5483
5483
|
}
|
|
5484
5484
|
v[y.key] = M;
|
|
5485
5485
|
} else y.key && (v[y.key] = b[y.key] || {});
|
|
@@ -5514,7 +5514,7 @@ function zs({
|
|
|
5514
5514
|
x(!0);
|
|
5515
5515
|
let v = await _e($);
|
|
5516
5516
|
if (v) {
|
|
5517
|
-
const b =
|
|
5517
|
+
const b = O(v);
|
|
5518
5518
|
g(b);
|
|
5519
5519
|
} else
|
|
5520
5520
|
V();
|
|
@@ -5522,8 +5522,8 @@ function zs({
|
|
|
5522
5522
|
console.error("Error fetching configuration:", v);
|
|
5523
5523
|
let b = "Failed to load configuration";
|
|
5524
5524
|
if (v.response) {
|
|
5525
|
-
const y = v.response.status,
|
|
5526
|
-
y === 400 ? b =
|
|
5525
|
+
const y = v.response.status, D = v.response.data?.message || v.response.data?.error;
|
|
5526
|
+
y === 400 ? b = D || "Invalid request. Please check the application ID." : y === 401 ? b = "You are not authorized to access this configuration." : y === 403 ? b = "Access denied. You don't have permission to view this configuration." : y === 404 ? b = "Configuration not found. It may not exist yet or the application ID is incorrect." : y >= 500 ? b = D || "Server error. Please try again later." : b = D || `Failed to load configuration (Error ${y})`;
|
|
5527
5527
|
} else v.request ? b = "Network error. Please check your connection and try again." : b = v.message || "An unexpected error occurred while loading configuration.";
|
|
5528
5528
|
Ie.error(b), V();
|
|
5529
5529
|
} finally {
|
|
@@ -5531,7 +5531,7 @@ function zs({
|
|
|
5531
5531
|
}
|
|
5532
5532
|
};
|
|
5533
5533
|
a && (i(a), t ? k() : V());
|
|
5534
|
-
}, [a,
|
|
5534
|
+
}, [a, E, t, s]);
|
|
5535
5535
|
const U = (k, v) => {
|
|
5536
5536
|
g((b) => ({
|
|
5537
5537
|
...b,
|
|
@@ -5551,68 +5551,68 @@ function zs({
|
|
|
5551
5551
|
return;
|
|
5552
5552
|
}
|
|
5553
5553
|
if (b.fieldtype === "number" && y !== "" && y !== null && y !== void 0) {
|
|
5554
|
-
const
|
|
5555
|
-
isNaN(
|
|
5554
|
+
const D = Number(y);
|
|
5555
|
+
isNaN(D) ? (k[v.key] || (k[v.key] = {}), k[v.key][b.key] = `${b.label} must be a valid number`) : (b.min !== void 0 && D < b.min && (k[v.key] || (k[v.key] = {}), k[v.key][b.key] = `${b.label} must be at least ${b.min}`), b.max !== void 0 && D > b.max && (k[v.key] || (k[v.key] = {}), k[v.key][b.key] = `${b.label} must not exceed ${b.max}`));
|
|
5556
5556
|
}
|
|
5557
5557
|
});
|
|
5558
5558
|
else if (v.type === "datatable") {
|
|
5559
5559
|
const b = u[v.key];
|
|
5560
|
-
Array.isArray(b) && b.forEach((y,
|
|
5560
|
+
Array.isArray(b) && b.forEach((y, D) => {
|
|
5561
5561
|
v.fields.forEach((M) => {
|
|
5562
|
-
const
|
|
5563
|
-
if (M.required && (!
|
|
5564
|
-
k[v.key] || (k[v.key] = {}), k[v.key][
|
|
5562
|
+
const z = y[M.key];
|
|
5563
|
+
if (M.required && (!z || typeof z == "string" && z.trim() === "")) {
|
|
5564
|
+
k[v.key] || (k[v.key] = {}), k[v.key][D] || (k[v.key][D] = {}), k[v.key][D][M.key] = `${M.label} is required`;
|
|
5565
5565
|
return;
|
|
5566
5566
|
}
|
|
5567
|
-
if (M.fieldtype === "number" &&
|
|
5568
|
-
const
|
|
5569
|
-
isNaN(
|
|
5567
|
+
if (M.fieldtype === "number" && z !== "" && z !== null && z !== void 0) {
|
|
5568
|
+
const P = Number(z);
|
|
5569
|
+
isNaN(P) ? (k[v.key] || (k[v.key] = {}), k[v.key][D] || (k[v.key][D] = {}), k[v.key][D][M.key] = `${M.label} must be a valid number`) : (M.min !== void 0 && P < M.min && (k[v.key] || (k[v.key] = {}), k[v.key][D] || (k[v.key][D] = {}), k[v.key][D][M.key] = `${M.label} must be at least ${M.min}`), M.max !== void 0 && P > M.max && (k[v.key] || (k[v.key] = {}), k[v.key][D] || (k[v.key][D] = {}), k[v.key][D][M.key] = `${M.label} must not exceed ${M.max}`));
|
|
5570
5570
|
}
|
|
5571
5571
|
});
|
|
5572
5572
|
});
|
|
5573
5573
|
}
|
|
5574
5574
|
}), k;
|
|
5575
|
-
}, q = (k) => Object.keys(k).length > 0,
|
|
5575
|
+
}, q = (k) => Object.keys(k).length > 0, C = async (k) => {
|
|
5576
5576
|
const v = a?.configuration?.filter(
|
|
5577
5577
|
(b) => b.fields?.some((y) => y.fieldtype === "managecollectionlist")
|
|
5578
5578
|
) || [];
|
|
5579
5579
|
for (const b of v) {
|
|
5580
|
-
const y = b.fields.find((
|
|
5580
|
+
const y = b.fields.find((F) => F.fieldtype === "managecollectionlist");
|
|
5581
5581
|
if (!y || !k[b.key]) continue;
|
|
5582
|
-
const
|
|
5583
|
-
if (!Array.isArray(
|
|
5582
|
+
const D = k[b.key][y.key];
|
|
5583
|
+
if (!Array.isArray(D)) continue;
|
|
5584
5584
|
const M = y.endpoints || {};
|
|
5585
|
-
let
|
|
5586
|
-
for (const
|
|
5585
|
+
let z = 0, P = 0;
|
|
5586
|
+
for (const F of D)
|
|
5587
5587
|
try {
|
|
5588
|
-
if (
|
|
5589
|
-
console.log("Creating new collection:",
|
|
5590
|
-
const
|
|
5591
|
-
categoryName:
|
|
5592
|
-
order:
|
|
5588
|
+
if (F._temp && F._isDraft) {
|
|
5589
|
+
console.log("Creating new collection:", F.categoryName);
|
|
5590
|
+
const S = await Le(M.collectionCreate, {
|
|
5591
|
+
categoryName: F.categoryName,
|
|
5592
|
+
order: F.order
|
|
5593
5593
|
});
|
|
5594
|
-
|
|
5595
|
-
} else if (
|
|
5596
|
-
console.log("Updating collection:",
|
|
5597
|
-
const
|
|
5598
|
-
|
|
5594
|
+
S && (console.log("Collection created successfully:", S), z++);
|
|
5595
|
+
} else if (F._isDraft && !F._temp) {
|
|
5596
|
+
console.log("Updating collection:", F.id, F.categoryName);
|
|
5597
|
+
const S = await Qn(`${M.collectionUpdate}/${F.id}?newName=${encodeURIComponent(F.categoryName)}`);
|
|
5598
|
+
S && (console.log("Collection updated successfully:", S), P++);
|
|
5599
5599
|
}
|
|
5600
|
-
} catch (
|
|
5601
|
-
throw console.error(`Failed to save collection ${
|
|
5600
|
+
} catch (S) {
|
|
5601
|
+
throw console.error(`Failed to save collection ${F.categoryName}:`, S), new Error(`Failed to save collection "${F.categoryName}": ${S.message}`);
|
|
5602
5602
|
}
|
|
5603
|
-
if (
|
|
5604
|
-
const
|
|
5605
|
-
|
|
5603
|
+
if (z > 0 || P > 0) {
|
|
5604
|
+
const F = [];
|
|
5605
|
+
z > 0 && F.push(`${z} collection${z > 1 ? "s" : ""} created`), P > 0 && F.push(`${P} collection${P > 1 ? "s" : ""} updated`), console.log("ManageCollectionList operations completed:", F.join(", "));
|
|
5606
5606
|
}
|
|
5607
5607
|
try {
|
|
5608
|
-
const
|
|
5609
|
-
id:
|
|
5610
|
-
order:
|
|
5611
|
-
categoryName:
|
|
5608
|
+
const F = D.filter((S) => !S._temp).map((S) => ({
|
|
5609
|
+
id: S.id,
|
|
5610
|
+
order: S.order,
|
|
5611
|
+
categoryName: S.categoryName
|
|
5612
5612
|
}));
|
|
5613
|
-
|
|
5614
|
-
} catch (
|
|
5615
|
-
throw console.error("Failed to update collection order:",
|
|
5613
|
+
F.length > 0 && (console.log("Updating collection order:", F), await Le(M.updateCollection, F), console.log("Collection order updated successfully"));
|
|
5614
|
+
} catch (F) {
|
|
5615
|
+
throw console.error("Failed to update collection order:", F), new Error(`Failed to update collection order: ${F.message}`);
|
|
5616
5616
|
}
|
|
5617
5617
|
}
|
|
5618
5618
|
}, h = () => {
|
|
@@ -5620,10 +5620,10 @@ function zs({
|
|
|
5620
5620
|
if (p(k), q(k)) {
|
|
5621
5621
|
let b = [];
|
|
5622
5622
|
Object.keys(k).forEach((y) => {
|
|
5623
|
-
typeof k[y] == "object" && Object.keys(k[y]).forEach((
|
|
5624
|
-
typeof k[y][
|
|
5625
|
-
b.push(`${y} row ${parseInt(
|
|
5626
|
-
}) : b.push(`${y}: ${k[y][
|
|
5623
|
+
typeof k[y] == "object" && Object.keys(k[y]).forEach((D) => {
|
|
5624
|
+
typeof k[y][D] == "object" ? Object.keys(k[y][D]).forEach((M) => {
|
|
5625
|
+
b.push(`${y} row ${parseInt(D) + 1}: ${k[y][D][M]}`);
|
|
5626
|
+
}) : b.push(`${y}: ${k[y][D]}`);
|
|
5627
5627
|
});
|
|
5628
5628
|
});
|
|
5629
5629
|
return;
|
|
@@ -5632,32 +5632,30 @@ function zs({
|
|
|
5632
5632
|
try {
|
|
5633
5633
|
N(!0);
|
|
5634
5634
|
const b = {};
|
|
5635
|
-
u && (await
|
|
5635
|
+
u && (await C(u), Object.keys(u).forEach((D) => {
|
|
5636
5636
|
const M = a?.configuration?.find(
|
|
5637
|
-
(
|
|
5637
|
+
(z) => z.key === D && z.type === "datatable"
|
|
5638
5638
|
);
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
roles: F[C.key].roles || []
|
|
5650
|
-
}), E[C.key] = B;
|
|
5639
|
+
M && Array.isArray(u[D]) ? b[D] = u[D].map((z) => {
|
|
5640
|
+
const P = { id: z.id || 0 };
|
|
5641
|
+
return M.fields && M.fields.forEach((F) => {
|
|
5642
|
+
if (F.fieldtype === "audience") {
|
|
5643
|
+
let S = { users: [], groups: [], roles: [] };
|
|
5644
|
+
z[F.key] && typeof z[F.key] == "object" && !Array.isArray(z[F.key]) && (S = {
|
|
5645
|
+
users: z[F.key].users || [],
|
|
5646
|
+
groups: z[F.key].groups || [],
|
|
5647
|
+
roles: z[F.key].roles || []
|
|
5648
|
+
}), P[F.key] = S;
|
|
5651
5649
|
} else
|
|
5652
|
-
|
|
5653
|
-
}),
|
|
5654
|
-
}) : b[
|
|
5650
|
+
P[F.key] = z[F.key] || "";
|
|
5651
|
+
}), P;
|
|
5652
|
+
}) : b[D] = u[D];
|
|
5655
5653
|
}));
|
|
5656
5654
|
let y = await Le(A, b);
|
|
5657
5655
|
if (console.log(), y && y.status != "fail") {
|
|
5658
5656
|
p({});
|
|
5659
|
-
const
|
|
5660
|
-
Ie.success(
|
|
5657
|
+
const D = y.message || "Configuration has been saved successfully";
|
|
5658
|
+
Ie.success(D), l && typeof l == "function" && l(u);
|
|
5661
5659
|
} else
|
|
5662
5660
|
throw Ie.error(y?.message || "Failed to save configuration"), new Error("No response received from server");
|
|
5663
5661
|
} catch (b) {
|
|
@@ -5673,7 +5671,7 @@ function zs({
|
|
|
5673
5671
|
}
|
|
5674
5672
|
d && Object.keys(d).length > 0 && !window.confirm(
|
|
5675
5673
|
"You have validation errors that will be lost. Are you sure you want to cancel?"
|
|
5676
|
-
) || (p({}), g(null),
|
|
5674
|
+
) || (p({}), g(null), R((v) => v + 1), Ie.info("Configuration changes cancelled"));
|
|
5677
5675
|
};
|
|
5678
5676
|
if (!m?.configuration && !a?.configuration)
|
|
5679
5677
|
return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-gray-500", children: "No configuration available" }) });
|
|
@@ -5739,9 +5737,9 @@ const Ql = ({
|
|
|
5739
5737
|
breadcrumb: f = [],
|
|
5740
5738
|
overview: x = {},
|
|
5741
5739
|
configuration: r = []
|
|
5742
|
-
} = t, N = r.map((
|
|
5743
|
-
if (
|
|
5744
|
-
const h = [...
|
|
5740
|
+
} = t, N = r.map((C) => {
|
|
5741
|
+
if (C.type === "section" && C.fields) {
|
|
5742
|
+
const h = [...C.fields], w = h.findIndex((T) => T.key === "appkey");
|
|
5745
5743
|
if (w !== -1) {
|
|
5746
5744
|
const T = h[w];
|
|
5747
5745
|
if (h[w] = {
|
|
@@ -5771,29 +5769,29 @@ const Ql = ({
|
|
|
5771
5769
|
}
|
|
5772
5770
|
}
|
|
5773
5771
|
return {
|
|
5774
|
-
...
|
|
5772
|
+
...C,
|
|
5775
5773
|
fields: h
|
|
5776
5774
|
};
|
|
5777
5775
|
}
|
|
5778
|
-
return
|
|
5776
|
+
return C;
|
|
5779
5777
|
}), d = {
|
|
5780
5778
|
heading: "App Details",
|
|
5781
5779
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
5782
5780
|
isLeftArrow: !0,
|
|
5783
5781
|
onBackClick: () => window.history.back(),
|
|
5784
5782
|
...u
|
|
5785
|
-
}, p = f.map((
|
|
5786
|
-
label:
|
|
5787
|
-
href:
|
|
5783
|
+
}, p = f.map((C) => ({
|
|
5784
|
+
label: C.text,
|
|
5785
|
+
href: C.href || "#"
|
|
5788
5786
|
})), $ = ae(() => {
|
|
5789
5787
|
console.log("handleCancelRequest called - showing modal"), i(!0);
|
|
5790
|
-
}, []), A = ae((
|
|
5791
|
-
i(!1),
|
|
5792
|
-
}, []),
|
|
5793
|
-
console.log("Configuration changed:",
|
|
5794
|
-
}, []),
|
|
5788
|
+
}, []), A = ae((C) => {
|
|
5789
|
+
i(!1), C.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
|
|
5790
|
+
}, []), E = ae((C) => {
|
|
5791
|
+
console.log("Configuration changed:", C);
|
|
5792
|
+
}, []), R = (() => {
|
|
5795
5793
|
if (g.headingKey && Array.isArray(r)) {
|
|
5796
|
-
const
|
|
5794
|
+
const C = g.headingKey.split("."), h = C[0], w = C[1], T = r.find((k) => k && k.key === h);
|
|
5797
5795
|
if (T && T.fields) {
|
|
5798
5796
|
const k = T.fields.find((v) => v && v.key === w);
|
|
5799
5797
|
if (k)
|
|
@@ -5801,18 +5799,18 @@ const Ql = ({
|
|
|
5801
5799
|
}
|
|
5802
5800
|
}
|
|
5803
5801
|
if (Array.isArray(r)) {
|
|
5804
|
-
for (const
|
|
5805
|
-
if (
|
|
5806
|
-
const h =
|
|
5802
|
+
for (const C of r)
|
|
5803
|
+
if (C && C.fields) {
|
|
5804
|
+
const h = C.fields.find((w) => w && w.key === "displayname");
|
|
5807
5805
|
if (h) return h.default ?? h.value ?? a;
|
|
5808
5806
|
}
|
|
5809
5807
|
}
|
|
5810
5808
|
return g.heading || a;
|
|
5811
|
-
})(),
|
|
5809
|
+
})(), O = {
|
|
5812
5810
|
subHeading: "Application configuration and details",
|
|
5813
5811
|
tags: [],
|
|
5814
5812
|
...g,
|
|
5815
|
-
heading:
|
|
5813
|
+
heading: R
|
|
5816
5814
|
// Use resolvedDisplayName only
|
|
5817
5815
|
}, V = {
|
|
5818
5816
|
about: "This application provides comprehensive functionality for your organization.",
|
|
@@ -5834,22 +5832,22 @@ const Ql = ({
|
|
|
5834
5832
|
...x
|
|
5835
5833
|
}, U = [
|
|
5836
5834
|
{ label: "Overview", content: q(V) },
|
|
5837
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(zs, { appid: a, configdata: { configuration: N }, disableApi: s, onCancel: $, onSave:
|
|
5835
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(zs, { appid: a, configdata: { configuration: N }, disableApi: s, onCancel: $, onSave: E }) }
|
|
5838
5836
|
];
|
|
5839
|
-
function Y(
|
|
5840
|
-
return
|
|
5837
|
+
function Y(C) {
|
|
5838
|
+
return C ? C.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: C } }) : C : "📱";
|
|
5841
5839
|
}
|
|
5842
|
-
function q(
|
|
5840
|
+
function q(C) {
|
|
5843
5841
|
return /* @__PURE__ */ n("div", { className: "bg-white rounded-2xl p-1", children: [
|
|
5844
5842
|
/* @__PURE__ */ n("section", { className: "mb-8", children: [
|
|
5845
5843
|
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
|
|
5846
|
-
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children:
|
|
5844
|
+
/* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children: C.about })
|
|
5847
5845
|
] }),
|
|
5848
5846
|
/* @__PURE__ */ n("section", { className: "flex flex-row gap-6 justify-center items-center mb-8", children: [
|
|
5849
5847
|
/* @__PURE__ */ e(
|
|
5850
5848
|
"img",
|
|
5851
5849
|
{
|
|
5852
|
-
src:
|
|
5850
|
+
src: C.images.desktop,
|
|
5853
5851
|
alt: "Desktop View",
|
|
5854
5852
|
className: "rounded-xl border border-gray-200 w-[340px] h-[220px] object-cover"
|
|
5855
5853
|
}
|
|
@@ -5857,7 +5855,7 @@ const Ql = ({
|
|
|
5857
5855
|
/* @__PURE__ */ e(
|
|
5858
5856
|
"img",
|
|
5859
5857
|
{
|
|
5860
|
-
src:
|
|
5858
|
+
src: C.images.mobile1,
|
|
5861
5859
|
alt: "Mobile View 1",
|
|
5862
5860
|
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
5863
5861
|
}
|
|
@@ -5865,7 +5863,7 @@ const Ql = ({
|
|
|
5865
5863
|
/* @__PURE__ */ e(
|
|
5866
5864
|
"img",
|
|
5867
5865
|
{
|
|
5868
|
-
src:
|
|
5866
|
+
src: C.images.mobile2,
|
|
5869
5867
|
alt: "Mobile View 2",
|
|
5870
5868
|
className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
|
|
5871
5869
|
}
|
|
@@ -5873,7 +5871,7 @@ const Ql = ({
|
|
|
5873
5871
|
] }),
|
|
5874
5872
|
/* @__PURE__ */ n("section", { children: [
|
|
5875
5873
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
|
|
5876
|
-
/* @__PURE__ */ e("ul", { className: "space-y-3", children:
|
|
5874
|
+
/* @__PURE__ */ e("ul", { className: "space-y-3", children: C.features.map((h, w) => /* @__PURE__ */ n("li", { children: [
|
|
5877
5875
|
/* @__PURE__ */ e("span", { className: "font-semibold", children: h.title }),
|
|
5878
5876
|
/* @__PURE__ */ e("br", {}),
|
|
5879
5877
|
/* @__PURE__ */ e("span", { className: "text-gray-700", children: h.description })
|
|
@@ -5893,27 +5891,27 @@ const Ql = ({
|
|
|
5893
5891
|
}
|
|
5894
5892
|
),
|
|
5895
5893
|
/* @__PURE__ */ n("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
|
|
5896
|
-
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: Y(
|
|
5894
|
+
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: Y(O.icon) }),
|
|
5897
5895
|
/* @__PURE__ */ n("div", { className: "flex flex-col min-w-0", children: [
|
|
5898
|
-
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children:
|
|
5899
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children:
|
|
5900
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children:
|
|
5896
|
+
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: O.heading }),
|
|
5897
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: O.subHeading }),
|
|
5898
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: O.tags && O.tags.map((C, h) => /* @__PURE__ */ e(
|
|
5901
5899
|
"span",
|
|
5902
5900
|
{
|
|
5903
5901
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
5904
|
-
children:
|
|
5902
|
+
children: C
|
|
5905
5903
|
},
|
|
5906
5904
|
h
|
|
5907
5905
|
)) })
|
|
5908
5906
|
] })
|
|
5909
5907
|
] }),
|
|
5910
5908
|
/* @__PURE__ */ n("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
|
|
5911
|
-
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: U.map((
|
|
5909
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: U.map((C, h) => /* @__PURE__ */ e(
|
|
5912
5910
|
"button",
|
|
5913
5911
|
{
|
|
5914
5912
|
onClick: () => l(h),
|
|
5915
5913
|
className: `${o === h ? "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`,
|
|
5916
|
-
children:
|
|
5914
|
+
children: C.label
|
|
5917
5915
|
},
|
|
5918
5916
|
h
|
|
5919
5917
|
)) }) }),
|
|
@@ -5981,15 +5979,15 @@ const Kl = ({
|
|
|
5981
5979
|
showAdd: $ = !1,
|
|
5982
5980
|
// Additional props
|
|
5983
5981
|
searchPlaceholder: A = "Search...",
|
|
5984
|
-
handleRefreshClick:
|
|
5982
|
+
handleRefreshClick: E = () => {
|
|
5985
5983
|
},
|
|
5986
|
-
handleSearchChange:
|
|
5984
|
+
handleSearchChange: R = () => {
|
|
5987
5985
|
},
|
|
5988
5986
|
// Optional: override export file names
|
|
5989
|
-
excelFileName:
|
|
5987
|
+
excelFileName: O,
|
|
5990
5988
|
pdfFileName: V
|
|
5991
5989
|
}) => {
|
|
5992
|
-
const U = () => l?.current || o?.current, [Y, q] = se.useState(""),
|
|
5990
|
+
const U = () => l?.current || o?.current, [Y, q] = se.useState(""), C = (t || "export").toString().trim() || "export", h = `${O || C}.xlsx`, w = `${V || C}.pdf`, T = (b, y, D) => Math.max(y, Math.min(b, D)), k = ae(
|
|
5993
5991
|
(b) => {
|
|
5994
5992
|
const y = U();
|
|
5995
5993
|
if (console.log("openColumnChooserNear", y), !!y?.openColumnChooser) {
|
|
@@ -5998,12 +5996,12 @@ const Kl = ({
|
|
|
5998
5996
|
return;
|
|
5999
5997
|
}
|
|
6000
5998
|
try {
|
|
6001
|
-
const
|
|
6002
|
-
let
|
|
6003
|
-
const
|
|
6004
|
-
|
|
6005
|
-
} catch (
|
|
6006
|
-
console.log("coloumn choose error",
|
|
5999
|
+
const D = b.currentTarget.getBoundingClientRect(), M = D.left + window.scrollX, z = D.bottom + window.scrollY;
|
|
6000
|
+
let P = M - 120, F = z - 120;
|
|
6001
|
+
const S = window.innerWidth, B = window.innerHeight;
|
|
6002
|
+
P = T(P, window.scrollX + 8, window.scrollX + S - 340), F = T(F, window.scrollY, window.scrollY + B - 120), console.log("openColumnChooserNear", P, F), y.openColumnChooser(P, F);
|
|
6003
|
+
} catch (D) {
|
|
6004
|
+
console.log("coloumn choose error", D);
|
|
6007
6005
|
}
|
|
6008
6006
|
}
|
|
6009
6007
|
},
|
|
@@ -6011,27 +6009,27 @@ const Kl = ({
|
|
|
6011
6009
|
// no external deps; reads ref at call time
|
|
6012
6010
|
), v = ae(
|
|
6013
6011
|
(b, y) => {
|
|
6014
|
-
const
|
|
6015
|
-
if (
|
|
6012
|
+
const D = U();
|
|
6013
|
+
if (D)
|
|
6016
6014
|
switch (b) {
|
|
6017
6015
|
case "ColumnChooser":
|
|
6018
|
-
f && (console.log("openColumnChooser", y), y ? k(y) :
|
|
6016
|
+
f && (console.log("openColumnChooser", y), y ? k(y) : D.openColumnChooser?.()), console.log("openColumnChooser out", y);
|
|
6019
6017
|
break;
|
|
6020
6018
|
case "Print":
|
|
6021
|
-
r &&
|
|
6019
|
+
r && D.print?.();
|
|
6022
6020
|
break;
|
|
6023
6021
|
case "Excel":
|
|
6024
|
-
N &&
|
|
6022
|
+
N && D.excelExport?.({ fileName: h });
|
|
6025
6023
|
break;
|
|
6026
6024
|
case "Pdf":
|
|
6027
|
-
d &&
|
|
6025
|
+
d && D.pdfExport?.({ fileName: w });
|
|
6028
6026
|
break;
|
|
6029
6027
|
case "Refresh":
|
|
6030
|
-
p &&
|
|
6028
|
+
p && E();
|
|
6031
6029
|
break;
|
|
6032
6030
|
}
|
|
6033
6031
|
},
|
|
6034
|
-
[f, r, N, d, p, h, w,
|
|
6032
|
+
[f, r, N, d, p, h, w, E, k]
|
|
6035
6033
|
);
|
|
6036
6034
|
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: [
|
|
6037
6035
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
@@ -6049,7 +6047,7 @@ const Kl = ({
|
|
|
6049
6047
|
placeholder: A,
|
|
6050
6048
|
value: Y,
|
|
6051
6049
|
onDebouncedChange: (b) => {
|
|
6052
|
-
q(b),
|
|
6050
|
+
q(b), R(b);
|
|
6053
6051
|
}
|
|
6054
6052
|
}
|
|
6055
6053
|
) }),
|
|
@@ -6157,19 +6155,19 @@ function eo(t) {
|
|
|
6157
6155
|
enableSearchApi: p = !1,
|
|
6158
6156
|
height: $ = "600",
|
|
6159
6157
|
selectionSettings: A = { type: "Multiple", mode: "Row" },
|
|
6160
|
-
enableCheckbox:
|
|
6161
|
-
columns:
|
|
6162
|
-
onGridStateChange:
|
|
6158
|
+
enableCheckbox: E = !1,
|
|
6159
|
+
columns: R = [],
|
|
6160
|
+
onGridStateChange: O,
|
|
6163
6161
|
onRowSelected: V,
|
|
6164
6162
|
onRowDeselected: U,
|
|
6165
6163
|
onRowDoubleClick: Y,
|
|
6166
6164
|
apiRef: q,
|
|
6167
|
-
gridProps:
|
|
6165
|
+
gridProps: C = {}
|
|
6168
6166
|
} = t, h = ge(null), {
|
|
6169
6167
|
pageSettings: w,
|
|
6170
6168
|
sortSettings: T,
|
|
6171
6169
|
...k
|
|
6172
|
-
} =
|
|
6170
|
+
} = C || {}, [v, b] = se.useState(w?.page || 1), [y, D] = se.useState(T?.pageSize || 20), [M, z] = se.useState(T?.sortKey || "updatedDate"), [P, F] = se.useState(T?.direction || "Descending"), S = me(() => {
|
|
6173
6171
|
const j = [sn];
|
|
6174
6172
|
return i && j.push(ln), u && j.push(on), g && j.push(cn), p && j.push(dn), r && j.push(mn), N && j.push(un), d && j.push(hn), x && j.push(pn), f && j.push(gn), j.push(bn), j;
|
|
6175
6173
|
}, [i, u, g, p, r, N, d, x, f]), B = me(() => {
|
|
@@ -6223,12 +6221,12 @@ function eo(t) {
|
|
|
6223
6221
|
}, G = (j) => {
|
|
6224
6222
|
setTimeout(() => {
|
|
6225
6223
|
h?.current?.hideSpinner();
|
|
6226
|
-
}, 1e3), j.requestType === "paging" && (b(j.currentPage),
|
|
6224
|
+
}, 1e3), j.requestType === "paging" && (b(j.currentPage), D(j.pageSize)), j.requestType === "sorting" && (z(j.columnName || "updatedDate"), F(j.direction === "Ascending" ? "ASC" : "DESC")), O && O(I(j), j);
|
|
6227
6225
|
}, X = (j) => {
|
|
6228
6226
|
typeof Y == "function" && Y(j?.rowData, j);
|
|
6229
6227
|
}, xe = () => {
|
|
6230
6228
|
const j = [];
|
|
6231
|
-
return
|
|
6229
|
+
return E && j.push(/* @__PURE__ */ e(St, { type: "checkbox", width: "50" }, "__checkbox__")), R.forEach((re, W) => {
|
|
6232
6230
|
const {
|
|
6233
6231
|
field: ve,
|
|
6234
6232
|
headerText: Re,
|
|
@@ -6293,7 +6291,7 @@ function eo(t) {
|
|
|
6293
6291
|
selectionSettings: A,
|
|
6294
6292
|
pageSettings: { pageSize: 10, pageSizes: w?.pageSizes ?? [20, 40, 60, 80, 100] },
|
|
6295
6293
|
sortSettings: T ?? {
|
|
6296
|
-
columns: [{ field: M, direction: _(
|
|
6294
|
+
columns: [{ field: M, direction: _(P) }],
|
|
6297
6295
|
allowUnsort: !1
|
|
6298
6296
|
},
|
|
6299
6297
|
actionBegin: G,
|
|
@@ -6303,7 +6301,7 @@ function eo(t) {
|
|
|
6303
6301
|
...k,
|
|
6304
6302
|
children: [
|
|
6305
6303
|
/* @__PURE__ */ e(yn, { children: xe() }),
|
|
6306
|
-
/* @__PURE__ */ e(xn, { services:
|
|
6304
|
+
/* @__PURE__ */ e(xn, { services: S })
|
|
6307
6305
|
]
|
|
6308
6306
|
}
|
|
6309
6307
|
);
|
|
@@ -6854,7 +6852,7 @@ function js({
|
|
|
6854
6852
|
/* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-full bg-white/90 border border-zinc-300 flex items-center justify-center", children: "›" })
|
|
6855
6853
|
] })
|
|
6856
6854
|
] }),
|
|
6857
|
-
/* @__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 ${$.chipGap} overflow-x-auto scrollbar-none`, children: u.map((
|
|
6855
|
+
/* @__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 ${$.chipGap} overflow-x-auto scrollbar-none`, children: u.map((E) => /* @__PURE__ */ e(Ls, { label: E, active: E === g, size: d }, E)) }) }),
|
|
6858
6856
|
/* @__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 ${$.searchH}`, children: [
|
|
6859
6857
|
/* @__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" }) }),
|
|
6860
6858
|
/* @__PURE__ */ e("span", { className: "ml-2 text-zinc-500 dark:text-zinc-400", children: "Search places" })
|
|
@@ -7026,8 +7024,8 @@ function Gs({
|
|
|
7026
7024
|
selectedIndex: u = 0,
|
|
7027
7025
|
...g
|
|
7028
7026
|
}) {
|
|
7029
|
-
const [f, x] = L(u), r = ie(t), N = ce[r], d = _s[r], p = i[f] || i[0], $ = (
|
|
7030
|
-
x(
|
|
7027
|
+
const [f, x] = L(u), r = ie(t), N = ce[r], d = _s[r], p = i[f] || i[0], $ = (E, R) => {
|
|
7028
|
+
x(R), o?.(E);
|
|
7031
7029
|
}, A = r === "lg";
|
|
7032
7030
|
return /* @__PURE__ */ n(
|
|
7033
7031
|
oe,
|
|
@@ -7047,29 +7045,29 @@ function Gs({
|
|
|
7047
7045
|
A ? (
|
|
7048
7046
|
// Large: Two-column layout
|
|
7049
7047
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
7050
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: i.map((
|
|
7048
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: i.map((E, R) => /* @__PURE__ */ e(
|
|
7051
7049
|
jt,
|
|
7052
7050
|
{
|
|
7053
|
-
ev:
|
|
7051
|
+
ev: E,
|
|
7054
7052
|
sizeMeta: d,
|
|
7055
|
-
isSelected:
|
|
7056
|
-
onClick: (
|
|
7053
|
+
isSelected: R === f,
|
|
7054
|
+
onClick: (O) => $(O, R)
|
|
7057
7055
|
},
|
|
7058
|
-
|
|
7056
|
+
E._id || E.id || R
|
|
7059
7057
|
)) }),
|
|
7060
7058
|
/* @__PURE__ */ e(qs, { ev: p, sizeMeta: d })
|
|
7061
7059
|
] })
|
|
7062
7060
|
) : (
|
|
7063
7061
|
// Small/Medium: Simple list only
|
|
7064
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: i.map((
|
|
7062
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: i.map((E, R) => /* @__PURE__ */ e(
|
|
7065
7063
|
jt,
|
|
7066
7064
|
{
|
|
7067
|
-
ev:
|
|
7065
|
+
ev: E,
|
|
7068
7066
|
sizeMeta: d,
|
|
7069
|
-
isSelected:
|
|
7070
|
-
onClick: (
|
|
7067
|
+
isSelected: R === f,
|
|
7068
|
+
onClick: (O) => $(O, R)
|
|
7071
7069
|
},
|
|
7072
|
-
|
|
7070
|
+
E._id || E.id || R
|
|
7073
7071
|
)) })
|
|
7074
7072
|
),
|
|
7075
7073
|
!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" }) })
|
|
@@ -7243,13 +7241,13 @@ function Xs({
|
|
|
7243
7241
|
onPin: f,
|
|
7244
7242
|
...x
|
|
7245
7243
|
}) {
|
|
7246
|
-
const [r, N] = L(u), d = ie(t), p = ce[d], $ = Ws[d], A = (
|
|
7247
|
-
N(V), o?.(
|
|
7248
|
-
},
|
|
7249
|
-
const V = { ...
|
|
7244
|
+
const [r, N] = L(u), d = ie(t), p = ce[d], $ = Ws[d], A = (O, V) => {
|
|
7245
|
+
N(V), o?.(O);
|
|
7246
|
+
}, E = (O) => {
|
|
7247
|
+
const V = { ...O, starred: !O.starred };
|
|
7250
7248
|
g?.(V);
|
|
7251
|
-
},
|
|
7252
|
-
const V = { ...
|
|
7249
|
+
}, R = (O) => {
|
|
7250
|
+
const V = { ...O, pinned: !O.pinned };
|
|
7253
7251
|
f?.(V);
|
|
7254
7252
|
};
|
|
7255
7253
|
return /* @__PURE__ */ n(
|
|
@@ -7265,17 +7263,17 @@ function Xs({
|
|
|
7265
7263
|
children: [
|
|
7266
7264
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${p.title}`, children: m }) }),
|
|
7267
7265
|
/* @__PURE__ */ e(he, { placeholder: "Type to search..." }),
|
|
7268
|
-
/* @__PURE__ */ e("div", { className: "space-y-0", children: i.map((
|
|
7266
|
+
/* @__PURE__ */ e("div", { className: "space-y-0", children: i.map((O, V) => /* @__PURE__ */ e(
|
|
7269
7267
|
Js,
|
|
7270
7268
|
{
|
|
7271
|
-
email:
|
|
7269
|
+
email: O,
|
|
7272
7270
|
sizeMeta: $,
|
|
7273
7271
|
isSelected: V === r,
|
|
7274
7272
|
onClick: (U) => A(U, V),
|
|
7275
|
-
onStar:
|
|
7276
|
-
onPin:
|
|
7273
|
+
onStar: E,
|
|
7274
|
+
onPin: R
|
|
7277
7275
|
},
|
|
7278
|
-
|
|
7276
|
+
O._id || O.id || V
|
|
7279
7277
|
)) }),
|
|
7280
7278
|
/* @__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" }) })
|
|
7281
7279
|
]
|
|
@@ -7495,8 +7493,8 @@ function el({
|
|
|
7495
7493
|
selectedIndex: u = 0,
|
|
7496
7494
|
...g
|
|
7497
7495
|
}) {
|
|
7498
|
-
const [f, x] = L(u), r = ie(t), N = ce[r], d = Qs[r], p = (
|
|
7499
|
-
x(
|
|
7496
|
+
const [f, x] = L(u), r = ie(t), N = ce[r], d = Qs[r], p = (E, R) => {
|
|
7497
|
+
x(R), o?.(E);
|
|
7500
7498
|
}, $ = i[f] || i[0], A = d.layout === "split";
|
|
7501
7499
|
return /* @__PURE__ */ n(
|
|
7502
7500
|
oe,
|
|
@@ -7512,15 +7510,15 @@ function el({
|
|
|
7512
7510
|
/* @__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 ${N.title}`, children: m }) }),
|
|
7513
7511
|
/* @__PURE__ */ e(Ks, { sizeMeta: d }),
|
|
7514
7512
|
A ? /* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0", children: [
|
|
7515
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: i.map((
|
|
7513
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: i.map((E, R) => /* @__PURE__ */ e(
|
|
7516
7514
|
Vt,
|
|
7517
7515
|
{
|
|
7518
|
-
contact:
|
|
7516
|
+
contact: E,
|
|
7519
7517
|
sizeMeta: d,
|
|
7520
|
-
isSelected:
|
|
7521
|
-
onClick: (
|
|
7518
|
+
isSelected: R === f,
|
|
7519
|
+
onClick: (O) => p(O, R)
|
|
7522
7520
|
},
|
|
7523
|
-
|
|
7521
|
+
E._id || E.id || R
|
|
7524
7522
|
)) }),
|
|
7525
7523
|
/* @__PURE__ */ e(
|
|
7526
7524
|
Zs,
|
|
@@ -7531,15 +7529,15 @@ function el({
|
|
|
7531
7529
|
)
|
|
7532
7530
|
] }) : (
|
|
7533
7531
|
// Single column layout for small screens
|
|
7534
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: i.map((
|
|
7532
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: i.map((E, R) => /* @__PURE__ */ e(
|
|
7535
7533
|
Vt,
|
|
7536
7534
|
{
|
|
7537
|
-
contact:
|
|
7535
|
+
contact: E,
|
|
7538
7536
|
sizeMeta: d,
|
|
7539
|
-
isSelected:
|
|
7540
|
-
onClick: (
|
|
7537
|
+
isSelected: R === f,
|
|
7538
|
+
onClick: (O) => p(O, R)
|
|
7541
7539
|
},
|
|
7542
|
-
|
|
7540
|
+
E._id || E.id || R
|
|
7543
7541
|
)) })
|
|
7544
7542
|
),
|
|
7545
7543
|
/* @__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" }) })
|
|
@@ -8257,9 +8255,9 @@ function gl({
|
|
|
8257
8255
|
showBanner: u = !0,
|
|
8258
8256
|
...g
|
|
8259
8257
|
}) {
|
|
8260
|
-
const [f, x] = L(i), r = ie(t), N = ce[r], d = ml[r], p = (
|
|
8261
|
-
x((
|
|
8262
|
-
}, $ = f.find((
|
|
8258
|
+
const [f, x] = L(i), r = ie(t), N = ce[r], d = ml[r], p = (E) => {
|
|
8259
|
+
x((R) => R.filter((O) => O.id !== E.id));
|
|
8260
|
+
}, $ = f.find((E) => E.type === "banner"), A = f.filter((E) => E.type !== "banner");
|
|
8263
8261
|
return /* @__PURE__ */ n(
|
|
8264
8262
|
oe,
|
|
8265
8263
|
{
|
|
@@ -8279,14 +8277,14 @@ function gl({
|
|
|
8279
8277
|
onDismiss: p
|
|
8280
8278
|
}
|
|
8281
8279
|
),
|
|
8282
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: A.slice(0, 3).map((
|
|
8280
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: A.slice(0, 3).map((E) => /* @__PURE__ */ e(
|
|
8283
8281
|
hl,
|
|
8284
8282
|
{
|
|
8285
|
-
alert:
|
|
8283
|
+
alert: E,
|
|
8286
8284
|
sizeMeta: d,
|
|
8287
8285
|
onDismiss: p
|
|
8288
8286
|
},
|
|
8289
|
-
|
|
8287
|
+
E.id
|
|
8290
8288
|
)) }),
|
|
8291
8289
|
/* @__PURE__ */ e("button", { className: "w-full py-3 px-4 border border-zinc-300 dark:border-zinc-600 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 font-medium rounded-lg transition-colors duration-200", children: "View All" })
|
|
8292
8290
|
]
|