@firecms/collection_editor 3.0.0-beta.2 → 3.0.0-beta.4.pre.1
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 +579 -567
- 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/collection_editor/utils/supported_fields.d.ts +2 -2
- package/package.json +27 -19
- package/src/ConfigControllerProvider.tsx +1 -1
- package/src/types/persisted_collection.ts +1 -1
- package/src/ui/MissingReferenceWidget.tsx +2 -1
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +17 -18
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +8 -4
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +1 -1
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +26 -9
- package/src/ui/collection_editor/EnumForm.tsx +3 -4
- package/src/ui/collection_editor/PropertyEditView.tsx +4 -4
- package/src/ui/collection_editor/SubcollectionsEditTab.tsx +1 -2
- 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 +4 -6
- 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 +1 -3
- 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 Ie, resolveEnumValues as Cr, isPropertyBuilder as ne, useCustomizationController as Ae, getFieldConfig as $e, ErrorBoundary as ge, PropertyConfigBadge as Ye, unslugify as ut, useNavigationController as Pe, 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 _e, randomString as _t, CircularProgressCenter as Nt, removeUndefined as Ft, ErrorView as Wt, removeInitialAndTrailingSlashes as Or, getDefaultPropertiesOrder as Vr } from "@firecms/core";
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as j } 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 Ie, resolveEnumValues as Cr, isPropertyBuilder as ne, useCustomizationController as Ae, getFieldConfig as $e, ErrorBoundary as ge, PropertyConfigBadge as Ye, unslugify as ut, useNavigationController as Pe, 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 _e, 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
|
-
import Y, { useState as $, useEffect as
|
|
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
5
|
import ve from "react-fast-compare";
|
|
6
|
-
import {
|
|
6
|
+
import { useAutoComplete as _r, Container as mt, Typography as O, Tooltip as te, IconButton as oe, Chip as st, TextField as Oe, cn as he, DebouncedTextField as Z, Autocomplete as Fr, AutocompleteItem as Sr, ExpandablePanel as xt, SettingsIcon as He, Select as be, 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 Ce, 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, UndoIcon as Kr, SaveIcon as Wr, Menu as Zr, MoreVertIcon as Jr, MenuItem as Qr, Collapse 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,
|
|
@@ -36,17 +30,17 @@ function yi({
|
|
|
36
30
|
setFieldValue: p,
|
|
37
31
|
handleChange: h,
|
|
38
32
|
touched: m,
|
|
39
|
-
errors:
|
|
40
|
-
setFieldTouched:
|
|
33
|
+
errors: s,
|
|
34
|
+
setFieldTouched: f,
|
|
41
35
|
isSubmitting: v,
|
|
42
36
|
submitCount: x
|
|
43
|
-
} = K(), [y, P] = $(!1), [
|
|
44
|
-
p("name",
|
|
37
|
+
} = K(), [y, P] = $(!1), [k, b] = $(!1), C = (c) => {
|
|
38
|
+
p("name", c), !I(m, "path") && t && c && p("path", Pt(c)), !I(m, "id") && t && c && p("id", Pt(c)), !I(m, "singularName") && t && c && p("singularName", vr(c));
|
|
45
39
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
const N = /* @__PURE__ */ e(ot, { collectionOrView: u }),
|
|
40
|
+
de(() => {
|
|
41
|
+
s.id && b(!0);
|
|
42
|
+
}, [s.id]);
|
|
43
|
+
const N = /* @__PURE__ */ e(ot, { collectionOrView: u }), g = l?.filter((c) => !r?.includes(c)), {
|
|
50
44
|
inputFocused: w,
|
|
51
45
|
autoCompleteOpen: _,
|
|
52
46
|
setAutoCompleteOpen: M
|
|
@@ -86,15 +80,15 @@ function yi({
|
|
|
86
80
|
Oe,
|
|
87
81
|
{
|
|
88
82
|
value: u.name ?? "",
|
|
89
|
-
onChange: (
|
|
83
|
+
onChange: (c) => C(c.target.value),
|
|
90
84
|
label: "Name",
|
|
91
85
|
required: !0,
|
|
92
|
-
error: A && !!
|
|
86
|
+
error: A && !!s.name
|
|
93
87
|
}
|
|
94
88
|
),
|
|
95
|
-
/* @__PURE__ */ e(X, { error: m.name && !!
|
|
89
|
+
/* @__PURE__ */ e(X, { error: m.name && !!s.name, children: m.name && s.name ? s.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: he("col-span-12 ", R ? "" : "sm:col-span-8"), children: [
|
|
98
92
|
/* @__PURE__ */ e(
|
|
99
93
|
H,
|
|
100
94
|
{
|
|
@@ -103,20 +97,20 @@ function yi({
|
|
|
103
97
|
label: "Path",
|
|
104
98
|
disabled: !t,
|
|
105
99
|
required: !0,
|
|
106
|
-
error: A && !!
|
|
100
|
+
error: A && !!s.path
|
|
107
101
|
}
|
|
108
102
|
),
|
|
109
|
-
/* @__PURE__ */ e(X, { error: m.path && !!
|
|
103
|
+
/* @__PURE__ */ e(X, { error: m.path && !!s.path, children: m.path && s.path ? s.path : R ? "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
|
!R && /* @__PURE__ */ a("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
112
106
|
/* @__PURE__ */ e(
|
|
113
107
|
Oe,
|
|
114
108
|
{
|
|
115
|
-
error: A && !!
|
|
109
|
+
error: A && !!s.group,
|
|
116
110
|
disabled: v,
|
|
117
111
|
value: u.group ?? "",
|
|
118
112
|
autoComplete: "off",
|
|
119
|
-
onChange: (
|
|
113
|
+
onChange: (c) => p("group", c.target.value),
|
|
120
114
|
name: "group",
|
|
121
115
|
inputRef: d,
|
|
122
116
|
label: "Group"
|
|
@@ -125,26 +119,26 @@ function yi({
|
|
|
125
119
|
/* @__PURE__ */ e(
|
|
126
120
|
Fr,
|
|
127
121
|
{
|
|
128
|
-
open: _ && (
|
|
122
|
+
open: _ && (g ?? []).length > 0,
|
|
129
123
|
setOpen: M,
|
|
130
|
-
children:
|
|
124
|
+
children: g?.map((c, V) => /* @__PURE__ */ e(
|
|
131
125
|
Sr,
|
|
132
126
|
{
|
|
133
127
|
onClick: () => {
|
|
134
|
-
M(!1), p("group",
|
|
128
|
+
M(!1), p("group", c ?? null);
|
|
135
129
|
},
|
|
136
|
-
children: /* @__PURE__ */ e("div", { className: "flex-grow", children:
|
|
130
|
+
children: /* @__PURE__ */ e("div", { className: "flex-grow", children: c })
|
|
137
131
|
},
|
|
138
|
-
V + "_" +
|
|
132
|
+
V + "_" + c
|
|
139
133
|
))
|
|
140
134
|
}
|
|
141
135
|
),
|
|
142
|
-
/* @__PURE__ */ e(X, { children: A &&
|
|
136
|
+
/* @__PURE__ */ e(X, { children: A && s.group ? s.group : "Group of the collection" })
|
|
143
137
|
] }),
|
|
144
138
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
145
139
|
xt,
|
|
146
140
|
{
|
|
147
|
-
expanded:
|
|
141
|
+
expanded: k,
|
|
148
142
|
onExpandedChange: b,
|
|
149
143
|
title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
|
|
150
144
|
/* @__PURE__ */ e(He, {}),
|
|
@@ -167,30 +161,30 @@ function yi({
|
|
|
167
161
|
as: Z,
|
|
168
162
|
disabled: !t,
|
|
169
163
|
label: "Collection id",
|
|
170
|
-
error: A && !!
|
|
164
|
+
error: A && !!s.id
|
|
171
165
|
}
|
|
172
166
|
),
|
|
173
|
-
/* @__PURE__ */ e(X, { error: m.id && !!
|
|
167
|
+
/* @__PURE__ */ e(X, { error: m.id && !!s.id, children: m.id && s.id ? s.id : "This id identifies this collection" })
|
|
174
168
|
] }),
|
|
175
169
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
176
170
|
/* @__PURE__ */ e(
|
|
177
171
|
Oe,
|
|
178
172
|
{
|
|
179
|
-
error: A && !!
|
|
173
|
+
error: A && !!s.singularName,
|
|
180
174
|
name: "singularName",
|
|
181
175
|
"aria-describedby": "singularName-helper",
|
|
182
|
-
onChange: (
|
|
176
|
+
onChange: (c) => (f("singularName", !0), h(c)),
|
|
183
177
|
value: u.singularName ?? "",
|
|
184
178
|
label: "Singular name"
|
|
185
179
|
}
|
|
186
180
|
),
|
|
187
|
-
/* @__PURE__ */ e(X, { error: A && !!
|
|
181
|
+
/* @__PURE__ */ e(X, { error: A && !!s.singularName, children: A && s.singularName ? s.singularName : "Optionally define a singular name for your entities" })
|
|
188
182
|
] }),
|
|
189
183
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
190
184
|
/* @__PURE__ */ e(
|
|
191
185
|
Oe,
|
|
192
186
|
{
|
|
193
|
-
error: A && !!
|
|
187
|
+
error: A && !!s.description,
|
|
194
188
|
name: "description",
|
|
195
189
|
value: u.description ?? "",
|
|
196
190
|
onChange: h,
|
|
@@ -200,7 +194,7 @@ function yi({
|
|
|
200
194
|
label: "Description"
|
|
201
195
|
}
|
|
202
196
|
),
|
|
203
|
-
/* @__PURE__ */ e(X, { error: A && !!
|
|
197
|
+
/* @__PURE__ */ e(X, { error: A && !!s.description, children: A && s.description ? s.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
|
be,
|
|
@@ -210,14 +204,14 @@ function yi({
|
|
|
210
204
|
position: "item-aligned",
|
|
211
205
|
onChange: h,
|
|
212
206
|
value: u.defaultSize ?? "",
|
|
213
|
-
renderValue: (
|
|
214
|
-
children: ["xs", "s", "m", "l", "xl"].map((
|
|
207
|
+
renderValue: (c) => c.toUpperCase(),
|
|
208
|
+
children: ["xs", "s", "m", "l", "xl"].map((c) => /* @__PURE__ */ e(
|
|
215
209
|
ee,
|
|
216
210
|
{
|
|
217
|
-
value:
|
|
218
|
-
children:
|
|
211
|
+
value: c,
|
|
212
|
+
children: c.toUpperCase()
|
|
219
213
|
},
|
|
220
|
-
`size-select-${
|
|
214
|
+
`size-select-${c}`
|
|
221
215
|
))
|
|
222
216
|
}
|
|
223
217
|
) }),
|
|
@@ -228,13 +222,13 @@ function yi({
|
|
|
228
222
|
label: "Data IDs generation",
|
|
229
223
|
position: "item-aligned",
|
|
230
224
|
disabled: D === "code_defined",
|
|
231
|
-
onValueChange: (
|
|
232
|
-
if (
|
|
225
|
+
onValueChange: (c) => {
|
|
226
|
+
if (c === "code_defined")
|
|
233
227
|
throw new Error("This should not happen");
|
|
234
|
-
|
|
228
|
+
c === "true" ? p("customId", !0) : c === "false" ? p("customId", !1) : c === "optional" && p("customId", "optional");
|
|
235
229
|
},
|
|
236
230
|
value: D ?? "",
|
|
237
|
-
renderValue: (
|
|
231
|
+
renderValue: (c) => c === "code_defined" ? "Code defined" : c === "true" ? "Users must define an ID" : c === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
|
|
238
232
|
children: [
|
|
239
233
|
/* @__PURE__ */ e(ee, { value: "false", children: "Document ID is generated automatically" }),
|
|
240
234
|
/* @__PURE__ */ e(ee, { value: "true", children: "Users must define an ID" }),
|
|
@@ -248,7 +242,7 @@ function yi({
|
|
|
248
242
|
{
|
|
249
243
|
position: "start",
|
|
250
244
|
label: "Collection group",
|
|
251
|
-
onValueChange: (
|
|
245
|
+
onValueChange: (c) => p("collectionGroup", c),
|
|
252
246
|
value: u.collectionGroup ?? !1
|
|
253
247
|
}
|
|
254
248
|
),
|
|
@@ -260,7 +254,7 @@ function yi({
|
|
|
260
254
|
{
|
|
261
255
|
position: "start",
|
|
262
256
|
label: "Enable text search for this collection",
|
|
263
|
-
onValueChange: (
|
|
257
|
+
onValueChange: (c) => p("textSearchEnabled", c),
|
|
264
258
|
value: u.textSearchEnabled ?? !1
|
|
265
259
|
}
|
|
266
260
|
),
|
|
@@ -282,8 +276,8 @@ function yi({
|
|
|
282
276
|
gr,
|
|
283
277
|
{
|
|
284
278
|
selectedIcon: u.icon,
|
|
285
|
-
onIconSelected: (
|
|
286
|
-
P(!1), p("icon",
|
|
279
|
+
onIconSelected: (c) => {
|
|
280
|
+
P(!1), p("icon", c);
|
|
287
281
|
}
|
|
288
282
|
}
|
|
289
283
|
) })
|
|
@@ -291,7 +285,7 @@ function yi({
|
|
|
291
285
|
)
|
|
292
286
|
] }) });
|
|
293
287
|
}
|
|
294
|
-
function
|
|
288
|
+
function me(t) {
|
|
295
289
|
return "properties." + t.replaceAll(".", ".properties.");
|
|
296
290
|
}
|
|
297
291
|
function bi(t) {
|
|
@@ -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 me(n);
|
|
309
303
|
}
|
|
310
304
|
function Ci({
|
|
311
305
|
enumValues: t,
|
|
@@ -320,15 +314,15 @@ function Ci({
|
|
|
320
314
|
initialValues: { enumValues: t },
|
|
321
315
|
validateOnChange: !0,
|
|
322
316
|
validation: (m) => {
|
|
323
|
-
const
|
|
317
|
+
const s = {};
|
|
324
318
|
m.enumValues && m.enumValues.forEach((v, x) => {
|
|
325
|
-
v?.label || (
|
|
319
|
+
v?.label || (s.enumValues = s.enumValues ?? [], s.enumValues[x] = s.enumValues[x] ?? {}, s.enumValues[x].label = "You must specify a label for this enum value entry"), v?.id || (s.enumValues = s.enumValues ?? [], s.enumValues[x] = s.enumValues[x] ?? {}, s.enumValues[x].id = "You must specify an ID for this enum value entry");
|
|
326
320
|
});
|
|
327
|
-
const
|
|
328
|
-
return n?.(
|
|
321
|
+
const f = !!(s?.enumValues && Object.keys(s?.enumValues).length > 0);
|
|
322
|
+
return n?.(f), s;
|
|
329
323
|
}
|
|
330
324
|
}), { values: p, errors: h } = u;
|
|
331
|
-
return
|
|
325
|
+
return de(() => {
|
|
332
326
|
r && r(p.enumValues);
|
|
333
327
|
}, [p.enumValues]), /* @__PURE__ */ e(kt, { value: u, children: /* @__PURE__ */ e(
|
|
334
328
|
Pi,
|
|
@@ -354,8 +348,8 @@ function Pi({
|
|
|
354
348
|
}) {
|
|
355
349
|
const {
|
|
356
350
|
setFieldValue: u
|
|
357
|
-
} = K(), [p, h] = Y.useState(), [m,
|
|
358
|
-
const N = p === C,
|
|
351
|
+
} = K(), [p, h] = Y.useState(), [m, s] = Y.useState(), [f, v] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, P = (b, C) => {
|
|
352
|
+
const N = p === C, g = r?.enumValues && r?.enumValues[b];
|
|
359
353
|
return /* @__PURE__ */ e(
|
|
360
354
|
Ni,
|
|
361
355
|
{
|
|
@@ -363,9 +357,9 @@ function Pi({
|
|
|
363
357
|
disabled: n,
|
|
364
358
|
enumValuesPath: i,
|
|
365
359
|
autoFocus: N,
|
|
366
|
-
entryError:
|
|
360
|
+
entryError: g,
|
|
367
361
|
shouldUpdateId: l || N,
|
|
368
|
-
onDialogOpen: () =>
|
|
362
|
+
onDialogOpen: () => s(b),
|
|
369
363
|
inferredEntry: y.has(t.enumValues[b]?.id)
|
|
370
364
|
},
|
|
371
365
|
`${C}`
|
|
@@ -385,24 +379,24 @@ function Pi({
|
|
|
385
379
|
o && /* @__PURE__ */ a(
|
|
386
380
|
z,
|
|
387
381
|
{
|
|
388
|
-
loading:
|
|
389
|
-
disabled: n ||
|
|
382
|
+
loading: f,
|
|
383
|
+
disabled: n || f,
|
|
390
384
|
variant: "text",
|
|
391
385
|
size: "small",
|
|
392
386
|
onClick: async () => {
|
|
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)),
|
|
390
|
+
const C = b.flat(), N = Array.from(new Set(C)), g = t.enumValues, _ = ei(N).filter((M) => !g?.some((R) => R.id === M.id));
|
|
397
391
|
_.forEach((M) => {
|
|
398
392
|
y.add(M.id);
|
|
399
|
-
}), u(i, [..._, ...
|
|
393
|
+
}), u(i, [..._, ...g], !0);
|
|
400
394
|
}).catch((b) => {
|
|
401
395
|
console.error(b);
|
|
402
396
|
}).finally(() => v(!1)));
|
|
403
397
|
},
|
|
404
398
|
children: [
|
|
405
|
-
|
|
399
|
+
f ? /* @__PURE__ */ e(De, { size: "small" }) : /* @__PURE__ */ e(ht, {}),
|
|
406
400
|
"Infer values from data"
|
|
407
401
|
]
|
|
408
402
|
}
|
|
@@ -430,7 +424,7 @@ function Pi({
|
|
|
430
424
|
index: m,
|
|
431
425
|
open: m !== void 0,
|
|
432
426
|
enumValuesPath: i,
|
|
433
|
-
onClose: () =>
|
|
427
|
+
onClose: () => s(void 0)
|
|
434
428
|
}
|
|
435
429
|
)
|
|
436
430
|
] })
|
|
@@ -450,13 +444,13 @@ const Ni = Y.memo(
|
|
|
450
444
|
const {
|
|
451
445
|
values: h,
|
|
452
446
|
handleChange: m,
|
|
453
|
-
errors:
|
|
454
|
-
setFieldValue:
|
|
447
|
+
errors: s,
|
|
448
|
+
setFieldValue: f,
|
|
455
449
|
touched: v
|
|
456
|
-
} = K(), x = Y.useRef(!I(h, `${i}[${r}].id`)), y = n || x.current, P = I(h, `${i}[${r}].id`),
|
|
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
|
-
(b.current === P || !P) && y &&
|
|
459
|
-
}, [
|
|
452
|
+
(b.current === P || !P) && y && f(`${i}[${r}].id`, k), b.current = k;
|
|
453
|
+
}, [k]), /* @__PURE__ */ a(j, { children: [
|
|
460
454
|
/* @__PURE__ */ a("div", { className: "flex w-full align-center justify-center", children: [
|
|
461
455
|
/* @__PURE__ */ e(
|
|
462
456
|
H,
|
|
@@ -552,7 +546,7 @@ function xi({
|
|
|
552
546
|
}
|
|
553
547
|
);
|
|
554
548
|
}
|
|
555
|
-
function
|
|
549
|
+
function ce({
|
|
556
550
|
field: t,
|
|
557
551
|
form: r,
|
|
558
552
|
label: n,
|
|
@@ -583,14 +577,14 @@ function se({
|
|
|
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(j, { 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
586
|
children: ({ field: d, form: u }) => /* @__PURE__ */ e(
|
|
593
|
-
|
|
587
|
+
ce,
|
|
594
588
|
{
|
|
595
589
|
disabled: t,
|
|
596
590
|
label: "Required",
|
|
@@ -607,7 +601,7 @@ function Se({ disabled: t }) {
|
|
|
607
601
|
name: "validation.unique",
|
|
608
602
|
type: "checkbox",
|
|
609
603
|
children: ({ field: d, form: u }) => /* @__PURE__ */ e(
|
|
610
|
-
|
|
604
|
+
ce,
|
|
611
605
|
{
|
|
612
606
|
disabled: t,
|
|
613
607
|
label: "Unique",
|
|
@@ -645,18 +639,18 @@ function Ee({
|
|
|
645
639
|
const {
|
|
646
640
|
values: h,
|
|
647
641
|
handleChange: m,
|
|
648
|
-
errors:
|
|
649
|
-
} = K(),
|
|
642
|
+
errors: s
|
|
643
|
+
} = K(), f = "validation.length", v = "validation.min", x = "validation.max", y = "validation.trim", P = "validation.matches", k = "validation.lowercase", b = "validation.uppercase", C = I(s, P), N = I(h, P), g = typeof N == "string" ? N : br(N);
|
|
650
644
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
651
645
|
/* @__PURE__ */ e(Se, { disabled: u }),
|
|
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,
|
|
655
649
|
{
|
|
656
|
-
name:
|
|
650
|
+
name: k,
|
|
657
651
|
type: "checkbox",
|
|
658
652
|
children: ({ field: w, form: _ }) => /* @__PURE__ */ e(
|
|
659
|
-
|
|
653
|
+
ce,
|
|
660
654
|
{
|
|
661
655
|
label: "Lowercase",
|
|
662
656
|
disabled: u,
|
|
@@ -672,7 +666,7 @@ function Ee({
|
|
|
672
666
|
name: b,
|
|
673
667
|
type: "checkbox",
|
|
674
668
|
children: ({ field: w, form: _ }) => /* @__PURE__ */ e(
|
|
675
|
-
|
|
669
|
+
ce,
|
|
676
670
|
{
|
|
677
671
|
label: "Uppercase",
|
|
678
672
|
disabled: u,
|
|
@@ -688,7 +682,7 @@ function Ee({
|
|
|
688
682
|
name: y,
|
|
689
683
|
type: "checkbox",
|
|
690
684
|
children: ({ field: w, form: _ }) => /* @__PURE__ */ e(
|
|
691
|
-
|
|
685
|
+
ce,
|
|
692
686
|
{
|
|
693
687
|
label: "Trim",
|
|
694
688
|
disabled: u,
|
|
@@ -703,9 +697,9 @@ function Ee({
|
|
|
703
697
|
t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
704
698
|
Z,
|
|
705
699
|
{
|
|
706
|
-
value: I(h,
|
|
700
|
+
value: I(h, f),
|
|
707
701
|
label: "Exact length",
|
|
708
|
-
name:
|
|
702
|
+
name: f,
|
|
709
703
|
type: "number",
|
|
710
704
|
size: "small",
|
|
711
705
|
disabled: u,
|
|
@@ -746,7 +740,7 @@ function Ee({
|
|
|
746
740
|
label: "Matches regex",
|
|
747
741
|
size: "small",
|
|
748
742
|
disabled: u,
|
|
749
|
-
value:
|
|
743
|
+
value: g,
|
|
750
744
|
error: !!C
|
|
751
745
|
}
|
|
752
746
|
),
|
|
@@ -827,8 +821,8 @@ function Rt({
|
|
|
827
821
|
values: d,
|
|
828
822
|
setFieldError: u,
|
|
829
823
|
setFieldValue: p
|
|
830
|
-
} = K(), h = Ie(), m = t ? "of.enumValues" : "enumValues",
|
|
831
|
-
return /* @__PURE__ */ a(
|
|
824
|
+
} = K(), h = Ie(), m = t ? "of.enumValues" : "enumValues", s = I(d, "defaultValue"), f = I(d, m), v = Zt(() => !f || typeof f == "boolean" ? [] : Cr(f) ?? [], [f]);
|
|
825
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
832
826
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
833
827
|
Ci,
|
|
834
828
|
{
|
|
@@ -842,8 +836,8 @@ function Rt({
|
|
|
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
838
|
if (d && (p(m, y), !t)) {
|
|
845
|
-
const P = y.filter((
|
|
846
|
-
|
|
839
|
+
const P = y.filter((k) => !!k?.id).map((k) => k.id);
|
|
840
|
+
s && !P.includes(s) && (p("defaultValue", void 0), h.open({
|
|
847
841
|
type: "warning",
|
|
848
842
|
message: "Default value was cleared"
|
|
849
843
|
}));
|
|
@@ -870,7 +864,7 @@ function Rt({
|
|
|
870
864
|
p("defaultValue", y);
|
|
871
865
|
},
|
|
872
866
|
label: "Default value",
|
|
873
|
-
value:
|
|
867
|
+
value: s ?? "",
|
|
874
868
|
children: v.filter((y) => !!y?.id).map((y) => /* @__PURE__ */ e(
|
|
875
869
|
ee,
|
|
876
870
|
{
|
|
@@ -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`, u = `${o}.fileName`, p = `${o}.storagePath`, h = `${o}.storeUrl`, m = I(i, u) ?? "{rand}_{file}",
|
|
895
|
+
} = K(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, u = `${o}.fileName`, p = `${o}.storagePath`, h = `${o}.storeUrl`, m = I(i, u) ?? "{rand}_{file}", s = I(i, p) ?? "/", f = I(i, d), v = Array.isArray(f) ? f : 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
|
-
}, P = typeof m == "function",
|
|
904
|
-
return /* @__PURE__ */ a(
|
|
897
|
+
}, P = typeof m == "function", k = typeof s == "function";
|
|
898
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
905
899
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
906
900
|
xt,
|
|
907
901
|
{
|
|
@@ -975,9 +969,9 @@ function Ut({
|
|
|
975
969
|
name: p,
|
|
976
970
|
as: Z,
|
|
977
971
|
label: "Storage path",
|
|
978
|
-
disabled:
|
|
972
|
+
disabled: k || n,
|
|
979
973
|
size: "small",
|
|
980
|
-
value:
|
|
974
|
+
value: k ? "-" : s
|
|
981
975
|
}
|
|
982
976
|
),
|
|
983
977
|
/* @__PURE__ */ a(O, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
|
|
@@ -998,7 +992,7 @@ function Ut({
|
|
|
998
992
|
name: h,
|
|
999
993
|
type: "checkbox",
|
|
1000
994
|
children: ({ field: b, form: C }) => /* @__PURE__ */ e(
|
|
1001
|
-
|
|
995
|
+
ce,
|
|
1002
996
|
{
|
|
1003
997
|
label: "Save URL instead of storage path",
|
|
1004
998
|
disabled: r || n,
|
|
@@ -1060,7 +1054,7 @@ function nr({
|
|
|
1060
1054
|
/* @__PURE__ */ a(
|
|
1061
1055
|
Ce,
|
|
1062
1056
|
{
|
|
1063
|
-
className:
|
|
1057
|
+
className: he(
|
|
1064
1058
|
"border",
|
|
1065
1059
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
1066
1060
|
Qt,
|
|
@@ -1137,7 +1131,7 @@ function Ti({
|
|
|
1137
1131
|
/* @__PURE__ */ e(
|
|
1138
1132
|
Ce,
|
|
1139
1133
|
{
|
|
1140
|
-
className:
|
|
1134
|
+
className: he(
|
|
1141
1135
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
1142
1136
|
Qt,
|
|
1143
1137
|
n ? Xt : "",
|
|
@@ -1213,48 +1207,48 @@ const ft = Y.memo(
|
|
|
1213
1207
|
onPropertyMove: p,
|
|
1214
1208
|
onPropertyRemove: h,
|
|
1215
1209
|
className: m,
|
|
1216
|
-
inferredPropertyKeys:
|
|
1217
|
-
collectionEditable:
|
|
1210
|
+
inferredPropertyKeys: s,
|
|
1211
|
+
collectionEditable: f
|
|
1218
1212
|
}) {
|
|
1219
1213
|
const v = o ?? Object.keys(l), x = Q((y) => {
|
|
1220
1214
|
if (!y.destination)
|
|
1221
1215
|
return;
|
|
1222
|
-
const P = y.source.index,
|
|
1223
|
-
b.splice(
|
|
1216
|
+
const P = y.source.index, k = y.destination.index, b = Array.from(v), [C] = b.splice(P, 1);
|
|
1217
|
+
b.splice(k, 0, C), p && p(b, r);
|
|
1224
1218
|
}, [r, p, v]);
|
|
1225
|
-
return /* @__PURE__ */ e(
|
|
1219
|
+
return /* @__PURE__ */ e(j, { 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,
|
|
1229
1223
|
ref: y.innerRef,
|
|
1230
1224
|
className: m,
|
|
1231
1225
|
children: [
|
|
1232
|
-
v && v.map((
|
|
1233
|
-
const C = l[
|
|
1234
|
-
return !C && !N ? (console.warn(`Property ${
|
|
1226
|
+
v && v.map((k, b) => {
|
|
1227
|
+
const C = l[k], N = d?.find((g) => g.key === k);
|
|
1228
|
+
return !C && !N ? (console.warn(`Property ${k} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
|
|
1235
1229
|
ai,
|
|
1236
1230
|
{
|
|
1237
|
-
draggableId: `array_field_${r}_${
|
|
1231
|
+
draggableId: `array_field_${r}_${k}}`,
|
|
1238
1232
|
index: b,
|
|
1239
|
-
children: (
|
|
1233
|
+
children: (g, w) => /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(
|
|
1240
1234
|
ki,
|
|
1241
1235
|
{
|
|
1242
|
-
propertyKey:
|
|
1236
|
+
propertyKey: k,
|
|
1243
1237
|
propertyOrBuilder: C,
|
|
1244
1238
|
additionalField: N,
|
|
1245
|
-
provided:
|
|
1239
|
+
provided: g,
|
|
1246
1240
|
errors: u,
|
|
1247
1241
|
namespace: r,
|
|
1248
|
-
inferredPropertyKeys:
|
|
1242
|
+
inferredPropertyKeys: s,
|
|
1249
1243
|
onPropertyMove: p,
|
|
1250
1244
|
onPropertyRemove: h,
|
|
1251
1245
|
onPropertyClick: w.isDragging ? void 0 : i,
|
|
1252
1246
|
selectedPropertyKey: n,
|
|
1253
|
-
collectionEditable:
|
|
1247
|
+
collectionEditable: f
|
|
1254
1248
|
}
|
|
1255
1249
|
) })
|
|
1256
1250
|
},
|
|
1257
|
-
`array_field_${r}_${
|
|
1251
|
+
`array_field_${r}_${k}}`
|
|
1258
1252
|
);
|
|
1259
1253
|
}).filter(Boolean),
|
|
1260
1254
|
y.placeholder
|
|
@@ -1281,9 +1275,9 @@ function ki({
|
|
|
1281
1275
|
onPropertyMove: p,
|
|
1282
1276
|
onPropertyRemove: h,
|
|
1283
1277
|
inferredPropertyKeys: m,
|
|
1284
|
-
collectionEditable:
|
|
1278
|
+
collectionEditable: s
|
|
1285
1279
|
}) {
|
|
1286
|
-
const
|
|
1280
|
+
const f = m?.includes(r ? `${r}.${t}` : t), v = ae(t, r), y = ir(t, r) in d;
|
|
1287
1281
|
let P;
|
|
1288
1282
|
if (typeof n == "object") {
|
|
1289
1283
|
const C = n;
|
|
@@ -1298,11 +1292,11 @@ function ki({
|
|
|
1298
1292
|
onPropertyClick: u,
|
|
1299
1293
|
onPropertyMove: p,
|
|
1300
1294
|
onPropertyRemove: h,
|
|
1301
|
-
collectionEditable:
|
|
1295
|
+
collectionEditable: s
|
|
1302
1296
|
}
|
|
1303
1297
|
));
|
|
1304
1298
|
}
|
|
1305
|
-
const
|
|
1299
|
+
const k = o === v, b = n && (s && !ne(n) || qe(n));
|
|
1306
1300
|
return /* @__PURE__ */ a(
|
|
1307
1301
|
"div",
|
|
1308
1302
|
{
|
|
@@ -1328,7 +1322,7 @@ function ki({
|
|
|
1328
1322
|
property: n,
|
|
1329
1323
|
onClick: u ? () => u(t, r) : void 0,
|
|
1330
1324
|
includeName: !0,
|
|
1331
|
-
selected:
|
|
1325
|
+
selected: k,
|
|
1332
1326
|
hasError: y
|
|
1333
1327
|
}
|
|
1334
1328
|
) : /* @__PURE__ */ e(
|
|
@@ -1337,11 +1331,11 @@ function ki({
|
|
|
1337
1331
|
name: t,
|
|
1338
1332
|
property: n,
|
|
1339
1333
|
onClick: u ? () => u(t, r) : void 0,
|
|
1340
|
-
selected:
|
|
1334
|
+
selected: k
|
|
1341
1335
|
}
|
|
1342
1336
|
),
|
|
1343
1337
|
/* @__PURE__ */ a("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
|
|
1344
|
-
|
|
1338
|
+
f && /* @__PURE__ */ e(te, { title: "Inferred property", children: /* @__PURE__ */ e(ht, { size: "small", className: "p-2" }) }),
|
|
1345
1339
|
h && /* @__PURE__ */ e(te, { title: "Remove", children: /* @__PURE__ */ e(
|
|
1346
1340
|
oe,
|
|
1347
1341
|
{
|
|
@@ -1369,28 +1363,28 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1369
1363
|
const {
|
|
1370
1364
|
values: o,
|
|
1371
1365
|
setFieldValue: d
|
|
1372
|
-
} = K(), [u, p] = $(!1), [h, m] = $(), [
|
|
1366
|
+
} = K(), [u, p] = $(!1), [h, m] = $(), [s, f] = $(), v = o.propertiesOrder ?? Object.keys(o.properties ?? {}), x = ({
|
|
1373
1367
|
id: N,
|
|
1374
|
-
property:
|
|
1368
|
+
property: g
|
|
1375
1369
|
}) => {
|
|
1376
1370
|
if (!N)
|
|
1377
1371
|
throw Error();
|
|
1378
1372
|
d("properties", {
|
|
1379
1373
|
...o.properties ?? {},
|
|
1380
|
-
[N]:
|
|
1374
|
+
[N]: g
|
|
1381
1375
|
}, !1);
|
|
1382
1376
|
const w = o.propertiesOrder ?? Object.keys(o.properties ?? {}), _ = w.includes(N) ? w : [...w, N];
|
|
1383
1377
|
d("propertiesOrder", _, !1), p(!1);
|
|
1384
|
-
}, y = Q((N,
|
|
1385
|
-
const w = N ? ae(N,
|
|
1378
|
+
}, y = Q((N, g) => {
|
|
1379
|
+
const w = N ? ae(N, g) : void 0;
|
|
1386
1380
|
if (!w)
|
|
1387
1381
|
throw Error("collection editor miss config");
|
|
1388
|
-
const _ =
|
|
1389
|
-
d(_, void 0, !1), d(M, R.filter((D) => D !== N), !1), p(!1), m(void 0),
|
|
1390
|
-
}, [d, o]), P = h ? ae(h,
|
|
1391
|
-
d(ye(
|
|
1382
|
+
const _ = me(w), M = ye(g), R = I(o, M) ?? Object.keys(I(o, bi(g)));
|
|
1383
|
+
d(_, void 0, !1), d(M, R.filter((D) => D !== N), !1), p(!1), m(void 0), f(void 0);
|
|
1384
|
+
}, [d, o]), P = h ? ae(h, s) : void 0, k = P ? I(o.properties, P.replaceAll(".", ".properties.")) : void 0, b = !v || v.length < 1, C = Q((N, g) => {
|
|
1385
|
+
d(ye(g), N, !1);
|
|
1392
1386
|
}, []);
|
|
1393
|
-
return /* @__PURE__ */ a(
|
|
1387
|
+
return /* @__PURE__ */ a(j, { 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" }),
|
|
@@ -1400,7 +1394,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1400
1394
|
color: "primary",
|
|
1401
1395
|
variant: "outlined",
|
|
1402
1396
|
onClick: () => p(!0),
|
|
1403
|
-
startIcon: /* @__PURE__ */ e(
|
|
1397
|
+
startIcon: /* @__PURE__ */ e(se, {}),
|
|
1404
1398
|
children: [
|
|
1405
1399
|
"Add property to ",
|
|
1406
1400
|
o.name ?? "this group"
|
|
@@ -1416,8 +1410,8 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1416
1410
|
propertiesOrder: v,
|
|
1417
1411
|
errors: {},
|
|
1418
1412
|
collectionEditable: l,
|
|
1419
|
-
onPropertyClick: (N,
|
|
1420
|
-
m(N), g
|
|
1413
|
+
onPropertyClick: (N, g) => {
|
|
1414
|
+
m(N), f(g), p(!0);
|
|
1421
1415
|
},
|
|
1422
1416
|
onPropertyMove: C
|
|
1423
1417
|
}
|
|
@@ -1454,16 +1448,16 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1454
1448
|
allowDataInference: n,
|
|
1455
1449
|
collectionEditable: l,
|
|
1456
1450
|
onCancel: () => {
|
|
1457
|
-
p(!1), m(void 0),
|
|
1451
|
+
p(!1), m(void 0), f(void 0);
|
|
1458
1452
|
},
|
|
1459
1453
|
onOkClicked: () => {
|
|
1460
|
-
p(!1), m(void 0),
|
|
1454
|
+
p(!1), m(void 0), f(void 0);
|
|
1461
1455
|
},
|
|
1462
1456
|
getData: r,
|
|
1463
1457
|
onDelete: y,
|
|
1464
1458
|
propertyKey: h,
|
|
1465
|
-
propertyNamespace:
|
|
1466
|
-
property:
|
|
1459
|
+
propertyNamespace: s,
|
|
1460
|
+
property: k,
|
|
1467
1461
|
existingProperty: !!h,
|
|
1468
1462
|
autoUpdateId: !h,
|
|
1469
1463
|
autoOpenTypeSelect: !h,
|
|
@@ -1488,11 +1482,11 @@ function Vi({
|
|
|
1488
1482
|
handleChange: p,
|
|
1489
1483
|
errors: h,
|
|
1490
1484
|
setFieldValue: m,
|
|
1491
|
-
touched:
|
|
1492
|
-
} = K(), [
|
|
1485
|
+
touched: s
|
|
1486
|
+
} = K(), [f, v] = $(!1), x = I(u, "of"), y = I(s, "of") && I(h, "of"), P = ({ id: b, property: C, namespace: N }) => {
|
|
1493
1487
|
console.log("onPropertyChanged", b, C, N), m("of", C);
|
|
1494
|
-
},
|
|
1495
|
-
return /* @__PURE__ */ a(
|
|
1488
|
+
}, k = x && $e(x, o);
|
|
1489
|
+
return /* @__PURE__ */ a(j, { 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(
|
|
@@ -1521,7 +1515,7 @@ function Vi({
|
|
|
1521
1515
|
onClick: () => v(!0),
|
|
1522
1516
|
children: [
|
|
1523
1517
|
"Edit ",
|
|
1524
|
-
`${
|
|
1518
|
+
`${k ? k.name : "repeat component"}`
|
|
1525
1519
|
]
|
|
1526
1520
|
}
|
|
1527
1521
|
),
|
|
@@ -1529,7 +1523,7 @@ function Vi({
|
|
|
1529
1523
|
Ve,
|
|
1530
1524
|
{
|
|
1531
1525
|
inArray: !0,
|
|
1532
|
-
open:
|
|
1526
|
+
open: f,
|
|
1533
1527
|
existingProperty: r,
|
|
1534
1528
|
getData: i,
|
|
1535
1529
|
autoUpdateId: !r,
|
|
@@ -1564,9 +1558,9 @@ const Ii = Y.forwardRef(
|
|
|
1564
1558
|
values: p,
|
|
1565
1559
|
setFieldValue: h,
|
|
1566
1560
|
setFieldTouched: m,
|
|
1567
|
-
touched:
|
|
1568
|
-
validate:
|
|
1569
|
-
} = K(), v = "name", x = r && I(u, v), y = "id", P = r && I(u, y),
|
|
1561
|
+
touched: s,
|
|
1562
|
+
validate: f
|
|
1563
|
+
} = K(), v = "name", x = r && I(u, v), y = "id", P = r && I(u, y), k = "description", b = r && I(u, 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(
|
|
@@ -1578,7 +1572,7 @@ const Ii = Y.forwardRef(
|
|
|
1578
1572
|
value: p[v],
|
|
1579
1573
|
onChange: (C) => {
|
|
1580
1574
|
const N = C.target.value;
|
|
1581
|
-
!I(
|
|
1575
|
+
!I(s, y) && l && h(y, N ? Pt(N) : "", !1), h(v, N, !0), m(v, !0);
|
|
1582
1576
|
},
|
|
1583
1577
|
style: { fontSize: 20 },
|
|
1584
1578
|
placeholder: "Field name",
|
|
@@ -1599,7 +1593,7 @@ const Ii = Y.forwardRef(
|
|
|
1599
1593
|
value: p[y],
|
|
1600
1594
|
onChange: (C) => {
|
|
1601
1595
|
const N = C.target.value;
|
|
1602
|
-
!I(
|
|
1596
|
+
!I(s, v) && l && h(v, N ? ut(N) : ""), h(y, N, !0), m(y, !0);
|
|
1603
1597
|
},
|
|
1604
1598
|
disabled: n || i,
|
|
1605
1599
|
required: !0,
|
|
@@ -1613,7 +1607,7 @@ const Ii = Y.forwardRef(
|
|
|
1613
1607
|
/* @__PURE__ */ e(
|
|
1614
1608
|
H,
|
|
1615
1609
|
{
|
|
1616
|
-
name:
|
|
1610
|
+
name: k,
|
|
1617
1611
|
as: Z,
|
|
1618
1612
|
label: "Description",
|
|
1619
1613
|
disabled: i,
|
|
@@ -1631,7 +1625,7 @@ function _i({
|
|
|
1631
1625
|
showErrors: n
|
|
1632
1626
|
}) {
|
|
1633
1627
|
const { values: i, setFieldValue: l } = K();
|
|
1634
|
-
return /* @__PURE__ */ a(
|
|
1628
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
1635
1629
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ne, { children: [
|
|
1636
1630
|
t === "text_field" && /* @__PURE__ */ e(
|
|
1637
1631
|
Ee,
|
|
@@ -1700,14 +1694,14 @@ function _i({
|
|
|
1700
1694
|
}
|
|
1701
1695
|
function Fi({ disabled: t }) {
|
|
1702
1696
|
const { values: r } = K(), n = I(r, "defaultValue");
|
|
1703
|
-
return /* @__PURE__ */ a(
|
|
1697
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
1704
1698
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }),
|
|
1705
1699
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1706
1700
|
H,
|
|
1707
1701
|
{
|
|
1708
1702
|
name: "defaultValue",
|
|
1709
1703
|
children: ({ field: i, form: l }) => /* @__PURE__ */ e(
|
|
1710
|
-
|
|
1704
|
+
ce,
|
|
1711
1705
|
{
|
|
1712
1706
|
label: n == null ? "Default value not set" : "Default value is " + n.toString(),
|
|
1713
1707
|
disabled: t,
|
|
@@ -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(), [u, p] = $(!1), [h, m] = $(), [
|
|
1721
|
+
} = K(), [u, p] = $(!1), [h, m] = $(), [s, f] = $(), v = ({
|
|
1728
1722
|
id: C,
|
|
1729
1723
|
property: N
|
|
1730
1724
|
}) => {
|
|
@@ -1734,22 +1728,22 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1734
1728
|
...o.oneOf?.properties ?? {},
|
|
1735
1729
|
[C]: N
|
|
1736
1730
|
}, !1);
|
|
1737
|
-
const
|
|
1731
|
+
const g = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), w = g.includes(C) ? g : [...g, C];
|
|
1738
1732
|
d("oneOf.propertiesOrder", w, !1), p(!1);
|
|
1739
|
-
}, x = h ? ae(h,
|
|
1740
|
-
const
|
|
1741
|
-
if (!
|
|
1733
|
+
}, x = h ? ae(h, s) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, P = Q((C, N) => {
|
|
1734
|
+
const g = C ? ae(C, N) : void 0;
|
|
1735
|
+
if (!g)
|
|
1742
1736
|
throw Error("collection editor miss config");
|
|
1743
|
-
d(`oneOf.${
|
|
1737
|
+
d(`oneOf.${me(g)}`, void 0, !1);
|
|
1744
1738
|
const w = `oneOf.${ye(N)}`, _ = I(o, w);
|
|
1745
|
-
d(w, _.filter((M) => M !== C), !1), p(!1), m(void 0),
|
|
1746
|
-
}, [d, o]),
|
|
1739
|
+
d(w, _.filter((M) => M !== C), !1), p(!1), m(void 0), f(void 0);
|
|
1740
|
+
}, [d, o]), k = /* @__PURE__ */ a(
|
|
1747
1741
|
z,
|
|
1748
1742
|
{
|
|
1749
1743
|
autoFocus: !0,
|
|
1750
1744
|
color: "primary",
|
|
1751
1745
|
onClick: () => p(!0),
|
|
1752
|
-
startIcon: /* @__PURE__ */ e(
|
|
1746
|
+
startIcon: /* @__PURE__ */ e(se, {}),
|
|
1753
1747
|
children: [
|
|
1754
1748
|
"Add property to ",
|
|
1755
1749
|
o.name ?? "this block"
|
|
@@ -1758,11 +1752,11 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1758
1752
|
), b = Q((C, N) => {
|
|
1759
1753
|
d(`oneOf.${ye(N)}`, C, !1);
|
|
1760
1754
|
}, []);
|
|
1761
|
-
return /* @__PURE__ */ a(
|
|
1755
|
+
return /* @__PURE__ */ a(j, { 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
1761
|
/* @__PURE__ */ a(Ce, { className: "p-2 pl-8", children: [
|
|
1768
1762
|
/* @__PURE__ */ e(
|
|
@@ -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),
|
|
1770
|
+
m(C), f(N), p(!0);
|
|
1777
1771
|
},
|
|
1778
1772
|
onPropertyMove: t ? void 0 : b
|
|
1779
1773
|
}
|
|
@@ -1790,15 +1784,15 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1790
1784
|
getData: r,
|
|
1791
1785
|
allowDataInference: n,
|
|
1792
1786
|
onCancel: () => {
|
|
1793
|
-
p(!1), m(void 0),
|
|
1787
|
+
p(!1), m(void 0), f(void 0);
|
|
1794
1788
|
},
|
|
1795
1789
|
onOkClicked: () => {
|
|
1796
|
-
p(!1), m(void 0),
|
|
1790
|
+
p(!1), m(void 0), f(void 0);
|
|
1797
1791
|
},
|
|
1798
1792
|
collectionEditable: l,
|
|
1799
1793
|
onDelete: P,
|
|
1800
1794
|
propertyKey: h,
|
|
1801
|
-
propertyNamespace:
|
|
1795
|
+
propertyNamespace: s,
|
|
1802
1796
|
property: y,
|
|
1803
1797
|
existingProperty: !!h,
|
|
1804
1798
|
autoUpdateId: !h,
|
|
@@ -1870,12 +1864,12 @@ function Ei({ disabled: t }) {
|
|
|
1870
1864
|
{
|
|
1871
1865
|
name: "validation.positive",
|
|
1872
1866
|
type: "checkbox",
|
|
1873
|
-
children: ({ field: m, form:
|
|
1874
|
-
|
|
1867
|
+
children: ({ field: m, form: s }) => /* @__PURE__ */ e(
|
|
1868
|
+
ce,
|
|
1875
1869
|
{
|
|
1876
1870
|
label: "Positive value",
|
|
1877
1871
|
disabled: t,
|
|
1878
|
-
form:
|
|
1872
|
+
form: s,
|
|
1879
1873
|
field: m
|
|
1880
1874
|
}
|
|
1881
1875
|
)
|
|
@@ -1886,12 +1880,12 @@ function Ei({ disabled: t }) {
|
|
|
1886
1880
|
{
|
|
1887
1881
|
name: "validation.negative",
|
|
1888
1882
|
type: "checkbox",
|
|
1889
|
-
children: ({ field: m, form:
|
|
1890
|
-
|
|
1883
|
+
children: ({ field: m, form: s }) => /* @__PURE__ */ e(
|
|
1884
|
+
ce,
|
|
1891
1885
|
{
|
|
1892
1886
|
label: "Negative value",
|
|
1893
1887
|
disabled: t,
|
|
1894
|
-
form:
|
|
1888
|
+
form: s,
|
|
1895
1889
|
field: m
|
|
1896
1890
|
}
|
|
1897
1891
|
)
|
|
@@ -1902,12 +1896,12 @@ function Ei({ disabled: t }) {
|
|
|
1902
1896
|
{
|
|
1903
1897
|
name: "validation.integer",
|
|
1904
1898
|
type: "checkbox",
|
|
1905
|
-
children: ({ field: m, form:
|
|
1906
|
-
|
|
1899
|
+
children: ({ field: m, form: s }) => /* @__PURE__ */ e(
|
|
1900
|
+
ce,
|
|
1907
1901
|
{
|
|
1908
1902
|
label: "Integer value",
|
|
1909
1903
|
disabled: t,
|
|
1910
|
-
form:
|
|
1904
|
+
form: s,
|
|
1911
1905
|
field: m
|
|
1912
1906
|
}
|
|
1913
1907
|
)
|
|
@@ -1917,7 +1911,7 @@ function Ei({ disabled: t }) {
|
|
|
1917
1911
|
}
|
|
1918
1912
|
function Ai({ disabled: t }) {
|
|
1919
1913
|
const { values: r, setFieldValue: n } = K();
|
|
1920
|
-
return /* @__PURE__ */ a(
|
|
1914
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
1921
1915
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Ei, { disabled: t }) }) }),
|
|
1922
1916
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1923
1917
|
Oe,
|
|
@@ -1948,13 +1942,13 @@ function jt({
|
|
|
1948
1942
|
if (!Pe())
|
|
1949
1943
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(De, {}) });
|
|
1950
1944
|
const p = r ? "of.path" : "path", h = I(l, p), m = i && I(d, p);
|
|
1951
|
-
return /* @__PURE__ */ e(
|
|
1945
|
+
return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1952
1946
|
H,
|
|
1953
1947
|
{
|
|
1954
1948
|
name: p,
|
|
1955
1949
|
pathPath: p,
|
|
1956
1950
|
type: "select",
|
|
1957
|
-
disabled: t || n,
|
|
1951
|
+
disabled: t && !!h || n,
|
|
1958
1952
|
value: h,
|
|
1959
1953
|
error: m,
|
|
1960
1954
|
handleChange: o,
|
|
@@ -1976,7 +1970,7 @@ function Di({
|
|
|
1976
1970
|
const u = d?.collections ?? [], p = Array.from(new Set(
|
|
1977
1971
|
Object.values(u).map((m) => m.group).filter(Boolean)
|
|
1978
1972
|
).values()), h = u.filter((m) => !m.group);
|
|
1979
|
-
return /* @__PURE__ */ a(
|
|
1973
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
1980
1974
|
/* @__PURE__ */ a(
|
|
1981
1975
|
be,
|
|
1982
1976
|
{
|
|
@@ -1988,15 +1982,15 @@ function Di({
|
|
|
1988
1982
|
onChange: i,
|
|
1989
1983
|
label: "Target collection",
|
|
1990
1984
|
renderValue: (m) => {
|
|
1991
|
-
const
|
|
1992
|
-
return
|
|
1993
|
-
/* @__PURE__ */ e(ot, { collectionOrView:
|
|
1985
|
+
const s = u.find((f) => f.id === m || f.path === m);
|
|
1986
|
+
return s ? /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
1987
|
+
/* @__PURE__ */ e(ot, { collectionOrView: s }),
|
|
1994
1988
|
/* @__PURE__ */ e(
|
|
1995
1989
|
O,
|
|
1996
1990
|
{
|
|
1997
1991
|
variant: "subtitle2",
|
|
1998
1992
|
className: "font-medium ml-4",
|
|
1999
|
-
children:
|
|
1993
|
+
children: s?.name.toUpperCase()
|
|
2000
1994
|
}
|
|
2001
1995
|
)
|
|
2002
1996
|
] }) : null;
|
|
@@ -2007,23 +2001,23 @@ function Di({
|
|
|
2007
2001
|
At,
|
|
2008
2002
|
{
|
|
2009
2003
|
label: m || "Views",
|
|
2010
|
-
children: u.filter((
|
|
2004
|
+
children: u.filter((s) => s.group === m).map((s) => /* @__PURE__ */ e(
|
|
2011
2005
|
ee,
|
|
2012
2006
|
{
|
|
2013
|
-
value:
|
|
2007
|
+
value: s.id ?? s.path,
|
|
2014
2008
|
children: /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
2015
|
-
/* @__PURE__ */ e(ot, { collectionOrView:
|
|
2009
|
+
/* @__PURE__ */ e(ot, { collectionOrView: s }),
|
|
2016
2010
|
/* @__PURE__ */ e(
|
|
2017
2011
|
O,
|
|
2018
2012
|
{
|
|
2019
2013
|
variant: "subtitle2",
|
|
2020
2014
|
className: "font-medium ml-4",
|
|
2021
|
-
children:
|
|
2015
|
+
children: s?.name.toUpperCase()
|
|
2022
2016
|
}
|
|
2023
2017
|
)
|
|
2024
2018
|
] })
|
|
2025
2019
|
},
|
|
2026
|
-
`${
|
|
2020
|
+
`${s.id ?? s.path}-${m}`
|
|
2027
2021
|
))
|
|
2028
2022
|
},
|
|
2029
2023
|
`group_${m}`
|
|
@@ -2059,7 +2053,7 @@ function Bi({ disabled: t }) {
|
|
|
2059
2053
|
touched: i,
|
|
2060
2054
|
setFieldValue: l
|
|
2061
2055
|
} = K(), o = "mode", d = I(r, o), u = I(i, o) && I(n, o), p = "autoValue", h = I(r, p), m = I(i, p) && I(n, p);
|
|
2062
|
-
return /* @__PURE__ */ a(
|
|
2056
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
2063
2057
|
/* @__PURE__ */ a("div", { className: "flex flex-col col-span-12", children: [
|
|
2064
2058
|
/* @__PURE__ */ a(
|
|
2065
2059
|
be,
|
|
@@ -2067,10 +2061,10 @@ function Bi({ disabled: t }) {
|
|
|
2067
2061
|
name: o,
|
|
2068
2062
|
value: d ?? "date",
|
|
2069
2063
|
error: !!u,
|
|
2070
|
-
onValueChange: (
|
|
2064
|
+
onValueChange: (s) => l(o, s),
|
|
2071
2065
|
label: "Mode",
|
|
2072
|
-
renderValue: (
|
|
2073
|
-
switch (
|
|
2066
|
+
renderValue: (s) => {
|
|
2067
|
+
switch (s) {
|
|
2074
2068
|
case "date_time":
|
|
2075
2069
|
return "Date/Time";
|
|
2076
2070
|
case "date":
|
|
@@ -2093,9 +2087,9 @@ function Bi({ disabled: t }) {
|
|
|
2093
2087
|
name: p,
|
|
2094
2088
|
disabled: t,
|
|
2095
2089
|
value: h ?? "",
|
|
2096
|
-
onValueChange: (
|
|
2097
|
-
renderValue: (
|
|
2098
|
-
switch (
|
|
2090
|
+
onValueChange: (s) => l(p, s === "none" ? null : s),
|
|
2091
|
+
renderValue: (s) => {
|
|
2092
|
+
switch (s) {
|
|
2099
2093
|
case "on_create":
|
|
2100
2094
|
return "On create";
|
|
2101
2095
|
case "on_update":
|
|
@@ -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
|
]
|
|
@@ -2121,7 +2115,7 @@ function Bi({ disabled: t }) {
|
|
|
2121
2115
|
function zi({ disabled: t }) {
|
|
2122
2116
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2123
2117
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(H, { type: "checkbox", name: "hideFromCollection", children: ({ field: i, form: l }) => /* @__PURE__ */ e(
|
|
2124
|
-
|
|
2118
|
+
ce,
|
|
2125
2119
|
{
|
|
2126
2120
|
label: "Hide from collection",
|
|
2127
2121
|
disabled: t,
|
|
@@ -2136,7 +2130,7 @@ function zi({ disabled: t }) {
|
|
|
2136
2130
|
name: "readOnly",
|
|
2137
2131
|
type: "checkbox",
|
|
2138
2132
|
children: ({ field: i, form: l }) => /* @__PURE__ */ e(
|
|
2139
|
-
|
|
2133
|
+
ce,
|
|
2140
2134
|
{
|
|
2141
2135
|
label: "Read only",
|
|
2142
2136
|
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(j, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { 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: he(
|
|
2378
2372
|
"flex flex-row items-center text-base min-h-[52px]",
|
|
2379
2373
|
r ? "w-full" : ""
|
|
2380
2374
|
),
|
|
@@ -2403,7 +2397,7 @@ 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(j, { children: [
|
|
2407
2401
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
2408
2402
|
be,
|
|
2409
2403
|
{
|
|
@@ -2491,41 +2485,41 @@ const Ui = [
|
|
|
2491
2485
|
existingPropertyKeys: p,
|
|
2492
2486
|
propertyNamespace: h,
|
|
2493
2487
|
property: m,
|
|
2494
|
-
onPropertyChanged:
|
|
2495
|
-
onPropertyChangedImmediate:
|
|
2488
|
+
onPropertyChanged: s,
|
|
2489
|
+
onPropertyChangedImmediate: f = !0,
|
|
2496
2490
|
onDelete: v,
|
|
2497
2491
|
onError: x,
|
|
2498
2492
|
initialErrors: y,
|
|
2499
2493
|
forceShowErrors: P,
|
|
2500
|
-
allowDataInference:
|
|
2494
|
+
allowDataInference: k,
|
|
2501
2495
|
getController: b,
|
|
2502
2496
|
getData: C,
|
|
2503
2497
|
propertyConfigs: N,
|
|
2504
|
-
collectionEditable:
|
|
2498
|
+
collectionEditable: g
|
|
2505
2499
|
} = r, w = {
|
|
2506
2500
|
id: "",
|
|
2507
2501
|
name: ""
|
|
2508
|
-
}, _ = !!(m && !qe(m)) && !
|
|
2502
|
+
}, _ = !!(m && !qe(m)) && !g, M = Le(m ? {
|
|
2509
2503
|
id: u,
|
|
2510
2504
|
previousId: u,
|
|
2511
2505
|
property: m
|
|
2512
2506
|
} : void 0), R = ({
|
|
2513
2507
|
id: A,
|
|
2514
|
-
property:
|
|
2508
|
+
property: c
|
|
2515
2509
|
}) => {
|
|
2516
2510
|
const V = {
|
|
2517
2511
|
id: A,
|
|
2518
2512
|
previousId: M.current?.id,
|
|
2519
|
-
property:
|
|
2513
|
+
property: c,
|
|
2520
2514
|
namespace: h
|
|
2521
2515
|
};
|
|
2522
|
-
M.current = V,
|
|
2516
|
+
M.current = V, s?.(V);
|
|
2523
2517
|
}, D = Tt({
|
|
2524
2518
|
initialValues: m ? { id: u, ...m } : w,
|
|
2525
2519
|
initialErrors: y,
|
|
2526
2520
|
validateOnChange: !0,
|
|
2527
2521
|
validateOnInitialRender: !0,
|
|
2528
|
-
onSubmit: (A,
|
|
2522
|
+
onSubmit: (A, c) => {
|
|
2529
2523
|
console.debug("onSubmit", A);
|
|
2530
2524
|
const {
|
|
2531
2525
|
id: V,
|
|
@@ -2534,35 +2528,35 @@ const Ui = [
|
|
|
2534
2528
|
R({
|
|
2535
2529
|
id: V,
|
|
2536
2530
|
property: { ...G, editable: G.editable ?? !0 }
|
|
2537
|
-
}), l ||
|
|
2531
|
+
}), l || c.resetForm({ values: w });
|
|
2538
2532
|
},
|
|
2539
2533
|
validation: (A) => {
|
|
2540
|
-
const
|
|
2534
|
+
const c = {};
|
|
2541
2535
|
if (n) {
|
|
2542
2536
|
if (!A.name)
|
|
2543
|
-
|
|
2537
|
+
c.name = "Required";
|
|
2544
2538
|
else {
|
|
2545
2539
|
const V = $i(A.name);
|
|
2546
|
-
V && (
|
|
2540
|
+
V && (c.name = V);
|
|
2547
2541
|
}
|
|
2548
2542
|
if (!A.id)
|
|
2549
|
-
|
|
2543
|
+
c.id = "Required";
|
|
2550
2544
|
else {
|
|
2551
2545
|
const V = qi(A.id, p);
|
|
2552
|
-
V && (
|
|
2546
|
+
V && (c.id = V);
|
|
2553
2547
|
}
|
|
2554
2548
|
}
|
|
2555
|
-
return A.dataType === "string" && A.validation?.matches && !Pr(A.validation?.matches.toString()) && (
|
|
2549
|
+
return A.dataType === "string" && A.validation?.matches && !Pr(A.validation?.matches.toString()) && (c.validation = {
|
|
2556
2550
|
matches: "Invalid regular expression"
|
|
2557
|
-
}), A.dataType === "reference" && !A.path && (
|
|
2551
|
+
}), A.dataType === "reference" && !A.path && (c.path = "You must specify a target collection for the field"), A.propertyConfig === "repeat" && (A.of || (c.of = "You need to specify a repeat field")), A.propertyConfig === "block" && (A.oneOf || (c.oneOf = "You need to specify the properties of this block")), c;
|
|
2558
2552
|
}
|
|
2559
2553
|
});
|
|
2560
|
-
return
|
|
2554
|
+
return de(() => {
|
|
2561
2555
|
b?.(D);
|
|
2562
2556
|
}, [D, b]), /* @__PURE__ */ e(kt, { value: D, children: /* @__PURE__ */ e(
|
|
2563
2557
|
ji,
|
|
2564
2558
|
{
|
|
2565
|
-
onPropertyChanged:
|
|
2559
|
+
onPropertyChanged: f ? R : void 0,
|
|
2566
2560
|
onDelete: v,
|
|
2567
2561
|
includeIdAndTitle: n,
|
|
2568
2562
|
propertyNamespace: h,
|
|
@@ -2574,9 +2568,9 @@ const Ui = [
|
|
|
2574
2568
|
autoOpenTypeSelect: i,
|
|
2575
2569
|
disabled: _,
|
|
2576
2570
|
getData: C,
|
|
2577
|
-
allowDataInference:
|
|
2571
|
+
allowDataInference: k,
|
|
2578
2572
|
propertyConfigs: N,
|
|
2579
|
-
collectionEditable:
|
|
2573
|
+
collectionEditable: g,
|
|
2580
2574
|
...D
|
|
2581
2575
|
}
|
|
2582
2576
|
) });
|
|
@@ -2662,28 +2656,28 @@ function ji({
|
|
|
2662
2656
|
onDelete: p,
|
|
2663
2657
|
propertyNamespace: h,
|
|
2664
2658
|
onError: m,
|
|
2665
|
-
showErrors:
|
|
2666
|
-
disabled:
|
|
2659
|
+
showErrors: s,
|
|
2660
|
+
disabled: f,
|
|
2667
2661
|
inArray: v,
|
|
2668
2662
|
getData: x,
|
|
2669
2663
|
allowDataInference: y,
|
|
2670
2664
|
propertyConfigs: P,
|
|
2671
|
-
collectionEditable:
|
|
2665
|
+
collectionEditable: k
|
|
2672
2666
|
}) {
|
|
2673
|
-
const [b, C] = $(o), [N,
|
|
2674
|
-
|
|
2667
|
+
const [b, C] = $(o), [N, g] = $(!1), [w, _] = $(t?.dataType ? Kt(t) : void 0), M = Object.entries(lr).concat(Object.entries(P)), R = v ? M.filter(([q, L]) => !ne(L.property) && L.property?.dataType !== "array") : M, D = Ir(t), A = Le(null), c = Le(t), V = s && I(r, "selectedWidget");
|
|
2668
|
+
de(() => {
|
|
2675
2669
|
if (u && (!d || D.id)) {
|
|
2676
2670
|
const {
|
|
2677
2671
|
id: q,
|
|
2678
2672
|
...L
|
|
2679
2673
|
} = D;
|
|
2680
|
-
ve(D,
|
|
2674
|
+
ve(D, c.current) || (u({
|
|
2681
2675
|
id: q,
|
|
2682
2676
|
property: L,
|
|
2683
2677
|
namespace: h
|
|
2684
|
-
}),
|
|
2678
|
+
}), c.current = D);
|
|
2685
2679
|
}
|
|
2686
|
-
}, [D, d, u, h]),
|
|
2680
|
+
}, [D, d, u, h]), de(() => {
|
|
2687
2681
|
t?.id && m && m(t?.id, h, r);
|
|
2688
2682
|
}, [r, m, h, t?.id]);
|
|
2689
2683
|
const G = (q) => {
|
|
@@ -2696,14 +2690,14 @@ function ji({
|
|
|
2696
2690
|
_i,
|
|
2697
2691
|
{
|
|
2698
2692
|
widgetId: w,
|
|
2699
|
-
disabled:
|
|
2700
|
-
showErrors:
|
|
2693
|
+
disabled: f,
|
|
2694
|
+
showErrors: s
|
|
2701
2695
|
}
|
|
2702
2696
|
) : w === "url" ? B = /* @__PURE__ */ e(
|
|
2703
2697
|
Ri,
|
|
2704
2698
|
{
|
|
2705
|
-
disabled:
|
|
2706
|
-
showErrors:
|
|
2699
|
+
disabled: f,
|
|
2700
|
+
showErrors: s
|
|
2707
2701
|
}
|
|
2708
2702
|
) : w === "select" || w === "number_select" ? B = /* @__PURE__ */ e(
|
|
2709
2703
|
Rt,
|
|
@@ -2711,81 +2705,81 @@ function ji({
|
|
|
2711
2705
|
multiselect: !1,
|
|
2712
2706
|
allowDataInference: y,
|
|
2713
2707
|
updateIds: !i,
|
|
2714
|
-
disabled:
|
|
2708
|
+
disabled: f,
|
|
2715
2709
|
getData: x,
|
|
2716
|
-
showErrors:
|
|
2710
|
+
showErrors: s
|
|
2717
2711
|
}
|
|
2718
2712
|
) : w === "multi_select" || w === "multi_number_select" ? B = /* @__PURE__ */ e(
|
|
2719
2713
|
Rt,
|
|
2720
2714
|
{
|
|
2721
2715
|
multiselect: !0,
|
|
2722
2716
|
updateIds: !i,
|
|
2723
|
-
disabled:
|
|
2717
|
+
disabled: f,
|
|
2724
2718
|
allowDataInference: y,
|
|
2725
2719
|
getData: x,
|
|
2726
|
-
showErrors:
|
|
2720
|
+
showErrors: s
|
|
2727
2721
|
}
|
|
2728
2722
|
) : w === "file_upload" ? B = /* @__PURE__ */ e(
|
|
2729
2723
|
Ut,
|
|
2730
2724
|
{
|
|
2731
2725
|
existing: i,
|
|
2732
2726
|
multiple: !1,
|
|
2733
|
-
disabled:
|
|
2727
|
+
disabled: f
|
|
2734
2728
|
}
|
|
2735
2729
|
) : w === "multi_file_upload" ? B = /* @__PURE__ */ e(
|
|
2736
2730
|
Ut,
|
|
2737
2731
|
{
|
|
2738
2732
|
existing: i,
|
|
2739
2733
|
multiple: !0,
|
|
2740
|
-
disabled:
|
|
2734
|
+
disabled: f
|
|
2741
2735
|
}
|
|
2742
|
-
) : w === "switch" ? B = /* @__PURE__ */ e(Fi, { disabled:
|
|
2736
|
+
) : w === "switch" ? B = /* @__PURE__ */ e(Fi, { disabled: f }) : w === "number_input" ? B = /* @__PURE__ */ e(Ai, { disabled: f }) : w === "group" ? B = /* @__PURE__ */ e(
|
|
2743
2737
|
Oi,
|
|
2744
2738
|
{
|
|
2745
|
-
disabled:
|
|
2739
|
+
disabled: f,
|
|
2746
2740
|
getData: x,
|
|
2747
2741
|
allowDataInference: y,
|
|
2748
|
-
collectionEditable:
|
|
2742
|
+
collectionEditable: k,
|
|
2749
2743
|
propertyConfigs: P
|
|
2750
2744
|
}
|
|
2751
2745
|
) : w === "block" ? B = /* @__PURE__ */ e(
|
|
2752
2746
|
Si,
|
|
2753
2747
|
{
|
|
2754
|
-
disabled:
|
|
2748
|
+
disabled: f,
|
|
2755
2749
|
getData: x,
|
|
2756
2750
|
allowDataInference: y,
|
|
2757
|
-
collectionEditable:
|
|
2751
|
+
collectionEditable: k,
|
|
2758
2752
|
propertyConfigs: P
|
|
2759
2753
|
}
|
|
2760
2754
|
) : w === "reference" ? B = /* @__PURE__ */ e(
|
|
2761
2755
|
jt,
|
|
2762
2756
|
{
|
|
2763
|
-
showErrors:
|
|
2757
|
+
showErrors: s,
|
|
2764
2758
|
existing: i,
|
|
2765
2759
|
multiple: !1,
|
|
2766
|
-
disabled:
|
|
2760
|
+
disabled: f
|
|
2767
2761
|
}
|
|
2768
|
-
) : w === "date_time" ? B = /* @__PURE__ */ e(Bi, { disabled:
|
|
2762
|
+
) : w === "date_time" ? B = /* @__PURE__ */ e(Bi, { disabled: f }) : w === "multi_references" ? B = /* @__PURE__ */ e(
|
|
2769
2763
|
jt,
|
|
2770
2764
|
{
|
|
2771
|
-
showErrors:
|
|
2765
|
+
showErrors: s,
|
|
2772
2766
|
existing: i,
|
|
2773
2767
|
multiple: !0,
|
|
2774
|
-
disabled:
|
|
2768
|
+
disabled: f
|
|
2775
2769
|
}
|
|
2776
2770
|
) : w === "repeat" ? B = /* @__PURE__ */ e(
|
|
2777
2771
|
Vi,
|
|
2778
2772
|
{
|
|
2779
|
-
showErrors:
|
|
2773
|
+
showErrors: s,
|
|
2780
2774
|
existing: i,
|
|
2781
2775
|
getData: x,
|
|
2782
2776
|
allowDataInference: y,
|
|
2783
|
-
disabled:
|
|
2784
|
-
collectionEditable:
|
|
2777
|
+
disabled: f,
|
|
2778
|
+
collectionEditable: k,
|
|
2785
2779
|
propertyConfigs: P
|
|
2786
2780
|
}
|
|
2787
|
-
) : w === "key_value" ? B = /* @__PURE__ */ e(Mi, { disabled:
|
|
2788
|
-
|
|
2781
|
+
) : w === "key_value" ? B = /* @__PURE__ */ e(Mi, { disabled: f }) : B = null, /* @__PURE__ */ a(j, { children: [
|
|
2782
|
+
f && /* @__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: [
|
|
2791
2785
|
"You may not have permission to edit it or it is defined in code with no ",
|
|
@@ -2804,31 +2798,31 @@ function ji({
|
|
|
2804
2798
|
open: b,
|
|
2805
2799
|
onOpenChange: C,
|
|
2806
2800
|
position: "item-aligned",
|
|
2807
|
-
disabled:
|
|
2801
|
+
disabled: f,
|
|
2808
2802
|
renderValue: (q) => {
|
|
2809
2803
|
if (!q)
|
|
2810
2804
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
2811
|
-
const L = q, J = Gt[L] ?? P[L], le = J.property, Me = le && !ne(le) ? $e(le, P) : void 0, we = ne(le) || i && le.dataType !== t?.dataType,
|
|
2805
|
+
const L = q, J = Gt[L] ?? P[L], le = J.property, Me = le && !ne(le) ? $e(le, P) : void 0, we = ne(le) || i && le.dataType !== t?.dataType, ue = Me ? W(Me, J) : J;
|
|
2812
2806
|
return /* @__PURE__ */ a(
|
|
2813
2807
|
"div",
|
|
2814
2808
|
{
|
|
2815
2809
|
onClick: (re) => {
|
|
2816
2810
|
we && (re.stopPropagation(), re.preventDefault());
|
|
2817
2811
|
},
|
|
2818
|
-
className:
|
|
2812
|
+
className: he(
|
|
2819
2813
|
"flex items-center",
|
|
2820
2814
|
we ? "w-full pointer-events-none opacity-50" : ""
|
|
2821
2815
|
),
|
|
2822
2816
|
children: [
|
|
2823
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ye, { propertyConfig:
|
|
2817
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ye, { propertyConfig: ue }) }),
|
|
2824
2818
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-start text-base text-left", children: [
|
|
2825
|
-
/* @__PURE__ */ e("div", { children:
|
|
2819
|
+
/* @__PURE__ */ e("div", { children: ue.name }),
|
|
2826
2820
|
/* @__PURE__ */ e(
|
|
2827
2821
|
O,
|
|
2828
2822
|
{
|
|
2829
2823
|
variant: "caption",
|
|
2830
2824
|
color: "disabled",
|
|
2831
|
-
children: we ? "You can only switch to widgets that use the same data type" :
|
|
2825
|
+
children: we ? "You can only switch to widgets that use the same data type" : ue.description
|
|
2832
2826
|
}
|
|
2833
2827
|
)
|
|
2834
2828
|
] })
|
|
@@ -2869,8 +2863,8 @@ function ji({
|
|
|
2869
2863
|
{
|
|
2870
2864
|
variant: "ghost",
|
|
2871
2865
|
className: "m-4",
|
|
2872
|
-
disabled:
|
|
2873
|
-
onClick: () =>
|
|
2866
|
+
disabled: f,
|
|
2867
|
+
onClick: () => g(!0),
|
|
2874
2868
|
children: /* @__PURE__ */ e(dt, {})
|
|
2875
2869
|
}
|
|
2876
2870
|
)
|
|
@@ -2879,23 +2873,23 @@ function ji({
|
|
|
2879
2873
|
d && /* @__PURE__ */ e(
|
|
2880
2874
|
Ii,
|
|
2881
2875
|
{
|
|
2882
|
-
showErrors:
|
|
2876
|
+
showErrors: s,
|
|
2883
2877
|
disabledId: i,
|
|
2884
2878
|
isNewProperty: !i,
|
|
2885
|
-
disabled:
|
|
2879
|
+
disabled: f,
|
|
2886
2880
|
autoUpdateId: l,
|
|
2887
2881
|
ref: A
|
|
2888
2882
|
}
|
|
2889
2883
|
),
|
|
2890
2884
|
B,
|
|
2891
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled:
|
|
2885
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled: f }) })
|
|
2892
2886
|
] }),
|
|
2893
2887
|
p && /* @__PURE__ */ e(
|
|
2894
2888
|
lt,
|
|
2895
2889
|
{
|
|
2896
2890
|
open: N,
|
|
2897
2891
|
onAccept: () => p(t?.id, h),
|
|
2898
|
-
onCancel: () =>
|
|
2892
|
+
onCancel: () => g(!1),
|
|
2899
2893
|
title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
|
|
2900
2894
|
body: /* @__PURE__ */ a("div", { children: [
|
|
2901
2895
|
" This will ",
|
|
@@ -2952,7 +2946,7 @@ const ` + (t.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.s
|
|
|
2952
2946
|
theme: si.vsDark,
|
|
2953
2947
|
code: l,
|
|
2954
2948
|
language: "typescript",
|
|
2955
|
-
children: ({ className: o, style: d, tokens: u, getLineProps: p, getTokenProps: h }) => /* @__PURE__ */ e("pre", { style: d, className: "p-4 rounded text-sm", children: u.map((m,
|
|
2949
|
+
children: ({ className: o, style: d, tokens: u, getLineProps: p, getTokenProps: h }) => /* @__PURE__ */ e("pre", { style: d, className: "p-4 rounded text-sm", children: u.map((m, s) => /* @__PURE__ */ e("div", { ...p({ line: m }), children: m.map((f, v) => /* @__PURE__ */ e("span", { ...h({ token: f }) }, v)) }, s)) })
|
|
2956
2950
|
}
|
|
2957
2951
|
)
|
|
2958
2952
|
] }),
|
|
@@ -3019,21 +3013,21 @@ function Gi({
|
|
|
3019
3013
|
getData: p,
|
|
3020
3014
|
doCollectionInference: h,
|
|
3021
3015
|
propertyConfigs: m,
|
|
3022
|
-
collectionEditable:
|
|
3016
|
+
collectionEditable: s
|
|
3023
3017
|
}) {
|
|
3024
3018
|
const {
|
|
3025
|
-
values:
|
|
3019
|
+
values: f,
|
|
3026
3020
|
setFieldValue: v,
|
|
3027
3021
|
setFieldError: x,
|
|
3028
3022
|
setFieldTouched: y,
|
|
3029
3023
|
errors: P,
|
|
3030
|
-
dirty:
|
|
3031
|
-
} = K(), b = Ie(), C = Nr(), N = !C, [
|
|
3032
|
-
|
|
3033
|
-
l && l(
|
|
3034
|
-
}, [
|
|
3035
|
-
const
|
|
3036
|
-
h && (q(!0), h(
|
|
3024
|
+
dirty: k
|
|
3025
|
+
} = K(), b = Ie(), C = Nr(), N = !C, [g, w] = $(), [_, M] = $(), [R, D] = $(), A = _ ? ae(_, R) : void 0, c = A ? I(f.properties, A.replaceAll(".", ".properties.")) : void 0, [V, G] = $(!1), [B, q] = $(!1), [L, J] = $(!1), [le, Me] = $([]), we = Y.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
|
|
3026
|
+
de(() => {
|
|
3027
|
+
l && l(k);
|
|
3028
|
+
}, [k]);
|
|
3029
|
+
const ue = h ? () => {
|
|
3030
|
+
h && (q(!0), h(f).then((F) => {
|
|
3037
3031
|
if (F && pt(F.properties), !F) {
|
|
3038
3032
|
b.open({
|
|
3039
3033
|
type: "error",
|
|
@@ -3041,87 +3035,93 @@ function Gi({
|
|
|
3041
3035
|
});
|
|
3042
3036
|
return;
|
|
3043
3037
|
}
|
|
3044
|
-
const
|
|
3045
|
-
if (
|
|
3038
|
+
const U = (F.properties ? Object.keys(F.properties) : []).filter((E) => !f.properties[E]);
|
|
3039
|
+
if (U.length === 0) {
|
|
3046
3040
|
b.open({
|
|
3047
3041
|
type: "info",
|
|
3048
3042
|
message: "No new properties found in existing data"
|
|
3049
3043
|
});
|
|
3050
3044
|
return;
|
|
3051
3045
|
}
|
|
3052
|
-
const
|
|
3053
|
-
...
|
|
3054
|
-
...
|
|
3046
|
+
const T = {
|
|
3047
|
+
...U.reduce((E, ie) => (E[ie] = (F.properties ?? {})[ie], E), {}),
|
|
3048
|
+
...f.properties
|
|
3055
3049
|
}, S = [
|
|
3056
|
-
...
|
|
3057
|
-
...
|
|
3050
|
+
...U,
|
|
3051
|
+
...f.propertiesOrder ?? []
|
|
3058
3052
|
];
|
|
3059
|
-
v("properties",
|
|
3053
|
+
v("properties", T, !1), fe(S), Me(U);
|
|
3060
3054
|
}).finally(() => {
|
|
3061
3055
|
q(!1);
|
|
3062
3056
|
}));
|
|
3063
|
-
} : void 0, re = Q((F) => F ? we.current[F] ?? I(
|
|
3064
|
-
const
|
|
3065
|
-
v(
|
|
3066
|
-
}, [v]), Te = Q((F,
|
|
3067
|
-
const
|
|
3068
|
-
if (!
|
|
3057
|
+
} : void 0, re = Q((F) => F ? we.current[F] ?? I(f, ye(F)) : we.current[""], [f]), fe = Q((F, U) => {
|
|
3058
|
+
const T = ye(U);
|
|
3059
|
+
v(T, F, !1), we.current[U ?? ""] = F;
|
|
3060
|
+
}, [v]), Te = Q((F, U) => {
|
|
3061
|
+
const T = F ? ae(F, U) : void 0;
|
|
3062
|
+
if (!T)
|
|
3069
3063
|
throw Error("collection editor miss config");
|
|
3070
|
-
v(
|
|
3071
|
-
const E = re(
|
|
3072
|
-
|
|
3073
|
-
}, [re, v,
|
|
3074
|
-
v(ye(
|
|
3064
|
+
v(me(T), void 0, !1);
|
|
3065
|
+
const E = re(U).filter((ie) => ie !== F);
|
|
3066
|
+
fe(E, U), J(!1), w(void 0), M(void 0), D(void 0);
|
|
3067
|
+
}, [re, v, fe]), Ge = (F, U) => {
|
|
3068
|
+
v(ye(U), F, !1);
|
|
3075
3069
|
}, gt = ({
|
|
3076
3070
|
id: F,
|
|
3077
|
-
property:
|
|
3071
|
+
property: U
|
|
3078
3072
|
}) => {
|
|
3079
3073
|
if (!F)
|
|
3080
3074
|
throw Error("Need to include an ID when creating a new property");
|
|
3081
3075
|
v("properties", {
|
|
3082
|
-
...
|
|
3083
|
-
[F]:
|
|
3076
|
+
...f.properties ?? {},
|
|
3077
|
+
[F]: U
|
|
3084
3078
|
}, !1);
|
|
3085
|
-
const
|
|
3086
|
-
|
|
3087
|
-
},
|
|
3079
|
+
const T = [...f.propertiesOrder ?? Object.keys(f.properties), F];
|
|
3080
|
+
fe(T), J(!1), C && (w(T.indexOf(F)), M(F)), D(void 0);
|
|
3081
|
+
}, pe = ({
|
|
3088
3082
|
id: F,
|
|
3089
|
-
property:
|
|
3090
|
-
previousId:
|
|
3083
|
+
property: U,
|
|
3084
|
+
previousId: T,
|
|
3091
3085
|
namespace: S
|
|
3092
3086
|
}) => {
|
|
3093
|
-
const E = F ? ae(F, S) : void 0, ie = E ?
|
|
3094
|
-
if (
|
|
3095
|
-
|
|
3096
|
-
|
|
3087
|
+
const E = F ? ae(F, S) : void 0, ie = E ? me(E) : void 0;
|
|
3088
|
+
if (T && T !== F) {
|
|
3089
|
+
console.debug("onPropertyChanged, id change", {
|
|
3090
|
+
id: F,
|
|
3091
|
+
property: U,
|
|
3092
|
+
previousId: T,
|
|
3093
|
+
namespace: S
|
|
3094
|
+
});
|
|
3095
|
+
const ke = ae(T, S), Vt = me(ke), It = re(S).map((Xe) => Xe === T ? F : Xe).filter((Xe) => Xe !== void 0);
|
|
3096
|
+
fe(It, S), F && (w(It.indexOf(F)), M(F)), v(Vt, void 0, !1), y(Vt, !1, !1);
|
|
3097
3097
|
}
|
|
3098
3098
|
console.debug("onPropertyChanged", {
|
|
3099
3099
|
id: F,
|
|
3100
|
-
property:
|
|
3101
|
-
previousId:
|
|
3100
|
+
property: U,
|
|
3101
|
+
previousId: T,
|
|
3102
3102
|
namespace: S,
|
|
3103
3103
|
propertyPath: ie
|
|
3104
|
-
}), ie && (v(ie,
|
|
3105
|
-
}, Ke = Q((F,
|
|
3106
|
-
const S = F ? ae(F,
|
|
3104
|
+
}), ie && (v(ie, U, !1), y(ie, !0, !1));
|
|
3105
|
+
}, Ke = Q((F, U, T) => {
|
|
3106
|
+
const S = F ? ae(F, U) : void 0;
|
|
3107
3107
|
if (console.debug("onPropertyErrorInternal", {
|
|
3108
3108
|
id: F,
|
|
3109
|
-
namespace:
|
|
3110
|
-
error:
|
|
3109
|
+
namespace: U,
|
|
3110
|
+
error: T,
|
|
3111
3111
|
propertyPath: S
|
|
3112
3112
|
}), S) {
|
|
3113
|
-
const E =
|
|
3114
|
-
i(F,
|
|
3113
|
+
const E = T && Object.keys(T).length > 0;
|
|
3114
|
+
i(F, U, E ? T : void 0), x(me(S), E ? "Property error" : void 0);
|
|
3115
3115
|
}
|
|
3116
3116
|
}, []), We = () => {
|
|
3117
3117
|
w(void 0), M(void 0);
|
|
3118
|
-
}, Ze = _ && n?.current?.properties ? n.current.properties[_] : void 0, Je =
|
|
3118
|
+
}, Ze = _ && n?.current?.properties ? n.current.properties[_] : void 0, Je = f?.propertiesOrder === void 0 || f.propertiesOrder.length === 0, Re = f.propertiesOrder ? f.propertiesOrder : Object.keys(f.properties), Qe = Zt(() => f.ownerId ? u(f.ownerId) : null, [u, f.ownerId]), vt = Q((F, U) => {
|
|
3119
3119
|
console.debug("CollectionEditor: onPropertyClick", {
|
|
3120
3120
|
propertyKey: F,
|
|
3121
|
-
namespace:
|
|
3122
|
-
}), w(Re.indexOf(F)), M(F), D(
|
|
3121
|
+
namespace: U
|
|
3122
|
+
}), w(Re.indexOf(F)), M(F), D(U);
|
|
3123
3123
|
}, [Re]), yt = /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
3124
|
-
/* @__PURE__ */ a("div", { className:
|
|
3124
|
+
/* @__PURE__ */ a("div", { className: he(
|
|
3125
3125
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
3126
3126
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
3127
3127
|
!N && "border-r " + wt
|
|
@@ -3166,12 +3166,12 @@ function Gi({
|
|
|
3166
3166
|
children: /* @__PURE__ */ e($r, {})
|
|
3167
3167
|
}
|
|
3168
3168
|
) }),
|
|
3169
|
-
|
|
3169
|
+
ue && /* @__PURE__ */ e(te, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
|
|
3170
3170
|
oe,
|
|
3171
3171
|
{
|
|
3172
3172
|
variant: "filled",
|
|
3173
3173
|
disabled: B,
|
|
3174
|
-
onClick:
|
|
3174
|
+
onClick: ue,
|
|
3175
3175
|
children: B ? /* @__PURE__ */ e(De, { size: "small" }) : /* @__PURE__ */ e(ht, {})
|
|
3176
3176
|
}
|
|
3177
3177
|
) }),
|
|
@@ -3180,7 +3180,7 @@ function Gi({
|
|
|
3180
3180
|
{
|
|
3181
3181
|
variant: "outlined",
|
|
3182
3182
|
onClick: () => J(!0),
|
|
3183
|
-
children: /* @__PURE__ */ e(
|
|
3183
|
+
children: /* @__PURE__ */ e(se, {})
|
|
3184
3184
|
}
|
|
3185
3185
|
) })
|
|
3186
3186
|
] })
|
|
@@ -3191,13 +3191,13 @@ function Gi({
|
|
|
3191
3191
|
className: "pl-8",
|
|
3192
3192
|
inferredPropertyKeys: le,
|
|
3193
3193
|
selectedPropertyKey: _ ? ae(_, R) : void 0,
|
|
3194
|
-
properties:
|
|
3195
|
-
additionalFields:
|
|
3194
|
+
properties: f.properties,
|
|
3195
|
+
additionalFields: f.additionalFields,
|
|
3196
3196
|
propertiesOrder: Re,
|
|
3197
3197
|
onPropertyClick: vt,
|
|
3198
3198
|
onPropertyMove: Ge,
|
|
3199
3199
|
onPropertyRemove: r ? Te : void 0,
|
|
3200
|
-
collectionEditable:
|
|
3200
|
+
collectionEditable: s,
|
|
3201
3201
|
errors: P
|
|
3202
3202
|
}
|
|
3203
3203
|
) }),
|
|
@@ -3209,7 +3209,7 @@ function Gi({
|
|
|
3209
3209
|
variant: "outlined",
|
|
3210
3210
|
size: "large",
|
|
3211
3211
|
onClick: () => J(!0),
|
|
3212
|
-
startIcon: /* @__PURE__ */ e(
|
|
3212
|
+
startIcon: /* @__PURE__ */ e(se, {}),
|
|
3213
3213
|
children: "Add new property"
|
|
3214
3214
|
}
|
|
3215
3215
|
)
|
|
@@ -3219,7 +3219,7 @@ function Gi({
|
|
|
3219
3219
|
{
|
|
3220
3220
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
3221
3221
|
children: [
|
|
3222
|
-
A &&
|
|
3222
|
+
A && c && !ne(c) && /* @__PURE__ */ e(
|
|
3223
3223
|
sr,
|
|
3224
3224
|
{
|
|
3225
3225
|
inArray: !1,
|
|
@@ -3229,20 +3229,33 @@ function Gi({
|
|
|
3229
3229
|
autoOpenTypeSelect: !1,
|
|
3230
3230
|
propertyKey: _,
|
|
3231
3231
|
propertyNamespace: R,
|
|
3232
|
-
property:
|
|
3233
|
-
onPropertyChanged:
|
|
3232
|
+
property: c,
|
|
3233
|
+
onPropertyChanged: pe,
|
|
3234
3234
|
onDelete: Te,
|
|
3235
3235
|
onError: Ke,
|
|
3236
3236
|
forceShowErrors: t,
|
|
3237
3237
|
initialErrors: Ze,
|
|
3238
3238
|
getData: p,
|
|
3239
3239
|
propertyConfigs: m,
|
|
3240
|
-
collectionEditable:
|
|
3240
|
+
collectionEditable: s
|
|
3241
3241
|
},
|
|
3242
|
-
`edit_view_${
|
|
3242
|
+
`edit_view_${g}`
|
|
3243
3243
|
),
|
|
3244
|
-
!
|
|
3245
|
-
|
|
3244
|
+
!c && /* @__PURE__ */ a("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
|
|
3245
|
+
/* @__PURE__ */ e(O, { variant: "label", className: "", children: Je ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
3246
|
+
/* @__PURE__ */ a(
|
|
3247
|
+
z,
|
|
3248
|
+
{
|
|
3249
|
+
variant: "outlined",
|
|
3250
|
+
onClick: () => J(!0),
|
|
3251
|
+
children: [
|
|
3252
|
+
/* @__PURE__ */ e(se, {}),
|
|
3253
|
+
"Add new property"
|
|
3254
|
+
]
|
|
3255
|
+
}
|
|
3256
|
+
)
|
|
3257
|
+
] }),
|
|
3258
|
+
c && ne(c) && /* @__PURE__ */ e(O, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
3246
3259
|
]
|
|
3247
3260
|
}
|
|
3248
3261
|
) }),
|
|
@@ -3250,28 +3263,28 @@ function Gi({
|
|
|
3250
3263
|
Ve,
|
|
3251
3264
|
{
|
|
3252
3265
|
inArray: !1,
|
|
3253
|
-
open:
|
|
3254
|
-
autoUpdateId: !
|
|
3266
|
+
open: g !== void 0,
|
|
3267
|
+
autoUpdateId: !c,
|
|
3255
3268
|
allowDataInference: !r,
|
|
3256
3269
|
existingProperty: !0,
|
|
3257
3270
|
autoOpenTypeSelect: !1,
|
|
3258
3271
|
propertyKey: _,
|
|
3259
3272
|
propertyNamespace: R,
|
|
3260
|
-
property:
|
|
3261
|
-
onPropertyChanged:
|
|
3273
|
+
property: c,
|
|
3274
|
+
onPropertyChanged: pe,
|
|
3262
3275
|
onDelete: Te,
|
|
3263
3276
|
onError: Ke,
|
|
3264
3277
|
forceShowErrors: t,
|
|
3265
3278
|
initialErrors: Ze,
|
|
3266
3279
|
getData: p,
|
|
3267
3280
|
propertyConfigs: m,
|
|
3268
|
-
collectionEditable:
|
|
3281
|
+
collectionEditable: s,
|
|
3269
3282
|
onOkClicked: N ? We : void 0
|
|
3270
3283
|
},
|
|
3271
|
-
`edit_view_${
|
|
3284
|
+
`edit_view_${g}`
|
|
3272
3285
|
)
|
|
3273
3286
|
] });
|
|
3274
|
-
return /* @__PURE__ */ a(
|
|
3287
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
3275
3288
|
yt,
|
|
3276
3289
|
/* @__PURE__ */ e(
|
|
3277
3290
|
Ve,
|
|
@@ -3287,14 +3300,14 @@ function Gi({
|
|
|
3287
3300
|
getData: p,
|
|
3288
3301
|
allowDataInference: !r,
|
|
3289
3302
|
propertyConfigs: m,
|
|
3290
|
-
collectionEditable:
|
|
3291
|
-
existingPropertyKeys:
|
|
3303
|
+
collectionEditable: s,
|
|
3304
|
+
existingPropertyKeys: f.propertiesOrder
|
|
3292
3305
|
}
|
|
3293
3306
|
),
|
|
3294
3307
|
/* @__PURE__ */ e(
|
|
3295
3308
|
Hi,
|
|
3296
3309
|
{
|
|
3297
|
-
collection:
|
|
3310
|
+
collection: f,
|
|
3298
3311
|
open: V,
|
|
3299
3312
|
onOpenChange: G
|
|
3300
3313
|
}
|
|
@@ -3371,10 +3384,10 @@ function Zi({
|
|
|
3371
3384
|
getUser: l,
|
|
3372
3385
|
parentCollectionIds: o
|
|
3373
3386
|
}) {
|
|
3374
|
-
const { entityViews: d } = Ae(), [u, p] = Y.useState(), [h, m] = Y.useState(!1), [
|
|
3387
|
+
const { entityViews: d } = Ae(), [u, p] = Y.useState(), [h, m] = Y.useState(!1), [s, f] = Y.useState(), [v, x] = Y.useState(), {
|
|
3375
3388
|
values: y,
|
|
3376
3389
|
setFieldValue: P
|
|
3377
|
-
} = K(),
|
|
3390
|
+
} = K(), k = t.subcollections ?? [], b = y.entityViews?.filter((g) => typeof g == "string").map((g) => xr(g, d)).filter(Boolean) ?? [], C = t.entityViews?.filter((g) => typeof g != "string") ?? [], N = b.length + C.length;
|
|
3378
3391
|
return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
|
|
3379
3392
|
/* @__PURE__ */ e(mt, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-16", children: [
|
|
3380
3393
|
/* @__PURE__ */ a("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
@@ -3383,19 +3396,19 @@ function Zi({
|
|
|
3383
3396
|
y.name
|
|
3384
3397
|
] }),
|
|
3385
3398
|
/* @__PURE__ */ a(Ce, { className: "flex flex-col gap-4 p-2 w-full", children: [
|
|
3386
|
-
|
|
3399
|
+
k && k.length > 0 && /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(Bt, { children: k.map((g) => /* @__PURE__ */ a(
|
|
3387
3400
|
bt,
|
|
3388
3401
|
{
|
|
3389
3402
|
onClick: () => x({
|
|
3390
3403
|
isNewCollection: !1,
|
|
3391
|
-
editedCollectionId:
|
|
3404
|
+
editedCollectionId: g.id
|
|
3392
3405
|
}),
|
|
3393
3406
|
children: [
|
|
3394
3407
|
/* @__PURE__ */ e(
|
|
3395
3408
|
Ue,
|
|
3396
3409
|
{
|
|
3397
3410
|
align: "left",
|
|
3398
|
-
children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children:
|
|
3411
|
+
children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: g.name })
|
|
3399
3412
|
}
|
|
3400
3413
|
),
|
|
3401
3414
|
/* @__PURE__ */ e(
|
|
@@ -3407,7 +3420,7 @@ function Zi({
|
|
|
3407
3420
|
{
|
|
3408
3421
|
size: "small",
|
|
3409
3422
|
onClick: (w) => {
|
|
3410
|
-
w.preventDefault(), w.stopPropagation(), p(
|
|
3423
|
+
w.preventDefault(), w.stopPropagation(), p(g.id);
|
|
3411
3424
|
},
|
|
3412
3425
|
color: "inherit",
|
|
3413
3426
|
children: /* @__PURE__ */ e(dt, { size: "small" })
|
|
@@ -3417,7 +3430,7 @@ function Zi({
|
|
|
3417
3430
|
)
|
|
3418
3431
|
]
|
|
3419
3432
|
},
|
|
3420
|
-
|
|
3433
|
+
g.path
|
|
3421
3434
|
)) }) }),
|
|
3422
3435
|
/* @__PURE__ */ e(
|
|
3423
3436
|
z,
|
|
@@ -3428,7 +3441,7 @@ function Zi({
|
|
|
3428
3441
|
});
|
|
3429
3442
|
},
|
|
3430
3443
|
variant: "text",
|
|
3431
|
-
startIcon: /* @__PURE__ */ e(
|
|
3444
|
+
startIcon: /* @__PURE__ */ e(se, {}),
|
|
3432
3445
|
children: "Add subcollection"
|
|
3433
3446
|
}
|
|
3434
3447
|
)
|
|
@@ -3447,15 +3460,15 @@ function Zi({
|
|
|
3447
3460
|
target: "_blank",
|
|
3448
3461
|
children: "More info"
|
|
3449
3462
|
}
|
|
3450
|
-
), children: "Define your own custom views by uploading
|
|
3451
|
-
/* @__PURE__ */ e(
|
|
3463
|
+
), children: "Define your own custom views by uploading them with the CLI." }),
|
|
3464
|
+
/* @__PURE__ */ e(j, { children: /* @__PURE__ */ a(Ce, { className: "flex flex-col gap-4 p-2 w-full", children: [
|
|
3452
3465
|
/* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ a(Bt, { children: [
|
|
3453
|
-
b.map((
|
|
3466
|
+
b.map((g) => /* @__PURE__ */ a(bt, { children: [
|
|
3454
3467
|
/* @__PURE__ */ e(
|
|
3455
3468
|
Ue,
|
|
3456
3469
|
{
|
|
3457
3470
|
align: "left",
|
|
3458
|
-
children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children:
|
|
3471
|
+
children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: g.name })
|
|
3459
3472
|
}
|
|
3460
3473
|
),
|
|
3461
3474
|
/* @__PURE__ */ e(
|
|
@@ -3467,7 +3480,7 @@ function Zi({
|
|
|
3467
3480
|
{
|
|
3468
3481
|
size: "small",
|
|
3469
3482
|
onClick: (w) => {
|
|
3470
|
-
w.preventDefault(), w.stopPropagation(), g
|
|
3483
|
+
w.preventDefault(), w.stopPropagation(), f(g.key);
|
|
3471
3484
|
},
|
|
3472
3485
|
color: "inherit",
|
|
3473
3486
|
children: /* @__PURE__ */ e(dt, { size: "small" })
|
|
@@ -3475,20 +3488,20 @@ function Zi({
|
|
|
3475
3488
|
) })
|
|
3476
3489
|
}
|
|
3477
3490
|
)
|
|
3478
|
-
] },
|
|
3479
|
-
C.map((
|
|
3491
|
+
] }, g.key)),
|
|
3492
|
+
C.map((g) => /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ a(
|
|
3480
3493
|
Ue,
|
|
3481
3494
|
{
|
|
3482
3495
|
align: "left",
|
|
3483
3496
|
children: [
|
|
3484
|
-
/* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children:
|
|
3497
|
+
/* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: g.name }),
|
|
3485
3498
|
/* @__PURE__ */ a(O, { variant: "caption", className: "flex-grow", children: [
|
|
3486
3499
|
"This view is defined in code with key ",
|
|
3487
|
-
/* @__PURE__ */ e("code", { children:
|
|
3500
|
+
/* @__PURE__ */ e("code", { children: g.key })
|
|
3488
3501
|
] })
|
|
3489
3502
|
]
|
|
3490
3503
|
}
|
|
3491
|
-
) },
|
|
3504
|
+
) }, g.key))
|
|
3492
3505
|
] }) }),
|
|
3493
3506
|
/* @__PURE__ */ e(
|
|
3494
3507
|
z,
|
|
@@ -3497,7 +3510,7 @@ function Zi({
|
|
|
3497
3510
|
m(!0);
|
|
3498
3511
|
},
|
|
3499
3512
|
variant: "text",
|
|
3500
|
-
startIcon: /* @__PURE__ */ e(
|
|
3513
|
+
startIcon: /* @__PURE__ */ e(se, {}),
|
|
3501
3514
|
children: "Add custom entity view"
|
|
3502
3515
|
}
|
|
3503
3516
|
)
|
|
@@ -3510,31 +3523,31 @@ function Zi({
|
|
|
3510
3523
|
{
|
|
3511
3524
|
open: !!u,
|
|
3512
3525
|
onAccept: () => {
|
|
3513
|
-
const
|
|
3526
|
+
const g = {
|
|
3514
3527
|
id: u,
|
|
3515
3528
|
parentCollectionIds: [...o ?? [], t.id]
|
|
3516
3529
|
};
|
|
3517
|
-
console.debug("Deleting subcollection",
|
|
3530
|
+
console.debug("Deleting subcollection", g), n.deleteCollection(g), p(void 0);
|
|
3518
3531
|
},
|
|
3519
3532
|
onCancel: () => p(void 0),
|
|
3520
|
-
title: /* @__PURE__ */ e(
|
|
3521
|
-
body: /* @__PURE__ */ a(
|
|
3533
|
+
title: /* @__PURE__ */ e(j, { children: "Delete this subcollection?" }),
|
|
3534
|
+
body: /* @__PURE__ */ a(j, { children: [
|
|
3522
3535
|
" This will ",
|
|
3523
3536
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
3524
3537
|
", only the collection in the CMS"
|
|
3525
3538
|
] })
|
|
3526
3539
|
}
|
|
3527
3540
|
),
|
|
3528
|
-
|
|
3541
|
+
s && /* @__PURE__ */ e(
|
|
3529
3542
|
lt,
|
|
3530
3543
|
{
|
|
3531
|
-
open: !!
|
|
3544
|
+
open: !!s,
|
|
3532
3545
|
onAccept: () => {
|
|
3533
|
-
P("entityViews", y.entityViews?.filter((
|
|
3546
|
+
P("entityViews", y.entityViews?.filter((g) => g !== s)), f(void 0);
|
|
3534
3547
|
},
|
|
3535
|
-
onCancel: () =>
|
|
3536
|
-
title: /* @__PURE__ */ e(
|
|
3537
|
-
body: /* @__PURE__ */ a(
|
|
3548
|
+
onCancel: () => f(void 0),
|
|
3549
|
+
title: /* @__PURE__ */ e(j, { children: "Remove this view?" }),
|
|
3550
|
+
body: /* @__PURE__ */ a(j, { children: [
|
|
3538
3551
|
"This will ",
|
|
3539
3552
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
3540
3553
|
", only the view in the CMS"
|
|
@@ -3561,8 +3574,8 @@ function Zi({
|
|
|
3561
3574
|
Wi,
|
|
3562
3575
|
{
|
|
3563
3576
|
open: h,
|
|
3564
|
-
onClose: (
|
|
3565
|
-
|
|
3577
|
+
onClose: (g) => {
|
|
3578
|
+
g && P("entityViews", [...y.entityViews ?? [], g]), m(!1);
|
|
3566
3579
|
}
|
|
3567
3580
|
}
|
|
3568
3581
|
)
|
|
@@ -3998,7 +4011,7 @@ function Ji({
|
|
|
3998
4011
|
existingCollectionPaths: l
|
|
3999
4012
|
}) {
|
|
4000
4013
|
const [o, d] = $(!1), [u, p] = $();
|
|
4001
|
-
|
|
4014
|
+
de(() => {
|
|
4002
4015
|
r && l && (d(!0), r(t).then((v) => {
|
|
4003
4016
|
const x = v.filter((y) => !(l ?? []).find((P) => P.trim().toLowerCase() === y.trim().toLowerCase()));
|
|
4004
4017
|
p(x);
|
|
@@ -4007,8 +4020,8 @@ function Ji({
|
|
|
4007
4020
|
const {
|
|
4008
4021
|
values: h,
|
|
4009
4022
|
setFieldValue: m,
|
|
4010
|
-
setValues:
|
|
4011
|
-
submitCount:
|
|
4023
|
+
setValues: s,
|
|
4024
|
+
submitCount: f
|
|
4012
4025
|
} = K();
|
|
4013
4026
|
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: [
|
|
4014
4027
|
/* @__PURE__ */ e(
|
|
@@ -4065,7 +4078,7 @@ function Ji({
|
|
|
4065
4078
|
subtitle: "A collection of products with images, prices and stock",
|
|
4066
4079
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Lt.icon }),
|
|
4067
4080
|
onClick: () => {
|
|
4068
|
-
|
|
4081
|
+
s(Lt), i();
|
|
4069
4082
|
}
|
|
4070
4083
|
}
|
|
4071
4084
|
),
|
|
@@ -4076,7 +4089,7 @@ function Ji({
|
|
|
4076
4089
|
subtitle: "A collection of users with emails, names and roles",
|
|
4077
4090
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: $t.icon }),
|
|
4078
4091
|
onClick: () => {
|
|
4079
|
-
|
|
4092
|
+
s($t), i();
|
|
4080
4093
|
}
|
|
4081
4094
|
}
|
|
4082
4095
|
),
|
|
@@ -4087,7 +4100,7 @@ function Ji({
|
|
|
4087
4100
|
subtitle: "A collection of blog posts with images, authors and complex content",
|
|
4088
4101
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: qt.icon }),
|
|
4089
4102
|
onClick: () => {
|
|
4090
|
-
|
|
4103
|
+
s(qt), i();
|
|
4091
4104
|
}
|
|
4092
4105
|
}
|
|
4093
4106
|
),
|
|
@@ -4098,7 +4111,7 @@ function Ji({
|
|
|
4098
4111
|
subtitle: "A collection of pages with images, authors and complex content",
|
|
4099
4112
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Yt.icon }),
|
|
4100
4113
|
onClick: () => {
|
|
4101
|
-
|
|
4114
|
+
s(Yt), i();
|
|
4102
4115
|
}
|
|
4103
4116
|
}
|
|
4104
4117
|
)
|
|
@@ -4129,9 +4142,9 @@ function nt({
|
|
|
4129
4142
|
tr,
|
|
4130
4143
|
{
|
|
4131
4144
|
onClick: i,
|
|
4132
|
-
className:
|
|
4145
|
+
className: he(
|
|
4133
4146
|
"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",
|
|
4134
|
-
"text-gray-700 dark:text-
|
|
4147
|
+
"text-gray-700 dark:text-slate-300",
|
|
4135
4148
|
"hover:border-primary-dark hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary",
|
|
4136
4149
|
"border-gray-400 dark:border-gray-600 "
|
|
4137
4150
|
),
|
|
@@ -4151,18 +4164,18 @@ function Qi({
|
|
|
4151
4164
|
setFieldValue: i,
|
|
4152
4165
|
setFieldTouched: l,
|
|
4153
4166
|
values: o
|
|
4154
|
-
} = K(), [d, u] = $(void 0), p = Y.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), h = d ? d.id : void 0, m = d || void 0,
|
|
4167
|
+
} = K(), [d, u] = $(void 0), p = Y.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), h = d ? d.id : void 0, m = d || void 0, s = ({
|
|
4155
4168
|
id: v,
|
|
4156
4169
|
property: x,
|
|
4157
4170
|
previousId: y,
|
|
4158
4171
|
namespace: P
|
|
4159
4172
|
}) => {
|
|
4160
|
-
const
|
|
4173
|
+
const k = v ? ae(v, P) : void 0, b = k ? me(k) : void 0, C = (g) => g ? p.current[g] ?? I(o, ye(g)) : p.current[""], N = (g, w) => {
|
|
4161
4174
|
const _ = ye(w);
|
|
4162
|
-
i(_,
|
|
4175
|
+
i(_, g, !1), p.current[w ?? ""] = g;
|
|
4163
4176
|
};
|
|
4164
4177
|
if (y && y !== v) {
|
|
4165
|
-
const
|
|
4178
|
+
const g = ae(y, P), w = me(g), M = C(P).map((D) => D === y ? v : D).filter((D) => D !== void 0);
|
|
4166
4179
|
N(M, P);
|
|
4167
4180
|
const R = { ...t.headersMapping };
|
|
4168
4181
|
Object.keys(R).forEach((D) => {
|
|
@@ -4170,13 +4183,13 @@ function Qi({
|
|
|
4170
4183
|
}), t.setHeadersMapping(R), i(w, void 0, !1), l(w, !1, !1);
|
|
4171
4184
|
}
|
|
4172
4185
|
b && (i(b, x, !1), l(b, !0, !1));
|
|
4173
|
-
},
|
|
4186
|
+
}, f = async ({
|
|
4174
4187
|
id: v,
|
|
4175
4188
|
importKey: x,
|
|
4176
4189
|
property: y,
|
|
4177
4190
|
namespace: P
|
|
4178
4191
|
}) => {
|
|
4179
|
-
const
|
|
4192
|
+
const k = v ? ae(v, P) : void 0, b = k ? me(k) : void 0, C = t.importData.map((g) => I(g, x)), N = {
|
|
4180
4193
|
...ti(C, y, rr),
|
|
4181
4194
|
editable: !0
|
|
4182
4195
|
};
|
|
@@ -4192,7 +4205,7 @@ function Qi({
|
|
|
4192
4205
|
idColumn: t.idColumn,
|
|
4193
4206
|
originProperties: t.originProperties,
|
|
4194
4207
|
destinationProperties: o.properties,
|
|
4195
|
-
onIdPropertyChanged: (v) => t.setIdColumn(v),
|
|
4208
|
+
onIdPropertyChanged: (v) => t.setIdColumn(v ?? void 0),
|
|
4196
4209
|
buildPropertyView: ({
|
|
4197
4210
|
property: v,
|
|
4198
4211
|
propertyKey: x,
|
|
@@ -4202,7 +4215,7 @@ function Qi({
|
|
|
4202
4215
|
{
|
|
4203
4216
|
property: v,
|
|
4204
4217
|
propertyKey: x,
|
|
4205
|
-
onPropertyNameChanged: (P,
|
|
4218
|
+
onPropertyNameChanged: (P, k) => i(`properties.${P}.name`, k, !1),
|
|
4206
4219
|
onEditClick: () => {
|
|
4207
4220
|
!x || !v || u({
|
|
4208
4221
|
...v,
|
|
@@ -4215,7 +4228,7 @@ function Qi({
|
|
|
4215
4228
|
{
|
|
4216
4229
|
property: v,
|
|
4217
4230
|
disabled: !1,
|
|
4218
|
-
onPropertyChanged: (P) =>
|
|
4231
|
+
onPropertyChanged: (P) => f({
|
|
4219
4232
|
...P,
|
|
4220
4233
|
importKey: y
|
|
4221
4234
|
}),
|
|
@@ -4236,7 +4249,7 @@ function Qi({
|
|
|
4236
4249
|
property: m,
|
|
4237
4250
|
inArray: !1,
|
|
4238
4251
|
autoUpdateId: !1,
|
|
4239
|
-
onPropertyChanged:
|
|
4252
|
+
onPropertyChanged: s,
|
|
4240
4253
|
allowDataInference: !1,
|
|
4241
4254
|
collectionEditable: n,
|
|
4242
4255
|
onOkClicked: () => {
|
|
@@ -4304,7 +4317,7 @@ function Xi({
|
|
|
4304
4317
|
);
|
|
4305
4318
|
}
|
|
4306
4319
|
function en({ importConfig: t, properties: r, propertiesOrder: n }) {
|
|
4307
|
-
|
|
4320
|
+
de(() => {
|
|
4308
4321
|
const l = pi(t.originProperties, r), o = t.importData.map((d) => mi(d, t.idColumn, t.headersMapping, r, l, "TEMP_PATH"));
|
|
4309
4322
|
t.setEntities(o);
|
|
4310
4323
|
}, []);
|
|
@@ -4334,15 +4347,15 @@ function dr(t, r = "") {
|
|
|
4334
4347
|
const n = Object.keys(t).reduce((o, d) => {
|
|
4335
4348
|
const u = t[d], p = kr(d), h = r ? `${r}.${p}` : p;
|
|
4336
4349
|
if (u.dataType === "map" && u.properties) {
|
|
4337
|
-
const
|
|
4350
|
+
const f = dr(u.properties, h);
|
|
4338
4351
|
return {
|
|
4339
4352
|
headersMapping: { ...o.headersMapping, [d]: h },
|
|
4340
4353
|
properties: {
|
|
4341
4354
|
...o.properties,
|
|
4342
4355
|
[p]: {
|
|
4343
4356
|
...u,
|
|
4344
|
-
properties:
|
|
4345
|
-
propertiesOrder: Object.keys(
|
|
4357
|
+
properties: f.properties,
|
|
4358
|
+
propertiesOrder: Object.keys(f.properties)
|
|
4346
4359
|
}
|
|
4347
4360
|
}
|
|
4348
4361
|
};
|
|
@@ -4366,7 +4379,7 @@ function ur(t) {
|
|
|
4366
4379
|
const r = t.open, [n, i] = je.useState(!1), [l, o] = je.useState(!1), d = Q(() => {
|
|
4367
4380
|
n ? o(!0) : t.handleClose(void 0);
|
|
4368
4381
|
}, [n, t.handleClose]);
|
|
4369
|
-
return
|
|
4382
|
+
return de(() => {
|
|
4370
4383
|
r || (i(!1), o(!1));
|
|
4371
4384
|
}, [r]), /* @__PURE__ */ a(
|
|
4372
4385
|
Fe,
|
|
@@ -4403,10 +4416,10 @@ function tn(t) {
|
|
|
4403
4416
|
const { propertyConfigs: r } = Ae(), n = Pe(), i = _e(), {
|
|
4404
4417
|
topLevelNavigation: l,
|
|
4405
4418
|
collections: o
|
|
4406
|
-
} = n, d = t.initialValues, u = !d?.path && (t.parentCollectionIds ?? []).length === 0, p = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], h = p.map((b) => b.path.trim().toLowerCase()), m = p.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [
|
|
4407
|
-
if (
|
|
4419
|
+
} = n, d = t.initialValues, u = !d?.path && (t.parentCollectionIds ?? []).length === 0, p = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], h = p.map((b) => b.path.trim().toLowerCase()), m = p.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [s, f] = je.useState(), [v, x] = je.useState(!1);
|
|
4420
|
+
if (de(() => {
|
|
4408
4421
|
try {
|
|
4409
|
-
n.initialised && (t.editedCollectionId ?
|
|
4422
|
+
n.initialised && (t.editedCollectionId ? f(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : f(void 0), x(!0));
|
|
4410
4423
|
} catch (b) {
|
|
4411
4424
|
console.error(b);
|
|
4412
4425
|
}
|
|
@@ -4414,10 +4427,10 @@ function tn(t) {
|
|
|
4414
4427
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
4415
4428
|
const {
|
|
4416
4429
|
groups: y
|
|
4417
|
-
} = l, P =
|
|
4418
|
-
...
|
|
4419
|
-
id:
|
|
4420
|
-
} : void 0,
|
|
4430
|
+
} = l, P = s ? {
|
|
4431
|
+
...s,
|
|
4432
|
+
id: s.id ?? s.path ?? _t(16)
|
|
4433
|
+
} : void 0, k = P ? nn(P, r) : {
|
|
4421
4434
|
id: d?.path ?? _t(16),
|
|
4422
4435
|
path: d?.path ?? "",
|
|
4423
4436
|
name: d?.name ?? "",
|
|
@@ -4431,12 +4444,12 @@ function tn(t) {
|
|
|
4431
4444
|
rn,
|
|
4432
4445
|
{
|
|
4433
4446
|
...t,
|
|
4434
|
-
initialValues:
|
|
4447
|
+
initialValues: k,
|
|
4435
4448
|
existingPaths: h,
|
|
4436
4449
|
existingIds: m,
|
|
4437
4450
|
includeTemplates: u,
|
|
4438
|
-
collection:
|
|
4439
|
-
setCollection:
|
|
4451
|
+
collection: s,
|
|
4452
|
+
setCollection: f,
|
|
4440
4453
|
groups: y,
|
|
4441
4454
|
propertyConfigs: r
|
|
4442
4455
|
}
|
|
@@ -4454,24 +4467,24 @@ function rn({
|
|
|
4454
4467
|
extraView: p,
|
|
4455
4468
|
handleCancel: h,
|
|
4456
4469
|
setFormDirty: m,
|
|
4457
|
-
pathSuggestions:
|
|
4458
|
-
getUser:
|
|
4470
|
+
pathSuggestions: s,
|
|
4471
|
+
getUser: f,
|
|
4459
4472
|
parentCollection: v,
|
|
4460
4473
|
getData: x,
|
|
4461
4474
|
existingPaths: y,
|
|
4462
4475
|
existingIds: P,
|
|
4463
|
-
includeTemplates:
|
|
4476
|
+
includeTemplates: k,
|
|
4464
4477
|
collection: b,
|
|
4465
4478
|
setCollection: C,
|
|
4466
4479
|
initialValues: N,
|
|
4467
|
-
propertyConfigs:
|
|
4480
|
+
propertyConfigs: g,
|
|
4468
4481
|
groups: w
|
|
4469
4482
|
}) {
|
|
4470
|
-
const _ = hi(), M = Pe(), R = Ie(), D = Le({}), A = t ?
|
|
4471
|
-
const S =
|
|
4483
|
+
const _ = hi(), M = Pe(), R = Ie(), D = Le({}), A = t ? k ? "welcome" : "details" : "properties", [c, V] = $(A), [G, B] = je.useState(), q = (T) => {
|
|
4484
|
+
const S = T.id || T.path;
|
|
4472
4485
|
return r.saveCollection({
|
|
4473
4486
|
id: S,
|
|
4474
|
-
collectionData:
|
|
4487
|
+
collectionData: T,
|
|
4475
4488
|
previousId: n,
|
|
4476
4489
|
parentCollectionIds: i
|
|
4477
4490
|
}).then(() => (B(void 0), !0)).catch((E) => (B(E), console.error(E), R.open({
|
|
@@ -4479,45 +4492,45 @@ function rn({
|
|
|
4479
4492
|
message: "Error persisting collection: " + (E.message ?? "Details in the console")
|
|
4480
4493
|
}), !1));
|
|
4481
4494
|
}, L = Q(() => {
|
|
4482
|
-
|
|
4483
|
-
}, [
|
|
4495
|
+
c === "details" ? _.inUse ? V("import_data_saving") : V(p ? "extra_view" : "properties") : V(c === "welcome" ? "details" : c === "import_data_mapping" ? "import_data_preview" : c === "import_data_preview" ? "details" : c === "extra_view" ? "properties" : "details");
|
|
4496
|
+
}, [c, _.inUse, p]), J = Q((T) => {
|
|
4484
4497
|
if (o)
|
|
4485
|
-
return o?.(
|
|
4486
|
-
}, [o, i]), le = Q(async (
|
|
4498
|
+
return o?.(T.path, T.collectionGroup ?? !1, i ?? []);
|
|
4499
|
+
}, [o, i]), le = Q(async (T) => {
|
|
4487
4500
|
try {
|
|
4488
4501
|
if (!J)
|
|
4489
|
-
return C(
|
|
4502
|
+
return C(T), Promise.resolve(T);
|
|
4490
4503
|
V("loading");
|
|
4491
|
-
const S = await J?.(
|
|
4504
|
+
const S = await J?.(T);
|
|
4492
4505
|
if (!S)
|
|
4493
|
-
return C(
|
|
4506
|
+
return C(T), Promise.resolve(T);
|
|
4494
4507
|
const E = {
|
|
4495
|
-
...
|
|
4508
|
+
...T ?? {}
|
|
4496
4509
|
};
|
|
4497
4510
|
return Object.keys(S.properties ?? {}).length > 0 && (E.properties = S.properties, E.propertiesOrder = S.propertiesOrder), E.propertiesOrder ? (C(E), console.debug("Inferred collection", {
|
|
4498
|
-
newCollection:
|
|
4511
|
+
newCollection: T ?? {},
|
|
4499
4512
|
values: E
|
|
4500
4513
|
}), E) : (E.propertiesOrder = Object.keys(E.properties), E);
|
|
4501
4514
|
} catch (S) {
|
|
4502
4515
|
return console.error(S), R.open({
|
|
4503
4516
|
type: "error",
|
|
4504
4517
|
message: "Error inferring collection: " + (S.message ?? "Details in the console")
|
|
4505
|
-
}),
|
|
4518
|
+
}), T;
|
|
4506
4519
|
}
|
|
4507
|
-
}, [i, J]),
|
|
4520
|
+
}, [i, J]), ue = Tt({
|
|
4508
4521
|
initialValues: N,
|
|
4509
|
-
onSubmit: (
|
|
4510
|
-
console.log("Submitting collection",
|
|
4522
|
+
onSubmit: (T, S) => {
|
|
4523
|
+
console.log("Submitting collection", T);
|
|
4511
4524
|
try {
|
|
4512
4525
|
if (!t) {
|
|
4513
|
-
q(
|
|
4514
|
-
S.resetForm({ values: N }), d(
|
|
4526
|
+
q(T).then(() => {
|
|
4527
|
+
S.resetForm({ values: N }), d(T);
|
|
4515
4528
|
});
|
|
4516
4529
|
return;
|
|
4517
4530
|
}
|
|
4518
|
-
|
|
4531
|
+
c === "welcome" ? (L(), S.resetForm({ values: T })) : c === "details" ? p || _.inUse ? (S.resetForm({ values: T }), L()) : t ? le(T).then((E) => {
|
|
4519
4532
|
S.resetForm({
|
|
4520
|
-
values: E ??
|
|
4533
|
+
values: E ?? T,
|
|
4521
4534
|
touched: {
|
|
4522
4535
|
path: !0,
|
|
4523
4536
|
name: !0
|
|
@@ -4525,62 +4538,62 @@ function rn({
|
|
|
4525
4538
|
});
|
|
4526
4539
|
}).finally(() => {
|
|
4527
4540
|
L();
|
|
4528
|
-
}) : (S.resetForm({ values:
|
|
4529
|
-
S.resetForm({ values: N }), L(), d(
|
|
4530
|
-
}) : (L(), S.resetForm({ values:
|
|
4541
|
+
}) : (S.resetForm({ values: T }), L()) : c === "extra_view" ? (L(), S.resetForm({ values: T })) : c === "import_data_mapping" || c === "import_data_preview" ? L() : c === "properties" ? q(T).then(() => {
|
|
4542
|
+
S.resetForm({ values: N }), L(), d(T);
|
|
4543
|
+
}) : (L(), S.resetForm({ values: T }));
|
|
4531
4544
|
} catch (E) {
|
|
4532
4545
|
R.open({
|
|
4533
4546
|
type: "error",
|
|
4534
4547
|
message: "Error persisting collection: " + (E.message ?? "Details in the console")
|
|
4535
|
-
}), console.error(E), S.resetForm({ values:
|
|
4548
|
+
}), console.error(E), S.resetForm({ values: T });
|
|
4536
4549
|
}
|
|
4537
4550
|
},
|
|
4538
|
-
validation: (
|
|
4551
|
+
validation: (T) => {
|
|
4539
4552
|
let S = {};
|
|
4540
|
-
const E = (
|
|
4553
|
+
const E = (c === "properties" || c === "subcollections" || c === "details") && vi;
|
|
4541
4554
|
if (E)
|
|
4542
4555
|
try {
|
|
4543
|
-
E.validateSync(
|
|
4556
|
+
E.validateSync(T, { abortEarly: !1 });
|
|
4544
4557
|
} catch (ie) {
|
|
4545
4558
|
ie.inner.forEach((ke) => {
|
|
4546
4559
|
S[ke.path] = ke.message;
|
|
4547
4560
|
});
|
|
4548
4561
|
}
|
|
4549
|
-
if (
|
|
4550
|
-
const ie = Ht(
|
|
4562
|
+
if (c === "properties" && (S = { ...S, ...D.current }), c === "details") {
|
|
4563
|
+
const ie = Ht(T.path, t, y, T.id);
|
|
4551
4564
|
ie && (S.path = ie);
|
|
4552
|
-
const ke = an(
|
|
4565
|
+
const ke = an(T.id, t, y, P);
|
|
4553
4566
|
ke && (S.id = ke);
|
|
4554
4567
|
}
|
|
4555
4568
|
return S;
|
|
4556
4569
|
}
|
|
4557
4570
|
}), {
|
|
4558
4571
|
values: re,
|
|
4559
|
-
setFieldValue:
|
|
4572
|
+
setFieldValue: fe,
|
|
4560
4573
|
isSubmitting: Te,
|
|
4561
4574
|
dirty: Ge,
|
|
4562
4575
|
submitCount: gt
|
|
4563
|
-
} =
|
|
4564
|
-
|
|
4576
|
+
} = 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;
|
|
4577
|
+
de(() => {
|
|
4565
4578
|
m(Ge);
|
|
4566
4579
|
}, [Ge]);
|
|
4567
|
-
function Qe(
|
|
4568
|
-
_.setInUse(!0), ri(
|
|
4580
|
+
function Qe(T) {
|
|
4581
|
+
_.setInUse(!0), ri(T, rr).then((S) => {
|
|
4569
4582
|
const E = dr(S);
|
|
4570
|
-
|
|
4583
|
+
fe("properties", E.properties), fe("propertiesOrder", Object.keys(E.properties)), _.setIdColumn(E.idColumn), _.setImportData(T), _.setHeadersMapping(E.headersMapping), _.setOriginProperties(E.properties);
|
|
4571
4584
|
});
|
|
4572
4585
|
}
|
|
4573
4586
|
const vt = !!re.name && !!re.id, yt = () => {
|
|
4574
|
-
const
|
|
4575
|
-
_.idColumn && delete
|
|
4576
|
-
},
|
|
4577
|
-
return /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(kt, { value:
|
|
4587
|
+
const T = { ...re.properties };
|
|
4588
|
+
_.idColumn && delete T[_.idColumn], fe("properties", T), L();
|
|
4589
|
+
}, U = b?.editable === void 0 || b?.editable === !0 || t;
|
|
4590
|
+
return /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(kt, { value: ue, children: /* @__PURE__ */ a(j, { children: [
|
|
4578
4591
|
!t && /* @__PURE__ */ a(
|
|
4579
4592
|
Hr,
|
|
4580
4593
|
{
|
|
4581
|
-
value:
|
|
4582
|
-
className:
|
|
4583
|
-
onValueChange: (
|
|
4594
|
+
value: c,
|
|
4595
|
+
className: he(wt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
4596
|
+
onValueChange: (T) => V(T),
|
|
4584
4597
|
children: [
|
|
4585
4598
|
/* @__PURE__ */ e(Ct, { value: "details", children: "Details" }),
|
|
4586
4599
|
/* @__PURE__ */ e(Ct, { value: "properties", children: "Properties" }),
|
|
@@ -4592,35 +4605,35 @@ function rn({
|
|
|
4592
4605
|
"form",
|
|
4593
4606
|
{
|
|
4594
4607
|
noValidate: !0,
|
|
4595
|
-
onSubmit:
|
|
4596
|
-
className:
|
|
4608
|
+
onSubmit: ue.handleSubmit,
|
|
4609
|
+
className: he(
|
|
4597
4610
|
t ? "h-full" : "h-[calc(100%-48px)]",
|
|
4598
4611
|
"flex-grow flex flex-col relative"
|
|
4599
4612
|
),
|
|
4600
4613
|
children: [
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4614
|
+
c === "loading" && /* @__PURE__ */ e(Nt, {}),
|
|
4615
|
+
c === "extra_view" && pe && p?.View && /* @__PURE__ */ e(p.View, { path: pe }),
|
|
4616
|
+
c === "welcome" && /* @__PURE__ */ e(
|
|
4604
4617
|
Ji,
|
|
4605
4618
|
{
|
|
4606
|
-
path:
|
|
4607
|
-
onContinue: (
|
|
4608
|
-
|
|
4619
|
+
path: pe,
|
|
4620
|
+
onContinue: (T) => {
|
|
4621
|
+
T ? (Qe(T), V("import_data_mapping")) : V("details");
|
|
4609
4622
|
},
|
|
4610
4623
|
existingCollectionPaths: y,
|
|
4611
4624
|
parentCollection: v,
|
|
4612
|
-
pathSuggestions:
|
|
4625
|
+
pathSuggestions: s
|
|
4613
4626
|
}
|
|
4614
4627
|
),
|
|
4615
|
-
|
|
4628
|
+
c === "import_data_mapping" && _ && /* @__PURE__ */ e(
|
|
4616
4629
|
Qi,
|
|
4617
4630
|
{
|
|
4618
4631
|
importConfig: _,
|
|
4619
|
-
collectionEditable:
|
|
4620
|
-
propertyConfigs:
|
|
4632
|
+
collectionEditable: U,
|
|
4633
|
+
propertyConfigs: g
|
|
4621
4634
|
}
|
|
4622
4635
|
),
|
|
4623
|
-
|
|
4636
|
+
c === "import_data_preview" && _ && /* @__PURE__ */ e(
|
|
4624
4637
|
en,
|
|
4625
4638
|
{
|
|
4626
4639
|
importConfig: _,
|
|
@@ -4628,20 +4641,21 @@ function rn({
|
|
|
4628
4641
|
propertiesOrder: re.propertiesOrder
|
|
4629
4642
|
}
|
|
4630
4643
|
),
|
|
4631
|
-
|
|
4644
|
+
c === "import_data_saving" && _ && /* @__PURE__ */ e(
|
|
4632
4645
|
fi,
|
|
4633
4646
|
{
|
|
4634
4647
|
importConfig: _,
|
|
4635
4648
|
collection: re,
|
|
4636
|
-
|
|
4649
|
+
path: pe,
|
|
4650
|
+
onImportSuccess: async (T) => {
|
|
4637
4651
|
R.open({
|
|
4638
4652
|
type: "info",
|
|
4639
4653
|
message: "Data imported successfully"
|
|
4640
|
-
}), await q(re), d(
|
|
4654
|
+
}), await q(re), d(T);
|
|
4641
4655
|
}
|
|
4642
4656
|
}
|
|
4643
4657
|
),
|
|
4644
|
-
|
|
4658
|
+
c === "details" && /* @__PURE__ */ e(
|
|
4645
4659
|
yi,
|
|
4646
4660
|
{
|
|
4647
4661
|
existingPaths: y,
|
|
@@ -4652,35 +4666,35 @@ function rn({
|
|
|
4652
4666
|
isNewCollection: t
|
|
4653
4667
|
}
|
|
4654
4668
|
),
|
|
4655
|
-
|
|
4669
|
+
c === "subcollections" && b && /* @__PURE__ */ e(
|
|
4656
4670
|
Zi,
|
|
4657
4671
|
{
|
|
4658
4672
|
parentCollection: v,
|
|
4659
4673
|
configController: r,
|
|
4660
|
-
getUser:
|
|
4674
|
+
getUser: f,
|
|
4661
4675
|
collectionInference: o,
|
|
4662
4676
|
parentCollectionIds: i,
|
|
4663
4677
|
collection: b
|
|
4664
4678
|
}
|
|
4665
4679
|
),
|
|
4666
|
-
|
|
4680
|
+
c === "properties" && /* @__PURE__ */ e(
|
|
4667
4681
|
Gi,
|
|
4668
4682
|
{
|
|
4669
4683
|
showErrors: gt > 0,
|
|
4670
4684
|
isNewCollection: t,
|
|
4671
4685
|
reservedGroups: u,
|
|
4672
|
-
onPropertyError: (
|
|
4686
|
+
onPropertyError: (T, S, E) => {
|
|
4673
4687
|
const ie = Ft({
|
|
4674
4688
|
...D.current,
|
|
4675
|
-
[ir(
|
|
4689
|
+
[ir(T, S)]: Ft(E, !0)
|
|
4676
4690
|
}, !0);
|
|
4677
|
-
D.current = ie,
|
|
4691
|
+
D.current = ie, ue.validate();
|
|
4678
4692
|
},
|
|
4679
|
-
getUser:
|
|
4693
|
+
getUser: f,
|
|
4680
4694
|
getData: Re,
|
|
4681
4695
|
doCollectionInference: J,
|
|
4682
|
-
propertyConfigs:
|
|
4683
|
-
collectionEditable:
|
|
4696
|
+
propertyConfigs: g,
|
|
4697
|
+
collectionEditable: U,
|
|
4684
4698
|
extraIcon: p?.icon && /* @__PURE__ */ e(
|
|
4685
4699
|
oe,
|
|
4686
4700
|
{
|
|
@@ -4691,13 +4705,13 @@ function rn({
|
|
|
4691
4705
|
)
|
|
4692
4706
|
}
|
|
4693
4707
|
),
|
|
4694
|
-
|
|
4708
|
+
c !== "welcome" && /* @__PURE__ */ a(
|
|
4695
4709
|
ze,
|
|
4696
4710
|
{
|
|
4697
4711
|
position: "absolute",
|
|
4698
4712
|
children: [
|
|
4699
4713
|
G && /* @__PURE__ */ e(Wt, { error: G }),
|
|
4700
|
-
t &&
|
|
4714
|
+
t && k && c === "import_data_mapping" && /* @__PURE__ */ a(
|
|
4701
4715
|
z,
|
|
4702
4716
|
{
|
|
4703
4717
|
variant: "text",
|
|
@@ -4709,7 +4723,7 @@ function rn({
|
|
|
4709
4723
|
]
|
|
4710
4724
|
}
|
|
4711
4725
|
),
|
|
4712
|
-
t &&
|
|
4726
|
+
t && k && c === "import_data_preview" && /* @__PURE__ */ a(
|
|
4713
4727
|
z,
|
|
4714
4728
|
{
|
|
4715
4729
|
variant: "text",
|
|
@@ -4723,7 +4737,7 @@ function rn({
|
|
|
4723
4737
|
]
|
|
4724
4738
|
}
|
|
4725
4739
|
),
|
|
4726
|
-
t &&
|
|
4740
|
+
t && k && c === "details" && /* @__PURE__ */ a(
|
|
4727
4741
|
z,
|
|
4728
4742
|
{
|
|
4729
4743
|
variant: "text",
|
|
@@ -4735,7 +4749,7 @@ function rn({
|
|
|
4735
4749
|
]
|
|
4736
4750
|
}
|
|
4737
4751
|
),
|
|
4738
|
-
t &&
|
|
4752
|
+
t && c === "properties" && /* @__PURE__ */ a(
|
|
4739
4753
|
z,
|
|
4740
4754
|
{
|
|
4741
4755
|
variant: "text",
|
|
@@ -4757,7 +4771,7 @@ function rn({
|
|
|
4757
4771
|
children: "Cancel"
|
|
4758
4772
|
}
|
|
4759
4773
|
),
|
|
4760
|
-
t &&
|
|
4774
|
+
t && c === "import_data_mapping" && /* @__PURE__ */ e(
|
|
4761
4775
|
z,
|
|
4762
4776
|
{
|
|
4763
4777
|
variant: "filled",
|
|
@@ -4766,7 +4780,7 @@ function rn({
|
|
|
4766
4780
|
children: "Next"
|
|
4767
4781
|
}
|
|
4768
4782
|
),
|
|
4769
|
-
t &&
|
|
4783
|
+
t && c === "import_data_preview" && /* @__PURE__ */ e(
|
|
4770
4784
|
z,
|
|
4771
4785
|
{
|
|
4772
4786
|
variant: "filled",
|
|
@@ -4777,18 +4791,18 @@ function rn({
|
|
|
4777
4791
|
children: "Next"
|
|
4778
4792
|
}
|
|
4779
4793
|
),
|
|
4780
|
-
t && (
|
|
4794
|
+
t && (c === "details" || c === "properties") && /* @__PURE__ */ a(
|
|
4781
4795
|
Mt,
|
|
4782
4796
|
{
|
|
4783
4797
|
variant: "filled",
|
|
4784
4798
|
color: "primary",
|
|
4785
4799
|
type: "submit",
|
|
4786
4800
|
loading: Te,
|
|
4787
|
-
disabled: Te ||
|
|
4788
|
-
startIcon:
|
|
4801
|
+
disabled: Te || c === "details" && !vt,
|
|
4802
|
+
startIcon: c === "properties" ? /* @__PURE__ */ e(Gr, {}) : void 0,
|
|
4789
4803
|
children: [
|
|
4790
|
-
|
|
4791
|
-
|
|
4804
|
+
c === "details" && "Next",
|
|
4805
|
+
c === "properties" && "Create collection"
|
|
4792
4806
|
]
|
|
4793
4807
|
}
|
|
4794
4808
|
),
|
|
@@ -4812,7 +4826,7 @@ function rn({
|
|
|
4812
4826
|
}
|
|
4813
4827
|
function nn(t, r) {
|
|
4814
4828
|
const { properties: n, ...i } = t, l = {};
|
|
4815
|
-
return Object.keys(n).forEach((o) => {
|
|
4829
|
+
return n && Object.keys(n).forEach((o) => {
|
|
4816
4830
|
l[o] = pr(n[o], r);
|
|
4817
4831
|
}), { ...i, properties: l };
|
|
4818
4832
|
}
|
|
@@ -4852,26 +4866,26 @@ const Ht = (t, r, n, i) => {
|
|
|
4852
4866
|
getData: h,
|
|
4853
4867
|
onAnalyticsEvent: m
|
|
4854
4868
|
}) {
|
|
4855
|
-
const
|
|
4869
|
+
const s = Pe(), f = gi(), v = Ie(), { propertyConfigs: x } = Ae(), {
|
|
4856
4870
|
collections: y
|
|
4857
|
-
} =
|
|
4858
|
-
|
|
4859
|
-
u && u().then((
|
|
4860
|
-
b(
|
|
4871
|
+
} = s, P = (y ?? []).map((c) => c.path.trim().toLowerCase()), [k, b] = Y.useState();
|
|
4872
|
+
de(() => {
|
|
4873
|
+
u && u().then((c) => {
|
|
4874
|
+
b(c.filter((V) => !P.includes(V.trim().toLowerCase())));
|
|
4861
4875
|
});
|
|
4862
4876
|
}, [u]);
|
|
4863
|
-
const [C, N] = Y.useState(), [
|
|
4877
|
+
const [C, N] = Y.useState(), [g, w] = Y.useState(), _ = Q(() => ({
|
|
4864
4878
|
createCollections: !0,
|
|
4865
4879
|
editCollections: !0,
|
|
4866
4880
|
deleteCollections: !0
|
|
4867
4881
|
}), []), M = Q(({
|
|
4868
|
-
id:
|
|
4882
|
+
id: c,
|
|
4869
4883
|
fullPath: V,
|
|
4870
4884
|
parentCollectionIds: G,
|
|
4871
4885
|
parentCollection: B
|
|
4872
4886
|
}) => {
|
|
4873
|
-
console.debug("Edit collection",
|
|
4874
|
-
editedCollectionId:
|
|
4887
|
+
console.debug("Edit collection", c, V, G, B), m?.("edit_collection", { id: c, fullPath: V }), N({
|
|
4888
|
+
editedCollectionId: c,
|
|
4875
4889
|
fullPath: V,
|
|
4876
4890
|
parentCollectionIds: G,
|
|
4877
4891
|
isNewCollection: !1,
|
|
@@ -4879,15 +4893,15 @@ const Ht = (t, r, n, i) => {
|
|
|
4879
4893
|
redirect: !1
|
|
4880
4894
|
});
|
|
4881
4895
|
}, []), R = Q(({
|
|
4882
|
-
propertyKey:
|
|
4896
|
+
propertyKey: c,
|
|
4883
4897
|
property: V,
|
|
4884
4898
|
editedCollectionId: G,
|
|
4885
4899
|
currentPropertiesOrder: B,
|
|
4886
4900
|
parentCollectionIds: q,
|
|
4887
4901
|
collection: L
|
|
4888
4902
|
}) => {
|
|
4889
|
-
console.debug("
|
|
4890
|
-
const J =
|
|
4903
|
+
console.debug("Edit property", c, V, G, B, q, L), m?.("edit_property", { propertyKey: c, editedCollectionId: G });
|
|
4904
|
+
const J = c && c.includes(".") ? c.substring(0, c.lastIndexOf(".")) : void 0, le = c && c.includes(".") ? c.substring(c.lastIndexOf(".") + 1) : c;
|
|
4891
4905
|
w({
|
|
4892
4906
|
propertyKey: le,
|
|
4893
4907
|
property: V,
|
|
@@ -4898,20 +4912,20 @@ const Ht = (t, r, n, i) => {
|
|
|
4898
4912
|
collectionEditable: L?.editable ?? !1
|
|
4899
4913
|
});
|
|
4900
4914
|
}, []), D = Y.useCallback(({
|
|
4901
|
-
parentCollectionIds:
|
|
4915
|
+
parentCollectionIds: c,
|
|
4902
4916
|
parentCollection: V,
|
|
4903
4917
|
initialValues: G,
|
|
4904
4918
|
redirect: B,
|
|
4905
4919
|
sourceClick: q
|
|
4906
4920
|
}) => {
|
|
4907
|
-
console.debug("Create collection", { parentCollectionIds:
|
|
4921
|
+
console.debug("Create collection", { parentCollectionIds: c, parentCollection: V, initialValues: G, redirect: B, sourceClick: q }), m?.("create_collection", { parentCollectionIds: c, parentCollection: V, initialValues: G, redirect: B, sourceClick: q }), N({
|
|
4908
4922
|
isNewCollection: !0,
|
|
4909
|
-
parentCollectionIds:
|
|
4923
|
+
parentCollectionIds: c,
|
|
4910
4924
|
parentCollection: V,
|
|
4911
4925
|
initialValues: G,
|
|
4912
4926
|
redirect: B
|
|
4913
4927
|
});
|
|
4914
|
-
}, []), A = u ? (
|
|
4928
|
+
}, []), A = u ? (c) => !c && k ? Promise.resolve(k) : u?.(c) : void 0;
|
|
4915
4929
|
return /* @__PURE__ */ e(mr.Provider, { value: n, children: /* @__PURE__ */ a(
|
|
4916
4930
|
hr.Provider,
|
|
4917
4931
|
{
|
|
@@ -4920,7 +4934,7 @@ const Ht = (t, r, n, i) => {
|
|
|
4920
4934
|
createCollection: D,
|
|
4921
4935
|
editProperty: R,
|
|
4922
4936
|
configPermissions: i ?? _,
|
|
4923
|
-
rootPathSuggestions:
|
|
4937
|
+
rootPathSuggestions: k
|
|
4924
4938
|
},
|
|
4925
4939
|
children: [
|
|
4926
4940
|
r,
|
|
@@ -4937,10 +4951,10 @@ const Ht = (t, r, n, i) => {
|
|
|
4937
4951
|
extraView: d,
|
|
4938
4952
|
pathSuggestions: A,
|
|
4939
4953
|
getUser: p,
|
|
4940
|
-
handleClose: (
|
|
4941
|
-
if (C?.redirect &&
|
|
4942
|
-
const V =
|
|
4943
|
-
|
|
4954
|
+
handleClose: (c) => {
|
|
4955
|
+
if (C?.redirect && c && C?.isNewCollection && !C.parentCollectionIds.length) {
|
|
4956
|
+
const V = s.buildUrlCollectionPath(c.id ?? c.path);
|
|
4957
|
+
f(V);
|
|
4944
4958
|
}
|
|
4945
4959
|
N(void 0);
|
|
4946
4960
|
}
|
|
@@ -4949,32 +4963,32 @@ const Ht = (t, r, n, i) => {
|
|
|
4949
4963
|
/* @__PURE__ */ e(
|
|
4950
4964
|
Ve,
|
|
4951
4965
|
{
|
|
4952
|
-
open: !!
|
|
4966
|
+
open: !!g,
|
|
4953
4967
|
includeIdAndName: !0,
|
|
4954
|
-
existingProperty: !!
|
|
4955
|
-
autoUpdateId:
|
|
4956
|
-
autoOpenTypeSelect:
|
|
4968
|
+
existingProperty: !!g?.propertyKey,
|
|
4969
|
+
autoUpdateId: g ? !g?.propertyKey : !1,
|
|
4970
|
+
autoOpenTypeSelect: g ? !g?.propertyKey : !1,
|
|
4957
4971
|
inArray: !1,
|
|
4958
|
-
collectionEditable:
|
|
4959
|
-
getData: h &&
|
|
4960
|
-
console.debug("get data for property",
|
|
4961
|
-
const
|
|
4962
|
-
return h(
|
|
4972
|
+
collectionEditable: g?.collectionEditable ?? !1,
|
|
4973
|
+
getData: h && g?.editedCollectionId ? () => {
|
|
4974
|
+
console.debug("get data for property", g?.editedCollectionId);
|
|
4975
|
+
const c = s.resolveAliasesFrom(g.editedCollectionId);
|
|
4976
|
+
return h(c, []);
|
|
4963
4977
|
} : void 0,
|
|
4964
4978
|
onPropertyChanged: ({
|
|
4965
|
-
id:
|
|
4979
|
+
id: c,
|
|
4966
4980
|
property: V
|
|
4967
4981
|
}) => {
|
|
4968
|
-
if (!
|
|
4982
|
+
if (!g || !c)
|
|
4969
4983
|
return;
|
|
4970
|
-
const G = !
|
|
4984
|
+
const G = !g.propertyKey;
|
|
4971
4985
|
return n.saveProperty({
|
|
4972
|
-
path:
|
|
4986
|
+
path: g?.editedCollectionId,
|
|
4973
4987
|
property: V,
|
|
4974
|
-
propertyKey:
|
|
4975
|
-
newPropertiesOrder: G &&
|
|
4976
|
-
namespace:
|
|
4977
|
-
parentCollectionIds:
|
|
4988
|
+
propertyKey: c,
|
|
4989
|
+
newPropertiesOrder: G && g.currentPropertiesOrder ? [...g.currentPropertiesOrder, c] : void 0,
|
|
4990
|
+
namespace: g.namespace,
|
|
4991
|
+
parentCollectionIds: g.parentCollectionIds
|
|
4978
4992
|
}).catch((B) => (console.error(B), v.open({
|
|
4979
4993
|
type: "error",
|
|
4980
4994
|
message: "Error persisting property: " + (B.message ?? "Details in the console")
|
|
@@ -4982,15 +4996,15 @@ const Ht = (t, r, n, i) => {
|
|
|
4982
4996
|
},
|
|
4983
4997
|
onPropertyChangedImmediate: !1,
|
|
4984
4998
|
onDelete: () => {
|
|
4985
|
-
if (!
|
|
4999
|
+
if (!g?.propertyKey)
|
|
4986
5000
|
return;
|
|
4987
|
-
const
|
|
5001
|
+
const c = g?.currentPropertiesOrder?.filter((V) => V !== g?.propertyKey);
|
|
4988
5002
|
return n.deleteProperty({
|
|
4989
|
-
path:
|
|
4990
|
-
propertyKey:
|
|
4991
|
-
namespace:
|
|
4992
|
-
newPropertiesOrder:
|
|
4993
|
-
parentCollectionIds:
|
|
5003
|
+
path: g?.editedCollectionId,
|
|
5004
|
+
propertyKey: g?.propertyKey,
|
|
5005
|
+
namespace: g?.namespace,
|
|
5006
|
+
newPropertiesOrder: c,
|
|
5007
|
+
parentCollectionIds: g?.parentCollectionIds
|
|
4994
5008
|
}).then(() => {
|
|
4995
5009
|
w(void 0);
|
|
4996
5010
|
}).catch((V) => (console.error(V), v.open({
|
|
@@ -5011,8 +5025,8 @@ const Ht = (t, r, n, i) => {
|
|
|
5011
5025
|
existingPropertyKeys: [],
|
|
5012
5026
|
allowDataInference: !0,
|
|
5013
5027
|
propertyConfigs: x,
|
|
5014
|
-
property:
|
|
5015
|
-
propertyKey:
|
|
5028
|
+
property: g?.property,
|
|
5029
|
+
propertyKey: g?.propertyKey
|
|
5016
5030
|
}
|
|
5017
5031
|
)
|
|
5018
5032
|
]
|
|
@@ -5031,8 +5045,8 @@ function ln({
|
|
|
5031
5045
|
user: l.user,
|
|
5032
5046
|
collection: n
|
|
5033
5047
|
}).editCollections : !0;
|
|
5034
|
-
let
|
|
5035
|
-
return (!ve(at(i.filterValues), at(n.initialFilter)) || !ve(at(i.sortBy), at(n.initialSort))) && (
|
|
5048
|
+
let s = null;
|
|
5049
|
+
return (!ve(at(i.filterValues), at(n.initialFilter)) || !ve(at(i.sortBy), at(n.initialSort))) && (s = /* @__PURE__ */ a(j, { children: [
|
|
5036
5050
|
(n.initialFilter || n.initialSort) && /* @__PURE__ */ e(
|
|
5037
5051
|
te,
|
|
5038
5052
|
{
|
|
@@ -5082,8 +5096,8 @@ function ln({
|
|
|
5082
5096
|
)
|
|
5083
5097
|
}
|
|
5084
5098
|
)
|
|
5085
|
-
] })), /* @__PURE__ */ a(
|
|
5086
|
-
m &&
|
|
5099
|
+
] })), /* @__PURE__ */ a(j, { children: [
|
|
5100
|
+
m && s,
|
|
5087
5101
|
/* @__PURE__ */ e(
|
|
5088
5102
|
te,
|
|
5089
5103
|
{
|
|
@@ -5121,14 +5135,14 @@ function sn({
|
|
|
5121
5135
|
});
|
|
5122
5136
|
});
|
|
5123
5137
|
}, [t, l]);
|
|
5124
|
-
return /* @__PURE__ */ a(
|
|
5138
|
+
return /* @__PURE__ */ a(j, { children: [
|
|
5125
5139
|
/* @__PURE__ */ a("div", { children: [
|
|
5126
5140
|
d.deleteCollections && /* @__PURE__ */ e(
|
|
5127
5141
|
Zr,
|
|
5128
5142
|
{
|
|
5129
5143
|
trigger: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Jr, { size: "small" }) }),
|
|
5130
|
-
children: /* @__PURE__ */ a(Qr, { onClick: (
|
|
5131
|
-
|
|
5144
|
+
children: /* @__PURE__ */ a(Qr, { onClick: (s) => {
|
|
5145
|
+
s.preventDefault(), s.stopPropagation(), h(!0);
|
|
5132
5146
|
}, children: [
|
|
5133
5147
|
/* @__PURE__ */ e(dt, {}),
|
|
5134
5148
|
"Delete"
|
|
@@ -5138,7 +5152,7 @@ function sn({
|
|
|
5138
5152
|
d.editCollections && /* @__PURE__ */ e(
|
|
5139
5153
|
oe,
|
|
5140
5154
|
{
|
|
5141
|
-
onClick: (
|
|
5155
|
+
onClick: (s) => {
|
|
5142
5156
|
u();
|
|
5143
5157
|
},
|
|
5144
5158
|
children: /* @__PURE__ */ e(He, { size: "small" })
|
|
@@ -5151,8 +5165,8 @@ function sn({
|
|
|
5151
5165
|
open: p,
|
|
5152
5166
|
onAccept: m,
|
|
5153
5167
|
onCancel: () => h(!1),
|
|
5154
|
-
title: /* @__PURE__ */ e(
|
|
5155
|
-
body: /* @__PURE__ */ a(
|
|
5168
|
+
title: /* @__PURE__ */ e(j, { children: "Delete this collection?" }),
|
|
5169
|
+
body: /* @__PURE__ */ a(j, { children: [
|
|
5156
5170
|
" This will ",
|
|
5157
5171
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
5158
5172
|
", only the collection in the CMS"
|
|
@@ -5173,7 +5187,7 @@ function cn({
|
|
|
5173
5187
|
return /* @__PURE__ */ e(
|
|
5174
5188
|
tr,
|
|
5175
5189
|
{
|
|
5176
|
-
className:
|
|
5190
|
+
className: he("h-full p-4 min-h-[124px]"),
|
|
5177
5191
|
onClick: i && l ? () => i.createCollection({
|
|
5178
5192
|
initialValues: t ? { group: t } : void 0,
|
|
5179
5193
|
parentCollectionIds: [],
|
|
@@ -5185,7 +5199,7 @@ function cn({
|
|
|
5185
5199
|
{
|
|
5186
5200
|
className: "flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",
|
|
5187
5201
|
children: [
|
|
5188
|
-
/* @__PURE__ */ e(
|
|
5202
|
+
/* @__PURE__ */ e(se, { color: "primary", size: "large" }),
|
|
5189
5203
|
/* @__PURE__ */ e(
|
|
5190
5204
|
O,
|
|
5191
5205
|
{
|
|
@@ -5233,7 +5247,7 @@ function dn({ introMode: t }) {
|
|
|
5233
5247
|
(o ?? []).map((p) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
5234
5248
|
st,
|
|
5235
5249
|
{
|
|
5236
|
-
icon: /* @__PURE__ */ e(
|
|
5250
|
+
icon: /* @__PURE__ */ e(se, { size: "small" }),
|
|
5237
5251
|
colorScheme: "cyanLighter",
|
|
5238
5252
|
onClick: i && l ? () => i.createCollection({
|
|
5239
5253
|
initialValues: { path: p, name: ut(p) },
|
|
@@ -5304,7 +5318,7 @@ function pn({
|
|
|
5304
5318
|
collection: n
|
|
5305
5319
|
});
|
|
5306
5320
|
},
|
|
5307
|
-
children: /* @__PURE__ */ e(
|
|
5321
|
+
children: /* @__PURE__ */ e(se, { color: "inherit" })
|
|
5308
5322
|
}
|
|
5309
5323
|
) });
|
|
5310
5324
|
}
|
|
@@ -5321,7 +5335,7 @@ function mn() {
|
|
|
5321
5335
|
sourceClick: "new_collection_button"
|
|
5322
5336
|
}),
|
|
5323
5337
|
children: [
|
|
5324
|
-
/* @__PURE__ */ e(
|
|
5338
|
+
/* @__PURE__ */ e(se, {}),
|
|
5325
5339
|
"New collection"
|
|
5326
5340
|
]
|
|
5327
5341
|
}
|
|
@@ -5342,9 +5356,6 @@ function In({
|
|
|
5342
5356
|
return {
|
|
5343
5357
|
name: "Collection Editor",
|
|
5344
5358
|
loading: t.loading,
|
|
5345
|
-
collections: {
|
|
5346
|
-
CollectionActions: ln
|
|
5347
|
-
},
|
|
5348
5359
|
provider: {
|
|
5349
5360
|
Component: on,
|
|
5350
5361
|
props: {
|
|
@@ -5367,6 +5378,7 @@ function In({
|
|
|
5367
5378
|
AdditionalCards: r ? void 0 : cn
|
|
5368
5379
|
},
|
|
5369
5380
|
collectionView: {
|
|
5381
|
+
CollectionActions: ln,
|
|
5370
5382
|
HeaderAction: un,
|
|
5371
5383
|
AddColumnComponent: pn
|
|
5372
5384
|
}
|
|
@@ -5392,7 +5404,7 @@ function hn({ introMode: t }) {
|
|
|
5392
5404
|
sourceClick: "new_collection_card"
|
|
5393
5405
|
}) : void 0,
|
|
5394
5406
|
children: [
|
|
5395
|
-
/* @__PURE__ */ e(
|
|
5407
|
+
/* @__PURE__ */ e(se, {}),
|
|
5396
5408
|
"Create your first collection"
|
|
5397
5409
|
]
|
|
5398
5410
|
}
|
|
@@ -5431,7 +5443,7 @@ export {
|
|
|
5431
5443
|
qe as editableProperty,
|
|
5432
5444
|
ae as getFullId,
|
|
5433
5445
|
ir as getFullIdPath,
|
|
5434
|
-
|
|
5446
|
+
me as idToPropertiesPath,
|
|
5435
5447
|
ye as namespaceToPropertiesOrderPath,
|
|
5436
5448
|
bi as namespaceToPropertiesPath,
|
|
5437
5449
|
wi as removeNonEditableProperties,
|