@firecms/collection_editor 3.0.0-alpha.81 → 3.0.0-alpha.82
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/index.es.js +211 -223
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/ConfigControllerProvider.tsx +8 -2
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +5 -5
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +2 -2
- package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +2 -2
- package/src/ui/collection_editor/PropertyFieldPreview.tsx +3 -4
- package/src/ui/collection_editor/SubcollectionsEditTab.tsx +2 -2
- package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +5 -22
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { SearchIconsView as br, toSnakeCase as wt, singular as Cr, IconForView as pt, FormikArrayContainer as xr, SwitchControl as he, serializeRegExp as Pr, isValidRegExp as Nr, useSnackbarController as De, resolveEnumValues as wr, isPropertyBuilder as re, useCustomizationController as Le, getFieldConfig as Qe, ErrorBoundary as we, FieldConfigBadge as We, unslugify as vt, useNavigationController as Me, mergeDeep as Z, DEFAULT_FIELD_CONFIGS as Jt, getFieldId as Qt, DeleteConfirmationDialog as mt, useLargeLayout as Tr, makePropertiesEditable as Xe, resolveEntityView as Or, useSelectionController as kr, EntityCollectionTable as Vr, slugify as Fr, useAuthController as qe, randomString as Et, CircularProgressCenter as At, removeUndefined as _r, ErrorView as Wt, removeInitialAndTrailingSlashes as Ir, getDefaultPropertiesOrder as Sr, joinCollectionLists as Er } from "@firecms/core";
|
|
3
3
|
import * as $e from "react";
|
|
4
4
|
import G, { useState as Y, useEffect as ue, useMemo as Xt, useCallback as Q, useRef as Ze, useDeferredValue as Ar, useContext as er } from "react";
|
|
5
5
|
import ht from "react-fast-compare";
|
|
@@ -35,18 +35,18 @@ function xi({
|
|
|
35
35
|
values: u,
|
|
36
36
|
setFieldValue: p,
|
|
37
37
|
handleChange: m,
|
|
38
|
-
touched:
|
|
39
|
-
errors:
|
|
38
|
+
touched: c,
|
|
39
|
+
errors: d,
|
|
40
40
|
setFieldTouched: y,
|
|
41
41
|
isSubmitting: g,
|
|
42
42
|
submitCount: v
|
|
43
43
|
} = H(), [P, x] = Y(!1), [N, h] = Y(!1), b = (V) => {
|
|
44
|
-
p("name", V), !k(
|
|
44
|
+
p("name", V), !k(c, "path") && t && V && p("path", wt(V)), !k(c, "id") && t && V && p("id", wt(V)), !k(c, "singularName") && t && V && p("singularName", Cr(V));
|
|
45
45
|
};
|
|
46
46
|
ue(() => {
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
const C = pt
|
|
47
|
+
d.id && h(!0);
|
|
48
|
+
}, [d.id]);
|
|
49
|
+
const C = /* @__PURE__ */ e(pt, { collectionOrView: u }), f = l?.filter((V) => !r?.includes(V)), {
|
|
50
50
|
inputFocused: _,
|
|
51
51
|
autoCompleteOpen: z,
|
|
52
52
|
setAutoCompleteOpen: S
|
|
@@ -87,10 +87,10 @@ function xi({
|
|
|
87
87
|
onChange: (V) => b(V.target.value),
|
|
88
88
|
label: "Name",
|
|
89
89
|
required: !0,
|
|
90
|
-
error:
|
|
90
|
+
error: c.name && !!d.name
|
|
91
91
|
}
|
|
92
92
|
),
|
|
93
|
-
/* @__PURE__ */ e(W, { error:
|
|
93
|
+
/* @__PURE__ */ e(W, { error: c.name && !!d.name, children: c.name && d.name ? d.name : "Name of in this collection, usually a plural name (e.g. Products)" })
|
|
94
94
|
] }),
|
|
95
95
|
/* @__PURE__ */ o("div", { className: Ce("col-span-12 ", F ? "" : "sm:col-span-8"), children: [
|
|
96
96
|
/* @__PURE__ */ e(
|
|
@@ -101,16 +101,16 @@ function xi({
|
|
|
101
101
|
label: "Path",
|
|
102
102
|
disabled: !t,
|
|
103
103
|
required: !0,
|
|
104
|
-
error:
|
|
104
|
+
error: c.path && !!d.path
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
/* @__PURE__ */ e(W, { error:
|
|
107
|
+
/* @__PURE__ */ e(W, { error: c.path && !!d.path, children: c.path && d.path ? d.path : F ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database" })
|
|
108
108
|
] }),
|
|
109
109
|
!F && /* @__PURE__ */ o("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
110
110
|
/* @__PURE__ */ e(
|
|
111
111
|
Ae,
|
|
112
112
|
{
|
|
113
|
-
error:
|
|
113
|
+
error: c.group && !!d.group,
|
|
114
114
|
disabled: g,
|
|
115
115
|
value: u.group ?? "",
|
|
116
116
|
autoComplete: "off",
|
|
@@ -137,7 +137,7 @@ function xi({
|
|
|
137
137
|
))
|
|
138
138
|
}
|
|
139
139
|
),
|
|
140
|
-
/* @__PURE__ */ e(W, { children:
|
|
140
|
+
/* @__PURE__ */ e(W, { children: c.group && d.group ? d.group : "Group of the collection" })
|
|
141
141
|
] }),
|
|
142
142
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
143
143
|
Ot,
|
|
@@ -165,16 +165,16 @@ function xi({
|
|
|
165
165
|
as: J,
|
|
166
166
|
disabled: !t,
|
|
167
167
|
label: "Collection id",
|
|
168
|
-
error:
|
|
168
|
+
error: c.id && !!d.id
|
|
169
169
|
}
|
|
170
170
|
),
|
|
171
|
-
/* @__PURE__ */ e(W, { error:
|
|
171
|
+
/* @__PURE__ */ e(W, { error: c.id && !!d.id, children: c.id && d.id ? d.id : "This id identifies this collection" })
|
|
172
172
|
] }),
|
|
173
173
|
/* @__PURE__ */ o("div", { className: "col-span-12", children: [
|
|
174
174
|
/* @__PURE__ */ e(
|
|
175
175
|
Ae,
|
|
176
176
|
{
|
|
177
|
-
error:
|
|
177
|
+
error: c.singularName && !!d.singularName,
|
|
178
178
|
id: "singularName",
|
|
179
179
|
"aria-describedby": "singularName-helper",
|
|
180
180
|
onChange: (V) => (y("singularName", !0), m(V)),
|
|
@@ -182,13 +182,13 @@ function xi({
|
|
|
182
182
|
label: "Singular name"
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
/* @__PURE__ */ e(W, { error:
|
|
185
|
+
/* @__PURE__ */ e(W, { error: c.singularName && !!d.singularName, children: c.singularName && d.singularName ? d.singularName : "Optionally define a singular name for your entities" })
|
|
186
186
|
] }),
|
|
187
187
|
/* @__PURE__ */ o("div", { className: "col-span-12", children: [
|
|
188
188
|
/* @__PURE__ */ e(
|
|
189
189
|
Ae,
|
|
190
190
|
{
|
|
191
|
-
error:
|
|
191
|
+
error: c.description && !!d.description,
|
|
192
192
|
id: "description",
|
|
193
193
|
value: u.description ?? "",
|
|
194
194
|
onChange: m,
|
|
@@ -198,7 +198,7 @@ function xi({
|
|
|
198
198
|
label: "Description"
|
|
199
199
|
}
|
|
200
200
|
),
|
|
201
|
-
/* @__PURE__ */ e(W, { error:
|
|
201
|
+
/* @__PURE__ */ e(W, { error: c.description && !!d.description, children: c.description && d.description ? d.description : "Description of the collection, you can use markdown" })
|
|
202
202
|
] }),
|
|
203
203
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
204
204
|
Oe,
|
|
@@ -355,7 +355,7 @@ function wi({
|
|
|
355
355
|
}) {
|
|
356
356
|
const {
|
|
357
357
|
setFieldValue: u
|
|
358
|
-
} = H(), [p, m] = G.useState(), [
|
|
358
|
+
} = H(), [p, m] = G.useState(), [c, d] = G.useState(), [y, g] = G.useState(!1), P = G.useRef(/* @__PURE__ */ new Set()).current, x = (h, b) => {
|
|
359
359
|
const C = p === b;
|
|
360
360
|
return /* @__PURE__ */ e(
|
|
361
361
|
Ti,
|
|
@@ -365,7 +365,7 @@ function wi({
|
|
|
365
365
|
enumValuesPath: n,
|
|
366
366
|
autoFocus: C,
|
|
367
367
|
shouldUpdateId: l || C,
|
|
368
|
-
onDialogOpen: () =>
|
|
368
|
+
onDialogOpen: () => d(h),
|
|
369
369
|
inferredEntry: P.has(t.enumValues[h]?.id)
|
|
370
370
|
},
|
|
371
371
|
`${b}`
|
|
@@ -426,10 +426,10 @@ function wi({
|
|
|
426
426
|
/* @__PURE__ */ e(
|
|
427
427
|
Oi,
|
|
428
428
|
{
|
|
429
|
-
index:
|
|
430
|
-
open:
|
|
429
|
+
index: c,
|
|
430
|
+
open: c !== void 0,
|
|
431
431
|
enumValuesPath: n,
|
|
432
|
-
onClose: () =>
|
|
432
|
+
onClose: () => d(void 0)
|
|
433
433
|
}
|
|
434
434
|
)
|
|
435
435
|
] })
|
|
@@ -448,12 +448,12 @@ const Ti = G.memo(
|
|
|
448
448
|
const {
|
|
449
449
|
values: p,
|
|
450
450
|
handleChange: m,
|
|
451
|
-
errors:
|
|
452
|
-
setFieldValue:
|
|
451
|
+
errors: c,
|
|
452
|
+
setFieldValue: d,
|
|
453
453
|
touched: y
|
|
454
|
-
} = H(), g = G.useRef(!k(p, `${n}[${r}].id`)), v = i || g.current, P = k(p, `${n}[${r}].id`), x = k(p, `${n}[${r}].label`), N = k(
|
|
454
|
+
} = H(), g = G.useRef(!k(p, `${n}[${r}].id`)), v = i || g.current, P = k(p, `${n}[${r}].id`), x = k(p, `${n}[${r}].label`), N = k(c, `${n}[${r}].label`), h = G.useRef(x);
|
|
455
455
|
return G.useEffect(() => {
|
|
456
|
-
(h.current === P || !P) && v &&
|
|
456
|
+
(h.current === P || !P) && v && d(`${n}[${r}].id`, x), h.current = x;
|
|
457
457
|
}, [x]), /* @__PURE__ */ o("div", { className: "flex w-full align-center justify-center", children: [
|
|
458
458
|
/* @__PURE__ */ e(
|
|
459
459
|
le,
|
|
@@ -506,7 +506,7 @@ function Oi({
|
|
|
506
506
|
maxWidth: "md",
|
|
507
507
|
"aria-labelledby": "enum-edit-dialog",
|
|
508
508
|
open: r,
|
|
509
|
-
onOpenChange: (
|
|
509
|
+
onOpenChange: (c) => c ? void 0 : i(),
|
|
510
510
|
children: [
|
|
511
511
|
/* @__PURE__ */ e(Ye, { children: t !== void 0 && /* @__PURE__ */ o("div", { children: [
|
|
512
512
|
/* @__PURE__ */ e(
|
|
@@ -597,9 +597,9 @@ function je({
|
|
|
597
597
|
}) {
|
|
598
598
|
const {
|
|
599
599
|
values: m,
|
|
600
|
-
handleChange:
|
|
601
|
-
errors:
|
|
602
|
-
} = H(), y = "validation.length", g = "validation.min", v = "validation.max", P = "validation.trim", x = "validation.matches", N = "validation.lowercase", h = "validation.uppercase", b = k(
|
|
600
|
+
handleChange: c,
|
|
601
|
+
errors: d
|
|
602
|
+
} = H(), y = "validation.length", g = "validation.min", v = "validation.max", P = "validation.trim", x = "validation.matches", N = "validation.lowercase", h = "validation.uppercase", b = k(d, x), C = k(m, x), f = typeof C == "string" ? C : Pr(C);
|
|
603
603
|
return /* @__PURE__ */ o("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
604
604
|
/* @__PURE__ */ e(Re, { disabled: u }),
|
|
605
605
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
@@ -644,7 +644,7 @@ function je({
|
|
|
644
644
|
type: "number",
|
|
645
645
|
size: "small",
|
|
646
646
|
disabled: u,
|
|
647
|
-
onChange:
|
|
647
|
+
onChange: c
|
|
648
648
|
}
|
|
649
649
|
) }),
|
|
650
650
|
l && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
@@ -656,7 +656,7 @@ function je({
|
|
|
656
656
|
type: "number",
|
|
657
657
|
size: "small",
|
|
658
658
|
disabled: u,
|
|
659
|
-
onChange:
|
|
659
|
+
onChange: c
|
|
660
660
|
}
|
|
661
661
|
) }),
|
|
662
662
|
n && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
@@ -668,7 +668,7 @@ function je({
|
|
|
668
668
|
type: "number",
|
|
669
669
|
size: "small",
|
|
670
670
|
disabled: u,
|
|
671
|
-
onChange:
|
|
671
|
+
onChange: c
|
|
672
672
|
}
|
|
673
673
|
) })
|
|
674
674
|
] }),
|
|
@@ -764,8 +764,8 @@ function jt({
|
|
|
764
764
|
handleChange: u,
|
|
765
765
|
errors: p,
|
|
766
766
|
touched: m,
|
|
767
|
-
setFieldError:
|
|
768
|
-
setFieldValue:
|
|
767
|
+
setFieldError: c,
|
|
768
|
+
setFieldValue: d
|
|
769
769
|
} = H(), y = De(), g = t ? "of.enumValues" : "enumValues", v = k(s, "defaultValue"), P = k(s, g), x = Xt(() => !P || typeof P == "boolean" ? [] : wr(P) ?? [], [P]);
|
|
770
770
|
return /* @__PURE__ */ o($, { children: [
|
|
771
771
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
@@ -776,13 +776,13 @@ function jt({
|
|
|
776
776
|
disabled: i,
|
|
777
777
|
allowDataInference: l,
|
|
778
778
|
onError: (h) => {
|
|
779
|
-
|
|
779
|
+
c(g, h ? "" : void 0);
|
|
780
780
|
},
|
|
781
781
|
getData: a ? () => a().then((h) => h.map((b) => s.id && k(b, s.id)).filter(Boolean)) : void 0,
|
|
782
782
|
onValuesChanged: (h) => {
|
|
783
|
-
if (s && (
|
|
783
|
+
if (s && (d(g, h), !t)) {
|
|
784
784
|
const b = h.filter((C) => !!C?.id).map((C) => C.id);
|
|
785
|
-
v && !b.includes(v) && (
|
|
785
|
+
v && !b.includes(v) && (d("defaultValue", void 0), y.open({
|
|
786
786
|
type: "warning",
|
|
787
787
|
message: "Default value was cleared"
|
|
788
788
|
}));
|
|
@@ -806,7 +806,7 @@ function jt({
|
|
|
806
806
|
disabled: i,
|
|
807
807
|
position: "item-aligned",
|
|
808
808
|
onValueChange: (h) => {
|
|
809
|
-
|
|
809
|
+
d("defaultValue", h);
|
|
810
810
|
},
|
|
811
811
|
label: "Default value",
|
|
812
812
|
value: v ?? "",
|
|
@@ -837,9 +837,9 @@ function Lt({
|
|
|
837
837
|
const {
|
|
838
838
|
values: n,
|
|
839
839
|
setFieldValue: l
|
|
840
|
-
} = H(), a = t ? "of.storage" : "storage", s = `${a}.acceptedFiles`, u = `${a}.fileName`, p = `${a}.storagePath`, m = `${a}.storeUrl`,
|
|
840
|
+
} = H(), a = t ? "of.storage" : "storage", s = `${a}.acceptedFiles`, u = `${a}.fileName`, p = `${a}.storagePath`, m = `${a}.storeUrl`, c = k(n, u) ?? "{rand}_{file}", d = k(n, p) ?? "/", y = k(n, s), g = Array.isArray(y) ? y : void 0, v = !g || g.length === 0, P = (h) => {
|
|
841
841
|
h ? h.includes("all") || h.length >= Object.keys(ct).length ? l(s, void 0) : v ? l(s, Object.keys(ct).filter((b) => !h.includes(b))) : l(s, h) : l(s, void 0);
|
|
842
|
-
}, x = typeof
|
|
842
|
+
}, x = typeof c == "function", N = typeof d == "function";
|
|
843
843
|
return /* @__PURE__ */ o($, { children: [
|
|
844
844
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
845
845
|
Ot,
|
|
@@ -904,7 +904,7 @@ function Lt({
|
|
|
904
904
|
label: "File name",
|
|
905
905
|
size: "small",
|
|
906
906
|
disabled: x || i,
|
|
907
|
-
value: x ? "-" :
|
|
907
|
+
value: x ? "-" : c
|
|
908
908
|
}
|
|
909
909
|
) }),
|
|
910
910
|
/* @__PURE__ */ o("div", { className: "col-span-12", children: [
|
|
@@ -916,7 +916,7 @@ function Lt({
|
|
|
916
916
|
label: "Storage path",
|
|
917
917
|
disabled: N || i,
|
|
918
918
|
size: "small",
|
|
919
|
-
value: N ? "-" :
|
|
919
|
+
value: N ? "-" : d
|
|
920
920
|
}
|
|
921
921
|
),
|
|
922
922
|
/* @__PURE__ */ o(O, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
|
|
@@ -1143,8 +1143,8 @@ function Ct({
|
|
|
1143
1143
|
onPropertyMove: u,
|
|
1144
1144
|
onPropertyRemove: p,
|
|
1145
1145
|
className: m,
|
|
1146
|
-
inferredPropertyKeys:
|
|
1147
|
-
collectionEditable:
|
|
1146
|
+
inferredPropertyKeys: c,
|
|
1147
|
+
collectionEditable: d
|
|
1148
1148
|
}) {
|
|
1149
1149
|
const y = l ?? Object.keys(n), g = Q((v) => {
|
|
1150
1150
|
if (!v.destination)
|
|
@@ -1175,12 +1175,12 @@ function Ct({
|
|
|
1175
1175
|
provided: C,
|
|
1176
1176
|
errors: s,
|
|
1177
1177
|
namespace: t,
|
|
1178
|
-
inferredPropertyKeys:
|
|
1178
|
+
inferredPropertyKeys: c,
|
|
1179
1179
|
onPropertyMove: u,
|
|
1180
1180
|
onPropertyRemove: p,
|
|
1181
1181
|
onPropertyClick: f.isDragging ? void 0 : i,
|
|
1182
1182
|
selectedPropertyKey: r,
|
|
1183
|
-
collectionEditable:
|
|
1183
|
+
collectionEditable: d
|
|
1184
1184
|
}
|
|
1185
1185
|
) })
|
|
1186
1186
|
},
|
|
@@ -1203,10 +1203,10 @@ function Ii({
|
|
|
1203
1203
|
onPropertyClick: u,
|
|
1204
1204
|
onPropertyMove: p,
|
|
1205
1205
|
onPropertyRemove: m,
|
|
1206
|
-
inferredPropertyKeys:
|
|
1207
|
-
collectionEditable:
|
|
1206
|
+
inferredPropertyKeys: c,
|
|
1207
|
+
collectionEditable: d
|
|
1208
1208
|
}) {
|
|
1209
|
-
const y =
|
|
1209
|
+
const y = c?.includes(r ? `${r}.${t}` : t), g = oe(t, r);
|
|
1210
1210
|
let v;
|
|
1211
1211
|
if (typeof i == "object") {
|
|
1212
1212
|
const h = i;
|
|
@@ -1221,11 +1221,11 @@ function Ii({
|
|
|
1221
1221
|
onPropertyClick: u,
|
|
1222
1222
|
onPropertyMove: p,
|
|
1223
1223
|
onPropertyRemove: m,
|
|
1224
|
-
collectionEditable:
|
|
1224
|
+
collectionEditable: d
|
|
1225
1225
|
}
|
|
1226
1226
|
));
|
|
1227
1227
|
}
|
|
1228
|
-
const P = g ? k(s, be(g)) : !1, x = a === g, N = i && (
|
|
1228
|
+
const P = g ? k(s, be(g)) : !1, x = a === g, N = i && (d && !re(i) || Je(i));
|
|
1229
1229
|
return /* @__PURE__ */ o(
|
|
1230
1230
|
"div",
|
|
1231
1231
|
{
|
|
@@ -1292,7 +1292,7 @@ function Si({ disabled: t, getData: r, allowDataInference: i, propertyConfigs: n
|
|
|
1292
1292
|
const {
|
|
1293
1293
|
values: a,
|
|
1294
1294
|
setFieldValue: s
|
|
1295
|
-
} = H(), [u, p] = Y(!1), [m,
|
|
1295
|
+
} = H(), [u, p] = Y(!1), [m, c] = Y(), [d, y] = Y(), g = a.propertiesOrder ?? Object.keys(a.properties ?? {}), v = Q(({
|
|
1296
1296
|
id: f,
|
|
1297
1297
|
property: _
|
|
1298
1298
|
}) => {
|
|
@@ -1307,8 +1307,8 @@ function Si({ disabled: t, getData: r, allowDataInference: i, propertyConfigs: n
|
|
|
1307
1307
|
if (!z)
|
|
1308
1308
|
throw Error("collection editor miss config");
|
|
1309
1309
|
const S = be(z), F = Te(_), U = k(a, F) ?? Object.keys(k(a, Pi(_)));
|
|
1310
|
-
s(S, void 0, !1), s(F, U.filter((V) => V !== f), !1), p(!1),
|
|
1311
|
-
}, [s, a]), x = m ? oe(m,
|
|
1310
|
+
s(S, void 0, !1), s(F, U.filter((V) => V !== f), !1), p(!1), c(void 0), y(void 0);
|
|
1311
|
+
}, [s, a]), x = m ? oe(m, d) : void 0, N = x ? k(a.properties, x.replaceAll(".", ".properties.")) : void 0, h = /* @__PURE__ */ o(
|
|
1312
1312
|
R,
|
|
1313
1313
|
{
|
|
1314
1314
|
color: "primary",
|
|
@@ -1338,7 +1338,7 @@ function Si({ disabled: t, getData: r, allowDataInference: i, propertyConfigs: n
|
|
|
1338
1338
|
errors: {},
|
|
1339
1339
|
collectionEditable: l,
|
|
1340
1340
|
onPropertyClick: (f, _) => {
|
|
1341
|
-
|
|
1341
|
+
c(f), y(_), p(!0);
|
|
1342
1342
|
},
|
|
1343
1343
|
onPropertyMove: C
|
|
1344
1344
|
}
|
|
@@ -1375,15 +1375,15 @@ function Si({ disabled: t, getData: r, allowDataInference: i, propertyConfigs: n
|
|
|
1375
1375
|
allowDataInference: i,
|
|
1376
1376
|
collectionEditable: l,
|
|
1377
1377
|
onCancel: () => {
|
|
1378
|
-
p(!1),
|
|
1378
|
+
p(!1), c(void 0), y(void 0);
|
|
1379
1379
|
},
|
|
1380
1380
|
onOkClicked: () => {
|
|
1381
|
-
p(!1),
|
|
1381
|
+
p(!1), c(void 0), y(void 0);
|
|
1382
1382
|
},
|
|
1383
1383
|
getData: r,
|
|
1384
1384
|
onDelete: P,
|
|
1385
1385
|
propertyKey: m,
|
|
1386
|
-
propertyNamespace:
|
|
1386
|
+
propertyNamespace: d,
|
|
1387
1387
|
property: N,
|
|
1388
1388
|
existingProperty: !!m,
|
|
1389
1389
|
autoUpdateId: !m,
|
|
@@ -1408,10 +1408,10 @@ function Ei({
|
|
|
1408
1408
|
values: u,
|
|
1409
1409
|
handleChange: p,
|
|
1410
1410
|
errors: m,
|
|
1411
|
-
setFieldValue:
|
|
1412
|
-
touched:
|
|
1413
|
-
} = H(), [y, g] = Y(!1), v = k(u, "of"), P = k(
|
|
1414
|
-
|
|
1411
|
+
setFieldValue: c,
|
|
1412
|
+
touched: d
|
|
1413
|
+
} = H(), [y, g] = Y(!1), v = k(u, "of"), P = k(d, "of") && k(m, "of"), x = Q(({ id: h, property: b, namespace: C }) => {
|
|
1414
|
+
c("of", b);
|
|
1415
1415
|
}, []), N = v && Qe(v, a);
|
|
1416
1416
|
return /* @__PURE__ */ o($, { children: [
|
|
1417
1417
|
/* @__PURE__ */ o("div", { className: "col-span-12", children: [
|
|
@@ -1485,8 +1485,8 @@ const Ai = G.forwardRef(
|
|
|
1485
1485
|
const {
|
|
1486
1486
|
errors: p,
|
|
1487
1487
|
values: m,
|
|
1488
|
-
setFieldValue:
|
|
1489
|
-
setFieldTouched:
|
|
1488
|
+
setFieldValue: c,
|
|
1489
|
+
setFieldTouched: d,
|
|
1490
1490
|
touched: y
|
|
1491
1491
|
} = H(), g = "name", v = r && k(p, g), P = "id", x = r && k(p, P), N = "description", h = r && k(p, N);
|
|
1492
1492
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-2 col-span-12", children: [
|
|
@@ -1499,7 +1499,7 @@ const Ai = G.forwardRef(
|
|
|
1499
1499
|
value: m[g],
|
|
1500
1500
|
onChange: (b) => {
|
|
1501
1501
|
const C = b.target.value;
|
|
1502
|
-
|
|
1502
|
+
c(g, C), d(g, !0, !0), !k(y, P) && a && c(P, C ? wt(C) : "");
|
|
1503
1503
|
},
|
|
1504
1504
|
style: { fontSize: 20 },
|
|
1505
1505
|
validate: Mi,
|
|
@@ -1520,7 +1520,7 @@ const Ai = G.forwardRef(
|
|
|
1520
1520
|
value: m[P],
|
|
1521
1521
|
onChange: (b) => {
|
|
1522
1522
|
const C = b.target.value;
|
|
1523
|
-
|
|
1523
|
+
c(P, C), d(P, !0, !0), !k(y, g) && a && c(g, C ? vt(C) : "");
|
|
1524
1524
|
},
|
|
1525
1525
|
validate: () => Di(m[P], n),
|
|
1526
1526
|
disabled: i || l,
|
|
@@ -1649,7 +1649,7 @@ function Ui({ disabled: t, getData: r, allowDataInference: i, propertyConfigs: n
|
|
|
1649
1649
|
const {
|
|
1650
1650
|
values: a,
|
|
1651
1651
|
setFieldValue: s
|
|
1652
|
-
} = H(), [u, p] = Y(!1), [m,
|
|
1652
|
+
} = H(), [u, p] = Y(!1), [m, c] = Y(), [d, y] = Y(), g = Q(({
|
|
1653
1653
|
id: b,
|
|
1654
1654
|
property: C
|
|
1655
1655
|
}) => {
|
|
@@ -1659,13 +1659,13 @@ function Ui({ disabled: t, getData: r, allowDataInference: i, propertyConfigs: n
|
|
|
1659
1659
|
...a.oneOf?.properties ?? {},
|
|
1660
1660
|
[b]: C
|
|
1661
1661
|
}, !1), s("oneOf.propertiesOrder", [...a.oneOf?.propertiesOrder ?? Object.keys(a.oneOf?.properties ?? {}), b], !1), p(!1);
|
|
1662
|
-
}, [a.oneOf?.properties, a.oneOf?.propertiesOrder]), v = m ? oe(m,
|
|
1662
|
+
}, [a.oneOf?.properties, a.oneOf?.propertiesOrder]), v = m ? oe(m, d) : void 0, P = v ? k(a.oneOf?.properties, v.replaceAll(".", ".properties.")) : void 0, x = Q((b, C) => {
|
|
1663
1663
|
const f = b ? oe(b, C) : void 0;
|
|
1664
1664
|
if (!f)
|
|
1665
1665
|
throw Error("collection editor miss config");
|
|
1666
1666
|
s(`oneOf.${be(f)}`, void 0, !1);
|
|
1667
1667
|
const _ = `oneOf.${Te(C)}`, z = k(a, _);
|
|
1668
|
-
s(_, z.filter((S) => S !== b), !1), p(!1),
|
|
1668
|
+
s(_, z.filter((S) => S !== b), !1), p(!1), c(void 0), y(void 0);
|
|
1669
1669
|
}, [s, a]), N = /* @__PURE__ */ o(
|
|
1670
1670
|
R,
|
|
1671
1671
|
{
|
|
@@ -1696,7 +1696,7 @@ function Ui({ disabled: t, getData: r, allowDataInference: i, propertyConfigs: n
|
|
|
1696
1696
|
errors: {},
|
|
1697
1697
|
collectionEditable: l,
|
|
1698
1698
|
onPropertyClick: t ? void 0 : (b, C) => {
|
|
1699
|
-
|
|
1699
|
+
c(b), y(C), p(!0);
|
|
1700
1700
|
},
|
|
1701
1701
|
onPropertyMove: t ? void 0 : h
|
|
1702
1702
|
}
|
|
@@ -1713,15 +1713,15 @@ function Ui({ disabled: t, getData: r, allowDataInference: i, propertyConfigs: n
|
|
|
1713
1713
|
getData: r,
|
|
1714
1714
|
allowDataInference: i,
|
|
1715
1715
|
onCancel: () => {
|
|
1716
|
-
p(!1),
|
|
1716
|
+
p(!1), c(void 0), y(void 0);
|
|
1717
1717
|
},
|
|
1718
1718
|
onOkClicked: () => {
|
|
1719
|
-
p(!1),
|
|
1719
|
+
p(!1), c(void 0), y(void 0);
|
|
1720
1720
|
},
|
|
1721
1721
|
collectionEditable: l,
|
|
1722
1722
|
onDelete: x,
|
|
1723
1723
|
propertyKey: m,
|
|
1724
|
-
propertyNamespace:
|
|
1724
|
+
propertyNamespace: d,
|
|
1725
1725
|
property: P,
|
|
1726
1726
|
existingProperty: !!m,
|
|
1727
1727
|
autoUpdateId: !m,
|
|
@@ -1848,25 +1848,22 @@ function qt({
|
|
|
1848
1848
|
const {
|
|
1849
1849
|
values: l,
|
|
1850
1850
|
handleChange: a,
|
|
1851
|
-
errors: s
|
|
1852
|
-
touched: u,
|
|
1853
|
-
setFieldError: p,
|
|
1854
|
-
setFieldValue: m
|
|
1851
|
+
errors: s
|
|
1855
1852
|
} = H();
|
|
1856
1853
|
if (!Me())
|
|
1857
1854
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(tt, {}) });
|
|
1858
|
-
const
|
|
1855
|
+
const p = r ? "of.path" : "path", m = k(l, p), c = n && k(s, p);
|
|
1859
1856
|
return /* @__PURE__ */ e($, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1860
1857
|
ve,
|
|
1861
1858
|
{
|
|
1862
1859
|
required: !0,
|
|
1863
|
-
name:
|
|
1864
|
-
pathPath:
|
|
1860
|
+
name: p,
|
|
1861
|
+
pathPath: p,
|
|
1865
1862
|
type: "select",
|
|
1866
1863
|
validate: Li,
|
|
1867
1864
|
disabled: t || i,
|
|
1868
|
-
value:
|
|
1869
|
-
error:
|
|
1865
|
+
value: m,
|
|
1866
|
+
error: c,
|
|
1870
1867
|
handleChange: a,
|
|
1871
1868
|
component: qi
|
|
1872
1869
|
}
|
|
@@ -1888,8 +1885,8 @@ function qi({
|
|
|
1888
1885
|
if (!s)
|
|
1889
1886
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(tt, {}) });
|
|
1890
1887
|
const u = s?.collections ?? [], p = Array.from(new Set(
|
|
1891
|
-
Object.values(u).map((
|
|
1892
|
-
).values()), m = u.filter((
|
|
1888
|
+
Object.values(u).map((c) => c.group).filter(Boolean)
|
|
1889
|
+
).values()), m = u.filter((c) => !c.group);
|
|
1893
1890
|
return /* @__PURE__ */ o($, { children: [
|
|
1894
1891
|
/* @__PURE__ */ o(
|
|
1895
1892
|
Oe,
|
|
@@ -1901,74 +1898,65 @@ function qi({
|
|
|
1901
1898
|
name: r,
|
|
1902
1899
|
onChange: n,
|
|
1903
1900
|
label: "Target collection",
|
|
1904
|
-
renderValue: (
|
|
1905
|
-
const
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
const y = pt(c);
|
|
1909
|
-
return /* @__PURE__ */ o("div", { className: "flex flex-row", children: [
|
|
1910
|
-
y,
|
|
1901
|
+
renderValue: (c) => {
|
|
1902
|
+
const d = u.find((y) => y.id === c || y.path === c);
|
|
1903
|
+
return d ? /* @__PURE__ */ o("div", { className: "flex flex-row", children: [
|
|
1904
|
+
/* @__PURE__ */ e(pt, { collectionOrView: d }),
|
|
1911
1905
|
/* @__PURE__ */ e(
|
|
1912
1906
|
O,
|
|
1913
1907
|
{
|
|
1914
1908
|
variant: "subtitle2",
|
|
1915
1909
|
className: "font-medium ml-4",
|
|
1916
|
-
children:
|
|
1910
|
+
children: d?.name.toUpperCase()
|
|
1917
1911
|
}
|
|
1918
1912
|
)
|
|
1919
|
-
] });
|
|
1913
|
+
] }) : null;
|
|
1920
1914
|
},
|
|
1921
1915
|
...a,
|
|
1922
1916
|
children: [
|
|
1923
|
-
p.flatMap((
|
|
1917
|
+
p.flatMap((c) => /* @__PURE__ */ e(
|
|
1924
1918
|
Mt,
|
|
1925
1919
|
{
|
|
1926
|
-
label:
|
|
1927
|
-
children: u.filter((
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
{
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
`${c.id ?? c.path}-${d}`
|
|
1946
|
-
);
|
|
1947
|
-
})
|
|
1920
|
+
label: c || "Views",
|
|
1921
|
+
children: u.filter((d) => d.group === c).map((d) => /* @__PURE__ */ e(
|
|
1922
|
+
X,
|
|
1923
|
+
{
|
|
1924
|
+
value: d.id ?? d.path,
|
|
1925
|
+
children: /* @__PURE__ */ o("div", { className: "flex flex-row", children: [
|
|
1926
|
+
/* @__PURE__ */ e(pt, { collectionOrView: d }),
|
|
1927
|
+
/* @__PURE__ */ e(
|
|
1928
|
+
O,
|
|
1929
|
+
{
|
|
1930
|
+
variant: "subtitle2",
|
|
1931
|
+
className: "font-medium ml-4",
|
|
1932
|
+
children: d?.name.toUpperCase()
|
|
1933
|
+
}
|
|
1934
|
+
)
|
|
1935
|
+
] })
|
|
1936
|
+
},
|
|
1937
|
+
`${d.id ?? d.path}-${c}`
|
|
1938
|
+
))
|
|
1948
1939
|
},
|
|
1949
|
-
`group_${
|
|
1940
|
+
`group_${c}`
|
|
1950
1941
|
)),
|
|
1951
|
-
m && /* @__PURE__ */ e(Mt, { label: "Views", children: m.map((
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
{
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
d.id ?? d.path
|
|
1970
|
-
);
|
|
1971
|
-
}) })
|
|
1942
|
+
m && /* @__PURE__ */ e(Mt, { label: "Views", children: m.map((c) => /* @__PURE__ */ e(
|
|
1943
|
+
X,
|
|
1944
|
+
{
|
|
1945
|
+
value: c.id ?? c.path,
|
|
1946
|
+
children: /* @__PURE__ */ o("div", { className: "flex flex-row", children: [
|
|
1947
|
+
/* @__PURE__ */ e(pt, { collectionOrView: c }),
|
|
1948
|
+
/* @__PURE__ */ e(
|
|
1949
|
+
O,
|
|
1950
|
+
{
|
|
1951
|
+
variant: "subtitle2",
|
|
1952
|
+
className: "font-medium ml-4",
|
|
1953
|
+
children: c?.name.toUpperCase()
|
|
1954
|
+
}
|
|
1955
|
+
)
|
|
1956
|
+
] })
|
|
1957
|
+
},
|
|
1958
|
+
c.id ?? c.path
|
|
1959
|
+
)) })
|
|
1972
1960
|
]
|
|
1973
1961
|
}
|
|
1974
1962
|
),
|
|
@@ -1981,7 +1969,7 @@ function Yi({ disabled: t }) {
|
|
|
1981
1969
|
errors: i,
|
|
1982
1970
|
touched: n,
|
|
1983
1971
|
setFieldValue: l
|
|
1984
|
-
} = H(), a = "mode", s = k(r, a), u = k(n, a) && k(i, a), p = "autoValue", m = k(r, p),
|
|
1972
|
+
} = H(), a = "mode", s = k(r, a), u = k(n, a) && k(i, a), p = "autoValue", m = k(r, p), c = k(n, p) && k(i, p);
|
|
1985
1973
|
return /* @__PURE__ */ o($, { children: [
|
|
1986
1974
|
/* @__PURE__ */ o("div", { className: "flex flex-col col-span-12", children: [
|
|
1987
1975
|
/* @__PURE__ */ o(
|
|
@@ -1990,10 +1978,10 @@ function Yi({ disabled: t }) {
|
|
|
1990
1978
|
name: a,
|
|
1991
1979
|
value: s ?? "date",
|
|
1992
1980
|
error: !!u,
|
|
1993
|
-
onValueChange: (
|
|
1981
|
+
onValueChange: (d) => l(a, d),
|
|
1994
1982
|
label: "Mode",
|
|
1995
|
-
renderValue: (
|
|
1996
|
-
switch (
|
|
1983
|
+
renderValue: (d) => {
|
|
1984
|
+
switch (d) {
|
|
1997
1985
|
case "date_time":
|
|
1998
1986
|
return "Date/Time";
|
|
1999
1987
|
case "date":
|
|
@@ -2016,9 +2004,9 @@ function Yi({ disabled: t }) {
|
|
|
2016
2004
|
name: p,
|
|
2017
2005
|
disabled: t,
|
|
2018
2006
|
value: m ?? "",
|
|
2019
|
-
onValueChange: (
|
|
2020
|
-
renderValue: (
|
|
2021
|
-
switch (
|
|
2007
|
+
onValueChange: (d) => l(p, d),
|
|
2008
|
+
renderValue: (d) => {
|
|
2009
|
+
switch (d) {
|
|
2022
2010
|
case "on_create":
|
|
2023
2011
|
return "On create";
|
|
2024
2012
|
case "on_update":
|
|
@@ -2027,7 +2015,7 @@ function Yi({ disabled: t }) {
|
|
|
2027
2015
|
return "None";
|
|
2028
2016
|
}
|
|
2029
2017
|
},
|
|
2030
|
-
error: !!
|
|
2018
|
+
error: !!c,
|
|
2031
2019
|
label: "Automatic value",
|
|
2032
2020
|
children: [
|
|
2033
2021
|
/* @__PURE__ */ e(X, { value: "", children: " None " }),
|
|
@@ -2036,7 +2024,7 @@ function Yi({ disabled: t }) {
|
|
|
2036
2024
|
]
|
|
2037
2025
|
}
|
|
2038
2026
|
),
|
|
2039
|
-
/* @__PURE__ */ e(W, { error: !!
|
|
2027
|
+
/* @__PURE__ */ e(W, { error: !!c, children: c ?? "Update this field automatically when creating or updating the entity" })
|
|
2040
2028
|
] }),
|
|
2041
2029
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ve, { children: /* @__PURE__ */ e(Re, { disabled: t }) }) })
|
|
2042
2030
|
] });
|
|
@@ -2408,8 +2396,8 @@ const Zi = [
|
|
|
2408
2396
|
propertyNamespace: u,
|
|
2409
2397
|
property: p,
|
|
2410
2398
|
onPropertyChanged: m,
|
|
2411
|
-
onPropertyChangedImmediate:
|
|
2412
|
-
onDelete:
|
|
2399
|
+
onPropertyChangedImmediate: c = !0,
|
|
2400
|
+
onDelete: d,
|
|
2413
2401
|
onError: y,
|
|
2414
2402
|
initialErrors: g,
|
|
2415
2403
|
forceShowErrors: v,
|
|
@@ -2460,8 +2448,8 @@ const Zi = [
|
|
|
2460
2448
|
}, [F]), /* @__PURE__ */ e(
|
|
2461
2449
|
Ji,
|
|
2462
2450
|
{
|
|
2463
|
-
onPropertyChanged:
|
|
2464
|
-
onDelete:
|
|
2451
|
+
onPropertyChanged: c ? S : void 0,
|
|
2452
|
+
onDelete: d,
|
|
2465
2453
|
includeIdAndTitle: r,
|
|
2466
2454
|
propertyNamespace: u,
|
|
2467
2455
|
onError: y,
|
|
@@ -2553,8 +2541,8 @@ function Ji({
|
|
|
2553
2541
|
autoOpenTypeSelect: u,
|
|
2554
2542
|
includeIdAndTitle: p,
|
|
2555
2543
|
onPropertyChanged: m,
|
|
2556
|
-
onDelete:
|
|
2557
|
-
propertyNamespace:
|
|
2544
|
+
onDelete: c,
|
|
2545
|
+
propertyNamespace: d,
|
|
2558
2546
|
onError: y,
|
|
2559
2547
|
showErrors: g,
|
|
2560
2548
|
disabled: v,
|
|
@@ -2575,12 +2563,12 @@ function Ji({
|
|
|
2575
2563
|
ht(M, A.current) || (m({
|
|
2576
2564
|
id: K,
|
|
2577
2565
|
property: ie,
|
|
2578
|
-
namespace:
|
|
2566
|
+
namespace: d
|
|
2579
2567
|
}), A.current = M);
|
|
2580
2568
|
}
|
|
2581
|
-
}, [M, p, m,
|
|
2582
|
-
t?.id && y && Object.keys(r).length > 0 && y(t?.id,
|
|
2583
|
-
}, [r, y,
|
|
2569
|
+
}, [M, p, m, d]), ue(() => {
|
|
2570
|
+
t?.id && y && Object.keys(r).length > 0 && y(t?.id, d, r);
|
|
2571
|
+
}, [r, y, d, t?.id]);
|
|
2584
2572
|
const Pe = (K) => {
|
|
2585
2573
|
U(K), n(sr(t, K, b)), setTimeout(() => {
|
|
2586
2574
|
w.current?.focus();
|
|
@@ -2759,7 +2747,7 @@ function Ji({
|
|
|
2759
2747
|
}
|
|
2760
2748
|
)
|
|
2761
2749
|
] }),
|
|
2762
|
-
|
|
2750
|
+
c && t?.id && /* @__PURE__ */ e(
|
|
2763
2751
|
se,
|
|
2764
2752
|
{
|
|
2765
2753
|
variant: "ghost",
|
|
@@ -2786,11 +2774,11 @@ function Ji({
|
|
|
2786
2774
|
D,
|
|
2787
2775
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Gi, { disabled: v }) })
|
|
2788
2776
|
] }),
|
|
2789
|
-
|
|
2777
|
+
c && /* @__PURE__ */ e(
|
|
2790
2778
|
mt,
|
|
2791
2779
|
{
|
|
2792
2780
|
open: z,
|
|
2793
|
-
onAccept: () =>
|
|
2781
|
+
onAccept: () => c(t?.id, d),
|
|
2794
2782
|
onCancel: () => S(!1),
|
|
2795
2783
|
title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
|
|
2796
2784
|
body: /* @__PURE__ */ o("div", { children: [
|
|
@@ -2839,7 +2827,7 @@ const ` + Qi(t.name) + "Collection:EntityCollection = " + ci.stringify(pr(t), nu
|
|
|
2839
2827
|
theme: ui.vsDark,
|
|
2840
2828
|
code: l,
|
|
2841
2829
|
language: "typescript",
|
|
2842
|
-
children: ({ className: a, style: s, tokens: u, getLineProps: p, getTokenProps: m }) => /* @__PURE__ */ e("pre", { style: s, className: "p-4 rounded text-sm", children: u.map((
|
|
2830
|
+
children: ({ className: a, style: s, tokens: u, getLineProps: p, getTokenProps: m }) => /* @__PURE__ */ e("pre", { style: s, className: "p-4 rounded text-sm", children: u.map((c, d) => /* @__PURE__ */ e("div", { ...p({ line: c }), children: c.map((y, g) => /* @__PURE__ */ e("span", { ...m({ token: y }) }, g)) }, d)) })
|
|
2843
2831
|
}
|
|
2844
2832
|
)
|
|
2845
2833
|
] }),
|
|
@@ -2905,8 +2893,8 @@ function Xi({
|
|
|
2905
2893
|
getUser: u,
|
|
2906
2894
|
getData: p,
|
|
2907
2895
|
doCollectionInference: m,
|
|
2908
|
-
propertyConfigs:
|
|
2909
|
-
collectionEditable:
|
|
2896
|
+
propertyConfigs: c,
|
|
2897
|
+
collectionEditable: d
|
|
2910
2898
|
}) {
|
|
2911
2899
|
const {
|
|
2912
2900
|
values: y,
|
|
@@ -3081,7 +3069,7 @@ function Xi({
|
|
|
3081
3069
|
propertiesOrder: q,
|
|
3082
3070
|
onPropertyMove: Fe,
|
|
3083
3071
|
onPropertyRemove: r ? ye : void 0,
|
|
3084
|
-
collectionEditable:
|
|
3072
|
+
collectionEditable: d,
|
|
3085
3073
|
errors: t ? x : {}
|
|
3086
3074
|
}
|
|
3087
3075
|
) }),
|
|
@@ -3120,8 +3108,8 @@ function Xi({
|
|
|
3120
3108
|
forceShowErrors: t,
|
|
3121
3109
|
initialErrors: E,
|
|
3122
3110
|
getData: p,
|
|
3123
|
-
propertyConfigs:
|
|
3124
|
-
collectionEditable:
|
|
3111
|
+
propertyConfigs: c,
|
|
3112
|
+
collectionEditable: d
|
|
3125
3113
|
},
|
|
3126
3114
|
`edit_view_${f}`
|
|
3127
3115
|
),
|
|
@@ -3148,8 +3136,8 @@ function Xi({
|
|
|
3148
3136
|
forceShowErrors: t,
|
|
3149
3137
|
initialErrors: E,
|
|
3150
3138
|
getData: p,
|
|
3151
|
-
propertyConfigs:
|
|
3152
|
-
collectionEditable:
|
|
3139
|
+
propertyConfigs: c,
|
|
3140
|
+
collectionEditable: d,
|
|
3153
3141
|
onOkClicked: C ? xt : void 0
|
|
3154
3142
|
},
|
|
3155
3143
|
`edit_view_${f}`
|
|
@@ -3170,8 +3158,8 @@ function Xi({
|
|
|
3170
3158
|
onPropertyChanged: de,
|
|
3171
3159
|
getData: p,
|
|
3172
3160
|
allowDataInference: !r,
|
|
3173
|
-
propertyConfigs:
|
|
3174
|
-
collectionEditable:
|
|
3161
|
+
propertyConfigs: c,
|
|
3162
|
+
collectionEditable: d,
|
|
3175
3163
|
existingPropertyKeys: y.propertiesOrder
|
|
3176
3164
|
}
|
|
3177
3165
|
),
|
|
@@ -3255,7 +3243,7 @@ function rn({
|
|
|
3255
3243
|
getUser: l,
|
|
3256
3244
|
parentCollectionIds: a
|
|
3257
3245
|
}) {
|
|
3258
|
-
const { entityViews: s } = Le(), [u, p] = G.useState(), [m,
|
|
3246
|
+
const { entityViews: s } = Le(), [u, p] = G.useState(), [m, c] = G.useState(!1), [d, y] = G.useState(), [g, v] = G.useState(), {
|
|
3259
3247
|
values: P,
|
|
3260
3248
|
setFieldValue: x
|
|
3261
3249
|
} = H(), N = t.subcollections ?? [], h = P.entityViews?.filter((f) => typeof f == "string").map((f) => Or(f, s)).filter(Boolean) ?? [], b = t.entityViews?.filter((f) => typeof f != "string") ?? [], C = h.length + b.length;
|
|
@@ -3367,7 +3355,7 @@ function rn({
|
|
|
3367
3355
|
R,
|
|
3368
3356
|
{
|
|
3369
3357
|
onClick: () => {
|
|
3370
|
-
|
|
3358
|
+
c(!0);
|
|
3371
3359
|
},
|
|
3372
3360
|
variant: "outlined",
|
|
3373
3361
|
startIcon: /* @__PURE__ */ e(xe, {}),
|
|
@@ -3396,12 +3384,12 @@ function rn({
|
|
|
3396
3384
|
] })
|
|
3397
3385
|
}
|
|
3398
3386
|
),
|
|
3399
|
-
|
|
3387
|
+
d && /* @__PURE__ */ e(
|
|
3400
3388
|
mt,
|
|
3401
3389
|
{
|
|
3402
|
-
open: !!
|
|
3390
|
+
open: !!d,
|
|
3403
3391
|
onAccept: () => {
|
|
3404
|
-
x("entityViews", P.entityViews?.filter((f) => f !==
|
|
3392
|
+
x("entityViews", P.entityViews?.filter((f) => f !== d)), y(void 0);
|
|
3405
3393
|
},
|
|
3406
3394
|
onCancel: () => y(void 0),
|
|
3407
3395
|
title: /* @__PURE__ */ e($, { children: "Remove this view?" }),
|
|
@@ -3433,7 +3421,7 @@ function rn({
|
|
|
3433
3421
|
{
|
|
3434
3422
|
open: m,
|
|
3435
3423
|
onClose: (f) => {
|
|
3436
|
-
f && x("entityViews", [...P.entityViews ?? [], f]),
|
|
3424
|
+
f && x("entityViews", [...P.entityViews ?? [], f]), c(!1);
|
|
3437
3425
|
}
|
|
3438
3426
|
}
|
|
3439
3427
|
)
|
|
@@ -3877,8 +3865,8 @@ function nn({
|
|
|
3877
3865
|
}, [l, t, r]);
|
|
3878
3866
|
const {
|
|
3879
3867
|
values: m,
|
|
3880
|
-
setFieldValue:
|
|
3881
|
-
setValues:
|
|
3868
|
+
setFieldValue: c,
|
|
3869
|
+
setValues: d,
|
|
3882
3870
|
handleChange: y,
|
|
3883
3871
|
touched: g,
|
|
3884
3872
|
errors: v,
|
|
@@ -3914,7 +3902,7 @@ function nn({
|
|
|
3914
3902
|
{
|
|
3915
3903
|
colorScheme: "cyanLighter",
|
|
3916
3904
|
onClick: () => {
|
|
3917
|
-
|
|
3905
|
+
c("name", vt(h)), c("id", h), c("path", h), c("properties", void 0), n();
|
|
3918
3906
|
},
|
|
3919
3907
|
size: "small",
|
|
3920
3908
|
children: h
|
|
@@ -3941,7 +3929,7 @@ function nn({
|
|
|
3941
3929
|
subtitle: "A collection of products with images, prices and stock",
|
|
3942
3930
|
icon: /* @__PURE__ */ e(ot, { size: "small", iconKey: Yt.icon }),
|
|
3943
3931
|
onClick: () => {
|
|
3944
|
-
|
|
3932
|
+
d(Yt), n();
|
|
3945
3933
|
}
|
|
3946
3934
|
}
|
|
3947
3935
|
),
|
|
@@ -3952,7 +3940,7 @@ function nn({
|
|
|
3952
3940
|
subtitle: "A collection of users with emails, names and roles",
|
|
3953
3941
|
icon: /* @__PURE__ */ e(ot, { size: "small", iconKey: Ht.icon }),
|
|
3954
3942
|
onClick: () => {
|
|
3955
|
-
|
|
3943
|
+
d(Ht), n();
|
|
3956
3944
|
}
|
|
3957
3945
|
}
|
|
3958
3946
|
),
|
|
@@ -3963,7 +3951,7 @@ function nn({
|
|
|
3963
3951
|
subtitle: "A collection of blog posts with images, authors and complex content",
|
|
3964
3952
|
icon: /* @__PURE__ */ e(ot, { size: "small", iconKey: Gt.icon }),
|
|
3965
3953
|
onClick: () => {
|
|
3966
|
-
|
|
3954
|
+
d(Gt), n();
|
|
3967
3955
|
}
|
|
3968
3956
|
}
|
|
3969
3957
|
),
|
|
@@ -3974,7 +3962,7 @@ function nn({
|
|
|
3974
3962
|
subtitle: "A collection of pages with images, authors and complex content",
|
|
3975
3963
|
icon: /* @__PURE__ */ e(ot, { size: "small", iconKey: Kt.icon }),
|
|
3976
3964
|
onClick: () => {
|
|
3977
|
-
|
|
3965
|
+
d(Kt), n();
|
|
3978
3966
|
}
|
|
3979
3967
|
}
|
|
3980
3968
|
)
|
|
@@ -4027,7 +4015,7 @@ function an({
|
|
|
4027
4015
|
setFieldValue: n,
|
|
4028
4016
|
setFieldTouched: l,
|
|
4029
4017
|
values: a
|
|
4030
|
-
} = H(), [s, u] = Y(void 0), p = G.useRef(a.propertiesOrder ? { "": a.propertiesOrder } : {}), m = s ? s.id : void 0,
|
|
4018
|
+
} = H(), [s, u] = Y(void 0), p = G.useRef(a.propertiesOrder ? { "": a.propertiesOrder } : {}), m = s ? s.id : void 0, c = s || void 0, d = ({
|
|
4031
4019
|
id: g,
|
|
4032
4020
|
property: v,
|
|
4033
4021
|
previousId: P,
|
|
@@ -4109,10 +4097,10 @@ function an({
|
|
|
4109
4097
|
{
|
|
4110
4098
|
open: s !== void 0,
|
|
4111
4099
|
propertyKey: m,
|
|
4112
|
-
property:
|
|
4100
|
+
property: c,
|
|
4113
4101
|
inArray: !1,
|
|
4114
4102
|
autoUpdateId: !1,
|
|
4115
|
-
onPropertyChanged:
|
|
4103
|
+
onPropertyChanged: d,
|
|
4116
4104
|
allowDataInference: !1,
|
|
4117
4105
|
collectionEditable: i,
|
|
4118
4106
|
onOkClicked: () => {
|
|
@@ -4156,20 +4144,20 @@ function on({
|
|
|
4156
4144
|
position: "item-aligned",
|
|
4157
4145
|
renderValue: (m) => s ? /* @__PURE__ */ e(We, { propertyConfig: s }) : null,
|
|
4158
4146
|
onValueChange: (m) => {
|
|
4159
|
-
const
|
|
4147
|
+
const c = sr(t, m, n);
|
|
4160
4148
|
i && r({
|
|
4161
4149
|
id: i,
|
|
4162
|
-
property:
|
|
4150
|
+
property: c,
|
|
4163
4151
|
previousId: i,
|
|
4164
4152
|
namespace: void 0
|
|
4165
4153
|
});
|
|
4166
4154
|
},
|
|
4167
|
-
children: Object.entries(dr).map(([m,
|
|
4155
|
+
children: Object.entries(dr).map(([m, c]) => /* @__PURE__ */ e(
|
|
4168
4156
|
cr,
|
|
4169
4157
|
{
|
|
4170
4158
|
value: m,
|
|
4171
4159
|
optionDisabled: !1,
|
|
4172
|
-
propertyConfig:
|
|
4160
|
+
propertyConfig: c,
|
|
4173
4161
|
existing: !1
|
|
4174
4162
|
},
|
|
4175
4163
|
m
|
|
@@ -4223,13 +4211,13 @@ function mr(t, r = "") {
|
|
|
4223
4211
|
}
|
|
4224
4212
|
};
|
|
4225
4213
|
}
|
|
4226
|
-
const
|
|
4214
|
+
const c = {
|
|
4227
4215
|
...a.properties,
|
|
4228
4216
|
[p]: u
|
|
4229
4217
|
};
|
|
4230
4218
|
return {
|
|
4231
4219
|
headersMapping: { ...a.headersMapping, [s]: m },
|
|
4232
|
-
properties:
|
|
4220
|
+
properties: c
|
|
4233
4221
|
};
|
|
4234
4222
|
}, { headersMapping: {}, properties: {} }), n = Object.keys(i.headersMapping)?.[0];
|
|
4235
4223
|
let l;
|
|
@@ -4286,8 +4274,8 @@ function sn({
|
|
|
4286
4274
|
handleClose: u,
|
|
4287
4275
|
reservedGroups: p,
|
|
4288
4276
|
extraView: m,
|
|
4289
|
-
handleCancel:
|
|
4290
|
-
setFormDirty:
|
|
4277
|
+
handleCancel: c,
|
|
4278
|
+
setFormDirty: d,
|
|
4291
4279
|
pathSuggestions: y,
|
|
4292
4280
|
getUser: g,
|
|
4293
4281
|
parentCollection: v,
|
|
@@ -4414,7 +4402,7 @@ function sn({
|
|
|
4414
4402
|
submitCount: L
|
|
4415
4403
|
} = E, j = B.path ?? n, ne = a?.includes("/") ? a?.split("/").slice(0, -1).join("/") + "/" + j : j, te = Zt(j, t, _, B.id), ge = !te && l ? N.convertIdsToPaths(l) : void 0, it = te ? void 0 : N.resolveAliasesFrom(ne), nt = it && P ? () => P(it, ge ?? []) : void 0;
|
|
4416
4404
|
ue(() => {
|
|
4417
|
-
|
|
4405
|
+
d(I);
|
|
4418
4406
|
}, [I]);
|
|
4419
4407
|
function _t(ae) {
|
|
4420
4408
|
S.setInUse(!0), ai(ae, or).then((St) => {
|
|
@@ -4602,7 +4590,7 @@ function sn({
|
|
|
4602
4590
|
{
|
|
4603
4591
|
variant: "text",
|
|
4604
4592
|
onClick: () => {
|
|
4605
|
-
|
|
4593
|
+
c();
|
|
4606
4594
|
},
|
|
4607
4595
|
children: "Cancel"
|
|
4608
4596
|
}
|
|
@@ -4703,11 +4691,11 @@ const Zt = (t, r, i, n) => {
|
|
|
4703
4691
|
pathSuggestions: u,
|
|
4704
4692
|
getUser: p,
|
|
4705
4693
|
getData: m,
|
|
4706
|
-
onAnalyticsEvent:
|
|
4694
|
+
onAnalyticsEvent: c
|
|
4707
4695
|
}) {
|
|
4708
|
-
const
|
|
4696
|
+
const d = Me(), y = bi(), g = De(), { propertyConfigs: v } = Le(), {
|
|
4709
4697
|
collections: P
|
|
4710
|
-
} =
|
|
4698
|
+
} = d, x = P.map((T) => T.path.trim().toLowerCase()), [N, h] = G.useState();
|
|
4711
4699
|
ue(() => {
|
|
4712
4700
|
u && u().then((T) => {
|
|
4713
4701
|
h(T.filter((M) => !x.includes(M.trim().toLowerCase())));
|
|
@@ -4723,7 +4711,7 @@ const Zt = (t, r, i, n) => {
|
|
|
4723
4711
|
parentCollectionIds: w,
|
|
4724
4712
|
parentCollection: A
|
|
4725
4713
|
}) => {
|
|
4726
|
-
console.debug("edit collection", T, M, w, A),
|
|
4714
|
+
console.debug("edit collection", T, M, w, A), c?.("edit_collection", { path: T, fullPath: M }), C({
|
|
4727
4715
|
editedCollectionPath: T,
|
|
4728
4716
|
fullPath: M,
|
|
4729
4717
|
parentCollectionIds: w,
|
|
@@ -4739,7 +4727,7 @@ const Zt = (t, r, i, n) => {
|
|
|
4739
4727
|
parentCollectionIds: fe,
|
|
4740
4728
|
collection: Pe
|
|
4741
4729
|
}) => {
|
|
4742
|
-
console.debug("edit property", T, M, w, A, fe, Pe),
|
|
4730
|
+
console.debug("edit property", T, M, w, A, fe, Pe), c?.("edit_property", { propertyKey: T, editedCollectionPath: w });
|
|
4743
4731
|
const D = T && T.includes(".") ? T.substring(0, T.lastIndexOf(".")) : void 0, K = T && T.includes(".") ? T.substring(T.lastIndexOf(".") + 1) : T;
|
|
4744
4732
|
_({
|
|
4745
4733
|
propertyKey: K,
|
|
@@ -4756,7 +4744,7 @@ const Zt = (t, r, i, n) => {
|
|
|
4756
4744
|
initialValues: w,
|
|
4757
4745
|
redirect: A
|
|
4758
4746
|
}) => {
|
|
4759
|
-
console.debug("create collection", T, M, w, A),
|
|
4747
|
+
console.debug("create collection", T, M, w, A), c?.("create_collection", { parentCollectionIds: T, parentCollection: M, initialValues: w, redirect: A }), C({
|
|
4760
4748
|
isNewCollection: !0,
|
|
4761
4749
|
parentCollectionIds: T,
|
|
4762
4750
|
parentCollection: M,
|
|
@@ -4791,7 +4779,7 @@ const Zt = (t, r, i, n) => {
|
|
|
4791
4779
|
getUser: p,
|
|
4792
4780
|
handleClose: (T) => {
|
|
4793
4781
|
if (b?.redirect && T && b?.isNewCollection && !b.parentCollectionIds.length) {
|
|
4794
|
-
const M =
|
|
4782
|
+
const M = d.buildUrlCollectionPath(T.id ?? T.path);
|
|
4795
4783
|
y(M);
|
|
4796
4784
|
}
|
|
4797
4785
|
C(void 0);
|
|
@@ -4810,7 +4798,7 @@ const Zt = (t, r, i, n) => {
|
|
|
4810
4798
|
collectionEditable: f?.collectionEditable ?? !1,
|
|
4811
4799
|
getData: m && f?.editedCollectionPath ? () => {
|
|
4812
4800
|
console.debug("get data for property", f?.editedCollectionPath);
|
|
4813
|
-
const T =
|
|
4801
|
+
const T = d.resolveAliasesFrom(f.editedCollectionPath);
|
|
4814
4802
|
return m(T, []);
|
|
4815
4803
|
} : void 0,
|
|
4816
4804
|
onPropertyChanged: ({
|
|
@@ -4879,12 +4867,12 @@ function pn({
|
|
|
4879
4867
|
collection: i,
|
|
4880
4868
|
tableController: n
|
|
4881
4869
|
}) {
|
|
4882
|
-
const l = qe(), a = Me(), s = _e(), u = yr(), p = De(), m = a.getCollectionFromIds(r),
|
|
4870
|
+
const l = qe(), a = Me(), s = _e(), u = yr(), p = De(), m = a.getCollectionFromIds(r), c = s.configPermissions ? s.configPermissions({
|
|
4883
4871
|
user: l.user,
|
|
4884
4872
|
collection: i
|
|
4885
4873
|
}).editCollections : !0;
|
|
4886
|
-
let
|
|
4887
|
-
return (!ht(ut(n.filterValues), ut(i.initialFilter)) || !ht(ut(n.sortBy), ut(i.initialSort))) && (
|
|
4874
|
+
let d = null;
|
|
4875
|
+
return (!ht(ut(n.filterValues), ut(i.initialFilter)) || !ht(ut(n.sortBy), ut(i.initialSort))) && (d = /* @__PURE__ */ o($, { children: [
|
|
4888
4876
|
i.initialFilter || i.initialSort && /* @__PURE__ */ e(
|
|
4889
4877
|
ee,
|
|
4890
4878
|
{
|
|
@@ -4935,17 +4923,17 @@ function pn({
|
|
|
4935
4923
|
}
|
|
4936
4924
|
)
|
|
4937
4925
|
] })), /* @__PURE__ */ o($, { children: [
|
|
4938
|
-
|
|
4926
|
+
c && d,
|
|
4939
4927
|
/* @__PURE__ */ e(
|
|
4940
4928
|
ee,
|
|
4941
4929
|
{
|
|
4942
|
-
title:
|
|
4930
|
+
title: c ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
4943
4931
|
children: /* @__PURE__ */ e(
|
|
4944
4932
|
se,
|
|
4945
4933
|
{
|
|
4946
4934
|
color: "primary",
|
|
4947
|
-
disabled: !
|
|
4948
|
-
onClick:
|
|
4935
|
+
disabled: !c,
|
|
4936
|
+
onClick: c ? () => s?.editCollection({ path: i.path, fullPath: t, parentCollectionIds: r, parentCollection: m }) : void 0,
|
|
4949
4937
|
children: /* @__PURE__ */ e(et, {})
|
|
4950
4938
|
}
|
|
4951
4939
|
)
|
|
@@ -4965,7 +4953,7 @@ function mn({
|
|
|
4965
4953
|
collection: r
|
|
4966
4954
|
}), u = Q(() => {
|
|
4967
4955
|
a?.editCollection({ path: t, parentCollectionIds: [] });
|
|
4968
|
-
}, [a, t]), [p, m] = Y(!1),
|
|
4956
|
+
}, [a, t]), [p, m] = Y(!1), c = Q(() => {
|
|
4969
4957
|
l?.deleteCollection({ path: t }).then(() => {
|
|
4970
4958
|
m(!1), i.open({
|
|
4971
4959
|
message: "Collection deleted",
|
|
@@ -4979,8 +4967,8 @@ function mn({
|
|
|
4979
4967
|
Wr,
|
|
4980
4968
|
{
|
|
4981
4969
|
trigger: /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(Xr, { size: "small" }) }),
|
|
4982
|
-
children: /* @__PURE__ */ o(ei, { onClick: (
|
|
4983
|
-
|
|
4970
|
+
children: /* @__PURE__ */ o(ei, { onClick: (d) => {
|
|
4971
|
+
d.preventDefault(), d.stopPropagation(), m(!0);
|
|
4984
4972
|
}, children: [
|
|
4985
4973
|
/* @__PURE__ */ e(gt, {}),
|
|
4986
4974
|
"Delete"
|
|
@@ -4990,7 +4978,7 @@ function mn({
|
|
|
4990
4978
|
s.editCollections && /* @__PURE__ */ e(
|
|
4991
4979
|
se,
|
|
4992
4980
|
{
|
|
4993
|
-
onClick: (
|
|
4981
|
+
onClick: (d) => {
|
|
4994
4982
|
u();
|
|
4995
4983
|
},
|
|
4996
4984
|
children: /* @__PURE__ */ e(et, { size: "small" })
|
|
@@ -5001,7 +4989,7 @@ function mn({
|
|
|
5001
4989
|
mt,
|
|
5002
4990
|
{
|
|
5003
4991
|
open: p,
|
|
5004
|
-
onAccept:
|
|
4992
|
+
onAccept: c,
|
|
5005
4993
|
onCancel: () => m(!1),
|
|
5006
4994
|
title: /* @__PURE__ */ e($, { children: "Delete this collection?" }),
|
|
5007
4995
|
body: /* @__PURE__ */ o($, { children: [
|
|
@@ -5175,19 +5163,19 @@ function En({
|
|
|
5175
5163
|
getData: p,
|
|
5176
5164
|
onAnalyticsEvent: m
|
|
5177
5165
|
}) {
|
|
5178
|
-
const
|
|
5166
|
+
const c = (d) => {
|
|
5179
5167
|
const y = (P) => {
|
|
5180
5168
|
Xe(P.properties), P.subcollections?.forEach(y);
|
|
5181
5169
|
}, g = t.collections ?? [];
|
|
5182
|
-
g.forEach(y), console.debug("Collections specified in code:",
|
|
5183
|
-
const v = Er(
|
|
5170
|
+
g.forEach(y), console.debug("Collections specified in code:", d), console.debug("Collections stored in the backend", g);
|
|
5171
|
+
const v = Er(d, g, [], r);
|
|
5184
5172
|
return console.debug("Collections after joining:", v), v;
|
|
5185
5173
|
};
|
|
5186
5174
|
return {
|
|
5187
5175
|
name: "Collection Editor",
|
|
5188
5176
|
loading: t.loading,
|
|
5189
5177
|
collections: {
|
|
5190
|
-
injectCollections:
|
|
5178
|
+
injectCollections: c,
|
|
5191
5179
|
CollectionActions: pn
|
|
5192
5180
|
},
|
|
5193
5181
|
provider: {
|