@firecms/collection_editor 3.0.0-canary.45 → 3.0.0-canary.47
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 +893 -863
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +14 -14
- package/src/ConfigControllerProvider.tsx +24 -24
- package/src/ui/HomePageEditorCollectionAction.tsx +5 -5
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +31 -1
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +10 -10
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +10 -10
- package/src/ui/collection_editor/PropertyEditView.tsx +3 -2
- package/src/ui/collection_editor/PropertyTree.tsx +3 -3
- package/src/ui/collection_editor/properties/BlockPropertyField.tsx +5 -5
- package/src/ui/collection_editor/properties/MapPropertyField.tsx +5 -5
package/dist/index.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as R } from "react/jsx-runtime";
|
|
2
|
-
import { FieldCaption as
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useAutoComplete as Sr, Container as
|
|
7
|
-
import * as
|
|
8
|
-
import { useFormex as
|
|
9
|
-
import { extractEnumFromValues as
|
|
10
|
-
import { DragDropContext as
|
|
11
|
-
import
|
|
12
|
-
import { Highlight as
|
|
13
|
-
import { ImportFileUpload as
|
|
14
|
-
import { useNavigate as
|
|
15
|
-
const
|
|
16
|
-
id:
|
|
17
|
-
name:
|
|
18
|
-
path:
|
|
2
|
+
import { FieldCaption as J, SearchIconsView as vr, toSnakeCase as Nt, singular as yr, IconForView as st, ArrayContainer as br, serializeRegExp as Cr, useSnackbarController as Ve, resolveEnumValues as Nr, isPropertyBuilder as re, useCustomizationController as Se, getFieldConfig as je, ErrorBoundary as pe, PropertyConfigBadge as qe, unslugify as xt, useNavigationController as Te, mergeDeep as W, DEFAULT_FIELD_CONFIGS as Wt, isValidRegExp as Pr, getFieldId as Gt, DeleteConfirmationDialog as dt, useLargeLayout as xr, makePropertiesEditable as Le, resolveEntityView as wr, useSelectionController as Tr, CircularProgressCenter as ct, EntityCollectionTable as kr, slugify as Or, useAuthController as Ie, randomString as _t, removeUndefined as Ft, ErrorView as Kt, removeInitialAndTrailingSlashes as Vr, getDefaultPropertiesOrder as Ir, joinCollectionLists as _r } from "@firecms/core";
|
|
3
|
+
import * as ze from "react";
|
|
4
|
+
import G, { useState as j, useEffect as ce, useMemo as Zt, useRef as Re, useDeferredValue as Fr, useCallback as Er, useContext as Jt } from "react";
|
|
5
|
+
import ve from "react-fast-compare";
|
|
6
|
+
import { useAutoComplete as Sr, Container as mt, Typography as V, Tooltip as ee, IconButton as ie, Chip as Pt, TextField as we, cn as he, DebouncedTextField as K, Autocomplete as Ar, AutocompleteItem as Dr, ExpandablePanel as wt, SettingsIcon as $e, ClearIcon as Br, Select as be, SelectItem as X, BooleanSwitchWithLabel as ut, Dialog as _e, AutoAwesomeIcon as ht, Badge as Mr, ListIcon as zr, Button as z, CircularProgress as He, Paper as fe, DialogContent as Ae, DialogActions as De, RuleIcon as Rr, FileUploadIcon as Ur, MultiSelect as jr, MultiSelectItem as Et, Checkbox as St, cardMixin as Qt, cardClickableMixin as Xt, cardSelectedMixin as er, FunctionsIcon as qr, RemoveCircleIcon as Lr, defaultBorderMixin as Tt, RemoveIcon as $r, DragHandleIcon as Hr, AddIcon as de, SelectGroup as At, InfoLabel as Yr, DeleteIcon as pt, ContentCopyIcon as Wr, CodeIcon as Gr, Table as Dt, TableBody as Bt, TableRow as bt, TableCell as Me, Alert as Kr, Icon as rt, Card as tr, coolIconKeys as Mt, Tabs as Zr, Tab as Ct, ArrowBackIcon as it, LoadingButton as zt, DoneIcon as Jr, Menu as Qr, MoreVertIcon as Xr, MenuItem as ei, SaveIcon as ti, UndoIcon as ri } from "@firecms/ui";
|
|
7
|
+
import * as nt from "yup";
|
|
8
|
+
import { useFormex as Y, Field as $, getIn as I, useCreateFormex as kt, Formex as Ot } from "@firecms/formex";
|
|
9
|
+
import { extractEnumFromValues as ii, buildPropertyFromData as ni, buildEntityPropertiesFromData as ai } from "@firecms/schema_inference";
|
|
10
|
+
import { DragDropContext as oi, Droppable as li, Draggable as si } from "@hello-pangea/dnd";
|
|
11
|
+
import di from "json5";
|
|
12
|
+
import { Highlight as ci, themes as ui } from "prism-react-renderer";
|
|
13
|
+
import { ImportFileUpload as pi, DataNewPropertiesMapping as mi, ImportNewPropertyFieldPreview as hi, getInferenceType as rr, convertDataToEntity as fi, useImportConfig as gi, ImportSaveInProgress as vi } from "@firecms/data_import_export";
|
|
14
|
+
import { useNavigate as yi } from "react-router";
|
|
15
|
+
const bi = nt.object().shape({
|
|
16
|
+
id: nt.string().required("Required"),
|
|
17
|
+
name: nt.string().required("Required"),
|
|
18
|
+
path: nt.string().required("Required")
|
|
19
19
|
});
|
|
20
|
-
function
|
|
20
|
+
function Ci({
|
|
21
21
|
isNewCollection: t,
|
|
22
22
|
reservedGroups: r,
|
|
23
23
|
existingPaths: n,
|
|
@@ -25,7 +25,7 @@ function bi({
|
|
|
25
25
|
groups: l,
|
|
26
26
|
parentCollection: o
|
|
27
27
|
}) {
|
|
28
|
-
const d =
|
|
28
|
+
const d = G.useRef(null), {
|
|
29
29
|
values: c,
|
|
30
30
|
setFieldValue: u,
|
|
31
31
|
handleChange: m,
|
|
@@ -34,23 +34,23 @@ function bi({
|
|
|
34
34
|
setFieldTouched: f,
|
|
35
35
|
isSubmitting: g,
|
|
36
36
|
submitCount: x
|
|
37
|
-
} =
|
|
38
|
-
u("name", h), !I(p, "path") && t && h && u("path",
|
|
37
|
+
} = Y(), [y, P] = j(!1), [v, b] = j(!1), T = (h) => {
|
|
38
|
+
u("name", h), !I(p, "path") && t && h && u("path", Nt(h)), !I(p, "id") && t && h && u("id", Nt(h)), !I(p, "singularName") && t && h && u("singularName", yr(h));
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
ce(() => {
|
|
41
41
|
s.id && b(!0);
|
|
42
42
|
}, [s.id]);
|
|
43
|
-
const w = /* @__PURE__ */ e(
|
|
43
|
+
const w = /* @__PURE__ */ e(st, { collectionOrView: c }), C = l?.filter((h) => !r?.includes(h)), {
|
|
44
44
|
inputFocused: O,
|
|
45
45
|
autoCompleteOpen: N,
|
|
46
46
|
setAutoCompleteOpen: F
|
|
47
47
|
} = Sr({
|
|
48
48
|
ref: d
|
|
49
|
-
}),
|
|
49
|
+
}), B = !!o;
|
|
50
50
|
let _;
|
|
51
51
|
typeof c.customId == "object" ? _ = "code_defined" : c.customId === !0 ? _ = "true" : c.customId === !1 ? _ = "false" : c.customId === "optional" && (_ = "optional");
|
|
52
|
-
const
|
|
53
|
-
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(
|
|
52
|
+
const E = x > 0;
|
|
53
|
+
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(mt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
54
54
|
/* @__PURE__ */ a("div", { children: [
|
|
55
55
|
/* @__PURE__ */ a(
|
|
56
56
|
"div",
|
|
@@ -58,8 +58,8 @@ function bi({
|
|
|
58
58
|
className: "flex flex-row py-2 pt-3 items-center",
|
|
59
59
|
children: [
|
|
60
60
|
/* @__PURE__ */ e(V, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${c?.name} collection` }),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
-
|
|
61
|
+
/* @__PURE__ */ e(ee, { title: "Change icon", children: /* @__PURE__ */ e(
|
|
62
|
+
ie,
|
|
63
63
|
{
|
|
64
64
|
shape: "square",
|
|
65
65
|
onClick: () => P(!0),
|
|
@@ -69,7 +69,7 @@ function bi({
|
|
|
69
69
|
]
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
o && /* @__PURE__ */ e(
|
|
72
|
+
o && /* @__PURE__ */ e(Pt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
|
|
73
73
|
"This is a subcollection of ",
|
|
74
74
|
/* @__PURE__ */ e("b", { children: o.name })
|
|
75
75
|
] }) })
|
|
@@ -77,36 +77,36 @@ function bi({
|
|
|
77
77
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-4", children: [
|
|
78
78
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
79
79
|
/* @__PURE__ */ e(
|
|
80
|
-
|
|
80
|
+
we,
|
|
81
81
|
{
|
|
82
82
|
value: c.name ?? "",
|
|
83
83
|
onChange: (h) => T(h.target.value),
|
|
84
84
|
label: "Name",
|
|
85
85
|
required: !0,
|
|
86
|
-
error:
|
|
86
|
+
error: E && !!s.name
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
/* @__PURE__ */ e(
|
|
89
|
+
/* @__PURE__ */ e(J, { error: p.name && !!s.name, children: p.name && s.name ? s.name : "Name of in this collection, usually a plural name (e.g. Products)" })
|
|
90
90
|
] }),
|
|
91
|
-
/* @__PURE__ */ a("div", { className:
|
|
91
|
+
/* @__PURE__ */ a("div", { className: he("col-span-12 ", B ? "" : "sm:col-span-8"), children: [
|
|
92
92
|
/* @__PURE__ */ e(
|
|
93
93
|
$,
|
|
94
94
|
{
|
|
95
95
|
name: "path",
|
|
96
|
-
as:
|
|
96
|
+
as: K,
|
|
97
97
|
label: "Path",
|
|
98
98
|
disabled: !t,
|
|
99
99
|
required: !0,
|
|
100
|
-
error:
|
|
100
|
+
error: E && !!s.path
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
|
-
/* @__PURE__ */ e(
|
|
103
|
+
/* @__PURE__ */ e(J, { error: p.path && !!s.path, children: p.path && s.path ? s.path : B ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database" })
|
|
104
104
|
] }),
|
|
105
|
-
!
|
|
105
|
+
!B && /* @__PURE__ */ a("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
106
106
|
/* @__PURE__ */ e(
|
|
107
|
-
|
|
107
|
+
we,
|
|
108
108
|
{
|
|
109
|
-
error:
|
|
109
|
+
error: E && !!s.group,
|
|
110
110
|
disabled: g,
|
|
111
111
|
value: c.group ?? "",
|
|
112
112
|
autoComplete: "off",
|
|
@@ -121,7 +121,7 @@ function bi({
|
|
|
121
121
|
{
|
|
122
122
|
open: N && (C ?? []).length > 0,
|
|
123
123
|
setOpen: F,
|
|
124
|
-
children: C?.map((h,
|
|
124
|
+
children: C?.map((h, D) => /* @__PURE__ */ e(
|
|
125
125
|
Dr,
|
|
126
126
|
{
|
|
127
127
|
onClick: () => {
|
|
@@ -129,19 +129,19 @@ function bi({
|
|
|
129
129
|
},
|
|
130
130
|
children: /* @__PURE__ */ e("div", { className: "flex-grow", children: h })
|
|
131
131
|
},
|
|
132
|
-
|
|
132
|
+
D + "_" + h
|
|
133
133
|
))
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
|
-
/* @__PURE__ */ e(
|
|
136
|
+
/* @__PURE__ */ e(J, { children: E && s.group ? s.group : "Group of the collection" })
|
|
137
137
|
] }),
|
|
138
138
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
139
|
-
|
|
139
|
+
wt,
|
|
140
140
|
{
|
|
141
141
|
expanded: v,
|
|
142
142
|
onExpandedChange: b,
|
|
143
143
|
title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
|
|
144
|
-
/* @__PURE__ */ e(
|
|
144
|
+
/* @__PURE__ */ e($e, {}),
|
|
145
145
|
/* @__PURE__ */ e(
|
|
146
146
|
V,
|
|
147
147
|
{
|
|
@@ -158,19 +158,19 @@ function bi({
|
|
|
158
158
|
$,
|
|
159
159
|
{
|
|
160
160
|
name: "id",
|
|
161
|
-
as:
|
|
161
|
+
as: K,
|
|
162
162
|
disabled: !t,
|
|
163
163
|
label: "Collection id",
|
|
164
|
-
error:
|
|
164
|
+
error: E && !!s.id
|
|
165
165
|
}
|
|
166
166
|
),
|
|
167
|
-
/* @__PURE__ */ e(
|
|
167
|
+
/* @__PURE__ */ e(J, { error: p.id && !!s.id, children: p.id && s.id ? s.id : "This id identifies this collection. Typically the same as the path." })
|
|
168
168
|
] }),
|
|
169
169
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
170
170
|
/* @__PURE__ */ e(
|
|
171
|
-
|
|
171
|
+
we,
|
|
172
172
|
{
|
|
173
|
-
error:
|
|
173
|
+
error: E && !!s.singularName,
|
|
174
174
|
name: "singularName",
|
|
175
175
|
"aria-describedby": "singularName-helper",
|
|
176
176
|
onChange: (h) => (f("singularName", !0), m(h)),
|
|
@@ -178,13 +178,43 @@ function bi({
|
|
|
178
178
|
label: "Singular name"
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
|
-
/* @__PURE__ */ e(
|
|
181
|
+
/* @__PURE__ */ e(J, { error: E && !!s.singularName, children: E && s.singularName ? s.singularName : "Optionally define a singular name for your entities" })
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
184
|
+
/* @__PURE__ */ e(
|
|
185
|
+
we,
|
|
186
|
+
{
|
|
187
|
+
error: E && !!s.sideDialogWidth,
|
|
188
|
+
name: "sideDialogWidth",
|
|
189
|
+
type: "number",
|
|
190
|
+
"aria-describedby": "sideDialogWidth-helper",
|
|
191
|
+
onChange: (h) => {
|
|
192
|
+
f("sideDialogWidth", !0);
|
|
193
|
+
const D = h.target.value;
|
|
194
|
+
D ? isNaN(Number(D)) || u("sideDialogWidth", Number(D)) : u("sideDialogWidth", null);
|
|
195
|
+
},
|
|
196
|
+
endAdornment: /* @__PURE__ */ e(
|
|
197
|
+
ie,
|
|
198
|
+
{
|
|
199
|
+
size: "small",
|
|
200
|
+
onClick: () => {
|
|
201
|
+
u("sideDialogWidth", null);
|
|
202
|
+
},
|
|
203
|
+
disabled: !c.sideDialogWidth,
|
|
204
|
+
children: /* @__PURE__ */ e(Br, { size: "small" })
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
value: c.sideDialogWidth ?? "",
|
|
208
|
+
label: "Side dialog width"
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ e(J, { error: E && !!s.singularName, children: E && s.singularName ? s.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px" })
|
|
182
212
|
] }),
|
|
183
213
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
184
214
|
/* @__PURE__ */ e(
|
|
185
|
-
|
|
215
|
+
we,
|
|
186
216
|
{
|
|
187
|
-
error:
|
|
217
|
+
error: E && !!s.description,
|
|
188
218
|
name: "description",
|
|
189
219
|
value: c.description ?? "",
|
|
190
220
|
onChange: m,
|
|
@@ -194,10 +224,10 @@ function bi({
|
|
|
194
224
|
label: "Description"
|
|
195
225
|
}
|
|
196
226
|
),
|
|
197
|
-
/* @__PURE__ */ e(
|
|
227
|
+
/* @__PURE__ */ e(J, { error: E && !!s.description, children: E && s.description ? s.description : "Description of the collection, you can use markdown" })
|
|
198
228
|
] }),
|
|
199
229
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
200
|
-
|
|
230
|
+
be,
|
|
201
231
|
{
|
|
202
232
|
name: "defaultSize",
|
|
203
233
|
label: "Default row size",
|
|
@@ -206,7 +236,7 @@ function bi({
|
|
|
206
236
|
value: c.defaultSize ?? "",
|
|
207
237
|
renderValue: (h) => h.toUpperCase(),
|
|
208
238
|
children: ["xs", "s", "m", "l", "xl"].map((h) => /* @__PURE__ */ e(
|
|
209
|
-
|
|
239
|
+
X,
|
|
210
240
|
{
|
|
211
241
|
value: h,
|
|
212
242
|
children: h.toUpperCase()
|
|
@@ -216,10 +246,10 @@ function bi({
|
|
|
216
246
|
}
|
|
217
247
|
) }),
|
|
218
248
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
219
|
-
|
|
249
|
+
be,
|
|
220
250
|
{
|
|
221
251
|
name: "customId",
|
|
222
|
-
label: "
|
|
252
|
+
label: "Document IDs generation",
|
|
223
253
|
position: "item-aligned",
|
|
224
254
|
disabled: _ === "code_defined",
|
|
225
255
|
onValueChange: (h) => {
|
|
@@ -230,15 +260,15 @@ function bi({
|
|
|
230
260
|
value: _ ?? "",
|
|
231
261
|
renderValue: (h) => h === "code_defined" ? "Code defined" : h === "true" ? "Users must define an ID" : h === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
|
|
232
262
|
children: [
|
|
233
|
-
/* @__PURE__ */ e(
|
|
234
|
-
/* @__PURE__ */ e(
|
|
235
|
-
/* @__PURE__ */ e(
|
|
263
|
+
/* @__PURE__ */ e(X, { value: "false", children: "Document ID is generated automatically" }),
|
|
264
|
+
/* @__PURE__ */ e(X, { value: "true", children: "Users must define an ID" }),
|
|
265
|
+
/* @__PURE__ */ e(X, { value: "optional", children: "Users can define an ID, but it is not required" })
|
|
236
266
|
]
|
|
237
267
|
}
|
|
238
268
|
) }),
|
|
239
269
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
240
270
|
/* @__PURE__ */ e(
|
|
241
|
-
|
|
271
|
+
ut,
|
|
242
272
|
{
|
|
243
273
|
position: "start",
|
|
244
274
|
label: "Collection group",
|
|
@@ -246,11 +276,11 @@ function bi({
|
|
|
246
276
|
value: c.collectionGroup ?? !1
|
|
247
277
|
}
|
|
248
278
|
),
|
|
249
|
-
/* @__PURE__ */ e(
|
|
279
|
+
/* @__PURE__ */ e(J, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." })
|
|
250
280
|
] }),
|
|
251
281
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
252
282
|
/* @__PURE__ */ e(
|
|
253
|
-
|
|
283
|
+
ut,
|
|
254
284
|
{
|
|
255
285
|
position: "start",
|
|
256
286
|
label: "Enable text search for this collection",
|
|
@@ -258,7 +288,7 @@ function bi({
|
|
|
258
288
|
value: c.textSearchEnabled ?? !1
|
|
259
289
|
}
|
|
260
290
|
),
|
|
261
|
-
/* @__PURE__ */ e(
|
|
291
|
+
/* @__PURE__ */ e(J, { 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." })
|
|
262
292
|
] })
|
|
263
293
|
] })
|
|
264
294
|
}
|
|
@@ -266,14 +296,14 @@ function bi({
|
|
|
266
296
|
] }),
|
|
267
297
|
/* @__PURE__ */ e("div", { style: { height: "52px" } }),
|
|
268
298
|
/* @__PURE__ */ e(
|
|
269
|
-
|
|
299
|
+
_e,
|
|
270
300
|
{
|
|
271
301
|
open: y,
|
|
272
302
|
onOpenChange: P,
|
|
273
303
|
maxWidth: "xl",
|
|
274
304
|
fullWidth: !0,
|
|
275
305
|
children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
|
|
276
|
-
|
|
306
|
+
vr,
|
|
277
307
|
{
|
|
278
308
|
selectedIcon: c.icon,
|
|
279
309
|
onIconSelected: (h) => {
|
|
@@ -285,23 +315,23 @@ function bi({
|
|
|
285
315
|
)
|
|
286
316
|
] }) });
|
|
287
317
|
}
|
|
288
|
-
function
|
|
318
|
+
function me(t) {
|
|
289
319
|
return "properties." + t.replaceAll(".", ".properties.");
|
|
290
320
|
}
|
|
291
|
-
function
|
|
321
|
+
function ir(t) {
|
|
292
322
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
|
|
293
323
|
}
|
|
294
|
-
function
|
|
324
|
+
function ye(t) {
|
|
295
325
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
|
|
296
326
|
}
|
|
297
327
|
function ne(t, r) {
|
|
298
328
|
return r ? `${r}.${t}` : t;
|
|
299
329
|
}
|
|
300
|
-
function
|
|
330
|
+
function nr(t, r) {
|
|
301
331
|
const n = r ? `${r}.${t}` : t;
|
|
302
|
-
return
|
|
332
|
+
return me(n);
|
|
303
333
|
}
|
|
304
|
-
function
|
|
334
|
+
function Ni({
|
|
305
335
|
enumValues: t,
|
|
306
336
|
onValuesChanged: r,
|
|
307
337
|
onError: n,
|
|
@@ -310,7 +340,7 @@ function Ci({
|
|
|
310
340
|
allowDataInference: o,
|
|
311
341
|
getData: d
|
|
312
342
|
}) {
|
|
313
|
-
const c =
|
|
343
|
+
const c = kt({
|
|
314
344
|
initialValues: { enumValues: t },
|
|
315
345
|
validateOnChange: !0,
|
|
316
346
|
validation: (p) => {
|
|
@@ -322,10 +352,10 @@ function Ci({
|
|
|
322
352
|
return n?.(f), s;
|
|
323
353
|
}
|
|
324
354
|
}), { values: u, errors: m } = c;
|
|
325
|
-
return
|
|
355
|
+
return ce(() => {
|
|
326
356
|
r && r(u.enumValues);
|
|
327
|
-
}, [u.enumValues]), /* @__PURE__ */ e(
|
|
328
|
-
|
|
357
|
+
}, [u.enumValues]), /* @__PURE__ */ e(Ot, { value: c, children: /* @__PURE__ */ e(
|
|
358
|
+
Pi,
|
|
329
359
|
{
|
|
330
360
|
enumValuesPath: "enumValues",
|
|
331
361
|
values: u,
|
|
@@ -337,7 +367,7 @@ function Ci({
|
|
|
337
367
|
}
|
|
338
368
|
) });
|
|
339
369
|
}
|
|
340
|
-
function
|
|
370
|
+
function Pi({
|
|
341
371
|
values: t,
|
|
342
372
|
errors: r,
|
|
343
373
|
disabled: n,
|
|
@@ -348,10 +378,10 @@ function Ni({
|
|
|
348
378
|
}) {
|
|
349
379
|
const {
|
|
350
380
|
setFieldValue: c
|
|
351
|
-
} =
|
|
381
|
+
} = Y(), [u, m] = G.useState(), [p, s] = G.useState(), [f, g] = G.useState(!1), y = G.useRef(/* @__PURE__ */ new Set()).current, P = (b, T) => {
|
|
352
382
|
const w = u === T, C = r?.enumValues && r?.enumValues[b];
|
|
353
383
|
return /* @__PURE__ */ e(
|
|
354
|
-
|
|
384
|
+
xi,
|
|
355
385
|
{
|
|
356
386
|
index: b,
|
|
357
387
|
disabled: n,
|
|
@@ -367,7 +397,7 @@ function Ni({
|
|
|
367
397
|
};
|
|
368
398
|
return /* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
369
399
|
/* @__PURE__ */ a("div", { className: "ml-3.5 flex flex-row items-center", children: [
|
|
370
|
-
/* @__PURE__ */ e(
|
|
400
|
+
/* @__PURE__ */ e(zr, {}),
|
|
371
401
|
/* @__PURE__ */ e(
|
|
372
402
|
V,
|
|
373
403
|
{
|
|
@@ -387,7 +417,7 @@ function Ni({
|
|
|
387
417
|
d && (g(!0), d?.().then((b) => {
|
|
388
418
|
if (!b)
|
|
389
419
|
return;
|
|
390
|
-
const T = b.flat(), w = Array.from(new Set(T)), C = t.enumValues, N =
|
|
420
|
+
const T = b.flat(), w = Array.from(new Set(T)), C = t.enumValues, N = ii(w).filter((F) => !C?.some((B) => B.id === F.id));
|
|
391
421
|
N.forEach((F) => {
|
|
392
422
|
y.add(F.id);
|
|
393
423
|
}), c(i, [...N, ...C], !0);
|
|
@@ -396,15 +426,15 @@ function Ni({
|
|
|
396
426
|
}).finally(() => g(!1)));
|
|
397
427
|
},
|
|
398
428
|
children: [
|
|
399
|
-
f ? /* @__PURE__ */ e(
|
|
429
|
+
f ? /* @__PURE__ */ e(He, { size: "small" }) : /* @__PURE__ */ e(ht, {}),
|
|
400
430
|
"Infer values from data"
|
|
401
431
|
]
|
|
402
432
|
}
|
|
403
433
|
)
|
|
404
434
|
] }),
|
|
405
|
-
/* @__PURE__ */ a(
|
|
435
|
+
/* @__PURE__ */ a(fe, { className: "p-4 m-1", children: [
|
|
406
436
|
/* @__PURE__ */ e(
|
|
407
|
-
|
|
437
|
+
br,
|
|
408
438
|
{
|
|
409
439
|
droppableId: i,
|
|
410
440
|
addLabel: "Add enum value",
|
|
@@ -419,7 +449,7 @@ function Ni({
|
|
|
419
449
|
}
|
|
420
450
|
),
|
|
421
451
|
/* @__PURE__ */ e(
|
|
422
|
-
|
|
452
|
+
wi,
|
|
423
453
|
{
|
|
424
454
|
index: p,
|
|
425
455
|
open: p !== void 0,
|
|
@@ -430,7 +460,7 @@ function Ni({
|
|
|
430
460
|
] })
|
|
431
461
|
] });
|
|
432
462
|
}
|
|
433
|
-
const
|
|
463
|
+
const xi = G.memo(
|
|
434
464
|
function({
|
|
435
465
|
index: r,
|
|
436
466
|
shouldUpdateId: n,
|
|
@@ -447,8 +477,8 @@ const Pi = Y.memo(
|
|
|
447
477
|
errors: s,
|
|
448
478
|
setFieldValue: f,
|
|
449
479
|
touched: g
|
|
450
|
-
} =
|
|
451
|
-
return
|
|
480
|
+
} = Y(), x = G.useRef(!I(m, `${i}[${r}].id`)), y = n || x.current, P = I(m, `${i}[${r}].id`), v = I(m, `${i}[${r}].label`), b = G.useRef(v);
|
|
481
|
+
return G.useEffect(() => {
|
|
452
482
|
(b.current === P || !P) && y && f(`${i}[${r}].id`, v), b.current = v;
|
|
453
483
|
}, [v]), /* @__PURE__ */ a(R, { children: [
|
|
454
484
|
/* @__PURE__ */ a("div", { className: "flex w-full align-center justify-center", children: [
|
|
@@ -456,25 +486,25 @@ const Pi = Y.memo(
|
|
|
456
486
|
$,
|
|
457
487
|
{
|
|
458
488
|
name: `${i}[${r}].label`,
|
|
459
|
-
as:
|
|
489
|
+
as: K,
|
|
460
490
|
className: "flex-grow",
|
|
461
491
|
required: !0,
|
|
462
492
|
disabled: d,
|
|
463
493
|
size: "small",
|
|
464
494
|
autoFocus: l,
|
|
465
495
|
autoComplete: "off",
|
|
466
|
-
endAdornment: c && /* @__PURE__ */ e(
|
|
496
|
+
endAdornment: c && /* @__PURE__ */ e(ht, { size: "small" }),
|
|
467
497
|
error: !!u?.label
|
|
468
498
|
}
|
|
469
499
|
),
|
|
470
|
-
!d && /* @__PURE__ */ e(
|
|
471
|
-
|
|
500
|
+
!d && /* @__PURE__ */ e(Mr, { color: "error", invisible: !u?.id, children: /* @__PURE__ */ e(
|
|
501
|
+
ie,
|
|
472
502
|
{
|
|
473
503
|
size: "small",
|
|
474
504
|
"aria-label": "edit",
|
|
475
505
|
className: "m-1",
|
|
476
506
|
onClick: () => o(),
|
|
477
|
-
children: /* @__PURE__ */ e(
|
|
507
|
+
children: /* @__PURE__ */ e($e, { size: "small" })
|
|
478
508
|
}
|
|
479
509
|
) })
|
|
480
510
|
] }),
|
|
@@ -497,10 +527,10 @@ const Pi = Y.memo(
|
|
|
497
527
|
] });
|
|
498
528
|
},
|
|
499
529
|
function(r, n) {
|
|
500
|
-
return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry &&
|
|
530
|
+
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;
|
|
501
531
|
}
|
|
502
532
|
);
|
|
503
|
-
function
|
|
533
|
+
function wi({
|
|
504
534
|
index: t,
|
|
505
535
|
open: r,
|
|
506
536
|
onClose: n,
|
|
@@ -508,21 +538,21 @@ function xi({
|
|
|
508
538
|
}) {
|
|
509
539
|
const {
|
|
510
540
|
errors: l
|
|
511
|
-
} =
|
|
541
|
+
} = Y(), o = t !== void 0 ? I(l, `${i}[${t}].id`) : void 0;
|
|
512
542
|
return /* @__PURE__ */ a(
|
|
513
|
-
|
|
543
|
+
_e,
|
|
514
544
|
{
|
|
515
545
|
maxWidth: "md",
|
|
516
546
|
"aria-labelledby": "enum-edit-dialog",
|
|
517
547
|
open: r,
|
|
518
548
|
onOpenChange: (d) => d ? void 0 : n(),
|
|
519
549
|
children: [
|
|
520
|
-
/* @__PURE__ */ e(
|
|
550
|
+
/* @__PURE__ */ e(Ae, { children: t !== void 0 && /* @__PURE__ */ a("div", { children: [
|
|
521
551
|
/* @__PURE__ */ e(
|
|
522
552
|
$,
|
|
523
553
|
{
|
|
524
554
|
name: `${i}[${t}].id`,
|
|
525
|
-
as:
|
|
555
|
+
as: K,
|
|
526
556
|
required: !0,
|
|
527
557
|
label: "ID",
|
|
528
558
|
size: "small",
|
|
@@ -530,9 +560,9 @@ function xi({
|
|
|
530
560
|
error: !!o
|
|
531
561
|
}
|
|
532
562
|
),
|
|
533
|
-
/* @__PURE__ */ e(
|
|
563
|
+
/* @__PURE__ */ e(J, { error: !!o, children: o ?? "Value saved in the data source" })
|
|
534
564
|
] }) }),
|
|
535
|
-
/* @__PURE__ */ e(
|
|
565
|
+
/* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
|
|
536
566
|
z,
|
|
537
567
|
{
|
|
538
568
|
autoFocus: !0,
|
|
@@ -546,7 +576,7 @@ function xi({
|
|
|
546
576
|
}
|
|
547
577
|
);
|
|
548
578
|
}
|
|
549
|
-
function
|
|
579
|
+
function oe({
|
|
550
580
|
field: t,
|
|
551
581
|
form: r,
|
|
552
582
|
label: n,
|
|
@@ -556,7 +586,7 @@ function le({
|
|
|
556
586
|
allowIndeterminate: d
|
|
557
587
|
}) {
|
|
558
588
|
const c = /* @__PURE__ */ e(
|
|
559
|
-
|
|
589
|
+
ut,
|
|
560
590
|
{
|
|
561
591
|
label: n,
|
|
562
592
|
size: o,
|
|
@@ -568,15 +598,15 @@ function le({
|
|
|
568
598
|
}
|
|
569
599
|
);
|
|
570
600
|
return i ? /* @__PURE__ */ e(
|
|
571
|
-
|
|
601
|
+
ee,
|
|
572
602
|
{
|
|
573
603
|
title: i,
|
|
574
604
|
children: c
|
|
575
605
|
}
|
|
576
606
|
) : c;
|
|
577
607
|
}
|
|
578
|
-
function
|
|
579
|
-
const { values: r, handleChange: n } =
|
|
608
|
+
function Fe({ disabled: t }) {
|
|
609
|
+
const { values: r, handleChange: n } = Y(), i = "validation.required", l = "validation.requiredMessage";
|
|
580
610
|
return /* @__PURE__ */ a(R, { children: [
|
|
581
611
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
582
612
|
$,
|
|
@@ -584,7 +614,7 @@ function Ee({ disabled: t }) {
|
|
|
584
614
|
name: i,
|
|
585
615
|
type: "checkbox",
|
|
586
616
|
children: ({ field: d, form: c }) => /* @__PURE__ */ e(
|
|
587
|
-
|
|
617
|
+
oe,
|
|
588
618
|
{
|
|
589
619
|
disabled: t,
|
|
590
620
|
label: "Required",
|
|
@@ -601,7 +631,7 @@ function Ee({ disabled: t }) {
|
|
|
601
631
|
name: "validation.unique",
|
|
602
632
|
type: "checkbox",
|
|
603
633
|
children: ({ field: d, form: c }) => /* @__PURE__ */ e(
|
|
604
|
-
|
|
634
|
+
oe,
|
|
605
635
|
{
|
|
606
636
|
disabled: t,
|
|
607
637
|
label: "Unique",
|
|
@@ -613,7 +643,7 @@ function Ee({ disabled: t }) {
|
|
|
613
643
|
}
|
|
614
644
|
) }),
|
|
615
645
|
I(r, i) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
616
|
-
|
|
646
|
+
K,
|
|
617
647
|
{
|
|
618
648
|
disabled: t,
|
|
619
649
|
value: I(r, l),
|
|
@@ -625,7 +655,7 @@ function Ee({ disabled: t }) {
|
|
|
625
655
|
) })
|
|
626
656
|
] });
|
|
627
657
|
}
|
|
628
|
-
function
|
|
658
|
+
function Ee({
|
|
629
659
|
length: t,
|
|
630
660
|
lowercase: r,
|
|
631
661
|
matches: n,
|
|
@@ -640,9 +670,9 @@ function Se({
|
|
|
640
670
|
values: m,
|
|
641
671
|
handleChange: p,
|
|
642
672
|
errors: s
|
|
643
|
-
} =
|
|
673
|
+
} = Y(), f = "validation.length", g = "validation.min", x = "validation.max", y = "validation.trim", P = "validation.matches", v = "validation.lowercase", b = "validation.uppercase", T = I(s, P), w = I(m, P), C = typeof w == "string" ? w : Cr(w);
|
|
644
674
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
645
|
-
/* @__PURE__ */ e(
|
|
675
|
+
/* @__PURE__ */ e(Fe, { disabled: c }),
|
|
646
676
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
647
677
|
r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
648
678
|
$,
|
|
@@ -650,7 +680,7 @@ function Se({
|
|
|
650
680
|
name: v,
|
|
651
681
|
type: "checkbox",
|
|
652
682
|
children: ({ field: O, form: N }) => /* @__PURE__ */ e(
|
|
653
|
-
|
|
683
|
+
oe,
|
|
654
684
|
{
|
|
655
685
|
label: "Lowercase",
|
|
656
686
|
disabled: c,
|
|
@@ -666,7 +696,7 @@ function Se({
|
|
|
666
696
|
name: b,
|
|
667
697
|
type: "checkbox",
|
|
668
698
|
children: ({ field: O, form: N }) => /* @__PURE__ */ e(
|
|
669
|
-
|
|
699
|
+
oe,
|
|
670
700
|
{
|
|
671
701
|
label: "Uppercase",
|
|
672
702
|
disabled: c,
|
|
@@ -682,7 +712,7 @@ function Se({
|
|
|
682
712
|
name: y,
|
|
683
713
|
type: "checkbox",
|
|
684
714
|
children: ({ field: O, form: N }) => /* @__PURE__ */ e(
|
|
685
|
-
|
|
715
|
+
oe,
|
|
686
716
|
{
|
|
687
717
|
label: "Trim",
|
|
688
718
|
disabled: c,
|
|
@@ -695,7 +725,7 @@ function Se({
|
|
|
695
725
|
] }),
|
|
696
726
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
697
727
|
t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
698
|
-
|
|
728
|
+
K,
|
|
699
729
|
{
|
|
700
730
|
value: I(m, f),
|
|
701
731
|
label: "Exact length",
|
|
@@ -707,7 +737,7 @@ function Se({
|
|
|
707
737
|
}
|
|
708
738
|
) }),
|
|
709
739
|
l && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
710
|
-
|
|
740
|
+
K,
|
|
711
741
|
{
|
|
712
742
|
value: I(m, g),
|
|
713
743
|
label: "Min length",
|
|
@@ -719,7 +749,7 @@ function Se({
|
|
|
719
749
|
}
|
|
720
750
|
) }),
|
|
721
751
|
i && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
722
|
-
|
|
752
|
+
K,
|
|
723
753
|
{
|
|
724
754
|
value: I(m, x),
|
|
725
755
|
label: "Max length",
|
|
@@ -736,7 +766,7 @@ function Se({
|
|
|
736
766
|
$,
|
|
737
767
|
{
|
|
738
768
|
name: P,
|
|
739
|
-
as:
|
|
769
|
+
as: K,
|
|
740
770
|
label: "Matches regex",
|
|
741
771
|
size: "small",
|
|
742
772
|
disabled: c,
|
|
@@ -744,11 +774,11 @@ function Se({
|
|
|
744
774
|
error: !!T
|
|
745
775
|
}
|
|
746
776
|
),
|
|
747
|
-
/* @__PURE__ */ e(
|
|
777
|
+
/* @__PURE__ */ e(J, { error: !!T, children: T ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
|
|
748
778
|
] })
|
|
749
779
|
] });
|
|
750
780
|
}
|
|
751
|
-
function
|
|
781
|
+
function Vt({
|
|
752
782
|
max: t = !0,
|
|
753
783
|
min: r = !0,
|
|
754
784
|
disabled: n
|
|
@@ -756,11 +786,11 @@ function It({
|
|
|
756
786
|
const {
|
|
757
787
|
values: i,
|
|
758
788
|
handleChange: l
|
|
759
|
-
} =
|
|
789
|
+
} = Y(), o = "validation.min", d = "validation.max";
|
|
760
790
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
761
|
-
/* @__PURE__ */ e(
|
|
791
|
+
/* @__PURE__ */ e(Fe, { disabled: n }),
|
|
762
792
|
r && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
763
|
-
|
|
793
|
+
K,
|
|
764
794
|
{
|
|
765
795
|
value: I(i, o),
|
|
766
796
|
disabled: n,
|
|
@@ -772,7 +802,7 @@ function It({
|
|
|
772
802
|
}
|
|
773
803
|
) }),
|
|
774
804
|
t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
775
|
-
|
|
805
|
+
K,
|
|
776
806
|
{
|
|
777
807
|
value: I(i, d),
|
|
778
808
|
disabled: n,
|
|
@@ -785,17 +815,17 @@ function It({
|
|
|
785
815
|
) })
|
|
786
816
|
] });
|
|
787
817
|
}
|
|
788
|
-
function
|
|
818
|
+
function Ce({
|
|
789
819
|
children: t
|
|
790
820
|
}) {
|
|
791
821
|
return /* @__PURE__ */ e(
|
|
792
|
-
|
|
822
|
+
wt,
|
|
793
823
|
{
|
|
794
824
|
initiallyExpanded: !1,
|
|
795
825
|
asField: !0,
|
|
796
826
|
className: "p-4",
|
|
797
827
|
title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
|
|
798
|
-
/* @__PURE__ */ e(
|
|
828
|
+
/* @__PURE__ */ e(Rr, {}),
|
|
799
829
|
/* @__PURE__ */ e(
|
|
800
830
|
V,
|
|
801
831
|
{
|
|
@@ -809,7 +839,7 @@ function Pe({
|
|
|
809
839
|
}
|
|
810
840
|
);
|
|
811
841
|
}
|
|
812
|
-
function
|
|
842
|
+
function Rt({
|
|
813
843
|
multiselect: t,
|
|
814
844
|
updateIds: r,
|
|
815
845
|
disabled: n,
|
|
@@ -821,10 +851,10 @@ function Ut({
|
|
|
821
851
|
values: d,
|
|
822
852
|
setFieldError: c,
|
|
823
853
|
setFieldValue: u
|
|
824
|
-
} =
|
|
854
|
+
} = Y(), m = Ve(), p = t ? "of.enumValues" : "enumValues", s = I(d, "defaultValue"), f = I(d, p), g = Zt(() => !f || typeof f == "boolean" ? [] : Nr(f) ?? [], [f]);
|
|
825
855
|
return /* @__PURE__ */ a(R, { children: [
|
|
826
856
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
827
|
-
|
|
857
|
+
Ni,
|
|
828
858
|
{
|
|
829
859
|
enumValues: g,
|
|
830
860
|
updateIds: r,
|
|
@@ -845,18 +875,18 @@ function Ut({
|
|
|
845
875
|
}
|
|
846
876
|
}
|
|
847
877
|
) }),
|
|
848
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
878
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ce, { children: [
|
|
849
879
|
!t && /* @__PURE__ */ e(
|
|
850
|
-
|
|
880
|
+
Ee,
|
|
851
881
|
{
|
|
852
882
|
disabled: n,
|
|
853
883
|
showErrors: i
|
|
854
884
|
}
|
|
855
885
|
),
|
|
856
|
-
t && /* @__PURE__ */ e(
|
|
886
|
+
t && /* @__PURE__ */ e(Vt, { disabled: n })
|
|
857
887
|
] }) }),
|
|
858
888
|
!t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
859
|
-
|
|
889
|
+
be,
|
|
860
890
|
{
|
|
861
891
|
disabled: n,
|
|
862
892
|
position: "item-aligned",
|
|
@@ -866,7 +896,7 @@ function Ut({
|
|
|
866
896
|
label: "Default value",
|
|
867
897
|
value: s ?? "",
|
|
868
898
|
children: g.filter((y) => !!y?.id).map((y) => /* @__PURE__ */ e(
|
|
869
|
-
|
|
899
|
+
X,
|
|
870
900
|
{
|
|
871
901
|
value: y.id?.toString(),
|
|
872
902
|
children: y.label
|
|
@@ -877,14 +907,14 @@ function Ut({
|
|
|
877
907
|
) })
|
|
878
908
|
] });
|
|
879
909
|
}
|
|
880
|
-
const
|
|
910
|
+
const at = {
|
|
881
911
|
"image/*": "Images",
|
|
882
912
|
"video/*": "Videos",
|
|
883
913
|
"audio/*": "Audio files",
|
|
884
914
|
"application/*": "Files (pdf, zip, csv, excel...)",
|
|
885
915
|
"text/*": "Text files"
|
|
886
916
|
};
|
|
887
|
-
function
|
|
917
|
+
function Ut({
|
|
888
918
|
multiple: t,
|
|
889
919
|
existing: r,
|
|
890
920
|
disabled: n
|
|
@@ -892,15 +922,15 @@ function jt({
|
|
|
892
922
|
const {
|
|
893
923
|
values: i,
|
|
894
924
|
setFieldValue: l
|
|
895
|
-
} =
|
|
896
|
-
b ? b.includes("all") || b.length >= Object.keys(
|
|
925
|
+
} = Y(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, c = `${o}.fileName`, u = `${o}.storagePath`, m = `${o}.storeUrl`, p = I(i, c) ?? "{rand}_{file}", s = I(i, u) ?? "/", f = I(i, d), g = Array.isArray(f) ? f : void 0, x = !g || g.length === 0, y = (b) => {
|
|
926
|
+
b ? b.includes("all") || b.length >= Object.keys(at).length ? l(d, void 0) : x ? l(d, Object.keys(at).filter((T) => !b.includes(T))) : l(d, b) : l(d, void 0);
|
|
897
927
|
}, P = typeof p == "function", v = typeof s == "function";
|
|
898
928
|
return /* @__PURE__ */ a(R, { children: [
|
|
899
929
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
900
|
-
|
|
930
|
+
wt,
|
|
901
931
|
{
|
|
902
932
|
title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
|
|
903
|
-
/* @__PURE__ */ e(
|
|
933
|
+
/* @__PURE__ */ e(Ur, {}),
|
|
904
934
|
/* @__PURE__ */ e(
|
|
905
935
|
V,
|
|
906
936
|
{
|
|
@@ -912,27 +942,27 @@ function jt({
|
|
|
912
942
|
] }),
|
|
913
943
|
children: /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
|
|
914
944
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
915
|
-
|
|
945
|
+
jr,
|
|
916
946
|
{
|
|
917
947
|
disabled: n,
|
|
918
948
|
name: d,
|
|
919
949
|
value: g ?? [],
|
|
920
950
|
onMultiValueChange: y,
|
|
921
951
|
label: x ? void 0 : "Allowed file types",
|
|
922
|
-
renderValues: (b) => !b || b.length === 0 ? "All file types allowed" : b.map((T) =>
|
|
952
|
+
renderValues: (b) => !b || b.length === 0 ? "All file types allowed" : b.map((T) => at[T]).filter((T) => !!T).join(", "),
|
|
923
953
|
children: [
|
|
924
|
-
/* @__PURE__ */ a(
|
|
954
|
+
/* @__PURE__ */ a(Et, { value: "all", className: "flex items-center gap-2", children: [
|
|
925
955
|
/* @__PURE__ */ e(
|
|
926
|
-
|
|
956
|
+
St,
|
|
927
957
|
{
|
|
928
958
|
checked: !g
|
|
929
959
|
}
|
|
930
960
|
),
|
|
931
961
|
"All"
|
|
932
962
|
] }, "all"),
|
|
933
|
-
Object.entries(
|
|
963
|
+
Object.entries(at).map(([b, T]) => /* @__PURE__ */ a(Et, { value: b, className: "flex items-center gap-2", children: [
|
|
934
964
|
/* @__PURE__ */ e(
|
|
935
|
-
|
|
965
|
+
St,
|
|
936
966
|
{
|
|
937
967
|
checked: x || g.indexOf(b) > -1
|
|
938
968
|
}
|
|
@@ -955,7 +985,7 @@ function jt({
|
|
|
955
985
|
$,
|
|
956
986
|
{
|
|
957
987
|
name: c,
|
|
958
|
-
as:
|
|
988
|
+
as: K,
|
|
959
989
|
label: "File name",
|
|
960
990
|
size: "small",
|
|
961
991
|
disabled: P || n,
|
|
@@ -967,7 +997,7 @@ function jt({
|
|
|
967
997
|
$,
|
|
968
998
|
{
|
|
969
999
|
name: u,
|
|
970
|
-
as:
|
|
1000
|
+
as: K,
|
|
971
1001
|
label: "Storage path",
|
|
972
1002
|
disabled: v || n,
|
|
973
1003
|
size: "small",
|
|
@@ -992,7 +1022,7 @@ function jt({
|
|
|
992
1022
|
name: m,
|
|
993
1023
|
type: "checkbox",
|
|
994
1024
|
children: ({ field: b, form: T }) => /* @__PURE__ */ e(
|
|
995
|
-
|
|
1025
|
+
oe,
|
|
996
1026
|
{
|
|
997
1027
|
label: "Save URL instead of storage path",
|
|
998
1028
|
disabled: r || n,
|
|
@@ -1007,33 +1037,33 @@ function jt({
|
|
|
1007
1037
|
] })
|
|
1008
1038
|
}
|
|
1009
1039
|
) }),
|
|
1010
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
1011
|
-
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(
|
|
1012
|
-
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1040
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ce, { children: [
|
|
1041
|
+
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Fe, { disabled: n }) }),
|
|
1042
|
+
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Vt, { disabled: n }) })
|
|
1013
1043
|
] }) })
|
|
1014
1044
|
] });
|
|
1015
1045
|
}
|
|
1016
|
-
function
|
|
1017
|
-
if (
|
|
1046
|
+
function Ue(t) {
|
|
1047
|
+
if (re(t) || re(t))
|
|
1018
1048
|
return !1;
|
|
1019
1049
|
{
|
|
1020
1050
|
const r = t;
|
|
1021
1051
|
return r.dataType === "array" && typeof r.of == "function" || r.dataType === "array" && Array.isArray(r.of) ? !1 : !!r.editable;
|
|
1022
1052
|
}
|
|
1023
1053
|
}
|
|
1024
|
-
function
|
|
1025
|
-
return Object.entries(t).filter(([r, n]) =>
|
|
1054
|
+
function Ti(t) {
|
|
1055
|
+
return Object.entries(t).filter(([r, n]) => Ue(n)).map(([r, n]) => {
|
|
1026
1056
|
const i = n;
|
|
1027
|
-
if (
|
|
1057
|
+
if (Ue(i))
|
|
1028
1058
|
return i.dataType === "map" && i.properties ? {
|
|
1029
1059
|
[r]: {
|
|
1030
1060
|
...i,
|
|
1031
|
-
properties:
|
|
1061
|
+
properties: Ti(i.properties)
|
|
1032
1062
|
}
|
|
1033
1063
|
} : { [r]: i };
|
|
1034
1064
|
}).filter((r) => !!r).reduce((r, n) => ({ ...r, ...n }), {});
|
|
1035
1065
|
}
|
|
1036
|
-
function
|
|
1066
|
+
function ar({
|
|
1037
1067
|
property: t,
|
|
1038
1068
|
onClick: r,
|
|
1039
1069
|
hasError: n,
|
|
@@ -1041,31 +1071,31 @@ function or({
|
|
|
1041
1071
|
includeEditButton: l,
|
|
1042
1072
|
selected: o
|
|
1043
1073
|
}) {
|
|
1044
|
-
const { propertyConfigs: d } =
|
|
1045
|
-
|
|
1074
|
+
const { propertyConfigs: d } = Se(), c = je(t, d);
|
|
1075
|
+
Ue(t);
|
|
1046
1076
|
const u = n ? "border-red-500 dark:border-red-500 border-opacity-100 dark:border-opacity-100 ring-0 dark:ring-0" : o ? "border-primary" : "border-transparent";
|
|
1047
|
-
return n && console.log("PropertyFieldPreview", t), /* @__PURE__ */ e(
|
|
1077
|
+
return n && console.log("PropertyFieldPreview", t), /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ a(
|
|
1048
1078
|
"div",
|
|
1049
1079
|
{
|
|
1050
1080
|
onClick: r,
|
|
1051
1081
|
className: "flex flex-row w-full cursor-pointer",
|
|
1052
1082
|
children: [
|
|
1053
|
-
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(
|
|
1083
|
+
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(qe, { propertyConfig: c }) }),
|
|
1054
1084
|
/* @__PURE__ */ a(
|
|
1055
|
-
|
|
1085
|
+
fe,
|
|
1056
1086
|
{
|
|
1057
|
-
className:
|
|
1087
|
+
className: he(
|
|
1058
1088
|
"border",
|
|
1059
1089
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
1060
|
-
|
|
1061
|
-
r ?
|
|
1062
|
-
o ?
|
|
1090
|
+
Qt,
|
|
1091
|
+
r ? Xt : "",
|
|
1092
|
+
o ? er : "",
|
|
1063
1093
|
"flex-grow p-4 border transition-colors duration-200",
|
|
1064
1094
|
u
|
|
1065
1095
|
),
|
|
1066
1096
|
children: [
|
|
1067
1097
|
/* @__PURE__ */ a("div", { className: "w-full flex flex-col", children: [
|
|
1068
|
-
i && /* @__PURE__ */ e(
|
|
1098
|
+
i && /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
1069
1099
|
V,
|
|
1070
1100
|
{
|
|
1071
1101
|
variant: "body1",
|
|
@@ -1075,7 +1105,7 @@ function or({
|
|
|
1075
1105
|
}
|
|
1076
1106
|
) }),
|
|
1077
1107
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center", children: [
|
|
1078
|
-
/* @__PURE__ */ e(
|
|
1108
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
1079
1109
|
V,
|
|
1080
1110
|
{
|
|
1081
1111
|
className: "flex-grow pr-2",
|
|
@@ -1085,7 +1115,7 @@ function or({
|
|
|
1085
1115
|
children: c?.name
|
|
1086
1116
|
}
|
|
1087
1117
|
) }),
|
|
1088
|
-
/* @__PURE__ */ e(
|
|
1118
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
1089
1119
|
V,
|
|
1090
1120
|
{
|
|
1091
1121
|
variant: "body2",
|
|
@@ -1104,13 +1134,13 @@ function or({
|
|
|
1104
1134
|
}
|
|
1105
1135
|
) });
|
|
1106
1136
|
}
|
|
1107
|
-
function
|
|
1137
|
+
function ki({
|
|
1108
1138
|
name: t,
|
|
1109
1139
|
selected: r,
|
|
1110
1140
|
onClick: n,
|
|
1111
1141
|
property: i
|
|
1112
1142
|
}) {
|
|
1113
|
-
const { propertyConfigs: l } =
|
|
1143
|
+
const { propertyConfigs: l } = Se(), o = !re(i) && i ? je(i, l) : void 0;
|
|
1114
1144
|
return /* @__PURE__ */ a(
|
|
1115
1145
|
"div",
|
|
1116
1146
|
{
|
|
@@ -1118,24 +1148,24 @@ function Ti({
|
|
|
1118
1148
|
className: "flex flex-row w-full cursor-pointer",
|
|
1119
1149
|
children: [
|
|
1120
1150
|
/* @__PURE__ */ a("div", { className: "relative m-4", children: [
|
|
1121
|
-
o && /* @__PURE__ */ e(
|
|
1151
|
+
o && /* @__PURE__ */ e(qe, { propertyConfig: o }),
|
|
1122
1152
|
!o && /* @__PURE__ */ e(
|
|
1123
1153
|
"div",
|
|
1124
1154
|
{
|
|
1125
1155
|
className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
|
|
1126
|
-
children: /* @__PURE__ */ e(
|
|
1156
|
+
children: /* @__PURE__ */ e(qr, { color: "inherit", size: "medium" })
|
|
1127
1157
|
}
|
|
1128
1158
|
),
|
|
1129
|
-
/* @__PURE__ */ e(
|
|
1159
|
+
/* @__PURE__ */ e(Lr, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
|
|
1130
1160
|
] }),
|
|
1131
1161
|
/* @__PURE__ */ e(
|
|
1132
|
-
|
|
1162
|
+
fe,
|
|
1133
1163
|
{
|
|
1134
|
-
className:
|
|
1164
|
+
className: he(
|
|
1135
1165
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
1136
|
-
|
|
1137
|
-
n ?
|
|
1138
|
-
r ?
|
|
1166
|
+
Qt,
|
|
1167
|
+
n ? Xt : "",
|
|
1168
|
+
r ? er : "",
|
|
1139
1169
|
"flex-grow p-4 border transition-colors duration-200",
|
|
1140
1170
|
r ? "border-primary" : "border-transparent"
|
|
1141
1171
|
),
|
|
@@ -1160,7 +1190,7 @@ function Ti({
|
|
|
1160
1190
|
children: o?.name
|
|
1161
1191
|
}
|
|
1162
1192
|
),
|
|
1163
|
-
i && !
|
|
1193
|
+
i && !re(i) && /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
1164
1194
|
V,
|
|
1165
1195
|
{
|
|
1166
1196
|
variant: "body2",
|
|
@@ -1169,7 +1199,7 @@ function Ti({
|
|
|
1169
1199
|
children: i.dataType
|
|
1170
1200
|
}
|
|
1171
1201
|
) }),
|
|
1172
|
-
i &&
|
|
1202
|
+
i && re(i) && /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
1173
1203
|
V,
|
|
1174
1204
|
{
|
|
1175
1205
|
variant: "body2",
|
|
@@ -1178,7 +1208,7 @@ function Ti({
|
|
|
1178
1208
|
children: "This property is defined as a property builder in code"
|
|
1179
1209
|
}
|
|
1180
1210
|
) }),
|
|
1181
|
-
!i && /* @__PURE__ */ e(
|
|
1211
|
+
!i && /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
1182
1212
|
V,
|
|
1183
1213
|
{
|
|
1184
1214
|
variant: "body2",
|
|
@@ -1195,7 +1225,7 @@ function Ti({
|
|
|
1195
1225
|
}
|
|
1196
1226
|
);
|
|
1197
1227
|
}
|
|
1198
|
-
const
|
|
1228
|
+
const ft = G.memo(
|
|
1199
1229
|
function({
|
|
1200
1230
|
namespace: r,
|
|
1201
1231
|
selectedPropertyKey: n,
|
|
@@ -1210,13 +1240,13 @@ const gt = Y.memo(
|
|
|
1210
1240
|
inferredPropertyKeys: s,
|
|
1211
1241
|
collectionEditable: f
|
|
1212
1242
|
}) {
|
|
1213
|
-
const g = o ?? Object.keys(l)
|
|
1243
|
+
const g = o ?? Object.keys(l);
|
|
1244
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(oi, { onDragEnd: (y) => {
|
|
1214
1245
|
if (!y.destination)
|
|
1215
1246
|
return;
|
|
1216
1247
|
const P = y.source.index, v = y.destination.index, b = Array.from(g), [T] = b.splice(P, 1);
|
|
1217
1248
|
b.splice(v, 0, T), u && u(b, r);
|
|
1218
|
-
},
|
|
1219
|
-
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ai, { onDragEnd: x, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${r}`, children: (y, P) => /* @__PURE__ */ a(
|
|
1249
|
+
}, children: /* @__PURE__ */ e(li, { droppableId: `droppable_${r}`, children: (y, P) => /* @__PURE__ */ a(
|
|
1220
1250
|
"div",
|
|
1221
1251
|
{
|
|
1222
1252
|
...y.droppableProps,
|
|
@@ -1226,12 +1256,12 @@ const gt = Y.memo(
|
|
|
1226
1256
|
g && g.map((v, b) => {
|
|
1227
1257
|
const T = l[v], w = d?.find((C) => C.key === v);
|
|
1228
1258
|
return !T && !w ? (console.warn(`Property ${v} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
|
|
1229
|
-
|
|
1259
|
+
si,
|
|
1230
1260
|
{
|
|
1231
1261
|
draggableId: `array_field_${r}_${v}}`,
|
|
1232
1262
|
index: b,
|
|
1233
|
-
children: (C, O) => /* @__PURE__ */ e(
|
|
1234
|
-
|
|
1263
|
+
children: (C, O) => /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
1264
|
+
Oi,
|
|
1235
1265
|
{
|
|
1236
1266
|
propertyKey: v,
|
|
1237
1267
|
propertyOrBuilder: T,
|
|
@@ -1258,12 +1288,12 @@ const gt = Y.memo(
|
|
|
1258
1288
|
},
|
|
1259
1289
|
(t, r) => {
|
|
1260
1290
|
const n = r.selectedPropertyKey?.startsWith(r.namespace ?? ""), i = t.selectedPropertyKey?.startsWith(t.namespace ?? "");
|
|
1261
|
-
return n || i ? !1 :
|
|
1291
|
+
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) &&
|
|
1262
1292
|
// equal(prevProps.onPropertyRemove, nextProps.onPropertyRemove) &&
|
|
1263
1293
|
t.namespace === r.namespace && t.collectionEditable === r.collectionEditable;
|
|
1264
1294
|
}
|
|
1265
1295
|
);
|
|
1266
|
-
function
|
|
1296
|
+
function Oi({
|
|
1267
1297
|
propertyKey: t,
|
|
1268
1298
|
namespace: r,
|
|
1269
1299
|
propertyOrBuilder: n,
|
|
@@ -1277,12 +1307,12 @@ function ki({
|
|
|
1277
1307
|
inferredPropertyKeys: p,
|
|
1278
1308
|
collectionEditable: s
|
|
1279
1309
|
}) {
|
|
1280
|
-
const f = p?.includes(r ? `${r}.${t}` : t), g = ne(t, r), y =
|
|
1310
|
+
const f = p?.includes(r ? `${r}.${t}` : t), g = ne(t, r), y = nr(t, r) in d;
|
|
1281
1311
|
let P;
|
|
1282
1312
|
if (typeof n == "object") {
|
|
1283
1313
|
const T = n;
|
|
1284
1314
|
T.dataType === "map" && T.properties && (P = /* @__PURE__ */ e(
|
|
1285
|
-
|
|
1315
|
+
ft,
|
|
1286
1316
|
{
|
|
1287
1317
|
selectedPropertyKey: o,
|
|
1288
1318
|
namespace: g,
|
|
@@ -1296,7 +1326,7 @@ function ki({
|
|
|
1296
1326
|
}
|
|
1297
1327
|
));
|
|
1298
1328
|
}
|
|
1299
|
-
const v = o === g, b = n && (s && !
|
|
1329
|
+
const v = o === g, b = n && (s && !re(n) || Ue(n));
|
|
1300
1330
|
return /* @__PURE__ */ a(
|
|
1301
1331
|
"div",
|
|
1302
1332
|
{
|
|
@@ -1308,7 +1338,7 @@ function ki({
|
|
|
1308
1338
|
P && /* @__PURE__ */ e(
|
|
1309
1339
|
"div",
|
|
1310
1340
|
{
|
|
1311
|
-
className: "absolute border-l " +
|
|
1341
|
+
className: "absolute border-l " + Tt,
|
|
1312
1342
|
style: {
|
|
1313
1343
|
left: "32px",
|
|
1314
1344
|
top: "64px",
|
|
@@ -1316,8 +1346,8 @@ function ki({
|
|
|
1316
1346
|
}
|
|
1317
1347
|
}
|
|
1318
1348
|
),
|
|
1319
|
-
!
|
|
1320
|
-
|
|
1349
|
+
!re(n) && !i && b ? /* @__PURE__ */ e(
|
|
1350
|
+
ar,
|
|
1321
1351
|
{
|
|
1322
1352
|
property: n,
|
|
1323
1353
|
onClick: c ? () => c(t, r) : void 0,
|
|
@@ -1326,7 +1356,7 @@ function ki({
|
|
|
1326
1356
|
hasError: y
|
|
1327
1357
|
}
|
|
1328
1358
|
) : /* @__PURE__ */ e(
|
|
1329
|
-
|
|
1359
|
+
ki,
|
|
1330
1360
|
{
|
|
1331
1361
|
name: t,
|
|
1332
1362
|
property: n,
|
|
@@ -1335,22 +1365,22 @@ function ki({
|
|
|
1335
1365
|
}
|
|
1336
1366
|
),
|
|
1337
1367
|
/* @__PURE__ */ a("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
|
|
1338
|
-
f && /* @__PURE__ */ e(
|
|
1339
|
-
m && /* @__PURE__ */ e(
|
|
1340
|
-
|
|
1368
|
+
f && /* @__PURE__ */ e(ee, { title: "Inferred property", children: /* @__PURE__ */ e(ht, { size: "small", className: "p-2" }) }),
|
|
1369
|
+
m && /* @__PURE__ */ e(ee, { title: "Remove", children: /* @__PURE__ */ e(
|
|
1370
|
+
ie,
|
|
1341
1371
|
{
|
|
1342
1372
|
size: "small",
|
|
1343
1373
|
color: "inherit",
|
|
1344
1374
|
onClick: () => m(t, r),
|
|
1345
|
-
children: /* @__PURE__ */ e(
|
|
1375
|
+
children: /* @__PURE__ */ e($r, { size: "small" })
|
|
1346
1376
|
}
|
|
1347
1377
|
) }),
|
|
1348
|
-
u && /* @__PURE__ */ e(
|
|
1349
|
-
|
|
1378
|
+
u && /* @__PURE__ */ e(ee, { title: "Move", children: /* @__PURE__ */ e(
|
|
1379
|
+
ie,
|
|
1350
1380
|
{
|
|
1351
1381
|
component: "span",
|
|
1352
1382
|
size: "small",
|
|
1353
|
-
children: /* @__PURE__ */ e(
|
|
1383
|
+
children: /* @__PURE__ */ e(Hr, { size: "small" })
|
|
1354
1384
|
}
|
|
1355
1385
|
) })
|
|
1356
1386
|
] }),
|
|
@@ -1359,11 +1389,11 @@ function ki({
|
|
|
1359
1389
|
}
|
|
1360
1390
|
);
|
|
1361
1391
|
}
|
|
1362
|
-
function
|
|
1392
|
+
function Vi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i, collectionEditable: l }) {
|
|
1363
1393
|
const {
|
|
1364
1394
|
values: o,
|
|
1365
1395
|
setFieldValue: d
|
|
1366
|
-
} =
|
|
1396
|
+
} = Y(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), x = ({
|
|
1367
1397
|
id: w,
|
|
1368
1398
|
property: C
|
|
1369
1399
|
}) => {
|
|
@@ -1375,15 +1405,15 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1375
1405
|
}, !1);
|
|
1376
1406
|
const O = o.propertiesOrder ?? Object.keys(o.properties ?? {}), N = O.includes(w) ? O : [...O, w];
|
|
1377
1407
|
d("propertiesOrder", N, !1), u(!1);
|
|
1378
|
-
}, y =
|
|
1408
|
+
}, y = (w, C) => {
|
|
1379
1409
|
const O = w ? ne(w, C) : void 0;
|
|
1380
1410
|
if (!O)
|
|
1381
1411
|
throw Error("collection editor miss config");
|
|
1382
|
-
const N =
|
|
1383
|
-
d(N, void 0, !1), d(F,
|
|
1384
|
-
},
|
|
1385
|
-
d(
|
|
1386
|
-
}
|
|
1412
|
+
const N = me(O), F = ye(C), B = I(o, F) ?? Object.keys(I(o, ir(C)));
|
|
1413
|
+
d(N, void 0, !1), d(F, B.filter((_) => _ !== w), !1), u(!1), p(void 0), f(void 0);
|
|
1414
|
+
}, P = m ? ne(m, s) : void 0, v = P ? I(o.properties, P.replaceAll(".", ".properties.")) : void 0, b = !g || g.length < 1, T = (w, C) => {
|
|
1415
|
+
d(ye(C), w, !1);
|
|
1416
|
+
};
|
|
1387
1417
|
return /* @__PURE__ */ a(R, { children: [
|
|
1388
1418
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1389
1419
|
/* @__PURE__ */ a("div", { className: "flex justify-between items-end my-4", children: [
|
|
@@ -1394,7 +1424,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1394
1424
|
color: "primary",
|
|
1395
1425
|
variant: "outlined",
|
|
1396
1426
|
onClick: () => u(!0),
|
|
1397
|
-
startIcon: /* @__PURE__ */ e(
|
|
1427
|
+
startIcon: /* @__PURE__ */ e(de, {}),
|
|
1398
1428
|
children: [
|
|
1399
1429
|
"Add property to ",
|
|
1400
1430
|
o.name ?? "this group"
|
|
@@ -1402,9 +1432,9 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1402
1432
|
}
|
|
1403
1433
|
)
|
|
1404
1434
|
] }),
|
|
1405
|
-
/* @__PURE__ */ a(
|
|
1435
|
+
/* @__PURE__ */ a(fe, { className: "p-2 pl-8", children: [
|
|
1406
1436
|
/* @__PURE__ */ e(
|
|
1407
|
-
|
|
1437
|
+
ft,
|
|
1408
1438
|
{
|
|
1409
1439
|
properties: o.properties ?? {},
|
|
1410
1440
|
propertiesOrder: g,
|
|
@@ -1428,7 +1458,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1428
1458
|
] }),
|
|
1429
1459
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1430
1460
|
/* @__PURE__ */ e(
|
|
1431
|
-
|
|
1461
|
+
ut,
|
|
1432
1462
|
{
|
|
1433
1463
|
position: "start",
|
|
1434
1464
|
size: "small",
|
|
@@ -1437,10 +1467,10 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1437
1467
|
value: o.spreadChildren ?? !1
|
|
1438
1468
|
}
|
|
1439
1469
|
),
|
|
1440
|
-
/* @__PURE__ */ e(
|
|
1470
|
+
/* @__PURE__ */ e(J, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
|
|
1441
1471
|
] }),
|
|
1442
1472
|
/* @__PURE__ */ e(
|
|
1443
|
-
|
|
1473
|
+
Oe,
|
|
1444
1474
|
{
|
|
1445
1475
|
inArray: !1,
|
|
1446
1476
|
forceShowErrors: !1,
|
|
@@ -1468,7 +1498,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
|
|
|
1468
1498
|
)
|
|
1469
1499
|
] });
|
|
1470
1500
|
}
|
|
1471
|
-
function
|
|
1501
|
+
function Ii({
|
|
1472
1502
|
showErrors: t,
|
|
1473
1503
|
existing: r,
|
|
1474
1504
|
disabled: n,
|
|
@@ -1483,9 +1513,9 @@ function Vi({
|
|
|
1483
1513
|
errors: m,
|
|
1484
1514
|
setFieldValue: p,
|
|
1485
1515
|
touched: s
|
|
1486
|
-
} =
|
|
1516
|
+
} = Y(), [f, g] = j(!1), x = I(c, "of"), y = I(s, "of") && I(m, "of"), P = ({ id: b, property: T, namespace: w }) => {
|
|
1487
1517
|
console.log("onPropertyChanged", b, T, w), p("of", T);
|
|
1488
|
-
}, v = x &&
|
|
1518
|
+
}, v = x && je(x, o);
|
|
1489
1519
|
return /* @__PURE__ */ a(R, { children: [
|
|
1490
1520
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1491
1521
|
/* @__PURE__ */ e(V, { variant: "subtitle2", children: "Repeat component" }),
|
|
@@ -1494,9 +1524,9 @@ function Vi({
|
|
|
1494
1524
|
{
|
|
1495
1525
|
name: "of",
|
|
1496
1526
|
value: x,
|
|
1497
|
-
children: ({}) => /* @__PURE__ */ a(
|
|
1527
|
+
children: ({}) => /* @__PURE__ */ a(fe, { className: "p-2 mt-4", children: [
|
|
1498
1528
|
x && /* @__PURE__ */ e(
|
|
1499
|
-
|
|
1529
|
+
ar,
|
|
1500
1530
|
{
|
|
1501
1531
|
property: x,
|
|
1502
1532
|
onClick: n ? void 0 : () => g(!0),
|
|
@@ -1520,7 +1550,7 @@ function Vi({
|
|
|
1520
1550
|
}
|
|
1521
1551
|
),
|
|
1522
1552
|
/* @__PURE__ */ e(
|
|
1523
|
-
|
|
1553
|
+
Oe,
|
|
1524
1554
|
{
|
|
1525
1555
|
inArray: !0,
|
|
1526
1556
|
open: f,
|
|
@@ -1542,10 +1572,10 @@ function Vi({
|
|
|
1542
1572
|
}
|
|
1543
1573
|
)
|
|
1544
1574
|
] }),
|
|
1545
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1575
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Vt, { disabled: n }) }) })
|
|
1546
1576
|
] });
|
|
1547
1577
|
}
|
|
1548
|
-
const
|
|
1578
|
+
const _i = G.forwardRef(
|
|
1549
1579
|
function({
|
|
1550
1580
|
showErrors: r,
|
|
1551
1581
|
disabledId: n,
|
|
@@ -1560,7 +1590,7 @@ const Ii = Y.forwardRef(
|
|
|
1560
1590
|
setFieldTouched: p,
|
|
1561
1591
|
touched: s,
|
|
1562
1592
|
validate: f
|
|
1563
|
-
} =
|
|
1593
|
+
} = Y(), g = "name", x = r && I(c, g), y = "id", P = r && I(c, y), v = "description", b = r && I(c, v);
|
|
1564
1594
|
return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 col-span-12", children: [
|
|
1565
1595
|
/* @__PURE__ */ a("div", { children: [
|
|
1566
1596
|
/* @__PURE__ */ e(
|
|
@@ -1568,11 +1598,11 @@ const Ii = Y.forwardRef(
|
|
|
1568
1598
|
{
|
|
1569
1599
|
name: g,
|
|
1570
1600
|
inputRef: d,
|
|
1571
|
-
as:
|
|
1601
|
+
as: K,
|
|
1572
1602
|
value: u[g],
|
|
1573
1603
|
onChange: (T) => {
|
|
1574
1604
|
const w = T.target.value;
|
|
1575
|
-
!I(s, y) && l && m(y, w ?
|
|
1605
|
+
!I(s, y) && l && m(y, w ? Nt(w) : "", !1), m(g, w, !0), p(g, !0);
|
|
1576
1606
|
},
|
|
1577
1607
|
style: { fontSize: 20 },
|
|
1578
1608
|
placeholder: "Field name",
|
|
@@ -1581,19 +1611,19 @@ const Ii = Y.forwardRef(
|
|
|
1581
1611
|
error: !!x
|
|
1582
1612
|
}
|
|
1583
1613
|
),
|
|
1584
|
-
/* @__PURE__ */ e(
|
|
1614
|
+
/* @__PURE__ */ e(J, { error: !!x, children: x })
|
|
1585
1615
|
] }),
|
|
1586
1616
|
/* @__PURE__ */ a("div", { children: [
|
|
1587
1617
|
/* @__PURE__ */ e(
|
|
1588
1618
|
$,
|
|
1589
1619
|
{
|
|
1590
1620
|
name: y,
|
|
1591
|
-
as:
|
|
1621
|
+
as: K,
|
|
1592
1622
|
label: "ID",
|
|
1593
1623
|
value: u[y],
|
|
1594
1624
|
onChange: (T) => {
|
|
1595
1625
|
const w = T.target.value;
|
|
1596
|
-
!I(s, g) && l && m(g, w ?
|
|
1626
|
+
!I(s, g) && l && m(g, w ? xt(w) : ""), m(y, w, !0), p(y, !0);
|
|
1597
1627
|
},
|
|
1598
1628
|
disabled: n || i,
|
|
1599
1629
|
required: !0,
|
|
@@ -1601,34 +1631,34 @@ const Ii = Y.forwardRef(
|
|
|
1601
1631
|
error: !!P
|
|
1602
1632
|
}
|
|
1603
1633
|
),
|
|
1604
|
-
/* @__PURE__ */ e(
|
|
1634
|
+
/* @__PURE__ */ e(J, { error: !!P, children: P })
|
|
1605
1635
|
] }),
|
|
1606
1636
|
/* @__PURE__ */ a("div", { children: [
|
|
1607
1637
|
/* @__PURE__ */ e(
|
|
1608
1638
|
$,
|
|
1609
1639
|
{
|
|
1610
1640
|
name: v,
|
|
1611
|
-
as:
|
|
1641
|
+
as: K,
|
|
1612
1642
|
label: "Description",
|
|
1613
1643
|
disabled: i,
|
|
1614
1644
|
error: !!b
|
|
1615
1645
|
}
|
|
1616
1646
|
),
|
|
1617
|
-
/* @__PURE__ */ e(
|
|
1647
|
+
/* @__PURE__ */ e(J, { error: !!b, children: b })
|
|
1618
1648
|
] })
|
|
1619
1649
|
] });
|
|
1620
1650
|
}
|
|
1621
1651
|
);
|
|
1622
|
-
function
|
|
1652
|
+
function Fi({
|
|
1623
1653
|
widgetId: t,
|
|
1624
1654
|
disabled: r,
|
|
1625
1655
|
showErrors: n
|
|
1626
1656
|
}) {
|
|
1627
|
-
const { values: i, setFieldValue: l } =
|
|
1657
|
+
const { values: i, setFieldValue: l } = Y();
|
|
1628
1658
|
return /* @__PURE__ */ a(R, { children: [
|
|
1629
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
1659
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ce, { children: [
|
|
1630
1660
|
t === "text_field" && /* @__PURE__ */ e(
|
|
1631
|
-
|
|
1661
|
+
Ee,
|
|
1632
1662
|
{
|
|
1633
1663
|
disabled: r,
|
|
1634
1664
|
length: !0,
|
|
@@ -1642,7 +1672,7 @@ function _i({
|
|
|
1642
1672
|
}
|
|
1643
1673
|
),
|
|
1644
1674
|
t === "multiline" && /* @__PURE__ */ e(
|
|
1645
|
-
|
|
1675
|
+
Ee,
|
|
1646
1676
|
{
|
|
1647
1677
|
disabled: r,
|
|
1648
1678
|
length: !0,
|
|
@@ -1655,7 +1685,7 @@ function _i({
|
|
|
1655
1685
|
}
|
|
1656
1686
|
),
|
|
1657
1687
|
t === "markdown" && /* @__PURE__ */ e(
|
|
1658
|
-
|
|
1688
|
+
Ee,
|
|
1659
1689
|
{
|
|
1660
1690
|
disabled: r,
|
|
1661
1691
|
length: !0,
|
|
@@ -1668,7 +1698,7 @@ function _i({
|
|
|
1668
1698
|
}
|
|
1669
1699
|
),
|
|
1670
1700
|
t === "email" && /* @__PURE__ */ e(
|
|
1671
|
-
|
|
1701
|
+
Ee,
|
|
1672
1702
|
{
|
|
1673
1703
|
disabled: r,
|
|
1674
1704
|
max: !0,
|
|
@@ -1679,7 +1709,7 @@ function _i({
|
|
|
1679
1709
|
)
|
|
1680
1710
|
] }) }),
|
|
1681
1711
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1682
|
-
|
|
1712
|
+
we,
|
|
1683
1713
|
{
|
|
1684
1714
|
name: "defaultValue",
|
|
1685
1715
|
disabled: r,
|
|
@@ -1692,16 +1722,16 @@ function _i({
|
|
|
1692
1722
|
) })
|
|
1693
1723
|
] });
|
|
1694
1724
|
}
|
|
1695
|
-
function
|
|
1696
|
-
const { values: r } =
|
|
1725
|
+
function Ei({ disabled: t }) {
|
|
1726
|
+
const { values: r } = Y(), n = I(r, "defaultValue");
|
|
1697
1727
|
return /* @__PURE__ */ a(R, { children: [
|
|
1698
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1728
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Fe, { disabled: t }) }) }),
|
|
1699
1729
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1700
1730
|
$,
|
|
1701
1731
|
{
|
|
1702
1732
|
name: "defaultValue",
|
|
1703
1733
|
children: ({ field: i, form: l }) => /* @__PURE__ */ e(
|
|
1704
|
-
|
|
1734
|
+
oe,
|
|
1705
1735
|
{
|
|
1706
1736
|
label: n == null ? "Default value not set" : "Default value is " + n.toString(),
|
|
1707
1737
|
disabled: t,
|
|
@@ -1714,7 +1744,7 @@ function Fi({ disabled: t }) {
|
|
|
1714
1744
|
) })
|
|
1715
1745
|
] });
|
|
1716
1746
|
}
|
|
1717
|
-
function
|
|
1747
|
+
function Si({
|
|
1718
1748
|
disabled: t,
|
|
1719
1749
|
getData: r,
|
|
1720
1750
|
allowDataInference: n,
|
|
@@ -1724,7 +1754,7 @@ function Ei({
|
|
|
1724
1754
|
const {
|
|
1725
1755
|
values: o,
|
|
1726
1756
|
setFieldValue: d
|
|
1727
|
-
} =
|
|
1757
|
+
} = Y(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = ({
|
|
1728
1758
|
id: T,
|
|
1729
1759
|
property: w
|
|
1730
1760
|
}) => {
|
|
@@ -1736,37 +1766,37 @@ function Ei({
|
|
|
1736
1766
|
}, !1);
|
|
1737
1767
|
const C = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), O = C.includes(T) ? C : [...C, T];
|
|
1738
1768
|
d("oneOf.propertiesOrder", O, !1), u(!1);
|
|
1739
|
-
}, x = m ? ne(m, s) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, P =
|
|
1769
|
+
}, x = m ? ne(m, s) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, P = (T, w) => {
|
|
1740
1770
|
const C = T ? ne(T, w) : void 0;
|
|
1741
1771
|
if (!C)
|
|
1742
1772
|
throw Error("collection editor miss config");
|
|
1743
|
-
d(`oneOf.${
|
|
1744
|
-
const O = `oneOf.${
|
|
1773
|
+
d(`oneOf.${me(C)}`, void 0, !1);
|
|
1774
|
+
const O = `oneOf.${ye(w)}`, N = I(o, O) ?? Object.keys(I(o, ir(w)));
|
|
1745
1775
|
d(O, N.filter((F) => F !== T), !1), u(!1), p(void 0), f(void 0);
|
|
1746
|
-
},
|
|
1776
|
+
}, v = /* @__PURE__ */ a(
|
|
1747
1777
|
z,
|
|
1748
1778
|
{
|
|
1749
1779
|
autoFocus: !0,
|
|
1750
1780
|
color: "primary",
|
|
1751
1781
|
onClick: () => u(!0),
|
|
1752
|
-
startIcon: /* @__PURE__ */ e(
|
|
1782
|
+
startIcon: /* @__PURE__ */ e(de, {}),
|
|
1753
1783
|
children: [
|
|
1754
1784
|
"Add property to ",
|
|
1755
1785
|
o.name ?? "this block"
|
|
1756
1786
|
]
|
|
1757
1787
|
}
|
|
1758
|
-
), b =
|
|
1759
|
-
d(`oneOf.${
|
|
1760
|
-
}
|
|
1788
|
+
), b = (T, w) => {
|
|
1789
|
+
d(`oneOf.${ye(w)}`, T, !1);
|
|
1790
|
+
};
|
|
1761
1791
|
return /* @__PURE__ */ a(R, { children: [
|
|
1762
1792
|
/* @__PURE__ */ a("div", { className: "col-span-12", children: [
|
|
1763
1793
|
/* @__PURE__ */ a("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
|
|
1764
1794
|
/* @__PURE__ */ e(V, { variant: "subtitle2", children: "Properties in this block" }),
|
|
1765
1795
|
v
|
|
1766
1796
|
] }),
|
|
1767
|
-
/* @__PURE__ */ a(
|
|
1797
|
+
/* @__PURE__ */ a(fe, { className: "p-2 pl-8", children: [
|
|
1768
1798
|
/* @__PURE__ */ e(
|
|
1769
|
-
|
|
1799
|
+
ft,
|
|
1770
1800
|
{
|
|
1771
1801
|
properties: o.oneOf?.properties ?? {},
|
|
1772
1802
|
propertiesOrder: o.oneOf?.propertiesOrder,
|
|
@@ -1782,7 +1812,7 @@ function Ei({
|
|
|
1782
1812
|
] })
|
|
1783
1813
|
] }),
|
|
1784
1814
|
!t && /* @__PURE__ */ e(
|
|
1785
|
-
|
|
1815
|
+
Oe,
|
|
1786
1816
|
{
|
|
1787
1817
|
inArray: !1,
|
|
1788
1818
|
forceShowErrors: !1,
|
|
@@ -1810,15 +1840,15 @@ function Ei({
|
|
|
1810
1840
|
)
|
|
1811
1841
|
] });
|
|
1812
1842
|
}
|
|
1813
|
-
function
|
|
1843
|
+
function Ai({ disabled: t }) {
|
|
1814
1844
|
const {
|
|
1815
1845
|
values: r,
|
|
1816
1846
|
handleChange: n
|
|
1817
|
-
} =
|
|
1847
|
+
} = Y(), i = "validation.min", l = "validation.max", o = "validation.lessThan", d = "validation.moreThan";
|
|
1818
1848
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
1819
|
-
/* @__PURE__ */ e(
|
|
1849
|
+
/* @__PURE__ */ e(Fe, { disabled: t }),
|
|
1820
1850
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
1821
|
-
|
|
1851
|
+
K,
|
|
1822
1852
|
{
|
|
1823
1853
|
value: I(r, i),
|
|
1824
1854
|
label: "Min value",
|
|
@@ -1830,7 +1860,7 @@ function Si({ disabled: t }) {
|
|
|
1830
1860
|
}
|
|
1831
1861
|
) }),
|
|
1832
1862
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
1833
|
-
|
|
1863
|
+
K,
|
|
1834
1864
|
{
|
|
1835
1865
|
value: I(r, l),
|
|
1836
1866
|
label: "Max value",
|
|
@@ -1842,7 +1872,7 @@ function Si({ disabled: t }) {
|
|
|
1842
1872
|
}
|
|
1843
1873
|
) }),
|
|
1844
1874
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
1845
|
-
|
|
1875
|
+
K,
|
|
1846
1876
|
{
|
|
1847
1877
|
value: I(r, o),
|
|
1848
1878
|
label: "Less than",
|
|
@@ -1854,7 +1884,7 @@ function Si({ disabled: t }) {
|
|
|
1854
1884
|
}
|
|
1855
1885
|
) }),
|
|
1856
1886
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
1857
|
-
|
|
1887
|
+
K,
|
|
1858
1888
|
{
|
|
1859
1889
|
value: I(r, d),
|
|
1860
1890
|
label: "More than",
|
|
@@ -1871,7 +1901,7 @@ function Si({ disabled: t }) {
|
|
|
1871
1901
|
name: "validation.positive",
|
|
1872
1902
|
type: "checkbox",
|
|
1873
1903
|
children: ({ field: p, form: s }) => /* @__PURE__ */ e(
|
|
1874
|
-
|
|
1904
|
+
oe,
|
|
1875
1905
|
{
|
|
1876
1906
|
label: "Positive value",
|
|
1877
1907
|
disabled: t,
|
|
@@ -1887,7 +1917,7 @@ function Si({ disabled: t }) {
|
|
|
1887
1917
|
name: "validation.negative",
|
|
1888
1918
|
type: "checkbox",
|
|
1889
1919
|
children: ({ field: p, form: s }) => /* @__PURE__ */ e(
|
|
1890
|
-
|
|
1920
|
+
oe,
|
|
1891
1921
|
{
|
|
1892
1922
|
label: "Negative value",
|
|
1893
1923
|
disabled: t,
|
|
@@ -1903,7 +1933,7 @@ function Si({ disabled: t }) {
|
|
|
1903
1933
|
name: "validation.integer",
|
|
1904
1934
|
type: "checkbox",
|
|
1905
1935
|
children: ({ field: p, form: s }) => /* @__PURE__ */ e(
|
|
1906
|
-
|
|
1936
|
+
oe,
|
|
1907
1937
|
{
|
|
1908
1938
|
label: "Integer value",
|
|
1909
1939
|
disabled: t,
|
|
@@ -1915,12 +1945,12 @@ function Si({ disabled: t }) {
|
|
|
1915
1945
|
) })
|
|
1916
1946
|
] });
|
|
1917
1947
|
}
|
|
1918
|
-
function
|
|
1919
|
-
const { values: r, setFieldValue: n } =
|
|
1948
|
+
function Di({ disabled: t }) {
|
|
1949
|
+
const { values: r, setFieldValue: n } = Y();
|
|
1920
1950
|
return /* @__PURE__ */ a(R, { children: [
|
|
1921
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1951
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Ai, { disabled: t }) }) }),
|
|
1922
1952
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1923
|
-
|
|
1953
|
+
we,
|
|
1924
1954
|
{
|
|
1925
1955
|
name: "defaultValue",
|
|
1926
1956
|
disabled: t,
|
|
@@ -1934,7 +1964,7 @@ function Ai({ disabled: t }) {
|
|
|
1934
1964
|
) })
|
|
1935
1965
|
] });
|
|
1936
1966
|
}
|
|
1937
|
-
function
|
|
1967
|
+
function jt({
|
|
1938
1968
|
existing: t,
|
|
1939
1969
|
multiple: r,
|
|
1940
1970
|
disabled: n,
|
|
@@ -1944,9 +1974,9 @@ function qt({
|
|
|
1944
1974
|
values: l,
|
|
1945
1975
|
handleChange: o,
|
|
1946
1976
|
errors: d
|
|
1947
|
-
} =
|
|
1977
|
+
} = Y();
|
|
1948
1978
|
if (!Te())
|
|
1949
|
-
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1979
|
+
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(He, {}) });
|
|
1950
1980
|
const u = r ? "of.path" : "path", m = I(l, u), p = i && I(d, u);
|
|
1951
1981
|
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
1952
1982
|
$,
|
|
@@ -1958,11 +1988,11 @@ function qt({
|
|
|
1958
1988
|
value: m,
|
|
1959
1989
|
error: p,
|
|
1960
1990
|
handleChange: o,
|
|
1961
|
-
as:
|
|
1991
|
+
as: Bi
|
|
1962
1992
|
}
|
|
1963
1993
|
) }) });
|
|
1964
1994
|
}
|
|
1965
|
-
function
|
|
1995
|
+
function Bi({
|
|
1966
1996
|
disabled: t,
|
|
1967
1997
|
pathPath: r,
|
|
1968
1998
|
value: n,
|
|
@@ -1972,13 +2002,13 @@ function Di({
|
|
|
1972
2002
|
}) {
|
|
1973
2003
|
const d = Te();
|
|
1974
2004
|
if (!d)
|
|
1975
|
-
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2005
|
+
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(He, {}) });
|
|
1976
2006
|
const c = d?.collections ?? [], u = Array.from(new Set(
|
|
1977
2007
|
Object.values(c).map((p) => p.group).filter(Boolean)
|
|
1978
2008
|
).values()), m = c.filter((p) => !p.group);
|
|
1979
2009
|
return /* @__PURE__ */ a(R, { children: [
|
|
1980
2010
|
/* @__PURE__ */ a(
|
|
1981
|
-
|
|
2011
|
+
be,
|
|
1982
2012
|
{
|
|
1983
2013
|
error: !!l,
|
|
1984
2014
|
disabled: t,
|
|
@@ -1990,7 +2020,7 @@ function Di({
|
|
|
1990
2020
|
renderValue: (p) => {
|
|
1991
2021
|
const s = c.find((f) => f.id === p || f.path === p);
|
|
1992
2022
|
return s ? /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
1993
|
-
/* @__PURE__ */ e(
|
|
2023
|
+
/* @__PURE__ */ e(st, { collectionOrView: s }),
|
|
1994
2024
|
/* @__PURE__ */ e(
|
|
1995
2025
|
V,
|
|
1996
2026
|
{
|
|
@@ -2004,15 +2034,15 @@ function Di({
|
|
|
2004
2034
|
...o,
|
|
2005
2035
|
children: [
|
|
2006
2036
|
u.flatMap((p) => /* @__PURE__ */ e(
|
|
2007
|
-
|
|
2037
|
+
At,
|
|
2008
2038
|
{
|
|
2009
2039
|
label: p || "Views",
|
|
2010
2040
|
children: c.filter((s) => s.group === p).map((s) => /* @__PURE__ */ e(
|
|
2011
|
-
|
|
2041
|
+
X,
|
|
2012
2042
|
{
|
|
2013
2043
|
value: s.id ?? s.path,
|
|
2014
2044
|
children: /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
2015
|
-
/* @__PURE__ */ e(
|
|
2045
|
+
/* @__PURE__ */ e(st, { collectionOrView: s }),
|
|
2016
2046
|
/* @__PURE__ */ e(
|
|
2017
2047
|
V,
|
|
2018
2048
|
{
|
|
@@ -2028,12 +2058,12 @@ function Di({
|
|
|
2028
2058
|
},
|
|
2029
2059
|
`group_${p}`
|
|
2030
2060
|
)),
|
|
2031
|
-
m && /* @__PURE__ */ e(
|
|
2032
|
-
|
|
2061
|
+
m && /* @__PURE__ */ e(At, { label: "Views", children: m.map((p) => /* @__PURE__ */ e(
|
|
2062
|
+
X,
|
|
2033
2063
|
{
|
|
2034
2064
|
value: p.id ?? p.path,
|
|
2035
2065
|
children: /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
|
|
2036
|
-
/* @__PURE__ */ e(
|
|
2066
|
+
/* @__PURE__ */ e(st, { collectionOrView: p }),
|
|
2037
2067
|
/* @__PURE__ */ e(
|
|
2038
2068
|
V,
|
|
2039
2069
|
{
|
|
@@ -2049,20 +2079,20 @@ function Di({
|
|
|
2049
2079
|
]
|
|
2050
2080
|
}
|
|
2051
2081
|
),
|
|
2052
|
-
/* @__PURE__ */ e(
|
|
2082
|
+
/* @__PURE__ */ e(J, { children: "You can only edit the reference collection upon field creation." })
|
|
2053
2083
|
] });
|
|
2054
2084
|
}
|
|
2055
|
-
function
|
|
2085
|
+
function Mi({ disabled: t }) {
|
|
2056
2086
|
const {
|
|
2057
2087
|
values: r,
|
|
2058
2088
|
errors: n,
|
|
2059
2089
|
touched: i,
|
|
2060
2090
|
setFieldValue: l
|
|
2061
|
-
} =
|
|
2091
|
+
} = Y(), o = "mode", d = I(r, o), c = I(i, o) && I(n, o), u = "autoValue", m = I(r, u), p = I(i, u) && I(n, u);
|
|
2062
2092
|
return /* @__PURE__ */ a(R, { children: [
|
|
2063
2093
|
/* @__PURE__ */ a("div", { className: "flex flex-col col-span-12", children: [
|
|
2064
2094
|
/* @__PURE__ */ a(
|
|
2065
|
-
|
|
2095
|
+
be,
|
|
2066
2096
|
{
|
|
2067
2097
|
name: o,
|
|
2068
2098
|
value: d ?? "date",
|
|
@@ -2081,14 +2111,14 @@ function Bi({ disabled: t }) {
|
|
|
2081
2111
|
},
|
|
2082
2112
|
disabled: t,
|
|
2083
2113
|
children: [
|
|
2084
|
-
/* @__PURE__ */ e(
|
|
2085
|
-
/* @__PURE__ */ e(
|
|
2114
|
+
/* @__PURE__ */ e(X, { value: "date_time", children: " Date/Time " }),
|
|
2115
|
+
/* @__PURE__ */ e(X, { value: "date", children: " Date " })
|
|
2086
2116
|
]
|
|
2087
2117
|
}
|
|
2088
2118
|
),
|
|
2089
|
-
/* @__PURE__ */ e(
|
|
2119
|
+
/* @__PURE__ */ e(J, { error: !!c, children: c }),
|
|
2090
2120
|
/* @__PURE__ */ a(
|
|
2091
|
-
|
|
2121
|
+
be,
|
|
2092
2122
|
{
|
|
2093
2123
|
name: u,
|
|
2094
2124
|
disabled: t,
|
|
@@ -2107,21 +2137,21 @@ function Bi({ disabled: t }) {
|
|
|
2107
2137
|
error: !!p,
|
|
2108
2138
|
label: "Automatic value",
|
|
2109
2139
|
children: [
|
|
2110
|
-
/* @__PURE__ */ e(
|
|
2111
|
-
/* @__PURE__ */ e(
|
|
2112
|
-
/* @__PURE__ */ e(
|
|
2140
|
+
/* @__PURE__ */ e(X, { value: "none", children: " None " }),
|
|
2141
|
+
/* @__PURE__ */ e(X, { value: "on_create", children: " On create " }),
|
|
2142
|
+
/* @__PURE__ */ e(X, { value: "on_update", children: " On any update " })
|
|
2113
2143
|
]
|
|
2114
2144
|
}
|
|
2115
2145
|
),
|
|
2116
|
-
/* @__PURE__ */ e(
|
|
2146
|
+
/* @__PURE__ */ e(J, { error: !!p, children: p ?? "Update this field automatically when creating or updating the entity" })
|
|
2117
2147
|
] }),
|
|
2118
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2148
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Fe, { disabled: t }) }) })
|
|
2119
2149
|
] });
|
|
2120
2150
|
}
|
|
2121
|
-
function
|
|
2151
|
+
function zi({ disabled: t }) {
|
|
2122
2152
|
return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2123
2153
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e($, { type: "checkbox", name: "hideFromCollection", children: ({ field: i, form: l }) => /* @__PURE__ */ e(
|
|
2124
|
-
|
|
2154
|
+
oe,
|
|
2125
2155
|
{
|
|
2126
2156
|
label: "Hide from collection",
|
|
2127
2157
|
disabled: t,
|
|
@@ -2136,7 +2166,7 @@ function Mi({ disabled: t }) {
|
|
|
2136
2166
|
name: "readOnly",
|
|
2137
2167
|
type: "checkbox",
|
|
2138
2168
|
children: ({ field: i, form: l }) => /* @__PURE__ */ e(
|
|
2139
|
-
|
|
2169
|
+
oe,
|
|
2140
2170
|
{
|
|
2141
2171
|
label: "Read only",
|
|
2142
2172
|
disabled: t,
|
|
@@ -2149,12 +2179,12 @@ function Mi({ disabled: t }) {
|
|
|
2149
2179
|
) })
|
|
2150
2180
|
] });
|
|
2151
2181
|
}
|
|
2152
|
-
function
|
|
2153
|
-
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2182
|
+
function Ri({ disabled: t }) {
|
|
2183
|
+
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Fe, { disabled: t }) }) }) });
|
|
2154
2184
|
}
|
|
2155
|
-
function
|
|
2185
|
+
function or(t, r, n) {
|
|
2156
2186
|
let i;
|
|
2157
|
-
return r === "text_field" ? i =
|
|
2187
|
+
return r === "text_field" ? i = W(
|
|
2158
2188
|
t,
|
|
2159
2189
|
{
|
|
2160
2190
|
dataType: "string",
|
|
@@ -2167,7 +2197,7 @@ function lr(t, r, n) {
|
|
|
2167
2197
|
url: void 0,
|
|
2168
2198
|
enumValues: void 0
|
|
2169
2199
|
}
|
|
2170
|
-
) : r === "multiline" ? i =
|
|
2200
|
+
) : r === "multiline" ? i = W(
|
|
2171
2201
|
t,
|
|
2172
2202
|
{
|
|
2173
2203
|
dataType: "string",
|
|
@@ -2180,7 +2210,7 @@ function lr(t, r, n) {
|
|
|
2180
2210
|
url: void 0,
|
|
2181
2211
|
enumValues: void 0
|
|
2182
2212
|
}
|
|
2183
|
-
) : r === "markdown" ? i =
|
|
2213
|
+
) : r === "markdown" ? i = W(
|
|
2184
2214
|
t,
|
|
2185
2215
|
{
|
|
2186
2216
|
dataType: "string",
|
|
@@ -2192,7 +2222,7 @@ function lr(t, r, n) {
|
|
|
2192
2222
|
email: void 0,
|
|
2193
2223
|
url: void 0
|
|
2194
2224
|
}
|
|
2195
|
-
) : r === "url" ? i =
|
|
2225
|
+
) : r === "url" ? i = W(
|
|
2196
2226
|
t,
|
|
2197
2227
|
{
|
|
2198
2228
|
dataType: "string",
|
|
@@ -2205,7 +2235,7 @@ function lr(t, r, n) {
|
|
|
2205
2235
|
url: !0,
|
|
2206
2236
|
enumValues: void 0
|
|
2207
2237
|
}
|
|
2208
|
-
) : r === "email" ? i =
|
|
2238
|
+
) : r === "email" ? i = W(
|
|
2209
2239
|
t,
|
|
2210
2240
|
{
|
|
2211
2241
|
dataType: "string",
|
|
@@ -2218,7 +2248,7 @@ function lr(t, r, n) {
|
|
|
2218
2248
|
url: void 0,
|
|
2219
2249
|
enumValues: void 0
|
|
2220
2250
|
}
|
|
2221
|
-
) : r === "select" ? i =
|
|
2251
|
+
) : r === "select" ? i = W(
|
|
2222
2252
|
t,
|
|
2223
2253
|
{
|
|
2224
2254
|
dataType: "string",
|
|
@@ -2231,7 +2261,7 @@ function lr(t, r, n) {
|
|
|
2231
2261
|
url: void 0,
|
|
2232
2262
|
enumValues: t.enumValues ?? []
|
|
2233
2263
|
}
|
|
2234
|
-
) : r === "multi_select" ? i =
|
|
2264
|
+
) : r === "multi_select" ? i = W(
|
|
2235
2265
|
t,
|
|
2236
2266
|
{
|
|
2237
2267
|
dataType: "array",
|
|
@@ -2242,7 +2272,7 @@ function lr(t, r, n) {
|
|
|
2242
2272
|
enumValues: t.of?.enumValues ?? []
|
|
2243
2273
|
}
|
|
2244
2274
|
}
|
|
2245
|
-
) : r === "number_input" ? i =
|
|
2275
|
+
) : r === "number_input" ? i = W(
|
|
2246
2276
|
t,
|
|
2247
2277
|
{
|
|
2248
2278
|
dataType: "number",
|
|
@@ -2250,7 +2280,7 @@ function lr(t, r, n) {
|
|
|
2250
2280
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
2251
2281
|
enumValues: void 0
|
|
2252
2282
|
}
|
|
2253
|
-
) : r === "number_select" ? i =
|
|
2283
|
+
) : r === "number_select" ? i = W(
|
|
2254
2284
|
t,
|
|
2255
2285
|
{
|
|
2256
2286
|
dataType: "number",
|
|
@@ -2258,7 +2288,7 @@ function lr(t, r, n) {
|
|
|
2258
2288
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
2259
2289
|
enumValues: t.enumValues ?? []
|
|
2260
2290
|
}
|
|
2261
|
-
) : r === "multi_number_select" ? i =
|
|
2291
|
+
) : r === "multi_number_select" ? i = W(
|
|
2262
2292
|
t,
|
|
2263
2293
|
{
|
|
2264
2294
|
dataType: "array",
|
|
@@ -2269,7 +2299,7 @@ function lr(t, r, n) {
|
|
|
2269
2299
|
enumValues: t.of?.enumValues ?? []
|
|
2270
2300
|
}
|
|
2271
2301
|
}
|
|
2272
|
-
) : r === "file_upload" ? i =
|
|
2302
|
+
) : r === "file_upload" ? i = W(
|
|
2273
2303
|
t,
|
|
2274
2304
|
{
|
|
2275
2305
|
dataType: "string",
|
|
@@ -2279,7 +2309,7 @@ function lr(t, r, n) {
|
|
|
2279
2309
|
storagePath: "/"
|
|
2280
2310
|
}
|
|
2281
2311
|
}
|
|
2282
|
-
) : r === "multi_file_upload" ? i =
|
|
2312
|
+
) : r === "multi_file_upload" ? i = W(
|
|
2283
2313
|
t,
|
|
2284
2314
|
{
|
|
2285
2315
|
dataType: "array",
|
|
@@ -2292,7 +2322,7 @@ function lr(t, r, n) {
|
|
|
2292
2322
|
}
|
|
2293
2323
|
}
|
|
2294
2324
|
}
|
|
2295
|
-
) : r === "group" ? i =
|
|
2325
|
+
) : r === "group" ? i = W(
|
|
2296
2326
|
t,
|
|
2297
2327
|
{
|
|
2298
2328
|
dataType: "map",
|
|
@@ -2301,7 +2331,7 @@ function lr(t, r, n) {
|
|
|
2301
2331
|
keyValue: !1,
|
|
2302
2332
|
properties: t.properties ?? {}
|
|
2303
2333
|
}
|
|
2304
|
-
) : r === "key_value" ? i =
|
|
2334
|
+
) : r === "key_value" ? i = W(
|
|
2305
2335
|
t,
|
|
2306
2336
|
{
|
|
2307
2337
|
dataType: "map",
|
|
@@ -2310,14 +2340,14 @@ function lr(t, r, n) {
|
|
|
2310
2340
|
keyValue: !0,
|
|
2311
2341
|
properties: void 0
|
|
2312
2342
|
}
|
|
2313
|
-
) : r === "reference" ? i =
|
|
2343
|
+
) : r === "reference" ? i = W(
|
|
2314
2344
|
t,
|
|
2315
2345
|
{
|
|
2316
2346
|
dataType: "reference",
|
|
2317
2347
|
propertyConfig: "reference",
|
|
2318
2348
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
2319
2349
|
}
|
|
2320
|
-
) : r === "multi_references" ? i =
|
|
2350
|
+
) : r === "multi_references" ? i = W(
|
|
2321
2351
|
t,
|
|
2322
2352
|
{
|
|
2323
2353
|
dataType: "array",
|
|
@@ -2327,14 +2357,14 @@ function lr(t, r, n) {
|
|
|
2327
2357
|
dataType: "reference"
|
|
2328
2358
|
}
|
|
2329
2359
|
}
|
|
2330
|
-
) : r === "switch" ? i =
|
|
2360
|
+
) : r === "switch" ? i = W(
|
|
2331
2361
|
t,
|
|
2332
2362
|
{
|
|
2333
2363
|
dataType: "boolean",
|
|
2334
2364
|
propertyConfig: "switch",
|
|
2335
2365
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
2336
2366
|
}
|
|
2337
|
-
) : r === "date_time" ? i =
|
|
2367
|
+
) : r === "date_time" ? i = W(
|
|
2338
2368
|
t,
|
|
2339
2369
|
{
|
|
2340
2370
|
dataType: "date",
|
|
@@ -2342,14 +2372,14 @@ function lr(t, r, n) {
|
|
|
2342
2372
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
2343
2373
|
mode: "date_time"
|
|
2344
2374
|
}
|
|
2345
|
-
) : r === "repeat" ? i =
|
|
2375
|
+
) : r === "repeat" ? i = W(
|
|
2346
2376
|
t,
|
|
2347
2377
|
{
|
|
2348
2378
|
dataType: "array",
|
|
2349
2379
|
propertyConfig: "repeat",
|
|
2350
2380
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
2351
2381
|
}
|
|
2352
|
-
) : r === "block" ? i =
|
|
2382
|
+
) : r === "block" ? i = W(
|
|
2353
2383
|
t,
|
|
2354
2384
|
{
|
|
2355
2385
|
dataType: "array",
|
|
@@ -2364,9 +2394,9 @@ function lr(t, r, n) {
|
|
|
2364
2394
|
propertyConfig: r
|
|
2365
2395
|
}), i;
|
|
2366
2396
|
}
|
|
2367
|
-
function
|
|
2397
|
+
function lr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
|
|
2368
2398
|
return /* @__PURE__ */ e(
|
|
2369
|
-
|
|
2399
|
+
X,
|
|
2370
2400
|
{
|
|
2371
2401
|
value: t,
|
|
2372
2402
|
disabled: r,
|
|
@@ -2374,12 +2404,12 @@ function sr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
|
|
|
2374
2404
|
children: /* @__PURE__ */ a(
|
|
2375
2405
|
"div",
|
|
2376
2406
|
{
|
|
2377
|
-
className:
|
|
2407
|
+
className: he(
|
|
2378
2408
|
"flex flex-row items-center text-base min-h-[52px]",
|
|
2379
2409
|
r ? "w-full" : ""
|
|
2380
2410
|
),
|
|
2381
2411
|
children: [
|
|
2382
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
2412
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(qe, { propertyConfig: n }) }),
|
|
2383
2413
|
/* @__PURE__ */ a("div", { children: [
|
|
2384
2414
|
/* @__PURE__ */ e("div", { children: n.name }),
|
|
2385
2415
|
/* @__PURE__ */ e(
|
|
@@ -2398,14 +2428,14 @@ function sr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
|
|
|
2398
2428
|
}
|
|
2399
2429
|
);
|
|
2400
2430
|
}
|
|
2401
|
-
function
|
|
2431
|
+
function Ui({
|
|
2402
2432
|
disabled: t,
|
|
2403
2433
|
showErrors: r
|
|
2404
2434
|
}) {
|
|
2405
|
-
const { values: n, setFieldValue: i } =
|
|
2435
|
+
const { values: n, setFieldValue: i } = Y(), l = I(n, "url");
|
|
2406
2436
|
return /* @__PURE__ */ a(R, { children: [
|
|
2407
2437
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
|
|
2408
|
-
|
|
2438
|
+
be,
|
|
2409
2439
|
{
|
|
2410
2440
|
disabled: t,
|
|
2411
2441
|
position: "item-aligned",
|
|
@@ -2427,15 +2457,15 @@ function Ri({
|
|
|
2427
2457
|
},
|
|
2428
2458
|
value: l ?? "[NONE]",
|
|
2429
2459
|
children: [
|
|
2430
|
-
/* @__PURE__ */ e(
|
|
2431
|
-
/* @__PURE__ */ e(
|
|
2432
|
-
/* @__PURE__ */ e(
|
|
2433
|
-
/* @__PURE__ */ e(
|
|
2460
|
+
/* @__PURE__ */ e(X, { value: "[NONE]", children: "Display URL" }),
|
|
2461
|
+
/* @__PURE__ */ e(X, { value: "image", children: "Image" }),
|
|
2462
|
+
/* @__PURE__ */ e(X, { value: "video", children: "Video" }),
|
|
2463
|
+
/* @__PURE__ */ e(X, { value: "audio", children: "Audio" })
|
|
2434
2464
|
]
|
|
2435
2465
|
}
|
|
2436
2466
|
) }),
|
|
2437
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2438
|
-
|
|
2467
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
|
|
2468
|
+
Ee,
|
|
2439
2469
|
{
|
|
2440
2470
|
disabled: t,
|
|
2441
2471
|
max: !0,
|
|
@@ -2445,7 +2475,7 @@ function Ri({
|
|
|
2445
2475
|
}
|
|
2446
2476
|
) }) }),
|
|
2447
2477
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2448
|
-
|
|
2478
|
+
we,
|
|
2449
2479
|
{
|
|
2450
2480
|
name: "defaultValue",
|
|
2451
2481
|
disabled: t,
|
|
@@ -2458,7 +2488,7 @@ function Ri({
|
|
|
2458
2488
|
) })
|
|
2459
2489
|
] });
|
|
2460
2490
|
}
|
|
2461
|
-
const
|
|
2491
|
+
const ji = [
|
|
2462
2492
|
"text_field",
|
|
2463
2493
|
"multiline",
|
|
2464
2494
|
"markdown",
|
|
@@ -2479,7 +2509,7 @@ const Ui = [
|
|
|
2479
2509
|
"key_value",
|
|
2480
2510
|
"repeat",
|
|
2481
2511
|
"block"
|
|
2482
|
-
],
|
|
2512
|
+
], sr = Object.entries(Wt).filter(([t]) => ji.includes(t)).map(([t, r]) => ({ [t]: r })).reduce((t, r) => ({ ...t, ...r }), {}), dr = G.memo(
|
|
2483
2513
|
function(r) {
|
|
2484
2514
|
const {
|
|
2485
2515
|
includeIdAndName: n = !0,
|
|
@@ -2505,64 +2535,64 @@ const Ui = [
|
|
|
2505
2535
|
} = r, O = {
|
|
2506
2536
|
id: "",
|
|
2507
2537
|
name: ""
|
|
2508
|
-
}, N = !!(p && !
|
|
2538
|
+
}, N = !!(p && !Ue(p)) && !C, F = Re(p ? {
|
|
2509
2539
|
id: c,
|
|
2510
2540
|
previousId: c,
|
|
2511
2541
|
property: p
|
|
2512
|
-
} : void 0),
|
|
2513
|
-
id:
|
|
2542
|
+
} : void 0), B = ({
|
|
2543
|
+
id: E,
|
|
2514
2544
|
property: h
|
|
2515
2545
|
}) => {
|
|
2516
|
-
const
|
|
2517
|
-
id:
|
|
2546
|
+
const D = {
|
|
2547
|
+
id: E,
|
|
2518
2548
|
previousId: F.current?.id,
|
|
2519
2549
|
property: h,
|
|
2520
2550
|
namespace: m
|
|
2521
2551
|
};
|
|
2522
|
-
F.current =
|
|
2523
|
-
}, _ =
|
|
2552
|
+
F.current = D, s?.(D);
|
|
2553
|
+
}, _ = kt({
|
|
2524
2554
|
initialValues: p ? { id: c, ...p } : O,
|
|
2525
2555
|
initialErrors: y,
|
|
2526
2556
|
validateOnChange: !0,
|
|
2527
2557
|
validateOnInitialRender: !0,
|
|
2528
|
-
onSubmit: (
|
|
2529
|
-
console.debug("onSubmit",
|
|
2558
|
+
onSubmit: (E, h) => {
|
|
2559
|
+
console.debug("onSubmit", E);
|
|
2530
2560
|
const {
|
|
2531
|
-
id:
|
|
2532
|
-
...
|
|
2533
|
-
} =
|
|
2534
|
-
|
|
2535
|
-
id:
|
|
2536
|
-
property: { ...
|
|
2561
|
+
id: D,
|
|
2562
|
+
...ae
|
|
2563
|
+
} = E;
|
|
2564
|
+
B({
|
|
2565
|
+
id: D,
|
|
2566
|
+
property: { ...ae, editable: ae.editable ?? !0 }
|
|
2537
2567
|
}), l || h.resetForm({ values: O });
|
|
2538
2568
|
},
|
|
2539
|
-
validation: (
|
|
2569
|
+
validation: (E) => {
|
|
2540
2570
|
const h = {};
|
|
2541
2571
|
if (n) {
|
|
2542
|
-
if (!
|
|
2572
|
+
if (!E.name)
|
|
2543
2573
|
h.name = "Required";
|
|
2544
2574
|
else {
|
|
2545
|
-
const
|
|
2546
|
-
|
|
2575
|
+
const D = Hi(E.name);
|
|
2576
|
+
D && (h.name = D);
|
|
2547
2577
|
}
|
|
2548
|
-
if (!
|
|
2578
|
+
if (!E.id)
|
|
2549
2579
|
h.id = "Required";
|
|
2550
2580
|
else {
|
|
2551
|
-
const
|
|
2552
|
-
|
|
2581
|
+
const D = $i(E.id, u);
|
|
2582
|
+
D && (h.id = D);
|
|
2553
2583
|
}
|
|
2554
2584
|
}
|
|
2555
|
-
return
|
|
2585
|
+
return E.dataType === "string" && E.validation?.matches && !Pr(E.validation?.matches.toString()) && (h.validation = {
|
|
2556
2586
|
matches: "Invalid regular expression"
|
|
2557
|
-
}),
|
|
2587
|
+
}), E.dataType === "reference" && !E.path && (h.path = "You must specify a target collection for the field"), E.propertyConfig === "repeat" && (E.of || (h.of = "You need to specify a repeat field")), E.propertyConfig === "block" && (E.oneOf || (h.oneOf = "You need to specify the properties of this block")), h;
|
|
2558
2588
|
}
|
|
2559
2589
|
});
|
|
2560
|
-
return
|
|
2590
|
+
return ce(() => {
|
|
2561
2591
|
b?.(_);
|
|
2562
|
-
}, [_, b]), /* @__PURE__ */ e(
|
|
2563
|
-
|
|
2592
|
+
}, [_, b]), /* @__PURE__ */ e(Ot, { value: _, children: /* @__PURE__ */ e(
|
|
2593
|
+
qi,
|
|
2564
2594
|
{
|
|
2565
|
-
onPropertyChanged: f ?
|
|
2595
|
+
onPropertyChanged: f ? B : void 0,
|
|
2566
2596
|
onDelete: g,
|
|
2567
2597
|
includeIdAndTitle: n,
|
|
2568
2598
|
propertyNamespace: m,
|
|
@@ -2581,9 +2611,9 @@ const Ui = [
|
|
|
2581
2611
|
}
|
|
2582
2612
|
) });
|
|
2583
2613
|
},
|
|
2584
|
-
(t, r) => t.getData === r.getData && t.propertyKey === r.propertyKey && t.propertyNamespace === r.propertyNamespace && t.includeIdAndName === r.includeIdAndName && t.autoOpenTypeSelect === r.autoOpenTypeSelect && t.autoUpdateId === r.autoUpdateId && t.existingProperty === r.existingProperty
|
|
2614
|
+
(t, r) => t.getData === r.getData && t.propertyKey === r.propertyKey && t.propertyNamespace === r.propertyNamespace && t.includeIdAndName === r.includeIdAndName && t.autoOpenTypeSelect === r.autoOpenTypeSelect && t.autoUpdateId === r.autoUpdateId && t.existingPropertyKeys === r.existingPropertyKeys && t.existingProperty === r.existingProperty
|
|
2585
2615
|
);
|
|
2586
|
-
function
|
|
2616
|
+
function Oe({
|
|
2587
2617
|
open: t,
|
|
2588
2618
|
onCancel: r,
|
|
2589
2619
|
onOkClicked: n,
|
|
@@ -2592,9 +2622,9 @@ function Ve({
|
|
|
2592
2622
|
collectionEditable: o,
|
|
2593
2623
|
...d
|
|
2594
2624
|
}) {
|
|
2595
|
-
const c =
|
|
2625
|
+
const c = Re();
|
|
2596
2626
|
return /* @__PURE__ */ e(
|
|
2597
|
-
|
|
2627
|
+
_e,
|
|
2598
2628
|
{
|
|
2599
2629
|
open: t ?? !1,
|
|
2600
2630
|
maxWidth: "xl",
|
|
@@ -2608,8 +2638,8 @@ function Ve({
|
|
|
2608
2638
|
m.preventDefault(), m.stopPropagation(), c.current?.handleSubmit(m);
|
|
2609
2639
|
},
|
|
2610
2640
|
children: [
|
|
2611
|
-
/* @__PURE__ */ e(
|
|
2612
|
-
|
|
2641
|
+
/* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(
|
|
2642
|
+
dr,
|
|
2613
2643
|
{
|
|
2614
2644
|
...d,
|
|
2615
2645
|
onPropertyChanged: (m) => {
|
|
@@ -2623,7 +2653,7 @@ function Ve({
|
|
|
2623
2653
|
getData: l
|
|
2624
2654
|
}
|
|
2625
2655
|
) }),
|
|
2626
|
-
/* @__PURE__ */ a(
|
|
2656
|
+
/* @__PURE__ */ a(De, { children: [
|
|
2627
2657
|
r && /* @__PURE__ */ e(
|
|
2628
2658
|
z,
|
|
2629
2659
|
{
|
|
@@ -2650,7 +2680,7 @@ function Ve({
|
|
|
2650
2680
|
}
|
|
2651
2681
|
);
|
|
2652
2682
|
}
|
|
2653
|
-
function
|
|
2683
|
+
function qi({
|
|
2654
2684
|
values: t,
|
|
2655
2685
|
errors: r,
|
|
2656
2686
|
setValues: n,
|
|
@@ -2670,43 +2700,43 @@ function ji({
|
|
|
2670
2700
|
propertyConfigs: P,
|
|
2671
2701
|
collectionEditable: v
|
|
2672
2702
|
}) {
|
|
2673
|
-
const [b, T] = j(o), [w, C] = j(!1), [O, N] = j(t?.dataType ?
|
|
2674
|
-
|
|
2703
|
+
const [b, T] = j(o), [w, C] = j(!1), [O, N] = j(t?.dataType ? Gt(t) : void 0), F = Object.entries(sr).concat(Object.entries(P)), B = g ? F.filter(([Z, H]) => !re(H.property) && H.property?.dataType !== "array") : F, _ = Fr(t), E = Re(null), h = Re(t), D = s && I(r, "selectedWidget");
|
|
2704
|
+
ce(() => {
|
|
2675
2705
|
if (c && (!d || _.id)) {
|
|
2676
2706
|
const {
|
|
2677
2707
|
id: Z,
|
|
2678
2708
|
...H
|
|
2679
2709
|
} = _;
|
|
2680
|
-
|
|
2710
|
+
ve(_, h.current) || (c({
|
|
2681
2711
|
id: Z,
|
|
2682
2712
|
property: H,
|
|
2683
2713
|
namespace: m
|
|
2684
2714
|
}), h.current = _);
|
|
2685
2715
|
}
|
|
2686
|
-
}, [_, d,
|
|
2716
|
+
}, [_, d, m]), ce(() => {
|
|
2687
2717
|
t?.id && p && p(t?.id, m, r);
|
|
2688
|
-
}, [r,
|
|
2689
|
-
const
|
|
2690
|
-
N(Z), n(
|
|
2691
|
-
|
|
2718
|
+
}, [r, m, t?.id]);
|
|
2719
|
+
const ae = (Z) => {
|
|
2720
|
+
N(Z), n(or(t, Z, P)), setTimeout(() => {
|
|
2721
|
+
E.current?.focus();
|
|
2692
2722
|
}, 0);
|
|
2693
2723
|
};
|
|
2694
2724
|
let q;
|
|
2695
2725
|
return O === "text_field" || O === "multiline" || O === "markdown" || O === "email" ? q = /* @__PURE__ */ e(
|
|
2696
|
-
|
|
2726
|
+
Fi,
|
|
2697
2727
|
{
|
|
2698
2728
|
widgetId: O,
|
|
2699
2729
|
disabled: f,
|
|
2700
2730
|
showErrors: s
|
|
2701
2731
|
}
|
|
2702
2732
|
) : O === "url" ? q = /* @__PURE__ */ e(
|
|
2703
|
-
|
|
2733
|
+
Ui,
|
|
2704
2734
|
{
|
|
2705
2735
|
disabled: f,
|
|
2706
2736
|
showErrors: s
|
|
2707
2737
|
}
|
|
2708
2738
|
) : O === "select" || O === "number_select" ? q = /* @__PURE__ */ e(
|
|
2709
|
-
|
|
2739
|
+
Rt,
|
|
2710
2740
|
{
|
|
2711
2741
|
multiselect: !1,
|
|
2712
2742
|
allowDataInference: y,
|
|
@@ -2716,7 +2746,7 @@ function ji({
|
|
|
2716
2746
|
showErrors: s
|
|
2717
2747
|
}
|
|
2718
2748
|
) : O === "multi_select" || O === "multi_number_select" ? q = /* @__PURE__ */ e(
|
|
2719
|
-
|
|
2749
|
+
Rt,
|
|
2720
2750
|
{
|
|
2721
2751
|
multiselect: !0,
|
|
2722
2752
|
updateIds: !i,
|
|
@@ -2726,21 +2756,21 @@ function ji({
|
|
|
2726
2756
|
showErrors: s
|
|
2727
2757
|
}
|
|
2728
2758
|
) : O === "file_upload" ? q = /* @__PURE__ */ e(
|
|
2729
|
-
|
|
2759
|
+
Ut,
|
|
2730
2760
|
{
|
|
2731
2761
|
existing: i,
|
|
2732
2762
|
multiple: !1,
|
|
2733
2763
|
disabled: f
|
|
2734
2764
|
}
|
|
2735
2765
|
) : O === "multi_file_upload" ? q = /* @__PURE__ */ e(
|
|
2736
|
-
|
|
2766
|
+
Ut,
|
|
2737
2767
|
{
|
|
2738
2768
|
existing: i,
|
|
2739
2769
|
multiple: !0,
|
|
2740
2770
|
disabled: f
|
|
2741
2771
|
}
|
|
2742
|
-
) : O === "switch" ? q = /* @__PURE__ */ e(
|
|
2743
|
-
|
|
2772
|
+
) : O === "switch" ? q = /* @__PURE__ */ e(Ei, { disabled: f }) : O === "number_input" ? q = /* @__PURE__ */ e(Di, { disabled: f }) : O === "group" ? q = /* @__PURE__ */ e(
|
|
2773
|
+
Vi,
|
|
2744
2774
|
{
|
|
2745
2775
|
disabled: f,
|
|
2746
2776
|
getData: x,
|
|
@@ -2749,7 +2779,7 @@ function ji({
|
|
|
2749
2779
|
propertyConfigs: P
|
|
2750
2780
|
}
|
|
2751
2781
|
) : O === "block" ? q = /* @__PURE__ */ e(
|
|
2752
|
-
|
|
2782
|
+
Si,
|
|
2753
2783
|
{
|
|
2754
2784
|
disabled: f,
|
|
2755
2785
|
getData: x,
|
|
@@ -2758,15 +2788,15 @@ function ji({
|
|
|
2758
2788
|
propertyConfigs: P
|
|
2759
2789
|
}
|
|
2760
2790
|
) : O === "reference" ? q = /* @__PURE__ */ e(
|
|
2761
|
-
|
|
2791
|
+
jt,
|
|
2762
2792
|
{
|
|
2763
2793
|
showErrors: s,
|
|
2764
2794
|
existing: i,
|
|
2765
2795
|
multiple: !1,
|
|
2766
2796
|
disabled: f
|
|
2767
2797
|
}
|
|
2768
|
-
) : O === "date_time" ? q = /* @__PURE__ */ e(
|
|
2769
|
-
|
|
2798
|
+
) : O === "date_time" ? q = /* @__PURE__ */ e(Mi, { disabled: f }) : O === "multi_references" ? q = /* @__PURE__ */ e(
|
|
2799
|
+
jt,
|
|
2770
2800
|
{
|
|
2771
2801
|
showErrors: s,
|
|
2772
2802
|
existing: i,
|
|
@@ -2774,7 +2804,7 @@ function ji({
|
|
|
2774
2804
|
disabled: f
|
|
2775
2805
|
}
|
|
2776
2806
|
) : O === "repeat" ? q = /* @__PURE__ */ e(
|
|
2777
|
-
|
|
2807
|
+
Ii,
|
|
2778
2808
|
{
|
|
2779
2809
|
showErrors: s,
|
|
2780
2810
|
existing: i,
|
|
@@ -2784,8 +2814,8 @@ function ji({
|
|
|
2784
2814
|
collectionEditable: v,
|
|
2785
2815
|
propertyConfigs: P
|
|
2786
2816
|
}
|
|
2787
|
-
) : O === "key_value" ? q = /* @__PURE__ */ e(
|
|
2788
|
-
f && /* @__PURE__ */ a(
|
|
2817
|
+
) : O === "key_value" ? q = /* @__PURE__ */ e(Ri, { disabled: f }) : q = null, /* @__PURE__ */ a(R, { children: [
|
|
2818
|
+
f && /* @__PURE__ */ a(Yr, { mode: "warn", children: [
|
|
2789
2819
|
/* @__PURE__ */ e(V, { children: "This property can't be edited" }),
|
|
2790
2820
|
/* @__PURE__ */ a(V, { variant: "caption", children: [
|
|
2791
2821
|
"You may not have permission to edit it or it is defined in code with no ",
|
|
@@ -2796,9 +2826,9 @@ function ji({
|
|
|
2796
2826
|
/* @__PURE__ */ a("div", { className: "flex mt-2 justify-between", children: [
|
|
2797
2827
|
/* @__PURE__ */ a("div", { className: "w-full flex flex-col gap-2", children: [
|
|
2798
2828
|
/* @__PURE__ */ e(
|
|
2799
|
-
|
|
2829
|
+
be,
|
|
2800
2830
|
{
|
|
2801
|
-
error: !!
|
|
2831
|
+
error: !!D,
|
|
2802
2832
|
value: O ?? "",
|
|
2803
2833
|
placeholder: "Select a property widget",
|
|
2804
2834
|
open: b,
|
|
@@ -2808,27 +2838,27 @@ function ji({
|
|
|
2808
2838
|
renderValue: (Z) => {
|
|
2809
2839
|
if (!Z)
|
|
2810
2840
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
2811
|
-
const H = Z, Q =
|
|
2841
|
+
const H = Z, Q = Wt[H] ?? P[H], le = Q.property, Be = le && !re(le) ? je(le, P) : void 0, Pe = re(le) || i && le.dataType !== t?.dataType, se = Be ? W(Be, Q) : Q;
|
|
2812
2842
|
return /* @__PURE__ */ a(
|
|
2813
2843
|
"div",
|
|
2814
2844
|
{
|
|
2815
|
-
onClick: (
|
|
2816
|
-
|
|
2845
|
+
onClick: (te) => {
|
|
2846
|
+
Pe && (te.stopPropagation(), te.preventDefault());
|
|
2817
2847
|
},
|
|
2818
|
-
className:
|
|
2848
|
+
className: he(
|
|
2819
2849
|
"flex items-center",
|
|
2820
|
-
|
|
2850
|
+
Pe ? "w-full pointer-events-none opacity-50" : ""
|
|
2821
2851
|
),
|
|
2822
2852
|
children: [
|
|
2823
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
2853
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(qe, { propertyConfig: se }) }),
|
|
2824
2854
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-start text-base text-left", children: [
|
|
2825
|
-
/* @__PURE__ */ e("div", { children:
|
|
2855
|
+
/* @__PURE__ */ e("div", { children: se.name }),
|
|
2826
2856
|
/* @__PURE__ */ e(
|
|
2827
2857
|
V,
|
|
2828
2858
|
{
|
|
2829
2859
|
variant: "caption",
|
|
2830
2860
|
color: "disabled",
|
|
2831
|
-
children:
|
|
2861
|
+
children: Pe ? "You can only switch to widgets that use the same data type" : se.description
|
|
2832
2862
|
}
|
|
2833
2863
|
)
|
|
2834
2864
|
] })
|
|
@@ -2837,15 +2867,15 @@ function ji({
|
|
|
2837
2867
|
);
|
|
2838
2868
|
},
|
|
2839
2869
|
onValueChange: (Z) => {
|
|
2840
|
-
|
|
2870
|
+
ae(Z);
|
|
2841
2871
|
},
|
|
2842
|
-
children:
|
|
2843
|
-
const Q = H.property,
|
|
2872
|
+
children: B.map(([Z, H]) => {
|
|
2873
|
+
const Q = H.property, le = i && !re(Q) && Q.dataType !== t?.dataType;
|
|
2844
2874
|
return /* @__PURE__ */ e(
|
|
2845
|
-
|
|
2875
|
+
lr,
|
|
2846
2876
|
{
|
|
2847
2877
|
value: Z,
|
|
2848
|
-
optionDisabled:
|
|
2878
|
+
optionDisabled: le,
|
|
2849
2879
|
propertyConfig: H,
|
|
2850
2880
|
existing: i
|
|
2851
2881
|
},
|
|
@@ -2854,7 +2884,7 @@ function ji({
|
|
|
2854
2884
|
})
|
|
2855
2885
|
}
|
|
2856
2886
|
),
|
|
2857
|
-
|
|
2887
|
+
D && /* @__PURE__ */ e(
|
|
2858
2888
|
V,
|
|
2859
2889
|
{
|
|
2860
2890
|
variant: "caption",
|
|
@@ -2865,33 +2895,33 @@ function ji({
|
|
|
2865
2895
|
)
|
|
2866
2896
|
] }),
|
|
2867
2897
|
u && t?.id && /* @__PURE__ */ e(
|
|
2868
|
-
|
|
2898
|
+
ie,
|
|
2869
2899
|
{
|
|
2870
2900
|
variant: "ghost",
|
|
2871
2901
|
className: "m-4",
|
|
2872
2902
|
disabled: f,
|
|
2873
2903
|
onClick: () => C(!0),
|
|
2874
|
-
children: /* @__PURE__ */ e(
|
|
2904
|
+
children: /* @__PURE__ */ e(pt, {})
|
|
2875
2905
|
}
|
|
2876
2906
|
)
|
|
2877
2907
|
] }),
|
|
2878
2908
|
/* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
|
|
2879
2909
|
d && /* @__PURE__ */ e(
|
|
2880
|
-
|
|
2910
|
+
_i,
|
|
2881
2911
|
{
|
|
2882
2912
|
showErrors: s,
|
|
2883
2913
|
disabledId: i,
|
|
2884
2914
|
isNewProperty: !i,
|
|
2885
2915
|
disabled: f,
|
|
2886
2916
|
autoUpdateId: l,
|
|
2887
|
-
ref:
|
|
2917
|
+
ref: E
|
|
2888
2918
|
}
|
|
2889
2919
|
),
|
|
2890
2920
|
q,
|
|
2891
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2921
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled: f }) })
|
|
2892
2922
|
] }),
|
|
2893
2923
|
u && /* @__PURE__ */ e(
|
|
2894
|
-
|
|
2924
|
+
dt,
|
|
2895
2925
|
{
|
|
2896
2926
|
open: w,
|
|
2897
2927
|
onAccept: () => u(t?.id, m),
|
|
@@ -2906,34 +2936,34 @@ function ji({
|
|
|
2906
2936
|
)
|
|
2907
2937
|
] });
|
|
2908
2938
|
}
|
|
2909
|
-
const
|
|
2910
|
-
function
|
|
2939
|
+
const Li = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
2940
|
+
function $i(t, r) {
|
|
2911
2941
|
let n;
|
|
2912
|
-
return t || (n = "You must specify an id for the field"), t && !t.match(
|
|
2942
|
+
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;
|
|
2913
2943
|
}
|
|
2914
|
-
function
|
|
2944
|
+
function Hi(t) {
|
|
2915
2945
|
let r;
|
|
2916
2946
|
return t || (r = "You must specify a title for the field"), r;
|
|
2917
2947
|
}
|
|
2918
|
-
function
|
|
2948
|
+
function Yi(t) {
|
|
2919
2949
|
return t ? (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((r, n) => r + n[0].toUpperCase() + n.substring(1), "") : "";
|
|
2920
2950
|
}
|
|
2921
|
-
function
|
|
2951
|
+
function Wi({
|
|
2922
2952
|
collection: t,
|
|
2923
2953
|
onOpenChange: r,
|
|
2924
2954
|
open: n
|
|
2925
2955
|
}) {
|
|
2926
|
-
const i =
|
|
2956
|
+
const i = Ve(), l = t ? `import { EntityCollection } from "firecms";
|
|
2927
2957
|
|
|
2928
|
-
const ` + (t?.name ?
|
|
2958
|
+
const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + di.stringify(cr(t), null, " ") : "No collection selected";
|
|
2929
2959
|
return /* @__PURE__ */ a(
|
|
2930
|
-
|
|
2960
|
+
_e,
|
|
2931
2961
|
{
|
|
2932
2962
|
open: n,
|
|
2933
2963
|
onOpenChange: r,
|
|
2934
2964
|
maxWidth: "4xl",
|
|
2935
2965
|
children: [
|
|
2936
|
-
/* @__PURE__ */ a(
|
|
2966
|
+
/* @__PURE__ */ a(Ae, { children: [
|
|
2937
2967
|
/* @__PURE__ */ a(V, { variant: "h6", className: "my-4", children: [
|
|
2938
2968
|
"Code for ",
|
|
2939
2969
|
t.name
|
|
@@ -2951,9 +2981,9 @@ const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.
|
|
|
2951
2981
|
"."
|
|
2952
2982
|
] }),
|
|
2953
2983
|
/* @__PURE__ */ e(
|
|
2954
|
-
|
|
2984
|
+
ci,
|
|
2955
2985
|
{
|
|
2956
|
-
theme:
|
|
2986
|
+
theme: ui.vsDark,
|
|
2957
2987
|
code: l,
|
|
2958
2988
|
language: "typescript",
|
|
2959
2989
|
children: ({
|
|
@@ -2966,7 +2996,7 @@ const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.
|
|
|
2966
2996
|
}
|
|
2967
2997
|
)
|
|
2968
2998
|
] }),
|
|
2969
|
-
/* @__PURE__ */ a(
|
|
2999
|
+
/* @__PURE__ */ a(De, { children: [
|
|
2970
3000
|
/* @__PURE__ */ a(
|
|
2971
3001
|
z,
|
|
2972
3002
|
{
|
|
@@ -2977,7 +3007,7 @@ const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.
|
|
|
2977
3007
|
message: "Copied"
|
|
2978
3008
|
}), navigator.clipboard.writeText(l)),
|
|
2979
3009
|
children: [
|
|
2980
|
-
/* @__PURE__ */ e(
|
|
3010
|
+
/* @__PURE__ */ e(Wr, { size: "small" }),
|
|
2981
3011
|
"Copy to clipboard"
|
|
2982
3012
|
]
|
|
2983
3013
|
}
|
|
@@ -2988,7 +3018,7 @@ const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.
|
|
|
2988
3018
|
}
|
|
2989
3019
|
);
|
|
2990
3020
|
}
|
|
2991
|
-
function
|
|
3021
|
+
function cr(t) {
|
|
2992
3022
|
const r = (n) => {
|
|
2993
3023
|
const i = {
|
|
2994
3024
|
...n
|
|
@@ -3014,7 +3044,7 @@ function ur(t) {
|
|
|
3014
3044
|
properties: Object.entries(t.properties ?? {}).map(([n, i]) => ({
|
|
3015
3045
|
[n]: r(i)
|
|
3016
3046
|
})).reduce((n, i) => ({ ...n, ...i }), {}),
|
|
3017
|
-
subcollections: (t.subcollections ?? []).map(
|
|
3047
|
+
subcollections: (t.subcollections ?? []).map(cr)
|
|
3018
3048
|
};
|
|
3019
3049
|
}
|
|
3020
3050
|
function Gi({
|
|
@@ -3038,13 +3068,13 @@ function Gi({
|
|
|
3038
3068
|
setFieldTouched: y,
|
|
3039
3069
|
errors: P,
|
|
3040
3070
|
dirty: v
|
|
3041
|
-
} =
|
|
3042
|
-
|
|
3071
|
+
} = Y(), b = Ve(), T = xr(), w = !T, [C, O] = j(), [N, F] = j(), [B, _] = j(), E = N ? ne(N, B) : void 0, h = E ? I(f.properties, E.replaceAll(".", ".properties.")) : void 0, [D, ae] = j(!1), [q, Z] = j(!1), [H, Q] = j(!1), [le, Be] = j([]), Pe = G.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
|
|
3072
|
+
ce(() => {
|
|
3043
3073
|
l && l(v);
|
|
3044
3074
|
}, [v]);
|
|
3045
|
-
const
|
|
3075
|
+
const se = m ? () => {
|
|
3046
3076
|
m && (Z(!0), m(f).then((A) => {
|
|
3047
|
-
if (A &&
|
|
3077
|
+
if (A && Le(A.properties), !A) {
|
|
3048
3078
|
b.open({
|
|
3049
3079
|
type: "error",
|
|
3050
3080
|
message: "Could not infer properties from data"
|
|
@@ -3062,27 +3092,27 @@ function Gi({
|
|
|
3062
3092
|
const k = {
|
|
3063
3093
|
...U.reduce((M, L) => (M[L] = (A.properties ?? {})[L], M), {}),
|
|
3064
3094
|
...f.properties
|
|
3065
|
-
},
|
|
3095
|
+
}, S = [
|
|
3066
3096
|
...U,
|
|
3067
3097
|
...f.propertiesOrder ?? []
|
|
3068
3098
|
];
|
|
3069
|
-
g("properties", k, !1),
|
|
3099
|
+
g("properties", k, !1), xe(S), Be(U);
|
|
3070
3100
|
}).finally(() => {
|
|
3071
3101
|
Z(!1);
|
|
3072
3102
|
}));
|
|
3073
|
-
} : void 0,
|
|
3074
|
-
const k =
|
|
3075
|
-
g(k, A, !1),
|
|
3076
|
-
},
|
|
3103
|
+
} : void 0, te = (A) => A ? Pe.current[A] ?? I(f, ye(A)) : Pe.current[""], xe = (A, U) => {
|
|
3104
|
+
const k = ye(U);
|
|
3105
|
+
g(k, A, !1), Pe.current[U ?? ""] = A;
|
|
3106
|
+
}, ke = (A, U) => {
|
|
3077
3107
|
const k = A ? ne(A, U) : void 0;
|
|
3078
3108
|
if (!k)
|
|
3079
3109
|
throw Error("collection editor miss config");
|
|
3080
|
-
g(
|
|
3081
|
-
const M =
|
|
3082
|
-
|
|
3083
|
-
},
|
|
3084
|
-
g(
|
|
3085
|
-
},
|
|
3110
|
+
g(me(k), void 0, !1);
|
|
3111
|
+
const M = te(U).filter((L) => L !== A);
|
|
3112
|
+
xe(M, U), Q(!1), O(void 0), F(void 0), _(void 0);
|
|
3113
|
+
}, Ye = (A, U) => {
|
|
3114
|
+
g(ye(U), A, !1);
|
|
3115
|
+
}, gt = ({
|
|
3086
3116
|
id: A,
|
|
3087
3117
|
property: U
|
|
3088
3118
|
}) => {
|
|
@@ -3093,54 +3123,54 @@ function Gi({
|
|
|
3093
3123
|
[A]: U
|
|
3094
3124
|
}, !1);
|
|
3095
3125
|
const k = [...f.propertiesOrder ?? Object.keys(f.properties), A];
|
|
3096
|
-
|
|
3097
|
-
},
|
|
3126
|
+
xe(k), Q(!1), T && (O(k.indexOf(A)), F(A)), _(void 0);
|
|
3127
|
+
}, ue = ({
|
|
3098
3128
|
id: A,
|
|
3099
3129
|
property: U,
|
|
3100
3130
|
previousId: k,
|
|
3101
|
-
namespace:
|
|
3131
|
+
namespace: S
|
|
3102
3132
|
}) => {
|
|
3103
|
-
const M = A ? ne(A,
|
|
3133
|
+
const M = A ? ne(A, S) : void 0, L = M ? me(M) : void 0;
|
|
3104
3134
|
if (k && k !== A) {
|
|
3105
3135
|
console.debug("onPropertyChanged, id change", {
|
|
3106
3136
|
id: A,
|
|
3107
3137
|
property: U,
|
|
3108
3138
|
previousId: k,
|
|
3109
|
-
namespace:
|
|
3139
|
+
namespace: S
|
|
3110
3140
|
});
|
|
3111
|
-
const
|
|
3112
|
-
|
|
3141
|
+
const ge = ne(k, S), Xe = me(ge), It = te(S).map((tt) => tt === k ? A : tt).filter((tt) => tt !== void 0);
|
|
3142
|
+
xe(It, S), A && (O(It.indexOf(A)), F(A)), g(Xe, void 0, !1), y(Xe, !1, !1);
|
|
3113
3143
|
}
|
|
3114
3144
|
console.debug("onPropertyChanged", {
|
|
3115
3145
|
id: A,
|
|
3116
3146
|
property: U,
|
|
3117
3147
|
previousId: k,
|
|
3118
|
-
namespace:
|
|
3148
|
+
namespace: S,
|
|
3119
3149
|
propertyPath: L
|
|
3120
3150
|
}), L && (g(L, U, !1), y(L, !0, !1));
|
|
3121
|
-
}, We =
|
|
3122
|
-
const
|
|
3151
|
+
}, We = (A, U, k) => {
|
|
3152
|
+
const S = A ? ne(A, U) : void 0;
|
|
3123
3153
|
if (console.debug("onPropertyErrorInternal", {
|
|
3124
3154
|
id: A,
|
|
3125
3155
|
namespace: U,
|
|
3126
3156
|
error: k,
|
|
3127
|
-
propertyPath:
|
|
3128
|
-
}),
|
|
3157
|
+
propertyPath: S
|
|
3158
|
+
}), S) {
|
|
3129
3159
|
const M = k && Object.keys(k).length > 0;
|
|
3130
|
-
i(A, U, M ? k : void 0), x(
|
|
3160
|
+
i(A, U, M ? k : void 0), x(me(S), M ? "Property error" : void 0);
|
|
3131
3161
|
}
|
|
3132
|
-
},
|
|
3162
|
+
}, Ge = () => {
|
|
3133
3163
|
O(void 0), F(void 0);
|
|
3134
|
-
},
|
|
3164
|
+
}, Ke = N && n?.current?.properties ? n.current.properties[N] : void 0, Ze = f?.propertiesOrder === void 0 || f.propertiesOrder.length === 0, Je = f.propertiesOrder ? f.propertiesOrder : Object.keys(f.properties), Qe = Zt(() => f.ownerId && c ? c(f.ownerId) : null, [c, f.ownerId]), vt = (A, U) => {
|
|
3135
3165
|
console.debug("CollectionEditor: onPropertyClick", {
|
|
3136
3166
|
propertyKey: A,
|
|
3137
3167
|
namespace: U
|
|
3138
|
-
}), O(
|
|
3139
|
-
},
|
|
3140
|
-
/* @__PURE__ */ a("div", { className:
|
|
3168
|
+
}), O(Je.indexOf(A)), F(A), _(U);
|
|
3169
|
+
}, yt = /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
3170
|
+
/* @__PURE__ */ a("div", { className: he(
|
|
3141
3171
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
3142
3172
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
3143
|
-
!w && "border-r " +
|
|
3173
|
+
!w && "border-r " + Tt
|
|
3144
3174
|
), children: [
|
|
3145
3175
|
/* @__PURE__ */ a("div", { className: "flex my-2", children: [
|
|
3146
3176
|
/* @__PURE__ */ a("div", { className: "flex-grow mb-4", children: [
|
|
@@ -3148,7 +3178,7 @@ function Gi({
|
|
|
3148
3178
|
$,
|
|
3149
3179
|
{
|
|
3150
3180
|
name: "name",
|
|
3151
|
-
as:
|
|
3181
|
+
as: K,
|
|
3152
3182
|
invisible: !0,
|
|
3153
3183
|
className: "-ml-1",
|
|
3154
3184
|
inputClassName: "text-2xl font-headers",
|
|
@@ -3158,7 +3188,7 @@ function Gi({
|
|
|
3158
3188
|
error: !!P?.name
|
|
3159
3189
|
}
|
|
3160
3190
|
),
|
|
3161
|
-
|
|
3191
|
+
Qe && /* @__PURE__ */ a(
|
|
3162
3192
|
V,
|
|
3163
3193
|
{
|
|
3164
3194
|
variant: "body2",
|
|
@@ -3166,52 +3196,52 @@ function Gi({
|
|
|
3166
3196
|
color: "secondary",
|
|
3167
3197
|
children: [
|
|
3168
3198
|
"Created by ",
|
|
3169
|
-
|
|
3199
|
+
Qe.displayName
|
|
3170
3200
|
]
|
|
3171
3201
|
}
|
|
3172
3202
|
)
|
|
3173
3203
|
] }),
|
|
3174
3204
|
d && /* @__PURE__ */ e("div", { className: "ml-4", children: d }),
|
|
3175
3205
|
/* @__PURE__ */ a("div", { className: "ml-1 mt-2 flex flex-row gap-2", children: [
|
|
3176
|
-
/* @__PURE__ */ e(
|
|
3177
|
-
|
|
3206
|
+
/* @__PURE__ */ e(ee, { title: "Get the code for this collection", children: /* @__PURE__ */ e(
|
|
3207
|
+
ie,
|
|
3178
3208
|
{
|
|
3179
3209
|
variant: "filled",
|
|
3180
3210
|
disabled: q,
|
|
3181
|
-
onClick: () =>
|
|
3211
|
+
onClick: () => ae(!0),
|
|
3182
3212
|
children: /* @__PURE__ */ e(Gr, {})
|
|
3183
3213
|
}
|
|
3184
3214
|
) }),
|
|
3185
|
-
|
|
3186
|
-
|
|
3215
|
+
se && /* @__PURE__ */ e(ee, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
|
|
3216
|
+
ie,
|
|
3187
3217
|
{
|
|
3188
3218
|
variant: "filled",
|
|
3189
3219
|
disabled: q,
|
|
3190
|
-
onClick:
|
|
3191
|
-
children: q ? /* @__PURE__ */ e(
|
|
3220
|
+
onClick: se,
|
|
3221
|
+
children: q ? /* @__PURE__ */ e(He, { size: "small" }) : /* @__PURE__ */ e(ht, {})
|
|
3192
3222
|
}
|
|
3193
3223
|
) }),
|
|
3194
|
-
/* @__PURE__ */ e(
|
|
3224
|
+
/* @__PURE__ */ e(ee, { title: "Add new property", children: /* @__PURE__ */ e(
|
|
3195
3225
|
z,
|
|
3196
3226
|
{
|
|
3197
3227
|
variant: "outlined",
|
|
3198
3228
|
onClick: () => Q(!0),
|
|
3199
|
-
children: /* @__PURE__ */ e(
|
|
3229
|
+
children: /* @__PURE__ */ e(de, {})
|
|
3200
3230
|
}
|
|
3201
3231
|
) })
|
|
3202
3232
|
] })
|
|
3203
3233
|
] }),
|
|
3204
|
-
/* @__PURE__ */ e(
|
|
3205
|
-
|
|
3234
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
3235
|
+
ft,
|
|
3206
3236
|
{
|
|
3207
3237
|
className: "pl-8",
|
|
3208
|
-
inferredPropertyKeys:
|
|
3209
|
-
selectedPropertyKey: N ? ne(N,
|
|
3238
|
+
inferredPropertyKeys: le,
|
|
3239
|
+
selectedPropertyKey: N ? ne(N, B) : void 0,
|
|
3210
3240
|
properties: f.properties,
|
|
3211
3241
|
additionalFields: f.additionalFields,
|
|
3212
|
-
propertiesOrder:
|
|
3213
|
-
onPropertyClick:
|
|
3214
|
-
onPropertyMove:
|
|
3242
|
+
propertiesOrder: Je,
|
|
3243
|
+
onPropertyClick: vt,
|
|
3244
|
+
onPropertyMove: Ye,
|
|
3215
3245
|
onPropertyRemove: r ? ke : void 0,
|
|
3216
3246
|
collectionEditable: s,
|
|
3217
3247
|
errors: P
|
|
@@ -3225,18 +3255,18 @@ function Gi({
|
|
|
3225
3255
|
variant: "outlined",
|
|
3226
3256
|
size: "large",
|
|
3227
3257
|
onClick: () => Q(!0),
|
|
3228
|
-
startIcon: /* @__PURE__ */ e(
|
|
3258
|
+
startIcon: /* @__PURE__ */ e(de, {}),
|
|
3229
3259
|
children: "Add new property"
|
|
3230
3260
|
}
|
|
3231
3261
|
)
|
|
3232
3262
|
] }),
|
|
3233
3263
|
!w && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ a(
|
|
3234
|
-
|
|
3264
|
+
fe,
|
|
3235
3265
|
{
|
|
3236
3266
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
3237
3267
|
children: [
|
|
3238
|
-
|
|
3239
|
-
|
|
3268
|
+
E && h && !re(h) && /* @__PURE__ */ e(
|
|
3269
|
+
dr,
|
|
3240
3270
|
{
|
|
3241
3271
|
inArray: !1,
|
|
3242
3272
|
existingProperty: !r,
|
|
@@ -3244,13 +3274,13 @@ function Gi({
|
|
|
3244
3274
|
allowDataInference: !r,
|
|
3245
3275
|
autoOpenTypeSelect: !1,
|
|
3246
3276
|
propertyKey: N,
|
|
3247
|
-
propertyNamespace:
|
|
3277
|
+
propertyNamespace: B,
|
|
3248
3278
|
property: h,
|
|
3249
|
-
onPropertyChanged:
|
|
3279
|
+
onPropertyChanged: ue,
|
|
3250
3280
|
onDelete: ke,
|
|
3251
3281
|
onError: We,
|
|
3252
3282
|
forceShowErrors: t,
|
|
3253
|
-
initialErrors:
|
|
3283
|
+
initialErrors: Ke,
|
|
3254
3284
|
getData: u,
|
|
3255
3285
|
propertyConfigs: p,
|
|
3256
3286
|
collectionEditable: s
|
|
@@ -3258,25 +3288,25 @@ function Gi({
|
|
|
3258
3288
|
`edit_view_${C}`
|
|
3259
3289
|
),
|
|
3260
3290
|
!h && /* @__PURE__ */ a("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
|
|
3261
|
-
/* @__PURE__ */ e(V, { variant: "label", className: "", children:
|
|
3291
|
+
/* @__PURE__ */ e(V, { variant: "label", className: "", children: Ze ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
3262
3292
|
/* @__PURE__ */ a(
|
|
3263
3293
|
z,
|
|
3264
3294
|
{
|
|
3265
3295
|
variant: "outlined",
|
|
3266
3296
|
onClick: () => Q(!0),
|
|
3267
3297
|
children: [
|
|
3268
|
-
/* @__PURE__ */ e(
|
|
3298
|
+
/* @__PURE__ */ e(de, {}),
|
|
3269
3299
|
"Add new property"
|
|
3270
3300
|
]
|
|
3271
3301
|
}
|
|
3272
3302
|
)
|
|
3273
3303
|
] }),
|
|
3274
|
-
h &&
|
|
3304
|
+
h && re(h) && /* @__PURE__ */ e(V, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
3275
3305
|
]
|
|
3276
3306
|
}
|
|
3277
3307
|
) }),
|
|
3278
3308
|
w && /* @__PURE__ */ e(
|
|
3279
|
-
|
|
3309
|
+
Oe,
|
|
3280
3310
|
{
|
|
3281
3311
|
inArray: !1,
|
|
3282
3312
|
open: C !== void 0,
|
|
@@ -3285,25 +3315,25 @@ function Gi({
|
|
|
3285
3315
|
existingProperty: !0,
|
|
3286
3316
|
autoOpenTypeSelect: !1,
|
|
3287
3317
|
propertyKey: N,
|
|
3288
|
-
propertyNamespace:
|
|
3318
|
+
propertyNamespace: B,
|
|
3289
3319
|
property: h,
|
|
3290
|
-
onPropertyChanged:
|
|
3320
|
+
onPropertyChanged: ue,
|
|
3291
3321
|
onDelete: ke,
|
|
3292
3322
|
onError: We,
|
|
3293
3323
|
forceShowErrors: t,
|
|
3294
|
-
initialErrors:
|
|
3324
|
+
initialErrors: Ke,
|
|
3295
3325
|
getData: u,
|
|
3296
3326
|
propertyConfigs: p,
|
|
3297
3327
|
collectionEditable: s,
|
|
3298
|
-
onOkClicked: w ?
|
|
3328
|
+
onOkClicked: w ? Ge : void 0
|
|
3299
3329
|
},
|
|
3300
3330
|
`edit_view_${C}`
|
|
3301
3331
|
)
|
|
3302
3332
|
] });
|
|
3303
3333
|
return /* @__PURE__ */ a(R, { children: [
|
|
3304
|
-
|
|
3334
|
+
yt,
|
|
3305
3335
|
/* @__PURE__ */ e(
|
|
3306
|
-
|
|
3336
|
+
Oe,
|
|
3307
3337
|
{
|
|
3308
3338
|
inArray: !1,
|
|
3309
3339
|
existingProperty: !1,
|
|
@@ -3312,7 +3342,7 @@ function Gi({
|
|
|
3312
3342
|
forceShowErrors: t,
|
|
3313
3343
|
open: H,
|
|
3314
3344
|
onCancel: () => Q(!1),
|
|
3315
|
-
onPropertyChanged:
|
|
3345
|
+
onPropertyChanged: gt,
|
|
3316
3346
|
getData: u,
|
|
3317
3347
|
allowDataInference: !r,
|
|
3318
3348
|
propertyConfigs: p,
|
|
@@ -3320,12 +3350,12 @@ function Gi({
|
|
|
3320
3350
|
existingPropertyKeys: f.propertiesOrder
|
|
3321
3351
|
}
|
|
3322
3352
|
),
|
|
3323
|
-
/* @__PURE__ */ e(
|
|
3324
|
-
|
|
3353
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
3354
|
+
Wi,
|
|
3325
3355
|
{
|
|
3326
3356
|
collection: f,
|
|
3327
|
-
open:
|
|
3328
|
-
onOpenChange:
|
|
3357
|
+
open: D,
|
|
3358
|
+
onOpenChange: ae
|
|
3329
3359
|
}
|
|
3330
3360
|
) })
|
|
3331
3361
|
] });
|
|
@@ -3338,19 +3368,19 @@ function Ki({
|
|
|
3338
3368
|
title: l
|
|
3339
3369
|
}) {
|
|
3340
3370
|
return /* @__PURE__ */ a(
|
|
3341
|
-
|
|
3371
|
+
_e,
|
|
3342
3372
|
{
|
|
3343
3373
|
open: t,
|
|
3344
3374
|
onOpenChange: (o) => o ? n() : r(),
|
|
3345
3375
|
"aria-labelledby": "alert-dialog-title",
|
|
3346
3376
|
"aria-describedby": "alert-dialog-description",
|
|
3347
3377
|
children: [
|
|
3348
|
-
/* @__PURE__ */ a(
|
|
3378
|
+
/* @__PURE__ */ a(Ae, { children: [
|
|
3349
3379
|
/* @__PURE__ */ e(V, { variant: "h6", children: l ?? "Unsaved changes" }),
|
|
3350
3380
|
i && /* @__PURE__ */ e(V, { children: i }),
|
|
3351
3381
|
/* @__PURE__ */ e(V, { children: "Are you sure?" })
|
|
3352
3382
|
] }),
|
|
3353
|
-
/* @__PURE__ */ a(
|
|
3383
|
+
/* @__PURE__ */ a(De, { children: [
|
|
3354
3384
|
/* @__PURE__ */ e(z, { variant: "text", onClick: n, autoFocus: !0, children: " Cancel " }),
|
|
3355
3385
|
/* @__PURE__ */ e(z, { onClick: r, children: " Ok " })
|
|
3356
3386
|
] })
|
|
@@ -3358,17 +3388,17 @@ function Ki({
|
|
|
3358
3388
|
}
|
|
3359
3389
|
);
|
|
3360
3390
|
}
|
|
3361
|
-
function
|
|
3391
|
+
function Zi({ open: t, onClose: r }) {
|
|
3362
3392
|
const {
|
|
3363
3393
|
entityViews: n
|
|
3364
|
-
} =
|
|
3394
|
+
} = Se();
|
|
3365
3395
|
return /* @__PURE__ */ a(
|
|
3366
|
-
|
|
3396
|
+
_e,
|
|
3367
3397
|
{
|
|
3368
3398
|
maxWidth: "md",
|
|
3369
3399
|
open: t,
|
|
3370
3400
|
children: [
|
|
3371
|
-
/* @__PURE__ */ a(
|
|
3401
|
+
/* @__PURE__ */ a(Ae, { className: "flex flex-col gap-4", children: [
|
|
3372
3402
|
/* @__PURE__ */ e(V, { variant: "h6", children: "Select view" }),
|
|
3373
3403
|
n?.map((i) => /* @__PURE__ */ a(
|
|
3374
3404
|
z,
|
|
@@ -3387,12 +3417,12 @@ function Wi({ open: t, onClose: r }) {
|
|
|
3387
3417
|
)),
|
|
3388
3418
|
(n ?? []).length === 0 && /* @__PURE__ */ e(V, { variant: "body2", children: "No custom views defined" })
|
|
3389
3419
|
] }),
|
|
3390
|
-
/* @__PURE__ */ e(
|
|
3420
|
+
/* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(z, { variant: "outlined", onClick: () => r(), children: "Cancel" }) })
|
|
3391
3421
|
]
|
|
3392
3422
|
}
|
|
3393
3423
|
);
|
|
3394
3424
|
}
|
|
3395
|
-
function
|
|
3425
|
+
function Ji({
|
|
3396
3426
|
collection: t,
|
|
3397
3427
|
parentCollection: r,
|
|
3398
3428
|
configController: n,
|
|
@@ -3400,20 +3430,20 @@ function Zi({
|
|
|
3400
3430
|
getUser: l,
|
|
3401
3431
|
parentCollectionIds: o
|
|
3402
3432
|
}) {
|
|
3403
|
-
const { entityViews: d } =
|
|
3433
|
+
const { entityViews: d } = Se(), [c, u] = G.useState(), [m, p] = G.useState(!1), [s, f] = G.useState(), [g, x] = G.useState(), {
|
|
3404
3434
|
values: y,
|
|
3405
3435
|
setFieldValue: P
|
|
3406
|
-
} =
|
|
3436
|
+
} = Y(), v = t.subcollections ?? [], b = y.entityViews?.filter((C) => typeof C == "string").map((C) => wr(C, d)).filter(Boolean) ?? [], T = t.entityViews?.filter((C) => typeof C != "string") ?? [], w = b.length + T.length;
|
|
3407
3437
|
return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
|
|
3408
|
-
/* @__PURE__ */ e(
|
|
3438
|
+
/* @__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: [
|
|
3409
3439
|
/* @__PURE__ */ a("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
3410
3440
|
/* @__PURE__ */ a(V, { variant: "h5", children: [
|
|
3411
3441
|
"Subcollections of ",
|
|
3412
3442
|
y.name
|
|
3413
3443
|
] }),
|
|
3414
|
-
/* @__PURE__ */ a(
|
|
3415
|
-
v && v.length > 0 && /* @__PURE__ */ e(
|
|
3416
|
-
|
|
3444
|
+
/* @__PURE__ */ a(fe, { className: "flex flex-col gap-4 p-2 w-full", children: [
|
|
3445
|
+
v && v.length > 0 && /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(Bt, { children: v.map((C) => /* @__PURE__ */ a(
|
|
3446
|
+
bt,
|
|
3417
3447
|
{
|
|
3418
3448
|
onClick: () => x({
|
|
3419
3449
|
isNewCollection: !1,
|
|
@@ -3421,25 +3451,25 @@ function Zi({
|
|
|
3421
3451
|
}),
|
|
3422
3452
|
children: [
|
|
3423
3453
|
/* @__PURE__ */ e(
|
|
3424
|
-
|
|
3454
|
+
Me,
|
|
3425
3455
|
{
|
|
3426
3456
|
align: "left",
|
|
3427
3457
|
children: /* @__PURE__ */ e(V, { variant: "subtitle2", className: "flex-grow", children: C.name })
|
|
3428
3458
|
}
|
|
3429
3459
|
),
|
|
3430
3460
|
/* @__PURE__ */ e(
|
|
3431
|
-
|
|
3461
|
+
Me,
|
|
3432
3462
|
{
|
|
3433
3463
|
align: "right",
|
|
3434
|
-
children: /* @__PURE__ */ e(
|
|
3435
|
-
|
|
3464
|
+
children: /* @__PURE__ */ e(ee, { title: "Remove", children: /* @__PURE__ */ e(
|
|
3465
|
+
ie,
|
|
3436
3466
|
{
|
|
3437
3467
|
size: "small",
|
|
3438
3468
|
onClick: (O) => {
|
|
3439
3469
|
O.preventDefault(), O.stopPropagation(), u(C.id);
|
|
3440
3470
|
},
|
|
3441
3471
|
color: "inherit",
|
|
3442
|
-
children: /* @__PURE__ */ e(
|
|
3472
|
+
children: /* @__PURE__ */ e(pt, { size: "small" })
|
|
3443
3473
|
}
|
|
3444
3474
|
) })
|
|
3445
3475
|
}
|
|
@@ -3457,7 +3487,7 @@ function Zi({
|
|
|
3457
3487
|
});
|
|
3458
3488
|
},
|
|
3459
3489
|
variant: "text",
|
|
3460
|
-
startIcon: /* @__PURE__ */ e(
|
|
3490
|
+
startIcon: /* @__PURE__ */ e(de, {}),
|
|
3461
3491
|
children: "Add subcollection"
|
|
3462
3492
|
}
|
|
3463
3493
|
)
|
|
@@ -3477,36 +3507,36 @@ function Zi({
|
|
|
3477
3507
|
children: "More info"
|
|
3478
3508
|
}
|
|
3479
3509
|
), children: "Define your own custom views by uploading them with the CLI." }),
|
|
3480
|
-
/* @__PURE__ */ e(R, { children: /* @__PURE__ */ a(
|
|
3481
|
-
/* @__PURE__ */ e(
|
|
3482
|
-
b.map((C) => /* @__PURE__ */ a(
|
|
3510
|
+
/* @__PURE__ */ e(R, { children: /* @__PURE__ */ a(fe, { className: "flex flex-col gap-4 p-2 w-full", children: [
|
|
3511
|
+
/* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ a(Bt, { children: [
|
|
3512
|
+
b.map((C) => /* @__PURE__ */ a(bt, { children: [
|
|
3483
3513
|
/* @__PURE__ */ e(
|
|
3484
|
-
|
|
3514
|
+
Me,
|
|
3485
3515
|
{
|
|
3486
3516
|
align: "left",
|
|
3487
3517
|
children: /* @__PURE__ */ e(V, { variant: "subtitle2", className: "flex-grow", children: C.name })
|
|
3488
3518
|
}
|
|
3489
3519
|
),
|
|
3490
3520
|
/* @__PURE__ */ e(
|
|
3491
|
-
|
|
3521
|
+
Me,
|
|
3492
3522
|
{
|
|
3493
3523
|
align: "right",
|
|
3494
|
-
children: /* @__PURE__ */ e(
|
|
3495
|
-
|
|
3524
|
+
children: /* @__PURE__ */ e(ee, { title: "Remove", children: /* @__PURE__ */ e(
|
|
3525
|
+
ie,
|
|
3496
3526
|
{
|
|
3497
3527
|
size: "small",
|
|
3498
3528
|
onClick: (O) => {
|
|
3499
3529
|
O.preventDefault(), O.stopPropagation(), f(C.key);
|
|
3500
3530
|
},
|
|
3501
3531
|
color: "inherit",
|
|
3502
|
-
children: /* @__PURE__ */ e(
|
|
3532
|
+
children: /* @__PURE__ */ e(pt, { size: "small" })
|
|
3503
3533
|
}
|
|
3504
3534
|
) })
|
|
3505
3535
|
}
|
|
3506
3536
|
)
|
|
3507
3537
|
] }, C.key)),
|
|
3508
|
-
T.map((C) => /* @__PURE__ */ e(
|
|
3509
|
-
|
|
3538
|
+
T.map((C) => /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ a(
|
|
3539
|
+
Me,
|
|
3510
3540
|
{
|
|
3511
3541
|
align: "left",
|
|
3512
3542
|
children: [
|
|
@@ -3526,7 +3556,7 @@ function Zi({
|
|
|
3526
3556
|
p(!0);
|
|
3527
3557
|
},
|
|
3528
3558
|
variant: "text",
|
|
3529
|
-
startIcon: /* @__PURE__ */ e(
|
|
3559
|
+
startIcon: /* @__PURE__ */ e(de, {}),
|
|
3530
3560
|
children: "Add custom entity view"
|
|
3531
3561
|
}
|
|
3532
3562
|
)
|
|
@@ -3535,7 +3565,7 @@ function Zi({
|
|
|
3535
3565
|
] }) }),
|
|
3536
3566
|
/* @__PURE__ */ e("div", { style: { height: "52px" } }),
|
|
3537
3567
|
c && /* @__PURE__ */ e(
|
|
3538
|
-
|
|
3568
|
+
dt,
|
|
3539
3569
|
{
|
|
3540
3570
|
open: !!c,
|
|
3541
3571
|
onAccept: () => {
|
|
@@ -3555,7 +3585,7 @@ function Zi({
|
|
|
3555
3585
|
}
|
|
3556
3586
|
),
|
|
3557
3587
|
s && /* @__PURE__ */ e(
|
|
3558
|
-
|
|
3588
|
+
dt,
|
|
3559
3589
|
{
|
|
3560
3590
|
open: !!s,
|
|
3561
3591
|
onAccept: () => {
|
|
@@ -3571,7 +3601,7 @@ function Zi({
|
|
|
3571
3601
|
}
|
|
3572
3602
|
),
|
|
3573
3603
|
/* @__PURE__ */ e(
|
|
3574
|
-
|
|
3604
|
+
pr,
|
|
3575
3605
|
{
|
|
3576
3606
|
open: !!g,
|
|
3577
3607
|
configController: n,
|
|
@@ -3587,7 +3617,7 @@ function Zi({
|
|
|
3587
3617
|
}
|
|
3588
3618
|
),
|
|
3589
3619
|
/* @__PURE__ */ e(
|
|
3590
|
-
|
|
3620
|
+
Zi,
|
|
3591
3621
|
{
|
|
3592
3622
|
open: m,
|
|
3593
3623
|
onClose: (C) => {
|
|
@@ -3597,14 +3627,14 @@ function Zi({
|
|
|
3597
3627
|
)
|
|
3598
3628
|
] });
|
|
3599
3629
|
}
|
|
3600
|
-
const
|
|
3630
|
+
const qt = {
|
|
3601
3631
|
id: "products",
|
|
3602
3632
|
path: "products",
|
|
3603
3633
|
name: "Products",
|
|
3604
3634
|
singularName: "Product",
|
|
3605
3635
|
icon: "shopping_cart",
|
|
3606
3636
|
description: "List of the products currently sold in your shop",
|
|
3607
|
-
properties:
|
|
3637
|
+
properties: Le({
|
|
3608
3638
|
name: {
|
|
3609
3639
|
dataType: "string",
|
|
3610
3640
|
name: "Name",
|
|
@@ -3682,7 +3712,7 @@ const Lt = {
|
|
|
3682
3712
|
autoValue: "on_create"
|
|
3683
3713
|
}
|
|
3684
3714
|
})
|
|
3685
|
-
},
|
|
3715
|
+
}, Lt = {
|
|
3686
3716
|
id: "blog",
|
|
3687
3717
|
path: "blog",
|
|
3688
3718
|
name: "Blog",
|
|
@@ -3690,7 +3720,7 @@ const Lt = {
|
|
|
3690
3720
|
icon: "article",
|
|
3691
3721
|
description: "A collection of blog entries",
|
|
3692
3722
|
defaultSize: "l",
|
|
3693
|
-
properties:
|
|
3723
|
+
properties: Le({
|
|
3694
3724
|
name: {
|
|
3695
3725
|
name: "Name",
|
|
3696
3726
|
validation: { required: !0 },
|
|
@@ -3794,14 +3824,14 @@ const Lt = {
|
|
|
3794
3824
|
initialFilter: {
|
|
3795
3825
|
status: ["==", "published"]
|
|
3796
3826
|
}
|
|
3797
|
-
},
|
|
3827
|
+
}, $t = {
|
|
3798
3828
|
id: "users",
|
|
3799
3829
|
path: "users",
|
|
3800
3830
|
name: "Users",
|
|
3801
3831
|
singularName: "User",
|
|
3802
3832
|
description: "Registered users in the app/web",
|
|
3803
3833
|
icon: "person",
|
|
3804
|
-
properties:
|
|
3834
|
+
properties: Le({
|
|
3805
3835
|
displayName: {
|
|
3806
3836
|
name: "Display name",
|
|
3807
3837
|
dataType: "string"
|
|
@@ -3833,7 +3863,7 @@ const Lt = {
|
|
|
3833
3863
|
url: "image"
|
|
3834
3864
|
}
|
|
3835
3865
|
})
|
|
3836
|
-
},
|
|
3866
|
+
}, Ht = {
|
|
3837
3867
|
id: "pages",
|
|
3838
3868
|
path: "pages",
|
|
3839
3869
|
name: "Pages",
|
|
@@ -4019,7 +4049,7 @@ const Lt = {
|
|
|
4019
4049
|
}
|
|
4020
4050
|
}
|
|
4021
4051
|
};
|
|
4022
|
-
function
|
|
4052
|
+
function Qi({
|
|
4023
4053
|
path: t,
|
|
4024
4054
|
pathSuggestions: r,
|
|
4025
4055
|
parentCollection: n,
|
|
@@ -4027,7 +4057,7 @@ function Ji({
|
|
|
4027
4057
|
existingCollectionPaths: l
|
|
4028
4058
|
}) {
|
|
4029
4059
|
const [o, d] = j(!1), [c, u] = j();
|
|
4030
|
-
|
|
4060
|
+
ce(() => {
|
|
4031
4061
|
r && l && (d(!0), r(t).then((g) => {
|
|
4032
4062
|
const x = g.filter((y) => !(l ?? []).find((P) => P.trim().toLowerCase() === y.trim().toLowerCase()));
|
|
4033
4063
|
u(x);
|
|
@@ -4038,8 +4068,8 @@ function Ji({
|
|
|
4038
4068
|
setFieldValue: p,
|
|
4039
4069
|
setValues: s,
|
|
4040
4070
|
submitCount: f
|
|
4041
|
-
} =
|
|
4042
|
-
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(
|
|
4071
|
+
} = Y();
|
|
4072
|
+
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: [
|
|
4043
4073
|
/* @__PURE__ */ e(
|
|
4044
4074
|
"div",
|
|
4045
4075
|
{
|
|
@@ -4047,7 +4077,7 @@ function Ji({
|
|
|
4047
4077
|
children: /* @__PURE__ */ e(V, { variant: "h4", className: "flex-grow", children: "New collection" })
|
|
4048
4078
|
}
|
|
4049
4079
|
),
|
|
4050
|
-
n && /* @__PURE__ */ e(
|
|
4080
|
+
n && /* @__PURE__ */ e(Pt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
|
|
4051
4081
|
"This is a subcollection of ",
|
|
4052
4082
|
/* @__PURE__ */ e("b", { children: n.name })
|
|
4053
4083
|
] }) }),
|
|
@@ -4061,13 +4091,13 @@ function Ji({
|
|
|
4061
4091
|
}
|
|
4062
4092
|
),
|
|
4063
4093
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
|
|
4064
|
-
o && !c && /* @__PURE__ */ e(
|
|
4094
|
+
o && !c && /* @__PURE__ */ e(He, { size: "small" }),
|
|
4065
4095
|
c?.map((g, x) => /* @__PURE__ */ e(
|
|
4066
|
-
|
|
4096
|
+
Pt,
|
|
4067
4097
|
{
|
|
4068
4098
|
colorScheme: "cyanLighter",
|
|
4069
4099
|
onClick: () => {
|
|
4070
|
-
p("name",
|
|
4100
|
+
p("name", xt(g)), p("id", g), p("path", g), p("properties", void 0), i();
|
|
4071
4101
|
},
|
|
4072
4102
|
size: "small",
|
|
4073
4103
|
children: g
|
|
@@ -4088,46 +4118,46 @@ function Ji({
|
|
|
4088
4118
|
),
|
|
4089
4119
|
/* @__PURE__ */ a("div", { className: "flex gap-4", children: [
|
|
4090
4120
|
/* @__PURE__ */ e(
|
|
4091
|
-
|
|
4121
|
+
ot,
|
|
4092
4122
|
{
|
|
4093
4123
|
title: "Products",
|
|
4094
4124
|
subtitle: "A collection of products with images, prices and stock",
|
|
4095
|
-
icon: /* @__PURE__ */ e(
|
|
4125
|
+
icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: qt.icon }),
|
|
4096
4126
|
onClick: () => {
|
|
4097
|
-
s(
|
|
4127
|
+
s(qt), i();
|
|
4098
4128
|
}
|
|
4099
4129
|
}
|
|
4100
4130
|
),
|
|
4101
4131
|
/* @__PURE__ */ e(
|
|
4102
|
-
|
|
4132
|
+
ot,
|
|
4103
4133
|
{
|
|
4104
4134
|
title: "Users",
|
|
4105
4135
|
subtitle: "A collection of users with emails, names and roles",
|
|
4106
|
-
icon: /* @__PURE__ */ e(
|
|
4136
|
+
icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: $t.icon }),
|
|
4107
4137
|
onClick: () => {
|
|
4108
|
-
s(
|
|
4138
|
+
s($t), i();
|
|
4109
4139
|
}
|
|
4110
4140
|
}
|
|
4111
4141
|
),
|
|
4112
4142
|
/* @__PURE__ */ e(
|
|
4113
|
-
|
|
4143
|
+
ot,
|
|
4114
4144
|
{
|
|
4115
4145
|
title: "Blog posts",
|
|
4116
4146
|
subtitle: "A collection of blog posts with images, authors and complex content",
|
|
4117
|
-
icon: /* @__PURE__ */ e(
|
|
4147
|
+
icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Lt.icon }),
|
|
4118
4148
|
onClick: () => {
|
|
4119
|
-
s(
|
|
4149
|
+
s(Lt), i();
|
|
4120
4150
|
}
|
|
4121
4151
|
}
|
|
4122
4152
|
),
|
|
4123
4153
|
/* @__PURE__ */ e(
|
|
4124
|
-
|
|
4154
|
+
ot,
|
|
4125
4155
|
{
|
|
4126
4156
|
title: "Pages",
|
|
4127
4157
|
subtitle: "A collection of pages with images, authors and complex content",
|
|
4128
|
-
icon: /* @__PURE__ */ e(
|
|
4158
|
+
icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Ht.icon }),
|
|
4129
4159
|
onClick: () => {
|
|
4130
|
-
s(
|
|
4160
|
+
s(Ht), i();
|
|
4131
4161
|
}
|
|
4132
4162
|
}
|
|
4133
4163
|
)
|
|
@@ -4143,22 +4173,22 @@ function Ji({
|
|
|
4143
4173
|
children: "● Create a collection from a file (csv, json, xls, xslx...)"
|
|
4144
4174
|
}
|
|
4145
4175
|
),
|
|
4146
|
-
/* @__PURE__ */ e(
|
|
4176
|
+
/* @__PURE__ */ e(pi, { onDataAdded: (g, x) => i(g, x) })
|
|
4147
4177
|
] }),
|
|
4148
4178
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(z, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
|
|
4149
4179
|
] }) });
|
|
4150
4180
|
}
|
|
4151
|
-
function
|
|
4181
|
+
function ot({
|
|
4152
4182
|
title: t,
|
|
4153
4183
|
subtitle: r,
|
|
4154
4184
|
icon: n,
|
|
4155
4185
|
onClick: i
|
|
4156
4186
|
}) {
|
|
4157
|
-
return /* @__PURE__ */ e(
|
|
4158
|
-
|
|
4187
|
+
return /* @__PURE__ */ e(ee, { title: r, children: /* @__PURE__ */ a(
|
|
4188
|
+
tr,
|
|
4159
4189
|
{
|
|
4160
4190
|
onClick: i,
|
|
4161
|
-
className:
|
|
4191
|
+
className: he(
|
|
4162
4192
|
"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",
|
|
4163
4193
|
"text-gray-700 dark:text-slate-300",
|
|
4164
4194
|
"hover:border-primary-dark hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary",
|
|
@@ -4171,7 +4201,7 @@ function lt({
|
|
|
4171
4201
|
}
|
|
4172
4202
|
) });
|
|
4173
4203
|
}
|
|
4174
|
-
function
|
|
4204
|
+
function Xi({
|
|
4175
4205
|
importConfig: t,
|
|
4176
4206
|
propertyConfigs: r,
|
|
4177
4207
|
collectionEditable: n
|
|
@@ -4180,23 +4210,23 @@ function Qi({
|
|
|
4180
4210
|
setFieldValue: i,
|
|
4181
4211
|
setFieldTouched: l,
|
|
4182
4212
|
values: o
|
|
4183
|
-
} =
|
|
4213
|
+
} = Y(), [d, c] = j(void 0), u = G.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), m = d ? d.id : void 0, p = d || void 0, s = ({
|
|
4184
4214
|
id: g,
|
|
4185
4215
|
property: x,
|
|
4186
4216
|
previousId: y,
|
|
4187
4217
|
namespace: P
|
|
4188
4218
|
}) => {
|
|
4189
|
-
const v = g ? ne(g, P) : void 0, b = v ?
|
|
4190
|
-
const N =
|
|
4219
|
+
const v = g ? ne(g, P) : void 0, b = v ? me(v) : void 0, T = (C) => C ? u.current[C] ?? I(o, ye(C)) : u.current[""], w = (C, O) => {
|
|
4220
|
+
const N = ye(O);
|
|
4191
4221
|
i(N, C, !1), u.current[O ?? ""] = C;
|
|
4192
4222
|
};
|
|
4193
4223
|
if (y && y !== g) {
|
|
4194
|
-
const C = ne(y, P), O =
|
|
4224
|
+
const C = ne(y, P), O = me(C), F = T(P).map((_) => _ === y ? g : _).filter((_) => _ !== void 0);
|
|
4195
4225
|
w(F, P);
|
|
4196
|
-
const
|
|
4197
|
-
Object.keys(
|
|
4198
|
-
|
|
4199
|
-
}), t.setHeadersMapping(
|
|
4226
|
+
const B = { ...t.headersMapping };
|
|
4227
|
+
Object.keys(B).forEach((_) => {
|
|
4228
|
+
B[_] === y && (B[_] = g ?? "");
|
|
4229
|
+
}), t.setHeadersMapping(B), i(O, void 0, !1), l(O, !1, !1);
|
|
4200
4230
|
}
|
|
4201
4231
|
b && (i(b, x, !1), l(b, !0, !1));
|
|
4202
4232
|
}, f = async ({
|
|
@@ -4205,17 +4235,17 @@ function Qi({
|
|
|
4205
4235
|
property: y,
|
|
4206
4236
|
namespace: P
|
|
4207
4237
|
}) => {
|
|
4208
|
-
const v = g ? ne(g, P) : void 0, b = v ?
|
|
4209
|
-
...
|
|
4238
|
+
const v = g ? ne(g, P) : void 0, b = v ? me(v) : void 0, T = t.importData.map((C) => I(C, x)), w = {
|
|
4239
|
+
...ni(T, y, rr),
|
|
4210
4240
|
editable: !0
|
|
4211
4241
|
};
|
|
4212
4242
|
b && (w ? i(b, w, !1) : i(b, y, !1), l(b, !0, !1));
|
|
4213
4243
|
};
|
|
4214
4244
|
return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
|
|
4215
|
-
/* @__PURE__ */ a(
|
|
4245
|
+
/* @__PURE__ */ a(mt, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
4216
4246
|
/* @__PURE__ */ e(V, { variant: "h6", className: "my-4 ml-3.5", children: "Data property mapping" }),
|
|
4217
4247
|
/* @__PURE__ */ e(
|
|
4218
|
-
|
|
4248
|
+
mi,
|
|
4219
4249
|
{
|
|
4220
4250
|
importConfig: t,
|
|
4221
4251
|
destinationProperties: o.properties,
|
|
@@ -4225,7 +4255,7 @@ function Qi({
|
|
|
4225
4255
|
importKey: y,
|
|
4226
4256
|
isIdColumn: P
|
|
4227
4257
|
}) => P ? /* @__PURE__ */ e(V, { children: " This column will be used as ID" }) : /* @__PURE__ */ e(
|
|
4228
|
-
|
|
4258
|
+
hi,
|
|
4229
4259
|
{
|
|
4230
4260
|
property: g,
|
|
4231
4261
|
propertyKey: x,
|
|
@@ -4238,7 +4268,7 @@ function Qi({
|
|
|
4238
4268
|
});
|
|
4239
4269
|
},
|
|
4240
4270
|
propertyTypeView: /* @__PURE__ */ e(
|
|
4241
|
-
|
|
4271
|
+
en,
|
|
4242
4272
|
{
|
|
4243
4273
|
property: g,
|
|
4244
4274
|
disabled: !1,
|
|
@@ -4256,7 +4286,7 @@ function Qi({
|
|
|
4256
4286
|
)
|
|
4257
4287
|
] }),
|
|
4258
4288
|
/* @__PURE__ */ e(
|
|
4259
|
-
|
|
4289
|
+
Oe,
|
|
4260
4290
|
{
|
|
4261
4291
|
open: d !== void 0,
|
|
4262
4292
|
propertyKey: m,
|
|
@@ -4280,21 +4310,21 @@ function Qi({
|
|
|
4280
4310
|
/* @__PURE__ */ e("div", { style: { height: "52px" } })
|
|
4281
4311
|
] });
|
|
4282
4312
|
}
|
|
4283
|
-
function
|
|
4313
|
+
function en({
|
|
4284
4314
|
property: t,
|
|
4285
4315
|
onPropertyChanged: r,
|
|
4286
4316
|
propertyKey: n,
|
|
4287
4317
|
propertyConfigs: i,
|
|
4288
4318
|
disabled: l
|
|
4289
4319
|
}) {
|
|
4290
|
-
const o = t ?
|
|
4320
|
+
const o = t ? Gt(t) : null, d = t ? je(t, i) : null, [c, u] = j(!1);
|
|
4291
4321
|
return /* @__PURE__ */ e(
|
|
4292
|
-
|
|
4322
|
+
ee,
|
|
4293
4323
|
{
|
|
4294
4324
|
title: t && d ? `${d?.name} - ${t.dataType}` : void 0,
|
|
4295
4325
|
open: c ? !1 : void 0,
|
|
4296
4326
|
children: /* @__PURE__ */ e(
|
|
4297
|
-
|
|
4327
|
+
be,
|
|
4298
4328
|
{
|
|
4299
4329
|
open: c,
|
|
4300
4330
|
onOpenChange: u,
|
|
@@ -4305,9 +4335,9 @@ function Xi({
|
|
|
4305
4335
|
value: o ?? "",
|
|
4306
4336
|
placeholder: "Select a property widget",
|
|
4307
4337
|
position: "item-aligned",
|
|
4308
|
-
renderValue: (m) => d ? /* @__PURE__ */ e(
|
|
4338
|
+
renderValue: (m) => d ? /* @__PURE__ */ e(qe, { propertyConfig: d }) : null,
|
|
4309
4339
|
onValueChange: (m) => {
|
|
4310
|
-
const p =
|
|
4340
|
+
const p = or(t, m, i);
|
|
4311
4341
|
n && r({
|
|
4312
4342
|
id: n,
|
|
4313
4343
|
property: p,
|
|
@@ -4315,8 +4345,8 @@ function Xi({
|
|
|
4315
4345
|
namespace: void 0
|
|
4316
4346
|
});
|
|
4317
4347
|
},
|
|
4318
|
-
children: Object.entries(
|
|
4319
|
-
|
|
4348
|
+
children: Object.entries(sr).map(([m, p]) => /* @__PURE__ */ e(
|
|
4349
|
+
lr,
|
|
4320
4350
|
{
|
|
4321
4351
|
value: m,
|
|
4322
4352
|
optionDisabled: !1,
|
|
@@ -4330,22 +4360,22 @@ function Xi({
|
|
|
4330
4360
|
}
|
|
4331
4361
|
);
|
|
4332
4362
|
}
|
|
4333
|
-
function
|
|
4363
|
+
function tn({
|
|
4334
4364
|
importConfig: t,
|
|
4335
4365
|
properties: r,
|
|
4336
4366
|
propertiesOrder: n
|
|
4337
4367
|
}) {
|
|
4338
4368
|
const [i, l] = j(!1);
|
|
4339
4369
|
async function o() {
|
|
4340
|
-
const c = t.importData.map((u) =>
|
|
4370
|
+
const c = t.importData.map((u) => fi(u, t.idColumn, t.headersMapping, r, "TEMP_PATH", t.defaultValues));
|
|
4341
4371
|
t.setEntities(c);
|
|
4342
4372
|
}
|
|
4343
|
-
|
|
4373
|
+
ce(() => {
|
|
4344
4374
|
o().finally(() => l(!1));
|
|
4345
4375
|
}, []);
|
|
4346
|
-
const d =
|
|
4347
|
-
return i ? /* @__PURE__ */ e(
|
|
4348
|
-
|
|
4376
|
+
const d = Tr();
|
|
4377
|
+
return i ? /* @__PURE__ */ e(ct, {}) : /* @__PURE__ */ e(
|
|
4378
|
+
kr,
|
|
4349
4379
|
{
|
|
4350
4380
|
title: /* @__PURE__ */ a("div", { children: [
|
|
4351
4381
|
/* @__PURE__ */ e(V, { variant: "subtitle2", children: "Imported data preview" }),
|
|
@@ -4369,11 +4399,11 @@ function en({
|
|
|
4369
4399
|
}
|
|
4370
4400
|
);
|
|
4371
4401
|
}
|
|
4372
|
-
function
|
|
4402
|
+
function ur(t, r = "") {
|
|
4373
4403
|
const n = Object.keys(t).reduce((o, d) => {
|
|
4374
|
-
const c = t[d], u =
|
|
4404
|
+
const c = t[d], u = Or(d), m = r ? `${r}.${u}` : u;
|
|
4375
4405
|
if (c.dataType === "map" && c.properties) {
|
|
4376
|
-
const f =
|
|
4406
|
+
const f = ur(c.properties, m);
|
|
4377
4407
|
return {
|
|
4378
4408
|
headersMapping: { ...o.headersMapping, [d]: m },
|
|
4379
4409
|
properties: {
|
|
@@ -4401,14 +4431,14 @@ function pr(t, r = "") {
|
|
|
4401
4431
|
idColumn: l
|
|
4402
4432
|
};
|
|
4403
4433
|
}
|
|
4404
|
-
function
|
|
4405
|
-
const r = t.open, [n, i] =
|
|
4434
|
+
function pr(t) {
|
|
4435
|
+
const r = t.open, [n, i] = ze.useState(!1), [l, o] = ze.useState(!1), d = () => {
|
|
4406
4436
|
n ? o(!0) : t.handleClose(void 0);
|
|
4407
|
-
}
|
|
4408
|
-
return
|
|
4437
|
+
};
|
|
4438
|
+
return ce(() => {
|
|
4409
4439
|
r || (i(!1), o(!1));
|
|
4410
4440
|
}, [r]), /* @__PURE__ */ a(
|
|
4411
|
-
|
|
4441
|
+
_e,
|
|
4412
4442
|
{
|
|
4413
4443
|
open: r,
|
|
4414
4444
|
fullWidth: !0,
|
|
@@ -4418,7 +4448,7 @@ function mr(t) {
|
|
|
4418
4448
|
onOpenChange: (c) => c ? void 0 : d(),
|
|
4419
4449
|
children: [
|
|
4420
4450
|
r && /* @__PURE__ */ e(
|
|
4421
|
-
|
|
4451
|
+
rn,
|
|
4422
4452
|
{
|
|
4423
4453
|
...t,
|
|
4424
4454
|
handleCancel: d,
|
|
@@ -4438,36 +4468,36 @@ function mr(t) {
|
|
|
4438
4468
|
}
|
|
4439
4469
|
);
|
|
4440
4470
|
}
|
|
4441
|
-
function
|
|
4442
|
-
const { propertyConfigs: r } =
|
|
4471
|
+
function rn(t) {
|
|
4472
|
+
const { propertyConfigs: r } = Se(), n = Te(), i = Ie(), {
|
|
4443
4473
|
topLevelNavigation: l,
|
|
4444
4474
|
collections: o
|
|
4445
|
-
} = n, d = t.initialValues, c = !d?.path && (t.parentCollectionIds ?? []).length === 0, u = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], m = u.map((b) => b.path.trim().toLowerCase()), p = u.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [s, f] =
|
|
4446
|
-
if (
|
|
4475
|
+
} = n, d = t.initialValues, c = !d?.path && (t.parentCollectionIds ?? []).length === 0, u = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], m = u.map((b) => b.path.trim().toLowerCase()), p = u.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [s, f] = ze.useState(), [g, x] = ze.useState(!1);
|
|
4476
|
+
if (ce(() => {
|
|
4447
4477
|
try {
|
|
4448
4478
|
n.initialised && (t.editedCollectionId ? f(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : f(void 0), x(!0));
|
|
4449
4479
|
} catch (b) {
|
|
4450
4480
|
console.error(b);
|
|
4451
4481
|
}
|
|
4452
|
-
}, [t.editedCollectionId, t.parentCollectionIds, n]), !l)
|
|
4482
|
+
}, [t.editedCollectionId, t.parentCollectionIds, n.initialised, n.getCollectionFromPaths]), !l)
|
|
4453
4483
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
4454
4484
|
const {
|
|
4455
4485
|
groups: y
|
|
4456
4486
|
} = l, P = s ? {
|
|
4457
4487
|
...s,
|
|
4458
|
-
id: s.id ?? s.path ??
|
|
4459
|
-
} : void 0, v = P ?
|
|
4460
|
-
id: d?.path ??
|
|
4488
|
+
id: s.id ?? s.path ?? _t(16)
|
|
4489
|
+
} : void 0, v = P ? an(P, r) : {
|
|
4490
|
+
id: d?.path ?? _t(16),
|
|
4461
4491
|
path: d?.path ?? "",
|
|
4462
4492
|
name: d?.name ?? "",
|
|
4463
4493
|
group: d?.group ?? "",
|
|
4464
4494
|
properties: {},
|
|
4465
4495
|
propertiesOrder: [],
|
|
4466
|
-
icon:
|
|
4496
|
+
icon: Mt[Math.floor(Math.random() * Mt.length)],
|
|
4467
4497
|
ownerId: i.user?.uid ?? ""
|
|
4468
4498
|
};
|
|
4469
|
-
return g ? !t.isNewCollection && (!n.initialised || !g) ? /* @__PURE__ */ e(
|
|
4470
|
-
|
|
4499
|
+
return g ? !t.isNewCollection && (!n.initialised || !g) ? /* @__PURE__ */ e(ct, {}) : /* @__PURE__ */ e(
|
|
4500
|
+
nn,
|
|
4471
4501
|
{
|
|
4472
4502
|
...t,
|
|
4473
4503
|
initialValues: v,
|
|
@@ -4479,9 +4509,9 @@ function tn(t) {
|
|
|
4479
4509
|
groups: y,
|
|
4480
4510
|
propertyConfigs: r
|
|
4481
4511
|
}
|
|
4482
|
-
) : /* @__PURE__ */ e(
|
|
4512
|
+
) : /* @__PURE__ */ e(ct, {});
|
|
4483
4513
|
}
|
|
4484
|
-
function
|
|
4514
|
+
function nn({
|
|
4485
4515
|
isNewCollection: t,
|
|
4486
4516
|
configController: r,
|
|
4487
4517
|
editedCollectionId: n,
|
|
@@ -4506,56 +4536,56 @@ function rn({
|
|
|
4506
4536
|
propertyConfigs: C,
|
|
4507
4537
|
groups: O
|
|
4508
4538
|
}) {
|
|
4509
|
-
const N =
|
|
4510
|
-
const
|
|
4539
|
+
const N = gi(), F = Te(), B = Ve(), _ = Re({}), E = t ? v ? "welcome" : "details" : "properties", [h, D] = j(E), [ae, q] = ze.useState(), Z = (k) => {
|
|
4540
|
+
const S = k.id || k.path;
|
|
4511
4541
|
return r.saveCollection({
|
|
4512
|
-
id:
|
|
4542
|
+
id: S,
|
|
4513
4543
|
collectionData: k,
|
|
4514
4544
|
previousId: n,
|
|
4515
4545
|
parentCollectionIds: i
|
|
4516
|
-
}).then(() => (q(void 0), !0)).catch((M) => (q(M), console.error(M),
|
|
4546
|
+
}).then(() => (q(void 0), !0)).catch((M) => (q(M), console.error(M), B.open({
|
|
4517
4547
|
type: "error",
|
|
4518
4548
|
message: "Error persisting collection: " + (M.message ?? "Details in the console")
|
|
4519
4549
|
}), !1));
|
|
4520
|
-
}, H =
|
|
4521
|
-
h === "details" ? N.inUse ?
|
|
4522
|
-
},
|
|
4550
|
+
}, H = () => {
|
|
4551
|
+
h === "details" ? N.inUse ? D("import_data_saving") : D(u ? "extra_view" : "properties") : D(h === "welcome" ? "details" : h === "import_data_mapping" ? "import_data_preview" : h === "import_data_preview" ? "details" : h === "extra_view" ? "properties" : "details");
|
|
4552
|
+
}, Q = (k) => {
|
|
4523
4553
|
if (o)
|
|
4524
4554
|
return o?.(k.path, k.collectionGroup ?? !1, i ?? []);
|
|
4525
|
-
},
|
|
4555
|
+
}, le = async (k) => {
|
|
4526
4556
|
try {
|
|
4527
4557
|
if (!Q)
|
|
4528
4558
|
return T(k), Promise.resolve(k);
|
|
4529
|
-
|
|
4530
|
-
const
|
|
4531
|
-
if (!
|
|
4559
|
+
D("loading");
|
|
4560
|
+
const S = await Q?.(k);
|
|
4561
|
+
if (!S)
|
|
4532
4562
|
return T(k), Promise.resolve(k);
|
|
4533
4563
|
const M = {
|
|
4534
4564
|
...k ?? {}
|
|
4535
4565
|
};
|
|
4536
|
-
return Object.keys(
|
|
4566
|
+
return Object.keys(S.properties ?? {}).length > 0 && (M.properties = S.properties, M.propertiesOrder = S.propertiesOrder), M.propertiesOrder ? (T(M), console.debug("Inferred collection", {
|
|
4537
4567
|
newCollection: k ?? {},
|
|
4538
4568
|
values: M
|
|
4539
4569
|
}), M) : (M.propertiesOrder = Object.keys(M.properties), M);
|
|
4540
|
-
} catch (
|
|
4541
|
-
return console.error(
|
|
4570
|
+
} catch (S) {
|
|
4571
|
+
return console.error(S), B.open({
|
|
4542
4572
|
type: "error",
|
|
4543
|
-
message: "Error inferring collection: " + (
|
|
4573
|
+
message: "Error inferring collection: " + (S.message ?? "Details in the console")
|
|
4544
4574
|
}), k;
|
|
4545
4575
|
}
|
|
4546
|
-
},
|
|
4576
|
+
}, se = kt({
|
|
4547
4577
|
initialValues: w,
|
|
4548
|
-
onSubmit: (k,
|
|
4578
|
+
onSubmit: (k, S) => {
|
|
4549
4579
|
console.log("Submitting collection", k);
|
|
4550
4580
|
try {
|
|
4551
4581
|
if (!t) {
|
|
4552
4582
|
Z(k).then(() => {
|
|
4553
|
-
|
|
4583
|
+
S.resetForm({ values: w }), d(k);
|
|
4554
4584
|
});
|
|
4555
4585
|
return;
|
|
4556
4586
|
}
|
|
4557
|
-
h === "welcome" ? (H(),
|
|
4558
|
-
|
|
4587
|
+
h === "welcome" ? (H(), S.resetForm({ values: k })) : h === "details" ? u || N.inUse ? (S.resetForm({ values: k }), H()) : t ? le(k).then((M) => {
|
|
4588
|
+
S.resetForm({
|
|
4559
4589
|
values: M ?? k,
|
|
4560
4590
|
touched: {
|
|
4561
4591
|
path: !0,
|
|
@@ -4564,70 +4594,70 @@ function rn({
|
|
|
4564
4594
|
});
|
|
4565
4595
|
}).finally(() => {
|
|
4566
4596
|
H();
|
|
4567
|
-
}) : (
|
|
4568
|
-
|
|
4569
|
-
}) : (H(),
|
|
4597
|
+
}) : (S.resetForm({ values: k }), H()) : h === "extra_view" ? (H(), S.resetForm({ values: k })) : h === "import_data_mapping" || h === "import_data_preview" ? H() : h === "properties" ? Z(k).then(() => {
|
|
4598
|
+
S.resetForm({ values: w }), H(), d(k);
|
|
4599
|
+
}) : (H(), S.resetForm({ values: k }));
|
|
4570
4600
|
} catch (M) {
|
|
4571
|
-
|
|
4601
|
+
B.open({
|
|
4572
4602
|
type: "error",
|
|
4573
4603
|
message: "Error persisting collection: " + (M.message ?? "Details in the console")
|
|
4574
|
-
}), console.error(M),
|
|
4604
|
+
}), console.error(M), S.resetForm({ values: k });
|
|
4575
4605
|
}
|
|
4576
4606
|
},
|
|
4577
4607
|
validation: (k) => {
|
|
4578
|
-
let
|
|
4579
|
-
const M = (h === "properties" || h === "subcollections" || h === "details") &&
|
|
4608
|
+
let S = {};
|
|
4609
|
+
const M = (h === "properties" || h === "subcollections" || h === "details") && bi;
|
|
4580
4610
|
if (M)
|
|
4581
4611
|
try {
|
|
4582
4612
|
M.validateSync(k, { abortEarly: !1 });
|
|
4583
4613
|
} catch (L) {
|
|
4584
|
-
L.inner.forEach((
|
|
4585
|
-
|
|
4614
|
+
L.inner.forEach((ge) => {
|
|
4615
|
+
S[ge.path] = ge.message;
|
|
4586
4616
|
});
|
|
4587
4617
|
}
|
|
4588
|
-
if (h === "properties" && (
|
|
4589
|
-
const L =
|
|
4590
|
-
L && (
|
|
4591
|
-
const
|
|
4592
|
-
|
|
4618
|
+
if (h === "properties" && (S = { ...S, ..._.current }), h === "details") {
|
|
4619
|
+
const L = Yt(k.path, t, y, k.id);
|
|
4620
|
+
L && (S.path = L);
|
|
4621
|
+
const ge = on(k.id, t, y, P);
|
|
4622
|
+
ge && (S.id = ge);
|
|
4593
4623
|
}
|
|
4594
|
-
return
|
|
4624
|
+
return S;
|
|
4595
4625
|
}
|
|
4596
4626
|
}), {
|
|
4597
|
-
values:
|
|
4598
|
-
setFieldValue:
|
|
4627
|
+
values: te,
|
|
4628
|
+
setFieldValue: xe,
|
|
4599
4629
|
isSubmitting: ke,
|
|
4600
|
-
dirty:
|
|
4601
|
-
submitCount:
|
|
4602
|
-
} =
|
|
4603
|
-
|
|
4604
|
-
p(
|
|
4605
|
-
}, [
|
|
4606
|
-
function
|
|
4607
|
-
N.setInUse(!0),
|
|
4608
|
-
const L =
|
|
4630
|
+
dirty: Ye,
|
|
4631
|
+
submitCount: gt
|
|
4632
|
+
} = se, ue = te.path, We = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + ue : ue, Ge = Yt(ue, t, y, te.id), Ke = !Ge && i ? F.convertIdsToPaths(i) : void 0, Ze = Ge ? void 0 : F.resolveAliasesFrom(We), Je = Ze && x ? () => x(Ze, Ke ?? []) : void 0;
|
|
4633
|
+
ce(() => {
|
|
4634
|
+
p(Ye);
|
|
4635
|
+
}, [Ye]);
|
|
4636
|
+
function Qe(k, S) {
|
|
4637
|
+
N.setInUse(!0), ai(k, rr).then((M) => {
|
|
4638
|
+
const L = ur(M);
|
|
4609
4639
|
N.setIdColumn(L.idColumn), N.setImportData(k), N.setHeadersMapping(L.headersMapping);
|
|
4610
|
-
const
|
|
4611
|
-
N.setHeadingsOrder(
|
|
4612
|
-
const
|
|
4613
|
-
|
|
4640
|
+
const ge = (S ?? []).filter((et) => L.headersMapping[et]) ?? Object.keys(L.properties);
|
|
4641
|
+
N.setHeadingsOrder(ge), N.setOriginProperties(L.properties);
|
|
4642
|
+
const Xe = (S ?? []).map((et) => L.headersMapping[et]).filter(Boolean) ?? Object.keys(L.properties);
|
|
4643
|
+
xe("properties", L.properties), xe("propertiesOrder", Xe);
|
|
4614
4644
|
});
|
|
4615
4645
|
}
|
|
4616
|
-
const
|
|
4617
|
-
const k = { ...
|
|
4618
|
-
N.idColumn && delete k[N.idColumn],
|
|
4646
|
+
const vt = !!te.name && !!te.id, yt = () => {
|
|
4647
|
+
const k = { ...te.properties };
|
|
4648
|
+
N.idColumn && delete k[N.idColumn], xe("properties", k), H();
|
|
4619
4649
|
}, U = b?.editable === void 0 || b?.editable === !0 || t;
|
|
4620
|
-
return /* @__PURE__ */ e(
|
|
4650
|
+
return /* @__PURE__ */ e(Ae, { fullHeight: !0, children: /* @__PURE__ */ e(Ot, { value: se, children: /* @__PURE__ */ a(R, { children: [
|
|
4621
4651
|
!t && /* @__PURE__ */ a(
|
|
4622
|
-
|
|
4652
|
+
Zr,
|
|
4623
4653
|
{
|
|
4624
4654
|
value: h,
|
|
4625
|
-
className:
|
|
4626
|
-
onValueChange: (k) =>
|
|
4655
|
+
className: he(Tt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
4656
|
+
onValueChange: (k) => D(k),
|
|
4627
4657
|
children: [
|
|
4628
|
-
/* @__PURE__ */ e(
|
|
4629
|
-
/* @__PURE__ */ e(
|
|
4630
|
-
/* @__PURE__ */ e(
|
|
4658
|
+
/* @__PURE__ */ e(Ct, { value: "details", children: "Details" }),
|
|
4659
|
+
/* @__PURE__ */ e(Ct, { value: "properties", children: "Properties" }),
|
|
4660
|
+
/* @__PURE__ */ e(Ct, { value: "subcollections", children: "Additional views" })
|
|
4631
4661
|
]
|
|
4632
4662
|
}
|
|
4633
4663
|
),
|
|
@@ -4635,20 +4665,20 @@ function rn({
|
|
|
4635
4665
|
"form",
|
|
4636
4666
|
{
|
|
4637
4667
|
noValidate: !0,
|
|
4638
|
-
onSubmit:
|
|
4639
|
-
className:
|
|
4668
|
+
onSubmit: se.handleSubmit,
|
|
4669
|
+
className: he(
|
|
4640
4670
|
t ? "h-full" : "h-[calc(100%-48px)]",
|
|
4641
4671
|
"flex-grow flex flex-col relative"
|
|
4642
4672
|
),
|
|
4643
4673
|
children: [
|
|
4644
|
-
h === "loading" && /* @__PURE__ */ e(
|
|
4645
|
-
h === "extra_view" &&
|
|
4674
|
+
h === "loading" && /* @__PURE__ */ e(ct, {}),
|
|
4675
|
+
h === "extra_view" && ue && u?.View && /* @__PURE__ */ e(u.View, { path: ue }),
|
|
4646
4676
|
h === "welcome" && /* @__PURE__ */ e(
|
|
4647
|
-
|
|
4677
|
+
Qi,
|
|
4648
4678
|
{
|
|
4649
|
-
path:
|
|
4650
|
-
onContinue: (k,
|
|
4651
|
-
k ? (
|
|
4679
|
+
path: ue,
|
|
4680
|
+
onContinue: (k, S) => {
|
|
4681
|
+
k ? (Qe(k, S), D("import_data_mapping")) : D("details");
|
|
4652
4682
|
},
|
|
4653
4683
|
existingCollectionPaths: y,
|
|
4654
4684
|
parentCollection: g,
|
|
@@ -4656,7 +4686,7 @@ function rn({
|
|
|
4656
4686
|
}
|
|
4657
4687
|
),
|
|
4658
4688
|
h === "import_data_mapping" && N && /* @__PURE__ */ e(
|
|
4659
|
-
|
|
4689
|
+
Xi,
|
|
4660
4690
|
{
|
|
4661
4691
|
importConfig: N,
|
|
4662
4692
|
collectionEditable: U,
|
|
@@ -4664,29 +4694,29 @@ function rn({
|
|
|
4664
4694
|
}
|
|
4665
4695
|
),
|
|
4666
4696
|
h === "import_data_preview" && N && /* @__PURE__ */ e(
|
|
4667
|
-
|
|
4697
|
+
tn,
|
|
4668
4698
|
{
|
|
4669
4699
|
importConfig: N,
|
|
4670
|
-
properties:
|
|
4671
|
-
propertiesOrder:
|
|
4700
|
+
properties: te.properties,
|
|
4701
|
+
propertiesOrder: te.propertiesOrder
|
|
4672
4702
|
}
|
|
4673
4703
|
),
|
|
4674
4704
|
h === "import_data_saving" && N && /* @__PURE__ */ e(
|
|
4675
|
-
|
|
4705
|
+
vi,
|
|
4676
4706
|
{
|
|
4677
4707
|
importConfig: N,
|
|
4678
|
-
collection:
|
|
4679
|
-
path:
|
|
4708
|
+
collection: te,
|
|
4709
|
+
path: ue,
|
|
4680
4710
|
onImportSuccess: async (k) => {
|
|
4681
|
-
|
|
4711
|
+
B.open({
|
|
4682
4712
|
type: "info",
|
|
4683
4713
|
message: "Data imported successfully"
|
|
4684
|
-
}), await Z(
|
|
4714
|
+
}), await Z(te), d(k);
|
|
4685
4715
|
}
|
|
4686
4716
|
}
|
|
4687
4717
|
),
|
|
4688
4718
|
h === "details" && /* @__PURE__ */ e(
|
|
4689
|
-
|
|
4719
|
+
Ci,
|
|
4690
4720
|
{
|
|
4691
4721
|
existingPaths: y,
|
|
4692
4722
|
existingIds: P,
|
|
@@ -4697,7 +4727,7 @@ function rn({
|
|
|
4697
4727
|
}
|
|
4698
4728
|
),
|
|
4699
4729
|
h === "subcollections" && b && /* @__PURE__ */ e(
|
|
4700
|
-
|
|
4730
|
+
Ji,
|
|
4701
4731
|
{
|
|
4702
4732
|
parentCollection: g,
|
|
4703
4733
|
configController: r,
|
|
@@ -4710,45 +4740,45 @@ function rn({
|
|
|
4710
4740
|
h === "properties" && /* @__PURE__ */ e(
|
|
4711
4741
|
Gi,
|
|
4712
4742
|
{
|
|
4713
|
-
showErrors:
|
|
4743
|
+
showErrors: gt > 0,
|
|
4714
4744
|
isNewCollection: t,
|
|
4715
4745
|
reservedGroups: c,
|
|
4716
|
-
onPropertyError: (k,
|
|
4717
|
-
const L =
|
|
4746
|
+
onPropertyError: (k, S, M) => {
|
|
4747
|
+
const L = Ft({
|
|
4718
4748
|
..._.current,
|
|
4719
|
-
[
|
|
4749
|
+
[nr(k, S)]: Ft(M, !0)
|
|
4720
4750
|
}, !0);
|
|
4721
|
-
_.current = L,
|
|
4751
|
+
_.current = L, se.validate();
|
|
4722
4752
|
},
|
|
4723
4753
|
getUser: f,
|
|
4724
|
-
getData:
|
|
4754
|
+
getData: Je,
|
|
4725
4755
|
doCollectionInference: Q,
|
|
4726
4756
|
propertyConfigs: C,
|
|
4727
4757
|
collectionEditable: U,
|
|
4728
4758
|
extraIcon: u?.icon && /* @__PURE__ */ e(
|
|
4729
|
-
|
|
4759
|
+
ie,
|
|
4730
4760
|
{
|
|
4731
4761
|
color: "primary",
|
|
4732
|
-
onClick: () =>
|
|
4762
|
+
onClick: () => D("extra_view"),
|
|
4733
4763
|
children: u.icon
|
|
4734
4764
|
}
|
|
4735
4765
|
)
|
|
4736
4766
|
}
|
|
4737
4767
|
),
|
|
4738
4768
|
h !== "welcome" && /* @__PURE__ */ a(
|
|
4739
|
-
|
|
4769
|
+
De,
|
|
4740
4770
|
{
|
|
4741
4771
|
position: "absolute",
|
|
4742
4772
|
children: [
|
|
4743
|
-
|
|
4773
|
+
ae && /* @__PURE__ */ e(Kt, { error: ae }),
|
|
4744
4774
|
t && v && h === "import_data_mapping" && /* @__PURE__ */ a(
|
|
4745
4775
|
z,
|
|
4746
4776
|
{
|
|
4747
4777
|
variant: "text",
|
|
4748
4778
|
type: "button",
|
|
4749
|
-
onClick: () => (N.setInUse(!1),
|
|
4779
|
+
onClick: () => (N.setInUse(!1), D("welcome")),
|
|
4750
4780
|
children: [
|
|
4751
|
-
/* @__PURE__ */ e(
|
|
4781
|
+
/* @__PURE__ */ e(it, {}),
|
|
4752
4782
|
"Back"
|
|
4753
4783
|
]
|
|
4754
4784
|
}
|
|
@@ -4759,10 +4789,10 @@ function rn({
|
|
|
4759
4789
|
variant: "text",
|
|
4760
4790
|
type: "button",
|
|
4761
4791
|
onClick: () => {
|
|
4762
|
-
|
|
4792
|
+
D("import_data_mapping");
|
|
4763
4793
|
},
|
|
4764
4794
|
children: [
|
|
4765
|
-
/* @__PURE__ */ e(
|
|
4795
|
+
/* @__PURE__ */ e(it, {}),
|
|
4766
4796
|
"Back"
|
|
4767
4797
|
]
|
|
4768
4798
|
}
|
|
@@ -4772,9 +4802,9 @@ function rn({
|
|
|
4772
4802
|
{
|
|
4773
4803
|
variant: "text",
|
|
4774
4804
|
type: "button",
|
|
4775
|
-
onClick: () =>
|
|
4805
|
+
onClick: () => D("welcome"),
|
|
4776
4806
|
children: [
|
|
4777
|
-
/* @__PURE__ */ e(
|
|
4807
|
+
/* @__PURE__ */ e(it, {}),
|
|
4778
4808
|
"Back"
|
|
4779
4809
|
]
|
|
4780
4810
|
}
|
|
@@ -4784,9 +4814,9 @@ function rn({
|
|
|
4784
4814
|
{
|
|
4785
4815
|
variant: "text",
|
|
4786
4816
|
type: "button",
|
|
4787
|
-
onClick: () =>
|
|
4817
|
+
onClick: () => D("details"),
|
|
4788
4818
|
children: [
|
|
4789
|
-
/* @__PURE__ */ e(
|
|
4819
|
+
/* @__PURE__ */ e(it, {}),
|
|
4790
4820
|
"Back"
|
|
4791
4821
|
]
|
|
4792
4822
|
}
|
|
@@ -4806,7 +4836,7 @@ function rn({
|
|
|
4806
4836
|
{
|
|
4807
4837
|
variant: "filled",
|
|
4808
4838
|
color: "primary",
|
|
4809
|
-
onClick:
|
|
4839
|
+
onClick: yt,
|
|
4810
4840
|
children: "Next"
|
|
4811
4841
|
}
|
|
4812
4842
|
),
|
|
@@ -4822,14 +4852,14 @@ function rn({
|
|
|
4822
4852
|
}
|
|
4823
4853
|
),
|
|
4824
4854
|
t && (h === "details" || h === "properties") && /* @__PURE__ */ a(
|
|
4825
|
-
|
|
4855
|
+
zt,
|
|
4826
4856
|
{
|
|
4827
4857
|
variant: "filled",
|
|
4828
4858
|
color: "primary",
|
|
4829
4859
|
type: "submit",
|
|
4830
4860
|
loading: ke,
|
|
4831
|
-
disabled: ke || h === "details" && !
|
|
4832
|
-
startIcon: h === "properties" ? /* @__PURE__ */ e(
|
|
4861
|
+
disabled: ke || h === "details" && !vt,
|
|
4862
|
+
startIcon: h === "properties" ? /* @__PURE__ */ e(Jr, {}) : void 0,
|
|
4833
4863
|
children: [
|
|
4834
4864
|
h === "details" && "Next",
|
|
4835
4865
|
h === "properties" && "Create collection"
|
|
@@ -4837,7 +4867,7 @@ function rn({
|
|
|
4837
4867
|
}
|
|
4838
4868
|
),
|
|
4839
4869
|
!t && /* @__PURE__ */ e(
|
|
4840
|
-
|
|
4870
|
+
zt,
|
|
4841
4871
|
{
|
|
4842
4872
|
variant: "filled",
|
|
4843
4873
|
color: "primary",
|
|
@@ -4854,28 +4884,28 @@ function rn({
|
|
|
4854
4884
|
)
|
|
4855
4885
|
] }) }) });
|
|
4856
4886
|
}
|
|
4857
|
-
function
|
|
4887
|
+
function an(t, r) {
|
|
4858
4888
|
const {
|
|
4859
4889
|
properties: n,
|
|
4860
4890
|
...i
|
|
4861
4891
|
} = t, l = {};
|
|
4862
4892
|
return n && Object.keys(n).forEach((o) => {
|
|
4863
|
-
l[o] =
|
|
4893
|
+
l[o] = mr(n[o], r);
|
|
4864
4894
|
}), {
|
|
4865
4895
|
...i,
|
|
4866
4896
|
properties: l
|
|
4867
4897
|
};
|
|
4868
4898
|
}
|
|
4869
|
-
function
|
|
4899
|
+
function mr(t, r) {
|
|
4870
4900
|
let n = t;
|
|
4871
4901
|
if (r && typeof n == "object" && n.propertyConfig) {
|
|
4872
4902
|
const i = r[n.propertyConfig];
|
|
4873
|
-
if (i &&
|
|
4903
|
+
if (i && re(i.property))
|
|
4874
4904
|
n = i.property;
|
|
4875
|
-
else if (i && (n =
|
|
4905
|
+
else if (i && (n = W(i.property, n)), !re(n) && n.dataType === "map" && n.properties) {
|
|
4876
4906
|
const l = {};
|
|
4877
4907
|
Object.keys(n.properties).forEach((o) => {
|
|
4878
|
-
l[o] =
|
|
4908
|
+
l[o] = mr(n.properties[o], r);
|
|
4879
4909
|
}), n = {
|
|
4880
4910
|
...n,
|
|
4881
4911
|
properties: l
|
|
@@ -4884,15 +4914,15 @@ function hr(t, r) {
|
|
|
4884
4914
|
}
|
|
4885
4915
|
return n;
|
|
4886
4916
|
}
|
|
4887
|
-
const
|
|
4917
|
+
const Yt = (t, r, n, i) => {
|
|
4888
4918
|
let l;
|
|
4889
|
-
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"),
|
|
4890
|
-
},
|
|
4919
|
+
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"), Vr(t).split("/").length % 2 === 0 && (l = `Collection paths must have an odd number of segments: ${t}`), l;
|
|
4920
|
+
}, on = (t, r, n, i) => {
|
|
4891
4921
|
if (!t)
|
|
4892
4922
|
return;
|
|
4893
4923
|
let l;
|
|
4894
4924
|
return r && n?.includes(t.trim().toLowerCase()) && (l = "There is already a collection that uses this value as a path"), r && i?.includes(t.trim().toLowerCase()) && (l = "There is already a collection which uses this id"), l;
|
|
4895
|
-
},
|
|
4925
|
+
}, hr = G.createContext({}), fr = G.createContext({}), ln = G.memo(
|
|
4896
4926
|
function({
|
|
4897
4927
|
children: r,
|
|
4898
4928
|
collectionConfigController: n,
|
|
@@ -4905,78 +4935,78 @@ const Gt = (t, r, n, i) => {
|
|
|
4905
4935
|
getData: m,
|
|
4906
4936
|
onAnalyticsEvent: p
|
|
4907
4937
|
}) {
|
|
4908
|
-
const s = Te(), f =
|
|
4938
|
+
const s = Te(), f = yi(), g = Ve(), { propertyConfigs: x } = Se(), [y, P] = G.useState(), [v, b] = G.useState(), T = Er(() => ({
|
|
4909
4939
|
createCollections: !0,
|
|
4910
4940
|
editCollections: !0,
|
|
4911
4941
|
deleteCollections: !0
|
|
4912
|
-
}), []), w =
|
|
4942
|
+
}), []), w = ({
|
|
4913
4943
|
id: N,
|
|
4914
4944
|
fullPath: F,
|
|
4915
|
-
parentCollectionIds:
|
|
4945
|
+
parentCollectionIds: B,
|
|
4916
4946
|
parentCollection: _
|
|
4917
4947
|
}) => {
|
|
4918
|
-
console.debug("Edit collection", N, F,
|
|
4948
|
+
console.debug("Edit collection", N, F, B, _), p?.("edit_collection", {
|
|
4919
4949
|
id: N,
|
|
4920
4950
|
fullPath: F
|
|
4921
4951
|
}), P({
|
|
4922
4952
|
editedCollectionId: N,
|
|
4923
4953
|
fullPath: F,
|
|
4924
|
-
parentCollectionIds:
|
|
4954
|
+
parentCollectionIds: B,
|
|
4925
4955
|
isNewCollection: !1,
|
|
4926
4956
|
parentCollection: _,
|
|
4927
4957
|
redirect: !1
|
|
4928
4958
|
});
|
|
4929
|
-
},
|
|
4959
|
+
}, C = ({
|
|
4930
4960
|
propertyKey: N,
|
|
4931
4961
|
property: F,
|
|
4932
|
-
editedCollectionId:
|
|
4962
|
+
editedCollectionId: B,
|
|
4933
4963
|
currentPropertiesOrder: _,
|
|
4934
|
-
parentCollectionIds:
|
|
4964
|
+
parentCollectionIds: E,
|
|
4935
4965
|
collection: h
|
|
4936
4966
|
}) => {
|
|
4937
|
-
console.debug("Edit property", N, F,
|
|
4967
|
+
console.debug("Edit property", N, F, B, _, E, h), p?.("edit_property", {
|
|
4938
4968
|
propertyKey: N,
|
|
4939
|
-
editedCollectionId:
|
|
4969
|
+
editedCollectionId: B
|
|
4940
4970
|
});
|
|
4941
|
-
const
|
|
4971
|
+
const D = N && N.includes(".") ? N.substring(0, N.lastIndexOf(".")) : void 0, ae = N && N.includes(".") ? N.substring(N.lastIndexOf(".") + 1) : N;
|
|
4942
4972
|
b({
|
|
4943
|
-
propertyKey:
|
|
4973
|
+
propertyKey: ae,
|
|
4944
4974
|
property: F,
|
|
4945
|
-
namespace:
|
|
4975
|
+
namespace: D,
|
|
4946
4976
|
currentPropertiesOrder: _,
|
|
4947
|
-
editedCollectionId:
|
|
4948
|
-
parentCollectionIds:
|
|
4977
|
+
editedCollectionId: B,
|
|
4978
|
+
parentCollectionIds: E,
|
|
4949
4979
|
collectionEditable: h?.editable ?? !1
|
|
4950
4980
|
});
|
|
4951
|
-
},
|
|
4981
|
+
}, O = ({
|
|
4952
4982
|
parentCollectionIds: N,
|
|
4953
4983
|
parentCollection: F,
|
|
4954
|
-
initialValues:
|
|
4984
|
+
initialValues: B,
|
|
4955
4985
|
redirect: _,
|
|
4956
|
-
sourceClick:
|
|
4986
|
+
sourceClick: E
|
|
4957
4987
|
}) => {
|
|
4958
4988
|
console.debug("Create collection", {
|
|
4959
4989
|
parentCollectionIds: N,
|
|
4960
4990
|
parentCollection: F,
|
|
4961
|
-
initialValues:
|
|
4991
|
+
initialValues: B,
|
|
4962
4992
|
redirect: _,
|
|
4963
|
-
sourceClick:
|
|
4993
|
+
sourceClick: E
|
|
4964
4994
|
}), p?.("create_collection", {
|
|
4965
4995
|
parentCollectionIds: N,
|
|
4966
4996
|
parentCollection: F,
|
|
4967
|
-
initialValues:
|
|
4997
|
+
initialValues: B,
|
|
4968
4998
|
redirect: _,
|
|
4969
|
-
sourceClick:
|
|
4999
|
+
sourceClick: E
|
|
4970
5000
|
}), P({
|
|
4971
5001
|
isNewCollection: !0,
|
|
4972
5002
|
parentCollectionIds: N,
|
|
4973
5003
|
parentCollection: F,
|
|
4974
|
-
initialValues:
|
|
5004
|
+
initialValues: B,
|
|
4975
5005
|
redirect: _
|
|
4976
5006
|
});
|
|
4977
|
-
}
|
|
4978
|
-
return /* @__PURE__ */ e(
|
|
4979
|
-
|
|
5007
|
+
};
|
|
5008
|
+
return /* @__PURE__ */ e(hr.Provider, { value: n, children: /* @__PURE__ */ a(
|
|
5009
|
+
fr.Provider,
|
|
4980
5010
|
{
|
|
4981
5011
|
value: {
|
|
4982
5012
|
editCollection: w,
|
|
@@ -4988,7 +5018,7 @@ const Gt = (t, r, n, i) => {
|
|
|
4988
5018
|
children: [
|
|
4989
5019
|
r,
|
|
4990
5020
|
/* @__PURE__ */ e(
|
|
4991
|
-
|
|
5021
|
+
pr,
|
|
4992
5022
|
{
|
|
4993
5023
|
open: !!y,
|
|
4994
5024
|
configController: n,
|
|
@@ -5010,7 +5040,7 @@ const Gt = (t, r, n, i) => {
|
|
|
5010
5040
|
}
|
|
5011
5041
|
),
|
|
5012
5042
|
/* @__PURE__ */ e(
|
|
5013
|
-
|
|
5043
|
+
Oe,
|
|
5014
5044
|
{
|
|
5015
5045
|
open: !!v,
|
|
5016
5046
|
includeIdAndName: !0,
|
|
@@ -5030,12 +5060,12 @@ const Gt = (t, r, n, i) => {
|
|
|
5030
5060
|
}) => {
|
|
5031
5061
|
if (!v || !N)
|
|
5032
5062
|
return;
|
|
5033
|
-
const
|
|
5063
|
+
const B = !v.propertyKey;
|
|
5034
5064
|
return n.saveProperty({
|
|
5035
5065
|
path: v?.editedCollectionId,
|
|
5036
5066
|
property: F,
|
|
5037
5067
|
propertyKey: N,
|
|
5038
|
-
newPropertiesOrder:
|
|
5068
|
+
newPropertiesOrder: B && v.currentPropertiesOrder ? [...v.currentPropertiesOrder, N] : void 0,
|
|
5039
5069
|
namespace: v.namespace,
|
|
5040
5070
|
parentCollectionIds: v.parentCollectionIds
|
|
5041
5071
|
}).catch((_) => (console.error(_), g.open({
|
|
@@ -5082,78 +5112,78 @@ const Gt = (t, r, n, i) => {
|
|
|
5082
5112
|
}
|
|
5083
5113
|
) });
|
|
5084
5114
|
},
|
|
5085
|
-
|
|
5086
|
-
),
|
|
5087
|
-
function
|
|
5115
|
+
ve
|
|
5116
|
+
), Ne = () => Jt(fr);
|
|
5117
|
+
function sn({
|
|
5088
5118
|
path: t,
|
|
5089
5119
|
parentCollectionIds: r,
|
|
5090
5120
|
collection: n,
|
|
5091
5121
|
tableController: i
|
|
5092
5122
|
}) {
|
|
5093
|
-
const l =
|
|
5123
|
+
const l = Ie(), o = Te(), d = Ne(), c = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
|
|
5094
5124
|
user: l.user,
|
|
5095
5125
|
collection: n
|
|
5096
5126
|
}).editCollections : !0;
|
|
5097
5127
|
return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(
|
|
5098
|
-
|
|
5128
|
+
ee,
|
|
5099
5129
|
{
|
|
5100
5130
|
title: u ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
5101
5131
|
children: /* @__PURE__ */ e(
|
|
5102
|
-
|
|
5132
|
+
ie,
|
|
5103
5133
|
{
|
|
5104
5134
|
color: "primary",
|
|
5105
5135
|
disabled: !u,
|
|
5106
5136
|
onClick: u ? () => d?.editCollection({ id: n.id, fullPath: t, parentCollectionIds: r, parentCollection: c }) : void 0,
|
|
5107
|
-
children: /* @__PURE__ */ e(
|
|
5137
|
+
children: /* @__PURE__ */ e($e, {})
|
|
5108
5138
|
}
|
|
5109
5139
|
)
|
|
5110
5140
|
}
|
|
5111
5141
|
) });
|
|
5112
5142
|
}
|
|
5113
|
-
const
|
|
5114
|
-
function
|
|
5143
|
+
const gr = () => Jt(hr);
|
|
5144
|
+
function dn({
|
|
5115
5145
|
path: t,
|
|
5116
5146
|
collection: r
|
|
5117
5147
|
}) {
|
|
5118
|
-
const n =
|
|
5148
|
+
const n = Ve(), i = Ie(), l = gr(), o = Ne(), d = o.configPermissions({
|
|
5119
5149
|
user: i.user,
|
|
5120
5150
|
collection: r
|
|
5121
|
-
}), c =
|
|
5151
|
+
}), c = () => {
|
|
5122
5152
|
o?.editCollection({ id: r.id, parentCollectionIds: [] });
|
|
5123
|
-
}, [
|
|
5153
|
+
}, [u, m] = j(!1), p = () => {
|
|
5124
5154
|
l?.deleteCollection({ id: r.id }).then(() => {
|
|
5125
5155
|
m(!1), n.open({
|
|
5126
5156
|
message: "Collection deleted",
|
|
5127
5157
|
type: "success"
|
|
5128
5158
|
});
|
|
5129
5159
|
});
|
|
5130
|
-
}
|
|
5160
|
+
};
|
|
5131
5161
|
return /* @__PURE__ */ a(R, { children: [
|
|
5132
5162
|
/* @__PURE__ */ a("div", { children: [
|
|
5133
5163
|
d.deleteCollections && /* @__PURE__ */ e(
|
|
5134
|
-
|
|
5164
|
+
Qr,
|
|
5135
5165
|
{
|
|
5136
|
-
trigger: /* @__PURE__ */ e(
|
|
5137
|
-
children: /* @__PURE__ */ a(
|
|
5166
|
+
trigger: /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(Xr, { size: "small" }) }),
|
|
5167
|
+
children: /* @__PURE__ */ a(ei, { onClick: (s) => {
|
|
5138
5168
|
s.preventDefault(), s.stopPropagation(), m(!0);
|
|
5139
5169
|
}, children: [
|
|
5140
|
-
/* @__PURE__ */ e(
|
|
5170
|
+
/* @__PURE__ */ e(pt, {}),
|
|
5141
5171
|
"Delete"
|
|
5142
5172
|
] })
|
|
5143
5173
|
}
|
|
5144
5174
|
),
|
|
5145
5175
|
d.editCollections && /* @__PURE__ */ e(
|
|
5146
|
-
|
|
5176
|
+
ie,
|
|
5147
5177
|
{
|
|
5148
5178
|
onClick: (s) => {
|
|
5149
5179
|
c();
|
|
5150
5180
|
},
|
|
5151
|
-
children: /* @__PURE__ */ e(
|
|
5181
|
+
children: /* @__PURE__ */ e($e, { size: "small" })
|
|
5152
5182
|
}
|
|
5153
5183
|
)
|
|
5154
5184
|
] }),
|
|
5155
5185
|
/* @__PURE__ */ e(
|
|
5156
|
-
|
|
5186
|
+
dt,
|
|
5157
5187
|
{
|
|
5158
5188
|
open: u,
|
|
5159
5189
|
onAccept: p,
|
|
@@ -5168,7 +5198,7 @@ function sn({
|
|
|
5168
5198
|
)
|
|
5169
5199
|
] });
|
|
5170
5200
|
}
|
|
5171
|
-
function
|
|
5201
|
+
function cn({
|
|
5172
5202
|
propertyKey: t,
|
|
5173
5203
|
onHover: r,
|
|
5174
5204
|
property: n,
|
|
@@ -5176,9 +5206,9 @@ function dn({
|
|
|
5176
5206
|
parentCollectionIds: l,
|
|
5177
5207
|
collection: o
|
|
5178
5208
|
}) {
|
|
5179
|
-
const d =
|
|
5180
|
-
return /* @__PURE__ */ e(
|
|
5181
|
-
|
|
5209
|
+
const d = Ne();
|
|
5210
|
+
return /* @__PURE__ */ e(ee, { title: "Edit", children: /* @__PURE__ */ e(
|
|
5211
|
+
ie,
|
|
5182
5212
|
{
|
|
5183
5213
|
className: r ? "bg-white dark:bg-gray-950" : "hidden",
|
|
5184
5214
|
onClick: () => {
|
|
@@ -5191,20 +5221,20 @@ function dn({
|
|
|
5191
5221
|
});
|
|
5192
5222
|
},
|
|
5193
5223
|
size: "small",
|
|
5194
|
-
children: /* @__PURE__ */ e(
|
|
5224
|
+
children: /* @__PURE__ */ e($e, { size: "small" })
|
|
5195
5225
|
}
|
|
5196
5226
|
) });
|
|
5197
5227
|
}
|
|
5198
|
-
function
|
|
5228
|
+
function un({
|
|
5199
5229
|
fullPath: t,
|
|
5200
5230
|
parentCollectionIds: r,
|
|
5201
5231
|
collection: n
|
|
5202
5232
|
}) {
|
|
5203
|
-
const i =
|
|
5233
|
+
const i = Ie(), l = Ne(), o = l.configPermissions ? l.configPermissions({
|
|
5204
5234
|
user: i.user,
|
|
5205
5235
|
collection: n
|
|
5206
5236
|
}).editCollections : !0;
|
|
5207
|
-
return /* @__PURE__ */ e(
|
|
5237
|
+
return /* @__PURE__ */ e(ee, { title: o ? "Add new property" : "You don't have permission to add new properties", children: /* @__PURE__ */ e(
|
|
5208
5238
|
"div",
|
|
5209
5239
|
{
|
|
5210
5240
|
className: "p-0.5 w-20 h-full flex items-center justify-center cursor-pointer bg-gray-100 bg-opacity-40 hover:bg-gray-100 dark:bg-gray-950 dark:bg-opacity-40 dark:hover:bg-gray-950",
|
|
@@ -5212,16 +5242,16 @@ function cn({
|
|
|
5212
5242
|
l.editProperty({
|
|
5213
5243
|
editedCollectionId: n.id,
|
|
5214
5244
|
parentCollectionIds: r,
|
|
5215
|
-
currentPropertiesOrder:
|
|
5245
|
+
currentPropertiesOrder: Ir(n),
|
|
5216
5246
|
collection: n
|
|
5217
5247
|
});
|
|
5218
5248
|
},
|
|
5219
|
-
children: /* @__PURE__ */ e(
|
|
5249
|
+
children: /* @__PURE__ */ e(de, { color: "inherit" })
|
|
5220
5250
|
}
|
|
5221
5251
|
) });
|
|
5222
5252
|
}
|
|
5223
|
-
function
|
|
5224
|
-
const t =
|
|
5253
|
+
function pn() {
|
|
5254
|
+
const t = Ne();
|
|
5225
5255
|
return /* @__PURE__ */ e("div", { className: "bg-gray-50 dark:bg-gray-900 min-w-fit rounded", children: /* @__PURE__ */ a(
|
|
5226
5256
|
z,
|
|
5227
5257
|
{
|
|
@@ -5233,26 +5263,26 @@ function un() {
|
|
|
5233
5263
|
sourceClick: "new_collection_button"
|
|
5234
5264
|
}),
|
|
5235
5265
|
children: [
|
|
5236
|
-
/* @__PURE__ */ e(
|
|
5266
|
+
/* @__PURE__ */ e(de, {}),
|
|
5237
5267
|
"New collection"
|
|
5238
5268
|
]
|
|
5239
5269
|
}
|
|
5240
5270
|
) });
|
|
5241
5271
|
}
|
|
5242
|
-
function
|
|
5272
|
+
function mn({
|
|
5243
5273
|
path: t,
|
|
5244
5274
|
parentCollectionIds: r,
|
|
5245
5275
|
collection: n,
|
|
5246
5276
|
tableController: i
|
|
5247
5277
|
}) {
|
|
5248
|
-
const l =
|
|
5278
|
+
const l = Ie(), o = Ne(), d = gr(), c = Ve(), u = o.configPermissions ? o.configPermissions({
|
|
5249
5279
|
user: l.user,
|
|
5250
5280
|
collection: n
|
|
5251
5281
|
}).editCollections : !0;
|
|
5252
5282
|
let m = null;
|
|
5253
|
-
return (!
|
|
5283
|
+
return (!ve(lt(i.filterValues), lt(n.initialFilter)) || !ve(lt(i.sortBy), lt(n.initialSort))) && (m = /* @__PURE__ */ a(R, { children: [
|
|
5254
5284
|
/* @__PURE__ */ e(
|
|
5255
|
-
|
|
5285
|
+
ee,
|
|
5256
5286
|
{
|
|
5257
5287
|
title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
5258
5288
|
children: /* @__PURE__ */ e(
|
|
@@ -5264,7 +5294,7 @@ function pn({
|
|
|
5264
5294
|
onClick: () => d?.saveCollection({
|
|
5265
5295
|
id: n.id,
|
|
5266
5296
|
parentCollectionIds: r,
|
|
5267
|
-
collectionData:
|
|
5297
|
+
collectionData: W(
|
|
5268
5298
|
n,
|
|
5269
5299
|
{
|
|
5270
5300
|
initialFilter: i.filterValues ?? null,
|
|
@@ -5277,13 +5307,13 @@ function pn({
|
|
|
5277
5307
|
message: "Default config saved"
|
|
5278
5308
|
});
|
|
5279
5309
|
}),
|
|
5280
|
-
children: /* @__PURE__ */ e(
|
|
5310
|
+
children: /* @__PURE__ */ e(ti, {})
|
|
5281
5311
|
}
|
|
5282
5312
|
)
|
|
5283
5313
|
}
|
|
5284
5314
|
),
|
|
5285
5315
|
(n.initialFilter || n.initialSort) && /* @__PURE__ */ e(
|
|
5286
|
-
|
|
5316
|
+
ee,
|
|
5287
5317
|
{
|
|
5288
5318
|
title: "Reset to default filter and sort",
|
|
5289
5319
|
children: /* @__PURE__ */ e(
|
|
@@ -5295,29 +5325,29 @@ function pn({
|
|
|
5295
5325
|
onClick: () => {
|
|
5296
5326
|
i.clearFilter?.(), n?.initialFilter && i.setFilterValues?.(n?.initialFilter), n?.initialSort && i.setSortBy?.(n?.initialSort);
|
|
5297
5327
|
},
|
|
5298
|
-
children: /* @__PURE__ */ e(
|
|
5328
|
+
children: /* @__PURE__ */ e(ri, {})
|
|
5299
5329
|
}
|
|
5300
5330
|
)
|
|
5301
5331
|
}
|
|
5302
5332
|
)
|
|
5303
5333
|
] })), /* @__PURE__ */ e(R, { children: u && m });
|
|
5304
5334
|
}
|
|
5305
|
-
function
|
|
5335
|
+
function lt(t) {
|
|
5306
5336
|
return t && Object.keys(t).length === 0 ? t : t ?? null;
|
|
5307
5337
|
}
|
|
5308
|
-
function
|
|
5338
|
+
function hn({
|
|
5309
5339
|
group: t,
|
|
5310
5340
|
context: r
|
|
5311
5341
|
}) {
|
|
5312
5342
|
if (!r.navigation.topLevelNavigation)
|
|
5313
5343
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
5314
|
-
const n =
|
|
5344
|
+
const n = Ie(), i = Ne(), l = i.configPermissions ? i.configPermissions({
|
|
5315
5345
|
user: n.user
|
|
5316
5346
|
}).createCollections : !0;
|
|
5317
5347
|
return /* @__PURE__ */ e(
|
|
5318
|
-
|
|
5348
|
+
tr,
|
|
5319
5349
|
{
|
|
5320
|
-
className:
|
|
5350
|
+
className: he("h-full p-4 min-h-[124px]"),
|
|
5321
5351
|
onClick: i && l ? () => i.createCollection({
|
|
5322
5352
|
initialValues: t ? { group: t } : void 0,
|
|
5323
5353
|
parentCollectionIds: [],
|
|
@@ -5329,7 +5359,7 @@ function mn({
|
|
|
5329
5359
|
{
|
|
5330
5360
|
className: "flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",
|
|
5331
5361
|
children: [
|
|
5332
|
-
/* @__PURE__ */ e(
|
|
5362
|
+
/* @__PURE__ */ e(de, { color: "primary", size: "large" }),
|
|
5333
5363
|
/* @__PURE__ */ e(
|
|
5334
5364
|
V,
|
|
5335
5365
|
{
|
|
@@ -5346,7 +5376,7 @@ function mn({
|
|
|
5346
5376
|
}
|
|
5347
5377
|
);
|
|
5348
5378
|
}
|
|
5349
|
-
function
|
|
5379
|
+
function In({
|
|
5350
5380
|
collectionConfigController: t,
|
|
5351
5381
|
configPermissions: r,
|
|
5352
5382
|
reservedGroups: n,
|
|
@@ -5361,7 +5391,7 @@ function Vn({
|
|
|
5361
5391
|
key: "collection_editor",
|
|
5362
5392
|
loading: t.loading,
|
|
5363
5393
|
provider: {
|
|
5364
|
-
Component:
|
|
5394
|
+
Component: ln,
|
|
5365
5395
|
props: {
|
|
5366
5396
|
collectionConfigController: t,
|
|
5367
5397
|
configPermissions: r,
|
|
@@ -5375,29 +5405,29 @@ function Vn({
|
|
|
5375
5405
|
}
|
|
5376
5406
|
},
|
|
5377
5407
|
homePage: {
|
|
5378
|
-
additionalActions: /* @__PURE__ */ e(
|
|
5379
|
-
additionalChildrenStart: /* @__PURE__ */ e(
|
|
5408
|
+
additionalActions: /* @__PURE__ */ e(pn, {}),
|
|
5409
|
+
additionalChildrenStart: /* @__PURE__ */ e(fn, {}),
|
|
5380
5410
|
// additionalChildrenEnd: <RootCollectionSuggestions introMode={introMode}/>,
|
|
5381
|
-
CollectionActions:
|
|
5382
|
-
AdditionalCards:
|
|
5411
|
+
CollectionActions: dn,
|
|
5412
|
+
AdditionalCards: hn
|
|
5383
5413
|
},
|
|
5384
5414
|
collectionView: {
|
|
5385
|
-
CollectionActionsStart:
|
|
5386
|
-
CollectionActions:
|
|
5387
|
-
HeaderAction:
|
|
5388
|
-
AddColumnComponent:
|
|
5415
|
+
CollectionActionsStart: mn,
|
|
5416
|
+
CollectionActions: sn,
|
|
5417
|
+
HeaderAction: cn,
|
|
5418
|
+
AddColumnComponent: un
|
|
5389
5419
|
}
|
|
5390
5420
|
};
|
|
5391
5421
|
}
|
|
5392
|
-
function
|
|
5422
|
+
function fn({}) {
|
|
5393
5423
|
const t = Te();
|
|
5394
5424
|
if (!t.topLevelNavigation)
|
|
5395
5425
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
5396
|
-
const r =
|
|
5426
|
+
const r = Ie(), n = Ne(), i = n.configPermissions ? n.configPermissions({
|
|
5397
5427
|
user: r.user
|
|
5398
5428
|
}).createCollections : !0;
|
|
5399
5429
|
return !t.initialised || t.collections === void 0 || (t.collections ?? []).length > 0 ? null : /* @__PURE__ */ a(
|
|
5400
|
-
|
|
5430
|
+
fe,
|
|
5401
5431
|
{
|
|
5402
5432
|
className: "my-4 px-4 py-6 flex flex-col bg-white dark:bg-slate-800 gap-2",
|
|
5403
5433
|
children: [
|
|
@@ -5412,7 +5442,7 @@ function hn({}) {
|
|
|
5412
5442
|
sourceClick: "new_collection_card"
|
|
5413
5443
|
}) : void 0,
|
|
5414
5444
|
children: [
|
|
5415
|
-
/* @__PURE__ */ e(
|
|
5445
|
+
/* @__PURE__ */ e(de, {}),
|
|
5416
5446
|
"Create your first collection"
|
|
5417
5447
|
]
|
|
5418
5448
|
}
|
|
@@ -5422,18 +5452,18 @@ function hn({}) {
|
|
|
5422
5452
|
}
|
|
5423
5453
|
);
|
|
5424
5454
|
}
|
|
5425
|
-
const
|
|
5455
|
+
const _n = (t, r, n) => {
|
|
5426
5456
|
const i = (d) => {
|
|
5427
|
-
|
|
5457
|
+
Le(d.properties), d.subcollections?.forEach(i);
|
|
5428
5458
|
}, l = r ?? [];
|
|
5429
5459
|
l.forEach(i), console.debug("Collections specified in code:", t), console.debug("Collections stored in the backend", l);
|
|
5430
|
-
const o =
|
|
5460
|
+
const o = _r(t, l, [], n);
|
|
5431
5461
|
return console.debug("Collections after joining:", o), o;
|
|
5432
5462
|
};
|
|
5433
|
-
function
|
|
5434
|
-
const r = Te(), n =
|
|
5463
|
+
function Fn({ path: t }) {
|
|
5464
|
+
const r = Te(), n = gn(t), i = r.getParentCollectionIds(t), l = Ne();
|
|
5435
5465
|
return /* @__PURE__ */ a("div", { className: "p-1 flex flex-col items-center", children: [
|
|
5436
|
-
/* @__PURE__ */ e(
|
|
5466
|
+
/* @__PURE__ */ e(Kt, { error: "No collection for path: " + n }),
|
|
5437
5467
|
/* @__PURE__ */ e(
|
|
5438
5468
|
z,
|
|
5439
5469
|
{
|
|
@@ -5442,7 +5472,7 @@ function _n({ path: t }) {
|
|
|
5442
5472
|
size: "small",
|
|
5443
5473
|
onClick: () => {
|
|
5444
5474
|
l.createCollection({
|
|
5445
|
-
initialValues: { path: n, name:
|
|
5475
|
+
initialValues: { path: n, name: xt(n) },
|
|
5446
5476
|
parentCollectionIds: i,
|
|
5447
5477
|
redirect: !1,
|
|
5448
5478
|
sourceClick: "missing_reference"
|
|
@@ -5453,22 +5483,22 @@ function _n({ path: t }) {
|
|
|
5453
5483
|
)
|
|
5454
5484
|
] });
|
|
5455
5485
|
}
|
|
5456
|
-
function
|
|
5486
|
+
function gn(t) {
|
|
5457
5487
|
const r = t.split("/");
|
|
5458
5488
|
return r[r.length - 1];
|
|
5459
5489
|
}
|
|
5460
5490
|
export {
|
|
5461
|
-
|
|
5462
|
-
|
|
5491
|
+
Fn as MissingReferenceWidget,
|
|
5492
|
+
Ue as editableProperty,
|
|
5463
5493
|
ne as getFullId,
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5494
|
+
nr as getFullIdPath,
|
|
5495
|
+
me as idToPropertiesPath,
|
|
5496
|
+
_n as mergeCollections,
|
|
5497
|
+
ye as namespaceToPropertiesOrderPath,
|
|
5498
|
+
ir as namespaceToPropertiesPath,
|
|
5499
|
+
Ti as removeNonEditableProperties,
|
|
5500
|
+
Ne as useCollectionEditorController,
|
|
5501
|
+
In as useCollectionEditorPlugin,
|
|
5502
|
+
gr as useCollectionsConfigController
|
|
5473
5503
|
};
|
|
5474
5504
|
//# sourceMappingURL=index.es.js.map
|