@firecms/collection_editor 3.0.0-beta.2-pre.4 → 3.0.0-beta.2-pre.5
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 +1152 -1112
- 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/RootCollectionSuggestions.d.ts +3 -1
- package/dist/useCollectionEditorPlugin.d.ts +6 -3
- package/package.json +7 -7
- package/src/ui/RootCollectionSuggestions.tsx +15 -8
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +15 -13
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +7 -9
- package/src/ui/collection_editor/GetCodeDialog.tsx +1 -1
- package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +1 -1
- package/src/useCollectionEditorPlugin.tsx +50 -16
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as U } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { Typography as
|
|
2
|
+
import { SearchIconsView as gr, toSnakeCase as Pt, singular as vr, IconForView as ot, ArrayContainer as yr, serializeRegExp as br, useSnackbarController as Ie, resolveEnumValues as Cr, isPropertyBuilder as ne, useCustomizationController as Ae, getFieldConfig as $e, ErrorBoundary as ge, PropertyConfigBadge as Ye, unslugify as ut, useNavigationController as Pe, mergeDeep as W, DEFAULT_FIELD_CONFIGS as Gt, isValidRegExp as Pr, getFieldId as Kt, DeleteConfirmationDialog as lt, useLargeLayout as Nr, makePropertiesEditable as pt, resolveEntityView as xr, useSelectionController as wr, EntityCollectionTable as Tr, slugify as kr, useAuthController as _e, randomString as _t, CircularProgressCenter as Nt, removeUndefined as Ft, ErrorView as Wt, removeInitialAndTrailingSlashes as Or, getDefaultPropertiesOrder as Vr } from "@firecms/core";
|
|
3
|
+
import * as je from "react";
|
|
4
|
+
import Y, { useState as $, useEffect as ce, useMemo as Zt, useCallback as Z, useRef as Le, useDeferredValue as Ir, useContext as Jt } from "react";
|
|
5
|
+
import ve from "react-fast-compare";
|
|
6
|
+
import { Typography as k, useAutoComplete as _r, Container as mt, Tooltip as te, IconButton as oe, Chip as st, TextField as Oe, cn as me, DebouncedTextField as J, Autocomplete as Fr, AutocompleteItem as Sr, ExpandablePanel as xt, SettingsIcon as He, Select as be, SelectItem as ee, BooleanSwitchWithLabel as ct, Dialog as Fe, AutoAwesomeIcon as ht, Badge as Er, ListIcon as Ar, Button as z, CircularProgress as De, Paper as Ce, DialogContent as Be, DialogActions as ze, RuleIcon as Dr, FileUploadIcon as Br, MultiSelect as zr, MultiSelectItem as St, Checkbox as Et, cardMixin as Qt, cardClickableMixin as Xt, cardSelectedMixin as er, FunctionsIcon as Mr, RemoveCircleIcon as Rr, defaultBorderMixin as wt, RemoveIcon as Ur, DragHandleIcon as jr, AddIcon as ue, SelectGroup as At, InfoLabel as Lr, DeleteIcon as dt, ContentCopyIcon as qr, CodeIcon as $r, Table as Dt, TableBody as Bt, TableRow as bt, TableCell as Ue, Alert as Yr, Icon as et, Card as tr, coolIconKeys as zt, Tabs as Hr, Tab as Ct, ArrowBackIcon as tt, LoadingButton as Mt, DoneIcon as Gr, UndoIcon as Kr, SaveIcon as Wr, Menu as Zr, MoreVertIcon as Jr, MenuItem as Qr, Collapse as Xr } from "@firecms/ui";
|
|
7
7
|
import * as rt from "yup";
|
|
8
8
|
import { useFormex as K, Field as H, getIn as I, useCreateFormex as Tt, Formex as kt } from "@firecms/formex";
|
|
9
9
|
import { extractEnumFromValues as ei, buildPropertyFromData as ti, buildEntityPropertiesFromData as ri } from "@firecms/schema_inference";
|
|
10
10
|
import { DragDropContext as ii, Droppable as ni, Draggable as ai } from "@hello-pangea/dnd";
|
|
11
11
|
import oi from "json5";
|
|
12
12
|
import { Highlight as li, themes as si } from "prism-react-renderer";
|
|
13
|
-
import { ImportFileUpload as
|
|
13
|
+
import { ImportFileUpload as ci, DataNewPropertiesMapping as di, ImportNewPropertyFieldPreview as ui, getInferenceType as rr, getPropertiesMapping as pi, convertDataToEntity as mi, useImportConfig as hi, ImportSaveInProgress as fi } from "@firecms/data_import_export";
|
|
14
14
|
import { useNavigate as gi } from "react-router";
|
|
15
15
|
const vi = rt.object().shape({
|
|
16
16
|
id: rt.string().required("Required"),
|
|
@@ -21,7 +21,7 @@ function X({
|
|
|
21
21
|
error: t,
|
|
22
22
|
children: r
|
|
23
23
|
}) {
|
|
24
|
-
return r ? /* @__PURE__ */ e(
|
|
24
|
+
return r ? /* @__PURE__ */ e(k, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: r }) : null;
|
|
25
25
|
}
|
|
26
26
|
function yi({
|
|
27
27
|
isNewCollection: t,
|
|
@@ -32,28 +32,29 @@ function yi({
|
|
|
32
32
|
parentCollection: o
|
|
33
33
|
}) {
|
|
34
34
|
const d = Y.useRef(null), {
|
|
35
|
-
values:
|
|
36
|
-
setFieldValue:
|
|
37
|
-
handleChange:
|
|
38
|
-
touched:
|
|
39
|
-
errors:
|
|
40
|
-
setFieldTouched:
|
|
35
|
+
values: p,
|
|
36
|
+
setFieldValue: u,
|
|
37
|
+
handleChange: h,
|
|
38
|
+
touched: m,
|
|
39
|
+
errors: c,
|
|
40
|
+
setFieldTouched: g,
|
|
41
41
|
isSubmitting: v,
|
|
42
|
-
submitCount:
|
|
43
|
-
} = K(), [y, C] =
|
|
44
|
-
|
|
42
|
+
submitCount: x
|
|
43
|
+
} = K(), [y, C] = $(!1), [w, b] = $(!1), P = (s) => {
|
|
44
|
+
u("name", s), !I(m, "path") && t && s && u("path", Pt(s)), !I(m, "id") && t && s && u("id", Pt(s)), !I(m, "singularName") && t && s && u("singularName", vr(s));
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
const O = /* @__PURE__ */ e(ot, { collectionOrView:
|
|
46
|
+
ce(() => {
|
|
47
|
+
c.id && b(!0);
|
|
48
|
+
}, [c.id]);
|
|
49
|
+
const O = /* @__PURE__ */ e(ot, { collectionOrView: p }), f = l?.filter((s) => !r?.includes(s)), {
|
|
50
50
|
inputFocused: N,
|
|
51
|
-
autoCompleteOpen:
|
|
51
|
+
autoCompleteOpen: _,
|
|
52
52
|
setAutoCompleteOpen: R
|
|
53
53
|
} = _r({
|
|
54
54
|
ref: d
|
|
55
55
|
}), M = !!o;
|
|
56
56
|
let B;
|
|
57
|
+
const S = x > 0;
|
|
57
58
|
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: [
|
|
58
59
|
/* @__PURE__ */ a("div", { children: [
|
|
59
60
|
/* @__PURE__ */ a(
|
|
@@ -61,7 +62,7 @@ function yi({
|
|
|
61
62
|
{
|
|
62
63
|
className: "flex flex-row py-2 pt-3 items-center",
|
|
63
64
|
children: [
|
|
64
|
-
/* @__PURE__ */ e(
|
|
65
|
+
/* @__PURE__ */ e(k, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${p?.name} collection` }),
|
|
65
66
|
/* @__PURE__ */ e(te, { title: "Change icon", children: /* @__PURE__ */ e(
|
|
66
67
|
oe,
|
|
67
68
|
{
|
|
@@ -73,7 +74,7 @@ function yi({
|
|
|
73
74
|
]
|
|
74
75
|
}
|
|
75
76
|
),
|
|
76
|
-
o && /* @__PURE__ */ e(st, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(
|
|
77
|
+
o && /* @__PURE__ */ e(st, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(k, { variant: "caption", children: [
|
|
77
78
|
"This is a subcollection of ",
|
|
78
79
|
/* @__PURE__ */ e("b", { children: o.name })
|
|
79
80
|
] }) })
|
|
@@ -83,16 +84,16 @@ function yi({
|
|
|
83
84
|
/* @__PURE__ */ e(
|
|
84
85
|
Oe,
|
|
85
86
|
{
|
|
86
|
-
value:
|
|
87
|
-
onChange: (
|
|
87
|
+
value: p.name ?? "",
|
|
88
|
+
onChange: (s) => P(s.target.value),
|
|
88
89
|
label: "Name",
|
|
89
90
|
required: !0,
|
|
90
|
-
error:
|
|
91
|
+
error: S && !!c.name
|
|
91
92
|
}
|
|
92
93
|
),
|
|
93
|
-
/* @__PURE__ */ e(X, { error:
|
|
94
|
+
/* @__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)" })
|
|
94
95
|
] }),
|
|
95
|
-
/* @__PURE__ */ a("div", { className:
|
|
96
|
+
/* @__PURE__ */ a("div", { className: me("col-span-12 ", M ? "" : "sm:col-span-8"), children: [
|
|
96
97
|
/* @__PURE__ */ e(
|
|
97
98
|
H,
|
|
98
99
|
{
|
|
@@ -101,20 +102,20 @@ function yi({
|
|
|
101
102
|
label: "Path",
|
|
102
103
|
disabled: !t,
|
|
103
104
|
required: !0,
|
|
104
|
-
error:
|
|
105
|
+
error: S && !!c.path
|
|
105
106
|
}
|
|
106
107
|
),
|
|
107
|
-
/* @__PURE__ */ e(X, { error:
|
|
108
|
+
/* @__PURE__ */ e(X, { error: m.path && !!c.path, children: m.path && c.path ? c.path : M ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database" })
|
|
108
109
|
] }),
|
|
109
110
|
!M && /* @__PURE__ */ a("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
110
111
|
/* @__PURE__ */ e(
|
|
111
112
|
Oe,
|
|
112
113
|
{
|
|
113
|
-
error:
|
|
114
|
+
error: S && !!c.group,
|
|
114
115
|
disabled: v,
|
|
115
|
-
value:
|
|
116
|
+
value: p.group ?? "",
|
|
116
117
|
autoComplete: "off",
|
|
117
|
-
onChange: (
|
|
118
|
+
onChange: (s) => u("group", s.target.value),
|
|
118
119
|
name: "group",
|
|
119
120
|
inputRef: d,
|
|
120
121
|
label: "Group"
|
|
@@ -123,31 +124,31 @@ function yi({
|
|
|
123
124
|
/* @__PURE__ */ e(
|
|
124
125
|
Fr,
|
|
125
126
|
{
|
|
126
|
-
open:
|
|
127
|
+
open: _ && (f ?? []).length > 0,
|
|
127
128
|
setOpen: R,
|
|
128
|
-
children:
|
|
129
|
+
children: f?.map((s, V) => /* @__PURE__ */ e(
|
|
129
130
|
Sr,
|
|
130
131
|
{
|
|
131
132
|
onClick: () => {
|
|
132
|
-
R(!1),
|
|
133
|
+
R(!1), u("group", s ?? null);
|
|
133
134
|
},
|
|
134
|
-
children: /* @__PURE__ */ e("div", { className: "flex-grow", children:
|
|
135
|
+
children: /* @__PURE__ */ e("div", { className: "flex-grow", children: s })
|
|
135
136
|
},
|
|
136
|
-
|
|
137
|
+
V + "_" + s
|
|
137
138
|
))
|
|
138
139
|
}
|
|
139
140
|
),
|
|
140
|
-
/* @__PURE__ */ e(X, { children:
|
|
141
|
+
/* @__PURE__ */ e(X, { children: S && c.group ? c.group : "Group of the collection" })
|
|
141
142
|
] }),
|
|
142
143
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
143
144
|
xt,
|
|
144
145
|
{
|
|
145
|
-
expanded:
|
|
146
|
+
expanded: w,
|
|
146
147
|
onExpandedChange: b,
|
|
147
148
|
title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
|
|
148
|
-
/* @__PURE__ */ e(
|
|
149
|
+
/* @__PURE__ */ e(He, {}),
|
|
149
150
|
/* @__PURE__ */ e(
|
|
150
|
-
|
|
151
|
+
k,
|
|
151
152
|
{
|
|
152
153
|
variant: "subtitle2",
|
|
153
154
|
className: "ml-2",
|
|
@@ -165,40 +166,40 @@ function yi({
|
|
|
165
166
|
as: J,
|
|
166
167
|
disabled: !t,
|
|
167
168
|
label: "Collection id",
|
|
168
|
-
error:
|
|
169
|
+
error: S && !!c.id
|
|
169
170
|
}
|
|
170
171
|
),
|
|
171
|
-
/* @__PURE__ */ e(X, { error:
|
|
172
|
+
/* @__PURE__ */ e(X, { error: m.id && !!c.id, children: m.id && c.id ? c.id : "This id identifies this collection" })
|
|
172
173
|
] }),
|
|
173
174
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
174
175
|
/* @__PURE__ */ e(
|
|
175
176
|
Oe,
|
|
176
177
|
{
|
|
177
|
-
error:
|
|
178
|
+
error: S && !!c.singularName,
|
|
178
179
|
id: "singularName",
|
|
179
180
|
"aria-describedby": "singularName-helper",
|
|
180
|
-
onChange: (
|
|
181
|
-
value:
|
|
181
|
+
onChange: (s) => (g("singularName", !0), h(s)),
|
|
182
|
+
value: p.singularName ?? "",
|
|
182
183
|
label: "Singular name"
|
|
183
184
|
}
|
|
184
185
|
),
|
|
185
|
-
/* @__PURE__ */ e(X, { error:
|
|
186
|
+
/* @__PURE__ */ e(X, { error: S && !!c.singularName, children: S && c.singularName ? c.singularName : "Optionally define a singular name for your entities" })
|
|
186
187
|
] }),
|
|
187
188
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
188
189
|
/* @__PURE__ */ e(
|
|
189
190
|
Oe,
|
|
190
191
|
{
|
|
191
|
-
error:
|
|
192
|
+
error: S && !!c.description,
|
|
192
193
|
id: "description",
|
|
193
|
-
value:
|
|
194
|
-
onChange:
|
|
194
|
+
value: p.description ?? "",
|
|
195
|
+
onChange: h,
|
|
195
196
|
multiline: !0,
|
|
196
197
|
rows: 2,
|
|
197
198
|
"aria-describedby": "description-helper-text",
|
|
198
199
|
label: "Description"
|
|
199
200
|
}
|
|
200
201
|
),
|
|
201
|
-
/* @__PURE__ */ e(X, { error:
|
|
202
|
+
/* @__PURE__ */ e(X, { error: S && !!c.description, children: S && c.description ? c.description : "Description of the collection, you can use markdown" })
|
|
202
203
|
] }),
|
|
203
204
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
204
205
|
be,
|
|
@@ -206,16 +207,16 @@ function yi({
|
|
|
206
207
|
name: "defaultSize",
|
|
207
208
|
label: "Default row size",
|
|
208
209
|
position: "item-aligned",
|
|
209
|
-
onChange:
|
|
210
|
-
value:
|
|
211
|
-
renderValue: (
|
|
212
|
-
children: ["xs", "s", "m", "l", "xl"].map((
|
|
210
|
+
onChange: h,
|
|
211
|
+
value: p.defaultSize ?? "",
|
|
212
|
+
renderValue: (s) => s.toUpperCase(),
|
|
213
|
+
children: ["xs", "s", "m", "l", "xl"].map((s) => /* @__PURE__ */ e(
|
|
213
214
|
ee,
|
|
214
215
|
{
|
|
215
|
-
value:
|
|
216
|
-
children:
|
|
216
|
+
value: s,
|
|
217
|
+
children: s.toUpperCase()
|
|
217
218
|
},
|
|
218
|
-
`size-select-${
|
|
219
|
+
`size-select-${s}`
|
|
219
220
|
))
|
|
220
221
|
}
|
|
221
222
|
) }),
|
|
@@ -226,13 +227,13 @@ function yi({
|
|
|
226
227
|
label: "Data IDs generation",
|
|
227
228
|
position: "item-aligned",
|
|
228
229
|
disabled: B === "code_defined",
|
|
229
|
-
onValueChange: (
|
|
230
|
-
if (
|
|
230
|
+
onValueChange: (s) => {
|
|
231
|
+
if (s === "code_defined")
|
|
231
232
|
throw new Error("This should not happen");
|
|
232
|
-
|
|
233
|
+
s === "true" ? u("customId", !0) : s === "false" ? u("customId", !1) : s === "optional" && u("customId", "optional");
|
|
233
234
|
},
|
|
234
235
|
value: "",
|
|
235
|
-
renderValue: (
|
|
236
|
+
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",
|
|
236
237
|
children: [
|
|
237
238
|
/* @__PURE__ */ e(ee, { value: "false", children: "Document ID is generated automatically" }),
|
|
238
239
|
/* @__PURE__ */ e(ee, { value: "true", children: "Users must define an ID" }),
|
|
@@ -242,24 +243,24 @@ function yi({
|
|
|
242
243
|
) }),
|
|
243
244
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
244
245
|
/* @__PURE__ */ e(
|
|
245
|
-
|
|
246
|
+
ct,
|
|
246
247
|
{
|
|
247
248
|
position: "start",
|
|
248
249
|
label: "Collection group",
|
|
249
|
-
onValueChange: (
|
|
250
|
-
value:
|
|
250
|
+
onValueChange: (s) => u("collectionGroup", s),
|
|
251
|
+
value: p.collectionGroup ?? !1
|
|
251
252
|
}
|
|
252
253
|
),
|
|
253
254
|
/* @__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
255
|
] }),
|
|
255
256
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
256
257
|
/* @__PURE__ */ e(
|
|
257
|
-
|
|
258
|
+
ct,
|
|
258
259
|
{
|
|
259
260
|
position: "start",
|
|
260
261
|
label: "Enable text search for this collection",
|
|
261
|
-
onValueChange: (
|
|
262
|
-
value:
|
|
262
|
+
onValueChange: (s) => u("textSearchEnabled", s),
|
|
263
|
+
value: p.textSearchEnabled ?? !1
|
|
263
264
|
}
|
|
264
265
|
),
|
|
265
266
|
/* @__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." })
|
|
@@ -270,18 +271,18 @@ function yi({
|
|
|
270
271
|
] }),
|
|
271
272
|
/* @__PURE__ */ e("div", { style: { height: "52px" } }),
|
|
272
273
|
/* @__PURE__ */ e(
|
|
273
|
-
|
|
274
|
+
Fe,
|
|
274
275
|
{
|
|
275
276
|
open: y,
|
|
276
277
|
onOpenChange: C,
|
|
277
278
|
maxWidth: "xl",
|
|
278
279
|
fullWidth: !0,
|
|
279
280
|
children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
|
|
280
|
-
|
|
281
|
+
gr,
|
|
281
282
|
{
|
|
282
|
-
selectedIcon:
|
|
283
|
-
onIconSelected: (
|
|
284
|
-
C(!1),
|
|
283
|
+
selectedIcon: p.icon,
|
|
284
|
+
onIconSelected: (s) => {
|
|
285
|
+
C(!1), u("icon", s);
|
|
285
286
|
}
|
|
286
287
|
}
|
|
287
288
|
) })
|
|
@@ -289,7 +290,7 @@ function yi({
|
|
|
289
290
|
)
|
|
290
291
|
] }) });
|
|
291
292
|
}
|
|
292
|
-
function
|
|
293
|
+
function pe(t) {
|
|
293
294
|
return "properties." + t.replaceAll(".", ".properties.");
|
|
294
295
|
}
|
|
295
296
|
function bi(t) {
|
|
@@ -303,7 +304,7 @@ function ae(t, r) {
|
|
|
303
304
|
}
|
|
304
305
|
function ir(t, r) {
|
|
305
306
|
const n = r ? `${r}.${t}` : t;
|
|
306
|
-
return
|
|
307
|
+
return pe(n);
|
|
307
308
|
}
|
|
308
309
|
function Ci({
|
|
309
310
|
enumValues: t,
|
|
@@ -314,26 +315,26 @@ function Ci({
|
|
|
314
315
|
allowDataInference: o,
|
|
315
316
|
getData: d
|
|
316
317
|
}) {
|
|
317
|
-
const
|
|
318
|
+
const p = Tt({
|
|
318
319
|
initialValues: { enumValues: t },
|
|
319
320
|
validateOnChange: !0,
|
|
320
|
-
validation: (
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
v?.label || (
|
|
321
|
+
validation: (m) => {
|
|
322
|
+
const c = {};
|
|
323
|
+
m.enumValues && m.enumValues.forEach((v, x) => {
|
|
324
|
+
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");
|
|
324
325
|
});
|
|
325
|
-
const
|
|
326
|
-
return n?.(
|
|
326
|
+
const g = !!(c?.enumValues && Object.keys(c?.enumValues).length > 0);
|
|
327
|
+
return n?.(g), c;
|
|
327
328
|
}
|
|
328
|
-
}), { values:
|
|
329
|
-
return
|
|
330
|
-
r && r(
|
|
331
|
-
}, [
|
|
329
|
+
}), { values: u, errors: h } = p;
|
|
330
|
+
return ce(() => {
|
|
331
|
+
r && r(u.enumValues);
|
|
332
|
+
}, [u.enumValues]), /* @__PURE__ */ e(kt, { value: p, children: /* @__PURE__ */ e(
|
|
332
333
|
Pi,
|
|
333
334
|
{
|
|
334
335
|
enumValuesPath: "enumValues",
|
|
335
|
-
values:
|
|
336
|
-
errors:
|
|
336
|
+
values: u,
|
|
337
|
+
errors: h,
|
|
337
338
|
shouldUpdateId: i,
|
|
338
339
|
disabled: l,
|
|
339
340
|
allowDataInference: o,
|
|
@@ -351,9 +352,9 @@ function Pi({
|
|
|
351
352
|
getData: d
|
|
352
353
|
}) {
|
|
353
354
|
const {
|
|
354
|
-
setFieldValue:
|
|
355
|
-
} = K(), [
|
|
356
|
-
const O =
|
|
355
|
+
setFieldValue: p
|
|
356
|
+
} = K(), [u, h] = Y.useState(), [m, c] = Y.useState(), [g, v] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, C = (b, P) => {
|
|
357
|
+
const O = u === P, f = r?.enumValues && r?.enumValues[b];
|
|
357
358
|
return /* @__PURE__ */ e(
|
|
358
359
|
Ni,
|
|
359
360
|
{
|
|
@@ -361,9 +362,9 @@ function Pi({
|
|
|
361
362
|
disabled: n,
|
|
362
363
|
enumValuesPath: i,
|
|
363
364
|
autoFocus: O,
|
|
364
|
-
entryError:
|
|
365
|
+
entryError: f,
|
|
365
366
|
shouldUpdateId: l || O,
|
|
366
|
-
onDialogOpen: () =>
|
|
367
|
+
onDialogOpen: () => c(b),
|
|
367
368
|
inferredEntry: y.has(t.enumValues[b]?.id)
|
|
368
369
|
},
|
|
369
370
|
`${P}`
|
|
@@ -373,7 +374,7 @@ function Pi({
|
|
|
373
374
|
/* @__PURE__ */ a("div", { className: "ml-3.5 flex flex-row items-center", children: [
|
|
374
375
|
/* @__PURE__ */ e(Ar, {}),
|
|
375
376
|
/* @__PURE__ */ e(
|
|
376
|
-
|
|
377
|
+
k,
|
|
377
378
|
{
|
|
378
379
|
variant: "subtitle2",
|
|
379
380
|
className: "ml-2 grow",
|
|
@@ -383,24 +384,24 @@ function Pi({
|
|
|
383
384
|
o && /* @__PURE__ */ a(
|
|
384
385
|
z,
|
|
385
386
|
{
|
|
386
|
-
loading:
|
|
387
|
-
disabled: n ||
|
|
387
|
+
loading: g,
|
|
388
|
+
disabled: n || g,
|
|
388
389
|
variant: "text",
|
|
389
390
|
size: "small",
|
|
390
391
|
onClick: async () => {
|
|
391
392
|
d && (v(!0), d?.().then((b) => {
|
|
392
393
|
if (!b)
|
|
393
394
|
return;
|
|
394
|
-
const P = b.flat(), O = Array.from(new Set(P)),
|
|
395
|
-
|
|
395
|
+
const P = b.flat(), O = Array.from(new Set(P)), f = t.enumValues, _ = ei(O).filter((R) => !f?.some((M) => M.id === R.id));
|
|
396
|
+
_.forEach((R) => {
|
|
396
397
|
y.add(R.id);
|
|
397
|
-
}),
|
|
398
|
+
}), p(i, [..._, ...f], !0);
|
|
398
399
|
}).catch((b) => {
|
|
399
400
|
console.error(b);
|
|
400
401
|
}).finally(() => v(!1)));
|
|
401
402
|
},
|
|
402
403
|
children: [
|
|
403
|
-
|
|
404
|
+
g ? /* @__PURE__ */ e(De, { size: "small" }) : /* @__PURE__ */ e(ht, {}),
|
|
404
405
|
"Infer values from data"
|
|
405
406
|
]
|
|
406
407
|
}
|
|
@@ -408,7 +409,7 @@ function Pi({
|
|
|
408
409
|
] }),
|
|
409
410
|
/* @__PURE__ */ a(Ce, { className: "p-4 m-1", children: [
|
|
410
411
|
/* @__PURE__ */ e(
|
|
411
|
-
|
|
412
|
+
yr,
|
|
412
413
|
{
|
|
413
414
|
droppableId: i,
|
|
414
415
|
addLabel: "Add enum value",
|
|
@@ -416,19 +417,19 @@ function Pi({
|
|
|
416
417
|
disabled: n,
|
|
417
418
|
size: "small",
|
|
418
419
|
buildEntry: C,
|
|
419
|
-
onInternalIdAdded:
|
|
420
|
+
onInternalIdAdded: h,
|
|
420
421
|
includeAddButton: !0,
|
|
421
|
-
onValueChange: (b) =>
|
|
422
|
+
onValueChange: (b) => p(i, b),
|
|
422
423
|
newDefaultEntry: { id: "", label: "" }
|
|
423
424
|
}
|
|
424
425
|
),
|
|
425
426
|
/* @__PURE__ */ e(
|
|
426
427
|
xi,
|
|
427
428
|
{
|
|
428
|
-
index:
|
|
429
|
-
open:
|
|
429
|
+
index: m,
|
|
430
|
+
open: m !== void 0,
|
|
430
431
|
enumValuesPath: i,
|
|
431
|
-
onClose: () =>
|
|
432
|
+
onClose: () => c(void 0)
|
|
432
433
|
}
|
|
433
434
|
)
|
|
434
435
|
] })
|
|
@@ -442,19 +443,19 @@ const Ni = Y.memo(
|
|
|
442
443
|
autoFocus: l,
|
|
443
444
|
onDialogOpen: o,
|
|
444
445
|
disabled: d,
|
|
445
|
-
inferredEntry:
|
|
446
|
-
entryError:
|
|
446
|
+
inferredEntry: p,
|
|
447
|
+
entryError: u
|
|
447
448
|
}) {
|
|
448
449
|
const {
|
|
449
|
-
values:
|
|
450
|
-
handleChange:
|
|
451
|
-
errors:
|
|
452
|
-
setFieldValue:
|
|
450
|
+
values: h,
|
|
451
|
+
handleChange: m,
|
|
452
|
+
errors: c,
|
|
453
|
+
setFieldValue: g,
|
|
453
454
|
touched: v
|
|
454
|
-
} = K(),
|
|
455
|
+
} = K(), x = Y.useRef(!I(h, `${i}[${r}].id`)), y = n || x.current, C = I(h, `${i}[${r}].id`), w = I(h, `${i}[${r}].label`), b = Y.useRef(w);
|
|
455
456
|
return Y.useEffect(() => {
|
|
456
|
-
(b.current === C || !C) && y &&
|
|
457
|
-
}, [
|
|
457
|
+
(b.current === C || !C) && y && g(`${i}[${r}].id`, w), b.current = w;
|
|
458
|
+
}, [w]), /* @__PURE__ */ a(U, { children: [
|
|
458
459
|
/* @__PURE__ */ a("div", { className: "flex w-full align-center justify-center", children: [
|
|
459
460
|
/* @__PURE__ */ e(
|
|
460
461
|
H,
|
|
@@ -467,41 +468,41 @@ const Ni = Y.memo(
|
|
|
467
468
|
size: "small",
|
|
468
469
|
autoFocus: l,
|
|
469
470
|
autoComplete: "off",
|
|
470
|
-
endAdornment:
|
|
471
|
-
error: !!
|
|
471
|
+
endAdornment: p && /* @__PURE__ */ e(ht, { size: "small" }),
|
|
472
|
+
error: !!u?.label
|
|
472
473
|
}
|
|
473
474
|
),
|
|
474
|
-
!d && /* @__PURE__ */ e(Er, { color: "error", invisible: !
|
|
475
|
+
!d && /* @__PURE__ */ e(Er, { color: "error", invisible: !u?.id, children: /* @__PURE__ */ e(
|
|
475
476
|
oe,
|
|
476
477
|
{
|
|
477
478
|
size: "small",
|
|
478
479
|
"aria-label": "edit",
|
|
479
480
|
className: "m-1",
|
|
480
481
|
onClick: () => o(),
|
|
481
|
-
children: /* @__PURE__ */ e(
|
|
482
|
+
children: /* @__PURE__ */ e(He, { size: "small" })
|
|
482
483
|
}
|
|
483
484
|
) })
|
|
484
485
|
] }),
|
|
485
|
-
|
|
486
|
-
|
|
486
|
+
u?.label && /* @__PURE__ */ e(
|
|
487
|
+
k,
|
|
487
488
|
{
|
|
488
489
|
variant: "caption",
|
|
489
490
|
className: "ml-3.5 text-red-500 dark:text-red-500",
|
|
490
|
-
children:
|
|
491
|
+
children: u?.label
|
|
491
492
|
}
|
|
492
493
|
),
|
|
493
|
-
|
|
494
|
-
|
|
494
|
+
u?.id && /* @__PURE__ */ e(
|
|
495
|
+
k,
|
|
495
496
|
{
|
|
496
497
|
variant: "caption",
|
|
497
498
|
className: "ml-3.5 text-red-500 dark:text-red-500",
|
|
498
|
-
children:
|
|
499
|
+
children: u?.id
|
|
499
500
|
}
|
|
500
501
|
)
|
|
501
502
|
] });
|
|
502
503
|
},
|
|
503
504
|
function(r, n) {
|
|
504
|
-
return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry &&
|
|
505
|
+
return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry && ve(r.entryError, n.entryError) && r.autoFocus === n.autoFocus;
|
|
505
506
|
}
|
|
506
507
|
);
|
|
507
508
|
function xi({
|
|
@@ -514,14 +515,14 @@ function xi({
|
|
|
514
515
|
errors: l
|
|
515
516
|
} = K(), o = t !== void 0 ? I(l, `${i}[${t}].id`) : void 0;
|
|
516
517
|
return /* @__PURE__ */ a(
|
|
517
|
-
|
|
518
|
+
Fe,
|
|
518
519
|
{
|
|
519
520
|
maxWidth: "md",
|
|
520
521
|
"aria-labelledby": "enum-edit-dialog",
|
|
521
522
|
open: r,
|
|
522
523
|
onOpenChange: (d) => d ? void 0 : n(),
|
|
523
524
|
children: [
|
|
524
|
-
/* @__PURE__ */ e(
|
|
525
|
+
/* @__PURE__ */ e(Be, { children: t !== void 0 && /* @__PURE__ */ a("div", { children: [
|
|
525
526
|
/* @__PURE__ */ e(
|
|
526
527
|
H,
|
|
527
528
|
{
|
|
@@ -536,7 +537,7 @@ function xi({
|
|
|
536
537
|
),
|
|
537
538
|
/* @__PURE__ */ e(X, { error: !!o, children: o ?? "Value saved in the data source" })
|
|
538
539
|
] }) }),
|
|
539
|
-
/* @__PURE__ */ e(
|
|
540
|
+
/* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(
|
|
540
541
|
z,
|
|
541
542
|
{
|
|
542
543
|
autoFocus: !0,
|
|
@@ -559,8 +560,8 @@ function se({
|
|
|
559
560
|
size: o = "small",
|
|
560
561
|
allowIndeterminate: d
|
|
561
562
|
}) {
|
|
562
|
-
const
|
|
563
|
-
|
|
563
|
+
const p = /* @__PURE__ */ e(
|
|
564
|
+
ct,
|
|
564
565
|
{
|
|
565
566
|
label: n,
|
|
566
567
|
size: o,
|
|
@@ -568,18 +569,18 @@ function se({
|
|
|
568
569
|
value: t.value,
|
|
569
570
|
disabled: l,
|
|
570
571
|
allowIndeterminate: d,
|
|
571
|
-
onValueChange: (
|
|
572
|
+
onValueChange: (u) => r.setFieldValue(t.name, u)
|
|
572
573
|
}
|
|
573
574
|
);
|
|
574
575
|
return i ? /* @__PURE__ */ e(
|
|
575
576
|
te,
|
|
576
577
|
{
|
|
577
578
|
title: i,
|
|
578
|
-
children:
|
|
579
|
+
children: p
|
|
579
580
|
}
|
|
580
|
-
) :
|
|
581
|
+
) : p;
|
|
581
582
|
}
|
|
582
|
-
function
|
|
583
|
+
function Se({ disabled: t }) {
|
|
583
584
|
const { values: r, handleChange: n } = K(), i = "validation.required", l = "validation.requiredMessage";
|
|
584
585
|
return /* @__PURE__ */ a(U, { children: [
|
|
585
586
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
@@ -587,13 +588,13 @@ function Fe({ disabled: t }) {
|
|
|
587
588
|
{
|
|
588
589
|
name: i,
|
|
589
590
|
type: "checkbox",
|
|
590
|
-
children: ({ field: d, form:
|
|
591
|
+
children: ({ field: d, form: p }) => /* @__PURE__ */ e(
|
|
591
592
|
se,
|
|
592
593
|
{
|
|
593
594
|
disabled: t,
|
|
594
595
|
label: "Required",
|
|
595
596
|
tooltip: "You won't be able to save this entity if this value is not set",
|
|
596
|
-
form:
|
|
597
|
+
form: p,
|
|
597
598
|
field: d
|
|
598
599
|
}
|
|
599
600
|
)
|
|
@@ -604,13 +605,13 @@ function Fe({ disabled: t }) {
|
|
|
604
605
|
{
|
|
605
606
|
name: "validation.unique",
|
|
606
607
|
type: "checkbox",
|
|
607
|
-
children: ({ field: d, form:
|
|
608
|
+
children: ({ field: d, form: p }) => /* @__PURE__ */ e(
|
|
608
609
|
se,
|
|
609
610
|
{
|
|
610
611
|
disabled: t,
|
|
611
612
|
label: "Unique",
|
|
612
613
|
tooltip: "There cannot be multiple entities with the same value",
|
|
613
|
-
form:
|
|
614
|
+
form: p,
|
|
614
615
|
field: d
|
|
615
616
|
}
|
|
616
617
|
)
|
|
@@ -629,7 +630,7 @@ function Fe({ disabled: t }) {
|
|
|
629
630
|
) })
|
|
630
631
|
] });
|
|
631
632
|
}
|
|
632
|
-
function
|
|
633
|
+
function Ee({
|
|
633
634
|
length: t,
|
|
634
635
|
lowercase: r,
|
|
635
636
|
matches: n,
|
|
@@ -637,28 +638,28 @@ function Se({
|
|
|
637
638
|
min: l,
|
|
638
639
|
trim: o,
|
|
639
640
|
uppercase: d,
|
|
640
|
-
disabled:
|
|
641
|
-
showErrors:
|
|
641
|
+
disabled: p,
|
|
642
|
+
showErrors: u
|
|
642
643
|
}) {
|
|
643
644
|
const {
|
|
644
|
-
values:
|
|
645
|
-
handleChange:
|
|
646
|
-
errors:
|
|
647
|
-
} = K(),
|
|
645
|
+
values: h,
|
|
646
|
+
handleChange: m,
|
|
647
|
+
errors: c
|
|
648
|
+
} = K(), g = "validation.length", v = "validation.min", x = "validation.max", y = "validation.trim", C = "validation.matches", w = "validation.lowercase", b = "validation.uppercase", P = I(c, C), O = I(h, C), f = typeof O == "string" ? O : br(O);
|
|
648
649
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
649
|
-
/* @__PURE__ */ e(
|
|
650
|
+
/* @__PURE__ */ e(Se, { disabled: p }),
|
|
650
651
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
651
652
|
r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
652
653
|
H,
|
|
653
654
|
{
|
|
654
|
-
name:
|
|
655
|
+
name: w,
|
|
655
656
|
type: "checkbox",
|
|
656
|
-
children: ({ field: N, form:
|
|
657
|
+
children: ({ field: N, form: _ }) => /* @__PURE__ */ e(
|
|
657
658
|
se,
|
|
658
659
|
{
|
|
659
660
|
label: "Lowercase",
|
|
660
|
-
disabled:
|
|
661
|
-
form:
|
|
661
|
+
disabled: p,
|
|
662
|
+
form: _,
|
|
662
663
|
field: N
|
|
663
664
|
}
|
|
664
665
|
)
|
|
@@ -669,12 +670,12 @@ function Se({
|
|
|
669
670
|
{
|
|
670
671
|
name: b,
|
|
671
672
|
type: "checkbox",
|
|
672
|
-
children: ({ field: N, form:
|
|
673
|
+
children: ({ field: N, form: _ }) => /* @__PURE__ */ e(
|
|
673
674
|
se,
|
|
674
675
|
{
|
|
675
676
|
label: "Uppercase",
|
|
676
|
-
disabled:
|
|
677
|
-
form:
|
|
677
|
+
disabled: p,
|
|
678
|
+
form: _,
|
|
678
679
|
field: N
|
|
679
680
|
}
|
|
680
681
|
)
|
|
@@ -685,12 +686,12 @@ function Se({
|
|
|
685
686
|
{
|
|
686
687
|
name: y,
|
|
687
688
|
type: "checkbox",
|
|
688
|
-
children: ({ field: N, form:
|
|
689
|
+
children: ({ field: N, form: _ }) => /* @__PURE__ */ e(
|
|
689
690
|
se,
|
|
690
691
|
{
|
|
691
692
|
label: "Trim",
|
|
692
|
-
disabled:
|
|
693
|
-
form:
|
|
693
|
+
disabled: p,
|
|
694
|
+
form: _,
|
|
694
695
|
field: N
|
|
695
696
|
}
|
|
696
697
|
)
|
|
@@ -701,37 +702,37 @@ function Se({
|
|
|
701
702
|
t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
702
703
|
J,
|
|
703
704
|
{
|
|
704
|
-
value: I(
|
|
705
|
+
value: I(h, g),
|
|
705
706
|
label: "Exact length",
|
|
706
|
-
name:
|
|
707
|
+
name: g,
|
|
707
708
|
type: "number",
|
|
708
709
|
size: "small",
|
|
709
|
-
disabled:
|
|
710
|
-
onChange:
|
|
710
|
+
disabled: p,
|
|
711
|
+
onChange: m
|
|
711
712
|
}
|
|
712
713
|
) }),
|
|
713
714
|
l && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
714
715
|
J,
|
|
715
716
|
{
|
|
716
|
-
value: I(
|
|
717
|
+
value: I(h, v),
|
|
717
718
|
label: "Min length",
|
|
718
719
|
name: v,
|
|
719
720
|
type: "number",
|
|
720
721
|
size: "small",
|
|
721
|
-
disabled:
|
|
722
|
-
onChange:
|
|
722
|
+
disabled: p,
|
|
723
|
+
onChange: m
|
|
723
724
|
}
|
|
724
725
|
) }),
|
|
725
726
|
i && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
726
727
|
J,
|
|
727
728
|
{
|
|
728
|
-
value: I(
|
|
729
|
+
value: I(h, x),
|
|
729
730
|
label: "Max length",
|
|
730
|
-
name:
|
|
731
|
+
name: x,
|
|
731
732
|
type: "number",
|
|
732
733
|
size: "small",
|
|
733
|
-
disabled:
|
|
734
|
-
onChange:
|
|
734
|
+
disabled: p,
|
|
735
|
+
onChange: m
|
|
735
736
|
}
|
|
736
737
|
) })
|
|
737
738
|
] }),
|
|
@@ -743,8 +744,8 @@ function Se({
|
|
|
743
744
|
as: J,
|
|
744
745
|
label: "Matches regex",
|
|
745
746
|
size: "small",
|
|
746
|
-
disabled:
|
|
747
|
-
value:
|
|
747
|
+
disabled: p,
|
|
748
|
+
value: f,
|
|
748
749
|
error: !!P
|
|
749
750
|
}
|
|
750
751
|
),
|
|
@@ -762,7 +763,7 @@ function Ot({
|
|
|
762
763
|
handleChange: l
|
|
763
764
|
} = K(), o = "validation.min", d = "validation.max";
|
|
764
765
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
765
|
-
/* @__PURE__ */ e(
|
|
766
|
+
/* @__PURE__ */ e(Se, { disabled: n }),
|
|
766
767
|
r && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
767
768
|
J,
|
|
768
769
|
{
|
|
@@ -789,7 +790,7 @@ function Ot({
|
|
|
789
790
|
) })
|
|
790
791
|
] });
|
|
791
792
|
}
|
|
792
|
-
function
|
|
793
|
+
function Ne({
|
|
793
794
|
children: t
|
|
794
795
|
}) {
|
|
795
796
|
return /* @__PURE__ */ e(
|
|
@@ -801,7 +802,7 @@ function Pe({
|
|
|
801
802
|
title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
|
|
802
803
|
/* @__PURE__ */ e(Dr, {}),
|
|
803
804
|
/* @__PURE__ */ e(
|
|
804
|
-
|
|
805
|
+
k,
|
|
805
806
|
{
|
|
806
807
|
variant: "subtitle2",
|
|
807
808
|
className: "ml-2",
|
|
@@ -823,9 +824,9 @@ function Rt({
|
|
|
823
824
|
}) {
|
|
824
825
|
const {
|
|
825
826
|
values: d,
|
|
826
|
-
setFieldError:
|
|
827
|
-
setFieldValue:
|
|
828
|
-
} = K(),
|
|
827
|
+
setFieldError: p,
|
|
828
|
+
setFieldValue: u
|
|
829
|
+
} = K(), h = Ie(), m = t ? "of.enumValues" : "enumValues", c = I(d, "defaultValue"), g = I(d, m), v = Zt(() => !g || typeof g == "boolean" ? [] : Cr(g) ?? [], [g]);
|
|
829
830
|
return /* @__PURE__ */ a(U, { children: [
|
|
830
831
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
831
832
|
Ci,
|
|
@@ -835,13 +836,13 @@ function Rt({
|
|
|
835
836
|
disabled: n,
|
|
836
837
|
allowDataInference: l,
|
|
837
838
|
onError: (y) => {
|
|
838
|
-
|
|
839
|
+
p(m, y ? "This enum property is missing some values" : void 0);
|
|
839
840
|
},
|
|
840
841
|
getData: o ? () => o().then((y) => y.map((C) => d.id && I(C, d.id)).filter(Boolean)) : void 0,
|
|
841
842
|
onValuesChanged: (y) => {
|
|
842
|
-
if (d && (
|
|
843
|
-
const C = y.filter((
|
|
844
|
-
|
|
843
|
+
if (d && (u(m, y), !t)) {
|
|
844
|
+
const C = y.filter((w) => !!w?.id).map((w) => w.id);
|
|
845
|
+
c && !C.includes(c) && (u("defaultValue", void 0), h.open({
|
|
845
846
|
type: "warning",
|
|
846
847
|
message: "Default value was cleared"
|
|
847
848
|
}));
|
|
@@ -849,9 +850,9 @@ function Rt({
|
|
|
849
850
|
}
|
|
850
851
|
}
|
|
851
852
|
) }),
|
|
852
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
853
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ne, { children: [
|
|
853
854
|
!t && /* @__PURE__ */ e(
|
|
854
|
-
|
|
855
|
+
Ee,
|
|
855
856
|
{
|
|
856
857
|
disabled: n,
|
|
857
858
|
showErrors: i
|
|
@@ -865,10 +866,10 @@ function Rt({
|
|
|
865
866
|
disabled: n,
|
|
866
867
|
position: "item-aligned",
|
|
867
868
|
onValueChange: (y) => {
|
|
868
|
-
|
|
869
|
+
u("defaultValue", y);
|
|
869
870
|
},
|
|
870
871
|
label: "Default value",
|
|
871
|
-
value:
|
|
872
|
+
value: c ?? "",
|
|
872
873
|
children: v.filter((y) => !!y?.id).map((y) => /* @__PURE__ */ e(
|
|
873
874
|
ee,
|
|
874
875
|
{
|
|
@@ -896,9 +897,9 @@ function Ut({
|
|
|
896
897
|
const {
|
|
897
898
|
values: i,
|
|
898
899
|
setFieldValue: l
|
|
899
|
-
} = K(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`,
|
|
900
|
-
b ? b.includes("all") || b.length >= Object.keys(it).length ? l(d, void 0) :
|
|
901
|
-
}, C = typeof
|
|
900
|
+
} = 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) => {
|
|
901
|
+
b ? b.includes("all") || b.length >= Object.keys(it).length ? l(d, void 0) : x ? l(d, Object.keys(it).filter((P) => !b.includes(P))) : l(d, b) : l(d, void 0);
|
|
902
|
+
}, C = typeof m == "function", w = typeof c == "function";
|
|
902
903
|
return /* @__PURE__ */ a(U, { children: [
|
|
903
904
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
904
905
|
xt,
|
|
@@ -906,7 +907,7 @@ function Ut({
|
|
|
906
907
|
title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
|
|
907
908
|
/* @__PURE__ */ e(Br, {}),
|
|
908
909
|
/* @__PURE__ */ e(
|
|
909
|
-
|
|
910
|
+
k,
|
|
910
911
|
{
|
|
911
912
|
variant: "subtitle2",
|
|
912
913
|
className: "ml-2",
|
|
@@ -922,7 +923,7 @@ function Ut({
|
|
|
922
923
|
name: d,
|
|
923
924
|
value: v ?? [],
|
|
924
925
|
onMultiValueChange: y,
|
|
925
|
-
label:
|
|
926
|
+
label: x ? void 0 : "Allowed file types",
|
|
926
927
|
renderValues: (b) => !b || b.length === 0 ? "All file types allowed" : b.map((P) => it[P]).filter((P) => !!P).join(", "),
|
|
927
928
|
children: [
|
|
928
929
|
/* @__PURE__ */ a(St, { value: "all", className: "flex items-center gap-2", children: [
|
|
@@ -938,7 +939,7 @@ function Ut({
|
|
|
938
939
|
/* @__PURE__ */ e(
|
|
939
940
|
Et,
|
|
940
941
|
{
|
|
941
|
-
checked:
|
|
942
|
+
checked: x || v.indexOf(b) > -1
|
|
942
943
|
}
|
|
943
944
|
),
|
|
944
945
|
/* @__PURE__ */ e("div", { className: "flex-grow", children: P }),
|
|
@@ -958,27 +959,27 @@ function Ut({
|
|
|
958
959
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
959
960
|
H,
|
|
960
961
|
{
|
|
961
|
-
name:
|
|
962
|
+
name: p,
|
|
962
963
|
as: J,
|
|
963
964
|
label: "File name",
|
|
964
965
|
size: "small",
|
|
965
966
|
disabled: C || n,
|
|
966
|
-
value: C ? "-" :
|
|
967
|
+
value: C ? "-" : m
|
|
967
968
|
}
|
|
968
969
|
) }),
|
|
969
970
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
970
971
|
/* @__PURE__ */ e(
|
|
971
972
|
H,
|
|
972
973
|
{
|
|
973
|
-
name:
|
|
974
|
+
name: u,
|
|
974
975
|
as: J,
|
|
975
976
|
label: "Storage path",
|
|
976
|
-
disabled:
|
|
977
|
+
disabled: w || n,
|
|
977
978
|
size: "small",
|
|
978
|
-
value:
|
|
979
|
+
value: w ? "-" : c
|
|
979
980
|
}
|
|
980
981
|
),
|
|
981
|
-
/* @__PURE__ */ a(
|
|
982
|
+
/* @__PURE__ */ a(k, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
|
|
982
983
|
/* @__PURE__ */ e("p", { children: "You can use the following placeholders in the file name and storage path values:" }),
|
|
983
984
|
/* @__PURE__ */ a("ul", { children: [
|
|
984
985
|
/* @__PURE__ */ e("li", { children: "{file} - Full name of the uploaded file" }),
|
|
@@ -993,7 +994,7 @@ function Ut({
|
|
|
993
994
|
/* @__PURE__ */ e(
|
|
994
995
|
H,
|
|
995
996
|
{
|
|
996
|
-
name:
|
|
997
|
+
name: h,
|
|
997
998
|
type: "checkbox",
|
|
998
999
|
children: ({ field: b, form: P }) => /* @__PURE__ */ e(
|
|
999
1000
|
se,
|
|
@@ -1006,18 +1007,18 @@ function Ut({
|
|
|
1006
1007
|
)
|
|
1007
1008
|
}
|
|
1008
1009
|
),
|
|
1009
|
-
/* @__PURE__ */ e(
|
|
1010
|
+
/* @__PURE__ */ e(k, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: "Turn this setting on, if you prefer to save the download URL of the uploaded file instead of the storage path. You can only change this prop upon creation." })
|
|
1010
1011
|
] })
|
|
1011
1012
|
] })
|
|
1012
1013
|
}
|
|
1013
1014
|
) }),
|
|
1014
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
1015
|
-
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(
|
|
1015
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ne, { children: [
|
|
1016
|
+
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Se, { disabled: n }) }),
|
|
1016
1017
|
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ot, { disabled: n }) })
|
|
1017
1018
|
] }) })
|
|
1018
1019
|
] });
|
|
1019
1020
|
}
|
|
1020
|
-
function
|
|
1021
|
+
function qe(t) {
|
|
1021
1022
|
if (ne(t) || ne(t))
|
|
1022
1023
|
return !1;
|
|
1023
1024
|
{
|
|
@@ -1026,9 +1027,9 @@ function Le(t) {
|
|
|
1026
1027
|
}
|
|
1027
1028
|
}
|
|
1028
1029
|
function wi(t) {
|
|
1029
|
-
return Object.entries(t).filter(([r, n]) =>
|
|
1030
|
+
return Object.entries(t).filter(([r, n]) => qe(n)).map(([r, n]) => {
|
|
1030
1031
|
const i = n;
|
|
1031
|
-
if (
|
|
1032
|
+
if (qe(i))
|
|
1032
1033
|
return i.dataType === "map" && i.properties ? {
|
|
1033
1034
|
[r]: {
|
|
1034
1035
|
...i,
|
|
@@ -1045,32 +1046,32 @@ function nr({
|
|
|
1045
1046
|
includeEditButton: l,
|
|
1046
1047
|
selected: o
|
|
1047
1048
|
}) {
|
|
1048
|
-
const { propertyConfigs: d } =
|
|
1049
|
-
|
|
1050
|
-
const
|
|
1051
|
-
return n && console.log("PropertyFieldPreview", t), /* @__PURE__ */ e(
|
|
1049
|
+
const { propertyConfigs: d } = Ae(), p = $e(t, d);
|
|
1050
|
+
qe(t);
|
|
1051
|
+
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";
|
|
1052
|
+
return n && console.log("PropertyFieldPreview", t), /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ a(
|
|
1052
1053
|
"div",
|
|
1053
1054
|
{
|
|
1054
1055
|
onClick: r,
|
|
1055
1056
|
className: "flex flex-row w-full cursor-pointer",
|
|
1056
1057
|
children: [
|
|
1057
|
-
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(
|
|
1058
|
+
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ye, { propertyConfig: p }) }),
|
|
1058
1059
|
/* @__PURE__ */ a(
|
|
1059
1060
|
Ce,
|
|
1060
1061
|
{
|
|
1061
|
-
className:
|
|
1062
|
+
className: me(
|
|
1062
1063
|
"border",
|
|
1063
1064
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
1064
1065
|
Qt,
|
|
1065
1066
|
r ? Xt : "",
|
|
1066
1067
|
o ? er : "",
|
|
1067
1068
|
"flex-grow p-4 border transition-colors duration-200",
|
|
1068
|
-
|
|
1069
|
+
u
|
|
1069
1070
|
),
|
|
1070
1071
|
children: [
|
|
1071
1072
|
/* @__PURE__ */ a("div", { className: "w-full flex flex-col", children: [
|
|
1072
|
-
i && /* @__PURE__ */ e(
|
|
1073
|
-
|
|
1073
|
+
i && /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(
|
|
1074
|
+
k,
|
|
1074
1075
|
{
|
|
1075
1076
|
variant: "body1",
|
|
1076
1077
|
component: "span",
|
|
@@ -1079,18 +1080,18 @@ function nr({
|
|
|
1079
1080
|
}
|
|
1080
1081
|
) }),
|
|
1081
1082
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center", children: [
|
|
1082
|
-
/* @__PURE__ */ e(
|
|
1083
|
-
|
|
1083
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(
|
|
1084
|
+
k,
|
|
1084
1085
|
{
|
|
1085
1086
|
className: "flex-grow pr-2",
|
|
1086
1087
|
variant: i ? "body2" : "subtitle1",
|
|
1087
1088
|
component: "span",
|
|
1088
1089
|
color: "secondary",
|
|
1089
|
-
children:
|
|
1090
|
+
children: p?.name
|
|
1090
1091
|
}
|
|
1091
1092
|
) }),
|
|
1092
|
-
/* @__PURE__ */ e(
|
|
1093
|
-
|
|
1093
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(
|
|
1094
|
+
k,
|
|
1094
1095
|
{
|
|
1095
1096
|
variant: "body2",
|
|
1096
1097
|
component: "span",
|
|
@@ -1100,7 +1101,7 @@ function nr({
|
|
|
1100
1101
|
) })
|
|
1101
1102
|
] })
|
|
1102
1103
|
] }),
|
|
1103
|
-
l && /* @__PURE__ */ e(
|
|
1104
|
+
l && /* @__PURE__ */ e(k, { variant: "button", children: "EDIT" })
|
|
1104
1105
|
]
|
|
1105
1106
|
}
|
|
1106
1107
|
)
|
|
@@ -1114,7 +1115,7 @@ function Ti({
|
|
|
1114
1115
|
onClick: n,
|
|
1115
1116
|
property: i
|
|
1116
1117
|
}) {
|
|
1117
|
-
const { propertyConfigs: l } =
|
|
1118
|
+
const { propertyConfigs: l } = Ae(), o = !ne(i) && i ? $e(i, l) : void 0;
|
|
1118
1119
|
return /* @__PURE__ */ a(
|
|
1119
1120
|
"div",
|
|
1120
1121
|
{
|
|
@@ -1122,7 +1123,7 @@ function Ti({
|
|
|
1122
1123
|
className: "flex flex-row w-full cursor-pointer",
|
|
1123
1124
|
children: [
|
|
1124
1125
|
/* @__PURE__ */ a("div", { className: "relative m-4", children: [
|
|
1125
|
-
o && /* @__PURE__ */ e(
|
|
1126
|
+
o && /* @__PURE__ */ e(Ye, { propertyConfig: o }),
|
|
1126
1127
|
!o && /* @__PURE__ */ e(
|
|
1127
1128
|
"div",
|
|
1128
1129
|
{
|
|
@@ -1135,7 +1136,7 @@ function Ti({
|
|
|
1135
1136
|
/* @__PURE__ */ e(
|
|
1136
1137
|
Ce,
|
|
1137
1138
|
{
|
|
1138
|
-
className:
|
|
1139
|
+
className: me(
|
|
1139
1140
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
1140
1141
|
Qt,
|
|
1141
1142
|
n ? Xt : "",
|
|
@@ -1145,7 +1146,7 @@ function Ti({
|
|
|
1145
1146
|
),
|
|
1146
1147
|
children: /* @__PURE__ */ a("div", { className: "w-full flex flex-col", children: [
|
|
1147
1148
|
/* @__PURE__ */ e(
|
|
1148
|
-
|
|
1149
|
+
k,
|
|
1149
1150
|
{
|
|
1150
1151
|
variant: "body1",
|
|
1151
1152
|
component: "span",
|
|
@@ -1155,7 +1156,7 @@ function Ti({
|
|
|
1155
1156
|
),
|
|
1156
1157
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center", children: [
|
|
1157
1158
|
o && /* @__PURE__ */ e(
|
|
1158
|
-
|
|
1159
|
+
k,
|
|
1159
1160
|
{
|
|
1160
1161
|
className: "flex-grow pr-2",
|
|
1161
1162
|
variant: "body2",
|
|
@@ -1164,8 +1165,8 @@ function Ti({
|
|
|
1164
1165
|
children: o?.name
|
|
1165
1166
|
}
|
|
1166
1167
|
),
|
|
1167
|
-
i && !ne(i) && /* @__PURE__ */ e(
|
|
1168
|
-
|
|
1168
|
+
i && !ne(i) && /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(
|
|
1169
|
+
k,
|
|
1169
1170
|
{
|
|
1170
1171
|
variant: "body2",
|
|
1171
1172
|
component: "span",
|
|
@@ -1173,8 +1174,8 @@ function Ti({
|
|
|
1173
1174
|
children: i.dataType
|
|
1174
1175
|
}
|
|
1175
1176
|
) }),
|
|
1176
|
-
i && ne(i) && /* @__PURE__ */ e(
|
|
1177
|
-
|
|
1177
|
+
i && ne(i) && /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(
|
|
1178
|
+
k,
|
|
1178
1179
|
{
|
|
1179
1180
|
variant: "body2",
|
|
1180
1181
|
component: "span",
|
|
@@ -1182,8 +1183,8 @@ function Ti({
|
|
|
1182
1183
|
children: "This property is defined as a property builder in code"
|
|
1183
1184
|
}
|
|
1184
1185
|
) }),
|
|
1185
|
-
!i && /* @__PURE__ */ e(
|
|
1186
|
-
|
|
1186
|
+
!i && /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(
|
|
1187
|
+
k,
|
|
1187
1188
|
{
|
|
1188
1189
|
variant: "body2",
|
|
1189
1190
|
component: "span",
|
|
@@ -1207,52 +1208,52 @@ const ft = Y.memo(
|
|
|
1207
1208
|
properties: l,
|
|
1208
1209
|
propertiesOrder: o,
|
|
1209
1210
|
additionalFields: d,
|
|
1210
|
-
errors:
|
|
1211
|
-
onPropertyMove:
|
|
1212
|
-
onPropertyRemove:
|
|
1213
|
-
className:
|
|
1214
|
-
inferredPropertyKeys:
|
|
1215
|
-
collectionEditable:
|
|
1211
|
+
errors: p,
|
|
1212
|
+
onPropertyMove: u,
|
|
1213
|
+
onPropertyRemove: h,
|
|
1214
|
+
className: m,
|
|
1215
|
+
inferredPropertyKeys: c,
|
|
1216
|
+
collectionEditable: g
|
|
1216
1217
|
}) {
|
|
1217
|
-
const v = o ?? Object.keys(l),
|
|
1218
|
+
const v = o ?? Object.keys(l), x = Z((y) => {
|
|
1218
1219
|
if (!y.destination)
|
|
1219
1220
|
return;
|
|
1220
|
-
const C = y.source.index,
|
|
1221
|
-
b.splice(
|
|
1222
|
-
}, [r,
|
|
1223
|
-
return /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(ii, { onDragEnd:
|
|
1221
|
+
const C = y.source.index, w = y.destination.index, b = Array.from(v), [P] = b.splice(C, 1);
|
|
1222
|
+
b.splice(w, 0, P), u && u(b, r);
|
|
1223
|
+
}, [r, u, v]);
|
|
1224
|
+
return /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(ii, { onDragEnd: x, children: /* @__PURE__ */ e(ni, { droppableId: `droppable_${r}`, children: (y, C) => /* @__PURE__ */ a(
|
|
1224
1225
|
"div",
|
|
1225
1226
|
{
|
|
1226
1227
|
...y.droppableProps,
|
|
1227
1228
|
ref: y.innerRef,
|
|
1228
|
-
className:
|
|
1229
|
+
className: m,
|
|
1229
1230
|
children: [
|
|
1230
|
-
v && v.map((
|
|
1231
|
-
const P = l[
|
|
1232
|
-
return !P && !O ? (console.warn(`Property ${
|
|
1231
|
+
v && v.map((w, b) => {
|
|
1232
|
+
const P = l[w], O = d?.find((f) => f.key === w);
|
|
1233
|
+
return !P && !O ? (console.warn(`Property ${w} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
|
|
1233
1234
|
ai,
|
|
1234
1235
|
{
|
|
1235
|
-
draggableId: `array_field_${r}_${
|
|
1236
|
+
draggableId: `array_field_${r}_${w}}`,
|
|
1236
1237
|
index: b,
|
|
1237
|
-
children: (
|
|
1238
|
+
children: (f, N) => /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(
|
|
1238
1239
|
ki,
|
|
1239
1240
|
{
|
|
1240
|
-
propertyKey:
|
|
1241
|
+
propertyKey: w,
|
|
1241
1242
|
propertyOrBuilder: P,
|
|
1242
1243
|
additionalField: O,
|
|
1243
|
-
provided:
|
|
1244
|
-
errors:
|
|
1244
|
+
provided: f,
|
|
1245
|
+
errors: p,
|
|
1245
1246
|
namespace: r,
|
|
1246
|
-
inferredPropertyKeys:
|
|
1247
|
-
onPropertyMove:
|
|
1248
|
-
onPropertyRemove:
|
|
1247
|
+
inferredPropertyKeys: c,
|
|
1248
|
+
onPropertyMove: u,
|
|
1249
|
+
onPropertyRemove: h,
|
|
1249
1250
|
onPropertyClick: N.isDragging ? void 0 : i,
|
|
1250
1251
|
selectedPropertyKey: n,
|
|
1251
|
-
collectionEditable:
|
|
1252
|
+
collectionEditable: g
|
|
1252
1253
|
}
|
|
1253
1254
|
) })
|
|
1254
1255
|
},
|
|
1255
|
-
`array_field_${r}_${
|
|
1256
|
+
`array_field_${r}_${w}}`
|
|
1256
1257
|
);
|
|
1257
1258
|
}).filter(Boolean),
|
|
1258
1259
|
y.placeholder
|
|
@@ -1262,7 +1263,7 @@ const ft = Y.memo(
|
|
|
1262
1263
|
},
|
|
1263
1264
|
(t, r) => {
|
|
1264
1265
|
const n = r.selectedPropertyKey?.startsWith(r.namespace ?? ""), i = t.selectedPropertyKey?.startsWith(t.namespace ?? "");
|
|
1265
|
-
return n || i ? !1 :
|
|
1266
|
+
return n || i ? !1 : ve(t.properties, r.properties) && t.propertiesOrder === r.propertiesOrder && ve(t.additionalFields, r.additionalFields) && ve(t.errors, r.errors) && ve(t.onPropertyClick, r.onPropertyClick) && // equal(prevProps.onPropertyMove, nextProps.onPropertyMove) &&
|
|
1266
1267
|
// equal(prevProps.onPropertyRemove, nextProps.onPropertyRemove) &&
|
|
1267
1268
|
t.namespace === r.namespace && t.collectionEditable === r.collectionEditable;
|
|
1268
1269
|
}
|
|
@@ -1275,13 +1276,13 @@ function ki({
|
|
|
1275
1276
|
provided: l,
|
|
1276
1277
|
selectedPropertyKey: o,
|
|
1277
1278
|
errors: d,
|
|
1278
|
-
onPropertyClick:
|
|
1279
|
-
onPropertyMove:
|
|
1280
|
-
onPropertyRemove:
|
|
1281
|
-
inferredPropertyKeys:
|
|
1282
|
-
collectionEditable:
|
|
1279
|
+
onPropertyClick: p,
|
|
1280
|
+
onPropertyMove: u,
|
|
1281
|
+
onPropertyRemove: h,
|
|
1282
|
+
inferredPropertyKeys: m,
|
|
1283
|
+
collectionEditable: c
|
|
1283
1284
|
}) {
|
|
1284
|
-
const
|
|
1285
|
+
const g = m?.includes(r ? `${r}.${t}` : t), v = ae(t, r), y = ir(t, r) in d;
|
|
1285
1286
|
let C;
|
|
1286
1287
|
if (typeof n == "object") {
|
|
1287
1288
|
const P = n;
|
|
@@ -1293,14 +1294,14 @@ function ki({
|
|
|
1293
1294
|
properties: P.properties,
|
|
1294
1295
|
propertiesOrder: P.propertiesOrder,
|
|
1295
1296
|
errors: d,
|
|
1296
|
-
onPropertyClick:
|
|
1297
|
-
onPropertyMove:
|
|
1298
|
-
onPropertyRemove:
|
|
1299
|
-
collectionEditable:
|
|
1297
|
+
onPropertyClick: p,
|
|
1298
|
+
onPropertyMove: u,
|
|
1299
|
+
onPropertyRemove: h,
|
|
1300
|
+
collectionEditable: c
|
|
1300
1301
|
}
|
|
1301
1302
|
));
|
|
1302
1303
|
}
|
|
1303
|
-
const
|
|
1304
|
+
const w = o === v, b = n && (c && !ne(n) || qe(n));
|
|
1304
1305
|
return /* @__PURE__ */ a(
|
|
1305
1306
|
"div",
|
|
1306
1307
|
{
|
|
@@ -1324,9 +1325,9 @@ function ki({
|
|
|
1324
1325
|
nr,
|
|
1325
1326
|
{
|
|
1326
1327
|
property: n,
|
|
1327
|
-
onClick:
|
|
1328
|
+
onClick: p ? () => p(t, r) : void 0,
|
|
1328
1329
|
includeName: !0,
|
|
1329
|
-
selected:
|
|
1330
|
+
selected: w,
|
|
1330
1331
|
hasError: y
|
|
1331
1332
|
}
|
|
1332
1333
|
) : /* @__PURE__ */ e(
|
|
@@ -1334,27 +1335,27 @@ function ki({
|
|
|
1334
1335
|
{
|
|
1335
1336
|
name: t,
|
|
1336
1337
|
property: n,
|
|
1337
|
-
onClick:
|
|
1338
|
-
selected:
|
|
1338
|
+
onClick: p ? () => p(t, r) : void 0,
|
|
1339
|
+
selected: w
|
|
1339
1340
|
}
|
|
1340
1341
|
),
|
|
1341
1342
|
/* @__PURE__ */ a("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
|
|
1342
|
-
|
|
1343
|
-
|
|
1343
|
+
g && /* @__PURE__ */ e(te, { title: "Inferred property", children: /* @__PURE__ */ e(ht, { size: "small", className: "p-2" }) }),
|
|
1344
|
+
h && /* @__PURE__ */ e(te, { title: "Remove", children: /* @__PURE__ */ e(
|
|
1344
1345
|
oe,
|
|
1345
1346
|
{
|
|
1346
1347
|
size: "small",
|
|
1347
1348
|
color: "inherit",
|
|
1348
|
-
onClick: () =>
|
|
1349
|
+
onClick: () => h(t, r),
|
|
1349
1350
|
children: /* @__PURE__ */ e(Ur, { size: "small" })
|
|
1350
1351
|
}
|
|
1351
1352
|
) }),
|
|
1352
|
-
|
|
1353
|
+
u && /* @__PURE__ */ e(te, { title: "Move", children: /* @__PURE__ */ e(
|
|
1353
1354
|
oe,
|
|
1354
1355
|
{
|
|
1355
1356
|
component: "span",
|
|
1356
1357
|
size: "small",
|
|
1357
|
-
children: /* @__PURE__ */ e(
|
|
1358
|
+
children: /* @__PURE__ */ e(jr, { size: "small" })
|
|
1358
1359
|
}
|
|
1359
1360
|
) })
|
|
1360
1361
|
] }),
|
|
@@ -1367,41 +1368,41 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1367
1368
|
const {
|
|
1368
1369
|
values: o,
|
|
1369
1370
|
setFieldValue: d
|
|
1370
|
-
} = K(), [
|
|
1371
|
-
id:
|
|
1371
|
+
} = K(), [p, u] = $(!1), [h, m] = $(), [c, g] = $(), v = o.propertiesOrder ?? Object.keys(o.properties ?? {}), x = Z(({
|
|
1372
|
+
id: f,
|
|
1372
1373
|
property: N
|
|
1373
1374
|
}) => {
|
|
1374
|
-
if (!
|
|
1375
|
+
if (!f)
|
|
1375
1376
|
throw Error();
|
|
1376
1377
|
d("properties", {
|
|
1377
1378
|
...o.properties ?? {},
|
|
1378
|
-
[
|
|
1379
|
-
}, !1), d("propertiesOrder", [...v,
|
|
1380
|
-
}, [o.properties, v]), y = Z((
|
|
1381
|
-
const
|
|
1382
|
-
if (!
|
|
1379
|
+
[f]: N
|
|
1380
|
+
}, !1), d("propertiesOrder", [...v, f], !1), u(!1);
|
|
1381
|
+
}, [o.properties, v]), y = Z((f, N) => {
|
|
1382
|
+
const _ = f ? ae(f, N) : void 0;
|
|
1383
|
+
if (!_)
|
|
1383
1384
|
throw Error("collection editor miss config");
|
|
1384
|
-
const R =
|
|
1385
|
-
d(R, void 0, !1), d(M, B.filter((
|
|
1386
|
-
}, [d, o]), C =
|
|
1385
|
+
const R = pe(_), M = ye(N), B = I(o, M) ?? Object.keys(I(o, bi(N)));
|
|
1386
|
+
d(R, void 0, !1), d(M, B.filter((S) => S !== f), !1), u(!1), m(void 0), g(void 0);
|
|
1387
|
+
}, [d, o]), C = h ? ae(h, c) : void 0, w = C ? I(o.properties, C.replaceAll(".", ".properties.")) : void 0, b = /* @__PURE__ */ a(
|
|
1387
1388
|
z,
|
|
1388
1389
|
{
|
|
1389
1390
|
color: "primary",
|
|
1390
1391
|
variant: "outlined",
|
|
1391
|
-
onClick: () =>
|
|
1392
|
-
startIcon: /* @__PURE__ */ e(
|
|
1392
|
+
onClick: () => u(!0),
|
|
1393
|
+
startIcon: /* @__PURE__ */ e(ue, {}),
|
|
1393
1394
|
children: [
|
|
1394
1395
|
"Add property to ",
|
|
1395
1396
|
o.name ?? "this group"
|
|
1396
1397
|
]
|
|
1397
1398
|
}
|
|
1398
|
-
), P = !v || v.length < 1, O = Z((
|
|
1399
|
-
d(ye(N),
|
|
1399
|
+
), P = !v || v.length < 1, O = Z((f, N) => {
|
|
1400
|
+
d(ye(N), f, !1);
|
|
1400
1401
|
}, []);
|
|
1401
1402
|
return /* @__PURE__ */ a(U, { children: [
|
|
1402
1403
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1403
1404
|
/* @__PURE__ */ a("div", { className: "flex justify-between items-end my-4", children: [
|
|
1404
|
-
/* @__PURE__ */ e(
|
|
1405
|
+
/* @__PURE__ */ e(k, { variant: "subtitle2", children: "Properties in this group" }),
|
|
1405
1406
|
b
|
|
1406
1407
|
] }),
|
|
1407
1408
|
/* @__PURE__ */ a(Ce, { className: "p-2 pl-8", children: [
|
|
@@ -1412,14 +1413,14 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1412
1413
|
propertiesOrder: v,
|
|
1413
1414
|
errors: {},
|
|
1414
1415
|
collectionEditable: l,
|
|
1415
|
-
onPropertyClick: (
|
|
1416
|
-
|
|
1416
|
+
onPropertyClick: (f, N) => {
|
|
1417
|
+
m(f), g(N), u(!0);
|
|
1417
1418
|
},
|
|
1418
1419
|
onPropertyMove: O
|
|
1419
1420
|
}
|
|
1420
1421
|
),
|
|
1421
1422
|
P && /* @__PURE__ */ e(
|
|
1422
|
-
|
|
1423
|
+
k,
|
|
1423
1424
|
{
|
|
1424
1425
|
variant: "label",
|
|
1425
1426
|
className: "h-full flex items-center justify-center p-4",
|
|
@@ -1430,12 +1431,12 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1430
1431
|
] }),
|
|
1431
1432
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1432
1433
|
/* @__PURE__ */ e(
|
|
1433
|
-
|
|
1434
|
+
ct,
|
|
1434
1435
|
{
|
|
1435
1436
|
position: "start",
|
|
1436
1437
|
size: "small",
|
|
1437
1438
|
label: "Spread children as columns",
|
|
1438
|
-
onValueChange: (
|
|
1439
|
+
onValueChange: (f) => d("spreadChildren", f),
|
|
1439
1440
|
value: o.spreadChildren ?? !1
|
|
1440
1441
|
}
|
|
1441
1442
|
),
|
|
@@ -1446,25 +1447,25 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1446
1447
|
{
|
|
1447
1448
|
inArray: !1,
|
|
1448
1449
|
forceShowErrors: !1,
|
|
1449
|
-
open:
|
|
1450
|
+
open: p,
|
|
1450
1451
|
allowDataInference: n,
|
|
1451
1452
|
collectionEditable: l,
|
|
1452
1453
|
onCancel: () => {
|
|
1453
|
-
|
|
1454
|
+
u(!1), m(void 0), g(void 0);
|
|
1454
1455
|
},
|
|
1455
1456
|
onOkClicked: () => {
|
|
1456
|
-
|
|
1457
|
+
u(!1), m(void 0), g(void 0);
|
|
1457
1458
|
},
|
|
1458
1459
|
getData: r,
|
|
1459
1460
|
onDelete: y,
|
|
1460
|
-
propertyKey:
|
|
1461
|
-
propertyNamespace:
|
|
1462
|
-
property:
|
|
1463
|
-
existingProperty: !!
|
|
1464
|
-
autoUpdateId: !
|
|
1465
|
-
autoOpenTypeSelect: !
|
|
1466
|
-
onPropertyChanged:
|
|
1467
|
-
existingPropertyKeys:
|
|
1461
|
+
propertyKey: h,
|
|
1462
|
+
propertyNamespace: c,
|
|
1463
|
+
property: w,
|
|
1464
|
+
existingProperty: !!h,
|
|
1465
|
+
autoUpdateId: !h,
|
|
1466
|
+
autoOpenTypeSelect: !h,
|
|
1467
|
+
onPropertyChanged: x,
|
|
1468
|
+
existingPropertyKeys: h ? void 0 : v,
|
|
1468
1469
|
propertyConfigs: i
|
|
1469
1470
|
}
|
|
1470
1471
|
)
|
|
@@ -1480,27 +1481,27 @@ function Vi({
|
|
|
1480
1481
|
collectionEditable: d
|
|
1481
1482
|
}) {
|
|
1482
1483
|
const {
|
|
1483
|
-
values:
|
|
1484
|
-
handleChange:
|
|
1485
|
-
errors:
|
|
1486
|
-
setFieldValue:
|
|
1487
|
-
touched:
|
|
1488
|
-
} = K(), [
|
|
1489
|
-
console.log("onPropertyChanged", b, P, O),
|
|
1490
|
-
},
|
|
1484
|
+
values: p,
|
|
1485
|
+
handleChange: u,
|
|
1486
|
+
errors: h,
|
|
1487
|
+
setFieldValue: m,
|
|
1488
|
+
touched: c
|
|
1489
|
+
} = K(), [g, v] = $(!1), x = I(p, "of"), y = I(c, "of") && I(h, "of"), C = ({ id: b, property: P, namespace: O }) => {
|
|
1490
|
+
console.log("onPropertyChanged", b, P, O), m("of", P);
|
|
1491
|
+
}, w = x && $e(x, o);
|
|
1491
1492
|
return /* @__PURE__ */ a(U, { children: [
|
|
1492
1493
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1493
|
-
/* @__PURE__ */ e(
|
|
1494
|
+
/* @__PURE__ */ e(k, { variant: "subtitle2", children: "Repeat component" }),
|
|
1494
1495
|
/* @__PURE__ */ e(
|
|
1495
1496
|
H,
|
|
1496
1497
|
{
|
|
1497
1498
|
name: "of",
|
|
1498
|
-
value:
|
|
1499
|
+
value: x,
|
|
1499
1500
|
children: ({}) => /* @__PURE__ */ a(Ce, { className: "p-2 mt-4", children: [
|
|
1500
|
-
|
|
1501
|
+
x && /* @__PURE__ */ e(
|
|
1501
1502
|
nr,
|
|
1502
1503
|
{
|
|
1503
|
-
property:
|
|
1504
|
+
property: x,
|
|
1504
1505
|
onClick: n ? void 0 : () => v(!0),
|
|
1505
1506
|
includeName: !1,
|
|
1506
1507
|
includeEditButton: !0,
|
|
@@ -1508,7 +1509,7 @@ function Vi({
|
|
|
1508
1509
|
hasError: !1
|
|
1509
1510
|
}
|
|
1510
1511
|
),
|
|
1511
|
-
!n && !
|
|
1512
|
+
!n && !x && /* @__PURE__ */ a(
|
|
1512
1513
|
z,
|
|
1513
1514
|
{
|
|
1514
1515
|
variant: "text",
|
|
@@ -1517,7 +1518,7 @@ function Vi({
|
|
|
1517
1518
|
onClick: () => v(!0),
|
|
1518
1519
|
children: [
|
|
1519
1520
|
"Edit ",
|
|
1520
|
-
`${
|
|
1521
|
+
`${w ? w.name : "repeat component"}`
|
|
1521
1522
|
]
|
|
1522
1523
|
}
|
|
1523
1524
|
),
|
|
@@ -1525,14 +1526,14 @@ function Vi({
|
|
|
1525
1526
|
Ve,
|
|
1526
1527
|
{
|
|
1527
1528
|
inArray: !0,
|
|
1528
|
-
open:
|
|
1529
|
+
open: g,
|
|
1529
1530
|
existingProperty: r,
|
|
1530
1531
|
getData: i,
|
|
1531
1532
|
autoUpdateId: !r,
|
|
1532
1533
|
autoOpenTypeSelect: !r,
|
|
1533
1534
|
onOkClicked: () => v(!1),
|
|
1534
1535
|
allowDataInference: l,
|
|
1535
|
-
property:
|
|
1536
|
+
property: x,
|
|
1536
1537
|
includeIdAndName: !1,
|
|
1537
1538
|
onPropertyChanged: C,
|
|
1538
1539
|
forceShowErrors: t,
|
|
@@ -1544,7 +1545,7 @@ function Vi({
|
|
|
1544
1545
|
}
|
|
1545
1546
|
)
|
|
1546
1547
|
] }),
|
|
1547
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1548
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Ot, { disabled: n }) }) })
|
|
1548
1549
|
] });
|
|
1549
1550
|
}
|
|
1550
1551
|
const Ii = Y.forwardRef(
|
|
@@ -1556,13 +1557,13 @@ const Ii = Y.forwardRef(
|
|
|
1556
1557
|
isNewProperty: o
|
|
1557
1558
|
}, d) {
|
|
1558
1559
|
const {
|
|
1559
|
-
errors:
|
|
1560
|
-
values:
|
|
1561
|
-
setFieldValue:
|
|
1562
|
-
setFieldTouched:
|
|
1563
|
-
touched:
|
|
1564
|
-
validate:
|
|
1565
|
-
} = K(), v = "name",
|
|
1560
|
+
errors: p,
|
|
1561
|
+
values: u,
|
|
1562
|
+
setFieldValue: h,
|
|
1563
|
+
setFieldTouched: m,
|
|
1564
|
+
touched: c,
|
|
1565
|
+
validate: g
|
|
1566
|
+
} = K(), v = "name", x = r && I(p, v), y = "id", C = r && I(p, y), w = "description", b = r && I(p, w);
|
|
1566
1567
|
return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 col-span-12", children: [
|
|
1567
1568
|
/* @__PURE__ */ a("div", { children: [
|
|
1568
1569
|
/* @__PURE__ */ e(
|
|
@@ -1571,19 +1572,19 @@ const Ii = Y.forwardRef(
|
|
|
1571
1572
|
name: v,
|
|
1572
1573
|
inputRef: d,
|
|
1573
1574
|
as: J,
|
|
1574
|
-
value:
|
|
1575
|
+
value: u[v],
|
|
1575
1576
|
onChange: (P) => {
|
|
1576
1577
|
const O = P.target.value;
|
|
1577
|
-
!I(
|
|
1578
|
+
!I(c, y) && l && h(y, O ? Pt(O) : "", !1), h(v, O, !0), m(v, !0);
|
|
1578
1579
|
},
|
|
1579
1580
|
style: { fontSize: 20 },
|
|
1580
1581
|
placeholder: "Field name",
|
|
1581
1582
|
required: !0,
|
|
1582
1583
|
disabled: i,
|
|
1583
|
-
error: !!
|
|
1584
|
+
error: !!x
|
|
1584
1585
|
}
|
|
1585
1586
|
),
|
|
1586
|
-
/* @__PURE__ */ e(X, { error: !!
|
|
1587
|
+
/* @__PURE__ */ e(X, { error: !!x, children: x })
|
|
1587
1588
|
] }),
|
|
1588
1589
|
/* @__PURE__ */ a("div", { children: [
|
|
1589
1590
|
/* @__PURE__ */ e(
|
|
@@ -1592,10 +1593,10 @@ const Ii = Y.forwardRef(
|
|
|
1592
1593
|
name: y,
|
|
1593
1594
|
as: J,
|
|
1594
1595
|
label: "ID",
|
|
1595
|
-
value:
|
|
1596
|
+
value: u[y],
|
|
1596
1597
|
onChange: (P) => {
|
|
1597
1598
|
const O = P.target.value;
|
|
1598
|
-
!I(
|
|
1599
|
+
!I(c, v) && l && h(v, O ? ut(O) : ""), h(y, O, !0), m(y, !0);
|
|
1599
1600
|
},
|
|
1600
1601
|
disabled: n || i,
|
|
1601
1602
|
required: !0,
|
|
@@ -1609,7 +1610,7 @@ const Ii = Y.forwardRef(
|
|
|
1609
1610
|
/* @__PURE__ */ e(
|
|
1610
1611
|
H,
|
|
1611
1612
|
{
|
|
1612
|
-
name:
|
|
1613
|
+
name: w,
|
|
1613
1614
|
as: J,
|
|
1614
1615
|
label: "Description",
|
|
1615
1616
|
disabled: i,
|
|
@@ -1628,9 +1629,9 @@ function _i({
|
|
|
1628
1629
|
}) {
|
|
1629
1630
|
const { values: i, setFieldValue: l } = K();
|
|
1630
1631
|
return /* @__PURE__ */ a(U, { children: [
|
|
1631
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
1632
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ne, { children: [
|
|
1632
1633
|
t === "text_field" && /* @__PURE__ */ e(
|
|
1633
|
-
|
|
1634
|
+
Ee,
|
|
1634
1635
|
{
|
|
1635
1636
|
disabled: r,
|
|
1636
1637
|
length: !0,
|
|
@@ -1644,7 +1645,7 @@ function _i({
|
|
|
1644
1645
|
}
|
|
1645
1646
|
),
|
|
1646
1647
|
t === "multiline" && /* @__PURE__ */ e(
|
|
1647
|
-
|
|
1648
|
+
Ee,
|
|
1648
1649
|
{
|
|
1649
1650
|
disabled: r,
|
|
1650
1651
|
length: !0,
|
|
@@ -1657,7 +1658,7 @@ function _i({
|
|
|
1657
1658
|
}
|
|
1658
1659
|
),
|
|
1659
1660
|
t === "markdown" && /* @__PURE__ */ e(
|
|
1660
|
-
|
|
1661
|
+
Ee,
|
|
1661
1662
|
{
|
|
1662
1663
|
disabled: r,
|
|
1663
1664
|
length: !0,
|
|
@@ -1670,7 +1671,7 @@ function _i({
|
|
|
1670
1671
|
}
|
|
1671
1672
|
),
|
|
1672
1673
|
t === "email" && /* @__PURE__ */ e(
|
|
1673
|
-
|
|
1674
|
+
Ee,
|
|
1674
1675
|
{
|
|
1675
1676
|
disabled: r,
|
|
1676
1677
|
max: !0,
|
|
@@ -1697,7 +1698,7 @@ function _i({
|
|
|
1697
1698
|
function Fi({ disabled: t }) {
|
|
1698
1699
|
const { values: r } = K(), n = I(r, "defaultValue");
|
|
1699
1700
|
return /* @__PURE__ */ a(U, { children: [
|
|
1700
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1701
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }),
|
|
1701
1702
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1702
1703
|
H,
|
|
1703
1704
|
{
|
|
@@ -1720,7 +1721,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1720
1721
|
const {
|
|
1721
1722
|
values: o,
|
|
1722
1723
|
setFieldValue: d
|
|
1723
|
-
} = K(), [
|
|
1724
|
+
} = K(), [p, u] = $(!1), [h, m] = $(), [c, g] = $(), v = Z(({
|
|
1724
1725
|
id: P,
|
|
1725
1726
|
property: O
|
|
1726
1727
|
}) => {
|
|
@@ -1729,21 +1730,21 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1729
1730
|
d("oneOf.properties", {
|
|
1730
1731
|
...o.oneOf?.properties ?? {},
|
|
1731
1732
|
[P]: O
|
|
1732
|
-
}, !1), d("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), P], !1),
|
|
1733
|
-
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]),
|
|
1734
|
-
const
|
|
1735
|
-
if (!
|
|
1733
|
+
}, !1), d("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), P], !1), u(!1);
|
|
1734
|
+
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), x = h ? ae(h, c) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, C = Z((P, O) => {
|
|
1735
|
+
const f = P ? ae(P, O) : void 0;
|
|
1736
|
+
if (!f)
|
|
1736
1737
|
throw Error("collection editor miss config");
|
|
1737
|
-
d(`oneOf.${
|
|
1738
|
-
const N = `oneOf.${ye(O)}`,
|
|
1739
|
-
d(N,
|
|
1740
|
-
}, [d, o]),
|
|
1738
|
+
d(`oneOf.${pe(f)}`, void 0, !1);
|
|
1739
|
+
const N = `oneOf.${ye(O)}`, _ = I(o, N);
|
|
1740
|
+
d(N, _.filter((R) => R !== P), !1), u(!1), m(void 0), g(void 0);
|
|
1741
|
+
}, [d, o]), w = /* @__PURE__ */ a(
|
|
1741
1742
|
z,
|
|
1742
1743
|
{
|
|
1743
1744
|
autoFocus: !0,
|
|
1744
1745
|
color: "primary",
|
|
1745
|
-
onClick: () =>
|
|
1746
|
-
startIcon: /* @__PURE__ */ e(
|
|
1746
|
+
onClick: () => u(!0),
|
|
1747
|
+
startIcon: /* @__PURE__ */ e(ue, {}),
|
|
1747
1748
|
children: [
|
|
1748
1749
|
"Add property to ",
|
|
1749
1750
|
o.name ?? "this block"
|
|
@@ -1755,8 +1756,8 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1755
1756
|
return /* @__PURE__ */ a(U, { children: [
|
|
1756
1757
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1757
1758
|
/* @__PURE__ */ a("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
|
|
1758
|
-
/* @__PURE__ */ e(
|
|
1759
|
-
|
|
1759
|
+
/* @__PURE__ */ e(k, { variant: "subtitle2", children: "Properties in this block" }),
|
|
1760
|
+
w
|
|
1760
1761
|
] }),
|
|
1761
1762
|
/* @__PURE__ */ a(Ce, { className: "p-2 pl-8", children: [
|
|
1762
1763
|
/* @__PURE__ */ e(
|
|
@@ -1767,7 +1768,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1767
1768
|
errors: {},
|
|
1768
1769
|
collectionEditable: l,
|
|
1769
1770
|
onPropertyClick: t ? void 0 : (P, O) => {
|
|
1770
|
-
|
|
1771
|
+
m(P), g(O), u(!0);
|
|
1771
1772
|
},
|
|
1772
1773
|
onPropertyMove: t ? void 0 : b
|
|
1773
1774
|
}
|
|
@@ -1780,25 +1781,25 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1780
1781
|
{
|
|
1781
1782
|
inArray: !1,
|
|
1782
1783
|
forceShowErrors: !1,
|
|
1783
|
-
open:
|
|
1784
|
+
open: p,
|
|
1784
1785
|
getData: r,
|
|
1785
1786
|
allowDataInference: n,
|
|
1786
1787
|
onCancel: () => {
|
|
1787
|
-
|
|
1788
|
+
u(!1), m(void 0), g(void 0);
|
|
1788
1789
|
},
|
|
1789
1790
|
onOkClicked: () => {
|
|
1790
|
-
|
|
1791
|
+
u(!1), m(void 0), g(void 0);
|
|
1791
1792
|
},
|
|
1792
1793
|
collectionEditable: l,
|
|
1793
1794
|
onDelete: C,
|
|
1794
|
-
propertyKey:
|
|
1795
|
-
propertyNamespace:
|
|
1795
|
+
propertyKey: h,
|
|
1796
|
+
propertyNamespace: c,
|
|
1796
1797
|
property: y,
|
|
1797
|
-
existingProperty: !!
|
|
1798
|
-
autoUpdateId: !
|
|
1799
|
-
autoOpenTypeSelect: !
|
|
1798
|
+
existingProperty: !!h,
|
|
1799
|
+
autoUpdateId: !h,
|
|
1800
|
+
autoOpenTypeSelect: !h,
|
|
1800
1801
|
onPropertyChanged: v,
|
|
1801
|
-
existingPropertyKeys:
|
|
1802
|
+
existingPropertyKeys: h ? void 0 : o.oneOf?.propertiesOrder,
|
|
1802
1803
|
propertyConfigs: i
|
|
1803
1804
|
}
|
|
1804
1805
|
)
|
|
@@ -1808,9 +1809,9 @@ function Ei({ disabled: t }) {
|
|
|
1808
1809
|
const {
|
|
1809
1810
|
values: r,
|
|
1810
1811
|
handleChange: n
|
|
1811
|
-
} = K(), i = "validation.min", l = "validation.max", o = "validation.lessThan", d = "validation.moreThan"
|
|
1812
|
+
} = K(), i = "validation.min", l = "validation.max", o = "validation.lessThan", d = "validation.moreThan";
|
|
1812
1813
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
1813
|
-
/* @__PURE__ */ e(
|
|
1814
|
+
/* @__PURE__ */ e(Se, { disabled: t }),
|
|
1814
1815
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
1815
1816
|
J,
|
|
1816
1817
|
{
|
|
@@ -1862,15 +1863,15 @@ function Ei({ disabled: t }) {
|
|
|
1862
1863
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
1863
1864
|
H,
|
|
1864
1865
|
{
|
|
1865
|
-
name:
|
|
1866
|
+
name: "validation.positive",
|
|
1866
1867
|
type: "checkbox",
|
|
1867
|
-
children: ({ field:
|
|
1868
|
+
children: ({ field: m, form: c }) => /* @__PURE__ */ e(
|
|
1868
1869
|
se,
|
|
1869
1870
|
{
|
|
1870
1871
|
label: "Positive value",
|
|
1871
1872
|
disabled: t,
|
|
1872
|
-
form:
|
|
1873
|
-
field:
|
|
1873
|
+
form: c,
|
|
1874
|
+
field: m
|
|
1874
1875
|
}
|
|
1875
1876
|
)
|
|
1876
1877
|
}
|
|
@@ -1878,15 +1879,15 @@ function Ei({ disabled: t }) {
|
|
|
1878
1879
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
1879
1880
|
H,
|
|
1880
1881
|
{
|
|
1881
|
-
name:
|
|
1882
|
+
name: "validation.negative",
|
|
1882
1883
|
type: "checkbox",
|
|
1883
|
-
children: ({ field:
|
|
1884
|
+
children: ({ field: m, form: c }) => /* @__PURE__ */ e(
|
|
1884
1885
|
se,
|
|
1885
1886
|
{
|
|
1886
1887
|
label: "Negative value",
|
|
1887
1888
|
disabled: t,
|
|
1888
|
-
form:
|
|
1889
|
-
field:
|
|
1889
|
+
form: c,
|
|
1890
|
+
field: m
|
|
1890
1891
|
}
|
|
1891
1892
|
)
|
|
1892
1893
|
}
|
|
@@ -1894,15 +1895,15 @@ function Ei({ disabled: t }) {
|
|
|
1894
1895
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
1895
1896
|
H,
|
|
1896
1897
|
{
|
|
1897
|
-
name:
|
|
1898
|
+
name: "validation.integer",
|
|
1898
1899
|
type: "checkbox",
|
|
1899
|
-
children: ({ field:
|
|
1900
|
+
children: ({ field: m, form: c }) => /* @__PURE__ */ e(
|
|
1900
1901
|
se,
|
|
1901
1902
|
{
|
|
1902
1903
|
label: "Integer value",
|
|
1903
1904
|
disabled: t,
|
|
1904
|
-
form:
|
|
1905
|
-
field:
|
|
1905
|
+
form: c,
|
|
1906
|
+
field: m
|
|
1906
1907
|
}
|
|
1907
1908
|
)
|
|
1908
1909
|
}
|
|
@@ -1912,7 +1913,7 @@ function Ei({ disabled: t }) {
|
|
|
1912
1913
|
function Ai({ disabled: t }) {
|
|
1913
1914
|
const { values: r, setFieldValue: n } = K();
|
|
1914
1915
|
return /* @__PURE__ */ a(U, { children: [
|
|
1915
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1916
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Ei, { disabled: t }) }) }),
|
|
1916
1917
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1917
1918
|
Oe,
|
|
1918
1919
|
{
|
|
@@ -1928,7 +1929,7 @@ function Ai({ disabled: t }) {
|
|
|
1928
1929
|
) })
|
|
1929
1930
|
] });
|
|
1930
1931
|
}
|
|
1931
|
-
function
|
|
1932
|
+
function jt({
|
|
1932
1933
|
existing: t,
|
|
1933
1934
|
multiple: r,
|
|
1934
1935
|
disabled: n,
|
|
@@ -1939,18 +1940,18 @@ function qt({
|
|
|
1939
1940
|
handleChange: o,
|
|
1940
1941
|
errors: d
|
|
1941
1942
|
} = K();
|
|
1942
|
-
if (!
|
|
1943
|
-
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1944
|
-
const
|
|
1943
|
+
if (!Pe())
|
|
1944
|
+
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(De, {}) });
|
|
1945
|
+
const u = r ? "of.path" : "path", h = I(l, u), m = i && I(d, u);
|
|
1945
1946
|
return /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1946
1947
|
H,
|
|
1947
1948
|
{
|
|
1948
|
-
name:
|
|
1949
|
-
pathPath:
|
|
1949
|
+
name: u,
|
|
1950
|
+
pathPath: u,
|
|
1950
1951
|
type: "select",
|
|
1951
1952
|
disabled: t || n,
|
|
1952
|
-
value:
|
|
1953
|
-
error:
|
|
1953
|
+
value: h,
|
|
1954
|
+
error: m,
|
|
1954
1955
|
handleChange: o,
|
|
1955
1956
|
as: Di
|
|
1956
1957
|
}
|
|
@@ -1964,12 +1965,12 @@ function Di({
|
|
|
1964
1965
|
error: l,
|
|
1965
1966
|
...o
|
|
1966
1967
|
}) {
|
|
1967
|
-
const d =
|
|
1968
|
+
const d = Pe();
|
|
1968
1969
|
if (!d)
|
|
1969
|
-
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1970
|
-
const
|
|
1971
|
-
Object.values(
|
|
1972
|
-
).values()),
|
|
1970
|
+
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(De, {}) });
|
|
1971
|
+
const p = d?.collections ?? [], u = Array.from(new Set(
|
|
1972
|
+
Object.values(p).map((m) => m.group).filter(Boolean)
|
|
1973
|
+
).values()), h = p.filter((m) => !m.group);
|
|
1973
1974
|
return /* @__PURE__ */ a(U, { children: [
|
|
1974
1975
|
/* @__PURE__ */ a(
|
|
1975
1976
|
be,
|
|
@@ -1981,64 +1982,64 @@ function Di({
|
|
|
1981
1982
|
name: r,
|
|
1982
1983
|
onChange: i,
|
|
1983
1984
|
label: "Target collection",
|
|
1984
|
-
renderValue: (
|
|
1985
|
-
const
|
|
1986
|
-
return
|
|
1987
|
-
/* @__PURE__ */ e(ot, { collectionOrView:
|
|
1985
|
+
renderValue: (m) => {
|
|
1986
|
+
const c = p.find((g) => g.id === m || g.path === m);
|
|
1987
|
+
return c ? /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
1988
|
+
/* @__PURE__ */ e(ot, { collectionOrView: c }),
|
|
1988
1989
|
/* @__PURE__ */ e(
|
|
1989
|
-
|
|
1990
|
+
k,
|
|
1990
1991
|
{
|
|
1991
1992
|
variant: "subtitle2",
|
|
1992
1993
|
className: "font-medium ml-4",
|
|
1993
|
-
children:
|
|
1994
|
+
children: c?.name.toUpperCase()
|
|
1994
1995
|
}
|
|
1995
1996
|
)
|
|
1996
1997
|
] }) : null;
|
|
1997
1998
|
},
|
|
1998
1999
|
...o,
|
|
1999
2000
|
children: [
|
|
2000
|
-
|
|
2001
|
+
u.flatMap((m) => /* @__PURE__ */ e(
|
|
2001
2002
|
At,
|
|
2002
2003
|
{
|
|
2003
|
-
label:
|
|
2004
|
-
children:
|
|
2004
|
+
label: m || "Views",
|
|
2005
|
+
children: p.filter((c) => c.group === m).map((c) => /* @__PURE__ */ e(
|
|
2005
2006
|
ee,
|
|
2006
2007
|
{
|
|
2007
|
-
value:
|
|
2008
|
+
value: c.id ?? c.path,
|
|
2008
2009
|
children: /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
2009
|
-
/* @__PURE__ */ e(ot, { collectionOrView:
|
|
2010
|
+
/* @__PURE__ */ e(ot, { collectionOrView: c }),
|
|
2010
2011
|
/* @__PURE__ */ e(
|
|
2011
|
-
|
|
2012
|
+
k,
|
|
2012
2013
|
{
|
|
2013
2014
|
variant: "subtitle2",
|
|
2014
2015
|
className: "font-medium ml-4",
|
|
2015
|
-
children:
|
|
2016
|
+
children: c?.name.toUpperCase()
|
|
2016
2017
|
}
|
|
2017
2018
|
)
|
|
2018
2019
|
] })
|
|
2019
2020
|
},
|
|
2020
|
-
`${
|
|
2021
|
+
`${c.id ?? c.path}-${m}`
|
|
2021
2022
|
))
|
|
2022
2023
|
},
|
|
2023
|
-
`group_${
|
|
2024
|
+
`group_${m}`
|
|
2024
2025
|
)),
|
|
2025
|
-
|
|
2026
|
+
h && /* @__PURE__ */ e(At, { label: "Views", children: h.map((m) => /* @__PURE__ */ e(
|
|
2026
2027
|
ee,
|
|
2027
2028
|
{
|
|
2028
|
-
value:
|
|
2029
|
+
value: m.id ?? m.path,
|
|
2029
2030
|
children: /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
2030
|
-
/* @__PURE__ */ e(ot, { collectionOrView:
|
|
2031
|
+
/* @__PURE__ */ e(ot, { collectionOrView: m }),
|
|
2031
2032
|
/* @__PURE__ */ e(
|
|
2032
|
-
|
|
2033
|
+
k,
|
|
2033
2034
|
{
|
|
2034
2035
|
variant: "subtitle2",
|
|
2035
2036
|
className: "font-medium ml-4",
|
|
2036
|
-
children:
|
|
2037
|
+
children: m?.name.toUpperCase()
|
|
2037
2038
|
}
|
|
2038
2039
|
)
|
|
2039
2040
|
] })
|
|
2040
2041
|
},
|
|
2041
|
-
|
|
2042
|
+
m.id ?? m.path
|
|
2042
2043
|
)) })
|
|
2043
2044
|
]
|
|
2044
2045
|
}
|
|
@@ -2052,7 +2053,7 @@ function Bi({ disabled: t }) {
|
|
|
2052
2053
|
errors: n,
|
|
2053
2054
|
touched: i,
|
|
2054
2055
|
setFieldValue: l
|
|
2055
|
-
} = K(), o = "mode", d = I(r, o),
|
|
2056
|
+
} = 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
2057
|
return /* @__PURE__ */ a(U, { children: [
|
|
2057
2058
|
/* @__PURE__ */ a("div", { className: "flex flex-col col-span-12", children: [
|
|
2058
2059
|
/* @__PURE__ */ a(
|
|
@@ -2060,11 +2061,11 @@ function Bi({ disabled: t }) {
|
|
|
2060
2061
|
{
|
|
2061
2062
|
name: o,
|
|
2062
2063
|
value: d ?? "date",
|
|
2063
|
-
error: !!
|
|
2064
|
-
onValueChange: (
|
|
2064
|
+
error: !!p,
|
|
2065
|
+
onValueChange: (c) => l(o, c),
|
|
2065
2066
|
label: "Mode",
|
|
2066
|
-
renderValue: (
|
|
2067
|
-
switch (
|
|
2067
|
+
renderValue: (c) => {
|
|
2068
|
+
switch (c) {
|
|
2068
2069
|
case "date_time":
|
|
2069
2070
|
return "Date/Time";
|
|
2070
2071
|
case "date":
|
|
@@ -2080,16 +2081,16 @@ function Bi({ disabled: t }) {
|
|
|
2080
2081
|
]
|
|
2081
2082
|
}
|
|
2082
2083
|
),
|
|
2083
|
-
/* @__PURE__ */ e(X, { error: !!
|
|
2084
|
+
/* @__PURE__ */ e(X, { error: !!p, children: p }),
|
|
2084
2085
|
/* @__PURE__ */ a(
|
|
2085
2086
|
be,
|
|
2086
2087
|
{
|
|
2087
|
-
name:
|
|
2088
|
+
name: u,
|
|
2088
2089
|
disabled: t,
|
|
2089
|
-
value:
|
|
2090
|
-
onValueChange: (
|
|
2091
|
-
renderValue: (
|
|
2092
|
-
switch (
|
|
2090
|
+
value: h ?? "",
|
|
2091
|
+
onValueChange: (c) => l(u, c),
|
|
2092
|
+
renderValue: (c) => {
|
|
2093
|
+
switch (c) {
|
|
2093
2094
|
case "on_create":
|
|
2094
2095
|
return "On create";
|
|
2095
2096
|
case "on_update":
|
|
@@ -2098,7 +2099,7 @@ function Bi({ disabled: t }) {
|
|
|
2098
2099
|
return "None";
|
|
2099
2100
|
}
|
|
2100
2101
|
},
|
|
2101
|
-
error: !!
|
|
2102
|
+
error: !!m,
|
|
2102
2103
|
label: "Automatic value",
|
|
2103
2104
|
children: [
|
|
2104
2105
|
/* @__PURE__ */ e(ee, { value: "", children: " None " }),
|
|
@@ -2107,9 +2108,9 @@ function Bi({ disabled: t }) {
|
|
|
2107
2108
|
]
|
|
2108
2109
|
}
|
|
2109
2110
|
),
|
|
2110
|
-
/* @__PURE__ */ e(X, { error: !!
|
|
2111
|
+
/* @__PURE__ */ e(X, { error: !!m, children: m ?? "Update this field automatically when creating or updating the entity" })
|
|
2111
2112
|
] }),
|
|
2112
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2113
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) })
|
|
2113
2114
|
] });
|
|
2114
2115
|
}
|
|
2115
2116
|
function zi({ disabled: t }) {
|
|
@@ -2144,7 +2145,7 @@ function zi({ disabled: t }) {
|
|
|
2144
2145
|
] });
|
|
2145
2146
|
}
|
|
2146
2147
|
function Mi({ disabled: t }) {
|
|
2147
|
-
return /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2148
|
+
return /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Se, { disabled: t }) }) }) });
|
|
2148
2149
|
}
|
|
2149
2150
|
function ar(t, r, n) {
|
|
2150
2151
|
let i;
|
|
@@ -2368,16 +2369,16 @@ function or({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
|
|
|
2368
2369
|
children: /* @__PURE__ */ a(
|
|
2369
2370
|
"div",
|
|
2370
2371
|
{
|
|
2371
|
-
className:
|
|
2372
|
+
className: me(
|
|
2372
2373
|
"flex flex-row items-center text-base min-h-[52px]",
|
|
2373
2374
|
r ? "w-full" : ""
|
|
2374
2375
|
),
|
|
2375
2376
|
children: [
|
|
2376
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
2377
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ye, { propertyConfig: n }) }),
|
|
2377
2378
|
/* @__PURE__ */ a("div", { children: [
|
|
2378
2379
|
/* @__PURE__ */ e("div", { children: n.name }),
|
|
2379
2380
|
/* @__PURE__ */ e(
|
|
2380
|
-
|
|
2381
|
+
k,
|
|
2381
2382
|
{
|
|
2382
2383
|
variant: "caption",
|
|
2383
2384
|
color: "disabled",
|
|
@@ -2428,8 +2429,8 @@ function Ri({
|
|
|
2428
2429
|
]
|
|
2429
2430
|
}
|
|
2430
2431
|
) }),
|
|
2431
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2432
|
-
|
|
2432
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
2433
|
+
Ee,
|
|
2433
2434
|
{
|
|
2434
2435
|
disabled: t,
|
|
2435
2436
|
max: !0,
|
|
@@ -2473,7 +2474,7 @@ const Ui = [
|
|
|
2473
2474
|
"key_value",
|
|
2474
2475
|
"repeat",
|
|
2475
2476
|
"block"
|
|
2476
|
-
], lr = Object.entries(
|
|
2477
|
+
], lr = Object.entries(Gt).filter(([t]) => Ui.includes(t)).map(([t, r]) => ({ [t]: r })).reduce((t, r) => ({ ...t, ...r }), {}), sr = Y.memo(
|
|
2477
2478
|
function(r) {
|
|
2478
2479
|
const {
|
|
2479
2480
|
includeIdAndName: n = !0,
|
|
@@ -2481,96 +2482,96 @@ const Ui = [
|
|
|
2481
2482
|
existingProperty: l,
|
|
2482
2483
|
autoUpdateId: o,
|
|
2483
2484
|
inArray: d,
|
|
2484
|
-
propertyKey:
|
|
2485
|
-
existingPropertyKeys:
|
|
2486
|
-
propertyNamespace:
|
|
2487
|
-
property:
|
|
2488
|
-
onPropertyChanged:
|
|
2489
|
-
onPropertyChangedImmediate:
|
|
2485
|
+
propertyKey: p,
|
|
2486
|
+
existingPropertyKeys: u,
|
|
2487
|
+
propertyNamespace: h,
|
|
2488
|
+
property: m,
|
|
2489
|
+
onPropertyChanged: c,
|
|
2490
|
+
onPropertyChangedImmediate: g = !0,
|
|
2490
2491
|
onDelete: v,
|
|
2491
|
-
onError:
|
|
2492
|
+
onError: x,
|
|
2492
2493
|
initialErrors: y,
|
|
2493
2494
|
forceShowErrors: C,
|
|
2494
|
-
allowDataInference:
|
|
2495
|
+
allowDataInference: w,
|
|
2495
2496
|
getController: b,
|
|
2496
2497
|
getData: P,
|
|
2497
2498
|
propertyConfigs: O,
|
|
2498
|
-
collectionEditable:
|
|
2499
|
+
collectionEditable: f
|
|
2499
2500
|
} = r, N = {
|
|
2500
2501
|
id: "",
|
|
2501
2502
|
name: ""
|
|
2502
|
-
},
|
|
2503
|
-
id:
|
|
2504
|
-
previousId:
|
|
2505
|
-
property:
|
|
2503
|
+
}, _ = !!(m && !qe(m)) && !f, R = Le(m ? {
|
|
2504
|
+
id: p,
|
|
2505
|
+
previousId: p,
|
|
2506
|
+
property: m
|
|
2506
2507
|
} : void 0), M = ({
|
|
2507
|
-
id:
|
|
2508
|
-
property:
|
|
2508
|
+
id: S,
|
|
2509
|
+
property: s
|
|
2509
2510
|
}) => {
|
|
2510
|
-
const
|
|
2511
|
-
id:
|
|
2511
|
+
const V = {
|
|
2512
|
+
id: S,
|
|
2512
2513
|
previousId: R.current?.id,
|
|
2513
|
-
property:
|
|
2514
|
-
namespace:
|
|
2514
|
+
property: s,
|
|
2515
|
+
namespace: h
|
|
2515
2516
|
};
|
|
2516
|
-
R.current =
|
|
2517
|
+
R.current = V, c?.(V);
|
|
2517
2518
|
}, B = Tt({
|
|
2518
|
-
initialValues:
|
|
2519
|
+
initialValues: m ? { id: p, ...m } : N,
|
|
2519
2520
|
initialErrors: y,
|
|
2520
2521
|
validateOnChange: !0,
|
|
2521
2522
|
validateOnInitialRender: !0,
|
|
2522
|
-
onSubmit: (
|
|
2523
|
-
console.debug("onSubmit",
|
|
2523
|
+
onSubmit: (S, s) => {
|
|
2524
|
+
console.debug("onSubmit", S);
|
|
2524
2525
|
const {
|
|
2525
|
-
id:
|
|
2526
|
+
id: V,
|
|
2526
2527
|
...G
|
|
2527
|
-
} =
|
|
2528
|
+
} = S;
|
|
2528
2529
|
M({
|
|
2529
|
-
id:
|
|
2530
|
+
id: V,
|
|
2530
2531
|
property: { ...G, editable: G.editable ?? !0 }
|
|
2531
|
-
}), l ||
|
|
2532
|
+
}), l || s.resetForm({ values: N });
|
|
2532
2533
|
},
|
|
2533
|
-
validation: (
|
|
2534
|
-
const
|
|
2534
|
+
validation: (S) => {
|
|
2535
|
+
const s = {};
|
|
2535
2536
|
if (n) {
|
|
2536
|
-
if (!
|
|
2537
|
-
|
|
2537
|
+
if (!S.name)
|
|
2538
|
+
s.name = "Required";
|
|
2538
2539
|
else {
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2540
|
+
const V = $i(S.name);
|
|
2541
|
+
V && (s.name = V);
|
|
2541
2542
|
}
|
|
2542
|
-
if (!
|
|
2543
|
-
|
|
2543
|
+
if (!S.id)
|
|
2544
|
+
s.id = "Required";
|
|
2544
2545
|
else {
|
|
2545
|
-
const
|
|
2546
|
-
|
|
2546
|
+
const V = qi(S.id, u);
|
|
2547
|
+
V && (s.id = V);
|
|
2547
2548
|
}
|
|
2548
2549
|
}
|
|
2549
|
-
return
|
|
2550
|
+
return S.dataType === "string" && S.validation?.matches && !Pr(S.validation?.matches.toString()) && (s.validation = {
|
|
2550
2551
|
matches: "Invalid regular expression"
|
|
2551
|
-
}),
|
|
2552
|
+
}), S.dataType === "reference" && !S.path && (s.path = "You must specify a target collection for the field"), S.propertyConfig === "repeat" && (S.of || (s.of = "You need to specify a repeat field")), S.propertyConfig === "block" && (S.oneOf || (s.oneOf = "You need to specify the properties of this block")), s;
|
|
2552
2553
|
}
|
|
2553
2554
|
});
|
|
2554
|
-
return
|
|
2555
|
+
return ce(() => {
|
|
2555
2556
|
b?.(B);
|
|
2556
2557
|
}, [B, b]), /* @__PURE__ */ e(kt, { value: B, children: /* @__PURE__ */ e(
|
|
2557
|
-
|
|
2558
|
+
ji,
|
|
2558
2559
|
{
|
|
2559
|
-
onPropertyChanged:
|
|
2560
|
+
onPropertyChanged: g ? M : void 0,
|
|
2560
2561
|
onDelete: v,
|
|
2561
2562
|
includeIdAndTitle: n,
|
|
2562
|
-
propertyNamespace:
|
|
2563
|
-
onError:
|
|
2563
|
+
propertyNamespace: h,
|
|
2564
|
+
onError: x,
|
|
2564
2565
|
showErrors: C || B.submitCount > 0,
|
|
2565
2566
|
existing: l,
|
|
2566
2567
|
autoUpdateId: o,
|
|
2567
2568
|
inArray: d,
|
|
2568
2569
|
autoOpenTypeSelect: i,
|
|
2569
|
-
disabled:
|
|
2570
|
+
disabled: _,
|
|
2570
2571
|
getData: P,
|
|
2571
|
-
allowDataInference:
|
|
2572
|
+
allowDataInference: w,
|
|
2572
2573
|
propertyConfigs: O,
|
|
2573
|
-
collectionEditable:
|
|
2574
|
+
collectionEditable: f,
|
|
2574
2575
|
...B
|
|
2575
2576
|
}
|
|
2576
2577
|
) });
|
|
@@ -2586,9 +2587,9 @@ function Ve({
|
|
|
2586
2587
|
collectionEditable: o,
|
|
2587
2588
|
...d
|
|
2588
2589
|
}) {
|
|
2589
|
-
const
|
|
2590
|
+
const p = Le();
|
|
2590
2591
|
return /* @__PURE__ */ e(
|
|
2591
|
-
|
|
2592
|
+
Fe,
|
|
2592
2593
|
{
|
|
2593
2594
|
open: t ?? !1,
|
|
2594
2595
|
maxWidth: "xl",
|
|
@@ -2598,32 +2599,32 @@ function Ve({
|
|
|
2598
2599
|
{
|
|
2599
2600
|
noValidate: !0,
|
|
2600
2601
|
autoComplete: "off",
|
|
2601
|
-
onSubmit: (
|
|
2602
|
-
|
|
2602
|
+
onSubmit: (h) => {
|
|
2603
|
+
h.preventDefault(), h.stopPropagation(), p.current?.handleSubmit(h);
|
|
2603
2604
|
},
|
|
2604
2605
|
children: [
|
|
2605
|
-
/* @__PURE__ */ e(
|
|
2606
|
+
/* @__PURE__ */ e(Be, { children: /* @__PURE__ */ e(
|
|
2606
2607
|
sr,
|
|
2607
2608
|
{
|
|
2608
2609
|
...d,
|
|
2609
|
-
onPropertyChanged: (
|
|
2610
|
-
i?.(
|
|
2610
|
+
onPropertyChanged: (h) => {
|
|
2611
|
+
i?.(h), n?.();
|
|
2611
2612
|
},
|
|
2612
2613
|
collectionEditable: o,
|
|
2613
2614
|
onPropertyChangedImmediate: !1,
|
|
2614
|
-
getController: (
|
|
2615
|
-
|
|
2615
|
+
getController: (h) => {
|
|
2616
|
+
p.current = h;
|
|
2616
2617
|
},
|
|
2617
2618
|
getData: l
|
|
2618
2619
|
}
|
|
2619
2620
|
) }),
|
|
2620
|
-
/* @__PURE__ */ a(
|
|
2621
|
+
/* @__PURE__ */ a(ze, { children: [
|
|
2621
2622
|
r && /* @__PURE__ */ e(
|
|
2622
2623
|
z,
|
|
2623
2624
|
{
|
|
2624
2625
|
variant: "text",
|
|
2625
2626
|
onClick: () => {
|
|
2626
|
-
r(),
|
|
2627
|
+
r(), p.current?.resetForm();
|
|
2627
2628
|
},
|
|
2628
2629
|
children: "Cancel"
|
|
2629
2630
|
}
|
|
@@ -2644,7 +2645,7 @@ function Ve({
|
|
|
2644
2645
|
}
|
|
2645
2646
|
);
|
|
2646
2647
|
}
|
|
2647
|
-
function
|
|
2648
|
+
function ji({
|
|
2648
2649
|
values: t,
|
|
2649
2650
|
errors: r,
|
|
2650
2651
|
setValues: n,
|
|
@@ -2652,37 +2653,37 @@ function qi({
|
|
|
2652
2653
|
autoUpdateId: l = !1,
|
|
2653
2654
|
autoOpenTypeSelect: o,
|
|
2654
2655
|
includeIdAndTitle: d,
|
|
2655
|
-
onPropertyChanged:
|
|
2656
|
-
onDelete:
|
|
2657
|
-
propertyNamespace:
|
|
2658
|
-
onError:
|
|
2659
|
-
showErrors:
|
|
2660
|
-
disabled:
|
|
2656
|
+
onPropertyChanged: p,
|
|
2657
|
+
onDelete: u,
|
|
2658
|
+
propertyNamespace: h,
|
|
2659
|
+
onError: m,
|
|
2660
|
+
showErrors: c,
|
|
2661
|
+
disabled: g,
|
|
2661
2662
|
inArray: v,
|
|
2662
|
-
getData:
|
|
2663
|
+
getData: x,
|
|
2663
2664
|
allowDataInference: y,
|
|
2664
2665
|
propertyConfigs: C,
|
|
2665
|
-
collectionEditable:
|
|
2666
|
+
collectionEditable: w
|
|
2666
2667
|
}) {
|
|
2667
|
-
const [b, P] =
|
|
2668
|
-
|
|
2669
|
-
if (
|
|
2668
|
+
const [b, P] = $(o), [O, f] = $(!1), [N, _] = $(t?.dataType ? Kt(t) : void 0), R = Object.entries(lr).concat(Object.entries(C)), M = v ? R.filter(([q, L]) => !ne(L.property) && L.property?.dataType !== "array") : R, B = Ir(t), S = Le(null), s = Le(t), V = c && I(r, "selectedWidget");
|
|
2669
|
+
ce(() => {
|
|
2670
|
+
if (p && (!d || B.id)) {
|
|
2670
2671
|
const {
|
|
2671
|
-
id:
|
|
2672
|
+
id: q,
|
|
2672
2673
|
...L
|
|
2673
2674
|
} = B;
|
|
2674
|
-
|
|
2675
|
-
id:
|
|
2675
|
+
ve(B, s.current) || (p({
|
|
2676
|
+
id: q,
|
|
2676
2677
|
property: L,
|
|
2677
|
-
namespace:
|
|
2678
|
-
}),
|
|
2678
|
+
namespace: h
|
|
2679
|
+
}), s.current = B);
|
|
2679
2680
|
}
|
|
2680
|
-
}, [B, d,
|
|
2681
|
-
t?.id &&
|
|
2682
|
-
}, [r,
|
|
2683
|
-
const G = (
|
|
2684
|
-
|
|
2685
|
-
|
|
2681
|
+
}, [B, d, p, h]), ce(() => {
|
|
2682
|
+
t?.id && m && m(t?.id, h, r);
|
|
2683
|
+
}, [r, m, h, t?.id]);
|
|
2684
|
+
const G = (q) => {
|
|
2685
|
+
_(q), n(ar(t, q, C)), setTimeout(() => {
|
|
2686
|
+
S.current?.focus();
|
|
2686
2687
|
}, 0);
|
|
2687
2688
|
};
|
|
2688
2689
|
let D;
|
|
@@ -2690,14 +2691,14 @@ function qi({
|
|
|
2690
2691
|
_i,
|
|
2691
2692
|
{
|
|
2692
2693
|
widgetId: N,
|
|
2693
|
-
disabled:
|
|
2694
|
-
showErrors:
|
|
2694
|
+
disabled: g,
|
|
2695
|
+
showErrors: c
|
|
2695
2696
|
}
|
|
2696
2697
|
) : N === "url" ? D = /* @__PURE__ */ e(
|
|
2697
2698
|
Ri,
|
|
2698
2699
|
{
|
|
2699
|
-
disabled:
|
|
2700
|
-
showErrors:
|
|
2700
|
+
disabled: g,
|
|
2701
|
+
showErrors: c
|
|
2701
2702
|
}
|
|
2702
2703
|
) : N === "select" || N === "number_select" ? D = /* @__PURE__ */ e(
|
|
2703
2704
|
Rt,
|
|
@@ -2705,83 +2706,83 @@ function qi({
|
|
|
2705
2706
|
multiselect: !1,
|
|
2706
2707
|
allowDataInference: y,
|
|
2707
2708
|
updateIds: !i,
|
|
2708
|
-
disabled:
|
|
2709
|
-
getData:
|
|
2710
|
-
showErrors:
|
|
2709
|
+
disabled: g,
|
|
2710
|
+
getData: x,
|
|
2711
|
+
showErrors: c
|
|
2711
2712
|
}
|
|
2712
2713
|
) : N === "multi_select" || N === "multi_number_select" ? D = /* @__PURE__ */ e(
|
|
2713
2714
|
Rt,
|
|
2714
2715
|
{
|
|
2715
2716
|
multiselect: !0,
|
|
2716
2717
|
updateIds: !i,
|
|
2717
|
-
disabled:
|
|
2718
|
+
disabled: g,
|
|
2718
2719
|
allowDataInference: y,
|
|
2719
|
-
getData:
|
|
2720
|
-
showErrors:
|
|
2720
|
+
getData: x,
|
|
2721
|
+
showErrors: c
|
|
2721
2722
|
}
|
|
2722
2723
|
) : N === "file_upload" ? D = /* @__PURE__ */ e(
|
|
2723
2724
|
Ut,
|
|
2724
2725
|
{
|
|
2725
2726
|
existing: i,
|
|
2726
2727
|
multiple: !1,
|
|
2727
|
-
disabled:
|
|
2728
|
+
disabled: g
|
|
2728
2729
|
}
|
|
2729
2730
|
) : N === "multi_file_upload" ? D = /* @__PURE__ */ e(
|
|
2730
2731
|
Ut,
|
|
2731
2732
|
{
|
|
2732
2733
|
existing: i,
|
|
2733
2734
|
multiple: !0,
|
|
2734
|
-
disabled:
|
|
2735
|
+
disabled: g
|
|
2735
2736
|
}
|
|
2736
|
-
) : N === "switch" ? D = /* @__PURE__ */ e(Fi, { disabled:
|
|
2737
|
+
) : N === "switch" ? D = /* @__PURE__ */ e(Fi, { disabled: g }) : N === "number_input" ? D = /* @__PURE__ */ e(Ai, { disabled: g }) : N === "group" ? D = /* @__PURE__ */ e(
|
|
2737
2738
|
Oi,
|
|
2738
2739
|
{
|
|
2739
|
-
disabled:
|
|
2740
|
-
getData:
|
|
2740
|
+
disabled: g,
|
|
2741
|
+
getData: x,
|
|
2741
2742
|
allowDataInference: y,
|
|
2742
|
-
collectionEditable:
|
|
2743
|
+
collectionEditable: w,
|
|
2743
2744
|
propertyConfigs: C
|
|
2744
2745
|
}
|
|
2745
2746
|
) : N === "block" ? D = /* @__PURE__ */ e(
|
|
2746
2747
|
Si,
|
|
2747
2748
|
{
|
|
2748
|
-
disabled:
|
|
2749
|
-
getData:
|
|
2749
|
+
disabled: g,
|
|
2750
|
+
getData: x,
|
|
2750
2751
|
allowDataInference: y,
|
|
2751
|
-
collectionEditable:
|
|
2752
|
+
collectionEditable: w,
|
|
2752
2753
|
propertyConfigs: C
|
|
2753
2754
|
}
|
|
2754
2755
|
) : N === "reference" ? D = /* @__PURE__ */ e(
|
|
2755
|
-
|
|
2756
|
+
jt,
|
|
2756
2757
|
{
|
|
2757
|
-
showErrors:
|
|
2758
|
+
showErrors: c,
|
|
2758
2759
|
existing: i,
|
|
2759
2760
|
multiple: !1,
|
|
2760
|
-
disabled:
|
|
2761
|
+
disabled: g
|
|
2761
2762
|
}
|
|
2762
|
-
) : N === "date_time" ? D = /* @__PURE__ */ e(Bi, { disabled:
|
|
2763
|
-
|
|
2763
|
+
) : N === "date_time" ? D = /* @__PURE__ */ e(Bi, { disabled: g }) : N === "multi_references" ? D = /* @__PURE__ */ e(
|
|
2764
|
+
jt,
|
|
2764
2765
|
{
|
|
2765
|
-
showErrors:
|
|
2766
|
+
showErrors: c,
|
|
2766
2767
|
existing: i,
|
|
2767
2768
|
multiple: !0,
|
|
2768
|
-
disabled:
|
|
2769
|
+
disabled: g
|
|
2769
2770
|
}
|
|
2770
2771
|
) : N === "repeat" ? D = /* @__PURE__ */ e(
|
|
2771
2772
|
Vi,
|
|
2772
2773
|
{
|
|
2773
|
-
showErrors:
|
|
2774
|
+
showErrors: c,
|
|
2774
2775
|
existing: i,
|
|
2775
|
-
getData:
|
|
2776
|
+
getData: x,
|
|
2776
2777
|
allowDataInference: y,
|
|
2777
|
-
disabled:
|
|
2778
|
-
collectionEditable:
|
|
2778
|
+
disabled: g,
|
|
2779
|
+
collectionEditable: w,
|
|
2779
2780
|
propertyConfigs: C
|
|
2780
2781
|
}
|
|
2781
|
-
) : N === "key_value" ? D = /* @__PURE__ */ e(Mi, { disabled:
|
|
2782
|
-
|
|
2783
|
-
/* @__PURE__ */ e(
|
|
2784
|
-
/* @__PURE__ */ a(
|
|
2782
|
+
) : N === "key_value" ? D = /* @__PURE__ */ e(Mi, { disabled: g }) : D = null, /* @__PURE__ */ a(U, { children: [
|
|
2783
|
+
g && /* @__PURE__ */ a(Lr, { mode: "warn", children: [
|
|
2784
|
+
/* @__PURE__ */ e(k, { children: "This property can't be edited" }),
|
|
2785
|
+
/* @__PURE__ */ a(k, { variant: "caption", children: [
|
|
2785
2786
|
"You may not have permission to edit it or it is defined in code with no ",
|
|
2786
2787
|
/* @__PURE__ */ e("code", { children: "editable" }),
|
|
2787
2788
|
" flag"
|
|
@@ -2792,37 +2793,37 @@ function qi({
|
|
|
2792
2793
|
/* @__PURE__ */ e(
|
|
2793
2794
|
be,
|
|
2794
2795
|
{
|
|
2795
|
-
error: !!
|
|
2796
|
+
error: !!V,
|
|
2796
2797
|
value: N ?? "",
|
|
2797
2798
|
placeholder: "Select a property widget",
|
|
2798
2799
|
open: b,
|
|
2799
2800
|
onOpenChange: P,
|
|
2800
2801
|
position: "item-aligned",
|
|
2801
|
-
disabled:
|
|
2802
|
-
renderValue: (
|
|
2803
|
-
if (
|
|
2802
|
+
disabled: g,
|
|
2803
|
+
renderValue: (q) => {
|
|
2804
|
+
if (!q)
|
|
2804
2805
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
2805
|
-
const L =
|
|
2806
|
+
const L = q, Q = Gt[L] ?? C[L], le = Q.property, Me = le && !ne(le) ? $e(le, C) : void 0, we = ne(le) || i && le.dataType !== t?.dataType, de = Me ? W(Me, Q) : Q;
|
|
2806
2807
|
return /* @__PURE__ */ a(
|
|
2807
2808
|
"div",
|
|
2808
2809
|
{
|
|
2809
2810
|
onClick: (re) => {
|
|
2810
|
-
|
|
2811
|
+
we && (re.stopPropagation(), re.preventDefault());
|
|
2811
2812
|
},
|
|
2812
|
-
className:
|
|
2813
|
+
className: me(
|
|
2813
2814
|
"flex items-center",
|
|
2814
|
-
|
|
2815
|
+
we ? "w-full pointer-events-none opacity-50" : ""
|
|
2815
2816
|
),
|
|
2816
2817
|
children: [
|
|
2817
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
2818
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ye, { propertyConfig: de }) }),
|
|
2818
2819
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-start text-base text-left", children: [
|
|
2819
|
-
/* @__PURE__ */ e("div", { children:
|
|
2820
|
+
/* @__PURE__ */ e("div", { children: de.name }),
|
|
2820
2821
|
/* @__PURE__ */ e(
|
|
2821
|
-
|
|
2822
|
+
k,
|
|
2822
2823
|
{
|
|
2823
2824
|
variant: "caption",
|
|
2824
2825
|
color: "disabled",
|
|
2825
|
-
children:
|
|
2826
|
+
children: we ? "You can only switch to widgets that use the same data type" : de.description
|
|
2826
2827
|
}
|
|
2827
2828
|
)
|
|
2828
2829
|
] })
|
|
@@ -2830,26 +2831,26 @@ function qi({
|
|
|
2830
2831
|
}
|
|
2831
2832
|
);
|
|
2832
2833
|
},
|
|
2833
|
-
onValueChange: (
|
|
2834
|
-
G(
|
|
2834
|
+
onValueChange: (q) => {
|
|
2835
|
+
G(q);
|
|
2835
2836
|
},
|
|
2836
|
-
children: M.map(([
|
|
2837
|
+
children: M.map(([q, L]) => {
|
|
2837
2838
|
const Q = L.property, le = i && !ne(Q) && Q.dataType !== t?.dataType;
|
|
2838
2839
|
return /* @__PURE__ */ e(
|
|
2839
2840
|
or,
|
|
2840
2841
|
{
|
|
2841
|
-
value:
|
|
2842
|
+
value: q,
|
|
2842
2843
|
optionDisabled: le,
|
|
2843
2844
|
propertyConfig: L,
|
|
2844
2845
|
existing: i
|
|
2845
2846
|
},
|
|
2846
|
-
|
|
2847
|
+
q
|
|
2847
2848
|
);
|
|
2848
2849
|
})
|
|
2849
2850
|
}
|
|
2850
2851
|
),
|
|
2851
|
-
|
|
2852
|
-
|
|
2852
|
+
V && /* @__PURE__ */ e(
|
|
2853
|
+
k,
|
|
2853
2854
|
{
|
|
2854
2855
|
variant: "caption",
|
|
2855
2856
|
className: "ml-3.5",
|
|
@@ -2858,14 +2859,14 @@ function qi({
|
|
|
2858
2859
|
}
|
|
2859
2860
|
)
|
|
2860
2861
|
] }),
|
|
2861
|
-
|
|
2862
|
+
u && t?.id && /* @__PURE__ */ e(
|
|
2862
2863
|
oe,
|
|
2863
2864
|
{
|
|
2864
2865
|
variant: "ghost",
|
|
2865
2866
|
className: "m-4",
|
|
2866
|
-
disabled:
|
|
2867
|
-
onClick: () =>
|
|
2868
|
-
children: /* @__PURE__ */ e(
|
|
2867
|
+
disabled: g,
|
|
2868
|
+
onClick: () => f(!0),
|
|
2869
|
+
children: /* @__PURE__ */ e(dt, {})
|
|
2869
2870
|
}
|
|
2870
2871
|
)
|
|
2871
2872
|
] }),
|
|
@@ -2873,23 +2874,23 @@ function qi({
|
|
|
2873
2874
|
d && /* @__PURE__ */ e(
|
|
2874
2875
|
Ii,
|
|
2875
2876
|
{
|
|
2876
|
-
showErrors:
|
|
2877
|
+
showErrors: c,
|
|
2877
2878
|
disabledId: i,
|
|
2878
2879
|
isNewProperty: !i,
|
|
2879
|
-
disabled:
|
|
2880
|
+
disabled: g,
|
|
2880
2881
|
autoUpdateId: l,
|
|
2881
|
-
ref:
|
|
2882
|
+
ref: S
|
|
2882
2883
|
}
|
|
2883
2884
|
),
|
|
2884
2885
|
D,
|
|
2885
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled:
|
|
2886
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled: g }) })
|
|
2886
2887
|
] }),
|
|
2887
|
-
|
|
2888
|
+
u && /* @__PURE__ */ e(
|
|
2888
2889
|
lt,
|
|
2889
2890
|
{
|
|
2890
2891
|
open: O,
|
|
2891
|
-
onAccept: () =>
|
|
2892
|
-
onCancel: () =>
|
|
2892
|
+
onAccept: () => u(t?.id, h),
|
|
2893
|
+
onCancel: () => f(!1),
|
|
2893
2894
|
title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
|
|
2894
2895
|
body: /* @__PURE__ */ a("div", { children: [
|
|
2895
2896
|
" This will ",
|
|
@@ -2901,11 +2902,11 @@ function qi({
|
|
|
2901
2902
|
] });
|
|
2902
2903
|
}
|
|
2903
2904
|
const Li = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
2904
|
-
function
|
|
2905
|
+
function qi(t, r) {
|
|
2905
2906
|
let n;
|
|
2906
2907
|
return t || (n = "You must specify an id for the field"), t && !t.match(Li) && (n = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && r && r.includes(t) && (n = "There is another field with this ID already"), n;
|
|
2907
2908
|
}
|
|
2908
|
-
function
|
|
2909
|
+
function $i(t) {
|
|
2909
2910
|
let r;
|
|
2910
2911
|
return t || (r = "You must specify a title for the field"), r;
|
|
2911
2912
|
}
|
|
@@ -2915,20 +2916,20 @@ function Yi(t) {
|
|
|
2915
2916
|
function Hi({ collection: t, onOpenChange: r, open: n }) {
|
|
2916
2917
|
const i = Ie(), l = `import { EntityCollection } from "firecms";
|
|
2917
2918
|
|
|
2918
|
-
const ` + (t.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.stringify(
|
|
2919
|
+
const ` + (t.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.stringify(cr(t), null, " ");
|
|
2919
2920
|
return /* @__PURE__ */ a(
|
|
2920
|
-
|
|
2921
|
+
Fe,
|
|
2921
2922
|
{
|
|
2922
2923
|
open: n,
|
|
2923
2924
|
onOpenChange: r,
|
|
2924
2925
|
maxWidth: "4xl",
|
|
2925
2926
|
children: [
|
|
2926
|
-
/* @__PURE__ */ a(
|
|
2927
|
-
/* @__PURE__ */ a(
|
|
2927
|
+
/* @__PURE__ */ a(Be, { children: [
|
|
2928
|
+
/* @__PURE__ */ a(k, { variant: "h6", className: "my-4", children: [
|
|
2928
2929
|
"Code for ",
|
|
2929
2930
|
t.name
|
|
2930
2931
|
] }),
|
|
2931
|
-
/* @__PURE__ */ a(
|
|
2932
|
+
/* @__PURE__ */ a(k, { variant: "body2", className: "my-4 mb-8", children: [
|
|
2932
2933
|
"If you want to customise the collection in code, you can add this collection code to your CMS app configuration. More info in the ",
|
|
2933
2934
|
/* @__PURE__ */ e(
|
|
2934
2935
|
"a",
|
|
@@ -2946,11 +2947,11 @@ const ` + (t.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.s
|
|
|
2946
2947
|
theme: si.vsDark,
|
|
2947
2948
|
code: l,
|
|
2948
2949
|
language: "typescript",
|
|
2949
|
-
children: ({ className: o, style: d, tokens:
|
|
2950
|
+
children: ({ className: o, style: d, tokens: p, getLineProps: u, getTokenProps: h }) => /* @__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)) })
|
|
2950
2951
|
}
|
|
2951
2952
|
)
|
|
2952
2953
|
] }),
|
|
2953
|
-
/* @__PURE__ */ a(
|
|
2954
|
+
/* @__PURE__ */ a(ze, { children: [
|
|
2954
2955
|
/* @__PURE__ */ a(
|
|
2955
2956
|
z,
|
|
2956
2957
|
{
|
|
@@ -2961,7 +2962,7 @@ const ` + (t.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.s
|
|
|
2961
2962
|
message: "Copied"
|
|
2962
2963
|
}), navigator.clipboard.writeText(l)),
|
|
2963
2964
|
children: [
|
|
2964
|
-
/* @__PURE__ */ e(
|
|
2965
|
+
/* @__PURE__ */ e(qr, { size: "small" }),
|
|
2965
2966
|
"Copy to clipboard"
|
|
2966
2967
|
]
|
|
2967
2968
|
}
|
|
@@ -2972,7 +2973,7 @@ const ` + (t.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + oi.s
|
|
|
2972
2973
|
}
|
|
2973
2974
|
);
|
|
2974
2975
|
}
|
|
2975
|
-
function
|
|
2976
|
+
function cr(t) {
|
|
2976
2977
|
const r = (n) => {
|
|
2977
2978
|
const i = {
|
|
2978
2979
|
...n
|
|
@@ -2995,10 +2996,10 @@ function dr(t) {
|
|
|
2995
2996
|
customId: t.customId,
|
|
2996
2997
|
initialFilter: t.initialFilter,
|
|
2997
2998
|
initialSort: t.initialSort,
|
|
2998
|
-
properties: Object.entries(t.properties).map(([n, i]) => ({
|
|
2999
|
+
properties: Object.entries(t.properties ?? {}).map(([n, i]) => ({
|
|
2999
3000
|
[n]: r(i)
|
|
3000
3001
|
})).reduce((n, i) => ({ ...n, ...i }), {}),
|
|
3001
|
-
subcollections: (t.subcollections ?? []).map(
|
|
3002
|
+
subcollections: (t.subcollections ?? []).map(cr)
|
|
3002
3003
|
};
|
|
3003
3004
|
}
|
|
3004
3005
|
function Gi({
|
|
@@ -3009,113 +3010,113 @@ function Gi({
|
|
|
3009
3010
|
setDirty: l,
|
|
3010
3011
|
reservedGroups: o,
|
|
3011
3012
|
extraIcon: d,
|
|
3012
|
-
getUser:
|
|
3013
|
-
getData:
|
|
3014
|
-
doCollectionInference:
|
|
3015
|
-
propertyConfigs:
|
|
3016
|
-
collectionEditable:
|
|
3013
|
+
getUser: p,
|
|
3014
|
+
getData: u,
|
|
3015
|
+
doCollectionInference: h,
|
|
3016
|
+
propertyConfigs: m,
|
|
3017
|
+
collectionEditable: c
|
|
3017
3018
|
}) {
|
|
3018
3019
|
const {
|
|
3019
|
-
values:
|
|
3020
|
+
values: g,
|
|
3020
3021
|
setFieldValue: v,
|
|
3021
|
-
setFieldError:
|
|
3022
|
+
setFieldError: x,
|
|
3022
3023
|
setFieldTouched: y,
|
|
3023
3024
|
errors: C,
|
|
3024
|
-
dirty:
|
|
3025
|
-
} = K(), b = Ie(), P =
|
|
3026
|
-
|
|
3027
|
-
l && l(
|
|
3028
|
-
}, [
|
|
3029
|
-
const
|
|
3030
|
-
|
|
3031
|
-
if (
|
|
3025
|
+
dirty: w
|
|
3026
|
+
} = K(), b = Ie(), P = Nr(), O = !P, [f, N] = $(), [_, R] = $(), [M, B] = $(), S = _ ? ae(_, M) : void 0, s = S ? I(g.properties, S.replaceAll(".", ".properties.")) : void 0, [V, G] = $(!1), [D, q] = $(!1), [L, Q] = $(!1), [le, Me] = $([]), we = Y.useRef(g.propertiesOrder ? { "": g.propertiesOrder } : {});
|
|
3027
|
+
ce(() => {
|
|
3028
|
+
l && l(w);
|
|
3029
|
+
}, [w]);
|
|
3030
|
+
const de = h ? () => {
|
|
3031
|
+
h && (q(!0), h(g).then((F) => {
|
|
3032
|
+
if (F && pt(F.properties), !F) {
|
|
3032
3033
|
b.open({
|
|
3033
3034
|
type: "error",
|
|
3034
3035
|
message: "Could not infer properties from data"
|
|
3035
3036
|
});
|
|
3036
3037
|
return;
|
|
3037
3038
|
}
|
|
3038
|
-
const
|
|
3039
|
-
if (
|
|
3039
|
+
const j = (F.properties ? Object.keys(F.properties) : []).filter((A) => !g.properties[A]);
|
|
3040
|
+
if (j.length === 0) {
|
|
3040
3041
|
b.open({
|
|
3041
3042
|
type: "info",
|
|
3042
3043
|
message: "No new properties found in existing data"
|
|
3043
3044
|
});
|
|
3044
3045
|
return;
|
|
3045
3046
|
}
|
|
3046
|
-
const
|
|
3047
|
-
...
|
|
3048
|
-
...
|
|
3047
|
+
const T = {
|
|
3048
|
+
...j.reduce((A, ie) => (A[ie] = (F.properties ?? {})[ie], A), {}),
|
|
3049
|
+
...g.properties
|
|
3049
3050
|
}, E = [
|
|
3050
|
-
...
|
|
3051
|
-
...
|
|
3051
|
+
...j,
|
|
3052
|
+
...g.propertiesOrder ?? []
|
|
3052
3053
|
];
|
|
3053
|
-
v("properties",
|
|
3054
|
+
v("properties", T, !1), he(E), Me(j);
|
|
3054
3055
|
}).finally(() => {
|
|
3055
|
-
|
|
3056
|
+
q(!1);
|
|
3056
3057
|
}));
|
|
3057
|
-
} : void 0, re = Z((
|
|
3058
|
-
const
|
|
3059
|
-
v(
|
|
3060
|
-
}, [v]), Te = Z((
|
|
3061
|
-
const
|
|
3062
|
-
if (!
|
|
3058
|
+
} : void 0, re = Z((F) => F ? we.current[F] ?? I(g, ye(F)) : we.current[""], [g]), he = Z((F, j) => {
|
|
3059
|
+
const T = ye(j);
|
|
3060
|
+
v(T, F, !1), we.current[j ?? ""] = F;
|
|
3061
|
+
}, [v]), Te = Z((F, j) => {
|
|
3062
|
+
const T = F ? ae(F, j) : void 0;
|
|
3063
|
+
if (!T)
|
|
3063
3064
|
throw Error("collection editor miss config");
|
|
3064
|
-
v(
|
|
3065
|
-
const A = re(
|
|
3066
|
-
he(A,
|
|
3067
|
-
}, [re, v, he]), Ge = (
|
|
3068
|
-
v(ye(
|
|
3065
|
+
v(pe(T), void 0, !1);
|
|
3066
|
+
const A = re(j).filter((ie) => ie !== F);
|
|
3067
|
+
he(A, j), Q(!1), N(void 0), R(void 0), B(void 0);
|
|
3068
|
+
}, [re, v, he]), Ge = (F, j) => {
|
|
3069
|
+
v(ye(j), F, !1);
|
|
3069
3070
|
}, gt = ({
|
|
3070
|
-
id:
|
|
3071
|
-
property:
|
|
3071
|
+
id: F,
|
|
3072
|
+
property: j
|
|
3072
3073
|
}) => {
|
|
3073
|
-
if (!
|
|
3074
|
+
if (!F)
|
|
3074
3075
|
throw Error("Need to include an ID when creating a new property");
|
|
3075
3076
|
v("properties", {
|
|
3076
|
-
...
|
|
3077
|
-
[
|
|
3077
|
+
...g.properties ?? {},
|
|
3078
|
+
[F]: j
|
|
3078
3079
|
}, !1);
|
|
3079
|
-
const
|
|
3080
|
-
he(
|
|
3080
|
+
const T = [...g.propertiesOrder ?? Object.keys(g.properties), F];
|
|
3081
|
+
he(T), Q(!1), P && (N(T.indexOf(F)), R(F)), B(void 0);
|
|
3081
3082
|
}, fe = ({
|
|
3082
|
-
id:
|
|
3083
|
-
property:
|
|
3084
|
-
previousId:
|
|
3083
|
+
id: F,
|
|
3084
|
+
property: j,
|
|
3085
|
+
previousId: T,
|
|
3085
3086
|
namespace: E
|
|
3086
3087
|
}) => {
|
|
3087
|
-
const A =
|
|
3088
|
-
if (
|
|
3089
|
-
const ke = ae(
|
|
3090
|
-
he(It, E),
|
|
3088
|
+
const A = F ? ae(F, E) : void 0, ie = A ? pe(A) : void 0;
|
|
3089
|
+
if (T && T !== F) {
|
|
3090
|
+
const ke = ae(T, E), Vt = pe(ke), It = re(E).map((Xe) => Xe === T ? F : Xe).filter((Xe) => Xe !== void 0);
|
|
3091
|
+
he(It, E), F && (N(It.indexOf(F)), R(F)), v(Vt, void 0, !1), y(Vt, !1, !1);
|
|
3091
3092
|
}
|
|
3092
3093
|
console.debug("onPropertyChanged", {
|
|
3093
|
-
id:
|
|
3094
|
-
property:
|
|
3095
|
-
previousId:
|
|
3094
|
+
id: F,
|
|
3095
|
+
property: j,
|
|
3096
|
+
previousId: T,
|
|
3096
3097
|
namespace: E,
|
|
3097
3098
|
propertyPath: ie
|
|
3098
|
-
}), ie && (v(ie,
|
|
3099
|
-
}, Ke = Z((
|
|
3100
|
-
const E =
|
|
3099
|
+
}), ie && (v(ie, j, !1), y(ie, !0, !1));
|
|
3100
|
+
}, Ke = Z((F, j, T) => {
|
|
3101
|
+
const E = F ? ae(F, j) : void 0;
|
|
3101
3102
|
if (console.debug("onPropertyErrorInternal", {
|
|
3102
|
-
id:
|
|
3103
|
-
namespace:
|
|
3104
|
-
error:
|
|
3103
|
+
id: F,
|
|
3104
|
+
namespace: j,
|
|
3105
|
+
error: T,
|
|
3105
3106
|
propertyPath: E
|
|
3106
3107
|
}), E) {
|
|
3107
|
-
const A =
|
|
3108
|
-
i(
|
|
3108
|
+
const A = T && Object.keys(T).length > 0;
|
|
3109
|
+
i(F, j, A ? T : void 0), x(pe(E), A ? "Property error" : void 0);
|
|
3109
3110
|
}
|
|
3110
3111
|
}, []), We = () => {
|
|
3111
3112
|
N(void 0), R(void 0);
|
|
3112
|
-
}, Ze =
|
|
3113
|
+
}, 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(() => p(g.ownerId), [p, g.ownerId]), vt = Z((F, j) => {
|
|
3113
3114
|
console.debug("CollectionEditor: onPropertyClick", {
|
|
3114
|
-
propertyKey:
|
|
3115
|
-
namespace:
|
|
3116
|
-
}), N(
|
|
3117
|
-
}, [
|
|
3118
|
-
/* @__PURE__ */ a("div", { className:
|
|
3115
|
+
propertyKey: F,
|
|
3116
|
+
namespace: j
|
|
3117
|
+
}), N(Re.indexOf(F)), R(F), B(j);
|
|
3118
|
+
}, [Re]), yt = /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
3119
|
+
/* @__PURE__ */ a("div", { className: me(
|
|
3119
3120
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
3120
3121
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
3121
3122
|
!O && "border-r " + wt
|
|
@@ -3137,7 +3138,7 @@ function Gi({
|
|
|
3137
3138
|
}
|
|
3138
3139
|
),
|
|
3139
3140
|
Qe && /* @__PURE__ */ a(
|
|
3140
|
-
|
|
3141
|
+
k,
|
|
3141
3142
|
{
|
|
3142
3143
|
variant: "body2",
|
|
3143
3144
|
className: "ml-2",
|
|
@@ -3157,16 +3158,16 @@ function Gi({
|
|
|
3157
3158
|
variant: "filled",
|
|
3158
3159
|
disabled: D,
|
|
3159
3160
|
onClick: () => G(!0),
|
|
3160
|
-
children: /* @__PURE__ */ e(
|
|
3161
|
+
children: /* @__PURE__ */ e($r, {})
|
|
3161
3162
|
}
|
|
3162
3163
|
) }),
|
|
3163
|
-
|
|
3164
|
+
de && /* @__PURE__ */ e(te, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
|
|
3164
3165
|
oe,
|
|
3165
3166
|
{
|
|
3166
3167
|
variant: "filled",
|
|
3167
3168
|
disabled: D,
|
|
3168
|
-
onClick:
|
|
3169
|
-
children: D ? /* @__PURE__ */ e(
|
|
3169
|
+
onClick: de,
|
|
3170
|
+
children: D ? /* @__PURE__ */ e(De, { size: "small" }) : /* @__PURE__ */ e(ht, {})
|
|
3170
3171
|
}
|
|
3171
3172
|
) }),
|
|
3172
3173
|
/* @__PURE__ */ e(te, { title: "Add new property", children: /* @__PURE__ */ e(
|
|
@@ -3174,24 +3175,24 @@ function Gi({
|
|
|
3174
3175
|
{
|
|
3175
3176
|
variant: "outlined",
|
|
3176
3177
|
onClick: () => Q(!0),
|
|
3177
|
-
children: /* @__PURE__ */ e(
|
|
3178
|
+
children: /* @__PURE__ */ e(ue, {})
|
|
3178
3179
|
}
|
|
3179
3180
|
) })
|
|
3180
3181
|
] })
|
|
3181
3182
|
] }),
|
|
3182
|
-
/* @__PURE__ */ e(
|
|
3183
|
+
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(
|
|
3183
3184
|
ft,
|
|
3184
3185
|
{
|
|
3185
3186
|
className: "pl-8",
|
|
3186
3187
|
inferredPropertyKeys: le,
|
|
3187
|
-
selectedPropertyKey:
|
|
3188
|
-
properties:
|
|
3189
|
-
additionalFields:
|
|
3190
|
-
propertiesOrder:
|
|
3188
|
+
selectedPropertyKey: _ ? ae(_, M) : void 0,
|
|
3189
|
+
properties: g.properties,
|
|
3190
|
+
additionalFields: g.additionalFields,
|
|
3191
|
+
propertiesOrder: Re,
|
|
3191
3192
|
onPropertyClick: vt,
|
|
3192
3193
|
onPropertyMove: Ge,
|
|
3193
3194
|
onPropertyRemove: r ? Te : void 0,
|
|
3194
|
-
collectionEditable:
|
|
3195
|
+
collectionEditable: c,
|
|
3195
3196
|
errors: C
|
|
3196
3197
|
}
|
|
3197
3198
|
) }),
|
|
@@ -3203,7 +3204,7 @@ function Gi({
|
|
|
3203
3204
|
variant: "outlined",
|
|
3204
3205
|
size: "large",
|
|
3205
3206
|
onClick: () => Q(!0),
|
|
3206
|
-
startIcon: /* @__PURE__ */ e(
|
|
3207
|
+
startIcon: /* @__PURE__ */ e(ue, {}),
|
|
3207
3208
|
children: "Add new property"
|
|
3208
3209
|
}
|
|
3209
3210
|
)
|
|
@@ -3213,7 +3214,7 @@ function Gi({
|
|
|
3213
3214
|
{
|
|
3214
3215
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
3215
3216
|
children: [
|
|
3216
|
-
|
|
3217
|
+
S && s && !ne(s) && /* @__PURE__ */ e(
|
|
3217
3218
|
sr,
|
|
3218
3219
|
{
|
|
3219
3220
|
inArray: !1,
|
|
@@ -3221,22 +3222,22 @@ function Gi({
|
|
|
3221
3222
|
autoUpdateId: !1,
|
|
3222
3223
|
allowDataInference: !r,
|
|
3223
3224
|
autoOpenTypeSelect: !1,
|
|
3224
|
-
propertyKey:
|
|
3225
|
+
propertyKey: _,
|
|
3225
3226
|
propertyNamespace: M,
|
|
3226
|
-
property:
|
|
3227
|
+
property: s,
|
|
3227
3228
|
onPropertyChanged: fe,
|
|
3228
3229
|
onDelete: Te,
|
|
3229
3230
|
onError: Ke,
|
|
3230
3231
|
forceShowErrors: t,
|
|
3231
3232
|
initialErrors: Ze,
|
|
3232
|
-
getData:
|
|
3233
|
-
propertyConfigs:
|
|
3234
|
-
collectionEditable:
|
|
3233
|
+
getData: u,
|
|
3234
|
+
propertyConfigs: m,
|
|
3235
|
+
collectionEditable: c
|
|
3235
3236
|
},
|
|
3236
|
-
`edit_view_${
|
|
3237
|
+
`edit_view_${f}`
|
|
3237
3238
|
),
|
|
3238
|
-
!
|
|
3239
|
-
|
|
3239
|
+
!s && /* @__PURE__ */ e(k, { variant: "label", className: "flex items-center justify-center h-full", children: Je ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
3240
|
+
s && ne(s) && /* @__PURE__ */ e(k, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
3240
3241
|
]
|
|
3241
3242
|
}
|
|
3242
3243
|
) }),
|
|
@@ -3244,25 +3245,25 @@ function Gi({
|
|
|
3244
3245
|
Ve,
|
|
3245
3246
|
{
|
|
3246
3247
|
inArray: !1,
|
|
3247
|
-
open:
|
|
3248
|
-
autoUpdateId: !
|
|
3248
|
+
open: f !== void 0,
|
|
3249
|
+
autoUpdateId: !s,
|
|
3249
3250
|
allowDataInference: !r,
|
|
3250
3251
|
existingProperty: !0,
|
|
3251
3252
|
autoOpenTypeSelect: !1,
|
|
3252
|
-
propertyKey:
|
|
3253
|
+
propertyKey: _,
|
|
3253
3254
|
propertyNamespace: M,
|
|
3254
|
-
property:
|
|
3255
|
+
property: s,
|
|
3255
3256
|
onPropertyChanged: fe,
|
|
3256
3257
|
onDelete: Te,
|
|
3257
3258
|
onError: Ke,
|
|
3258
3259
|
forceShowErrors: t,
|
|
3259
3260
|
initialErrors: Ze,
|
|
3260
|
-
getData:
|
|
3261
|
-
propertyConfigs:
|
|
3262
|
-
collectionEditable:
|
|
3261
|
+
getData: u,
|
|
3262
|
+
propertyConfigs: m,
|
|
3263
|
+
collectionEditable: c,
|
|
3263
3264
|
onOkClicked: O ? We : void 0
|
|
3264
3265
|
},
|
|
3265
|
-
`edit_view_${
|
|
3266
|
+
`edit_view_${f}`
|
|
3266
3267
|
)
|
|
3267
3268
|
] });
|
|
3268
3269
|
return /* @__PURE__ */ a(U, { children: [
|
|
@@ -3278,18 +3279,18 @@ function Gi({
|
|
|
3278
3279
|
open: L,
|
|
3279
3280
|
onCancel: () => Q(!1),
|
|
3280
3281
|
onPropertyChanged: gt,
|
|
3281
|
-
getData:
|
|
3282
|
+
getData: u,
|
|
3282
3283
|
allowDataInference: !r,
|
|
3283
|
-
propertyConfigs:
|
|
3284
|
-
collectionEditable:
|
|
3285
|
-
existingPropertyKeys:
|
|
3284
|
+
propertyConfigs: m,
|
|
3285
|
+
collectionEditable: c,
|
|
3286
|
+
existingPropertyKeys: g.propertiesOrder
|
|
3286
3287
|
}
|
|
3287
3288
|
),
|
|
3288
3289
|
/* @__PURE__ */ e(
|
|
3289
3290
|
Hi,
|
|
3290
3291
|
{
|
|
3291
|
-
collection:
|
|
3292
|
-
open:
|
|
3292
|
+
collection: g,
|
|
3293
|
+
open: V,
|
|
3293
3294
|
onOpenChange: G
|
|
3294
3295
|
}
|
|
3295
3296
|
)
|
|
@@ -3303,19 +3304,19 @@ function Ki({
|
|
|
3303
3304
|
title: l
|
|
3304
3305
|
}) {
|
|
3305
3306
|
return /* @__PURE__ */ a(
|
|
3306
|
-
|
|
3307
|
+
Fe,
|
|
3307
3308
|
{
|
|
3308
3309
|
open: t,
|
|
3309
3310
|
onOpenChange: (o) => o ? n() : r(),
|
|
3310
3311
|
"aria-labelledby": "alert-dialog-title",
|
|
3311
3312
|
"aria-describedby": "alert-dialog-description",
|
|
3312
3313
|
children: [
|
|
3313
|
-
/* @__PURE__ */ a(De, { children: [
|
|
3314
|
-
/* @__PURE__ */ e(V, { variant: "h6", children: l ?? "Unsaved changes" }),
|
|
3315
|
-
i && /* @__PURE__ */ e(V, { children: i }),
|
|
3316
|
-
/* @__PURE__ */ e(V, { children: "Are you sure?" })
|
|
3317
|
-
] }),
|
|
3318
3314
|
/* @__PURE__ */ a(Be, { children: [
|
|
3315
|
+
/* @__PURE__ */ e(k, { variant: "h6", children: l ?? "Unsaved changes" }),
|
|
3316
|
+
i && /* @__PURE__ */ e(k, { children: i }),
|
|
3317
|
+
/* @__PURE__ */ e(k, { children: "Are you sure?" })
|
|
3318
|
+
] }),
|
|
3319
|
+
/* @__PURE__ */ a(ze, { children: [
|
|
3319
3320
|
/* @__PURE__ */ e(z, { variant: "text", onClick: n, autoFocus: !0, children: " Cancel " }),
|
|
3320
3321
|
/* @__PURE__ */ e(z, { onClick: r, children: " Ok " })
|
|
3321
3322
|
] })
|
|
@@ -3326,15 +3327,15 @@ function Ki({
|
|
|
3326
3327
|
function Wi({ open: t, onClose: r }) {
|
|
3327
3328
|
const {
|
|
3328
3329
|
entityViews: n
|
|
3329
|
-
} =
|
|
3330
|
+
} = Ae();
|
|
3330
3331
|
return /* @__PURE__ */ a(
|
|
3331
|
-
|
|
3332
|
+
Fe,
|
|
3332
3333
|
{
|
|
3333
3334
|
maxWidth: "md",
|
|
3334
3335
|
open: t,
|
|
3335
3336
|
children: [
|
|
3336
|
-
/* @__PURE__ */ a(
|
|
3337
|
-
/* @__PURE__ */ e(
|
|
3337
|
+
/* @__PURE__ */ a(Be, { className: "flex flex-col gap-4", children: [
|
|
3338
|
+
/* @__PURE__ */ e(k, { variant: "h6", children: "Select view" }),
|
|
3338
3339
|
n?.map((i) => /* @__PURE__ */ a(
|
|
3339
3340
|
z,
|
|
3340
3341
|
{
|
|
@@ -3350,9 +3351,9 @@ function Wi({ open: t, onClose: r }) {
|
|
|
3350
3351
|
},
|
|
3351
3352
|
i.key
|
|
3352
3353
|
)),
|
|
3353
|
-
(n ?? []).length === 0 && /* @__PURE__ */ e(
|
|
3354
|
+
(n ?? []).length === 0 && /* @__PURE__ */ e(k, { variant: "body2", children: "No custom views defined" })
|
|
3354
3355
|
] }),
|
|
3355
|
-
/* @__PURE__ */ e(
|
|
3356
|
+
/* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(z, { variant: "outlined", onClick: () => r(), children: "Cancel" }) })
|
|
3356
3357
|
]
|
|
3357
3358
|
}
|
|
3358
3359
|
);
|
|
@@ -3365,34 +3366,34 @@ function Zi({
|
|
|
3365
3366
|
getUser: l,
|
|
3366
3367
|
parentCollectionIds: o
|
|
3367
3368
|
}) {
|
|
3368
|
-
const { entityViews: d } =
|
|
3369
|
+
const { entityViews: d } = Ae(), [p, u] = Y.useState(), [h, m] = Y.useState(!1), [c, g] = Y.useState(), [v, x] = Y.useState(), {
|
|
3369
3370
|
values: y,
|
|
3370
3371
|
setFieldValue: C
|
|
3371
|
-
} = K(),
|
|
3372
|
+
} = K(), w = t.subcollections ?? [], b = y.entityViews?.filter((f) => typeof f == "string").map((f) => xr(f, d)).filter(Boolean) ?? [], P = t.entityViews?.filter((f) => typeof f != "string") ?? [], O = b.length + P.length;
|
|
3372
3373
|
return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
|
|
3373
3374
|
/* @__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: [
|
|
3374
3375
|
/* @__PURE__ */ a("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
3375
|
-
/* @__PURE__ */ a(
|
|
3376
|
+
/* @__PURE__ */ a(k, { variant: "h5", children: [
|
|
3376
3377
|
"Subcollections of ",
|
|
3377
3378
|
y.name
|
|
3378
3379
|
] }),
|
|
3379
|
-
|
|
3380
|
+
w && w.length > 0 && /* @__PURE__ */ e(Ce, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(Bt, { children: w.map((f) => /* @__PURE__ */ a(
|
|
3380
3381
|
bt,
|
|
3381
3382
|
{
|
|
3382
|
-
onClick: () =>
|
|
3383
|
+
onClick: () => x({
|
|
3383
3384
|
isNewCollection: !1,
|
|
3384
|
-
editedCollectionPath:
|
|
3385
|
+
editedCollectionPath: f.path
|
|
3385
3386
|
}),
|
|
3386
3387
|
children: [
|
|
3387
3388
|
/* @__PURE__ */ e(
|
|
3388
|
-
|
|
3389
|
+
Ue,
|
|
3389
3390
|
{
|
|
3390
3391
|
align: "left",
|
|
3391
|
-
children: /* @__PURE__ */ e(
|
|
3392
|
+
children: /* @__PURE__ */ e(k, { variant: "subtitle2", className: "flex-grow", children: f.name })
|
|
3392
3393
|
}
|
|
3393
3394
|
),
|
|
3394
3395
|
/* @__PURE__ */ e(
|
|
3395
|
-
|
|
3396
|
+
Ue,
|
|
3396
3397
|
{
|
|
3397
3398
|
align: "right",
|
|
3398
3399
|
children: /* @__PURE__ */ e(te, { title: "Remove", children: /* @__PURE__ */ e(
|
|
@@ -3400,45 +3401,45 @@ function Zi({
|
|
|
3400
3401
|
{
|
|
3401
3402
|
size: "small",
|
|
3402
3403
|
onClick: (N) => {
|
|
3403
|
-
N.preventDefault(), N.stopPropagation(),
|
|
3404
|
+
N.preventDefault(), N.stopPropagation(), u(f.id);
|
|
3404
3405
|
},
|
|
3405
3406
|
color: "inherit",
|
|
3406
|
-
children: /* @__PURE__ */ e(
|
|
3407
|
+
children: /* @__PURE__ */ e(dt, { size: "small" })
|
|
3407
3408
|
}
|
|
3408
3409
|
) })
|
|
3409
3410
|
}
|
|
3410
3411
|
)
|
|
3411
3412
|
]
|
|
3412
3413
|
},
|
|
3413
|
-
|
|
3414
|
+
f.path
|
|
3414
3415
|
)) }) }) }),
|
|
3415
3416
|
/* @__PURE__ */ e(
|
|
3416
3417
|
z,
|
|
3417
3418
|
{
|
|
3418
3419
|
onClick: () => {
|
|
3419
|
-
|
|
3420
|
+
x({
|
|
3420
3421
|
isNewCollection: !0
|
|
3421
3422
|
});
|
|
3422
3423
|
},
|
|
3423
3424
|
variant: "outlined",
|
|
3424
|
-
startIcon: /* @__PURE__ */ e(
|
|
3425
|
+
startIcon: /* @__PURE__ */ e(ue, {}),
|
|
3425
3426
|
children: "Add subcollection"
|
|
3426
3427
|
}
|
|
3427
3428
|
)
|
|
3428
3429
|
] }),
|
|
3429
3430
|
/* @__PURE__ */ a("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
3430
|
-
/* @__PURE__ */ e(
|
|
3431
|
+
/* @__PURE__ */ e(k, { variant: "h5", children: "Custom views" }),
|
|
3431
3432
|
O > 0 && /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(Ce, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ a(Bt, { children: [
|
|
3432
|
-
b.map((
|
|
3433
|
+
b.map((f) => /* @__PURE__ */ a(bt, { children: [
|
|
3433
3434
|
/* @__PURE__ */ e(
|
|
3434
|
-
|
|
3435
|
+
Ue,
|
|
3435
3436
|
{
|
|
3436
3437
|
align: "left",
|
|
3437
|
-
children: /* @__PURE__ */ e(
|
|
3438
|
+
children: /* @__PURE__ */ e(k, { variant: "subtitle2", className: "flex-grow", children: f.name })
|
|
3438
3439
|
}
|
|
3439
3440
|
),
|
|
3440
3441
|
/* @__PURE__ */ e(
|
|
3441
|
-
|
|
3442
|
+
Ue,
|
|
3442
3443
|
{
|
|
3443
3444
|
align: "right",
|
|
3444
3445
|
children: /* @__PURE__ */ e(te, { title: "Remove", children: /* @__PURE__ */ e(
|
|
@@ -3446,28 +3447,28 @@ function Zi({
|
|
|
3446
3447
|
{
|
|
3447
3448
|
size: "small",
|
|
3448
3449
|
onClick: (N) => {
|
|
3449
|
-
N.preventDefault(), N.stopPropagation(), f
|
|
3450
|
+
N.preventDefault(), N.stopPropagation(), g(f.key);
|
|
3450
3451
|
},
|
|
3451
3452
|
color: "inherit",
|
|
3452
|
-
children: /* @__PURE__ */ e(
|
|
3453
|
+
children: /* @__PURE__ */ e(dt, { size: "small" })
|
|
3453
3454
|
}
|
|
3454
3455
|
) })
|
|
3455
3456
|
}
|
|
3456
3457
|
)
|
|
3457
|
-
] },
|
|
3458
|
-
P.map((
|
|
3459
|
-
|
|
3458
|
+
] }, f.key)),
|
|
3459
|
+
P.map((f) => /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ a(
|
|
3460
|
+
Ue,
|
|
3460
3461
|
{
|
|
3461
3462
|
align: "left",
|
|
3462
3463
|
children: [
|
|
3463
|
-
/* @__PURE__ */ e(
|
|
3464
|
-
/* @__PURE__ */ a(
|
|
3464
|
+
/* @__PURE__ */ e(k, { variant: "subtitle2", className: "flex-grow", children: f.name }),
|
|
3465
|
+
/* @__PURE__ */ a(k, { variant: "caption", className: "flex-grow", children: [
|
|
3465
3466
|
"This view is defined in code with key ",
|
|
3466
|
-
/* @__PURE__ */ e("code", { children:
|
|
3467
|
+
/* @__PURE__ */ e("code", { children: f.key })
|
|
3467
3468
|
] })
|
|
3468
3469
|
]
|
|
3469
3470
|
}
|
|
3470
|
-
) },
|
|
3471
|
+
) }, f.key))
|
|
3471
3472
|
] }) }) }) }),
|
|
3472
3473
|
O === 0 && /* @__PURE__ */ e(Yr, { action: /* @__PURE__ */ e(
|
|
3473
3474
|
z,
|
|
@@ -3485,28 +3486,28 @@ function Zi({
|
|
|
3485
3486
|
z,
|
|
3486
3487
|
{
|
|
3487
3488
|
onClick: () => {
|
|
3488
|
-
|
|
3489
|
+
m(!0);
|
|
3489
3490
|
},
|
|
3490
3491
|
variant: "outlined",
|
|
3491
|
-
startIcon: /* @__PURE__ */ e(
|
|
3492
|
+
startIcon: /* @__PURE__ */ e(ue, {}),
|
|
3492
3493
|
children: "Add custom entity view"
|
|
3493
3494
|
}
|
|
3494
3495
|
)
|
|
3495
3496
|
] })
|
|
3496
3497
|
] }) }),
|
|
3497
3498
|
/* @__PURE__ */ e("div", { style: { height: "52px" } }),
|
|
3498
|
-
|
|
3499
|
+
p && /* @__PURE__ */ e(
|
|
3499
3500
|
lt,
|
|
3500
3501
|
{
|
|
3501
|
-
open: !!
|
|
3502
|
+
open: !!p,
|
|
3502
3503
|
onAccept: () => {
|
|
3503
|
-
const
|
|
3504
|
-
id:
|
|
3504
|
+
const f = {
|
|
3505
|
+
id: p,
|
|
3505
3506
|
parentCollectionIds: [...o ?? [], t.id]
|
|
3506
3507
|
};
|
|
3507
|
-
console.debug("Deleting subcollection",
|
|
3508
|
+
console.debug("Deleting subcollection", f), n.deleteCollection(f), u(void 0);
|
|
3508
3509
|
},
|
|
3509
|
-
onCancel: () =>
|
|
3510
|
+
onCancel: () => u(void 0),
|
|
3510
3511
|
title: /* @__PURE__ */ e(U, { children: "Delete this subcollection?" }),
|
|
3511
3512
|
body: /* @__PURE__ */ a(U, { children: [
|
|
3512
3513
|
" This will ",
|
|
@@ -3515,14 +3516,14 @@ function Zi({
|
|
|
3515
3516
|
] })
|
|
3516
3517
|
}
|
|
3517
3518
|
),
|
|
3518
|
-
|
|
3519
|
+
c && /* @__PURE__ */ e(
|
|
3519
3520
|
lt,
|
|
3520
3521
|
{
|
|
3521
|
-
open: !!
|
|
3522
|
+
open: !!c,
|
|
3522
3523
|
onAccept: () => {
|
|
3523
|
-
C("entityViews", y.entityViews?.filter((
|
|
3524
|
+
C("entityViews", y.entityViews?.filter((f) => f !== c)), g(void 0);
|
|
3524
3525
|
},
|
|
3525
|
-
onCancel: () =>
|
|
3526
|
+
onCancel: () => g(void 0),
|
|
3526
3527
|
title: /* @__PURE__ */ e(U, { children: "Remove this view?" }),
|
|
3527
3528
|
body: /* @__PURE__ */ a(U, { children: [
|
|
3528
3529
|
"This will ",
|
|
@@ -3543,16 +3544,16 @@ function Zi({
|
|
|
3543
3544
|
...v,
|
|
3544
3545
|
getUser: l,
|
|
3545
3546
|
handleClose: () => {
|
|
3546
|
-
|
|
3547
|
+
x(void 0);
|
|
3547
3548
|
}
|
|
3548
3549
|
}
|
|
3549
3550
|
),
|
|
3550
3551
|
/* @__PURE__ */ e(
|
|
3551
3552
|
Wi,
|
|
3552
3553
|
{
|
|
3553
|
-
open:
|
|
3554
|
-
onClose: (
|
|
3555
|
-
|
|
3554
|
+
open: h,
|
|
3555
|
+
onClose: (f) => {
|
|
3556
|
+
f && C("entityViews", [...y.entityViews ?? [], f]), m(!1);
|
|
3556
3557
|
}
|
|
3557
3558
|
}
|
|
3558
3559
|
)
|
|
@@ -3643,7 +3644,7 @@ const Lt = {
|
|
|
3643
3644
|
autoValue: "on_create"
|
|
3644
3645
|
}
|
|
3645
3646
|
})
|
|
3646
|
-
},
|
|
3647
|
+
}, qt = {
|
|
3647
3648
|
id: "blog",
|
|
3648
3649
|
path: "blog",
|
|
3649
3650
|
name: "Blog",
|
|
@@ -3755,7 +3756,7 @@ const Lt = {
|
|
|
3755
3756
|
initialFilter: {
|
|
3756
3757
|
status: ["==", "published"]
|
|
3757
3758
|
}
|
|
3758
|
-
},
|
|
3759
|
+
}, $t = {
|
|
3759
3760
|
id: "users",
|
|
3760
3761
|
path: "users",
|
|
3761
3762
|
name: "Users",
|
|
@@ -3987,34 +3988,34 @@ function Ji({
|
|
|
3987
3988
|
onContinue: i,
|
|
3988
3989
|
existingCollectionPaths: l
|
|
3989
3990
|
}) {
|
|
3990
|
-
const [o, d] =
|
|
3991
|
-
|
|
3991
|
+
const [o, d] = $(!1), [p, u] = $();
|
|
3992
|
+
ce(() => {
|
|
3992
3993
|
r && l && (d(!0), r(t).then((v) => {
|
|
3993
|
-
const
|
|
3994
|
-
|
|
3994
|
+
const x = v.filter((y) => !(l ?? []).find((C) => C.trim().toLowerCase() === y.trim().toLowerCase()));
|
|
3995
|
+
u(x);
|
|
3995
3996
|
}).finally(() => d(!1)));
|
|
3996
3997
|
}, [l, t, r]);
|
|
3997
3998
|
const {
|
|
3998
|
-
values:
|
|
3999
|
-
setFieldValue:
|
|
4000
|
-
setValues:
|
|
4001
|
-
submitCount:
|
|
3999
|
+
values: h,
|
|
4000
|
+
setFieldValue: m,
|
|
4001
|
+
setValues: c,
|
|
4002
|
+
submitCount: g
|
|
4002
4003
|
} = K();
|
|
4003
4004
|
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: [
|
|
4004
4005
|
/* @__PURE__ */ e(
|
|
4005
4006
|
"div",
|
|
4006
4007
|
{
|
|
4007
4008
|
className: "flex flex-row py-2 pt-3 items-center",
|
|
4008
|
-
children: /* @__PURE__ */ e(
|
|
4009
|
+
children: /* @__PURE__ */ e(k, { variant: "h4", className: "flex-grow", children: "New collection" })
|
|
4009
4010
|
}
|
|
4010
4011
|
),
|
|
4011
|
-
n && /* @__PURE__ */ e(st, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(
|
|
4012
|
+
n && /* @__PURE__ */ e(st, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(k, { variant: "caption", children: [
|
|
4012
4013
|
"This is a subcollection of ",
|
|
4013
4014
|
/* @__PURE__ */ e("b", { children: n.name })
|
|
4014
4015
|
] }) }),
|
|
4015
4016
|
/* @__PURE__ */ a("div", { className: "my-2", children: [
|
|
4016
4017
|
/* @__PURE__ */ e(
|
|
4017
|
-
|
|
4018
|
+
k,
|
|
4018
4019
|
{
|
|
4019
4020
|
variant: "caption",
|
|
4020
4021
|
color: "secondary",
|
|
@@ -4022,25 +4023,25 @@ function Ji({
|
|
|
4022
4023
|
}
|
|
4023
4024
|
),
|
|
4024
4025
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
|
|
4025
|
-
o && !
|
|
4026
|
-
|
|
4026
|
+
o && !p && /* @__PURE__ */ e(De, { size: "small" }),
|
|
4027
|
+
p?.map((v, x) => /* @__PURE__ */ e(
|
|
4027
4028
|
st,
|
|
4028
4029
|
{
|
|
4029
4030
|
colorScheme: "cyanLighter",
|
|
4030
4031
|
onClick: () => {
|
|
4031
|
-
|
|
4032
|
+
m("name", ut(v)), m("id", v), m("path", v), m("properties", void 0), i();
|
|
4032
4033
|
},
|
|
4033
4034
|
size: "small",
|
|
4034
4035
|
children: v
|
|
4035
4036
|
},
|
|
4036
4037
|
v
|
|
4037
4038
|
)),
|
|
4038
|
-
!o && (
|
|
4039
|
+
!o && (p ?? [])?.length === 0 && /* @__PURE__ */ e(k, { variant: "caption", children: "No suggestions" })
|
|
4039
4040
|
] })
|
|
4040
4041
|
] }),
|
|
4041
4042
|
/* @__PURE__ */ a("div", { className: "my-2", children: [
|
|
4042
4043
|
/* @__PURE__ */ e(
|
|
4043
|
-
|
|
4044
|
+
k,
|
|
4044
4045
|
{
|
|
4045
4046
|
variant: "caption",
|
|
4046
4047
|
color: "secondary",
|
|
@@ -4055,7 +4056,7 @@ function Ji({
|
|
|
4055
4056
|
subtitle: "A collection of products with images, prices and stock",
|
|
4056
4057
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Lt.icon }),
|
|
4057
4058
|
onClick: () => {
|
|
4058
|
-
|
|
4059
|
+
c(Lt), i();
|
|
4059
4060
|
}
|
|
4060
4061
|
}
|
|
4061
4062
|
),
|
|
@@ -4064,9 +4065,9 @@ function Ji({
|
|
|
4064
4065
|
{
|
|
4065
4066
|
title: "Users",
|
|
4066
4067
|
subtitle: "A collection of users with emails, names and roles",
|
|
4067
|
-
icon: /* @__PURE__ */ e(et, { size: "small", iconKey:
|
|
4068
|
+
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: $t.icon }),
|
|
4068
4069
|
onClick: () => {
|
|
4069
|
-
|
|
4070
|
+
c($t), i();
|
|
4070
4071
|
}
|
|
4071
4072
|
}
|
|
4072
4073
|
),
|
|
@@ -4075,9 +4076,9 @@ function Ji({
|
|
|
4075
4076
|
{
|
|
4076
4077
|
title: "Blog posts",
|
|
4077
4078
|
subtitle: "A collection of blog posts with images, authors and complex content",
|
|
4078
|
-
icon: /* @__PURE__ */ e(et, { size: "small", iconKey:
|
|
4079
|
+
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: qt.icon }),
|
|
4079
4080
|
onClick: () => {
|
|
4080
|
-
|
|
4081
|
+
c(qt), i();
|
|
4081
4082
|
}
|
|
4082
4083
|
}
|
|
4083
4084
|
),
|
|
@@ -4088,7 +4089,7 @@ function Ji({
|
|
|
4088
4089
|
subtitle: "A collection of pages with images, authors and complex content",
|
|
4089
4090
|
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Yt.icon }),
|
|
4090
4091
|
onClick: () => {
|
|
4091
|
-
|
|
4092
|
+
c(Yt), i();
|
|
4092
4093
|
}
|
|
4093
4094
|
}
|
|
4094
4095
|
)
|
|
@@ -4096,7 +4097,7 @@ function Ji({
|
|
|
4096
4097
|
] }),
|
|
4097
4098
|
!n && /* @__PURE__ */ a("div", { children: [
|
|
4098
4099
|
/* @__PURE__ */ e(
|
|
4099
|
-
|
|
4100
|
+
k,
|
|
4100
4101
|
{
|
|
4101
4102
|
variant: "caption",
|
|
4102
4103
|
color: "secondary",
|
|
@@ -4104,7 +4105,7 @@ function Ji({
|
|
|
4104
4105
|
children: "● Create a collection from a file (csv, json, xls, xslx...)"
|
|
4105
4106
|
}
|
|
4106
4107
|
),
|
|
4107
|
-
/* @__PURE__ */ e(
|
|
4108
|
+
/* @__PURE__ */ e(ci, { onDataAdded: (v) => i(v) })
|
|
4108
4109
|
] }),
|
|
4109
4110
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(z, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
|
|
4110
4111
|
] }) });
|
|
@@ -4119,7 +4120,7 @@ function nt({
|
|
|
4119
4120
|
tr,
|
|
4120
4121
|
{
|
|
4121
4122
|
onClick: i,
|
|
4122
|
-
className:
|
|
4123
|
+
className: me(
|
|
4123
4124
|
"my-2 rounded-md border mx-0 p-6 px-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center",
|
|
4124
4125
|
"text-gray-700 dark:text-gray-300",
|
|
4125
4126
|
"hover:border-primary-dark hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary",
|
|
@@ -4127,7 +4128,7 @@ function nt({
|
|
|
4127
4128
|
),
|
|
4128
4129
|
children: [
|
|
4129
4130
|
n,
|
|
4130
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col items-start", children: /* @__PURE__ */ e(
|
|
4131
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col items-start", children: /* @__PURE__ */ e(k, { variant: "subtitle1", children: t }) })
|
|
4131
4132
|
]
|
|
4132
4133
|
}
|
|
4133
4134
|
) });
|
|
@@ -4141,42 +4142,42 @@ function Qi({
|
|
|
4141
4142
|
setFieldValue: i,
|
|
4142
4143
|
setFieldTouched: l,
|
|
4143
4144
|
values: o
|
|
4144
|
-
} = K(), [d,
|
|
4145
|
+
} = K(), [d, p] = $(void 0), u = Y.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), h = d ? d.id : void 0, m = d || void 0, c = ({
|
|
4145
4146
|
id: v,
|
|
4146
|
-
property:
|
|
4147
|
+
property: x,
|
|
4147
4148
|
previousId: y,
|
|
4148
4149
|
namespace: C
|
|
4149
4150
|
}) => {
|
|
4150
|
-
const
|
|
4151
|
-
const
|
|
4152
|
-
i(
|
|
4151
|
+
const w = v ? ae(v, C) : void 0, b = w ? pe(w) : void 0, P = (f) => f ? u.current[f] ?? I(o, ye(f)) : u.current[""], O = (f, N) => {
|
|
4152
|
+
const _ = ye(N);
|
|
4153
|
+
i(_, f, !1), u.current[N ?? ""] = f;
|
|
4153
4154
|
};
|
|
4154
4155
|
if (y && y !== v) {
|
|
4155
|
-
const
|
|
4156
|
+
const f = ae(y, C), N = pe(f), R = P(C).map((B) => B === y ? v : B).filter((B) => B !== void 0);
|
|
4156
4157
|
O(R, C);
|
|
4157
4158
|
const M = { ...t.headersMapping };
|
|
4158
4159
|
Object.keys(M).forEach((B) => {
|
|
4159
4160
|
M[B] === y && (M[B] = v ?? "");
|
|
4160
4161
|
}), t.setHeadersMapping(M), i(N, void 0, !1), l(N, !1, !1);
|
|
4161
4162
|
}
|
|
4162
|
-
b && (i(b,
|
|
4163
|
-
},
|
|
4163
|
+
b && (i(b, x, !1), l(b, !0, !1));
|
|
4164
|
+
}, g = async ({
|
|
4164
4165
|
id: v,
|
|
4165
|
-
importKey:
|
|
4166
|
+
importKey: x,
|
|
4166
4167
|
property: y,
|
|
4167
4168
|
namespace: C
|
|
4168
4169
|
}) => {
|
|
4169
|
-
const
|
|
4170
|
+
const w = v ? ae(v, C) : void 0, b = w ? pe(w) : void 0, P = t.importData.map((f) => I(f, x)), O = {
|
|
4170
4171
|
...ti(P, y, rr),
|
|
4171
4172
|
editable: !0
|
|
4172
4173
|
};
|
|
4173
4174
|
b && (O ? i(b, O, !1) : i(b, y, !1), l(b, !0, !1));
|
|
4174
4175
|
};
|
|
4175
|
-
return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto
|
|
4176
|
+
return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
|
|
4176
4177
|
/* @__PURE__ */ a(mt, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
4177
|
-
/* @__PURE__ */ e(
|
|
4178
|
+
/* @__PURE__ */ e(k, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
|
|
4178
4179
|
/* @__PURE__ */ e(
|
|
4179
|
-
|
|
4180
|
+
di,
|
|
4180
4181
|
{
|
|
4181
4182
|
headersMapping: t.headersMapping,
|
|
4182
4183
|
idColumn: t.idColumn,
|
|
@@ -4185,18 +4186,18 @@ function Qi({
|
|
|
4185
4186
|
onIdPropertyChanged: (v) => t.setIdColumn(v),
|
|
4186
4187
|
buildPropertyView: ({
|
|
4187
4188
|
property: v,
|
|
4188
|
-
propertyKey:
|
|
4189
|
+
propertyKey: x,
|
|
4189
4190
|
importKey: y
|
|
4190
4191
|
}) => /* @__PURE__ */ e(
|
|
4191
4192
|
ui,
|
|
4192
4193
|
{
|
|
4193
4194
|
property: v,
|
|
4194
|
-
propertyKey:
|
|
4195
|
-
onPropertyNameChanged: (C,
|
|
4195
|
+
propertyKey: x,
|
|
4196
|
+
onPropertyNameChanged: (C, w) => i(`properties.${C}.name`, w, !1),
|
|
4196
4197
|
onEditClick: () => {
|
|
4197
|
-
!
|
|
4198
|
+
!x || !v || p({
|
|
4198
4199
|
...v,
|
|
4199
|
-
id:
|
|
4200
|
+
id: x,
|
|
4200
4201
|
editable: !0
|
|
4201
4202
|
});
|
|
4202
4203
|
},
|
|
@@ -4205,11 +4206,11 @@ function Qi({
|
|
|
4205
4206
|
{
|
|
4206
4207
|
property: v,
|
|
4207
4208
|
disabled: !1,
|
|
4208
|
-
onPropertyChanged: (C) =>
|
|
4209
|
+
onPropertyChanged: (C) => g({
|
|
4209
4210
|
...C,
|
|
4210
4211
|
importKey: y
|
|
4211
4212
|
}),
|
|
4212
|
-
propertyKey:
|
|
4213
|
+
propertyKey: x,
|
|
4213
4214
|
propertyConfigs: r
|
|
4214
4215
|
}
|
|
4215
4216
|
)
|
|
@@ -4222,18 +4223,18 @@ function Qi({
|
|
|
4222
4223
|
Ve,
|
|
4223
4224
|
{
|
|
4224
4225
|
open: d !== void 0,
|
|
4225
|
-
propertyKey:
|
|
4226
|
-
property:
|
|
4226
|
+
propertyKey: h,
|
|
4227
|
+
property: m,
|
|
4227
4228
|
inArray: !1,
|
|
4228
4229
|
autoUpdateId: !1,
|
|
4229
|
-
onPropertyChanged:
|
|
4230
|
+
onPropertyChanged: c,
|
|
4230
4231
|
allowDataInference: !1,
|
|
4231
4232
|
collectionEditable: n,
|
|
4232
4233
|
onOkClicked: () => {
|
|
4233
|
-
|
|
4234
|
+
p(void 0);
|
|
4234
4235
|
},
|
|
4235
4236
|
onCancel: () => {
|
|
4236
|
-
|
|
4237
|
+
p(void 0);
|
|
4237
4238
|
},
|
|
4238
4239
|
autoOpenTypeSelect: !1,
|
|
4239
4240
|
existingProperty: !1,
|
|
@@ -4250,17 +4251,17 @@ function Xi({
|
|
|
4250
4251
|
propertyConfigs: i,
|
|
4251
4252
|
disabled: l
|
|
4252
4253
|
}) {
|
|
4253
|
-
const o = t ?
|
|
4254
|
+
const o = t ? Kt(t) : null, d = t ? $e(t, i) : null, [p, u] = $(!1);
|
|
4254
4255
|
return /* @__PURE__ */ e(
|
|
4255
4256
|
te,
|
|
4256
4257
|
{
|
|
4257
4258
|
title: t && d ? `${d?.name} - ${t.dataType}` : void 0,
|
|
4258
|
-
open:
|
|
4259
|
+
open: p ? !1 : void 0,
|
|
4259
4260
|
children: /* @__PURE__ */ e(
|
|
4260
4261
|
be,
|
|
4261
4262
|
{
|
|
4262
|
-
open:
|
|
4263
|
-
onOpenChange:
|
|
4263
|
+
open: p,
|
|
4264
|
+
onOpenChange: u,
|
|
4264
4265
|
invisible: !0,
|
|
4265
4266
|
className: "w-full",
|
|
4266
4267
|
disabled: l,
|
|
@@ -4268,25 +4269,25 @@ function Xi({
|
|
|
4268
4269
|
value: o ?? "",
|
|
4269
4270
|
placeholder: "Select a property widget",
|
|
4270
4271
|
position: "item-aligned",
|
|
4271
|
-
renderValue: (
|
|
4272
|
-
onValueChange: (
|
|
4273
|
-
const
|
|
4272
|
+
renderValue: (h) => d ? /* @__PURE__ */ e(Ye, { propertyConfig: d }) : null,
|
|
4273
|
+
onValueChange: (h) => {
|
|
4274
|
+
const m = ar(t, h, i);
|
|
4274
4275
|
n && r({
|
|
4275
4276
|
id: n,
|
|
4276
|
-
property:
|
|
4277
|
+
property: m,
|
|
4277
4278
|
previousId: n,
|
|
4278
4279
|
namespace: void 0
|
|
4279
4280
|
});
|
|
4280
4281
|
},
|
|
4281
|
-
children: Object.entries(lr).map(([
|
|
4282
|
+
children: Object.entries(lr).map(([h, m]) => /* @__PURE__ */ e(
|
|
4282
4283
|
or,
|
|
4283
4284
|
{
|
|
4284
|
-
value:
|
|
4285
|
+
value: h,
|
|
4285
4286
|
optionDisabled: !1,
|
|
4286
|
-
propertyConfig:
|
|
4287
|
+
propertyConfig: m,
|
|
4287
4288
|
existing: !1
|
|
4288
4289
|
},
|
|
4289
|
-
|
|
4290
|
+
h
|
|
4290
4291
|
))
|
|
4291
4292
|
}
|
|
4292
4293
|
)
|
|
@@ -4294,17 +4295,17 @@ function Xi({
|
|
|
4294
4295
|
);
|
|
4295
4296
|
}
|
|
4296
4297
|
function en({ importConfig: t, properties: r, propertiesOrder: n }) {
|
|
4297
|
-
|
|
4298
|
+
ce(() => {
|
|
4298
4299
|
const l = pi(t.originProperties, r), o = t.importData.map((d) => mi(d, t.idColumn, t.headersMapping, r, l, "TEMP_PATH"));
|
|
4299
4300
|
t.setEntities(o);
|
|
4300
4301
|
}, []);
|
|
4301
|
-
const i =
|
|
4302
|
+
const i = wr();
|
|
4302
4303
|
return /* @__PURE__ */ e(
|
|
4303
|
-
|
|
4304
|
+
Tr,
|
|
4304
4305
|
{
|
|
4305
4306
|
title: /* @__PURE__ */ a("div", { children: [
|
|
4306
|
-
/* @__PURE__ */ e(
|
|
4307
|
-
/* @__PURE__ */ e(
|
|
4307
|
+
/* @__PURE__ */ e(k, { variant: "subtitle2", children: "Imported data preview" }),
|
|
4308
|
+
/* @__PURE__ */ e(k, { variant: "caption", children: "Entities with the same id will be overwritten" })
|
|
4308
4309
|
] }),
|
|
4309
4310
|
tableController: {
|
|
4310
4311
|
data: t.entities,
|
|
@@ -4320,30 +4321,30 @@ function en({ importConfig: t, properties: r, propertiesOrder: n }) {
|
|
|
4320
4321
|
}
|
|
4321
4322
|
);
|
|
4322
4323
|
}
|
|
4323
|
-
function
|
|
4324
|
+
function dr(t, r = "") {
|
|
4324
4325
|
const n = Object.keys(t).reduce((o, d) => {
|
|
4325
|
-
const
|
|
4326
|
-
if (
|
|
4327
|
-
const
|
|
4326
|
+
const p = t[d], u = kr(d), h = r ? `${r}.${u}` : u;
|
|
4327
|
+
if (p.dataType === "map" && p.properties) {
|
|
4328
|
+
const g = dr(p.properties, h);
|
|
4328
4329
|
return {
|
|
4329
|
-
headersMapping: { ...o.headersMapping, [d]:
|
|
4330
|
+
headersMapping: { ...o.headersMapping, [d]: h },
|
|
4330
4331
|
properties: {
|
|
4331
4332
|
...o.properties,
|
|
4332
|
-
[
|
|
4333
|
-
...
|
|
4334
|
-
properties:
|
|
4335
|
-
propertiesOrder: Object.keys(
|
|
4333
|
+
[u]: {
|
|
4334
|
+
...p,
|
|
4335
|
+
properties: g.properties,
|
|
4336
|
+
propertiesOrder: Object.keys(g.properties)
|
|
4336
4337
|
}
|
|
4337
4338
|
}
|
|
4338
4339
|
};
|
|
4339
4340
|
}
|
|
4340
|
-
const
|
|
4341
|
+
const m = {
|
|
4341
4342
|
...o.properties,
|
|
4342
|
-
[
|
|
4343
|
+
[u]: p
|
|
4343
4344
|
};
|
|
4344
4345
|
return {
|
|
4345
|
-
headersMapping: { ...o.headersMapping, [d]:
|
|
4346
|
-
properties:
|
|
4346
|
+
headersMapping: { ...o.headersMapping, [d]: h },
|
|
4347
|
+
properties: m
|
|
4347
4348
|
};
|
|
4348
4349
|
}, { headersMapping: {}, properties: {} }), i = Object.keys(n.headersMapping)?.[0];
|
|
4349
4350
|
let l;
|
|
@@ -4353,20 +4354,20 @@ function cr(t, r = "") {
|
|
|
4353
4354
|
};
|
|
4354
4355
|
}
|
|
4355
4356
|
function ur(t) {
|
|
4356
|
-
const r = t.open, [n, i] =
|
|
4357
|
+
const r = t.open, [n, i] = je.useState(!1), [l, o] = je.useState(!1), d = Z(() => {
|
|
4357
4358
|
n ? o(!0) : t.handleClose(void 0);
|
|
4358
4359
|
}, [n, t.handleClose]);
|
|
4359
|
-
return
|
|
4360
|
+
return ce(() => {
|
|
4360
4361
|
r || (i(!1), o(!1));
|
|
4361
4362
|
}, [r]), /* @__PURE__ */ a(
|
|
4362
|
-
|
|
4363
|
+
Fe,
|
|
4363
4364
|
{
|
|
4364
4365
|
open: r,
|
|
4365
4366
|
fullWidth: !0,
|
|
4366
4367
|
fullHeight: !0,
|
|
4367
4368
|
scrollable: !1,
|
|
4368
4369
|
maxWidth: "7xl",
|
|
4369
|
-
onOpenChange: (
|
|
4370
|
+
onOpenChange: (p) => p ? void 0 : d(),
|
|
4370
4371
|
children: [
|
|
4371
4372
|
r && /* @__PURE__ */ e(
|
|
4372
4373
|
tn,
|
|
@@ -4390,13 +4391,13 @@ function ur(t) {
|
|
|
4390
4391
|
);
|
|
4391
4392
|
}
|
|
4392
4393
|
function tn(t) {
|
|
4393
|
-
const { propertyConfigs: r } =
|
|
4394
|
+
const { propertyConfigs: r } = Ae(), n = Pe(), i = _e(), {
|
|
4394
4395
|
topLevelNavigation: l,
|
|
4395
4396
|
collections: o
|
|
4396
|
-
} = n, d = t.initialValues,
|
|
4397
|
-
if (
|
|
4397
|
+
} = 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);
|
|
4398
|
+
if (ce(() => {
|
|
4398
4399
|
try {
|
|
4399
|
-
n.initialised && (t.editedCollectionId ?
|
|
4400
|
+
n.initialised && (t.editedCollectionId ? g(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : g(void 0), x(!0));
|
|
4400
4401
|
} catch (b) {
|
|
4401
4402
|
console.error(b);
|
|
4402
4403
|
}
|
|
@@ -4404,10 +4405,10 @@ function tn(t) {
|
|
|
4404
4405
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
4405
4406
|
const {
|
|
4406
4407
|
groups: y
|
|
4407
|
-
} = l, C =
|
|
4408
|
-
...
|
|
4409
|
-
id:
|
|
4410
|
-
} : void 0,
|
|
4408
|
+
} = l, C = c ? {
|
|
4409
|
+
...c,
|
|
4410
|
+
id: c.id ?? c.path ?? _t(16)
|
|
4411
|
+
} : void 0, w = C ? nn(C, r) : {
|
|
4411
4412
|
id: d?.path ?? _t(16),
|
|
4412
4413
|
path: d?.path ?? "",
|
|
4413
4414
|
name: d?.name ?? "",
|
|
@@ -4421,12 +4422,12 @@ function tn(t) {
|
|
|
4421
4422
|
rn,
|
|
4422
4423
|
{
|
|
4423
4424
|
...t,
|
|
4424
|
-
initialValues:
|
|
4425
|
-
existingPaths:
|
|
4426
|
-
existingIds:
|
|
4427
|
-
includeTemplates:
|
|
4428
|
-
collection:
|
|
4429
|
-
setCollection:
|
|
4425
|
+
initialValues: w,
|
|
4426
|
+
existingPaths: h,
|
|
4427
|
+
existingIds: m,
|
|
4428
|
+
includeTemplates: p,
|
|
4429
|
+
collection: c,
|
|
4430
|
+
setCollection: g,
|
|
4430
4431
|
groups: y,
|
|
4431
4432
|
propertyConfigs: r
|
|
4432
4433
|
}
|
|
@@ -4440,28 +4441,30 @@ function rn({
|
|
|
4440
4441
|
fullPath: l,
|
|
4441
4442
|
collectionInference: o,
|
|
4442
4443
|
handleClose: d,
|
|
4443
|
-
reservedGroups:
|
|
4444
|
-
extraView:
|
|
4445
|
-
handleCancel:
|
|
4446
|
-
setFormDirty:
|
|
4447
|
-
pathSuggestions:
|
|
4448
|
-
getUser:
|
|
4444
|
+
reservedGroups: p,
|
|
4445
|
+
extraView: u,
|
|
4446
|
+
handleCancel: h,
|
|
4447
|
+
setFormDirty: m,
|
|
4448
|
+
pathSuggestions: c,
|
|
4449
|
+
getUser: g,
|
|
4449
4450
|
parentCollection: v,
|
|
4450
|
-
getData:
|
|
4451
|
+
getData: x,
|
|
4451
4452
|
existingPaths: y,
|
|
4452
4453
|
existingIds: C,
|
|
4453
|
-
includeTemplates:
|
|
4454
|
+
includeTemplates: w,
|
|
4454
4455
|
collection: b,
|
|
4455
4456
|
setCollection: P,
|
|
4456
4457
|
initialValues: O,
|
|
4457
|
-
propertyConfigs:
|
|
4458
|
+
propertyConfigs: f,
|
|
4458
4459
|
groups: N
|
|
4459
4460
|
}) {
|
|
4460
|
-
const
|
|
4461
|
-
|
|
4461
|
+
const _ = hi(), R = Pe(), M = Ie();
|
|
4462
|
+
console.log({ importConfig: _ });
|
|
4463
|
+
const B = Le({}), S = t ? w ? "welcome" : "details" : "properties", [s, V] = $(S), [G, D] = je.useState(), q = (T) => {
|
|
4464
|
+
const E = T.id || T.path;
|
|
4462
4465
|
return r.saveCollection({
|
|
4463
4466
|
id: E,
|
|
4464
|
-
collectionData:
|
|
4467
|
+
collectionData: T,
|
|
4465
4468
|
previousId: n,
|
|
4466
4469
|
parentCollectionIds: i
|
|
4467
4470
|
}).then(() => (D(void 0), !0)).catch((A) => (D(A), console.error(A), M.open({
|
|
@@ -4469,45 +4472,45 @@ function rn({
|
|
|
4469
4472
|
message: "Error persisting collection: " + (A.message ?? "Details in the console")
|
|
4470
4473
|
}), !1));
|
|
4471
4474
|
}, L = Z(() => {
|
|
4472
|
-
|
|
4473
|
-
}, [
|
|
4475
|
+
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");
|
|
4476
|
+
}, [s, _.inUse, u]), Q = Z((T) => {
|
|
4474
4477
|
if (o)
|
|
4475
|
-
return o?.(
|
|
4476
|
-
}, [o, i]), le = Z(async (
|
|
4478
|
+
return o?.(T.path, T.collectionGroup ?? !1, i ?? []);
|
|
4479
|
+
}, [o, i]), le = Z(async (T) => {
|
|
4477
4480
|
try {
|
|
4478
4481
|
if (!Q)
|
|
4479
|
-
return P(
|
|
4480
|
-
|
|
4481
|
-
const E = await Q?.(
|
|
4482
|
+
return P(T), Promise.resolve(T);
|
|
4483
|
+
V("loading");
|
|
4484
|
+
const E = await Q?.(T);
|
|
4482
4485
|
if (!E)
|
|
4483
|
-
return P(
|
|
4486
|
+
return P(T), Promise.resolve(T);
|
|
4484
4487
|
const A = {
|
|
4485
|
-
...
|
|
4488
|
+
...T ?? {}
|
|
4486
4489
|
};
|
|
4487
4490
|
return Object.keys(E.properties ?? {}).length > 0 && (A.properties = E.properties, A.propertiesOrder = E.propertiesOrder), A.propertiesOrder ? (P(A), console.debug("Inferred collection", {
|
|
4488
|
-
newCollection:
|
|
4491
|
+
newCollection: T ?? {},
|
|
4489
4492
|
values: A
|
|
4490
4493
|
}), A) : (A.propertiesOrder = Object.keys(A.properties), A);
|
|
4491
4494
|
} catch (E) {
|
|
4492
4495
|
return console.error(E), M.open({
|
|
4493
4496
|
type: "error",
|
|
4494
4497
|
message: "Error inferring collection: " + (E.message ?? "Details in the console")
|
|
4495
|
-
}),
|
|
4498
|
+
}), T;
|
|
4496
4499
|
}
|
|
4497
|
-
}, [i, Q]),
|
|
4500
|
+
}, [i, Q]), de = Tt({
|
|
4498
4501
|
initialValues: O,
|
|
4499
|
-
onSubmit: (
|
|
4500
|
-
console.log("Submitting collection",
|
|
4502
|
+
onSubmit: (T, E) => {
|
|
4503
|
+
console.log("Submitting collection", T);
|
|
4501
4504
|
try {
|
|
4502
4505
|
if (!t) {
|
|
4503
|
-
|
|
4504
|
-
E.resetForm({ values: O }), d(
|
|
4506
|
+
q(T).then(() => {
|
|
4507
|
+
E.resetForm({ values: O }), d(T);
|
|
4505
4508
|
});
|
|
4506
4509
|
return;
|
|
4507
4510
|
}
|
|
4508
|
-
|
|
4511
|
+
s === "welcome" ? (L(), E.resetForm({ values: T })) : s === "details" ? u || _.inUse ? (E.resetForm({ values: T }), L()) : t ? le(T).then((A) => {
|
|
4509
4512
|
E.resetForm({
|
|
4510
|
-
values: A ??
|
|
4513
|
+
values: A ?? T,
|
|
4511
4514
|
touched: {
|
|
4512
4515
|
path: !0,
|
|
4513
4516
|
name: !0
|
|
@@ -4515,31 +4518,31 @@ function rn({
|
|
|
4515
4518
|
});
|
|
4516
4519
|
}).finally(() => {
|
|
4517
4520
|
L();
|
|
4518
|
-
}) : (E.resetForm({ values:
|
|
4519
|
-
E.resetForm({ values: O }), L(), d(
|
|
4520
|
-
}) : (L(), E.resetForm({ values:
|
|
4521
|
+
}) : (E.resetForm({ values: T }), L()) : s === "extra_view" ? (L(), E.resetForm({ values: T })) : s === "import_data_mapping" || s === "import_data_preview" ? L() : s === "properties" ? q(T).then(() => {
|
|
4522
|
+
E.resetForm({ values: O }), L(), d(T);
|
|
4523
|
+
}) : (L(), E.resetForm({ values: T }));
|
|
4521
4524
|
} catch (A) {
|
|
4522
4525
|
M.open({
|
|
4523
4526
|
type: "error",
|
|
4524
4527
|
message: "Error persisting collection: " + (A.message ?? "Details in the console")
|
|
4525
|
-
}), console.error(A), E.resetForm({ values:
|
|
4528
|
+
}), console.error(A), E.resetForm({ values: T });
|
|
4526
4529
|
}
|
|
4527
4530
|
},
|
|
4528
|
-
validation: (
|
|
4531
|
+
validation: (T) => {
|
|
4529
4532
|
let E = {};
|
|
4530
|
-
const A = (
|
|
4533
|
+
const A = (s === "properties" || s === "subcollections" || s === "details") && vi;
|
|
4531
4534
|
if (A)
|
|
4532
4535
|
try {
|
|
4533
|
-
A.validateSync(
|
|
4536
|
+
A.validateSync(T, { abortEarly: !1 });
|
|
4534
4537
|
} catch (ie) {
|
|
4535
4538
|
ie.inner.forEach((ke) => {
|
|
4536
4539
|
E[ke.path] = ke.message;
|
|
4537
4540
|
});
|
|
4538
4541
|
}
|
|
4539
|
-
if (
|
|
4540
|
-
const ie = Ht(
|
|
4542
|
+
if (s === "properties" && (E = { ...E, ...B.current }), s === "details") {
|
|
4543
|
+
const ie = Ht(T.path, t, y, T.id);
|
|
4541
4544
|
ie && (E.path = ie);
|
|
4542
|
-
const ke = an(
|
|
4545
|
+
const ke = an(T.id, t, y, C);
|
|
4543
4546
|
ke && (E.id = ke);
|
|
4544
4547
|
}
|
|
4545
4548
|
return E;
|
|
@@ -4550,27 +4553,27 @@ function rn({
|
|
|
4550
4553
|
isSubmitting: Te,
|
|
4551
4554
|
dirty: Ge,
|
|
4552
4555
|
submitCount: gt
|
|
4553
|
-
} =
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
+
} = de, fe = re.path ?? n, Ke = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + fe : fe, We = Ht(fe, t, y, re.id), Ze = !We && i ? R.convertIdsToPaths(i) : void 0, Je = We ? void 0 : R.resolveAliasesFrom(Ke), Re = Je && x ? () => x(Je, Ze ?? []) : void 0;
|
|
4557
|
+
ce(() => {
|
|
4558
|
+
m(Ge);
|
|
4556
4559
|
}, [Ge]);
|
|
4557
|
-
function Qe(
|
|
4558
|
-
|
|
4559
|
-
const A =
|
|
4560
|
-
he("properties", A.properties), he("propertiesOrder", Object.keys(A.properties)),
|
|
4560
|
+
function Qe(T) {
|
|
4561
|
+
_.setInUse(!0), ri(T, rr).then((E) => {
|
|
4562
|
+
const A = dr(E);
|
|
4563
|
+
he("properties", A.properties), he("propertiesOrder", Object.keys(A.properties)), _.setIdColumn(A.idColumn), _.setImportData(T), _.setHeadersMapping(A.headersMapping), _.setOriginProperties(A.properties);
|
|
4561
4564
|
});
|
|
4562
4565
|
}
|
|
4563
4566
|
const vt = !!re.name && !!re.id, yt = () => {
|
|
4564
|
-
const
|
|
4565
|
-
|
|
4566
|
-
},
|
|
4567
|
-
return /* @__PURE__ */ e(
|
|
4567
|
+
const T = { ...re.properties };
|
|
4568
|
+
_.idColumn && delete T[_.idColumn], he("properties", T), L();
|
|
4569
|
+
}, j = b?.editable === void 0 || b?.editable === !0 || t;
|
|
4570
|
+
return /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(kt, { value: de, children: /* @__PURE__ */ a(U, { children: [
|
|
4568
4571
|
!t && /* @__PURE__ */ a(
|
|
4569
4572
|
Hr,
|
|
4570
4573
|
{
|
|
4571
|
-
value:
|
|
4572
|
-
className:
|
|
4573
|
-
onValueChange: (
|
|
4574
|
+
value: s,
|
|
4575
|
+
className: me(wt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
4576
|
+
onValueChange: (T) => V(T),
|
|
4574
4577
|
children: [
|
|
4575
4578
|
/* @__PURE__ */ e(Ct, { value: "details", children: "Details" }),
|
|
4576
4579
|
/* @__PURE__ */ e(Ct, { value: "properties", children: "Properties" }),
|
|
@@ -4582,56 +4585,56 @@ function rn({
|
|
|
4582
4585
|
"form",
|
|
4583
4586
|
{
|
|
4584
4587
|
noValidate: !0,
|
|
4585
|
-
onSubmit:
|
|
4586
|
-
className:
|
|
4588
|
+
onSubmit: de.handleSubmit,
|
|
4589
|
+
className: me(
|
|
4587
4590
|
t ? "h-full" : "h-[calc(100%-48px)]",
|
|
4588
4591
|
"flex-grow flex flex-col relative"
|
|
4589
4592
|
),
|
|
4590
4593
|
children: [
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
+
s === "loading" && /* @__PURE__ */ e(Nt, {}),
|
|
4595
|
+
s === "extra_view" && fe && u?.View && /* @__PURE__ */ e(u.View, { path: fe }),
|
|
4596
|
+
s === "welcome" && /* @__PURE__ */ e(
|
|
4594
4597
|
Ji,
|
|
4595
4598
|
{
|
|
4596
4599
|
path: fe,
|
|
4597
|
-
onContinue: (
|
|
4598
|
-
|
|
4600
|
+
onContinue: (T) => {
|
|
4601
|
+
T ? (Qe(T), V("import_data_mapping")) : V("details");
|
|
4599
4602
|
},
|
|
4600
4603
|
existingCollectionPaths: y,
|
|
4601
4604
|
parentCollection: v,
|
|
4602
|
-
pathSuggestions:
|
|
4605
|
+
pathSuggestions: c
|
|
4603
4606
|
}
|
|
4604
4607
|
),
|
|
4605
|
-
|
|
4608
|
+
s === "import_data_mapping" && _ && /* @__PURE__ */ e(
|
|
4606
4609
|
Qi,
|
|
4607
4610
|
{
|
|
4608
|
-
importConfig:
|
|
4609
|
-
collectionEditable:
|
|
4610
|
-
propertyConfigs:
|
|
4611
|
+
importConfig: _,
|
|
4612
|
+
collectionEditable: j,
|
|
4613
|
+
propertyConfigs: f
|
|
4611
4614
|
}
|
|
4612
4615
|
),
|
|
4613
|
-
|
|
4616
|
+
s === "import_data_preview" && _ && /* @__PURE__ */ e(
|
|
4614
4617
|
en,
|
|
4615
4618
|
{
|
|
4616
|
-
importConfig:
|
|
4619
|
+
importConfig: _,
|
|
4617
4620
|
properties: re.properties,
|
|
4618
4621
|
propertiesOrder: re.propertiesOrder
|
|
4619
4622
|
}
|
|
4620
4623
|
),
|
|
4621
|
-
|
|
4624
|
+
s === "import_data_saving" && _ && /* @__PURE__ */ e(
|
|
4622
4625
|
fi,
|
|
4623
4626
|
{
|
|
4624
|
-
importConfig:
|
|
4627
|
+
importConfig: _,
|
|
4625
4628
|
collection: re,
|
|
4626
|
-
onImportSuccess: (
|
|
4627
|
-
|
|
4629
|
+
onImportSuccess: async (T) => {
|
|
4630
|
+
M.open({
|
|
4628
4631
|
type: "info",
|
|
4629
4632
|
message: "Data imported successfully"
|
|
4630
|
-
});
|
|
4633
|
+
}), await q(re), d(T);
|
|
4631
4634
|
}
|
|
4632
4635
|
}
|
|
4633
4636
|
),
|
|
4634
|
-
|
|
4637
|
+
s === "details" && /* @__PURE__ */ e(
|
|
4635
4638
|
yi,
|
|
4636
4639
|
{
|
|
4637
4640
|
existingPaths: y,
|
|
@@ -4642,70 +4645,70 @@ function rn({
|
|
|
4642
4645
|
isNewCollection: t
|
|
4643
4646
|
}
|
|
4644
4647
|
),
|
|
4645
|
-
|
|
4648
|
+
s === "subcollections" && b && /* @__PURE__ */ e(
|
|
4646
4649
|
Zi,
|
|
4647
4650
|
{
|
|
4648
4651
|
parentCollection: v,
|
|
4649
4652
|
configController: r,
|
|
4650
|
-
getUser:
|
|
4653
|
+
getUser: g,
|
|
4651
4654
|
collectionInference: o,
|
|
4652
4655
|
parentCollectionIds: i,
|
|
4653
4656
|
collection: b
|
|
4654
4657
|
}
|
|
4655
4658
|
),
|
|
4656
|
-
|
|
4659
|
+
s === "properties" && /* @__PURE__ */ e(
|
|
4657
4660
|
Gi,
|
|
4658
4661
|
{
|
|
4659
4662
|
showErrors: gt > 0,
|
|
4660
4663
|
isNewCollection: t,
|
|
4661
|
-
reservedGroups:
|
|
4662
|
-
onPropertyError: (
|
|
4664
|
+
reservedGroups: p,
|
|
4665
|
+
onPropertyError: (T, E, A) => {
|
|
4663
4666
|
const ie = Ft({
|
|
4664
4667
|
...B.current,
|
|
4665
|
-
[ir(
|
|
4668
|
+
[ir(T, E)]: Ft(A, !0)
|
|
4666
4669
|
}, !0);
|
|
4667
|
-
B.current = ie,
|
|
4670
|
+
B.current = ie, de.validate();
|
|
4668
4671
|
},
|
|
4669
|
-
getUser:
|
|
4670
|
-
getData:
|
|
4672
|
+
getUser: g,
|
|
4673
|
+
getData: Re,
|
|
4671
4674
|
doCollectionInference: Q,
|
|
4672
|
-
propertyConfigs:
|
|
4673
|
-
collectionEditable:
|
|
4674
|
-
extraIcon:
|
|
4675
|
+
propertyConfigs: f,
|
|
4676
|
+
collectionEditable: j,
|
|
4677
|
+
extraIcon: u?.icon && /* @__PURE__ */ e(
|
|
4675
4678
|
oe,
|
|
4676
4679
|
{
|
|
4677
4680
|
color: "primary",
|
|
4678
|
-
onClick: () =>
|
|
4679
|
-
children:
|
|
4681
|
+
onClick: () => V("extra_view"),
|
|
4682
|
+
children: u.icon
|
|
4680
4683
|
}
|
|
4681
4684
|
)
|
|
4682
4685
|
}
|
|
4683
4686
|
),
|
|
4684
|
-
|
|
4685
|
-
|
|
4687
|
+
s !== "welcome" && /* @__PURE__ */ a(
|
|
4688
|
+
ze,
|
|
4686
4689
|
{
|
|
4687
4690
|
position: "absolute",
|
|
4688
4691
|
children: [
|
|
4689
|
-
G && /* @__PURE__ */ e(
|
|
4690
|
-
t &&
|
|
4692
|
+
G && /* @__PURE__ */ e(Wt, { error: G }),
|
|
4693
|
+
t && w && s === "import_data_mapping" && /* @__PURE__ */ a(
|
|
4691
4694
|
z,
|
|
4692
4695
|
{
|
|
4693
4696
|
variant: "text",
|
|
4694
4697
|
type: "button",
|
|
4695
|
-
onClick: () => (
|
|
4698
|
+
onClick: () => (_.setInUse(!1), V("welcome")),
|
|
4696
4699
|
children: [
|
|
4697
4700
|
/* @__PURE__ */ e(tt, {}),
|
|
4698
4701
|
"Back"
|
|
4699
4702
|
]
|
|
4700
4703
|
}
|
|
4701
4704
|
),
|
|
4702
|
-
t &&
|
|
4705
|
+
t && w && s === "import_data_preview" && /* @__PURE__ */ a(
|
|
4703
4706
|
z,
|
|
4704
4707
|
{
|
|
4705
4708
|
variant: "text",
|
|
4706
4709
|
type: "button",
|
|
4707
4710
|
onClick: () => {
|
|
4708
|
-
|
|
4711
|
+
V("import_data_mapping");
|
|
4709
4712
|
},
|
|
4710
4713
|
children: [
|
|
4711
4714
|
/* @__PURE__ */ e(tt, {}),
|
|
@@ -4713,24 +4716,24 @@ function rn({
|
|
|
4713
4716
|
]
|
|
4714
4717
|
}
|
|
4715
4718
|
),
|
|
4716
|
-
t &&
|
|
4719
|
+
t && w && s === "details" && /* @__PURE__ */ a(
|
|
4717
4720
|
z,
|
|
4718
4721
|
{
|
|
4719
4722
|
variant: "text",
|
|
4720
4723
|
type: "button",
|
|
4721
|
-
onClick: () =>
|
|
4724
|
+
onClick: () => V("welcome"),
|
|
4722
4725
|
children: [
|
|
4723
4726
|
/* @__PURE__ */ e(tt, {}),
|
|
4724
4727
|
"Back"
|
|
4725
4728
|
]
|
|
4726
4729
|
}
|
|
4727
4730
|
),
|
|
4728
|
-
t &&
|
|
4731
|
+
t && s === "properties" && /* @__PURE__ */ a(
|
|
4729
4732
|
z,
|
|
4730
4733
|
{
|
|
4731
4734
|
variant: "text",
|
|
4732
4735
|
type: "button",
|
|
4733
|
-
onClick: () =>
|
|
4736
|
+
onClick: () => V("details"),
|
|
4734
4737
|
children: [
|
|
4735
4738
|
/* @__PURE__ */ e(tt, {}),
|
|
4736
4739
|
"Back"
|
|
@@ -4742,12 +4745,12 @@ function rn({
|
|
|
4742
4745
|
{
|
|
4743
4746
|
variant: "text",
|
|
4744
4747
|
onClick: () => {
|
|
4745
|
-
|
|
4748
|
+
h();
|
|
4746
4749
|
},
|
|
4747
4750
|
children: "Cancel"
|
|
4748
4751
|
}
|
|
4749
4752
|
),
|
|
4750
|
-
t &&
|
|
4753
|
+
t && s === "import_data_mapping" && /* @__PURE__ */ e(
|
|
4751
4754
|
z,
|
|
4752
4755
|
{
|
|
4753
4756
|
variant: "filled",
|
|
@@ -4756,7 +4759,7 @@ function rn({
|
|
|
4756
4759
|
children: "Next"
|
|
4757
4760
|
}
|
|
4758
4761
|
),
|
|
4759
|
-
t &&
|
|
4762
|
+
t && s === "import_data_preview" && /* @__PURE__ */ e(
|
|
4760
4763
|
z,
|
|
4761
4764
|
{
|
|
4762
4765
|
variant: "filled",
|
|
@@ -4767,18 +4770,18 @@ function rn({
|
|
|
4767
4770
|
children: "Next"
|
|
4768
4771
|
}
|
|
4769
4772
|
),
|
|
4770
|
-
t && (
|
|
4773
|
+
t && (s === "details" || s === "properties") && /* @__PURE__ */ a(
|
|
4771
4774
|
Mt,
|
|
4772
4775
|
{
|
|
4773
4776
|
variant: "filled",
|
|
4774
4777
|
color: "primary",
|
|
4775
4778
|
type: "submit",
|
|
4776
4779
|
loading: Te,
|
|
4777
|
-
disabled: Te ||
|
|
4778
|
-
startIcon:
|
|
4780
|
+
disabled: Te || s === "details" && !vt,
|
|
4781
|
+
startIcon: s === "properties" ? /* @__PURE__ */ e(Gr, {}) : void 0,
|
|
4779
4782
|
children: [
|
|
4780
|
-
|
|
4781
|
-
|
|
4783
|
+
s === "details" && "Next",
|
|
4784
|
+
s === "properties" && "Create collection"
|
|
4782
4785
|
]
|
|
4783
4786
|
}
|
|
4784
4787
|
),
|
|
@@ -4823,7 +4826,7 @@ function pr(t, r) {
|
|
|
4823
4826
|
}
|
|
4824
4827
|
const Ht = (t, r, n, i) => {
|
|
4825
4828
|
let l;
|
|
4826
|
-
return t || (l = "You must specify a path in the database for this collection"), r && n?.includes(t.trim().toLowerCase()) && !i && (l = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, make sure the have different ids"),
|
|
4829
|
+
return t || (l = "You must specify a path in the database for this collection"), r && n?.includes(t.trim().toLowerCase()) && !i && (l = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, make sure the have different ids"), Or(t).split("/").length % 2 === 0 && (l = `Collection paths must have an odd number of segments: ${t}`), l;
|
|
4827
4830
|
}, an = (t, r, n, i) => {
|
|
4828
4831
|
if (!t)
|
|
4829
4832
|
return;
|
|
@@ -4837,71 +4840,71 @@ const Ht = (t, r, n, i) => {
|
|
|
4837
4840
|
reservedGroups: l,
|
|
4838
4841
|
collectionInference: o,
|
|
4839
4842
|
extraView: d,
|
|
4840
|
-
pathSuggestions:
|
|
4841
|
-
getUser:
|
|
4842
|
-
getData:
|
|
4843
|
-
onAnalyticsEvent:
|
|
4843
|
+
pathSuggestions: p,
|
|
4844
|
+
getUser: u,
|
|
4845
|
+
getData: h,
|
|
4846
|
+
onAnalyticsEvent: m
|
|
4844
4847
|
}) {
|
|
4845
|
-
const
|
|
4848
|
+
const c = Pe(), g = gi(), v = Ie(), { propertyConfigs: x } = Ae(), {
|
|
4846
4849
|
collections: y
|
|
4847
|
-
} =
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
b(
|
|
4850
|
+
} = c, C = (y ?? []).map((s) => s.path.trim().toLowerCase()), [w, b] = Y.useState();
|
|
4851
|
+
ce(() => {
|
|
4852
|
+
p && p().then((s) => {
|
|
4853
|
+
b(s.filter((V) => !C.includes(V.trim().toLowerCase())));
|
|
4851
4854
|
});
|
|
4852
|
-
}, [
|
|
4853
|
-
const [P, O] = Y.useState(), [
|
|
4855
|
+
}, [p]);
|
|
4856
|
+
const [P, O] = Y.useState(), [f, N] = Y.useState(), _ = Z(() => ({
|
|
4854
4857
|
createCollections: !0,
|
|
4855
4858
|
editCollections: !0,
|
|
4856
4859
|
deleteCollections: !0
|
|
4857
4860
|
}), []), R = Z(({
|
|
4858
|
-
id:
|
|
4859
|
-
fullPath:
|
|
4861
|
+
id: s,
|
|
4862
|
+
fullPath: V,
|
|
4860
4863
|
parentCollectionIds: G,
|
|
4861
4864
|
parentCollection: D
|
|
4862
4865
|
}) => {
|
|
4863
|
-
console.debug("Edit collection",
|
|
4864
|
-
editedCollectionId:
|
|
4865
|
-
fullPath:
|
|
4866
|
+
console.debug("Edit collection", s, V, G, D), m?.("edit_collection", { id: s, fullPath: V }), O({
|
|
4867
|
+
editedCollectionId: s,
|
|
4868
|
+
fullPath: V,
|
|
4866
4869
|
parentCollectionIds: G,
|
|
4867
4870
|
isNewCollection: !1,
|
|
4868
4871
|
parentCollection: D,
|
|
4869
4872
|
redirect: !1
|
|
4870
4873
|
});
|
|
4871
4874
|
}, []), M = Z(({
|
|
4872
|
-
propertyKey:
|
|
4873
|
-
property:
|
|
4875
|
+
propertyKey: s,
|
|
4876
|
+
property: V,
|
|
4874
4877
|
editedCollectionId: G,
|
|
4875
4878
|
currentPropertiesOrder: D,
|
|
4876
|
-
parentCollectionIds:
|
|
4879
|
+
parentCollectionIds: q,
|
|
4877
4880
|
collection: L
|
|
4878
4881
|
}) => {
|
|
4879
|
-
console.debug("edit property",
|
|
4880
|
-
const Q =
|
|
4882
|
+
console.debug("edit property", s, V, G, D, q, L), m?.("edit_property", { propertyKey: s, editedCollectionId: G });
|
|
4883
|
+
const Q = s && s.includes(".") ? s.substring(0, s.lastIndexOf(".")) : void 0, le = s && s.includes(".") ? s.substring(s.lastIndexOf(".") + 1) : s;
|
|
4881
4884
|
N({
|
|
4882
4885
|
propertyKey: le,
|
|
4883
|
-
property:
|
|
4886
|
+
property: V,
|
|
4884
4887
|
namespace: Q,
|
|
4885
4888
|
currentPropertiesOrder: D,
|
|
4886
4889
|
editedCollectionId: G,
|
|
4887
|
-
parentCollectionIds:
|
|
4890
|
+
parentCollectionIds: q,
|
|
4888
4891
|
collectionEditable: L?.editable ?? !1
|
|
4889
4892
|
});
|
|
4890
4893
|
}, []), B = Y.useCallback(({
|
|
4891
|
-
parentCollectionIds:
|
|
4892
|
-
parentCollection:
|
|
4894
|
+
parentCollectionIds: s,
|
|
4895
|
+
parentCollection: V,
|
|
4893
4896
|
initialValues: G,
|
|
4894
4897
|
redirect: D,
|
|
4895
|
-
sourceClick:
|
|
4898
|
+
sourceClick: q
|
|
4896
4899
|
}) => {
|
|
4897
|
-
console.debug("Create collection", { parentCollectionIds:
|
|
4900
|
+
console.debug("Create collection", { parentCollectionIds: s, parentCollection: V, initialValues: G, redirect: D, sourceClick: q }), m?.("create_collection", { parentCollectionIds: s, parentCollection: V, initialValues: G, redirect: D, sourceClick: q }), O({
|
|
4898
4901
|
isNewCollection: !0,
|
|
4899
|
-
parentCollectionIds:
|
|
4900
|
-
parentCollection:
|
|
4902
|
+
parentCollectionIds: s,
|
|
4903
|
+
parentCollection: V,
|
|
4901
4904
|
initialValues: G,
|
|
4902
4905
|
redirect: D
|
|
4903
4906
|
});
|
|
4904
|
-
}, []),
|
|
4907
|
+
}, []), S = p ? (s) => !s && w ? Promise.resolve(w) : p?.(s) : void 0;
|
|
4905
4908
|
return /* @__PURE__ */ e(mr.Provider, { value: n, children: /* @__PURE__ */ a(
|
|
4906
4909
|
hr.Provider,
|
|
4907
4910
|
{
|
|
@@ -4909,8 +4912,8 @@ const Ht = (t, r, n, i) => {
|
|
|
4909
4912
|
editCollection: R,
|
|
4910
4913
|
createCollection: B,
|
|
4911
4914
|
editProperty: M,
|
|
4912
|
-
configPermissions: i ??
|
|
4913
|
-
rootPathSuggestions:
|
|
4915
|
+
configPermissions: i ?? _,
|
|
4916
|
+
rootPathSuggestions: w
|
|
4914
4917
|
},
|
|
4915
4918
|
children: [
|
|
4916
4919
|
r,
|
|
@@ -4922,15 +4925,15 @@ const Ht = (t, r, n, i) => {
|
|
|
4922
4925
|
isNewCollection: !1,
|
|
4923
4926
|
collectionInference: o,
|
|
4924
4927
|
...P,
|
|
4925
|
-
getData:
|
|
4928
|
+
getData: h,
|
|
4926
4929
|
reservedGroups: l,
|
|
4927
4930
|
extraView: d,
|
|
4928
|
-
pathSuggestions:
|
|
4929
|
-
getUser:
|
|
4930
|
-
handleClose: (
|
|
4931
|
-
if (P?.redirect &&
|
|
4932
|
-
const
|
|
4933
|
-
|
|
4931
|
+
pathSuggestions: S,
|
|
4932
|
+
getUser: u,
|
|
4933
|
+
handleClose: (s) => {
|
|
4934
|
+
if (P?.redirect && s && P?.isNewCollection && !P.parentCollectionIds.length) {
|
|
4935
|
+
const V = c.buildUrlCollectionPath(s.id ?? s.path);
|
|
4936
|
+
g(V);
|
|
4934
4937
|
}
|
|
4935
4938
|
O(void 0);
|
|
4936
4939
|
}
|
|
@@ -4939,32 +4942,32 @@ const Ht = (t, r, n, i) => {
|
|
|
4939
4942
|
/* @__PURE__ */ e(
|
|
4940
4943
|
Ve,
|
|
4941
4944
|
{
|
|
4942
|
-
open: !!
|
|
4945
|
+
open: !!f,
|
|
4943
4946
|
includeIdAndName: !0,
|
|
4944
|
-
existingProperty: !!
|
|
4945
|
-
autoUpdateId:
|
|
4946
|
-
autoOpenTypeSelect:
|
|
4947
|
+
existingProperty: !!f?.propertyKey,
|
|
4948
|
+
autoUpdateId: f ? !f?.propertyKey : !1,
|
|
4949
|
+
autoOpenTypeSelect: f ? !f?.propertyKey : !1,
|
|
4947
4950
|
inArray: !1,
|
|
4948
|
-
collectionEditable:
|
|
4949
|
-
getData:
|
|
4950
|
-
console.debug("get data for property",
|
|
4951
|
-
const
|
|
4952
|
-
return
|
|
4951
|
+
collectionEditable: f?.collectionEditable ?? !1,
|
|
4952
|
+
getData: h && f?.editedCollectionId ? () => {
|
|
4953
|
+
console.debug("get data for property", f?.editedCollectionId);
|
|
4954
|
+
const s = c.resolveAliasesFrom(f.editedCollectionId);
|
|
4955
|
+
return h(s, []);
|
|
4953
4956
|
} : void 0,
|
|
4954
4957
|
onPropertyChanged: ({
|
|
4955
|
-
id:
|
|
4956
|
-
property:
|
|
4958
|
+
id: s,
|
|
4959
|
+
property: V
|
|
4957
4960
|
}) => {
|
|
4958
|
-
if (!
|
|
4961
|
+
if (!f || !s)
|
|
4959
4962
|
return;
|
|
4960
|
-
const G = !
|
|
4963
|
+
const G = !f.propertyKey;
|
|
4961
4964
|
return n.saveProperty({
|
|
4962
|
-
path:
|
|
4963
|
-
property:
|
|
4964
|
-
propertyKey:
|
|
4965
|
-
newPropertiesOrder: G &&
|
|
4966
|
-
namespace:
|
|
4967
|
-
parentCollectionIds:
|
|
4965
|
+
path: f?.editedCollectionId,
|
|
4966
|
+
property: V,
|
|
4967
|
+
propertyKey: s,
|
|
4968
|
+
newPropertiesOrder: G && f.currentPropertiesOrder ? [...f.currentPropertiesOrder, s] : void 0,
|
|
4969
|
+
namespace: f.namespace,
|
|
4970
|
+
parentCollectionIds: f.parentCollectionIds
|
|
4968
4971
|
}).catch((D) => (console.error(D), v.open({
|
|
4969
4972
|
type: "error",
|
|
4970
4973
|
message: "Error persisting property: " + (D.message ?? "Details in the console")
|
|
@@ -4972,20 +4975,20 @@ const Ht = (t, r, n, i) => {
|
|
|
4972
4975
|
},
|
|
4973
4976
|
onPropertyChangedImmediate: !1,
|
|
4974
4977
|
onDelete: () => {
|
|
4975
|
-
if (!
|
|
4978
|
+
if (!f?.propertyKey)
|
|
4976
4979
|
return;
|
|
4977
|
-
const
|
|
4980
|
+
const s = f?.currentPropertiesOrder?.filter((V) => V !== f?.propertyKey);
|
|
4978
4981
|
return n.deleteProperty({
|
|
4979
|
-
path:
|
|
4980
|
-
propertyKey:
|
|
4981
|
-
namespace:
|
|
4982
|
-
newPropertiesOrder:
|
|
4983
|
-
parentCollectionIds:
|
|
4982
|
+
path: f?.editedCollectionId,
|
|
4983
|
+
propertyKey: f?.propertyKey,
|
|
4984
|
+
namespace: f?.namespace,
|
|
4985
|
+
newPropertiesOrder: s,
|
|
4986
|
+
parentCollectionIds: f?.parentCollectionIds
|
|
4984
4987
|
}).then(() => {
|
|
4985
4988
|
N(void 0);
|
|
4986
|
-
}).catch((
|
|
4989
|
+
}).catch((V) => (console.error(V), v.open({
|
|
4987
4990
|
type: "error",
|
|
4988
|
-
message: "Error deleting property: " + (
|
|
4991
|
+
message: "Error deleting property: " + (V.message ?? "Details in the console")
|
|
4989
4992
|
}), !1));
|
|
4990
4993
|
},
|
|
4991
4994
|
onError: () => {
|
|
@@ -5000,29 +5003,29 @@ const Ht = (t, r, n, i) => {
|
|
|
5000
5003
|
forceShowErrors: !1,
|
|
5001
5004
|
existingPropertyKeys: [],
|
|
5002
5005
|
allowDataInference: !0,
|
|
5003
|
-
propertyConfigs:
|
|
5004
|
-
property:
|
|
5005
|
-
propertyKey:
|
|
5006
|
+
propertyConfigs: x,
|
|
5007
|
+
property: f?.property,
|
|
5008
|
+
propertyKey: f?.propertyKey
|
|
5006
5009
|
}
|
|
5007
5010
|
)
|
|
5008
5011
|
]
|
|
5009
5012
|
}
|
|
5010
5013
|
) });
|
|
5011
5014
|
},
|
|
5012
|
-
|
|
5013
|
-
),
|
|
5015
|
+
ve
|
|
5016
|
+
), xe = () => Jt(hr), fr = () => Jt(mr);
|
|
5014
5017
|
function ln({
|
|
5015
5018
|
path: t,
|
|
5016
5019
|
parentCollectionIds: r,
|
|
5017
5020
|
collection: n,
|
|
5018
5021
|
tableController: i
|
|
5019
5022
|
}) {
|
|
5020
|
-
const l =
|
|
5023
|
+
const l = _e(), o = Pe(), d = xe(), p = fr(), u = Ie(), h = o.getCollectionFromIds(r), m = d.configPermissions ? d.configPermissions({
|
|
5021
5024
|
user: l.user,
|
|
5022
5025
|
collection: n
|
|
5023
5026
|
}).editCollections : !0;
|
|
5024
|
-
let
|
|
5025
|
-
return (!
|
|
5027
|
+
let c = null;
|
|
5028
|
+
return (!ve(at(i.filterValues), at(n.initialFilter)) || !ve(at(i.sortBy), at(n.initialSort))) && (c = /* @__PURE__ */ a(U, { children: [
|
|
5026
5029
|
(n.initialFilter || n.initialSort) && /* @__PURE__ */ e(
|
|
5027
5030
|
te,
|
|
5028
5031
|
{
|
|
@@ -5051,7 +5054,7 @@ function ln({
|
|
|
5051
5054
|
color: "primary",
|
|
5052
5055
|
size: "small",
|
|
5053
5056
|
variant: "outlined",
|
|
5054
|
-
onClick: () =>
|
|
5057
|
+
onClick: () => p?.saveCollection({
|
|
5055
5058
|
id: n.id,
|
|
5056
5059
|
parentCollectionIds: r,
|
|
5057
5060
|
collectionData: W(
|
|
@@ -5062,7 +5065,7 @@ function ln({
|
|
|
5062
5065
|
}
|
|
5063
5066
|
)
|
|
5064
5067
|
}).then(() => {
|
|
5065
|
-
|
|
5068
|
+
u.open({
|
|
5066
5069
|
type: "success",
|
|
5067
5070
|
message: "Default config saved"
|
|
5068
5071
|
});
|
|
@@ -5073,18 +5076,18 @@ function ln({
|
|
|
5073
5076
|
}
|
|
5074
5077
|
)
|
|
5075
5078
|
] })), /* @__PURE__ */ a(U, { children: [
|
|
5076
|
-
|
|
5079
|
+
m && c,
|
|
5077
5080
|
/* @__PURE__ */ e(
|
|
5078
5081
|
te,
|
|
5079
5082
|
{
|
|
5080
|
-
title:
|
|
5083
|
+
title: m ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
5081
5084
|
children: /* @__PURE__ */ e(
|
|
5082
5085
|
oe,
|
|
5083
5086
|
{
|
|
5084
5087
|
color: "primary",
|
|
5085
|
-
disabled: !
|
|
5086
|
-
onClick:
|
|
5087
|
-
children: /* @__PURE__ */ e(
|
|
5088
|
+
disabled: !m,
|
|
5089
|
+
onClick: m ? () => d?.editCollection({ id: n.id, fullPath: t, parentCollectionIds: r, parentCollection: h }) : void 0,
|
|
5090
|
+
children: /* @__PURE__ */ e(He, {})
|
|
5088
5091
|
}
|
|
5089
5092
|
)
|
|
5090
5093
|
}
|
|
@@ -5098,14 +5101,14 @@ function sn({
|
|
|
5098
5101
|
path: t,
|
|
5099
5102
|
collection: r
|
|
5100
5103
|
}) {
|
|
5101
|
-
const n = Ie(), i =
|
|
5104
|
+
const n = Ie(), i = _e(), l = fr(), o = xe(), d = o.configPermissions({
|
|
5102
5105
|
user: i.user,
|
|
5103
5106
|
collection: r
|
|
5104
|
-
}),
|
|
5107
|
+
}), p = Z(() => {
|
|
5105
5108
|
o?.editCollection({ id: r.id, parentCollectionIds: [] });
|
|
5106
|
-
}, [o, t]), [
|
|
5109
|
+
}, [o, t]), [u, h] = $(!1), m = Z(() => {
|
|
5107
5110
|
l?.deleteCollection({ id: r.id }).then(() => {
|
|
5108
|
-
|
|
5111
|
+
h(!1), n.open({
|
|
5109
5112
|
message: "Collection deleted",
|
|
5110
5113
|
type: "success"
|
|
5111
5114
|
});
|
|
@@ -5117,10 +5120,10 @@ function sn({
|
|
|
5117
5120
|
Zr,
|
|
5118
5121
|
{
|
|
5119
5122
|
trigger: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(Jr, { size: "small" }) }),
|
|
5120
|
-
children: /* @__PURE__ */ a(Qr, { onClick: (
|
|
5121
|
-
|
|
5123
|
+
children: /* @__PURE__ */ a(Qr, { onClick: (c) => {
|
|
5124
|
+
c.preventDefault(), c.stopPropagation(), h(!0);
|
|
5122
5125
|
}, children: [
|
|
5123
|
-
/* @__PURE__ */ e(
|
|
5126
|
+
/* @__PURE__ */ e(dt, {}),
|
|
5124
5127
|
"Delete"
|
|
5125
5128
|
] })
|
|
5126
5129
|
}
|
|
@@ -5128,19 +5131,19 @@ function sn({
|
|
|
5128
5131
|
d.editCollections && /* @__PURE__ */ e(
|
|
5129
5132
|
oe,
|
|
5130
5133
|
{
|
|
5131
|
-
onClick: (
|
|
5132
|
-
|
|
5134
|
+
onClick: (c) => {
|
|
5135
|
+
p();
|
|
5133
5136
|
},
|
|
5134
|
-
children: /* @__PURE__ */ e(
|
|
5137
|
+
children: /* @__PURE__ */ e(He, { size: "small" })
|
|
5135
5138
|
}
|
|
5136
5139
|
)
|
|
5137
5140
|
] }),
|
|
5138
5141
|
/* @__PURE__ */ e(
|
|
5139
5142
|
lt,
|
|
5140
5143
|
{
|
|
5141
|
-
open:
|
|
5142
|
-
onAccept:
|
|
5143
|
-
onCancel: () =>
|
|
5144
|
+
open: u,
|
|
5145
|
+
onAccept: m,
|
|
5146
|
+
onCancel: () => h(!1),
|
|
5144
5147
|
title: /* @__PURE__ */ e(U, { children: "Delete this collection?" }),
|
|
5145
5148
|
body: /* @__PURE__ */ a(U, { children: [
|
|
5146
5149
|
" This will ",
|
|
@@ -5151,19 +5154,19 @@ function sn({
|
|
|
5151
5154
|
)
|
|
5152
5155
|
] });
|
|
5153
5156
|
}
|
|
5154
|
-
function
|
|
5157
|
+
function cn({
|
|
5155
5158
|
group: t,
|
|
5156
5159
|
context: r
|
|
5157
5160
|
}) {
|
|
5158
5161
|
if (!r.navigation.topLevelNavigation)
|
|
5159
5162
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
5160
|
-
const n =
|
|
5163
|
+
const n = _e(), i = xe(), l = i.configPermissions ? i.configPermissions({
|
|
5161
5164
|
user: n.user
|
|
5162
5165
|
}).createCollections : !0;
|
|
5163
5166
|
return /* @__PURE__ */ e(
|
|
5164
5167
|
tr,
|
|
5165
5168
|
{
|
|
5166
|
-
className:
|
|
5169
|
+
className: me("h-full p-4 min-h-[124px]"),
|
|
5167
5170
|
onClick: i && l ? () => i.createCollection({
|
|
5168
5171
|
initialValues: t ? { group: t } : void 0,
|
|
5169
5172
|
parentCollectionIds: [],
|
|
@@ -5175,9 +5178,9 @@ function dn({
|
|
|
5175
5178
|
{
|
|
5176
5179
|
className: "flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",
|
|
5177
5180
|
children: [
|
|
5178
|
-
/* @__PURE__ */ e(
|
|
5181
|
+
/* @__PURE__ */ e(ue, { color: "primary", size: "large" }),
|
|
5179
5182
|
/* @__PURE__ */ e(
|
|
5180
|
-
|
|
5183
|
+
k,
|
|
5181
5184
|
{
|
|
5182
5185
|
color: "primary",
|
|
5183
5186
|
variant: "caption",
|
|
@@ -5185,46 +5188,55 @@ function dn({
|
|
|
5185
5188
|
children: "Add new collection".toUpperCase()
|
|
5186
5189
|
}
|
|
5187
5190
|
),
|
|
5188
|
-
!l && /* @__PURE__ */ e(
|
|
5191
|
+
!l && /* @__PURE__ */ e(k, { variant: "caption", children: "You don't have permissions to create collections" })
|
|
5189
5192
|
]
|
|
5190
5193
|
}
|
|
5191
5194
|
)
|
|
5192
5195
|
}
|
|
5193
5196
|
);
|
|
5194
5197
|
}
|
|
5195
|
-
function
|
|
5196
|
-
const
|
|
5197
|
-
user:
|
|
5198
|
-
}).createCollections : !0,
|
|
5198
|
+
function dn({ introMode: t }) {
|
|
5199
|
+
const r = _e(), n = Pe(), i = xe(), l = i.configPermissions ? i.configPermissions({
|
|
5200
|
+
user: r.user
|
|
5201
|
+
}).createCollections : !0, o = i.rootPathSuggestions, d = (o ?? []).length > 3 || (n.collections ?? []).length === 0 && (o ?? []).length > 0;
|
|
5199
5202
|
return /* @__PURE__ */ e(
|
|
5200
5203
|
Xr,
|
|
5201
5204
|
{
|
|
5202
|
-
in:
|
|
5205
|
+
in: t === "existing_project" || d,
|
|
5203
5206
|
children: /* @__PURE__ */ a(
|
|
5204
5207
|
"div",
|
|
5205
5208
|
{
|
|
5206
5209
|
className: "flex flex-col gap-1 p-2 my-4",
|
|
5207
5210
|
children: [
|
|
5208
|
-
/* @__PURE__ */ e(
|
|
5209
|
-
/* @__PURE__ */
|
|
5211
|
+
!t && /* @__PURE__ */ e(k, { variant: "body2", color: "secondary", children: "Create a collection from your data:" }),
|
|
5212
|
+
t === "existing_project" && /* @__PURE__ */ a(k, { children: [
|
|
5213
|
+
"You will see your ",
|
|
5214
|
+
/* @__PURE__ */ e("b", { children: "database collections" }),
|
|
5215
|
+
" here, a few seconds after project creation"
|
|
5216
|
+
] }),
|
|
5217
|
+
/* @__PURE__ */ a(
|
|
5210
5218
|
"div",
|
|
5211
5219
|
{
|
|
5212
5220
|
className: "flex flex-row gap-1 overflow-scroll no-scrollbar ",
|
|
5213
|
-
children:
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5221
|
+
children: [
|
|
5222
|
+
(o ?? []).map((u) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
5223
|
+
st,
|
|
5224
|
+
{
|
|
5225
|
+
icon: /* @__PURE__ */ e(ue, { size: "small" }),
|
|
5226
|
+
colorScheme: "cyanLighter",
|
|
5227
|
+
onClick: i && l ? () => i.createCollection({
|
|
5228
|
+
initialValues: { path: u, name: ut(u) },
|
|
5229
|
+
parentCollectionIds: [],
|
|
5230
|
+
redirect: !0,
|
|
5231
|
+
sourceClick: "root_collection_suggestion"
|
|
5232
|
+
}) : void 0,
|
|
5233
|
+
size: "small",
|
|
5234
|
+
children: u
|
|
5235
|
+
}
|
|
5236
|
+
) }, u)),
|
|
5237
|
+
o === void 0 && /* @__PURE__ */ e(De, { size: "small" }),
|
|
5238
|
+
o?.length === 0 && /* @__PURE__ */ e(k, { variant: "caption", children: "No suggestions" })
|
|
5239
|
+
]
|
|
5228
5240
|
}
|
|
5229
5241
|
)
|
|
5230
5242
|
]
|
|
@@ -5241,7 +5253,7 @@ function un({
|
|
|
5241
5253
|
parentCollectionIds: l,
|
|
5242
5254
|
collection: o
|
|
5243
5255
|
}) {
|
|
5244
|
-
const d =
|
|
5256
|
+
const d = xe();
|
|
5245
5257
|
return /* @__PURE__ */ e(te, { title: "Edit", children: /* @__PURE__ */ e(
|
|
5246
5258
|
oe,
|
|
5247
5259
|
{
|
|
@@ -5256,7 +5268,7 @@ function un({
|
|
|
5256
5268
|
});
|
|
5257
5269
|
},
|
|
5258
5270
|
size: "small",
|
|
5259
|
-
children: /* @__PURE__ */ e(
|
|
5271
|
+
children: /* @__PURE__ */ e(He, { size: "small" })
|
|
5260
5272
|
}
|
|
5261
5273
|
) });
|
|
5262
5274
|
}
|
|
@@ -5265,7 +5277,7 @@ function pn({
|
|
|
5265
5277
|
parentCollectionIds: r,
|
|
5266
5278
|
collection: n
|
|
5267
5279
|
}) {
|
|
5268
|
-
const i =
|
|
5280
|
+
const i = _e(), l = xe(), o = l.configPermissions ? l.configPermissions({
|
|
5269
5281
|
user: i.user,
|
|
5270
5282
|
collection: n
|
|
5271
5283
|
}).editCollections : !0;
|
|
@@ -5277,16 +5289,16 @@ function pn({
|
|
|
5277
5289
|
l.editProperty({
|
|
5278
5290
|
editedCollectionId: n.id,
|
|
5279
5291
|
parentCollectionIds: r,
|
|
5280
|
-
currentPropertiesOrder:
|
|
5292
|
+
currentPropertiesOrder: Vr(n),
|
|
5281
5293
|
collection: n
|
|
5282
5294
|
});
|
|
5283
5295
|
},
|
|
5284
|
-
children: /* @__PURE__ */ e(
|
|
5296
|
+
children: /* @__PURE__ */ e(ue, { color: "inherit" })
|
|
5285
5297
|
}
|
|
5286
5298
|
) });
|
|
5287
5299
|
}
|
|
5288
5300
|
function mn() {
|
|
5289
|
-
const t =
|
|
5301
|
+
const t = xe();
|
|
5290
5302
|
return /* @__PURE__ */ a(
|
|
5291
5303
|
z,
|
|
5292
5304
|
{
|
|
@@ -5298,23 +5310,23 @@ function mn() {
|
|
|
5298
5310
|
sourceClick: "new_collection_button"
|
|
5299
5311
|
}),
|
|
5300
5312
|
children: [
|
|
5301
|
-
/* @__PURE__ */ e(
|
|
5313
|
+
/* @__PURE__ */ e(ue, {}),
|
|
5302
5314
|
"New collection"
|
|
5303
5315
|
]
|
|
5304
5316
|
}
|
|
5305
5317
|
);
|
|
5306
5318
|
}
|
|
5307
|
-
function
|
|
5319
|
+
function In({
|
|
5308
5320
|
collectionConfigController: t,
|
|
5309
|
-
|
|
5321
|
+
introMode: r,
|
|
5310
5322
|
configPermissions: n,
|
|
5311
5323
|
reservedGroups: i,
|
|
5312
5324
|
extraView: l,
|
|
5313
5325
|
pathSuggestions: o,
|
|
5314
5326
|
getUser: d,
|
|
5315
|
-
collectionInference:
|
|
5316
|
-
getData:
|
|
5317
|
-
onAnalyticsEvent:
|
|
5327
|
+
collectionInference: p,
|
|
5328
|
+
getData: u,
|
|
5329
|
+
onAnalyticsEvent: h
|
|
5318
5330
|
}) {
|
|
5319
5331
|
return {
|
|
5320
5332
|
name: "Collection Editor",
|
|
@@ -5327,20 +5339,21 @@ function Vn({
|
|
|
5327
5339
|
props: {
|
|
5328
5340
|
collectionConfigController: t,
|
|
5329
5341
|
configPermissions: n,
|
|
5330
|
-
collectionInference:
|
|
5342
|
+
collectionInference: p,
|
|
5331
5343
|
reservedGroups: i,
|
|
5332
5344
|
extraView: l,
|
|
5333
5345
|
pathSuggestions: o,
|
|
5334
5346
|
getUser: d,
|
|
5335
|
-
getData:
|
|
5336
|
-
onAnalyticsEvent:
|
|
5347
|
+
getData: u,
|
|
5348
|
+
onAnalyticsEvent: h
|
|
5337
5349
|
}
|
|
5338
5350
|
},
|
|
5339
5351
|
homePage: {
|
|
5340
5352
|
additionalActions: /* @__PURE__ */ e(mn, {}),
|
|
5341
|
-
|
|
5353
|
+
additionalChildrenStart: r ? /* @__PURE__ */ e(hn, { introMode: r }) : void 0,
|
|
5354
|
+
additionalChildrenEnd: /* @__PURE__ */ e(dn, { introMode: r }),
|
|
5342
5355
|
CollectionActions: sn,
|
|
5343
|
-
AdditionalCards:
|
|
5356
|
+
AdditionalCards: r ? void 0 : cn
|
|
5344
5357
|
},
|
|
5345
5358
|
collectionView: {
|
|
5346
5359
|
HeaderAction: un,
|
|
@@ -5348,10 +5361,37 @@ function Vn({
|
|
|
5348
5361
|
}
|
|
5349
5362
|
};
|
|
5350
5363
|
}
|
|
5351
|
-
function
|
|
5352
|
-
|
|
5364
|
+
function hn({ introMode: t }) {
|
|
5365
|
+
if (!Pe().topLevelNavigation)
|
|
5366
|
+
throw Error("Navigation not ready in FireCMSHomePage");
|
|
5367
|
+
const n = _e(), i = xe(), l = i.configPermissions ? i.configPermissions({
|
|
5368
|
+
user: n.user
|
|
5369
|
+
}).createCollections : !0;
|
|
5370
|
+
return /* @__PURE__ */ a("div", { className: "mt-8 flex flex-col mt-8 p-2", children: [
|
|
5371
|
+
/* @__PURE__ */ e(k, { variant: "h4", className: "mb-4", children: "Welcome" }),
|
|
5372
|
+
/* @__PURE__ */ e(k, { paragraph: !0, children: "Your admin panel is ready ✌️" }),
|
|
5373
|
+
/* @__PURE__ */ e(k, { paragraph: !0, children: "Start building collections in FireCMS easily. Map them to your existing database data, import from files, or use our templates. Simplify your data management process now." }),
|
|
5374
|
+
l && /* @__PURE__ */ a(
|
|
5375
|
+
z,
|
|
5376
|
+
{
|
|
5377
|
+
className: "mt-4",
|
|
5378
|
+
onClick: i && l ? () => i.createCollection({
|
|
5379
|
+
parentCollectionIds: [],
|
|
5380
|
+
redirect: !0,
|
|
5381
|
+
sourceClick: "new_collection_card"
|
|
5382
|
+
}) : void 0,
|
|
5383
|
+
children: [
|
|
5384
|
+
/* @__PURE__ */ e(ue, {}),
|
|
5385
|
+
"Create your first collection"
|
|
5386
|
+
]
|
|
5387
|
+
}
|
|
5388
|
+
)
|
|
5389
|
+
] });
|
|
5390
|
+
}
|
|
5391
|
+
function _n({ path: t }) {
|
|
5392
|
+
const r = Pe(), n = fn(t), i = r.getParentCollectionIds(t), l = xe();
|
|
5353
5393
|
return /* @__PURE__ */ a("div", { className: "p-1 flex flex-col items-center", children: [
|
|
5354
|
-
/* @__PURE__ */ e(
|
|
5394
|
+
/* @__PURE__ */ e(Wt, { error: "No collection for path: " + n }),
|
|
5355
5395
|
/* @__PURE__ */ e(
|
|
5356
5396
|
z,
|
|
5357
5397
|
{
|
|
@@ -5371,21 +5411,21 @@ function In({ path: t }) {
|
|
|
5371
5411
|
)
|
|
5372
5412
|
] });
|
|
5373
5413
|
}
|
|
5374
|
-
function
|
|
5414
|
+
function fn(t) {
|
|
5375
5415
|
const r = t.split("/");
|
|
5376
5416
|
return r[r.length - 1];
|
|
5377
5417
|
}
|
|
5378
5418
|
export {
|
|
5379
|
-
|
|
5380
|
-
|
|
5419
|
+
_n as MissingReferenceWidget,
|
|
5420
|
+
qe as editableProperty,
|
|
5381
5421
|
ae as getFullId,
|
|
5382
5422
|
ir as getFullIdPath,
|
|
5383
|
-
|
|
5423
|
+
pe as idToPropertiesPath,
|
|
5384
5424
|
ye as namespaceToPropertiesOrderPath,
|
|
5385
5425
|
bi as namespaceToPropertiesPath,
|
|
5386
5426
|
wi as removeNonEditableProperties,
|
|
5387
|
-
|
|
5388
|
-
|
|
5427
|
+
xe as useCollectionEditorController,
|
|
5428
|
+
In as useCollectionEditorPlugin,
|
|
5389
5429
|
fr as useCollectionsConfigController
|
|
5390
5430
|
};
|
|
5391
5431
|
//# sourceMappingURL=index.es.js.map
|