@firecms/collection_editor 3.0.0-canary.38 → 3.0.0-canary.39
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 +759 -748
- 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/ui/EditorCollectionActionStart.d.ts +2 -0
- package/package.json +6 -6
- package/src/ui/EditorCollectionAction.tsx +0 -51
- package/src/ui/EditorCollectionActionStart.tsx +87 -0
- package/src/useCollectionEditorPlugin.tsx +2 -0
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as e, jsxs as a, Fragment as
|
|
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
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { FieldCaption as X, SearchIconsView as gr, toSnakeCase as Pt, singular as vr, IconForView as ot, ArrayContainer as yr, serializeRegExp as br, useSnackbarController as _e, resolveEnumValues as Cr, isPropertyBuilder as ne, useCustomizationController as Ae, getFieldConfig as $e, ErrorBoundary as me, PropertyConfigBadge as Ye, unslugify as ut, useNavigationController as Ne, mergeDeep as W, DEFAULT_FIELD_CONFIGS as Gt, isValidRegExp as Pr, getFieldId as Kt, DeleteConfirmationDialog as lt, useLargeLayout as Nr, makePropertiesEditable as pt, resolveEntityView as xr, useSelectionController as wr, EntityCollectionTable as Tr, slugify as kr, useAuthController as Te, randomString as _t, CircularProgressCenter as Nt, removeUndefined as Ft, ErrorView as Wt, removeInitialAndTrailingSlashes as Or, getDefaultPropertiesOrder as Vr } from "@firecms/core";
|
|
3
3
|
import * as je from "react";
|
|
4
4
|
import Y, { useState as $, useEffect as de, useMemo as Zt, useCallback as Q, useRef as Le, useDeferredValue as Ir, useContext as Jt } from "react";
|
|
5
|
-
import
|
|
6
|
-
import { useAutoComplete as _r, Container as mt, Typography as O, Tooltip as te, IconButton as oe, Chip as st, TextField as
|
|
5
|
+
import ye from "react-fast-compare";
|
|
6
|
+
import { useAutoComplete as _r, Container as mt, Typography as O, Tooltip as te, IconButton as oe, Chip as st, TextField as Ve, cn as fe, DebouncedTextField as Z, Autocomplete as Fr, AutocompleteItem as Sr, ExpandablePanel as xt, SettingsIcon as He, Select as Ce, SelectItem as ee, BooleanSwitchWithLabel as ct, Dialog as Fe, AutoAwesomeIcon as ht, Badge as Er, ListIcon as Ar, Button as z, CircularProgress as De, Paper as Pe, DialogContent as Be, DialogActions as ze, RuleIcon as Dr, FileUploadIcon as Br, MultiSelect as zr, MultiSelectItem as St, Checkbox as Et, cardMixin as Qt, cardClickableMixin as Xt, cardSelectedMixin as er, FunctionsIcon as Mr, RemoveCircleIcon as Rr, defaultBorderMixin as wt, RemoveIcon as Ur, DragHandleIcon as jr, AddIcon as se, SelectGroup as At, InfoLabel as Lr, DeleteIcon as dt, ContentCopyIcon as qr, CodeIcon as $r, Table as Dt, TableBody as Bt, TableRow as bt, TableCell as Ue, Alert as Yr, Icon as et, Card as tr, coolIconKeys as zt, Tabs as Hr, Tab as Ct, ArrowBackIcon as tt, LoadingButton as Mt, DoneIcon as Gr, Menu as Kr, MoreVertIcon as Wr, MenuItem as Zr, Collapse as Jr, SaveIcon as Qr, UndoIcon as Xr } from "@firecms/ui";
|
|
7
7
|
import * as rt from "yup";
|
|
8
8
|
import { useFormex as K, Field as H, getIn as I, useCreateFormex as Tt, Formex as kt } from "@firecms/formex";
|
|
9
9
|
import { extractEnumFromValues as ei, buildPropertyFromData as ti, buildEntityPropertiesFromData as ri } from "@firecms/schema_inference";
|
|
@@ -26,29 +26,29 @@ function yi({
|
|
|
26
26
|
parentCollection: o
|
|
27
27
|
}) {
|
|
28
28
|
const d = Y.useRef(null), {
|
|
29
|
-
values:
|
|
30
|
-
setFieldValue:
|
|
29
|
+
values: p,
|
|
30
|
+
setFieldValue: u,
|
|
31
31
|
handleChange: h,
|
|
32
32
|
touched: m,
|
|
33
|
-
errors:
|
|
34
|
-
setFieldTouched:
|
|
33
|
+
errors: c,
|
|
34
|
+
setFieldTouched: g,
|
|
35
35
|
isSubmitting: v,
|
|
36
36
|
submitCount: x
|
|
37
|
-
} = K(), [y, P] = $(!1), [k, b] = $(!1), C = (
|
|
38
|
-
|
|
37
|
+
} = K(), [y, P] = $(!1), [k, b] = $(!1), C = (s) => {
|
|
38
|
+
u("name", s), !I(m, "path") && t && s && u("path", Pt(s)), !I(m, "id") && t && s && u("id", Pt(s)), !I(m, "singularName") && t && s && u("singularName", vr(s));
|
|
39
39
|
};
|
|
40
40
|
de(() => {
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
const N = /* @__PURE__ */ e(ot, { collectionOrView:
|
|
41
|
+
c.id && b(!0);
|
|
42
|
+
}, [c.id]);
|
|
43
|
+
const N = /* @__PURE__ */ e(ot, { collectionOrView: p }), f = l?.filter((s) => !r?.includes(s)), {
|
|
44
44
|
inputFocused: w,
|
|
45
45
|
autoCompleteOpen: _,
|
|
46
46
|
setAutoCompleteOpen: M
|
|
47
47
|
} = _r({
|
|
48
48
|
ref: d
|
|
49
|
-
}),
|
|
49
|
+
}), U = !!o;
|
|
50
50
|
let D;
|
|
51
|
-
typeof
|
|
51
|
+
typeof p.customId == "object" ? D = "code_defined" : p.customId === !0 ? D = "true" : p.customId === !1 ? D = "false" : p.customId === "optional" && (D = "optional");
|
|
52
52
|
const A = x > 0;
|
|
53
53
|
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(mt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
54
54
|
/* @__PURE__ */ a("div", { children: [
|
|
@@ -57,7 +57,7 @@ function yi({
|
|
|
57
57
|
{
|
|
58
58
|
className: "flex flex-row py-2 pt-3 items-center",
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */ e(O, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${
|
|
60
|
+
/* @__PURE__ */ e(O, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${p?.name} collection` }),
|
|
61
61
|
/* @__PURE__ */ e(te, { title: "Change icon", children: /* @__PURE__ */ e(
|
|
62
62
|
oe,
|
|
63
63
|
{
|
|
@@ -77,18 +77,18 @@ function yi({
|
|
|
77
77
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-4", children: [
|
|
78
78
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
79
79
|
/* @__PURE__ */ e(
|
|
80
|
-
|
|
80
|
+
Ve,
|
|
81
81
|
{
|
|
82
|
-
value:
|
|
83
|
-
onChange: (
|
|
82
|
+
value: p.name ?? "",
|
|
83
|
+
onChange: (s) => C(s.target.value),
|
|
84
84
|
label: "Name",
|
|
85
85
|
required: !0,
|
|
86
|
-
error: A && !!
|
|
86
|
+
error: A && !!c.name
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
/* @__PURE__ */ e(X, { error: m.name && !!
|
|
89
|
+
/* @__PURE__ */ e(X, { error: m.name && !!c.name, children: m.name && c.name ? c.name : "Name of in this collection, usually a plural name (e.g. Products)" })
|
|
90
90
|
] }),
|
|
91
|
-
/* @__PURE__ */ a("div", { className: fe("col-span-12 ",
|
|
91
|
+
/* @__PURE__ */ a("div", { className: fe("col-span-12 ", U ? "" : "sm:col-span-8"), children: [
|
|
92
92
|
/* @__PURE__ */ e(
|
|
93
93
|
H,
|
|
94
94
|
{
|
|
@@ -97,20 +97,20 @@ function yi({
|
|
|
97
97
|
label: "Path",
|
|
98
98
|
disabled: !t,
|
|
99
99
|
required: !0,
|
|
100
|
-
error: A && !!
|
|
100
|
+
error: A && !!c.path
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
|
-
/* @__PURE__ */ e(X, { error: m.path && !!
|
|
103
|
+
/* @__PURE__ */ e(X, { error: m.path && !!c.path, children: m.path && c.path ? c.path : U ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database" })
|
|
104
104
|
] }),
|
|
105
|
-
!
|
|
105
|
+
!U && /* @__PURE__ */ a("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
106
106
|
/* @__PURE__ */ e(
|
|
107
|
-
|
|
107
|
+
Ve,
|
|
108
108
|
{
|
|
109
|
-
error: A && !!
|
|
109
|
+
error: A && !!c.group,
|
|
110
110
|
disabled: v,
|
|
111
|
-
value:
|
|
111
|
+
value: p.group ?? "",
|
|
112
112
|
autoComplete: "off",
|
|
113
|
-
onChange: (
|
|
113
|
+
onChange: (s) => u("group", s.target.value),
|
|
114
114
|
name: "group",
|
|
115
115
|
inputRef: d,
|
|
116
116
|
label: "Group"
|
|
@@ -119,21 +119,21 @@ function yi({
|
|
|
119
119
|
/* @__PURE__ */ e(
|
|
120
120
|
Fr,
|
|
121
121
|
{
|
|
122
|
-
open: _ && (
|
|
122
|
+
open: _ && (f ?? []).length > 0,
|
|
123
123
|
setOpen: M,
|
|
124
|
-
children:
|
|
124
|
+
children: f?.map((s, V) => /* @__PURE__ */ e(
|
|
125
125
|
Sr,
|
|
126
126
|
{
|
|
127
127
|
onClick: () => {
|
|
128
|
-
M(!1),
|
|
128
|
+
M(!1), u("group", s ?? null);
|
|
129
129
|
},
|
|
130
|
-
children: /* @__PURE__ */ e("div", { className: "flex-grow", children:
|
|
130
|
+
children: /* @__PURE__ */ e("div", { className: "flex-grow", children: s })
|
|
131
131
|
},
|
|
132
|
-
V + "_" +
|
|
132
|
+
V + "_" + s
|
|
133
133
|
))
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
|
-
/* @__PURE__ */ e(X, { children: A &&
|
|
136
|
+
/* @__PURE__ */ e(X, { children: A && c.group ? c.group : "Group of the collection" })
|
|
137
137
|
] }),
|
|
138
138
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
139
139
|
xt,
|
|
@@ -161,32 +161,32 @@ function yi({
|
|
|
161
161
|
as: Z,
|
|
162
162
|
disabled: !t,
|
|
163
163
|
label: "Collection id",
|
|
164
|
-
error: A && !!
|
|
164
|
+
error: A && !!c.id
|
|
165
165
|
}
|
|
166
166
|
),
|
|
167
|
-
/* @__PURE__ */ e(X, { error: m.id && !!
|
|
167
|
+
/* @__PURE__ */ e(X, { error: m.id && !!c.id, children: m.id && c.id ? c.id : "This id identifies this collection" })
|
|
168
168
|
] }),
|
|
169
169
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
170
170
|
/* @__PURE__ */ e(
|
|
171
|
-
|
|
171
|
+
Ve,
|
|
172
172
|
{
|
|
173
|
-
error: A && !!
|
|
173
|
+
error: A && !!c.singularName,
|
|
174
174
|
name: "singularName",
|
|
175
175
|
"aria-describedby": "singularName-helper",
|
|
176
|
-
onChange: (
|
|
177
|
-
value:
|
|
176
|
+
onChange: (s) => (g("singularName", !0), h(s)),
|
|
177
|
+
value: p.singularName ?? "",
|
|
178
178
|
label: "Singular name"
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
|
-
/* @__PURE__ */ e(X, { error: A && !!
|
|
181
|
+
/* @__PURE__ */ e(X, { error: A && !!c.singularName, children: A && c.singularName ? c.singularName : "Optionally define a singular name for your entities" })
|
|
182
182
|
] }),
|
|
183
183
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
184
184
|
/* @__PURE__ */ e(
|
|
185
|
-
|
|
185
|
+
Ve,
|
|
186
186
|
{
|
|
187
|
-
error: A && !!
|
|
187
|
+
error: A && !!c.description,
|
|
188
188
|
name: "description",
|
|
189
|
-
value:
|
|
189
|
+
value: p.description ?? "",
|
|
190
190
|
onChange: h,
|
|
191
191
|
multiline: !0,
|
|
192
192
|
rows: 2,
|
|
@@ -194,41 +194,41 @@ function yi({
|
|
|
194
194
|
label: "Description"
|
|
195
195
|
}
|
|
196
196
|
),
|
|
197
|
-
/* @__PURE__ */ e(X, { error: A && !!
|
|
197
|
+
/* @__PURE__ */ e(X, { error: A && !!c.description, children: A && c.description ? c.description : "Description of the collection, you can use markdown" })
|
|
198
198
|
] }),
|
|
199
199
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
200
|
-
|
|
200
|
+
Ce,
|
|
201
201
|
{
|
|
202
202
|
name: "defaultSize",
|
|
203
203
|
label: "Default row size",
|
|
204
204
|
position: "item-aligned",
|
|
205
205
|
onChange: h,
|
|
206
|
-
value:
|
|
207
|
-
renderValue: (
|
|
208
|
-
children: ["xs", "s", "m", "l", "xl"].map((
|
|
206
|
+
value: p.defaultSize ?? "",
|
|
207
|
+
renderValue: (s) => s.toUpperCase(),
|
|
208
|
+
children: ["xs", "s", "m", "l", "xl"].map((s) => /* @__PURE__ */ e(
|
|
209
209
|
ee,
|
|
210
210
|
{
|
|
211
|
-
value:
|
|
212
|
-
children:
|
|
211
|
+
value: s,
|
|
212
|
+
children: s.toUpperCase()
|
|
213
213
|
},
|
|
214
|
-
`size-select-${
|
|
214
|
+
`size-select-${s}`
|
|
215
215
|
))
|
|
216
216
|
}
|
|
217
217
|
) }),
|
|
218
218
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
219
|
-
|
|
219
|
+
Ce,
|
|
220
220
|
{
|
|
221
221
|
name: "customId",
|
|
222
222
|
label: "Data IDs generation",
|
|
223
223
|
position: "item-aligned",
|
|
224
224
|
disabled: D === "code_defined",
|
|
225
|
-
onValueChange: (
|
|
226
|
-
if (
|
|
225
|
+
onValueChange: (s) => {
|
|
226
|
+
if (s === "code_defined")
|
|
227
227
|
throw new Error("This should not happen");
|
|
228
|
-
|
|
228
|
+
s === "true" ? u("customId", !0) : s === "false" ? u("customId", !1) : s === "optional" && u("customId", "optional");
|
|
229
229
|
},
|
|
230
230
|
value: D ?? "",
|
|
231
|
-
renderValue: (
|
|
231
|
+
renderValue: (s) => s === "code_defined" ? "Code defined" : s === "true" ? "Users must define an ID" : s === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
|
|
232
232
|
children: [
|
|
233
233
|
/* @__PURE__ */ e(ee, { value: "false", children: "Document ID is generated automatically" }),
|
|
234
234
|
/* @__PURE__ */ e(ee, { value: "true", children: "Users must define an ID" }),
|
|
@@ -242,8 +242,8 @@ function yi({
|
|
|
242
242
|
{
|
|
243
243
|
position: "start",
|
|
244
244
|
label: "Collection group",
|
|
245
|
-
onValueChange: (
|
|
246
|
-
value:
|
|
245
|
+
onValueChange: (s) => u("collectionGroup", s),
|
|
246
|
+
value: p.collectionGroup ?? !1
|
|
247
247
|
}
|
|
248
248
|
),
|
|
249
249
|
/* @__PURE__ */ e(X, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." })
|
|
@@ -254,8 +254,8 @@ function yi({
|
|
|
254
254
|
{
|
|
255
255
|
position: "start",
|
|
256
256
|
label: "Enable text search for this collection",
|
|
257
|
-
onValueChange: (
|
|
258
|
-
value:
|
|
257
|
+
onValueChange: (s) => u("textSearchEnabled", s),
|
|
258
|
+
value: p.textSearchEnabled ?? !1
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
261
|
/* @__PURE__ */ e(X, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." })
|
|
@@ -275,9 +275,9 @@ function yi({
|
|
|
275
275
|
children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
|
|
276
276
|
gr,
|
|
277
277
|
{
|
|
278
|
-
selectedIcon:
|
|
279
|
-
onIconSelected: (
|
|
280
|
-
P(!1),
|
|
278
|
+
selectedIcon: p.icon,
|
|
279
|
+
onIconSelected: (s) => {
|
|
280
|
+
P(!1), u("icon", s);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
) })
|
|
@@ -291,7 +291,7 @@ function he(t) {
|
|
|
291
291
|
function bi(t) {
|
|
292
292
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function be(t) {
|
|
295
295
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
|
|
296
296
|
}
|
|
297
297
|
function ae(t, r) {
|
|
@@ -310,25 +310,25 @@ function Ci({
|
|
|
310
310
|
allowDataInference: o,
|
|
311
311
|
getData: d
|
|
312
312
|
}) {
|
|
313
|
-
const
|
|
313
|
+
const p = Tt({
|
|
314
314
|
initialValues: { enumValues: t },
|
|
315
315
|
validateOnChange: !0,
|
|
316
316
|
validation: (m) => {
|
|
317
|
-
const
|
|
317
|
+
const c = {};
|
|
318
318
|
m.enumValues && m.enumValues.forEach((v, x) => {
|
|
319
|
-
v?.label || (
|
|
319
|
+
v?.label || (c.enumValues = c.enumValues ?? [], c.enumValues[x] = c.enumValues[x] ?? {}, c.enumValues[x].label = "You must specify a label for this enum value entry"), v?.id || (c.enumValues = c.enumValues ?? [], c.enumValues[x] = c.enumValues[x] ?? {}, c.enumValues[x].id = "You must specify an ID for this enum value entry");
|
|
320
320
|
});
|
|
321
|
-
const
|
|
322
|
-
return n?.(
|
|
321
|
+
const g = !!(c?.enumValues && Object.keys(c?.enumValues).length > 0);
|
|
322
|
+
return n?.(g), c;
|
|
323
323
|
}
|
|
324
|
-
}), { values:
|
|
324
|
+
}), { values: u, errors: h } = p;
|
|
325
325
|
return de(() => {
|
|
326
|
-
r && r(
|
|
327
|
-
}, [
|
|
326
|
+
r && r(u.enumValues);
|
|
327
|
+
}, [u.enumValues]), /* @__PURE__ */ e(kt, { value: p, children: /* @__PURE__ */ e(
|
|
328
328
|
Pi,
|
|
329
329
|
{
|
|
330
330
|
enumValuesPath: "enumValues",
|
|
331
|
-
values:
|
|
331
|
+
values: u,
|
|
332
332
|
errors: h,
|
|
333
333
|
shouldUpdateId: i,
|
|
334
334
|
disabled: l,
|
|
@@ -347,9 +347,9 @@ function Pi({
|
|
|
347
347
|
getData: d
|
|
348
348
|
}) {
|
|
349
349
|
const {
|
|
350
|
-
setFieldValue:
|
|
351
|
-
} = K(), [
|
|
352
|
-
const N =
|
|
350
|
+
setFieldValue: p
|
|
351
|
+
} = K(), [u, h] = Y.useState(), [m, c] = Y.useState(), [g, v] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, P = (b, C) => {
|
|
352
|
+
const N = u === C, f = r?.enumValues && r?.enumValues[b];
|
|
353
353
|
return /* @__PURE__ */ e(
|
|
354
354
|
Ni,
|
|
355
355
|
{
|
|
@@ -357,9 +357,9 @@ function Pi({
|
|
|
357
357
|
disabled: n,
|
|
358
358
|
enumValuesPath: i,
|
|
359
359
|
autoFocus: N,
|
|
360
|
-
entryError:
|
|
360
|
+
entryError: f,
|
|
361
361
|
shouldUpdateId: l || N,
|
|
362
|
-
onDialogOpen: () =>
|
|
362
|
+
onDialogOpen: () => c(b),
|
|
363
363
|
inferredEntry: y.has(t.enumValues[b]?.id)
|
|
364
364
|
},
|
|
365
365
|
`${C}`
|
|
@@ -379,30 +379,30 @@ function Pi({
|
|
|
379
379
|
o && /* @__PURE__ */ a(
|
|
380
380
|
z,
|
|
381
381
|
{
|
|
382
|
-
loading:
|
|
383
|
-
disabled: n ||
|
|
382
|
+
loading: g,
|
|
383
|
+
disabled: n || g,
|
|
384
384
|
variant: "text",
|
|
385
385
|
size: "small",
|
|
386
386
|
onClick: async () => {
|
|
387
387
|
d && (v(!0), d?.().then((b) => {
|
|
388
388
|
if (!b)
|
|
389
389
|
return;
|
|
390
|
-
const C = b.flat(), N = Array.from(new Set(C)),
|
|
390
|
+
const C = b.flat(), N = Array.from(new Set(C)), f = t.enumValues, _ = ei(N).filter((M) => !f?.some((U) => U.id === M.id));
|
|
391
391
|
_.forEach((M) => {
|
|
392
392
|
y.add(M.id);
|
|
393
|
-
}),
|
|
393
|
+
}), p(i, [..._, ...f], !0);
|
|
394
394
|
}).catch((b) => {
|
|
395
395
|
console.error(b);
|
|
396
396
|
}).finally(() => v(!1)));
|
|
397
397
|
},
|
|
398
398
|
children: [
|
|
399
|
-
|
|
399
|
+
g ? /* @__PURE__ */ e(De, { size: "small" }) : /* @__PURE__ */ e(ht, {}),
|
|
400
400
|
"Infer values from data"
|
|
401
401
|
]
|
|
402
402
|
}
|
|
403
403
|
)
|
|
404
404
|
] }),
|
|
405
|
-
/* @__PURE__ */ a(
|
|
405
|
+
/* @__PURE__ */ a(Pe, { className: "p-4 m-1", children: [
|
|
406
406
|
/* @__PURE__ */ e(
|
|
407
407
|
yr,
|
|
408
408
|
{
|
|
@@ -414,7 +414,7 @@ function Pi({
|
|
|
414
414
|
buildEntry: P,
|
|
415
415
|
onInternalIdAdded: h,
|
|
416
416
|
includeAddButton: !0,
|
|
417
|
-
onValueChange: (b) =>
|
|
417
|
+
onValueChange: (b) => p(i, b),
|
|
418
418
|
newDefaultEntry: { id: "", label: "" }
|
|
419
419
|
}
|
|
420
420
|
),
|
|
@@ -424,7 +424,7 @@ function Pi({
|
|
|
424
424
|
index: m,
|
|
425
425
|
open: m !== void 0,
|
|
426
426
|
enumValuesPath: i,
|
|
427
|
-
onClose: () =>
|
|
427
|
+
onClose: () => c(void 0)
|
|
428
428
|
}
|
|
429
429
|
)
|
|
430
430
|
] })
|
|
@@ -438,19 +438,19 @@ const Ni = Y.memo(
|
|
|
438
438
|
autoFocus: l,
|
|
439
439
|
onDialogOpen: o,
|
|
440
440
|
disabled: d,
|
|
441
|
-
inferredEntry:
|
|
442
|
-
entryError:
|
|
441
|
+
inferredEntry: p,
|
|
442
|
+
entryError: u
|
|
443
443
|
}) {
|
|
444
444
|
const {
|
|
445
445
|
values: h,
|
|
446
446
|
handleChange: m,
|
|
447
|
-
errors:
|
|
448
|
-
setFieldValue:
|
|
447
|
+
errors: c,
|
|
448
|
+
setFieldValue: g,
|
|
449
449
|
touched: v
|
|
450
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);
|
|
451
451
|
return Y.useEffect(() => {
|
|
452
|
-
(b.current === P || !P) && y &&
|
|
453
|
-
}, [k]), /* @__PURE__ */ a(
|
|
452
|
+
(b.current === P || !P) && y && g(`${i}[${r}].id`, k), b.current = k;
|
|
453
|
+
}, [k]), /* @__PURE__ */ a(R, { children: [
|
|
454
454
|
/* @__PURE__ */ a("div", { className: "flex w-full align-center justify-center", children: [
|
|
455
455
|
/* @__PURE__ */ e(
|
|
456
456
|
H,
|
|
@@ -463,11 +463,11 @@ const Ni = Y.memo(
|
|
|
463
463
|
size: "small",
|
|
464
464
|
autoFocus: l,
|
|
465
465
|
autoComplete: "off",
|
|
466
|
-
endAdornment:
|
|
467
|
-
error: !!
|
|
466
|
+
endAdornment: p && /* @__PURE__ */ e(ht, { size: "small" }),
|
|
467
|
+
error: !!u?.label
|
|
468
468
|
}
|
|
469
469
|
),
|
|
470
|
-
!d && /* @__PURE__ */ e(Er, { color: "error", invisible: !
|
|
470
|
+
!d && /* @__PURE__ */ e(Er, { color: "error", invisible: !u?.id, children: /* @__PURE__ */ e(
|
|
471
471
|
oe,
|
|
472
472
|
{
|
|
473
473
|
size: "small",
|
|
@@ -478,26 +478,26 @@ const Ni = Y.memo(
|
|
|
478
478
|
}
|
|
479
479
|
) })
|
|
480
480
|
] }),
|
|
481
|
-
|
|
481
|
+
u?.label && /* @__PURE__ */ e(
|
|
482
482
|
O,
|
|
483
483
|
{
|
|
484
484
|
variant: "caption",
|
|
485
485
|
className: "ml-3.5 text-red-500 dark:text-red-500",
|
|
486
|
-
children:
|
|
486
|
+
children: u?.label
|
|
487
487
|
}
|
|
488
488
|
),
|
|
489
|
-
|
|
489
|
+
u?.id && /* @__PURE__ */ e(
|
|
490
490
|
O,
|
|
491
491
|
{
|
|
492
492
|
variant: "caption",
|
|
493
493
|
className: "ml-3.5 text-red-500 dark:text-red-500",
|
|
494
|
-
children:
|
|
494
|
+
children: u?.id
|
|
495
495
|
}
|
|
496
496
|
)
|
|
497
497
|
] });
|
|
498
498
|
},
|
|
499
499
|
function(r, n) {
|
|
500
|
-
return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry &&
|
|
500
|
+
return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry && ye(r.entryError, n.entryError) && r.autoFocus === n.autoFocus;
|
|
501
501
|
}
|
|
502
502
|
);
|
|
503
503
|
function xi({
|
|
@@ -555,7 +555,7 @@ function ce({
|
|
|
555
555
|
size: o = "small",
|
|
556
556
|
allowIndeterminate: d
|
|
557
557
|
}) {
|
|
558
|
-
const
|
|
558
|
+
const p = /* @__PURE__ */ e(
|
|
559
559
|
ct,
|
|
560
560
|
{
|
|
561
561
|
label: n,
|
|
@@ -564,32 +564,32 @@ function ce({
|
|
|
564
564
|
value: t.value,
|
|
565
565
|
disabled: l,
|
|
566
566
|
allowIndeterminate: d,
|
|
567
|
-
onValueChange: (
|
|
567
|
+
onValueChange: (u) => r.setFieldValue(t.name, u)
|
|
568
568
|
}
|
|
569
569
|
);
|
|
570
570
|
return i ? /* @__PURE__ */ e(
|
|
571
571
|
te,
|
|
572
572
|
{
|
|
573
573
|
title: i,
|
|
574
|
-
children:
|
|
574
|
+
children: p
|
|
575
575
|
}
|
|
576
|
-
) :
|
|
576
|
+
) : p;
|
|
577
577
|
}
|
|
578
578
|
function Se({ disabled: t }) {
|
|
579
579
|
const { values: r, handleChange: n } = K(), i = "validation.required", l = "validation.requiredMessage";
|
|
580
|
-
return /* @__PURE__ */ a(
|
|
580
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
581
581
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
582
582
|
H,
|
|
583
583
|
{
|
|
584
584
|
name: i,
|
|
585
585
|
type: "checkbox",
|
|
586
|
-
children: ({ field: d, form:
|
|
586
|
+
children: ({ field: d, form: p }) => /* @__PURE__ */ e(
|
|
587
587
|
ce,
|
|
588
588
|
{
|
|
589
589
|
disabled: t,
|
|
590
590
|
label: "Required",
|
|
591
591
|
tooltip: "You won't be able to save this entity if this value is not set",
|
|
592
|
-
form:
|
|
592
|
+
form: p,
|
|
593
593
|
field: d
|
|
594
594
|
}
|
|
595
595
|
)
|
|
@@ -600,13 +600,13 @@ function Se({ disabled: t }) {
|
|
|
600
600
|
{
|
|
601
601
|
name: "validation.unique",
|
|
602
602
|
type: "checkbox",
|
|
603
|
-
children: ({ field: d, form:
|
|
603
|
+
children: ({ field: d, form: p }) => /* @__PURE__ */ e(
|
|
604
604
|
ce,
|
|
605
605
|
{
|
|
606
606
|
disabled: t,
|
|
607
607
|
label: "Unique",
|
|
608
608
|
tooltip: "There cannot be multiple entities with the same value",
|
|
609
|
-
form:
|
|
609
|
+
form: p,
|
|
610
610
|
field: d
|
|
611
611
|
}
|
|
612
612
|
)
|
|
@@ -633,16 +633,16 @@ function Ee({
|
|
|
633
633
|
min: l,
|
|
634
634
|
trim: o,
|
|
635
635
|
uppercase: d,
|
|
636
|
-
disabled:
|
|
637
|
-
showErrors:
|
|
636
|
+
disabled: p,
|
|
637
|
+
showErrors: u
|
|
638
638
|
}) {
|
|
639
639
|
const {
|
|
640
640
|
values: h,
|
|
641
641
|
handleChange: m,
|
|
642
|
-
errors:
|
|
643
|
-
} = K(),
|
|
642
|
+
errors: c
|
|
643
|
+
} = K(), g = "validation.length", v = "validation.min", x = "validation.max", y = "validation.trim", P = "validation.matches", k = "validation.lowercase", b = "validation.uppercase", C = I(c, P), N = I(h, P), f = typeof N == "string" ? N : br(N);
|
|
644
644
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
645
|
-
/* @__PURE__ */ e(Se, { disabled:
|
|
645
|
+
/* @__PURE__ */ e(Se, { disabled: p }),
|
|
646
646
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
647
647
|
r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
648
648
|
H,
|
|
@@ -653,7 +653,7 @@ function Ee({
|
|
|
653
653
|
ce,
|
|
654
654
|
{
|
|
655
655
|
label: "Lowercase",
|
|
656
|
-
disabled:
|
|
656
|
+
disabled: p,
|
|
657
657
|
form: _,
|
|
658
658
|
field: w
|
|
659
659
|
}
|
|
@@ -669,7 +669,7 @@ function Ee({
|
|
|
669
669
|
ce,
|
|
670
670
|
{
|
|
671
671
|
label: "Uppercase",
|
|
672
|
-
disabled:
|
|
672
|
+
disabled: p,
|
|
673
673
|
form: _,
|
|
674
674
|
field: w
|
|
675
675
|
}
|
|
@@ -685,7 +685,7 @@ function Ee({
|
|
|
685
685
|
ce,
|
|
686
686
|
{
|
|
687
687
|
label: "Trim",
|
|
688
|
-
disabled:
|
|
688
|
+
disabled: p,
|
|
689
689
|
form: _,
|
|
690
690
|
field: w
|
|
691
691
|
}
|
|
@@ -697,12 +697,12 @@ function Ee({
|
|
|
697
697
|
t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
698
698
|
Z,
|
|
699
699
|
{
|
|
700
|
-
value: I(h,
|
|
700
|
+
value: I(h, g),
|
|
701
701
|
label: "Exact length",
|
|
702
|
-
name:
|
|
702
|
+
name: g,
|
|
703
703
|
type: "number",
|
|
704
704
|
size: "small",
|
|
705
|
-
disabled:
|
|
705
|
+
disabled: p,
|
|
706
706
|
onChange: m
|
|
707
707
|
}
|
|
708
708
|
) }),
|
|
@@ -714,7 +714,7 @@ function Ee({
|
|
|
714
714
|
name: v,
|
|
715
715
|
type: "number",
|
|
716
716
|
size: "small",
|
|
717
|
-
disabled:
|
|
717
|
+
disabled: p,
|
|
718
718
|
onChange: m
|
|
719
719
|
}
|
|
720
720
|
) }),
|
|
@@ -726,7 +726,7 @@ function Ee({
|
|
|
726
726
|
name: x,
|
|
727
727
|
type: "number",
|
|
728
728
|
size: "small",
|
|
729
|
-
disabled:
|
|
729
|
+
disabled: p,
|
|
730
730
|
onChange: m
|
|
731
731
|
}
|
|
732
732
|
) })
|
|
@@ -739,8 +739,8 @@ function Ee({
|
|
|
739
739
|
as: Z,
|
|
740
740
|
label: "Matches regex",
|
|
741
741
|
size: "small",
|
|
742
|
-
disabled:
|
|
743
|
-
value:
|
|
742
|
+
disabled: p,
|
|
743
|
+
value: f,
|
|
744
744
|
error: !!C
|
|
745
745
|
}
|
|
746
746
|
),
|
|
@@ -785,7 +785,7 @@ function Ot({
|
|
|
785
785
|
) })
|
|
786
786
|
] });
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function xe({
|
|
789
789
|
children: t
|
|
790
790
|
}) {
|
|
791
791
|
return /* @__PURE__ */ e(
|
|
@@ -819,10 +819,10 @@ function Rt({
|
|
|
819
819
|
}) {
|
|
820
820
|
const {
|
|
821
821
|
values: d,
|
|
822
|
-
setFieldError:
|
|
823
|
-
setFieldValue:
|
|
824
|
-
} = K(), h =
|
|
825
|
-
return /* @__PURE__ */ a(
|
|
822
|
+
setFieldError: p,
|
|
823
|
+
setFieldValue: u
|
|
824
|
+
} = K(), h = _e(), m = t ? "of.enumValues" : "enumValues", c = I(d, "defaultValue"), g = I(d, m), v = Zt(() => !g || typeof g == "boolean" ? [] : Cr(g) ?? [], [g]);
|
|
825
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
826
826
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
827
827
|
Ci,
|
|
828
828
|
{
|
|
@@ -831,13 +831,13 @@ function Rt({
|
|
|
831
831
|
disabled: n,
|
|
832
832
|
allowDataInference: l,
|
|
833
833
|
onError: (y) => {
|
|
834
|
-
|
|
834
|
+
p(m, y ? "This enum property is missing some values" : void 0);
|
|
835
835
|
},
|
|
836
836
|
getData: o ? () => o().then((y) => y.map((P) => d.id && I(P, d.id)).filter(Boolean)) : void 0,
|
|
837
837
|
onValuesChanged: (y) => {
|
|
838
|
-
if (d && (
|
|
838
|
+
if (d && (u(m, y), !t)) {
|
|
839
839
|
const P = y.filter((k) => !!k?.id).map((k) => k.id);
|
|
840
|
-
|
|
840
|
+
c && !P.includes(c) && (u("defaultValue", void 0), h.open({
|
|
841
841
|
type: "warning",
|
|
842
842
|
message: "Default value was cleared"
|
|
843
843
|
}));
|
|
@@ -845,7 +845,7 @@ function Rt({
|
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
847
|
) }),
|
|
848
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
848
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
|
|
849
849
|
!t && /* @__PURE__ */ e(
|
|
850
850
|
Ee,
|
|
851
851
|
{
|
|
@@ -856,15 +856,15 @@ function Rt({
|
|
|
856
856
|
t && /* @__PURE__ */ e(Ot, { disabled: n })
|
|
857
857
|
] }) }),
|
|
858
858
|
!t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
859
|
-
|
|
859
|
+
Ce,
|
|
860
860
|
{
|
|
861
861
|
disabled: n,
|
|
862
862
|
position: "item-aligned",
|
|
863
863
|
onValueChange: (y) => {
|
|
864
|
-
|
|
864
|
+
u("defaultValue", y);
|
|
865
865
|
},
|
|
866
866
|
label: "Default value",
|
|
867
|
-
value:
|
|
867
|
+
value: c ?? "",
|
|
868
868
|
children: v.filter((y) => !!y?.id).map((y) => /* @__PURE__ */ e(
|
|
869
869
|
ee,
|
|
870
870
|
{
|
|
@@ -892,10 +892,10 @@ function Ut({
|
|
|
892
892
|
const {
|
|
893
893
|
values: i,
|
|
894
894
|
setFieldValue: l
|
|
895
|
-
} = K(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`,
|
|
895
|
+
} = K(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, p = `${o}.fileName`, u = `${o}.storagePath`, h = `${o}.storeUrl`, m = I(i, p) ?? "{rand}_{file}", c = I(i, u) ?? "/", g = I(i, d), v = Array.isArray(g) ? g : void 0, x = !v || v.length === 0, y = (b) => {
|
|
896
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);
|
|
897
|
-
}, P = typeof m == "function", k = typeof
|
|
898
|
-
return /* @__PURE__ */ a(
|
|
897
|
+
}, P = typeof m == "function", k = typeof c == "function";
|
|
898
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
899
899
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
900
900
|
xt,
|
|
901
901
|
{
|
|
@@ -954,7 +954,7 @@ function Ut({
|
|
|
954
954
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
955
955
|
H,
|
|
956
956
|
{
|
|
957
|
-
name:
|
|
957
|
+
name: p,
|
|
958
958
|
as: Z,
|
|
959
959
|
label: "File name",
|
|
960
960
|
size: "small",
|
|
@@ -966,12 +966,12 @@ function Ut({
|
|
|
966
966
|
/* @__PURE__ */ e(
|
|
967
967
|
H,
|
|
968
968
|
{
|
|
969
|
-
name:
|
|
969
|
+
name: u,
|
|
970
970
|
as: Z,
|
|
971
971
|
label: "Storage path",
|
|
972
972
|
disabled: k || n,
|
|
973
973
|
size: "small",
|
|
974
|
-
value: k ? "-" :
|
|
974
|
+
value: k ? "-" : c
|
|
975
975
|
}
|
|
976
976
|
),
|
|
977
977
|
/* @__PURE__ */ a(O, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
|
|
@@ -1007,7 +1007,7 @@ function Ut({
|
|
|
1007
1007
|
] })
|
|
1008
1008
|
}
|
|
1009
1009
|
) }),
|
|
1010
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
1010
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
|
|
1011
1011
|
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Se, { disabled: n }) }),
|
|
1012
1012
|
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ot, { disabled: n }) })
|
|
1013
1013
|
] }) })
|
|
@@ -1041,18 +1041,18 @@ function nr({
|
|
|
1041
1041
|
includeEditButton: l,
|
|
1042
1042
|
selected: o
|
|
1043
1043
|
}) {
|
|
1044
|
-
const { propertyConfigs: d } = Ae(),
|
|
1044
|
+
const { propertyConfigs: d } = Ae(), p = $e(t, d);
|
|
1045
1045
|
qe(t);
|
|
1046
|
-
const
|
|
1046
|
+
const u = n ? "border-red-500 dark:border-red-500 border-opacity-100 dark:border-opacity-100 ring-0 dark:ring-0" : o ? "border-primary" : "border-transparent";
|
|
1047
1047
|
return n && console.log("PropertyFieldPreview", t), /* @__PURE__ */ e(me, { children: /* @__PURE__ */ a(
|
|
1048
1048
|
"div",
|
|
1049
1049
|
{
|
|
1050
1050
|
onClick: r,
|
|
1051
1051
|
className: "flex flex-row w-full cursor-pointer",
|
|
1052
1052
|
children: [
|
|
1053
|
-
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ye, { propertyConfig:
|
|
1053
|
+
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ye, { propertyConfig: p }) }),
|
|
1054
1054
|
/* @__PURE__ */ a(
|
|
1055
|
-
|
|
1055
|
+
Pe,
|
|
1056
1056
|
{
|
|
1057
1057
|
className: fe(
|
|
1058
1058
|
"border",
|
|
@@ -1061,7 +1061,7 @@ function nr({
|
|
|
1061
1061
|
r ? Xt : "",
|
|
1062
1062
|
o ? er : "",
|
|
1063
1063
|
"flex-grow p-4 border transition-colors duration-200",
|
|
1064
|
-
|
|
1064
|
+
u
|
|
1065
1065
|
),
|
|
1066
1066
|
children: [
|
|
1067
1067
|
/* @__PURE__ */ a("div", { className: "w-full flex flex-col", children: [
|
|
@@ -1082,7 +1082,7 @@ function nr({
|
|
|
1082
1082
|
variant: i ? "body2" : "subtitle1",
|
|
1083
1083
|
component: "span",
|
|
1084
1084
|
color: "secondary",
|
|
1085
|
-
children:
|
|
1085
|
+
children: p?.name
|
|
1086
1086
|
}
|
|
1087
1087
|
) }),
|
|
1088
1088
|
/* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
@@ -1129,7 +1129,7 @@ function Ti({
|
|
|
1129
1129
|
/* @__PURE__ */ e(Rr, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
|
|
1130
1130
|
] }),
|
|
1131
1131
|
/* @__PURE__ */ e(
|
|
1132
|
-
|
|
1132
|
+
Pe,
|
|
1133
1133
|
{
|
|
1134
1134
|
className: fe(
|
|
1135
1135
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
@@ -1203,20 +1203,20 @@ const ft = Y.memo(
|
|
|
1203
1203
|
properties: l,
|
|
1204
1204
|
propertiesOrder: o,
|
|
1205
1205
|
additionalFields: d,
|
|
1206
|
-
errors:
|
|
1207
|
-
onPropertyMove:
|
|
1206
|
+
errors: p,
|
|
1207
|
+
onPropertyMove: u,
|
|
1208
1208
|
onPropertyRemove: h,
|
|
1209
1209
|
className: m,
|
|
1210
|
-
inferredPropertyKeys:
|
|
1211
|
-
collectionEditable:
|
|
1210
|
+
inferredPropertyKeys: c,
|
|
1211
|
+
collectionEditable: g
|
|
1212
1212
|
}) {
|
|
1213
1213
|
const v = o ?? Object.keys(l), x = Q((y) => {
|
|
1214
1214
|
if (!y.destination)
|
|
1215
1215
|
return;
|
|
1216
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),
|
|
1218
|
-
}, [r,
|
|
1219
|
-
return /* @__PURE__ */ e(
|
|
1217
|
+
b.splice(k, 0, C), u && u(b, r);
|
|
1218
|
+
}, [r, u, v]);
|
|
1219
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ii, { onDragEnd: x, children: /* @__PURE__ */ e(ni, { droppableId: `droppable_${r}`, children: (y, P) => /* @__PURE__ */ a(
|
|
1220
1220
|
"div",
|
|
1221
1221
|
{
|
|
1222
1222
|
...y.droppableProps,
|
|
@@ -1224,27 +1224,27 @@ const ft = Y.memo(
|
|
|
1224
1224
|
className: m,
|
|
1225
1225
|
children: [
|
|
1226
1226
|
v && v.map((k, b) => {
|
|
1227
|
-
const C = l[k], N = d?.find((
|
|
1227
|
+
const C = l[k], N = d?.find((f) => f.key === k);
|
|
1228
1228
|
return !C && !N ? (console.warn(`Property ${k} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
|
|
1229
1229
|
ai,
|
|
1230
1230
|
{
|
|
1231
1231
|
draggableId: `array_field_${r}_${k}}`,
|
|
1232
1232
|
index: b,
|
|
1233
|
-
children: (
|
|
1233
|
+
children: (f, w) => /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
1234
1234
|
ki,
|
|
1235
1235
|
{
|
|
1236
1236
|
propertyKey: k,
|
|
1237
1237
|
propertyOrBuilder: C,
|
|
1238
1238
|
additionalField: N,
|
|
1239
|
-
provided:
|
|
1240
|
-
errors:
|
|
1239
|
+
provided: f,
|
|
1240
|
+
errors: p,
|
|
1241
1241
|
namespace: r,
|
|
1242
|
-
inferredPropertyKeys:
|
|
1243
|
-
onPropertyMove:
|
|
1242
|
+
inferredPropertyKeys: c,
|
|
1243
|
+
onPropertyMove: u,
|
|
1244
1244
|
onPropertyRemove: h,
|
|
1245
1245
|
onPropertyClick: w.isDragging ? void 0 : i,
|
|
1246
1246
|
selectedPropertyKey: n,
|
|
1247
|
-
collectionEditable:
|
|
1247
|
+
collectionEditable: g
|
|
1248
1248
|
}
|
|
1249
1249
|
) })
|
|
1250
1250
|
},
|
|
@@ -1258,7 +1258,7 @@ const ft = Y.memo(
|
|
|
1258
1258
|
},
|
|
1259
1259
|
(t, r) => {
|
|
1260
1260
|
const n = r.selectedPropertyKey?.startsWith(r.namespace ?? ""), i = t.selectedPropertyKey?.startsWith(t.namespace ?? "");
|
|
1261
|
-
return n || i ? !1 :
|
|
1261
|
+
return n || i ? !1 : ye(t.properties, r.properties) && t.propertiesOrder === r.propertiesOrder && ye(t.additionalFields, r.additionalFields) && ye(t.errors, r.errors) && ye(t.onPropertyClick, r.onPropertyClick) && // equal(prevProps.onPropertyMove, nextProps.onPropertyMove) &&
|
|
1262
1262
|
// equal(prevProps.onPropertyRemove, nextProps.onPropertyRemove) &&
|
|
1263
1263
|
t.namespace === r.namespace && t.collectionEditable === r.collectionEditable;
|
|
1264
1264
|
}
|
|
@@ -1271,13 +1271,13 @@ function ki({
|
|
|
1271
1271
|
provided: l,
|
|
1272
1272
|
selectedPropertyKey: o,
|
|
1273
1273
|
errors: d,
|
|
1274
|
-
onPropertyClick:
|
|
1275
|
-
onPropertyMove:
|
|
1274
|
+
onPropertyClick: p,
|
|
1275
|
+
onPropertyMove: u,
|
|
1276
1276
|
onPropertyRemove: h,
|
|
1277
1277
|
inferredPropertyKeys: m,
|
|
1278
|
-
collectionEditable:
|
|
1278
|
+
collectionEditable: c
|
|
1279
1279
|
}) {
|
|
1280
|
-
const
|
|
1280
|
+
const g = m?.includes(r ? `${r}.${t}` : t), v = ae(t, r), y = ir(t, r) in d;
|
|
1281
1281
|
let P;
|
|
1282
1282
|
if (typeof n == "object") {
|
|
1283
1283
|
const C = n;
|
|
@@ -1289,14 +1289,14 @@ function ki({
|
|
|
1289
1289
|
properties: C.properties,
|
|
1290
1290
|
propertiesOrder: C.propertiesOrder,
|
|
1291
1291
|
errors: d,
|
|
1292
|
-
onPropertyClick:
|
|
1293
|
-
onPropertyMove:
|
|
1292
|
+
onPropertyClick: p,
|
|
1293
|
+
onPropertyMove: u,
|
|
1294
1294
|
onPropertyRemove: h,
|
|
1295
|
-
collectionEditable:
|
|
1295
|
+
collectionEditable: c
|
|
1296
1296
|
}
|
|
1297
1297
|
));
|
|
1298
1298
|
}
|
|
1299
|
-
const k = o === v, b = n && (
|
|
1299
|
+
const k = o === v, b = n && (c && !ne(n) || qe(n));
|
|
1300
1300
|
return /* @__PURE__ */ a(
|
|
1301
1301
|
"div",
|
|
1302
1302
|
{
|
|
@@ -1320,7 +1320,7 @@ function ki({
|
|
|
1320
1320
|
nr,
|
|
1321
1321
|
{
|
|
1322
1322
|
property: n,
|
|
1323
|
-
onClick:
|
|
1323
|
+
onClick: p ? () => p(t, r) : void 0,
|
|
1324
1324
|
includeName: !0,
|
|
1325
1325
|
selected: k,
|
|
1326
1326
|
hasError: y
|
|
@@ -1330,12 +1330,12 @@ function ki({
|
|
|
1330
1330
|
{
|
|
1331
1331
|
name: t,
|
|
1332
1332
|
property: n,
|
|
1333
|
-
onClick:
|
|
1333
|
+
onClick: p ? () => p(t, r) : void 0,
|
|
1334
1334
|
selected: k
|
|
1335
1335
|
}
|
|
1336
1336
|
),
|
|
1337
1337
|
/* @__PURE__ */ a("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
|
|
1338
|
-
|
|
1338
|
+
g && /* @__PURE__ */ e(te, { title: "Inferred property", children: /* @__PURE__ */ e(ht, { size: "small", className: "p-2" }) }),
|
|
1339
1339
|
h && /* @__PURE__ */ e(te, { title: "Remove", children: /* @__PURE__ */ e(
|
|
1340
1340
|
oe,
|
|
1341
1341
|
{
|
|
@@ -1345,7 +1345,7 @@ function ki({
|
|
|
1345
1345
|
children: /* @__PURE__ */ e(Ur, { size: "small" })
|
|
1346
1346
|
}
|
|
1347
1347
|
) }),
|
|
1348
|
-
|
|
1348
|
+
u && /* @__PURE__ */ e(te, { title: "Move", children: /* @__PURE__ */ e(
|
|
1349
1349
|
oe,
|
|
1350
1350
|
{
|
|
1351
1351
|
component: "span",
|
|
@@ -1363,28 +1363,28 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1363
1363
|
const {
|
|
1364
1364
|
values: o,
|
|
1365
1365
|
setFieldValue: d
|
|
1366
|
-
} = K(), [
|
|
1366
|
+
} = K(), [p, u] = $(!1), [h, m] = $(), [c, g] = $(), v = o.propertiesOrder ?? Object.keys(o.properties ?? {}), x = ({
|
|
1367
1367
|
id: N,
|
|
1368
|
-
property:
|
|
1368
|
+
property: f
|
|
1369
1369
|
}) => {
|
|
1370
1370
|
if (!N)
|
|
1371
1371
|
throw Error();
|
|
1372
1372
|
d("properties", {
|
|
1373
1373
|
...o.properties ?? {},
|
|
1374
|
-
[N]:
|
|
1374
|
+
[N]: f
|
|
1375
1375
|
}, !1);
|
|
1376
1376
|
const w = o.propertiesOrder ?? Object.keys(o.properties ?? {}), _ = w.includes(N) ? w : [...w, N];
|
|
1377
|
-
d("propertiesOrder", _, !1),
|
|
1378
|
-
}, y = Q((N,
|
|
1379
|
-
const w = N ? ae(N,
|
|
1377
|
+
d("propertiesOrder", _, !1), u(!1);
|
|
1378
|
+
}, y = Q((N, f) => {
|
|
1379
|
+
const w = N ? ae(N, f) : void 0;
|
|
1380
1380
|
if (!w)
|
|
1381
1381
|
throw Error("collection editor miss config");
|
|
1382
|
-
const _ = he(w), M =
|
|
1383
|
-
d(_, void 0, !1), d(M,
|
|
1384
|
-
}, [d, o]), P = h ? ae(h,
|
|
1385
|
-
d(
|
|
1382
|
+
const _ = he(w), M = be(f), U = I(o, M) ?? Object.keys(I(o, bi(f)));
|
|
1383
|
+
d(_, void 0, !1), d(M, U.filter((D) => D !== N), !1), u(!1), m(void 0), g(void 0);
|
|
1384
|
+
}, [d, o]), P = h ? ae(h, c) : void 0, k = P ? I(o.properties, P.replaceAll(".", ".properties.")) : void 0, b = !v || v.length < 1, C = Q((N, f) => {
|
|
1385
|
+
d(be(f), N, !1);
|
|
1386
1386
|
}, []);
|
|
1387
|
-
return /* @__PURE__ */ a(
|
|
1387
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1388
1388
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1389
1389
|
/* @__PURE__ */ a("div", { className: "flex justify-between items-end my-4", children: [
|
|
1390
1390
|
/* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this group" }),
|
|
@@ -1393,7 +1393,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1393
1393
|
{
|
|
1394
1394
|
color: "primary",
|
|
1395
1395
|
variant: "outlined",
|
|
1396
|
-
onClick: () =>
|
|
1396
|
+
onClick: () => u(!0),
|
|
1397
1397
|
startIcon: /* @__PURE__ */ e(se, {}),
|
|
1398
1398
|
children: [
|
|
1399
1399
|
"Add property to ",
|
|
@@ -1402,7 +1402,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1402
1402
|
}
|
|
1403
1403
|
)
|
|
1404
1404
|
] }),
|
|
1405
|
-
/* @__PURE__ */ a(
|
|
1405
|
+
/* @__PURE__ */ a(Pe, { className: "p-2 pl-8", children: [
|
|
1406
1406
|
/* @__PURE__ */ e(
|
|
1407
1407
|
ft,
|
|
1408
1408
|
{
|
|
@@ -1410,8 +1410,8 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1410
1410
|
propertiesOrder: v,
|
|
1411
1411
|
errors: {},
|
|
1412
1412
|
collectionEditable: l,
|
|
1413
|
-
onPropertyClick: (N,
|
|
1414
|
-
m(N), f
|
|
1413
|
+
onPropertyClick: (N, f) => {
|
|
1414
|
+
m(N), g(f), u(!0);
|
|
1415
1415
|
},
|
|
1416
1416
|
onPropertyMove: C
|
|
1417
1417
|
}
|
|
@@ -1440,23 +1440,23 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1440
1440
|
/* @__PURE__ */ e(X, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
|
|
1441
1441
|
] }),
|
|
1442
1442
|
/* @__PURE__ */ e(
|
|
1443
|
-
|
|
1443
|
+
Ie,
|
|
1444
1444
|
{
|
|
1445
1445
|
inArray: !1,
|
|
1446
1446
|
forceShowErrors: !1,
|
|
1447
|
-
open:
|
|
1447
|
+
open: p,
|
|
1448
1448
|
allowDataInference: n,
|
|
1449
1449
|
collectionEditable: l,
|
|
1450
1450
|
onCancel: () => {
|
|
1451
|
-
|
|
1451
|
+
u(!1), m(void 0), g(void 0);
|
|
1452
1452
|
},
|
|
1453
1453
|
onOkClicked: () => {
|
|
1454
|
-
|
|
1454
|
+
u(!1), m(void 0), g(void 0);
|
|
1455
1455
|
},
|
|
1456
1456
|
getData: r,
|
|
1457
1457
|
onDelete: y,
|
|
1458
1458
|
propertyKey: h,
|
|
1459
|
-
propertyNamespace:
|
|
1459
|
+
propertyNamespace: c,
|
|
1460
1460
|
property: k,
|
|
1461
1461
|
existingProperty: !!h,
|
|
1462
1462
|
autoUpdateId: !h,
|
|
@@ -1478,15 +1478,15 @@ function Vi({
|
|
|
1478
1478
|
collectionEditable: d
|
|
1479
1479
|
}) {
|
|
1480
1480
|
const {
|
|
1481
|
-
values:
|
|
1482
|
-
handleChange:
|
|
1481
|
+
values: p,
|
|
1482
|
+
handleChange: u,
|
|
1483
1483
|
errors: h,
|
|
1484
1484
|
setFieldValue: m,
|
|
1485
|
-
touched:
|
|
1486
|
-
} = K(), [
|
|
1485
|
+
touched: c
|
|
1486
|
+
} = K(), [g, v] = $(!1), x = I(p, "of"), y = I(c, "of") && I(h, "of"), P = ({ id: b, property: C, namespace: N }) => {
|
|
1487
1487
|
console.log("onPropertyChanged", b, C, N), m("of", C);
|
|
1488
1488
|
}, k = x && $e(x, o);
|
|
1489
|
-
return /* @__PURE__ */ a(
|
|
1489
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1490
1490
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1491
1491
|
/* @__PURE__ */ e(O, { variant: "subtitle2", children: "Repeat component" }),
|
|
1492
1492
|
/* @__PURE__ */ e(
|
|
@@ -1494,7 +1494,7 @@ function Vi({
|
|
|
1494
1494
|
{
|
|
1495
1495
|
name: "of",
|
|
1496
1496
|
value: x,
|
|
1497
|
-
children: ({}) => /* @__PURE__ */ a(
|
|
1497
|
+
children: ({}) => /* @__PURE__ */ a(Pe, { className: "p-2 mt-4", children: [
|
|
1498
1498
|
x && /* @__PURE__ */ e(
|
|
1499
1499
|
nr,
|
|
1500
1500
|
{
|
|
@@ -1520,10 +1520,10 @@ function Vi({
|
|
|
1520
1520
|
}
|
|
1521
1521
|
),
|
|
1522
1522
|
/* @__PURE__ */ e(
|
|
1523
|
-
|
|
1523
|
+
Ie,
|
|
1524
1524
|
{
|
|
1525
1525
|
inArray: !0,
|
|
1526
|
-
open:
|
|
1526
|
+
open: g,
|
|
1527
1527
|
existingProperty: r,
|
|
1528
1528
|
getData: i,
|
|
1529
1529
|
autoUpdateId: !r,
|
|
@@ -1542,7 +1542,7 @@ function Vi({
|
|
|
1542
1542
|
}
|
|
1543
1543
|
)
|
|
1544
1544
|
] }),
|
|
1545
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1545
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ot, { disabled: n }) }) })
|
|
1546
1546
|
] });
|
|
1547
1547
|
}
|
|
1548
1548
|
const Ii = Y.forwardRef(
|
|
@@ -1554,13 +1554,13 @@ const Ii = Y.forwardRef(
|
|
|
1554
1554
|
isNewProperty: o
|
|
1555
1555
|
}, d) {
|
|
1556
1556
|
const {
|
|
1557
|
-
errors:
|
|
1558
|
-
values:
|
|
1557
|
+
errors: p,
|
|
1558
|
+
values: u,
|
|
1559
1559
|
setFieldValue: h,
|
|
1560
1560
|
setFieldTouched: m,
|
|
1561
|
-
touched:
|
|
1562
|
-
validate:
|
|
1563
|
-
} = K(), v = "name", x = r && I(
|
|
1561
|
+
touched: c,
|
|
1562
|
+
validate: g
|
|
1563
|
+
} = K(), v = "name", x = r && I(p, v), y = "id", P = r && I(p, y), k = "description", b = r && I(p, k);
|
|
1564
1564
|
return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 col-span-12", children: [
|
|
1565
1565
|
/* @__PURE__ */ a("div", { children: [
|
|
1566
1566
|
/* @__PURE__ */ e(
|
|
@@ -1569,10 +1569,10 @@ const Ii = Y.forwardRef(
|
|
|
1569
1569
|
name: v,
|
|
1570
1570
|
inputRef: d,
|
|
1571
1571
|
as: Z,
|
|
1572
|
-
value:
|
|
1572
|
+
value: u[v],
|
|
1573
1573
|
onChange: (C) => {
|
|
1574
1574
|
const N = C.target.value;
|
|
1575
|
-
!I(
|
|
1575
|
+
!I(c, y) && l && h(y, N ? Pt(N) : "", !1), h(v, N, !0), m(v, !0);
|
|
1576
1576
|
},
|
|
1577
1577
|
style: { fontSize: 20 },
|
|
1578
1578
|
placeholder: "Field name",
|
|
@@ -1590,10 +1590,10 @@ const Ii = Y.forwardRef(
|
|
|
1590
1590
|
name: y,
|
|
1591
1591
|
as: Z,
|
|
1592
1592
|
label: "ID",
|
|
1593
|
-
value:
|
|
1593
|
+
value: u[y],
|
|
1594
1594
|
onChange: (C) => {
|
|
1595
1595
|
const N = C.target.value;
|
|
1596
|
-
!I(
|
|
1596
|
+
!I(c, v) && l && h(v, N ? ut(N) : ""), h(y, N, !0), m(y, !0);
|
|
1597
1597
|
},
|
|
1598
1598
|
disabled: n || i,
|
|
1599
1599
|
required: !0,
|
|
@@ -1625,8 +1625,8 @@ function _i({
|
|
|
1625
1625
|
showErrors: n
|
|
1626
1626
|
}) {
|
|
1627
1627
|
const { values: i, setFieldValue: l } = K();
|
|
1628
|
-
return /* @__PURE__ */ a(
|
|
1629
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
1628
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1629
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
|
|
1630
1630
|
t === "text_field" && /* @__PURE__ */ e(
|
|
1631
1631
|
Ee,
|
|
1632
1632
|
{
|
|
@@ -1679,7 +1679,7 @@ function _i({
|
|
|
1679
1679
|
)
|
|
1680
1680
|
] }) }),
|
|
1681
1681
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1682
|
-
|
|
1682
|
+
Ve,
|
|
1683
1683
|
{
|
|
1684
1684
|
name: "defaultValue",
|
|
1685
1685
|
disabled: r,
|
|
@@ -1694,8 +1694,8 @@ function _i({
|
|
|
1694
1694
|
}
|
|
1695
1695
|
function Fi({ disabled: t }) {
|
|
1696
1696
|
const { values: r } = K(), n = I(r, "defaultValue");
|
|
1697
|
-
return /* @__PURE__ */ a(
|
|
1698
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1697
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1698
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }),
|
|
1699
1699
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1700
1700
|
H,
|
|
1701
1701
|
{
|
|
@@ -1718,7 +1718,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1718
1718
|
const {
|
|
1719
1719
|
values: o,
|
|
1720
1720
|
setFieldValue: d
|
|
1721
|
-
} = K(), [
|
|
1721
|
+
} = K(), [p, u] = $(!1), [h, m] = $(), [c, g] = $(), v = ({
|
|
1722
1722
|
id: C,
|
|
1723
1723
|
property: N
|
|
1724
1724
|
}) => {
|
|
@@ -1728,21 +1728,21 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1728
1728
|
...o.oneOf?.properties ?? {},
|
|
1729
1729
|
[C]: N
|
|
1730
1730
|
}, !1);
|
|
1731
|
-
const
|
|
1732
|
-
d("oneOf.propertiesOrder", w, !1),
|
|
1733
|
-
}, x = h ? ae(h,
|
|
1734
|
-
const
|
|
1735
|
-
if (!
|
|
1731
|
+
const f = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), w = f.includes(C) ? f : [...f, C];
|
|
1732
|
+
d("oneOf.propertiesOrder", w, !1), u(!1);
|
|
1733
|
+
}, x = h ? ae(h, c) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, P = Q((C, N) => {
|
|
1734
|
+
const f = C ? ae(C, N) : void 0;
|
|
1735
|
+
if (!f)
|
|
1736
1736
|
throw Error("collection editor miss config");
|
|
1737
|
-
d(`oneOf.${he(
|
|
1738
|
-
const w = `oneOf.${
|
|
1739
|
-
d(w, _.filter((M) => M !== C), !1),
|
|
1737
|
+
d(`oneOf.${he(f)}`, void 0, !1);
|
|
1738
|
+
const w = `oneOf.${be(N)}`, _ = I(o, w);
|
|
1739
|
+
d(w, _.filter((M) => M !== C), !1), u(!1), m(void 0), g(void 0);
|
|
1740
1740
|
}, [d, o]), k = /* @__PURE__ */ a(
|
|
1741
1741
|
z,
|
|
1742
1742
|
{
|
|
1743
1743
|
autoFocus: !0,
|
|
1744
1744
|
color: "primary",
|
|
1745
|
-
onClick: () =>
|
|
1745
|
+
onClick: () => u(!0),
|
|
1746
1746
|
startIcon: /* @__PURE__ */ e(se, {}),
|
|
1747
1747
|
children: [
|
|
1748
1748
|
"Add property to ",
|
|
@@ -1750,15 +1750,15 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1750
1750
|
]
|
|
1751
1751
|
}
|
|
1752
1752
|
), b = Q((C, N) => {
|
|
1753
|
-
d(`oneOf.${
|
|
1753
|
+
d(`oneOf.${be(N)}`, C, !1);
|
|
1754
1754
|
}, []);
|
|
1755
|
-
return /* @__PURE__ */ a(
|
|
1755
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1756
1756
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1757
1757
|
/* @__PURE__ */ a("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
|
|
1758
1758
|
/* @__PURE__ */ e(O, { variant: "subtitle2", children: "Properties in this block" }),
|
|
1759
1759
|
k
|
|
1760
1760
|
] }),
|
|
1761
|
-
/* @__PURE__ */ a(
|
|
1761
|
+
/* @__PURE__ */ a(Pe, { className: "p-2 pl-8", children: [
|
|
1762
1762
|
/* @__PURE__ */ e(
|
|
1763
1763
|
ft,
|
|
1764
1764
|
{
|
|
@@ -1767,7 +1767,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1767
1767
|
errors: {},
|
|
1768
1768
|
collectionEditable: l,
|
|
1769
1769
|
onPropertyClick: t ? void 0 : (C, N) => {
|
|
1770
|
-
m(C),
|
|
1770
|
+
m(C), g(N), u(!0);
|
|
1771
1771
|
},
|
|
1772
1772
|
onPropertyMove: t ? void 0 : b
|
|
1773
1773
|
}
|
|
@@ -1776,23 +1776,23 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1776
1776
|
] })
|
|
1777
1777
|
] }),
|
|
1778
1778
|
!t && /* @__PURE__ */ e(
|
|
1779
|
-
|
|
1779
|
+
Ie,
|
|
1780
1780
|
{
|
|
1781
1781
|
inArray: !1,
|
|
1782
1782
|
forceShowErrors: !1,
|
|
1783
|
-
open:
|
|
1783
|
+
open: p,
|
|
1784
1784
|
getData: r,
|
|
1785
1785
|
allowDataInference: n,
|
|
1786
1786
|
onCancel: () => {
|
|
1787
|
-
|
|
1787
|
+
u(!1), m(void 0), g(void 0);
|
|
1788
1788
|
},
|
|
1789
1789
|
onOkClicked: () => {
|
|
1790
|
-
|
|
1790
|
+
u(!1), m(void 0), g(void 0);
|
|
1791
1791
|
},
|
|
1792
1792
|
collectionEditable: l,
|
|
1793
1793
|
onDelete: P,
|
|
1794
1794
|
propertyKey: h,
|
|
1795
|
-
propertyNamespace:
|
|
1795
|
+
propertyNamespace: c,
|
|
1796
1796
|
property: y,
|
|
1797
1797
|
existingProperty: !!h,
|
|
1798
1798
|
autoUpdateId: !h,
|
|
@@ -1864,12 +1864,12 @@ function Ei({ disabled: t }) {
|
|
|
1864
1864
|
{
|
|
1865
1865
|
name: "validation.positive",
|
|
1866
1866
|
type: "checkbox",
|
|
1867
|
-
children: ({ field: m, form:
|
|
1867
|
+
children: ({ field: m, form: c }) => /* @__PURE__ */ e(
|
|
1868
1868
|
ce,
|
|
1869
1869
|
{
|
|
1870
1870
|
label: "Positive value",
|
|
1871
1871
|
disabled: t,
|
|
1872
|
-
form:
|
|
1872
|
+
form: c,
|
|
1873
1873
|
field: m
|
|
1874
1874
|
}
|
|
1875
1875
|
)
|
|
@@ -1880,12 +1880,12 @@ function Ei({ disabled: t }) {
|
|
|
1880
1880
|
{
|
|
1881
1881
|
name: "validation.negative",
|
|
1882
1882
|
type: "checkbox",
|
|
1883
|
-
children: ({ field: m, form:
|
|
1883
|
+
children: ({ field: m, form: c }) => /* @__PURE__ */ e(
|
|
1884
1884
|
ce,
|
|
1885
1885
|
{
|
|
1886
1886
|
label: "Negative value",
|
|
1887
1887
|
disabled: t,
|
|
1888
|
-
form:
|
|
1888
|
+
form: c,
|
|
1889
1889
|
field: m
|
|
1890
1890
|
}
|
|
1891
1891
|
)
|
|
@@ -1896,12 +1896,12 @@ function Ei({ disabled: t }) {
|
|
|
1896
1896
|
{
|
|
1897
1897
|
name: "validation.integer",
|
|
1898
1898
|
type: "checkbox",
|
|
1899
|
-
children: ({ field: m, form:
|
|
1899
|
+
children: ({ field: m, form: c }) => /* @__PURE__ */ e(
|
|
1900
1900
|
ce,
|
|
1901
1901
|
{
|
|
1902
1902
|
label: "Integer value",
|
|
1903
1903
|
disabled: t,
|
|
1904
|
-
form:
|
|
1904
|
+
form: c,
|
|
1905
1905
|
field: m
|
|
1906
1906
|
}
|
|
1907
1907
|
)
|
|
@@ -1911,10 +1911,10 @@ function Ei({ disabled: t }) {
|
|
|
1911
1911
|
}
|
|
1912
1912
|
function Ai({ disabled: t }) {
|
|
1913
1913
|
const { values: r, setFieldValue: n } = K();
|
|
1914
|
-
return /* @__PURE__ */ a(
|
|
1915
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1914
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1915
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ei, { disabled: t }) }) }),
|
|
1916
1916
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1917
|
-
|
|
1917
|
+
Ve,
|
|
1918
1918
|
{
|
|
1919
1919
|
name: "defaultValue",
|
|
1920
1920
|
disabled: t,
|
|
@@ -1939,14 +1939,14 @@ function jt({
|
|
|
1939
1939
|
handleChange: o,
|
|
1940
1940
|
errors: d
|
|
1941
1941
|
} = K();
|
|
1942
|
-
if (!
|
|
1942
|
+
if (!Ne())
|
|
1943
1943
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(De, {}) });
|
|
1944
|
-
const
|
|
1945
|
-
return /* @__PURE__ */ e(
|
|
1944
|
+
const u = r ? "of.path" : "path", h = I(l, u), m = i && I(d, u);
|
|
1945
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1946
1946
|
H,
|
|
1947
1947
|
{
|
|
1948
|
-
name:
|
|
1949
|
-
pathPath:
|
|
1948
|
+
name: u,
|
|
1949
|
+
pathPath: u,
|
|
1950
1950
|
type: "select",
|
|
1951
1951
|
disabled: t && !!h || n,
|
|
1952
1952
|
value: h,
|
|
@@ -1964,15 +1964,15 @@ function Di({
|
|
|
1964
1964
|
error: l,
|
|
1965
1965
|
...o
|
|
1966
1966
|
}) {
|
|
1967
|
-
const d =
|
|
1967
|
+
const d = Ne();
|
|
1968
1968
|
if (!d)
|
|
1969
1969
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(De, {}) });
|
|
1970
|
-
const
|
|
1971
|
-
Object.values(
|
|
1972
|
-
).values()), h =
|
|
1973
|
-
return /* @__PURE__ */ a(
|
|
1970
|
+
const p = d?.collections ?? [], u = Array.from(new Set(
|
|
1971
|
+
Object.values(p).map((m) => m.group).filter(Boolean)
|
|
1972
|
+
).values()), h = p.filter((m) => !m.group);
|
|
1973
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
1974
1974
|
/* @__PURE__ */ a(
|
|
1975
|
-
|
|
1975
|
+
Ce,
|
|
1976
1976
|
{
|
|
1977
1977
|
error: !!l,
|
|
1978
1978
|
disabled: t,
|
|
@@ -1982,42 +1982,42 @@ function Di({
|
|
|
1982
1982
|
onChange: i,
|
|
1983
1983
|
label: "Target collection",
|
|
1984
1984
|
renderValue: (m) => {
|
|
1985
|
-
const
|
|
1986
|
-
return
|
|
1987
|
-
/* @__PURE__ */ e(ot, { collectionOrView:
|
|
1985
|
+
const c = p.find((g) => g.id === m || g.path === m);
|
|
1986
|
+
return c ? /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
1987
|
+
/* @__PURE__ */ e(ot, { collectionOrView: c }),
|
|
1988
1988
|
/* @__PURE__ */ e(
|
|
1989
1989
|
O,
|
|
1990
1990
|
{
|
|
1991
1991
|
variant: "subtitle2",
|
|
1992
1992
|
className: "font-medium ml-4",
|
|
1993
|
-
children:
|
|
1993
|
+
children: c?.name.toUpperCase()
|
|
1994
1994
|
}
|
|
1995
1995
|
)
|
|
1996
1996
|
] }) : null;
|
|
1997
1997
|
},
|
|
1998
1998
|
...o,
|
|
1999
1999
|
children: [
|
|
2000
|
-
|
|
2000
|
+
u.flatMap((m) => /* @__PURE__ */ e(
|
|
2001
2001
|
At,
|
|
2002
2002
|
{
|
|
2003
2003
|
label: m || "Views",
|
|
2004
|
-
children:
|
|
2004
|
+
children: p.filter((c) => c.group === m).map((c) => /* @__PURE__ */ e(
|
|
2005
2005
|
ee,
|
|
2006
2006
|
{
|
|
2007
|
-
value:
|
|
2007
|
+
value: c.id ?? c.path,
|
|
2008
2008
|
children: /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
2009
|
-
/* @__PURE__ */ e(ot, { collectionOrView:
|
|
2009
|
+
/* @__PURE__ */ e(ot, { collectionOrView: c }),
|
|
2010
2010
|
/* @__PURE__ */ e(
|
|
2011
2011
|
O,
|
|
2012
2012
|
{
|
|
2013
2013
|
variant: "subtitle2",
|
|
2014
2014
|
className: "font-medium ml-4",
|
|
2015
|
-
children:
|
|
2015
|
+
children: c?.name.toUpperCase()
|
|
2016
2016
|
}
|
|
2017
2017
|
)
|
|
2018
2018
|
] })
|
|
2019
2019
|
},
|
|
2020
|
-
`${
|
|
2020
|
+
`${c.id ?? c.path}-${m}`
|
|
2021
2021
|
))
|
|
2022
2022
|
},
|
|
2023
2023
|
`group_${m}`
|
|
@@ -2052,19 +2052,19 @@ function Bi({ disabled: t }) {
|
|
|
2052
2052
|
errors: n,
|
|
2053
2053
|
touched: i,
|
|
2054
2054
|
setFieldValue: l
|
|
2055
|
-
} = K(), o = "mode", d = I(r, o),
|
|
2056
|
-
return /* @__PURE__ */ a(
|
|
2055
|
+
} = K(), o = "mode", d = I(r, o), p = I(i, o) && I(n, o), u = "autoValue", h = I(r, u), m = I(i, u) && I(n, u);
|
|
2056
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
2057
2057
|
/* @__PURE__ */ a("div", { className: "flex flex-col col-span-12", children: [
|
|
2058
2058
|
/* @__PURE__ */ a(
|
|
2059
|
-
|
|
2059
|
+
Ce,
|
|
2060
2060
|
{
|
|
2061
2061
|
name: o,
|
|
2062
2062
|
value: d ?? "date",
|
|
2063
|
-
error: !!
|
|
2064
|
-
onValueChange: (
|
|
2063
|
+
error: !!p,
|
|
2064
|
+
onValueChange: (c) => l(o, c),
|
|
2065
2065
|
label: "Mode",
|
|
2066
|
-
renderValue: (
|
|
2067
|
-
switch (
|
|
2066
|
+
renderValue: (c) => {
|
|
2067
|
+
switch (c) {
|
|
2068
2068
|
case "date_time":
|
|
2069
2069
|
return "Date/Time";
|
|
2070
2070
|
case "date":
|
|
@@ -2080,16 +2080,16 @@ function Bi({ disabled: t }) {
|
|
|
2080
2080
|
]
|
|
2081
2081
|
}
|
|
2082
2082
|
),
|
|
2083
|
-
/* @__PURE__ */ e(X, { error: !!
|
|
2083
|
+
/* @__PURE__ */ e(X, { error: !!p, children: p }),
|
|
2084
2084
|
/* @__PURE__ */ a(
|
|
2085
|
-
|
|
2085
|
+
Ce,
|
|
2086
2086
|
{
|
|
2087
|
-
name:
|
|
2087
|
+
name: u,
|
|
2088
2088
|
disabled: t,
|
|
2089
2089
|
value: h ?? "",
|
|
2090
|
-
onValueChange: (
|
|
2091
|
-
renderValue: (
|
|
2092
|
-
switch (
|
|
2090
|
+
onValueChange: (c) => l(u, c === "none" ? null : c),
|
|
2091
|
+
renderValue: (c) => {
|
|
2092
|
+
switch (c) {
|
|
2093
2093
|
case "on_create":
|
|
2094
2094
|
return "On create";
|
|
2095
2095
|
case "on_update":
|
|
@@ -2109,7 +2109,7 @@ function Bi({ disabled: t }) {
|
|
|
2109
2109
|
),
|
|
2110
2110
|
/* @__PURE__ */ e(X, { error: !!m, children: m ?? "Update this field automatically when creating or updating the entity" })
|
|
2111
2111
|
] }),
|
|
2112
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2112
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) })
|
|
2113
2113
|
] });
|
|
2114
2114
|
}
|
|
2115
2115
|
function zi({ disabled: t }) {
|
|
@@ -2144,7 +2144,7 @@ function zi({ disabled: t }) {
|
|
|
2144
2144
|
] });
|
|
2145
2145
|
}
|
|
2146
2146
|
function Mi({ disabled: t }) {
|
|
2147
|
-
return /* @__PURE__ */ e(
|
|
2147
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }) });
|
|
2148
2148
|
}
|
|
2149
2149
|
function ar(t, r, n) {
|
|
2150
2150
|
let i;
|
|
@@ -2397,9 +2397,9 @@ function Ri({
|
|
|
2397
2397
|
showErrors: r
|
|
2398
2398
|
}) {
|
|
2399
2399
|
const { values: n, setFieldValue: i } = K(), l = I(n, "url");
|
|
2400
|
-
return /* @__PURE__ */ a(
|
|
2400
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
2401
2401
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
2402
|
-
|
|
2402
|
+
Ce,
|
|
2403
2403
|
{
|
|
2404
2404
|
disabled: t,
|
|
2405
2405
|
position: "item-aligned",
|
|
@@ -2428,7 +2428,7 @@ function Ri({
|
|
|
2428
2428
|
]
|
|
2429
2429
|
}
|
|
2430
2430
|
) }),
|
|
2431
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2431
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(
|
|
2432
2432
|
Ee,
|
|
2433
2433
|
{
|
|
2434
2434
|
disabled: t,
|
|
@@ -2439,7 +2439,7 @@ function Ri({
|
|
|
2439
2439
|
}
|
|
2440
2440
|
) }) }),
|
|
2441
2441
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2442
|
-
|
|
2442
|
+
Ve,
|
|
2443
2443
|
{
|
|
2444
2444
|
name: "defaultValue",
|
|
2445
2445
|
disabled: t,
|
|
@@ -2481,12 +2481,12 @@ const Ui = [
|
|
|
2481
2481
|
existingProperty: l,
|
|
2482
2482
|
autoUpdateId: o,
|
|
2483
2483
|
inArray: d,
|
|
2484
|
-
propertyKey:
|
|
2485
|
-
existingPropertyKeys:
|
|
2484
|
+
propertyKey: p,
|
|
2485
|
+
existingPropertyKeys: u,
|
|
2486
2486
|
propertyNamespace: h,
|
|
2487
2487
|
property: m,
|
|
2488
|
-
onPropertyChanged:
|
|
2489
|
-
onPropertyChangedImmediate:
|
|
2488
|
+
onPropertyChanged: c,
|
|
2489
|
+
onPropertyChangedImmediate: g = !0,
|
|
2490
2490
|
onDelete: v,
|
|
2491
2491
|
onError: x,
|
|
2492
2492
|
initialErrors: y,
|
|
@@ -2495,60 +2495,60 @@ const Ui = [
|
|
|
2495
2495
|
getController: b,
|
|
2496
2496
|
getData: C,
|
|
2497
2497
|
propertyConfigs: N,
|
|
2498
|
-
collectionEditable:
|
|
2498
|
+
collectionEditable: f
|
|
2499
2499
|
} = r, w = {
|
|
2500
2500
|
id: "",
|
|
2501
2501
|
name: ""
|
|
2502
|
-
}, _ = !!(m && !qe(m)) && !
|
|
2503
|
-
id:
|
|
2504
|
-
previousId:
|
|
2502
|
+
}, _ = !!(m && !qe(m)) && !f, M = Le(m ? {
|
|
2503
|
+
id: p,
|
|
2504
|
+
previousId: p,
|
|
2505
2505
|
property: m
|
|
2506
|
-
} : void 0),
|
|
2506
|
+
} : void 0), U = ({
|
|
2507
2507
|
id: A,
|
|
2508
|
-
property:
|
|
2508
|
+
property: s
|
|
2509
2509
|
}) => {
|
|
2510
2510
|
const V = {
|
|
2511
2511
|
id: A,
|
|
2512
2512
|
previousId: M.current?.id,
|
|
2513
|
-
property:
|
|
2513
|
+
property: s,
|
|
2514
2514
|
namespace: h
|
|
2515
2515
|
};
|
|
2516
|
-
M.current = V,
|
|
2516
|
+
M.current = V, c?.(V);
|
|
2517
2517
|
}, D = Tt({
|
|
2518
|
-
initialValues: m ? { id:
|
|
2518
|
+
initialValues: m ? { id: p, ...m } : w,
|
|
2519
2519
|
initialErrors: y,
|
|
2520
2520
|
validateOnChange: !0,
|
|
2521
2521
|
validateOnInitialRender: !0,
|
|
2522
|
-
onSubmit: (A,
|
|
2522
|
+
onSubmit: (A, s) => {
|
|
2523
2523
|
console.debug("onSubmit", A);
|
|
2524
2524
|
const {
|
|
2525
2525
|
id: V,
|
|
2526
2526
|
...G
|
|
2527
2527
|
} = A;
|
|
2528
|
-
|
|
2528
|
+
U({
|
|
2529
2529
|
id: V,
|
|
2530
2530
|
property: { ...G, editable: G.editable ?? !0 }
|
|
2531
|
-
}), l ||
|
|
2531
|
+
}), l || s.resetForm({ values: w });
|
|
2532
2532
|
},
|
|
2533
2533
|
validation: (A) => {
|
|
2534
|
-
const
|
|
2534
|
+
const s = {};
|
|
2535
2535
|
if (n) {
|
|
2536
2536
|
if (!A.name)
|
|
2537
|
-
|
|
2537
|
+
s.name = "Required";
|
|
2538
2538
|
else {
|
|
2539
2539
|
const V = $i(A.name);
|
|
2540
|
-
V && (
|
|
2540
|
+
V && (s.name = V);
|
|
2541
2541
|
}
|
|
2542
2542
|
if (!A.id)
|
|
2543
|
-
|
|
2543
|
+
s.id = "Required";
|
|
2544
2544
|
else {
|
|
2545
|
-
const V = qi(A.id,
|
|
2546
|
-
V && (
|
|
2545
|
+
const V = qi(A.id, u);
|
|
2546
|
+
V && (s.id = V);
|
|
2547
2547
|
}
|
|
2548
2548
|
}
|
|
2549
|
-
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()) && (s.validation = {
|
|
2550
2550
|
matches: "Invalid regular expression"
|
|
2551
|
-
}), A.dataType === "reference" && !A.path && (
|
|
2551
|
+
}), A.dataType === "reference" && !A.path && (s.path = "You must specify a target collection for the field"), A.propertyConfig === "repeat" && (A.of || (s.of = "You need to specify a repeat field")), A.propertyConfig === "block" && (A.oneOf || (s.oneOf = "You need to specify the properties of this block")), s;
|
|
2552
2552
|
}
|
|
2553
2553
|
});
|
|
2554
2554
|
return de(() => {
|
|
@@ -2556,7 +2556,7 @@ const Ui = [
|
|
|
2556
2556
|
}, [D, b]), /* @__PURE__ */ e(kt, { value: D, children: /* @__PURE__ */ e(
|
|
2557
2557
|
ji,
|
|
2558
2558
|
{
|
|
2559
|
-
onPropertyChanged:
|
|
2559
|
+
onPropertyChanged: g ? U : void 0,
|
|
2560
2560
|
onDelete: v,
|
|
2561
2561
|
includeIdAndTitle: n,
|
|
2562
2562
|
propertyNamespace: h,
|
|
@@ -2570,14 +2570,14 @@ const Ui = [
|
|
|
2570
2570
|
getData: C,
|
|
2571
2571
|
allowDataInference: k,
|
|
2572
2572
|
propertyConfigs: N,
|
|
2573
|
-
collectionEditable:
|
|
2573
|
+
collectionEditable: f,
|
|
2574
2574
|
...D
|
|
2575
2575
|
}
|
|
2576
2576
|
) });
|
|
2577
2577
|
},
|
|
2578
2578
|
(t, r) => t.getData === r.getData && t.propertyKey === r.propertyKey && t.propertyNamespace === r.propertyNamespace && t.includeIdAndName === r.includeIdAndName && t.autoOpenTypeSelect === r.autoOpenTypeSelect && t.autoUpdateId === r.autoUpdateId && t.existingProperty === r.existingProperty
|
|
2579
2579
|
);
|
|
2580
|
-
function
|
|
2580
|
+
function Ie({
|
|
2581
2581
|
open: t,
|
|
2582
2582
|
onCancel: r,
|
|
2583
2583
|
onOkClicked: n,
|
|
@@ -2586,7 +2586,7 @@ function Ve({
|
|
|
2586
2586
|
collectionEditable: o,
|
|
2587
2587
|
...d
|
|
2588
2588
|
}) {
|
|
2589
|
-
const
|
|
2589
|
+
const p = Le();
|
|
2590
2590
|
return /* @__PURE__ */ e(
|
|
2591
2591
|
Fe,
|
|
2592
2592
|
{
|
|
@@ -2599,7 +2599,7 @@ function Ve({
|
|
|
2599
2599
|
noValidate: !0,
|
|
2600
2600
|
autoComplete: "off",
|
|
2601
2601
|
onSubmit: (h) => {
|
|
2602
|
-
h.preventDefault(), h.stopPropagation(),
|
|
2602
|
+
h.preventDefault(), h.stopPropagation(), p.current?.handleSubmit(h);
|
|
2603
2603
|
},
|
|
2604
2604
|
children: [
|
|
2605
2605
|
/* @__PURE__ */ e(Be, { children: /* @__PURE__ */ e(
|
|
@@ -2612,7 +2612,7 @@ function Ve({
|
|
|
2612
2612
|
collectionEditable: o,
|
|
2613
2613
|
onPropertyChangedImmediate: !1,
|
|
2614
2614
|
getController: (h) => {
|
|
2615
|
-
|
|
2615
|
+
p.current = h;
|
|
2616
2616
|
},
|
|
2617
2617
|
getData: l
|
|
2618
2618
|
}
|
|
@@ -2623,7 +2623,7 @@ function Ve({
|
|
|
2623
2623
|
{
|
|
2624
2624
|
variant: "text",
|
|
2625
2625
|
onClick: () => {
|
|
2626
|
-
r(),
|
|
2626
|
+
r(), p.current?.resetForm();
|
|
2627
2627
|
},
|
|
2628
2628
|
children: "Cancel"
|
|
2629
2629
|
}
|
|
@@ -2652,32 +2652,32 @@ function ji({
|
|
|
2652
2652
|
autoUpdateId: l = !1,
|
|
2653
2653
|
autoOpenTypeSelect: o,
|
|
2654
2654
|
includeIdAndTitle: d,
|
|
2655
|
-
onPropertyChanged:
|
|
2656
|
-
onDelete:
|
|
2655
|
+
onPropertyChanged: p,
|
|
2656
|
+
onDelete: u,
|
|
2657
2657
|
propertyNamespace: h,
|
|
2658
2658
|
onError: m,
|
|
2659
|
-
showErrors:
|
|
2660
|
-
disabled:
|
|
2659
|
+
showErrors: c,
|
|
2660
|
+
disabled: g,
|
|
2661
2661
|
inArray: v,
|
|
2662
2662
|
getData: x,
|
|
2663
2663
|
allowDataInference: y,
|
|
2664
2664
|
propertyConfigs: P,
|
|
2665
2665
|
collectionEditable: k
|
|
2666
2666
|
}) {
|
|
2667
|
-
const [b, C] = $(o), [N,
|
|
2667
|
+
const [b, C] = $(o), [N, f] = $(!1), [w, _] = $(t?.dataType ? Kt(t) : void 0), M = Object.entries(lr).concat(Object.entries(P)), U = v ? M.filter(([q, L]) => !ne(L.property) && L.property?.dataType !== "array") : M, D = Ir(t), A = Le(null), s = Le(t), V = c && I(r, "selectedWidget");
|
|
2668
2668
|
de(() => {
|
|
2669
|
-
if (
|
|
2669
|
+
if (p && (!d || D.id)) {
|
|
2670
2670
|
const {
|
|
2671
2671
|
id: q,
|
|
2672
2672
|
...L
|
|
2673
2673
|
} = D;
|
|
2674
|
-
|
|
2674
|
+
ye(D, s.current) || (p({
|
|
2675
2675
|
id: q,
|
|
2676
2676
|
property: L,
|
|
2677
2677
|
namespace: h
|
|
2678
|
-
}),
|
|
2678
|
+
}), s.current = D);
|
|
2679
2679
|
}
|
|
2680
|
-
}, [D, d,
|
|
2680
|
+
}, [D, d, p, h]), de(() => {
|
|
2681
2681
|
t?.id && m && m(t?.id, h, r);
|
|
2682
2682
|
}, [r, m, h, t?.id]);
|
|
2683
2683
|
const G = (q) => {
|
|
@@ -2690,14 +2690,14 @@ function ji({
|
|
|
2690
2690
|
_i,
|
|
2691
2691
|
{
|
|
2692
2692
|
widgetId: w,
|
|
2693
|
-
disabled:
|
|
2694
|
-
showErrors:
|
|
2693
|
+
disabled: g,
|
|
2694
|
+
showErrors: c
|
|
2695
2695
|
}
|
|
2696
2696
|
) : w === "url" ? B = /* @__PURE__ */ e(
|
|
2697
2697
|
Ri,
|
|
2698
2698
|
{
|
|
2699
|
-
disabled:
|
|
2700
|
-
showErrors:
|
|
2699
|
+
disabled: g,
|
|
2700
|
+
showErrors: c
|
|
2701
2701
|
}
|
|
2702
2702
|
) : w === "select" || w === "number_select" ? B = /* @__PURE__ */ e(
|
|
2703
2703
|
Rt,
|
|
@@ -2705,38 +2705,38 @@ function ji({
|
|
|
2705
2705
|
multiselect: !1,
|
|
2706
2706
|
allowDataInference: y,
|
|
2707
2707
|
updateIds: !i,
|
|
2708
|
-
disabled:
|
|
2708
|
+
disabled: g,
|
|
2709
2709
|
getData: x,
|
|
2710
|
-
showErrors:
|
|
2710
|
+
showErrors: c
|
|
2711
2711
|
}
|
|
2712
2712
|
) : w === "multi_select" || w === "multi_number_select" ? B = /* @__PURE__ */ e(
|
|
2713
2713
|
Rt,
|
|
2714
2714
|
{
|
|
2715
2715
|
multiselect: !0,
|
|
2716
2716
|
updateIds: !i,
|
|
2717
|
-
disabled:
|
|
2717
|
+
disabled: g,
|
|
2718
2718
|
allowDataInference: y,
|
|
2719
2719
|
getData: x,
|
|
2720
|
-
showErrors:
|
|
2720
|
+
showErrors: c
|
|
2721
2721
|
}
|
|
2722
2722
|
) : w === "file_upload" ? B = /* @__PURE__ */ e(
|
|
2723
2723
|
Ut,
|
|
2724
2724
|
{
|
|
2725
2725
|
existing: i,
|
|
2726
2726
|
multiple: !1,
|
|
2727
|
-
disabled:
|
|
2727
|
+
disabled: g
|
|
2728
2728
|
}
|
|
2729
2729
|
) : w === "multi_file_upload" ? B = /* @__PURE__ */ e(
|
|
2730
2730
|
Ut,
|
|
2731
2731
|
{
|
|
2732
2732
|
existing: i,
|
|
2733
2733
|
multiple: !0,
|
|
2734
|
-
disabled:
|
|
2734
|
+
disabled: g
|
|
2735
2735
|
}
|
|
2736
|
-
) : w === "switch" ? B = /* @__PURE__ */ e(Fi, { disabled:
|
|
2736
|
+
) : w === "switch" ? B = /* @__PURE__ */ e(Fi, { disabled: g }) : w === "number_input" ? B = /* @__PURE__ */ e(Ai, { disabled: g }) : w === "group" ? B = /* @__PURE__ */ e(
|
|
2737
2737
|
Oi,
|
|
2738
2738
|
{
|
|
2739
|
-
disabled:
|
|
2739
|
+
disabled: g,
|
|
2740
2740
|
getData: x,
|
|
2741
2741
|
allowDataInference: y,
|
|
2742
2742
|
collectionEditable: k,
|
|
@@ -2745,7 +2745,7 @@ function ji({
|
|
|
2745
2745
|
) : w === "block" ? B = /* @__PURE__ */ e(
|
|
2746
2746
|
Si,
|
|
2747
2747
|
{
|
|
2748
|
-
disabled:
|
|
2748
|
+
disabled: g,
|
|
2749
2749
|
getData: x,
|
|
2750
2750
|
allowDataInference: y,
|
|
2751
2751
|
collectionEditable: k,
|
|
@@ -2754,32 +2754,32 @@ function ji({
|
|
|
2754
2754
|
) : w === "reference" ? B = /* @__PURE__ */ e(
|
|
2755
2755
|
jt,
|
|
2756
2756
|
{
|
|
2757
|
-
showErrors:
|
|
2757
|
+
showErrors: c,
|
|
2758
2758
|
existing: i,
|
|
2759
2759
|
multiple: !1,
|
|
2760
|
-
disabled:
|
|
2760
|
+
disabled: g
|
|
2761
2761
|
}
|
|
2762
|
-
) : w === "date_time" ? B = /* @__PURE__ */ e(Bi, { disabled:
|
|
2762
|
+
) : w === "date_time" ? B = /* @__PURE__ */ e(Bi, { disabled: g }) : w === "multi_references" ? B = /* @__PURE__ */ e(
|
|
2763
2763
|
jt,
|
|
2764
2764
|
{
|
|
2765
|
-
showErrors:
|
|
2765
|
+
showErrors: c,
|
|
2766
2766
|
existing: i,
|
|
2767
2767
|
multiple: !0,
|
|
2768
|
-
disabled:
|
|
2768
|
+
disabled: g
|
|
2769
2769
|
}
|
|
2770
2770
|
) : w === "repeat" ? B = /* @__PURE__ */ e(
|
|
2771
2771
|
Vi,
|
|
2772
2772
|
{
|
|
2773
|
-
showErrors:
|
|
2773
|
+
showErrors: c,
|
|
2774
2774
|
existing: i,
|
|
2775
2775
|
getData: x,
|
|
2776
2776
|
allowDataInference: y,
|
|
2777
|
-
disabled:
|
|
2777
|
+
disabled: g,
|
|
2778
2778
|
collectionEditable: k,
|
|
2779
2779
|
propertyConfigs: P
|
|
2780
2780
|
}
|
|
2781
|
-
) : w === "key_value" ? B = /* @__PURE__ */ e(Mi, { disabled:
|
|
2782
|
-
|
|
2781
|
+
) : w === "key_value" ? B = /* @__PURE__ */ e(Mi, { disabled: g }) : B = null, /* @__PURE__ */ a(R, { children: [
|
|
2782
|
+
g && /* @__PURE__ */ a(Lr, { mode: "warn", children: [
|
|
2783
2783
|
/* @__PURE__ */ e(O, { children: "This property can't be edited" }),
|
|
2784
2784
|
/* @__PURE__ */ a(O, { variant: "caption", children: [
|
|
2785
2785
|
"You may not have permission to edit it or it is defined in code with no ",
|
|
@@ -2790,7 +2790,7 @@ function ji({
|
|
|
2790
2790
|
/* @__PURE__ */ a("div", { className: "flex mt-2 justify-between", children: [
|
|
2791
2791
|
/* @__PURE__ */ a("div", { className: "w-full flex flex-col gap-2", children: [
|
|
2792
2792
|
/* @__PURE__ */ e(
|
|
2793
|
-
|
|
2793
|
+
Ce,
|
|
2794
2794
|
{
|
|
2795
2795
|
error: !!V,
|
|
2796
2796
|
value: w ?? "",
|
|
@@ -2798,7 +2798,7 @@ function ji({
|
|
|
2798
2798
|
open: b,
|
|
2799
2799
|
onOpenChange: C,
|
|
2800
2800
|
position: "item-aligned",
|
|
2801
|
-
disabled:
|
|
2801
|
+
disabled: g,
|
|
2802
2802
|
renderValue: (q) => {
|
|
2803
2803
|
if (!q)
|
|
2804
2804
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
@@ -2833,7 +2833,7 @@ function ji({
|
|
|
2833
2833
|
onValueChange: (q) => {
|
|
2834
2834
|
G(q);
|
|
2835
2835
|
},
|
|
2836
|
-
children:
|
|
2836
|
+
children: U.map(([q, L]) => {
|
|
2837
2837
|
const J = L.property, le = i && !ne(J) && J.dataType !== t?.dataType;
|
|
2838
2838
|
return /* @__PURE__ */ e(
|
|
2839
2839
|
or,
|
|
@@ -2858,13 +2858,13 @@ function ji({
|
|
|
2858
2858
|
}
|
|
2859
2859
|
)
|
|
2860
2860
|
] }),
|
|
2861
|
-
|
|
2861
|
+
u && t?.id && /* @__PURE__ */ e(
|
|
2862
2862
|
oe,
|
|
2863
2863
|
{
|
|
2864
2864
|
variant: "ghost",
|
|
2865
2865
|
className: "m-4",
|
|
2866
|
-
disabled:
|
|
2867
|
-
onClick: () =>
|
|
2866
|
+
disabled: g,
|
|
2867
|
+
onClick: () => f(!0),
|
|
2868
2868
|
children: /* @__PURE__ */ e(dt, {})
|
|
2869
2869
|
}
|
|
2870
2870
|
)
|
|
@@ -2873,23 +2873,23 @@ function ji({
|
|
|
2873
2873
|
d && /* @__PURE__ */ e(
|
|
2874
2874
|
Ii,
|
|
2875
2875
|
{
|
|
2876
|
-
showErrors:
|
|
2876
|
+
showErrors: c,
|
|
2877
2877
|
disabledId: i,
|
|
2878
2878
|
isNewProperty: !i,
|
|
2879
|
-
disabled:
|
|
2879
|
+
disabled: g,
|
|
2880
2880
|
autoUpdateId: l,
|
|
2881
2881
|
ref: A
|
|
2882
2882
|
}
|
|
2883
2883
|
),
|
|
2884
2884
|
B,
|
|
2885
|
-
/* @__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: g }) })
|
|
2886
2886
|
] }),
|
|
2887
|
-
|
|
2887
|
+
u && /* @__PURE__ */ e(
|
|
2888
2888
|
lt,
|
|
2889
2889
|
{
|
|
2890
2890
|
open: N,
|
|
2891
|
-
onAccept: () =>
|
|
2892
|
-
onCancel: () =>
|
|
2891
|
+
onAccept: () => u(t?.id, h),
|
|
2892
|
+
onCancel: () => f(!1),
|
|
2893
2893
|
title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
|
|
2894
2894
|
body: /* @__PURE__ */ a("div", { children: [
|
|
2895
2895
|
" This will ",
|
|
@@ -2917,7 +2917,7 @@ function Hi({
|
|
|
2917
2917
|
onOpenChange: r,
|
|
2918
2918
|
open: n
|
|
2919
2919
|
}) {
|
|
2920
|
-
const i =
|
|
2920
|
+
const i = _e(), l = t ? `import { EntityCollection } from "firecms";
|
|
2921
2921
|
|
|
2922
2922
|
const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.stringify(cr(t), null, " ") : "No collection selected";
|
|
2923
2923
|
return /* @__PURE__ */ a(
|
|
@@ -2953,10 +2953,10 @@ const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.
|
|
|
2953
2953
|
children: ({
|
|
2954
2954
|
className: o,
|
|
2955
2955
|
style: d,
|
|
2956
|
-
tokens:
|
|
2957
|
-
getLineProps:
|
|
2956
|
+
tokens: p,
|
|
2957
|
+
getLineProps: u,
|
|
2958
2958
|
getTokenProps: h
|
|
2959
|
-
}) => /* @__PURE__ */ e("pre", { style: d, className: "p-4 rounded text-sm", children:
|
|
2959
|
+
}) => /* @__PURE__ */ e("pre", { style: d, className: "p-4 rounded text-sm", children: p.map((m, c) => /* @__PURE__ */ e("div", { ...u({ line: m }), children: m.map((g, v) => /* @__PURE__ */ e("span", { ...h({ token: g }) }, v)) }, c)) })
|
|
2960
2960
|
}
|
|
2961
2961
|
)
|
|
2962
2962
|
] }),
|
|
@@ -3019,25 +3019,25 @@ function Gi({
|
|
|
3019
3019
|
setDirty: l,
|
|
3020
3020
|
reservedGroups: o,
|
|
3021
3021
|
extraIcon: d,
|
|
3022
|
-
getUser:
|
|
3023
|
-
getData:
|
|
3022
|
+
getUser: p,
|
|
3023
|
+
getData: u,
|
|
3024
3024
|
doCollectionInference: h,
|
|
3025
3025
|
propertyConfigs: m,
|
|
3026
|
-
collectionEditable:
|
|
3026
|
+
collectionEditable: c
|
|
3027
3027
|
}) {
|
|
3028
3028
|
const {
|
|
3029
|
-
values:
|
|
3029
|
+
values: g,
|
|
3030
3030
|
setFieldValue: v,
|
|
3031
3031
|
setFieldError: x,
|
|
3032
3032
|
setFieldTouched: y,
|
|
3033
3033
|
errors: P,
|
|
3034
3034
|
dirty: k
|
|
3035
|
-
} = K(), b =
|
|
3035
|
+
} = K(), b = _e(), C = Nr(), N = !C, [f, w] = $(), [_, M] = $(), [U, D] = $(), A = _ ? ae(_, U) : void 0, s = A ? I(g.properties, A.replaceAll(".", ".properties.")) : void 0, [V, G] = $(!1), [B, q] = $(!1), [L, J] = $(!1), [le, Me] = $([]), we = Y.useRef(g.propertiesOrder ? { "": g.propertiesOrder } : {});
|
|
3036
3036
|
de(() => {
|
|
3037
3037
|
l && l(k);
|
|
3038
3038
|
}, [k]);
|
|
3039
3039
|
const ue = h ? () => {
|
|
3040
|
-
h && (q(!0), h(
|
|
3040
|
+
h && (q(!0), h(g).then((F) => {
|
|
3041
3041
|
if (F && pt(F.properties), !F) {
|
|
3042
3042
|
b.open({
|
|
3043
3043
|
type: "error",
|
|
@@ -3045,8 +3045,8 @@ function Gi({
|
|
|
3045
3045
|
});
|
|
3046
3046
|
return;
|
|
3047
3047
|
}
|
|
3048
|
-
const
|
|
3049
|
-
if (
|
|
3048
|
+
const j = (F.properties ? Object.keys(F.properties) : []).filter((E) => !g.properties[E]);
|
|
3049
|
+
if (j.length === 0) {
|
|
3050
3050
|
b.open({
|
|
3051
3051
|
type: "info",
|
|
3052
3052
|
message: "No new properties found in existing data"
|
|
@@ -3054,43 +3054,43 @@ function Gi({
|
|
|
3054
3054
|
return;
|
|
3055
3055
|
}
|
|
3056
3056
|
const T = {
|
|
3057
|
-
...
|
|
3058
|
-
...
|
|
3057
|
+
...j.reduce((E, ie) => (E[ie] = (F.properties ?? {})[ie], E), {}),
|
|
3058
|
+
...g.properties
|
|
3059
3059
|
}, S = [
|
|
3060
|
-
...
|
|
3061
|
-
...
|
|
3060
|
+
...j,
|
|
3061
|
+
...g.propertiesOrder ?? []
|
|
3062
3062
|
];
|
|
3063
|
-
v("properties", T, !1),
|
|
3063
|
+
v("properties", T, !1), ve(S), Me(j);
|
|
3064
3064
|
}).finally(() => {
|
|
3065
3065
|
q(!1);
|
|
3066
3066
|
}));
|
|
3067
|
-
} : void 0, re = Q((F) => F ? we.current[F] ?? I(
|
|
3068
|
-
const T =
|
|
3069
|
-
v(T, F, !1), we.current[
|
|
3070
|
-
}, [v]),
|
|
3071
|
-
const T = F ? ae(F,
|
|
3067
|
+
} : void 0, re = Q((F) => F ? we.current[F] ?? I(g, be(F)) : we.current[""], [g]), ve = Q((F, j) => {
|
|
3068
|
+
const T = be(j);
|
|
3069
|
+
v(T, F, !1), we.current[j ?? ""] = F;
|
|
3070
|
+
}, [v]), ke = Q((F, j) => {
|
|
3071
|
+
const T = F ? ae(F, j) : void 0;
|
|
3072
3072
|
if (!T)
|
|
3073
3073
|
throw Error("collection editor miss config");
|
|
3074
3074
|
v(he(T), void 0, !1);
|
|
3075
|
-
const E = re(
|
|
3076
|
-
|
|
3077
|
-
}, [re, v,
|
|
3078
|
-
v(
|
|
3075
|
+
const E = re(j).filter((ie) => ie !== F);
|
|
3076
|
+
ve(E, j), J(!1), w(void 0), M(void 0), D(void 0);
|
|
3077
|
+
}, [re, v, ve]), Ge = (F, j) => {
|
|
3078
|
+
v(be(j), F, !1);
|
|
3079
3079
|
}, gt = ({
|
|
3080
3080
|
id: F,
|
|
3081
|
-
property:
|
|
3081
|
+
property: j
|
|
3082
3082
|
}) => {
|
|
3083
3083
|
if (!F)
|
|
3084
3084
|
throw Error("Need to include an ID when creating a new property");
|
|
3085
3085
|
v("properties", {
|
|
3086
|
-
...
|
|
3087
|
-
[F]:
|
|
3086
|
+
...g.properties ?? {},
|
|
3087
|
+
[F]: j
|
|
3088
3088
|
}, !1);
|
|
3089
|
-
const T = [...
|
|
3090
|
-
|
|
3089
|
+
const T = [...g.propertiesOrder ?? Object.keys(g.properties), F];
|
|
3090
|
+
ve(T), J(!1), C && (w(T.indexOf(F)), M(F)), D(void 0);
|
|
3091
3091
|
}, pe = ({
|
|
3092
3092
|
id: F,
|
|
3093
|
-
property:
|
|
3093
|
+
property: j,
|
|
3094
3094
|
previousId: T,
|
|
3095
3095
|
namespace: S
|
|
3096
3096
|
}) => {
|
|
@@ -3098,38 +3098,38 @@ function Gi({
|
|
|
3098
3098
|
if (T && T !== F) {
|
|
3099
3099
|
console.debug("onPropertyChanged, id change", {
|
|
3100
3100
|
id: F,
|
|
3101
|
-
property:
|
|
3101
|
+
property: j,
|
|
3102
3102
|
previousId: T,
|
|
3103
3103
|
namespace: S
|
|
3104
3104
|
});
|
|
3105
|
-
const
|
|
3106
|
-
|
|
3105
|
+
const Oe = ae(T, S), Vt = he(Oe), It = re(S).map((Xe) => Xe === T ? F : Xe).filter((Xe) => Xe !== void 0);
|
|
3106
|
+
ve(It, S), F && (w(It.indexOf(F)), M(F)), v(Vt, void 0, !1), y(Vt, !1, !1);
|
|
3107
3107
|
}
|
|
3108
3108
|
console.debug("onPropertyChanged", {
|
|
3109
3109
|
id: F,
|
|
3110
|
-
property:
|
|
3110
|
+
property: j,
|
|
3111
3111
|
previousId: T,
|
|
3112
3112
|
namespace: S,
|
|
3113
3113
|
propertyPath: ie
|
|
3114
|
-
}), ie && (v(ie,
|
|
3115
|
-
}, Ke = Q((F,
|
|
3116
|
-
const S = F ? ae(F,
|
|
3114
|
+
}), ie && (v(ie, j, !1), y(ie, !0, !1));
|
|
3115
|
+
}, Ke = Q((F, j, T) => {
|
|
3116
|
+
const S = F ? ae(F, j) : void 0;
|
|
3117
3117
|
if (console.debug("onPropertyErrorInternal", {
|
|
3118
3118
|
id: F,
|
|
3119
|
-
namespace:
|
|
3119
|
+
namespace: j,
|
|
3120
3120
|
error: T,
|
|
3121
3121
|
propertyPath: S
|
|
3122
3122
|
}), S) {
|
|
3123
3123
|
const E = T && Object.keys(T).length > 0;
|
|
3124
|
-
i(F,
|
|
3124
|
+
i(F, j, E ? T : void 0), x(he(S), E ? "Property error" : void 0);
|
|
3125
3125
|
}
|
|
3126
3126
|
}, []), We = () => {
|
|
3127
3127
|
w(void 0), M(void 0);
|
|
3128
|
-
}, Ze = _ && n?.current?.properties ? n.current.properties[_] : void 0, Je =
|
|
3128
|
+
}, Ze = _ && n?.current?.properties ? n.current.properties[_] : void 0, Je = g?.propertiesOrder === void 0 || g.propertiesOrder.length === 0, Re = g.propertiesOrder ? g.propertiesOrder : Object.keys(g.properties), Qe = Zt(() => g.ownerId ? p(g.ownerId) : null, [p, g.ownerId]), vt = Q((F, j) => {
|
|
3129
3129
|
console.debug("CollectionEditor: onPropertyClick", {
|
|
3130
3130
|
propertyKey: F,
|
|
3131
|
-
namespace:
|
|
3132
|
-
}), w(Re.indexOf(F)), M(F), D(
|
|
3131
|
+
namespace: j
|
|
3132
|
+
}), w(Re.indexOf(F)), M(F), D(j);
|
|
3133
3133
|
}, [Re]), yt = /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
3134
3134
|
/* @__PURE__ */ a("div", { className: fe(
|
|
3135
3135
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
@@ -3200,14 +3200,14 @@ function Gi({
|
|
|
3200
3200
|
{
|
|
3201
3201
|
className: "pl-8",
|
|
3202
3202
|
inferredPropertyKeys: le,
|
|
3203
|
-
selectedPropertyKey: _ ? ae(_,
|
|
3204
|
-
properties:
|
|
3205
|
-
additionalFields:
|
|
3203
|
+
selectedPropertyKey: _ ? ae(_, U) : void 0,
|
|
3204
|
+
properties: g.properties,
|
|
3205
|
+
additionalFields: g.additionalFields,
|
|
3206
3206
|
propertiesOrder: Re,
|
|
3207
3207
|
onPropertyClick: vt,
|
|
3208
3208
|
onPropertyMove: Ge,
|
|
3209
|
-
onPropertyRemove: r ?
|
|
3210
|
-
collectionEditable:
|
|
3209
|
+
onPropertyRemove: r ? ke : void 0,
|
|
3210
|
+
collectionEditable: c,
|
|
3211
3211
|
errors: P
|
|
3212
3212
|
}
|
|
3213
3213
|
) }),
|
|
@@ -3225,11 +3225,11 @@ function Gi({
|
|
|
3225
3225
|
)
|
|
3226
3226
|
] }),
|
|
3227
3227
|
!N && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ a(
|
|
3228
|
-
|
|
3228
|
+
Pe,
|
|
3229
3229
|
{
|
|
3230
3230
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
3231
3231
|
children: [
|
|
3232
|
-
A &&
|
|
3232
|
+
A && s && !ne(s) && /* @__PURE__ */ e(
|
|
3233
3233
|
sr,
|
|
3234
3234
|
{
|
|
3235
3235
|
inArray: !1,
|
|
@@ -3238,20 +3238,20 @@ function Gi({
|
|
|
3238
3238
|
allowDataInference: !r,
|
|
3239
3239
|
autoOpenTypeSelect: !1,
|
|
3240
3240
|
propertyKey: _,
|
|
3241
|
-
propertyNamespace:
|
|
3242
|
-
property:
|
|
3241
|
+
propertyNamespace: U,
|
|
3242
|
+
property: s,
|
|
3243
3243
|
onPropertyChanged: pe,
|
|
3244
|
-
onDelete:
|
|
3244
|
+
onDelete: ke,
|
|
3245
3245
|
onError: Ke,
|
|
3246
3246
|
forceShowErrors: t,
|
|
3247
3247
|
initialErrors: Ze,
|
|
3248
|
-
getData:
|
|
3248
|
+
getData: u,
|
|
3249
3249
|
propertyConfigs: m,
|
|
3250
|
-
collectionEditable:
|
|
3250
|
+
collectionEditable: c
|
|
3251
3251
|
},
|
|
3252
|
-
`edit_view_${
|
|
3252
|
+
`edit_view_${f}`
|
|
3253
3253
|
),
|
|
3254
|
-
!
|
|
3254
|
+
!s && /* @__PURE__ */ a("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
|
|
3255
3255
|
/* @__PURE__ */ e(O, { variant: "label", className: "", children: Je ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
3256
3256
|
/* @__PURE__ */ a(
|
|
3257
3257
|
z,
|
|
@@ -3265,39 +3265,39 @@ function Gi({
|
|
|
3265
3265
|
}
|
|
3266
3266
|
)
|
|
3267
3267
|
] }),
|
|
3268
|
-
|
|
3268
|
+
s && ne(s) && /* @__PURE__ */ e(O, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
3269
3269
|
]
|
|
3270
3270
|
}
|
|
3271
3271
|
) }),
|
|
3272
3272
|
N && /* @__PURE__ */ e(
|
|
3273
|
-
|
|
3273
|
+
Ie,
|
|
3274
3274
|
{
|
|
3275
3275
|
inArray: !1,
|
|
3276
|
-
open:
|
|
3277
|
-
autoUpdateId: !
|
|
3276
|
+
open: f !== void 0,
|
|
3277
|
+
autoUpdateId: !s,
|
|
3278
3278
|
allowDataInference: !r,
|
|
3279
3279
|
existingProperty: !0,
|
|
3280
3280
|
autoOpenTypeSelect: !1,
|
|
3281
3281
|
propertyKey: _,
|
|
3282
|
-
propertyNamespace:
|
|
3283
|
-
property:
|
|
3282
|
+
propertyNamespace: U,
|
|
3283
|
+
property: s,
|
|
3284
3284
|
onPropertyChanged: pe,
|
|
3285
|
-
onDelete:
|
|
3285
|
+
onDelete: ke,
|
|
3286
3286
|
onError: Ke,
|
|
3287
3287
|
forceShowErrors: t,
|
|
3288
3288
|
initialErrors: Ze,
|
|
3289
|
-
getData:
|
|
3289
|
+
getData: u,
|
|
3290
3290
|
propertyConfigs: m,
|
|
3291
|
-
collectionEditable:
|
|
3291
|
+
collectionEditable: c,
|
|
3292
3292
|
onOkClicked: N ? We : void 0
|
|
3293
3293
|
},
|
|
3294
|
-
`edit_view_${
|
|
3294
|
+
`edit_view_${f}`
|
|
3295
3295
|
)
|
|
3296
3296
|
] });
|
|
3297
|
-
return /* @__PURE__ */ a(
|
|
3297
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
3298
3298
|
yt,
|
|
3299
3299
|
/* @__PURE__ */ e(
|
|
3300
|
-
|
|
3300
|
+
Ie,
|
|
3301
3301
|
{
|
|
3302
3302
|
inArray: !1,
|
|
3303
3303
|
existingProperty: !1,
|
|
@@ -3307,17 +3307,17 @@ function Gi({
|
|
|
3307
3307
|
open: L,
|
|
3308
3308
|
onCancel: () => J(!1),
|
|
3309
3309
|
onPropertyChanged: gt,
|
|
3310
|
-
getData:
|
|
3310
|
+
getData: u,
|
|
3311
3311
|
allowDataInference: !r,
|
|
3312
3312
|
propertyConfigs: m,
|
|
3313
|
-
collectionEditable:
|
|
3314
|
-
existingPropertyKeys:
|
|
3313
|
+
collectionEditable: c,
|
|
3314
|
+
existingPropertyKeys: g.propertiesOrder
|
|
3315
3315
|
}
|
|
3316
3316
|
),
|
|
3317
3317
|
/* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
|
|
3318
3318
|
Hi,
|
|
3319
3319
|
{
|
|
3320
|
-
collection:
|
|
3320
|
+
collection: g,
|
|
3321
3321
|
open: V,
|
|
3322
3322
|
onOpenChange: G
|
|
3323
3323
|
}
|
|
@@ -3394,10 +3394,10 @@ function Zi({
|
|
|
3394
3394
|
getUser: l,
|
|
3395
3395
|
parentCollectionIds: o
|
|
3396
3396
|
}) {
|
|
3397
|
-
const { entityViews: d } = Ae(), [
|
|
3397
|
+
const { entityViews: d } = Ae(), [p, u] = Y.useState(), [h, m] = Y.useState(!1), [c, g] = Y.useState(), [v, x] = Y.useState(), {
|
|
3398
3398
|
values: y,
|
|
3399
3399
|
setFieldValue: P
|
|
3400
|
-
} = K(), k = t.subcollections ?? [], b = y.entityViews?.filter((
|
|
3400
|
+
} = K(), k = t.subcollections ?? [], b = y.entityViews?.filter((f) => typeof f == "string").map((f) => xr(f, d)).filter(Boolean) ?? [], C = t.entityViews?.filter((f) => typeof f != "string") ?? [], N = b.length + C.length;
|
|
3401
3401
|
return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
|
|
3402
3402
|
/* @__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: [
|
|
3403
3403
|
/* @__PURE__ */ a("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
@@ -3405,20 +3405,20 @@ function Zi({
|
|
|
3405
3405
|
"Subcollections of ",
|
|
3406
3406
|
y.name
|
|
3407
3407
|
] }),
|
|
3408
|
-
/* @__PURE__ */ a(
|
|
3409
|
-
k && k.length > 0 && /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(Bt, { children: k.map((
|
|
3408
|
+
/* @__PURE__ */ a(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: [
|
|
3409
|
+
k && k.length > 0 && /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(Bt, { children: k.map((f) => /* @__PURE__ */ a(
|
|
3410
3410
|
bt,
|
|
3411
3411
|
{
|
|
3412
3412
|
onClick: () => x({
|
|
3413
3413
|
isNewCollection: !1,
|
|
3414
|
-
editedCollectionId:
|
|
3414
|
+
editedCollectionId: f.id
|
|
3415
3415
|
}),
|
|
3416
3416
|
children: [
|
|
3417
3417
|
/* @__PURE__ */ e(
|
|
3418
3418
|
Ue,
|
|
3419
3419
|
{
|
|
3420
3420
|
align: "left",
|
|
3421
|
-
children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children:
|
|
3421
|
+
children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: f.name })
|
|
3422
3422
|
}
|
|
3423
3423
|
),
|
|
3424
3424
|
/* @__PURE__ */ e(
|
|
@@ -3430,7 +3430,7 @@ function Zi({
|
|
|
3430
3430
|
{
|
|
3431
3431
|
size: "small",
|
|
3432
3432
|
onClick: (w) => {
|
|
3433
|
-
w.preventDefault(), w.stopPropagation(),
|
|
3433
|
+
w.preventDefault(), w.stopPropagation(), u(f.id);
|
|
3434
3434
|
},
|
|
3435
3435
|
color: "inherit",
|
|
3436
3436
|
children: /* @__PURE__ */ e(dt, { size: "small" })
|
|
@@ -3440,7 +3440,7 @@ function Zi({
|
|
|
3440
3440
|
)
|
|
3441
3441
|
]
|
|
3442
3442
|
},
|
|
3443
|
-
|
|
3443
|
+
f.path
|
|
3444
3444
|
)) }) }),
|
|
3445
3445
|
/* @__PURE__ */ e(
|
|
3446
3446
|
z,
|
|
@@ -3471,14 +3471,14 @@ function Zi({
|
|
|
3471
3471
|
children: "More info"
|
|
3472
3472
|
}
|
|
3473
3473
|
), children: "Define your own custom views by uploading them with the CLI." }),
|
|
3474
|
-
/* @__PURE__ */ e(
|
|
3474
|
+
/* @__PURE__ */ e(R, { children: /* @__PURE__ */ a(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: [
|
|
3475
3475
|
/* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ a(Bt, { children: [
|
|
3476
|
-
b.map((
|
|
3476
|
+
b.map((f) => /* @__PURE__ */ a(bt, { children: [
|
|
3477
3477
|
/* @__PURE__ */ e(
|
|
3478
3478
|
Ue,
|
|
3479
3479
|
{
|
|
3480
3480
|
align: "left",
|
|
3481
|
-
children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children:
|
|
3481
|
+
children: /* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: f.name })
|
|
3482
3482
|
}
|
|
3483
3483
|
),
|
|
3484
3484
|
/* @__PURE__ */ e(
|
|
@@ -3490,7 +3490,7 @@ function Zi({
|
|
|
3490
3490
|
{
|
|
3491
3491
|
size: "small",
|
|
3492
3492
|
onClick: (w) => {
|
|
3493
|
-
w.preventDefault(), w.stopPropagation(), f
|
|
3493
|
+
w.preventDefault(), w.stopPropagation(), g(f.key);
|
|
3494
3494
|
},
|
|
3495
3495
|
color: "inherit",
|
|
3496
3496
|
children: /* @__PURE__ */ e(dt, { size: "small" })
|
|
@@ -3498,20 +3498,20 @@ function Zi({
|
|
|
3498
3498
|
) })
|
|
3499
3499
|
}
|
|
3500
3500
|
)
|
|
3501
|
-
] },
|
|
3502
|
-
C.map((
|
|
3501
|
+
] }, f.key)),
|
|
3502
|
+
C.map((f) => /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ a(
|
|
3503
3503
|
Ue,
|
|
3504
3504
|
{
|
|
3505
3505
|
align: "left",
|
|
3506
3506
|
children: [
|
|
3507
|
-
/* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children:
|
|
3507
|
+
/* @__PURE__ */ e(O, { variant: "subtitle2", className: "flex-grow", children: f.name }),
|
|
3508
3508
|
/* @__PURE__ */ a(O, { variant: "caption", className: "flex-grow", children: [
|
|
3509
3509
|
"This view is defined in code with key ",
|
|
3510
|
-
/* @__PURE__ */ e("code", { children:
|
|
3510
|
+
/* @__PURE__ */ e("code", { children: f.key })
|
|
3511
3511
|
] })
|
|
3512
3512
|
]
|
|
3513
3513
|
}
|
|
3514
|
-
) },
|
|
3514
|
+
) }, f.key))
|
|
3515
3515
|
] }) }),
|
|
3516
3516
|
/* @__PURE__ */ e(
|
|
3517
3517
|
z,
|
|
@@ -3528,36 +3528,36 @@ function Zi({
|
|
|
3528
3528
|
] })
|
|
3529
3529
|
] }) }),
|
|
3530
3530
|
/* @__PURE__ */ e("div", { style: { height: "52px" } }),
|
|
3531
|
-
|
|
3531
|
+
p && /* @__PURE__ */ e(
|
|
3532
3532
|
lt,
|
|
3533
3533
|
{
|
|
3534
|
-
open: !!
|
|
3534
|
+
open: !!p,
|
|
3535
3535
|
onAccept: () => {
|
|
3536
|
-
const
|
|
3537
|
-
id:
|
|
3536
|
+
const f = {
|
|
3537
|
+
id: p,
|
|
3538
3538
|
parentCollectionIds: [...o ?? [], t.id]
|
|
3539
3539
|
};
|
|
3540
|
-
console.debug("Deleting subcollection",
|
|
3540
|
+
console.debug("Deleting subcollection", f), n.deleteCollection(f), u(void 0);
|
|
3541
3541
|
},
|
|
3542
|
-
onCancel: () =>
|
|
3543
|
-
title: /* @__PURE__ */ e(
|
|
3544
|
-
body: /* @__PURE__ */ a(
|
|
3542
|
+
onCancel: () => u(void 0),
|
|
3543
|
+
title: /* @__PURE__ */ e(R, { children: "Delete this subcollection?" }),
|
|
3544
|
+
body: /* @__PURE__ */ a(R, { children: [
|
|
3545
3545
|
" This will ",
|
|
3546
3546
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
3547
3547
|
", only the collection in the CMS"
|
|
3548
3548
|
] })
|
|
3549
3549
|
}
|
|
3550
3550
|
),
|
|
3551
|
-
|
|
3551
|
+
c && /* @__PURE__ */ e(
|
|
3552
3552
|
lt,
|
|
3553
3553
|
{
|
|
3554
|
-
open: !!
|
|
3554
|
+
open: !!c,
|
|
3555
3555
|
onAccept: () => {
|
|
3556
|
-
P("entityViews", y.entityViews?.filter((
|
|
3556
|
+
P("entityViews", y.entityViews?.filter((f) => f !== c)), g(void 0);
|
|
3557
3557
|
},
|
|
3558
|
-
onCancel: () =>
|
|
3559
|
-
title: /* @__PURE__ */ e(
|
|
3560
|
-
body: /* @__PURE__ */ a(
|
|
3558
|
+
onCancel: () => g(void 0),
|
|
3559
|
+
title: /* @__PURE__ */ e(R, { children: "Remove this view?" }),
|
|
3560
|
+
body: /* @__PURE__ */ a(R, { children: [
|
|
3561
3561
|
"This will ",
|
|
3562
3562
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
3563
3563
|
", only the view in the CMS"
|
|
@@ -3584,8 +3584,8 @@ function Zi({
|
|
|
3584
3584
|
Wi,
|
|
3585
3585
|
{
|
|
3586
3586
|
open: h,
|
|
3587
|
-
onClose: (
|
|
3588
|
-
|
|
3587
|
+
onClose: (f) => {
|
|
3588
|
+
f && P("entityViews", [...y.entityViews ?? [], f]), m(!1);
|
|
3589
3589
|
}
|
|
3590
3590
|
}
|
|
3591
3591
|
)
|
|
@@ -4020,18 +4020,18 @@ function Ji({
|
|
|
4020
4020
|
onContinue: i,
|
|
4021
4021
|
existingCollectionPaths: l
|
|
4022
4022
|
}) {
|
|
4023
|
-
const [o, d] = $(!1), [
|
|
4023
|
+
const [o, d] = $(!1), [p, u] = $();
|
|
4024
4024
|
de(() => {
|
|
4025
4025
|
r && l && (d(!0), r(t).then((v) => {
|
|
4026
4026
|
const x = v.filter((y) => !(l ?? []).find((P) => P.trim().toLowerCase() === y.trim().toLowerCase()));
|
|
4027
|
-
|
|
4027
|
+
u(x);
|
|
4028
4028
|
}).finally(() => d(!1)));
|
|
4029
4029
|
}, [l, t, r]);
|
|
4030
4030
|
const {
|
|
4031
4031
|
values: h,
|
|
4032
4032
|
setFieldValue: m,
|
|
4033
|
-
setValues:
|
|
4034
|
-
submitCount:
|
|
4033
|
+
setValues: c,
|
|
4034
|
+
submitCount: g
|
|
4035
4035
|
} = K();
|
|
4036
4036
|
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: [
|
|
4037
4037
|
/* @__PURE__ */ e(
|
|
@@ -4055,8 +4055,8 @@ function Ji({
|
|
|
4055
4055
|
}
|
|
4056
4056
|
),
|
|
4057
4057
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
|
|
4058
|
-
o && !
|
|
4059
|
-
|
|
4058
|
+
o && !p && /* @__PURE__ */ e(De, { size: "small" }),
|
|
4059
|
+
p?.map((v, x) => /* @__PURE__ */ e(
|
|
4060
4060
|
st,
|
|
4061
4061
|
{
|
|
4062
4062
|
colorScheme: "cyanLighter",
|
|
@@ -4068,7 +4068,7 @@ function Ji({
|
|
|
4068
4068
|
},
|
|
4069
4069
|
v
|
|
4070
4070
|
)),
|
|
4071
|
-
!o && (
|
|
4071
|
+
!o && (p ?? [])?.length === 0 && /* @__PURE__ */ e(O, { variant: "caption", children: "No suggestions" })
|
|
4072
4072
|
] })
|
|
4073
4073
|
] }),
|
|
4074
4074
|
/* @__PURE__ */ a("div", { className: "my-2", children: [
|
|
@@ -4088,7 +4088,7 @@ function Ji({
|
|
|
4088
4088
|
subtitle: "A collection of products with images, prices and stock",
|
|
4089
4089
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Lt.icon }),
|
|
4090
4090
|
onClick: () => {
|
|
4091
|
-
|
|
4091
|
+
c(Lt), i();
|
|
4092
4092
|
}
|
|
4093
4093
|
}
|
|
4094
4094
|
),
|
|
@@ -4099,7 +4099,7 @@ function Ji({
|
|
|
4099
4099
|
subtitle: "A collection of users with emails, names and roles",
|
|
4100
4100
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: $t.icon }),
|
|
4101
4101
|
onClick: () => {
|
|
4102
|
-
|
|
4102
|
+
c($t), i();
|
|
4103
4103
|
}
|
|
4104
4104
|
}
|
|
4105
4105
|
),
|
|
@@ -4110,7 +4110,7 @@ function Ji({
|
|
|
4110
4110
|
subtitle: "A collection of blog posts with images, authors and complex content",
|
|
4111
4111
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: qt.icon }),
|
|
4112
4112
|
onClick: () => {
|
|
4113
|
-
|
|
4113
|
+
c(qt), i();
|
|
4114
4114
|
}
|
|
4115
4115
|
}
|
|
4116
4116
|
),
|
|
@@ -4121,7 +4121,7 @@ function Ji({
|
|
|
4121
4121
|
subtitle: "A collection of pages with images, authors and complex content",
|
|
4122
4122
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Yt.icon }),
|
|
4123
4123
|
onClick: () => {
|
|
4124
|
-
|
|
4124
|
+
c(Yt), i();
|
|
4125
4125
|
}
|
|
4126
4126
|
}
|
|
4127
4127
|
)
|
|
@@ -4174,32 +4174,32 @@ function Qi({
|
|
|
4174
4174
|
setFieldValue: i,
|
|
4175
4175
|
setFieldTouched: l,
|
|
4176
4176
|
values: o
|
|
4177
|
-
} = K(), [d,
|
|
4177
|
+
} = K(), [d, p] = $(void 0), u = Y.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), h = d ? d.id : void 0, m = d || void 0, c = ({
|
|
4178
4178
|
id: v,
|
|
4179
4179
|
property: x,
|
|
4180
4180
|
previousId: y,
|
|
4181
4181
|
namespace: P
|
|
4182
4182
|
}) => {
|
|
4183
|
-
const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = (
|
|
4184
|
-
const _ =
|
|
4185
|
-
i(_,
|
|
4183
|
+
const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = (f) => f ? u.current[f] ?? I(o, be(f)) : u.current[""], N = (f, w) => {
|
|
4184
|
+
const _ = be(w);
|
|
4185
|
+
i(_, f, !1), u.current[w ?? ""] = f;
|
|
4186
4186
|
};
|
|
4187
4187
|
if (y && y !== v) {
|
|
4188
|
-
const
|
|
4188
|
+
const f = ae(y, P), w = he(f), M = C(P).map((D) => D === y ? v : D).filter((D) => D !== void 0);
|
|
4189
4189
|
N(M, P);
|
|
4190
|
-
const
|
|
4191
|
-
Object.keys(
|
|
4192
|
-
|
|
4193
|
-
}), t.setHeadersMapping(
|
|
4190
|
+
const U = { ...t.headersMapping };
|
|
4191
|
+
Object.keys(U).forEach((D) => {
|
|
4192
|
+
U[D] === y && (U[D] = v ?? "");
|
|
4193
|
+
}), t.setHeadersMapping(U), i(w, void 0, !1), l(w, !1, !1);
|
|
4194
4194
|
}
|
|
4195
4195
|
b && (i(b, x, !1), l(b, !0, !1));
|
|
4196
|
-
},
|
|
4196
|
+
}, g = async ({
|
|
4197
4197
|
id: v,
|
|
4198
4198
|
importKey: x,
|
|
4199
4199
|
property: y,
|
|
4200
4200
|
namespace: P
|
|
4201
4201
|
}) => {
|
|
4202
|
-
const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = t.importData.map((
|
|
4202
|
+
const k = v ? ae(v, P) : void 0, b = k ? he(k) : void 0, C = t.importData.map((f) => I(f, x)), N = {
|
|
4203
4203
|
...ti(C, y, rr),
|
|
4204
4204
|
editable: !0
|
|
4205
4205
|
};
|
|
@@ -4227,7 +4227,7 @@ function Qi({
|
|
|
4227
4227
|
propertyKey: x,
|
|
4228
4228
|
onPropertyNameChanged: (P, k) => i(`properties.${P}.name`, k, !1),
|
|
4229
4229
|
onEditClick: () => {
|
|
4230
|
-
!x || !v ||
|
|
4230
|
+
!x || !v || p({
|
|
4231
4231
|
...v,
|
|
4232
4232
|
id: x,
|
|
4233
4233
|
editable: !0
|
|
@@ -4238,7 +4238,7 @@ function Qi({
|
|
|
4238
4238
|
{
|
|
4239
4239
|
property: v,
|
|
4240
4240
|
disabled: !1,
|
|
4241
|
-
onPropertyChanged: (P) =>
|
|
4241
|
+
onPropertyChanged: (P) => g({
|
|
4242
4242
|
...P,
|
|
4243
4243
|
importKey: y
|
|
4244
4244
|
}),
|
|
@@ -4252,21 +4252,21 @@ function Qi({
|
|
|
4252
4252
|
)
|
|
4253
4253
|
] }),
|
|
4254
4254
|
/* @__PURE__ */ e(
|
|
4255
|
-
|
|
4255
|
+
Ie,
|
|
4256
4256
|
{
|
|
4257
4257
|
open: d !== void 0,
|
|
4258
4258
|
propertyKey: h,
|
|
4259
4259
|
property: m,
|
|
4260
4260
|
inArray: !1,
|
|
4261
4261
|
autoUpdateId: !1,
|
|
4262
|
-
onPropertyChanged:
|
|
4262
|
+
onPropertyChanged: c,
|
|
4263
4263
|
allowDataInference: !1,
|
|
4264
4264
|
collectionEditable: n,
|
|
4265
4265
|
onOkClicked: () => {
|
|
4266
|
-
|
|
4266
|
+
p(void 0);
|
|
4267
4267
|
},
|
|
4268
4268
|
onCancel: () => {
|
|
4269
|
-
|
|
4269
|
+
p(void 0);
|
|
4270
4270
|
},
|
|
4271
4271
|
autoOpenTypeSelect: !1,
|
|
4272
4272
|
existingProperty: !1,
|
|
@@ -4283,17 +4283,17 @@ function Xi({
|
|
|
4283
4283
|
propertyConfigs: i,
|
|
4284
4284
|
disabled: l
|
|
4285
4285
|
}) {
|
|
4286
|
-
const o = t ? Kt(t) : null, d = t ? $e(t, i) : null, [
|
|
4286
|
+
const o = t ? Kt(t) : null, d = t ? $e(t, i) : null, [p, u] = $(!1);
|
|
4287
4287
|
return /* @__PURE__ */ e(
|
|
4288
4288
|
te,
|
|
4289
4289
|
{
|
|
4290
4290
|
title: t && d ? `${d?.name} - ${t.dataType}` : void 0,
|
|
4291
|
-
open:
|
|
4291
|
+
open: p ? !1 : void 0,
|
|
4292
4292
|
children: /* @__PURE__ */ e(
|
|
4293
|
-
|
|
4293
|
+
Ce,
|
|
4294
4294
|
{
|
|
4295
|
-
open:
|
|
4296
|
-
onOpenChange:
|
|
4295
|
+
open: p,
|
|
4296
|
+
onOpenChange: u,
|
|
4297
4297
|
invisible: !0,
|
|
4298
4298
|
className: "w-full",
|
|
4299
4299
|
disabled: l,
|
|
@@ -4355,24 +4355,24 @@ function en({ importConfig: t, properties: r, propertiesOrder: n }) {
|
|
|
4355
4355
|
}
|
|
4356
4356
|
function dr(t, r = "") {
|
|
4357
4357
|
const n = Object.keys(t).reduce((o, d) => {
|
|
4358
|
-
const
|
|
4359
|
-
if (
|
|
4360
|
-
const
|
|
4358
|
+
const p = t[d], u = kr(d), h = r ? `${r}.${u}` : u;
|
|
4359
|
+
if (p.dataType === "map" && p.properties) {
|
|
4360
|
+
const g = dr(p.properties, h);
|
|
4361
4361
|
return {
|
|
4362
4362
|
headersMapping: { ...o.headersMapping, [d]: h },
|
|
4363
4363
|
properties: {
|
|
4364
4364
|
...o.properties,
|
|
4365
|
-
[
|
|
4366
|
-
...
|
|
4367
|
-
properties:
|
|
4368
|
-
propertiesOrder: Object.keys(
|
|
4365
|
+
[u]: {
|
|
4366
|
+
...p,
|
|
4367
|
+
properties: g.properties,
|
|
4368
|
+
propertiesOrder: Object.keys(g.properties)
|
|
4369
4369
|
}
|
|
4370
4370
|
}
|
|
4371
4371
|
};
|
|
4372
4372
|
}
|
|
4373
4373
|
const m = {
|
|
4374
4374
|
...o.properties,
|
|
4375
|
-
[
|
|
4375
|
+
[u]: p
|
|
4376
4376
|
};
|
|
4377
4377
|
return {
|
|
4378
4378
|
headersMapping: { ...o.headersMapping, [d]: h },
|
|
@@ -4399,7 +4399,7 @@ function ur(t) {
|
|
|
4399
4399
|
fullHeight: !0,
|
|
4400
4400
|
scrollable: !1,
|
|
4401
4401
|
maxWidth: "7xl",
|
|
4402
|
-
onOpenChange: (
|
|
4402
|
+
onOpenChange: (p) => p ? void 0 : d(),
|
|
4403
4403
|
children: [
|
|
4404
4404
|
r && /* @__PURE__ */ e(
|
|
4405
4405
|
tn,
|
|
@@ -4423,13 +4423,13 @@ function ur(t) {
|
|
|
4423
4423
|
);
|
|
4424
4424
|
}
|
|
4425
4425
|
function tn(t) {
|
|
4426
|
-
const { propertyConfigs: r } = Ae(), n =
|
|
4426
|
+
const { propertyConfigs: r } = Ae(), n = Ne(), i = Te(), {
|
|
4427
4427
|
topLevelNavigation: l,
|
|
4428
4428
|
collections: o
|
|
4429
|
-
} = n, d = t.initialValues,
|
|
4429
|
+
} = n, d = t.initialValues, p = !d?.path && (t.parentCollectionIds ?? []).length === 0, u = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], h = u.map((b) => b.path.trim().toLowerCase()), m = u.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [c, g] = je.useState(), [v, x] = je.useState(!1);
|
|
4430
4430
|
if (de(() => {
|
|
4431
4431
|
try {
|
|
4432
|
-
n.initialised && (t.editedCollectionId ?
|
|
4432
|
+
n.initialised && (t.editedCollectionId ? g(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : g(void 0), x(!0));
|
|
4433
4433
|
} catch (b) {
|
|
4434
4434
|
console.error(b);
|
|
4435
4435
|
}
|
|
@@ -4437,9 +4437,9 @@ function tn(t) {
|
|
|
4437
4437
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
4438
4438
|
const {
|
|
4439
4439
|
groups: y
|
|
4440
|
-
} = l, P =
|
|
4441
|
-
...
|
|
4442
|
-
id:
|
|
4440
|
+
} = l, P = c ? {
|
|
4441
|
+
...c,
|
|
4442
|
+
id: c.id ?? c.path ?? _t(16)
|
|
4443
4443
|
} : void 0, k = P ? nn(P, r) : {
|
|
4444
4444
|
id: d?.path ?? _t(16),
|
|
4445
4445
|
path: d?.path ?? "",
|
|
@@ -4457,9 +4457,9 @@ function tn(t) {
|
|
|
4457
4457
|
initialValues: k,
|
|
4458
4458
|
existingPaths: h,
|
|
4459
4459
|
existingIds: m,
|
|
4460
|
-
includeTemplates:
|
|
4461
|
-
collection:
|
|
4462
|
-
setCollection:
|
|
4460
|
+
includeTemplates: p,
|
|
4461
|
+
collection: c,
|
|
4462
|
+
setCollection: g,
|
|
4463
4463
|
groups: y,
|
|
4464
4464
|
propertyConfigs: r
|
|
4465
4465
|
}
|
|
@@ -4473,12 +4473,12 @@ function rn({
|
|
|
4473
4473
|
fullPath: l,
|
|
4474
4474
|
collectionInference: o,
|
|
4475
4475
|
handleClose: d,
|
|
4476
|
-
reservedGroups:
|
|
4477
|
-
extraView:
|
|
4476
|
+
reservedGroups: p,
|
|
4477
|
+
extraView: u,
|
|
4478
4478
|
handleCancel: h,
|
|
4479
4479
|
setFormDirty: m,
|
|
4480
|
-
pathSuggestions:
|
|
4481
|
-
getUser:
|
|
4480
|
+
pathSuggestions: c,
|
|
4481
|
+
getUser: g,
|
|
4482
4482
|
parentCollection: v,
|
|
4483
4483
|
getData: x,
|
|
4484
4484
|
existingPaths: y,
|
|
@@ -4487,23 +4487,23 @@ function rn({
|
|
|
4487
4487
|
collection: b,
|
|
4488
4488
|
setCollection: C,
|
|
4489
4489
|
initialValues: N,
|
|
4490
|
-
propertyConfigs:
|
|
4490
|
+
propertyConfigs: f,
|
|
4491
4491
|
groups: w
|
|
4492
4492
|
}) {
|
|
4493
|
-
const _ = hi(), M =
|
|
4493
|
+
const _ = hi(), M = Ne(), U = _e(), D = Le({}), A = t ? k ? "welcome" : "details" : "properties", [s, V] = $(A), [G, B] = je.useState(), q = (T) => {
|
|
4494
4494
|
const S = T.id || T.path;
|
|
4495
4495
|
return r.saveCollection({
|
|
4496
4496
|
id: S,
|
|
4497
4497
|
collectionData: T,
|
|
4498
4498
|
previousId: n,
|
|
4499
4499
|
parentCollectionIds: i
|
|
4500
|
-
}).then(() => (B(void 0), !0)).catch((E) => (B(E), console.error(E),
|
|
4500
|
+
}).then(() => (B(void 0), !0)).catch((E) => (B(E), console.error(E), U.open({
|
|
4501
4501
|
type: "error",
|
|
4502
4502
|
message: "Error persisting collection: " + (E.message ?? "Details in the console")
|
|
4503
4503
|
}), !1));
|
|
4504
4504
|
}, L = Q(() => {
|
|
4505
|
-
|
|
4506
|
-
}, [
|
|
4505
|
+
s === "details" ? _.inUse ? V("import_data_saving") : V(u ? "extra_view" : "properties") : V(s === "welcome" ? "details" : s === "import_data_mapping" ? "import_data_preview" : s === "import_data_preview" ? "details" : s === "extra_view" ? "properties" : "details");
|
|
4506
|
+
}, [s, _.inUse, u]), J = Q((T) => {
|
|
4507
4507
|
if (o)
|
|
4508
4508
|
return o?.(T.path, T.collectionGroup ?? !1, i ?? []);
|
|
4509
4509
|
}, [o, i]), le = Q(async (T) => {
|
|
@@ -4522,7 +4522,7 @@ function rn({
|
|
|
4522
4522
|
values: E
|
|
4523
4523
|
}), E) : (E.propertiesOrder = Object.keys(E.properties), E);
|
|
4524
4524
|
} catch (S) {
|
|
4525
|
-
return console.error(S),
|
|
4525
|
+
return console.error(S), U.open({
|
|
4526
4526
|
type: "error",
|
|
4527
4527
|
message: "Error inferring collection: " + (S.message ?? "Details in the console")
|
|
4528
4528
|
}), T;
|
|
@@ -4538,7 +4538,7 @@ function rn({
|
|
|
4538
4538
|
});
|
|
4539
4539
|
return;
|
|
4540
4540
|
}
|
|
4541
|
-
|
|
4541
|
+
s === "welcome" ? (L(), S.resetForm({ values: T })) : s === "details" ? u || _.inUse ? (S.resetForm({ values: T }), L()) : t ? le(T).then((E) => {
|
|
4542
4542
|
S.resetForm({
|
|
4543
4543
|
values: E ?? T,
|
|
4544
4544
|
touched: {
|
|
@@ -4548,11 +4548,11 @@ function rn({
|
|
|
4548
4548
|
});
|
|
4549
4549
|
}).finally(() => {
|
|
4550
4550
|
L();
|
|
4551
|
-
}) : (S.resetForm({ values: T }), L()) :
|
|
4551
|
+
}) : (S.resetForm({ values: T }), L()) : s === "extra_view" ? (L(), S.resetForm({ values: T })) : s === "import_data_mapping" || s === "import_data_preview" ? L() : s === "properties" ? q(T).then(() => {
|
|
4552
4552
|
S.resetForm({ values: N }), L(), d(T);
|
|
4553
4553
|
}) : (L(), S.resetForm({ values: T }));
|
|
4554
4554
|
} catch (E) {
|
|
4555
|
-
|
|
4555
|
+
U.open({
|
|
4556
4556
|
type: "error",
|
|
4557
4557
|
message: "Error persisting collection: " + (E.message ?? "Details in the console")
|
|
4558
4558
|
}), console.error(E), S.resetForm({ values: T });
|
|
@@ -4560,27 +4560,27 @@ function rn({
|
|
|
4560
4560
|
},
|
|
4561
4561
|
validation: (T) => {
|
|
4562
4562
|
let S = {};
|
|
4563
|
-
const E = (
|
|
4563
|
+
const E = (s === "properties" || s === "subcollections" || s === "details") && vi;
|
|
4564
4564
|
if (E)
|
|
4565
4565
|
try {
|
|
4566
4566
|
E.validateSync(T, { abortEarly: !1 });
|
|
4567
4567
|
} catch (ie) {
|
|
4568
|
-
ie.inner.forEach((
|
|
4569
|
-
S[
|
|
4568
|
+
ie.inner.forEach((Oe) => {
|
|
4569
|
+
S[Oe.path] = Oe.message;
|
|
4570
4570
|
});
|
|
4571
4571
|
}
|
|
4572
|
-
if (
|
|
4572
|
+
if (s === "properties" && (S = { ...S, ...D.current }), s === "details") {
|
|
4573
4573
|
const ie = Ht(T.path, t, y, T.id);
|
|
4574
4574
|
ie && (S.path = ie);
|
|
4575
|
-
const
|
|
4576
|
-
|
|
4575
|
+
const Oe = an(T.id, t, y, P);
|
|
4576
|
+
Oe && (S.id = Oe);
|
|
4577
4577
|
}
|
|
4578
4578
|
return S;
|
|
4579
4579
|
}
|
|
4580
4580
|
}), {
|
|
4581
4581
|
values: re,
|
|
4582
|
-
setFieldValue:
|
|
4583
|
-
isSubmitting:
|
|
4582
|
+
setFieldValue: ve,
|
|
4583
|
+
isSubmitting: ke,
|
|
4584
4584
|
dirty: Ge,
|
|
4585
4585
|
submitCount: gt
|
|
4586
4586
|
} = ue, pe = re.path, Ke = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + pe : pe, We = Ht(pe, t, y, re.id), Ze = !We && i ? M.convertIdsToPaths(i) : void 0, Je = We ? void 0 : M.resolveAliasesFrom(Ke), Re = Je && x ? () => x(Je, Ze ?? []) : void 0;
|
|
@@ -4590,18 +4590,18 @@ function rn({
|
|
|
4590
4590
|
function Qe(T) {
|
|
4591
4591
|
_.setInUse(!0), ri(T, rr).then((S) => {
|
|
4592
4592
|
const E = dr(S);
|
|
4593
|
-
|
|
4593
|
+
ve("properties", E.properties), ve("propertiesOrder", Object.keys(E.properties)), _.setIdColumn(E.idColumn), _.setImportData(T), _.setHeadersMapping(E.headersMapping), _.setOriginProperties(E.properties);
|
|
4594
4594
|
});
|
|
4595
4595
|
}
|
|
4596
4596
|
const vt = !!re.name && !!re.id, yt = () => {
|
|
4597
4597
|
const T = { ...re.properties };
|
|
4598
|
-
_.idColumn && delete T[_.idColumn],
|
|
4599
|
-
},
|
|
4600
|
-
return /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(kt, { value: ue, children: /* @__PURE__ */ a(
|
|
4598
|
+
_.idColumn && delete T[_.idColumn], ve("properties", T), L();
|
|
4599
|
+
}, j = b?.editable === void 0 || b?.editable === !0 || t;
|
|
4600
|
+
return /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(kt, { value: ue, children: /* @__PURE__ */ a(R, { children: [
|
|
4601
4601
|
!t && /* @__PURE__ */ a(
|
|
4602
4602
|
Hr,
|
|
4603
4603
|
{
|
|
4604
|
-
value:
|
|
4604
|
+
value: s,
|
|
4605
4605
|
className: fe(wt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
4606
4606
|
onValueChange: (T) => V(T),
|
|
4607
4607
|
children: [
|
|
@@ -4621,9 +4621,9 @@ function rn({
|
|
|
4621
4621
|
"flex-grow flex flex-col relative"
|
|
4622
4622
|
),
|
|
4623
4623
|
children: [
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4624
|
+
s === "loading" && /* @__PURE__ */ e(Nt, {}),
|
|
4625
|
+
s === "extra_view" && pe && u?.View && /* @__PURE__ */ e(u.View, { path: pe }),
|
|
4626
|
+
s === "welcome" && /* @__PURE__ */ e(
|
|
4627
4627
|
Ji,
|
|
4628
4628
|
{
|
|
4629
4629
|
path: pe,
|
|
@@ -4632,18 +4632,18 @@ function rn({
|
|
|
4632
4632
|
},
|
|
4633
4633
|
existingCollectionPaths: y,
|
|
4634
4634
|
parentCollection: v,
|
|
4635
|
-
pathSuggestions:
|
|
4635
|
+
pathSuggestions: c
|
|
4636
4636
|
}
|
|
4637
4637
|
),
|
|
4638
|
-
|
|
4638
|
+
s === "import_data_mapping" && _ && /* @__PURE__ */ e(
|
|
4639
4639
|
Qi,
|
|
4640
4640
|
{
|
|
4641
4641
|
importConfig: _,
|
|
4642
|
-
collectionEditable:
|
|
4643
|
-
propertyConfigs:
|
|
4642
|
+
collectionEditable: j,
|
|
4643
|
+
propertyConfigs: f
|
|
4644
4644
|
}
|
|
4645
4645
|
),
|
|
4646
|
-
|
|
4646
|
+
s === "import_data_preview" && _ && /* @__PURE__ */ e(
|
|
4647
4647
|
en,
|
|
4648
4648
|
{
|
|
4649
4649
|
importConfig: _,
|
|
@@ -4651,21 +4651,21 @@ function rn({
|
|
|
4651
4651
|
propertiesOrder: re.propertiesOrder
|
|
4652
4652
|
}
|
|
4653
4653
|
),
|
|
4654
|
-
|
|
4654
|
+
s === "import_data_saving" && _ && /* @__PURE__ */ e(
|
|
4655
4655
|
fi,
|
|
4656
4656
|
{
|
|
4657
4657
|
importConfig: _,
|
|
4658
4658
|
collection: re,
|
|
4659
4659
|
path: pe,
|
|
4660
4660
|
onImportSuccess: async (T) => {
|
|
4661
|
-
|
|
4661
|
+
U.open({
|
|
4662
4662
|
type: "info",
|
|
4663
4663
|
message: "Data imported successfully"
|
|
4664
4664
|
}), await q(re), d(T);
|
|
4665
4665
|
}
|
|
4666
4666
|
}
|
|
4667
4667
|
),
|
|
4668
|
-
|
|
4668
|
+
s === "details" && /* @__PURE__ */ e(
|
|
4669
4669
|
yi,
|
|
4670
4670
|
{
|
|
4671
4671
|
existingPaths: y,
|
|
@@ -4676,23 +4676,23 @@ function rn({
|
|
|
4676
4676
|
isNewCollection: t
|
|
4677
4677
|
}
|
|
4678
4678
|
),
|
|
4679
|
-
|
|
4679
|
+
s === "subcollections" && b && /* @__PURE__ */ e(
|
|
4680
4680
|
Zi,
|
|
4681
4681
|
{
|
|
4682
4682
|
parentCollection: v,
|
|
4683
4683
|
configController: r,
|
|
4684
|
-
getUser:
|
|
4684
|
+
getUser: g,
|
|
4685
4685
|
collectionInference: o,
|
|
4686
4686
|
parentCollectionIds: i,
|
|
4687
4687
|
collection: b
|
|
4688
4688
|
}
|
|
4689
4689
|
),
|
|
4690
|
-
|
|
4690
|
+
s === "properties" && /* @__PURE__ */ e(
|
|
4691
4691
|
Gi,
|
|
4692
4692
|
{
|
|
4693
4693
|
showErrors: gt > 0,
|
|
4694
4694
|
isNewCollection: t,
|
|
4695
|
-
reservedGroups:
|
|
4695
|
+
reservedGroups: p,
|
|
4696
4696
|
onPropertyError: (T, S, E) => {
|
|
4697
4697
|
const ie = Ft({
|
|
4698
4698
|
...D.current,
|
|
@@ -4700,28 +4700,28 @@ function rn({
|
|
|
4700
4700
|
}, !0);
|
|
4701
4701
|
D.current = ie, ue.validate();
|
|
4702
4702
|
},
|
|
4703
|
-
getUser:
|
|
4703
|
+
getUser: g,
|
|
4704
4704
|
getData: Re,
|
|
4705
4705
|
doCollectionInference: J,
|
|
4706
|
-
propertyConfigs:
|
|
4707
|
-
collectionEditable:
|
|
4708
|
-
extraIcon:
|
|
4706
|
+
propertyConfigs: f,
|
|
4707
|
+
collectionEditable: j,
|
|
4708
|
+
extraIcon: u?.icon && /* @__PURE__ */ e(
|
|
4709
4709
|
oe,
|
|
4710
4710
|
{
|
|
4711
4711
|
color: "primary",
|
|
4712
4712
|
onClick: () => V("extra_view"),
|
|
4713
|
-
children:
|
|
4713
|
+
children: u.icon
|
|
4714
4714
|
}
|
|
4715
4715
|
)
|
|
4716
4716
|
}
|
|
4717
4717
|
),
|
|
4718
|
-
|
|
4718
|
+
s !== "welcome" && /* @__PURE__ */ a(
|
|
4719
4719
|
ze,
|
|
4720
4720
|
{
|
|
4721
4721
|
position: "absolute",
|
|
4722
4722
|
children: [
|
|
4723
4723
|
G && /* @__PURE__ */ e(Wt, { error: G }),
|
|
4724
|
-
t && k &&
|
|
4724
|
+
t && k && s === "import_data_mapping" && /* @__PURE__ */ a(
|
|
4725
4725
|
z,
|
|
4726
4726
|
{
|
|
4727
4727
|
variant: "text",
|
|
@@ -4733,7 +4733,7 @@ function rn({
|
|
|
4733
4733
|
]
|
|
4734
4734
|
}
|
|
4735
4735
|
),
|
|
4736
|
-
t && k &&
|
|
4736
|
+
t && k && s === "import_data_preview" && /* @__PURE__ */ a(
|
|
4737
4737
|
z,
|
|
4738
4738
|
{
|
|
4739
4739
|
variant: "text",
|
|
@@ -4747,7 +4747,7 @@ function rn({
|
|
|
4747
4747
|
]
|
|
4748
4748
|
}
|
|
4749
4749
|
),
|
|
4750
|
-
t && k &&
|
|
4750
|
+
t && k && s === "details" && /* @__PURE__ */ a(
|
|
4751
4751
|
z,
|
|
4752
4752
|
{
|
|
4753
4753
|
variant: "text",
|
|
@@ -4759,7 +4759,7 @@ function rn({
|
|
|
4759
4759
|
]
|
|
4760
4760
|
}
|
|
4761
4761
|
),
|
|
4762
|
-
t &&
|
|
4762
|
+
t && s === "properties" && /* @__PURE__ */ a(
|
|
4763
4763
|
z,
|
|
4764
4764
|
{
|
|
4765
4765
|
variant: "text",
|
|
@@ -4781,7 +4781,7 @@ function rn({
|
|
|
4781
4781
|
children: "Cancel"
|
|
4782
4782
|
}
|
|
4783
4783
|
),
|
|
4784
|
-
t &&
|
|
4784
|
+
t && s === "import_data_mapping" && /* @__PURE__ */ e(
|
|
4785
4785
|
z,
|
|
4786
4786
|
{
|
|
4787
4787
|
variant: "filled",
|
|
@@ -4790,7 +4790,7 @@ function rn({
|
|
|
4790
4790
|
children: "Next"
|
|
4791
4791
|
}
|
|
4792
4792
|
),
|
|
4793
|
-
t &&
|
|
4793
|
+
t && s === "import_data_preview" && /* @__PURE__ */ e(
|
|
4794
4794
|
z,
|
|
4795
4795
|
{
|
|
4796
4796
|
variant: "filled",
|
|
@@ -4801,18 +4801,18 @@ function rn({
|
|
|
4801
4801
|
children: "Next"
|
|
4802
4802
|
}
|
|
4803
4803
|
),
|
|
4804
|
-
t && (
|
|
4804
|
+
t && (s === "details" || s === "properties") && /* @__PURE__ */ a(
|
|
4805
4805
|
Mt,
|
|
4806
4806
|
{
|
|
4807
4807
|
variant: "filled",
|
|
4808
4808
|
color: "primary",
|
|
4809
4809
|
type: "submit",
|
|
4810
|
-
loading:
|
|
4811
|
-
disabled:
|
|
4812
|
-
startIcon:
|
|
4810
|
+
loading: ke,
|
|
4811
|
+
disabled: ke || s === "details" && !vt,
|
|
4812
|
+
startIcon: s === "properties" ? /* @__PURE__ */ e(Gr, {}) : void 0,
|
|
4813
4813
|
children: [
|
|
4814
|
-
|
|
4815
|
-
|
|
4814
|
+
s === "details" && "Next",
|
|
4815
|
+
s === "properties" && "Create collection"
|
|
4816
4816
|
]
|
|
4817
4817
|
}
|
|
4818
4818
|
),
|
|
@@ -4822,7 +4822,7 @@ function rn({
|
|
|
4822
4822
|
variant: "filled",
|
|
4823
4823
|
color: "primary",
|
|
4824
4824
|
type: "submit",
|
|
4825
|
-
loading:
|
|
4825
|
+
loading: ke,
|
|
4826
4826
|
children: "Update collection"
|
|
4827
4827
|
}
|
|
4828
4828
|
)
|
|
@@ -4871,47 +4871,47 @@ const Ht = (t, r, n, i) => {
|
|
|
4871
4871
|
reservedGroups: l,
|
|
4872
4872
|
collectionInference: o,
|
|
4873
4873
|
extraView: d,
|
|
4874
|
-
pathSuggestions:
|
|
4875
|
-
getUser:
|
|
4874
|
+
pathSuggestions: p,
|
|
4875
|
+
getUser: u,
|
|
4876
4876
|
getData: h,
|
|
4877
4877
|
onAnalyticsEvent: m
|
|
4878
4878
|
}) {
|
|
4879
|
-
const
|
|
4879
|
+
const c = Ne(), g = gi(), v = _e(), { propertyConfigs: x } = Ae(), {
|
|
4880
4880
|
collections: y
|
|
4881
|
-
} =
|
|
4881
|
+
} = c, P = (y ?? []).map((s) => s.path.trim().toLowerCase()), [k, b] = Y.useState();
|
|
4882
4882
|
de(() => {
|
|
4883
|
-
|
|
4884
|
-
b(
|
|
4883
|
+
p && p().then((s) => {
|
|
4884
|
+
b(s.filter((V) => !P.includes(V.trim().toLowerCase())));
|
|
4885
4885
|
});
|
|
4886
|
-
}, [
|
|
4887
|
-
const [C, N] = Y.useState(), [
|
|
4886
|
+
}, [p]);
|
|
4887
|
+
const [C, N] = Y.useState(), [f, w] = Y.useState(), _ = Q(() => ({
|
|
4888
4888
|
createCollections: !0,
|
|
4889
4889
|
editCollections: !0,
|
|
4890
4890
|
deleteCollections: !0
|
|
4891
4891
|
}), []), M = Q(({
|
|
4892
|
-
id:
|
|
4892
|
+
id: s,
|
|
4893
4893
|
fullPath: V,
|
|
4894
4894
|
parentCollectionIds: G,
|
|
4895
4895
|
parentCollection: B
|
|
4896
4896
|
}) => {
|
|
4897
|
-
console.debug("Edit collection",
|
|
4898
|
-
editedCollectionId:
|
|
4897
|
+
console.debug("Edit collection", s, V, G, B), m?.("edit_collection", { id: s, fullPath: V }), N({
|
|
4898
|
+
editedCollectionId: s,
|
|
4899
4899
|
fullPath: V,
|
|
4900
4900
|
parentCollectionIds: G,
|
|
4901
4901
|
isNewCollection: !1,
|
|
4902
4902
|
parentCollection: B,
|
|
4903
4903
|
redirect: !1
|
|
4904
4904
|
});
|
|
4905
|
-
}, []),
|
|
4906
|
-
propertyKey:
|
|
4905
|
+
}, []), U = Q(({
|
|
4906
|
+
propertyKey: s,
|
|
4907
4907
|
property: V,
|
|
4908
4908
|
editedCollectionId: G,
|
|
4909
4909
|
currentPropertiesOrder: B,
|
|
4910
4910
|
parentCollectionIds: q,
|
|
4911
4911
|
collection: L
|
|
4912
4912
|
}) => {
|
|
4913
|
-
console.debug("Edit property",
|
|
4914
|
-
const J =
|
|
4913
|
+
console.debug("Edit property", s, V, G, B, q, L), m?.("edit_property", { propertyKey: s, editedCollectionId: G });
|
|
4914
|
+
const J = s && s.includes(".") ? s.substring(0, s.lastIndexOf(".")) : void 0, le = s && s.includes(".") ? s.substring(s.lastIndexOf(".") + 1) : s;
|
|
4915
4915
|
w({
|
|
4916
4916
|
propertyKey: le,
|
|
4917
4917
|
property: V,
|
|
@@ -4922,27 +4922,27 @@ const Ht = (t, r, n, i) => {
|
|
|
4922
4922
|
collectionEditable: L?.editable ?? !1
|
|
4923
4923
|
});
|
|
4924
4924
|
}, []), D = Y.useCallback(({
|
|
4925
|
-
parentCollectionIds:
|
|
4925
|
+
parentCollectionIds: s,
|
|
4926
4926
|
parentCollection: V,
|
|
4927
4927
|
initialValues: G,
|
|
4928
4928
|
redirect: B,
|
|
4929
4929
|
sourceClick: q
|
|
4930
4930
|
}) => {
|
|
4931
|
-
console.debug("Create collection", { parentCollectionIds:
|
|
4931
|
+
console.debug("Create collection", { parentCollectionIds: s, parentCollection: V, initialValues: G, redirect: B, sourceClick: q }), m?.("create_collection", { parentCollectionIds: s, parentCollection: V, initialValues: G, redirect: B, sourceClick: q }), N({
|
|
4932
4932
|
isNewCollection: !0,
|
|
4933
|
-
parentCollectionIds:
|
|
4933
|
+
parentCollectionIds: s,
|
|
4934
4934
|
parentCollection: V,
|
|
4935
4935
|
initialValues: G,
|
|
4936
4936
|
redirect: B
|
|
4937
4937
|
});
|
|
4938
|
-
}, []), A =
|
|
4938
|
+
}, []), A = p ? (s) => !s && k ? Promise.resolve(k) : p?.(s) : void 0;
|
|
4939
4939
|
return /* @__PURE__ */ e(mr.Provider, { value: n, children: /* @__PURE__ */ a(
|
|
4940
4940
|
hr.Provider,
|
|
4941
4941
|
{
|
|
4942
4942
|
value: {
|
|
4943
4943
|
editCollection: M,
|
|
4944
4944
|
createCollection: D,
|
|
4945
|
-
editProperty:
|
|
4945
|
+
editProperty: U,
|
|
4946
4946
|
configPermissions: i ?? _,
|
|
4947
4947
|
rootPathSuggestions: k
|
|
4948
4948
|
},
|
|
@@ -4960,45 +4960,45 @@ const Ht = (t, r, n, i) => {
|
|
|
4960
4960
|
reservedGroups: l,
|
|
4961
4961
|
extraView: d,
|
|
4962
4962
|
pathSuggestions: A,
|
|
4963
|
-
getUser:
|
|
4964
|
-
handleClose: (
|
|
4965
|
-
if (C?.redirect &&
|
|
4966
|
-
const V =
|
|
4967
|
-
|
|
4963
|
+
getUser: u,
|
|
4964
|
+
handleClose: (s) => {
|
|
4965
|
+
if (C?.redirect && s && C?.isNewCollection && !C.parentCollectionIds.length) {
|
|
4966
|
+
const V = c.buildUrlCollectionPath(s.id ?? s.path);
|
|
4967
|
+
g(V);
|
|
4968
4968
|
}
|
|
4969
4969
|
N(void 0);
|
|
4970
4970
|
}
|
|
4971
4971
|
}
|
|
4972
4972
|
),
|
|
4973
4973
|
/* @__PURE__ */ e(
|
|
4974
|
-
|
|
4974
|
+
Ie,
|
|
4975
4975
|
{
|
|
4976
|
-
open: !!
|
|
4976
|
+
open: !!f,
|
|
4977
4977
|
includeIdAndName: !0,
|
|
4978
|
-
existingProperty: !!
|
|
4979
|
-
autoUpdateId:
|
|
4980
|
-
autoOpenTypeSelect:
|
|
4978
|
+
existingProperty: !!f?.propertyKey,
|
|
4979
|
+
autoUpdateId: f ? !f?.propertyKey : !1,
|
|
4980
|
+
autoOpenTypeSelect: f ? !f?.propertyKey : !1,
|
|
4981
4981
|
inArray: !1,
|
|
4982
|
-
collectionEditable:
|
|
4983
|
-
getData: h &&
|
|
4984
|
-
console.debug("get data for property",
|
|
4985
|
-
const
|
|
4986
|
-
return h(
|
|
4982
|
+
collectionEditable: f?.collectionEditable ?? !1,
|
|
4983
|
+
getData: h && f?.editedCollectionId ? () => {
|
|
4984
|
+
console.debug("get data for property", f?.editedCollectionId);
|
|
4985
|
+
const s = c.resolveAliasesFrom(f.editedCollectionId);
|
|
4986
|
+
return h(s, []);
|
|
4987
4987
|
} : void 0,
|
|
4988
4988
|
onPropertyChanged: ({
|
|
4989
|
-
id:
|
|
4989
|
+
id: s,
|
|
4990
4990
|
property: V
|
|
4991
4991
|
}) => {
|
|
4992
|
-
if (!
|
|
4992
|
+
if (!f || !s)
|
|
4993
4993
|
return;
|
|
4994
|
-
const G = !
|
|
4994
|
+
const G = !f.propertyKey;
|
|
4995
4995
|
return n.saveProperty({
|
|
4996
|
-
path:
|
|
4996
|
+
path: f?.editedCollectionId,
|
|
4997
4997
|
property: V,
|
|
4998
|
-
propertyKey:
|
|
4999
|
-
newPropertiesOrder: G &&
|
|
5000
|
-
namespace:
|
|
5001
|
-
parentCollectionIds:
|
|
4998
|
+
propertyKey: s,
|
|
4999
|
+
newPropertiesOrder: G && f.currentPropertiesOrder ? [...f.currentPropertiesOrder, s] : void 0,
|
|
5000
|
+
namespace: f.namespace,
|
|
5001
|
+
parentCollectionIds: f.parentCollectionIds
|
|
5002
5002
|
}).catch((B) => (console.error(B), v.open({
|
|
5003
5003
|
type: "error",
|
|
5004
5004
|
message: "Error persisting property: " + (B.message ?? "Details in the console")
|
|
@@ -5006,15 +5006,15 @@ const Ht = (t, r, n, i) => {
|
|
|
5006
5006
|
},
|
|
5007
5007
|
onPropertyChangedImmediate: !1,
|
|
5008
5008
|
onDelete: () => {
|
|
5009
|
-
if (!
|
|
5009
|
+
if (!f?.propertyKey)
|
|
5010
5010
|
return;
|
|
5011
|
-
const
|
|
5011
|
+
const s = f?.currentPropertiesOrder?.filter((V) => V !== f?.propertyKey);
|
|
5012
5012
|
return n.deleteProperty({
|
|
5013
|
-
path:
|
|
5014
|
-
propertyKey:
|
|
5015
|
-
namespace:
|
|
5016
|
-
newPropertiesOrder:
|
|
5017
|
-
parentCollectionIds:
|
|
5013
|
+
path: f?.editedCollectionId,
|
|
5014
|
+
propertyKey: f?.propertyKey,
|
|
5015
|
+
namespace: f?.namespace,
|
|
5016
|
+
newPropertiesOrder: s,
|
|
5017
|
+
parentCollectionIds: f?.parentCollectionIds
|
|
5018
5018
|
}).then(() => {
|
|
5019
5019
|
w(void 0);
|
|
5020
5020
|
}).catch((V) => (console.error(V), v.open({
|
|
@@ -5035,109 +5035,53 @@ const Ht = (t, r, n, i) => {
|
|
|
5035
5035
|
existingPropertyKeys: [],
|
|
5036
5036
|
allowDataInference: !0,
|
|
5037
5037
|
propertyConfigs: x,
|
|
5038
|
-
property:
|
|
5039
|
-
propertyKey:
|
|
5038
|
+
property: f?.property,
|
|
5039
|
+
propertyKey: f?.propertyKey
|
|
5040
5040
|
}
|
|
5041
5041
|
)
|
|
5042
5042
|
]
|
|
5043
5043
|
}
|
|
5044
5044
|
) });
|
|
5045
5045
|
},
|
|
5046
|
-
|
|
5047
|
-
),
|
|
5046
|
+
ye
|
|
5047
|
+
), ge = () => Jt(hr);
|
|
5048
5048
|
function ln({
|
|
5049
5049
|
path: t,
|
|
5050
5050
|
parentCollectionIds: r,
|
|
5051
5051
|
collection: n,
|
|
5052
5052
|
tableController: i
|
|
5053
5053
|
}) {
|
|
5054
|
-
const l =
|
|
5054
|
+
const l = Te(), o = Ne(), d = ge(), p = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
|
|
5055
5055
|
user: l.user,
|
|
5056
5056
|
collection: n
|
|
5057
5057
|
}).editCollections : !0;
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
children: /* @__PURE__ */ e(Kr, {})
|
|
5074
|
-
}
|
|
5075
|
-
)
|
|
5076
|
-
}
|
|
5077
|
-
),
|
|
5078
|
-
/* @__PURE__ */ e(
|
|
5079
|
-
te,
|
|
5080
|
-
{
|
|
5081
|
-
title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
5082
|
-
children: /* @__PURE__ */ e(
|
|
5083
|
-
z,
|
|
5084
|
-
{
|
|
5085
|
-
color: "primary",
|
|
5086
|
-
size: "small",
|
|
5087
|
-
variant: "outlined",
|
|
5088
|
-
onClick: () => u?.saveCollection({
|
|
5089
|
-
id: n.id,
|
|
5090
|
-
parentCollectionIds: r,
|
|
5091
|
-
collectionData: W(
|
|
5092
|
-
n,
|
|
5093
|
-
{
|
|
5094
|
-
initialFilter: i.filterValues ?? null,
|
|
5095
|
-
initialSort: i.sortBy ?? null
|
|
5096
|
-
}
|
|
5097
|
-
)
|
|
5098
|
-
}).then(() => {
|
|
5099
|
-
p.open({
|
|
5100
|
-
type: "success",
|
|
5101
|
-
message: "Default config saved"
|
|
5102
|
-
});
|
|
5103
|
-
}),
|
|
5104
|
-
children: /* @__PURE__ */ e(Wr, {})
|
|
5105
|
-
}
|
|
5106
|
-
)
|
|
5107
|
-
}
|
|
5108
|
-
)
|
|
5109
|
-
] })), /* @__PURE__ */ a(j, { children: [
|
|
5110
|
-
m && s,
|
|
5111
|
-
/* @__PURE__ */ e(
|
|
5112
|
-
te,
|
|
5113
|
-
{
|
|
5114
|
-
title: m ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
5115
|
-
children: /* @__PURE__ */ e(
|
|
5116
|
-
oe,
|
|
5117
|
-
{
|
|
5118
|
-
color: "primary",
|
|
5119
|
-
disabled: !m,
|
|
5120
|
-
onClick: m ? () => d?.editCollection({ id: n.id, fullPath: t, parentCollectionIds: r, parentCollection: h }) : void 0,
|
|
5121
|
-
children: /* @__PURE__ */ e(He, {})
|
|
5122
|
-
}
|
|
5123
|
-
)
|
|
5124
|
-
}
|
|
5125
|
-
)
|
|
5126
|
-
] });
|
|
5127
|
-
}
|
|
5128
|
-
function at(t) {
|
|
5129
|
-
return t && Object.keys(t).length === 0 ? t : t ?? null;
|
|
5058
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(
|
|
5059
|
+
te,
|
|
5060
|
+
{
|
|
5061
|
+
title: u ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
5062
|
+
children: /* @__PURE__ */ e(
|
|
5063
|
+
oe,
|
|
5064
|
+
{
|
|
5065
|
+
color: "primary",
|
|
5066
|
+
disabled: !u,
|
|
5067
|
+
onClick: u ? () => d?.editCollection({ id: n.id, fullPath: t, parentCollectionIds: r, parentCollection: p }) : void 0,
|
|
5068
|
+
children: /* @__PURE__ */ e(He, {})
|
|
5069
|
+
}
|
|
5070
|
+
)
|
|
5071
|
+
}
|
|
5072
|
+
) });
|
|
5130
5073
|
}
|
|
5074
|
+
const fr = () => Jt(mr);
|
|
5131
5075
|
function sn({
|
|
5132
5076
|
path: t,
|
|
5133
5077
|
collection: r
|
|
5134
5078
|
}) {
|
|
5135
|
-
const n =
|
|
5079
|
+
const n = _e(), i = Te(), l = fr(), o = ge(), d = o.configPermissions({
|
|
5136
5080
|
user: i.user,
|
|
5137
5081
|
collection: r
|
|
5138
|
-
}),
|
|
5082
|
+
}), p = Q(() => {
|
|
5139
5083
|
o?.editCollection({ id: r.id, parentCollectionIds: [] });
|
|
5140
|
-
}, [o, t]), [
|
|
5084
|
+
}, [o, t]), [u, h] = $(!1), m = Q(() => {
|
|
5141
5085
|
l?.deleteCollection({ id: r.id }).then(() => {
|
|
5142
5086
|
h(!1), n.open({
|
|
5143
5087
|
message: "Collection deleted",
|
|
@@ -5145,14 +5089,14 @@ function sn({
|
|
|
5145
5089
|
});
|
|
5146
5090
|
});
|
|
5147
5091
|
}, [t, l]);
|
|
5148
|
-
return /* @__PURE__ */ a(
|
|
5092
|
+
return /* @__PURE__ */ a(R, { children: [
|
|
5149
5093
|
/* @__PURE__ */ a("div", { children: [
|
|
5150
5094
|
d.deleteCollections && /* @__PURE__ */ e(
|
|
5151
|
-
|
|
5095
|
+
Kr,
|
|
5152
5096
|
{
|
|
5153
|
-
trigger: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(
|
|
5154
|
-
children: /* @__PURE__ */ a(
|
|
5155
|
-
|
|
5097
|
+
trigger: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Wr, { size: "small" }) }),
|
|
5098
|
+
children: /* @__PURE__ */ a(Zr, { onClick: (c) => {
|
|
5099
|
+
c.preventDefault(), c.stopPropagation(), h(!0);
|
|
5156
5100
|
}, children: [
|
|
5157
5101
|
/* @__PURE__ */ e(dt, {}),
|
|
5158
5102
|
"Delete"
|
|
@@ -5162,8 +5106,8 @@ function sn({
|
|
|
5162
5106
|
d.editCollections && /* @__PURE__ */ e(
|
|
5163
5107
|
oe,
|
|
5164
5108
|
{
|
|
5165
|
-
onClick: (
|
|
5166
|
-
|
|
5109
|
+
onClick: (c) => {
|
|
5110
|
+
p();
|
|
5167
5111
|
},
|
|
5168
5112
|
children: /* @__PURE__ */ e(He, { size: "small" })
|
|
5169
5113
|
}
|
|
@@ -5172,11 +5116,11 @@ function sn({
|
|
|
5172
5116
|
/* @__PURE__ */ e(
|
|
5173
5117
|
lt,
|
|
5174
5118
|
{
|
|
5175
|
-
open:
|
|
5119
|
+
open: u,
|
|
5176
5120
|
onAccept: m,
|
|
5177
5121
|
onCancel: () => h(!1),
|
|
5178
|
-
title: /* @__PURE__ */ e(
|
|
5179
|
-
body: /* @__PURE__ */ a(
|
|
5122
|
+
title: /* @__PURE__ */ e(R, { children: "Delete this collection?" }),
|
|
5123
|
+
body: /* @__PURE__ */ a(R, { children: [
|
|
5180
5124
|
" This will ",
|
|
5181
5125
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
5182
5126
|
", only the collection in the CMS"
|
|
@@ -5191,7 +5135,7 @@ function cn({
|
|
|
5191
5135
|
}) {
|
|
5192
5136
|
if (!r.navigation.topLevelNavigation)
|
|
5193
5137
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
5194
|
-
const n =
|
|
5138
|
+
const n = Te(), i = ge(), l = i.configPermissions ? i.configPermissions({
|
|
5195
5139
|
user: n.user
|
|
5196
5140
|
}).createCollections : !0;
|
|
5197
5141
|
return /* @__PURE__ */ e(
|
|
@@ -5227,11 +5171,11 @@ function cn({
|
|
|
5227
5171
|
);
|
|
5228
5172
|
}
|
|
5229
5173
|
function dn({ introMode: t }) {
|
|
5230
|
-
const r =
|
|
5174
|
+
const r = Te(), n = Ne(), i = ge(), l = i.configPermissions ? i.configPermissions({
|
|
5231
5175
|
user: r.user
|
|
5232
5176
|
}).createCollections : !0, o = i.rootPathSuggestions, d = (o ?? []).length > 3 || (n.collections ?? []).length === 0 && (o ?? []).length > 0;
|
|
5233
5177
|
return /* @__PURE__ */ e(
|
|
5234
|
-
|
|
5178
|
+
Jr,
|
|
5235
5179
|
{
|
|
5236
5180
|
in: t === "existing_project" || d,
|
|
5237
5181
|
children: /* @__PURE__ */ a(
|
|
@@ -5254,21 +5198,21 @@ function dn({ introMode: t }) {
|
|
|
5254
5198
|
{
|
|
5255
5199
|
className: "flex flex-row gap-1 overflow-scroll no-scrollbar ",
|
|
5256
5200
|
children: [
|
|
5257
|
-
(o ?? []).map((
|
|
5201
|
+
(o ?? []).map((u) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
5258
5202
|
st,
|
|
5259
5203
|
{
|
|
5260
5204
|
icon: /* @__PURE__ */ e(se, { size: "small" }),
|
|
5261
5205
|
colorScheme: "cyanLighter",
|
|
5262
5206
|
onClick: i && l ? () => i.createCollection({
|
|
5263
|
-
initialValues: { path:
|
|
5207
|
+
initialValues: { path: u, name: ut(u) },
|
|
5264
5208
|
parentCollectionIds: [],
|
|
5265
5209
|
redirect: !0,
|
|
5266
5210
|
sourceClick: "root_collection_suggestion"
|
|
5267
5211
|
}) : void 0,
|
|
5268
5212
|
size: "small",
|
|
5269
|
-
children:
|
|
5213
|
+
children: u
|
|
5270
5214
|
}
|
|
5271
|
-
) },
|
|
5215
|
+
) }, u)),
|
|
5272
5216
|
o === void 0 && /* @__PURE__ */ e(De, { size: "small" }),
|
|
5273
5217
|
o?.length === 0 && /* @__PURE__ */ e(O, { variant: "caption", children: "No suggestions" })
|
|
5274
5218
|
]
|
|
@@ -5288,7 +5232,7 @@ function un({
|
|
|
5288
5232
|
parentCollectionIds: l,
|
|
5289
5233
|
collection: o
|
|
5290
5234
|
}) {
|
|
5291
|
-
const d =
|
|
5235
|
+
const d = ge();
|
|
5292
5236
|
return /* @__PURE__ */ e(te, { title: "Edit", children: /* @__PURE__ */ e(
|
|
5293
5237
|
oe,
|
|
5294
5238
|
{
|
|
@@ -5312,7 +5256,7 @@ function pn({
|
|
|
5312
5256
|
parentCollectionIds: r,
|
|
5313
5257
|
collection: n
|
|
5314
5258
|
}) {
|
|
5315
|
-
const i =
|
|
5259
|
+
const i = Te(), l = ge(), o = l.configPermissions ? l.configPermissions({
|
|
5316
5260
|
user: i.user,
|
|
5317
5261
|
collection: n
|
|
5318
5262
|
}).editCollections : !0;
|
|
@@ -5333,7 +5277,7 @@ function pn({
|
|
|
5333
5277
|
) });
|
|
5334
5278
|
}
|
|
5335
5279
|
function mn() {
|
|
5336
|
-
const t =
|
|
5280
|
+
const t = ge();
|
|
5337
5281
|
return /* @__PURE__ */ e("div", { className: "bg-gray-50 dark:bg-gray-900 min-w-fit rounded", children: /* @__PURE__ */ a(
|
|
5338
5282
|
z,
|
|
5339
5283
|
{
|
|
@@ -5351,7 +5295,73 @@ function mn() {
|
|
|
5351
5295
|
}
|
|
5352
5296
|
) });
|
|
5353
5297
|
}
|
|
5354
|
-
function
|
|
5298
|
+
function hn({
|
|
5299
|
+
path: t,
|
|
5300
|
+
parentCollectionIds: r,
|
|
5301
|
+
collection: n,
|
|
5302
|
+
tableController: i
|
|
5303
|
+
}) {
|
|
5304
|
+
const l = Te(), o = ge(), d = fr(), p = _e(), u = o.configPermissions ? o.configPermissions({
|
|
5305
|
+
user: l.user,
|
|
5306
|
+
collection: n
|
|
5307
|
+
}).editCollections : !0;
|
|
5308
|
+
let h = null;
|
|
5309
|
+
return (!ye(at(i.filterValues), at(n.initialFilter)) || !ye(at(i.sortBy), at(n.initialSort))) && (h = /* @__PURE__ */ a(R, { children: [
|
|
5310
|
+
/* @__PURE__ */ e(
|
|
5311
|
+
te,
|
|
5312
|
+
{
|
|
5313
|
+
title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
5314
|
+
children: /* @__PURE__ */ e(
|
|
5315
|
+
z,
|
|
5316
|
+
{
|
|
5317
|
+
color: "primary",
|
|
5318
|
+
size: "small",
|
|
5319
|
+
variant: "outlined",
|
|
5320
|
+
onClick: () => d?.saveCollection({
|
|
5321
|
+
id: n.id,
|
|
5322
|
+
parentCollectionIds: r,
|
|
5323
|
+
collectionData: W(
|
|
5324
|
+
n,
|
|
5325
|
+
{
|
|
5326
|
+
initialFilter: i.filterValues ?? null,
|
|
5327
|
+
initialSort: i.sortBy ?? null
|
|
5328
|
+
}
|
|
5329
|
+
)
|
|
5330
|
+
}).then(() => {
|
|
5331
|
+
p.open({
|
|
5332
|
+
type: "success",
|
|
5333
|
+
message: "Default config saved"
|
|
5334
|
+
});
|
|
5335
|
+
}),
|
|
5336
|
+
children: /* @__PURE__ */ e(Qr, {})
|
|
5337
|
+
}
|
|
5338
|
+
)
|
|
5339
|
+
}
|
|
5340
|
+
),
|
|
5341
|
+
(n.initialFilter || n.initialSort) && /* @__PURE__ */ e(
|
|
5342
|
+
te,
|
|
5343
|
+
{
|
|
5344
|
+
title: "Reset to default filter and sort",
|
|
5345
|
+
children: /* @__PURE__ */ e(
|
|
5346
|
+
z,
|
|
5347
|
+
{
|
|
5348
|
+
color: "primary",
|
|
5349
|
+
size: "small",
|
|
5350
|
+
variant: "text",
|
|
5351
|
+
onClick: () => {
|
|
5352
|
+
i.clearFilter?.(), n?.initialFilter && i.setFilterValues?.(n?.initialFilter), n?.initialSort && i.setSortBy?.(n?.initialSort);
|
|
5353
|
+
},
|
|
5354
|
+
children: /* @__PURE__ */ e(Xr, {})
|
|
5355
|
+
}
|
|
5356
|
+
)
|
|
5357
|
+
}
|
|
5358
|
+
)
|
|
5359
|
+
] })), /* @__PURE__ */ e(R, { children: u && h });
|
|
5360
|
+
}
|
|
5361
|
+
function at(t) {
|
|
5362
|
+
return t && Object.keys(t).length === 0 ? t : t ?? null;
|
|
5363
|
+
}
|
|
5364
|
+
function _n({
|
|
5355
5365
|
collectionConfigController: t,
|
|
5356
5366
|
introMode: r,
|
|
5357
5367
|
configPermissions: n,
|
|
@@ -5359,8 +5369,8 @@ function In({
|
|
|
5359
5369
|
extraView: l,
|
|
5360
5370
|
pathSuggestions: o,
|
|
5361
5371
|
getUser: d,
|
|
5362
|
-
collectionInference:
|
|
5363
|
-
getData:
|
|
5372
|
+
collectionInference: p,
|
|
5373
|
+
getData: u,
|
|
5364
5374
|
onAnalyticsEvent: h
|
|
5365
5375
|
}) {
|
|
5366
5376
|
return {
|
|
@@ -5371,33 +5381,34 @@ function In({
|
|
|
5371
5381
|
props: {
|
|
5372
5382
|
collectionConfigController: t,
|
|
5373
5383
|
configPermissions: n,
|
|
5374
|
-
collectionInference:
|
|
5384
|
+
collectionInference: p,
|
|
5375
5385
|
reservedGroups: i,
|
|
5376
5386
|
extraView: l,
|
|
5377
5387
|
pathSuggestions: o,
|
|
5378
5388
|
getUser: d,
|
|
5379
|
-
getData:
|
|
5389
|
+
getData: u,
|
|
5380
5390
|
onAnalyticsEvent: h
|
|
5381
5391
|
}
|
|
5382
5392
|
},
|
|
5383
5393
|
homePage: {
|
|
5384
5394
|
additionalActions: /* @__PURE__ */ e(mn, {}),
|
|
5385
|
-
additionalChildrenStart: r ? /* @__PURE__ */ e(
|
|
5395
|
+
additionalChildrenStart: r ? /* @__PURE__ */ e(fn, { introMode: r }) : void 0,
|
|
5386
5396
|
additionalChildrenEnd: /* @__PURE__ */ e(dn, { introMode: r }),
|
|
5387
5397
|
CollectionActions: sn,
|
|
5388
5398
|
AdditionalCards: r ? void 0 : cn
|
|
5389
5399
|
},
|
|
5390
5400
|
collectionView: {
|
|
5401
|
+
CollectionActionsStart: hn,
|
|
5391
5402
|
CollectionActions: ln,
|
|
5392
5403
|
HeaderAction: un,
|
|
5393
5404
|
AddColumnComponent: pn
|
|
5394
5405
|
}
|
|
5395
5406
|
};
|
|
5396
5407
|
}
|
|
5397
|
-
function
|
|
5398
|
-
if (!
|
|
5408
|
+
function fn({ introMode: t }) {
|
|
5409
|
+
if (!Ne().topLevelNavigation)
|
|
5399
5410
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
5400
|
-
const n =
|
|
5411
|
+
const n = Te(), i = ge(), l = i.configPermissions ? i.configPermissions({
|
|
5401
5412
|
user: n.user
|
|
5402
5413
|
}).createCollections : !0;
|
|
5403
5414
|
return /* @__PURE__ */ a("div", { className: "mt-8 flex flex-col mt-8 p-2", children: [
|
|
@@ -5421,8 +5432,8 @@ function hn({ introMode: t }) {
|
|
|
5421
5432
|
)
|
|
5422
5433
|
] });
|
|
5423
5434
|
}
|
|
5424
|
-
function
|
|
5425
|
-
const r =
|
|
5435
|
+
function Fn({ path: t }) {
|
|
5436
|
+
const r = Ne(), n = gn(t), i = r.getParentCollectionIds(t), l = ge();
|
|
5426
5437
|
return /* @__PURE__ */ a("div", { className: "p-1 flex flex-col items-center", children: [
|
|
5427
5438
|
/* @__PURE__ */ e(Wt, { error: "No collection for path: " + n }),
|
|
5428
5439
|
/* @__PURE__ */ e(
|
|
@@ -5444,21 +5455,21 @@ function _n({ path: t }) {
|
|
|
5444
5455
|
)
|
|
5445
5456
|
] });
|
|
5446
5457
|
}
|
|
5447
|
-
function
|
|
5458
|
+
function gn(t) {
|
|
5448
5459
|
const r = t.split("/");
|
|
5449
5460
|
return r[r.length - 1];
|
|
5450
5461
|
}
|
|
5451
5462
|
export {
|
|
5452
|
-
|
|
5463
|
+
Fn as MissingReferenceWidget,
|
|
5453
5464
|
qe as editableProperty,
|
|
5454
5465
|
ae as getFullId,
|
|
5455
5466
|
ir as getFullIdPath,
|
|
5456
5467
|
he as idToPropertiesPath,
|
|
5457
|
-
|
|
5468
|
+
be as namespaceToPropertiesOrderPath,
|
|
5458
5469
|
bi as namespaceToPropertiesPath,
|
|
5459
5470
|
wi as removeNonEditableProperties,
|
|
5460
|
-
|
|
5461
|
-
|
|
5471
|
+
ge as useCollectionEditorController,
|
|
5472
|
+
_n as useCollectionEditorPlugin,
|
|
5462
5473
|
fr as useCollectionsConfigController
|
|
5463
5474
|
};
|
|
5464
5475
|
//# sourceMappingURL=index.es.js.map
|