@firecms/collection_editor 3.0.0-canary.4 → 3.0.0-canary.40
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 +525 -511
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/types/persisted_collection.d.ts +1 -1
- package/dist/ui/EditorCollectionActionStart.d.ts +2 -0
- package/dist/ui/collection_editor/CollectionEditorDialog.d.ts +1 -1
- package/dist/ui/collection_editor/utils/supported_fields.d.ts +2 -2
- package/package.json +18 -18
- package/src/ConfigControllerProvider.tsx +1 -1
- package/src/types/persisted_collection.ts +1 -1
- package/src/ui/EditorCollectionAction.tsx +0 -51
- package/src/ui/EditorCollectionActionStart.tsx +87 -0
- package/src/ui/MissingReferenceWidget.tsx +2 -1
- package/src/ui/NewCollectionButton.tsx +12 -10
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +17 -18
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +13 -9
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +1 -1
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +7 -6
- package/src/ui/collection_editor/EnumForm.tsx +3 -4
- package/src/ui/collection_editor/GetCodeDialog.tsx +15 -3
- package/src/ui/collection_editor/PropertyEditView.tsx +4 -4
- package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +1 -1
- package/src/ui/collection_editor/properties/CommonPropertyFields.tsx +7 -8
- package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +7 -8
- package/src/ui/collection_editor/properties/MapPropertyField.tsx +3 -4
- package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +3 -4
- package/src/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +3 -4
- package/src/ui/collection_editor/utils/supported_fields.tsx +3 -3
- package/src/useCollectionEditorPlugin.tsx +4 -4
- package/dist/ui/collection_editor/properties/FieldHelperView.d.ts +0 -4
- package/src/ui/collection_editor/properties/FieldHelperView.tsx +0 -13
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as e, jsxs as a, Fragment as
|
|
2
|
-
import { SearchIconsView as gr, toSnakeCase as Pt, singular as vr, IconForView as ot, ArrayContainer as yr, serializeRegExp as br, useSnackbarController as
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { FieldCaption as X, SearchIconsView as gr, toSnakeCase as Pt, singular as vr, IconForView as ot, ArrayContainer as yr, serializeRegExp as br, useSnackbarController as _e, resolveEnumValues as Cr, isPropertyBuilder as ne, useCustomizationController as Ae, getFieldConfig as $e, ErrorBoundary as me, PropertyConfigBadge as Ye, unslugify as ut, useNavigationController as Ne, mergeDeep as W, DEFAULT_FIELD_CONFIGS as Gt, isValidRegExp as Pr, getFieldId as Kt, DeleteConfirmationDialog as lt, useLargeLayout as Nr, makePropertiesEditable as pt, resolveEntityView as xr, useSelectionController as wr, EntityCollectionTable as Tr, slugify as kr, useAuthController as Te, randomString as _t, CircularProgressCenter as Nt, removeUndefined as Ft, ErrorView as Wt, removeInitialAndTrailingSlashes as Or, getDefaultPropertiesOrder as Vr } from "@firecms/core";
|
|
3
3
|
import * as je from "react";
|
|
4
4
|
import Y, { useState as $, useEffect as de, useMemo as Zt, useCallback as Q, useRef as Le, useDeferredValue as Ir, useContext as Jt } from "react";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
5
|
+
import ye from "react-fast-compare";
|
|
6
|
+
import { useAutoComplete as _r, Container as mt, Typography as O, Tooltip as te, IconButton as oe, Chip as st, TextField as Ve, cn as fe, DebouncedTextField as Z, Autocomplete as Fr, AutocompleteItem as Sr, ExpandablePanel as xt, SettingsIcon as He, Select as Ce, SelectItem as ee, BooleanSwitchWithLabel as ct, Dialog as Fe, AutoAwesomeIcon as ht, Badge as Er, ListIcon as Ar, Button as z, CircularProgress as De, Paper as Pe, DialogContent as Be, DialogActions as ze, RuleIcon as Dr, FileUploadIcon as Br, MultiSelect as zr, MultiSelectItem as St, Checkbox as Et, cardMixin as Qt, cardClickableMixin as Xt, cardSelectedMixin as er, FunctionsIcon as Mr, RemoveCircleIcon as Rr, defaultBorderMixin as wt, RemoveIcon as Ur, DragHandleIcon as jr, AddIcon as se, SelectGroup as At, InfoLabel as Lr, DeleteIcon as dt, ContentCopyIcon as qr, CodeIcon as $r, Table as Dt, TableBody as Bt, TableRow as bt, TableCell as Ue, Alert as Yr, Icon as et, Card as tr, coolIconKeys as zt, Tabs as Hr, Tab as Ct, ArrowBackIcon as tt, LoadingButton as Mt, DoneIcon as Gr, Menu as Kr, MoreVertIcon as Wr, MenuItem as Zr, Collapse as Jr, SaveIcon as Qr, UndoIcon as Xr } from "@firecms/ui";
|
|
7
7
|
import * as rt from "yup";
|
|
8
8
|
import { useFormex as K, Field as H, getIn as I, useCreateFormex as Tt, Formex as kt } from "@firecms/formex";
|
|
9
9
|
import { extractEnumFromValues as ei, buildPropertyFromData as ti, buildEntityPropertiesFromData as ri } from "@firecms/schema_inference";
|
|
@@ -17,12 +17,6 @@ const vi = rt.object().shape({
|
|
|
17
17
|
name: rt.string().required("Required"),
|
|
18
18
|
path: rt.string().required("Required")
|
|
19
19
|
});
|
|
20
|
-
function X({
|
|
21
|
-
error: t,
|
|
22
|
-
children: r
|
|
23
|
-
}) {
|
|
24
|
-
return r ? /* @__PURE__ */ e(O, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: r }) : null;
|
|
25
|
-
}
|
|
26
20
|
function yi({
|
|
27
21
|
isNewCollection: t,
|
|
28
22
|
reservedGroups: r,
|
|
@@ -32,8 +26,8 @@ function yi({
|
|
|
32
26
|
parentCollection: o
|
|
33
27
|
}) {
|
|
34
28
|
const d = Y.useRef(null), {
|
|
35
|
-
values:
|
|
36
|
-
setFieldValue:
|
|
29
|
+
values: p,
|
|
30
|
+
setFieldValue: u,
|
|
37
31
|
handleChange: h,
|
|
38
32
|
touched: m,
|
|
39
33
|
errors: c,
|
|
@@ -41,20 +35,20 @@ function yi({
|
|
|
41
35
|
isSubmitting: v,
|
|
42
36
|
submitCount: x
|
|
43
37
|
} = K(), [y, P] = $(!1), [k, b] = $(!1), C = (s) => {
|
|
44
|
-
|
|
38
|
+
u("name", s), !I(m, "path") && t && s && u("path", Pt(s)), !I(m, "id") && t && s && u("id", Pt(s)), !I(m, "singularName") && t && s && u("singularName", vr(s));
|
|
45
39
|
};
|
|
46
40
|
de(() => {
|
|
47
41
|
c.id && b(!0);
|
|
48
42
|
}, [c.id]);
|
|
49
|
-
const N = /* @__PURE__ */ e(ot, { collectionOrView:
|
|
43
|
+
const N = /* @__PURE__ */ e(ot, { collectionOrView: p }), f = l?.filter((s) => !r?.includes(s)), {
|
|
50
44
|
inputFocused: w,
|
|
51
45
|
autoCompleteOpen: _,
|
|
52
46
|
setAutoCompleteOpen: M
|
|
53
47
|
} = _r({
|
|
54
48
|
ref: d
|
|
55
|
-
}),
|
|
49
|
+
}), U = !!o;
|
|
56
50
|
let D;
|
|
57
|
-
typeof
|
|
51
|
+
typeof p.customId == "object" ? D = "code_defined" : p.customId === !0 ? D = "true" : p.customId === !1 ? D = "false" : p.customId === "optional" && (D = "optional");
|
|
58
52
|
const A = x > 0;
|
|
59
53
|
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(mt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
60
54
|
/* @__PURE__ */ a("div", { children: [
|
|
@@ -63,7 +57,7 @@ function yi({
|
|
|
63
57
|
{
|
|
64
58
|
className: "flex flex-row py-2 pt-3 items-center",
|
|
65
59
|
children: [
|
|
66
|
-
/* @__PURE__ */ e(O, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${
|
|
60
|
+
/* @__PURE__ */ e(O, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${p?.name} collection` }),
|
|
67
61
|
/* @__PURE__ */ e(te, { title: "Change icon", children: /* @__PURE__ */ e(
|
|
68
62
|
oe,
|
|
69
63
|
{
|
|
@@ -83,9 +77,9 @@ function yi({
|
|
|
83
77
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-4", children: [
|
|
84
78
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
85
79
|
/* @__PURE__ */ e(
|
|
86
|
-
|
|
80
|
+
Ve,
|
|
87
81
|
{
|
|
88
|
-
value:
|
|
82
|
+
value: p.name ?? "",
|
|
89
83
|
onChange: (s) => C(s.target.value),
|
|
90
84
|
label: "Name",
|
|
91
85
|
required: !0,
|
|
@@ -94,7 +88,7 @@ function yi({
|
|
|
94
88
|
),
|
|
95
89
|
/* @__PURE__ */ e(X, { error: m.name && !!c.name, children: m.name && c.name ? c.name : "Name of in this collection, usually a plural name (e.g. Products)" })
|
|
96
90
|
] }),
|
|
97
|
-
/* @__PURE__ */ a("div", { className:
|
|
91
|
+
/* @__PURE__ */ a("div", { className: fe("col-span-12 ", U ? "" : "sm:col-span-8"), children: [
|
|
98
92
|
/* @__PURE__ */ e(
|
|
99
93
|
H,
|
|
100
94
|
{
|
|
@@ -106,17 +100,17 @@ function yi({
|
|
|
106
100
|
error: A && !!c.path
|
|
107
101
|
}
|
|
108
102
|
),
|
|
109
|
-
/* @__PURE__ */ e(X, { error: m.path && !!c.path, children: m.path && c.path ? c.path :
|
|
103
|
+
/* @__PURE__ */ e(X, { error: m.path && !!c.path, children: m.path && c.path ? c.path : U ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database" })
|
|
110
104
|
] }),
|
|
111
|
-
!
|
|
105
|
+
!U && /* @__PURE__ */ a("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
112
106
|
/* @__PURE__ */ e(
|
|
113
|
-
|
|
107
|
+
Ve,
|
|
114
108
|
{
|
|
115
109
|
error: A && !!c.group,
|
|
116
110
|
disabled: v,
|
|
117
|
-
value:
|
|
111
|
+
value: p.group ?? "",
|
|
118
112
|
autoComplete: "off",
|
|
119
|
-
onChange: (s) =>
|
|
113
|
+
onChange: (s) => u("group", s.target.value),
|
|
120
114
|
name: "group",
|
|
121
115
|
inputRef: d,
|
|
122
116
|
label: "Group"
|
|
@@ -131,7 +125,7 @@ function yi({
|
|
|
131
125
|
Sr,
|
|
132
126
|
{
|
|
133
127
|
onClick: () => {
|
|
134
|
-
M(!1),
|
|
128
|
+
M(!1), u("group", s ?? null);
|
|
135
129
|
},
|
|
136
130
|
children: /* @__PURE__ */ e("div", { className: "flex-grow", children: s })
|
|
137
131
|
},
|
|
@@ -174,13 +168,13 @@ function yi({
|
|
|
174
168
|
] }),
|
|
175
169
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
176
170
|
/* @__PURE__ */ e(
|
|
177
|
-
|
|
171
|
+
Ve,
|
|
178
172
|
{
|
|
179
173
|
error: A && !!c.singularName,
|
|
180
174
|
name: "singularName",
|
|
181
175
|
"aria-describedby": "singularName-helper",
|
|
182
176
|
onChange: (s) => (g("singularName", !0), h(s)),
|
|
183
|
-
value:
|
|
177
|
+
value: p.singularName ?? "",
|
|
184
178
|
label: "Singular name"
|
|
185
179
|
}
|
|
186
180
|
),
|
|
@@ -188,11 +182,11 @@ function yi({
|
|
|
188
182
|
] }),
|
|
189
183
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
190
184
|
/* @__PURE__ */ e(
|
|
191
|
-
|
|
185
|
+
Ve,
|
|
192
186
|
{
|
|
193
187
|
error: A && !!c.description,
|
|
194
188
|
name: "description",
|
|
195
|
-
value:
|
|
189
|
+
value: p.description ?? "",
|
|
196
190
|
onChange: h,
|
|
197
191
|
multiline: !0,
|
|
198
192
|
rows: 2,
|
|
@@ -203,13 +197,13 @@ function yi({
|
|
|
203
197
|
/* @__PURE__ */ e(X, { error: A && !!c.description, children: A && c.description ? c.description : "Description of the collection, you can use markdown" })
|
|
204
198
|
] }),
|
|
205
199
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
206
|
-
|
|
200
|
+
Ce,
|
|
207
201
|
{
|
|
208
202
|
name: "defaultSize",
|
|
209
203
|
label: "Default row size",
|
|
210
204
|
position: "item-aligned",
|
|
211
205
|
onChange: h,
|
|
212
|
-
value:
|
|
206
|
+
value: p.defaultSize ?? "",
|
|
213
207
|
renderValue: (s) => s.toUpperCase(),
|
|
214
208
|
children: ["xs", "s", "m", "l", "xl"].map((s) => /* @__PURE__ */ e(
|
|
215
209
|
ee,
|
|
@@ -222,7 +216,7 @@ function yi({
|
|
|
222
216
|
}
|
|
223
217
|
) }),
|
|
224
218
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
225
|
-
|
|
219
|
+
Ce,
|
|
226
220
|
{
|
|
227
221
|
name: "customId",
|
|
228
222
|
label: "Data IDs generation",
|
|
@@ -231,7 +225,7 @@ function yi({
|
|
|
231
225
|
onValueChange: (s) => {
|
|
232
226
|
if (s === "code_defined")
|
|
233
227
|
throw new Error("This should not happen");
|
|
234
|
-
s === "true" ?
|
|
228
|
+
s === "true" ? u("customId", !0) : s === "false" ? u("customId", !1) : s === "optional" && u("customId", "optional");
|
|
235
229
|
},
|
|
236
230
|
value: D ?? "",
|
|
237
231
|
renderValue: (s) => s === "code_defined" ? "Code defined" : s === "true" ? "Users must define an ID" : s === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
|
|
@@ -248,8 +242,8 @@ function yi({
|
|
|
248
242
|
{
|
|
249
243
|
position: "start",
|
|
250
244
|
label: "Collection group",
|
|
251
|
-
onValueChange: (s) =>
|
|
252
|
-
value:
|
|
245
|
+
onValueChange: (s) => u("collectionGroup", s),
|
|
246
|
+
value: p.collectionGroup ?? !1
|
|
253
247
|
}
|
|
254
248
|
),
|
|
255
249
|
/* @__PURE__ */ e(X, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." })
|
|
@@ -260,8 +254,8 @@ function yi({
|
|
|
260
254
|
{
|
|
261
255
|
position: "start",
|
|
262
256
|
label: "Enable text search for this collection",
|
|
263
|
-
onValueChange: (s) =>
|
|
264
|
-
value:
|
|
257
|
+
onValueChange: (s) => u("textSearchEnabled", s),
|
|
258
|
+
value: p.textSearchEnabled ?? !1
|
|
265
259
|
}
|
|
266
260
|
),
|
|
267
261
|
/* @__PURE__ */ e(X, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." })
|
|
@@ -281,9 +275,9 @@ function yi({
|
|
|
281
275
|
children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
|
|
282
276
|
gr,
|
|
283
277
|
{
|
|
284
|
-
selectedIcon:
|
|
278
|
+
selectedIcon: p.icon,
|
|
285
279
|
onIconSelected: (s) => {
|
|
286
|
-
P(!1),
|
|
280
|
+
P(!1), u("icon", s);
|
|
287
281
|
}
|
|
288
282
|
}
|
|
289
283
|
) })
|
|
@@ -291,13 +285,13 @@ function yi({
|
|
|
291
285
|
)
|
|
292
286
|
] }) });
|
|
293
287
|
}
|
|
294
|
-
function
|
|
288
|
+
function he(t) {
|
|
295
289
|
return "properties." + t.replaceAll(".", ".properties.");
|
|
296
290
|
}
|
|
297
291
|
function bi(t) {
|
|
298
292
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
|
|
299
293
|
}
|
|
300
|
-
function
|
|
294
|
+
function be(t) {
|
|
301
295
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
|
|
302
296
|
}
|
|
303
297
|
function ae(t, r) {
|
|
@@ -305,7 +299,7 @@ function ae(t, r) {
|
|
|
305
299
|
}
|
|
306
300
|
function ir(t, r) {
|
|
307
301
|
const n = r ? `${r}.${t}` : t;
|
|
308
|
-
return
|
|
302
|
+
return he(n);
|
|
309
303
|
}
|
|
310
304
|
function Ci({
|
|
311
305
|
enumValues: t,
|
|
@@ -316,7 +310,7 @@ function Ci({
|
|
|
316
310
|
allowDataInference: o,
|
|
317
311
|
getData: d
|
|
318
312
|
}) {
|
|
319
|
-
const
|
|
313
|
+
const p = Tt({
|
|
320
314
|
initialValues: { enumValues: t },
|
|
321
315
|
validateOnChange: !0,
|
|
322
316
|
validation: (m) => {
|
|
@@ -327,14 +321,14 @@ function Ci({
|
|
|
327
321
|
const g = !!(c?.enumValues && Object.keys(c?.enumValues).length > 0);
|
|
328
322
|
return n?.(g), c;
|
|
329
323
|
}
|
|
330
|
-
}), { values:
|
|
324
|
+
}), { values: u, errors: h } = p;
|
|
331
325
|
return de(() => {
|
|
332
|
-
r && r(
|
|
333
|
-
}, [
|
|
326
|
+
r && r(u.enumValues);
|
|
327
|
+
}, [u.enumValues]), /* @__PURE__ */ e(kt, { value: p, children: /* @__PURE__ */ e(
|
|
334
328
|
Pi,
|
|
335
329
|
{
|
|
336
330
|
enumValuesPath: "enumValues",
|
|
337
|
-
values:
|
|
331
|
+
values: u,
|
|
338
332
|
errors: h,
|
|
339
333
|
shouldUpdateId: i,
|
|
340
334
|
disabled: l,
|
|
@@ -353,9 +347,9 @@ function Pi({
|
|
|
353
347
|
getData: d
|
|
354
348
|
}) {
|
|
355
349
|
const {
|
|
356
|
-
setFieldValue:
|
|
357
|
-
} = K(), [
|
|
358
|
-
const N =
|
|
350
|
+
setFieldValue: p
|
|
351
|
+
} = K(), [u, h] = Y.useState(), [m, c] = Y.useState(), [g, v] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, P = (b, C) => {
|
|
352
|
+
const N = u === C, f = r?.enumValues && r?.enumValues[b];
|
|
359
353
|
return /* @__PURE__ */ e(
|
|
360
354
|
Ni,
|
|
361
355
|
{
|
|
@@ -393,10 +387,10 @@ function Pi({
|
|
|
393
387
|
d && (v(!0), d?.().then((b) => {
|
|
394
388
|
if (!b)
|
|
395
389
|
return;
|
|
396
|
-
const C = b.flat(), N = Array.from(new Set(C)), f = t.enumValues, _ = ei(N).filter((M) => !f?.some((
|
|
390
|
+
const C = b.flat(), N = Array.from(new Set(C)), f = t.enumValues, _ = ei(N).filter((M) => !f?.some((U) => U.id === M.id));
|
|
397
391
|
_.forEach((M) => {
|
|
398
392
|
y.add(M.id);
|
|
399
|
-
}),
|
|
393
|
+
}), p(i, [..._, ...f], !0);
|
|
400
394
|
}).catch((b) => {
|
|
401
395
|
console.error(b);
|
|
402
396
|
}).finally(() => v(!1)));
|
|
@@ -408,7 +402,7 @@ function Pi({
|
|
|
408
402
|
}
|
|
409
403
|
)
|
|
410
404
|
] }),
|
|
411
|
-
/* @__PURE__ */ a(
|
|
405
|
+
/* @__PURE__ */ a(Pe, { className: "p-4 m-1", children: [
|
|
412
406
|
/* @__PURE__ */ e(
|
|
413
407
|
yr,
|
|
414
408
|
{
|
|
@@ -420,7 +414,7 @@ function Pi({
|
|
|
420
414
|
buildEntry: P,
|
|
421
415
|
onInternalIdAdded: h,
|
|
422
416
|
includeAddButton: !0,
|
|
423
|
-
onValueChange: (b) =>
|
|
417
|
+
onValueChange: (b) => p(i, b),
|
|
424
418
|
newDefaultEntry: { id: "", label: "" }
|
|
425
419
|
}
|
|
426
420
|
),
|
|
@@ -444,8 +438,8 @@ const Ni = Y.memo(
|
|
|
444
438
|
autoFocus: l,
|
|
445
439
|
onDialogOpen: o,
|
|
446
440
|
disabled: d,
|
|
447
|
-
inferredEntry:
|
|
448
|
-
entryError:
|
|
441
|
+
inferredEntry: p,
|
|
442
|
+
entryError: u
|
|
449
443
|
}) {
|
|
450
444
|
const {
|
|
451
445
|
values: h,
|
|
@@ -456,7 +450,7 @@ const Ni = Y.memo(
|
|
|
456
450
|
} = K(), x = Y.useRef(!I(h, `${i}[${r}].id`)), y = n || x.current, P = I(h, `${i}[${r}].id`), k = I(h, `${i}[${r}].label`), b = Y.useRef(k);
|
|
457
451
|
return Y.useEffect(() => {
|
|
458
452
|
(b.current === P || !P) && y && g(`${i}[${r}].id`, k), b.current = k;
|
|
459
|
-
}, [k]), /* @__PURE__ */ a(
|
|
453
|
+
}, [k]), /* @__PURE__ */ a(R, { children: [
|
|
460
454
|
/* @__PURE__ */ a("div", { className: "flex w-full align-center justify-center", children: [
|
|
461
455
|
/* @__PURE__ */ e(
|
|
462
456
|
H,
|
|
@@ -469,11 +463,11 @@ const Ni = Y.memo(
|
|
|
469
463
|
size: "small",
|
|
470
464
|
autoFocus: l,
|
|
471
465
|
autoComplete: "off",
|
|
472
|
-
endAdornment:
|
|
473
|
-
error: !!
|
|
466
|
+
endAdornment: p && /* @__PURE__ */ e(ht, { size: "small" }),
|
|
467
|
+
error: !!u?.label
|
|
474
468
|
}
|
|
475
469
|
),
|
|
476
|
-
!d && /* @__PURE__ */ e(Er, { color: "error", invisible: !
|
|
470
|
+
!d && /* @__PURE__ */ e(Er, { color: "error", invisible: !u?.id, children: /* @__PURE__ */ e(
|
|
477
471
|
oe,
|
|
478
472
|
{
|
|
479
473
|
size: "small",
|
|
@@ -484,26 +478,26 @@ const Ni = Y.memo(
|
|
|
484
478
|
}
|
|
485
479
|
) })
|
|
486
480
|
] }),
|
|
487
|
-
|
|
481
|
+
u?.label && /* @__PURE__ */ e(
|
|
488
482
|
O,
|
|
489
483
|
{
|
|
490
484
|
variant: "caption",
|
|
491
485
|
className: "ml-3.5 text-red-500 dark:text-red-500",
|
|
492
|
-
children:
|
|
486
|
+
children: u?.label
|
|
493
487
|
}
|
|
494
488
|
),
|
|
495
|
-
|
|
489
|
+
u?.id && /* @__PURE__ */ e(
|
|
496
490
|
O,
|
|
497
491
|
{
|
|
498
492
|
variant: "caption",
|
|
499
493
|
className: "ml-3.5 text-red-500 dark:text-red-500",
|
|
500
|
-
children:
|
|
494
|
+
children: u?.id
|
|
501
495
|
}
|
|
502
496
|
)
|
|
503
497
|
] });
|
|
504
498
|
},
|
|
505
499
|
function(r, n) {
|
|
506
|
-
return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry &&
|
|
500
|
+
return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry && ye(r.entryError, n.entryError) && r.autoFocus === n.autoFocus;
|
|
507
501
|
}
|
|
508
502
|
);
|
|
509
503
|
function xi({
|
|
@@ -561,7 +555,7 @@ function ce({
|
|
|
561
555
|
size: o = "small",
|
|
562
556
|
allowIndeterminate: d
|
|
563
557
|
}) {
|
|
564
|
-
const
|
|
558
|
+
const p = /* @__PURE__ */ e(
|
|
565
559
|
ct,
|
|
566
560
|
{
|
|
567
561
|
label: n,
|
|
@@ -570,32 +564,32 @@ function ce({
|
|
|
570
564
|
value: t.value,
|
|
571
565
|
disabled: l,
|
|
572
566
|
allowIndeterminate: d,
|
|
573
|
-
onValueChange: (
|
|
567
|
+
onValueChange: (u) => r.setFieldValue(t.name, u)
|
|
574
568
|
}
|
|
575
569
|
);
|
|
576
570
|
return i ? /* @__PURE__ */ e(
|
|
577
571
|
te,
|
|
578
572
|
{
|
|
579
573
|
title: i,
|
|
580
|
-
children:
|
|
574
|
+
children: p
|
|
581
575
|
}
|
|
582
|
-
) :
|
|
576
|
+
) : p;
|
|
583
577
|
}
|
|
584
578
|
function Se({ disabled: t }) {
|
|
585
579
|
const { values: r, handleChange: n } = K(), i = "validation.required", l = "validation.requiredMessage";
|
|
586
|
-
return /* @__PURE__ */ a(
|
|
580
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
587
581
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
588
582
|
H,
|
|
589
583
|
{
|
|
590
584
|
name: i,
|
|
591
585
|
type: "checkbox",
|
|
592
|
-
children: ({ field: d, form:
|
|
586
|
+
children: ({ field: d, form: p }) => /* @__PURE__ */ e(
|
|
593
587
|
ce,
|
|
594
588
|
{
|
|
595
589
|
disabled: t,
|
|
596
590
|
label: "Required",
|
|
597
591
|
tooltip: "You won't be able to save this entity if this value is not set",
|
|
598
|
-
form:
|
|
592
|
+
form: p,
|
|
599
593
|
field: d
|
|
600
594
|
}
|
|
601
595
|
)
|
|
@@ -606,13 +600,13 @@ function Se({ disabled: t }) {
|
|
|
606
600
|
{
|
|
607
601
|
name: "validation.unique",
|
|
608
602
|
type: "checkbox",
|
|
609
|
-
children: ({ field: d, form:
|
|
603
|
+
children: ({ field: d, form: p }) => /* @__PURE__ */ e(
|
|
610
604
|
ce,
|
|
611
605
|
{
|
|
612
606
|
disabled: t,
|
|
613
607
|
label: "Unique",
|
|
614
608
|
tooltip: "There cannot be multiple entities with the same value",
|
|
615
|
-
form:
|
|
609
|
+
form: p,
|
|
616
610
|
field: d
|
|
617
611
|
}
|
|
618
612
|
)
|
|
@@ -639,8 +633,8 @@ function Ee({
|
|
|
639
633
|
min: l,
|
|
640
634
|
trim: o,
|
|
641
635
|
uppercase: d,
|
|
642
|
-
disabled:
|
|
643
|
-
showErrors:
|
|
636
|
+
disabled: p,
|
|
637
|
+
showErrors: u
|
|
644
638
|
}) {
|
|
645
639
|
const {
|
|
646
640
|
values: h,
|
|
@@ -648,7 +642,7 @@ function Ee({
|
|
|
648
642
|
errors: c
|
|
649
643
|
} = K(), g = "validation.length", v = "validation.min", x = "validation.max", y = "validation.trim", P = "validation.matches", k = "validation.lowercase", b = "validation.uppercase", C = I(c, P), N = I(h, P), f = typeof N == "string" ? N : br(N);
|
|
650
644
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
651
|
-
/* @__PURE__ */ e(Se, { disabled:
|
|
645
|
+
/* @__PURE__ */ e(Se, { disabled: p }),
|
|
652
646
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
653
647
|
r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
654
648
|
H,
|
|
@@ -659,7 +653,7 @@ function Ee({
|
|
|
659
653
|
ce,
|
|
660
654
|
{
|
|
661
655
|
label: "Lowercase",
|
|
662
|
-
disabled:
|
|
656
|
+
disabled: p,
|
|
663
657
|
form: _,
|
|
664
658
|
field: w
|
|
665
659
|
}
|
|
@@ -675,7 +669,7 @@ function Ee({
|
|
|
675
669
|
ce,
|
|
676
670
|
{
|
|
677
671
|
label: "Uppercase",
|
|
678
|
-
disabled:
|
|
672
|
+
disabled: p,
|
|
679
673
|
form: _,
|
|
680
674
|
field: w
|
|
681
675
|
}
|
|
@@ -691,7 +685,7 @@ function Ee({
|
|
|
691
685
|
ce,
|
|
692
686
|
{
|
|
693
687
|
label: "Trim",
|
|
694
|
-
disabled:
|
|
688
|
+
disabled: p,
|
|
695
689
|
form: _,
|
|
696
690
|
field: w
|
|
697
691
|
}
|
|
@@ -708,7 +702,7 @@ function Ee({
|
|
|
708
702
|
name: g,
|
|
709
703
|
type: "number",
|
|
710
704
|
size: "small",
|
|
711
|
-
disabled:
|
|
705
|
+
disabled: p,
|
|
712
706
|
onChange: m
|
|
713
707
|
}
|
|
714
708
|
) }),
|
|
@@ -720,7 +714,7 @@ function Ee({
|
|
|
720
714
|
name: v,
|
|
721
715
|
type: "number",
|
|
722
716
|
size: "small",
|
|
723
|
-
disabled:
|
|
717
|
+
disabled: p,
|
|
724
718
|
onChange: m
|
|
725
719
|
}
|
|
726
720
|
) }),
|
|
@@ -732,7 +726,7 @@ function Ee({
|
|
|
732
726
|
name: x,
|
|
733
727
|
type: "number",
|
|
734
728
|
size: "small",
|
|
735
|
-
disabled:
|
|
729
|
+
disabled: p,
|
|
736
730
|
onChange: m
|
|
737
731
|
}
|
|
738
732
|
) })
|
|
@@ -745,7 +739,7 @@ function Ee({
|
|
|
745
739
|
as: Z,
|
|
746
740
|
label: "Matches regex",
|
|
747
741
|
size: "small",
|
|
748
|
-
disabled:
|
|
742
|
+
disabled: p,
|
|
749
743
|
value: f,
|
|
750
744
|
error: !!C
|
|
751
745
|
}
|
|
@@ -791,7 +785,7 @@ function Ot({
|
|
|
791
785
|
) })
|
|
792
786
|
] });
|
|
793
787
|
}
|
|
794
|
-
function
|
|
788
|
+
function xe({
|
|
795
789
|
children: t
|
|
796
790
|
}) {
|
|
797
791
|
return /* @__PURE__ */ e(
|
|
@@ -825,10 +819,10 @@ function Rt({
|
|
|
825
819
|
}) {
|
|
826
820
|
const {
|
|
827
821
|
values: d,
|
|
828
|
-
setFieldError:
|
|
829
|
-
setFieldValue:
|
|
830
|
-
} = K(), h =
|
|
831
|
-
return /* @__PURE__ */ a(
|
|
822
|
+
setFieldError: p,
|
|
823
|
+
setFieldValue: u
|
|
824
|
+
} = K(), h = _e(), m = t ? "of.enumValues" : "enumValues", c = I(d, "defaultValue"), g = I(d, m), v = Zt(() => !g || typeof g == "boolean" ? [] : Cr(g) ?? [], [g]);
|
|
825
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
832
826
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
833
827
|
Ci,
|
|
834
828
|
{
|
|
@@ -837,13 +831,13 @@ function Rt({
|
|
|
837
831
|
disabled: n,
|
|
838
832
|
allowDataInference: l,
|
|
839
833
|
onError: (y) => {
|
|
840
|
-
|
|
834
|
+
p(m, y ? "This enum property is missing some values" : void 0);
|
|
841
835
|
},
|
|
842
836
|
getData: o ? () => o().then((y) => y.map((P) => d.id && I(P, d.id)).filter(Boolean)) : void 0,
|
|
843
837
|
onValuesChanged: (y) => {
|
|
844
|
-
if (d && (
|
|
838
|
+
if (d && (u(m, y), !t)) {
|
|
845
839
|
const P = y.filter((k) => !!k?.id).map((k) => k.id);
|
|
846
|
-
c && !P.includes(c) && (
|
|
840
|
+
c && !P.includes(c) && (u("defaultValue", void 0), h.open({
|
|
847
841
|
type: "warning",
|
|
848
842
|
message: "Default value was cleared"
|
|
849
843
|
}));
|
|
@@ -851,7 +845,7 @@ function Rt({
|
|
|
851
845
|
}
|
|
852
846
|
}
|
|
853
847
|
) }),
|
|
854
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
848
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
|
|
855
849
|
!t && /* @__PURE__ */ e(
|
|
856
850
|
Ee,
|
|
857
851
|
{
|
|
@@ -862,12 +856,12 @@ function Rt({
|
|
|
862
856
|
t && /* @__PURE__ */ e(Ot, { disabled: n })
|
|
863
857
|
] }) }),
|
|
864
858
|
!t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
865
|
-
|
|
859
|
+
Ce,
|
|
866
860
|
{
|
|
867
861
|
disabled: n,
|
|
868
862
|
position: "item-aligned",
|
|
869
863
|
onValueChange: (y) => {
|
|
870
|
-
|
|
864
|
+
u("defaultValue", y);
|
|
871
865
|
},
|
|
872
866
|
label: "Default value",
|
|
873
867
|
value: c ?? "",
|
|
@@ -898,10 +892,10 @@ function Ut({
|
|
|
898
892
|
const {
|
|
899
893
|
values: i,
|
|
900
894
|
setFieldValue: l
|
|
901
|
-
} = K(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`,
|
|
895
|
+
} = K(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, p = `${o}.fileName`, u = `${o}.storagePath`, h = `${o}.storeUrl`, m = I(i, p) ?? "{rand}_{file}", c = I(i, u) ?? "/", g = I(i, d), v = Array.isArray(g) ? g : void 0, x = !v || v.length === 0, y = (b) => {
|
|
902
896
|
b ? b.includes("all") || b.length >= Object.keys(it).length ? l(d, void 0) : x ? l(d, Object.keys(it).filter((C) => !b.includes(C))) : l(d, b) : l(d, void 0);
|
|
903
897
|
}, P = typeof m == "function", k = typeof c == "function";
|
|
904
|
-
return /* @__PURE__ */ a(
|
|
898
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
905
899
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
906
900
|
xt,
|
|
907
901
|
{
|
|
@@ -960,7 +954,7 @@ function Ut({
|
|
|
960
954
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
961
955
|
H,
|
|
962
956
|
{
|
|
963
|
-
name:
|
|
957
|
+
name: p,
|
|
964
958
|
as: Z,
|
|
965
959
|
label: "File name",
|
|
966
960
|
size: "small",
|
|
@@ -972,7 +966,7 @@ function Ut({
|
|
|
972
966
|
/* @__PURE__ */ e(
|
|
973
967
|
H,
|
|
974
968
|
{
|
|
975
|
-
name:
|
|
969
|
+
name: u,
|
|
976
970
|
as: Z,
|
|
977
971
|
label: "Storage path",
|
|
978
972
|
disabled: k || n,
|
|
@@ -1013,7 +1007,7 @@ function Ut({
|
|
|
1013
1007
|
] })
|
|
1014
1008
|
}
|
|
1015
1009
|
) }),
|
|
1016
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
1010
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
|
|
1017
1011
|
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Se, { disabled: n }) }),
|
|
1018
1012
|
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ot, { disabled: n }) })
|
|
1019
1013
|
] }) })
|
|
@@ -1047,31 +1041,31 @@ function nr({
|
|
|
1047
1041
|
includeEditButton: l,
|
|
1048
1042
|
selected: o
|
|
1049
1043
|
}) {
|
|
1050
|
-
const { propertyConfigs: d } = Ae(),
|
|
1044
|
+
const { propertyConfigs: d } = Ae(), p = $e(t, d);
|
|
1051
1045
|
qe(t);
|
|
1052
|
-
const
|
|
1053
|
-
return n && console.log("PropertyFieldPreview", t), /* @__PURE__ */ e(
|
|
1046
|
+
const u = n ? "border-red-500 dark:border-red-500 border-opacity-100 dark:border-opacity-100 ring-0 dark:ring-0" : o ? "border-primary" : "border-transparent";
|
|
1047
|
+
return n && console.log("PropertyFieldPreview", t), /* @__PURE__ */ e(me, { children: /* @__PURE__ */ a(
|
|
1054
1048
|
"div",
|
|
1055
1049
|
{
|
|
1056
1050
|
onClick: r,
|
|
1057
1051
|
className: "flex flex-row w-full cursor-pointer",
|
|
1058
1052
|
children: [
|
|
1059
|
-
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ye, { propertyConfig:
|
|
1053
|
+
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ye, { propertyConfig: p }) }),
|
|
1060
1054
|
/* @__PURE__ */ a(
|
|
1061
|
-
|
|
1055
|
+
Pe,
|
|
1062
1056
|
{
|
|
1063
|
-
className:
|
|
1057
|
+
className: fe(
|
|
1064
1058
|
"border",
|
|
1065
1059
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
1066
1060
|
Qt,
|
|
1067
1061
|
r ? Xt : "",
|
|
1068
1062
|
o ? er : "",
|
|
1069
1063
|
"flex-grow p-4 border transition-colors duration-200",
|
|
1070
|
-
|
|
1064
|
+
u
|
|
1071
1065
|
),
|
|
1072
1066
|
children: [
|
|
1073
1067
|
/* @__PURE__ */ a("div", { className: "w-full flex flex-col", children: [
|
|
1074
|
-
i && /* @__PURE__ */ e(
|
|
1068
|
+
i && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
1075
1069
|
O,
|
|
1076
1070
|
{
|
|
1077
1071
|
variant: "body1",
|
|
@@ -1081,17 +1075,17 @@ function nr({
|
|
|
1081
1075
|
}
|
|
1082
1076
|
) }),
|
|
1083
1077
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center", children: [
|
|
1084
|
-
/* @__PURE__ */ e(
|
|
1078
|
+
/* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
1085
1079
|
O,
|
|
1086
1080
|
{
|
|
1087
1081
|
className: "flex-grow pr-2",
|
|
1088
1082
|
variant: i ? "body2" : "subtitle1",
|
|
1089
1083
|
component: "span",
|
|
1090
1084
|
color: "secondary",
|
|
1091
|
-
children:
|
|
1085
|
+
children: p?.name
|
|
1092
1086
|
}
|
|
1093
1087
|
) }),
|
|
1094
|
-
/* @__PURE__ */ e(
|
|
1088
|
+
/* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
1095
1089
|
O,
|
|
1096
1090
|
{
|
|
1097
1091
|
variant: "body2",
|
|
@@ -1135,9 +1129,9 @@ function Ti({
|
|
|
1135
1129
|
/* @__PURE__ */ e(Rr, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
|
|
1136
1130
|
] }),
|
|
1137
1131
|
/* @__PURE__ */ e(
|
|
1138
|
-
|
|
1132
|
+
Pe,
|
|
1139
1133
|
{
|
|
1140
|
-
className:
|
|
1134
|
+
className: fe(
|
|
1141
1135
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
1142
1136
|
Qt,
|
|
1143
1137
|
n ? Xt : "",
|
|
@@ -1166,7 +1160,7 @@ function Ti({
|
|
|
1166
1160
|
children: o?.name
|
|
1167
1161
|
}
|
|
1168
1162
|
),
|
|
1169
|
-
i && !ne(i) && /* @__PURE__ */ e(
|
|
1163
|
+
i && !ne(i) && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
1170
1164
|
O,
|
|
1171
1165
|
{
|
|
1172
1166
|
variant: "body2",
|
|
@@ -1175,7 +1169,7 @@ function Ti({
|
|
|
1175
1169
|
children: i.dataType
|
|
1176
1170
|
}
|
|
1177
1171
|
) }),
|
|
1178
|
-
i && ne(i) && /* @__PURE__ */ e(
|
|
1172
|
+
i && ne(i) && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
1179
1173
|
O,
|
|
1180
1174
|
{
|
|
1181
1175
|
variant: "body2",
|
|
@@ -1184,7 +1178,7 @@ function Ti({
|
|
|
1184
1178
|
children: "This property is defined as a property builder in code"
|
|
1185
1179
|
}
|
|
1186
1180
|
) }),
|
|
1187
|
-
!i && /* @__PURE__ */ e(
|
|
1181
|
+
!i && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
1188
1182
|
O,
|
|
1189
1183
|
{
|
|
1190
1184
|
variant: "body2",
|
|
@@ -1209,8 +1203,8 @@ const ft = Y.memo(
|
|
|
1209
1203
|
properties: l,
|
|
1210
1204
|
propertiesOrder: o,
|
|
1211
1205
|
additionalFields: d,
|
|
1212
|
-
errors:
|
|
1213
|
-
onPropertyMove:
|
|
1206
|
+
errors: p,
|
|
1207
|
+
onPropertyMove: u,
|
|
1214
1208
|
onPropertyRemove: h,
|
|
1215
1209
|
className: m,
|
|
1216
1210
|
inferredPropertyKeys: c,
|
|
@@ -1220,9 +1214,9 @@ const ft = Y.memo(
|
|
|
1220
1214
|
if (!y.destination)
|
|
1221
1215
|
return;
|
|
1222
1216
|
const P = y.source.index, k = y.destination.index, b = Array.from(v), [C] = b.splice(P, 1);
|
|
1223
|
-
b.splice(k, 0, C),
|
|
1224
|
-
}, [r,
|
|
1225
|
-
return /* @__PURE__ */ e(
|
|
1217
|
+
b.splice(k, 0, C), u && u(b, r);
|
|
1218
|
+
}, [r, u, v]);
|
|
1219
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ii, { onDragEnd: x, children: /* @__PURE__ */ e(ni, { droppableId: `droppable_${r}`, children: (y, P) => /* @__PURE__ */ a(
|
|
1226
1220
|
"div",
|
|
1227
1221
|
{
|
|
1228
1222
|
...y.droppableProps,
|
|
@@ -1236,17 +1230,17 @@ const ft = Y.memo(
|
|
|
1236
1230
|
{
|
|
1237
1231
|
draggableId: `array_field_${r}_${k}}`,
|
|
1238
1232
|
index: b,
|
|
1239
|
-
children: (f, w) => /* @__PURE__ */ e(
|
|
1233
|
+
children: (f, w) => /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
1240
1234
|
ki,
|
|
1241
1235
|
{
|
|
1242
1236
|
propertyKey: k,
|
|
1243
1237
|
propertyOrBuilder: C,
|
|
1244
1238
|
additionalField: N,
|
|
1245
1239
|
provided: f,
|
|
1246
|
-
errors:
|
|
1240
|
+
errors: p,
|
|
1247
1241
|
namespace: r,
|
|
1248
1242
|
inferredPropertyKeys: c,
|
|
1249
|
-
onPropertyMove:
|
|
1243
|
+
onPropertyMove: u,
|
|
1250
1244
|
onPropertyRemove: h,
|
|
1251
1245
|
onPropertyClick: w.isDragging ? void 0 : i,
|
|
1252
1246
|
selectedPropertyKey: n,
|
|
@@ -1264,7 +1258,7 @@ const ft = Y.memo(
|
|
|
1264
1258
|
},
|
|
1265
1259
|
(t, r) => {
|
|
1266
1260
|
const n = r.selectedPropertyKey?.startsWith(r.namespace ?? ""), i = t.selectedPropertyKey?.startsWith(t.namespace ?? "");
|
|
1267
|
-
return n || i ? !1 :
|
|
1261
|
+
return n || i ? !1 : ye(t.properties, r.properties) && t.propertiesOrder === r.propertiesOrder && ye(t.additionalFields, r.additionalFields) && ye(t.errors, r.errors) && ye(t.onPropertyClick, r.onPropertyClick) && // equal(prevProps.onPropertyMove, nextProps.onPropertyMove) &&
|
|
1268
1262
|
// equal(prevProps.onPropertyRemove, nextProps.onPropertyRemove) &&
|
|
1269
1263
|
t.namespace === r.namespace && t.collectionEditable === r.collectionEditable;
|
|
1270
1264
|
}
|
|
@@ -1277,8 +1271,8 @@ function ki({
|
|
|
1277
1271
|
provided: l,
|
|
1278
1272
|
selectedPropertyKey: o,
|
|
1279
1273
|
errors: d,
|
|
1280
|
-
onPropertyClick:
|
|
1281
|
-
onPropertyMove:
|
|
1274
|
+
onPropertyClick: p,
|
|
1275
|
+
onPropertyMove: u,
|
|
1282
1276
|
onPropertyRemove: h,
|
|
1283
1277
|
inferredPropertyKeys: m,
|
|
1284
1278
|
collectionEditable: c
|
|
@@ -1295,8 +1289,8 @@ function ki({
|
|
|
1295
1289
|
properties: C.properties,
|
|
1296
1290
|
propertiesOrder: C.propertiesOrder,
|
|
1297
1291
|
errors: d,
|
|
1298
|
-
onPropertyClick:
|
|
1299
|
-
onPropertyMove:
|
|
1292
|
+
onPropertyClick: p,
|
|
1293
|
+
onPropertyMove: u,
|
|
1300
1294
|
onPropertyRemove: h,
|
|
1301
1295
|
collectionEditable: c
|
|
1302
1296
|
}
|
|
@@ -1326,7 +1320,7 @@ function ki({
|
|
|
1326
1320
|
nr,
|
|
1327
1321
|
{
|
|
1328
1322
|
property: n,
|
|
1329
|
-
onClick:
|
|
1323
|
+
onClick: p ? () => p(t, r) : void 0,
|
|
1330
1324
|
includeName: !0,
|
|
1331
1325
|
selected: k,
|
|
1332
1326
|
hasError: y
|
|
@@ -1336,7 +1330,7 @@ function ki({
|
|
|
1336
1330
|
{
|
|
1337
1331
|
name: t,
|
|
1338
1332
|
property: n,
|
|
1339
|
-
onClick:
|
|
1333
|
+
onClick: p ? () => p(t, r) : void 0,
|
|
1340
1334
|
selected: k
|
|
1341
1335
|
}
|
|
1342
1336
|
),
|
|
@@ -1351,7 +1345,7 @@ function ki({
|
|
|
1351
1345
|
children: /* @__PURE__ */ e(Ur, { size: "small" })
|
|
1352
1346
|
}
|
|
1353
1347
|
) }),
|
|
1354
|
-
|
|
1348
|
+
u && /* @__PURE__ */ e(te, { title: "Move", children: /* @__PURE__ */ e(
|
|
1355
1349
|
oe,
|
|
1356
1350
|
{
|
|
1357
1351
|
component: "span",
|
|
@@ -1369,7 +1363,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1369
1363
|
const {
|
|
1370
1364
|
values: o,
|
|
1371
1365
|
setFieldValue: d
|
|
1372
|
-
} = K(), [
|
|
1366
|
+
} = K(), [p, u] = $(!1), [h, m] = $(), [c, g] = $(), v = o.propertiesOrder ?? Object.keys(o.properties ?? {}), x = ({
|
|
1373
1367
|
id: N,
|
|
1374
1368
|
property: f
|
|
1375
1369
|
}) => {
|
|
@@ -1380,17 +1374,17 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1380
1374
|
[N]: f
|
|
1381
1375
|
}, !1);
|
|
1382
1376
|
const w = o.propertiesOrder ?? Object.keys(o.properties ?? {}), _ = w.includes(N) ? w : [...w, N];
|
|
1383
|
-
d("propertiesOrder", _, !1),
|
|
1377
|
+
d("propertiesOrder", _, !1), u(!1);
|
|
1384
1378
|
}, y = Q((N, f) => {
|
|
1385
1379
|
const w = N ? ae(N, f) : void 0;
|
|
1386
1380
|
if (!w)
|
|
1387
1381
|
throw Error("collection editor miss config");
|
|
1388
|
-
const _ =
|
|
1389
|
-
d(_, void 0, !1), d(M,
|
|
1382
|
+
const _ = he(w), M = be(f), U = I(o, M) ?? Object.keys(I(o, bi(f)));
|
|
1383
|
+
d(_, void 0, !1), d(M, U.filter((D) => D !== N), !1), u(!1), m(void 0), g(void 0);
|
|
1390
1384
|
}, [d, o]), P = h ? ae(h, c) : void 0, k = P ? I(o.properties, P.replaceAll(".", ".properties.")) : void 0, b = !v || v.length < 1, C = Q((N, f) => {
|
|
1391
|
-
d(
|
|
1385
|
+
d(be(f), N, !1);
|
|
1392
1386
|
}, []);
|
|
1393
|
-
return /* @__PURE__ */ a(
|
|
1387
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1394
1388
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1395
1389
|
/* @__PURE__ */ a("div", { className: "flex justify-between items-end my-4", children: [
|
|
1396
1390
|
/* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this group" }),
|
|
@@ -1399,7 +1393,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1399
1393
|
{
|
|
1400
1394
|
color: "primary",
|
|
1401
1395
|
variant: "outlined",
|
|
1402
|
-
onClick: () =>
|
|
1396
|
+
onClick: () => u(!0),
|
|
1403
1397
|
startIcon: /* @__PURE__ */ e(se, {}),
|
|
1404
1398
|
children: [
|
|
1405
1399
|
"Add property to ",
|
|
@@ -1408,7 +1402,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1408
1402
|
}
|
|
1409
1403
|
)
|
|
1410
1404
|
] }),
|
|
1411
|
-
/* @__PURE__ */ a(
|
|
1405
|
+
/* @__PURE__ */ a(Pe, { className: "p-2 pl-8", children: [
|
|
1412
1406
|
/* @__PURE__ */ e(
|
|
1413
1407
|
ft,
|
|
1414
1408
|
{
|
|
@@ -1417,7 +1411,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1417
1411
|
errors: {},
|
|
1418
1412
|
collectionEditable: l,
|
|
1419
1413
|
onPropertyClick: (N, f) => {
|
|
1420
|
-
m(N), g(f),
|
|
1414
|
+
m(N), g(f), u(!0);
|
|
1421
1415
|
},
|
|
1422
1416
|
onPropertyMove: C
|
|
1423
1417
|
}
|
|
@@ -1446,18 +1440,18 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1446
1440
|
/* @__PURE__ */ e(X, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
|
|
1447
1441
|
] }),
|
|
1448
1442
|
/* @__PURE__ */ e(
|
|
1449
|
-
|
|
1443
|
+
Ie,
|
|
1450
1444
|
{
|
|
1451
1445
|
inArray: !1,
|
|
1452
1446
|
forceShowErrors: !1,
|
|
1453
|
-
open:
|
|
1447
|
+
open: p,
|
|
1454
1448
|
allowDataInference: n,
|
|
1455
1449
|
collectionEditable: l,
|
|
1456
1450
|
onCancel: () => {
|
|
1457
|
-
|
|
1451
|
+
u(!1), m(void 0), g(void 0);
|
|
1458
1452
|
},
|
|
1459
1453
|
onOkClicked: () => {
|
|
1460
|
-
|
|
1454
|
+
u(!1), m(void 0), g(void 0);
|
|
1461
1455
|
},
|
|
1462
1456
|
getData: r,
|
|
1463
1457
|
onDelete: y,
|
|
@@ -1484,15 +1478,15 @@ function Vi({
|
|
|
1484
1478
|
collectionEditable: d
|
|
1485
1479
|
}) {
|
|
1486
1480
|
const {
|
|
1487
|
-
values:
|
|
1488
|
-
handleChange:
|
|
1481
|
+
values: p,
|
|
1482
|
+
handleChange: u,
|
|
1489
1483
|
errors: h,
|
|
1490
1484
|
setFieldValue: m,
|
|
1491
1485
|
touched: c
|
|
1492
|
-
} = K(), [g, v] = $(!1), x = I(
|
|
1486
|
+
} = K(), [g, v] = $(!1), x = I(p, "of"), y = I(c, "of") && I(h, "of"), P = ({ id: b, property: C, namespace: N }) => {
|
|
1493
1487
|
console.log("onPropertyChanged", b, C, N), m("of", C);
|
|
1494
1488
|
}, k = x && $e(x, o);
|
|
1495
|
-
return /* @__PURE__ */ a(
|
|
1489
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1496
1490
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1497
1491
|
/* @__PURE__ */ e(O, { variant: "subtitle2", children: "Repeat component" }),
|
|
1498
1492
|
/* @__PURE__ */ e(
|
|
@@ -1500,7 +1494,7 @@ function Vi({
|
|
|
1500
1494
|
{
|
|
1501
1495
|
name: "of",
|
|
1502
1496
|
value: x,
|
|
1503
|
-
children: ({}) => /* @__PURE__ */ a(
|
|
1497
|
+
children: ({}) => /* @__PURE__ */ a(Pe, { className: "p-2 mt-4", children: [
|
|
1504
1498
|
x && /* @__PURE__ */ e(
|
|
1505
1499
|
nr,
|
|
1506
1500
|
{
|
|
@@ -1526,7 +1520,7 @@ function Vi({
|
|
|
1526
1520
|
}
|
|
1527
1521
|
),
|
|
1528
1522
|
/* @__PURE__ */ e(
|
|
1529
|
-
|
|
1523
|
+
Ie,
|
|
1530
1524
|
{
|
|
1531
1525
|
inArray: !0,
|
|
1532
1526
|
open: g,
|
|
@@ -1548,7 +1542,7 @@ function Vi({
|
|
|
1548
1542
|
}
|
|
1549
1543
|
)
|
|
1550
1544
|
] }),
|
|
1551
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1545
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ot, { disabled: n }) }) })
|
|
1552
1546
|
] });
|
|
1553
1547
|
}
|
|
1554
1548
|
const Ii = Y.forwardRef(
|
|
@@ -1560,13 +1554,13 @@ const Ii = Y.forwardRef(
|
|
|
1560
1554
|
isNewProperty: o
|
|
1561
1555
|
}, d) {
|
|
1562
1556
|
const {
|
|
1563
|
-
errors:
|
|
1564
|
-
values:
|
|
1557
|
+
errors: p,
|
|
1558
|
+
values: u,
|
|
1565
1559
|
setFieldValue: h,
|
|
1566
1560
|
setFieldTouched: m,
|
|
1567
1561
|
touched: c,
|
|
1568
1562
|
validate: g
|
|
1569
|
-
} = K(), v = "name", x = r && I(
|
|
1563
|
+
} = K(), v = "name", x = r && I(p, v), y = "id", P = r && I(p, y), k = "description", b = r && I(p, k);
|
|
1570
1564
|
return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 col-span-12", children: [
|
|
1571
1565
|
/* @__PURE__ */ a("div", { children: [
|
|
1572
1566
|
/* @__PURE__ */ e(
|
|
@@ -1575,7 +1569,7 @@ const Ii = Y.forwardRef(
|
|
|
1575
1569
|
name: v,
|
|
1576
1570
|
inputRef: d,
|
|
1577
1571
|
as: Z,
|
|
1578
|
-
value:
|
|
1572
|
+
value: u[v],
|
|
1579
1573
|
onChange: (C) => {
|
|
1580
1574
|
const N = C.target.value;
|
|
1581
1575
|
!I(c, y) && l && h(y, N ? Pt(N) : "", !1), h(v, N, !0), m(v, !0);
|
|
@@ -1596,7 +1590,7 @@ const Ii = Y.forwardRef(
|
|
|
1596
1590
|
name: y,
|
|
1597
1591
|
as: Z,
|
|
1598
1592
|
label: "ID",
|
|
1599
|
-
value:
|
|
1593
|
+
value: u[y],
|
|
1600
1594
|
onChange: (C) => {
|
|
1601
1595
|
const N = C.target.value;
|
|
1602
1596
|
!I(c, v) && l && h(v, N ? ut(N) : ""), h(y, N, !0), m(y, !0);
|
|
@@ -1631,8 +1625,8 @@ function _i({
|
|
|
1631
1625
|
showErrors: n
|
|
1632
1626
|
}) {
|
|
1633
1627
|
const { values: i, setFieldValue: l } = K();
|
|
1634
|
-
return /* @__PURE__ */ a(
|
|
1635
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
1628
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1629
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
|
|
1636
1630
|
t === "text_field" && /* @__PURE__ */ e(
|
|
1637
1631
|
Ee,
|
|
1638
1632
|
{
|
|
@@ -1685,7 +1679,7 @@ function _i({
|
|
|
1685
1679
|
)
|
|
1686
1680
|
] }) }),
|
|
1687
1681
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1688
|
-
|
|
1682
|
+
Ve,
|
|
1689
1683
|
{
|
|
1690
1684
|
name: "defaultValue",
|
|
1691
1685
|
disabled: r,
|
|
@@ -1700,8 +1694,8 @@ function _i({
|
|
|
1700
1694
|
}
|
|
1701
1695
|
function Fi({ disabled: t }) {
|
|
1702
1696
|
const { values: r } = K(), n = I(r, "defaultValue");
|
|
1703
|
-
return /* @__PURE__ */ a(
|
|
1704
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1697
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1698
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }),
|
|
1705
1699
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1706
1700
|
H,
|
|
1707
1701
|
{
|
|
@@ -1724,7 +1718,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1724
1718
|
const {
|
|
1725
1719
|
values: o,
|
|
1726
1720
|
setFieldValue: d
|
|
1727
|
-
} = K(), [
|
|
1721
|
+
} = K(), [p, u] = $(!1), [h, m] = $(), [c, g] = $(), v = ({
|
|
1728
1722
|
id: C,
|
|
1729
1723
|
property: N
|
|
1730
1724
|
}) => {
|
|
@@ -1735,20 +1729,20 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1735
1729
|
[C]: N
|
|
1736
1730
|
}, !1);
|
|
1737
1731
|
const f = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), w = f.includes(C) ? f : [...f, C];
|
|
1738
|
-
d("oneOf.propertiesOrder", w, !1),
|
|
1732
|
+
d("oneOf.propertiesOrder", w, !1), u(!1);
|
|
1739
1733
|
}, x = h ? ae(h, c) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, P = Q((C, N) => {
|
|
1740
1734
|
const f = C ? ae(C, N) : void 0;
|
|
1741
1735
|
if (!f)
|
|
1742
1736
|
throw Error("collection editor miss config");
|
|
1743
|
-
d(`oneOf.${
|
|
1744
|
-
const w = `oneOf.${
|
|
1745
|
-
d(w, _.filter((M) => M !== C), !1),
|
|
1737
|
+
d(`oneOf.${he(f)}`, void 0, !1);
|
|
1738
|
+
const w = `oneOf.${be(N)}`, _ = I(o, w);
|
|
1739
|
+
d(w, _.filter((M) => M !== C), !1), u(!1), m(void 0), g(void 0);
|
|
1746
1740
|
}, [d, o]), k = /* @__PURE__ */ a(
|
|
1747
1741
|
z,
|
|
1748
1742
|
{
|
|
1749
1743
|
autoFocus: !0,
|
|
1750
1744
|
color: "primary",
|
|
1751
|
-
onClick: () =>
|
|
1745
|
+
onClick: () => u(!0),
|
|
1752
1746
|
startIcon: /* @__PURE__ */ e(se, {}),
|
|
1753
1747
|
children: [
|
|
1754
1748
|
"Add property to ",
|
|
@@ -1756,15 +1750,15 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1756
1750
|
]
|
|
1757
1751
|
}
|
|
1758
1752
|
), b = Q((C, N) => {
|
|
1759
|
-
d(`oneOf.${
|
|
1753
|
+
d(`oneOf.${be(N)}`, C, !1);
|
|
1760
1754
|
}, []);
|
|
1761
|
-
return /* @__PURE__ */ a(
|
|
1755
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1762
1756
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1763
1757
|
/* @__PURE__ */ a("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
|
|
1764
1758
|
/* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this block" }),
|
|
1765
1759
|
k
|
|
1766
1760
|
] }),
|
|
1767
|
-
/* @__PURE__ */ a(
|
|
1761
|
+
/* @__PURE__ */ a(Pe, { className: "p-2 pl-8", children: [
|
|
1768
1762
|
/* @__PURE__ */ e(
|
|
1769
1763
|
ft,
|
|
1770
1764
|
{
|
|
@@ -1773,7 +1767,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1773
1767
|
errors: {},
|
|
1774
1768
|
collectionEditable: l,
|
|
1775
1769
|
onPropertyClick: t ? void 0 : (C, N) => {
|
|
1776
|
-
m(C), g(N),
|
|
1770
|
+
m(C), g(N), u(!0);
|
|
1777
1771
|
},
|
|
1778
1772
|
onPropertyMove: t ? void 0 : b
|
|
1779
1773
|
}
|
|
@@ -1782,18 +1776,18 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1782
1776
|
] })
|
|
1783
1777
|
] }),
|
|
1784
1778
|
!t && /* @__PURE__ */ e(
|
|
1785
|
-
|
|
1779
|
+
Ie,
|
|
1786
1780
|
{
|
|
1787
1781
|
inArray: !1,
|
|
1788
1782
|
forceShowErrors: !1,
|
|
1789
|
-
open:
|
|
1783
|
+
open: p,
|
|
1790
1784
|
getData: r,
|
|
1791
1785
|
allowDataInference: n,
|
|
1792
1786
|
onCancel: () => {
|
|
1793
|
-
|
|
1787
|
+
u(!1), m(void 0), g(void 0);
|
|
1794
1788
|
},
|
|
1795
1789
|
onOkClicked: () => {
|
|
1796
|
-
|
|
1790
|
+
u(!1), m(void 0), g(void 0);
|
|
1797
1791
|
},
|
|
1798
1792
|
collectionEditable: l,
|
|
1799
1793
|
onDelete: P,
|
|
@@ -1917,10 +1911,10 @@ function Ei({ disabled: t }) {
|
|
|
1917
1911
|
}
|
|
1918
1912
|
function Ai({ disabled: t }) {
|
|
1919
1913
|
const { values: r, setFieldValue: n } = K();
|
|
1920
|
-
return /* @__PURE__ */ a(
|
|
1921
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1914
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1915
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ei, { disabled: t }) }) }),
|
|
1922
1916
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1923
|
-
|
|
1917
|
+
Ve,
|
|
1924
1918
|
{
|
|
1925
1919
|
name: "defaultValue",
|
|
1926
1920
|
disabled: t,
|
|
@@ -1945,14 +1939,14 @@ function jt({
|
|
|
1945
1939
|
handleChange: o,
|
|
1946
1940
|
errors: d
|
|
1947
1941
|
} = K();
|
|
1948
|
-
if (!
|
|
1942
|
+
if (!Ne())
|
|
1949
1943
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(De, {}) });
|
|
1950
|
-
const
|
|
1951
|
-
return /* @__PURE__ */ e(
|
|
1944
|
+
const u = r ? "of.path" : "path", h = I(l, u), m = i && I(d, u);
|
|
1945
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1952
1946
|
H,
|
|
1953
1947
|
{
|
|
1954
|
-
name:
|
|
1955
|
-
pathPath:
|
|
1948
|
+
name: u,
|
|
1949
|
+
pathPath: u,
|
|
1956
1950
|
type: "select",
|
|
1957
1951
|
disabled: t && !!h || n,
|
|
1958
1952
|
value: h,
|
|
@@ -1970,15 +1964,15 @@ function Di({
|
|
|
1970
1964
|
error: l,
|
|
1971
1965
|
...o
|
|
1972
1966
|
}) {
|
|
1973
|
-
const d =
|
|
1967
|
+
const d = Ne();
|
|
1974
1968
|
if (!d)
|
|
1975
1969
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(De, {}) });
|
|
1976
|
-
const
|
|
1977
|
-
Object.values(
|
|
1978
|
-
).values()), h =
|
|
1979
|
-
return /* @__PURE__ */ a(
|
|
1970
|
+
const p = d?.collections ?? [], u = Array.from(new Set(
|
|
1971
|
+
Object.values(p).map((m) => m.group).filter(Boolean)
|
|
1972
|
+
).values()), h = p.filter((m) => !m.group);
|
|
1973
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1980
1974
|
/* @__PURE__ */ a(
|
|
1981
|
-
|
|
1975
|
+
Ce,
|
|
1982
1976
|
{
|
|
1983
1977
|
error: !!l,
|
|
1984
1978
|
disabled: t,
|
|
@@ -1988,7 +1982,7 @@ function Di({
|
|
|
1988
1982
|
onChange: i,
|
|
1989
1983
|
label: "Target collection",
|
|
1990
1984
|
renderValue: (m) => {
|
|
1991
|
-
const c =
|
|
1985
|
+
const c = p.find((g) => g.id === m || g.path === m);
|
|
1992
1986
|
return c ? /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
1993
1987
|
/* @__PURE__ */ e(ot, { collectionOrView: c }),
|
|
1994
1988
|
/* @__PURE__ */ e(
|
|
@@ -2003,11 +1997,11 @@ function Di({
|
|
|
2003
1997
|
},
|
|
2004
1998
|
...o,
|
|
2005
1999
|
children: [
|
|
2006
|
-
|
|
2000
|
+
u.flatMap((m) => /* @__PURE__ */ e(
|
|
2007
2001
|
At,
|
|
2008
2002
|
{
|
|
2009
2003
|
label: m || "Views",
|
|
2010
|
-
children:
|
|
2004
|
+
children: p.filter((c) => c.group === m).map((c) => /* @__PURE__ */ e(
|
|
2011
2005
|
ee,
|
|
2012
2006
|
{
|
|
2013
2007
|
value: c.id ?? c.path,
|
|
@@ -2058,15 +2052,15 @@ function Bi({ disabled: t }) {
|
|
|
2058
2052
|
errors: n,
|
|
2059
2053
|
touched: i,
|
|
2060
2054
|
setFieldValue: l
|
|
2061
|
-
} = K(), o = "mode", d = I(r, o),
|
|
2062
|
-
return /* @__PURE__ */ a(
|
|
2055
|
+
} = K(), o = "mode", d = I(r, o), p = I(i, o) && I(n, o), u = "autoValue", h = I(r, u), m = I(i, u) && I(n, u);
|
|
2056
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
2063
2057
|
/* @__PURE__ */ a("div", { className: "flex flex-col col-span-12", children: [
|
|
2064
2058
|
/* @__PURE__ */ a(
|
|
2065
|
-
|
|
2059
|
+
Ce,
|
|
2066
2060
|
{
|
|
2067
2061
|
name: o,
|
|
2068
2062
|
value: d ?? "date",
|
|
2069
|
-
error: !!
|
|
2063
|
+
error: !!p,
|
|
2070
2064
|
onValueChange: (c) => l(o, c),
|
|
2071
2065
|
label: "Mode",
|
|
2072
2066
|
renderValue: (c) => {
|
|
@@ -2086,14 +2080,14 @@ function Bi({ disabled: t }) {
|
|
|
2086
2080
|
]
|
|
2087
2081
|
}
|
|
2088
2082
|
),
|
|
2089
|
-
/* @__PURE__ */ e(X, { error: !!
|
|
2083
|
+
/* @__PURE__ */ e(X, { error: !!p, children: p }),
|
|
2090
2084
|
/* @__PURE__ */ a(
|
|
2091
|
-
|
|
2085
|
+
Ce,
|
|
2092
2086
|
{
|
|
2093
|
-
name:
|
|
2087
|
+
name: u,
|
|
2094
2088
|
disabled: t,
|
|
2095
2089
|
value: h ?? "",
|
|
2096
|
-
onValueChange: (c) => l(
|
|
2090
|
+
onValueChange: (c) => l(u, c === "none" ? null : c),
|
|
2097
2091
|
renderValue: (c) => {
|
|
2098
2092
|
switch (c) {
|
|
2099
2093
|
case "on_create":
|
|
@@ -2107,7 +2101,7 @@ function Bi({ disabled: t }) {
|
|
|
2107
2101
|
error: !!m,
|
|
2108
2102
|
label: "Automatic value",
|
|
2109
2103
|
children: [
|
|
2110
|
-
/* @__PURE__ */ e(ee, { value: "", children: " None " }),
|
|
2104
|
+
/* @__PURE__ */ e(ee, { value: "none", children: " None " }),
|
|
2111
2105
|
/* @__PURE__ */ e(ee, { value: "on_create", children: " On create " }),
|
|
2112
2106
|
/* @__PURE__ */ e(ee, { value: "on_update", children: " On any update " })
|
|
2113
2107
|
]
|
|
@@ -2115,7 +2109,7 @@ function Bi({ disabled: t }) {
|
|
|
2115
2109
|
),
|
|
2116
2110
|
/* @__PURE__ */ e(X, { error: !!m, children: m ?? "Update this field automatically when creating or updating the entity" })
|
|
2117
2111
|
] }),
|
|
2118
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2112
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) })
|
|
2119
2113
|
] });
|
|
2120
2114
|
}
|
|
2121
2115
|
function zi({ disabled: t }) {
|
|
@@ -2150,7 +2144,7 @@ function zi({ disabled: t }) {
|
|
|
2150
2144
|
] });
|
|
2151
2145
|
}
|
|
2152
2146
|
function Mi({ disabled: t }) {
|
|
2153
|
-
return /* @__PURE__ */ e(
|
|
2147
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }) });
|
|
2154
2148
|
}
|
|
2155
2149
|
function ar(t, r, n) {
|
|
2156
2150
|
let i;
|
|
@@ -2374,7 +2368,7 @@ function or({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
|
|
|
2374
2368
|
children: /* @__PURE__ */ a(
|
|
2375
2369
|
"div",
|
|
2376
2370
|
{
|
|
2377
|
-
className:
|
|
2371
|
+
className: fe(
|
|
2378
2372
|
"flex flex-row items-center text-base min-h-[52px]",
|
|
2379
2373
|
r ? "w-full" : ""
|
|
2380
2374
|
),
|
|
@@ -2403,9 +2397,9 @@ function Ri({
|
|
|
2403
2397
|
showErrors: r
|
|
2404
2398
|
}) {
|
|
2405
2399
|
const { values: n, setFieldValue: i } = K(), l = I(n, "url");
|
|
2406
|
-
return /* @__PURE__ */ a(
|
|
2400
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
2407
2401
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
2408
|
-
|
|
2402
|
+
Ce,
|
|
2409
2403
|
{
|
|
2410
2404
|
disabled: t,
|
|
2411
2405
|
position: "item-aligned",
|
|
@@ -2434,7 +2428,7 @@ function Ri({
|
|
|
2434
2428
|
]
|
|
2435
2429
|
}
|
|
2436
2430
|
) }),
|
|
2437
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2431
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(
|
|
2438
2432
|
Ee,
|
|
2439
2433
|
{
|
|
2440
2434
|
disabled: t,
|
|
@@ -2445,7 +2439,7 @@ function Ri({
|
|
|
2445
2439
|
}
|
|
2446
2440
|
) }) }),
|
|
2447
2441
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2448
|
-
|
|
2442
|
+
Ve,
|
|
2449
2443
|
{
|
|
2450
2444
|
name: "defaultValue",
|
|
2451
2445
|
disabled: t,
|
|
@@ -2487,8 +2481,8 @@ const Ui = [
|
|
|
2487
2481
|
existingProperty: l,
|
|
2488
2482
|
autoUpdateId: o,
|
|
2489
2483
|
inArray: d,
|
|
2490
|
-
propertyKey:
|
|
2491
|
-
existingPropertyKeys:
|
|
2484
|
+
propertyKey: p,
|
|
2485
|
+
existingPropertyKeys: u,
|
|
2492
2486
|
propertyNamespace: h,
|
|
2493
2487
|
property: m,
|
|
2494
2488
|
onPropertyChanged: c,
|
|
@@ -2506,10 +2500,10 @@ const Ui = [
|
|
|
2506
2500
|
id: "",
|
|
2507
2501
|
name: ""
|
|
2508
2502
|
}, _ = !!(m && !qe(m)) && !f, M = Le(m ? {
|
|
2509
|
-
id:
|
|
2510
|
-
previousId:
|
|
2503
|
+
id: p,
|
|
2504
|
+
previousId: p,
|
|
2511
2505
|
property: m
|
|
2512
|
-
} : void 0),
|
|
2506
|
+
} : void 0), U = ({
|
|
2513
2507
|
id: A,
|
|
2514
2508
|
property: s
|
|
2515
2509
|
}) => {
|
|
@@ -2521,7 +2515,7 @@ const Ui = [
|
|
|
2521
2515
|
};
|
|
2522
2516
|
M.current = V, c?.(V);
|
|
2523
2517
|
}, D = Tt({
|
|
2524
|
-
initialValues: m ? { id:
|
|
2518
|
+
initialValues: m ? { id: p, ...m } : w,
|
|
2525
2519
|
initialErrors: y,
|
|
2526
2520
|
validateOnChange: !0,
|
|
2527
2521
|
validateOnInitialRender: !0,
|
|
@@ -2531,7 +2525,7 @@ const Ui = [
|
|
|
2531
2525
|
id: V,
|
|
2532
2526
|
...G
|
|
2533
2527
|
} = A;
|
|
2534
|
-
|
|
2528
|
+
U({
|
|
2535
2529
|
id: V,
|
|
2536
2530
|
property: { ...G, editable: G.editable ?? !0 }
|
|
2537
2531
|
}), l || s.resetForm({ values: w });
|
|
@@ -2548,7 +2542,7 @@ const Ui = [
|
|
|
2548
2542
|
if (!A.id)
|
|
2549
2543
|
s.id = "Required";
|
|
2550
2544
|
else {
|
|
2551
|
-
const V = qi(A.id,
|
|
2545
|
+
const V = qi(A.id, u);
|
|
2552
2546
|
V && (s.id = V);
|
|
2553
2547
|
}
|
|
2554
2548
|
}
|
|
@@ -2562,7 +2556,7 @@ const Ui = [
|
|
|
2562
2556
|
}, [D, b]), /* @__PURE__ */ e(kt, { value: D, children: /* @__PURE__ */ e(
|
|
2563
2557
|
ji,
|
|
2564
2558
|
{
|
|
2565
|
-
onPropertyChanged: g ?
|
|
2559
|
+
onPropertyChanged: g ? U : void 0,
|
|
2566
2560
|
onDelete: v,
|
|
2567
2561
|
includeIdAndTitle: n,
|
|
2568
2562
|
propertyNamespace: h,
|
|
@@ -2583,7 +2577,7 @@ const Ui = [
|
|
|
2583
2577
|
},
|
|
2584
2578
|
(t, r) => t.getData === r.getData && t.propertyKey === r.propertyKey && t.propertyNamespace === r.propertyNamespace && t.includeIdAndName === r.includeIdAndName && t.autoOpenTypeSelect === r.autoOpenTypeSelect && t.autoUpdateId === r.autoUpdateId && t.existingProperty === r.existingProperty
|
|
2585
2579
|
);
|
|
2586
|
-
function
|
|
2580
|
+
function Ie({
|
|
2587
2581
|
open: t,
|
|
2588
2582
|
onCancel: r,
|
|
2589
2583
|
onOkClicked: n,
|
|
@@ -2592,7 +2586,7 @@ function Ve({
|
|
|
2592
2586
|
collectionEditable: o,
|
|
2593
2587
|
...d
|
|
2594
2588
|
}) {
|
|
2595
|
-
const
|
|
2589
|
+
const p = Le();
|
|
2596
2590
|
return /* @__PURE__ */ e(
|
|
2597
2591
|
Fe,
|
|
2598
2592
|
{
|
|
@@ -2605,7 +2599,7 @@ function Ve({
|
|
|
2605
2599
|
noValidate: !0,
|
|
2606
2600
|
autoComplete: "off",
|
|
2607
2601
|
onSubmit: (h) => {
|
|
2608
|
-
h.preventDefault(), h.stopPropagation(),
|
|
2602
|
+
h.preventDefault(), h.stopPropagation(), p.current?.handleSubmit(h);
|
|
2609
2603
|
},
|
|
2610
2604
|
children: [
|
|
2611
2605
|
/* @__PURE__ */ e(Be, { children: /* @__PURE__ */ e(
|
|
@@ -2618,7 +2612,7 @@ function Ve({
|
|
|
2618
2612
|
collectionEditable: o,
|
|
2619
2613
|
onPropertyChangedImmediate: !1,
|
|
2620
2614
|
getController: (h) => {
|
|
2621
|
-
|
|
2615
|
+
p.current = h;
|
|
2622
2616
|
},
|
|
2623
2617
|
getData: l
|
|
2624
2618
|
}
|
|
@@ -2629,7 +2623,7 @@ function Ve({
|
|
|
2629
2623
|
{
|
|
2630
2624
|
variant: "text",
|
|
2631
2625
|
onClick: () => {
|
|
2632
|
-
r(),
|
|
2626
|
+
r(), p.current?.resetForm();
|
|
2633
2627
|
},
|
|
2634
2628
|
children: "Cancel"
|
|
2635
2629
|
}
|
|
@@ -2658,8 +2652,8 @@ function ji({
|
|
|
2658
2652
|
autoUpdateId: l = !1,
|
|
2659
2653
|
autoOpenTypeSelect: o,
|
|
2660
2654
|
includeIdAndTitle: d,
|
|
2661
|
-
onPropertyChanged:
|
|
2662
|
-
onDelete:
|
|
2655
|
+
onPropertyChanged: p,
|
|
2656
|
+
onDelete: u,
|
|
2663
2657
|
propertyNamespace: h,
|
|
2664
2658
|
onError: m,
|
|
2665
2659
|
showErrors: c,
|
|
@@ -2670,20 +2664,20 @@ function ji({
|
|
|
2670
2664
|
propertyConfigs: P,
|
|
2671
2665
|
collectionEditable: k
|
|
2672
2666
|
}) {
|
|
2673
|
-
const [b, C] = $(o), [N, f] = $(!1), [w, _] = $(t?.dataType ? Kt(t) : void 0), M = Object.entries(lr).concat(Object.entries(P)),
|
|
2667
|
+
const [b, C] = $(o), [N, f] = $(!1), [w, _] = $(t?.dataType ? Kt(t) : void 0), M = Object.entries(lr).concat(Object.entries(P)), U = v ? M.filter(([q, L]) => !ne(L.property) && L.property?.dataType !== "array") : M, D = Ir(t), A = Le(null), s = Le(t), V = c && I(r, "selectedWidget");
|
|
2674
2668
|
de(() => {
|
|
2675
|
-
if (
|
|
2669
|
+
if (p && (!d || D.id)) {
|
|
2676
2670
|
const {
|
|
2677
2671
|
id: q,
|
|
2678
2672
|
...L
|
|
2679
2673
|
} = D;
|
|
2680
|
-
|
|
2674
|
+
ye(D, s.current) || (p({
|
|
2681
2675
|
id: q,
|
|
2682
2676
|
property: L,
|
|
2683
2677
|
namespace: h
|
|
2684
2678
|
}), s.current = D);
|
|
2685
2679
|
}
|
|
2686
|
-
}, [D, d,
|
|
2680
|
+
}, [D, d, p, h]), de(() => {
|
|
2687
2681
|
t?.id && m && m(t?.id, h, r);
|
|
2688
2682
|
}, [r, m, h, t?.id]);
|
|
2689
2683
|
const G = (q) => {
|
|
@@ -2784,7 +2778,7 @@ function ji({
|
|
|
2784
2778
|
collectionEditable: k,
|
|
2785
2779
|
propertyConfigs: P
|
|
2786
2780
|
}
|
|
2787
|
-
) : w === "key_value" ? B = /* @__PURE__ */ e(Mi, { disabled: g }) : B = null, /* @__PURE__ */ a(
|
|
2781
|
+
) : w === "key_value" ? B = /* @__PURE__ */ e(Mi, { disabled: g }) : B = null, /* @__PURE__ */ a(R, { children: [
|
|
2788
2782
|
g && /* @__PURE__ */ a(Lr, { mode: "warn", children: [
|
|
2789
2783
|
/* @__PURE__ */ e(O, { children: "This property can't be edited" }),
|
|
2790
2784
|
/* @__PURE__ */ a(O, { variant: "caption", children: [
|
|
@@ -2796,7 +2790,7 @@ function ji({
|
|
|
2796
2790
|
/* @__PURE__ */ a("div", { className: "flex mt-2 justify-between", children: [
|
|
2797
2791
|
/* @__PURE__ */ a("div", { className: "w-full flex flex-col gap-2", children: [
|
|
2798
2792
|
/* @__PURE__ */ e(
|
|
2799
|
-
|
|
2793
|
+
Ce,
|
|
2800
2794
|
{
|
|
2801
2795
|
error: !!V,
|
|
2802
2796
|
value: w ?? "",
|
|
@@ -2815,7 +2809,7 @@ function ji({
|
|
|
2815
2809
|
onClick: (re) => {
|
|
2816
2810
|
we && (re.stopPropagation(), re.preventDefault());
|
|
2817
2811
|
},
|
|
2818
|
-
className:
|
|
2812
|
+
className: fe(
|
|
2819
2813
|
"flex items-center",
|
|
2820
2814
|
we ? "w-full pointer-events-none opacity-50" : ""
|
|
2821
2815
|
),
|
|
@@ -2839,7 +2833,7 @@ function ji({
|
|
|
2839
2833
|
onValueChange: (q) => {
|
|
2840
2834
|
G(q);
|
|
2841
2835
|
},
|
|
2842
|
-
children:
|
|
2836
|
+
children: U.map(([q, L]) => {
|
|
2843
2837
|
const J = L.property, le = i && !ne(J) && J.dataType !== t?.dataType;
|
|
2844
2838
|
return /* @__PURE__ */ e(
|
|
2845
2839
|
or,
|
|
@@ -2864,7 +2858,7 @@ function ji({
|
|
|
2864
2858
|
}
|
|
2865
2859
|
)
|
|
2866
2860
|
] }),
|
|
2867
|
-
|
|
2861
|
+
u && t?.id && /* @__PURE__ */ e(
|
|
2868
2862
|
oe,
|
|
2869
2863
|
{
|
|
2870
2864
|
variant: "ghost",
|
|
@@ -2890,11 +2884,11 @@ function ji({
|
|
|
2890
2884
|
B,
|
|
2891
2885
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled: g }) })
|
|
2892
2886
|
] }),
|
|
2893
|
-
|
|
2887
|
+
u && /* @__PURE__ */ e(
|
|
2894
2888
|
lt,
|
|
2895
2889
|
{
|
|
2896
2890
|
open: N,
|
|
2897
|
-
onAccept: () =>
|
|
2891
|
+
onAccept: () => u(t?.id, h),
|
|
2898
2892
|
onCancel: () => f(!1),
|
|
2899
2893
|
title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
|
|
2900
2894
|
body: /* @__PURE__ */ a("div", { children: [
|
|
@@ -2918,10 +2912,14 @@ function $i(t) {
|
|
|
2918
2912
|
function Yi(t) {
|
|
2919
2913
|
return t ? (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((r, n) => r + n[0].toUpperCase() + n.substring(1), "") : "";
|
|
2920
2914
|
}
|
|
2921
|
-
function Hi({
|
|
2922
|
-
|
|
2915
|
+
function Hi({
|
|
2916
|
+
collection: t,
|
|
2917
|
+
onOpenChange: r,
|
|
2918
|
+
open: n
|
|
2919
|
+
}) {
|
|
2920
|
+
const i = _e(), l = t ? `import { EntityCollection } from "firecms";
|
|
2923
2921
|
|
|
2924
|
-
const ` + (t
|
|
2922
|
+
const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.stringify(cr(t), null, " ") : "No collection selected";
|
|
2925
2923
|
return /* @__PURE__ */ a(
|
|
2926
2924
|
Fe,
|
|
2927
2925
|
{
|
|
@@ -2952,7 +2950,13 @@ const ` + (t.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.s
|
|
|
2952
2950
|
theme: si.vsDark,
|
|
2953
2951
|
code: l,
|
|
2954
2952
|
language: "typescript",
|
|
2955
|
-
children: ({
|
|
2953
|
+
children: ({
|
|
2954
|
+
className: o,
|
|
2955
|
+
style: d,
|
|
2956
|
+
tokens: p,
|
|
2957
|
+
getLineProps: u,
|
|
2958
|
+
getTokenProps: h
|
|
2959
|
+
}) => /* @__PURE__ */ e("pre", { style: d, className: "p-4 rounded text-sm", children: p.map((m, c) => /* @__PURE__ */ e("div", { ...u({ line: m }), children: m.map((g, v) => /* @__PURE__ */ e("span", { ...h({ token: g }) }, v)) }, c)) })
|
|
2956
2960
|
}
|
|
2957
2961
|
)
|
|
2958
2962
|
] }),
|
|
@@ -3015,8 +3019,8 @@ function Gi({
|
|
|
3015
3019
|
setDirty: l,
|
|
3016
3020
|
reservedGroups: o,
|
|
3017
3021
|
extraIcon: d,
|
|
3018
|
-
getUser:
|
|
3019
|
-
getData:
|
|
3022
|
+
getUser: p,
|
|
3023
|
+
getData: u,
|
|
3020
3024
|
doCollectionInference: h,
|
|
3021
3025
|
propertyConfigs: m,
|
|
3022
3026
|
collectionEditable: c
|
|
@@ -3028,7 +3032,7 @@ function Gi({
|
|
|
3028
3032
|
setFieldTouched: y,
|
|
3029
3033
|
errors: P,
|
|
3030
3034
|
dirty: k
|
|
3031
|
-
} = K(), b =
|
|
3035
|
+
} = K(), b = _e(), C = Nr(), N = !C, [f, w] = $(), [_, M] = $(), [U, D] = $(), A = _ ? ae(_, U) : void 0, s = A ? I(g.properties, A.replaceAll(".", ".properties.")) : void 0, [V, G] = $(!1), [B, q] = $(!1), [L, J] = $(!1), [le, Me] = $([]), we = Y.useRef(g.propertiesOrder ? { "": g.propertiesOrder } : {});
|
|
3032
3036
|
de(() => {
|
|
3033
3037
|
l && l(k);
|
|
3034
3038
|
}, [k]);
|
|
@@ -3041,8 +3045,8 @@ function Gi({
|
|
|
3041
3045
|
});
|
|
3042
3046
|
return;
|
|
3043
3047
|
}
|
|
3044
|
-
const
|
|
3045
|
-
if (
|
|
3048
|
+
const j = (F.properties ? Object.keys(F.properties) : []).filter((E) => !g.properties[E]);
|
|
3049
|
+
if (j.length === 0) {
|
|
3046
3050
|
b.open({
|
|
3047
3051
|
type: "info",
|
|
3048
3052
|
message: "No new properties found in existing data"
|
|
@@ -3050,84 +3054,84 @@ function Gi({
|
|
|
3050
3054
|
return;
|
|
3051
3055
|
}
|
|
3052
3056
|
const T = {
|
|
3053
|
-
...
|
|
3057
|
+
...j.reduce((E, ie) => (E[ie] = (F.properties ?? {})[ie], E), {}),
|
|
3054
3058
|
...g.properties
|
|
3055
3059
|
}, S = [
|
|
3056
|
-
...
|
|
3060
|
+
...j,
|
|
3057
3061
|
...g.propertiesOrder ?? []
|
|
3058
3062
|
];
|
|
3059
|
-
v("properties", T, !1),
|
|
3063
|
+
v("properties", T, !1), ve(S), Me(j);
|
|
3060
3064
|
}).finally(() => {
|
|
3061
3065
|
q(!1);
|
|
3062
3066
|
}));
|
|
3063
|
-
} : void 0, re = Q((F) => F ? we.current[F] ?? I(g,
|
|
3064
|
-
const T =
|
|
3065
|
-
v(T, F, !1), we.current[
|
|
3066
|
-
}, [v]),
|
|
3067
|
-
const T = F ? ae(F,
|
|
3067
|
+
} : void 0, re = Q((F) => F ? we.current[F] ?? I(g, be(F)) : we.current[""], [g]), ve = Q((F, j) => {
|
|
3068
|
+
const T = be(j);
|
|
3069
|
+
v(T, F, !1), we.current[j ?? ""] = F;
|
|
3070
|
+
}, [v]), ke = Q((F, j) => {
|
|
3071
|
+
const T = F ? ae(F, j) : void 0;
|
|
3068
3072
|
if (!T)
|
|
3069
3073
|
throw Error("collection editor miss config");
|
|
3070
|
-
v(
|
|
3071
|
-
const E = re(
|
|
3072
|
-
|
|
3073
|
-
}, [re, v,
|
|
3074
|
-
v(
|
|
3074
|
+
v(he(T), void 0, !1);
|
|
3075
|
+
const E = re(j).filter((ie) => ie !== F);
|
|
3076
|
+
ve(E, j), J(!1), w(void 0), M(void 0), D(void 0);
|
|
3077
|
+
}, [re, v, ve]), Ge = (F, j) => {
|
|
3078
|
+
v(be(j), F, !1);
|
|
3075
3079
|
}, gt = ({
|
|
3076
3080
|
id: F,
|
|
3077
|
-
property:
|
|
3081
|
+
property: j
|
|
3078
3082
|
}) => {
|
|
3079
3083
|
if (!F)
|
|
3080
3084
|
throw Error("Need to include an ID when creating a new property");
|
|
3081
3085
|
v("properties", {
|
|
3082
3086
|
...g.properties ?? {},
|
|
3083
|
-
[F]:
|
|
3087
|
+
[F]: j
|
|
3084
3088
|
}, !1);
|
|
3085
3089
|
const T = [...g.propertiesOrder ?? Object.keys(g.properties), F];
|
|
3086
|
-
|
|
3087
|
-
},
|
|
3090
|
+
ve(T), J(!1), C && (w(T.indexOf(F)), M(F)), D(void 0);
|
|
3091
|
+
}, pe = ({
|
|
3088
3092
|
id: F,
|
|
3089
|
-
property:
|
|
3093
|
+
property: j,
|
|
3090
3094
|
previousId: T,
|
|
3091
3095
|
namespace: S
|
|
3092
3096
|
}) => {
|
|
3093
|
-
const E = F ? ae(F, S) : void 0, ie = E ?
|
|
3097
|
+
const E = F ? ae(F, S) : void 0, ie = E ? he(E) : void 0;
|
|
3094
3098
|
if (T && T !== F) {
|
|
3095
3099
|
console.debug("onPropertyChanged, id change", {
|
|
3096
3100
|
id: F,
|
|
3097
|
-
property:
|
|
3101
|
+
property: j,
|
|
3098
3102
|
previousId: T,
|
|
3099
3103
|
namespace: S
|
|
3100
3104
|
});
|
|
3101
|
-
const
|
|
3102
|
-
|
|
3105
|
+
const Oe = ae(T, S), Vt = he(Oe), It = re(S).map((Xe) => Xe === T ? F : Xe).filter((Xe) => Xe !== void 0);
|
|
3106
|
+
ve(It, S), F && (w(It.indexOf(F)), M(F)), v(Vt, void 0, !1), y(Vt, !1, !1);
|
|
3103
3107
|
}
|
|
3104
3108
|
console.debug("onPropertyChanged", {
|
|
3105
3109
|
id: F,
|
|
3106
|
-
property:
|
|
3110
|
+
property: j,
|
|
3107
3111
|
previousId: T,
|
|
3108
3112
|
namespace: S,
|
|
3109
3113
|
propertyPath: ie
|
|
3110
|
-
}), ie && (v(ie,
|
|
3111
|
-
}, Ke = Q((F,
|
|
3112
|
-
const S = F ? ae(F,
|
|
3114
|
+
}), ie && (v(ie, j, !1), y(ie, !0, !1));
|
|
3115
|
+
}, Ke = Q((F, j, T) => {
|
|
3116
|
+
const S = F ? ae(F, j) : void 0;
|
|
3113
3117
|
if (console.debug("onPropertyErrorInternal", {
|
|
3114
3118
|
id: F,
|
|
3115
|
-
namespace:
|
|
3119
|
+
namespace: j,
|
|
3116
3120
|
error: T,
|
|
3117
3121
|
propertyPath: S
|
|
3118
3122
|
}), S) {
|
|
3119
3123
|
const E = T && Object.keys(T).length > 0;
|
|
3120
|
-
i(F,
|
|
3124
|
+
i(F, j, E ? T : void 0), x(he(S), E ? "Property error" : void 0);
|
|
3121
3125
|
}
|
|
3122
3126
|
}, []), We = () => {
|
|
3123
3127
|
w(void 0), M(void 0);
|
|
3124
|
-
}, Ze = _ && n?.current?.properties ? n.current.properties[_] : void 0, Je = g?.propertiesOrder === void 0 || g.propertiesOrder.length === 0, Re = g.propertiesOrder ? g.propertiesOrder : Object.keys(g.properties), Qe = Zt(() =>
|
|
3128
|
+
}, Ze = _ && n?.current?.properties ? n.current.properties[_] : void 0, Je = g?.propertiesOrder === void 0 || g.propertiesOrder.length === 0, Re = g.propertiesOrder ? g.propertiesOrder : Object.keys(g.properties), Qe = Zt(() => g.ownerId ? p(g.ownerId) : null, [p, g.ownerId]), vt = Q((F, j) => {
|
|
3125
3129
|
console.debug("CollectionEditor: onPropertyClick", {
|
|
3126
3130
|
propertyKey: F,
|
|
3127
|
-
namespace:
|
|
3128
|
-
}), w(Re.indexOf(F)), M(F), D(
|
|
3131
|
+
namespace: j
|
|
3132
|
+
}), w(Re.indexOf(F)), M(F), D(j);
|
|
3129
3133
|
}, [Re]), yt = /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
3130
|
-
/* @__PURE__ */ a("div", { className:
|
|
3134
|
+
/* @__PURE__ */ a("div", { className: fe(
|
|
3131
3135
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
3132
3136
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
3133
3137
|
!N && "border-r " + wt
|
|
@@ -3191,18 +3195,18 @@ function Gi({
|
|
|
3191
3195
|
) })
|
|
3192
3196
|
] })
|
|
3193
3197
|
] }),
|
|
3194
|
-
/* @__PURE__ */ e(
|
|
3198
|
+
/* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
3195
3199
|
ft,
|
|
3196
3200
|
{
|
|
3197
3201
|
className: "pl-8",
|
|
3198
3202
|
inferredPropertyKeys: le,
|
|
3199
|
-
selectedPropertyKey: _ ? ae(_,
|
|
3203
|
+
selectedPropertyKey: _ ? ae(_, U) : void 0,
|
|
3200
3204
|
properties: g.properties,
|
|
3201
3205
|
additionalFields: g.additionalFields,
|
|
3202
3206
|
propertiesOrder: Re,
|
|
3203
3207
|
onPropertyClick: vt,
|
|
3204
3208
|
onPropertyMove: Ge,
|
|
3205
|
-
onPropertyRemove: r ?
|
|
3209
|
+
onPropertyRemove: r ? ke : void 0,
|
|
3206
3210
|
collectionEditable: c,
|
|
3207
3211
|
errors: P
|
|
3208
3212
|
}
|
|
@@ -3221,7 +3225,7 @@ function Gi({
|
|
|
3221
3225
|
)
|
|
3222
3226
|
] }),
|
|
3223
3227
|
!N && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ a(
|
|
3224
|
-
|
|
3228
|
+
Pe,
|
|
3225
3229
|
{
|
|
3226
3230
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
3227
3231
|
children: [
|
|
@@ -3234,14 +3238,14 @@ function Gi({
|
|
|
3234
3238
|
allowDataInference: !r,
|
|
3235
3239
|
autoOpenTypeSelect: !1,
|
|
3236
3240
|
propertyKey: _,
|
|
3237
|
-
propertyNamespace:
|
|
3241
|
+
propertyNamespace: U,
|
|
3238
3242
|
property: s,
|
|
3239
|
-
onPropertyChanged:
|
|
3240
|
-
onDelete:
|
|
3243
|
+
onPropertyChanged: pe,
|
|
3244
|
+
onDelete: ke,
|
|
3241
3245
|
onError: Ke,
|
|
3242
3246
|
forceShowErrors: t,
|
|
3243
3247
|
initialErrors: Ze,
|
|
3244
|
-
getData:
|
|
3248
|
+
getData: u,
|
|
3245
3249
|
propertyConfigs: m,
|
|
3246
3250
|
collectionEditable: c
|
|
3247
3251
|
},
|
|
@@ -3266,7 +3270,7 @@ function Gi({
|
|
|
3266
3270
|
}
|
|
3267
3271
|
) }),
|
|
3268
3272
|
N && /* @__PURE__ */ e(
|
|
3269
|
-
|
|
3273
|
+
Ie,
|
|
3270
3274
|
{
|
|
3271
3275
|
inArray: !1,
|
|
3272
3276
|
open: f !== void 0,
|
|
@@ -3275,14 +3279,14 @@ function Gi({
|
|
|
3275
3279
|
existingProperty: !0,
|
|
3276
3280
|
autoOpenTypeSelect: !1,
|
|
3277
3281
|
propertyKey: _,
|
|
3278
|
-
propertyNamespace:
|
|
3282
|
+
propertyNamespace: U,
|
|
3279
3283
|
property: s,
|
|
3280
|
-
onPropertyChanged:
|
|
3281
|
-
onDelete:
|
|
3284
|
+
onPropertyChanged: pe,
|
|
3285
|
+
onDelete: ke,
|
|
3282
3286
|
onError: Ke,
|
|
3283
3287
|
forceShowErrors: t,
|
|
3284
3288
|
initialErrors: Ze,
|
|
3285
|
-
getData:
|
|
3289
|
+
getData: u,
|
|
3286
3290
|
propertyConfigs: m,
|
|
3287
3291
|
collectionEditable: c,
|
|
3288
3292
|
onOkClicked: N ? We : void 0
|
|
@@ -3290,10 +3294,10 @@ function Gi({
|
|
|
3290
3294
|
`edit_view_${f}`
|
|
3291
3295
|
)
|
|
3292
3296
|
] });
|
|
3293
|
-
return /* @__PURE__ */ a(
|
|
3297
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
3294
3298
|
yt,
|
|
3295
3299
|
/* @__PURE__ */ e(
|
|
3296
|
-
|
|
3300
|
+
Ie,
|
|
3297
3301
|
{
|
|
3298
3302
|
inArray: !1,
|
|
3299
3303
|
existingProperty: !1,
|
|
@@ -3303,21 +3307,21 @@ function Gi({
|
|
|
3303
3307
|
open: L,
|
|
3304
3308
|
onCancel: () => J(!1),
|
|
3305
3309
|
onPropertyChanged: gt,
|
|
3306
|
-
getData:
|
|
3310
|
+
getData: u,
|
|
3307
3311
|
allowDataInference: !r,
|
|
3308
3312
|
propertyConfigs: m,
|
|
3309
3313
|
collectionEditable: c,
|
|
3310
3314
|
existingPropertyKeys: g.propertiesOrder
|
|
3311
3315
|
}
|
|
3312
3316
|
),
|
|
3313
|
-
/* @__PURE__ */ e(
|
|
3317
|
+
/* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
3314
3318
|
Hi,
|
|
3315
3319
|
{
|
|
3316
3320
|
collection: g,
|
|
3317
3321
|
open: V,
|
|
3318
3322
|
onOpenChange: G
|
|
3319
3323
|
}
|
|
3320
|
-
)
|
|
3324
|
+
) })
|
|
3321
3325
|
] });
|
|
3322
3326
|
}
|
|
3323
3327
|
function Ki({
|
|
@@ -3390,7 +3394,7 @@ function Zi({
|
|
|
3390
3394
|
getUser: l,
|
|
3391
3395
|
parentCollectionIds: o
|
|
3392
3396
|
}) {
|
|
3393
|
-
const { entityViews: d } = Ae(), [
|
|
3397
|
+
const { entityViews: d } = Ae(), [p, u] = Y.useState(), [h, m] = Y.useState(!1), [c, g] = Y.useState(), [v, x] = Y.useState(), {
|
|
3394
3398
|
values: y,
|
|
3395
3399
|
setFieldValue: P
|
|
3396
3400
|
} = K(), k = t.subcollections ?? [], b = y.entityViews?.filter((f) => typeof f == "string").map((f) => xr(f, d)).filter(Boolean) ?? [], C = t.entityViews?.filter((f) => typeof f != "string") ?? [], N = b.length + C.length;
|
|
@@ -3401,7 +3405,7 @@ function Zi({
|
|
|
3401
3405
|
"Subcollections of ",
|
|
3402
3406
|
y.name
|
|
3403
3407
|
] }),
|
|
3404
|
-
/* @__PURE__ */ a(
|
|
3408
|
+
/* @__PURE__ */ a(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: [
|
|
3405
3409
|
k && k.length > 0 && /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(Bt, { children: k.map((f) => /* @__PURE__ */ a(
|
|
3406
3410
|
bt,
|
|
3407
3411
|
{
|
|
@@ -3426,7 +3430,7 @@ function Zi({
|
|
|
3426
3430
|
{
|
|
3427
3431
|
size: "small",
|
|
3428
3432
|
onClick: (w) => {
|
|
3429
|
-
w.preventDefault(), w.stopPropagation(),
|
|
3433
|
+
w.preventDefault(), w.stopPropagation(), u(f.id);
|
|
3430
3434
|
},
|
|
3431
3435
|
color: "inherit",
|
|
3432
3436
|
children: /* @__PURE__ */ e(dt, { size: "small" })
|
|
@@ -3467,7 +3471,7 @@ function Zi({
|
|
|
3467
3471
|
children: "More info"
|
|
3468
3472
|
}
|
|
3469
3473
|
), children: "Define your own custom views by uploading them with the CLI." }),
|
|
3470
|
-
/* @__PURE__ */ e(
|
|
3474
|
+
/* @__PURE__ */ e(R, { children: /* @__PURE__ */ a(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: [
|
|
3471
3475
|
/* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ a(Bt, { children: [
|
|
3472
3476
|
b.map((f) => /* @__PURE__ */ a(bt, { children: [
|
|
3473
3477
|
/* @__PURE__ */ e(
|
|
@@ -3524,20 +3528,20 @@ function Zi({
|
|
|
3524
3528
|
] })
|
|
3525
3529
|
] }) }),
|
|
3526
3530
|
/* @__PURE__ */ e("div", { style: { height: "52px" } }),
|
|
3527
|
-
|
|
3531
|
+
p && /* @__PURE__ */ e(
|
|
3528
3532
|
lt,
|
|
3529
3533
|
{
|
|
3530
|
-
open: !!
|
|
3534
|
+
open: !!p,
|
|
3531
3535
|
onAccept: () => {
|
|
3532
3536
|
const f = {
|
|
3533
|
-
id:
|
|
3537
|
+
id: p,
|
|
3534
3538
|
parentCollectionIds: [...o ?? [], t.id]
|
|
3535
3539
|
};
|
|
3536
|
-
console.debug("Deleting subcollection", f), n.deleteCollection(f),
|
|
3540
|
+
console.debug("Deleting subcollection", f), n.deleteCollection(f), u(void 0);
|
|
3537
3541
|
},
|
|
3538
|
-
onCancel: () =>
|
|
3539
|
-
title: /* @__PURE__ */ e(
|
|
3540
|
-
body: /* @__PURE__ */ a(
|
|
3542
|
+
onCancel: () => u(void 0),
|
|
3543
|
+
title: /* @__PURE__ */ e(R, { children: "Delete this subcollection?" }),
|
|
3544
|
+
body: /* @__PURE__ */ a(R, { children: [
|
|
3541
3545
|
" This will ",
|
|
3542
3546
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
3543
3547
|
", only the collection in the CMS"
|
|
@@ -3552,8 +3556,8 @@ function Zi({
|
|
|
3552
3556
|
P("entityViews", y.entityViews?.filter((f) => f !== c)), g(void 0);
|
|
3553
3557
|
},
|
|
3554
3558
|
onCancel: () => g(void 0),
|
|
3555
|
-
title: /* @__PURE__ */ e(
|
|
3556
|
-
body: /* @__PURE__ */ a(
|
|
3559
|
+
title: /* @__PURE__ */ e(R, { children: "Remove this view?" }),
|
|
3560
|
+
body: /* @__PURE__ */ a(R, { children: [
|
|
3557
3561
|
"This will ",
|
|
3558
3562
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
3559
3563
|
", only the view in the CMS"
|
|
@@ -4016,11 +4020,11 @@ function Ji({
|
|
|
4016
4020
|
onContinue: i,
|
|
4017
4021
|
existingCollectionPaths: l
|
|
4018
4022
|
}) {
|
|
4019
|
-
const [o, d] = $(!1), [
|
|
4023
|
+
const [o, d] = $(!1), [p, u] = $();
|
|
4020
4024
|
de(() => {
|
|
4021
4025
|
r && l && (d(!0), r(t).then((v) => {
|
|
4022
4026
|
const x = v.filter((y) => !(l ?? []).find((P) => P.trim().toLowerCase() === y.trim().toLowerCase()));
|
|
4023
|
-
|
|
4027
|
+
u(x);
|
|
4024
4028
|
}).finally(() => d(!1)));
|
|
4025
4029
|
}, [l, t, r]);
|
|
4026
4030
|
const {
|
|
@@ -4051,8 +4055,8 @@ function Ji({
|
|
|
4051
4055
|
}
|
|
4052
4056
|
),
|
|
4053
4057
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
|
|
4054
|
-
o && !
|
|
4055
|
-
|
|
4058
|
+
o && !p && /* @__PURE__ */ e(De, { size: "small" }),
|
|
4059
|
+
p?.map((v, x) => /* @__PURE__ */ e(
|
|
4056
4060
|
st,
|
|
4057
4061
|
{
|
|
4058
4062
|
colorScheme: "cyanLighter",
|
|
@@ -4064,7 +4068,7 @@ function Ji({
|
|
|
4064
4068
|
},
|
|
4065
4069
|
v
|
|
4066
4070
|
)),
|
|
4067
|
-
!o && (
|
|
4071
|
+
!o && (p ?? [])?.length === 0 && /* @__PURE__ */ e(O, { variant: "caption", children: "No suggestions" })
|
|
4068
4072
|
] })
|
|
4069
4073
|
] }),
|
|
4070
4074
|
/* @__PURE__ */ a("div", { className: "my-2", children: [
|
|
@@ -4148,9 +4152,9 @@ function nt({
|
|
|
4148
4152
|
tr,
|
|
4149
4153
|
{
|
|
4150
4154
|
onClick: i,
|
|
4151
|
-
className:
|
|
4155
|
+
className: fe(
|
|
4152
4156
|
"my-2 rounded-md border mx-0 p-6 px-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center",
|
|
4153
|
-
"text-gray-700 dark:text-
|
|
4157
|
+
"text-gray-700 dark:text-slate-300",
|
|
4154
4158
|
"hover:border-primary-dark hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary",
|
|
4155
4159
|
"border-gray-400 dark:border-gray-600 "
|
|
4156
4160
|
),
|
|
@@ -4170,23 +4174,23 @@ function Qi({
|
|
|
4170
4174
|
setFieldValue: i,
|
|
4171
4175
|
setFieldTouched: l,
|
|
4172
4176
|
values: o
|
|
4173
|
-
} = K(), [d,
|
|
4177
|
+
} = K(), [d, p] = $(void 0), u = Y.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), h = d ? d.id : void 0, m = d || void 0, c = ({
|
|
4174
4178
|
id: v,
|
|
4175
4179
|
property: x,
|
|
4176
4180
|
previousId: y,
|
|
4177
4181
|
namespace: P
|
|
4178
4182
|
}) => {
|
|
4179
|
-
const k = v ? ae(v, P) : void 0, b = k ?
|
|
4180
|
-
const _ =
|
|
4181
|
-
i(_, f, !1),
|
|
4183
|
+
const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = (f) => f ? u.current[f] ?? I(o, be(f)) : u.current[""], N = (f, w) => {
|
|
4184
|
+
const _ = be(w);
|
|
4185
|
+
i(_, f, !1), u.current[w ?? ""] = f;
|
|
4182
4186
|
};
|
|
4183
4187
|
if (y && y !== v) {
|
|
4184
|
-
const f = ae(y, P), w =
|
|
4188
|
+
const f = ae(y, P), w = he(f), M = C(P).map((D) => D === y ? v : D).filter((D) => D !== void 0);
|
|
4185
4189
|
N(M, P);
|
|
4186
|
-
const
|
|
4187
|
-
Object.keys(
|
|
4188
|
-
|
|
4189
|
-
}), t.setHeadersMapping(
|
|
4190
|
+
const U = { ...t.headersMapping };
|
|
4191
|
+
Object.keys(U).forEach((D) => {
|
|
4192
|
+
U[D] === y && (U[D] = v ?? "");
|
|
4193
|
+
}), t.setHeadersMapping(U), i(w, void 0, !1), l(w, !1, !1);
|
|
4190
4194
|
}
|
|
4191
4195
|
b && (i(b, x, !1), l(b, !0, !1));
|
|
4192
4196
|
}, g = async ({
|
|
@@ -4195,7 +4199,7 @@ function Qi({
|
|
|
4195
4199
|
property: y,
|
|
4196
4200
|
namespace: P
|
|
4197
4201
|
}) => {
|
|
4198
|
-
const k = v ? ae(v, P) : void 0, b = k ?
|
|
4202
|
+
const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = t.importData.map((f) => I(f, x)), N = {
|
|
4199
4203
|
...ti(C, y, rr),
|
|
4200
4204
|
editable: !0
|
|
4201
4205
|
};
|
|
@@ -4211,7 +4215,7 @@ function Qi({
|
|
|
4211
4215
|
idColumn: t.idColumn,
|
|
4212
4216
|
originProperties: t.originProperties,
|
|
4213
4217
|
destinationProperties: o.properties,
|
|
4214
|
-
onIdPropertyChanged: (v) => t.setIdColumn(v),
|
|
4218
|
+
onIdPropertyChanged: (v) => t.setIdColumn(v ?? void 0),
|
|
4215
4219
|
buildPropertyView: ({
|
|
4216
4220
|
property: v,
|
|
4217
4221
|
propertyKey: x,
|
|
@@ -4223,7 +4227,7 @@ function Qi({
|
|
|
4223
4227
|
propertyKey: x,
|
|
4224
4228
|
onPropertyNameChanged: (P, k) => i(`properties.${P}.name`, k, !1),
|
|
4225
4229
|
onEditClick: () => {
|
|
4226
|
-
!x || !v ||
|
|
4230
|
+
!x || !v || p({
|
|
4227
4231
|
...v,
|
|
4228
4232
|
id: x,
|
|
4229
4233
|
editable: !0
|
|
@@ -4248,7 +4252,7 @@ function Qi({
|
|
|
4248
4252
|
)
|
|
4249
4253
|
] }),
|
|
4250
4254
|
/* @__PURE__ */ e(
|
|
4251
|
-
|
|
4255
|
+
Ie,
|
|
4252
4256
|
{
|
|
4253
4257
|
open: d !== void 0,
|
|
4254
4258
|
propertyKey: h,
|
|
@@ -4259,10 +4263,10 @@ function Qi({
|
|
|
4259
4263
|
allowDataInference: !1,
|
|
4260
4264
|
collectionEditable: n,
|
|
4261
4265
|
onOkClicked: () => {
|
|
4262
|
-
|
|
4266
|
+
p(void 0);
|
|
4263
4267
|
},
|
|
4264
4268
|
onCancel: () => {
|
|
4265
|
-
|
|
4269
|
+
p(void 0);
|
|
4266
4270
|
},
|
|
4267
4271
|
autoOpenTypeSelect: !1,
|
|
4268
4272
|
existingProperty: !1,
|
|
@@ -4279,17 +4283,17 @@ function Xi({
|
|
|
4279
4283
|
propertyConfigs: i,
|
|
4280
4284
|
disabled: l
|
|
4281
4285
|
}) {
|
|
4282
|
-
const o = t ? Kt(t) : null, d = t ? $e(t, i) : null, [
|
|
4286
|
+
const o = t ? Kt(t) : null, d = t ? $e(t, i) : null, [p, u] = $(!1);
|
|
4283
4287
|
return /* @__PURE__ */ e(
|
|
4284
4288
|
te,
|
|
4285
4289
|
{
|
|
4286
4290
|
title: t && d ? `${d?.name} - ${t.dataType}` : void 0,
|
|
4287
|
-
open:
|
|
4291
|
+
open: p ? !1 : void 0,
|
|
4288
4292
|
children: /* @__PURE__ */ e(
|
|
4289
|
-
|
|
4293
|
+
Ce,
|
|
4290
4294
|
{
|
|
4291
|
-
open:
|
|
4292
|
-
onOpenChange:
|
|
4295
|
+
open: p,
|
|
4296
|
+
onOpenChange: u,
|
|
4293
4297
|
invisible: !0,
|
|
4294
4298
|
className: "w-full",
|
|
4295
4299
|
disabled: l,
|
|
@@ -4351,15 +4355,15 @@ function en({ importConfig: t, properties: r, propertiesOrder: n }) {
|
|
|
4351
4355
|
}
|
|
4352
4356
|
function dr(t, r = "") {
|
|
4353
4357
|
const n = Object.keys(t).reduce((o, d) => {
|
|
4354
|
-
const
|
|
4355
|
-
if (
|
|
4356
|
-
const g = dr(
|
|
4358
|
+
const p = t[d], u = kr(d), h = r ? `${r}.${u}` : u;
|
|
4359
|
+
if (p.dataType === "map" && p.properties) {
|
|
4360
|
+
const g = dr(p.properties, h);
|
|
4357
4361
|
return {
|
|
4358
4362
|
headersMapping: { ...o.headersMapping, [d]: h },
|
|
4359
4363
|
properties: {
|
|
4360
4364
|
...o.properties,
|
|
4361
|
-
[
|
|
4362
|
-
...
|
|
4365
|
+
[u]: {
|
|
4366
|
+
...p,
|
|
4363
4367
|
properties: g.properties,
|
|
4364
4368
|
propertiesOrder: Object.keys(g.properties)
|
|
4365
4369
|
}
|
|
@@ -4368,7 +4372,7 @@ function dr(t, r = "") {
|
|
|
4368
4372
|
}
|
|
4369
4373
|
const m = {
|
|
4370
4374
|
...o.properties,
|
|
4371
|
-
[
|
|
4375
|
+
[u]: p
|
|
4372
4376
|
};
|
|
4373
4377
|
return {
|
|
4374
4378
|
headersMapping: { ...o.headersMapping, [d]: h },
|
|
@@ -4395,7 +4399,7 @@ function ur(t) {
|
|
|
4395
4399
|
fullHeight: !0,
|
|
4396
4400
|
scrollable: !1,
|
|
4397
4401
|
maxWidth: "7xl",
|
|
4398
|
-
onOpenChange: (
|
|
4402
|
+
onOpenChange: (p) => p ? void 0 : d(),
|
|
4399
4403
|
children: [
|
|
4400
4404
|
r && /* @__PURE__ */ e(
|
|
4401
4405
|
tn,
|
|
@@ -4419,10 +4423,10 @@ function ur(t) {
|
|
|
4419
4423
|
);
|
|
4420
4424
|
}
|
|
4421
4425
|
function tn(t) {
|
|
4422
|
-
const { propertyConfigs: r } = Ae(), n =
|
|
4426
|
+
const { propertyConfigs: r } = Ae(), n = Ne(), i = Te(), {
|
|
4423
4427
|
topLevelNavigation: l,
|
|
4424
4428
|
collections: o
|
|
4425
|
-
} = n, d = t.initialValues,
|
|
4429
|
+
} = n, d = t.initialValues, p = !d?.path && (t.parentCollectionIds ?? []).length === 0, u = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], h = u.map((b) => b.path.trim().toLowerCase()), m = u.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [c, g] = je.useState(), [v, x] = je.useState(!1);
|
|
4426
4430
|
if (de(() => {
|
|
4427
4431
|
try {
|
|
4428
4432
|
n.initialised && (t.editedCollectionId ? g(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : g(void 0), x(!0));
|
|
@@ -4453,7 +4457,7 @@ function tn(t) {
|
|
|
4453
4457
|
initialValues: k,
|
|
4454
4458
|
existingPaths: h,
|
|
4455
4459
|
existingIds: m,
|
|
4456
|
-
includeTemplates:
|
|
4460
|
+
includeTemplates: p,
|
|
4457
4461
|
collection: c,
|
|
4458
4462
|
setCollection: g,
|
|
4459
4463
|
groups: y,
|
|
@@ -4469,8 +4473,8 @@ function rn({
|
|
|
4469
4473
|
fullPath: l,
|
|
4470
4474
|
collectionInference: o,
|
|
4471
4475
|
handleClose: d,
|
|
4472
|
-
reservedGroups:
|
|
4473
|
-
extraView:
|
|
4476
|
+
reservedGroups: p,
|
|
4477
|
+
extraView: u,
|
|
4474
4478
|
handleCancel: h,
|
|
4475
4479
|
setFormDirty: m,
|
|
4476
4480
|
pathSuggestions: c,
|
|
@@ -4486,20 +4490,20 @@ function rn({
|
|
|
4486
4490
|
propertyConfigs: f,
|
|
4487
4491
|
groups: w
|
|
4488
4492
|
}) {
|
|
4489
|
-
const _ = hi(), M =
|
|
4493
|
+
const _ = hi(), M = Ne(), U = _e(), D = Le({}), A = t ? k ? "welcome" : "details" : "properties", [s, V] = $(A), [G, B] = je.useState(), q = (T) => {
|
|
4490
4494
|
const S = T.id || T.path;
|
|
4491
4495
|
return r.saveCollection({
|
|
4492
4496
|
id: S,
|
|
4493
4497
|
collectionData: T,
|
|
4494
4498
|
previousId: n,
|
|
4495
4499
|
parentCollectionIds: i
|
|
4496
|
-
}).then(() => (B(void 0), !0)).catch((E) => (B(E), console.error(E),
|
|
4500
|
+
}).then(() => (B(void 0), !0)).catch((E) => (B(E), console.error(E), U.open({
|
|
4497
4501
|
type: "error",
|
|
4498
4502
|
message: "Error persisting collection: " + (E.message ?? "Details in the console")
|
|
4499
4503
|
}), !1));
|
|
4500
4504
|
}, L = Q(() => {
|
|
4501
|
-
s === "details" ? _.inUse ? V("import_data_saving") : V(
|
|
4502
|
-
}, [s, _.inUse,
|
|
4505
|
+
s === "details" ? _.inUse ? V("import_data_saving") : V(u ? "extra_view" : "properties") : V(s === "welcome" ? "details" : s === "import_data_mapping" ? "import_data_preview" : s === "import_data_preview" ? "details" : s === "extra_view" ? "properties" : "details");
|
|
4506
|
+
}, [s, _.inUse, u]), J = Q((T) => {
|
|
4503
4507
|
if (o)
|
|
4504
4508
|
return o?.(T.path, T.collectionGroup ?? !1, i ?? []);
|
|
4505
4509
|
}, [o, i]), le = Q(async (T) => {
|
|
@@ -4518,7 +4522,7 @@ function rn({
|
|
|
4518
4522
|
values: E
|
|
4519
4523
|
}), E) : (E.propertiesOrder = Object.keys(E.properties), E);
|
|
4520
4524
|
} catch (S) {
|
|
4521
|
-
return console.error(S),
|
|
4525
|
+
return console.error(S), U.open({
|
|
4522
4526
|
type: "error",
|
|
4523
4527
|
message: "Error inferring collection: " + (S.message ?? "Details in the console")
|
|
4524
4528
|
}), T;
|
|
@@ -4534,7 +4538,7 @@ function rn({
|
|
|
4534
4538
|
});
|
|
4535
4539
|
return;
|
|
4536
4540
|
}
|
|
4537
|
-
s === "welcome" ? (L(), S.resetForm({ values: T })) : s === "details" ?
|
|
4541
|
+
s === "welcome" ? (L(), S.resetForm({ values: T })) : s === "details" ? u || _.inUse ? (S.resetForm({ values: T }), L()) : t ? le(T).then((E) => {
|
|
4538
4542
|
S.resetForm({
|
|
4539
4543
|
values: E ?? T,
|
|
4540
4544
|
touched: {
|
|
@@ -4548,7 +4552,7 @@ function rn({
|
|
|
4548
4552
|
S.resetForm({ values: N }), L(), d(T);
|
|
4549
4553
|
}) : (L(), S.resetForm({ values: T }));
|
|
4550
4554
|
} catch (E) {
|
|
4551
|
-
|
|
4555
|
+
U.open({
|
|
4552
4556
|
type: "error",
|
|
4553
4557
|
message: "Error persisting collection: " + (E.message ?? "Details in the console")
|
|
4554
4558
|
}), console.error(E), S.resetForm({ values: T });
|
|
@@ -4561,44 +4565,44 @@ function rn({
|
|
|
4561
4565
|
try {
|
|
4562
4566
|
E.validateSync(T, { abortEarly: !1 });
|
|
4563
4567
|
} catch (ie) {
|
|
4564
|
-
ie.inner.forEach((
|
|
4565
|
-
S[
|
|
4568
|
+
ie.inner.forEach((Oe) => {
|
|
4569
|
+
S[Oe.path] = Oe.message;
|
|
4566
4570
|
});
|
|
4567
4571
|
}
|
|
4568
4572
|
if (s === "properties" && (S = { ...S, ...D.current }), s === "details") {
|
|
4569
4573
|
const ie = Ht(T.path, t, y, T.id);
|
|
4570
4574
|
ie && (S.path = ie);
|
|
4571
|
-
const
|
|
4572
|
-
|
|
4575
|
+
const Oe = an(T.id, t, y, P);
|
|
4576
|
+
Oe && (S.id = Oe);
|
|
4573
4577
|
}
|
|
4574
4578
|
return S;
|
|
4575
4579
|
}
|
|
4576
4580
|
}), {
|
|
4577
4581
|
values: re,
|
|
4578
|
-
setFieldValue:
|
|
4579
|
-
isSubmitting:
|
|
4582
|
+
setFieldValue: ve,
|
|
4583
|
+
isSubmitting: ke,
|
|
4580
4584
|
dirty: Ge,
|
|
4581
4585
|
submitCount: gt
|
|
4582
|
-
} = ue,
|
|
4586
|
+
} = ue, pe = re.path, Ke = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + pe : pe, We = Ht(pe, t, y, re.id), Ze = !We && i ? M.convertIdsToPaths(i) : void 0, Je = We ? void 0 : M.resolveAliasesFrom(Ke), Re = Je && x ? () => x(Je, Ze ?? []) : void 0;
|
|
4583
4587
|
de(() => {
|
|
4584
4588
|
m(Ge);
|
|
4585
4589
|
}, [Ge]);
|
|
4586
4590
|
function Qe(T) {
|
|
4587
4591
|
_.setInUse(!0), ri(T, rr).then((S) => {
|
|
4588
4592
|
const E = dr(S);
|
|
4589
|
-
|
|
4593
|
+
ve("properties", E.properties), ve("propertiesOrder", Object.keys(E.properties)), _.setIdColumn(E.idColumn), _.setImportData(T), _.setHeadersMapping(E.headersMapping), _.setOriginProperties(E.properties);
|
|
4590
4594
|
});
|
|
4591
4595
|
}
|
|
4592
4596
|
const vt = !!re.name && !!re.id, yt = () => {
|
|
4593
4597
|
const T = { ...re.properties };
|
|
4594
|
-
_.idColumn && delete T[_.idColumn],
|
|
4595
|
-
},
|
|
4596
|
-
return /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(kt, { value: ue, children: /* @__PURE__ */ a(
|
|
4598
|
+
_.idColumn && delete T[_.idColumn], ve("properties", T), L();
|
|
4599
|
+
}, j = b?.editable === void 0 || b?.editable === !0 || t;
|
|
4600
|
+
return /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(kt, { value: ue, children: /* @__PURE__ */ a(R, { children: [
|
|
4597
4601
|
!t && /* @__PURE__ */ a(
|
|
4598
4602
|
Hr,
|
|
4599
4603
|
{
|
|
4600
4604
|
value: s,
|
|
4601
|
-
className:
|
|
4605
|
+
className: fe(wt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
4602
4606
|
onValueChange: (T) => V(T),
|
|
4603
4607
|
children: [
|
|
4604
4608
|
/* @__PURE__ */ e(Ct, { value: "details", children: "Details" }),
|
|
@@ -4612,17 +4616,17 @@ function rn({
|
|
|
4612
4616
|
{
|
|
4613
4617
|
noValidate: !0,
|
|
4614
4618
|
onSubmit: ue.handleSubmit,
|
|
4615
|
-
className:
|
|
4619
|
+
className: fe(
|
|
4616
4620
|
t ? "h-full" : "h-[calc(100%-48px)]",
|
|
4617
4621
|
"flex-grow flex flex-col relative"
|
|
4618
4622
|
),
|
|
4619
4623
|
children: [
|
|
4620
4624
|
s === "loading" && /* @__PURE__ */ e(Nt, {}),
|
|
4621
|
-
s === "extra_view" &&
|
|
4625
|
+
s === "extra_view" && pe && u?.View && /* @__PURE__ */ e(u.View, { path: pe }),
|
|
4622
4626
|
s === "welcome" && /* @__PURE__ */ e(
|
|
4623
4627
|
Ji,
|
|
4624
4628
|
{
|
|
4625
|
-
path:
|
|
4629
|
+
path: pe,
|
|
4626
4630
|
onContinue: (T) => {
|
|
4627
4631
|
T ? (Qe(T), V("import_data_mapping")) : V("details");
|
|
4628
4632
|
},
|
|
@@ -4635,7 +4639,7 @@ function rn({
|
|
|
4635
4639
|
Qi,
|
|
4636
4640
|
{
|
|
4637
4641
|
importConfig: _,
|
|
4638
|
-
collectionEditable:
|
|
4642
|
+
collectionEditable: j,
|
|
4639
4643
|
propertyConfigs: f
|
|
4640
4644
|
}
|
|
4641
4645
|
),
|
|
@@ -4652,8 +4656,9 @@ function rn({
|
|
|
4652
4656
|
{
|
|
4653
4657
|
importConfig: _,
|
|
4654
4658
|
collection: re,
|
|
4659
|
+
path: pe,
|
|
4655
4660
|
onImportSuccess: async (T) => {
|
|
4656
|
-
|
|
4661
|
+
U.open({
|
|
4657
4662
|
type: "info",
|
|
4658
4663
|
message: "Data imported successfully"
|
|
4659
4664
|
}), await q(re), d(T);
|
|
@@ -4687,7 +4692,7 @@ function rn({
|
|
|
4687
4692
|
{
|
|
4688
4693
|
showErrors: gt > 0,
|
|
4689
4694
|
isNewCollection: t,
|
|
4690
|
-
reservedGroups:
|
|
4695
|
+
reservedGroups: p,
|
|
4691
4696
|
onPropertyError: (T, S, E) => {
|
|
4692
4697
|
const ie = Ft({
|
|
4693
4698
|
...D.current,
|
|
@@ -4699,13 +4704,13 @@ function rn({
|
|
|
4699
4704
|
getData: Re,
|
|
4700
4705
|
doCollectionInference: J,
|
|
4701
4706
|
propertyConfigs: f,
|
|
4702
|
-
collectionEditable:
|
|
4703
|
-
extraIcon:
|
|
4707
|
+
collectionEditable: j,
|
|
4708
|
+
extraIcon: u?.icon && /* @__PURE__ */ e(
|
|
4704
4709
|
oe,
|
|
4705
4710
|
{
|
|
4706
4711
|
color: "primary",
|
|
4707
4712
|
onClick: () => V("extra_view"),
|
|
4708
|
-
children:
|
|
4713
|
+
children: u.icon
|
|
4709
4714
|
}
|
|
4710
4715
|
)
|
|
4711
4716
|
}
|
|
@@ -4802,8 +4807,8 @@ function rn({
|
|
|
4802
4807
|
variant: "filled",
|
|
4803
4808
|
color: "primary",
|
|
4804
4809
|
type: "submit",
|
|
4805
|
-
loading:
|
|
4806
|
-
disabled:
|
|
4810
|
+
loading: ke,
|
|
4811
|
+
disabled: ke || s === "details" && !vt,
|
|
4807
4812
|
startIcon: s === "properties" ? /* @__PURE__ */ e(Gr, {}) : void 0,
|
|
4808
4813
|
children: [
|
|
4809
4814
|
s === "details" && "Next",
|
|
@@ -4817,7 +4822,7 @@ function rn({
|
|
|
4817
4822
|
variant: "filled",
|
|
4818
4823
|
color: "primary",
|
|
4819
4824
|
type: "submit",
|
|
4820
|
-
loading:
|
|
4825
|
+
loading: ke,
|
|
4821
4826
|
children: "Update collection"
|
|
4822
4827
|
}
|
|
4823
4828
|
)
|
|
@@ -4831,7 +4836,7 @@ function rn({
|
|
|
4831
4836
|
}
|
|
4832
4837
|
function nn(t, r) {
|
|
4833
4838
|
const { properties: n, ...i } = t, l = {};
|
|
4834
|
-
return Object.keys(n).forEach((o) => {
|
|
4839
|
+
return n && Object.keys(n).forEach((o) => {
|
|
4835
4840
|
l[o] = pr(n[o], r);
|
|
4836
4841
|
}), { ...i, properties: l };
|
|
4837
4842
|
}
|
|
@@ -4866,19 +4871,19 @@ const Ht = (t, r, n, i) => {
|
|
|
4866
4871
|
reservedGroups: l,
|
|
4867
4872
|
collectionInference: o,
|
|
4868
4873
|
extraView: d,
|
|
4869
|
-
pathSuggestions:
|
|
4870
|
-
getUser:
|
|
4874
|
+
pathSuggestions: p,
|
|
4875
|
+
getUser: u,
|
|
4871
4876
|
getData: h,
|
|
4872
4877
|
onAnalyticsEvent: m
|
|
4873
4878
|
}) {
|
|
4874
|
-
const c =
|
|
4879
|
+
const c = Ne(), g = gi(), v = _e(), { propertyConfigs: x } = Ae(), {
|
|
4875
4880
|
collections: y
|
|
4876
4881
|
} = c, P = (y ?? []).map((s) => s.path.trim().toLowerCase()), [k, b] = Y.useState();
|
|
4877
4882
|
de(() => {
|
|
4878
|
-
|
|
4883
|
+
p && p().then((s) => {
|
|
4879
4884
|
b(s.filter((V) => !P.includes(V.trim().toLowerCase())));
|
|
4880
4885
|
});
|
|
4881
|
-
}, [
|
|
4886
|
+
}, [p]);
|
|
4882
4887
|
const [C, N] = Y.useState(), [f, w] = Y.useState(), _ = Q(() => ({
|
|
4883
4888
|
createCollections: !0,
|
|
4884
4889
|
editCollections: !0,
|
|
@@ -4897,7 +4902,7 @@ const Ht = (t, r, n, i) => {
|
|
|
4897
4902
|
parentCollection: B,
|
|
4898
4903
|
redirect: !1
|
|
4899
4904
|
});
|
|
4900
|
-
}, []),
|
|
4905
|
+
}, []), U = Q(({
|
|
4901
4906
|
propertyKey: s,
|
|
4902
4907
|
property: V,
|
|
4903
4908
|
editedCollectionId: G,
|
|
@@ -4905,7 +4910,7 @@ const Ht = (t, r, n, i) => {
|
|
|
4905
4910
|
parentCollectionIds: q,
|
|
4906
4911
|
collection: L
|
|
4907
4912
|
}) => {
|
|
4908
|
-
console.debug("
|
|
4913
|
+
console.debug("Edit property", s, V, G, B, q, L), m?.("edit_property", { propertyKey: s, editedCollectionId: G });
|
|
4909
4914
|
const J = s && s.includes(".") ? s.substring(0, s.lastIndexOf(".")) : void 0, le = s && s.includes(".") ? s.substring(s.lastIndexOf(".") + 1) : s;
|
|
4910
4915
|
w({
|
|
4911
4916
|
propertyKey: le,
|
|
@@ -4930,14 +4935,14 @@ const Ht = (t, r, n, i) => {
|
|
|
4930
4935
|
initialValues: G,
|
|
4931
4936
|
redirect: B
|
|
4932
4937
|
});
|
|
4933
|
-
}, []), A =
|
|
4938
|
+
}, []), A = p ? (s) => !s && k ? Promise.resolve(k) : p?.(s) : void 0;
|
|
4934
4939
|
return /* @__PURE__ */ e(mr.Provider, { value: n, children: /* @__PURE__ */ a(
|
|
4935
4940
|
hr.Provider,
|
|
4936
4941
|
{
|
|
4937
4942
|
value: {
|
|
4938
4943
|
editCollection: M,
|
|
4939
4944
|
createCollection: D,
|
|
4940
|
-
editProperty:
|
|
4945
|
+
editProperty: U,
|
|
4941
4946
|
configPermissions: i ?? _,
|
|
4942
4947
|
rootPathSuggestions: k
|
|
4943
4948
|
},
|
|
@@ -4955,7 +4960,7 @@ const Ht = (t, r, n, i) => {
|
|
|
4955
4960
|
reservedGroups: l,
|
|
4956
4961
|
extraView: d,
|
|
4957
4962
|
pathSuggestions: A,
|
|
4958
|
-
getUser:
|
|
4963
|
+
getUser: u,
|
|
4959
4964
|
handleClose: (s) => {
|
|
4960
4965
|
if (C?.redirect && s && C?.isNewCollection && !C.parentCollectionIds.length) {
|
|
4961
4966
|
const V = c.buildUrlCollectionPath(s.id ?? s.path);
|
|
@@ -4966,7 +4971,7 @@ const Ht = (t, r, n, i) => {
|
|
|
4966
4971
|
}
|
|
4967
4972
|
),
|
|
4968
4973
|
/* @__PURE__ */ e(
|
|
4969
|
-
|
|
4974
|
+
Ie,
|
|
4970
4975
|
{
|
|
4971
4976
|
open: !!f,
|
|
4972
4977
|
includeIdAndName: !0,
|
|
@@ -5038,101 +5043,45 @@ const Ht = (t, r, n, i) => {
|
|
|
5038
5043
|
}
|
|
5039
5044
|
) });
|
|
5040
5045
|
},
|
|
5041
|
-
|
|
5042
|
-
),
|
|
5046
|
+
ye
|
|
5047
|
+
), ge = () => Jt(hr);
|
|
5043
5048
|
function ln({
|
|
5044
5049
|
path: t,
|
|
5045
5050
|
parentCollectionIds: r,
|
|
5046
5051
|
collection: n,
|
|
5047
5052
|
tableController: i
|
|
5048
5053
|
}) {
|
|
5049
|
-
const l =
|
|
5054
|
+
const l = Te(), o = Ne(), d = ge(), p = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
|
|
5050
5055
|
user: l.user,
|
|
5051
5056
|
collection: n
|
|
5052
5057
|
}).editCollections : !0;
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
children: /* @__PURE__ */ e(Kr, {})
|
|
5069
|
-
}
|
|
5070
|
-
)
|
|
5071
|
-
}
|
|
5072
|
-
),
|
|
5073
|
-
/* @__PURE__ */ e(
|
|
5074
|
-
te,
|
|
5075
|
-
{
|
|
5076
|
-
title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
5077
|
-
children: /* @__PURE__ */ e(
|
|
5078
|
-
z,
|
|
5079
|
-
{
|
|
5080
|
-
color: "primary",
|
|
5081
|
-
size: "small",
|
|
5082
|
-
variant: "outlined",
|
|
5083
|
-
onClick: () => u?.saveCollection({
|
|
5084
|
-
id: n.id,
|
|
5085
|
-
parentCollectionIds: r,
|
|
5086
|
-
collectionData: W(
|
|
5087
|
-
n,
|
|
5088
|
-
{
|
|
5089
|
-
initialFilter: i.filterValues ?? null,
|
|
5090
|
-
initialSort: i.sortBy ?? null
|
|
5091
|
-
}
|
|
5092
|
-
)
|
|
5093
|
-
}).then(() => {
|
|
5094
|
-
p.open({
|
|
5095
|
-
type: "success",
|
|
5096
|
-
message: "Default config saved"
|
|
5097
|
-
});
|
|
5098
|
-
}),
|
|
5099
|
-
children: /* @__PURE__ */ e(Wr, {})
|
|
5100
|
-
}
|
|
5101
|
-
)
|
|
5102
|
-
}
|
|
5103
|
-
)
|
|
5104
|
-
] })), /* @__PURE__ */ a(j, { children: [
|
|
5105
|
-
m && c,
|
|
5106
|
-
/* @__PURE__ */ e(
|
|
5107
|
-
te,
|
|
5108
|
-
{
|
|
5109
|
-
title: m ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
5110
|
-
children: /* @__PURE__ */ e(
|
|
5111
|
-
oe,
|
|
5112
|
-
{
|
|
5113
|
-
color: "primary",
|
|
5114
|
-
disabled: !m,
|
|
5115
|
-
onClick: m ? () => d?.editCollection({ id: n.id, fullPath: t, parentCollectionIds: r, parentCollection: h }) : void 0,
|
|
5116
|
-
children: /* @__PURE__ */ e(He, {})
|
|
5117
|
-
}
|
|
5118
|
-
)
|
|
5119
|
-
}
|
|
5120
|
-
)
|
|
5121
|
-
] });
|
|
5122
|
-
}
|
|
5123
|
-
function at(t) {
|
|
5124
|
-
return t && Object.keys(t).length === 0 ? t : t ?? null;
|
|
5058
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(
|
|
5059
|
+
te,
|
|
5060
|
+
{
|
|
5061
|
+
title: u ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
5062
|
+
children: /* @__PURE__ */ e(
|
|
5063
|
+
oe,
|
|
5064
|
+
{
|
|
5065
|
+
color: "primary",
|
|
5066
|
+
disabled: !u,
|
|
5067
|
+
onClick: u ? () => d?.editCollection({ id: n.id, fullPath: t, parentCollectionIds: r, parentCollection: p }) : void 0,
|
|
5068
|
+
children: /* @__PURE__ */ e(He, {})
|
|
5069
|
+
}
|
|
5070
|
+
)
|
|
5071
|
+
}
|
|
5072
|
+
) });
|
|
5125
5073
|
}
|
|
5074
|
+
const fr = () => Jt(mr);
|
|
5126
5075
|
function sn({
|
|
5127
5076
|
path: t,
|
|
5128
5077
|
collection: r
|
|
5129
5078
|
}) {
|
|
5130
|
-
const n =
|
|
5079
|
+
const n = _e(), i = Te(), l = fr(), o = ge(), d = o.configPermissions({
|
|
5131
5080
|
user: i.user,
|
|
5132
5081
|
collection: r
|
|
5133
|
-
}),
|
|
5082
|
+
}), p = Q(() => {
|
|
5134
5083
|
o?.editCollection({ id: r.id, parentCollectionIds: [] });
|
|
5135
|
-
}, [o, t]), [
|
|
5084
|
+
}, [o, t]), [u, h] = $(!1), m = Q(() => {
|
|
5136
5085
|
l?.deleteCollection({ id: r.id }).then(() => {
|
|
5137
5086
|
h(!1), n.open({
|
|
5138
5087
|
message: "Collection deleted",
|
|
@@ -5140,13 +5089,13 @@ function sn({
|
|
|
5140
5089
|
});
|
|
5141
5090
|
});
|
|
5142
5091
|
}, [t, l]);
|
|
5143
|
-
return /* @__PURE__ */ a(
|
|
5092
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
5144
5093
|
/* @__PURE__ */ a("div", { children: [
|
|
5145
5094
|
d.deleteCollections && /* @__PURE__ */ e(
|
|
5146
|
-
|
|
5095
|
+
Kr,
|
|
5147
5096
|
{
|
|
5148
|
-
trigger: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(
|
|
5149
|
-
children: /* @__PURE__ */ a(
|
|
5097
|
+
trigger: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Wr, { size: "small" }) }),
|
|
5098
|
+
children: /* @__PURE__ */ a(Zr, { onClick: (c) => {
|
|
5150
5099
|
c.preventDefault(), c.stopPropagation(), h(!0);
|
|
5151
5100
|
}, children: [
|
|
5152
5101
|
/* @__PURE__ */ e(dt, {}),
|
|
@@ -5158,7 +5107,7 @@ function sn({
|
|
|
5158
5107
|
oe,
|
|
5159
5108
|
{
|
|
5160
5109
|
onClick: (c) => {
|
|
5161
|
-
|
|
5110
|
+
p();
|
|
5162
5111
|
},
|
|
5163
5112
|
children: /* @__PURE__ */ e(He, { size: "small" })
|
|
5164
5113
|
}
|
|
@@ -5167,11 +5116,11 @@ function sn({
|
|
|
5167
5116
|
/* @__PURE__ */ e(
|
|
5168
5117
|
lt,
|
|
5169
5118
|
{
|
|
5170
|
-
open:
|
|
5119
|
+
open: u,
|
|
5171
5120
|
onAccept: m,
|
|
5172
5121
|
onCancel: () => h(!1),
|
|
5173
|
-
title: /* @__PURE__ */ e(
|
|
5174
|
-
body: /* @__PURE__ */ a(
|
|
5122
|
+
title: /* @__PURE__ */ e(R, { children: "Delete this collection?" }),
|
|
5123
|
+
body: /* @__PURE__ */ a(R, { children: [
|
|
5175
5124
|
" This will ",
|
|
5176
5125
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
5177
5126
|
", only the collection in the CMS"
|
|
@@ -5186,13 +5135,13 @@ function cn({
|
|
|
5186
5135
|
}) {
|
|
5187
5136
|
if (!r.navigation.topLevelNavigation)
|
|
5188
5137
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
5189
|
-
const n =
|
|
5138
|
+
const n = Te(), i = ge(), l = i.configPermissions ? i.configPermissions({
|
|
5190
5139
|
user: n.user
|
|
5191
5140
|
}).createCollections : !0;
|
|
5192
5141
|
return /* @__PURE__ */ e(
|
|
5193
5142
|
tr,
|
|
5194
5143
|
{
|
|
5195
|
-
className:
|
|
5144
|
+
className: fe("h-full p-4 min-h-[124px]"),
|
|
5196
5145
|
onClick: i && l ? () => i.createCollection({
|
|
5197
5146
|
initialValues: t ? { group: t } : void 0,
|
|
5198
5147
|
parentCollectionIds: [],
|
|
@@ -5222,11 +5171,11 @@ function cn({
|
|
|
5222
5171
|
);
|
|
5223
5172
|
}
|
|
5224
5173
|
function dn({ introMode: t }) {
|
|
5225
|
-
const r =
|
|
5174
|
+
const r = Te(), n = Ne(), i = ge(), l = i.configPermissions ? i.configPermissions({
|
|
5226
5175
|
user: r.user
|
|
5227
5176
|
}).createCollections : !0, o = i.rootPathSuggestions, d = (o ?? []).length > 3 || (n.collections ?? []).length === 0 && (o ?? []).length > 0;
|
|
5228
5177
|
return /* @__PURE__ */ e(
|
|
5229
|
-
|
|
5178
|
+
Jr,
|
|
5230
5179
|
{
|
|
5231
5180
|
in: t === "existing_project" || d,
|
|
5232
5181
|
children: /* @__PURE__ */ a(
|
|
@@ -5249,21 +5198,21 @@ function dn({ introMode: t }) {
|
|
|
5249
5198
|
{
|
|
5250
5199
|
className: "flex flex-row gap-1 overflow-scroll no-scrollbar ",
|
|
5251
5200
|
children: [
|
|
5252
|
-
(o ?? []).map((
|
|
5201
|
+
(o ?? []).map((u) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
5253
5202
|
st,
|
|
5254
5203
|
{
|
|
5255
5204
|
icon: /* @__PURE__ */ e(se, { size: "small" }),
|
|
5256
5205
|
colorScheme: "cyanLighter",
|
|
5257
5206
|
onClick: i && l ? () => i.createCollection({
|
|
5258
|
-
initialValues: { path:
|
|
5207
|
+
initialValues: { path: u, name: ut(u) },
|
|
5259
5208
|
parentCollectionIds: [],
|
|
5260
5209
|
redirect: !0,
|
|
5261
5210
|
sourceClick: "root_collection_suggestion"
|
|
5262
5211
|
}) : void 0,
|
|
5263
5212
|
size: "small",
|
|
5264
|
-
children:
|
|
5213
|
+
children: u
|
|
5265
5214
|
}
|
|
5266
|
-
) },
|
|
5215
|
+
) }, u)),
|
|
5267
5216
|
o === void 0 && /* @__PURE__ */ e(De, { size: "small" }),
|
|
5268
5217
|
o?.length === 0 && /* @__PURE__ */ e(O, { variant: "caption", children: "No suggestions" })
|
|
5269
5218
|
]
|
|
@@ -5283,7 +5232,7 @@ function un({
|
|
|
5283
5232
|
parentCollectionIds: l,
|
|
5284
5233
|
collection: o
|
|
5285
5234
|
}) {
|
|
5286
|
-
const d =
|
|
5235
|
+
const d = ge();
|
|
5287
5236
|
return /* @__PURE__ */ e(te, { title: "Edit", children: /* @__PURE__ */ e(
|
|
5288
5237
|
oe,
|
|
5289
5238
|
{
|
|
@@ -5307,7 +5256,7 @@ function pn({
|
|
|
5307
5256
|
parentCollectionIds: r,
|
|
5308
5257
|
collection: n
|
|
5309
5258
|
}) {
|
|
5310
|
-
const i =
|
|
5259
|
+
const i = Te(), l = ge(), o = l.configPermissions ? l.configPermissions({
|
|
5311
5260
|
user: i.user,
|
|
5312
5261
|
collection: n
|
|
5313
5262
|
}).editCollections : !0;
|
|
@@ -5328,8 +5277,8 @@ function pn({
|
|
|
5328
5277
|
) });
|
|
5329
5278
|
}
|
|
5330
5279
|
function mn() {
|
|
5331
|
-
const t =
|
|
5332
|
-
return /* @__PURE__ */ a(
|
|
5280
|
+
const t = ge();
|
|
5281
|
+
return /* @__PURE__ */ e("div", { className: "bg-gray-50 dark:bg-gray-900 min-w-fit rounded", children: /* @__PURE__ */ a(
|
|
5333
5282
|
z,
|
|
5334
5283
|
{
|
|
5335
5284
|
className: "min-w-fit",
|
|
@@ -5344,9 +5293,75 @@ function mn() {
|
|
|
5344
5293
|
"New collection"
|
|
5345
5294
|
]
|
|
5346
5295
|
}
|
|
5347
|
-
);
|
|
5296
|
+
) });
|
|
5297
|
+
}
|
|
5298
|
+
function hn({
|
|
5299
|
+
path: t,
|
|
5300
|
+
parentCollectionIds: r,
|
|
5301
|
+
collection: n,
|
|
5302
|
+
tableController: i
|
|
5303
|
+
}) {
|
|
5304
|
+
const l = Te(), o = ge(), d = fr(), p = _e(), u = o.configPermissions ? o.configPermissions({
|
|
5305
|
+
user: l.user,
|
|
5306
|
+
collection: n
|
|
5307
|
+
}).editCollections : !0;
|
|
5308
|
+
let h = null;
|
|
5309
|
+
return (!ye(at(i.filterValues), at(n.initialFilter)) || !ye(at(i.sortBy), at(n.initialSort))) && (h = /* @__PURE__ */ a(R, { children: [
|
|
5310
|
+
/* @__PURE__ */ e(
|
|
5311
|
+
te,
|
|
5312
|
+
{
|
|
5313
|
+
title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
5314
|
+
children: /* @__PURE__ */ e(
|
|
5315
|
+
z,
|
|
5316
|
+
{
|
|
5317
|
+
color: "primary",
|
|
5318
|
+
size: "small",
|
|
5319
|
+
variant: "outlined",
|
|
5320
|
+
onClick: () => d?.saveCollection({
|
|
5321
|
+
id: n.id,
|
|
5322
|
+
parentCollectionIds: r,
|
|
5323
|
+
collectionData: W(
|
|
5324
|
+
n,
|
|
5325
|
+
{
|
|
5326
|
+
initialFilter: i.filterValues ?? null,
|
|
5327
|
+
initialSort: i.sortBy ?? null
|
|
5328
|
+
}
|
|
5329
|
+
)
|
|
5330
|
+
}).then(() => {
|
|
5331
|
+
p.open({
|
|
5332
|
+
type: "success",
|
|
5333
|
+
message: "Default config saved"
|
|
5334
|
+
});
|
|
5335
|
+
}),
|
|
5336
|
+
children: /* @__PURE__ */ e(Qr, {})
|
|
5337
|
+
}
|
|
5338
|
+
)
|
|
5339
|
+
}
|
|
5340
|
+
),
|
|
5341
|
+
(n.initialFilter || n.initialSort) && /* @__PURE__ */ e(
|
|
5342
|
+
te,
|
|
5343
|
+
{
|
|
5344
|
+
title: "Reset to default filter and sort",
|
|
5345
|
+
children: /* @__PURE__ */ e(
|
|
5346
|
+
z,
|
|
5347
|
+
{
|
|
5348
|
+
color: "primary",
|
|
5349
|
+
size: "small",
|
|
5350
|
+
variant: "text",
|
|
5351
|
+
onClick: () => {
|
|
5352
|
+
i.clearFilter?.(), n?.initialFilter && i.setFilterValues?.(n?.initialFilter), n?.initialSort && i.setSortBy?.(n?.initialSort);
|
|
5353
|
+
},
|
|
5354
|
+
children: /* @__PURE__ */ e(Xr, {})
|
|
5355
|
+
}
|
|
5356
|
+
)
|
|
5357
|
+
}
|
|
5358
|
+
)
|
|
5359
|
+
] })), /* @__PURE__ */ e(R, { children: u && h });
|
|
5348
5360
|
}
|
|
5349
|
-
function
|
|
5361
|
+
function at(t) {
|
|
5362
|
+
return t && Object.keys(t).length === 0 ? t : t ?? null;
|
|
5363
|
+
}
|
|
5364
|
+
function _n({
|
|
5350
5365
|
collectionConfigController: t,
|
|
5351
5366
|
introMode: r,
|
|
5352
5367
|
configPermissions: n,
|
|
@@ -5354,47 +5369,46 @@ function In({
|
|
|
5354
5369
|
extraView: l,
|
|
5355
5370
|
pathSuggestions: o,
|
|
5356
5371
|
getUser: d,
|
|
5357
|
-
collectionInference:
|
|
5358
|
-
getData:
|
|
5372
|
+
collectionInference: p,
|
|
5373
|
+
getData: u,
|
|
5359
5374
|
onAnalyticsEvent: h
|
|
5360
5375
|
}) {
|
|
5361
5376
|
return {
|
|
5362
|
-
|
|
5377
|
+
key: "collection_editor",
|
|
5363
5378
|
loading: t.loading,
|
|
5364
|
-
collections: {
|
|
5365
|
-
CollectionActions: ln
|
|
5366
|
-
},
|
|
5367
5379
|
provider: {
|
|
5368
5380
|
Component: on,
|
|
5369
5381
|
props: {
|
|
5370
5382
|
collectionConfigController: t,
|
|
5371
5383
|
configPermissions: n,
|
|
5372
|
-
collectionInference:
|
|
5384
|
+
collectionInference: p,
|
|
5373
5385
|
reservedGroups: i,
|
|
5374
5386
|
extraView: l,
|
|
5375
5387
|
pathSuggestions: o,
|
|
5376
5388
|
getUser: d,
|
|
5377
|
-
getData:
|
|
5389
|
+
getData: u,
|
|
5378
5390
|
onAnalyticsEvent: h
|
|
5379
5391
|
}
|
|
5380
5392
|
},
|
|
5381
5393
|
homePage: {
|
|
5382
5394
|
additionalActions: /* @__PURE__ */ e(mn, {}),
|
|
5383
|
-
additionalChildrenStart: r ? /* @__PURE__ */ e(
|
|
5395
|
+
additionalChildrenStart: r ? /* @__PURE__ */ e(fn, { introMode: r }) : void 0,
|
|
5384
5396
|
additionalChildrenEnd: /* @__PURE__ */ e(dn, { introMode: r }),
|
|
5385
5397
|
CollectionActions: sn,
|
|
5386
5398
|
AdditionalCards: r ? void 0 : cn
|
|
5387
5399
|
},
|
|
5388
5400
|
collectionView: {
|
|
5401
|
+
CollectionActionsStart: hn,
|
|
5402
|
+
CollectionActions: ln,
|
|
5389
5403
|
HeaderAction: un,
|
|
5390
5404
|
AddColumnComponent: pn
|
|
5391
5405
|
}
|
|
5392
5406
|
};
|
|
5393
5407
|
}
|
|
5394
|
-
function
|
|
5395
|
-
if (!
|
|
5408
|
+
function fn({ introMode: t }) {
|
|
5409
|
+
if (!Ne().topLevelNavigation)
|
|
5396
5410
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
5397
|
-
const n =
|
|
5411
|
+
const n = Te(), i = ge(), l = i.configPermissions ? i.configPermissions({
|
|
5398
5412
|
user: n.user
|
|
5399
5413
|
}).createCollections : !0;
|
|
5400
5414
|
return /* @__PURE__ */ a("div", { className: "mt-8 flex flex-col mt-8 p-2", children: [
|
|
@@ -5418,8 +5432,8 @@ function hn({ introMode: t }) {
|
|
|
5418
5432
|
)
|
|
5419
5433
|
] });
|
|
5420
5434
|
}
|
|
5421
|
-
function
|
|
5422
|
-
const r =
|
|
5435
|
+
function Fn({ path: t }) {
|
|
5436
|
+
const r = Ne(), n = gn(t), i = r.getParentCollectionIds(t), l = ge();
|
|
5423
5437
|
return /* @__PURE__ */ a("div", { className: "p-1 flex flex-col items-center", children: [
|
|
5424
5438
|
/* @__PURE__ */ e(Wt, { error: "No collection for path: " + n }),
|
|
5425
5439
|
/* @__PURE__ */ e(
|
|
@@ -5441,21 +5455,21 @@ function _n({ path: t }) {
|
|
|
5441
5455
|
)
|
|
5442
5456
|
] });
|
|
5443
5457
|
}
|
|
5444
|
-
function
|
|
5458
|
+
function gn(t) {
|
|
5445
5459
|
const r = t.split("/");
|
|
5446
5460
|
return r[r.length - 1];
|
|
5447
5461
|
}
|
|
5448
5462
|
export {
|
|
5449
|
-
|
|
5463
|
+
Fn as MissingReferenceWidget,
|
|
5450
5464
|
qe as editableProperty,
|
|
5451
5465
|
ae as getFullId,
|
|
5452
5466
|
ir as getFullIdPath,
|
|
5453
|
-
|
|
5454
|
-
|
|
5467
|
+
he as idToPropertiesPath,
|
|
5468
|
+
be as namespaceToPropertiesOrderPath,
|
|
5455
5469
|
bi as namespaceToPropertiesPath,
|
|
5456
5470
|
wi as removeNonEditableProperties,
|
|
5457
|
-
|
|
5458
|
-
|
|
5471
|
+
ge as useCollectionEditorController,
|
|
5472
|
+
_n as useCollectionEditorPlugin,
|
|
5459
5473
|
fr as useCollectionsConfigController
|
|
5460
5474
|
};
|
|
5461
5475
|
//# sourceMappingURL=index.es.js.map
|